@spark-ui/components 17.2.3 → 17.2.4

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,397 +1,345 @@
1
- import { jsx as o, jsxs as F } from "react/jsx-runtime";
2
- import { Tabs as z } from "@base-ui/react/tabs";
3
- import { createContext as O, useContext as A, useState as B, useRef as v, useEffect as w, forwardRef as j, useMemo as Q } from "react";
4
- import { cva as b, cx as U } from "class-variance-authority";
5
- import { S as X } from "../Slot-DLY1rJrG.mjs";
6
- import { ArrowVerticalLeft as Y } from "@spark-ui/icons/ArrowVerticalLeft";
7
- import { ArrowVerticalRight as Z } from "@spark-ui/icons/ArrowVerticalRight";
8
- import { B as I } from "../Button-1M9DcZl0.mjs";
9
- import { I as S } from "../Icon-BO327oHU.mjs";
10
- import { useMergeRefs as D } from "@spark-ui/hooks/use-merge-refs";
11
- import { MoreMenuHorizontal as _ } from "@spark-ui/icons/MoreMenuHorizontal";
12
- import { I as ee } from "../IconButton-DdB3Pq13.mjs";
13
- import { Popover as T } from "../popover/index.mjs";
14
- import { makeVariants as te } from "@spark-ui/internal-utils";
15
- const K = O({}), k = () => {
16
- const t = A(K);
17
- if (!t)
18
- throw Error("useTabsContext must be used within a TabsContext Provider");
19
- return t;
20
- }, re = b([
21
- "flex",
22
- "data-[orientation=horizontal]:flex-col",
23
- "data-[orientation=vertical]:flex-row",
24
- "max-w-full"
1
+ import { Slot as e } from "../slot/index.mjs";
2
+ import { t } from "../icon-D05Uqh8_.mjs";
3
+ import { t as n } from "../button-_YZ_4J42.mjs";
4
+ import { t as r } from "../icon-button-6p3O7NIm.mjs";
5
+ import { t as i } from "../popover-CxZAQmw6.mjs";
6
+ import { cva as a, cx as o } from "class-variance-authority";
7
+ import { createContext as s, forwardRef as c, useContext as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
8
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
+ import { makeVariants as g } from "@spark-ui/internal-utils";
10
+ import { useMergeRefs as _ } from "@spark-ui/hooks/use-merge-refs";
11
+ import { ArrowVerticalRight as v } from "@spark-ui/icons/ArrowVerticalRight";
12
+ import { ArrowVerticalLeft as y } from "@spark-ui/icons/ArrowVerticalLeft";
13
+ import { Tabs as b } from "@base-ui/react/tabs";
14
+ import { MoreMenuHorizontal as x } from "@spark-ui/icons/MoreMenuHorizontal";
15
+ //#region src/tabs/TabsContext.tsx
16
+ var S = s({}), C = () => {
17
+ let e = l(S);
18
+ if (!e) throw Error("useTabsContext must be used within a TabsContext Provider");
19
+ return e;
20
+ }, w = a([
21
+ "flex",
22
+ "data-[orientation=horizontal]:flex-col",
23
+ "data-[orientation=vertical]:flex-row",
24
+ "max-w-full"
25
25
  ]);
26
- function y(t) {
27
- return t ? ({ ...r }) => /* @__PURE__ */ o(X, { ...r }) : void 0;
26
+ //#endregion
27
+ //#region src/tabs/useRenderSlot.tsx
28
+ function T(t) {
29
+ return t ? ({ ...t }) => /* @__PURE__ */ m(e, { ...t }) : void 0;
28
30
  }
29
- const $ = ({
30
- intent: t = "support",
31
- size: r = "md",
32
- /**
33
- * Default Base UI Primitive values
34
- * see https://base-ui.com/react/components/tabs
35
- */
36
- asChild: l = !1,
37
- forceMount: a = !1,
38
- orientation: n = "horizontal",
39
- children: i,
40
- className: s,
41
- ref: c,
42
- ...e
43
- }) => {
44
- const h = y(l);
45
- return /* @__PURE__ */ o(
46
- K.Provider,
47
- {
48
- value: {
49
- intent: t,
50
- size: r,
51
- orientation: n,
52
- forceMount: a
53
- },
54
- children: /* @__PURE__ */ o(
55
- z.Root,
56
- {
57
- ref: c,
58
- orientation: n,
59
- className: re({ className: s }),
60
- "data-spark-component": "tabs",
61
- render: h,
62
- ...e,
63
- children: i
64
- }
65
- )
66
- }
67
- );
31
+ //#endregion
32
+ //#region src/tabs/Tabs.tsx
33
+ var E = ({ intent: e = "support", size: t = "md", asChild: n = !1, forceMount: r = !1, orientation: i = "horizontal", children: a, className: o, ref: s, ...c }) => {
34
+ let l = T(n);
35
+ return /* @__PURE__ */ m(S.Provider, {
36
+ value: {
37
+ intent: e,
38
+ size: t,
39
+ orientation: i,
40
+ forceMount: r
41
+ },
42
+ children: /* @__PURE__ */ m(b.Root, {
43
+ ref: s,
44
+ orientation: i,
45
+ className: w({ className: o }),
46
+ "data-spark-component": "tabs",
47
+ render: l,
48
+ ...c,
49
+ children: a
50
+ })
51
+ });
68
52
  };
69
- $.displayName = "Tabs";
70
- const oe = b(["w-full p-lg", "focus-visible:u-outline-inset"], {
71
- variants: {
72
- forceMount: {
73
- true: "data-[hidden]:hidden",
74
- false: ""
75
- }
76
- }
77
- }), R = ({
78
- /**
79
- * Default Base UI Primitive values
80
- * see https://base-ui.com/react/components/tabs
81
- */
82
- children: t,
83
- asChild: r = !1,
84
- className: l,
85
- ref: a,
86
- forceMount: n,
87
- ...i
88
- }) => {
89
- const { forceMount: s } = k(), c = y(r), e = s || n;
90
- return /* @__PURE__ */ o(
91
- z.Panel,
92
- {
93
- "data-spark-component": "tabs-content",
94
- ref: a,
95
- keepMounted: e,
96
- className: oe({ className: l, forceMount: e }),
97
- render: c,
98
- ...i,
99
- children: t
100
- }
101
- );
53
+ E.displayName = "Tabs";
54
+ //#endregion
55
+ //#region src/tabs/TabsContent.styles.ts
56
+ var D = a(["w-full p-lg", "focus-visible:u-outline-inset"], { variants: { forceMount: {
57
+ true: "data-[hidden]:hidden",
58
+ false: ""
59
+ } } }), O = ({ children: e, asChild: t = !1, className: n, ref: r, forceMount: i, ...a }) => {
60
+ let { forceMount: o } = C(), s = T(t), c = o || i;
61
+ return /* @__PURE__ */ m(b.Panel, {
62
+ "data-spark-component": "tabs-content",
63
+ ref: r,
64
+ keepMounted: c,
65
+ className: D({
66
+ className: n,
67
+ forceMount: c
68
+ }),
69
+ render: s,
70
+ ...a,
71
+ children: e
72
+ });
102
73
  };
103
- R.displayName = "Tabs.Content";
104
- const ne = b(["relative flex"]), ie = b([
105
- "flex w-full",
106
- "data-[orientation=horizontal]:flex-row",
107
- "data-[orientation=vertical]:flex-col",
108
- "overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden",
109
- "after:flex after:shrink after:grow after:border-outline",
110
- "data-[orientation=horizontal]:after:border-b-sm",
111
- "data-[orientation=vertical]:after:border-r-sm"
112
- ]), E = b([
113
- "h-auto! flex-none",
114
- "border-b-sm border-outline",
115
- "outline-hidden",
116
- "focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!"
117
- ]), se = (t, r) => {
118
- const [l, a] = B({ width: void 0, height: void 0 }), n = v(null), i = v(r);
119
- return w(() => {
120
- i.current = r;
121
- }, [r]), w(() => {
122
- const s = t && "current" in t ? t.current : t;
123
- if (!(!s || n.current))
124
- return n.current = new ResizeObserver(([c]) => {
125
- const { inlineSize: e, blockSize: h } = c?.borderBoxSize?.[0] ?? {};
126
- i.current?.(c), a({ width: e, height: h });
127
- }), n.current.observe(s), () => {
128
- n.current && n.current.unobserve(s);
129
- };
130
- }, [t, n, i]), l;
131
- }, W = ({
132
- /**
133
- * Default Base UI Primitive values
134
- * see https://base-ui.com/react/components/tabs
135
- */
136
- asChild: t = !1,
137
- loop: r = !1,
138
- children: l,
139
- className: a,
140
- ref: n,
141
- ...i
142
- }) => {
143
- const s = v(null), c = v(null), e = n || c, { orientation: h } = k(), C = y(t), { width: x } = se(s), [d, g] = B({
144
- prev: "hidden",
145
- next: "hidden"
146
- });
147
- w(() => {
148
- typeof e == "function" || !e.current || g(h !== "horizontal" ? { prev: "hidden", next: "hidden" } : {
149
- prev: e.current.scrollWidth > e.current.clientWidth ? "visible" : "hidden",
150
- next: e.current.scrollWidth > e.current.clientWidth ? "visible" : "hidden"
151
- });
152
- }, [h, e, x]), w(() => {
153
- if (typeof e == "function" || !e.current || d.prev === "hidden" || r)
154
- return;
155
- const f = (u) => {
156
- g({
157
- prev: u.scrollLeft > 0 ? "visible" : "disabled",
158
- next: u.scrollLeft + u.clientWidth < u.scrollWidth ? "visible" : "disabled"
159
- });
160
- }, p = e.current;
161
- return f(p), p.addEventListener(
162
- "scroll",
163
- ({ target: u }) => f(u)
164
- ), () => p.removeEventListener(
165
- "scroll",
166
- ({ target: u }) => f(u)
167
- );
168
- }, [e, d.prev, r]);
169
- const N = () => {
170
- if (typeof e == "function" || !e.current)
171
- return;
172
- const f = r && e.current.scrollLeft <= 0;
173
- e.current.scrollTo({
174
- left: f ? e.current.scrollLeft + e.current.scrollWidth - e.current.clientWidth : e.current.scrollLeft - e.current.clientWidth,
175
- behavior: "smooth"
176
- });
177
- }, P = () => {
178
- if (typeof e == "function" || !e.current)
179
- return;
180
- const f = r && e.current.scrollLeft + e.current.clientWidth >= e.current.scrollWidth;
181
- e.current.scrollTo({
182
- left: f ? 0 : e.current.scrollLeft + e.current.clientWidth,
183
- behavior: "smooth"
184
- });
185
- };
186
- return /* @__PURE__ */ F("div", { className: ne({ className: a }), ref: s, children: [
187
- d.prev !== "hidden" && /* @__PURE__ */ o(
188
- I,
189
- {
190
- shape: "square",
191
- intent: "surface",
192
- size: "sm",
193
- className: E(),
194
- onClick: N,
195
- disabled: d.prev === "disabled",
196
- "aria-label": "Scroll left",
197
- children: /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(Y, {}) })
198
- }
199
- ),
200
- /* @__PURE__ */ o(
201
- z.List,
202
- {
203
- "data-spark-component": "tabs-list",
204
- ref: e,
205
- className: ie(),
206
- render: C,
207
- loopFocus: r,
208
- activateOnFocus: !0,
209
- ...i,
210
- children: l
211
- }
212
- ),
213
- d.next !== "hidden" && /* @__PURE__ */ o(
214
- I,
215
- {
216
- shape: "square",
217
- intent: "surface",
218
- size: "sm",
219
- className: E(),
220
- onClick: P,
221
- disabled: d.next === "disabled",
222
- "aria-label": "Scroll right",
223
- children: /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(Z, {}) })
224
- }
225
- )
226
- ] });
74
+ O.displayName = "Tabs.Content";
75
+ //#endregion
76
+ //#region src/tabs/TabsList.styles.ts
77
+ var k = a(["relative flex"]), A = a([
78
+ "flex w-full",
79
+ "data-[orientation=horizontal]:flex-row",
80
+ "data-[orientation=vertical]:flex-col",
81
+ "overflow-y-hidden u-no-scrollbar data-[orientation=vertical]:overflow-x-hidden",
82
+ "after:flex after:shrink after:grow after:border-outline",
83
+ "data-[orientation=horizontal]:after:border-b-sm",
84
+ "data-[orientation=vertical]:after:border-r-sm"
85
+ ]), j = a([
86
+ "h-auto! flex-none",
87
+ "border-b-sm border-outline",
88
+ "outline-hidden",
89
+ "focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!"
90
+ ]), M = (e, t) => {
91
+ let [n, r] = p({
92
+ width: void 0,
93
+ height: void 0
94
+ }), i = f(null), a = f(t);
95
+ return u(() => {
96
+ a.current = t;
97
+ }, [t]), u(() => {
98
+ let t = e && "current" in e ? e.current : e;
99
+ if (!(!t || i.current)) return i.current = new ResizeObserver(([e]) => {
100
+ let { inlineSize: t, blockSize: n } = e?.borderBoxSize?.[0] ?? {};
101
+ a.current?.(e), r({
102
+ width: t,
103
+ height: n
104
+ });
105
+ }), i.current.observe(t), () => {
106
+ i.current && i.current.unobserve(t);
107
+ };
108
+ }, [
109
+ e,
110
+ i,
111
+ a
112
+ ]), n;
113
+ }, N = ({ asChild: e = !1, loop: r = !1, children: i, className: a, ref: o, ...s }) => {
114
+ let c = f(null), l = f(null), d = o || l, { orientation: g } = C(), _ = T(e), { width: x } = M(c), [S, w] = p({
115
+ prev: "hidden",
116
+ next: "hidden"
117
+ });
118
+ u(() => {
119
+ typeof d == "function" || !d.current || w(g === "horizontal" ? {
120
+ prev: d.current.scrollWidth > d.current.clientWidth ? "visible" : "hidden",
121
+ next: d.current.scrollWidth > d.current.clientWidth ? "visible" : "hidden"
122
+ } : {
123
+ prev: "hidden",
124
+ next: "hidden"
125
+ });
126
+ }, [
127
+ g,
128
+ d,
129
+ x
130
+ ]), u(() => {
131
+ if (typeof d == "function" || !d.current || S.prev === "hidden" || r) return;
132
+ let e = (e) => {
133
+ w({
134
+ prev: e.scrollLeft > 0 ? "visible" : "disabled",
135
+ next: e.scrollLeft + e.clientWidth < e.scrollWidth ? "visible" : "disabled"
136
+ });
137
+ }, t = d.current;
138
+ return e(t), t.addEventListener("scroll", ({ target: t }) => e(t)), () => t.removeEventListener("scroll", ({ target: t }) => e(t));
139
+ }, [
140
+ d,
141
+ S.prev,
142
+ r
143
+ ]);
144
+ let E = () => {
145
+ if (typeof d == "function" || !d.current) return;
146
+ let e = r && d.current.scrollLeft <= 0;
147
+ d.current.scrollTo({
148
+ left: e ? d.current.scrollLeft + d.current.scrollWidth - d.current.clientWidth : d.current.scrollLeft - d.current.clientWidth,
149
+ behavior: "smooth"
150
+ });
151
+ }, D = () => {
152
+ if (typeof d == "function" || !d.current) return;
153
+ let e = r && d.current.scrollLeft + d.current.clientWidth >= d.current.scrollWidth;
154
+ d.current.scrollTo({
155
+ left: e ? 0 : d.current.scrollLeft + d.current.clientWidth,
156
+ behavior: "smooth"
157
+ });
158
+ };
159
+ return /* @__PURE__ */ h("div", {
160
+ className: k({ className: a }),
161
+ ref: c,
162
+ children: [
163
+ S.prev !== "hidden" && /* @__PURE__ */ m(n, {
164
+ shape: "square",
165
+ intent: "surface",
166
+ size: "sm",
167
+ className: j(),
168
+ onClick: E,
169
+ disabled: S.prev === "disabled",
170
+ "aria-label": "Scroll left",
171
+ children: /* @__PURE__ */ m(t, { children: /* @__PURE__ */ m(y, {}) })
172
+ }),
173
+ /* @__PURE__ */ m(b.List, {
174
+ "data-spark-component": "tabs-list",
175
+ ref: d,
176
+ className: A(),
177
+ render: _,
178
+ loopFocus: r,
179
+ activateOnFocus: !0,
180
+ ...s,
181
+ children: i
182
+ }),
183
+ S.next !== "hidden" && /* @__PURE__ */ m(n, {
184
+ shape: "square",
185
+ intent: "surface",
186
+ size: "sm",
187
+ className: j(),
188
+ onClick: D,
189
+ disabled: S.next === "disabled",
190
+ "aria-label": "Scroll right",
191
+ children: /* @__PURE__ */ m(t, { children: /* @__PURE__ */ m(v, {}) })
192
+ })
193
+ ]
194
+ });
227
195
  };
228
- W.displayName = "Tabs.List";
229
- const L = O(void 0), q = () => {
230
- const t = A(L);
231
- if (!t)
232
- throw new Error("TabsPopover components must be used within TabsPopover");
233
- return t;
234
- }, H = j(
235
- ({ "aria-label": t, children: r, ...l }, a) => {
236
- const { popoverTriggerRef: n } = q(), i = D(a, n);
237
- return /* @__PURE__ */ o(T.Trigger, { asChild: !0, ...l, children: /* @__PURE__ */ o(
238
- ee,
239
- {
240
- ref: i,
241
- size: "sm",
242
- intent: "surfaceInverse",
243
- design: "ghost",
244
- "aria-label": t,
245
- tabIndex: -1,
246
- children: /* @__PURE__ */ o(S, { children: r || /* @__PURE__ */ o(_, {}) })
247
- }
248
- ) });
249
- }
250
- );
251
- H.displayName = "Popover.Trigger";
252
- const G = j(
253
- ({ side: t, align: r = "start", className: l, ...a }, n) => {
254
- const { popoverSide: i } = q(), s = U("gap-sm flex flex-col", l);
255
- return /* @__PURE__ */ o(
256
- T.Content,
257
- {
258
- ref: n,
259
- ...a,
260
- side: t ?? i,
261
- align: r,
262
- className: s
263
- }
264
- );
265
- }
266
- );
267
- G.displayName = "Popover.Content";
268
- const J = ({ popoverSide: t, popoverTriggerRef: r, children: l }) => {
269
- const a = Q(
270
- () => ({ popoverSide: t, popoverTriggerRef: r }),
271
- [t, r]
272
- ), i = Object.assign(((s) => /* @__PURE__ */ o(L.Provider, { value: a, children: /* @__PURE__ */ o(T, { ...s, children: s.children }) })), T, {
273
- Content: G,
274
- Trigger: H
275
- });
276
- return /* @__PURE__ */ o(L.Provider, { value: a, children: l(i) });
196
+ N.displayName = "Tabs.List";
197
+ //#endregion
198
+ //#region src/tabs/TabsPopoverAbstraction.tsx
199
+ var P = s(void 0), F = () => {
200
+ let e = l(P);
201
+ if (!e) throw Error("TabsPopover components must be used within TabsPopover");
202
+ return e;
203
+ }, I = c(({ "aria-label": e, children: n, ...a }, o) => {
204
+ let { popoverTriggerRef: s } = F(), c = _(o, s);
205
+ return /* @__PURE__ */ m(i.Trigger, {
206
+ asChild: !0,
207
+ ...a,
208
+ children: /* @__PURE__ */ m(r, {
209
+ ref: c,
210
+ size: "sm",
211
+ intent: "surfaceInverse",
212
+ design: "ghost",
213
+ "aria-label": e,
214
+ tabIndex: -1,
215
+ children: /* @__PURE__ */ m(t, { children: n || /* @__PURE__ */ m(x, {}) })
216
+ })
217
+ });
218
+ });
219
+ I.displayName = "Popover.Trigger";
220
+ var L = c(({ side: e, align: t = "start", className: n, ...r }, a) => {
221
+ let { popoverSide: s } = F(), c = o("gap-sm flex flex-col", n);
222
+ return /* @__PURE__ */ m(i.Content, {
223
+ ref: a,
224
+ ...r,
225
+ side: e ?? s,
226
+ align: t,
227
+ className: c
228
+ });
229
+ });
230
+ L.displayName = "Popover.Content";
231
+ var R = ({ popoverSide: e, popoverTriggerRef: t, children: n }) => {
232
+ let r = d(() => ({
233
+ popoverSide: e,
234
+ popoverTriggerRef: t
235
+ }), [e, t]), a = Object.assign(((e) => /* @__PURE__ */ m(P.Provider, {
236
+ value: r,
237
+ children: /* @__PURE__ */ m(i, {
238
+ ...e,
239
+ children: e.children
240
+ })
241
+ })), i, {
242
+ Content: L,
243
+ Trigger: I
244
+ });
245
+ return /* @__PURE__ */ m(P.Provider, {
246
+ value: r,
247
+ children: n(a)
248
+ });
277
249
  };
278
- J.displayName = "Popover";
279
- const ae = b(
280
- [
281
- "px-md",
282
- "relative flex flex-none items-center",
283
- "border-outline",
284
- "hover:not-disabled:bg-surface-hovered",
285
- "after:absolute",
286
- "data-[active]:font-bold",
287
- "not-data-[active]:not-disabled:cursor-pointer",
288
- "data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2",
289
- "data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2",
290
- "focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset",
291
- "disabled:cursor-not-allowed disabled:opacity-dim-3",
292
- "gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md",
293
- "[&>svg:last-child:first-child]:mx-auto"
294
- ],
295
- {
296
- variants: {
297
- /**
298
- * Change the color scheme of the tabs
299
- * @default support
300
- */
301
- intent: te({
302
- main: ["data-[active]:text-main data-[active]:after:bg-main"],
303
- support: ["data-[active]:text-support data-[active]:after:bg-support"]
304
- }),
305
- /**
306
- * Change the size of the tabs
307
- * @default md
308
- */
309
- size: {
310
- xs: ["h-sz-32 min-w-sz-32 text-caption"],
311
- sm: ["h-sz-36 min-w-sz-36 text-body-2"],
312
- md: ["h-sz-40 min-w-sz-40 text-body-1"]
313
- },
314
- hasMenu: {
315
- true: "pr-3xl"
316
- },
317
- orientation: {
318
- horizontal: "",
319
- vertical: ""
320
- }
321
- },
322
- compoundVariants: [
323
- {
324
- hasMenu: !0,
325
- orientation: "vertical",
326
- class: "w-full"
327
- }
328
- ],
329
- defaultVariants: {
330
- intent: "support",
331
- size: "md",
332
- hasMenu: !1,
333
- orientation: "horizontal"
334
- }
335
- }
336
- ), M = ({
337
- /**
338
- * Default Base UI Primitive values
339
- * see https://base-ui.com/react/components/tabs
340
- */
341
- asChild: t = !1,
342
- value: r,
343
- disabled: l = !1,
344
- children: a,
345
- className: n,
346
- ref: i,
347
- onKeyDown: s,
348
- renderMenu: c,
349
- ...e
350
- }) => {
351
- const { intent: h, size: C, orientation: x } = k(), d = v(null), g = v(null), N = y(t), P = D(i, g), f = (m) => {
352
- m.key === "F10" && m.shiftKey && c && d.current && (m.preventDefault(), d.current.click()), s?.(m);
353
- }, p = !!c, u = x === "vertical" ? "right" : "bottom", V = /* @__PURE__ */ o(
354
- z.Tab,
355
- {
356
- "data-spark-component": "tabs-trigger",
357
- ref: P,
358
- className: ae({
359
- intent: h,
360
- size: C,
361
- hasMenu: p,
362
- orientation: x ?? "horizontal",
363
- className: n
364
- }),
365
- render: N,
366
- disabled: l,
367
- value: r,
368
- onFocus: ({ target: m }) => m.scrollIntoView({
369
- behavior: "smooth",
370
- block: "nearest",
371
- inline: "nearest"
372
- }),
373
- onKeyDown: f,
374
- "aria-haspopup": p ? "true" : void 0,
375
- ...e,
376
- children: a
377
- }
378
- );
379
- return p ? /* @__PURE__ */ F("div", { className: x === "vertical" ? "relative w-full" : "relative", children: [
380
- V,
381
- /* @__PURE__ */ o("div", { className: "right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2", children: /* @__PURE__ */ o(J, { popoverSide: u, popoverTriggerRef: d, children: (m) => c?.({ Popover: m }) }) })
382
- ] }) : V;
250
+ R.displayName = "Popover";
251
+ //#endregion
252
+ //#region src/tabs/TabsTrigger.styles.ts
253
+ var z = a([
254
+ "px-md",
255
+ "relative flex flex-none items-center",
256
+ "border-outline",
257
+ "hover:not-disabled:bg-surface-hovered",
258
+ "after:absolute",
259
+ "data-[active]:font-bold",
260
+ "not-data-[active]:not-disabled:cursor-pointer",
261
+ "data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2",
262
+ "data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2",
263
+ "focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset",
264
+ "disabled:cursor-not-allowed disabled:opacity-dim-3",
265
+ "gap-md [&>*:first-child]:ml-md [&>*:last-child]:mr-md",
266
+ "[&>svg:last-child:first-child]:mx-auto"
267
+ ], {
268
+ variants: {
269
+ intent: g({
270
+ main: ["data-[active]:text-main data-[active]:after:bg-main"],
271
+ support: ["data-[active]:text-support data-[active]:after:bg-support"]
272
+ }),
273
+ size: {
274
+ xs: ["h-sz-32 min-w-sz-32 text-caption"],
275
+ sm: ["h-sz-36 min-w-sz-36 text-body-2"],
276
+ md: ["h-sz-40 min-w-sz-40 text-body-1"]
277
+ },
278
+ hasMenu: { true: "pr-3xl" },
279
+ orientation: {
280
+ horizontal: "",
281
+ vertical: ""
282
+ }
283
+ },
284
+ compoundVariants: [{
285
+ hasMenu: !0,
286
+ orientation: "vertical",
287
+ class: "w-full"
288
+ }],
289
+ defaultVariants: {
290
+ intent: "support",
291
+ size: "md",
292
+ hasMenu: !1,
293
+ orientation: "horizontal"
294
+ }
295
+ }), B = ({ asChild: e = !1, value: t, disabled: n = !1, children: r, className: i, ref: a, onKeyDown: o, renderMenu: s, ...c }) => {
296
+ let { intent: l, size: u, orientation: d } = C(), p = f(null), g = f(null), v = T(e), y = _(a, g), x = (e) => {
297
+ e.key === "F10" && e.shiftKey && s && p.current && (e.preventDefault(), p.current.click()), o?.(e);
298
+ }, S = !!s, w = d === "vertical" ? "right" : "bottom", E = /* @__PURE__ */ m(b.Tab, {
299
+ "data-spark-component": "tabs-trigger",
300
+ ref: y,
301
+ className: z({
302
+ intent: l,
303
+ size: u,
304
+ hasMenu: S,
305
+ orientation: d ?? "horizontal",
306
+ className: i
307
+ }),
308
+ render: v,
309
+ disabled: n,
310
+ value: t,
311
+ onFocus: ({ target: e }) => e.scrollIntoView({
312
+ behavior: "smooth",
313
+ block: "nearest",
314
+ inline: "nearest"
315
+ }),
316
+ onKeyDown: x,
317
+ "aria-haspopup": S ? "true" : void 0,
318
+ ...c,
319
+ children: r
320
+ });
321
+ return S ? /* @__PURE__ */ h("div", {
322
+ className: d === "vertical" ? "relative w-full" : "relative",
323
+ children: [E, /* @__PURE__ */ m("div", {
324
+ className: "right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2",
325
+ children: /* @__PURE__ */ m(R, {
326
+ popoverSide: w,
327
+ popoverTriggerRef: p,
328
+ children: (e) => s?.({ Popover: e })
329
+ })
330
+ })]
331
+ }) : E;
383
332
  };
384
- M.displayName = "Tabs.Trigger";
385
- const le = Object.assign($, {
386
- List: W,
387
- Trigger: M,
388
- Content: R
333
+ B.displayName = "Tabs.Trigger";
334
+ //#endregion
335
+ //#region src/tabs/index.ts
336
+ var V = Object.assign(E, {
337
+ List: N,
338
+ Trigger: B,
339
+ Content: O
389
340
  });
390
- le.displayName = "Tabs";
391
- W.displayName = "Tabs.List";
392
- M.displayName = "Tabs.Trigger";
393
- R.displayName = "Tabs.Content";
394
- export {
395
- le as Tabs
396
- };
397
- //# sourceMappingURL=index.mjs.map
341
+ V.displayName = "Tabs", N.displayName = "Tabs.List", B.displayName = "Tabs.Trigger", O.displayName = "Tabs.Content";
342
+ //#endregion
343
+ export { V as Tabs };
344
+
345
+ //# sourceMappingURL=index.mjs.map