Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,82 @@ pre code,
box-shadow: 0 0 6px color-mix(in oklch, var(--key-dot) 70%, transparent);
}
.chip-gloss.chip-muted { --chip: var(--muted-foreground); }
/* ── Keycap button ────────────────────────────────────────────────────────────
The Pro chip's dark key, at button size: the same lifted fill, hairline
ring, sheen on top and shade at the foot. A press sinks the cap 1px and
flattens its drop, the way a key goes down. Built from --foreground and
--background, so it reads as a key in every theme. */
.keycap-btn {
color: var(--foreground);
background: linear-gradient(
to bottom,
color-mix(in oklch, var(--foreground) 14%, var(--background)),
color-mix(in oklch, var(--foreground) 6%, var(--background))
);
box-shadow:
inset 0 0 0 1px color-mix(in oklch, var(--foreground) 22%, transparent),
inset 0 1px 0 color-mix(in oklch, white 18%, transparent),
inset 0 -2px 0 rgb(0 0 0 / 0.22),
0 1px 2px rgb(0 0 0 / 0.3);
transition: transform 100ms cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 100ms cubic-bezier(0.165, 0.84, 0.44, 1), background 150ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
.keycap-btn:not(:disabled):hover {
background: linear-gradient(
to bottom,
color-mix(in oklch, var(--foreground) 18%, var(--background)),
color-mix(in oklch, var(--foreground) 9%, var(--background))
);
}
}
.keycap-btn:not(:disabled):active {
transform: translateY(1px);
box-shadow:
inset 0 0 0 1px color-mix(in oklch, var(--foreground) 22%, transparent),
inset 0 1px 0 color-mix(in oklch, white 10%, transparent),
inset 0 -1px 0 rgb(0 0 0 / 0.18);
}
.keycap-btn:focus-visible {
outline: 2px solid var(--ring);
outline-offset: 2px;
}
.keycap-btn:disabled { color: var(--muted-foreground); opacity: 0.6; }
/* Light themes: a white key on a pale page, with a lighter shade at its foot. */
html:not(.dark) .keycap-btn {
background: linear-gradient(to bottom, var(--background), color-mix(in oklch, var(--foreground) 5%, var(--background)));
box-shadow:
inset 0 0 0 1px color-mix(in oklch, var(--foreground) 16%, transparent),
inset 0 -2px 0 rgb(0 0 0 / 0.06),
0 1px 2px rgb(0 0 0 / 0.08);
}
@media (hover: hover) and (pointer: fine) {
html:not(.dark) .keycap-btn:not(:disabled):hover {
background: linear-gradient(to bottom, var(--background), color-mix(in oklch, var(--foreground) 8%, var(--background)));
}
}
html:not(.dark) .keycap-btn:not(:disabled):active {
box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--foreground) 16%, transparent), inset 0 1px 1px rgb(0 0 0 / 0.06);
}
html:not(.dark) .key-well { box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.06), inset 0 0 0 1px color-mix(in oklch, var(--foreground) 12%, transparent); }
html:not(.dark) .key-well:focus-within { box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.06), 0 0 0 2px var(--ring); }
@media (prefers-reduced-motion: reduce) {
.keycap-btn { transition: background 150ms ease-out; }
.keycap-btn:not(:disabled):active { transform: none; }
}
/* A field drawn as a well: a step darker than its surface, no border, a
faint inner shade. Focus deepens it and adds the ring. */
.key-well {
background: color-mix(in oklch, var(--foreground) 4%, var(--background));
box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.25), inset 0 0 0 1px color-mix(in oklch, var(--foreground) 8%, transparent);
transition: box-shadow 150ms ease-out, background 150ms ease-out;
}
.key-well:focus-within {
background: color-mix(in oklch, var(--foreground) 2%, var(--background));
box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.25), 0 0 0 2px var(--ring);
}
.key-well[data-invalid] {
box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.25), inset 0 0 0 1px var(--destructive);
}
.chip-gloss.chip-primary { --chip: var(--primary); }
.mark-grain::after {
opacity: 0.32;
Expand Down
44 changes: 24 additions & 20 deletions src/lib/components/LicenseActivation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import { activateLicense } from '$lib/stores/license.js'
import Icon from './Icon.svelte'
import { cn } from '$lib/utils.js'
import { Input } from '$lib/components/ui/input/index.js'
import { Button } from '$lib/components/ui/button/index.js'

let {
/** Fired once the celebration is over - the caller moves on from here. */
Expand Down Expand Up @@ -127,12 +125,12 @@
</script>

{#snippet keyField(extraClass)}
<!-- The app's own field and button (ui/input, ui/button): h-9, the field
radius, the 1px field hairline and the one focus outline. This screen
used to hand-roll h-11 slabs with 2px borders that matched nothing else. -->
<div class={cn('relative', extraClass)}>
<Icon name="key-round" class="pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" />
<Input
<!-- The field is a well a step below the page; the button above it is a
key. Typed keys are mono so each group lines up; the placeholder is
plain words, since a row of Xs never fit the width and got cut off. -->
<label class={cn('key-well flex h-10 items-center gap-2 rounded-md px-3', extraClass)} data-invalid={error ? '' : undefined}>
<Icon name="key-round" class="size-4 shrink-0 text-muted-foreground" />
<input
type="text"
bind:value={key}
onkeydown={handleKeydown}
Expand All @@ -141,24 +139,29 @@
aria-label="License key"
aria-invalid={error ? 'true' : undefined}
aria-describedby={error ? 'license-key-error' : undefined}
placeholder="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
placeholder="Paste your license key"
spellcheck="false"
autocomplete="off"
readonly={loading}
disabled={success}
class="bg-muted/20 pl-8 font-mono tracking-wide placeholder:text-muted-foreground/45"
class="no-field-frame h-full min-w-0 flex-1 bg-transparent text-ui-sm text-foreground outline-none placeholder:font-sans placeholder:tracking-normal placeholder:text-muted-foreground/70 {key ? 'font-mono tracking-wide' : ''}"
/>
</div>
</label>
{/snippet}

{#snippet submitBtn(fullWidth, label)}
<Button
size="lg"
variant={success ? 'outline' : 'default'}
<button
type="button"
disabled={!key.trim() && !success}
aria-busy={loading || undefined}
aria-keyshortcuts="Enter"
onclick={() => void submit()}
class={cn(fullWidth && 'w-full', (loading || success) && 'pointer-events-none', success && 'text-success')}
class={cn(
'keycap-btn inline-flex h-10 shrink-0 items-center justify-center gap-2 rounded-md px-4 text-ui-sm font-medium',
fullWidth && 'w-full',
(loading || success) && 'pointer-events-none',
success && 'text-success',
)}
>
{#if loading && verifyingVisible}
<Icon name="loader-2" class="size-3.5 shrink-0 animate-spin" />
Expand All @@ -168,11 +171,12 @@
License activated
{:else}
{label}
<span aria-hidden="true" class="chip-gloss chip-muted h-5 px-1.5 text-ui-3xs font-semibold">↵</span>
{/if}
</Button>
</button>
{/snippet}

<div class="flex flex-col gap-2 {naked || inline ? '' : compact ? 'p-5' : 'p-6'}">
<div class="flex flex-col gap-3 {naked || inline ? '' : compact ? 'p-5' : 'p-6'}">
{#if !compact && !naked && !inline}
<div class="flex flex-col gap-0.5">
<p class="text-ui-sm font-semibold text-foreground">Enter your license key</p>
Expand All @@ -194,11 +198,11 @@
field already turns red (aria-invalid); a red panel on top of that was
the same signal three times. The line is always in the tree and opens
and closes on its grid row, so the button below glides rather than
jumping, and `-mt-2` cancels the column gap while it is closed. -->
jumping, and `-mt-3` cancels the column gap while it is closed. -->
<div
class={cn(
'grid transition-[grid-template-rows,opacity,margin] duration-200 ease-out motion-reduce:transition-none',
error ? 'grid-rows-[1fr] opacity-100' : '-mt-2 grid-rows-[0fr] opacity-0',
error ? 'grid-rows-[1fr] opacity-100' : '-mt-3 grid-rows-[0fr] opacity-0',
)}
>
<div class="min-h-0 overflow-hidden">
Expand All @@ -210,7 +214,7 @@
</div>

{#if !inline}
{@render submitBtn(true, 'Activate License')}
{@render submitBtn(true, 'Activate')}
{/if}
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/SignInScreen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
{:else}
{#if $isReturningUser}
<h1 class="text-ui-2xl font-medium tracking-tight text-foreground text-balance">Sign in to continue</h1>
<p class="mt-2 text-ui-sm text-muted-foreground text-pretty">Your connections and settings stay on this Mac.</p>
<p class="mt-2 text-ui-sm text-muted-foreground text-pretty">Your connections and settings stay on this computer.</p>
{:else}
<h1 class="text-ui-2xl font-medium tracking-tight text-foreground text-balance">Welcome to Stroke</h1>
<p class="mt-2 text-ui-sm text-muted-foreground text-pretty">Sign in to start your free trial.</p>
Expand Down
Loading