@zeyolabs/ui 2026.11.5 → 2026.1106.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,18 +25,19 @@ The app must enable async Svelte and remote functions in its `vite.config.ts`
25
25
 
26
26
  ## Showcase
27
27
 
28
- `showcase/` is a SvelteKit app rendering every component live (ui.pureleaves.co.uk).
28
+ `showcase/` is a SvelteKit app rendering every component live (ui.zeyo.dev).
29
29
  `pnpm showcase:dev`, `pnpm showcase:build`. It deploys on push to main
30
- (`deploy-showcase.yaml`, needs the `CLOUDFLARE_API_TOKEN` repo secret).
30
+ (`deploy-showcase.yaml`, with `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` from the `production` environment, which only `main` can use).
31
31
 
32
32
  ## Versions
33
33
 
34
- Date versions: `YYYY.M.D` (the release day in London; semver forbids leading zeros, so
35
- `2026.11.5`). One release per day. Publishing uses npm trusted publishing (no stored token).
34
+ Date versions: `YYYY.MMDD.N`: the release day in London as month × 100 + day (semver forbids
35
+ leading zeros, so 6 November is `1106` and 5 January `105`), then that day's release count from 0:
36
+ `2026.1106.0`, `2026.1106.1`, `2026.1107.0`. Earlier releases used `YYYY.M.D` (`2026.11.6`). Publishing uses npm trusted publishing (no stored token).
36
37
 
37
38
  ```
38
- pnpm release # sets the version, commits, tags vYYYY.M.D
39
- git push origin HEAD vYYYY.M.D # the tag publishes to npm (publish.yaml)
39
+ pnpm release # sets the version, commits, tags vYYYY.MMDD.N
40
+ git push origin HEAD vYYYY.MMDD.N # the tag publishes to npm (publish.yaml)
40
41
  ```
41
42
 
42
43
  ## Checks
@@ -0,0 +1,199 @@
1
+ <script lang="ts">
2
+ import Trash2 from '@lucide/svelte/icons/trash-2';
3
+ import UserPlus from '@lucide/svelte/icons/user-plus';
4
+ import {
5
+ getAccountMembers,
6
+ inviteMemberForm,
7
+ removeMemberCmd,
8
+ revokeInviteCmd,
9
+ setMemberPolicyCmd,
10
+ } from '@zeyolabs/kit/auth/accounts/accounts.remote';
11
+ import { AccountSchemas } from '@zeyolabs/kit/auth/accounts/schemas';
12
+ import { toast } from 'svelte-sonner';
13
+
14
+ import Badge from '../badge/Badge.svelte';
15
+ import Boundary from '../boundary/Boundary.svelte';
16
+ import Card from '../card/Card.svelte';
17
+ import Button from '../form/Button.svelte';
18
+ import { EmailField, SelectField } from '../form/fields/index';
19
+ import Form from '../form/Form.svelte';
20
+ import Select from '../form/primitives/Select.svelte';
21
+ import SkeletonText from '../skeleton/SkeletonText.svelte';
22
+
23
+ /**
24
+ * Members of the request's account (`@zeyolabs/kit/auth`): who is in it, with which policy,
25
+ * pending invites, and an invite form. Controls appear only when the caller's policy allows
26
+ * them; the server checks again on every change.
27
+ */
28
+ let { title = 'Members' }: { title?: string } = $props();
29
+
30
+ type PolicyOption = { key: string; name: string };
31
+
32
+ const day = new Intl.DateTimeFormat('en-GB', { dateStyle: 'medium' });
33
+
34
+ async function run(work: () => Promise<unknown>, done?: string) {
35
+ try {
36
+ await work();
37
+ if (done) toast.success(done);
38
+ } catch (err) {
39
+ toast.error(err instanceof Error ? err.message : 'Something went wrong');
40
+ }
41
+ }
42
+ </script>
43
+
44
+ <Boundary message="Could not load the members.">
45
+ {const data = $derived(await getAccountMembers())}
46
+ {const assignable = $derived(
47
+ data.policies.filter((p) => p.key !== 'owner' || data.me.policy === 'owner') as PolicyOption[]
48
+ )}
49
+ {const policyName = (key: string) => data.policies.find((p) => p.key === key)?.name ?? key}
50
+
51
+ <Card gap="sm" padding="md">
52
+ <h2 class="account-title">{title}</h2>
53
+ <ul class="account-list">
54
+ {#each data.members as member (member.userId)}
55
+ <li>
56
+ <div class="who">
57
+ <span class="name">{member.name}</span>
58
+ <span class="sub">{member.email}</span>
59
+ </div>
60
+ {#if data.can.manage && member.userId !== data.me.userId && (member.policy !== 'owner' || data.me.policy === 'owner')}
61
+ <Select
62
+ class="policy"
63
+ getKey={(p: PolicyOption) => p.key}
64
+ getLabel={(p: PolicyOption) => p.name}
65
+ getValue={(p: PolicyOption) => p.key}
66
+ items={assignable}
67
+ onchange={(policy) =>
68
+ policy &&
69
+ policy !== member.policy &&
70
+ run(() => setMemberPolicyCmd({ policy, userId: member.userId }), 'Policy changed')}
71
+ placeholder="Policy"
72
+ value={member.policy}
73
+ />
74
+ <Button
75
+ aria-label="Remove {member.email}"
76
+ icon
77
+ onclick={() =>
78
+ run(() => removeMemberCmd({ userId: member.userId }), `Removed ${member.email}`)}
79
+ size="sm"
80
+ variant="ghost-destructive"
81
+ >
82
+ <Trash2 size={13} />
83
+ </Button>
84
+ {:else}
85
+ <Badge color={member.policy === 'owner' ? 'purple' : 'secondary'}>
86
+ {policyName(member.policy)}
87
+ </Badge>
88
+ {/if}
89
+ </li>
90
+ {/each}
91
+ </ul>
92
+
93
+ {#if data.invites.length}
94
+ <h3 class="account-subtitle">Pending invitations</h3>
95
+ <ul class="account-list">
96
+ {#each data.invites as invite (invite.email)}
97
+ <li>
98
+ <div class="who">
99
+ <span class="name">{invite.email}</span>
100
+ <span class="sub">
101
+ {policyName(invite.policy)}, expires {day.format(invite.expiresAt)}
102
+ </span>
103
+ </div>
104
+ {#if data.can.invite}
105
+ <Button
106
+ onclick={() =>
107
+ run(() => revokeInviteCmd({ email: invite.email }), 'Invitation revoked')}
108
+ size="sm"
109
+ variant="ghost"
110
+ >
111
+ Revoke
112
+ </Button>
113
+ {/if}
114
+ </li>
115
+ {/each}
116
+ </ul>
117
+ {/if}
118
+
119
+ {#if data.can.invite}
120
+ <Form class="account-invite" form={inviteMemberForm} schema={AccountSchemas.Invite}>
121
+ <EmailField name="email" form={inviteMemberForm} placeholder="name@example.com">
122
+ Invite by email
123
+ </EmailField>
124
+ <SelectField
125
+ name="policy"
126
+ form={inviteMemberForm}
127
+ getKey={(p: PolicyOption) => p.key}
128
+ getLabel={(p: PolicyOption) => p.name}
129
+ getValue={(p: PolicyOption) => p.key}
130
+ items={assignable}
131
+ label="Policy"
132
+ placeholder="Choose a policy"
133
+ />
134
+ <Button form={inviteMemberForm}><UserPlus size={14} /> Invite</Button>
135
+ </Form>
136
+ {/if}
137
+ </Card>
138
+
139
+ {#snippet pending()}
140
+ <SkeletonText lines={5} />
141
+ {/snippet}
142
+ </Boundary>
143
+
144
+ <style>
145
+ .account-title {
146
+ margin: 0;
147
+ font-size: var(--text-base);
148
+ font-weight: 600;
149
+ }
150
+ .account-subtitle {
151
+ margin: 4px 0 0;
152
+ font-size: 12px;
153
+ font-weight: 600;
154
+ color: var(--txs);
155
+ }
156
+ .account-list {
157
+ display: flex;
158
+ flex-direction: column;
159
+ margin: 0;
160
+ padding: 0;
161
+ list-style: none;
162
+ }
163
+ .account-list li {
164
+ display: flex;
165
+ align-items: center;
166
+ gap: 8px;
167
+ padding: 8px 0;
168
+ border-top: 1px solid var(--bds);
169
+ }
170
+ .who {
171
+ display: flex;
172
+ flex: 1;
173
+ flex-direction: column;
174
+ min-width: 0;
175
+ }
176
+ .name {
177
+ font-weight: 500;
178
+ }
179
+ .sub {
180
+ color: var(--txt);
181
+ font-size: 12px;
182
+ }
183
+ .account-list :global(.policy) {
184
+ width: 160px;
185
+ }
186
+ :global(form.account-invite) {
187
+ display: grid;
188
+ grid-template-columns: 2fr 1fr auto;
189
+ gap: 8px;
190
+ align-items: end;
191
+ padding-top: 8px;
192
+ border-top: 1px solid var(--bds);
193
+ }
194
+ @media (max-width: 640px) {
195
+ :global(form.account-invite) {
196
+ grid-template-columns: 1fr;
197
+ }
198
+ }
199
+ </style>
@@ -0,0 +1,201 @@
1
+ <script lang="ts">
2
+ import Plus from '@lucide/svelte/icons/plus';
3
+ import {
4
+ deletePolicyCmd,
5
+ getAccountMembers,
6
+ savePolicyCmd,
7
+ } from '@zeyolabs/kit/auth/accounts/accounts.remote';
8
+ import { toast } from 'svelte-sonner';
9
+
10
+ import Badge from '../badge/Badge.svelte';
11
+ import Boundary from '../boundary/Boundary.svelte';
12
+ import Card from '../card/Card.svelte';
13
+ import Button from '../form/Button.svelte';
14
+ import Checkbox from '../form/primitives/Checkbox.svelte';
15
+ import Input from '../form/primitives/Input.svelte';
16
+ import SkeletonText from '../skeleton/SkeletonText.svelte';
17
+
18
+ /**
19
+ * The account's policies (`@zeyolabs/kit/auth`): the built-in ones, read-only, and the
20
+ * account's own, which owners can create, edit and delete from the app's permission keys.
21
+ */
22
+ let { title = 'Policies' }: { title?: string } = $props();
23
+
24
+ type Draft = { isNew: boolean; key: string; name: string; permissions: string[] };
25
+
26
+ let draft = $state<Draft | null>(null);
27
+ let saving = $state(false);
28
+
29
+ function edit(policy?: { key: string; name: string; permissions: readonly string[] }) {
30
+ draft = policy
31
+ ? { isNew: false, key: policy.key, name: policy.name, permissions: [...policy.permissions] }
32
+ : { isNew: true, key: '', name: '', permissions: [] };
33
+ }
34
+
35
+ function toggle(permission: string, on: boolean) {
36
+ if (!draft) return;
37
+ draft.permissions = on
38
+ ? [...draft.permissions, permission]
39
+ : draft.permissions.filter((p) => p !== permission);
40
+ }
41
+
42
+ async function save() {
43
+ if (!draft) return;
44
+ saving = true;
45
+ try {
46
+ const { key, name, permissions } = draft;
47
+ await savePolicyCmd({ key: key.trim(), name, permissions });
48
+ toast.success(`Saved ${name}`);
49
+ draft = null;
50
+ } catch (err) {
51
+ toast.error(err instanceof Error ? err.message : 'Could not save the policy');
52
+ } finally {
53
+ saving = false;
54
+ }
55
+ }
56
+
57
+ async function remove(key: string) {
58
+ try {
59
+ await deletePolicyCmd({ key });
60
+ toast.success('Policy deleted');
61
+ } catch (err) {
62
+ toast.error(err instanceof Error ? err.message : 'Could not delete the policy');
63
+ }
64
+ }
65
+ </script>
66
+
67
+ <Boundary message="Could not load the policies.">
68
+ {const data = $derived(await getAccountMembers())}
69
+
70
+ <Card gap="sm" padding="md">
71
+ <div class="head">
72
+ <h2 class="policies-title">{title}</h2>
73
+ {#if data.can.managePolicies && !draft}
74
+ <Button onclick={() => edit()} size="sm" variant="secondary">
75
+ <Plus size={13} /> New policy
76
+ </Button>
77
+ {/if}
78
+ </div>
79
+
80
+ <ul class="policies">
81
+ {#each data.policies as policy (policy.key)}
82
+ <li>
83
+ <div class="what">
84
+ <span class="name">{policy.name}</span>
85
+ <span class="sub">
86
+ {policy.permissions.includes('*')
87
+ ? 'Everything'
88
+ : policy.permissions.join(', ') || 'Nothing'}
89
+ </span>
90
+ </div>
91
+ {#if policy.builtIn}
92
+ <Badge dot={false}>Built in</Badge>
93
+ {:else if data.can.managePolicies}
94
+ <Button onclick={() => edit(policy)} size="sm" variant="ghost">Edit</Button>
95
+ <Button onclick={() => remove(policy.key)} size="sm" variant="ghost-destructive">
96
+ Delete
97
+ </Button>
98
+ {/if}
99
+ </li>
100
+ {/each}
101
+ </ul>
102
+
103
+ {#if draft}
104
+ <div class="editor">
105
+ <div class="row">
106
+ <Input
107
+ aria-label="Policy name"
108
+ placeholder="Name, e.g. Support"
109
+ bind:value={draft.name}
110
+ />
111
+ <Input
112
+ aria-label="Policy key"
113
+ disabled={!draft.isNew}
114
+ placeholder="key, e.g. support"
115
+ bind:value={draft.key}
116
+ />
117
+ </div>
118
+ <div class="grants">
119
+ {#each data.permissions as permission (permission)}
120
+ <Checkbox
121
+ checked={draft.permissions.includes(permission)}
122
+ onCheckedChange={(on) => toggle(permission, on)}
123
+ >
124
+ {permission}
125
+ </Checkbox>
126
+ {/each}
127
+ </div>
128
+ <div class="row">
129
+ <Button
130
+ disabled={saving || !draft.name.trim() || !draft.key.trim()}
131
+ onclick={save}
132
+ size="sm"
133
+ >
134
+ {saving ? 'Saving…' : 'Save policy'}
135
+ </Button>
136
+ <Button onclick={() => (draft = null)} size="sm" variant="ghost">Cancel</Button>
137
+ </div>
138
+ </div>
139
+ {/if}
140
+ </Card>
141
+
142
+ {#snippet pending()}
143
+ <SkeletonText lines={4} />
144
+ {/snippet}
145
+ </Boundary>
146
+
147
+ <style>
148
+ .head {
149
+ display: flex;
150
+ align-items: center;
151
+ justify-content: space-between;
152
+ }
153
+ .policies-title {
154
+ margin: 0;
155
+ font-size: var(--text-base);
156
+ font-weight: 600;
157
+ }
158
+ .policies {
159
+ display: flex;
160
+ flex-direction: column;
161
+ margin: 0;
162
+ padding: 0;
163
+ list-style: none;
164
+ }
165
+ .policies li {
166
+ display: flex;
167
+ align-items: center;
168
+ gap: 8px;
169
+ padding: 8px 0;
170
+ border-top: 1px solid var(--bds);
171
+ }
172
+ .what {
173
+ display: flex;
174
+ flex: 1;
175
+ flex-direction: column;
176
+ min-width: 0;
177
+ }
178
+ .name {
179
+ font-weight: 500;
180
+ }
181
+ .sub {
182
+ color: var(--txt);
183
+ font-size: 12px;
184
+ }
185
+ .editor {
186
+ display: flex;
187
+ flex-direction: column;
188
+ gap: 10px;
189
+ padding-top: 8px;
190
+ border-top: 1px solid var(--bds);
191
+ }
192
+ .row {
193
+ display: flex;
194
+ gap: 8px;
195
+ }
196
+ .grants {
197
+ display: grid;
198
+ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
199
+ gap: 6px;
200
+ }
201
+ </style>
@@ -87,7 +87,7 @@ type LocalOpts<T> = {
87
87
  };
88
88
 
89
89
  /**
90
- * Text-like standalone view (text/number/date/time/email/password/etc.).
90
+ * Text-like standalone view (text/number/date/time/email/etc.).
91
91
  * Builds its own `oninput`/`onchange` since `as()` does not provide them.
92
92
  */
93
93
  export function createLocalTextView<T>(opts: LocalOpts<T>): FieldView {
@@ -10,7 +10,6 @@ export { default as IntervalField } from './IntervalField.svelte';
10
10
  export { default as MessageField } from './MessageField.svelte';
11
11
  export { default as NumberField } from './NumberField.svelte';
12
12
  export { default as Option } from './Option.svelte';
13
- export { default as PasswordField } from './PasswordField.svelte';
14
13
  export { default as RadioField } from './RadioField.svelte';
15
14
  export { default as SelectField } from './SelectField.svelte';
16
15
  export { default as SliderField } from './SliderField.svelte';
package/form/index.ts CHANGED
@@ -11,7 +11,6 @@ export { default as HexColorField } from './fields/HexColorField.svelte';
11
11
  export { default as MessageField } from './fields/MessageField.svelte';
12
12
  export { default as NumberField } from './fields/NumberField.svelte';
13
13
  export { default as Option } from './fields/Option.svelte';
14
- export { default as PasswordField } from './fields/PasswordField.svelte';
15
14
  export { default as SelectField } from './fields/SelectField.svelte';
16
15
  export { default as SliderField } from './fields/SliderField.svelte';
17
16
  export { default as SwitchField } from './fields/SwitchField.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeyolabs/ui",
3
- "version": "2026.11.5",
3
+ "version": "2026.1106.0",
4
4
  "description": "Shared Svelte 5 components, form fields and design tokens for SvelteKit 3 apps.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -28,6 +28,7 @@
28
28
  "release": "node scripts/release.mjs"
29
29
  },
30
30
  "files": [
31
+ "account",
31
32
  "back-button",
32
33
  "badge",
33
34
  "bar",
@@ -56,6 +57,7 @@
56
57
  "popover",
57
58
  "query-state",
58
59
  "schema.ts",
60
+ "sidebar",
59
61
  "skeleton",
60
62
  "spacing.css",
61
63
  "stat",
@@ -84,6 +86,7 @@
84
86
  "./percentage-ring/*": "./percentage-ring/*",
85
87
  "./status-row/types": "./status-row/types.ts",
86
88
  "./status-row/*": "./status-row/*",
89
+ "./account/*": "./account/*",
87
90
  "./boundary/pending-context": "./boundary/pending-context.ts",
88
91
  "./boundary/pending-flag": "./boundary/pending-flag.svelte.ts",
89
92
  "./boundary/*": "./boundary/*",
@@ -97,6 +100,7 @@
97
100
  "./form/*": "./form/*",
98
101
  "./menu/*": "./menu/*",
99
102
  "./popover/*": "./popover/*",
103
+ "./sidebar/*": "./sidebar/*",
100
104
  "./skeleton/*": "./skeleton/*",
101
105
  "./error/*": "./error/*",
102
106
  "./card/*": "./card/*",
@@ -128,7 +132,7 @@
128
132
  "./theme/*": "./theme/*"
129
133
  },
130
134
  "peerDependencies": {
131
- "@zeyolabs/kit": ">=2026.11.5",
135
+ "@zeyolabs/kit": ">=2026.11.6",
132
136
  "@sveltejs/kit": "^3.1.1",
133
137
  "svelte": "^5.57.3"
134
138
  },
@@ -149,7 +153,7 @@
149
153
  "devDependencies": {
150
154
  "@eslint/compat": "2.1.1",
151
155
  "@eslint/js": "9.39.4",
152
- "@zeyolabs/kit": "2026.11.5",
156
+ "@zeyolabs/kit": "2026.11.6",
153
157
  "@sveltejs/kit": "3.1.1",
154
158
  "@types/flickity": "2.2.12",
155
159
  "eslint": "9.39.4",
@@ -0,0 +1,73 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ /** App sidebar column: brand on top, fixed primary links, a scrolling body of groups, and a
5
+ * footer row (user, theme toggle, sign out). Fills its parent's height; pair with SplitShell. */
6
+ let {
7
+ brand,
8
+ children,
9
+ foot,
10
+ label = 'Main',
11
+ links,
12
+ }: {
13
+ brand?: Snippet;
14
+ children?: Snippet;
15
+ foot?: Snippet;
16
+ label?: string;
17
+ links?: Snippet;
18
+ } = $props();
19
+ </script>
20
+
21
+ <nav class="sidebar" aria-label={label}>
22
+ {@render brand?.()}
23
+
24
+ {#if links}
25
+ <ul class="sidebar-links">{@render links()}</ul>
26
+ {/if}
27
+
28
+ {#if children}
29
+ <div class="sidebar-body" class:sidebar-body--ruled={!!links}>{@render children()}</div>
30
+ {/if}
31
+
32
+ {#if foot}
33
+ <div class="sidebar-foot">{@render foot()}</div>
34
+ {/if}
35
+ </nav>
36
+
37
+ <style>
38
+ .sidebar {
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 10px;
42
+ height: 100%;
43
+ padding: 10px 8px;
44
+ background: var(--sf);
45
+ }
46
+ .sidebar-links {
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: 1px;
50
+ list-style: none;
51
+ margin: 0;
52
+ padding: 0;
53
+ }
54
+ .sidebar-body {
55
+ flex: 1;
56
+ min-height: 0;
57
+ overflow-y: auto;
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: 10px;
61
+ }
62
+ .sidebar-body--ruled {
63
+ padding-top: 6px;
64
+ border-top: 1px solid var(--bds);
65
+ }
66
+ .sidebar-foot {
67
+ display: flex;
68
+ align-items: center;
69
+ gap: 4px;
70
+ padding-top: 8px;
71
+ border-top: 1px solid var(--bds);
72
+ }
73
+ </style>
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+ /** Sidebar header: a small filled mark (one letter) beside the product name. */
3
+ let { href, label, mark }: { href: string; label: string; mark?: string } = $props();
4
+ </script>
5
+
6
+ <a class="sidebar-brand" {href}>
7
+ <span class="sidebar-mark" aria-hidden="true">{mark ?? label.charAt(0).toLowerCase()}</span>
8
+ <span>{label}</span>
9
+ </a>
10
+
11
+ <style>
12
+ .sidebar-brand {
13
+ display: flex;
14
+ align-items: center;
15
+ gap: 8px;
16
+ padding: 2px 6px;
17
+ font-weight: 700;
18
+ font-size: 15px;
19
+ color: var(--tx);
20
+ text-decoration: none;
21
+ }
22
+ .sidebar-mark {
23
+ display: grid;
24
+ place-items: center;
25
+ width: 22px;
26
+ height: 22px;
27
+ border-radius: var(--radius-sm);
28
+ background: var(--primary-strong);
29
+ color: var(--primary-soft);
30
+ font-size: 13px;
31
+ }
32
+ </style>
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { HTMLButtonAttributes } from 'svelte/elements';
4
+
5
+ /** Square 26px icon button for the sidebar footer (theme toggle, sign out). Pass `aria-label`. */
6
+ let {
7
+ children,
8
+ type = 'button',
9
+ ...rest
10
+ }: HTMLButtonAttributes & { children: Snippet } = $props();
11
+ </script>
12
+
13
+ <button class="sidebar-btn" {type} {...rest}>{@render children()}</button>
14
+
15
+ <style>
16
+ .sidebar-btn {
17
+ display: grid;
18
+ place-items: center;
19
+ width: 26px;
20
+ height: 26px;
21
+ border-radius: var(--radius-sm);
22
+ border: none;
23
+ background: none;
24
+ color: var(--txs);
25
+ cursor: pointer;
26
+ }
27
+ .sidebar-btn:hover {
28
+ background: var(--sfh);
29
+ color: var(--tx);
30
+ }
31
+ </style>
@@ -0,0 +1,39 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ /** A titled list of SidebarItems. `href` makes the uppercase title a link (e.g. a project). */
5
+ let { children, href, label }: { children: Snippet; href?: string; label: string } = $props();
6
+ </script>
7
+
8
+ <section>
9
+ {#if href}
10
+ <a class="sidebar-group-label sidebar-group-label--link" {href}>{label}</a>
11
+ {:else}
12
+ <span class="sidebar-group-label">{label}</span>
13
+ {/if}
14
+ <ul>{@render children()}</ul>
15
+ </section>
16
+
17
+ <style>
18
+ ul {
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: 1px;
22
+ list-style: none;
23
+ margin: 0;
24
+ padding: 0;
25
+ }
26
+ .sidebar-group-label {
27
+ display: block;
28
+ padding: 2px 8px;
29
+ font-size: 11px;
30
+ font-weight: 600;
31
+ letter-spacing: 0.04em;
32
+ text-transform: uppercase;
33
+ color: var(--txt);
34
+ text-decoration: none;
35
+ }
36
+ .sidebar-group-label--link:hover {
37
+ color: var(--tx);
38
+ }
39
+ </style>
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import type { Component, Snippet } from 'svelte';
3
+
4
+ /** One 26px sidebar row (renders its own `<li>`). `current` tints it and sets
5
+ * aria-current="page"; the caller decides what counts as current. */
6
+ let {
7
+ children,
8
+ current = false,
9
+ href,
10
+ icon: Icon,
11
+ iconSize = 14,
12
+ }: {
13
+ children: Snippet;
14
+ current?: boolean;
15
+ href: string;
16
+ icon?: Component<{ size?: number }>;
17
+ iconSize?: number;
18
+ } = $props();
19
+ </script>
20
+
21
+ <li>
22
+ <a class="sidebar-item" aria-current={current ? 'page' : undefined} {href}>
23
+ {#if Icon}<Icon size={iconSize} />{/if}
24
+ {@render children()}
25
+ </a>
26
+ </li>
27
+
28
+ <style>
29
+ .sidebar-item {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 6px;
33
+ height: 26px;
34
+ padding: 0 8px;
35
+ border-radius: var(--radius-sm);
36
+ color: var(--txs);
37
+ text-decoration: none;
38
+ }
39
+ .sidebar-item:hover {
40
+ background: var(--sfh);
41
+ color: var(--tx);
42
+ }
43
+ .sidebar-item[aria-current='page'] {
44
+ background: color-mix(in srgb, var(--primary) 16%, transparent);
45
+ color: var(--primary);
46
+ font-weight: 500;
47
+ }
48
+ </style>
package/stat/Stat.svelte CHANGED
@@ -22,9 +22,9 @@
22
22
  label: Snippet;
23
23
  /** Loading ring on the card while its value reloads; drive it from `pendingFlag()`. */
24
24
  loading?: boolean;
25
- /** Type treatment for the value. `display` (default) is the DM Sans heading face; `plain`
26
- * keeps the body sans at a slightly smaller size, for dense metric grids where a row of
27
- * display numerals reads too loud. */
25
+ /** Type treatment for the value. `display` (default) uses `--font-heading`; `plain` keeps
26
+ * `--font-sans` at a slightly smaller size, for dense metric grids where a row of display
27
+ * numerals reads too loud. */
28
28
  numerals?: 'display' | 'plain';
29
29
  sub?: Snippet;
30
30
  value: Snippet;
package/text/Title.svelte CHANGED
@@ -35,7 +35,7 @@
35
35
  maxWidth?: string;
36
36
  /** Single-line ellipsis. Needs a bounded width from context (a flex child needs its own
37
37
  * `min-width: 0`/`flex: 1` via `class`, or pass `maxWidth`). Clips only the inline axis —
38
- * unlike Tailwind's `truncate`, the vertical axis stays `visible` so descenders (DM Sans's
38
+ * unlike Tailwind's `truncate`, the vertical axis stays `visible` so descenders (the font's
39
39
  * glyph box is taller than the tight h1/h2 line-height) don't get cropped by the clip box. */
40
40
  truncate?: boolean;
41
41
  } = $props();
package/typography.css CHANGED
@@ -5,13 +5,12 @@
5
5
  letter-spacing scale, so no app duplicates or drifts from another. A component's own
6
6
  scoped <style> block (higher specificity than these unscoped tag selectors) still
7
7
  wins for any heading that needs a bespoke size — this scale is only the default.
8
- Requires the consuming app.html to load DM Sans via Google Fonts (see app.html in any
9
- app) — every app on the same font-delivery pipeline, same font-family name. */
8
+ Requires the consuming app.html to load Geist and Geist Mono via Google Fonts (see app.html
9
+ in any app) — every app on the same font-delivery pipeline, same font-family name. */
10
10
  @theme inline {
11
- --font-sans:
12
- 'DM Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
13
- --font-heading: 'DM Sans', sans-serif;
14
- --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
11
+ --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
12
+ --font-heading: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
13
+ --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
15
14
  }
16
15
 
17
16
  @layer base {
@@ -1,44 +0,0 @@
1
- <script generics="Input extends RemoteFormInput, T = string" lang="ts">
2
- import type { RemoteForm, RemoteFormInput } from '$app/server';
3
- import type { Snippet } from 'svelte';
4
- import type { ZodType } from 'zod';
5
-
6
- import Field from '../Field.svelte';
7
-
8
- interface Props {
9
- children?: Snippet;
10
- form?: Omit<RemoteForm<Input, unknown>, 'for'> | RemoteForm<Input, unknown>;
11
- name: keyof Input & string;
12
- onChange?: (value: T) => void;
13
- onInput?: (value: T) => void;
14
- optional?: boolean;
15
- placeholder?: string;
16
- schema?: ZodType;
17
- value?: T;
18
- }
19
-
20
- let {
21
- children,
22
- form,
23
- name,
24
- onChange,
25
- onInput,
26
- optional,
27
- placeholder,
28
- schema,
29
- value = $bindable(),
30
- }: Props = $props();
31
- </script>
32
-
33
- <Field
34
- {name}
35
- {children}
36
- {form}
37
- {onChange}
38
- {onInput}
39
- {optional}
40
- {placeholder}
41
- {schema}
42
- type="password"
43
- bind:value
44
- />