@spark-ui/components 17.2.3 → 17.2.4-beta.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 (302) hide show
  1. package/dist/DialogContent.styles-BSxCCi-u.mjs +62 -0
  2. package/dist/DialogContent.styles-BSxCCi-u.mjs.map +1 -0
  3. package/dist/DialogContent.styles-CAhJtUud.js +2 -0
  4. package/dist/DialogContent.styles-CAhJtUud.js.map +1 -0
  5. package/dist/FormFieldRequiredIndicator-CtgkvPZo.js +2 -0
  6. package/dist/FormFieldRequiredIndicator-CtgkvPZo.js.map +1 -0
  7. package/dist/FormFieldRequiredIndicator-DOGQ_HxO.mjs +14 -0
  8. package/dist/FormFieldRequiredIndicator-DOGQ_HxO.mjs.map +1 -0
  9. package/dist/accordion/index.js +2 -2
  10. package/dist/accordion/index.js.map +1 -1
  11. package/dist/accordion/index.mjs +99 -161
  12. package/dist/accordion/index.mjs.map +1 -1
  13. package/dist/alert-dialog/index.js +2 -2
  14. package/dist/alert-dialog/index.js.map +1 -1
  15. package/dist/alert-dialog/index.mjs +169 -235
  16. package/dist/alert-dialog/index.mjs.map +1 -1
  17. package/dist/avatar/index.js +2 -2
  18. package/dist/avatar/index.js.map +1 -1
  19. package/dist/avatar/index.mjs +187 -224
  20. package/dist/avatar/index.mjs.map +1 -1
  21. package/dist/badge/index.js +2 -2
  22. package/dist/badge/index.js.map +1 -1
  23. package/dist/badge/index.mjs +115 -81
  24. package/dist/badge/index.mjs.map +1 -1
  25. package/dist/breadcrumb/index.js +2 -2
  26. package/dist/breadcrumb/index.js.map +1 -1
  27. package/dist/breadcrumb/index.mjs +73 -106
  28. package/dist/breadcrumb/index.mjs.map +1 -1
  29. package/dist/button/index.js +1 -2
  30. package/dist/button/index.mjs +2 -5
  31. package/dist/button-BTDRzvpB.js +2 -0
  32. package/dist/button-BTDRzvpB.js.map +1 -0
  33. package/dist/button-_YZ_4J42.mjs +643 -0
  34. package/dist/button-_YZ_4J42.mjs.map +1 -0
  35. package/dist/card/index.js +2 -2
  36. package/dist/card/index.js.map +1 -1
  37. package/dist/card/index.mjs +327 -394
  38. package/dist/card/index.mjs.map +1 -1
  39. package/dist/carousel/index.js +2 -2
  40. package/dist/carousel/index.js.map +1 -1
  41. package/dist/carousel/index.mjs +515 -618
  42. package/dist/carousel/index.mjs.map +1 -1
  43. package/dist/checkbox/index.js +2 -2
  44. package/dist/checkbox/index.js.map +1 -1
  45. package/dist/checkbox/index.mjs +213 -246
  46. package/dist/checkbox/index.mjs.map +1 -1
  47. package/dist/chip/index.js +2 -2
  48. package/dist/chip/index.js.map +1 -1
  49. package/dist/chip/index.mjs +601 -652
  50. package/dist/chip/index.mjs.map +1 -1
  51. package/dist/chunk-C91j1N6u.js +1 -0
  52. package/dist/circular-meter/index.js +2 -2
  53. package/dist/circular-meter/index.js.map +1 -1
  54. package/dist/circular-meter/index.mjs +354 -309
  55. package/dist/circular-meter/index.mjs.map +1 -1
  56. package/dist/collapsible/index.js +2 -2
  57. package/dist/collapsible/index.js.map +1 -1
  58. package/dist/collapsible/index.mjs +53 -53
  59. package/dist/collapsible/index.mjs.map +1 -1
  60. package/dist/combobox/index.js +2 -2
  61. package/dist/combobox/index.js.map +1 -1
  62. package/dist/combobox/index.mjs +721 -876
  63. package/dist/combobox/index.mjs.map +1 -1
  64. package/dist/dialog/index.js +2 -2
  65. package/dist/dialog/index.js.map +1 -1
  66. package/dist/dialog/index.mjs +181 -206
  67. package/dist/dialog/index.mjs.map +1 -1
  68. package/dist/divider/index.js +2 -2
  69. package/dist/divider/index.js.map +1 -1
  70. package/dist/divider/index.mjs +178 -183
  71. package/dist/divider/index.mjs.map +1 -1
  72. package/dist/drawer/index.js +2 -2
  73. package/dist/drawer/index.js.map +1 -1
  74. package/dist/drawer/index.mjs +277 -309
  75. package/dist/drawer/index.mjs.map +1 -1
  76. package/dist/dropdown/index.js +2 -2
  77. package/dist/dropdown/index.js.map +1 -1
  78. package/dist/dropdown/index.mjs +429 -492
  79. package/dist/dropdown/index.mjs.map +1 -1
  80. package/dist/file-upload/index.js +2 -2
  81. package/dist/file-upload/index.js.map +1 -1
  82. package/dist/file-upload/index.mjs +540 -677
  83. package/dist/file-upload/index.mjs.map +1 -1
  84. package/dist/form-field/index.js +1 -2
  85. package/dist/form-field/index.mjs +2 -284
  86. package/dist/form-field-B8QzM655.mjs +231 -0
  87. package/dist/form-field-B8QzM655.mjs.map +1 -0
  88. package/dist/form-field-Bu_0E9tb.js +2 -0
  89. package/dist/form-field-Bu_0E9tb.js.map +1 -0
  90. package/dist/icon/index.js +1 -2
  91. package/dist/icon/index.mjs +2 -5
  92. package/dist/icon-CRPcdgYp.js +2 -0
  93. package/dist/icon-CRPcdgYp.js.map +1 -0
  94. package/dist/icon-D05Uqh8_.mjs +41 -0
  95. package/dist/icon-D05Uqh8_.mjs.map +1 -0
  96. package/dist/icon-button/index.js +1 -2
  97. package/dist/icon-button/index.mjs +2 -5
  98. package/dist/icon-button-6p3O7NIm.mjs +28 -0
  99. package/dist/icon-button-6p3O7NIm.mjs.map +1 -0
  100. package/dist/icon-button-CykysbgJ.js +2 -0
  101. package/dist/icon-button-CykysbgJ.js.map +1 -0
  102. package/dist/input/index.js +1 -2
  103. package/dist/input/index.mjs +2 -455
  104. package/dist/input-CmYeHYWQ.mjs +355 -0
  105. package/dist/input-CmYeHYWQ.mjs.map +1 -0
  106. package/dist/input-DNr40G2Z.js +2 -0
  107. package/dist/input-DNr40G2Z.js.map +1 -0
  108. package/dist/input-otp/index.js +2 -2
  109. package/dist/input-otp/index.js.map +1 -1
  110. package/dist/input-otp/index.mjs +344 -407
  111. package/dist/input-otp/index.mjs.map +1 -1
  112. package/dist/kbd/index.js +2 -2
  113. package/dist/kbd/index.js.map +1 -1
  114. package/dist/kbd/index.mjs +12 -17
  115. package/dist/kbd/index.mjs.map +1 -1
  116. package/dist/label/index.js +1 -2
  117. package/dist/label/index.mjs +2 -40
  118. package/dist/label-BqRlrca0.mjs +31 -0
  119. package/dist/label-BqRlrca0.mjs.map +1 -0
  120. package/dist/label-DU0p0d-f.js +2 -0
  121. package/dist/label-DU0p0d-f.js.map +1 -0
  122. package/dist/link-box/index.js +2 -2
  123. package/dist/link-box/index.js.map +1 -1
  124. package/dist/link-box/index.mjs +36 -34
  125. package/dist/link-box/index.mjs.map +1 -1
  126. package/dist/meter/index.js +2 -2
  127. package/dist/meter/index.js.map +1 -1
  128. package/dist/meter/index.mjs +149 -171
  129. package/dist/meter/index.mjs.map +1 -1
  130. package/dist/pagination/index.js +2 -2
  131. package/dist/pagination/index.js.map +1 -1
  132. package/dist/pagination/index.mjs +253 -214
  133. package/dist/pagination/index.mjs.map +1 -1
  134. package/dist/popover/index.js +1 -2
  135. package/dist/popover/index.mjs +2 -239
  136. package/dist/popover-CxZAQmw6.mjs +211 -0
  137. package/dist/popover-CxZAQmw6.mjs.map +1 -0
  138. package/dist/popover-GOovJ27J.js +2 -0
  139. package/dist/popover-GOovJ27J.js.map +1 -0
  140. package/dist/portal/index.js +2 -2
  141. package/dist/portal/index.js.map +1 -1
  142. package/dist/portal/index.mjs +8 -7
  143. package/dist/portal/index.mjs.map +1 -1
  144. package/dist/progress/index.js +1 -2
  145. package/dist/progress/index.mjs +2 -178
  146. package/dist/progress-cEf3tFbn.mjs +132 -0
  147. package/dist/progress-cEf3tFbn.mjs.map +1 -0
  148. package/dist/progress-rJZcPJsZ.js +2 -0
  149. package/dist/progress-rJZcPJsZ.js.map +1 -0
  150. package/dist/progress-tracker/index.js +2 -2
  151. package/dist/progress-tracker/index.js.map +1 -1
  152. package/dist/progress-tracker/index.mjs +303 -380
  153. package/dist/progress-tracker/index.mjs.map +1 -1
  154. package/dist/radio-group/index.js +2 -2
  155. package/dist/radio-group/index.js.map +1 -1
  156. package/dist/radio-group/index.mjs +204 -213
  157. package/dist/radio-group/index.mjs.map +1 -1
  158. package/dist/rating/index.js +2 -2
  159. package/dist/rating/index.js.map +1 -1
  160. package/dist/rating/index.mjs +189 -244
  161. package/dist/rating/index.mjs.map +1 -1
  162. package/dist/rating-display/index.js +2 -2
  163. package/dist/rating-display/index.js.map +1 -1
  164. package/dist/rating-display/index.mjs +165 -166
  165. package/dist/rating-display/index.mjs.map +1 -1
  166. package/dist/scrolling-list/index.js +2 -2
  167. package/dist/scrolling-list/index.js.map +1 -1
  168. package/dist/scrolling-list/index.mjs +216 -273
  169. package/dist/scrolling-list/index.mjs.map +1 -1
  170. package/dist/segmented-control/index.js +2 -2
  171. package/dist/segmented-control/index.js.map +1 -1
  172. package/dist/segmented-control/index.mjs +146 -180
  173. package/dist/segmented-control/index.mjs.map +1 -1
  174. package/dist/segmented-gauge/index.js +2 -2
  175. package/dist/segmented-gauge/index.js.map +1 -1
  176. package/dist/segmented-gauge/index.mjs +146 -195
  177. package/dist/segmented-gauge/index.mjs.map +1 -1
  178. package/dist/select/index.js +2 -2
  179. package/dist/select/index.js.map +1 -1
  180. package/dist/select/index.mjs +279 -327
  181. package/dist/select/index.mjs.map +1 -1
  182. package/dist/skeleton/index.js +2 -2
  183. package/dist/skeleton/index.js.map +1 -1
  184. package/dist/skeleton/index.mjs +92 -114
  185. package/dist/skeleton/index.mjs.map +1 -1
  186. package/dist/slider/index.js +2 -2
  187. package/dist/slider/index.js.map +1 -1
  188. package/dist/slider/index.mjs +259 -326
  189. package/dist/slider/index.mjs.map +1 -1
  190. package/dist/slot/index.js +2 -2
  191. package/dist/slot/index.js.map +1 -1
  192. package/dist/slot/index.mjs +12 -7
  193. package/dist/slot/index.mjs.map +1 -1
  194. package/dist/snackbar/index.js +2 -2
  195. package/dist/snackbar/index.js.map +1 -1
  196. package/dist/snackbar/index.mjs +404 -529
  197. package/dist/snackbar/index.mjs.map +1 -1
  198. package/dist/spinner/index.js +1 -2
  199. package/dist/spinner/index.mjs +2 -5
  200. package/dist/spinner-DFUoYvmm.js +2 -0
  201. package/dist/spinner-DFUoYvmm.js.map +1 -0
  202. package/dist/spinner-DULLiM6a.mjs +56 -0
  203. package/dist/spinner-DULLiM6a.mjs.map +1 -0
  204. package/dist/src/avatar/index.d.mts +2 -2
  205. package/dist/src/avatar/index.d.ts +2 -2
  206. package/dist/src/file-upload/index.d.mts +1 -1
  207. package/dist/src/file-upload/index.d.ts +1 -1
  208. package/dist/stepper/index.js +2 -2
  209. package/dist/stepper/index.js.map +1 -1
  210. package/dist/stepper/index.mjs +139 -176
  211. package/dist/stepper/index.mjs.map +1 -1
  212. package/dist/switch/index.js +2 -2
  213. package/dist/switch/index.js.map +1 -1
  214. package/dist/switch/index.mjs +194 -197
  215. package/dist/switch/index.mjs.map +1 -1
  216. package/dist/tabs/index.js +2 -2
  217. package/dist/tabs/index.js.map +1 -1
  218. package/dist/tabs/index.mjs +337 -389
  219. package/dist/tabs/index.mjs.map +1 -1
  220. package/dist/tag/index.js +2 -2
  221. package/dist/tag/index.js.map +1 -1
  222. package/dist/tag/index.mjs +192 -211
  223. package/dist/tag/index.mjs.map +1 -1
  224. package/dist/text-link/index.js +2 -2
  225. package/dist/text-link/index.js.map +1 -1
  226. package/dist/text-link/index.mjs +44 -5
  227. package/dist/text-link/index.mjs.map +1 -1
  228. package/dist/textarea/index.js +2 -2
  229. package/dist/textarea/index.js.map +1 -1
  230. package/dist/textarea/index.mjs +51 -50
  231. package/dist/textarea/index.mjs.map +1 -1
  232. package/dist/toast/index.js +2 -2
  233. package/dist/toast/index.js.map +1 -1
  234. package/dist/toast/index.mjs +314 -367
  235. package/dist/toast/index.mjs.map +1 -1
  236. package/dist/useRenderSlot-DP4fYerF.mjs +11 -0
  237. package/dist/useRenderSlot-DP4fYerF.mjs.map +1 -0
  238. package/dist/useRenderSlot-Xxf_s88b.js +2 -0
  239. package/dist/useRenderSlot-Xxf_s88b.js.map +1 -0
  240. package/dist/visually-hidden/index.js +2 -2
  241. package/dist/visually-hidden/index.js.map +1 -1
  242. package/dist/visually-hidden/index.mjs +25 -5
  243. package/dist/visually-hidden/index.mjs.map +1 -1
  244. package/package.json +4 -4
  245. package/dist/Button-1M9DcZl0.mjs +0 -704
  246. package/dist/Button-1M9DcZl0.mjs.map +0 -1
  247. package/dist/Button-FZceRWG2.js +0 -2
  248. package/dist/Button-FZceRWG2.js.map +0 -1
  249. package/dist/DialogContent.styles-CziMQtYr.js +0 -2
  250. package/dist/DialogContent.styles-CziMQtYr.js.map +0 -1
  251. package/dist/DialogContent.styles-Du7_Dkde.mjs +0 -60
  252. package/dist/DialogContent.styles-Du7_Dkde.mjs.map +0 -1
  253. package/dist/FormFieldRequiredIndicator-CHfcoT2y.js +0 -2
  254. package/dist/FormFieldRequiredIndicator-CHfcoT2y.js.map +0 -1
  255. package/dist/FormFieldRequiredIndicator-DTnCGiX2.mjs +0 -13
  256. package/dist/FormFieldRequiredIndicator-DTnCGiX2.mjs.map +0 -1
  257. package/dist/Icon-BO327oHU.mjs +0 -57
  258. package/dist/Icon-BO327oHU.mjs.map +0 -1
  259. package/dist/Icon-C-cNTnzd.js +0 -2
  260. package/dist/Icon-C-cNTnzd.js.map +0 -1
  261. package/dist/IconButton-BR1bJSQA.js +0 -2
  262. package/dist/IconButton-BR1bJSQA.js.map +0 -1
  263. package/dist/IconButton-DdB3Pq13.mjs +0 -43
  264. package/dist/IconButton-DdB3Pq13.mjs.map +0 -1
  265. package/dist/Slot-DLY1rJrG.mjs +0 -14
  266. package/dist/Slot-DLY1rJrG.mjs.map +0 -1
  267. package/dist/Slot-DQ8z2zsy.js +0 -2
  268. package/dist/Slot-DQ8z2zsy.js.map +0 -1
  269. package/dist/Spinner-Br4Rp9V2.js +0 -2
  270. package/dist/Spinner-Br4Rp9V2.js.map +0 -1
  271. package/dist/Spinner-Co3AjkQV.mjs +0 -68
  272. package/dist/Spinner-Co3AjkQV.mjs.map +0 -1
  273. package/dist/TextLink-5MvP0P8D.js +0 -2
  274. package/dist/TextLink-5MvP0P8D.js.map +0 -1
  275. package/dist/TextLink-Cc_LeVcx.mjs +0 -57
  276. package/dist/TextLink-Cc_LeVcx.mjs.map +0 -1
  277. package/dist/VisuallyHidden-CB6Nx76j.js +0 -2
  278. package/dist/VisuallyHidden-CB6Nx76j.js.map +0 -1
  279. package/dist/VisuallyHidden-DjlV0-CW.mjs +0 -28
  280. package/dist/VisuallyHidden-DjlV0-CW.mjs.map +0 -1
  281. package/dist/button/index.js.map +0 -1
  282. package/dist/button/index.mjs.map +0 -1
  283. package/dist/form-field/index.js.map +0 -1
  284. package/dist/form-field/index.mjs.map +0 -1
  285. package/dist/icon/index.js.map +0 -1
  286. package/dist/icon/index.mjs.map +0 -1
  287. package/dist/icon-button/index.js.map +0 -1
  288. package/dist/icon-button/index.mjs.map +0 -1
  289. package/dist/input/index.js.map +0 -1
  290. package/dist/input/index.mjs.map +0 -1
  291. package/dist/label/index.js.map +0 -1
  292. package/dist/label/index.mjs.map +0 -1
  293. package/dist/popover/index.js.map +0 -1
  294. package/dist/popover/index.mjs.map +0 -1
  295. package/dist/progress/index.js.map +0 -1
  296. package/dist/progress/index.mjs.map +0 -1
  297. package/dist/spinner/index.js.map +0 -1
  298. package/dist/spinner/index.mjs.map +0 -1
  299. package/dist/useRenderSlot-Bta2kdp4.mjs +0 -10
  300. package/dist/useRenderSlot-Bta2kdp4.mjs.map +0 -1
  301. package/dist/useRenderSlot-DATwjgpo.js +0 -2
  302. package/dist/useRenderSlot-DATwjgpo.js.map +0 -1
@@ -1,314 +1,282 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { Dialog as s } from "@base-ui/react/dialog";
3
- import { createContext as B, useContext as T, useRef as P } from "react";
4
- import { useMergeRefs as O } from "@spark-ui/hooks/use-merge-refs";
5
- import { useScrollOverflow as S } from "@spark-ui/hooks/use-scroll-overflow";
6
- import { cva as v, cx as i } from "class-variance-authority";
7
- import { u as z } from "../useRenderSlot-Bta2kdp4.mjs";
8
- import { Close as R } from "@spark-ui/icons/Close";
9
- import { I as F } from "../Icon-BO327oHU.mjs";
10
- import { I } from "../IconButton-DdB3Pq13.mjs";
11
- const C = B(null), H = ({
12
- children: e,
13
- withFade: a = !1
14
- }) => /* @__PURE__ */ t(
15
- C.Provider,
16
- {
17
- value: {
18
- withFade: a
19
- },
20
- children: e
21
- }
22
- ), $ = () => {
23
- const e = T(C);
24
- if (!e)
25
- throw Error("useDrawer must be used within a Drawer provider");
26
- return e;
27
- }, k = ({ onOpenChange: e, withFade: a = !1, ...r }) => {
28
- const o = e ? (l, n) => {
29
- e(l);
30
- } : void 0;
31
- return /* @__PURE__ */ t(H, { withFade: a, children: /* @__PURE__ */ t(s.Root, { "data-spark-component": "drawer", onOpenChange: o, ...r }) });
1
+ import { t as e } from "../icon-D05Uqh8_.mjs";
2
+ import { t } from "../icon-button-6p3O7NIm.mjs";
3
+ import { t as n } from "../useRenderSlot-DP4fYerF.mjs";
4
+ import { cva as r, cx as i } from "class-variance-authority";
5
+ import { createContext as a, useContext as o, useRef as s } from "react";
6
+ import { jsx as c } from "react/jsx-runtime";
7
+ import { useMergeRefs as l } from "@spark-ui/hooks/use-merge-refs";
8
+ import { useScrollOverflow as u } from "@spark-ui/hooks/use-scroll-overflow";
9
+ import { Close as d } from "@spark-ui/icons/Close";
10
+ import { Dialog as f } from "@base-ui/react/dialog";
11
+ //#region src/drawer/DrawerContext.tsx
12
+ var p = a(null), m = ({ children: e, withFade: t = !1 }) => /* @__PURE__ */ c(p.Provider, {
13
+ value: { withFade: t },
14
+ children: e
15
+ }), h = () => {
16
+ let e = o(p);
17
+ if (!e) throw Error("useDrawer must be used within a Drawer provider");
18
+ return e;
19
+ }, g = ({ onOpenChange: e, withFade: t = !1, ...n }) => {
20
+ let r = e ? (t, n) => {
21
+ e(t);
22
+ } : void 0;
23
+ return /* @__PURE__ */ c(m, {
24
+ withFade: t,
25
+ children: /* @__PURE__ */ c(f.Root, {
26
+ "data-spark-component": "drawer",
27
+ onOpenChange: r,
28
+ ...n
29
+ })
30
+ });
32
31
  };
33
- k.displayName = "Drawer.Root";
34
- const V = v(
35
- ["grow", "overflow-y-auto", "outline-hidden", "focus-visible:u-outline"],
36
- {
37
- variants: {
38
- inset: {
39
- true: "",
40
- false: "px-xl py-lg"
41
- }
42
- },
43
- defaultVariants: {
44
- inset: !1
45
- }
46
- }
47
- ), w = ({
48
- children: e,
49
- inset: a = !1,
50
- className: r,
51
- ref: o,
52
- ...l
53
- }) => {
54
- const n = P(null), m = O(o, n), { withFade: p } = $(), { overflow: c } = S(n);
55
- return /* @__PURE__ */ t(
56
- "div",
57
- {
58
- "data-spark-component": "drawer-body",
59
- ref: m,
60
- className: V({ inset: a, className: r }),
61
- style: {
62
- ...p && {
63
- maskImage: "linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
64
- maskSize: `100% calc(100% + ${c.top ? "0px" : "44px"} + ${c.bottom ? "0px" : "44px"})`,
65
- maskPosition: `0 ${c.top ? "0px" : "-44px"}`
66
- }
67
- },
68
- ...l,
69
- children: e
70
- }
71
- );
32
+ g.displayName = "Drawer.Root";
33
+ //#endregion
34
+ //#region src/drawer/DrawerBody.styles.ts
35
+ var _ = r([
36
+ "grow",
37
+ "overflow-y-auto",
38
+ "outline-hidden",
39
+ "focus-visible:u-outline"
40
+ ], {
41
+ variants: { inset: {
42
+ true: "",
43
+ false: "px-xl py-lg"
44
+ } },
45
+ defaultVariants: { inset: !1 }
46
+ }), v = ({ children: e, inset: t = !1, className: n, ref: r, ...i }) => {
47
+ let a = s(null), o = l(r, a), { withFade: d } = h(), { overflow: f } = u(a);
48
+ return /* @__PURE__ */ c("div", {
49
+ "data-spark-component": "drawer-body",
50
+ ref: o,
51
+ className: _({
52
+ inset: t,
53
+ className: n
54
+ }),
55
+ style: { ...d && {
56
+ maskImage: "linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
57
+ maskSize: `100% calc(100% + ${f.top ? "0px" : "44px"} + ${f.bottom ? "0px" : "44px"})`,
58
+ maskPosition: `0 ${f.top ? "0px" : "-44px"}`
59
+ } },
60
+ ...i,
61
+ children: e
62
+ });
72
63
  };
73
- w.displayName = "Drawer.Body";
74
- const d = ({ asChild: e = !1, ...a }) => {
75
- const r = z(e, "button");
76
- return /* @__PURE__ */ t(s.Close, { "data-spark-component": "drawer-close", render: r, ...a });
64
+ v.displayName = "Drawer.Body";
65
+ //#endregion
66
+ //#region src/drawer/DrawerClose.tsx
67
+ var y = ({ asChild: e = !1, ...t }) => {
68
+ let r = n(e, "button");
69
+ return /* @__PURE__ */ c(f.Close, {
70
+ "data-spark-component": "drawer-close",
71
+ render: r,
72
+ ...t
73
+ });
77
74
  };
78
- d.displayName = "Drawer.Close";
79
- const f = ({
80
- "aria-label": e,
81
- className: a,
82
- size: r = "md",
83
- intent: o = "neutral",
84
- design: l = "ghost",
85
- children: n = /* @__PURE__ */ t(R, {}),
86
- ref: m,
87
- ...p
88
- }) => /* @__PURE__ */ t(
89
- d,
90
- {
91
- "data-spark-component": "drawer-close-button",
92
- ref: m,
93
- className: i(["absolute", "top-sm", "right-xl"], a),
94
- asChild: !0,
95
- ...p,
96
- children: /* @__PURE__ */ t(I, { intent: o, size: r, design: l, "aria-label": e, children: /* @__PURE__ */ t(F, { children: n }) })
97
- }
98
- );
99
- f.displayName = "Drawer.CloseButton";
100
- const j = v(
101
- [
102
- "fixed z-modal flex flex-col bg-surface shadow-md",
103
- // Base UI uses data-open and data-closed for transitions
104
- "data-open:animation-duration-400 data-closed:animation-duration-200",
105
- // Nested dialog effect
106
- "data-nested-dialog-open:after:pointer-events-none",
107
- "after:bg-transparent",
108
- "after:transition-all",
109
- "after:duration-200",
110
- "data-nested-dialog-open:after:inset-0",
111
- "data-nested-dialog-open:after:absolute",
112
- "data-nested-dialog-open:after:rounded-[inherit]",
113
- "data-nested-dialog-open:after:bg-overlay/dim-3"
114
- ],
115
- {
116
- variants: {
117
- size: {
118
- sm: "",
119
- md: "",
120
- lg: "",
121
- fluid: "",
122
- fullscreen: "h-screen w-screen"
123
- },
124
- side: {
125
- right: [
126
- "inset-y-0 right-0",
127
- "data-open:animate-slide-in-right ",
128
- "data-closed:animate-slide-out-right"
129
- ],
130
- left: [
131
- "inset-y-0 left-0",
132
- "data-open:animate-slide-in-left",
133
- "data-closed:animate-slide-out-left"
134
- ],
135
- top: [
136
- "top-0 left-0",
137
- "w-screen",
138
- "data-open:animate-slide-in-top",
139
- "data-closed:animate-slide-out-top"
140
- ],
141
- bottom: [
142
- "bottom-0 left-0",
143
- "w-screen",
144
- "data-open:animate-slide-in-bottom",
145
- "data-closed:animate-slide-out-bottom"
146
- ]
147
- }
148
- },
149
- compoundVariants: [
150
- {
151
- side: ["right", "left"],
152
- size: "sm",
153
- class: ["w-sz-480", "max-w-full"]
154
- },
155
- {
156
- side: ["right", "left"],
157
- size: "md",
158
- class: ["w-sz-672", "max-w-full"]
159
- },
160
- {
161
- side: ["right", "left"],
162
- size: "lg",
163
- class: ["w-sz-864", "max-w-full"]
164
- },
165
- {
166
- side: ["left", "right"],
167
- size: "fluid",
168
- class: ["w-auto", "max-w-full"]
169
- },
170
- {
171
- side: ["top", "bottom"],
172
- size: "sm",
173
- class: ["h-sz-480", "max-h-full"]
174
- },
175
- {
176
- side: ["top", "bottom"],
177
- size: "md",
178
- class: ["h-sz-672", "max-h-full"]
179
- },
180
- {
181
- side: ["top", "bottom"],
182
- size: "lg",
183
- class: ["h-sz-864", "max-h-full"]
184
- },
185
- {
186
- side: ["top", "bottom"],
187
- size: "fluid",
188
- class: ["h-auto", "max-h-full"]
189
- }
190
- ],
191
- defaultVariants: {
192
- side: "right",
193
- size: "md"
194
- }
195
- }
196
- ), u = ({
197
- className: e,
198
- size: a = "md",
199
- side: r = "right",
200
- ref: o,
201
- ...l
202
- }) => /* @__PURE__ */ t(
203
- s.Popup,
204
- {
205
- ref: o,
206
- "data-spark-component": "drawer-content",
207
- role: "dialog",
208
- className: (n) => i(
209
- j({
210
- size: a,
211
- side: r,
212
- className: typeof e == "function" ? e(n) : e
213
- })
214
- ),
215
- ...l
216
- }
217
- );
218
- u.displayName = "Drawer.Content";
219
- const g = (e) => /* @__PURE__ */ t(s.Description, { "data-spark-component": "drawer-description", ...e });
220
- g.displayName = "Drawer.Description";
221
- const y = ({ className: e, ref: a, ...r }) => /* @__PURE__ */ t(
222
- "footer",
223
- {
224
- "data-spark-component": "drawer-footer",
225
- ref: a,
226
- className: i(["px-xl", "py-lg"], e),
227
- ...r
228
- }
229
- );
230
- y.displayName = "Drawer.Footer";
231
- const D = ({
232
- children: e,
233
- className: a,
234
- ref: r,
235
- ...o
236
- }) => /* @__PURE__ */ t(
237
- "header",
238
- {
239
- "data-spark-component": "drawer-header",
240
- ref: r,
241
- className: i(["px-xl", "py-lg"], a),
242
- ...o,
243
- children: e
244
- }
245
- );
246
- D.displayName = "Dialog.Header";
247
- const h = ({ className: e, ...a }) => /* @__PURE__ */ t(
248
- s.Backdrop,
249
- {
250
- "data-spark-component": "drawer-overlay",
251
- className: (r) => i(
252
- "z-overlay fixed top-0 left-0 h-screen w-screen",
253
- "bg-overlay/dim-1",
254
- // Base UI automatically adds data-[starting-style] and data-[ending-style] attributes
255
- "data-starting-style:animate-fade-in",
256
- "data-ending-style:animate-fade-out",
257
- typeof e == "function" ? e(r) : e
258
- ),
259
- ...a
260
- }
261
- );
262
- h.displayName = "Drawer.Overlay";
263
- const x = ({ className: e, ...a }) => /* @__PURE__ */ t(
264
- s.Portal,
265
- {
266
- "data-spark-component": "drawer-portal",
267
- className: i(e, "z-modal absolute"),
268
- ...a
269
- }
270
- );
271
- x.displayName = "Drawer.Portal";
272
- const b = ({ className: e, ...a }) => /* @__PURE__ */ t(
273
- s.Title,
274
- {
275
- "data-spark-component": "drawer-title",
276
- className: i("text-headline-2 text-on-surface", e),
277
- ...a
278
- }
279
- );
280
- b.displayName = "Drawer.Title";
281
- const N = ({ asChild: e = !1, ...a }) => {
282
- const r = z(e, "button");
283
- return /* @__PURE__ */ t(s.Trigger, { "data-spark-component": "drawer-trigger", render: r, ...a });
284
- };
285
- N.displayName = "Drawer.Trigger";
286
- const A = Object.assign(k, {
287
- Trigger: N,
288
- Portal: x,
289
- Overlay: h,
290
- Content: u,
291
- Header: D,
292
- Body: w,
293
- Footer: y,
294
- Close: d,
295
- CloseButton: f,
296
- Title: b,
297
- Description: g
75
+ y.displayName = "Drawer.Close";
76
+ //#endregion
77
+ //#region src/drawer/DrawerCloseButton.tsx
78
+ var b = ({ "aria-label": n, className: r, size: a = "md", intent: o = "neutral", design: s = "ghost", children: l = /* @__PURE__ */ c(d, {}), ref: u, ...f }) => /* @__PURE__ */ c(y, {
79
+ "data-spark-component": "drawer-close-button",
80
+ ref: u,
81
+ className: i([
82
+ "absolute",
83
+ "top-sm",
84
+ "right-xl"
85
+ ], r),
86
+ asChild: !0,
87
+ ...f,
88
+ children: /* @__PURE__ */ c(t, {
89
+ intent: o,
90
+ size: a,
91
+ design: s,
92
+ "aria-label": n,
93
+ children: /* @__PURE__ */ c(e, { children: l })
94
+ })
95
+ });
96
+ b.displayName = "Drawer.CloseButton";
97
+ //#endregion
98
+ //#region src/drawer/DrawerContent.styles.tsx
99
+ var x = r([
100
+ "fixed z-modal flex flex-col bg-surface shadow-md",
101
+ "data-open:animation-duration-400 data-closed:animation-duration-200",
102
+ "data-nested-dialog-open:after:pointer-events-none",
103
+ "after:bg-transparent",
104
+ "after:transition-all",
105
+ "after:duration-200",
106
+ "data-nested-dialog-open:after:inset-0",
107
+ "data-nested-dialog-open:after:absolute",
108
+ "data-nested-dialog-open:after:rounded-[inherit]",
109
+ "data-nested-dialog-open:after:bg-overlay/dim-3"
110
+ ], {
111
+ variants: {
112
+ size: {
113
+ sm: "",
114
+ md: "",
115
+ lg: "",
116
+ fluid: "",
117
+ fullscreen: "h-screen w-screen"
118
+ },
119
+ side: {
120
+ right: [
121
+ "inset-y-0 right-0",
122
+ "data-open:animate-slide-in-right ",
123
+ "data-closed:animate-slide-out-right"
124
+ ],
125
+ left: [
126
+ "inset-y-0 left-0",
127
+ "data-open:animate-slide-in-left",
128
+ "data-closed:animate-slide-out-left"
129
+ ],
130
+ top: [
131
+ "top-0 left-0",
132
+ "w-screen",
133
+ "data-open:animate-slide-in-top",
134
+ "data-closed:animate-slide-out-top"
135
+ ],
136
+ bottom: [
137
+ "bottom-0 left-0",
138
+ "w-screen",
139
+ "data-open:animate-slide-in-bottom",
140
+ "data-closed:animate-slide-out-bottom"
141
+ ]
142
+ }
143
+ },
144
+ compoundVariants: [
145
+ {
146
+ side: ["right", "left"],
147
+ size: "sm",
148
+ class: ["w-sz-480", "max-w-full"]
149
+ },
150
+ {
151
+ side: ["right", "left"],
152
+ size: "md",
153
+ class: ["w-sz-672", "max-w-full"]
154
+ },
155
+ {
156
+ side: ["right", "left"],
157
+ size: "lg",
158
+ class: ["w-sz-864", "max-w-full"]
159
+ },
160
+ {
161
+ side: ["left", "right"],
162
+ size: "fluid",
163
+ class: ["w-auto", "max-w-full"]
164
+ },
165
+ {
166
+ side: ["top", "bottom"],
167
+ size: "sm",
168
+ class: ["h-sz-480", "max-h-full"]
169
+ },
170
+ {
171
+ side: ["top", "bottom"],
172
+ size: "md",
173
+ class: ["h-sz-672", "max-h-full"]
174
+ },
175
+ {
176
+ side: ["top", "bottom"],
177
+ size: "lg",
178
+ class: ["h-sz-864", "max-h-full"]
179
+ },
180
+ {
181
+ side: ["top", "bottom"],
182
+ size: "fluid",
183
+ class: ["h-auto", "max-h-full"]
184
+ }
185
+ ],
186
+ defaultVariants: {
187
+ side: "right",
188
+ size: "md"
189
+ }
190
+ }), S = ({ className: e, size: t = "md", side: n = "right", ref: r, ...a }) => /* @__PURE__ */ c(f.Popup, {
191
+ ref: r,
192
+ "data-spark-component": "drawer-content",
193
+ role: "dialog",
194
+ className: (r) => i(x({
195
+ size: t,
196
+ side: n,
197
+ className: typeof e == "function" ? e(r) : e
198
+ })),
199
+ ...a
200
+ });
201
+ S.displayName = "Drawer.Content";
202
+ //#endregion
203
+ //#region src/drawer/DrawerDescription.tsx
204
+ var C = (e) => /* @__PURE__ */ c(f.Description, {
205
+ "data-spark-component": "drawer-description",
206
+ ...e
207
+ });
208
+ C.displayName = "Drawer.Description";
209
+ //#endregion
210
+ //#region src/drawer/DrawerFooter.tsx
211
+ var w = ({ className: e, ref: t, ...n }) => /* @__PURE__ */ c("footer", {
212
+ "data-spark-component": "drawer-footer",
213
+ ref: t,
214
+ className: i(["px-xl", "py-lg"], e),
215
+ ...n
216
+ });
217
+ w.displayName = "Drawer.Footer";
218
+ //#endregion
219
+ //#region src/drawer/DrawerHeader.tsx
220
+ var T = ({ children: e, className: t, ref: n, ...r }) => /* @__PURE__ */ c("header", {
221
+ "data-spark-component": "drawer-header",
222
+ ref: n,
223
+ className: i(["px-xl", "py-lg"], t),
224
+ ...r,
225
+ children: e
298
226
  });
299
- A.displayName = "Drawer";
300
- N.displayName = "Drawer.Trigger";
301
- x.displayName = "Drawer.Portal";
302
- h.displayName = "Drawer.Overlay";
303
- u.displayName = "Drawer.Content";
304
- D.displayName = "Drawer.Header";
305
- w.displayName = "Drawer.Body";
306
- y.displayName = "Drawer.Footer";
307
- d.displayName = "Drawer.Close";
308
- f.displayName = "Drawer.CloseButton";
309
- b.displayName = "Drawer.Title";
310
- g.displayName = "Drawer.Description";
311
- export {
312
- A as Drawer
227
+ T.displayName = "Dialog.Header";
228
+ //#endregion
229
+ //#region src/drawer/DrawerOverlay.tsx
230
+ var E = ({ className: e, ...t }) => /* @__PURE__ */ c(f.Backdrop, {
231
+ "data-spark-component": "drawer-overlay",
232
+ className: (t) => i("z-overlay fixed top-0 left-0 h-screen w-screen", "bg-overlay/dim-1", "data-starting-style:animate-fade-in", "data-ending-style:animate-fade-out", typeof e == "function" ? e(t) : e),
233
+ ...t
234
+ });
235
+ E.displayName = "Drawer.Overlay";
236
+ //#endregion
237
+ //#region src/drawer/DrawerPortal.tsx
238
+ var D = ({ className: e, ...t }) => /* @__PURE__ */ c(f.Portal, {
239
+ "data-spark-component": "drawer-portal",
240
+ className: i(e, "z-modal absolute"),
241
+ ...t
242
+ });
243
+ D.displayName = "Drawer.Portal";
244
+ //#endregion
245
+ //#region src/drawer/DrawerTitle.tsx
246
+ var O = ({ className: e, ...t }) => /* @__PURE__ */ c(f.Title, {
247
+ "data-spark-component": "drawer-title",
248
+ className: i("text-headline-2 text-on-surface", e),
249
+ ...t
250
+ });
251
+ O.displayName = "Drawer.Title";
252
+ //#endregion
253
+ //#region src/drawer/DrawerTrigger.tsx
254
+ var k = ({ asChild: e = !1, ...t }) => {
255
+ let r = n(e, "button");
256
+ return /* @__PURE__ */ c(f.Trigger, {
257
+ "data-spark-component": "drawer-trigger",
258
+ render: r,
259
+ ...t
260
+ });
313
261
  };
314
- //# sourceMappingURL=index.mjs.map
262
+ k.displayName = "Drawer.Trigger";
263
+ //#endregion
264
+ //#region src/drawer/index.ts
265
+ var A = Object.assign(g, {
266
+ Trigger: k,
267
+ Portal: D,
268
+ Overlay: E,
269
+ Content: S,
270
+ Header: T,
271
+ Body: v,
272
+ Footer: w,
273
+ Close: y,
274
+ CloseButton: b,
275
+ Title: O,
276
+ Description: C
277
+ });
278
+ A.displayName = "Drawer", k.displayName = "Drawer.Trigger", D.displayName = "Drawer.Portal", E.displayName = "Drawer.Overlay", S.displayName = "Drawer.Content", T.displayName = "Drawer.Header", v.displayName = "Drawer.Body", w.displayName = "Drawer.Footer", y.displayName = "Drawer.Close", b.displayName = "Drawer.CloseButton", O.displayName = "Drawer.Title", C.displayName = "Drawer.Description";
279
+ //#endregion
280
+ export { A as Drawer };
281
+
282
+ //# sourceMappingURL=index.mjs.map