@spark-ui/components 10.0.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 (296) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +19 -0
  4. package/dist/DialogTrigger-5SI4dvpK.d.mts +142 -0
  5. package/dist/DialogTrigger-5SI4dvpK.d.ts +142 -0
  6. package/dist/Input-g0LpWuv0.d.mts +17 -0
  7. package/dist/Input-g0LpWuv0.d.ts +17 -0
  8. package/dist/InputGroup-aoaZxCLk.d.mts +28 -0
  9. package/dist/InputGroup-aoaZxCLk.d.ts +28 -0
  10. package/dist/InputTrailingIcon-BBp7sE6D.d.mts +20 -0
  11. package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
  12. package/dist/LabelRequiredIndicator-DRnCzHMU.d.mts +19 -0
  13. package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
  14. package/dist/accordion/index.d.mts +85 -0
  15. package/dist/accordion/index.d.ts +85 -0
  16. package/dist/accordion/index.js +461 -0
  17. package/dist/accordion/index.js.map +1 -0
  18. package/dist/accordion/index.mjs +249 -0
  19. package/dist/accordion/index.mjs.map +1 -0
  20. package/dist/alert-dialog/index.d.mts +119 -0
  21. package/dist/alert-dialog/index.d.ts +119 -0
  22. package/dist/alert-dialog/index.js +1451 -0
  23. package/dist/alert-dialog/index.js.map +1 -0
  24. package/dist/alert-dialog/index.mjs +177 -0
  25. package/dist/alert-dialog/index.mjs.map +1 -0
  26. package/dist/badge/index.d.mts +47 -0
  27. package/dist/badge/index.d.ts +47 -0
  28. package/dist/badge/index.js +122 -0
  29. package/dist/badge/index.js.map +1 -0
  30. package/dist/badge/index.mjs +95 -0
  31. package/dist/badge/index.mjs.map +1 -0
  32. package/dist/breadcrumb/index.d.mts +64 -0
  33. package/dist/breadcrumb/index.d.ts +64 -0
  34. package/dist/breadcrumb/index.js +326 -0
  35. package/dist/breadcrumb/index.js.map +1 -0
  36. package/dist/breadcrumb/index.mjs +149 -0
  37. package/dist/breadcrumb/index.mjs.map +1 -0
  38. package/dist/button/index.d.mts +40 -0
  39. package/dist/button/index.d.ts +40 -0
  40. package/dist/button/index.js +877 -0
  41. package/dist/button/index.js.map +1 -0
  42. package/dist/button/index.mjs +10 -0
  43. package/dist/button/index.mjs.map +1 -0
  44. package/dist/carousel/index.d.mts +253 -0
  45. package/dist/carousel/index.d.ts +253 -0
  46. package/dist/carousel/index.js +1678 -0
  47. package/dist/carousel/index.js.map +1 -0
  48. package/dist/carousel/index.mjs +716 -0
  49. package/dist/carousel/index.mjs.map +1 -0
  50. package/dist/checkbox/index.d.mts +120 -0
  51. package/dist/checkbox/index.d.ts +120 -0
  52. package/dist/checkbox/index.js +873 -0
  53. package/dist/checkbox/index.js.map +1 -0
  54. package/dist/checkbox/index.mjs +349 -0
  55. package/dist/checkbox/index.mjs.map +1 -0
  56. package/dist/chip/index.d.mts +97 -0
  57. package/dist/chip/index.d.ts +97 -0
  58. package/dist/chip/index.js +905 -0
  59. package/dist/chip/index.js.map +1 -0
  60. package/dist/chip/index.mjs +793 -0
  61. package/dist/chip/index.mjs.map +1 -0
  62. package/dist/chunk-2KPFQEAA.mjs +52 -0
  63. package/dist/chunk-2KPFQEAA.mjs.map +1 -0
  64. package/dist/chunk-4F5DOL57.mjs +26 -0
  65. package/dist/chunk-4F5DOL57.mjs.map +1 -0
  66. package/dist/chunk-6JOA37TZ.mjs +742 -0
  67. package/dist/chunk-6JOA37TZ.mjs.map +1 -0
  68. package/dist/chunk-7PMPYEHJ.mjs +379 -0
  69. package/dist/chunk-7PMPYEHJ.mjs.map +1 -0
  70. package/dist/chunk-AESXFMCC.mjs +68 -0
  71. package/dist/chunk-AESXFMCC.mjs.map +1 -0
  72. package/dist/chunk-B42LOFIZ.mjs +308 -0
  73. package/dist/chunk-B42LOFIZ.mjs.map +1 -0
  74. package/dist/chunk-FGOZHKBT.mjs +97 -0
  75. package/dist/chunk-FGOZHKBT.mjs.map +1 -0
  76. package/dist/chunk-HLXYG643.mjs +52 -0
  77. package/dist/chunk-HLXYG643.mjs.map +1 -0
  78. package/dist/chunk-JKNBJHD5.mjs +601 -0
  79. package/dist/chunk-JKNBJHD5.mjs.map +1 -0
  80. package/dist/chunk-K7VP7DH3.mjs +66 -0
  81. package/dist/chunk-K7VP7DH3.mjs.map +1 -0
  82. package/dist/chunk-MUNDKRAE.mjs +80 -0
  83. package/dist/chunk-MUNDKRAE.mjs.map +1 -0
  84. package/dist/chunk-NBZKMCHF.mjs +36 -0
  85. package/dist/chunk-NBZKMCHF.mjs.map +1 -0
  86. package/dist/chunk-PZWESKAR.mjs +314 -0
  87. package/dist/chunk-PZWESKAR.mjs.map +1 -0
  88. package/dist/collapsible/index.d.mts +60 -0
  89. package/dist/collapsible/index.d.ts +60 -0
  90. package/dist/collapsible/index.js +140 -0
  91. package/dist/collapsible/index.js.map +1 -0
  92. package/dist/collapsible/index.mjs +8 -0
  93. package/dist/collapsible/index.mjs.map +1 -0
  94. package/dist/combobox/index.d.mts +285 -0
  95. package/dist/combobox/index.d.ts +285 -0
  96. package/dist/combobox/index.js +2920 -0
  97. package/dist/combobox/index.js.map +1 -0
  98. package/dist/combobox/index.mjs +1267 -0
  99. package/dist/combobox/index.mjs.map +1 -0
  100. package/dist/dialog/index.d.mts +33 -0
  101. package/dist/dialog/index.d.ts +33 -0
  102. package/dist/dialog/index.js +1286 -0
  103. package/dist/dialog/index.js.map +1 -0
  104. package/dist/dialog/index.mjs +13 -0
  105. package/dist/dialog/index.mjs.map +1 -0
  106. package/dist/divider/index.d.mts +61 -0
  107. package/dist/divider/index.d.ts +61 -0
  108. package/dist/divider/index.js +223 -0
  109. package/dist/divider/index.js.map +1 -0
  110. package/dist/divider/index.mjs +196 -0
  111. package/dist/divider/index.mjs.map +1 -0
  112. package/dist/drawer/index.d.mts +148 -0
  113. package/dist/drawer/index.d.ts +148 -0
  114. package/dist/drawer/index.js +1266 -0
  115. package/dist/drawer/index.js.map +1 -0
  116. package/dist/drawer/index.mjs +299 -0
  117. package/dist/drawer/index.mjs.map +1 -0
  118. package/dist/dropdown/index.d.mts +233 -0
  119. package/dist/dropdown/index.d.ts +233 -0
  120. package/dist/dropdown/index.js +2402 -0
  121. package/dist/dropdown/index.js.map +1 -0
  122. package/dist/dropdown/index.mjs +741 -0
  123. package/dist/dropdown/index.mjs.map +1 -0
  124. package/dist/form-field/index.d.mts +176 -0
  125. package/dist/form-field/index.d.ts +176 -0
  126. package/dist/form-field/index.js +540 -0
  127. package/dist/form-field/index.js.map +1 -0
  128. package/dist/form-field/index.mjs +13 -0
  129. package/dist/form-field/index.mjs.map +1 -0
  130. package/dist/icon/index.d.mts +28 -0
  131. package/dist/icon/index.d.ts +28 -0
  132. package/dist/icon/index.js +127 -0
  133. package/dist/icon/index.js.map +1 -0
  134. package/dist/icon/index.mjs +9 -0
  135. package/dist/icon/index.mjs.map +1 -0
  136. package/dist/icon-button/index.d.mts +16 -0
  137. package/dist/icon-button/index.d.ts +16 -0
  138. package/dist/icon-button/index.js +921 -0
  139. package/dist/icon-button/index.js.map +1 -0
  140. package/dist/icon-button/index.mjs +11 -0
  141. package/dist/icon-button/index.mjs.map +1 -0
  142. package/dist/input/index.d.mts +78 -0
  143. package/dist/input/index.d.ts +78 -0
  144. package/dist/input/index.js +1119 -0
  145. package/dist/input/index.js.map +1 -0
  146. package/dist/input/index.mjs +16 -0
  147. package/dist/input/index.mjs.map +1 -0
  148. package/dist/kbd/index.d.mts +9 -0
  149. package/dist/kbd/index.d.ts +9 -0
  150. package/dist/kbd/index.js +46 -0
  151. package/dist/kbd/index.js.map +1 -0
  152. package/dist/kbd/index.mjs +19 -0
  153. package/dist/kbd/index.mjs.map +1 -0
  154. package/dist/label/index.d.mts +11 -0
  155. package/dist/label/index.d.ts +11 -0
  156. package/dist/label/index.js +78 -0
  157. package/dist/label/index.js.map +1 -0
  158. package/dist/label/index.mjs +7 -0
  159. package/dist/label/index.mjs.map +1 -0
  160. package/dist/link-box/index.d.mts +34 -0
  161. package/dist/link-box/index.d.ts +34 -0
  162. package/dist/link-box/index.js +92 -0
  163. package/dist/link-box/index.js.map +1 -0
  164. package/dist/link-box/index.mjs +58 -0
  165. package/dist/link-box/index.mjs.map +1 -0
  166. package/dist/pagination/index.d.mts +143 -0
  167. package/dist/pagination/index.d.ts +143 -0
  168. package/dist/pagination/index.js +1303 -0
  169. package/dist/pagination/index.js.map +1 -0
  170. package/dist/pagination/index.mjs +326 -0
  171. package/dist/pagination/index.mjs.map +1 -0
  172. package/dist/popover/index.d.mts +93 -0
  173. package/dist/popover/index.d.ts +93 -0
  174. package/dist/popover/index.js +1280 -0
  175. package/dist/popover/index.js.map +1 -0
  176. package/dist/popover/index.mjs +13 -0
  177. package/dist/popover/index.mjs.map +1 -0
  178. package/dist/portal/index.d.mts +13 -0
  179. package/dist/portal/index.d.ts +13 -0
  180. package/dist/portal/index.js +37 -0
  181. package/dist/portal/index.js.map +1 -0
  182. package/dist/portal/index.mjs +10 -0
  183. package/dist/portal/index.mjs.map +1 -0
  184. package/dist/progress/index.d.mts +48 -0
  185. package/dist/progress/index.d.ts +48 -0
  186. package/dist/progress/index.js +201 -0
  187. package/dist/progress/index.js.map +1 -0
  188. package/dist/progress/index.mjs +174 -0
  189. package/dist/progress/index.mjs.map +1 -0
  190. package/dist/progress-tracker/index.d.mts +81 -0
  191. package/dist/progress-tracker/index.d.ts +81 -0
  192. package/dist/progress-tracker/index.js +834 -0
  193. package/dist/progress-tracker/index.js.map +1 -0
  194. package/dist/progress-tracker/index.mjs +716 -0
  195. package/dist/progress-tracker/index.mjs.map +1 -0
  196. package/dist/radio-group/index.d.mts +100 -0
  197. package/dist/radio-group/index.d.ts +100 -0
  198. package/dist/radio-group/index.js +824 -0
  199. package/dist/radio-group/index.js.map +1 -0
  200. package/dist/radio-group/index.mjs +297 -0
  201. package/dist/radio-group/index.mjs.map +1 -0
  202. package/dist/rating/index.d.mts +78 -0
  203. package/dist/rating/index.d.ts +78 -0
  204. package/dist/rating/index.js +362 -0
  205. package/dist/rating/index.js.map +1 -0
  206. package/dist/rating/index.mjs +247 -0
  207. package/dist/rating/index.mjs.map +1 -0
  208. package/dist/scrolling-list/index.d.mts +105 -0
  209. package/dist/scrolling-list/index.d.ts +105 -0
  210. package/dist/scrolling-list/index.js +1367 -0
  211. package/dist/scrolling-list/index.js.map +1 -0
  212. package/dist/scrolling-list/index.mjs +407 -0
  213. package/dist/scrolling-list/index.mjs.map +1 -0
  214. package/dist/select/index.d.mts +167 -0
  215. package/dist/select/index.d.ts +167 -0
  216. package/dist/select/index.js +991 -0
  217. package/dist/select/index.js.map +1 -0
  218. package/dist/select/index.mjs +470 -0
  219. package/dist/select/index.mjs.map +1 -0
  220. package/dist/skeleton/index.d.mts +67 -0
  221. package/dist/skeleton/index.d.ts +67 -0
  222. package/dist/skeleton/index.js +206 -0
  223. package/dist/skeleton/index.js.map +1 -0
  224. package/dist/skeleton/index.mjs +147 -0
  225. package/dist/skeleton/index.mjs.map +1 -0
  226. package/dist/slider/index.d.mts +97 -0
  227. package/dist/slider/index.d.ts +97 -0
  228. package/dist/slider/index.js +209 -0
  229. package/dist/slider/index.js.map +1 -0
  230. package/dist/slider/index.mjs +182 -0
  231. package/dist/slider/index.mjs.map +1 -0
  232. package/dist/slot/index.d.mts +17 -0
  233. package/dist/slot/index.d.ts +17 -0
  234. package/dist/slot/index.js +51 -0
  235. package/dist/slot/index.js.map +1 -0
  236. package/dist/slot/index.mjs +11 -0
  237. package/dist/slot/index.mjs.map +1 -0
  238. package/dist/snackbar/index.d.mts +158 -0
  239. package/dist/snackbar/index.d.ts +158 -0
  240. package/dist/snackbar/index.js +1693 -0
  241. package/dist/snackbar/index.js.map +1 -0
  242. package/dist/snackbar/index.mjs +733 -0
  243. package/dist/snackbar/index.mjs.map +1 -0
  244. package/dist/spinner/index.d.mts +21 -0
  245. package/dist/spinner/index.d.ts +21 -0
  246. package/dist/spinner/index.js +139 -0
  247. package/dist/spinner/index.js.map +1 -0
  248. package/dist/spinner/index.mjs +9 -0
  249. package/dist/spinner/index.mjs.map +1 -0
  250. package/dist/stepper/index.d.mts +82 -0
  251. package/dist/stepper/index.d.ts +82 -0
  252. package/dist/stepper/index.js +2178 -0
  253. package/dist/stepper/index.js.map +1 -0
  254. package/dist/stepper/index.mjs +229 -0
  255. package/dist/stepper/index.mjs.map +1 -0
  256. package/dist/switch/index.d.mts +64 -0
  257. package/dist/switch/index.d.ts +64 -0
  258. package/dist/switch/index.js +768 -0
  259. package/dist/switch/index.js.map +1 -0
  260. package/dist/switch/index.mjs +245 -0
  261. package/dist/switch/index.mjs.map +1 -0
  262. package/dist/tabs/index.d.mts +103 -0
  263. package/dist/tabs/index.d.ts +103 -0
  264. package/dist/tabs/index.js +1315 -0
  265. package/dist/tabs/index.js.map +1 -0
  266. package/dist/tabs/index.mjs +391 -0
  267. package/dist/tabs/index.mjs.map +1 -0
  268. package/dist/tag/index.d.mts +27 -0
  269. package/dist/tag/index.d.ts +27 -0
  270. package/dist/tag/index.js +269 -0
  271. package/dist/tag/index.js.map +1 -0
  272. package/dist/tag/index.mjs +237 -0
  273. package/dist/tag/index.mjs.map +1 -0
  274. package/dist/text-link/index.d.mts +20 -0
  275. package/dist/text-link/index.d.ts +20 -0
  276. package/dist/text-link/index.js +99 -0
  277. package/dist/text-link/index.js.map +1 -0
  278. package/dist/text-link/index.mjs +8 -0
  279. package/dist/text-link/index.mjs.map +1 -0
  280. package/dist/textarea/index.d.mts +47 -0
  281. package/dist/textarea/index.d.ts +47 -0
  282. package/dist/textarea/index.js +1180 -0
  283. package/dist/textarea/index.js.map +1 -0
  284. package/dist/textarea/index.mjs +77 -0
  285. package/dist/textarea/index.mjs.map +1 -0
  286. package/dist/visually-hidden/index.d.mts +16 -0
  287. package/dist/visually-hidden/index.d.ts +16 -0
  288. package/dist/visually-hidden/index.js +67 -0
  289. package/dist/visually-hidden/index.js.map +1 -0
  290. package/dist/visually-hidden/index.mjs +8 -0
  291. package/dist/visually-hidden/index.mjs.map +1 -0
  292. package/global.d.ts +12 -0
  293. package/package.json +75 -0
  294. package/tsconfig.build.json +9 -0
  295. package/tsconfig.json +9 -0
  296. package/tsup.config.ts +11 -0
@@ -0,0 +1,1693 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/snackbar/index.ts
21
+ var snackbar_exports = {};
22
+ __export(snackbar_exports, {
23
+ Snackbar: () => Snackbar2,
24
+ addSnackbar: () => addSnackbar,
25
+ clearSnackbarQueue: () => clearSnackbarQueue
26
+ });
27
+ module.exports = __toCommonJS(snackbar_exports);
28
+
29
+ // src/snackbar/Snackbar.tsx
30
+ var import_toast3 = require("@react-stately/toast");
31
+ var import_react9 = require("react");
32
+ var import_react_dom = require("react-dom");
33
+
34
+ // src/snackbar/SnackbarRegion.tsx
35
+ var import_toast2 = require("@react-aria/toast");
36
+ var import_react7 = require("react");
37
+
38
+ // src/snackbar/SnackbarItem.tsx
39
+ var import_toast = require("@react-aria/toast");
40
+ var import_react6 = require("react");
41
+
42
+ // src/snackbar/SnackbarItem.styles.ts
43
+ var import_class_variance_authority = require("class-variance-authority");
44
+
45
+ // src/snackbar/snackbarVariants.ts
46
+ var filledVariants = [
47
+ {
48
+ design: "filled",
49
+ intent: "success",
50
+ class: ["bg-success text-on-success"]
51
+ },
52
+ {
53
+ design: "filled",
54
+ intent: "alert",
55
+ class: ["bg-alert text-on-alert"]
56
+ },
57
+ {
58
+ design: "filled",
59
+ intent: "error",
60
+ class: ["bg-error text-on-error"]
61
+ },
62
+ {
63
+ design: "filled",
64
+ intent: "info",
65
+ class: ["bg-info text-on-info"]
66
+ },
67
+ {
68
+ design: "filled",
69
+ intent: "neutral",
70
+ class: ["bg-neutral text-on-neutral"]
71
+ },
72
+ {
73
+ design: "filled",
74
+ intent: "main",
75
+ class: ["bg-main text-on-main"]
76
+ },
77
+ {
78
+ design: "filled",
79
+ intent: "basic",
80
+ class: ["bg-basic text-on-basic"]
81
+ },
82
+ {
83
+ design: "filled",
84
+ intent: "support",
85
+ class: ["bg-support text-on-support"]
86
+ },
87
+ {
88
+ design: "filled",
89
+ intent: "accent",
90
+ class: ["bg-accent text-on-accent"]
91
+ },
92
+ {
93
+ design: "filled",
94
+ intent: "inverse",
95
+ class: ["bg-surface-inverse text-on-surface-inverse"]
96
+ }
97
+ ];
98
+ var tintedVariants = [
99
+ {
100
+ design: "tinted",
101
+ intent: "success",
102
+ class: ["bg-success-container text-on-success-container"]
103
+ },
104
+ {
105
+ design: "tinted",
106
+ intent: "alert",
107
+ class: ["bg-alert-container text-on-alert-container"]
108
+ },
109
+ {
110
+ design: "tinted",
111
+ intent: "error",
112
+ class: ["bg-error-container text-on-error-container"]
113
+ },
114
+ {
115
+ design: "tinted",
116
+ intent: "info",
117
+ class: ["bg-info-container text-on-info-container"]
118
+ },
119
+ {
120
+ design: "tinted",
121
+ intent: "neutral",
122
+ class: ["bg-neutral-container text-on-neutral-container"]
123
+ },
124
+ {
125
+ design: "tinted",
126
+ intent: "main",
127
+ class: ["bg-main-container text-on-main-container"]
128
+ },
129
+ {
130
+ design: "tinted",
131
+ intent: "basic",
132
+ class: ["bg-basic-container text-on-basic-container"]
133
+ },
134
+ {
135
+ design: "tinted",
136
+ intent: "support",
137
+ class: ["bg-support-container text-on-support-container"]
138
+ },
139
+ {
140
+ design: "tinted",
141
+ intent: "accent",
142
+ class: ["bg-accent-container text-on-accent-container"]
143
+ },
144
+ {
145
+ design: "tinted",
146
+ intent: "inverse",
147
+ class: ["bg-surface-inverse text-on-surface-inverse"]
148
+ }
149
+ ];
150
+
151
+ // src/snackbar/SnackbarItem.styles.ts
152
+ var snackbarItemVariant = (0, import_class_variance_authority.cva)(
153
+ [
154
+ "rounded-md shadow-sm",
155
+ "max-w-[600px]",
156
+ "cursor-default pointer-events-auto touch-none select-none",
157
+ "absolute",
158
+ /**
159
+ * Focus
160
+ */
161
+ "group-focus-visible:outline-hidden group-focus-visible:u-outline group-not-focus-visible:ring-inset",
162
+ /**
163
+ * Positionning
164
+ */
165
+ "group-data-[position=bottom]:bottom-0 group-data-[position=bottom-left]:bottom-0 group-data-[position=bottom-right]:bottom-0",
166
+ "group-data-[position=top]:top-0 group-data-[position=top-left]:top-0 group-data-[position=top-right]:top-0",
167
+ /**
168
+ * Animation and opacity
169
+ */
170
+ "[animation-fill-mode: forwards]!",
171
+ "data-[animation=queued]:animate-fade-in",
172
+ "data-[animation=entering]:easing-decelerate-back",
173
+ "data-[animation=exiting]:easing-standard",
174
+ // Parent position bottom|bottom-left|bottom-right
175
+ "data-[animation=entering]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-in-bottom",
176
+ "data-[animation=exiting]:opacity-0 data-[animation=exiting]:transition-opacity",
177
+ "data-[animation=exiting]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-out-bottom",
178
+ "data-[animation=entering]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-in-bottom",
179
+ "data-[animation=exiting]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-out-bottom",
180
+ "data-[animation=entering]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-in-bottom",
181
+ "data-[animation=exiting]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-out-bottom",
182
+ // Parent position top|top-left|top-right
183
+ "data-[animation=entering]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-in-top",
184
+ "data-[animation=exiting]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-out-top",
185
+ "data-[animation=entering]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-in-top",
186
+ "data-[animation=exiting]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-out-top",
187
+ "data-[animation=entering]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-in-top",
188
+ "data-[animation=exiting]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-out-top",
189
+ /**
190
+ * Swipe
191
+ */
192
+ "data-[swipe=move]:data-[swipe-direction=right]:translate-x-(--swipe-position-x)",
193
+ "data-[swipe=move]:data-[swipe-direction=left]:translate-x-(--swipe-position-x)",
194
+ "data-[swipe=cancel]:translate-x-0",
195
+ "data-[swipe=end]:data-[swipe-direction=right]:animate-standalone-swipe-out-right",
196
+ "data-[swipe=end]:data-[swipe-direction=left]:animate-standalone-swipe-out-left"
197
+ ],
198
+ {
199
+ variants: {
200
+ /**
201
+ * Set different look and feel
202
+ * @default 'filled'
203
+ */
204
+ design: {
205
+ filled: "",
206
+ tinted: ""
207
+ },
208
+ /**
209
+ * Set color intent
210
+ * @default 'neutral'
211
+ */
212
+ intent: {
213
+ success: "",
214
+ alert: "",
215
+ error: "",
216
+ info: "",
217
+ neutral: "",
218
+ main: "",
219
+ basic: "",
220
+ support: "",
221
+ accent: "",
222
+ inverse: ""
223
+ }
224
+ },
225
+ compoundVariants: [...filledVariants, ...tintedVariants],
226
+ defaultVariants: {
227
+ design: "filled",
228
+ intent: "neutral"
229
+ }
230
+ }
231
+ );
232
+ var snackbarItemVariantContent = (0, import_class_variance_authority.cva)(
233
+ [
234
+ "inline-grid items-center",
235
+ "col-start-1 row-start-1",
236
+ "px-md"
237
+ // applying padding on the parent prevents VoiceOver on Safari from reading snackbar content 🤷
238
+ ],
239
+ {
240
+ variants: {
241
+ /**
242
+ * Force action button displaying on a new line
243
+ * @default false
244
+ */
245
+ actionOnNewline: {
246
+ true: [
247
+ "grid-rows-[52px_1fr_52px]",
248
+ "grid-cols-[min-content_1fr_min-content]",
249
+ "[grid-template-areas:'icon_message_close'_'._message_.'_'action_action_action']"
250
+ ],
251
+ false: [
252
+ "grid-cols-[min-content_1fr_min-content_min-content]",
253
+ "[grid-template-areas:'icon_message_action_close']"
254
+ ]
255
+ }
256
+ },
257
+ defaultVariants: {
258
+ actionOnNewline: false
259
+ }
260
+ }
261
+ );
262
+
263
+ // src/snackbar/SnackbarItemAction.tsx
264
+ var import_class_variance_authority5 = require("class-variance-authority");
265
+
266
+ // src/button/Button.tsx
267
+ var import_class_variance_authority4 = require("class-variance-authority");
268
+ var import_react2 = require("react");
269
+
270
+ // src/slot/Slot.tsx
271
+ var import_radix_ui = require("radix-ui");
272
+ var import_react = require("react");
273
+ var import_jsx_runtime = require("react/jsx-runtime");
274
+ var Slottable = import_radix_ui.Slot.Slottable;
275
+ var Slot = ({ ref, ...props }) => {
276
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
277
+ };
278
+ var wrapPolymorphicSlot = (asChild, children, callback) => {
279
+ if (!asChild) return callback(children);
280
+ return (0, import_react.isValidElement)(children) ? (0, import_react.cloneElement)(
281
+ children,
282
+ void 0,
283
+ callback(children.props.children)
284
+ ) : null;
285
+ };
286
+
287
+ // src/visually-hidden/VisuallyHidden.tsx
288
+ var import_jsx_runtime2 = require("react/jsx-runtime");
289
+ var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
290
+ const Component = asChild ? Slot : "span";
291
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
292
+ Component,
293
+ {
294
+ ...props,
295
+ ref,
296
+ style: {
297
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
298
+ position: "absolute",
299
+ border: 0,
300
+ width: 1,
301
+ height: 1,
302
+ padding: 0,
303
+ margin: -1,
304
+ overflow: "hidden",
305
+ clip: "rect(0, 0, 0, 0)",
306
+ whiteSpace: "nowrap",
307
+ wordWrap: "normal",
308
+ ...props.style
309
+ }
310
+ }
311
+ );
312
+ };
313
+ VisuallyHidden.displayName = "VisuallyHidden";
314
+
315
+ // src/spinner/Spinner.styles.tsx
316
+ var import_internal_utils = require("@spark-ui/internal-utils");
317
+ var import_class_variance_authority2 = require("class-variance-authority");
318
+ var defaultVariants = {
319
+ intent: "current",
320
+ size: "current",
321
+ isBackgroundVisible: false
322
+ };
323
+ var spinnerStyles = (0, import_class_variance_authority2.cva)(
324
+ ["inline-block", "border-solid", "rounded-full", "border-md", "animate-spin"],
325
+ {
326
+ variants: {
327
+ /**
328
+ * Use `size` prop to set the size of the spinner. If you want to set the full size for the spinner, don't forget to add a wrapping container with its own size.
329
+ */
330
+ size: {
331
+ current: ["u-current-font-size"],
332
+ sm: ["w-sz-20", "h-sz-20"],
333
+ md: ["w-sz-28", "h-sz-28"],
334
+ full: ["w-full", "h-full"]
335
+ },
336
+ /**
337
+ * Color scheme of the spinner.
338
+ */
339
+ intent: (0, import_internal_utils.makeVariants)({
340
+ current: ["border-current"],
341
+ main: ["border-main"],
342
+ support: ["border-support"],
343
+ accent: ["border-accent"],
344
+ basic: ["border-basic"],
345
+ success: ["border-success"],
346
+ alert: ["border-alert"],
347
+ error: ["border-error"],
348
+ info: ["border-info"],
349
+ neutral: ["border-neutral"]
350
+ }),
351
+ /**
352
+ * Size of the button.
353
+ */
354
+ isBackgroundVisible: {
355
+ true: ["border-b-neutral-container", "border-l-neutral-container"],
356
+ false: ["border-b-transparent", "border-l-transparent"]
357
+ }
358
+ },
359
+ defaultVariants
360
+ }
361
+ );
362
+
363
+ // src/spinner/Spinner.tsx
364
+ var import_jsx_runtime3 = require("react/jsx-runtime");
365
+ var Spinner = ({
366
+ className,
367
+ size = "current",
368
+ intent = "current",
369
+ label,
370
+ isBackgroundVisible,
371
+ ref,
372
+ ...others
373
+ }) => {
374
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
375
+ "span",
376
+ {
377
+ role: "status",
378
+ "data-spark-component": "spinner",
379
+ ref,
380
+ className: spinnerStyles({ className, size, intent, isBackgroundVisible }),
381
+ ...others,
382
+ children: label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VisuallyHidden, { children: label })
383
+ }
384
+ );
385
+ };
386
+
387
+ // src/button/Button.styles.tsx
388
+ var import_internal_utils7 = require("@spark-ui/internal-utils");
389
+ var import_class_variance_authority3 = require("class-variance-authority");
390
+
391
+ // src/button/variants/filled.ts
392
+ var import_internal_utils2 = require("@spark-ui/internal-utils");
393
+ var filledVariants2 = [
394
+ // Main
395
+ {
396
+ intent: "main",
397
+ design: "filled",
398
+ class: (0, import_internal_utils2.tw)([
399
+ "bg-main",
400
+ "text-on-main",
401
+ "hover:bg-main-hovered",
402
+ "enabled:active:bg-main-hovered",
403
+ "focus-visible:bg-main-hovered"
404
+ ])
405
+ },
406
+ // Support
407
+ {
408
+ intent: "support",
409
+ design: "filled",
410
+ class: (0, import_internal_utils2.tw)([
411
+ "bg-support",
412
+ "text-on-support",
413
+ "hover:bg-support-hovered",
414
+ "enabled:active:bg-support-hovered",
415
+ "focus-visible:bg-support-hovered"
416
+ ])
417
+ },
418
+ // Accent
419
+ {
420
+ intent: "accent",
421
+ design: "filled",
422
+ class: (0, import_internal_utils2.tw)([
423
+ "bg-accent",
424
+ "text-on-accent",
425
+ "hover:bg-accent-hovered",
426
+ "enabled:active:bg-accent-hovered",
427
+ "focus-visible:bg-accent-hovered"
428
+ ])
429
+ },
430
+ // Basic
431
+ {
432
+ intent: "basic",
433
+ design: "filled",
434
+ class: (0, import_internal_utils2.tw)([
435
+ "bg-basic",
436
+ "text-on-basic",
437
+ "hover:bg-basic-hovered",
438
+ "enabled:active:bg-basic-hovered",
439
+ "focus-visible:bg-basic-hovered"
440
+ ])
441
+ },
442
+ // Success
443
+ {
444
+ intent: "success",
445
+ design: "filled",
446
+ class: (0, import_internal_utils2.tw)([
447
+ "bg-success",
448
+ "text-on-success",
449
+ "hover:bg-success-hovered",
450
+ "enabled:active:bg-success-hovered",
451
+ "focus-visible:bg-success-hovered"
452
+ ])
453
+ },
454
+ // Alert
455
+ {
456
+ intent: "alert",
457
+ design: "filled",
458
+ class: (0, import_internal_utils2.tw)([
459
+ "bg-alert",
460
+ "text-on-alert",
461
+ "hover:bg-alert-hovered",
462
+ "enabled:active:bg-alert-hovered",
463
+ "focus-visible:bg-alert-hovered"
464
+ ])
465
+ },
466
+ // Danger
467
+ {
468
+ intent: "danger",
469
+ design: "filled",
470
+ class: (0, import_internal_utils2.tw)([
471
+ "text-on-error bg-error",
472
+ "hover:bg-error-hovered enabled:active:bg-error-hovered",
473
+ "focus-visible:bg-error-hovered"
474
+ ])
475
+ },
476
+ // Info
477
+ {
478
+ intent: "info",
479
+ design: "filled",
480
+ class: (0, import_internal_utils2.tw)([
481
+ "text-on-error bg-info",
482
+ "hover:bg-info-hovered enabled:active:bg-info-hovered",
483
+ "focus-visible:bg-info-hovered"
484
+ ])
485
+ },
486
+ // Neutral
487
+ {
488
+ intent: "neutral",
489
+ design: "filled",
490
+ class: (0, import_internal_utils2.tw)([
491
+ "bg-neutral",
492
+ "text-on-neutral",
493
+ "hover:bg-neutral-hovered",
494
+ "enabled:active:bg-neutral-hovered",
495
+ "focus-visible:bg-neutral-hovered"
496
+ ])
497
+ },
498
+ // Surface
499
+ {
500
+ intent: "surface",
501
+ design: "filled",
502
+ class: (0, import_internal_utils2.tw)([
503
+ "bg-surface",
504
+ "text-on-surface",
505
+ "hover:bg-surface-hovered",
506
+ "enabled:active:bg-surface-hovered",
507
+ "focus-visible:bg-surface-hovered"
508
+ ])
509
+ }
510
+ ];
511
+
512
+ // src/button/variants/ghost.ts
513
+ var import_internal_utils3 = require("@spark-ui/internal-utils");
514
+ var ghostVariants = [
515
+ {
516
+ intent: "main",
517
+ design: "ghost",
518
+ class: (0, import_internal_utils3.tw)([
519
+ "text-main",
520
+ "hover:bg-main/dim-5",
521
+ "enabled:active:bg-main/dim-5",
522
+ "focus-visible:bg-main/dim-5"
523
+ ])
524
+ },
525
+ {
526
+ intent: "support",
527
+ design: "ghost",
528
+ class: (0, import_internal_utils3.tw)([
529
+ "text-support",
530
+ "hover:bg-support/dim-5",
531
+ "enabled:active:bg-support/dim-5",
532
+ "focus-visible:bg-support/dim-5"
533
+ ])
534
+ },
535
+ {
536
+ intent: "accent",
537
+ design: "ghost",
538
+ class: (0, import_internal_utils3.tw)([
539
+ "text-accent",
540
+ "hover:bg-accent/dim-5",
541
+ "enabled:active:bg-accent/dim-5",
542
+ "focus-visible:bg-accent/dim-5"
543
+ ])
544
+ },
545
+ {
546
+ intent: "basic",
547
+ design: "ghost",
548
+ class: (0, import_internal_utils3.tw)([
549
+ "text-basic",
550
+ "hover:bg-basic/dim-5",
551
+ "enabled:active:bg-basic/dim-5",
552
+ "focus-visible:bg-basic/dim-5"
553
+ ])
554
+ },
555
+ {
556
+ intent: "success",
557
+ design: "ghost",
558
+ class: (0, import_internal_utils3.tw)([
559
+ "text-success",
560
+ "hover:bg-success/dim-5",
561
+ "enabled:active:bg-success/dim-5",
562
+ "focus-visible:bg-success/dim-5"
563
+ ])
564
+ },
565
+ {
566
+ intent: "alert",
567
+ design: "ghost",
568
+ class: (0, import_internal_utils3.tw)([
569
+ "text-alert",
570
+ "hover:bg-alert/dim-5",
571
+ "enabled:active:bg-alert/dim-5",
572
+ "focus-visible:bg-alert/dim-5"
573
+ ])
574
+ },
575
+ {
576
+ intent: "danger",
577
+ design: "ghost",
578
+ class: (0, import_internal_utils3.tw)([
579
+ "text-error",
580
+ "hover:bg-error/dim-5",
581
+ "enabled:active:bg-error/dim-5",
582
+ "focus-visible:bg-error/dim-5"
583
+ ])
584
+ },
585
+ {
586
+ intent: "info",
587
+ design: "ghost",
588
+ class: (0, import_internal_utils3.tw)([
589
+ "text-info",
590
+ "hover:bg-info/dim-5",
591
+ "enabled:active:bg-info/dim-5",
592
+ "focus-visible:bg-info/dim-5"
593
+ ])
594
+ },
595
+ {
596
+ intent: "neutral",
597
+ design: "ghost",
598
+ class: (0, import_internal_utils3.tw)([
599
+ "text-neutral",
600
+ "hover:bg-neutral/dim-5",
601
+ "enabled:active:bg-neutral/dim-5",
602
+ "focus-visible:bg-neutral/dim-5"
603
+ ])
604
+ },
605
+ {
606
+ intent: "surface",
607
+ design: "ghost",
608
+ class: (0, import_internal_utils3.tw)([
609
+ "text-surface",
610
+ "hover:bg-surface/dim-5",
611
+ "enabled:active:bg-surface/dim-5",
612
+ "focus-visible:bg-surface/dim-5"
613
+ ])
614
+ }
615
+ ];
616
+
617
+ // src/button/variants/outlined.ts
618
+ var import_internal_utils4 = require("@spark-ui/internal-utils");
619
+ var outlinedVariants = [
620
+ {
621
+ intent: "main",
622
+ design: "outlined",
623
+ class: (0, import_internal_utils4.tw)([
624
+ "hover:bg-main/dim-5",
625
+ "enabled:active:bg-main/dim-5",
626
+ "focus-visible:bg-main/dim-5",
627
+ "text-main"
628
+ ])
629
+ },
630
+ {
631
+ intent: "support",
632
+ design: "outlined",
633
+ class: (0, import_internal_utils4.tw)([
634
+ "hover:bg-support/dim-5",
635
+ "enabled:active:bg-support/dim-5",
636
+ "focus-visible:bg-support/dim-5",
637
+ "text-support"
638
+ ])
639
+ },
640
+ {
641
+ intent: "accent",
642
+ design: "outlined",
643
+ class: (0, import_internal_utils4.tw)([
644
+ "hover:bg-accent/dim-5",
645
+ "enabled:active:bg-accent/dim-5",
646
+ "focus-visible:bg-accent/dim-5",
647
+ "text-accent"
648
+ ])
649
+ },
650
+ {
651
+ intent: "basic",
652
+ design: "outlined",
653
+ class: (0, import_internal_utils4.tw)([
654
+ "hover:bg-basic/dim-5",
655
+ "enabled:active:bg-basic/dim-5",
656
+ "focus-visible:bg-basic/dim-5",
657
+ "text-basic"
658
+ ])
659
+ },
660
+ {
661
+ intent: "success",
662
+ design: "outlined",
663
+ class: (0, import_internal_utils4.tw)([
664
+ "hover:bg-success/dim-5",
665
+ "enabled:active:bg-success/dim-5",
666
+ "focus-visible:bg-success/dim-5",
667
+ "text-success"
668
+ ])
669
+ },
670
+ {
671
+ intent: "alert",
672
+ design: "outlined",
673
+ class: (0, import_internal_utils4.tw)([
674
+ "hover:bg-alert/dim-5",
675
+ "enabled:active:bg-alert/dim-5",
676
+ "focus-visible:bg-alert/dim-5",
677
+ "text-alert"
678
+ ])
679
+ },
680
+ {
681
+ intent: "danger",
682
+ design: "outlined",
683
+ class: (0, import_internal_utils4.tw)([
684
+ "hover:bg-error/dim-5",
685
+ "enabled:active:bg-error/dim-5",
686
+ "focus-visible:bg-error/dim-5",
687
+ "text-error"
688
+ ])
689
+ },
690
+ {
691
+ intent: "info",
692
+ design: "outlined",
693
+ class: (0, import_internal_utils4.tw)([
694
+ "hover:bg-info/dim-5",
695
+ "enabled:active:bg-info/dim-5",
696
+ "focus-visible:bg-info/dim-5",
697
+ "text-info"
698
+ ])
699
+ },
700
+ {
701
+ intent: "neutral",
702
+ design: "outlined",
703
+ class: (0, import_internal_utils4.tw)([
704
+ "hover:bg-neutral/dim-5",
705
+ "enabled:active:bg-neutral/dim-5",
706
+ "focus-visible:bg-neutral/dim-5",
707
+ "text-neutral"
708
+ ])
709
+ },
710
+ {
711
+ intent: "surface",
712
+ design: "outlined",
713
+ class: (0, import_internal_utils4.tw)([
714
+ "hover:bg-surface/dim-5",
715
+ "enabled:active:bg-surface/dim-5",
716
+ "focus-visible:bg-surface/dim-5",
717
+ "text-surface"
718
+ ])
719
+ }
720
+ ];
721
+
722
+ // src/button/variants/tinted.ts
723
+ var import_internal_utils5 = require("@spark-ui/internal-utils");
724
+ var tintedVariants2 = [
725
+ {
726
+ intent: "main",
727
+ design: "tinted",
728
+ class: (0, import_internal_utils5.tw)([
729
+ "bg-main-container",
730
+ "text-on-main-container",
731
+ "hover:bg-main-container-hovered",
732
+ "enabled:active:bg-main-container-hovered",
733
+ "focus-visible:bg-main-container-hovered"
734
+ ])
735
+ },
736
+ {
737
+ intent: "support",
738
+ design: "tinted",
739
+ class: (0, import_internal_utils5.tw)([
740
+ "bg-support-container",
741
+ "text-on-support-container",
742
+ "hover:bg-support-container-hovered",
743
+ "enabled:active:bg-support-container-hovered",
744
+ "focus-visible:bg-support-container-hovered"
745
+ ])
746
+ },
747
+ {
748
+ intent: "accent",
749
+ design: "tinted",
750
+ class: (0, import_internal_utils5.tw)([
751
+ "bg-accent-container",
752
+ "text-on-accent-container",
753
+ "hover:bg-accent-container-hovered",
754
+ "enabled:active:bg-accent-container-hovered",
755
+ "focus-visible:bg-accent-container-hovered"
756
+ ])
757
+ },
758
+ {
759
+ intent: "basic",
760
+ design: "tinted",
761
+ class: (0, import_internal_utils5.tw)([
762
+ "bg-basic-container",
763
+ "text-on-basic-container",
764
+ "hover:bg-basic-container-hovered",
765
+ "enabled:active:bg-basic-container-hovered",
766
+ "focus-visible:bg-basic-container-hovered"
767
+ ])
768
+ },
769
+ {
770
+ intent: "success",
771
+ design: "tinted",
772
+ class: (0, import_internal_utils5.tw)([
773
+ "bg-success-container",
774
+ "text-on-success-container",
775
+ "hover:bg-success-container-hovered",
776
+ "enabled:active:bg-success-container-hovered",
777
+ "focus-visible:bg-success-container-hovered"
778
+ ])
779
+ },
780
+ {
781
+ intent: "alert",
782
+ design: "tinted",
783
+ class: (0, import_internal_utils5.tw)([
784
+ "bg-alert-container",
785
+ "text-on-alert-container",
786
+ "hover:bg-alert-container-hovered",
787
+ "enabled:active:bg-alert-container-hovered",
788
+ "focus-visible:bg-alert-container-hovered"
789
+ ])
790
+ },
791
+ {
792
+ intent: "danger",
793
+ design: "tinted",
794
+ class: (0, import_internal_utils5.tw)([
795
+ "bg-error-container",
796
+ "text-on-error-container",
797
+ "hover:bg-error-container-hovered",
798
+ "enabled:active:bg-error-container-hovered",
799
+ "focus-visible:bg-error-container-hovered"
800
+ ])
801
+ },
802
+ {
803
+ intent: "info",
804
+ design: "tinted",
805
+ class: (0, import_internal_utils5.tw)([
806
+ "bg-info-container",
807
+ "text-on-info-container",
808
+ "hover:bg-info-container-hovered",
809
+ "enabled:active:bg-info-container-hovered",
810
+ "focus-visible:bg-info-container-hovered"
811
+ ])
812
+ },
813
+ {
814
+ intent: "neutral",
815
+ design: "tinted",
816
+ class: (0, import_internal_utils5.tw)([
817
+ "bg-neutral-container",
818
+ "text-on-neutral-container",
819
+ "hover:bg-neutral-container-hovered",
820
+ "enabled:active:bg-neutral-container-hovered",
821
+ "focus-visible:bg-neutral-container-hovered"
822
+ ])
823
+ },
824
+ {
825
+ intent: "surface",
826
+ design: "tinted",
827
+ class: (0, import_internal_utils5.tw)([
828
+ "bg-surface",
829
+ "text-on-surface",
830
+ "hover:bg-surface-hovered",
831
+ "enabled:active:bg-surface-hovered",
832
+ "focus-visible:bg-surface-hovered"
833
+ ])
834
+ }
835
+ ];
836
+
837
+ // src/button/variants/contrast.ts
838
+ var import_internal_utils6 = require("@spark-ui/internal-utils");
839
+ var contrastVariants = [
840
+ {
841
+ intent: "main",
842
+ design: "contrast",
843
+ class: (0, import_internal_utils6.tw)([
844
+ "text-main",
845
+ "hover:bg-main-container-hovered",
846
+ "enabled:active:bg-main-container-hovered",
847
+ "focus-visible:bg-main-container-hovered"
848
+ ])
849
+ },
850
+ {
851
+ intent: "support",
852
+ design: "contrast",
853
+ class: (0, import_internal_utils6.tw)([
854
+ "text-support",
855
+ "hover:bg-support-container-hovered",
856
+ "enabled:active:bg-support-container-hovered",
857
+ "focus-visible:bg-support-container-hovered"
858
+ ])
859
+ },
860
+ {
861
+ intent: "accent",
862
+ design: "contrast",
863
+ class: (0, import_internal_utils6.tw)([
864
+ "text-accent",
865
+ "hover:bg-accent-container-hovered",
866
+ "enabled:active:bg-accent-container-hovered",
867
+ "focus-visible:bg-accent-container-hovered"
868
+ ])
869
+ },
870
+ {
871
+ intent: "basic",
872
+ design: "contrast",
873
+ class: (0, import_internal_utils6.tw)([
874
+ "text-basic",
875
+ "hover:bg-basic-container-hovered",
876
+ "enabled:active:bg-basic-container-hovered",
877
+ "focus-visible:bg-basic-container-hovered"
878
+ ])
879
+ },
880
+ {
881
+ intent: "success",
882
+ design: "contrast",
883
+ class: (0, import_internal_utils6.tw)([
884
+ "text-success",
885
+ "hover:bg-success-container-hovered",
886
+ "enabled:active:bg-success-container-hovered",
887
+ "focus-visible:bg-success-container-hovered"
888
+ ])
889
+ },
890
+ {
891
+ intent: "alert",
892
+ design: "contrast",
893
+ class: (0, import_internal_utils6.tw)([
894
+ "text-alert",
895
+ "hover:bg-alert-container-hovered",
896
+ "enabled:active:bg-alert-container-hovered",
897
+ "focus-visible:bg-alert-container-hovered"
898
+ ])
899
+ },
900
+ {
901
+ intent: "danger",
902
+ design: "contrast",
903
+ class: (0, import_internal_utils6.tw)([
904
+ "text-error",
905
+ "hover:bg-error-container-hovered",
906
+ "enabled:active:bg-error-container-hovered",
907
+ "focus-visible:bg-error-container-hovered"
908
+ ])
909
+ },
910
+ {
911
+ intent: "info",
912
+ design: "contrast",
913
+ class: (0, import_internal_utils6.tw)([
914
+ "text-info",
915
+ "hover:bg-info-container-hovered",
916
+ "enabled:active:bg-info-container-hovered",
917
+ "focus-visible:bg-info-container-hovered"
918
+ ])
919
+ },
920
+ {
921
+ intent: "neutral",
922
+ design: "contrast",
923
+ class: (0, import_internal_utils6.tw)([
924
+ "text-neutral",
925
+ "hover:bg-neutral-container-hovered",
926
+ "enabled:active:bg-neutral-container-hovered",
927
+ "focus-visible:bg-neutral-container-hovered"
928
+ ])
929
+ },
930
+ {
931
+ intent: "surface",
932
+ design: "contrast",
933
+ class: (0, import_internal_utils6.tw)([
934
+ "text-on-surface",
935
+ "hover:bg-surface-hovered",
936
+ "enabled:active:bg-surface-hovered",
937
+ "focus-visible:bg-surface-hovered"
938
+ ])
939
+ }
940
+ ];
941
+
942
+ // src/button/Button.styles.tsx
943
+ var buttonStyles = (0, import_class_variance_authority3.cva)(
944
+ [
945
+ "u-shadow-border-transition",
946
+ "box-border inline-flex items-center justify-center gap-md whitespace-nowrap",
947
+ "px-lg",
948
+ "text-body-1 font-bold",
949
+ "focus-visible:u-outline"
950
+ ],
951
+ {
952
+ variants: {
953
+ /**
954
+ * Main style of the button.
955
+ *
956
+ * - `filled`: Button will be plain.
957
+ *
958
+ * - `outlined`: Button will be transparent with an outline.
959
+ *
960
+ * - `tinted`: Button will be filled but using a lighter color scheme.
961
+ *
962
+ * - `ghost`: Button will look like a link. No borders, plain text.
963
+ *
964
+ * - `contrast`: Button will be surface filled. No borders, plain text.
965
+ *
966
+ */
967
+ design: (0, import_internal_utils7.makeVariants)({
968
+ filled: [],
969
+ outlined: ["bg-transparent", "border-sm", "border-current"],
970
+ tinted: [],
971
+ ghost: [],
972
+ contrast: ["bg-surface"]
973
+ }),
974
+ /**
975
+ * Color scheme of the button.
976
+ */
977
+ intent: (0, import_internal_utils7.makeVariants)({
978
+ main: [],
979
+ support: [],
980
+ accent: [],
981
+ basic: [],
982
+ success: [],
983
+ alert: [],
984
+ danger: [],
985
+ info: [],
986
+ neutral: [],
987
+ surface: []
988
+ }),
989
+ /**
990
+ * Size of the button.
991
+ */
992
+ size: (0, import_internal_utils7.makeVariants)({
993
+ sm: ["min-w-sz-32", "h-sz-32"],
994
+ md: ["min-w-sz-44", "h-sz-44"],
995
+ lg: ["min-w-sz-56", "h-sz-56"]
996
+ }),
997
+ /**
998
+ * Shape of the button.
999
+ */
1000
+ shape: (0, import_internal_utils7.makeVariants)({
1001
+ rounded: ["rounded-lg"],
1002
+ square: ["rounded-0"],
1003
+ pill: ["rounded-full"]
1004
+ }),
1005
+ /**
1006
+ * Disable the button, preventing user interaction and adding opacity.
1007
+ */
1008
+ disabled: {
1009
+ true: ["cursor-not-allowed", "opacity-dim-3"],
1010
+ false: ["cursor-pointer"]
1011
+ }
1012
+ },
1013
+ compoundVariants: [
1014
+ ...filledVariants2,
1015
+ ...outlinedVariants,
1016
+ ...tintedVariants2,
1017
+ ...ghostVariants,
1018
+ ...contrastVariants
1019
+ ],
1020
+ defaultVariants: {
1021
+ design: "filled",
1022
+ intent: "main",
1023
+ size: "md",
1024
+ shape: "rounded"
1025
+ }
1026
+ }
1027
+ );
1028
+
1029
+ // src/button/Button.tsx
1030
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1031
+ var blockedEventHandlers = [
1032
+ "onClick",
1033
+ "onMouseDown",
1034
+ "onMouseUp",
1035
+ "onMouseEnter",
1036
+ "onMouseLeave",
1037
+ "onMouseOver",
1038
+ "onMouseOut",
1039
+ "onKeyDown",
1040
+ "onKeyPress",
1041
+ "onKeyUp",
1042
+ "onSubmit"
1043
+ ];
1044
+ var Button = ({
1045
+ children,
1046
+ design = "filled",
1047
+ disabled = false,
1048
+ intent = "main",
1049
+ isLoading = false,
1050
+ loadingLabel,
1051
+ loadingText,
1052
+ shape = "rounded",
1053
+ size = "md",
1054
+ asChild,
1055
+ className,
1056
+ ref,
1057
+ ...others
1058
+ }) => {
1059
+ const Component = asChild ? Slot : "button";
1060
+ const shouldNotInteract = !!disabled || isLoading;
1061
+ const disabledEventHandlers = (0, import_react2.useMemo)(() => {
1062
+ const result = {};
1063
+ if (shouldNotInteract) {
1064
+ blockedEventHandlers.forEach((eventHandler) => result[eventHandler] = void 0);
1065
+ }
1066
+ return result;
1067
+ }, [shouldNotInteract]);
1068
+ const spinnerProps = {
1069
+ size: "current",
1070
+ className: loadingText ? "inline-block" : "absolute",
1071
+ ...loadingLabel && { "aria-label": loadingLabel }
1072
+ };
1073
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1074
+ Component,
1075
+ {
1076
+ "data-spark-component": "button",
1077
+ ...Component === "button" && { type: "button" },
1078
+ ref,
1079
+ className: buttonStyles({
1080
+ className,
1081
+ design,
1082
+ disabled: shouldNotInteract,
1083
+ intent,
1084
+ shape,
1085
+ size
1086
+ }),
1087
+ disabled: !!disabled,
1088
+ "aria-busy": isLoading,
1089
+ "aria-live": isLoading ? "assertive" : "off",
1090
+ ...others,
1091
+ ...disabledEventHandlers,
1092
+ children: wrapPolymorphicSlot(
1093
+ asChild,
1094
+ children,
1095
+ (slotted) => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1096
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Spinner, { ...spinnerProps }),
1097
+ loadingText && loadingText,
1098
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1099
+ "div",
1100
+ {
1101
+ "aria-hidden": true,
1102
+ className: (0, import_class_variance_authority4.cx)("gap-md", loadingText ? "hidden" : "inline-flex opacity-0"),
1103
+ children: slotted
1104
+ }
1105
+ )
1106
+ ] }) : slotted
1107
+ )
1108
+ }
1109
+ );
1110
+ };
1111
+ Button.displayName = "Button";
1112
+
1113
+ // src/snackbar/SnackbarItemContext.tsx
1114
+ var import_react3 = require("react");
1115
+ var SnackbarItemContext = (0, import_react3.createContext)({});
1116
+ var useSnackbarItemContext = () => (0, import_react3.useContext)(SnackbarItemContext);
1117
+
1118
+ // src/snackbar/SnackbarItemAction.tsx
1119
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1120
+ var SnackbarItemAction = ({
1121
+ design: designProp = "filled",
1122
+ intent: intentProp = "neutral",
1123
+ onClick,
1124
+ children,
1125
+ className,
1126
+ ref,
1127
+ ...rest
1128
+ }) => {
1129
+ const { toast, state } = useSnackbarItemContext();
1130
+ const intent = intentProp ?? toast.content.intent;
1131
+ const design = designProp ?? toast.content.design;
1132
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1133
+ Button,
1134
+ {
1135
+ ref,
1136
+ size: "md",
1137
+ shape: "rounded",
1138
+ ...intent === "inverse" ? {
1139
+ design: "ghost",
1140
+ intent: "surface"
1141
+ } : {
1142
+ design,
1143
+ intent: intent === "error" ? "danger" : intent
1144
+ },
1145
+ onClick: (e) => {
1146
+ onClick?.(e);
1147
+ state.close(toast.key);
1148
+ },
1149
+ style: { gridArea: "action", ...rest.style },
1150
+ className: (0, import_class_variance_authority5.cx)("ml-md justify-self-end", className),
1151
+ ...rest,
1152
+ children
1153
+ }
1154
+ );
1155
+ };
1156
+ SnackbarItemAction.displayName = "Snackbar.ItemAction";
1157
+
1158
+ // src/snackbar/SnackbarItemClose.tsx
1159
+ var import_Close = require("@spark-ui/icons/Close");
1160
+ var import_class_variance_authority8 = require("class-variance-authority");
1161
+
1162
+ // src/icon/Icon.tsx
1163
+ var import_react4 = require("react");
1164
+
1165
+ // src/icon/Icon.styles.tsx
1166
+ var import_internal_utils8 = require("@spark-ui/internal-utils");
1167
+ var import_class_variance_authority6 = require("class-variance-authority");
1168
+ var iconStyles = (0, import_class_variance_authority6.cva)(["fill-current shrink-0"], {
1169
+ variants: {
1170
+ /**
1171
+ * Color scheme of the icon.
1172
+ */
1173
+ intent: (0, import_internal_utils8.makeVariants)({
1174
+ current: ["text-current"],
1175
+ main: ["text-main"],
1176
+ support: ["text-support"],
1177
+ accent: ["text-accent"],
1178
+ basic: ["text-basic"],
1179
+ success: ["text-success"],
1180
+ alert: ["text-alert"],
1181
+ error: ["text-error"],
1182
+ info: ["text-info"],
1183
+ neutral: ["text-neutral"]
1184
+ }),
1185
+ /**
1186
+ * Sets the size of the icon.
1187
+ */
1188
+ size: (0, import_internal_utils8.makeVariants)({
1189
+ current: ["u-current-font-size"],
1190
+ sm: ["w-sz-16", "h-sz-16"],
1191
+ md: ["w-sz-24", "h-sz-24"],
1192
+ lg: ["w-sz-32", "h-sz-32"],
1193
+ xl: ["w-sz-40", "h-sz-40"]
1194
+ })
1195
+ }
1196
+ });
1197
+
1198
+ // src/icon/Icon.tsx
1199
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1200
+ var Icon = ({
1201
+ label,
1202
+ className,
1203
+ size = "current",
1204
+ intent = "current",
1205
+ children,
1206
+ ...others
1207
+ }) => {
1208
+ const child = import_react4.Children.only(children);
1209
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1210
+ (0, import_react4.cloneElement)(child, {
1211
+ className: iconStyles({ className, size, intent }),
1212
+ "data-spark-component": "icon",
1213
+ "aria-hidden": "true",
1214
+ focusable: "false",
1215
+ ...others
1216
+ }),
1217
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(VisuallyHidden, { children: label })
1218
+ ] });
1219
+ };
1220
+ Icon.displayName = "Icon";
1221
+
1222
+ // src/icon-button/IconButton.styles.tsx
1223
+ var import_internal_utils9 = require("@spark-ui/internal-utils");
1224
+ var import_class_variance_authority7 = require("class-variance-authority");
1225
+ var iconButtonStyles = (0, import_class_variance_authority7.cva)(["pl-0 pr-0"], {
1226
+ variants: {
1227
+ /**
1228
+ * Sets the size of the icon.
1229
+ */
1230
+ size: (0, import_internal_utils9.makeVariants)({
1231
+ sm: ["text-body-1"],
1232
+ md: ["text-body-1"],
1233
+ lg: ["text-display-3"]
1234
+ })
1235
+ }
1236
+ });
1237
+
1238
+ // src/icon-button/IconButton.tsx
1239
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1240
+ var IconButton = ({
1241
+ design = "filled",
1242
+ disabled = false,
1243
+ intent = "main",
1244
+ shape = "rounded",
1245
+ size = "md",
1246
+ className,
1247
+ ref,
1248
+ ...others
1249
+ }) => {
1250
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1251
+ Button,
1252
+ {
1253
+ ref,
1254
+ className: iconButtonStyles({ size, className }),
1255
+ design,
1256
+ disabled,
1257
+ intent,
1258
+ shape,
1259
+ size,
1260
+ ...others
1261
+ }
1262
+ );
1263
+ };
1264
+ IconButton.displayName = "IconButton";
1265
+
1266
+ // src/snackbar/SnackbarItemClose.tsx
1267
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1268
+ var SnackbarItemClose = ({
1269
+ design: designProp = "filled",
1270
+ intent: intentProp = "neutral",
1271
+ "aria-label": ariaLabel,
1272
+ onClick,
1273
+ className,
1274
+ ref,
1275
+ ...rest
1276
+ }) => {
1277
+ const { toast, state } = useSnackbarItemContext();
1278
+ const intent = intentProp ?? toast.content.intent;
1279
+ const design = designProp ?? toast.content.design;
1280
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1281
+ IconButton,
1282
+ {
1283
+ ref,
1284
+ size: "md",
1285
+ shape: "rounded",
1286
+ ...intent === "inverse" ? {
1287
+ design: "ghost",
1288
+ intent: "surface"
1289
+ } : {
1290
+ design,
1291
+ intent: intent === "error" ? "danger" : intent
1292
+ },
1293
+ "aria-label": ariaLabel,
1294
+ onClick: (e) => {
1295
+ onClick?.(e);
1296
+ state.close(toast.key);
1297
+ },
1298
+ style: { gridArea: "close", ...rest.style },
1299
+ className: (0, import_class_variance_authority8.cx)("ml-md justify-self-end", className),
1300
+ ...rest,
1301
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_Close.Close, {}) })
1302
+ }
1303
+ );
1304
+ };
1305
+ SnackbarItemClose.displayName = "Snackbar.ItemClose";
1306
+
1307
+ // src/snackbar/SnackbarItemIcon.tsx
1308
+ var import_class_variance_authority9 = require("class-variance-authority");
1309
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1310
+ var SnackbarItemIcon = ({
1311
+ children,
1312
+ className,
1313
+ ...rest
1314
+ }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1315
+ Icon,
1316
+ {
1317
+ size: "md",
1318
+ className: (0, import_class_variance_authority9.cx)("mx-md", className),
1319
+ style: { gridArea: "icon", ...rest.style },
1320
+ ...rest,
1321
+ children
1322
+ }
1323
+ );
1324
+ SnackbarItemIcon.displayName = "Snackbar.ItemIcon";
1325
+
1326
+ // src/snackbar/useSwipe.ts
1327
+ var import_react5 = require("react");
1328
+ var SWIPE_THRESHOLD = 75;
1329
+ var useSwipe = ({
1330
+ swipeRef,
1331
+ onSwipeStart,
1332
+ onSwipeMove,
1333
+ onSwipeCancel,
1334
+ onSwipeEnd,
1335
+ threshold = 10
1336
+ }) => {
1337
+ const [state, setState] = (0, import_react5.useState)();
1338
+ const direction = (0, import_react5.useRef)(null);
1339
+ const origin = (0, import_react5.useRef)(null);
1340
+ const delta = (0, import_react5.useRef)(null);
1341
+ const handleSwipeStart = (evt) => {
1342
+ origin.current = { x: evt.clientX, y: evt.clientY };
1343
+ document.addEventListener("selectstart", (e) => e.preventDefault());
1344
+ };
1345
+ const handleSwipeMove = (evt) => {
1346
+ if (!origin.current) return;
1347
+ const deltaX = Math.abs(evt.clientX - origin.current.x);
1348
+ const deltaY = Math.abs(evt.clientY - origin.current.y);
1349
+ let moveState;
1350
+ if (deltaX > deltaY && deltaX > threshold) {
1351
+ direction.current = evt.clientX > origin.current.x ? "right" : "left";
1352
+ } else if (deltaY > threshold) {
1353
+ direction.current = evt.clientY > origin.current.y ? "down" : "up";
1354
+ }
1355
+ if (!direction.current) return;
1356
+ if (!delta.current) {
1357
+ moveState = "start";
1358
+ delta.current = { x: deltaX, y: deltaY };
1359
+ onSwipeStart?.({ state: moveState, direction: direction.current });
1360
+ } else {
1361
+ moveState = "move";
1362
+ delta.current = { x: deltaX, y: deltaY };
1363
+ swipeRef.current.style.setProperty(
1364
+ "--swipe-position-x",
1365
+ `${deltaX > deltaY ? evt.clientX - origin.current.x : 0}px`
1366
+ );
1367
+ swipeRef.current.style.setProperty(
1368
+ "--swipe-position-y",
1369
+ `${!(deltaX > deltaY) ? evt.clientY - origin.current.y : 0}px`
1370
+ );
1371
+ onSwipeMove?.({ state: moveState, direction: direction.current });
1372
+ }
1373
+ setState(moveState);
1374
+ };
1375
+ const handleSwipeEnd = () => {
1376
+ const proxyDelta = delta.current;
1377
+ origin.current = null;
1378
+ delta.current = null;
1379
+ if (proxyDelta) {
1380
+ const { x: deltaX, y: deltaY } = proxyDelta;
1381
+ let endState;
1382
+ if (deltaX > deltaY) {
1383
+ if (deltaX > SWIPE_THRESHOLD) {
1384
+ endState = "end";
1385
+ onSwipeEnd?.({ state: endState, direction: direction.current });
1386
+ } else {
1387
+ endState = "cancel";
1388
+ onSwipeCancel?.({ state: endState, direction: direction.current });
1389
+ }
1390
+ } else {
1391
+ if (deltaY > SWIPE_THRESHOLD) {
1392
+ endState = "end";
1393
+ onSwipeEnd?.({ state: endState, direction: direction.current });
1394
+ } else {
1395
+ endState = "cancel";
1396
+ onSwipeCancel?.({ state: endState, direction: direction.current });
1397
+ }
1398
+ }
1399
+ setState(endState);
1400
+ document.removeEventListener("selectstart", (e) => e.preventDefault());
1401
+ }
1402
+ };
1403
+ (0, import_react5.useEffect)(() => {
1404
+ if (!swipeRef.current) return;
1405
+ const swipeElement = swipeRef.current;
1406
+ swipeElement.addEventListener("pointerdown", handleSwipeStart);
1407
+ document.addEventListener("pointermove", handleSwipeMove);
1408
+ document.addEventListener("pointerup", handleSwipeEnd);
1409
+ return () => {
1410
+ swipeElement.removeEventListener("pointerdown", handleSwipeStart);
1411
+ document.removeEventListener("pointermove", handleSwipeMove);
1412
+ document.removeEventListener("pointerup", handleSwipeEnd);
1413
+ };
1414
+ }, []);
1415
+ return {
1416
+ state,
1417
+ direction: direction.current
1418
+ };
1419
+ };
1420
+
1421
+ // src/snackbar/SnackbarItem.tsx
1422
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1423
+ var SnackbarItem = ({
1424
+ "aria-label": ariaLabel,
1425
+ "aria-labelledby": ariaLabelledby,
1426
+ "aria-describedby": ariaDescribedby,
1427
+ "aria-details": ariaDetails,
1428
+ design: designProp,
1429
+ intent: intentProp,
1430
+ actionOnNewline: actionOnNewlineProp,
1431
+ className,
1432
+ children,
1433
+ ref: forwardedRef,
1434
+ ...rest
1435
+ }) => {
1436
+ const innerRef = (0, import_react6.useRef)(null);
1437
+ const ref = typeof forwardedRef !== "function" ? forwardedRef || innerRef : innerRef;
1438
+ const { toast, state } = useSnackbarItemContext();
1439
+ const { state: swipeState, direction: swipeDirection } = useSwipe({
1440
+ swipeRef: ref,
1441
+ onSwipeStart: state.pauseAll,
1442
+ onSwipeCancel: state.resumeAll,
1443
+ onSwipeEnd: ({ direction }) => {
1444
+ ;
1445
+ ["left", "right"].includes(`${direction}`) && state.close(toast.key);
1446
+ }
1447
+ });
1448
+ const { message, icon, isClosable, onAction, actionLabel } = toast.content;
1449
+ const intent = intentProp ?? toast.content.intent;
1450
+ const design = designProp ?? toast.content.design;
1451
+ const actionOnNewline = actionOnNewlineProp ?? toast.content.actionOnNewline;
1452
+ const ariaProps = {
1453
+ ariaLabel,
1454
+ ariaLabelledby,
1455
+ ariaDescribedby,
1456
+ ariaDetails
1457
+ };
1458
+ const { toastProps, titleProps, closeButtonProps, contentProps } = (0, import_toast.useToast)(
1459
+ { toast, ...ariaProps },
1460
+ state,
1461
+ ref
1462
+ );
1463
+ const findElement = (0, import_react6.useCallback)(
1464
+ (elementDisplayName) => {
1465
+ const childrenArray = import_react6.Children.toArray(children);
1466
+ const match = childrenArray.filter(import_react6.isValidElement).find(
1467
+ (child) => !!child.type.displayName?.includes(
1468
+ elementDisplayName
1469
+ )
1470
+ );
1471
+ return match;
1472
+ },
1473
+ [children]
1474
+ );
1475
+ const iconFromChildren = findElement("Snackbar.ItemIcon");
1476
+ const actionBtnFromChildren = findElement("Snackbar.ItemAction");
1477
+ const closeBtnFromChildren = findElement("Snackbar.ItemClose");
1478
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1479
+ "div",
1480
+ {
1481
+ className: snackbarItemVariant({ design, intent, className }),
1482
+ "data-animation": toast.animation,
1483
+ ...!(swipeState === "cancel" && toast.animation === "exiting") && {
1484
+ "data-swipe": swipeState,
1485
+ "data-swipe-direction": swipeDirection
1486
+ },
1487
+ ...toast.animation === "exiting" && {
1488
+ // Remove snackbar when the exiting animation completes
1489
+ onAnimationEnd: () => state.remove(toast.key)
1490
+ },
1491
+ ref,
1492
+ ...toastProps,
1493
+ ...rest,
1494
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: snackbarItemVariantContent({ actionOnNewline }), ...contentProps, children: [
1495
+ renderSubComponent(iconFromChildren, icon ? SnackbarItemIcon : null, {
1496
+ children: icon
1497
+ }),
1498
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1499
+ "p",
1500
+ {
1501
+ className: "px-md py-lg text-body-2 row-span-3",
1502
+ style: { gridArea: "message" },
1503
+ ...titleProps,
1504
+ children: message
1505
+ }
1506
+ ),
1507
+ renderSubComponent(
1508
+ actionBtnFromChildren,
1509
+ actionLabel && onAction ? SnackbarItemAction : null,
1510
+ { intent, design, onClick: onAction, children: actionLabel }
1511
+ ),
1512
+ renderSubComponent(closeBtnFromChildren, isClosable ? SnackbarItemClose : null, {
1513
+ intent,
1514
+ design,
1515
+ /**
1516
+ * React Spectrum typing of aria-label is inaccurate, and aria-label value should never be undefined.
1517
+ * See https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/i18n/src/useLocalizedStringFormatter.ts#L40
1518
+ */
1519
+ "aria-label": closeButtonProps["aria-label"]
1520
+ })
1521
+ ] })
1522
+ }
1523
+ );
1524
+ };
1525
+ SnackbarItem.displayName = "Snackbar.Item";
1526
+ var renderSubComponent = (childItem, defaultItem, props) => {
1527
+ if (childItem) {
1528
+ return (0, import_react6.cloneElement)(childItem, { ...props, ...childItem.props });
1529
+ } else if (defaultItem) {
1530
+ const Item = defaultItem;
1531
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Item, { ...props });
1532
+ } else {
1533
+ return null;
1534
+ }
1535
+ };
1536
+
1537
+ // src/snackbar/SnackbarRegion.styles.ts
1538
+ var import_class_variance_authority10 = require("class-variance-authority");
1539
+ var snackbarRegionVariant = (0, import_class_variance_authority10.cva)(
1540
+ [
1541
+ "fixed inset-x-lg z-toast group",
1542
+ "outline-hidden pointer-events-none",
1543
+ "grid grid-rows-1 grid-cols-1 gap-lg"
1544
+ ],
1545
+ {
1546
+ variants: {
1547
+ /**
1548
+ * Set snackbar item position
1549
+ * @default 'bottom'
1550
+ */
1551
+ position: {
1552
+ top: "top-lg justify-items-center",
1553
+ "top-right": "top-lg justify-items-end",
1554
+ "top-left": "top-lg justify-items-start",
1555
+ bottom: "bottom-lg justify-items-center",
1556
+ "bottom-right": "bottom-lg justify-items-end",
1557
+ "bottom-left": "bottom-lg justify-items-start"
1558
+ }
1559
+ },
1560
+ defaultVariants: {
1561
+ position: "bottom"
1562
+ }
1563
+ }
1564
+ );
1565
+
1566
+ // src/snackbar/SnackbarRegion.tsx
1567
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1568
+ var SnackbarRegion = ({
1569
+ children = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SnackbarItem, {}),
1570
+ state,
1571
+ position = "bottom",
1572
+ className,
1573
+ ref: forwardedRef,
1574
+ ...rest
1575
+ }) => {
1576
+ const innerRef = (0, import_react7.useRef)(null);
1577
+ const ref = forwardedRef && typeof forwardedRef !== "function" ? forwardedRef : innerRef;
1578
+ const { regionProps } = (0, import_toast2.useToastRegion)(rest, state, ref);
1579
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1580
+ "div",
1581
+ {
1582
+ ...regionProps,
1583
+ ref,
1584
+ "data-position": position,
1585
+ className: snackbarRegionVariant({ position, className }),
1586
+ children: state.visibleToasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SnackbarItemContext.Provider, { value: { toast, state }, children: (0, import_react7.cloneElement)(children, { key: toast.key }) }, toast.key))
1587
+ }
1588
+ );
1589
+ };
1590
+
1591
+ // src/snackbar/useSnackbarGlobalStore.ts
1592
+ var import_react8 = require("react");
1593
+ var useSnackbarGlobalStore = ({
1594
+ providers,
1595
+ subscriptions
1596
+ }) => {
1597
+ const subscribe = (0, import_react8.useCallback)(
1598
+ (listener) => {
1599
+ subscriptions.add(listener);
1600
+ return () => subscriptions.delete(listener);
1601
+ },
1602
+ [subscriptions]
1603
+ );
1604
+ const getLastSnackbarProvider = (0, import_react8.useCallback)(() => [...providers].reverse()[0], [providers]);
1605
+ const addProvider = (0, import_react8.useCallback)(
1606
+ (provider2) => {
1607
+ providers.add(provider2);
1608
+ for (const subscribeFn of subscriptions) {
1609
+ subscribeFn();
1610
+ }
1611
+ },
1612
+ [providers, subscriptions]
1613
+ );
1614
+ const deleteProvider = (0, import_react8.useCallback)(
1615
+ (provider2) => {
1616
+ providers.delete(provider2);
1617
+ for (const subscribeFn of subscriptions) {
1618
+ subscribeFn();
1619
+ }
1620
+ },
1621
+ [providers, subscriptions]
1622
+ );
1623
+ const provider = (0, import_react8.useSyncExternalStore)(subscribe, getLastSnackbarProvider, getLastSnackbarProvider);
1624
+ return {
1625
+ provider,
1626
+ addProvider,
1627
+ deleteProvider
1628
+ };
1629
+ };
1630
+
1631
+ // src/snackbar/Snackbar.tsx
1632
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1633
+ var GLOBAL_SNACKBAR_QUEUE = null;
1634
+ var getGlobalSnackBarQueue = () => {
1635
+ if (!GLOBAL_SNACKBAR_QUEUE) {
1636
+ GLOBAL_SNACKBAR_QUEUE = new import_toast3.ToastQueue({
1637
+ maxVisibleToasts: 1,
1638
+ hasExitAnimation: true
1639
+ });
1640
+ }
1641
+ return GLOBAL_SNACKBAR_QUEUE;
1642
+ };
1643
+ var clearSnackbarQueue = () => {
1644
+ GLOBAL_SNACKBAR_QUEUE = null;
1645
+ };
1646
+ var GLOBAL_SNACKBAR_STORE = {
1647
+ providers: /* @__PURE__ */ new Set(),
1648
+ subscriptions: /* @__PURE__ */ new Set()
1649
+ };
1650
+ var Snackbar = ({ ref: forwardedRef, ...props }) => {
1651
+ const ref = (0, import_react9.useRef)(null);
1652
+ const state = (0, import_toast3.useToastQueue)(getGlobalSnackBarQueue());
1653
+ const { provider, addProvider, deleteProvider } = useSnackbarGlobalStore(GLOBAL_SNACKBAR_STORE);
1654
+ (0, import_react9.useEffect)(() => {
1655
+ addProvider(ref);
1656
+ return () => {
1657
+ for (const toast of getGlobalSnackBarQueue().visibleToasts) {
1658
+ toast.animation = void 0;
1659
+ }
1660
+ deleteProvider(ref);
1661
+ };
1662
+ }, []);
1663
+ return ref === provider && state.visibleToasts.length > 0 ? (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SnackbarRegion, { ref: forwardedRef, state, ...props }), document.body) : null;
1664
+ };
1665
+ Snackbar.displayName = "Snackbar";
1666
+ var addSnackbar = ({ onClose, timeout = 5e3, priority, ...content }) => {
1667
+ const queue = getGlobalSnackBarQueue();
1668
+ queue.add(content, {
1669
+ onClose,
1670
+ timeout: timeout && !content.onAction ? Math.max(timeout, 5e3) : void 0,
1671
+ priority
1672
+ });
1673
+ };
1674
+
1675
+ // src/snackbar/index.ts
1676
+ var Snackbar2 = Object.assign(Snackbar, {
1677
+ Item: SnackbarItem,
1678
+ ItemAction: SnackbarItemAction,
1679
+ ItemClose: SnackbarItemClose,
1680
+ ItemIcon: SnackbarItemIcon
1681
+ });
1682
+ Snackbar2.displayName = "Snackbar";
1683
+ SnackbarItem.displayName = "Snackbar.Item";
1684
+ SnackbarItemAction.displayName = "Snackbar.ItemAction";
1685
+ SnackbarItemClose.displayName = "Snackbar.ItemClose";
1686
+ SnackbarItemIcon.displayName = "Snackbar.ItemIcon";
1687
+ // Annotate the CommonJS export names for ESM import in node:
1688
+ 0 && (module.exports = {
1689
+ Snackbar,
1690
+ addSnackbar,
1691
+ clearSnackbarQueue
1692
+ });
1693
+ //# sourceMappingURL=index.js.map