@gears-frontx/ui-kit 0.3.0-alpha.1
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/LICENSE +201 -0
- package/NOTICE +49 -0
- package/README.md +75 -0
- package/dist/badge.d.ts +1 -0
- package/dist/badge.js +42 -0
- package/dist/badge.js.map +1 -0
- package/dist/button.d.ts +1 -0
- package/dist/button.js +73 -0
- package/dist/button.js.map +1 -0
- package/dist/card.d.ts +1 -0
- package/dist/card.js +54 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.d.ts +1 -0
- package/dist/checkbox.js +46 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chunks/badge.ej-3-Xs4.css +1 -0
- package/dist/chunks/button.CKfALaMe.css +1 -0
- package/dist/chunks/card.B0AcyAT1.css +1 -0
- package/dist/chunks/checkbox.Dd6YDr20.css +1 -0
- package/dist/chunks/dialog.D6LS2vnG.css +1 -0
- package/dist/chunks/dropdown-menu.DmDZc5gB.css +1 -0
- package/dist/chunks/field.BNZx8HfN.css +1 -0
- package/dist/chunks/input.CrRQ0OAn.css +1 -0
- package/dist/chunks/label.jrB9zD_G.css +1 -0
- package/dist/chunks/radio-group.1Y6B0lXt.css +1 -0
- package/dist/chunks/select.BmyP2S2q.css +1 -0
- package/dist/chunks/separator.DdRRkJW4.css +1 -0
- package/dist/chunks/skeleton.BhWSzPnI.css +1 -0
- package/dist/chunks/switch.B_ebMSxR.css +1 -0
- package/dist/chunks/table.r8ppNt1W.css +1 -0
- package/dist/chunks/tabs.DqJE9cX3.css +1 -0
- package/dist/chunks/textarea.BKWvs6fD.css +1 -0
- package/dist/chunks/toast.DMl31Mq4.css +1 -0
- package/dist/chunks/tooltip.apA3VWHJ.css +1 -0
- package/dist/components/badge/badge.d.ts +11 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/public.d.ts +2 -0
- package/dist/components/badge/public.d.ts.map +1 -0
- package/dist/components/button/button.d.ts +50 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/public.d.ts +2 -0
- package/dist/components/button/public.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +22 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/public.d.ts +2 -0
- package/dist/components/card/public.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +6 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/public.d.ts +2 -0
- package/dist/components/checkbox/public.d.ts.map +1 -0
- package/dist/components/dialog/dialog.d.ts +58 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -0
- package/dist/components/dialog/public.d.ts +2 -0
- package/dist/components/dialog/public.d.ts.map +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +70 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu/public.d.ts +2 -0
- package/dist/components/dropdown-menu/public.d.ts.map +1 -0
- package/dist/components/field/field.d.ts +18 -0
- package/dist/components/field/field.d.ts.map +1 -0
- package/dist/components/field/public.d.ts +2 -0
- package/dist/components/field/public.d.ts.map +1 -0
- package/dist/components/input/input.d.ts +6 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/input/public.d.ts +2 -0
- package/dist/components/input/public.d.ts.map +1 -0
- package/dist/components/label/label.d.ts +4 -0
- package/dist/components/label/label.d.ts.map +1 -0
- package/dist/components/label/public.d.ts +2 -0
- package/dist/components/label/public.d.ts.map +1 -0
- package/dist/components/radio-group/public.d.ts +2 -0
- package/dist/components/radio-group/public.d.ts.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +11 -0
- package/dist/components/radio-group/radio-group.d.ts.map +1 -0
- package/dist/components/select/public.d.ts +2 -0
- package/dist/components/select/public.d.ts.map +1 -0
- package/dist/components/select/select.d.ts +61 -0
- package/dist/components/select/select.d.ts.map +1 -0
- package/dist/components/separator/public.d.ts +2 -0
- package/dist/components/separator/public.d.ts.map +1 -0
- package/dist/components/separator/separator.d.ts +6 -0
- package/dist/components/separator/separator.d.ts.map +1 -0
- package/dist/components/skeleton/public.d.ts +2 -0
- package/dist/components/skeleton/public.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +4 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/switch/public.d.ts +2 -0
- package/dist/components/switch/public.d.ts.map +1 -0
- package/dist/components/switch/switch.d.ts +11 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/table/public.d.ts +2 -0
- package/dist/components/table/public.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +38 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/tabs/public.d.ts +2 -0
- package/dist/components/tabs/public.d.ts.map +1 -0
- package/dist/components/tabs/tabs.d.ts +23 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/textarea/public.d.ts +2 -0
- package/dist/components/textarea/public.d.ts.map +1 -0
- package/dist/components/textarea/textarea.d.ts +4 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -0
- package/dist/components/toast/public.d.ts +2 -0
- package/dist/components/toast/public.d.ts.map +1 -0
- package/dist/components/toast/toast.d.ts +85 -0
- package/dist/components/toast/toast.d.ts.map +1 -0
- package/dist/components/tooltip/public.d.ts +2 -0
- package/dist/components/tooltip/public.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +41 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/dialog.d.ts +1 -0
- package/dist/dialog.js +84 -0
- package/dist/dialog.js.map +1 -0
- package/dist/docs/badge.md +82 -0
- package/dist/docs/button.md +102 -0
- package/dist/docs/card.md +131 -0
- package/dist/docs/checkbox.md +55 -0
- package/dist/docs/dialog.md +124 -0
- package/dist/docs/dropdown-menu.md +140 -0
- package/dist/docs/field.md +68 -0
- package/dist/docs/input.md +65 -0
- package/dist/docs/label.md +50 -0
- package/dist/docs/radio-group.md +59 -0
- package/dist/docs/select.md +99 -0
- package/dist/docs/separator.md +119 -0
- package/dist/docs/skeleton.md +143 -0
- package/dist/docs/switch.md +51 -0
- package/dist/docs/table.md +276 -0
- package/dist/docs/tabs.md +124 -0
- package/dist/docs/textarea.md +52 -0
- package/dist/docs/toast.md +153 -0
- package/dist/docs/tooltip.md +134 -0
- package/dist/dropdown-menu.d.ts +1 -0
- package/dist/dropdown-menu.js +183 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/field.d.ts +1 -0
- package/dist/field.js +28 -0
- package/dist/field.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/input.d.ts +1 -0
- package/dist/input.js +30 -0
- package/dist/input.js.map +1 -0
- package/dist/label.d.ts +1 -0
- package/dist/label.js +12 -0
- package/dist/label.js.map +1 -0
- package/dist/radio-group.d.ts +1 -0
- package/dist/radio-group.js +21 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/select.d.ts +1 -0
- package/dist/select.js +175 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +1 -0
- package/dist/separator.js +13 -0
- package/dist/separator.js.map +1 -0
- package/dist/skeleton.d.ts +1 -0
- package/dist/skeleton.js +12 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/switch.d.ts +1 -0
- package/dist/switch.js +26 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.d.ts +1 -0
- package/dist/table.js +64 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.d.ts +1 -0
- package/dist/tabs.js +41 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.d.ts +1 -0
- package/dist/textarea.js +13 -0
- package/dist/textarea.js.map +1 -0
- package/dist/theme.css +485 -0
- package/dist/toast.d.ts +1 -0
- package/dist/toast.js +193 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.d.ts +1 -0
- package/dist/tooltip.js +49 -0
- package/dist/tooltip.js.map +1 -0
- package/llms.txt +148 -0
- package/package.json +85 -0
package/dist/theme.css
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Gears UI Kit theme tokens.
|
|
3
|
+
*
|
|
4
|
+
* Semantic-level CSS variables consumed by all kit components, plus the
|
|
5
|
+
* page-painting rules at the end of this file: importing this file alone is
|
|
6
|
+
* enough for a consumer's page to render correctly light or dark out of the
|
|
7
|
+
* box, with no data-theme attribute required — every component painting its
|
|
8
|
+
* own surface from these same tokens is what makes the rest of the page
|
|
9
|
+
* match. The token structure derives from shadcn/ui (MIT,
|
|
10
|
+
* https://ui.shadcn.com; see the repository NOTICE file for attribution);
|
|
11
|
+
* the values implement the Studio palette from the F-mockups Figma file
|
|
12
|
+
* (variable collection "Studio / shadcn", modes Light + Dark). Figma
|
|
13
|
+
* namespaces the same tokens under a `color/` folder (`color/background`);
|
|
14
|
+
* the CSS names stay unprefixed per the shadcn convention the collection
|
|
15
|
+
* itself is named after. A handful of collection entries are drawn by no
|
|
16
|
+
* mockup node, so their per-mode values are unreadable via the Figma API;
|
|
17
|
+
* those carry a `derived:` comment with the reasoning, and are the ones to
|
|
18
|
+
* re-check when the design file pins them down.
|
|
19
|
+
*
|
|
20
|
+
* Deliberately not here: the `color/workflow/*` and `color/scenario-canvas`
|
|
21
|
+
* entries from the same collection. Figma itself exports them under its own
|
|
22
|
+
* `--studio-*` namespace, which is the line this file follows — they name
|
|
23
|
+
* one consumer's workflow surfaces rather than any kit semantic, and belong
|
|
24
|
+
* to that app's own stylesheet.
|
|
25
|
+
*
|
|
26
|
+
* The line is namespace, not "is a component reading it today": a few groups
|
|
27
|
+
* here (Sidebar Navigation, the code pair, --blue, the four *-soft fills)
|
|
28
|
+
* are unread by any current component. They are part of the collection's
|
|
29
|
+
* unprefixed palette and are carried so a consumer painting a page around
|
|
30
|
+
* the kit — or a later kit component — brands them from the same surface as
|
|
31
|
+
* everything else, instead of finding a hole. Each such group says so at its
|
|
32
|
+
* own declaration; app LAYOUT itself stays a non-goal (see design-notes),
|
|
33
|
+
* so the sidebar tokens are colors for a consumer's own chrome, not a
|
|
34
|
+
* promise of a Sidebar component.
|
|
35
|
+
*
|
|
36
|
+
* Basic branding happens on the consumer side by overriding these variables.
|
|
37
|
+
* Dark mode: set data-theme="dark" on <html>/<body> for explicit control, or
|
|
38
|
+
* rely on the prefers-color-scheme fallback below.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* Theme-invariant tokens: shape, scale and scrim, not color. Deliberately
|
|
43
|
+
* declared on `:root` alone, outside every theme block below — a theme scope
|
|
44
|
+
* overrides colors, never shape or scale, so a `data-theme` subtree inherits
|
|
45
|
+
* whatever the consumer set globally instead of snapping back to these kit
|
|
46
|
+
* defaults. Filing them under a theme selector (e.g. `[data-theme='light']`)
|
|
47
|
+
* would break that: a `<section data-theme="light">` nested under a
|
|
48
|
+
* consumer's rebranded `--radius` would reset to the kit default here
|
|
49
|
+
* instead of inheriting the brand value, just because it happens to sit in
|
|
50
|
+
* a light-forced scope.
|
|
51
|
+
*/
|
|
52
|
+
:root {
|
|
53
|
+
/*
|
|
54
|
+
* Scrim behind modal-style popups (Dialog's backdrop). Unlike every color
|
|
55
|
+
* token below, it is not redefined in [data-theme='dark'] or the
|
|
56
|
+
* prefers-color-scheme block: a dark tint dims the page in both light and
|
|
57
|
+
* dark UI, whereas --foreground would flip to near-white in dark mode and
|
|
58
|
+
* brighten instead of dim.
|
|
59
|
+
*/
|
|
60
|
+
--overlay: oklch(0 0 0 / 50%);
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
* Popover chrome shared by every card-like popup (Dialog/DropdownMenu/
|
|
64
|
+
* Select/Toast): a 1px ring plus a two-layer drop shadow, previously
|
|
65
|
+
* hand-duplicated verbatim in all four modules (plus the ring half in
|
|
66
|
+
* Card, which has no real `border` to spend — see card.module.css). All
|
|
67
|
+
* four consumers already paint their surface from the --popover/
|
|
68
|
+
* --popover-foreground pair, so this chrome takes the same family name
|
|
69
|
+
* rather than "--overlay-*", which would read as a variant of --overlay
|
|
70
|
+
* above (the modal *scrim*, an unrelated concept — a popover has no
|
|
71
|
+
* backdrop) and reversed word order from it besides. --popover-shadow is
|
|
72
|
+
* COMPOSED from --popover-border (both its layers are that same color),
|
|
73
|
+
* not just co-located with it: rebranding the hairline recolors the
|
|
74
|
+
* shadow along with it, by construction, not as a separate edit anyone
|
|
75
|
+
* has to remember to make. Same rationale as --overlay above for living
|
|
76
|
+
* here un-redefined regardless: both are mixed from --foreground, so the
|
|
77
|
+
* computed value already flips correctly per theme without a separate
|
|
78
|
+
* light/dark declaration.
|
|
79
|
+
*/
|
|
80
|
+
--popover-border: color-mix(in oklab, var(--foreground) 10%, transparent);
|
|
81
|
+
--popover-shadow:
|
|
82
|
+
0 4px 6px -1px var(--popover-border),
|
|
83
|
+
0 2px 4px -2px var(--popover-border);
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* Radius scale. Components consume only the derived steps; consumers
|
|
87
|
+
* rebrand by overriding --radius alone and the whole scale follows. The
|
|
88
|
+
* offsets place the Studio scale (sm 6 / md 8 / lg 12 / xl 16) on the
|
|
89
|
+
* 8px base — note md, not lg, sits at the base value, unlike shadcn v4's
|
|
90
|
+
* derivation. --radius-xs has no Figma counterpart; it predates the
|
|
91
|
+
* Studio scale and keeps its 4px slot. Corner shape isn't a light/dark
|
|
92
|
+
* concern, so none of this is redefined per-theme.
|
|
93
|
+
*/
|
|
94
|
+
--radius: 0.5rem;
|
|
95
|
+
--radius-xs: calc(var(--radius) - 4px);
|
|
96
|
+
--radius-sm: calc(var(--radius) - 2px);
|
|
97
|
+
--radius-md: var(--radius);
|
|
98
|
+
--radius-lg: calc(var(--radius) + 4px);
|
|
99
|
+
--radius-xl: calc(var(--radius) + 8px);
|
|
100
|
+
|
|
101
|
+
/* Spacing scale (Figma space/1–8; the step number is the value in 4px
|
|
102
|
+
* units, so there is no space/7). */
|
|
103
|
+
--space-1: 0.25rem;
|
|
104
|
+
--space-2: 0.5rem;
|
|
105
|
+
--space-3: 0.75rem;
|
|
106
|
+
--space-4: 1rem;
|
|
107
|
+
--space-5: 1.25rem;
|
|
108
|
+
--space-6: 1.5rem;
|
|
109
|
+
--space-8: 2rem;
|
|
110
|
+
|
|
111
|
+
/*
|
|
112
|
+
* Control metrics (Figma control/height/*, icon/size/*, border/width/*).
|
|
113
|
+
* Heights follow the DRAWN control specimens (32/36/40) — the design
|
|
114
|
+
* file's "Token architecture" text says 32/40/44, but the drawn mockups
|
|
115
|
+
* are the source of truth for that discrepancy (a standing ruling; see
|
|
116
|
+
* design-notes.md). Buttons sit on sm/md/lg directly; the drawn fields are
|
|
117
|
+
* 40px (the lg step) and the filter chip 36px (md).
|
|
118
|
+
*/
|
|
119
|
+
--control-height-sm: 2rem;
|
|
120
|
+
--control-height-md: 2.25rem;
|
|
121
|
+
--control-height-lg: 2.5rem;
|
|
122
|
+
--icon-size-sm: 1rem;
|
|
123
|
+
--icon-size-md: 1.25rem;
|
|
124
|
+
--icon-size-lg: 1.5rem;
|
|
125
|
+
--border-width: 1px;
|
|
126
|
+
--border-width-focus: 2px;
|
|
127
|
+
/*
|
|
128
|
+
* The thickness a --border-width-focus ring adds INSIDE a --border-width
|
|
129
|
+
* border. Every 2px ring in the kit — focus, aria-invalid, and Table's
|
|
130
|
+
* selected row — is drawn as a recolored 1px border plus an inset shadow
|
|
131
|
+
* of this width rather than as a real border-width switch, so the ring
|
|
132
|
+
* thickens without the element's box changing: a genuine width switch
|
|
133
|
+
* grows it 1px on each edge, which shifts a control's text and, in a
|
|
134
|
+
* table, every row below the selected one. Named here rather than spelled
|
|
135
|
+
* out per module because it is one decision shared by eight components,
|
|
136
|
+
* not eight coincidences.
|
|
137
|
+
*/
|
|
138
|
+
--ring-inset: calc(var(--border-width-focus) - var(--border-width));
|
|
139
|
+
|
|
140
|
+
/*
|
|
141
|
+
* Typography (Figma "Typography / Specimens", frame 175:371 — the Studio
|
|
142
|
+
* text styles, recorded verbatim). The kit ships no font FILES: loading
|
|
143
|
+
* Inter/JetBrains Mono (@font-face, preload, subsetting) is the
|
|
144
|
+
* consumer's build concern; until they load, the fallback stacks keep
|
|
145
|
+
* metrics close. "Body Medium"/"Mono Medium" are not separate roles —
|
|
146
|
+
* the same metrics at weight 500.
|
|
147
|
+
*
|
|
148
|
+
* The specimens-vs-ramp conflict is settled: the drawn component
|
|
149
|
+
* specimens hand-set line-heights the ramp doesn't have (13/18, 12/17,
|
|
150
|
+
* plus a 10px table header with no role at all), and the ruling is that
|
|
151
|
+
* the token system wins — component text sits on these roles, off-ramp
|
|
152
|
+
* drawn metrics were normalized to the nearest role, and the same ruling
|
|
153
|
+
* snapped off-grid spacing onto --space-*. A tokens.test.ts guard enforces
|
|
154
|
+
* it; design-notes.md records it.
|
|
155
|
+
*/
|
|
156
|
+
--font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
157
|
+
--font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
158
|
+
/* Display: 28/34 semibold. */
|
|
159
|
+
--text-display-size: 1.75rem;
|
|
160
|
+
--text-display-line-height: 2.125rem;
|
|
161
|
+
--text-display-weight: 600;
|
|
162
|
+
--text-display-tracking: -0.4px;
|
|
163
|
+
/* Heading 1: 20/28 semibold. */
|
|
164
|
+
--text-heading-1-size: 1.25rem;
|
|
165
|
+
--text-heading-1-line-height: 1.75rem;
|
|
166
|
+
--text-heading-1-weight: 600;
|
|
167
|
+
--text-heading-1-tracking: -0.2px;
|
|
168
|
+
/* Heading 2: 16/24 semibold. */
|
|
169
|
+
--text-heading-2-size: 1rem;
|
|
170
|
+
--text-heading-2-line-height: 1.5rem;
|
|
171
|
+
--text-heading-2-weight: 600;
|
|
172
|
+
--text-heading-2-tracking: -0.1px;
|
|
173
|
+
/* Body: 15/20 regular (Body Medium = weight 500). */
|
|
174
|
+
--text-body-size: 0.9375rem;
|
|
175
|
+
--text-body-line-height: 1.25rem;
|
|
176
|
+
--text-body-weight: 400;
|
|
177
|
+
--text-body-tracking: 0px;
|
|
178
|
+
/* Label: 13/16 medium. */
|
|
179
|
+
--text-label-size: 0.8125rem;
|
|
180
|
+
--text-label-line-height: 1rem;
|
|
181
|
+
--text-label-weight: 500;
|
|
182
|
+
--text-label-tracking: 0.1px;
|
|
183
|
+
/* Meta: 12/16 regular. */
|
|
184
|
+
--text-meta-size: 0.75rem;
|
|
185
|
+
--text-meta-line-height: 1rem;
|
|
186
|
+
--text-meta-weight: 400;
|
|
187
|
+
--text-meta-tracking: 0.1px;
|
|
188
|
+
/* Mono: 11/16 regular, --font-mono (Mono Medium = weight 500). */
|
|
189
|
+
--text-mono-size: 0.6875rem;
|
|
190
|
+
--text-mono-line-height: 1rem;
|
|
191
|
+
--text-mono-weight: 400;
|
|
192
|
+
--text-mono-tracking: 0px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
:root,
|
|
196
|
+
[data-theme='light'] {
|
|
197
|
+
--background: #f8fafc;
|
|
198
|
+
--foreground: #0f172a;
|
|
199
|
+
|
|
200
|
+
/* Flat and raised panel fills. Both are white in light mode — the pair
|
|
201
|
+
* only separates visually in dark mode — but components must still pick
|
|
202
|
+
* the semantically right one so the dark theme comes out layered. */
|
|
203
|
+
--surface: #ffffff;
|
|
204
|
+
--surface-elevated: #ffffff;
|
|
205
|
+
|
|
206
|
+
--card: #ffffff;
|
|
207
|
+
--card-hover: #f8fafc;
|
|
208
|
+
--card-foreground: #0f172a;
|
|
209
|
+
|
|
210
|
+
/* derived: no mockup node draws with popover/*; overlays in the mockups
|
|
211
|
+
* sit on --surface-elevated, so popover mirrors it in both modes. */
|
|
212
|
+
--popover: #ffffff;
|
|
213
|
+
--popover-foreground: #0f172a;
|
|
214
|
+
|
|
215
|
+
--primary: #8257e6;
|
|
216
|
+
/* derived (light only): the dark mode's hover is the light primary, so
|
|
217
|
+
* the light hover takes the dark primary — one step down the same ramp.
|
|
218
|
+
* The dark value is Figma's own. */
|
|
219
|
+
--primary-hover: #7c4fde;
|
|
220
|
+
--primary-foreground: #ffffff;
|
|
221
|
+
--secondary: #f1f5f9;
|
|
222
|
+
--secondary-foreground: #0f172a;
|
|
223
|
+
/* derived (dark only): light muted equals light secondary in the
|
|
224
|
+
* collection, so dark muted follows dark secondary the same way. */
|
|
225
|
+
--muted: #f1f5f9;
|
|
226
|
+
--muted-foreground: #64748b;
|
|
227
|
+
/*
|
|
228
|
+
* Table's header row is the only consumer (tokens.test.ts's leading-class
|
|
229
|
+
* guard doesn't reach theme.css itself, but a grep confirms it — see
|
|
230
|
+
* table.module.css). Not the drawn value: each mode's drawn value failed
|
|
231
|
+
* the 4.5:1 AA floor against the header's own --surface fill (light
|
|
232
|
+
* #94a3b8 at 2.56:1, dark #667085 at 3.74:1), so both were replaced.
|
|
233
|
+
* AA leaves this token no room to read lighter than --muted-foreground in
|
|
234
|
+
* light mode (anything less saturated than ~this value fails against
|
|
235
|
+
* --surface's near-white), so light converges close to it; dark keeps a
|
|
236
|
+
* visibly dimmer, genuinely "subtler" step since --surface is dark enough
|
|
237
|
+
* to leave headroom. The ratios and the open designer question — pin
|
|
238
|
+
* AA-passing values in the Figma file — are in design-notes.md.
|
|
239
|
+
*/
|
|
240
|
+
--subtle-foreground: #5f6f88;
|
|
241
|
+
--accent: #f3e8ff;
|
|
242
|
+
--accent-foreground: #6d28d9;
|
|
243
|
+
|
|
244
|
+
/* derived: no mockup node draws with destructive/*, so it aliases danger —
|
|
245
|
+
* one red, two names, both overridable separately. White text clears AA
|
|
246
|
+
* on both modes' reds (4.7:1 light, 4.6:1 dark). */
|
|
247
|
+
--destructive: #e11d48;
|
|
248
|
+
--destructive-foreground: #ffffff;
|
|
249
|
+
|
|
250
|
+
/*
|
|
251
|
+
* Link text token — Button's `link` variant, which has no drawn
|
|
252
|
+
* counterpart to align to: the mockups' Button panel draws no borderless
|
|
253
|
+
* text variant, so there is no specimen color to take. --primary itself
|
|
254
|
+
* measured 4.51:1 light
|
|
255
|
+
* (barely over the 4.5:1 AA floor for this 13px text — 0.005 of headroom,
|
|
256
|
+
* so close that a future one-step nudge to --background could silently
|
|
257
|
+
* fail it again) and 3.78:1 dark (a clear fail) against the page
|
|
258
|
+
* background the borderless variant sits on. derived: light takes
|
|
259
|
+
* --primary-hover's value instead of --primary's own (still the same
|
|
260
|
+
* violet family, one step darker) for real headroom — 4.98:1, not a
|
|
261
|
+
* borderline pass; dark takes a lighter tint of the same hue.
|
|
262
|
+
*/
|
|
263
|
+
--link-foreground: #7c4fde;
|
|
264
|
+
|
|
265
|
+
/* Status colors with their -soft fills. The status colors themselves are
|
|
266
|
+
* consumed — Badge's dot and label text, Table's stale/restricted row
|
|
267
|
+
* rings; the four -soft fills are NOT read by any component yet — nothing
|
|
268
|
+
* in the kit currently paints a tinted status surface, since Badge draws
|
|
269
|
+
* its status on the dot and label over a neutral fill and the table states
|
|
270
|
+
* recolor the row's ring. They are kept as the Figma collection's own
|
|
271
|
+
* pairs so a later tinted surface doesn't have to re-derive them, and
|
|
272
|
+
* because the pair is what makes the derivation below reviewable. Dark
|
|
273
|
+
* warning-soft and info-soft are
|
|
274
|
+
* corroborated by the workflow aliases that resolve to the same values;
|
|
275
|
+
* dark danger-soft and light warning-soft are drawn nowhere — derived:
|
|
276
|
+
* chosen to sit in the same tint family as their corroborated siblings,
|
|
277
|
+
* not from one reproducible mix recipe (the four -soft values don't share
|
|
278
|
+
* a single formula against their base hue). */
|
|
279
|
+
--success: #059669;
|
|
280
|
+
--success-soft: #e8f8f1;
|
|
281
|
+
--warning: #d97706;
|
|
282
|
+
--warning-soft: #fdf3e2;
|
|
283
|
+
--danger: #e11d48;
|
|
284
|
+
--danger-soft: #fff1f2;
|
|
285
|
+
--info: #0284c7;
|
|
286
|
+
--info-soft: #eaf6ff;
|
|
287
|
+
/* A palette entry, not a semantic: --info is the token a component reaches
|
|
288
|
+
* for, and nothing in the kit reads this one. Kept because the collection
|
|
289
|
+
* names it separately from --info.
|
|
290
|
+
* derived (light only): dark is Figma's blue-400; light takes the same
|
|
291
|
+
* Tailwind ramp one step down (blue-500). */
|
|
292
|
+
--blue: #3b82f6;
|
|
293
|
+
|
|
294
|
+
--border: #e2e8f0;
|
|
295
|
+
--border-strong: #cbd5e1;
|
|
296
|
+
/* Field-control borders. Not derived: the mockups' Field set (frame
|
|
297
|
+
* 193:433) strokes every input/textarea/select with the border-strong
|
|
298
|
+
* value, so input carries it in both modes. */
|
|
299
|
+
--input: #cbd5e1;
|
|
300
|
+
/* Focus color. Light from the MVP Foundations frame; dark is drawn by
|
|
301
|
+
* the Field focus specimens (frame 193:383 strokes focus with the dark
|
|
302
|
+
* primary value), so neither mode is derived. */
|
|
303
|
+
--ring: #8b5cf6;
|
|
304
|
+
|
|
305
|
+
/* Sidebar Navigation block. Palette only — no kit component reads these
|
|
306
|
+
* (app layout is a non-goal; see design-notes), they brand a consumer's
|
|
307
|
+
* own navigation chrome from the same surface as the rest.
|
|
308
|
+
* --sidebar/--sidebar-accent are each drawn by their own dark-mode mockup
|
|
309
|
+
* node; the other three are not — named individually below, per this
|
|
310
|
+
* file's derived-marker convention. */
|
|
311
|
+
--sidebar: #f1f5f9;
|
|
312
|
+
/* derived (dark only): follows dark --muted-foreground. */
|
|
313
|
+
--sidebar-foreground: #64748b;
|
|
314
|
+
--sidebar-accent: #ffffff;
|
|
315
|
+
/* derived (dark only): follows dark --foreground. */
|
|
316
|
+
--sidebar-accent-foreground: #0f172a;
|
|
317
|
+
/* derived (dark only): follows dark --border. */
|
|
318
|
+
--sidebar-border: #e2e8f0;
|
|
319
|
+
|
|
320
|
+
/* Also palette-only: the kit ships no code/pre component, so these exist
|
|
321
|
+
* for a consumer rendering code blocks beside kit parts. */
|
|
322
|
+
--code-background: #f1f5f9;
|
|
323
|
+
--code-foreground: #334155;
|
|
324
|
+
|
|
325
|
+
/*
|
|
326
|
+
* Hands UA-owned surfaces (scrollbar, spellcheck underline, <input>
|
|
327
|
+
* autofill, form-control chrome) the light palette. The dark blocks below
|
|
328
|
+
* set this to `dark`; without it those surfaces keep following the OS
|
|
329
|
+
* default regardless of our tokens.
|
|
330
|
+
*/
|
|
331
|
+
color-scheme: light;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
[data-theme='dark'] {
|
|
335
|
+
--background: #090b10;
|
|
336
|
+
--foreground: #f6f7f9;
|
|
337
|
+
--surface: #0f131b;
|
|
338
|
+
--surface-elevated: #131824;
|
|
339
|
+
--card: #111722;
|
|
340
|
+
--card-hover: #151c29;
|
|
341
|
+
--card-foreground: #f6f7f9;
|
|
342
|
+
--popover: #131824;
|
|
343
|
+
--popover-foreground: #f6f7f9;
|
|
344
|
+
--primary: #7c4fde;
|
|
345
|
+
--primary-hover: #8257e6;
|
|
346
|
+
--primary-foreground: #ffffff;
|
|
347
|
+
--secondary: #1e293b;
|
|
348
|
+
--secondary-foreground: #f8fafc;
|
|
349
|
+
--muted: #1e293b;
|
|
350
|
+
--muted-foreground: #8d96a8;
|
|
351
|
+
--subtle-foreground: #7a8396;
|
|
352
|
+
--accent: #2e1065;
|
|
353
|
+
--accent-foreground: #ede9fe;
|
|
354
|
+
--destructive: #d63853;
|
|
355
|
+
--destructive-foreground: #ffffff;
|
|
356
|
+
--link-foreground: #a78bfa;
|
|
357
|
+
--success: #34d399;
|
|
358
|
+
--success-soft: #0d2921;
|
|
359
|
+
--warning: #fbbf24;
|
|
360
|
+
--warning-soft: #2e240a;
|
|
361
|
+
--danger: #d63853;
|
|
362
|
+
--danger-soft: #2b1119;
|
|
363
|
+
--info: #22d3ee;
|
|
364
|
+
--info-soft: #06262b;
|
|
365
|
+
--blue: #60a5fa;
|
|
366
|
+
--border: #222a38;
|
|
367
|
+
--border-strong: #303a4d;
|
|
368
|
+
--input: #303a4d;
|
|
369
|
+
--ring: #7c4fde;
|
|
370
|
+
--sidebar: #0c0f15;
|
|
371
|
+
--sidebar-foreground: #8d96a8;
|
|
372
|
+
--sidebar-accent: #172033;
|
|
373
|
+
--sidebar-accent-foreground: #f6f7f9;
|
|
374
|
+
--sidebar-border: #222a38;
|
|
375
|
+
--code-background: #0b1220;
|
|
376
|
+
--code-foreground: #e2e8f0;
|
|
377
|
+
|
|
378
|
+
/* See the light block's color-scheme comment above for why this exists. */
|
|
379
|
+
color-scheme: dark;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
@media (prefers-color-scheme: dark) {
|
|
383
|
+
:root:not([data-theme='light']) {
|
|
384
|
+
--background: #090b10;
|
|
385
|
+
--foreground: #f6f7f9;
|
|
386
|
+
--surface: #0f131b;
|
|
387
|
+
--surface-elevated: #131824;
|
|
388
|
+
--card: #111722;
|
|
389
|
+
--card-hover: #151c29;
|
|
390
|
+
--card-foreground: #f6f7f9;
|
|
391
|
+
--popover: #131824;
|
|
392
|
+
--popover-foreground: #f6f7f9;
|
|
393
|
+
--primary: #7c4fde;
|
|
394
|
+
--primary-hover: #8257e6;
|
|
395
|
+
--primary-foreground: #ffffff;
|
|
396
|
+
--secondary: #1e293b;
|
|
397
|
+
--secondary-foreground: #f8fafc;
|
|
398
|
+
--muted: #1e293b;
|
|
399
|
+
--muted-foreground: #8d96a8;
|
|
400
|
+
--subtle-foreground: #7a8396;
|
|
401
|
+
--accent: #2e1065;
|
|
402
|
+
--accent-foreground: #ede9fe;
|
|
403
|
+
--destructive: #d63853;
|
|
404
|
+
--destructive-foreground: #ffffff;
|
|
405
|
+
--link-foreground: #a78bfa;
|
|
406
|
+
--success: #34d399;
|
|
407
|
+
--success-soft: #0d2921;
|
|
408
|
+
--warning: #fbbf24;
|
|
409
|
+
--warning-soft: #2e240a;
|
|
410
|
+
--danger: #d63853;
|
|
411
|
+
--danger-soft: #2b1119;
|
|
412
|
+
--info: #22d3ee;
|
|
413
|
+
--info-soft: #06262b;
|
|
414
|
+
--blue: #60a5fa;
|
|
415
|
+
--border: #222a38;
|
|
416
|
+
--border-strong: #303a4d;
|
|
417
|
+
--input: #303a4d;
|
|
418
|
+
--ring: #7c4fde;
|
|
419
|
+
--sidebar: #0c0f15;
|
|
420
|
+
--sidebar-foreground: #8d96a8;
|
|
421
|
+
--sidebar-accent: #172033;
|
|
422
|
+
--sidebar-accent-foreground: #f6f7f9;
|
|
423
|
+
--sidebar-border: #222a38;
|
|
424
|
+
--code-background: #0b1220;
|
|
425
|
+
--code-foreground: #e2e8f0;
|
|
426
|
+
|
|
427
|
+
/* See the light block's color-scheme comment above for why this exists. */
|
|
428
|
+
color-scheme: dark;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/*
|
|
433
|
+
* Paint the page itself. Tokens alone only flip descendants' custom-property
|
|
434
|
+
* values — nothing is visible until something actually consumes them via
|
|
435
|
+
* background-color/color. Two selectors, two jobs:
|
|
436
|
+
* - `body`: fixes the default, no-attribute case. `html` carries no
|
|
437
|
+
* background of its own, so body's background is what the canvas
|
|
438
|
+
* actually shows. A single-element selector (specificity 0,0,1) is used
|
|
439
|
+
* deliberately so a consumer's own `body { background: ... }` rule can
|
|
440
|
+
* override it without `!important` — but that only holds when
|
|
441
|
+
* `data-theme` lives on `<html>`, as llms.txt recommends. A consumer who
|
|
442
|
+
* instead puts `data-theme` on `<body>` and then repaints that same
|
|
443
|
+
* element needs a rule of matching specificity (an attribute selector,
|
|
444
|
+
* or `!important`): once the attribute sits on `<body>`, the
|
|
445
|
+
* `[data-theme]` half below targets that same element and, at
|
|
446
|
+
* specificity 0,1,0, outranks a plain `body { ... }` override.
|
|
447
|
+
* - `[data-theme]`: makes a *scoped* theme paint its own surface, not just
|
|
448
|
+
* flip its descendants' tokens. Without this, a `data-theme="dark"`
|
|
449
|
+
* subtree nested in a light page would flip its descendants' colors but
|
|
450
|
+
* sit on the still-light background behind it (case (d) below).
|
|
451
|
+
*
|
|
452
|
+
* Cascade check against all four ways a theme can resolve (an explicit
|
|
453
|
+
* attribute always wins over the media query; no attribute falls through to
|
|
454
|
+
* it):
|
|
455
|
+
* (a) no attribute, prefers light -> only the plain `:root` half of the
|
|
456
|
+
* light block applies -> light tokens, color-scheme: light.
|
|
457
|
+
* (b) no attribute, prefers dark -> the light block sets light tokens on
|
|
458
|
+
* `:root` first, then `:root:not([data-theme='light'])` inside the
|
|
459
|
+
* media query overrides them (no attribute present, so :not matches)
|
|
460
|
+
* -> dark tokens win, color-scheme: dark.
|
|
461
|
+
* (c) data-theme="light", prefers dark -> `[data-theme='light']` sets
|
|
462
|
+
* light tokens; the media query's `:not([data-theme='light'])` guard
|
|
463
|
+
* now fails to match, so the dark override never applies -> light
|
|
464
|
+
* tokens win, color-scheme: light.
|
|
465
|
+
* (d) data-theme="dark" nested inside a light page -> `[data-theme='dark']`
|
|
466
|
+
* matches that element directly, setting dark tokens that cascade to
|
|
467
|
+
* its descendants; this rule's `[data-theme]` half paints that same
|
|
468
|
+
* element's own background/color from the now-dark tokens, instead of
|
|
469
|
+
* leaving its light-themed ancestor's background showing through ->
|
|
470
|
+
* dark tokens win, scoped to that subtree.
|
|
471
|
+
*
|
|
472
|
+
* No literal colors here — the page paints from the same tokens components
|
|
473
|
+
* consume, so it always tracks whichever case above resolved.
|
|
474
|
+
*/
|
|
475
|
+
body,
|
|
476
|
+
[data-theme] {
|
|
477
|
+
background-color: var(--background);
|
|
478
|
+
color: var(--foreground);
|
|
479
|
+
/* The app font, same override story as the colors: consumers rebrand by
|
|
480
|
+
* overriding --font-sans, not this rule. On `body` (not `html`) so it
|
|
481
|
+
* shares the single-element specificity reasoning above; repeated on
|
|
482
|
+
* [data-theme] only for symmetry with the paint — font-family inherits
|
|
483
|
+
* anyway, so a themed subtree changes nothing here. */
|
|
484
|
+
font-family: var(--font-sans);
|
|
485
|
+
}
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/toast/public.js'
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Toast as e } from "@base-ui/react/toast";
|
|
3
|
+
import { cx as i } from "class-variance-authority";
|
|
4
|
+
import { Button as a } from "./button.js";
|
|
5
|
+
import './chunks/toast.DMl31Mq4.css';const h = "_viewport_12x05_12", p = "_toast_12x05_10", _ = "_content_12x05_76", v = "_icon_12x05_253", m = "_iconDestructive_12x05_260", k = "_iconSpin_12x05_264", f = "_body_12x05_289", x = "_title_12x05_301", g = "_description_12x05_308", N = "_action_12x05_316", L = "_close_12x05_323", M = "_svgIcon_12x05_346", n = {
|
|
6
|
+
viewport: h,
|
|
7
|
+
toast: p,
|
|
8
|
+
content: _,
|
|
9
|
+
icon: v,
|
|
10
|
+
iconDestructive: m,
|
|
11
|
+
iconSpin: k,
|
|
12
|
+
body: f,
|
|
13
|
+
title: x,
|
|
14
|
+
description: g,
|
|
15
|
+
action: N,
|
|
16
|
+
close: L,
|
|
17
|
+
svgIcon: M
|
|
18
|
+
};
|
|
19
|
+
function T({ className: t }) {
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
21
|
+
"svg",
|
|
22
|
+
{
|
|
23
|
+
className: i(n.icon, t),
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
fill: "none",
|
|
26
|
+
stroke: "currentColor",
|
|
27
|
+
strokeWidth: "2",
|
|
28
|
+
strokeLinecap: "round",
|
|
29
|
+
strokeLinejoin: "round",
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10" }),
|
|
33
|
+
/* @__PURE__ */ o("path", { d: "m9 12 2 2 4-4" })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function w({ className: t }) {
|
|
39
|
+
return /* @__PURE__ */ r(
|
|
40
|
+
"svg",
|
|
41
|
+
{
|
|
42
|
+
className: i(n.icon, t),
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: "2",
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round",
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "10" }),
|
|
52
|
+
/* @__PURE__ */ o("path", { d: "M12 16v-4" }),
|
|
53
|
+
/* @__PURE__ */ o("path", { d: "M12 8h.01" })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function C({ className: t }) {
|
|
59
|
+
return /* @__PURE__ */ r(
|
|
60
|
+
"svg",
|
|
61
|
+
{
|
|
62
|
+
className: i(n.icon, t),
|
|
63
|
+
viewBox: "0 0 24 24",
|
|
64
|
+
fill: "none",
|
|
65
|
+
stroke: "currentColor",
|
|
66
|
+
strokeWidth: "2",
|
|
67
|
+
strokeLinecap: "round",
|
|
68
|
+
strokeLinejoin: "round",
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ o("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
72
|
+
/* @__PURE__ */ o("path", { d: "M12 9v4" }),
|
|
73
|
+
/* @__PURE__ */ o("path", { d: "M12 17h.01" })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function I({ className: t }) {
|
|
79
|
+
return /* @__PURE__ */ r(
|
|
80
|
+
"svg",
|
|
81
|
+
{
|
|
82
|
+
className: i(n.icon, t),
|
|
83
|
+
viewBox: "0 0 24 24",
|
|
84
|
+
fill: "none",
|
|
85
|
+
stroke: "currentColor",
|
|
86
|
+
strokeWidth: "2",
|
|
87
|
+
strokeLinecap: "round",
|
|
88
|
+
strokeLinejoin: "round",
|
|
89
|
+
"aria-hidden": "true",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ o("path", { d: "m15 9-6 6" }),
|
|
92
|
+
/* @__PURE__ */ o("path", { d: "M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z" }),
|
|
93
|
+
/* @__PURE__ */ o("path", { d: "m9 9 6 6" })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function y({ className: t }) {
|
|
99
|
+
return /* @__PURE__ */ o(
|
|
100
|
+
"svg",
|
|
101
|
+
{
|
|
102
|
+
className: i(n.icon, t),
|
|
103
|
+
viewBox: "0 0 24 24",
|
|
104
|
+
fill: "none",
|
|
105
|
+
stroke: "currentColor",
|
|
106
|
+
strokeWidth: "2",
|
|
107
|
+
strokeLinecap: "round",
|
|
108
|
+
strokeLinejoin: "round",
|
|
109
|
+
"aria-hidden": "true",
|
|
110
|
+
children: /* @__PURE__ */ o("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function j({ className: t }) {
|
|
115
|
+
return /* @__PURE__ */ o(
|
|
116
|
+
"svg",
|
|
117
|
+
{
|
|
118
|
+
className: i(n.svgIcon, t),
|
|
119
|
+
viewBox: "0 0 24 24",
|
|
120
|
+
fill: "none",
|
|
121
|
+
stroke: "currentColor",
|
|
122
|
+
strokeWidth: "2",
|
|
123
|
+
strokeLinecap: "round",
|
|
124
|
+
strokeLinejoin: "round",
|
|
125
|
+
"aria-hidden": "true",
|
|
126
|
+
children: /* @__PURE__ */ o("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
function B({ type: t }) {
|
|
131
|
+
switch (t) {
|
|
132
|
+
case "success":
|
|
133
|
+
return /* @__PURE__ */ o(T, {});
|
|
134
|
+
case "info":
|
|
135
|
+
return /* @__PURE__ */ o(w, {});
|
|
136
|
+
case "warning":
|
|
137
|
+
return /* @__PURE__ */ o(C, {});
|
|
138
|
+
case "error":
|
|
139
|
+
return /* @__PURE__ */ o(I, { className: n.iconDestructive });
|
|
140
|
+
case "loading":
|
|
141
|
+
return /* @__PURE__ */ o(y, { className: n.iconSpin });
|
|
142
|
+
default:
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function b({
|
|
147
|
+
toast: t,
|
|
148
|
+
closeLabel: s
|
|
149
|
+
}) {
|
|
150
|
+
return /* @__PURE__ */ o(e.Root, { toast: t, className: n.toast, children: /* @__PURE__ */ r(e.Content, { className: n.content, children: [
|
|
151
|
+
/* @__PURE__ */ o(B, { type: t.type }),
|
|
152
|
+
/* @__PURE__ */ r("div", { className: n.body, children: [
|
|
153
|
+
/* @__PURE__ */ o(e.Title, { className: n.title }),
|
|
154
|
+
/* @__PURE__ */ o(e.Description, { className: n.description })
|
|
155
|
+
] }),
|
|
156
|
+
/* @__PURE__ */ o(e.Action, { className: n.action, render: /* @__PURE__ */ o(a, { variant: "outline", size: "sm" }) }),
|
|
157
|
+
/* @__PURE__ */ o(
|
|
158
|
+
e.Close,
|
|
159
|
+
{
|
|
160
|
+
"aria-label": s,
|
|
161
|
+
className: n.close,
|
|
162
|
+
render: /* @__PURE__ */ o(a, { variant: "ghost", icon: /* @__PURE__ */ o(j, {}) })
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] }) });
|
|
166
|
+
}
|
|
167
|
+
function A({ closeLabel: t }) {
|
|
168
|
+
const { toasts: s } = e.useToastManager();
|
|
169
|
+
return s.map((c) => /* @__PURE__ */ o(b, { toast: c, closeLabel: t }, c.id));
|
|
170
|
+
}
|
|
171
|
+
const W = e.createToastManager(), V = e.useToastManager, H = e.createToastManager;
|
|
172
|
+
function O({
|
|
173
|
+
container: t,
|
|
174
|
+
children: s,
|
|
175
|
+
closeLabel: c = "Close toast",
|
|
176
|
+
// Defaulted here rather than left to Base UI's own 'Notifications', so an
|
|
177
|
+
// explicit undefined can never wipe the landmark name in the merge.
|
|
178
|
+
label: l = "Notifications",
|
|
179
|
+
toastManager: d = W,
|
|
180
|
+
...u
|
|
181
|
+
}) {
|
|
182
|
+
return /* @__PURE__ */ r(e.Provider, { toastManager: d, ...u, children: [
|
|
183
|
+
s,
|
|
184
|
+
/* @__PURE__ */ o(e.Portal, { container: t, children: /* @__PURE__ */ o(e.Viewport, { "aria-label": l, className: n.viewport, children: /* @__PURE__ */ o(A, { closeLabel: c }) }) })
|
|
185
|
+
] });
|
|
186
|
+
}
|
|
187
|
+
export {
|
|
188
|
+
O as Toaster,
|
|
189
|
+
H as createToastManager,
|
|
190
|
+
W as toast,
|
|
191
|
+
V as useToastManager
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=toast.js.map
|