@nuee/ui 0.3.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 (180) hide show
  1. package/LICENSE +201 -0
  2. package/dist/Icon.d.ts +43 -0
  3. package/dist/Icon.js +85 -0
  4. package/dist/Icon.js.map +7 -0
  5. package/dist/accordion.d.ts +6 -0
  6. package/dist/accordion.js +419 -0
  7. package/dist/accordion.js.map +7 -0
  8. package/dist/alert-dialog.d.ts +22 -0
  9. package/dist/alert-dialog.js +712 -0
  10. package/dist/alert-dialog.js.map +7 -0
  11. package/dist/aspect-ratio.d.ts +7 -0
  12. package/dist/aspect-ratio.js +95 -0
  13. package/dist/aspect-ratio.js.map +7 -0
  14. package/dist/attachment.d.ts +24 -0
  15. package/dist/attachment.js +830 -0
  16. package/dist/attachment.js.map +7 -0
  17. package/dist/avatar.d.ts +14 -0
  18. package/dist/avatar.js +451 -0
  19. package/dist/avatar.js.map +7 -0
  20. package/dist/badge.d.ts +9 -0
  21. package/dist/badge.js +130 -0
  22. package/dist/badge.js.map +7 -0
  23. package/dist/banner.d.ts +22 -0
  24. package/dist/banner.js +427 -0
  25. package/dist/banner.js.map +7 -0
  26. package/dist/breadcrumb.d.ts +10 -0
  27. package/dist/breadcrumb.js +419 -0
  28. package/dist/breadcrumb.js.map +7 -0
  29. package/dist/bubble.d.ts +8 -0
  30. package/dist/bubble.js +124 -0
  31. package/dist/bubble.js.map +7 -0
  32. package/dist/button-group.d.ts +14 -0
  33. package/dist/button-group.js +428 -0
  34. package/dist/button-group.js.map +7 -0
  35. package/dist/button.d.ts +13 -0
  36. package/dist/button.js +267 -0
  37. package/dist/button.js.map +7 -0
  38. package/dist/card.d.ts +15 -0
  39. package/dist/card.js +469 -0
  40. package/dist/card.js.map +7 -0
  41. package/dist/checkbox.d.ts +7 -0
  42. package/dist/checkbox.js +204 -0
  43. package/dist/checkbox.js.map +7 -0
  44. package/dist/cli.js +6 -0
  45. package/dist/cli.js.map +7 -0
  46. package/dist/collapsible.d.ts +5 -0
  47. package/dist/collapsible.js +345 -0
  48. package/dist/collapsible.js.map +7 -0
  49. package/dist/combobox.d.ts +15 -0
  50. package/dist/combobox.js +553 -0
  51. package/dist/combobox.js.map +7 -0
  52. package/dist/content-row.d.ts +19 -0
  53. package/dist/content-row.js +446 -0
  54. package/dist/content-row.js.map +7 -0
  55. package/dist/context-menu.d.ts +4 -0
  56. package/dist/context-menu.js +889 -0
  57. package/dist/context-menu.js.map +7 -0
  58. package/dist/dialog.d.ts +23 -0
  59. package/dist/dialog.js +486 -0
  60. package/dist/dialog.js.map +7 -0
  61. package/dist/drawer.d.ts +36 -0
  62. package/dist/drawer.js +735 -0
  63. package/dist/drawer.js.map +7 -0
  64. package/dist/dropdown-menu.d.ts +28 -0
  65. package/dist/dropdown-menu.js +882 -0
  66. package/dist/dropdown-menu.js.map +7 -0
  67. package/dist/empty.d.ts +12 -0
  68. package/dist/empty.js +361 -0
  69. package/dist/empty.js.map +7 -0
  70. package/dist/field.d.ts +20 -0
  71. package/dist/field.js +636 -0
  72. package/dist/field.js.map +7 -0
  73. package/dist/global.css +4 -0
  74. package/dist/hover-card.d.ts +12 -0
  75. package/dist/hover-card.js +159 -0
  76. package/dist/hover-card.js.map +7 -0
  77. package/dist/index.d.ts +89 -0
  78. package/dist/index.js +15427 -0
  79. package/dist/index.js.map +7 -0
  80. package/dist/input-group.d.ts +21 -0
  81. package/dist/input-group.js +966 -0
  82. package/dist/input-group.js.map +7 -0
  83. package/dist/input-otp.d.ts +10 -0
  84. package/dist/input-otp.js +246 -0
  85. package/dist/input-otp.js.map +7 -0
  86. package/dist/input.d.ts +7 -0
  87. package/dist/input.js +121 -0
  88. package/dist/input.js.map +7 -0
  89. package/dist/kbd.d.ts +8 -0
  90. package/dist/kbd.js +170 -0
  91. package/dist/kbd.js.map +7 -0
  92. package/dist/label.d.ts +6 -0
  93. package/dist/label.js +89 -0
  94. package/dist/label.js.map +7 -0
  95. package/dist/link.d.ts +14 -0
  96. package/dist/link.js +244 -0
  97. package/dist/link.js.map +7 -0
  98. package/dist/marker.d.ts +9 -0
  99. package/dist/marker.js +206 -0
  100. package/dist/marker.js.map +7 -0
  101. package/dist/menubar.d.ts +19 -0
  102. package/dist/menubar.js +1008 -0
  103. package/dist/menubar.js.map +7 -0
  104. package/dist/message-scroller.d.ts +10 -0
  105. package/dist/message-scroller.js +526 -0
  106. package/dist/message-scroller.js.map +7 -0
  107. package/dist/message.d.ts +10 -0
  108. package/dist/message.js +237 -0
  109. package/dist/message.js.map +7 -0
  110. package/dist/native-select.d.ts +9 -0
  111. package/dist/native-select.js +274 -0
  112. package/dist/native-select.js.map +7 -0
  113. package/dist/navigation-menu.d.ts +11 -0
  114. package/dist/navigation-menu.js +590 -0
  115. package/dist/navigation-menu.js.map +7 -0
  116. package/dist/pagination.d.ts +12 -0
  117. package/dist/pagination.js +481 -0
  118. package/dist/pagination.js.map +7 -0
  119. package/dist/popover.d.ts +14 -0
  120. package/dist/popover.js +293 -0
  121. package/dist/popover.js.map +7 -0
  122. package/dist/primitives.d.ts +1 -0
  123. package/dist/primitives.js +3 -0
  124. package/dist/primitives.js.map +7 -0
  125. package/dist/progress.d.ts +7 -0
  126. package/dist/progress.js +92 -0
  127. package/dist/progress.js.map +7 -0
  128. package/dist/radio-group.d.ts +12 -0
  129. package/dist/radio-group.js +184 -0
  130. package/dist/radio-group.js.map +7 -0
  131. package/dist/reset.css +73 -0
  132. package/dist/scroll-area.d.ts +10 -0
  133. package/dist/scroll-area.js +266 -0
  134. package/dist/scroll-area.js.map +7 -0
  135. package/dist/select.d.ts +14 -0
  136. package/dist/select.js +505 -0
  137. package/dist/select.js.map +7 -0
  138. package/dist/separator.d.ts +8 -0
  139. package/dist/separator.js +110 -0
  140. package/dist/separator.js.map +7 -0
  141. package/dist/skeleton.d.ts +6 -0
  142. package/dist/skeleton.js +87 -0
  143. package/dist/skeleton.js.map +7 -0
  144. package/dist/slider.d.ts +9 -0
  145. package/dist/slider.js +146 -0
  146. package/dist/slider.js.map +7 -0
  147. package/dist/spinner.d.ts +7 -0
  148. package/dist/spinner.js +99 -0
  149. package/dist/spinner.js.map +7 -0
  150. package/dist/stylex-props.d.ts +3 -0
  151. package/dist/stylex.css +2144 -0
  152. package/dist/switch.d.ts +8 -0
  153. package/dist/switch.js +159 -0
  154. package/dist/switch.js.map +7 -0
  155. package/dist/table.d.ts +14 -0
  156. package/dist/table.js +406 -0
  157. package/dist/table.js.map +7 -0
  158. package/dist/tabs.d.ts +10 -0
  159. package/dist/tabs.js +455 -0
  160. package/dist/tabs.js.map +7 -0
  161. package/dist/textarea.d.ts +6 -0
  162. package/dist/textarea.js +121 -0
  163. package/dist/textarea.js.map +7 -0
  164. package/dist/toast.d.ts +9 -0
  165. package/dist/toast.js +670 -0
  166. package/dist/toast.js.map +7 -0
  167. package/dist/toast.stylex.d.ts +6 -0
  168. package/dist/toggle-group.d.ts +18 -0
  169. package/dist/toggle-group.js +302 -0
  170. package/dist/toggle-group.js.map +7 -0
  171. package/dist/toggle.d.ts +11 -0
  172. package/dist/toggle.js +153 -0
  173. package/dist/toggle.js.map +7 -0
  174. package/dist/tooltip.d.ts +11 -0
  175. package/dist/tooltip.js +154 -0
  176. package/dist/tooltip.js.map +7 -0
  177. package/dist/typography.d.ts +292 -0
  178. package/dist/typography.js +92 -0
  179. package/dist/typography.js.map +7 -0
  180. package/package.json +110 -0
package/dist/toast.js ADDED
@@ -0,0 +1,670 @@
1
+ // src/toast.tsx
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import { Toast as ToastPrimitive } from "@base-ui/react/toast";
4
+ import * as stylex from "@stylexjs/stylex";
5
+ import { useLayoutEffect, useRef, useState } from "react";
6
+
7
+ // src/Icon.tsx
8
+ import {
9
+ ArrowDownIcon,
10
+ ArrowSquareOutIcon,
11
+ ArrowsDownUpIcon,
12
+ ArrowUpIcon,
13
+ CalendarIcon,
14
+ CaretDoubleLeftIcon,
15
+ CaretDoubleRightIcon,
16
+ CaretDownIcon,
17
+ CaretLeftIcon,
18
+ CaretRightIcon,
19
+ CaretUpIcon,
20
+ CaretUpDownIcon,
21
+ CheckCircleIcon,
22
+ CheckIcon,
23
+ ChecksIcon,
24
+ ClockIcon,
25
+ ColumnsIcon,
26
+ CopyIcon,
27
+ DotsThreeIcon,
28
+ EyeSlashIcon,
29
+ FileIcon,
30
+ FolderIcon,
31
+ FunnelIcon,
32
+ GitBranchIcon,
33
+ InfoIcon,
34
+ ListIcon,
35
+ MagnifyingGlassIcon,
36
+ MicrophoneIcon,
37
+ PaperclipIcon,
38
+ DownloadSimpleIcon,
39
+ StopIcon,
40
+ WarningIcon,
41
+ WrenchIcon,
42
+ XCircleIcon,
43
+ XIcon
44
+ } from "@phosphor-icons/react";
45
+ import { jsx } from "react/jsx-runtime";
46
+ var iconRegistry = {
47
+ close: XIcon,
48
+ chevronDown: CaretDownIcon,
49
+ chevronLeft: CaretLeftIcon,
50
+ chevronRight: CaretRightIcon,
51
+ chevronUp: CaretUpIcon,
52
+ chevronsLeft: CaretDoubleLeftIcon,
53
+ chevronsRight: CaretDoubleRightIcon,
54
+ caretUpDown: CaretUpDownIcon,
55
+ check: CheckIcon,
56
+ success: CheckCircleIcon,
57
+ error: XCircleIcon,
58
+ warning: WarningIcon,
59
+ info: InfoIcon,
60
+ calendar: CalendarIcon,
61
+ clock: ClockIcon,
62
+ externalLink: ArrowSquareOutIcon,
63
+ menu: ListIcon,
64
+ moreHorizontal: DotsThreeIcon,
65
+ search: MagnifyingGlassIcon,
66
+ arrowUp: ArrowUpIcon,
67
+ arrowDown: ArrowDownIcon,
68
+ arrowsUpDown: ArrowsDownUpIcon,
69
+ funnel: FunnelIcon,
70
+ eyeSlash: EyeSlashIcon,
71
+ viewColumns: ColumnsIcon,
72
+ copy: CopyIcon,
73
+ checkDouble: ChecksIcon,
74
+ wrench: WrenchIcon,
75
+ stop: StopIcon,
76
+ microphone: MicrophoneIcon,
77
+ folder: FolderIcon,
78
+ file: FileIcon,
79
+ paperclip: PaperclipIcon,
80
+ download: DownloadSimpleIcon,
81
+ branch: GitBranchIcon
82
+ };
83
+ function Icon({ name, weight = "regular", ...props2 }) {
84
+ const IconComponent = iconRegistry[name];
85
+ return /* @__PURE__ */ jsx(IconComponent, { ...props2, weight });
86
+ }
87
+
88
+ // src/toast.tsx
89
+ import { spacingVars } from "@nuee/tokens/semantic.stylex";
90
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
91
+ var styles = {
92
+ viewport: {
93
+ ks0D6T: "xowlazn",
94
+ kI3sdo: "x1a2a7pz",
95
+ kfzvcC: "x47corl",
96
+ kVAEAm: "xixxii4",
97
+ kzqmXN: "xjdehy0",
98
+ kY2c9j: "x6y048q",
99
+ "--xj53u9u": "xeffijn xac14zw",
100
+ "--x170ifs3": "x1jm5hub xsbdbit",
101
+ "--xzgjp8e": "x1scyh3n xptpqrj",
102
+ $$css: true
103
+ },
104
+ viewportTop: {
105
+ k87sOh: "xs8ca6r",
106
+ $$css: true
107
+ },
108
+ viewportBottom: {
109
+ krVfgx: "x19hvrdr",
110
+ $$css: true
111
+ },
112
+ viewportLeft: {
113
+ kbCHJM: "x19f49xq",
114
+ $$css: true
115
+ },
116
+ viewportCenter: {
117
+ kbCHJM: "x1nrll8i",
118
+ k3aq6I: "xuuh30",
119
+ $$css: true
120
+ },
121
+ viewportRight: {
122
+ kCIrl2: "xpg08jz",
123
+ $$css: true
124
+ },
125
+ stack: {
126
+ krVfgx: "x1ey2m1c",
127
+ kbCHJM: "xu96u03",
128
+ kfzvcC: "xt0hzig",
129
+ kVAEAm: "x10l6tqk",
130
+ kCIrl2: "x3m8u43",
131
+ $$css: true
132
+ },
133
+ stackTop: {
134
+ krVfgx: "xdd4er5",
135
+ k87sOh: "x13vifvy",
136
+ $$css: true
137
+ },
138
+ root: {
139
+ kWkggS: "x1sgh50o",
140
+ kVAM5u: "x13xm7is",
141
+ kaIpWk: "x7c24we",
142
+ ksu8eU: "x1y0btm7",
143
+ kMzoRj: "xzgztj1",
144
+ krVfgx: "x1ey2m1c",
145
+ kGVxlE: "x1juquzk",
146
+ kMwMTN: "x1alews2",
147
+ kZKoxP: "x4a9ltk",
148
+ kI3sdo: "x1a2a7pz",
149
+ kVQacm: "xb3r6kr",
150
+ kfzvcC: "x67bb7w",
151
+ kVAEAm: "x10l6tqk",
152
+ kbCHJM: "xu96u03",
153
+ kCIrl2: "x3m8u43",
154
+ k3aq6I: "x192b8fm",
155
+ k3nNDw: "xm4efwp",
156
+ kmkexE: "x1fye3y2",
157
+ kfSwDN: "x87ps6o",
158
+ kzqmXN: "xh8yej3",
159
+ k6sLGO: "x1so62im",
160
+ kY2c9j: "x1l48cz2",
161
+ k5JduY: "x1s928wv",
162
+ k4zj60: "x3nd85q",
163
+ kH8cDV: "x17cx49",
164
+ kwXMNM: "x1j6awrg",
165
+ k3foIR: "x1srwf7z",
166
+ kkgrvl: "x4eaejv",
167
+ kZs9gx: "x7yqiub",
168
+ kiEn40: "x1q375v2",
169
+ k7shQP: "x9v5kkp",
170
+ kPJHz1: "x11ci167",
171
+ kTrA0T: "xnbj6on",
172
+ kfkD4s: "x1pn4af4",
173
+ kBPcrh: "x1awh1os",
174
+ keMjcj: "x1a042xe",
175
+ k4F3UM: "xlq082z",
176
+ krwDK1: "xm69ghq",
177
+ kJcGZN: "x1llxi74",
178
+ kWGbKe: "x1i389j4",
179
+ kMqVnt: "x1gqblgl",
180
+ kkOw2F: "x1yzz94r",
181
+ k9qGvA: "xkjqs5f",
182
+ kNwbpG: "x17lkgwk",
183
+ kAHiuG: "xmpnhxk",
184
+ krnjz7: "x1v5215y",
185
+ k6CgDc: "x1yjfzay",
186
+ kahdpk: "xks8tqp",
187
+ k7DTxh: "x1ymz01m",
188
+ $$css: true
189
+ },
190
+ rootTop: {
191
+ krVfgx: "xdd4er5",
192
+ k87sOh: "x13vifvy",
193
+ k3aq6I: "x1pniplx",
194
+ k3nNDw: "xtj8gnn",
195
+ kBPcrh: "xrdgflj",
196
+ kWGbKe: "xv51xxh",
197
+ kkOw2F: "x18p6d6d",
198
+ kAHiuG: "x1hdwxx3",
199
+ krnjz7: "xhkt67u",
200
+ kahdpk: "x1rxji30",
201
+ k7DTxh: "x1ws6grc",
202
+ $$css: true
203
+ },
204
+ content: {
205
+ kGNEyG: "x6s0dn4",
206
+ k1xSpc: "x78zum5",
207
+ kOIVth: "xmtacc2",
208
+ kZKoxP: "x5yr21d",
209
+ kAzted: "xyvwee0",
210
+ kVQacm: "xb3r6kr",
211
+ kmVPX3: "xkm8lt0",
212
+ kVAEAm: "x1n2onr6",
213
+ kIyJzY: "x1ial40k",
214
+ k1ekBW: "x19991ni",
215
+ khG6SB: "x14vjn7q",
216
+ kLv8QS: "x14cldyx",
217
+ $$css: true
218
+ },
219
+ message: {
220
+ k1xSpc: "x78zum5",
221
+ kUk6DE: "x98rzlu",
222
+ kXwgrk: "xdt5ytf",
223
+ kOIVth: "x1kr9b5u",
224
+ k7Eaqz: "xeuugli",
225
+ $$css: true
226
+ },
227
+ title: {
228
+ kGuDYH: "x99mhxu",
229
+ k63SB2: "x1v899x5",
230
+ kLWn49: "x1hfsx4t",
231
+ kogj98: "x1ghz6dp",
232
+ $$css: true
233
+ },
234
+ description: {
235
+ kMwMTN: "x1ry1pnm",
236
+ kGuDYH: "x99mhxu",
237
+ kLWn49: "xi1fz51",
238
+ kogj98: "x1ghz6dp",
239
+ $$css: true
240
+ },
241
+ statusIcon: {
242
+ kGNEyG: "x6s0dn4",
243
+ kSGwAc: "xqcrz7y",
244
+ k1xSpc: "x3nfvp2",
245
+ kmuXW: "x2lah0s",
246
+ kZKoxP: "xswfmaf",
247
+ kjj79g: "xl56j7k",
248
+ keoZOQ: "xsj8jdm",
249
+ kzqmXN: "xmkpuva",
250
+ $$css: true
251
+ },
252
+ default: {
253
+ kMwMTN: "x1ry1pnm",
254
+ $$css: true
255
+ },
256
+ success: {
257
+ kMwMTN: "x6pgtun",
258
+ $$css: true
259
+ },
260
+ info: {
261
+ kMwMTN: "x4u89p0",
262
+ $$css: true
263
+ },
264
+ warning: {
265
+ kMwMTN: "x1vhcv9p",
266
+ $$css: true
267
+ },
268
+ error: {
269
+ kMwMTN: "xm777y0",
270
+ $$css: true
271
+ },
272
+ loading: {
273
+ kMwMTN: "x1ry1pnm",
274
+ $$css: true
275
+ },
276
+ loadingIcon: {
277
+ k44tkh: "xof6966",
278
+ ko0y90: "xa4qsjk",
279
+ kKVMdj: "xpedhrg",
280
+ kyAemX: "x1esw782",
281
+ kVAM5u: "x13xm7is",
282
+ kaIpWk: "x9gkxt8",
283
+ k26BEO: "x18v6yaz",
284
+ ksu8eU: "x1y0btm7",
285
+ kMzoRj: "x1shk7dx",
286
+ kmuXW: "x2lah0s",
287
+ kZKoxP: "xswfmaf",
288
+ kzqmXN: "xmkpuva",
289
+ kkDQuc: "xfs3gwd",
290
+ $$css: true
291
+ },
292
+ action: {
293
+ kysU6D: "xjyslct",
294
+ kWkggS: "x8m6yc2",
295
+ kVAM5u: "x13xm7is",
296
+ kaIpWk: "x7c24we",
297
+ ksu8eU: "x1y0btm7",
298
+ kMzoRj: "xzgztj1",
299
+ kMwMTN: "x1alews2",
300
+ kkrTdU: "x1ypdohk",
301
+ kmuXW: "x2lah0s",
302
+ kMv6JI: "x14e0hi7",
303
+ kGuDYH: "x131ut49",
304
+ k63SB2: "x1v899x5",
305
+ kZKoxP: "xb8l8e1",
306
+ kI3sdo: "x1a2a7pz",
307
+ kg3NbH: "xdaxh69",
308
+ kGzVvX: "x1o026c7",
309
+ kZs9gx: "x7yqiub",
310
+ kiEn40: "x1q375v2",
311
+ k7shQP: "x9v5kkp",
312
+ kPJHz1: "x11ci167",
313
+ $$css: true
314
+ },
315
+ close: {
316
+ kGNEyG: "x6s0dn4",
317
+ kysU6D: "xjyslct",
318
+ kWkggS: "xjbqb8w",
319
+ kVAM5u: "x9r1u3d",
320
+ kaIpWk: "x7c24we",
321
+ ksu8eU: "x1y0btm7",
322
+ kMzoRj: "xzgztj1",
323
+ kMwMTN: "x1ry1pnm",
324
+ kkrTdU: "x1ypdohk",
325
+ k1xSpc: "x3nfvp2",
326
+ kmuXW: "x2lah0s",
327
+ kZKoxP: "xb8l8e1",
328
+ kjj79g: "xl56j7k",
329
+ kI3sdo: "x1a2a7pz",
330
+ kzqmXN: "xh29eag",
331
+ kGzVvX: "x1o026c7",
332
+ kDPRdz: "x3s8dm3",
333
+ kZs9gx: "x7yqiub",
334
+ kiEn40: "x1q375v2",
335
+ k7shQP: "x9v5kkp",
336
+ kPJHz1: "x11ci167",
337
+ $$css: true
338
+ },
339
+ clearAll: {
340
+ kysU6D: "xjyslct",
341
+ kWkggS: "x13hkpcx",
342
+ kVAM5u: "x13xm7is",
343
+ ksu8eU: "x1y0btm7",
344
+ kaIpWk: "x7c24we",
345
+ kMzoRj: "xzgztj1",
346
+ kMwMTN: "x1ry1pnm",
347
+ kkrTdU: "x1ypdohk",
348
+ kMv6JI: "x14e0hi7",
349
+ kGuDYH: "x131ut49",
350
+ k63SB2: "x1v899x5",
351
+ kZKoxP: "xb8l8e1",
352
+ kI3sdo: "x1a2a7pz",
353
+ k8WAf4: "x15cgg",
354
+ kg3NbH: "x1cot6zx",
355
+ kSiTet: "x1o2uyhu",
356
+ kfzvcC: "x3dtjyh",
357
+ kVAEAm: "x10l6tqk",
358
+ kCIrl2: "x3m8u43",
359
+ k87sOh: "x13vifvy",
360
+ kY2c9j: "x1bkdxzg",
361
+ kGzVvX: "xh3kehl",
362
+ kDPRdz: "x3s8dm3",
363
+ kZs9gx: "x7yqiub",
364
+ kiEn40: "x1q375v2",
365
+ k7shQP: "x9v5kkp",
366
+ kPJHz1: "x11ci167",
367
+ $$css: true
368
+ },
369
+ clearAllTop: {
370
+ krVfgx: "x1ey2m1c",
371
+ k87sOh: "x80663w",
372
+ $$css: true
373
+ }
374
+ };
375
+ var toast = ToastPrimitive.createToastManager();
376
+ var toastIcons = {
377
+ success: "success",
378
+ info: "info",
379
+ warning: "warning",
380
+ error: "error"
381
+ };
382
+ function ToastStatusIcon(t0) {
383
+ const $ = _c(8);
384
+ const {
385
+ type
386
+ } = t0;
387
+ if (!type || type === "default") {
388
+ return null;
389
+ }
390
+ if (type === "loading") {
391
+ let t12;
392
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
393
+ t12 = /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", className: "xof6966 xa4qsjk xpedhrg x1esw782 x13xm7is x9gkxt8 x18v6yaz x1y0btm7 x1shk7dx x2lah0s xswfmaf xmkpuva xfs3gwd" });
394
+ $[0] = t12;
395
+ } else {
396
+ t12 = $[0];
397
+ }
398
+ return t12;
399
+ }
400
+ const iconName = toastIcons[type];
401
+ if (!iconName) {
402
+ return null;
403
+ }
404
+ let t1;
405
+ if ($[1] !== type) {
406
+ t1 = stylex.props(styles.statusIcon, styles[type]);
407
+ $[1] = type;
408
+ $[2] = t1;
409
+ } else {
410
+ t1 = $[2];
411
+ }
412
+ let t2;
413
+ if ($[3] !== iconName) {
414
+ t2 = /* @__PURE__ */ jsx2(Icon, { name: iconName });
415
+ $[3] = iconName;
416
+ $[4] = t2;
417
+ } else {
418
+ t2 = $[4];
419
+ }
420
+ let t3;
421
+ if ($[5] !== t1 || $[6] !== t2) {
422
+ t3 = /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", ...t1, children: t2 });
423
+ $[5] = t1;
424
+ $[6] = t2;
425
+ $[7] = t3;
426
+ } else {
427
+ t3 = $[7];
428
+ }
429
+ return t3;
430
+ }
431
+ function ToastStack(t0) {
432
+ const $ = _c(10);
433
+ const {
434
+ position
435
+ } = t0;
436
+ const {
437
+ toasts
438
+ } = ToastPrimitive.useToastManager();
439
+ const stackRef = useRef(null);
440
+ const [height, setHeight] = useState(0);
441
+ const isTop = position.startsWith("top");
442
+ const hasClearAction = toasts.length > 1;
443
+ const stackHeight = hasClearAction ? `calc(${height}px + 1.75rem + ${spacingVars.space2})` : height;
444
+ let t1;
445
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
446
+ t1 = () => {
447
+ const stack = stackRef.current;
448
+ if (!stack) {
449
+ return;
450
+ }
451
+ const measuredStack = stack;
452
+ const updateHeight = function updateHeight2() {
453
+ const rootList = Array.from(measuredStack.querySelectorAll("[data-nuee-toast-root]:not([data-limited])"));
454
+ const toastGap = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) * 0.75;
455
+ const nextHeight = rootList.reduce((maximumHeight, root) => {
456
+ const rootStyles = getComputedStyle(root);
457
+ const offset = Number.parseFloat(rootStyles.getPropertyValue("--toast-offset-y")) || 0;
458
+ const index = Number.parseFloat(rootStyles.getPropertyValue("--toast-index")) || 0;
459
+ const rootHeight = Number.parseFloat(rootStyles.getPropertyValue("--toast-height")) || root.offsetHeight;
460
+ return Math.max(maximumHeight, offset + index * toastGap + rootHeight);
461
+ }, 0);
462
+ setHeight((currentHeight) => currentHeight === nextHeight ? currentHeight : nextHeight);
463
+ };
464
+ updateHeight();
465
+ const resizeObserver = new ResizeObserver(updateHeight);
466
+ const rootList_0 = measuredStack.querySelectorAll("[data-nuee-toast-root]");
467
+ rootList_0.forEach((root_0) => resizeObserver.observe(root_0));
468
+ window.addEventListener("resize", updateHeight);
469
+ return () => {
470
+ resizeObserver.disconnect();
471
+ window.removeEventListener("resize", updateHeight);
472
+ };
473
+ };
474
+ $[0] = t1;
475
+ } else {
476
+ t1 = $[0];
477
+ }
478
+ let t2;
479
+ if ($[1] !== toasts) {
480
+ t2 = [toasts];
481
+ $[1] = toasts;
482
+ $[2] = t2;
483
+ } else {
484
+ t2 = $[2];
485
+ }
486
+ useLayoutEffect(t1, t2);
487
+ let t3;
488
+ if ($[3] !== stackHeight) {
489
+ t3 = {
490
+ height: stackHeight
491
+ };
492
+ $[3] = stackHeight;
493
+ $[4] = t3;
494
+ } else {
495
+ t3 = $[4];
496
+ }
497
+ const t4 = {
498
+ 0: {
499
+ className: "x1ey2m1c xu96u03 xt0hzig x10l6tqk x3m8u43"
500
+ },
501
+ 1: {
502
+ className: "xu96u03 xt0hzig x10l6tqk x3m8u43 xdd4er5 x13vifvy"
503
+ }
504
+ }[!!isTop << 0];
505
+ const t5 = toasts.map((item) => /* @__PURE__ */ jsx2(ToastPrimitive.Root, { toast: item, "data-nuee-toast-root": "", ...{
506
+ 0: {
507
+ className: "x1sgh50o x13xm7is x7c24we x1y0btm7 xzgztj1 x1ey2m1c x1juquzk x1alews2 x4a9ltk x1a2a7pz xb3r6kr x67bb7w x10l6tqk xu96u03 x3m8u43 x192b8fm xm4efwp x1fye3y2 x87ps6o xh8yej3 x1so62im x1l48cz2 x1s928wv x3nd85q x17cx49 x1j6awrg x1srwf7z x4eaejv x7yqiub x1q375v2 x9v5kkp x11ci167 xnbj6on x1pn4af4 x1awh1os x1a042xe xlq082z xm69ghq x1llxi74 x1i389j4 x1gqblgl x1yzz94r xkjqs5f x17lkgwk xmpnhxk x1v5215y x1yjfzay xks8tqp x1ymz01m"
508
+ },
509
+ 1: {
510
+ className: "x1sgh50o x13xm7is x7c24we x1y0btm7 xzgztj1 x1juquzk x1alews2 x4a9ltk x1a2a7pz xb3r6kr x67bb7w x10l6tqk xu96u03 x3m8u43 x1fye3y2 x87ps6o xh8yej3 x1so62im x1l48cz2 x1s928wv x3nd85q x17cx49 x1j6awrg x1srwf7z x4eaejv x7yqiub x1q375v2 x9v5kkp x11ci167 xnbj6on x1pn4af4 x1a042xe xlq082z xm69ghq x1llxi74 x1gqblgl xkjqs5f x17lkgwk x1yjfzay xdd4er5 x13vifvy x1pniplx xtj8gnn xrdgflj xv51xxh x18p6d6d x1hdwxx3 xhkt67u x1rxji30 x1ws6grc"
511
+ }
512
+ }[!!isTop << 0], children: /* @__PURE__ */ jsxs(ToastPrimitive.Content, { className: "x6s0dn4 x78zum5 xmtacc2 x5yr21d xyvwee0 xb3r6kr xkm8lt0 x1n2onr6 x1ial40k x19991ni x14vjn7q x14cldyx", children: [
513
+ /* @__PURE__ */ jsx2(ToastStatusIcon, { type: item.type }),
514
+ /* @__PURE__ */ jsxs("div", { className: "x78zum5 x98rzlu xdt5ytf x1kr9b5u xeuugli", children: [
515
+ /* @__PURE__ */ jsx2(ToastPrimitive.Title, { className: "x99mhxu x1v899x5 x1hfsx4t x1ghz6dp" }),
516
+ /* @__PURE__ */ jsx2(ToastPrimitive.Description, { className: "x1ry1pnm x99mhxu xi1fz51 x1ghz6dp" })
517
+ ] }),
518
+ item.actionProps ? /* @__PURE__ */ jsx2(ToastPrimitive.Action, { className: "xjyslct x8m6yc2 x13xm7is x7c24we x1y0btm7 xzgztj1 x1alews2 x1ypdohk x2lah0s x14e0hi7 x131ut49 x1v899x5 xb8l8e1 x1a2a7pz xdaxh69 x1o026c7 x7yqiub x1q375v2 x9v5kkp x11ci167" }) : null,
519
+ /* @__PURE__ */ jsx2(ToastPrimitive.Close, { "aria-label": "Close toast", className: "x6s0dn4 xjyslct xjbqb8w x9r1u3d x7c24we x1y0btm7 xzgztj1 x1ry1pnm x1ypdohk x3nfvp2 x2lah0s xb8l8e1 xl56j7k x1a2a7pz xh29eag x1o026c7 x3s8dm3 x7yqiub x1q375v2 x9v5kkp x11ci167", children: /* @__PURE__ */ jsx2(Icon, { "aria-hidden": "true", name: "close" }) })
520
+ ] }) }, item.id));
521
+ const t6 = hasClearAction ? /* @__PURE__ */ jsx2("button", { type: "button", onClick: _temp, ...{
522
+ 0: {
523
+ className: "xjyslct x13hkpcx x13xm7is x1y0btm7 x7c24we xzgztj1 x1ry1pnm x1ypdohk x14e0hi7 x131ut49 x1v899x5 xb8l8e1 x1a2a7pz x15cgg x1cot6zx x1o2uyhu x3dtjyh x10l6tqk x3m8u43 x13vifvy x1bkdxzg xh3kehl x3s8dm3 x7yqiub x1q375v2 x9v5kkp x11ci167"
524
+ },
525
+ 1: {
526
+ className: "xjyslct x13hkpcx x13xm7is x1y0btm7 x7c24we xzgztj1 x1ry1pnm x1ypdohk x14e0hi7 x131ut49 x1v899x5 xb8l8e1 x1a2a7pz x15cgg x1cot6zx x1o2uyhu x3dtjyh x10l6tqk x3m8u43 x1bkdxzg xh3kehl x3s8dm3 x7yqiub x1q375v2 x9v5kkp x11ci167 x1ey2m1c x80663w"
527
+ }
528
+ }[!!isTop << 0], children: "Clear all" }) : null;
529
+ let t7;
530
+ if ($[5] !== t3 || $[6] !== t4 || $[7] !== t5 || $[8] !== t6) {
531
+ t7 = /* @__PURE__ */ jsxs("div", { ref: stackRef, style: t3, ...t4, children: [
532
+ t5,
533
+ t6
534
+ ] });
535
+ $[5] = t3;
536
+ $[6] = t4;
537
+ $[7] = t5;
538
+ $[8] = t6;
539
+ $[9] = t7;
540
+ } else {
541
+ t7 = $[9];
542
+ }
543
+ return t7;
544
+ }
545
+ function _temp() {
546
+ return toast.close();
547
+ }
548
+ function Toaster(t0) {
549
+ const $ = _c(18);
550
+ let props2;
551
+ let t1;
552
+ let t2;
553
+ if ($[0] !== t0) {
554
+ ({
555
+ limit: t1,
556
+ position: t2,
557
+ ...props2
558
+ } = t0);
559
+ $[0] = t0;
560
+ $[1] = props2;
561
+ $[2] = t1;
562
+ $[3] = t2;
563
+ } else {
564
+ props2 = $[1];
565
+ t1 = $[2];
566
+ t2 = $[3];
567
+ }
568
+ const limit = t1 === void 0 ? 3 : t1;
569
+ const position = t2 === void 0 ? "bottom-right" : t2;
570
+ let t3;
571
+ if ($[4] !== position) {
572
+ t3 = position.split("-");
573
+ $[4] = position;
574
+ $[5] = t3;
575
+ } else {
576
+ t3 = $[5];
577
+ }
578
+ const [verticalPosition, horizontalPosition] = t3;
579
+ let t4;
580
+ if ($[6] !== horizontalPosition || $[7] !== verticalPosition) {
581
+ t4 = {
582
+ 0: {
583
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj x19hvrdr"
584
+ },
585
+ 8: {
586
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj xs8ca6r"
587
+ },
588
+ 4: {
589
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj x19hvrdr x19f49xq"
590
+ },
591
+ 12: {
592
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj xs8ca6r x19f49xq"
593
+ },
594
+ 2: {
595
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj x19hvrdr x1nrll8i xuuh30"
596
+ },
597
+ 10: {
598
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj xs8ca6r x1nrll8i xuuh30"
599
+ },
600
+ 6: {
601
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj x19hvrdr x1nrll8i xuuh30"
602
+ },
603
+ 14: {
604
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj xs8ca6r x1nrll8i xuuh30"
605
+ },
606
+ 1: {
607
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj x19hvrdr xpg08jz"
608
+ },
609
+ 9: {
610
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj xs8ca6r xpg08jz"
611
+ },
612
+ 5: {
613
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj x19hvrdr x19f49xq xpg08jz"
614
+ },
615
+ 13: {
616
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj xs8ca6r x19f49xq xpg08jz"
617
+ },
618
+ 3: {
619
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj x19hvrdr x1nrll8i xuuh30 xpg08jz"
620
+ },
621
+ 11: {
622
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj xs8ca6r x1nrll8i xuuh30 xpg08jz"
623
+ },
624
+ 7: {
625
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj x19hvrdr x1nrll8i xuuh30 xpg08jz"
626
+ },
627
+ 15: {
628
+ className: "xowlazn x1a2a7pz x47corl xixxii4 xjdehy0 x6y048q xeffijn xac14zw x1jm5hub xsbdbit x1scyh3n xptpqrj xs8ca6r x1nrll8i xuuh30 xpg08jz"
629
+ }
630
+ }[!!(verticalPosition === "top") << 3 | !!(horizontalPosition === "left") << 2 | !!(horizontalPosition === "center") << 1 | !!(horizontalPosition === "right") << 0];
631
+ $[6] = horizontalPosition;
632
+ $[7] = verticalPosition;
633
+ $[8] = t4;
634
+ } else {
635
+ t4 = $[8];
636
+ }
637
+ let t5;
638
+ if ($[9] !== position) {
639
+ t5 = /* @__PURE__ */ jsx2(ToastStack, { position });
640
+ $[9] = position;
641
+ $[10] = t5;
642
+ } else {
643
+ t5 = $[10];
644
+ }
645
+ let t6;
646
+ if ($[11] !== t4 || $[12] !== t5) {
647
+ t6 = /* @__PURE__ */ jsx2(ToastPrimitive.Portal, { children: /* @__PURE__ */ jsx2(ToastPrimitive.Viewport, { ...t4, children: t5 }) });
648
+ $[11] = t4;
649
+ $[12] = t5;
650
+ $[13] = t6;
651
+ } else {
652
+ t6 = $[13];
653
+ }
654
+ let t7;
655
+ if ($[14] !== limit || $[15] !== props2 || $[16] !== t6) {
656
+ t7 = /* @__PURE__ */ jsx2(ToastPrimitive.Provider, { ...props2, limit, toastManager: toast, children: t6 });
657
+ $[14] = limit;
658
+ $[15] = props2;
659
+ $[16] = t6;
660
+ $[17] = t7;
661
+ } else {
662
+ t7 = $[17];
663
+ }
664
+ return t7;
665
+ }
666
+ export {
667
+ Toaster,
668
+ toast
669
+ };
670
+ //# sourceMappingURL=toast.js.map