@mystravil/hardpoint 0.0.0-stage → 0.1.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 (112) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +25 -0
  3. package/README.md +64 -3
  4. package/dist/base.css +346 -0
  5. package/dist/components/AppShell.svelte +698 -0
  6. package/dist/components/AppShell.svelte.d.ts +77 -0
  7. package/dist/components/Button.svelte +174 -0
  8. package/dist/components/Button.svelte.d.ts +20 -0
  9. package/dist/components/Checkbox.svelte +198 -0
  10. package/dist/components/Checkbox.svelte.d.ts +16 -0
  11. package/dist/components/CheckboxGroup.svelte +99 -0
  12. package/dist/components/CheckboxGroup.svelte.d.ts +25 -0
  13. package/dist/components/Combobox.svelte +824 -0
  14. package/dist/components/Combobox.svelte.d.ts +63 -0
  15. package/dist/components/Dialog.svelte +356 -0
  16. package/dist/components/Dialog.svelte.d.ts +43 -0
  17. package/dist/components/Disclosure.svelte +201 -0
  18. package/dist/components/Disclosure.svelte.d.ts +27 -0
  19. package/dist/components/EmptyState.svelte +88 -0
  20. package/dist/components/EmptyState.svelte.d.ts +22 -0
  21. package/dist/components/ErrorState.svelte +135 -0
  22. package/dist/components/ErrorState.svelte.d.ts +26 -0
  23. package/dist/components/KeyValueList.svelte +114 -0
  24. package/dist/components/KeyValueList.svelte.d.ts +43 -0
  25. package/dist/components/LoadRegion.svelte +219 -0
  26. package/dist/components/LoadRegion.svelte.d.ts +27 -0
  27. package/dist/components/MediaFrame.svelte +110 -0
  28. package/dist/components/MediaFrame.svelte.d.ts +20 -0
  29. package/dist/components/MediaImage.svelte +256 -0
  30. package/dist/components/MediaImage.svelte.d.ts +16 -0
  31. package/dist/components/Menu.svelte +258 -0
  32. package/dist/components/Menu.svelte.d.ts +36 -0
  33. package/dist/components/MenuCheckboxItem.svelte +119 -0
  34. package/dist/components/MenuCheckboxItem.svelte.d.ts +15 -0
  35. package/dist/components/MenuGroup.svelte +50 -0
  36. package/dist/components/MenuGroup.svelte.d.ts +15 -0
  37. package/dist/components/MenuItem.svelte +94 -0
  38. package/dist/components/MenuItem.svelte.d.ts +19 -0
  39. package/dist/components/MenuRadioGroup.svelte +62 -0
  40. package/dist/components/MenuRadioGroup.svelte.d.ts +20 -0
  41. package/dist/components/MenuRadioItem.svelte +110 -0
  42. package/dist/components/MenuRadioItem.svelte.d.ts +17 -0
  43. package/dist/components/MenuSeparator.svelte +28 -0
  44. package/dist/components/MenuSeparator.svelte.d.ts +6 -0
  45. package/dist/components/NativeSelect.svelte +119 -0
  46. package/dist/components/NativeSelect.svelte.d.ts +46 -0
  47. package/dist/components/Pagination.svelte +132 -0
  48. package/dist/components/Pagination.svelte.d.ts +18 -0
  49. package/dist/components/Popover.svelte +222 -0
  50. package/dist/components/Popover.svelte.d.ts +35 -0
  51. package/dist/components/Progress.svelte +157 -0
  52. package/dist/components/Progress.svelte.d.ts +34 -0
  53. package/dist/components/Select.svelte +405 -0
  54. package/dist/components/Select.svelte.d.ts +42 -0
  55. package/dist/components/Skeleton.svelte +149 -0
  56. package/dist/components/Skeleton.svelte.d.ts +24 -0
  57. package/dist/components/Spinner.svelte +117 -0
  58. package/dist/components/Spinner.svelte.d.ts +13 -0
  59. package/dist/components/Stat.svelte +253 -0
  60. package/dist/components/Stat.svelte.d.ts +46 -0
  61. package/dist/components/Steps.svelte +189 -0
  62. package/dist/components/Steps.svelte.d.ts +31 -0
  63. package/dist/components/Switch.svelte +222 -0
  64. package/dist/components/Switch.svelte.d.ts +18 -0
  65. package/dist/components/Table.svelte +504 -0
  66. package/dist/components/Table.svelte.d.ts +92 -0
  67. package/dist/components/Tabs.svelte +246 -0
  68. package/dist/components/Tabs.svelte.d.ts +44 -0
  69. package/dist/components/Tag.svelte +40 -0
  70. package/dist/components/Tag.svelte.d.ts +15 -0
  71. package/dist/components/TextField.svelte +256 -0
  72. package/dist/components/TextField.svelte.d.ts +32 -0
  73. package/dist/components/Timeline.svelte +156 -0
  74. package/dist/components/Timeline.svelte.d.ts +30 -0
  75. package/dist/components/Toaster.svelte +411 -0
  76. package/dist/components/Toaster.svelte.d.ts +11 -0
  77. package/dist/components/Tooltip.svelte +200 -0
  78. package/dist/components/Tooltip.svelte.d.ts +38 -0
  79. package/dist/components/TooltipGroup.svelte +46 -0
  80. package/dist/components/TooltipGroup.svelte.d.ts +29 -0
  81. package/dist/components/internal/Scrim.svelte +52 -0
  82. package/dist/components/internal/Scrim.svelte.d.ts +15 -0
  83. package/dist/components/internal/Sheet.svelte +263 -0
  84. package/dist/components/internal/Sheet.svelte.d.ts +36 -0
  85. package/dist/components/internal/fade-in.d.ts +10 -0
  86. package/dist/components/internal/fade-in.js +20 -0
  87. package/dist/components/internal/resolve.d.ts +8 -0
  88. package/dist/components/internal/resolve.js +247 -0
  89. package/dist/components/internal/swipe-dismiss.d.ts +47 -0
  90. package/dist/components/internal/swipe-dismiss.js +220 -0
  91. package/dist/components/internal/visual-viewport.svelte.d.ts +35 -0
  92. package/dist/components/internal/visual-viewport.svelte.js +79 -0
  93. package/dist/components/toast.svelte.d.ts +57 -0
  94. package/dist/components/toast.svelte.js +84 -0
  95. package/dist/fonts/OFL-geist-pixel.txt +92 -0
  96. package/dist/fonts/OFL.txt +93 -0
  97. package/dist/fonts/geist-latin-variable.woff2 +0 -0
  98. package/dist/fonts/geist-mono-latin-variable.woff2 +0 -0
  99. package/dist/fonts/geist-pixel-square.woff2 +0 -0
  100. package/dist/fonts.css +71 -0
  101. package/dist/index.d.ts +39 -0
  102. package/dist/index.js +39 -0
  103. package/dist/motion/Motion.svelte +15 -0
  104. package/dist/motion/Motion.svelte.d.ts +9 -0
  105. package/dist/motion/context.d.ts +18 -0
  106. package/dist/motion/context.js +26 -0
  107. package/dist/motion/index.d.ts +3 -0
  108. package/dist/motion/index.js +3 -0
  109. package/dist/motion/transitions.d.ts +31 -0
  110. package/dist/motion/transitions.js +112 -0
  111. package/dist/tokens.css +279 -0
  112. package/package.json +76 -6
@@ -0,0 +1,57 @@
1
+ /** The one button a toast may carry. Running it dismisses the toast. */
2
+ export type ToastAction = {
3
+ /** A short verb such as "Undo", set in caps. */
4
+ label: string;
5
+ /** Runs after the toast is dismissed. */
6
+ onclick: () => void;
7
+ };
8
+ export type ToastOptions = {
9
+ /**
10
+ * A button after the message. It is a shortcut: the app offers the same
11
+ * step somewhere that does not go away.
12
+ */
13
+ action?: ToastAction;
14
+ /** Milliseconds on screen, pauses not counted: 4000, or 8000 with an action. */
15
+ duration?: number;
16
+ };
17
+ export type ToastHandle = {
18
+ /** Removes this toast now, if it is still the one on screen. */
19
+ dismiss: () => void;
20
+ };
21
+ /** The toast on screen. */
22
+ export type ShownToast = {
23
+ readonly id: number;
24
+ readonly message: string;
25
+ readonly action?: ToastAction;
26
+ };
27
+ /** Why the timer waits: a pointer over the toast, focus inside it, a hidden page. */
28
+ export type ToastHold = 'pointer' | 'focus' | 'hidden';
29
+ /**
30
+ * The one toast slot, in module scope, so `toast()` works from any code
31
+ * without a context and in apps without SvelteKit. It owns the timer; the
32
+ * Toaster that renders the slot reports what holds it.
33
+ */
34
+ declare class ToastSlot {
35
+ #private;
36
+ current: ShownToast | null;
37
+ /** Shows a toast in place of the one on screen and starts its timer again. */
38
+ show(message: string, { action, duration }: ToastOptions): ToastHandle;
39
+ /** Removes the toast on screen, or only toast `id` when given. */
40
+ dismiss(id?: number): void;
41
+ /** Pauses the timer for `reason`; it keeps the time left. */
42
+ hold(reason: ToastHold): void;
43
+ /** Ends a pause; with none left, the timer runs out the time left. */
44
+ release(reason: ToastHold): void;
45
+ /** Adds a mounted Toaster and returns its removal. The first one added renders the slot. */
46
+ register(toaster: object): () => void;
47
+ /** Whether `toaster` renders the slot. */
48
+ renders(toaster: object): boolean;
49
+ }
50
+ export declare const toastSlot: ToastSlot;
51
+ /**
52
+ * Confirms what just happened in a toast at the bottom of the screen. A new
53
+ * toast replaces the one on screen. Plain text only; errors stay inline,
54
+ * next to where things broke. Needs a `<Toaster />` mounted once in the app.
55
+ */
56
+ export declare function toast(message: string, options?: ToastOptions): ToastHandle;
57
+ export {};
@@ -0,0 +1,84 @@
1
+ import { untrack } from 'svelte';
2
+ const TOAST_MS = 4000;
3
+ const TOAST_ACTION_MS = 8000;
4
+ // setTimeout fires at once when the delay does not fit in 32 bits.
5
+ const MAX_DELAY = 2 ** 31 - 1;
6
+ /**
7
+ * The one toast slot, in module scope, so `toast()` works from any code
8
+ * without a context and in apps without SvelteKit. It owns the timer; the
9
+ * Toaster that renders the slot reports what holds it.
10
+ */
11
+ class ToastSlot {
12
+ current = $state.raw(null);
13
+ #toasters = $state.raw([]);
14
+ #holds = new Set();
15
+ #timer;
16
+ #remaining = 0;
17
+ #since = 0;
18
+ #lastId = 0;
19
+ /** Shows a toast in place of the one on screen and starts its timer again. */
20
+ show(message, { action, duration }) {
21
+ const id = ++this.#lastId;
22
+ this.#stop();
23
+ this.current = { id, message, action };
24
+ this.#remaining = Math.min(duration ?? (action ? TOAST_ACTION_MS : TOAST_MS), MAX_DELAY);
25
+ this.#run();
26
+ return { dismiss: () => this.dismiss(id) };
27
+ }
28
+ /** Removes the toast on screen, or only toast `id` when given. */
29
+ dismiss(id) {
30
+ const shown = untrack(() => this.current);
31
+ if (!shown || (id !== undefined && shown.id !== id))
32
+ return;
33
+ this.#stop();
34
+ this.current = null;
35
+ }
36
+ /** Pauses the timer for `reason`; it keeps the time left. */
37
+ hold(reason) {
38
+ if (this.#holds.has(reason))
39
+ return;
40
+ this.#holds.add(reason);
41
+ if (this.#timer === undefined)
42
+ return;
43
+ this.#remaining -= performance.now() - this.#since;
44
+ this.#stop();
45
+ }
46
+ /** Ends a pause; with none left, the timer runs out the time left. */
47
+ release(reason) {
48
+ if (this.#holds.delete(reason))
49
+ this.#run();
50
+ }
51
+ /** Adds a mounted Toaster and returns its removal. The first one added renders the slot. */
52
+ register(toaster) {
53
+ this.#toasters = [...untrack(() => this.#toasters), toaster];
54
+ return () => {
55
+ this.#toasters = this.#toasters.filter((t) => t !== toaster);
56
+ };
57
+ }
58
+ /** Whether `toaster` renders the slot. */
59
+ renders(toaster) {
60
+ return this.#toasters[0] === toaster;
61
+ }
62
+ #run() {
63
+ if (this.#timer !== undefined || this.#holds.size > 0 || !untrack(() => this.current))
64
+ return;
65
+ this.#since = performance.now();
66
+ this.#timer = setTimeout(() => {
67
+ this.#timer = undefined;
68
+ this.current = null;
69
+ }, Math.max(0, this.#remaining));
70
+ }
71
+ #stop() {
72
+ clearTimeout(this.#timer);
73
+ this.#timer = undefined;
74
+ }
75
+ }
76
+ export const toastSlot = new ToastSlot();
77
+ /**
78
+ * Confirms what just happened in a toast at the bottom of the screen. A new
79
+ * toast replaces the one on screen. Plain text only; errors stay inline,
80
+ * next to where things broke. Needs a `<Toaster />` mounted once in the app.
81
+ */
82
+ export function toast(message, options = {}) {
83
+ return toastSlot.show(message, options);
84
+ }
@@ -0,0 +1,92 @@
1
+ Copyright (c) 2023 Vercel, in collaboration with basement.studio
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font creation
14
+ efforts of academic and linguistic communities, and to provide a free and
15
+ open framework in which fonts may be shared and improved in partnership
16
+ with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply
25
+ to any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software components as
36
+ distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to, deleting,
39
+ or substituting -- in part or in whole -- any of the components of the
40
+ Original Version, by changing formats or by porting the Font Software to a
41
+ new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION AND CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
49
+ redistribute, and sell modified and unmodified copies of the Font
50
+ Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components,
53
+ in Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the corresponding
64
+ Copyright Holder. This restriction only applies to the primary font name as
65
+ presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created
77
+ using the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font.git)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
package/dist/fonts.css ADDED
@@ -0,0 +1,71 @@
1
+ /* Hardpoint faces. Import once, before tokens.css. An app that already serves
2
+ Geist (omp-remote) can skip this file and keep its own @font-face rules. */
3
+
4
+ /* Geist: UI, reading text and numbers. Latin subset, variable 100–900. */
5
+ @font-face {
6
+ font-family: 'Geist';
7
+ font-style: normal;
8
+ font-weight: 100 900;
9
+ font-display: swap;
10
+ src: url('./fonts/geist-latin-variable.woff2') format('woff2');
11
+ }
12
+
13
+ /* Geist Mono: identifiers, hashes, timestamps and code. */
14
+ @font-face {
15
+ font-family: 'Geist Mono';
16
+ font-style: normal;
17
+ font-weight: 100 900;
18
+ font-display: swap;
19
+ src: url('./fonts/geist-mono-latin-variable.woff2') format('woff2');
20
+ }
21
+
22
+ /* Geist Pixel Square: the wordmark, one display line per screen and the
23
+ spinner. Single weight. Crisp only at multiples of 26.32px.
24
+ On Windows, Chrome spreads every vertical edge over two pixels in all
25
+ modes (DirectWrite; no CSS switch changes it); horizontal edges stay
26
+ sharp. macOS, iOS and Android are unverified: check them on a device. */
27
+ @font-face {
28
+ font-family: 'Geist Pixel Square';
29
+ font-style: normal;
30
+ font-weight: 400;
31
+ font-display: swap;
32
+ src: url('./fonts/geist-pixel-square.woff2') format('woff2');
33
+ }
34
+
35
+ /* Fallbacks sized to Geist and Geist Mono, so text keeps its width and
36
+ baseline when the real face arrives (font-display: swap). size-adjust is
37
+ the real face's width over the local font's, measured in Chromium over
38
+ every Geist text node of 13 docs pages at 1440 and 390 px wide
39
+ (2026-11-11). One value per font: a separate weight-500 Arial face
40
+ measured worse, because at 500 caps want 95.6% and lowercase 105.9%.
41
+ The overrides give Geist's ascent (1005) and descent (295) at that size.
42
+ Characters outside Geist's Latin subset also come from these faces. */
43
+ @font-face {
44
+ font-family: 'Geist Fallback Arial';
45
+ src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('Arimo');
46
+ size-adjust: 102.8%;
47
+ ascent-override: 97.76%;
48
+ descent-override: 28.7%;
49
+ line-gap-override: 0%;
50
+ }
51
+
52
+ /* Android has no Arial; Roboto is its sans-serif. Unverified on a device. */
53
+ @font-face {
54
+ font-family: 'Geist Fallback Roboto';
55
+ src: local('Roboto'), local('Roboto Regular'), local('Roboto-Regular');
56
+ size-adjust: 103.1%;
57
+ ascent-override: 97.48%;
58
+ descent-override: 28.61%;
59
+ line-gap-override: 0%;
60
+ }
61
+
62
+ /* Consolas is 0.55em wide; Geist Mono, Menlo, Courier New and Android's
63
+ monospace are 0.6em, so only Consolas needs a face. */
64
+ @font-face {
65
+ font-family: 'Geist Mono Fallback';
66
+ src: local('Consolas');
67
+ size-adjust: 109.13%;
68
+ ascent-override: 92.09%;
69
+ descent-override: 27.03%;
70
+ line-gap-override: 0%;
71
+ }
@@ -0,0 +1,39 @@
1
+ export { default as Button, type ButtonProps, type ButtonVariant } from './components/Button.svelte';
2
+ export { default as NativeSelect, type NativeSelectBreakpoint, type NativeSelectOption } from './components/NativeSelect.svelte';
3
+ export { default as Pagination, type PaginationProps } from './components/Pagination.svelte';
4
+ export { default as Select, type SelectItem, type SelectItemSnippetProps, type SelectLabelBeside, type SelectProps } from './components/Select.svelte';
5
+ export { default as Table, type Column, type TableBreakpoint, type TableMark, type TableStack, type TableVariant } from './components/Table.svelte';
6
+ export { default as AppShell, type AppShellCompactNav, type AppShellDestination, type AppShellProps, type AppShellWideNav } from './components/AppShell.svelte';
7
+ export { default as Dialog, type DialogActionsSnippetProps, type DialogProps, type DialogTriggerSnippetProps } from './components/Dialog.svelte';
8
+ export { default as Tag, type TagElement, type TagProps } from './components/Tag.svelte';
9
+ export { default as KeyValueList, type KeyValueItem, type KeyValueListProps } from './components/KeyValueList.svelte';
10
+ export { default as Timeline, type TimelineEvent, type TimelineProps, type TimelineTone } from './components/Timeline.svelte';
11
+ export { default as MediaFrame, type MediaFrameProps } from './components/MediaFrame.svelte';
12
+ export { default as MediaImage, type MediaImageProps } from './components/MediaImage.svelte';
13
+ export { default as TextField, type TextFieldBreakpoint, type TextFieldProps, type TextFieldType } from './components/TextField.svelte';
14
+ export { default as Tabs, type TabsItem, type TabsProps } from './components/Tabs.svelte';
15
+ export { default as Checkbox, type CheckboxProps } from './components/Checkbox.svelte';
16
+ export { default as CheckboxGroup, type CheckboxGroupItem, type CheckboxGroupProps } from './components/CheckboxGroup.svelte';
17
+ export { default as Switch, type SwitchProps } from './components/Switch.svelte';
18
+ export { default as Stat, type StatProps, type StatTone, type StatVariant } from './components/Stat.svelte';
19
+ export { default as Steps, type StepsBreakpoint, type StepsItem, type StepsProps, type StepsState } from './components/Steps.svelte';
20
+ export { default as Progress, type ProgressProps } from './components/Progress.svelte';
21
+ export { default as Spinner, type SpinnerProps } from './components/Spinner.svelte';
22
+ export { default as Skeleton, type SkeletonProps, type SkeletonVariant } from './components/Skeleton.svelte';
23
+ export { default as LoadRegion, type LoadRegionProps } from './components/LoadRegion.svelte';
24
+ export { default as EmptyState, type EmptyStateProps, type EmptyStateTitleElement, type EmptyStateVariant } from './components/EmptyState.svelte';
25
+ export { default as ErrorState, type ErrorStateProps, type ErrorStateTitleElement, type ErrorStateVariant } from './components/ErrorState.svelte';
26
+ export { default as Popover, type PopoverActionsSnippetProps, type PopoverProps, type PopoverTriggerSnippetProps } from './components/Popover.svelte';
27
+ export { default as Menu, type MenuProps, type MenuTriggerSnippetProps } from './components/Menu.svelte';
28
+ export { default as MenuItem, type MenuItemProps, type MenuItemVariant } from './components/MenuItem.svelte';
29
+ export { default as MenuCheckboxItem, type MenuCheckboxItemProps } from './components/MenuCheckboxItem.svelte';
30
+ export { default as MenuRadioGroup, type MenuRadioGroupProps } from './components/MenuRadioGroup.svelte';
31
+ export { default as MenuRadioItem, type MenuRadioItemProps } from './components/MenuRadioItem.svelte';
32
+ export { default as MenuGroup, type MenuGroupProps } from './components/MenuGroup.svelte';
33
+ export { default as MenuSeparator, type MenuSeparatorProps } from './components/MenuSeparator.svelte';
34
+ export { default as Combobox, type ComboboxFilter, type ComboboxItem, type ComboboxItemSnippetProps, type ComboboxLabelBeside, type ComboboxProps } from './components/Combobox.svelte';
35
+ export { default as Tooltip, type TooltipProps, type TooltipTriggerSnippetProps } from './components/Tooltip.svelte';
36
+ export { default as TooltipGroup, type TooltipGroupProps } from './components/TooltipGroup.svelte';
37
+ export { default as Disclosure, type DisclosureProps, type DisclosureTitleElement } from './components/Disclosure.svelte';
38
+ export { default as Toaster, type ToasterProps } from './components/Toaster.svelte';
39
+ export { toast, type ToastAction, type ToastHandle, type ToastOptions } from './components/toast.svelte.js';
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ export { default as Button } from './components/Button.svelte';
2
+ export { default as NativeSelect } from './components/NativeSelect.svelte';
3
+ export { default as Pagination } from './components/Pagination.svelte';
4
+ export { default as Select } from './components/Select.svelte';
5
+ export { default as Table } from './components/Table.svelte';
6
+ export { default as AppShell } from './components/AppShell.svelte';
7
+ export { default as Dialog } from './components/Dialog.svelte';
8
+ export { default as Tag } from './components/Tag.svelte';
9
+ export { default as KeyValueList } from './components/KeyValueList.svelte';
10
+ export { default as Timeline } from './components/Timeline.svelte';
11
+ export { default as MediaFrame } from './components/MediaFrame.svelte';
12
+ export { default as MediaImage } from './components/MediaImage.svelte';
13
+ export { default as TextField } from './components/TextField.svelte';
14
+ export { default as Tabs } from './components/Tabs.svelte';
15
+ export { default as Checkbox } from './components/Checkbox.svelte';
16
+ export { default as CheckboxGroup } from './components/CheckboxGroup.svelte';
17
+ export { default as Switch } from './components/Switch.svelte';
18
+ export { default as Stat } from './components/Stat.svelte';
19
+ export { default as Steps } from './components/Steps.svelte';
20
+ export { default as Progress } from './components/Progress.svelte';
21
+ export { default as Spinner } from './components/Spinner.svelte';
22
+ export { default as Skeleton } from './components/Skeleton.svelte';
23
+ export { default as LoadRegion } from './components/LoadRegion.svelte';
24
+ export { default as EmptyState } from './components/EmptyState.svelte';
25
+ export { default as ErrorState } from './components/ErrorState.svelte';
26
+ export { default as Popover } from './components/Popover.svelte';
27
+ export { default as Menu } from './components/Menu.svelte';
28
+ export { default as MenuItem } from './components/MenuItem.svelte';
29
+ export { default as MenuCheckboxItem } from './components/MenuCheckboxItem.svelte';
30
+ export { default as MenuRadioGroup } from './components/MenuRadioGroup.svelte';
31
+ export { default as MenuRadioItem } from './components/MenuRadioItem.svelte';
32
+ export { default as MenuGroup } from './components/MenuGroup.svelte';
33
+ export { default as MenuSeparator } from './components/MenuSeparator.svelte';
34
+ export { default as Combobox } from './components/Combobox.svelte';
35
+ export { default as Tooltip } from './components/Tooltip.svelte';
36
+ export { default as TooltipGroup } from './components/TooltipGroup.svelte';
37
+ export { default as Disclosure } from './components/Disclosure.svelte';
38
+ export { default as Toaster } from './components/Toaster.svelte';
39
+ export { toast } from './components/toast.svelte.js';
@@ -0,0 +1,15 @@
1
+ <!--
2
+ Sets the motion tier for everything inside it. Renders no element.
3
+ <Motion tier="expressive"> marks an infrequent moment: the first load of a
4
+ view in a session, a success, an empty state filling (BRIEF, Motion).
5
+ -->
6
+ <script lang="ts">
7
+ import type { Snippet } from 'svelte';
8
+ import { setMotionTier, type MotionTier } from './context.js';
9
+
10
+ let { tier = 'quiet', children }: { tier?: MotionTier; children: Snippet } = $props();
11
+
12
+ setMotionTier(() => tier);
13
+ </script>
14
+
15
+ {@render children()}
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ import { type MotionTier } from './context.js';
3
+ type $$ComponentProps = {
4
+ tier?: MotionTier;
5
+ children: Snippet;
6
+ };
7
+ declare const Motion: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type Motion = ReturnType<typeof Motion>;
9
+ export default Motion;
@@ -0,0 +1,18 @@
1
+ /** `quiet` runs motion rules 1 to 5; `expressive` adds rules 6 to 10 (BRIEF, Motion). */
2
+ export type MotionTier = 'quiet' | 'expressive';
3
+ /**
4
+ * Sets the motion tier for this component and its descendants. Call during
5
+ * component initialisation. Pass a getter so the tier can change.
6
+ * `<Motion tier="…">` wraps this for markup.
7
+ */
8
+ export declare function setMotionTier(tier: () => MotionTier): void;
9
+ export interface MotionState {
10
+ /** The tier set by the nearest `<Motion>`, or `quiet`. */
11
+ readonly tier: MotionTier;
12
+ /** The user asked the system for reduced motion. */
13
+ readonly reduced: boolean;
14
+ /** Expressive effects may run: the tier is expressive and motion is not reduced. */
15
+ readonly expressive: boolean;
16
+ }
17
+ /** Reads the motion state. Call during component initialisation; read the fields later, reactively. */
18
+ export declare function useMotion(): MotionState;
@@ -0,0 +1,26 @@
1
+ import { createContext } from 'svelte';
2
+ import { prefersReducedMotion } from 'svelte/motion';
3
+ const [getTier, setTier, hasTier] = createContext();
4
+ /**
5
+ * Sets the motion tier for this component and its descendants. Call during
6
+ * component initialisation. Pass a getter so the tier can change.
7
+ * `<Motion tier="…">` wraps this for markup.
8
+ */
9
+ export function setMotionTier(tier) {
10
+ setTier(tier);
11
+ }
12
+ /** Reads the motion state. Call during component initialisation; read the fields later, reactively. */
13
+ export function useMotion() {
14
+ const tier = hasTier() ? getTier() : () => 'quiet';
15
+ return {
16
+ get tier() {
17
+ return tier();
18
+ },
19
+ get reduced() {
20
+ return prefersReducedMotion.current;
21
+ },
22
+ get expressive() {
23
+ return tier() === 'expressive' && !prefersReducedMotion.current;
24
+ }
25
+ };
26
+ }
@@ -0,0 +1,3 @@
1
+ export { default as Motion } from './Motion.svelte';
2
+ export { setMotionTier, useMotion, type MotionState, type MotionTier } from './context.js';
3
+ export { curve, drawer, duration, fade, pop, sheet } from './transitions.js';
@@ -0,0 +1,3 @@
1
+ export { default as Motion } from './Motion.svelte';
2
+ export { setMotionTier, useMotion } from './context.js';
3
+ export { curve, drawer, duration, fade, pop, sheet } from './transitions.js';
@@ -0,0 +1,31 @@
1
+ import type { EasingFunction, TransitionConfig } from 'svelte/transition';
2
+ type Run = (options?: {
3
+ direction?: 'in' | 'out';
4
+ }) => TransitionConfig;
5
+ /** A duration token on the element, such as `--dur-pop`, in milliseconds. */
6
+ export declare function duration(node: Element, name: string): number;
7
+ /** A `cubic-bezier()` token on the element, such as `--settle`, as an easing function. */
8
+ export declare function curve(node: Element, name?: string): EasingFunction;
9
+ /**
10
+ * Menus, popovers, select lists and tooltips: fade with a 4px move away from
11
+ * the trigger, `--dur-pop` in and `--dur-pop-exit` out. Reads Bits UI's
12
+ * `data-side` to move the right way. Reduced motion: fade only.
13
+ */
14
+ export declare function pop(node: Element, { distance }?: {
15
+ distance?: number;
16
+ }): Run;
17
+ /**
18
+ * Bottom sheets: slide up from the bottom edge, `--dur-sheet` in and
19
+ * `--dur-sheet-exit` out. Reduced motion: fade only.
20
+ */
21
+ export declare function sheet(node: Element): Run;
22
+ /**
23
+ * Side drawers: slide in from the left edge at the sheet timing,
24
+ * `--dur-sheet` in and `--dur-sheet-exit` out. Reduced motion: fade only.
25
+ */
26
+ export declare function drawer(node: Element): Run;
27
+ /** Scrims and other plain fades, timed with the overlay they belong to. */
28
+ export declare function fade(node: Element, { pace }?: {
29
+ pace?: 'pop' | 'sheet';
30
+ }): Run;
31
+ export {};