@lyeve-labs/ui-kit 0.17.0 → 0.18.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.
Files changed (37) hide show
  1. package/README.md +16 -13
  2. package/dist/components/AccordionItem.svelte +1 -1
  3. package/dist/components/AccountMenu.svelte +1 -1
  4. package/dist/components/AppShell.svelte +20 -6
  5. package/dist/components/Autocomplete.svelte +10 -1
  6. package/dist/components/Card.svelte +1 -0
  7. package/dist/components/Collapsible.svelte +1 -1
  8. package/dist/components/DatePicker.svelte +1 -1
  9. package/dist/components/Drawer.svelte +6 -26
  10. package/dist/components/Dropdown.svelte +196 -10
  11. package/dist/components/Dropdown.svelte.d.ts +12 -0
  12. package/dist/components/Logo.svelte +77 -0
  13. package/dist/components/Logo.svelte.d.ts +35 -0
  14. package/dist/components/Modal.svelte +2 -15
  15. package/dist/components/MultiSelect.svelte +12 -3
  16. package/dist/components/PageHeader.svelte +23 -1
  17. package/dist/components/Panel.svelte +1 -1
  18. package/dist/components/SearchInput.svelte +10 -1
  19. package/dist/components/Table.svelte +143 -10
  20. package/dist/components/Table.svelte.d.ts +7 -0
  21. package/dist/components/ThemeToggle.svelte +75 -12
  22. package/dist/components/ThemeToggle.svelte.d.ts +9 -0
  23. package/dist/components/Toaster.svelte +3 -15
  24. package/dist/components/Tooltip.svelte +1 -1
  25. package/dist/components/dialog/Dialog.svelte +9 -4
  26. package/dist/components/dialog/dialog-manager.svelte.d.ts +20 -1
  27. package/dist/components/dialog/dialog-manager.svelte.js +13 -2
  28. package/dist/index.d.ts +4 -2
  29. package/dist/index.js +6 -2
  30. package/dist/internal/layout.js +11 -2
  31. package/dist/internal/panel.d.ts +1 -1
  32. package/dist/internal/panel.js +1 -1
  33. package/dist/styles/theme.css +235 -0
  34. package/dist/utils/theme.d.ts +68 -3
  35. package/dist/utils/theme.js +118 -3
  36. package/package.json +18 -19
  37. package/src/lib/styles/theme.css +235 -0
@@ -79,6 +79,61 @@
79
79
  --radius-xl: 16px;
80
80
  --radius-2xl: 24px;
81
81
 
82
+ /* -- Elevation - the stacking order of everything that floats --- *
83
+ * Every floating surface in the kit carried a bare z-50, so which
84
+ * one won was decided by document order: a Dropdown opened after a
85
+ * Modal painted over it, and the same two in the other order did
86
+ * not. The layer a surface belongs to is a property of the surface,
87
+ * so it is named here once and each component asks for its layer by
88
+ * name.
89
+ *
90
+ * The ramp starts at 100 and leaves everything below it to the
91
+ * consuming app. The admin's own chrome sits at z-10 and z-20
92
+ * today, and a kit layer landing on either number would tie with
93
+ * it and resolve, again, by document order.
94
+ *
95
+ * The steps are 100 apart because one of these layers holds a
96
+ * stack rather than a surface: the dialog manager offsets each
97
+ * dialog above the one it opened over, and a ramp in steps of ten
98
+ * would put the eleventh dialog through the ceiling of its own
99
+ * layer and under the tooltip above it.
100
+ *
101
+ * tooltip sits above modal because a tooltip on a control inside a
102
+ * dialog is drawn while that dialog is the topmost surface. toast
103
+ * sits above tooltip because it reports the outcome of the action
104
+ * the tooltip described. skip-link is above everything: it is the
105
+ * first focusable thing in the document and nothing may cover it.
106
+ *
107
+ * No sticky rung is declared. Nothing in the kit is sticky or
108
+ * fixed below the dropdown layer, and a token no rule reads is the
109
+ * defect this scale was written to end. */
110
+ --z-index-dropdown: 100; /* a panel anchored to its trigger */
111
+ --z-index-overlay: 200; /* the scrim behind a drawer or modal */
112
+ --z-index-drawer: 300; /* a panel docked to a viewport edge */
113
+ --z-index-modal: 400; /* a centred dialog, and the stack */
114
+ --z-index-tooltip: 500; /* a label attached to a control */
115
+ --z-index-toast: 600; /* transient status */
116
+ --z-index-skip-link: 700; /* the first tab stop in the document */
117
+
118
+ /* -- Motion - how long a transition or an entrance runs -------- *
119
+ * Four durations shipped as literals inside the animate-[...]
120
+ * utility of the component that used them, so the only way to
121
+ * read the kit's motion was to grep four components. They are
122
+ * stated here at the values they already ran at.
123
+ *
124
+ * Tailwind builds no utility from a --duration-* token: there is
125
+ * no such theme namespace, and `duration-collapse` compiles to
126
+ * nothing at all. Each one is read through var() from an
127
+ * arbitrary utility instead, which is why they are listed in
128
+ * VAR_ONLY in theme-tokens.test.ts.
129
+ *
130
+ * The reduced-motion block at the foot of this file overrides
131
+ * every one of them and stays the authority on whether they run. */
132
+ --duration-modal-in: 120ms; /* Modal, the centred entrance */
133
+ --duration-toast-in: 140ms; /* Toaster, one toast arriving */
134
+ --duration-drawer-in: 150ms; /* Drawer, either edge */
135
+ --duration-collapse: 200ms; /* Accordion and Collapsible */
136
+
82
137
  /* ── Typography · families ───────────────────────────────────── */
83
138
  --font-sans:
84
139
  'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
@@ -181,6 +236,65 @@ html[data-theme='light'] {
181
236
  --color-danger: #ab1a1a;
182
237
  }
183
238
 
239
+ /*
240
+ * The entrance keyframes, declared here and not in the components that play
241
+ * them.
242
+ *
243
+ * Modal, Drawer and Toaster each held their own `@keyframes` in a scoped
244
+ * `<style>` block and started it from a Tailwind `animate-[...]` class. Svelte
245
+ * renames a scoped keyframe to `svelte-<hash>-<name>` and rewrites only the
246
+ * references inside that same style block, so the class asked the browser for
247
+ * `modal-in` while the only rule declared was `svelte-ta60gp-modal-in`. An
248
+ * animation-name that resolves to nothing is not an error: the element simply
249
+ * appears, and all four entrances had been dead in every consumer.
250
+ *
251
+ * A keyframe named from a class has to be global, and the file every consumer
252
+ * already imports is the one place it can be global from.
253
+ */
254
+ @keyframes modal-in {
255
+ from {
256
+ opacity: 0;
257
+ transform: translateY(6px) scale(0.98);
258
+ }
259
+ to {
260
+ opacity: 1;
261
+ transform: translateY(0) scale(1);
262
+ }
263
+ }
264
+
265
+ @keyframes drawer-in-right {
266
+ from {
267
+ opacity: 0;
268
+ transform: translateX(16px);
269
+ }
270
+ to {
271
+ opacity: 1;
272
+ transform: translateX(0);
273
+ }
274
+ }
275
+
276
+ @keyframes drawer-in-left {
277
+ from {
278
+ opacity: 0;
279
+ transform: translateX(-16px);
280
+ }
281
+ to {
282
+ opacity: 1;
283
+ transform: translateX(0);
284
+ }
285
+ }
286
+
287
+ @keyframes toast-in {
288
+ from {
289
+ opacity: 0;
290
+ transform: translateX(12px);
291
+ }
292
+ to {
293
+ opacity: 1;
294
+ transform: translateX(0);
295
+ }
296
+ }
297
+
184
298
  @layer base {
185
299
  html {
186
300
  background-color: var(--color-ink);
@@ -238,3 +352,124 @@ html[data-theme='light'] {
238
352
  }
239
353
  }
240
354
  }
355
+
356
+ /*
357
+ * Print.
358
+ *
359
+ * The estate had no `@media print` rule anywhere, and three surfaces print:
360
+ * the portal prints an invoice, the ops console prints an audit log, the admin
361
+ * prints a subject-access export. All three printed the sidebar, the theme
362
+ * toggle and the nav, in a dark palette, and all three printed one screenful
363
+ * and stopped, because the shell is `h-screen` with the content column set to
364
+ * `overflow-auto` and paper has neither a viewport nor a scrollbar.
365
+ *
366
+ * These rules are deliberately outside `@layer base`. An unlayered declaration
367
+ * beats every layered one whatever its specificity, so a `bg-surface` utility
368
+ * on a card cannot put the dark surface back.
369
+ *
370
+ * Three markers, each stating what paper needs rather than what an element is:
371
+ *
372
+ * data-print="hide" chrome that exists to navigate. Paper cannot be
373
+ * navigated, so it is noise on every page.
374
+ * data-print="unclip" a box that clips on screen because the screen is a
375
+ * fixed height. On paper it must give up its height and
376
+ * its overflow or the content past the first page is
377
+ * never printed.
378
+ * data-print="keep" a block that reads as one thing and must not be split
379
+ * across a page break.
380
+ */
381
+ @media print {
382
+ /*
383
+ * The palette, not the components.
384
+ *
385
+ * Every kit component paints from these tokens, so redefining them here
386
+ * turns the whole library monochrome without a single component knowing
387
+ * about paper. Browsers drop backgrounds when printing by default, which
388
+ * left light text on the white the printer supplies; naming white here means
389
+ * the two agree either way.
390
+ *
391
+ * The status hues collapse to black rather than to a print-safe tint. A
392
+ * colour that carries meaning on screen carries none through a mono printer,
393
+ * and a legible black label beats an unreadable coloured one.
394
+ */
395
+ html,
396
+ html[data-theme='light'] {
397
+ --color-ink: #ffffff;
398
+ --color-surface: #ffffff;
399
+ --color-surface-2: #ffffff;
400
+ --color-line: #999999;
401
+ --color-line-strong: #666666;
402
+ --color-fg: #000000;
403
+ --color-muted: #000000;
404
+ --color-faint: #000000;
405
+ --color-brand: #000000;
406
+ --color-brand-light: #000000;
407
+ --color-brand-deep: #000000;
408
+ --color-violet: #000000;
409
+ --color-success: #000000;
410
+ --color-warn: #000000;
411
+ --color-danger: #000000;
412
+ color-scheme: light;
413
+ }
414
+
415
+ html,
416
+ body {
417
+ background: #ffffff;
418
+ color: #000000;
419
+ }
420
+
421
+ [data-print='hide'] {
422
+ display: none !important;
423
+ }
424
+
425
+ /*
426
+ * height as well as overflow. The shell is `h-screen`, so releasing the
427
+ * overflow alone still caps the printed document at one viewport.
428
+ */
429
+ [data-print='unclip'] {
430
+ overflow: visible !important;
431
+ height: auto !important;
432
+ max-height: none !important;
433
+ }
434
+
435
+ [data-print='keep'],
436
+ tr,
437
+ li {
438
+ break-inside: avoid;
439
+ }
440
+
441
+ /* A table running past one page repeats its own column headings. */
442
+ thead {
443
+ display: table-header-group;
444
+ }
445
+
446
+ tfoot {
447
+ display: table-footer-group;
448
+ }
449
+
450
+ /*
451
+ * A heading orphaned at the foot of a page belongs to the section on the
452
+ * next one.
453
+ */
454
+ h1,
455
+ h2,
456
+ h3 {
457
+ break-after: avoid;
458
+ }
459
+
460
+ /*
461
+ * The target of a link, for the links a reader cannot follow from paper and
462
+ * could not guess.
463
+ *
464
+ * Absolute links only. An invoice full of "(/portal/invoices/8841)" after
465
+ * every internal link is noise, and the reader holding the paper is already
466
+ * inside that application. A caller whose absolute link is decorative, or
467
+ * whose text is the URL already, opts out per link.
468
+ */
469
+ a[href^='http']:not([data-print='bare'])::after {
470
+ content: ' <' attr(href) '>';
471
+ font-size: 0.85em;
472
+ font-weight: normal;
473
+ word-break: break-all;
474
+ }
475
+ }
@@ -5,22 +5,87 @@
5
5
  * The `<ThemeToggle />` component uses these under the hood; you can also
6
6
  * call them directly when you need to set the theme from a layout, route
7
7
  * loader, or an inline `<script>` that runs before paint.
8
+ *
9
+ * Two vocabularies, and the distinction is the whole point:
10
+ *
11
+ * Theme what is painted. `dark` or `light`, and it is what
12
+ * `data-theme` holds and what every palette rule keys off.
13
+ * ThemePreference what the reader asked for. `dark`, `light`, or `system`,
14
+ * which is a standing instruction to follow the operating
15
+ * system rather than a colour.
16
+ *
17
+ * The kit resolved a preference in exactly one place, the pre-paint script,
18
+ * and nothing else could read it back. A control could therefore offer two
19
+ * states and no third, so a reader who wanted the operating system's choice
20
+ * had to keep re-picking it by hand, and one console forked ThemeToggle rather
21
+ * than ship that. `system` is now a value the storage key holds and every
22
+ * helper here understands.
8
23
  */
24
+ /** What is painted. */
9
25
  export type Theme = 'dark' | 'light';
26
+ /** What the reader asked for. `system` resolves against the OS at read time. */
27
+ export type ThemePreference = Theme | 'system';
28
+ /** The order a control cycles through, and the order a picker lists. */
29
+ export declare const THEME_PREFERENCES: readonly ThemePreference[];
10
30
  /**
11
31
  * Inline-script payload that should run *before* the first paint to avoid
12
32
  * the flash-of-wrong-theme. Drop the returned string into a `<script>` tag
13
33
  * in the `<head>` of your app shell.
14
34
  *
15
35
  * Picks the theme in this order:
16
- * 1. `localStorage["lyeve-theme"]` if set
17
- * 2. The user's OS preference (`prefers-color-scheme`)
18
- * 3. Dark (the default brand palette)
36
+ * 1. `localStorage["lyeve-theme"]` when it holds `'light'` or `'dark'`
37
+ * 2. The user's OS preference (`prefers-color-scheme`), which is also what
38
+ * the stored value `'system'` asks for
39
+ * 3. Dark (the default brand palette), including when storage throws
19
40
  */
20
41
  export declare function themeBootScript(): string;
42
+ /**
43
+ * What the operating system is asking for.
44
+ *
45
+ * Dark unless the OS says light, which is the same fallback the pre-paint
46
+ * script uses and the same one a browser without `matchMedia` gets.
47
+ */
48
+ export declare function systemTheme(): Theme;
49
+ /** The theme a preference resolves to right now. */
50
+ export declare function resolveTheme(preference: ThemePreference): Theme;
51
+ /**
52
+ * What the reader asked for, from storage.
53
+ *
54
+ * `system` when nothing is stored, which is the default this kit resolves by
55
+ * and not a guess: an unanswered question is answered by the operating system,
56
+ * because the reader already answered it there.
57
+ */
58
+ export declare function getThemePreference(): ThemePreference;
21
59
  /** Read the current theme. SSR-safe; returns `'dark'` on the server. */
22
60
  export declare function getTheme(): Theme;
61
+ /**
62
+ * Record a preference, apply what it resolves to, and return the applied theme.
63
+ *
64
+ * `system` is stored under its own name rather than by clearing the key. The
65
+ * two are indistinguishable on the next read otherwise, and they are not the
66
+ * same thing: one reader chose to follow the OS and the other has not chosen
67
+ * anything yet. Both resolve identically today; only one of them is a decision
68
+ * a later default may not override.
69
+ */
70
+ export declare function setThemePreference(preference: ThemePreference): Theme;
23
71
  /** Apply a theme and persist the choice to `localStorage`. */
24
72
  export declare function setTheme(theme: Theme): void;
73
+ /**
74
+ * The next preference in `order`, wrapping at the end.
75
+ *
76
+ * Takes the list so a surface that offers only two states cycles through only
77
+ * those two. A preference that is not in the list starts the cycle at its
78
+ * first entry rather than falling out of it.
79
+ */
80
+ export declare function nextThemePreference(current: ThemePreference, order?: readonly ThemePreference[]): ThemePreference;
25
81
  /** Flip between dark and light. Returns the new theme. */
26
82
  export declare function toggleTheme(): Theme;
83
+ /**
84
+ * Call `onChange` whenever the operating system's choice changes. Returns the
85
+ * unsubscribe function, and a no-op one where there is no `matchMedia`.
86
+ *
87
+ * A page resolving `system` has to repaint when the OS flips at dusk. Without
88
+ * this the preference is honoured once, at load, and reads as ignored for the
89
+ * rest of the session.
90
+ */
91
+ export declare function watchSystemTheme(onChange: (theme: Theme) => void): () => void;
@@ -5,17 +5,46 @@
5
5
  * The `<ThemeToggle />` component uses these under the hood; you can also
6
6
  * call them directly when you need to set the theme from a layout, route
7
7
  * loader, or an inline `<script>` that runs before paint.
8
+ *
9
+ * Two vocabularies, and the distinction is the whole point:
10
+ *
11
+ * Theme what is painted. `dark` or `light`, and it is what
12
+ * `data-theme` holds and what every palette rule keys off.
13
+ * ThemePreference what the reader asked for. `dark`, `light`, or `system`,
14
+ * which is a standing instruction to follow the operating
15
+ * system rather than a colour.
16
+ *
17
+ * The kit resolved a preference in exactly one place, the pre-paint script,
18
+ * and nothing else could read it back. A control could therefore offer two
19
+ * states and no third, so a reader who wanted the operating system's choice
20
+ * had to keep re-picking it by hand, and one console forked ThemeToggle rather
21
+ * than ship that. `system` is now a value the storage key holds and every
22
+ * helper here understands.
23
+ */
24
+ /**
25
+ * The one key every surface in the estate reads and writes.
26
+ *
27
+ * Not exported. A surface that needs the name has `getThemePreference` and
28
+ * `setThemePreference`; a surface that spells the key itself is how two of
29
+ * them ended up on different keys, with the control writing one and the
30
+ * pre-paint script reading the other.
8
31
  */
9
32
  const STORAGE_KEY = 'lyeve-theme';
33
+ /** The order a control cycles through, and the order a picker lists. */
34
+ export const THEME_PREFERENCES = ['light', 'dark', 'system'];
35
+ function isPreference(value) {
36
+ return value === 'light' || value === 'dark' || value === 'system';
37
+ }
10
38
  /**
11
39
  * Inline-script payload that should run *before* the first paint to avoid
12
40
  * the flash-of-wrong-theme. Drop the returned string into a `<script>` tag
13
41
  * in the `<head>` of your app shell.
14
42
  *
15
43
  * Picks the theme in this order:
16
- * 1. `localStorage["lyeve-theme"]` if set
17
- * 2. The user's OS preference (`prefers-color-scheme`)
18
- * 3. Dark (the default brand palette)
44
+ * 1. `localStorage["lyeve-theme"]` when it holds `'light'` or `'dark'`
45
+ * 2. The user's OS preference (`prefers-color-scheme`), which is also what
46
+ * the stored value `'system'` asks for
47
+ * 3. Dark (the default brand palette), including when storage throws
19
48
  */
20
49
  export function themeBootScript() {
21
50
  return `(function () {
@@ -29,12 +58,69 @@ export function themeBootScript() {
29
58
  }
30
59
  })();`;
31
60
  }
61
+ /**
62
+ * What the operating system is asking for.
63
+ *
64
+ * Dark unless the OS says light, which is the same fallback the pre-paint
65
+ * script uses and the same one a browser without `matchMedia` gets.
66
+ */
67
+ export function systemTheme() {
68
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
69
+ return 'dark';
70
+ return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
71
+ }
72
+ /** The theme a preference resolves to right now. */
73
+ export function resolveTheme(preference) {
74
+ return preference === 'system' ? systemTheme() : preference;
75
+ }
76
+ /**
77
+ * What the reader asked for, from storage.
78
+ *
79
+ * `system` when nothing is stored, which is the default this kit resolves by
80
+ * and not a guess: an unanswered question is answered by the operating system,
81
+ * because the reader already answered it there.
82
+ */
83
+ export function getThemePreference() {
84
+ if (typeof localStorage === 'undefined')
85
+ return 'system';
86
+ try {
87
+ const stored = localStorage.getItem(STORAGE_KEY);
88
+ return isPreference(stored) ? stored : 'system';
89
+ }
90
+ catch {
91
+ // Storage may be disabled (private mode, quota). Follow the OS.
92
+ return 'system';
93
+ }
94
+ }
32
95
  /** Read the current theme. SSR-safe; returns `'dark'` on the server. */
33
96
  export function getTheme() {
34
97
  if (typeof document === 'undefined')
35
98
  return 'dark';
36
99
  return document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark';
37
100
  }
101
+ /**
102
+ * Record a preference, apply what it resolves to, and return the applied theme.
103
+ *
104
+ * `system` is stored under its own name rather than by clearing the key. The
105
+ * two are indistinguishable on the next read otherwise, and they are not the
106
+ * same thing: one reader chose to follow the OS and the other has not chosen
107
+ * anything yet. Both resolve identically today; only one of them is a decision
108
+ * a later default may not override.
109
+ */
110
+ export function setThemePreference(preference) {
111
+ const theme = resolveTheme(preference);
112
+ if (typeof document !== 'undefined') {
113
+ document.documentElement.setAttribute('data-theme', theme);
114
+ }
115
+ try {
116
+ localStorage.setItem(STORAGE_KEY, preference);
117
+ }
118
+ catch {
119
+ // Storage may be disabled (private mode, quota); the attribute is applied
120
+ // either way, so the session the reader is in still honours the choice.
121
+ }
122
+ return theme;
123
+ }
38
124
  /** Apply a theme and persist the choice to `localStorage`. */
39
125
  export function setTheme(theme) {
40
126
  if (typeof document === 'undefined')
@@ -47,9 +133,38 @@ export function setTheme(theme) {
47
133
  // Storage may be disabled (private mode, quota); fall through silently.
48
134
  }
49
135
  }
136
+ /**
137
+ * The next preference in `order`, wrapping at the end.
138
+ *
139
+ * Takes the list so a surface that offers only two states cycles through only
140
+ * those two. A preference that is not in the list starts the cycle at its
141
+ * first entry rather than falling out of it.
142
+ */
143
+ export function nextThemePreference(current, order = THEME_PREFERENCES) {
144
+ if (order.length === 0)
145
+ return current;
146
+ const at = order.indexOf(current);
147
+ return at === -1 ? order[0] : order[(at + 1) % order.length];
148
+ }
50
149
  /** Flip between dark and light. Returns the new theme. */
51
150
  export function toggleTheme() {
52
151
  const next = getTheme() === 'dark' ? 'light' : 'dark';
53
152
  setTheme(next);
54
153
  return next;
55
154
  }
155
+ /**
156
+ * Call `onChange` whenever the operating system's choice changes. Returns the
157
+ * unsubscribe function, and a no-op one where there is no `matchMedia`.
158
+ *
159
+ * A page resolving `system` has to repaint when the OS flips at dusk. Without
160
+ * this the preference is honoured once, at load, and reads as ignored for the
161
+ * rest of the session.
162
+ */
163
+ export function watchSystemTheme(onChange) {
164
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
165
+ return () => { };
166
+ const query = window.matchMedia('(prefers-color-scheme: light)');
167
+ const handler = () => onChange(query.matches ? 'light' : 'dark');
168
+ query.addEventListener('change', handler);
169
+ return () => query.removeEventListener('change', handler);
170
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyeve-labs/ui-kit",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "A clean, accessible, palette-aware Svelte 5 component library. The design system behind LyEve.",
5
5
  "license": "MIT",
6
6
  "author": "LyEve Labs <hello@lyeve.com>",
@@ -23,25 +23,9 @@
23
23
  ],
24
24
  "type": "module",
25
25
  "sideEffects": false,
26
- "packageManager": "pnpm@11.25.0",
27
26
  "engines": {
28
27
  "node": ">=20"
29
28
  },
30
- "scripts": {
31
- "build": "pnpm version:check && svelte-package && publint && node scripts/check-dist.mjs",
32
- "version:sync": "node scripts/sync-version.mjs",
33
- "version:check": "node scripts/sync-version.mjs --check",
34
- "package": "pnpm version:check && svelte-package && publint",
35
- "prepublishOnly": "pnpm package",
36
- "check": "svelte-check --tsconfig ./tsconfig.json",
37
- "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
38
- "test": "vitest run",
39
- "test:watch": "vitest",
40
- "test:coverage": "vitest run --coverage",
41
- "test:ct": "playwright test --config playwright-ct.config.ts",
42
- "format": "prettier --write .",
43
- "format:check": "prettier --check ."
44
- },
45
29
  "files": [
46
30
  "dist",
47
31
  "src/lib/styles",
@@ -60,7 +44,8 @@
60
44
  "./package.json": "./package.json"
61
45
  },
62
46
  "peerDependencies": {
63
- "svelte": "^5.0.0"
47
+ "svelte": "^5.0.0",
48
+ "tailwindcss": "^4"
64
49
  },
65
50
  "publishConfig": {
66
51
  "access": "public"
@@ -82,5 +67,19 @@
82
67
  "svelte-check": "^4.4.8",
83
68
  "typescript": "^5.9.3",
84
69
  "vitest": "^2.1.9"
70
+ },
71
+ "scripts": {
72
+ "build": "pnpm version:check && svelte-package && publint && node scripts/check-dist.mjs",
73
+ "version:sync": "node scripts/sync-version.mjs",
74
+ "version:check": "node scripts/sync-version.mjs --check",
75
+ "package": "pnpm version:check && svelte-package && publint",
76
+ "check": "svelte-check --tsconfig ./tsconfig.json",
77
+ "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
78
+ "test": "vitest run",
79
+ "test:watch": "vitest",
80
+ "test:coverage": "vitest run --coverage",
81
+ "test:ct": "playwright test --config playwright-ct.config.ts",
82
+ "format": "prettier --write .",
83
+ "format:check": "prettier --check ."
85
84
  }
86
- }
85
+ }