@moondreamsdev/dreamer-ui 1.7.10-test.15 → 1.7.10-test.150

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 (216) hide show
  1. package/dist/Toast-CZP-yFBM.js +617 -0
  2. package/dist/Toast-CZP-yFBM.js.map +1 -0
  3. package/dist/Toast-DnJHnDxS.cjs +2 -0
  4. package/dist/Toast-DnJHnDxS.cjs.map +1 -0
  5. package/dist/Window-DeUS0Imz.cjs +2 -0
  6. package/dist/Window-DeUS0Imz.cjs.map +1 -0
  7. package/dist/{Window-7myUuX6Y.js → Window-jwkN6WT6.js} +138 -23
  8. package/dist/Window-jwkN6WT6.js.map +1 -0
  9. package/dist/components.cjs.js +2 -2
  10. package/dist/components.cjs.js.map +1 -1
  11. package/dist/components.esm.js +4659 -2238
  12. package/dist/components.esm.js.map +1 -1
  13. package/dist/hooks.cjs.js +1 -1
  14. package/dist/hooks.esm.js +6 -4
  15. package/dist/hooks.esm.js.map +1 -1
  16. package/dist/providers.cjs.js +1 -1
  17. package/dist/providers.esm.js +2 -2
  18. package/dist/src/components/accordion/Accordion.d.ts +21 -0
  19. package/dist/src/components/accordion/AccordionItem.d.ts +11 -0
  20. package/dist/src/components/accordion/index.d.ts +2 -0
  21. package/dist/src/components/actionmodal/ActionModal.d.ts +21 -0
  22. package/dist/src/components/actionmodal/index.d.ts +1 -0
  23. package/dist/src/components/avatar/Avatar.d.ts +23 -0
  24. package/dist/src/components/avatar/icons.d.ts +30 -0
  25. package/dist/src/components/avatar/index.d.ts +1 -0
  26. package/dist/src/components/avatar/variants.d.ts +8 -0
  27. package/dist/src/components/badge/Badge.d.ts +15 -0
  28. package/dist/src/components/badge/index.d.ts +1 -0
  29. package/dist/src/components/badge/variants.d.ts +13 -0
  30. package/dist/src/components/button/Button.d.ts +16 -0
  31. package/dist/src/components/button/LoadingDots.d.ts +1 -0
  32. package/dist/src/components/button/index.d.ts +2 -0
  33. package/dist/src/components/button/variants.d.ts +34 -0
  34. package/dist/src/components/callout/Callout.d.ts +23 -0
  35. package/dist/src/components/callout/index.d.ts +1 -0
  36. package/dist/src/components/callout/variants.d.ts +9 -0
  37. package/dist/src/components/card/Card.d.ts +29 -0
  38. package/dist/src/components/card/index.d.ts +1 -0
  39. package/dist/src/components/card/variants.d.ts +10 -0
  40. package/dist/src/components/carousel/Carousel.d.ts +46 -0
  41. package/dist/src/components/carousel/hooks.d.ts +21 -0
  42. package/dist/src/components/carousel/index.d.ts +1 -0
  43. package/dist/src/components/carousel/variants.d.ts +36 -0
  44. package/dist/src/components/checkbox/Checkbox.d.ts +13 -0
  45. package/dist/src/components/checkbox/hooks.d.ts +1 -0
  46. package/dist/src/components/checkbox/index.d.ts +1 -0
  47. package/dist/src/components/clickable/Clickable.d.ts +9 -0
  48. package/dist/src/components/clickable/index.d.ts +1 -0
  49. package/dist/src/components/code/Code.d.ts +9 -0
  50. package/dist/src/components/code/hooks.d.ts +8 -0
  51. package/dist/src/components/code/index.d.ts +1 -0
  52. package/dist/src/components/code/variants.d.ts +7 -0
  53. package/dist/src/components/code-block/CodeBlock.d.ts +2 -1
  54. package/dist/src/components/code-block/classes.d.ts +5 -0
  55. package/dist/src/components/code-block/constants.d.ts +2 -4
  56. package/dist/src/components/code-block/format.d.ts +3 -2
  57. package/dist/src/components/code-block/hooks.d.ts +17 -0
  58. package/dist/src/components/code-block/index.d.ts +2 -0
  59. package/dist/src/components/code-block/tokenize.d.ts +8 -1
  60. package/dist/src/components/code-block/types.d.ts +36 -19
  61. package/dist/src/components/code-block/util.d.ts +2 -0
  62. package/dist/src/components/disclosure/Disclosure.d.ts +22 -0
  63. package/dist/src/components/disclosure/index.d.ts +1 -0
  64. package/dist/src/components/drawer/Drawer.d.ts +35 -0
  65. package/dist/src/components/drawer/hooks.d.ts +23 -0
  66. package/dist/src/components/drawer/index.d.ts +1 -0
  67. package/dist/src/components/dropdown-menu/DropdownContext.d.ts +16 -0
  68. package/dist/src/components/dropdown-menu/DropdownMenu.d.ts +9 -0
  69. package/dist/src/components/dropdown-menu/DropdownMenuBody.d.ts +6 -0
  70. package/dist/src/components/dropdown-menu/DropdownMenuOption.d.ts +7 -0
  71. package/dist/src/components/dropdown-menu/DropdownMenuSub.d.ts +6 -0
  72. package/dist/src/components/dropdown-menu/factories.d.ts +7 -0
  73. package/dist/src/components/dropdown-menu/hooks.d.ts +12 -0
  74. package/dist/src/components/dropdown-menu/index.d.ts +3 -0
  75. package/dist/src/components/dropdown-menu/types.d.ts +26 -0
  76. package/dist/src/components/dynamic-list/DynamicList.d.ts +41 -0
  77. package/dist/src/components/dynamic-list/hooks.d.ts +19 -0
  78. package/dist/src/components/dynamic-list/index.d.ts +2 -0
  79. package/dist/src/components/dynamic-list/markers.d.ts +8 -0
  80. package/dist/src/components/dynamic-list/variants.d.ts +4 -0
  81. package/dist/src/components/error-boundary/ErrorBoundary.d.ts +25 -0
  82. package/dist/src/components/error-boundary/index.d.ts +1 -0
  83. package/dist/src/components/error-boundary/variants.d.ts +11 -0
  84. package/dist/src/components/form/Form.d.ts +5 -0
  85. package/dist/src/components/form/factories.d.ts +8 -0
  86. package/dist/src/components/form/hooks.d.ts +9 -0
  87. package/dist/src/components/form/index.d.ts +3 -0
  88. package/dist/src/components/form/types.d.ts +81 -0
  89. package/dist/src/components/form/variants.d.ts +29 -0
  90. package/dist/src/components/index.d.ts +36 -0
  91. package/dist/src/components/input/Input.d.ts +10 -0
  92. package/dist/src/components/input/index.d.ts +1 -0
  93. package/dist/src/components/input/variants.d.ts +20 -0
  94. package/dist/src/components/label/Label.d.ts +10 -0
  95. package/dist/src/components/label/index.d.ts +1 -0
  96. package/dist/src/components/modal/Modal.d.ts +23 -0
  97. package/dist/src/components/modal/hooks.d.ts +6 -0
  98. package/dist/src/components/modal/index.d.ts +1 -0
  99. package/dist/src/components/pagination/Pagination.d.ts +23 -0
  100. package/dist/src/components/pagination/index.d.ts +1 -0
  101. package/dist/src/components/pagination/variants.d.ts +15 -0
  102. package/dist/src/components/panel/Panel.d.ts +36 -0
  103. package/dist/src/components/panel/hooks.d.ts +6 -0
  104. package/dist/src/components/panel/index.d.ts +1 -0
  105. package/dist/src/components/panel/variants.d.ts +12 -0
  106. package/dist/src/components/popover/Popover.d.ts +22 -0
  107. package/dist/src/components/popover/hooks.d.ts +12 -0
  108. package/dist/src/components/popover/index.d.ts +2 -0
  109. package/dist/src/components/popover/variants.d.ts +3 -0
  110. package/dist/src/components/radiogroup/RadioGroup.d.ts +19 -0
  111. package/dist/src/components/radiogroup/RadioGroupItem.d.ts +13 -0
  112. package/dist/src/components/radiogroup/RadioInput.d.ts +9 -0
  113. package/dist/src/components/radiogroup/hooks.d.ts +1 -0
  114. package/dist/src/components/radiogroup/index.d.ts +3 -0
  115. package/dist/src/components/scroll-area/ScrollArea.d.ts +20 -0
  116. package/dist/src/components/scroll-area/hooks.d.ts +13 -0
  117. package/dist/src/components/scroll-area/index.d.ts +1 -0
  118. package/dist/src/components/select/Select.d.ts +22 -0
  119. package/dist/src/components/select/hooks.d.ts +35 -0
  120. package/dist/src/components/select/index.d.ts +1 -0
  121. package/dist/src/components/select/variants.d.ts +15 -0
  122. package/dist/src/components/separator/Separator.d.ts +15 -0
  123. package/dist/src/components/separator/index.d.ts +1 -0
  124. package/dist/src/components/separator/variants.d.ts +7 -0
  125. package/dist/src/components/skeleton/Skeleton.d.ts +13 -0
  126. package/dist/src/components/skeleton/index.d.ts +1 -0
  127. package/dist/src/components/skeleton/variants.d.ts +18 -0
  128. package/dist/src/components/slider/Slider.d.ts +33 -0
  129. package/dist/src/components/slider/hooks.d.ts +30 -0
  130. package/dist/src/components/slider/index.d.ts +1 -0
  131. package/dist/src/components/slider/variants.d.ts +49 -0
  132. package/dist/src/components/table/Table.d.ts +63 -0
  133. package/dist/src/components/table/hooks.d.ts +28 -0
  134. package/dist/src/components/table/index.d.ts +2 -0
  135. package/dist/src/components/table/variants.d.ts +14 -0
  136. package/dist/src/components/tabs/Tabs.d.ts +26 -0
  137. package/dist/src/components/tabs/TabsContent.d.ts +11 -0
  138. package/dist/src/components/tabs/TabsContext.d.ts +12 -0
  139. package/dist/src/components/tabs/TabsList.d.ts +8 -0
  140. package/dist/src/components/tabs/TabsTrigger.d.ts +16 -0
  141. package/dist/src/components/tabs/hooks.d.ts +9 -0
  142. package/dist/src/components/tabs/index.d.ts +4 -0
  143. package/dist/src/components/tabs/variants.d.ts +18 -0
  144. package/dist/src/components/textarea/CharacterCount.d.ts +6 -0
  145. package/dist/src/components/textarea/Textarea.d.ts +13 -0
  146. package/dist/src/components/textarea/hooks.d.ts +1 -0
  147. package/dist/src/components/textarea/index.d.ts +1 -0
  148. package/dist/src/components/textarea/variants.d.ts +19 -0
  149. package/dist/src/components/toast/Toast.d.ts +25 -0
  150. package/dist/src/components/toast/index.d.ts +1 -0
  151. package/dist/src/components/toggle/Toggle.d.ts +13 -0
  152. package/dist/src/components/toggle/index.d.ts +1 -0
  153. package/dist/src/components/toggle/variants.d.ts +29 -0
  154. package/dist/src/components/tooltip/Tooltip.d.ts +23 -0
  155. package/dist/src/components/tooltip/hooks.d.ts +31 -0
  156. package/dist/src/components/tooltip/index.d.ts +1 -0
  157. package/dist/src/hooks/index.d.ts +3 -0
  158. package/dist/src/hooks/useActionModal.d.ts +4 -0
  159. package/dist/src/hooks/useScreenSize.d.ts +15 -0
  160. package/dist/src/hooks/useToast.d.ts +17 -0
  161. package/dist/src/index.d.ts +1 -0
  162. package/dist/src/providers/ActionModalProvider.d.ts +21 -0
  163. package/dist/src/providers/ToastProvider.d.ts +14 -0
  164. package/dist/src/providers/index.d.ts +2 -0
  165. package/dist/src/shared/forms/StatusHelpMessage.d.ts +7 -0
  166. package/dist/src/shared/forms/index.d.ts +1 -0
  167. package/dist/src/symbols/CaretCollapse.d.ts +2 -0
  168. package/dist/src/symbols/CaretExpand.d.ts +2 -0
  169. package/dist/src/symbols/Check.d.ts +2 -0
  170. package/dist/src/symbols/CheckCircled.d.ts +2 -0
  171. package/dist/src/symbols/ChevronDoubleLeft.d.ts +2 -0
  172. package/dist/src/symbols/ChevronDoubleRight.d.ts +2 -0
  173. package/dist/src/symbols/ChevronDown.d.ts +2 -0
  174. package/dist/src/symbols/ChevronLeft.d.ts +2 -0
  175. package/dist/src/symbols/ChevronRight.d.ts +2 -0
  176. package/dist/src/symbols/ChevronUp.d.ts +2 -0
  177. package/dist/src/symbols/Copy.d.ts +2 -0
  178. package/dist/src/symbols/CrossCircled.d.ts +2 -0
  179. package/dist/src/symbols/Dash.d.ts +2 -0
  180. package/dist/src/symbols/DeepRing.d.ts +2 -0
  181. package/dist/src/symbols/Download.d.ts +2 -0
  182. package/dist/src/symbols/ExclamationTriangle.d.ts +2 -0
  183. package/dist/src/symbols/EyeClosed.d.ts +2 -0
  184. package/dist/src/symbols/EyeOpened.d.ts +2 -0
  185. package/dist/src/symbols/GripVertical.d.ts +2 -0
  186. package/dist/src/symbols/InfoCircled.d.ts +2 -0
  187. package/dist/src/symbols/Plus.d.ts +2 -0
  188. package/dist/src/symbols/QuestionMarkCircled.d.ts +2 -0
  189. package/dist/src/symbols/Trash.d.ts +2 -0
  190. package/dist/src/symbols/Window.d.ts +2 -0
  191. package/dist/src/symbols/X.d.ts +2 -0
  192. package/dist/src/symbols/index.d.ts +26 -0
  193. package/dist/src/symbols/props.d.ts +5 -0
  194. package/dist/src/utils/downloadFile.d.ts +8 -0
  195. package/dist/src/utils/index.d.ts +3 -0
  196. package/dist/src/utils/join.d.ts +8 -0
  197. package/dist/src/utils/mergeRefs.d.ts +2 -0
  198. package/dist/symbols.cjs.js +1 -1
  199. package/dist/symbols.esm.js +22 -17
  200. package/dist/theme.css +5 -2
  201. package/dist/useScreenSize-DiuQZBHb.js +32 -0
  202. package/dist/useScreenSize-DiuQZBHb.js.map +1 -0
  203. package/dist/useScreenSize-UGyolnfn.cjs +2 -0
  204. package/dist/useScreenSize-UGyolnfn.cjs.map +1 -0
  205. package/dist/utils.cjs.js +1 -1
  206. package/dist/utils.cjs.js.map +1 -1
  207. package/dist/utils.esm.js +14 -6
  208. package/dist/utils.esm.js.map +1 -1
  209. package/package.json +1 -1
  210. package/dist/Toast-DKHf6xZF.cjs +0 -2
  211. package/dist/Toast-DKHf6xZF.cjs.map +0 -1
  212. package/dist/Toast-uhtwIXDu.js +0 -427
  213. package/dist/Toast-uhtwIXDu.js.map +0 -1
  214. package/dist/Window-7myUuX6Y.js.map +0 -1
  215. package/dist/Window-DvRXD7fx.cjs +0 -2
  216. package/dist/Window-DvRXD7fx.cjs.map +0 -1
@@ -0,0 +1,617 @@
1
+ import { jsx as t, Fragment as q, jsxs as v } from "react/jsx-runtime";
2
+ import g, { createContext as l, useId as $, useState as x, useEffect as p, useRef as H, useCallback as T, useMemo as L, useContext as j } from "react";
3
+ import { createPortal as K } from "react-dom";
4
+ import { X as P, C as V, E as _, I as F } from "./X-CIoyLewf.js";
5
+ import { j as X } from "./join-BmgR_f4v.js";
6
+ function y(...e) {
7
+ return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
8
+ }
9
+ function Z({ size: e = 15, color: r = "currentColor", className: u = "inline", ...n }) {
10
+ return /* @__PURE__ */ t(
11
+ "svg",
12
+ {
13
+ ...n,
14
+ width: e,
15
+ height: e,
16
+ className: u,
17
+ viewBox: "0 0 15 15",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ children: /* @__PURE__ */ t(
20
+ "path",
21
+ {
22
+ d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
23
+ fill: r,
24
+ fillRule: "evenodd",
25
+ clipRule: "evenodd"
26
+ }
27
+ )
28
+ }
29
+ );
30
+ }
31
+ function N(...e) {
32
+ return e.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
33
+ }
34
+ l(void 0);
35
+ l(null);
36
+ l(null);
37
+ l(null);
38
+ l(null);
39
+ l(null);
40
+ l(null);
41
+ l(null);
42
+ l(null);
43
+ l(null);
44
+ l(null);
45
+ l(null);
46
+ l(null);
47
+ l(null);
48
+ l(null);
49
+ l(null);
50
+ l(void 0);
51
+ l(void 0);
52
+ l(null);
53
+ l(void 0);
54
+ l(void 0);
55
+ l(null);
56
+ l(null);
57
+ l(null);
58
+ l(null);
59
+ l(null);
60
+ l(null);
61
+ l(null);
62
+ l(null);
63
+ l(null);
64
+ l(null);
65
+ l(null);
66
+ l(null);
67
+ l(null);
68
+ l(null);
69
+ l(null);
70
+ l(null);
71
+ l(null);
72
+ l(null);
73
+ l(null);
74
+ l(null);
75
+ l(null);
76
+ l(null);
77
+ l(null);
78
+ l(null);
79
+ l(null);
80
+ l(null);
81
+ l(null);
82
+ l(null);
83
+ l(null);
84
+ l(null);
85
+ l(null);
86
+ l(null);
87
+ l(null);
88
+ l(null);
89
+ l(null);
90
+ l(null);
91
+ l(null);
92
+ l(null);
93
+ l(null);
94
+ l(null);
95
+ l(null);
96
+ l(null);
97
+ l(null);
98
+ l(null);
99
+ l(null);
100
+ l(null);
101
+ l(null);
102
+ l(null);
103
+ l(null);
104
+ l(null);
105
+ l(null);
106
+ l(null);
107
+ l(null);
108
+ l(null);
109
+ l(null);
110
+ l(null);
111
+ l(null);
112
+ l(null);
113
+ l(null);
114
+ l(null);
115
+ l(null);
116
+ l(null);
117
+ l(null);
118
+ l(null);
119
+ l(null);
120
+ l(null);
121
+ l(null);
122
+ l(null);
123
+ l(null);
124
+ l(null);
125
+ l(null);
126
+ l(null);
127
+ l(null);
128
+ l(null);
129
+ l(null);
130
+ l(null);
131
+ l(null);
132
+ l(null);
133
+ l(null);
134
+ l(null);
135
+ l(null);
136
+ l(null);
137
+ l(null);
138
+ l(null);
139
+ l(null);
140
+ l(null);
141
+ l(null);
142
+ l(null);
143
+ l(null);
144
+ l(null);
145
+ l(null);
146
+ l(null);
147
+ l(null);
148
+ l(null);
149
+ l(null);
150
+ l(null);
151
+ l(null);
152
+ l(null);
153
+ l(null);
154
+ l(null);
155
+ l(null);
156
+ l(null);
157
+ l(null);
158
+ l(null);
159
+ l(null);
160
+ l(null);
161
+ l(null);
162
+ l(null);
163
+ l(null);
164
+ l(null);
165
+ l(null);
166
+ l(null);
167
+ l(null);
168
+ l(null);
169
+ l(null);
170
+ l(null);
171
+ l(null);
172
+ l(null);
173
+ l(null);
174
+ l(null);
175
+ l(null);
176
+ l(null);
177
+ l(void 0);
178
+ l(void 0);
179
+ l(null);
180
+ l(null);
181
+ l(void 0);
182
+ l(void 0);
183
+ l(null);
184
+ l(null);
185
+ l(void 0);
186
+ l(void 0);
187
+ l(null);
188
+ l(null);
189
+ l(void 0);
190
+ l(void 0);
191
+ l(null);
192
+ l(null);
193
+ l(void 0);
194
+ l(void 0);
195
+ l(null);
196
+ l(null);
197
+ l(void 0);
198
+ l(void 0);
199
+ l(null);
200
+ l(null);
201
+ l(void 0);
202
+ l(void 0);
203
+ l(null);
204
+ l(null);
205
+ l(void 0);
206
+ l(void 0);
207
+ l(null);
208
+ l(null);
209
+ l(void 0);
210
+ l(void 0);
211
+ l(null);
212
+ l(null);
213
+ l(void 0);
214
+ l(void 0);
215
+ l(null);
216
+ l(null);
217
+ l(void 0);
218
+ l(void 0);
219
+ l(null);
220
+ l(null);
221
+ l(void 0);
222
+ l(void 0);
223
+ l(null);
224
+ l(null);
225
+ l(void 0);
226
+ l(void 0);
227
+ l(null);
228
+ l(null);
229
+ l(void 0);
230
+ l(void 0);
231
+ l(null);
232
+ l(null);
233
+ l(void 0);
234
+ l(void 0);
235
+ l(null);
236
+ l(null);
237
+ l(void 0);
238
+ l(void 0);
239
+ function G() {
240
+ const [e, r] = x(0);
241
+ return p(() => {
242
+ const u = setInterval(() => {
243
+ r((n) => (n + 1) % 3);
244
+ }, 500);
245
+ return () => clearInterval(u);
246
+ }, []), /* @__PURE__ */ t("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((u) => /* @__PURE__ */ t(
247
+ "div",
248
+ {
249
+ className: y(
250
+ "rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
251
+ e === u && "transform -translate-y-1"
252
+ )
253
+ },
254
+ u
255
+ )) });
256
+ }
257
+ const J = {
258
+ base: "",
259
+ primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
260
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
261
+ tertiary: "text-primary hover:text-primary-foreground disabled:text-muted",
262
+ outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
263
+ link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
264
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
265
+ }, Q = {
266
+ stripped: "",
267
+ fitted: "size-fit leading-0",
268
+ sm: "px-2 py-1 text-sm",
269
+ md: "px-4 py-2 text-base",
270
+ lg: "px-6 py-3 text-lg",
271
+ icon: "p-1 w-fit aspect-square",
272
+ full: "p-2 w-full"
273
+ }, U = {
274
+ none: "rounded-none",
275
+ sm: "rounded-sm",
276
+ md: "rounded-md",
277
+ lg: "rounded-lg",
278
+ full: "rounded-full"
279
+ }, k = {
280
+ variant: "primary",
281
+ size: "md",
282
+ rounded: "md"
283
+ };
284
+ function W({
285
+ variant: e = k.variant,
286
+ size: r,
287
+ rounded: u = k.rounded,
288
+ loading: n,
289
+ className: o,
290
+ ...i
291
+ }) {
292
+ let d;
293
+ e === "link" && !r ? d = "fitted" : d = r || k.size;
294
+ const s = y(
295
+ "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
296
+ J[e],
297
+ Q[d],
298
+ U[u],
299
+ n && "relative pointer-events-none",
300
+ o
301
+ );
302
+ if (i.href && !i.disabled)
303
+ return /* @__PURE__ */ t(
304
+ "a",
305
+ {
306
+ ...i,
307
+ rel: i.rel ? i.rel : i.target === "_blank" ? "noopener noreferrer" : void 0,
308
+ "aria-label": i["aria-label"],
309
+ "aria-description": i["aria-description"],
310
+ href: i.href,
311
+ className: s,
312
+ children: i.children
313
+ }
314
+ );
315
+ const a = i, c = () => a.children ? typeof a.children == "string" || typeof a.children == "number" || typeof a.children == "boolean" ? /* @__PURE__ */ t("span", { className: y(n && "invisible"), children: a.children }) : g.Children.map(a.children, (m, f) => {
316
+ if (g.isValidElement(m)) {
317
+ const b = m.props;
318
+ return g.cloneElement(m, {
319
+ key: f,
320
+ className: y(n && "invisible", b.className)
321
+ });
322
+ }
323
+ return m;
324
+ }) : null;
325
+ return /* @__PURE__ */ v(
326
+ "button",
327
+ {
328
+ ...a,
329
+ "aria-label": a["aria-label"],
330
+ "aria-description": a["aria-description"],
331
+ "aria-disabled": a.disabled || n,
332
+ "aria-busy": n,
333
+ type: a.type ?? "button",
334
+ className: s,
335
+ children: [
336
+ n && /* @__PURE__ */ t(G, {}),
337
+ c()
338
+ ]
339
+ }
340
+ );
341
+ }
342
+ function Y(e) {
343
+ const [r, u] = x(!1), [n, o] = x(!1);
344
+ return p(() => {
345
+ e ? (o(!0), setTimeout(() => u(!0), 10)) : (u(!1), setTimeout(() => o(!1), 150));
346
+ }, [e]), { show: r, shouldRender: n };
347
+ }
348
+ function R(e, r) {
349
+ p(() => {
350
+ const u = (n) => {
351
+ n.key === "Escape" && e && r();
352
+ };
353
+ return document.addEventListener("keydown", u), e && (document.body.style.overflow = "hidden"), () => {
354
+ document.removeEventListener("keydown", u), document.body.style.overflow = "auto";
355
+ };
356
+ }, [e, r]);
357
+ }
358
+ function ll(e, r) {
359
+ const u = H(null), n = T(() => {
360
+ const o = document.getElementById(e);
361
+ if (!o) return;
362
+ const i = o.querySelectorAll('[data-modal-action="true"]');
363
+ if (i.length > 0) {
364
+ i[0].focus();
365
+ return;
366
+ }
367
+ const d = o.querySelectorAll(
368
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
369
+ );
370
+ if (d.length > 0) {
371
+ const s = Array.from(d).filter((a) => !(a instanceof HTMLButtonElement && a.getAttribute("data-modal-close-button") === "true"));
372
+ if (s.length > 0) {
373
+ s[0].focus();
374
+ return;
375
+ }
376
+ d[0].focus();
377
+ return;
378
+ }
379
+ o.focus();
380
+ }, [e]);
381
+ p(() => (r && (u.current = document.activeElement, n()), () => {
382
+ document.body.style.overflow = "auto", u.current instanceof HTMLElement && u.current.focus();
383
+ }), [r, n]);
384
+ }
385
+ function el({
386
+ id: e,
387
+ isOpen: r,
388
+ onClose: u,
389
+ title: n,
390
+ children: o,
391
+ contentOnly: i = !1,
392
+ className: d,
393
+ overlayClassName: s,
394
+ hideCloseButton: a = !1,
395
+ actions: c = [],
396
+ disableCloseOnOverlayClick: m = !1,
397
+ ariaLabelledBy: f,
398
+ ariaDescribedBy: b
399
+ }) {
400
+ const h = $(), C = e || `modal-${h}`, E = e ? `${e}-title` : `modal-title-${h}`, { show: A, shouldRender: w } = Y(r);
401
+ if (ll(C, w), R(w, u), !w) return null;
402
+ const M = () => n ? g.isValidElement(n) ? /* @__PURE__ */ t("div", { className: "mb-4", children: n }) : /* @__PURE__ */ t("h2", { className: "mb-4 text-xl font-semibold", id: E, children: n }) : null, I = () => c.length === 0 ? null : /* @__PURE__ */ t("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: c.map((B, D) => {
403
+ const { label: O, ...S } = B;
404
+ return /* @__PURE__ */ t(W, { ...S, "data-modal-action": "true", children: O }, D);
405
+ }) });
406
+ return /* @__PURE__ */ t(q, { children: K(
407
+ /* @__PURE__ */ t(
408
+ "div",
409
+ {
410
+ "aria-labelledby": f ?? n ? E : void 0,
411
+ "aria-describedby": b,
412
+ role: "dialog",
413
+ "aria-modal": "true",
414
+ className: "fixed inset-0 z-[100] overflow-y-auto",
415
+ children: /* @__PURE__ */ v("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
416
+ /* @__PURE__ */ t(
417
+ "div",
418
+ {
419
+ className: N("fixed inset-0 bg-black/20 transition-all", s),
420
+ onClick: () => {
421
+ m || u();
422
+ }
423
+ }
424
+ ),
425
+ i && /* @__PURE__ */ t("div", { className: N("relative w-fit", d), children: o }),
426
+ !i && /* @__PURE__ */ v(
427
+ "div",
428
+ {
429
+ id: C,
430
+ tabIndex: -1,
431
+ className: N(
432
+ "relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in duration-75",
433
+ A ? "opacity-100 scale-100" : "opacity-0 scale-90",
434
+ d
435
+ ),
436
+ children: [
437
+ !a && /* @__PURE__ */ t(
438
+ "button",
439
+ {
440
+ type: "button",
441
+ onClick: u,
442
+ "data-modal-close-button": "true",
443
+ className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
444
+ children: /* @__PURE__ */ t(Z, { size: 18 })
445
+ }
446
+ ),
447
+ M(),
448
+ o,
449
+ I()
450
+ ]
451
+ }
452
+ )
453
+ ] })
454
+ }
455
+ ),
456
+ document.body
457
+ ) });
458
+ }
459
+ function dl({
460
+ type: e,
461
+ message: r,
462
+ cancelText: u,
463
+ confirmText: n,
464
+ onConfirm: o,
465
+ onClose: i,
466
+ destructive: d = !1,
467
+ title: s,
468
+ ...a
469
+ }) {
470
+ const c = L(() => e === "confirm" ? {
471
+ confirm: n || "Confirm",
472
+ cancel: u || "Cancel",
473
+ defaultTitle: s || "Confirm Action"
474
+ } : {
475
+ confirm: n || "OK",
476
+ cancel: null,
477
+ defaultTitle: s || "Alert"
478
+ }, [e, n, s, u]), m = L(
479
+ () => [
480
+ ...c.cancel ? [
481
+ {
482
+ label: c.cancel,
483
+ variant: "secondary",
484
+ onClick: i
485
+ }
486
+ ] : [],
487
+ {
488
+ label: c.confirm,
489
+ variant: d ? "destructive" : "primary",
490
+ onClick: () => {
491
+ o == null || o(), i();
492
+ }
493
+ }
494
+ ],
495
+ [c, d, o, i]
496
+ );
497
+ return /* @__PURE__ */ t(
498
+ el,
499
+ {
500
+ ...a,
501
+ title: s || c.defaultTitle,
502
+ onClose: i,
503
+ actions: m,
504
+ disableCloseOnOverlayClick: e === "confirm",
505
+ hideCloseButton: e === "confirm",
506
+ children: typeof r == "string" ? /* @__PURE__ */ t("p", { className: "text-sm", children: r }) : r
507
+ }
508
+ );
509
+ }
510
+ const nl = l(null), sl = () => {
511
+ const e = j(nl);
512
+ if (!e)
513
+ throw new Error("DropdownMenu components must be used within a DropdownMenu component");
514
+ return e;
515
+ }, tl = l(null), cl = () => {
516
+ const e = j(tl);
517
+ if (!e)
518
+ throw new Error("Tabs components must be used within a Tabs component");
519
+ return e;
520
+ }, z = {
521
+ info: {
522
+ className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
523
+ icon: /* @__PURE__ */ t(F, { size: 20 })
524
+ },
525
+ warning: {
526
+ className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
527
+ icon: /* @__PURE__ */ t(_, { size: 20 })
528
+ },
529
+ error: {
530
+ className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
531
+ icon: /* @__PURE__ */ t(V, { size: 20 })
532
+ }
533
+ };
534
+ function ml({
535
+ id: e,
536
+ title: r,
537
+ description: u,
538
+ type: n = "info",
539
+ action: o,
540
+ duration: i = 5e3,
541
+ onRemove: d,
542
+ customTypes: s,
543
+ customComponent: a
544
+ }) {
545
+ const [c, m] = x(!1), f = T(() => {
546
+ m(!0), setTimeout(() => {
547
+ d == null || d(e);
548
+ }, 150);
549
+ }, [e, d]);
550
+ if (p(() => {
551
+ if (i > 0) {
552
+ const h = setTimeout(() => {
553
+ f();
554
+ }, i);
555
+ return () => clearTimeout(h);
556
+ }
557
+ }, [i, e, d, f]), a)
558
+ return /* @__PURE__ */ t(
559
+ a,
560
+ {
561
+ id: e,
562
+ title: r,
563
+ description: u,
564
+ type: n,
565
+ action: o,
566
+ duration: i,
567
+ onRemove: d
568
+ }
569
+ );
570
+ const b = (s == null ? void 0 : s[n]) || z[n] || z.info;
571
+ return /* @__PURE__ */ v(
572
+ "div",
573
+ {
574
+ role: n === "error" ? "alert" : "status",
575
+ "aria-live": n === "error" ? void 0 : "polite",
576
+ className: X(
577
+ "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
578
+ o && "pb-3",
579
+ b.className,
580
+ c ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
581
+ ),
582
+ children: [
583
+ /* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-3", children: b.icon }),
584
+ /* @__PURE__ */ v("div", { className: "flex-grow min-w-0", children: [
585
+ /* @__PURE__ */ t("div", { className: "font-medium text-sm leading-5", children: r }),
586
+ u && /* @__PURE__ */ t("div", { className: "mt-1 text-sm opacity-90 leading-5", children: u }),
587
+ o && /* @__PURE__ */ t("div", { className: "mt-1.5", children: /* @__PURE__ */ t(
588
+ "button",
589
+ {
590
+ onClick: o.onClick,
591
+ className: "text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",
592
+ children: o.label
593
+ }
594
+ ) })
595
+ ] }),
596
+ /* @__PURE__ */ t(
597
+ "button",
598
+ {
599
+ onClick: f,
600
+ className: "flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",
601
+ children: /* @__PURE__ */ t(P, { size: 16 })
602
+ }
603
+ )
604
+ ]
605
+ }
606
+ );
607
+ }
608
+ export {
609
+ dl as A,
610
+ nl as D,
611
+ ml as T,
612
+ tl as a,
613
+ cl as b,
614
+ y as n,
615
+ sl as u
616
+ };
617
+ //# sourceMappingURL=Toast-CZP-yFBM.js.map