jenosize-ui 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 (182) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +100 -0
  3. package/THIRD-PARTY-NOTICES.md +163 -0
  4. package/dist/Button-Bt7pzM4R.d.ts +82 -0
  5. package/dist/PaymentInput-CKPIPNWH.d.ts +141 -0
  6. package/dist/Select-CVbEQ2Ep.d.ts +118 -0
  7. package/dist/TagInput-CTJYOB4J.d.ts +90 -0
  8. package/dist/avatar.d.ts +161 -0
  9. package/dist/avatar.js +11 -0
  10. package/dist/badge.d.ts +109 -0
  11. package/dist/badge.js +10 -0
  12. package/dist/breadcrumb.d.ts +58 -0
  13. package/dist/breadcrumb.js +7 -0
  14. package/dist/button.d.ts +54 -0
  15. package/dist/button.js +14 -0
  16. package/dist/calendar.d.ts +368 -0
  17. package/dist/calendar.js +21 -0
  18. package/dist/callout.d.ts +70 -0
  19. package/dist/callout.js +16 -0
  20. package/dist/card-nWicloNi.d.ts +80 -0
  21. package/dist/card.d.ts +2 -0
  22. package/dist/card.js +7 -0
  23. package/dist/checkbox.d.ts +133 -0
  24. package/dist/checkbox.js +11 -0
  25. package/dist/chunk-24TO7E32.js +42 -0
  26. package/dist/chunk-3Y5X7B5C.js +146 -0
  27. package/dist/chunk-4OLULPQG.js +202 -0
  28. package/dist/chunk-4P2NBLBW.js +103 -0
  29. package/dist/chunk-52IFGFTL.js +11 -0
  30. package/dist/chunk-5FATN5YD.js +115 -0
  31. package/dist/chunk-5NOBSXJN.js +297 -0
  32. package/dist/chunk-5RAPA22E.js +106 -0
  33. package/dist/chunk-7EUAMHMU.js +16 -0
  34. package/dist/chunk-7EWQKTNQ.js +1336 -0
  35. package/dist/chunk-7HOIZ3UO.js +110 -0
  36. package/dist/chunk-7IU5TMFL.js +452 -0
  37. package/dist/chunk-7JBNLEJ7.js +29 -0
  38. package/dist/chunk-7S2TBALK.js +23 -0
  39. package/dist/chunk-BJUZVYQC.js +188 -0
  40. package/dist/chunk-BVJWBYIG.js +66 -0
  41. package/dist/chunk-CME4DIML.js +65 -0
  42. package/dist/chunk-CYPPEUX5.js +73 -0
  43. package/dist/chunk-D5BTFSL7.js +71 -0
  44. package/dist/chunk-D6TPWNRK.js +387 -0
  45. package/dist/chunk-DJSXIAFH.js +66 -0
  46. package/dist/chunk-DRZCJCBO.js +46 -0
  47. package/dist/chunk-DWKILXHE.js +17 -0
  48. package/dist/chunk-E7ZSWBAK.js +70 -0
  49. package/dist/chunk-EDSK6FEH.js +8 -0
  50. package/dist/chunk-F2K7VJUV.js +114 -0
  51. package/dist/chunk-F6NLE6XJ.js +40 -0
  52. package/dist/chunk-FHHAPGCR.js +32 -0
  53. package/dist/chunk-FXIBGTS5.js +14 -0
  54. package/dist/chunk-GCVA3OIV.js +72 -0
  55. package/dist/chunk-GFOAJVW5.js +336 -0
  56. package/dist/chunk-GRLSUQQE.js +136 -0
  57. package/dist/chunk-GTHJWR3Q.js +77 -0
  58. package/dist/chunk-HMUZE6EK.js +67 -0
  59. package/dist/chunk-I7WU4GTY.js +503 -0
  60. package/dist/chunk-J2BCKBHC.js +151 -0
  61. package/dist/chunk-J36M3KRX.js +1315 -0
  62. package/dist/chunk-J7ZQQFPT.js +113 -0
  63. package/dist/chunk-JP26LPCY.js +234 -0
  64. package/dist/chunk-JTNFJLIY.js +1046 -0
  65. package/dist/chunk-JVJRHBTD.js +50 -0
  66. package/dist/chunk-JYGR44ZC.js +133 -0
  67. package/dist/chunk-KDLPXXD2.js +173 -0
  68. package/dist/chunk-KMSYEE23.js +224 -0
  69. package/dist/chunk-KNYKWUYX.js +52 -0
  70. package/dist/chunk-LME57Z6J.js +138 -0
  71. package/dist/chunk-MFJP5FA7.js +20 -0
  72. package/dist/chunk-MKC5HNA7.js +1692 -0
  73. package/dist/chunk-MQGD2OUF.js +39 -0
  74. package/dist/chunk-MUFHLP4S.js +566 -0
  75. package/dist/chunk-O2LG3PNI.js +74 -0
  76. package/dist/chunk-O4GRKO3I.js +66 -0
  77. package/dist/chunk-OHUFNYGN.js +791 -0
  78. package/dist/chunk-PWKWNDBS.js +243 -0
  79. package/dist/chunk-QA74ITR4.js +103 -0
  80. package/dist/chunk-R6RGJF4L.js +170 -0
  81. package/dist/chunk-S7NNXWIN.js +7 -0
  82. package/dist/chunk-SV56BSUQ.js +162 -0
  83. package/dist/chunk-T7FCG7XV.js +435 -0
  84. package/dist/chunk-THC2ISYP.js +57 -0
  85. package/dist/chunk-VWC72TR3.js +115 -0
  86. package/dist/chunk-W46K56XU.js +216 -0
  87. package/dist/chunk-W5GGOUUI.js +75 -0
  88. package/dist/chunk-WEUJYDCV.js +269 -0
  89. package/dist/chunk-WFY7DKQD.js +279 -0
  90. package/dist/chunk-WZQFC7ZN.js +448 -0
  91. package/dist/chunk-Z3ETJN5G.js +136 -0
  92. package/dist/chunk-ZOOX3TUB.js +192 -0
  93. package/dist/chunk-ZSNJ6UA3.js +42 -0
  94. package/dist/chunk-ZZA2LUTL.js +130 -0
  95. package/dist/chunk-ZZT2E5VT.js +24 -0
  96. package/dist/color-CtSxc1Rh.d.ts +6 -0
  97. package/dist/combobox.d.ts +184 -0
  98. package/dist/combobox.js +21 -0
  99. package/dist/date-input.d.ts +83 -0
  100. package/dist/date-input.js +16 -0
  101. package/dist/date-picker.d.ts +249 -0
  102. package/dist/date-picker.js +29 -0
  103. package/dist/date-utils-7hTFTXNK.d.ts +34 -0
  104. package/dist/date-vMJBKAFK.d.ts +22 -0
  105. package/dist/dialog.d.ts +86 -0
  106. package/dist/dialog.js +15 -0
  107. package/dist/drawer.d.ts +77 -0
  108. package/dist/drawer.js +14 -0
  109. package/dist/dropdown-menu.d.ts +218 -0
  110. package/dist/dropdown-menu.js +10 -0
  111. package/dist/file-trigger.d.ts +42 -0
  112. package/dist/file-trigger.js +3 -0
  113. package/dist/form.d.ts +487 -0
  114. package/dist/form.js +1179 -0
  115. package/dist/header-navigation.d.ts +74 -0
  116. package/dist/header-navigation.js +23 -0
  117. package/dist/icons/app.d.ts +48 -0
  118. package/dist/icons/app.js +282 -0
  119. package/dist/icons/flag.d.ts +817 -0
  120. package/dist/icons/flag.js +58336 -0
  121. package/dist/icons/integration.d.ts +36 -0
  122. package/dist/icons/integration.js +531 -0
  123. package/dist/icons/payment.d.ts +116 -0
  124. package/dist/icons/payment.js +2418 -0
  125. package/dist/icons.d.ts +2013 -0
  126. package/dist/icons.js +2012 -0
  127. package/dist/illustration.d.ts +48 -0
  128. package/dist/illustration.js +4 -0
  129. package/dist/index.d.ts +68 -0
  130. package/dist/index.js +73 -0
  131. package/dist/indicator.d.ts +51 -0
  132. package/dist/indicator.js +7 -0
  133. package/dist/input.d.ts +66 -0
  134. package/dist/input.js +15 -0
  135. package/dist/multi-value-CJb_tnvi.d.ts +8 -0
  136. package/dist/nav-Bla0o_-1.d.ts +98 -0
  137. package/dist/number-input.d.ts +80 -0
  138. package/dist/number-input.js +15 -0
  139. package/dist/options-CPEIgjtd.d.ts +68 -0
  140. package/dist/overflow-Df0h42Oi.d.ts +29 -0
  141. package/dist/pagination.d.ts +77 -0
  142. package/dist/pagination.js +17 -0
  143. package/dist/payment-input.d.ts +7 -0
  144. package/dist/payment-input.js +15 -0
  145. package/dist/popover.d.ts +60 -0
  146. package/dist/popover.js +14 -0
  147. package/dist/progress.d.ts +87 -0
  148. package/dist/progress.js +5 -0
  149. package/dist/radio.d.ts +77 -0
  150. package/dist/radio.js +12 -0
  151. package/dist/select.d.ts +68 -0
  152. package/dist/select.js +24 -0
  153. package/dist/shared-BNXAdgh2.d.ts +9 -0
  154. package/dist/shared-BYXJPnsN.d.ts +11 -0
  155. package/dist/shared-Dc-GgA16.d.ts +42 -0
  156. package/dist/sidebar-navigation.d.ts +129 -0
  157. package/dist/sidebar-navigation.js +15 -0
  158. package/dist/styles.css +2 -0
  159. package/dist/switch.d.ts +23 -0
  160. package/dist/switch.js +7 -0
  161. package/dist/table.d.ts +692 -0
  162. package/dist/table.js +44 -0
  163. package/dist/tabs.d.ts +111 -0
  164. package/dist/tabs.js +8 -0
  165. package/dist/tag-input.d.ts +12 -0
  166. package/dist/tag-input.js +19 -0
  167. package/dist/tag.d.ts +98 -0
  168. package/dist/tag.js +9 -0
  169. package/dist/textarea.d.ts +40 -0
  170. package/dist/textarea.js +12 -0
  171. package/dist/theme-script.d.ts +29 -0
  172. package/dist/theme-script.js +15 -0
  173. package/dist/theme.css +929 -0
  174. package/dist/theme.d.ts +71 -0
  175. package/dist/theme.js +15 -0
  176. package/dist/toast.d.ts +242 -0
  177. package/dist/toast.js +15 -0
  178. package/dist/tooltip.d.ts +70 -0
  179. package/dist/tooltip.js +6 -0
  180. package/dist/tree.d.ts +308 -0
  181. package/dist/tree.js +11 -0
  182. package/package.json +352 -0
@@ -0,0 +1,503 @@
1
+ import { Button } from './chunk-W46K56XU.js';
2
+ import { Slot } from './chunk-52IFGFTL.js';
3
+ import { XIcon, CircleXIcon, TriangleAlertIcon, CircleCheckIcon, InfoIcon, BellIcon } from './chunk-24TO7E32.js';
4
+ import { devWarn, warnPositiveInt } from './chunk-GCVA3OIV.js';
5
+ import { cn } from './chunk-ZSNJ6UA3.js';
6
+ import { Toast } from '@base-ui/react/toast';
7
+ import * as React from 'react';
8
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
9
+
10
+ var regions = /* @__PURE__ */ new Map();
11
+ var regionsVersion = 0;
12
+ var regionListeners = /* @__PURE__ */ new Set();
13
+ function regionFor(position) {
14
+ let region = regions.get(position);
15
+ if (!region) {
16
+ region = { manager: Toast.createToastManager(), subscribers: 0, queue: [] };
17
+ regions.set(position, region);
18
+ }
19
+ return region;
20
+ }
21
+ function ensureRegion(position) {
22
+ const existed = regions.has(position);
23
+ const region = regionFor(position);
24
+ if (!existed) {
25
+ regionsVersion += 1;
26
+ for (const listener of regionListeners) {
27
+ listener();
28
+ }
29
+ }
30
+ return region;
31
+ }
32
+ var MAX_QUEUED = 24;
33
+ function withRegion(position, work) {
34
+ const region = ensureRegion(position);
35
+ if (region.subscribers > 0) {
36
+ work(region.manager);
37
+ } else {
38
+ region.queue.push(work);
39
+ if (region.queue.length > MAX_QUEUED) {
40
+ region.queue.shift();
41
+ devWarn(
42
+ `<ToastProvider> is not mounted, so more than ${MAX_QUEUED} toasts have been buffered for "${position}" and the oldest are being dropped. Toasts fired while no provider is mounted cannot be shown \u2014 check that ToastProvider stays mounted for the app's lifetime.`
43
+ );
44
+ }
45
+ }
46
+ }
47
+ var defaultTimeout = 5e3;
48
+ var defaultPosition = "top-right";
49
+ var toastRegions = /* @__PURE__ */ new Map();
50
+ var toastData = /* @__PURE__ */ new Map();
51
+ var idSeq = 0;
52
+ function priorityFor(type) {
53
+ return type === "error" || type === "warning" ? "high" : "low";
54
+ }
55
+ function toTimeout(duration) {
56
+ if (duration === void 0) {
57
+ return defaultTimeout;
58
+ }
59
+ return Number.isFinite(duration) ? duration : 0;
60
+ }
61
+ function dataFor(options) {
62
+ const data = {};
63
+ if ("leading" in options) data.leading = options.leading;
64
+ if ("trailing" in options) data.trailing = options.trailing;
65
+ if ("meta" in options) data.meta = options.meta;
66
+ if ("addOn" in options) data.addOn = options.addOn;
67
+ if ("actions" in options) data.actions = options.actions;
68
+ return Object.keys(data).length > 0 ? data : void 0;
69
+ }
70
+ function enqueue(type, title, options = {}) {
71
+ const { description, duration, id, onClose, position } = options;
72
+ const toastId = id ?? `jz-toast-${idSeq += 1}`;
73
+ const target = position ?? defaultPosition;
74
+ const previous = toastRegions.get(toastId);
75
+ if (previous !== void 0 && previous !== target) {
76
+ withRegion(previous, (manager) => manager.close(toastId));
77
+ }
78
+ toastRegions.set(toastId, target);
79
+ const data = dataFor(options);
80
+ if (data === void 0) {
81
+ toastData.delete(toastId);
82
+ } else {
83
+ toastData.set(toastId, data);
84
+ }
85
+ const addOptions = {
86
+ id: toastId,
87
+ title,
88
+ description,
89
+ type,
90
+ priority: priorityFor(type),
91
+ timeout: toTimeout(duration),
92
+ // Forget the per-id bookkeeping when the card is gone, before the caller's
93
+ // own handler (which may enqueue again and legitimately re-register it).
94
+ onClose: () => {
95
+ toastRegions.delete(toastId);
96
+ toastData.delete(toastId);
97
+ onClose?.();
98
+ },
99
+ data
100
+ };
101
+ withRegion(target, (manager) => manager.add(addOptions));
102
+ return toastId;
103
+ }
104
+ function closeToast(id) {
105
+ if (id === void 0) {
106
+ for (const region of regions.values()) {
107
+ if (region.subscribers > 0) {
108
+ region.manager.close();
109
+ } else {
110
+ region.queue.length = 0;
111
+ }
112
+ }
113
+ toastRegions.clear();
114
+ toastData.clear();
115
+ return;
116
+ }
117
+ const position = toastRegions.get(id) ?? defaultPosition;
118
+ withRegion(position, (manager) => manager.close(id));
119
+ toastRegions.delete(id);
120
+ toastData.delete(id);
121
+ }
122
+ function updateToast(id, options) {
123
+ const { title, type, description, duration, onClose } = options;
124
+ const updates = {};
125
+ if (title !== void 0) {
126
+ updates.title = title;
127
+ }
128
+ if (type !== void 0) {
129
+ updates.type = type;
130
+ updates.priority = priorityFor(type);
131
+ }
132
+ if (description !== void 0) {
133
+ updates.description = description;
134
+ }
135
+ if (duration !== void 0) {
136
+ updates.timeout = toTimeout(duration);
137
+ }
138
+ if (onClose !== void 0) {
139
+ updates.onClose = () => {
140
+ toastRegions.delete(id);
141
+ toastData.delete(id);
142
+ onClose();
143
+ };
144
+ }
145
+ const patch = dataFor(options);
146
+ if (patch !== void 0) {
147
+ const merged = { ...toastData.get(id), ...patch };
148
+ toastData.set(id, merged);
149
+ updates.data = merged;
150
+ }
151
+ const position = toastRegions.get(id) ?? defaultPosition;
152
+ withRegion(position, (manager) => manager.update(id, updates));
153
+ }
154
+ var toast = Object.assign((title, options) => enqueue("info", title, options), {
155
+ neutral: (title, options) => enqueue("neutral", title, options),
156
+ info: (title, options) => enqueue("info", title, options),
157
+ success: (title, options) => enqueue("success", title, options),
158
+ warning: (title, options) => enqueue("warning", title, options),
159
+ error: (title, options) => enqueue("error", title, options),
160
+ update: updateToast,
161
+ dismiss: closeToast
162
+ });
163
+ var TYPE_COLOR = {
164
+ neutral: "neutral",
165
+ info: "brand",
166
+ success: "success",
167
+ warning: "warning",
168
+ error: "error"
169
+ };
170
+ var ICON_TINT = {
171
+ // `neutral` has no hue to carry, so it takes the quiet wash + the muted glyph `lib/color.ts`'s
172
+ // `FG.neutral` already resolves to — the one tone shared with the library-wide colour axis agrees
173
+ // with it. The circle stays a circle: the other four are round, and a square in that row would
174
+ // read as a different kind of thing.
175
+ //
176
+ // It is also the ONLY row with a ring, and that is the point rather than an inconsistency: the
177
+ // other four delineate themselves by HUE, which this one does not have. Measured on the real card
178
+ // (canvas-normalised, both themes): `bg-secondary` against `bg-primary` is 1.05:1 in light and 1.06:1 in
179
+ // dark — no visible container at all, so the glyph floated where its four siblings sit in a circle.
180
+ // The ring lands at 1.18:1 / 1.28:1, which is not a new value to justify — it is `--color-border-secondary`,
181
+ // the same hairline every outlined `Card` in the library draws — and `color.ts`'s `SUBTLE.neutral`
182
+ // likewise ships one. The glyph itself reads at 7.36:1 / 6.89:1 against the wash, well past the
183
+ // 3:1 that WCAG 1.4.11 asks of non-text.
184
+ //
185
+ // (This used to cite `Callout` as agreeing. It no longer does, and the disagreement is the point:
186
+ // Callout unified all six tones on ONE raised square, so its row has no round siblings to match.
187
+ // Here four of five are circles, so the fifth must be too.)
188
+ neutral: "bg-secondary text-tertiary ring-1 ring-secondary ring-inset",
189
+ info: "bg-brand-primary text-brand-secondary",
190
+ success: "bg-success-primary text-success-primary",
191
+ warning: "bg-warning-primary text-warning-primary",
192
+ error: "bg-error-primary text-utility-red-700"
193
+ };
194
+ var TYPE_ICON = {
195
+ neutral: BellIcon,
196
+ info: InfoIcon,
197
+ success: CircleCheckIcon,
198
+ warning: TriangleAlertIcon,
199
+ error: CircleXIcon
200
+ };
201
+ function TypeIcon({ type }) {
202
+ const Glyph = TYPE_ICON[type];
203
+ return /* @__PURE__ */ jsx(Glyph, { className: "size-5" });
204
+ }
205
+ var EDGE = {
206
+ "top-left": "top",
207
+ "top-center": "top",
208
+ "top-right": "top",
209
+ "bottom-left": "bottom",
210
+ "bottom-center": "bottom",
211
+ "bottom-right": "bottom"
212
+ };
213
+ var AXIS = {
214
+ "top-left": "left",
215
+ "top-center": "up",
216
+ "top-right": "right",
217
+ "bottom-left": "left",
218
+ "bottom-center": "down",
219
+ "bottom-right": "right"
220
+ };
221
+ var SWIPE = {
222
+ left: "left",
223
+ right: "right",
224
+ up: "up",
225
+ down: "down"
226
+ };
227
+ var VIEWPORT = "fixed z-50 w-[calc(100vw-2rem)] max-w-sm outline-none";
228
+ var VIEWPORT_POSITION = {
229
+ "top-left": "top-4 left-4 sm:top-6 sm:left-6",
230
+ "top-center": "top-4 left-1/2 -translate-x-1/2 sm:top-6",
231
+ "top-right": "top-4 right-4 sm:top-6 sm:right-6",
232
+ "bottom-left": "bottom-4 left-4 sm:bottom-6 sm:left-6",
233
+ "bottom-center": "bottom-4 left-1/2 -translate-x-1/2 sm:bottom-6",
234
+ "bottom-right": "bottom-4 right-4 sm:bottom-6 sm:right-6"
235
+ };
236
+ var VIEWPORT_LIST = {
237
+ top: "flex flex-col gap-3",
238
+ bottom: "flex flex-col-reverse gap-3"
239
+ };
240
+ var ORIGIN = {
241
+ "top-left": "origin-top-left",
242
+ "top-center": "origin-top",
243
+ "top-right": "origin-top-right",
244
+ "bottom-left": "origin-bottom-left",
245
+ "bottom-center": "origin-bottom",
246
+ "bottom-right": "origin-bottom-right"
247
+ };
248
+ var ANCHOR = {
249
+ "top-left": "top-0 bottom-auto left-0 right-auto",
250
+ "top-center": "top-0 bottom-auto left-0 right-0",
251
+ "top-right": "top-0 bottom-auto right-0 left-auto",
252
+ "bottom-left": "bottom-0 top-auto left-0 right-auto",
253
+ "bottom-center": "bottom-0 top-auto left-0 right-0",
254
+ "bottom-right": "bottom-0 top-auto right-0 left-auto"
255
+ };
256
+ var ROOT_BASE = cn(
257
+ "[--gap:0.75rem] [--peek:0.625rem]",
258
+ "[--scale:calc(max(0,1-(var(--toast-index)*0.06)))] [--shrink:calc(1-var(--scale))]",
259
+ "[--height:var(--toast-frontmost-height,var(--toast-height))]",
260
+ "w-full select-none",
261
+ // The locked floating-surface edge (ring, not border, so the p-4 content box
262
+ // keeps its exact interior sizing).
263
+ "rounded-xl bg-primary shadow-lg ring-1 ring-secondary_alt ring-inset",
264
+ // Card keyboard focus (reachable via F6 / arrow nav) — the house outset CSS
265
+ // outline (an outline is never clipped-wrong or painted over page content the
266
+ // way a ring-offset band is).
267
+ "outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2"
268
+ );
269
+ var ROOT_STACKED = cn(
270
+ "absolute z-[calc(1000-var(--toast-index))]",
271
+ "[--stack-y:calc(((var(--toast-index)*var(--peek))+(var(--shrink)*var(--height)))*var(--dir))]",
272
+ "[--offset-y:calc(((var(--toast-offset-y)+(var(--toast-index)*var(--gap)))*var(--dir))+var(--toast-swipe-movement-y))]",
273
+ "[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+var(--stack-y)))_scale(var(--scale))]",
274
+ // Expanded (hover/focus): fan out using the measured offsets.
275
+ "data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]",
276
+ // Height: collapsed shows the frontmost height; expanded uses natural height.
277
+ "h-[var(--height)] data-[expanded]:h-[var(--toast-height)]",
278
+ // Beyond the limit: hide the collapsed surplus.
279
+ "data-[limited]:opacity-0",
280
+ "[transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s]"
281
+ );
282
+ var ROOT_STACKED_EDGE = {
283
+ top: cn("[--dir:1]", "after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']"),
284
+ bottom: cn("[--dir:-1]", "after:absolute after:bottom-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']")
285
+ };
286
+ var ROOT_LIST = cn("relative", "data-[limited]:hidden", "[transition:transform_0.4s_cubic-bezier(0.22,1,0.36,1),opacity_0.4s]");
287
+ var SLIDE_IN = {
288
+ left: "data-[starting-style]:[transform:translateX(-110%)]",
289
+ right: "data-[starting-style]:[transform:translateX(110%)]",
290
+ up: "data-[starting-style]:[transform:translateY(-110%)]",
291
+ down: "data-[starting-style]:[transform:translateY(110%)]"
292
+ };
293
+ var SLIDE_OUT = {
294
+ left: "[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateX(-110%)]",
295
+ right: "[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateX(110%)]",
296
+ up: "[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(-110%)]",
297
+ down: "[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(110%)]"
298
+ };
299
+ var SWIPE_OUT = {
300
+ left: cn(
301
+ "data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)_-_110%))_translateY(var(--offset-y))]",
302
+ "data-[expanded]:data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)_-_110%))_translateY(var(--offset-y))]"
303
+ ),
304
+ right: cn(
305
+ "data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)_+_110%))_translateY(var(--offset-y))]",
306
+ "data-[expanded]:data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)_+_110%))_translateY(var(--offset-y))]"
307
+ ),
308
+ up: cn(
309
+ "data-[ending-style]:data-[swipe-direction=up]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--offset-y)_-_110%))]",
310
+ "data-[expanded]:data-[ending-style]:data-[swipe-direction=up]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--offset-y)_-_110%))]"
311
+ ),
312
+ down: cn(
313
+ "data-[ending-style]:data-[swipe-direction=down]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--offset-y)_+_110%))]",
314
+ "data-[expanded]:data-[ending-style]:data-[swipe-direction=down]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--offset-y)_+_110%))]"
315
+ )
316
+ };
317
+ function rootClasses(position, stacked) {
318
+ const axis = AXIS[position];
319
+ return cn(
320
+ ROOT_BASE,
321
+ stacked ? cn(ROOT_STACKED, ROOT_STACKED_EDGE[EDGE[position]], ANCHOR[position], ORIGIN[position]) : ROOT_LIST,
322
+ // Enter + leave: fade always, slide off the nearest edge.
323
+ SLIDE_IN[axis],
324
+ "data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",
325
+ SLIDE_OUT[axis],
326
+ SWIPE_OUT[axis]
327
+ );
328
+ }
329
+ var CONTENT = cn("flex h-full gap-3 overflow-hidden p-4", "transition-opacity duration-200 ease-out");
330
+ var CONTENT_STACKED = "data-[behind]:opacity-0 data-[expanded]:opacity-100";
331
+ var CONTENT_ALIGN = { compact: "items-center", tall: "items-start" };
332
+ var ICON_CIRCLE = "flex size-9 shrink-0 items-center justify-center rounded-full";
333
+ var LEADING_SLOT = "mt-0.5 [&>svg]:size-5";
334
+ var TEXT = "flex min-w-0 flex-1 flex-col gap-0.5 break-words";
335
+ var TITLE_ROW = "flex min-w-0 items-baseline gap-2";
336
+ var TITLE = "min-w-0 text-sm font-semibold text-primary";
337
+ var META = "min-w-0 max-w-1/3 shrink truncate text-xs font-normal text-tertiary tabular-nums";
338
+ var TRAILING_SLOT = "ml-auto self-center [&>svg]:size-4";
339
+ var DESCRIPTION = "text-sm font-normal text-tertiary";
340
+ var ADDON = "mt-2 [&>img]:w-full [&>img]:rounded-lg [&>img]:object-cover";
341
+ var ACTION_ROW = "mt-2.5 flex flex-wrap items-center gap-3";
342
+ var ACTION = cn(
343
+ "inline-flex w-fit cursor-pointer items-center gap-1.5 rounded-sm text-sm font-semibold text-brand-secondary",
344
+ "transition-colors duration-100 ease-linear hover:text-brand-secondary_hover",
345
+ "outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2"
346
+ );
347
+ var CLOSE = cn(
348
+ "-mr-1.5 flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-lg text-quaternary",
349
+ "transition-colors duration-100 ease-linear hover:bg-ghost-hover hover:text-primary",
350
+ "outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2"
351
+ );
352
+ var CLOSE_TALL = "-mt-1.5";
353
+ var COUNTDOWN_CLIP = "pointer-events-none absolute inset-0 overflow-hidden rounded-xl";
354
+ var COUNTDOWN = "absolute inset-x-0 bottom-0 h-1";
355
+ var COUNTDOWN_FILL = cn(
356
+ "h-full w-full origin-left",
357
+ "[animation:jz-toast-countdown_var(--toast-countdown)_linear_forwards]",
358
+ "group-data-[expanded]/toast:[animation-play-state:paused]"
359
+ );
360
+ var COUNTDOWN_TINT = {
361
+ neutral: "bg-secondary-solid",
362
+ brand: "bg-brand-solid",
363
+ success: "bg-success-solid",
364
+ warning: "bg-warning-solid",
365
+ error: "bg-error-solid",
366
+ info: "bg-utility-blue-500"
367
+ };
368
+ function relFor(action) {
369
+ return action.rel?.join(" ") ?? (action.target === "_blank" ? "noreferrer" : void 0);
370
+ }
371
+ function ToastActionRow({ actions, id }) {
372
+ return /* @__PURE__ */ jsx("div", { className: ACTION_ROW, children: actions.map((action) => {
373
+ const onClick = () => {
374
+ action.onClick?.();
375
+ closeToast(id);
376
+ };
377
+ const anchor = action.href ? { render: /* @__PURE__ */ jsx("a", { href: action.href, target: action.target, rel: relFor(action) }) } : null;
378
+ if (action.variant === "primary") {
379
+ return /* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", leading: action.leading, onClick, ...anchor, children: action.label }, action.label);
380
+ }
381
+ const label = /* @__PURE__ */ jsxs(Fragment, { children: [
382
+ action.leading === void 0 ? null : /* @__PURE__ */ jsx(Slot, { className: "[&>svg]:size-4", children: action.leading }),
383
+ action.label
384
+ ] });
385
+ return action.href ? /* @__PURE__ */ jsx("a", { className: ACTION, href: action.href, target: action.target, rel: relFor(action), onClick, children: label }, action.label) : /* @__PURE__ */ jsx("button", { type: "button", className: ACTION, onClick, children: label }, action.label);
386
+ }) });
387
+ }
388
+ function ToastList({ position, stacked, countdown }) {
389
+ const { toasts } = Toast.useToastManager();
390
+ const rootClassName = rootClasses(position, stacked);
391
+ const swipeDirection = SWIPE[AXIS[position]];
392
+ return /* @__PURE__ */ jsx(Fragment, { children: toasts.map((item) => {
393
+ const type = item.type ?? "info";
394
+ const data = item.data;
395
+ const { leading, trailing, meta, addOn, actions } = data ?? {};
396
+ const compact = !item.description && meta === void 0 && addOn === void 0 && trailing === void 0 && !actions?.length;
397
+ const runFor = countdown && item.timeout ? item.timeout : 0;
398
+ return /* @__PURE__ */ jsxs(Toast.Root, { toast: item, swipeDirection, "data-slot": "toast", className: cn("group/toast", rootClassName), children: [
399
+ /* @__PURE__ */ jsxs(Toast.Content, { className: cn(CONTENT, compact ? CONTENT_ALIGN.compact : CONTENT_ALIGN.tall, stacked && CONTENT_STACKED), children: [
400
+ leading === void 0 ? /* @__PURE__ */ jsx("span", { className: cn(ICON_CIRCLE, ICON_TINT[type]), "aria-hidden": "true", children: /* @__PURE__ */ jsx(TypeIcon, { type }) }) : /* @__PURE__ */ jsx(Slot, { className: LEADING_SLOT, children: leading }),
401
+ /* @__PURE__ */ jsxs("div", { className: TEXT, children: [
402
+ meta === void 0 && trailing === void 0 ? /* @__PURE__ */ jsx(Toast.Title, { className: TITLE }) : /* @__PURE__ */ jsxs("div", { className: TITLE_ROW, children: [
403
+ /* @__PURE__ */ jsx(Toast.Title, { className: TITLE }),
404
+ meta === void 0 ? null : /* @__PURE__ */ jsx("span", { className: META, children: meta }),
405
+ trailing === void 0 ? null : /* @__PURE__ */ jsx(Slot, { className: TRAILING_SLOT, children: trailing })
406
+ ] }),
407
+ /* @__PURE__ */ jsx(Toast.Description, { className: DESCRIPTION }),
408
+ addOn === void 0 ? null : /* @__PURE__ */ jsx("div", { className: ADDON, children: addOn }),
409
+ actions?.length ? /* @__PURE__ */ jsx(ToastActionRow, { actions, id: item.id }) : null
410
+ ] }),
411
+ /* @__PURE__ */ jsx(Toast.Close, { className: cn(CLOSE, !compact && CLOSE_TALL), "aria-label": "Dismiss", children: /* @__PURE__ */ jsx(XIcon, { className: "size-4" }) })
412
+ ] }),
413
+ runFor > 0 ? (
414
+ // Keyed on `updateKey` so `toast.update` — which resets Base UI's dismiss timer —
415
+ // remounts the fill and restarts the animation with it. Without the key the bar would
416
+ // keep draining from wherever it had got to while the real deadline had moved.
417
+ /* @__PURE__ */ jsx("div", { className: COUNTDOWN_CLIP, "aria-hidden": "true", children: /* @__PURE__ */ jsx("div", { className: COUNTDOWN, children: /* @__PURE__ */ jsx(
418
+ "div",
419
+ {
420
+ className: cn(COUNTDOWN_FILL, COUNTDOWN_TINT[TYPE_COLOR[type]]),
421
+ style: { "--toast-countdown": `${runFor}ms` }
422
+ },
423
+ item.updateKey ?? 0
424
+ ) }) })
425
+ ) : null
426
+ ] }, item.id);
427
+ }) });
428
+ }
429
+ function ToastRegion(props) {
430
+ const { position, stacked, countdown, duration, limit, primary, className, children } = props;
431
+ warnPositiveInt("ToastProvider", "limit", limit);
432
+ const region = regionFor(position);
433
+ React.useEffect(() => {
434
+ region.subscribers += 1;
435
+ const queued = [...region.queue];
436
+ region.queue.length = 0;
437
+ for (const work of queued) {
438
+ work(region.manager);
439
+ }
440
+ return () => {
441
+ region.subscribers -= 1;
442
+ };
443
+ }, [region]);
444
+ return /* @__PURE__ */ jsxs(Toast.Provider, { toastManager: region.manager, timeout: toTimeout(duration), limit, children: [
445
+ children,
446
+ /* @__PURE__ */ jsx(Toast.Portal, { children: /* @__PURE__ */ jsx(
447
+ Toast.Viewport,
448
+ {
449
+ "aria-label": primary ? "Notifications" : `Notifications (${position.replace("-", " ")})`,
450
+ className: cn(VIEWPORT, VIEWPORT_POSITION[position], !stacked && VIEWPORT_LIST[EDGE[position]], className),
451
+ children: /* @__PURE__ */ jsx(ToastList, { position, stacked, countdown })
452
+ }
453
+ ) })
454
+ ] });
455
+ }
456
+ var subscribeToRegions = (onChange) => {
457
+ regionListeners.add(onChange);
458
+ return () => regionListeners.delete(onChange);
459
+ };
460
+ var regionsSnapshot = () => regionsVersion;
461
+ function ToastProvider(props) {
462
+ const { duration = 5e3, limit = 3, position = "top-right", stacked = true, countdown = true, className, children } = props;
463
+ defaultTimeout = duration;
464
+ defaultPosition = position;
465
+ React.useEffect(() => {
466
+ let dropped = false;
467
+ for (const [regionPosition, region] of regions) {
468
+ if (regionPosition === position || region.subscribers > 0 || region.queue.length > 0) {
469
+ continue;
470
+ }
471
+ regions.delete(regionPosition);
472
+ dropped = true;
473
+ }
474
+ if (dropped) {
475
+ regionsVersion += 1;
476
+ for (const listener of regionListeners) {
477
+ listener();
478
+ }
479
+ }
480
+ }, [position]);
481
+ const version = React.useSyncExternalStore(subscribeToRegions, regionsSnapshot, regionsSnapshot);
482
+ const positions = React.useMemo(() => {
483
+ return [.../* @__PURE__ */ new Set([position, ...regions.keys()])];
484
+ }, [position, version]);
485
+ return /* @__PURE__ */ jsx(Fragment, { children: positions.map((p) => /* @__PURE__ */ jsx(
486
+ ToastRegion,
487
+ {
488
+ position: p,
489
+ primary: p === position,
490
+ stacked,
491
+ countdown,
492
+ duration,
493
+ limit,
494
+ className,
495
+ children: p === position ? children : void 0
496
+ },
497
+ p
498
+ )) });
499
+ }
500
+
501
+ export { ToastProvider, toast };
502
+ //# sourceMappingURL=chunk-I7WU4GTY.js.map
503
+ //# sourceMappingURL=chunk-I7WU4GTY.js.map
@@ -0,0 +1,151 @@
1
+ import { CircleHelpIcon } from './chunk-24TO7E32.js';
2
+ import { TooltipExport } from './chunk-ZZA2LUTL.js';
3
+ import { cn } from './chunk-ZSNJ6UA3.js';
4
+ import { Field } from '@base-ui/react/field';
5
+ import 'react';
6
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
+
8
+ // src/components/field/control-size.ts
9
+ var CONTROL_TEXT = {
10
+ sm: "text-sm",
11
+ md: "text-md",
12
+ lg: "text-md"
13
+ };
14
+ var CONTROL_ICON = {
15
+ sm: "[&_svg]:size-4 [&_svg]:[stroke-width:2.25px]",
16
+ md: "[&_svg]:size-5",
17
+ lg: "[&_svg]:size-5"
18
+ };
19
+ var SLOT_ICON = {
20
+ sm: "[&>svg]:size-4 [&>svg]:[stroke-width:2.25px]",
21
+ md: "[&>svg]:size-5",
22
+ lg: "[&>svg]:size-5"
23
+ };
24
+ var CONTROL_RADIUS = "rounded-lg";
25
+ var HINT_TEXT = {
26
+ sm: "text-xs",
27
+ md: "text-sm",
28
+ lg: "text-sm"
29
+ };
30
+ var BAR_PX = {
31
+ sm: "px-3",
32
+ md: "px-3",
33
+ lg: "px-3.5"
34
+ };
35
+ var BAR_SIZE = {
36
+ sm: `h-9 ${BAR_PX.sm} gap-1.5 ${CONTROL_TEXT.sm} ${CONTROL_RADIUS}`,
37
+ md: `h-10 ${BAR_PX.md} gap-2 ${CONTROL_TEXT.md} ${CONTROL_RADIUS}`,
38
+ lg: `h-11 ${BAR_PX.lg} gap-2 ${CONTROL_TEXT.lg} ${CONTROL_RADIUS}`
39
+ };
40
+ var SHELL_SIZE = {
41
+ sm: `min-h-9 ${BAR_PX.sm} gap-1.5 ${CONTROL_TEXT.sm} ${CONTROL_RADIUS}`,
42
+ md: `min-h-10 ${BAR_PX.md} gap-2 ${CONTROL_TEXT.md} ${CONTROL_RADIUS}`,
43
+ lg: `min-h-11 ${BAR_PX.lg} gap-2 ${CONTROL_TEXT.lg} ${CONTROL_RADIUS}`
44
+ };
45
+ var LISTBOX_PX_SM = "pl-3 pr-2.5";
46
+ function useFieldValidity(invalid = false, error) {
47
+ const showError = error != null && error !== "";
48
+ return { isInvalid: invalid || showError, showError };
49
+ }
50
+ var FIELD_LABEL_CLASS = "flex items-center gap-0.5 text-sm font-medium text-secondary";
51
+ function LabelInner({ label, required, hideRequiredIndicator, isInvalid, tooltip, tooltipDescription }) {
52
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
53
+ label,
54
+ required && !hideRequiredIndicator ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: isInvalid ? "text-error-primary" : "text-brand-tertiary", children: "*" }) : null,
55
+ tooltip ? /* @__PURE__ */ jsx(TooltipExport, { content: tooltip, description: tooltipDescription, side: "top", children: /* @__PURE__ */ jsx(
56
+ "button",
57
+ {
58
+ type: "button",
59
+ disabled: false,
60
+ "aria-label": tooltip,
61
+ className: "flex cursor-pointer text-fg-quaternary transition-colors duration-200 outline-none hover:text-fg-quaternary_hover focus-visible:text-fg-quaternary_hover",
62
+ children: /* @__PURE__ */ jsx(CircleHelpIcon, { className: "size-4" })
63
+ }
64
+ ) }) : null
65
+ ] });
66
+ }
67
+ function FieldMessages({ hint, error, showError, size, hintId, errorId }) {
68
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
69
+ hint && !showError ? /* @__PURE__ */ jsx(Field.Description, { id: hintId, render: /* @__PURE__ */ jsx("div", {}), className: cn("text-tertiary", HINT_TEXT[size]), children: hint }) : null,
70
+ showError ? /* @__PURE__ */ jsx(Field.Error, { id: errorId, match: true, className: cn("text-error-primary", HINT_TEXT[size]), children: error }) : null
71
+ ] });
72
+ }
73
+ function FieldFrame(props) {
74
+ const {
75
+ label,
76
+ labelId,
77
+ messageId,
78
+ required = false,
79
+ hideRequiredIndicator = false,
80
+ tooltip,
81
+ tooltipDescription,
82
+ hint,
83
+ error,
84
+ isInvalid,
85
+ showError,
86
+ size = "md",
87
+ disabled = false,
88
+ name,
89
+ fullWidth = true,
90
+ className,
91
+ children
92
+ } = props;
93
+ return /* @__PURE__ */ jsxs(Field.Root, { name, disabled, invalid: isInvalid, className: cn("flex flex-col gap-1.5", fullWidth ? "w-full" : "w-auto", className), children: [
94
+ label ? /* @__PURE__ */ jsx(Field.Label, { id: labelId, className: FIELD_LABEL_CLASS, children: /* @__PURE__ */ jsx(
95
+ LabelInner,
96
+ {
97
+ label,
98
+ required,
99
+ hideRequiredIndicator,
100
+ isInvalid,
101
+ tooltip,
102
+ tooltipDescription
103
+ }
104
+ ) }) : null,
105
+ children,
106
+ /* @__PURE__ */ jsx(FieldMessages, { hint, error, showError, size, hintId: messageId?.hint, errorId: messageId?.error })
107
+ ] });
108
+ }
109
+ function FieldGroupFrame(props) {
110
+ const {
111
+ label,
112
+ labelId,
113
+ required = false,
114
+ hideRequiredIndicator = false,
115
+ tooltip,
116
+ tooltipDescription,
117
+ hint,
118
+ error,
119
+ isInvalid,
120
+ showError,
121
+ size = "md",
122
+ disabled = false,
123
+ name,
124
+ fullWidth = true,
125
+ className,
126
+ announceRequired = false,
127
+ children
128
+ } = props;
129
+ return /* @__PURE__ */ jsxs(Field.Root, { name, disabled, invalid: isInvalid, className: cn("flex flex-col gap-1.5", fullWidth ? "w-full" : "w-auto", className), children: [
130
+ label ? /* @__PURE__ */ jsxs("span", { id: labelId, className: FIELD_LABEL_CLASS, children: [
131
+ /* @__PURE__ */ jsx(
132
+ LabelInner,
133
+ {
134
+ label,
135
+ required,
136
+ hideRequiredIndicator,
137
+ isInvalid,
138
+ tooltip,
139
+ tooltipDescription
140
+ }
141
+ ),
142
+ required && announceRequired ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: ", required" }) : null
143
+ ] }) : null,
144
+ children,
145
+ /* @__PURE__ */ jsx(FieldMessages, { hint, error, showError, size })
146
+ ] });
147
+ }
148
+
149
+ export { BAR_SIZE, CONTROL_ICON, CONTROL_RADIUS, CONTROL_TEXT, FIELD_LABEL_CLASS, FieldFrame, FieldGroupFrame, LISTBOX_PX_SM, SHELL_SIZE, SLOT_ICON, useFieldValidity };
150
+ //# sourceMappingURL=chunk-J2BCKBHC.js.map
151
+ //# sourceMappingURL=chunk-J2BCKBHC.js.map