@zeyolabs/shopping 2026.11.38 → 2026.11.39

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.
@@ -1,7 +1,22 @@
1
1
  <script lang="ts">
2
- import { ErrorMessage } from '../../utils/errors';
3
2
  import { resolve } from '$app/paths';
3
+ import Minus from '@lucide/svelte/icons/minus';
4
+ import Plus from '@lucide/svelte/icons/plus';
5
+ import Trash from '@lucide/svelte/icons/trash-2';
6
+ import Boundary from '@zeyolabs/ui/boundary/Boundary.svelte';
7
+ import { Form } from '@zeyolabs/ui/form';
8
+ import Button from '@zeyolabs/ui/form/Button.svelte';
9
+ import { Select } from '@zeyolabs/ui/form/primitives';
10
+ import SkeletonCard from '@zeyolabs/ui/skeleton/SkeletonCard.svelte';
11
+ import Span from '@zeyolabs/ui/text/Span.svelte';
12
+ import Text from '@zeyolabs/ui/text/Text.svelte';
13
+ import { toast } from 'svelte-sonner';
14
+
15
+ import { shopContext } from '../../context';
4
16
  import PageTitle from '../../ui/PageTitle.svelte';
17
+ import { ErrorMessage } from '../../utils/errors';
18
+ import { Images } from '../../utils/images';
19
+ import { Money } from '../../utils/money';
5
20
  import {
6
21
  basketQuantityForm,
7
22
  getBasket,
@@ -10,18 +25,6 @@
10
25
  setShipTo,
11
26
  } from '../client.remote';
12
27
  import { BasketQuantitySchema } from '../schema';
13
- import Minus from '@lucide/svelte/icons/minus';
14
- import Plus from '@lucide/svelte/icons/plus';
15
- import Trash from '@lucide/svelte/icons/trash-2';
16
- import { shopContext } from '../../context';
17
- import { Images } from '../../utils/images';
18
- import { Money } from '../../utils/money';
19
- import { toast } from 'svelte-sonner';
20
- import Boundary from '@zeyolabs/ui/boundary/Boundary.svelte';
21
- import { Form } from '@zeyolabs/ui/form';
22
- import Button from '@zeyolabs/ui/form/Button.svelte';
23
- import { Select } from '@zeyolabs/ui/form/primitives';
24
- import SkeletonCard from '@zeyolabs/ui/skeleton/SkeletonCard.svelte';
25
28
 
26
29
  /** The app's own checkout remote function, which rate-limits before calling `createCheckout`. */
27
30
  let { startCheckout }: { startCheckout: () => Promise<{ url: string }> } = $props();
@@ -47,10 +50,10 @@
47
50
  {let [summary, countries] = $derived(await Promise.all([getBasket(), getShippableCountries()]))}
48
51
 
49
52
  {#if summary.lines.length === 0 && summary.bundles.length === 0}
50
- <p>Your basket is empty.</p>
51
- <p class="mt-4"><a class="underline" href={resolve('/')}>Continue shopping</a></p>
53
+ <Text>Your basket is empty.</Text>
54
+ <Text class="mt-4"><a class="underline" href={resolve('/')}>Continue shopping</a></Text>
52
55
  {:else}
53
- <ul class="divide-y divide-[var(--line)]">
56
+ <ul class="divide-y divide-[var(--bd)]">
54
57
  {#each summary.lines as line (line.id)}
55
58
  <li class="flex flex-wrap items-center gap-4 py-4">
56
59
  {#if line.cover}
@@ -64,11 +67,11 @@
64
67
  <a class="font-medium" href={resolve('/product/[slug]', { slug: line.slug })}>
65
68
  {line.name}
66
69
  </a>
67
- <p>{Money.format(line.pricePence)}</p>
70
+ <Text>{Money.format(line.pricePence)}</Text>
68
71
  {#if line.available < line.quantity}
69
- <p class="text-sm text-[var(--danger)]">
72
+ <Text class="text-[var(--danger)]">
70
73
  {line.available === 0 ? 'Out of stock' : `Only ${line.available} available`}
71
- </p>
74
+ </Text>
72
75
  {/if}
73
76
  </div>
74
77
  {const form = basketQuantityForm.for(line.id)}
@@ -89,7 +92,7 @@
89
92
  >
90
93
  <Minus size={14} />
91
94
  </Button>
92
- <span class="w-6 text-center">{line.quantity}</span>
95
+ <Span class="w-6" centered>{line.quantity}</Span>
93
96
  <Button
94
97
  {...form.fields.quantity.as('submit', line.quantity + 1)}
95
98
  aria-label="Increase quantity of {line.name}"
@@ -102,7 +105,7 @@
102
105
  <Plus size={14} />
103
106
  </Button>
104
107
  </Form>
105
- <p class="w-20 text-right">{Money.format(line.lineTotalPence)}</p>
108
+ <Text class="w-20 text-right">{Money.format(line.lineTotalPence)}</Text>
106
109
  </li>
107
110
  {/each}
108
111
  {#each summary.bundles as bundle (bundle.index)}
@@ -120,7 +123,7 @@
120
123
  {bundle.name}
121
124
  </a>
122
125
  {:else}
123
- <p class="font-medium">{bundle.name}</p>
126
+ <Text bold>{bundle.name}</Text>
124
127
  {/if}
125
128
  {#if bundle.details.length > 0}
126
129
  <ul class="mt-1 text-sm text-[var(--txs)]">
@@ -128,7 +131,7 @@
128
131
  </ul>
129
132
  {/if}
130
133
  {#if bundle.problem}
131
- <p class="mt-1 text-sm text-[var(--danger)]">{bundle.problem}</p>
134
+ <Text class="mt-1 text-[var(--danger)]">{bundle.problem}</Text>
132
135
  {/if}
133
136
  </div>
134
137
  <Button
@@ -140,12 +143,12 @@
140
143
  >
141
144
  <Trash size={14} />
142
145
  </Button>
143
- <p class="w-20 text-right">
146
+ <Text class="w-20 text-right">
144
147
  {Money.format(bundle.pricePence)}
145
148
  {#if bundle.listPricePence > bundle.pricePence}
146
149
  <s class="block text-xs text-[var(--txt)]">{Money.format(bundle.listPricePence)}</s>
147
150
  {/if}
148
- </p>
151
+ </Text>
149
152
  </li>
150
153
  {/each}
151
154
  </ul>
@@ -179,21 +182,21 @@
179
182
  <dd class="text-right font-medium">{Money.format(summary.totalPence)}</dd>
180
183
  </dl>
181
184
  {#if summary.shipping === null}
182
- <p class="mt-2 text-right text-sm text-[var(--danger)]">
185
+ <Text class="mt-2 text-right text-[var(--danger)]">
183
186
  We cannot ship this order to the selected country.
184
- </p>
187
+ </Text>
185
188
  {:else}
186
- <p class="mt-2 text-right text-sm">
189
+ <Text class="mt-2 text-right">
187
190
  {summary.shipping.name}, {summary.shipping.deliveryTime}.
188
- </p>
191
+ </Text>
189
192
  {/if}
190
193
  {#if summary.domestic && summary.shippingPence > 0}
191
- <p class="mt-2 text-right text-sm">
194
+ <Text class="mt-2 text-right">
192
195
  Free UK delivery on orders of {Money.format(summary.freeShippingFromPence)} or more.
193
- </p>
196
+ </Text>
194
197
  {/if}
195
198
 
196
- <p class="mt-6 text-right">
199
+ <Text class="mt-6 text-right">
197
200
  <Button
198
201
  disabled={!summary.shipping ||
199
202
  summary.lines.some((line) => line.available < 1) ||
@@ -205,7 +208,7 @@
205
208
  >
206
209
  Checkout
207
210
  </Button>
208
- </p>
211
+ </Text>
209
212
  {/if}
210
213
 
211
214
  {#snippet pending()}
@@ -1,8 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { resolve } from '$app/paths';
3
+ import Boundary from '@zeyolabs/ui/boundary/Boundary.svelte';
4
+ import Text from '@zeyolabs/ui/text/Text.svelte';
5
+ import Title from '@zeyolabs/ui/text/Title.svelte';
6
+
3
7
  import { getAdminBundle } from '../admin.remote';
4
8
  import BundleForm from './BundleForm.svelte';
5
- import Boundary from '@zeyolabs/ui/boundary/Boundary.svelte';
6
9
 
7
10
  /** The bundle to edit; leave out for a new one. */
8
11
  let { id }: { id?: number } = $props();
@@ -10,8 +13,8 @@
10
13
 
11
14
  <svelte:head><title>{id ? 'Edit bundle' : 'New bundle'} · Admin</title></svelte:head>
12
15
 
13
- <p class="text-sm"><a href={resolve('/bundles')}>← Bundles</a></p>
14
- <h1 class="mt-2 mb-6 text-2xl font-semibold">{id ? 'Edit bundle' : 'New bundle'}</h1>
16
+ <Text><a href={resolve('/bundles')}>← Bundles</a></Text>
17
+ <Title class="mt-2 mb-6" level={1} size="md">{id ? 'Edit bundle' : 'New bundle'}</Title>
15
18
 
16
19
  <Boundary message="Could not load the bundle." statusMessages={{ 404: 'Bundle not found.' }}>
17
20
  {let bundle = $derived(id ? await getAdminBundle(id) : null)}
@@ -19,6 +22,6 @@
19
22
  <BundleForm {bundle} />
20
23
  {/key}
21
24
  {#snippet pending()}
22
- <p class="text-[var(--ink-muted)]">Loading…</p>
25
+ <Text color="secondary">Loading…</Text>
23
26
  {/snippet}
24
27
  </Boundary>
@@ -1,12 +1,15 @@
1
1
  <script lang="ts">
2
2
  import { goto } from '$app/navigation';
3
3
  import { resolve } from '$app/paths';
4
+ import { CheckboxField, Form, MessageField, NumberField, TextField } from '@zeyolabs/ui/form';
5
+ import Button from '@zeyolabs/ui/form/Button.svelte';
6
+ import Title from '@zeyolabs/ui/text/Title.svelte';
7
+
4
8
  import type { getAdminBundle } from '../admin.remote';
9
+
10
+ import { shopContext } from '../../context';
5
11
  import { saveBundleForm } from '../admin.remote';
6
12
  import { BundleFormSchema } from '../schema';
7
- import { shopContext } from '../../context';
8
- import { CheckboxField, Form, MessageField, NumberField, TextField } from '@zeyolabs/ui/form';
9
- import Button from '@zeyolabs/ui/form/Button.svelte';
10
13
 
11
14
  type Bundle = Awaited<ReturnType<typeof getAdminBundle>>;
12
15
 
@@ -35,8 +38,8 @@
35
38
  { label: 'Kit cover (one product for every slot)', value: 'cover' },
36
39
  ] as const;
37
40
 
38
- const input = 'mt-1 w-full rounded-md border border-[var(--line)] bg-white px-3 py-1.5';
39
- const section = 'grid gap-4 rounded-xl border border-[var(--line)] bg-white p-5';
41
+ const input = 'mt-1 w-full rounded-md border border-[var(--bd)] bg-white px-3 py-1.5';
42
+ const section = 'grid gap-4 rounded-xl border border-[var(--bd)] bg-white p-5';
40
43
  </script>
41
44
 
42
45
  <Form
@@ -82,10 +85,10 @@
82
85
  {#each stepRows as _, i (i)}
83
86
  <section class={section}>
84
87
  <div class="flex items-center justify-between">
85
- <h2 class="font-semibold">Step {i + 1}</h2>
88
+ <Title level={2} size="sm">Step {i + 1}</Title>
86
89
  {#if stepRows.length > 1}
87
90
  <Button
88
- onclick={() => steps.set(stepRows.filter((_, j) => j !== i))}
91
+ onclick={() => steps.set(stepRows.filter((_: unknown, j: number) => j !== i))}
89
92
  size="sm"
90
93
  variant="secondary">Remove step</Button
91
94
  >
@@ -1,40 +1,44 @@
1
1
  <script lang="ts">
2
2
  import { resolve } from '$app/paths';
3
- import { getAdminBundles } from '../admin.remote';
4
3
  import Badge from '@zeyolabs/ui/badge/Badge.svelte';
5
4
  import Boundary from '@zeyolabs/ui/boundary/Boundary.svelte';
5
+ import Span from '@zeyolabs/ui/text/Span.svelte';
6
+ import Text from '@zeyolabs/ui/text/Text.svelte';
7
+ import Title from '@zeyolabs/ui/text/Title.svelte';
8
+
9
+ import { getAdminBundles } from '../admin.remote';
6
10
  </script>
7
11
 
8
12
  <svelte:head><title>Bundles · Admin</title></svelte:head>
9
13
 
10
- <p class="text-sm"><a href={resolve('/products')}>← Products</a></p>
14
+ <Text><a href={resolve('/products')}>← Products</a></Text>
11
15
  <div class="mt-2 flex items-center justify-between">
12
- <h1 class="text-2xl font-semibold">Bundles</h1>
16
+ <Title level={1} size="md">Bundles</Title>
13
17
  <a
14
- class="rounded-md bg-[var(--leaf-dark)] px-3 py-1.5 text-sm text-white no-underline"
18
+ class="rounded-md bg-[var(--acc)] px-3 py-1.5 text-sm text-white no-underline"
15
19
  href={resolve('/bundles/new')}>New bundle</a
16
20
  >
17
21
  </div>
18
- <p class="mt-1 text-sm text-[var(--ink-muted)]">
22
+ <Text class="mt-1" color="secondary">
19
23
  A bundle is built in steps; the customer's picks go into the basket as ordinary products at their
20
24
  own prices. Use a Stripe promotion code for a bundle discount.
21
- </p>
25
+ </Text>
22
26
 
23
27
  <Boundary message="Could not load bundles.">
24
28
  {let rows = $derived(await getAdminBundles())}
25
- <ul class="mt-4 divide-y divide-[var(--line)] rounded-xl border border-[var(--line)] bg-white">
29
+ <ul class="mt-4 divide-y divide-[var(--bd)] rounded-xl border border-[var(--bd)] bg-white">
26
30
  {#each rows as row (row.id)}
27
31
  <li class="px-4 py-2 text-sm">
28
32
  <a class="font-medium" href={resolve('/bundles/[id]', { id: String(row.id) })}>{row.name}</a
29
33
  >
30
- <span class="text-[var(--ink-muted)]">/bundle/{row.slug}</span>
34
+ <Span color="secondary">/bundle/{row.slug}</Span>
31
35
  {#if !row.active}<Badge color="neutral">inactive</Badge>{/if}
32
36
  </li>
33
37
  {:else}
34
- <li class="px-4 py-6 text-[var(--ink-muted)]">No bundles yet.</li>
38
+ <li class="px-4 py-6 text-[var(--txs)]">No bundles yet.</li>
35
39
  {/each}
36
40
  </ul>
37
41
  {#snippet pending()}
38
- <p class="mt-6 text-[var(--ink-muted)]">Loading…</p>
42
+ <Text class="mt-6" color="secondary">Loading…</Text>
39
43
  {/snippet}
40
44
  </Boundary>
@@ -1,17 +1,21 @@
1
1
  <script lang="ts">
2
- import { ErrorMessage } from '../../utils/errors';
3
2
  import { goto } from '$app/navigation';
4
3
  import { resolve } from '$app/paths';
5
- import PageTitle from '../../ui/PageTitle.svelte';
6
- import { addBundleToBasket, type getBundle } from '../client.remote';
7
- import { shopContext } from '../../context';
8
- import { Images } from '../../utils/images';
9
- import { Money } from '../../utils/money';
10
4
  import Minus from '@lucide/svelte/icons/minus';
11
5
  import Plus from '@lucide/svelte/icons/plus';
12
- import { SvelteMap, SvelteSet } from 'svelte/reactivity';
13
- import { toast } from 'svelte-sonner';
14
6
  import Button from '@zeyolabs/ui/form/Button.svelte';
7
+ import Span from '@zeyolabs/ui/text/Span.svelte';
8
+ import Text from '@zeyolabs/ui/text/Text.svelte';
9
+ import Title from '@zeyolabs/ui/text/Title.svelte';
10
+ import { toast } from 'svelte-sonner';
11
+ import { SvelteMap, SvelteSet } from 'svelte/reactivity';
12
+
13
+ import { shopContext } from '../../context';
14
+ import PageTitle from '../../ui/PageTitle.svelte';
15
+ import { ErrorMessage } from '../../utils/errors';
16
+ import { Images } from '../../utils/images';
17
+ import { Money } from '../../utils/money';
18
+ import { addBundleToBasket, type getBundle } from '../client.remote';
15
19
 
16
20
  let {
17
21
  bundle,
@@ -20,8 +24,8 @@
20
24
  bundle: Awaited<ReturnType<typeof getBundle>>;
21
25
  } = $props();
22
26
 
23
- type Step = (typeof bundle.steps)[number];
24
27
  type Option = Step['products'][number];
28
+ type Step = (typeof bundle.steps)[number];
25
29
 
26
30
  const context = shopContext();
27
31
  /** pick / base / cover steps: step id to the chosen product ids. */
@@ -58,7 +62,7 @@
58
62
  if (step.role === 'base') filled.clear();
59
63
  }
60
64
 
61
- function adjust(step: Step, product: Option, by: 1 | -1) {
65
+ function adjust(step: Step, product: Option, by: -1 | 1) {
62
66
  const map = filled.get(step.id) ?? new SvelteMap<number, number>();
63
67
  const next = (map.get(product.id) ?? 0) + by;
64
68
  if (next <= 0) map.delete(product.id);
@@ -170,33 +174,33 @@
170
174
  <PageTitle description={bundle.description.slice(0, 160)} title={bundle.name} />
171
175
 
172
176
  {#if bundle.description}
173
- <p class="-mt-4 mb-4 max-w-prose whitespace-pre-line text-[var(--txs)]">{bundle.description}</p>
177
+ <Text class="-mt-4 mb-4 max-w-prose whitespace-pre-line" color="secondary"
178
+ >{bundle.description}</Text
179
+ >
174
180
  {/if}
175
181
  {#if !kit && bundle.discountPercent > 0}
176
- <p
177
- class="mb-8 inline-flex rounded-full bg-[var(--primary-soft)] px-3 py-1 text-sm font-medium text-[var(--primary-strong)]"
182
+ <Text
183
+ class="mb-8 inline-flex rounded-full bg-[var(--primary-soft)] px-3 py-1 text-[var(--primary-strong)]"
184
+ bold
178
185
  >
179
186
  {bundle.discountPercent}% off when bought as a bundle
180
- </p>
187
+ </Text>
181
188
  {/if}
182
189
 
183
190
  {#if soldOut}
184
- <p
185
- class="mb-6 rounded-xl border border-[var(--bd)] bg-[var(--sfh)] px-4 py-3 text-sm text-[var(--tx)]"
186
- role="status"
187
- >
188
- Not available right now: every {soldOut.title.toLowerCase()} option is sold out.
189
- </p>
191
+ <div class="mb-6 rounded-xl border border-[var(--bd)] bg-[var(--sfh)] px-4 py-3" role="status">
192
+ <Text>Not available right now: every {soldOut.title.toLowerCase()} option is sold out.</Text>
193
+ </div>
190
194
  {/if}
191
195
 
192
196
  <ol class="mt-4 space-y-10">
193
197
  {#each bundle.steps as step, i (step.id)}
194
198
  {const locked = $derived((step.role === 'fill' || step.role === 'cover') && slots === 0)}
195
199
  <li class={locked ? 'opacity-50' : ''}>
196
- <h2 class="text-lg font-semibold tracking-normal">{i + 1}. {step.title}</h2>
197
- <p class="text-sm text-[var(--txs)]">
200
+ <Title level={2} size="sm">{i + 1}. {step.title}</Title>
201
+ <Text color="secondary">
198
202
  {rule(step)}{step.description ? ` · ${step.description}` : ''}
199
- </p>
203
+ </Text>
200
204
  <ul class="mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
201
205
  {#each step.products as product (product.id)}
202
206
  {const sold = $derived(out(step, product))}
@@ -219,13 +223,13 @@
219
223
  src={Images.url(context.imageBaseUrl, product.cover.src)}
220
224
  />
221
225
  {/if}
222
- <span class="min-w-0 flex-1">
223
- <span class="block text-sm font-medium">{label}</span>
224
- <span class="block text-xs text-[var(--txs)]">
226
+ <div class="min-w-0 flex-1">
227
+ <Span class="block" bold>{label}</Span>
228
+ <Span class="block" color="secondary" size="sm">
225
229
  {sold ? 'Out of stock' : priceLabel(step, product)}
226
- </span>
227
- </span>
228
- <span class="flex shrink-0 items-center gap-1">
230
+ </Span>
231
+ </div>
232
+ <div class="flex shrink-0 items-center gap-1">
229
233
  <Button
230
234
  aria-label="One fewer {product.name}"
231
235
  disabled={n === 0}
@@ -236,7 +240,7 @@
236
240
  >
237
241
  <Minus size={14} />
238
242
  </Button>
239
- <span class="w-6 text-center text-sm font-medium" aria-live="polite">{n}</span>
243
+ <div class="w-6 text-center" aria-live="polite"><Span bold>{n}</Span></div>
240
244
  <Button
241
245
  aria-label="One more {product.name}"
242
246
  disabled={sold || locked || !canAdd(step, product)}
@@ -247,7 +251,7 @@
247
251
  >
248
252
  <Plus size={14} />
249
253
  </Button>
250
- </span>
254
+ </div>
251
255
  </div>
252
256
  {:else}
253
257
  {const on = $derived(chosen(step.id).has(product.id))}
@@ -268,12 +272,12 @@
268
272
  src={Images.url(context.imageBaseUrl, product.cover.src)}
269
273
  />
270
274
  {/if}
271
- <span class="min-w-0">
272
- <span class="block text-sm font-medium">{label}</span>
273
- <span class="block text-xs text-[var(--txs)]">
275
+ <Span class="min-w-0">
276
+ <Span class="block" bold>{label}</Span>
277
+ <Span class="block" color="secondary" size="sm">
274
278
  {sold ? 'Out of stock' : priceLabel(step, product)}
275
- </span>
276
- </span>
279
+ </Span>
280
+ </Span>
277
281
  </button>
278
282
  {/if}
279
283
  </li>
@@ -286,16 +290,15 @@
286
290
  <div
287
291
  class="sticky bottom-0 mt-10 flex flex-wrap items-center justify-between gap-3 border-t border-[var(--bd)] bg-white py-4"
288
292
  >
289
- <p class="flex items-baseline gap-2">
290
- <span class="text-[var(--txs)]">Total</span>
293
+ <Text class="flex items-baseline gap-2">
294
+ <Span color="secondary">Total</Span>
291
295
  <strong class="text-xl">{Money.format(totalPence)}</strong>
292
296
  {#if totalPence < listPence}
293
297
  <s class="text-sm text-[var(--txt)]">{Money.format(listPence)}</s>
294
298
  {/if}
295
- </p>
299
+ </Text>
296
300
  <div class="flex items-center gap-3">
297
- {#if missing}<span class="text-sm text-[var(--txs)]">{missing.title}: {rule(missing)}</span
298
- >{/if}
301
+ {#if missing}<Span color="secondary">{missing.title}: {rule(missing)}</Span>{/if}
299
302
  <Button
300
303
  disabled={busy || soldOut !== undefined || missing !== undefined || totalPence === 0}
301
304
  onclick={add}
@@ -1,9 +1,13 @@
1
1
  <script lang="ts">
2
2
  import { resolve } from '$app/paths';
3
- import { getAdminCategories } from '../admin.remote';
4
- import CategoryForm from './CategoryForm.svelte';
5
3
  import Boundary from '@zeyolabs/ui/boundary/Boundary.svelte';
6
4
  import Button from '@zeyolabs/ui/form/Button.svelte';
5
+ import Span from '@zeyolabs/ui/text/Span.svelte';
6
+ import Text from '@zeyolabs/ui/text/Text.svelte';
7
+ import Title from '@zeyolabs/ui/text/Title.svelte';
8
+
9
+ import { getAdminCategories } from '../admin.remote';
10
+ import CategoryForm from './CategoryForm.svelte';
7
11
 
8
12
  type Category = {
9
13
  description: string;
@@ -19,9 +23,9 @@
19
23
 
20
24
  <svelte:head><title>Categories · Admin</title></svelte:head>
21
25
 
22
- <p class="text-sm"><a href={resolve('/products')}>← Products</a></p>
26
+ <Text><a href={resolve('/products')}>← Products</a></Text>
23
27
  <div class="mt-2 flex items-center justify-between">
24
- <h1 class="text-2xl font-semibold">Categories</h1>
28
+ <Title level={1} size="md">Categories</Title>
25
29
  <Button onclick={() => (editing = null)}>New category</Button>
26
30
  </div>
27
31
 
@@ -33,21 +37,20 @@
33
37
 
34
38
  <Boundary message="Could not load categories.">
35
39
  {let rows = $derived(await getAdminCategories())}
36
- <ul class="mt-4 divide-y divide-[var(--line)] rounded-xl border border-[var(--line)] bg-white">
40
+ <ul class="mt-4 divide-y divide-[var(--bd)] rounded-xl border border-[var(--bd)] bg-white">
37
41
  {#each rows as row (row.id)}
38
42
  <li class="flex items-center justify-between gap-3 px-4 py-2 text-sm">
39
- <span
43
+ <Span
40
44
  ><strong>{row.name}</strong>
41
- <span class="text-[var(--ink-muted)]">/category/{row.slug} · {row.products} products</span
42
- ></span
45
+ <Span color="secondary">/category/{row.slug} · {row.products} products</Span></Span
43
46
  >
44
47
  <button class="underline" onclick={() => (editing = row)} type="button">Edit</button>
45
48
  </li>
46
49
  {:else}
47
- <li class="px-4 py-6 text-[var(--ink-muted)]">No categories yet.</li>
50
+ <li class="px-4 py-6 text-[var(--txs)]">No categories yet.</li>
48
51
  {/each}
49
52
  </ul>
50
53
  {#snippet pending()}
51
- <p class="mt-6 text-[var(--ink-muted)]">Loading…</p>
54
+ <Text class="mt-6" color="secondary">Loading…</Text>
52
55
  {/snippet}
53
56
  </Boundary>
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
- import { saveCategoryForm } from '../admin.remote';
3
- import { CategoryFormSchema } from '../schema';
4
2
  import { Form, MessageField, NumberField, TextField } from '@zeyolabs/ui/form';
5
3
  import Button from '@zeyolabs/ui/form/Button.svelte';
6
4
 
5
+ import { saveCategoryForm } from '../admin.remote';
6
+ import { CategoryFormSchema } from '../schema';
7
+
7
8
  type Category = {
8
9
  description: string;
9
10
  id: number;
@@ -26,7 +27,7 @@
26
27
  </script>
27
28
 
28
29
  <Form
29
- class="grid max-w-xl gap-3 rounded-xl border border-[var(--line)] bg-white p-5"
30
+ class="grid max-w-xl gap-3 rounded-xl border border-[var(--bd)] bg-white p-5"
30
31
  defaults={{
31
32
  description: category?.description ?? '',
32
33
  name: category?.name ?? '',
@@ -1,8 +1,11 @@
1
1
  <script lang="ts">
2
2
  import { resolve } from '$app/paths';
3
+ import Boundary from '@zeyolabs/ui/boundary/Boundary.svelte';
4
+ import Text from '@zeyolabs/ui/text/Text.svelte';
5
+ import Title from '@zeyolabs/ui/text/Title.svelte';
6
+
3
7
  import { getAdminProduct, getProductOptions } from '../admin.remote';
4
8
  import ProductForm from './ProductForm.svelte';
5
- import Boundary from '@zeyolabs/ui/boundary/Boundary.svelte';
6
9
 
7
10
  /** The product to edit; leave out for a new one. */
8
11
  let { id }: { id?: number } = $props();
@@ -10,8 +13,8 @@
10
13
 
11
14
  <svelte:head><title>{id ? 'Edit product' : 'New product'} · Admin</title></svelte:head>
12
15
 
13
- <p class="text-sm"><a href={resolve('/products')}>← Products</a></p>
14
- <h1 class="mt-2 mb-6 text-2xl font-semibold">{id ? 'Edit product' : 'New product'}</h1>
16
+ <Text><a href={resolve('/products')}>← Products</a></Text>
17
+ <Title class="mt-2 mb-6" level={1} size="md">{id ? 'Edit product' : 'New product'}</Title>
15
18
 
16
19
  <Boundary message="Could not load the product." statusMessages={{ 404: 'Product not found.' }}>
17
20
  {let options = $derived(await getProductOptions())}
@@ -20,6 +23,6 @@
20
23
  <ProductForm {options} {product} />
21
24
  {/key}
22
25
  {#snippet pending()}
23
- <p class="text-[var(--ink-muted)]">Loading…</p>
26
+ <Text color="secondary">Loading…</Text>
24
27
  {/snippet}
25
28
  </Boundary>