@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,283 +1,226 @@
1
- import { jsxs as V, jsx as c } from "react/jsx-runtime";
2
- import { useScrollOverflow as D } from "@spark-ui/hooks/use-scroll-overflow";
3
- import { cx as u } from "class-variance-authority";
4
- import { createContext as $, useRef as b, useCallback as j, useEffect as S, useLayoutEffect as K, useState as H, useContext as m, Children as W, isValidElement as q, cloneElement as G } from "react";
5
- import { useSnapCarousel as J } from "react-snap-carousel";
6
- import { S as M } from "../Slot-DLY1rJrG.mjs";
7
- import { ArrowVerticalRight as Q } from "@spark-ui/icons/ArrowVerticalRight";
8
- import { I as P } from "../Icon-BO327oHU.mjs";
9
- import { I as L } from "../IconButton-DdB3Pq13.mjs";
10
- import { ArrowVerticalLeft as U } from "@spark-ui/icons/ArrowVerticalLeft";
11
- import { B as X } from "../Button-1M9DcZl0.mjs";
12
- const d = $(
13
- null
14
- ), N = ({
15
- snapType: s = "none",
16
- snapStop: l = "normal",
17
- scrollBehavior: e = "smooth",
18
- loop: i = !1,
19
- gap: o = 16,
20
- withFade: n = !1,
21
- scrollPadding: r = 0,
22
- children: a,
23
- className: p,
24
- ...g
25
- }) => {
26
- const t = b(null), f = b(null), h = J(), { overflow: F, refresh: y } = D(t, {
27
- precisionTreshold: 1
28
- }), { activePageIndex: E, pages: T, refresh: x } = h, v = T[E], O = v ? [v[0] + 1, v[v.length - 1] + 1] : [0, 0], w = j(() => {
29
- x && t.current && setTimeout(() => {
30
- x();
31
- }, 0);
32
- }, [x]);
33
- S(() => {
34
- w();
35
- }, [a, w]), K(() => {
36
- t.current && requestAnimationFrame(() => {
37
- y();
38
- });
39
- }, [a, y]);
40
- const z = {
41
- ...h,
42
- snapType: s,
43
- snapStop: l,
44
- skipKeyboardNavigation: () => {
45
- f.current?.focus();
46
- },
47
- scrollBehavior: e,
48
- visibleItemsRange: O,
49
- loop: i,
50
- gap: o,
51
- withFade: n,
52
- scrollPadding: r,
53
- scrollAreaRef: t,
54
- overflow: F
55
- };
56
- return /* @__PURE__ */ V(d.Provider, { value: z, children: [
57
- /* @__PURE__ */ c(
58
- "div",
59
- {
60
- "data-spark-component": "scrolling-list",
61
- className: u(
62
- "gap-lg group/scrolling-list relative flex flex-col default:w-full",
63
- p
64
- ),
65
- ...g,
66
- children: a
67
- }
68
- ),
69
- /* @__PURE__ */ c("span", { ref: f, className: "size-0 overflow-hidden", tabIndex: -1 })
70
- ] });
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 { cx as i } from "class-variance-authority";
6
+ import { Children as a, cloneElement as o, createContext as s, isValidElement as c, useCallback as l, useContext as u, useEffect as d, useLayoutEffect as f, useRef as p, useState as m } from "react";
7
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
8
+ import { useScrollOverflow as _ } from "@spark-ui/hooks/use-scroll-overflow";
9
+ import { ArrowVerticalRight as v } from "@spark-ui/icons/ArrowVerticalRight";
10
+ import { ArrowVerticalLeft as y } from "@spark-ui/icons/ArrowVerticalLeft";
11
+ import { useSnapCarousel as b } from "react-snap-carousel";
12
+ //#region src/scrolling-list/ScrollingList.tsx
13
+ var x = s(null), S = ({ snapType: e = "none", snapStop: t = "normal", scrollBehavior: n = "smooth", loop: r = !1, gap: a = 16, withFade: o = !1, scrollPadding: s = 0, children: c, className: u, ...m }) => {
14
+ let v = p(null), y = p(null), S = b(), { overflow: C, refresh: w } = _(v, { precisionTreshold: 1 }), { activePageIndex: T, pages: E, refresh: D } = S, O = E[T], k = O ? [O[0] + 1, O[O.length - 1] + 1] : [0, 0], A = l(() => {
15
+ D && v.current && setTimeout(() => {
16
+ D();
17
+ }, 0);
18
+ }, [D]);
19
+ d(() => {
20
+ A();
21
+ }, [c, A]), f(() => {
22
+ v.current && requestAnimationFrame(() => {
23
+ w();
24
+ });
25
+ }, [c, w]);
26
+ let j = () => {
27
+ y.current?.focus();
28
+ }, M = {
29
+ ...S,
30
+ snapType: e,
31
+ snapStop: t,
32
+ skipKeyboardNavigation: j,
33
+ scrollBehavior: n,
34
+ visibleItemsRange: k,
35
+ loop: r,
36
+ gap: a,
37
+ withFade: o,
38
+ scrollPadding: s,
39
+ scrollAreaRef: v,
40
+ overflow: C
41
+ };
42
+ return /* @__PURE__ */ g(x.Provider, {
43
+ value: M,
44
+ children: [/* @__PURE__ */ h("div", {
45
+ "data-spark-component": "scrolling-list",
46
+ className: i("gap-lg group/scrolling-list relative flex flex-col default:w-full", u),
47
+ ...m,
48
+ children: c
49
+ }), /* @__PURE__ */ h("span", {
50
+ ref: y,
51
+ className: "size-0 overflow-hidden",
52
+ tabIndex: -1
53
+ })]
54
+ });
71
55
  };
72
- N.displayName = "ScrollingList";
73
- const I = ({
74
- children: s,
75
- visibility: l = "always",
76
- className: e,
77
- ...i
78
- }) => /* @__PURE__ */ c(
79
- "div",
80
- {
81
- "data-spark-component": "scrolling-list-controls",
82
- className: u(
83
- "default:px-md pointer-events-none absolute inset-0 flex flex-row items-center justify-between overflow-hidden",
84
- e
85
- ),
86
- style: {
87
- "--scrolling-list-controls-opacity": l === "hover" ? "0" : "1"
88
- },
89
- "data-orientation": "horizontal",
90
- ...i,
91
- children: s
92
- }
93
- );
94
- I.displayName = "ScrollingList.Controls";
95
- function Y(s, l) {
96
- const [e, i] = H(!1);
97
- return S(() => {
98
- const o = (a) => {
99
- i(!0);
100
- const p = a.target, g = l.current;
101
- if (p && g) {
102
- const t = p.getBoundingClientRect(), f = g.getBoundingClientRect();
103
- t.left >= f.left && t.right <= f.right && t.top >= f.top && t.bottom <= f.bottom || p.scrollIntoView({ behavior: "smooth", inline: "center", block: "nearest" });
104
- }
105
- }, n = (a) => {
106
- s.current && !s.current.contains(a.relatedTarget) && i(!1);
107
- }, r = s.current;
108
- return r && (r.addEventListener("focusin", o), r.addEventListener("focusout", n)), () => {
109
- r && (r.removeEventListener("focusin", o), r.removeEventListener("focusout", n));
110
- };
111
- }, [s, l]), e;
56
+ S.displayName = "ScrollingList";
57
+ //#endregion
58
+ //#region src/scrolling-list/ScrollingListControls.tsx
59
+ var C = ({ children: e, visibility: t = "always", className: n, ...r }) => /* @__PURE__ */ h("div", {
60
+ "data-spark-component": "scrolling-list-controls",
61
+ className: i("default:px-md pointer-events-none absolute inset-0 flex flex-row items-center justify-between overflow-hidden", n),
62
+ style: { "--scrolling-list-controls-opacity": t === "hover" ? "0" : "1" },
63
+ "data-orientation": "horizontal",
64
+ ...r,
65
+ children: e
66
+ });
67
+ C.displayName = "ScrollingList.Controls";
68
+ //#endregion
69
+ //#region src/scrolling-list/useFocusWithinScroll.tsx
70
+ function w(e, t) {
71
+ let [n, r] = m(!1);
72
+ return d(() => {
73
+ let n = (e) => {
74
+ r(!0);
75
+ let n = e.target, i = t.current;
76
+ if (n && i) {
77
+ let e = n.getBoundingClientRect(), t = i.getBoundingClientRect();
78
+ e.left >= t.left && e.right <= t.right && e.top >= t.top && e.bottom <= t.bottom || n.scrollIntoView({
79
+ behavior: "smooth",
80
+ inline: "center",
81
+ block: "nearest"
82
+ });
83
+ }
84
+ }, i = (t) => {
85
+ e.current && !e.current.contains(t.relatedTarget) && r(!1);
86
+ }, a = e.current;
87
+ return a && (a.addEventListener("focusin", n), a.addEventListener("focusout", i)), () => {
88
+ a && (a.removeEventListener("focusin", n), a.removeEventListener("focusout", i));
89
+ };
90
+ }, [e, t]), n;
112
91
  }
113
- const k = ({
114
- asChild: s = !1,
115
- children: l,
116
- index: e = 0,
117
- className: i = "",
118
- ...o
119
- }) => {
120
- const n = m(d), r = b(null), a = n.snapPointIndexes.has(e);
121
- return Y(r, n.scrollAreaRef), /* @__PURE__ */ c(
122
- s ? M : "div",
123
- {
124
- "data-spark-component": "scrolling-list-item",
125
- role: "listitem",
126
- ref: r,
127
- className: u(
128
- "default:w-auto default:shrink-0",
129
- {
130
- "snap-start": a,
131
- "snap-normal": a && n.snapStop === "normal",
132
- "snap-always": a && n.snapStop === "always"
133
- },
134
- i
135
- ),
136
- ...o,
137
- children: l
138
- }
139
- );
92
+ //#endregion
93
+ //#region src/scrolling-list/ScrollingListItem.tsx
94
+ var T = ({ asChild: t = !1, children: n, index: r = 0, className: a = "", ...o }) => {
95
+ let s = u(x), c = p(null), l = s.snapPointIndexes.has(r);
96
+ return w(c, s.scrollAreaRef), /* @__PURE__ */ h(t ? e : "div", {
97
+ "data-spark-component": "scrolling-list-item",
98
+ role: "listitem",
99
+ ref: c,
100
+ className: i("default:w-auto default:shrink-0", {
101
+ "snap-start": l,
102
+ "snap-normal": l && s.snapStop === "normal",
103
+ "snap-always": l && s.snapStop === "always"
104
+ }, a),
105
+ ...o,
106
+ children: n
107
+ });
140
108
  };
141
- k.displayName = "ScrollingList.Item";
142
- function Z(...s) {
143
- return (l) => {
144
- s.forEach((e) => {
145
- typeof e == "function" ? e(l) : e && typeof e == "object" && "current" in e && (e.current = l);
146
- });
147
- };
109
+ T.displayName = "ScrollingList.Item";
110
+ //#endregion
111
+ //#region src/scrolling-list/ScrollingListItems.tsx
112
+ function E(...e) {
113
+ return (t) => {
114
+ e.forEach((e) => {
115
+ typeof e == "function" ? e(t) : e && typeof e == "object" && "current" in e && (e.current = t);
116
+ });
117
+ };
148
118
  }
149
- const B = ({ children: s, ref: l, className: e = "", ...i }) => {
150
- const o = m(d), n = {
151
- mandatory: "x mandatory",
152
- proximity: "x proximity",
153
- none: "none"
154
- }, r = (t) => {
155
- !o.loop && !o.hasPrevPage || (t.preventDefault(), o.goTo(o.hasPrevPage ? o.activePageIndex - 1 : o.pages.length - 1, {
156
- behavior: o.scrollBehavior
157
- }));
158
- }, a = (t) => {
159
- !o.loop && !o.hasNextPage || (t.preventDefault(), o.goTo(o.hasNextPage ? o.activePageIndex + 1 : 0, { behavior: o.scrollBehavior }));
160
- }, p = (t) => {
161
- t.key === "ArrowLeft" && r(t), t.key === "ArrowRight" && a(t);
162
- }, g = {
163
- scrollSnapType: n[o.snapType],
164
- scrollPaddingInline: "var(--scrolling-list-px)",
165
- "--scrolling-list-px": `${o.scrollPadding}px`,
166
- "--scrolling-list-gap": `${o.gap}px`,
167
- ...o.withFade && {
168
- maskImage: "linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
169
- maskSize: `calc(100% + ${o.overflow.left ? "0px" : "44px"} + ${o.overflow.right ? "0px" : "44px"}) 100%`,
170
- maskPosition: `${o.overflow.left ? "0px" : "-44px"} 0`
171
- }
172
- };
173
- return /* @__PURE__ */ c(
174
- "div",
175
- {
176
- "data-spark-component": "scrolling-list-items",
177
- id: "scrolling-list-items",
178
- role: "list",
179
- className: u(
180
- "relative transition-all duration-300",
181
- "u-no-scrollbar overflow-x-auto scroll-smooth",
182
- "w-full gap-(--scrolling-list-gap) default:flex default:flex-row",
183
- "focus-visible:u-outline",
184
- e
185
- ),
186
- ref: Z(o.scrollAreaRef, o.scrollRef, l),
187
- style: g,
188
- onKeyDown: p,
189
- ...i,
190
- children: W.map(
191
- s,
192
- (t, f) => q(t) ? G(t, { index: f }) : t
193
- )
194
- }
195
- );
119
+ var D = ({ children: e, ref: t, className: n = "", ...r }) => {
120
+ let s = u(x), l = {
121
+ mandatory: "x mandatory",
122
+ proximity: "x proximity",
123
+ none: "none"
124
+ }, d = (e) => {
125
+ !s.loop && !s.hasPrevPage || (e.preventDefault(), s.goTo(s.hasPrevPage ? s.activePageIndex - 1 : s.pages.length - 1, { behavior: s.scrollBehavior }));
126
+ }, f = (e) => {
127
+ !s.loop && !s.hasNextPage || (e.preventDefault(), s.goTo(s.hasNextPage ? s.activePageIndex + 1 : 0, { behavior: s.scrollBehavior }));
128
+ }, p = (e) => {
129
+ e.key === "ArrowLeft" && d(e), e.key === "ArrowRight" && f(e);
130
+ }, m = {
131
+ scrollSnapType: l[s.snapType],
132
+ scrollPaddingInline: "var(--scrolling-list-px)",
133
+ "--scrolling-list-px": `${s.scrollPadding}px`,
134
+ "--scrolling-list-gap": `${s.gap}px`,
135
+ ...s.withFade && {
136
+ maskImage: "linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
137
+ maskSize: `calc(100% + ${s.overflow.left ? "0px" : "44px"} + ${s.overflow.right ? "0px" : "44px"}) 100%`,
138
+ maskPosition: `${s.overflow.left ? "0px" : "-44px"} 0`
139
+ }
140
+ };
141
+ return /* @__PURE__ */ h("div", {
142
+ "data-spark-component": "scrolling-list-items",
143
+ id: "scrolling-list-items",
144
+ role: "list",
145
+ className: i("relative transition-all duration-300", "u-no-scrollbar overflow-x-auto scroll-smooth", "w-full gap-(--scrolling-list-gap) default:flex default:flex-row", "focus-visible:u-outline", n),
146
+ ref: E(s.scrollAreaRef, s.scrollRef, t),
147
+ style: m,
148
+ onKeyDown: p,
149
+ ...r,
150
+ children: a.map(e, (e, t) => c(e) ? o(e, { index: t }) : e)
151
+ });
196
152
  };
197
- B.displayName = "ScrollingList.Items";
198
- const C = ({ "aria-label": s, ...l }) => {
199
- const e = m(d), i = () => {
200
- e.hasNextPage ? e.next({ behavior: e.scrollBehavior }) : e.goTo(0, { behavior: e.scrollBehavior });
201
- }, n = !(e.overflow.left || e.overflow.right) || !e.loop && !e.overflow.right;
202
- return /* @__PURE__ */ c(
203
- L,
204
- {
205
- "data-spark-component": "scrolling-list-next-button",
206
- size: "sm",
207
- intent: "surface",
208
- design: "filled",
209
- className: u(
210
- "pointer-events-auto opacity-(--scrolling-list-controls-opacity) shadow-sm disabled:invisible",
211
- "group-hover/scrolling-list:opacity-none focus-visible:opacity-none"
212
- ),
213
- onClick: i,
214
- disabled: n,
215
- "aria-label": s,
216
- "aria-controls": "scrolling-list-items",
217
- ...l,
218
- children: /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Q, {}) })
219
- }
220
- );
153
+ D.displayName = "ScrollingList.Items";
154
+ //#endregion
155
+ //#region src/scrolling-list/ScrollingListNextButton.tsx
156
+ var O = ({ "aria-label": e, ...n }) => {
157
+ let a = u(x), o = () => {
158
+ a.hasNextPage ? a.next({ behavior: a.scrollBehavior }) : a.goTo(0, { behavior: a.scrollBehavior });
159
+ }, s = !(a.overflow.left || a.overflow.right) || !a.loop && !a.overflow.right;
160
+ return /* @__PURE__ */ h(r, {
161
+ "data-spark-component": "scrolling-list-next-button",
162
+ size: "sm",
163
+ intent: "surface",
164
+ design: "filled",
165
+ className: i("pointer-events-auto opacity-(--scrolling-list-controls-opacity) shadow-sm disabled:invisible", "group-hover/scrolling-list:opacity-none focus-visible:opacity-none"),
166
+ onClick: o,
167
+ disabled: s,
168
+ "aria-label": e,
169
+ "aria-controls": "scrolling-list-items",
170
+ ...n,
171
+ children: /* @__PURE__ */ h(t, { children: /* @__PURE__ */ h(v, {}) })
172
+ });
221
173
  };
222
- C.displayName = "ScrollingList.NextButton";
223
- const R = ({
224
- "aria-label": s,
225
- ...l
226
- }) => {
227
- const e = m(d), i = () => {
228
- e.activePageIndex === 0 && (e.scrollAreaRef.current?.scrollLeft || 0) > 0 ? e.goTo(0, { behavior: e.scrollBehavior }) : e.hasPrevPage ? e.prev({ behavior: e.scrollBehavior }) : e.goTo(e.pages.length - 1, { behavior: e.scrollBehavior });
229
- }, n = !(e.overflow.left || e.overflow.right) || !e.loop && !e.overflow.left;
230
- return /* @__PURE__ */ c(
231
- L,
232
- {
233
- "data-spark-component": "scrolling-list-prev-button",
234
- size: "sm",
235
- intent: "surface",
236
- design: "filled",
237
- className: u(
238
- "pointer-events-auto opacity-(--scrolling-list-controls-opacity) shadow-sm disabled:invisible",
239
- "group-hover/scrolling-list:opacity-none focus-visible:opacity-none"
240
- ),
241
- onClick: i,
242
- disabled: n,
243
- "aria-label": s,
244
- "aria-controls": "scrolling-list-items",
245
- ...l,
246
- children: /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(U, {}) })
247
- }
248
- );
174
+ O.displayName = "ScrollingList.NextButton";
175
+ //#endregion
176
+ //#region src/scrolling-list/ScrollingListPrevButton.tsx
177
+ var k = ({ "aria-label": e, ...n }) => {
178
+ let a = u(x), o = () => {
179
+ a.activePageIndex === 0 && (a.scrollAreaRef.current?.scrollLeft || 0) > 0 ? a.goTo(0, { behavior: a.scrollBehavior }) : a.hasPrevPage ? a.prev({ behavior: a.scrollBehavior }) : a.goTo(a.pages.length - 1, { behavior: a.scrollBehavior });
180
+ }, s = !(a.overflow.left || a.overflow.right) || !a.loop && !a.overflow.left;
181
+ return /* @__PURE__ */ h(r, {
182
+ "data-spark-component": "scrolling-list-prev-button",
183
+ size: "sm",
184
+ intent: "surface",
185
+ design: "filled",
186
+ className: i("pointer-events-auto opacity-(--scrolling-list-controls-opacity) shadow-sm disabled:invisible", "group-hover/scrolling-list:opacity-none focus-visible:opacity-none"),
187
+ onClick: o,
188
+ disabled: s,
189
+ "aria-label": e,
190
+ "aria-controls": "scrolling-list-items",
191
+ ...n,
192
+ children: /* @__PURE__ */ h(t, { children: /* @__PURE__ */ h(y, {}) })
193
+ });
249
194
  };
250
- R.displayName = "ScrollingList.PrevButton";
251
- const A = ({ children: s, ...l }) => {
252
- const e = m(d);
253
- return /* @__PURE__ */ c(
254
- X,
255
- {
256
- type: "button",
257
- design: "tinted",
258
- intent: "surface",
259
- tabIndex: 0,
260
- className: u(
261
- "z-raised absolute top-1/2 left-0 -translate-y-1/2",
262
- "not-focus-visible:pointer-events-none not-focus-visible:size-0 not-focus-visible:opacity-0"
263
- ),
264
- onClick: e.skipKeyboardNavigation,
265
- ...l,
266
- children: s
267
- }
268
- );
195
+ k.displayName = "ScrollingList.PrevButton";
196
+ //#endregion
197
+ //#region src/scrolling-list/ScrollingListSkipButton.tsx
198
+ var A = ({ children: e, ...t }) => {
199
+ let r = u(x);
200
+ return /* @__PURE__ */ h(n, {
201
+ type: "button",
202
+ design: "tinted",
203
+ intent: "surface",
204
+ tabIndex: 0,
205
+ className: i("z-raised absolute top-1/2 left-0 -translate-y-1/2", "not-focus-visible:pointer-events-none not-focus-visible:size-0 not-focus-visible:opacity-0"),
206
+ onClick: r.skipKeyboardNavigation,
207
+ ...t,
208
+ children: e
209
+ });
269
210
  };
270
211
  A.displayName = "ScrollingList.SkipButton";
271
- const _ = Object.assign(N, {
272
- Controls: I,
273
- NextButton: C,
274
- PrevButton: R,
275
- Item: k,
276
- Items: B,
277
- SkipButton: A
212
+ //#endregion
213
+ //#region src/scrolling-list/index.ts
214
+ var j = Object.assign(S, {
215
+ Controls: C,
216
+ NextButton: O,
217
+ PrevButton: k,
218
+ Item: T,
219
+ Items: D,
220
+ SkipButton: A
278
221
  });
279
- _.displayName = "ScrollingList";
280
- export {
281
- _ as ScrollingList
282
- };
283
- //# sourceMappingURL=index.mjs.map
222
+ j.displayName = "ScrollingList";
223
+ //#endregion
224
+ export { j as ScrollingList };
225
+
226
+ //# sourceMappingURL=index.mjs.map