@szum-tech/design-system 3.17.0 → 3.18.2

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 (299) hide show
  1. package/dist/chunk-D5PAWOAZ.cjs +1 -0
  2. package/dist/chunk-JUNHRB4B.js +1 -0
  3. package/dist/chunk-P7BFOJLM.cjs +3 -0
  4. package/dist/chunk-ZYG2KYKK.js +3 -0
  5. package/dist/components/index.cjs +1 -924
  6. package/dist/components/index.d.cts +1650 -56
  7. package/dist/components/index.d.ts +1650 -56
  8. package/dist/components/index.js +1 -43
  9. package/dist/hooks/index.cjs +1 -35
  10. package/dist/hooks/index.js +1 -2
  11. package/dist/icons/index.cjs +2 -93
  12. package/dist/icons/index.js +2 -88
  13. package/dist/utils/index.cjs +1 -10
  14. package/dist/utils/index.js +1 -1
  15. package/package.json +30 -38
  16. package/dist/chunk-2WQJ36RD.cjs +0 -78
  17. package/dist/chunk-2Y2ZCPNV.cjs +0 -61
  18. package/dist/chunk-35H6T7OQ.cjs +0 -2912
  19. package/dist/chunk-375QAB65.cjs +0 -145
  20. package/dist/chunk-3DP3VMPN.js +0 -173
  21. package/dist/chunk-3GNVQFCK.cjs +0 -50
  22. package/dist/chunk-3RK5PCIC.js +0 -86
  23. package/dist/chunk-3WSQRFUY.cjs +0 -11
  24. package/dist/chunk-4LNGZHF2.cjs +0 -33
  25. package/dist/chunk-4TRADSTP.js +0 -34
  26. package/dist/chunk-5B37TQYT.cjs +0 -18
  27. package/dist/chunk-5F2Y65JH.js +0 -32
  28. package/dist/chunk-5MJPZUTO.js +0 -38
  29. package/dist/chunk-5MV54MWS.js +0 -46
  30. package/dist/chunk-6BSR3O2J.js +0 -53
  31. package/dist/chunk-6HX7ETL3.cjs +0 -183
  32. package/dist/chunk-7OD2NBSV.cjs +0 -50
  33. package/dist/chunk-A72LE53B.js +0 -21
  34. package/dist/chunk-A7SBXO2Y.cjs +0 -40
  35. package/dist/chunk-AAPMLWYK.js +0 -2831
  36. package/dist/chunk-B4M7Q5KX.cjs +0 -25
  37. package/dist/chunk-B7RHEMZH.js +0 -48
  38. package/dist/chunk-BTSHACKG.js +0 -123
  39. package/dist/chunk-BUJO4FB6.js +0 -252
  40. package/dist/chunk-CL2C6STG.cjs +0 -278
  41. package/dist/chunk-CXHDWIGF.cjs +0 -89
  42. package/dist/chunk-DGWBE2Y3.cjs +0 -205
  43. package/dist/chunk-DUAM4RTP.cjs +0 -23
  44. package/dist/chunk-EOTQVIA5.js +0 -993
  45. package/dist/chunk-EUH466AL.cjs +0 -179
  46. package/dist/chunk-F7NFSDOD.cjs +0 -91
  47. package/dist/chunk-G24PWQKG.js +0 -20
  48. package/dist/chunk-GEDBA3JU.cjs +0 -49
  49. package/dist/chunk-GYXQUTWZ.cjs +0 -59
  50. package/dist/chunk-H2BWO3SI.cjs +0 -11
  51. package/dist/chunk-H5NHGMSQ.js +0 -136
  52. package/dist/chunk-HCHVDUI6.cjs +0 -34
  53. package/dist/chunk-HNRVLRMN.js +0 -82
  54. package/dist/chunk-HPICKLBZ.cjs +0 -204
  55. package/dist/chunk-I3E75OQX.js +0 -16
  56. package/dist/chunk-I3RSTJP6.js +0 -20
  57. package/dist/chunk-IWF52DDE.js +0 -55
  58. package/dist/chunk-IZU3KULT.js +0 -41
  59. package/dist/chunk-K5AURCK5.js +0 -183
  60. package/dist/chunk-KTAIBRTH.cjs +0 -10
  61. package/dist/chunk-L2TRMQNN.js +0 -130
  62. package/dist/chunk-M7NIRB3U.js +0 -43
  63. package/dist/chunk-MNDQXDV4.cjs +0 -607
  64. package/dist/chunk-N4TYSZSU.cjs +0 -44
  65. package/dist/chunk-NU5UQPBX.cjs +0 -25
  66. package/dist/chunk-NXEZE7LG.js +0 -15
  67. package/dist/chunk-OCOCENE6.js +0 -42
  68. package/dist/chunk-OQCNPNPS.js +0 -23
  69. package/dist/chunk-OXZQGDTR.js +0 -208
  70. package/dist/chunk-OZSNSRLV.cjs +0 -1027
  71. package/dist/chunk-P4IL77YC.js +0 -66
  72. package/dist/chunk-P4JIMFSL.js +0 -51
  73. package/dist/chunk-P5IUC7HJ.js +0 -9
  74. package/dist/chunk-PBEZZMAB.js +0 -25
  75. package/dist/chunk-RKFU4DS3.cjs +0 -1064
  76. package/dist/chunk-S3ANEJJ7.cjs +0 -22
  77. package/dist/chunk-S3ZUFD6U.js +0 -23
  78. package/dist/chunk-SHPJGB2L.cjs +0 -19
  79. package/dist/chunk-TH44JYXB.cjs +0 -27
  80. package/dist/chunk-TMXVL5CV.cjs +0 -48
  81. package/dist/chunk-U3QKV7I4.js +0 -54
  82. package/dist/chunk-U7XZJQ4O.js +0 -36
  83. package/dist/chunk-UJX74PFK.cjs +0 -46
  84. package/dist/chunk-ULEEQ723.cjs +0 -108
  85. package/dist/chunk-UNOMGKAZ.cjs +0 -141
  86. package/dist/chunk-USIW3VT5.cjs +0 -73
  87. package/dist/chunk-VK2FJ65F.js +0 -575
  88. package/dist/chunk-VK5EX3OG.cjs +0 -132
  89. package/dist/chunk-WCQ5WKCQ.js +0 -1042
  90. package/dist/chunk-WMGJCB7O.js +0 -157
  91. package/dist/chunk-X3ZT3KGX.cjs +0 -53
  92. package/dist/chunk-X5O7GP4S.js +0 -48
  93. package/dist/chunk-X7WREEFD.js +0 -8
  94. package/dist/chunk-XENOUBSI.cjs +0 -37
  95. package/dist/chunk-XKCLVPUC.js +0 -176
  96. package/dist/chunk-XTKD76O5.js +0 -29
  97. package/dist/chunk-YBFG2IRJ.cjs +0 -225
  98. package/dist/chunk-YEFLGE3L.cjs +0 -47
  99. package/dist/chunk-YUMKV5TH.js +0 -56
  100. package/dist/chunk-ZD2QRAOX.js +0 -9
  101. package/dist/chunk-ZVF7J4EI.cjs +0 -58
  102. package/dist/color-picker.types-GI7dq2Ig.d.cts +0 -42
  103. package/dist/color-picker.types-GI7dq2Ig.d.ts +0 -42
  104. package/dist/components/accordion/index.cjs +0 -23
  105. package/dist/components/accordion/index.d.cts +0 -17
  106. package/dist/components/accordion/index.d.ts +0 -17
  107. package/dist/components/accordion/index.js +0 -2
  108. package/dist/components/alert/index.cjs +0 -19
  109. package/dist/components/alert/index.d.cts +0 -24
  110. package/dist/components/alert/index.d.ts +0 -24
  111. package/dist/components/alert/index.js +0 -2
  112. package/dist/components/alert-dialog/index.cjs +0 -43
  113. package/dist/components/alert-dialog/index.d.cts +0 -32
  114. package/dist/components/alert-dialog/index.d.ts +0 -32
  115. package/dist/components/alert-dialog/index.js +0 -2
  116. package/dist/components/avatar/index.cjs +0 -19
  117. package/dist/components/avatar/index.d.cts +0 -14
  118. package/dist/components/avatar/index.d.ts +0 -14
  119. package/dist/components/avatar/index.js +0 -2
  120. package/dist/components/badge/index.cjs +0 -19
  121. package/dist/components/badge/index.d.cts +0 -28
  122. package/dist/components/badge/index.d.ts +0 -28
  123. package/dist/components/badge/index.js +0 -2
  124. package/dist/components/badge-overflow/index.cjs +0 -183
  125. package/dist/components/badge-overflow/index.d.cts +0 -21
  126. package/dist/components/badge-overflow/index.d.ts +0 -21
  127. package/dist/components/badge-overflow/index.js +0 -161
  128. package/dist/components/breadcrump/index.cjs +0 -80
  129. package/dist/components/breadcrump/index.d.cts +0 -21
  130. package/dist/components/breadcrump/index.d.ts +0 -21
  131. package/dist/components/breadcrump/index.js +0 -72
  132. package/dist/components/button/index.cjs +0 -52
  133. package/dist/components/button/index.d.cts +0 -58
  134. package/dist/components/button/index.d.ts +0 -58
  135. package/dist/components/button/index.js +0 -43
  136. package/dist/components/card/index.cjs +0 -35
  137. package/dist/components/card/index.d.cts +0 -25
  138. package/dist/components/card/index.d.ts +0 -25
  139. package/dist/components/card/index.js +0 -2
  140. package/dist/components/carousel/index.cjs +0 -269
  141. package/dist/components/carousel/index.d.cts +0 -48
  142. package/dist/components/carousel/index.d.ts +0 -48
  143. package/dist/components/carousel/index.js +0 -238
  144. package/dist/components/checkbox/index.cjs +0 -11
  145. package/dist/components/checkbox/index.d.cts +0 -8
  146. package/dist/components/checkbox/index.d.ts +0 -8
  147. package/dist/components/checkbox/index.js +0 -2
  148. package/dist/components/collapsible/index.cjs +0 -18
  149. package/dist/components/collapsible/index.d.cts +0 -12
  150. package/dist/components/collapsible/index.d.ts +0 -12
  151. package/dist/components/collapsible/index.js +0 -1
  152. package/dist/components/color-picker/index.cjs +0 -92
  153. package/dist/components/color-picker/index.d.cts +0 -71
  154. package/dist/components/color-picker/index.d.ts +0 -71
  155. package/dist/components/color-picker/index.js +0 -43
  156. package/dist/components/color-swatch/index.cjs +0 -11
  157. package/dist/components/color-swatch/index.d.cts +0 -22
  158. package/dist/components/color-swatch/index.d.ts +0 -22
  159. package/dist/components/color-swatch/index.js +0 -2
  160. package/dist/components/counting-number/index.cjs +0 -11
  161. package/dist/components/counting-number/index.d.cts +0 -57
  162. package/dist/components/counting-number/index.d.ts +0 -57
  163. package/dist/components/counting-number/index.js +0 -2
  164. package/dist/components/dialog/index.cjs +0 -39
  165. package/dist/components/dialog/index.d.cts +0 -42
  166. package/dist/components/dialog/index.d.ts +0 -42
  167. package/dist/components/dialog/index.js +0 -2
  168. package/dist/components/dropdown-menu/index.cjs +0 -71
  169. package/dist/components/dropdown-menu/index.d.cts +0 -67
  170. package/dist/components/dropdown-menu/index.d.ts +0 -67
  171. package/dist/components/dropdown-menu/index.js +0 -2
  172. package/dist/components/empty/index.cjs +0 -31
  173. package/dist/components/empty/index.d.cts +0 -29
  174. package/dist/components/empty/index.d.ts +0 -29
  175. package/dist/components/empty/index.js +0 -2
  176. package/dist/components/field/index.cjs +0 -49
  177. package/dist/components/field/index.d.cts +0 -50
  178. package/dist/components/field/index.d.ts +0 -50
  179. package/dist/components/field/index.js +0 -4
  180. package/dist/components/file-upload/index.cjs +0 -60
  181. package/dist/components/file-upload/index.d.cts +0 -131
  182. package/dist/components/file-upload/index.d.ts +0 -131
  183. package/dist/components/file-upload/index.js +0 -3
  184. package/dist/components/header/index.cjs +0 -11
  185. package/dist/components/header/index.d.cts +0 -18
  186. package/dist/components/header/index.d.ts +0 -18
  187. package/dist/components/header/index.js +0 -2
  188. package/dist/components/input/index.cjs +0 -11
  189. package/dist/components/input/index.d.cts +0 -9
  190. package/dist/components/input/index.d.ts +0 -9
  191. package/dist/components/input/index.js +0 -2
  192. package/dist/components/item/index.cjs +0 -48
  193. package/dist/components/item/index.d.cts +0 -61
  194. package/dist/components/item/index.d.ts +0 -61
  195. package/dist/components/item/index.js +0 -3
  196. package/dist/components/label/index.cjs +0 -11
  197. package/dist/components/label/index.d.cts +0 -8
  198. package/dist/components/label/index.d.ts +0 -8
  199. package/dist/components/label/index.js +0 -2
  200. package/dist/components/marquee/index.cjs +0 -11
  201. package/dist/components/marquee/index.d.cts +0 -48
  202. package/dist/components/marquee/index.d.ts +0 -48
  203. package/dist/components/marquee/index.js +0 -2
  204. package/dist/components/masonry/index.cjs +0 -16
  205. package/dist/components/masonry/index.d.cts +0 -181
  206. package/dist/components/masonry/index.d.ts +0 -181
  207. package/dist/components/masonry/index.js +0 -3
  208. package/dist/components/popover/index.cjs +0 -35
  209. package/dist/components/popover/index.d.cts +0 -18
  210. package/dist/components/popover/index.d.ts +0 -18
  211. package/dist/components/popover/index.js +0 -2
  212. package/dist/components/progress/index.cjs +0 -11
  213. package/dist/components/progress/index.d.cts +0 -8
  214. package/dist/components/progress/index.d.ts +0 -8
  215. package/dist/components/progress/index.js +0 -2
  216. package/dist/components/radio-group/index.cjs +0 -15
  217. package/dist/components/radio-group/index.d.cts +0 -22
  218. package/dist/components/radio-group/index.d.ts +0 -22
  219. package/dist/components/radio-group/index.js +0 -2
  220. package/dist/components/scroll-area/index.cjs +0 -15
  221. package/dist/components/scroll-area/index.d.cts +0 -11
  222. package/dist/components/scroll-area/index.d.ts +0 -11
  223. package/dist/components/scroll-area/index.js +0 -2
  224. package/dist/components/select/index.cjs +0 -31
  225. package/dist/components/select/index.d.cts +0 -22
  226. package/dist/components/select/index.d.ts +0 -22
  227. package/dist/components/select/index.js +0 -2
  228. package/dist/components/separator/index.cjs +0 -11
  229. package/dist/components/separator/index.d.cts +0 -8
  230. package/dist/components/separator/index.d.ts +0 -8
  231. package/dist/components/separator/index.js +0 -2
  232. package/dist/components/sheet/index.cjs +0 -39
  233. package/dist/components/sheet/index.d.cts +0 -42
  234. package/dist/components/sheet/index.d.ts +0 -42
  235. package/dist/components/sheet/index.js +0 -2
  236. package/dist/components/sidebar/index.cjs +0 -148
  237. package/dist/components/sidebar/index.d.cts +0 -135
  238. package/dist/components/sidebar/index.d.ts +0 -135
  239. package/dist/components/sidebar/index.js +0 -43
  240. package/dist/components/skeleton/index.cjs +0 -11
  241. package/dist/components/skeleton/index.d.cts +0 -7
  242. package/dist/components/skeleton/index.d.ts +0 -7
  243. package/dist/components/skeleton/index.js +0 -2
  244. package/dist/components/sortable/index.cjs +0 -27
  245. package/dist/components/sortable/index.d.cts +0 -50
  246. package/dist/components/sortable/index.d.ts +0 -50
  247. package/dist/components/sortable/index.js +0 -2
  248. package/dist/components/spinner/index.cjs +0 -11
  249. package/dist/components/spinner/index.d.cts +0 -7
  250. package/dist/components/spinner/index.d.ts +0 -7
  251. package/dist/components/spinner/index.js +0 -2
  252. package/dist/components/status/index.cjs +0 -19
  253. package/dist/components/status/index.d.cts +0 -25
  254. package/dist/components/status/index.d.ts +0 -25
  255. package/dist/components/status/index.js +0 -2
  256. package/dist/components/stepper/index.cjs +0 -124
  257. package/dist/components/stepper/index.d.cts +0 -164
  258. package/dist/components/stepper/index.d.ts +0 -164
  259. package/dist/components/stepper/index.js +0 -43
  260. package/dist/components/switch/index.cjs +0 -11
  261. package/dist/components/switch/index.d.cts +0 -19
  262. package/dist/components/switch/index.d.ts +0 -19
  263. package/dist/components/switch/index.js +0 -2
  264. package/dist/components/tabs/index.cjs +0 -23
  265. package/dist/components/tabs/index.d.cts +0 -17
  266. package/dist/components/tabs/index.d.ts +0 -17
  267. package/dist/components/tabs/index.js +0 -2
  268. package/dist/components/textarea/index.cjs +0 -11
  269. package/dist/components/textarea/index.d.cts +0 -9
  270. package/dist/components/textarea/index.d.ts +0 -9
  271. package/dist/components/textarea/index.js +0 -2
  272. package/dist/components/timeline/index.cjs +0 -45
  273. package/dist/components/timeline/index.d.cts +0 -63
  274. package/dist/components/timeline/index.d.ts +0 -63
  275. package/dist/components/timeline/index.js +0 -4
  276. package/dist/components/toaster/index.cjs +0 -56
  277. package/dist/components/toaster/index.d.cts +0 -8
  278. package/dist/components/toaster/index.d.ts +0 -8
  279. package/dist/components/toaster/index.js +0 -43
  280. package/dist/components/tooltip/index.cjs +0 -19
  281. package/dist/components/tooltip/index.d.cts +0 -12
  282. package/dist/components/tooltip/index.d.ts +0 -12
  283. package/dist/components/tooltip/index.js +0 -2
  284. package/dist/components/typing-text/index.cjs +0 -11
  285. package/dist/components/typing-text/index.d.cts +0 -41
  286. package/dist/components/typing-text/index.d.ts +0 -41
  287. package/dist/components/typing-text/index.js +0 -2
  288. package/dist/components/word-rotate/index.cjs +0 -11
  289. package/dist/components/word-rotate/index.d.cts +0 -30
  290. package/dist/components/word-rotate/index.d.ts +0 -30
  291. package/dist/components/word-rotate/index.js +0 -2
  292. package/dist/direction-CUOPDLCj.d.cts +0 -7
  293. package/dist/direction-CUOPDLCj.d.ts +0 -7
  294. package/dist/popover-trigger-Cf4PPj0z.d.cts +0 -14
  295. package/dist/popover-trigger-Cf4PPj0z.d.ts +0 -14
  296. package/dist/select-Bf6XQtt-.d.cts +0 -12
  297. package/dist/select-Bf6XQtt-.d.ts +0 -12
  298. package/dist/tooltip-content-DqtogPBq.d.cts +0 -8
  299. package/dist/tooltip-content-DqtogPBq.d.ts +0 -8
@@ -1,43 +0,0 @@
1
- import { cn } from './chunk-ZD2QRAOX.js';
2
- import { ScrollArea as ScrollArea$1 } from 'radix-ui';
3
- import { jsx, jsxs } from 'react/jsx-runtime';
4
-
5
- function ScrollBar({ className, orientation = "vertical", ...props }) {
6
- return /* @__PURE__ */ jsx(
7
- ScrollArea$1.ScrollAreaScrollbar,
8
- {
9
- "data-slot": "scroll-area-scrollbar",
10
- orientation,
11
- className: cn(
12
- "flex touch-none p-px transition-colors select-none",
13
- orientation === "vertical" ? "h-full w-2.5 border-l border-l-transparent" : "",
14
- orientation === "horizontal" ? "h-2.5 flex-col border-t border-t-transparent" : "",
15
- className
16
- ),
17
- ...props,
18
- children: /* @__PURE__ */ jsx(
19
- ScrollArea$1.ScrollAreaThumb,
20
- {
21
- "data-slot": "scroll-area-thumb",
22
- className: "bg-border relative flex-1 rounded"
23
- }
24
- )
25
- }
26
- );
27
- }
28
- function ScrollArea({ className, children, ...props }) {
29
- return /* @__PURE__ */ jsxs(ScrollArea$1.Root, { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [
30
- /* @__PURE__ */ jsx(
31
- ScrollArea$1.Viewport,
32
- {
33
- "data-slot": "scroll-area-viewport",
34
- className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring focus-visible:outline-1",
35
- children
36
- }
37
- ),
38
- /* @__PURE__ */ jsx(ScrollBar, {}),
39
- /* @__PURE__ */ jsx(ScrollArea$1.Corner, {})
40
- ] });
41
- }
42
-
43
- export { ScrollArea, ScrollBar };
@@ -1,607 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkN4TYSZSU_cjs = require('./chunk-N4TYSZSU.cjs');
4
- var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
5
- var React2 = require('react');
6
- var jsxRuntime = require('react/jsx-runtime');
7
- var reactSlot = require('@radix-ui/react-slot');
8
- var classVarianceAuthority = require('class-variance-authority');
9
-
10
- function _interopNamespace(e) {
11
- if (e && e.__esModule) return e;
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
20
- });
21
- }
22
- });
23
- }
24
- n.default = e;
25
- return Object.freeze(n);
26
- }
27
-
28
- var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
29
-
30
- var DirectionContext = React2__namespace.createContext(void 0);
31
- function useDirection(localDir) {
32
- const globalDir = React2__namespace.useContext(DirectionContext);
33
- return localDir || globalDir || "ltr";
34
- }
35
-
36
- // src/components/timeline/timeline.constants.ts
37
- var TIMELINE_ROOT_NAME = "Timeline";
38
- var TIMELINE_ITEM_NAME = "TimelineItem";
39
- var TIMELINE_CONTENT_NAME = "TimelineContent";
40
- var TIMELINE_CONNECTOR_NAME = "TimelineConnector";
41
- var TIMELINE_DOT_NAME = "TimelineDot";
42
-
43
- // src/components/timeline/timeline.store.tsx
44
- var TimelineStoreContext = React2__namespace.createContext(null);
45
- function useTimelineStore(selector) {
46
- const store = React2__namespace.useContext(TimelineStoreContext);
47
- if (!store) {
48
- throw new Error(`\`useTimelineStore\` must be used within \`${TIMELINE_ROOT_NAME}\``);
49
- }
50
- const getSnapshot = React2__namespace.useCallback(() => selector(store), [store, selector]);
51
- return React2__namespace.useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
52
- }
53
- function useTimelineStoreContext(consumerName) {
54
- const context = React2__namespace.useContext(TimelineStoreContext);
55
- if (!context) {
56
- throw new Error(`\`${consumerName}\` must be used within \`${TIMELINE_ROOT_NAME}\``);
57
- }
58
- return context;
59
- }
60
-
61
- // src/components/timeline/timeline.utils.ts
62
- function getItemStatus(itemIndex, activeIndex) {
63
- if (activeIndex === void 0) return "pending";
64
- if (itemIndex < activeIndex) return "completed";
65
- if (itemIndex === activeIndex) return "active";
66
- return "pending";
67
- }
68
- function getSortedEntries(entries) {
69
- return entries.sort((a, b) => {
70
- const elementA = a[1].current;
71
- const elementB = b[1].current;
72
- if (!elementA || !elementB) return 0;
73
- const position = elementA.compareDocumentPosition(elementB);
74
- if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
75
- if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;
76
- return 0;
77
- });
78
- }
79
- var TimelineContext = React2__namespace.createContext(null);
80
- function useTimelineContext(consumerName) {
81
- const context = React2__namespace.useContext(TimelineContext);
82
- if (!context) {
83
- throw new Error(`\`${consumerName}\` must be used within \`${TIMELINE_ROOT_NAME}\``);
84
- }
85
- return context;
86
- }
87
- var timelineVariants = classVarianceAuthority.cva(
88
- "relative flex [--timeline-connector-thickness:0.125rem] [--timeline-dot-size:0.875rem]",
89
- {
90
- variants: {
91
- orientation: {
92
- vertical: "flex-col",
93
- horizontal: "flex-row items-start"
94
- },
95
- variant: {
96
- default: "",
97
- alternate: ""
98
- }
99
- },
100
- compoundVariants: [
101
- {
102
- orientation: "vertical",
103
- variant: "default",
104
- class: "gap-6"
105
- },
106
- {
107
- orientation: "horizontal",
108
- variant: "default",
109
- class: "gap-8"
110
- },
111
- {
112
- orientation: "vertical",
113
- variant: "alternate",
114
- class: "relative w-full gap-3"
115
- },
116
- {
117
- orientation: "horizontal",
118
- variant: "alternate",
119
- class: "items-center gap-4"
120
- }
121
- ],
122
- defaultVariants: {
123
- orientation: "vertical",
124
- variant: "default"
125
- }
126
- }
127
- );
128
- var timelineItemVariants = classVarianceAuthority.cva("relative flex", {
129
- variants: {
130
- orientation: {
131
- vertical: "",
132
- horizontal: ""
133
- },
134
- variant: {
135
- default: "",
136
- alternate: ""
137
- },
138
- isAlternateRight: {
139
- true: "",
140
- false: ""
141
- }
142
- },
143
- compoundVariants: [
144
- {
145
- orientation: "vertical",
146
- variant: "default",
147
- class: "gap-3 pb-8 last:pb-0"
148
- },
149
- {
150
- orientation: "horizontal",
151
- variant: "default",
152
- class: "flex-col gap-3"
153
- },
154
- {
155
- orientation: "vertical",
156
- variant: "alternate",
157
- isAlternateRight: false,
158
- class: "w-1/2 gap-3 pr-6 pb-12 last:pb-0"
159
- },
160
- {
161
- orientation: "vertical",
162
- variant: "alternate",
163
- isAlternateRight: true,
164
- class: "ml-auto w-1/2 flex-row-reverse gap-3 pb-12 pl-6 last:pb-0"
165
- },
166
- {
167
- orientation: "horizontal",
168
- variant: "alternate",
169
- class: "grid min-w-0 grid-rows-[1fr_auto_1fr] gap-3"
170
- }
171
- ],
172
- defaultVariants: {
173
- orientation: "vertical",
174
- variant: "default",
175
- isAlternateRight: false
176
- }
177
- });
178
- var timelineContentVariants = classVarianceAuthority.cva("flex-1", {
179
- variants: {
180
- orientation: {
181
- vertical: "",
182
- horizontal: ""
183
- },
184
- variant: {
185
- default: "",
186
- alternate: ""
187
- },
188
- isAlternateRight: {
189
- true: "",
190
- false: ""
191
- }
192
- },
193
- compoundVariants: [
194
- {
195
- variant: "alternate",
196
- orientation: "vertical",
197
- isAlternateRight: false,
198
- class: "text-right"
199
- },
200
- {
201
- variant: "alternate",
202
- orientation: "horizontal",
203
- isAlternateRight: false,
204
- class: "row-start-3 pt-2"
205
- },
206
- {
207
- variant: "alternate",
208
- orientation: "horizontal",
209
- isAlternateRight: true,
210
- class: "row-start-1 pb-2"
211
- }
212
- ],
213
- defaultVariants: {
214
- orientation: "vertical",
215
- variant: "default",
216
- isAlternateRight: false
217
- }
218
- });
219
- var timelineDotVariants = classVarianceAuthority.cva(
220
- "relative z-10 flex size-(--timeline-dot-size) shrink-0 items-center justify-center rounded-full border-2 bg-background",
221
- {
222
- variants: {
223
- status: {
224
- completed: "border-primary",
225
- active: "border-primary",
226
- pending: "border-border"
227
- },
228
- orientation: {
229
- vertical: "",
230
- horizontal: ""
231
- },
232
- variant: {
233
- default: "",
234
- alternate: ""
235
- },
236
- isAlternateRight: {
237
- true: "",
238
- false: ""
239
- }
240
- },
241
- compoundVariants: [
242
- {
243
- variant: "alternate",
244
- orientation: "vertical",
245
- isAlternateRight: false,
246
- class: "absolute -right-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] bg-background"
247
- },
248
- {
249
- variant: "alternate",
250
- orientation: "vertical",
251
- isAlternateRight: true,
252
- class: "absolute -left-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] bg-background"
253
- },
254
- {
255
- variant: "alternate",
256
- orientation: "horizontal",
257
- class: "row-start-2 bg-background"
258
- },
259
- {
260
- variant: "alternate",
261
- status: "completed",
262
- class: "bg-background"
263
- },
264
- {
265
- variant: "alternate",
266
- status: "active",
267
- class: "bg-background"
268
- }
269
- ],
270
- defaultVariants: {
271
- status: "pending",
272
- orientation: "vertical",
273
- variant: "default",
274
- isAlternateRight: false
275
- }
276
- }
277
- );
278
- var timelineConnectorVariants = classVarianceAuthority.cva("absolute z-0", {
279
- variants: {
280
- isCompleted: {
281
- true: "bg-primary",
282
- false: "bg-border"
283
- },
284
- orientation: {
285
- vertical: "",
286
- horizontal: ""
287
- },
288
- variant: {
289
- default: "",
290
- alternate: ""
291
- },
292
- isAlternateRight: {
293
- true: "",
294
- false: ""
295
- }
296
- },
297
- compoundVariants: [
298
- {
299
- orientation: "vertical",
300
- variant: "default",
301
- class: "start-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] top-3 h-[calc(100%+0.5rem)] w-(--timeline-connector-thickness)"
302
- },
303
- {
304
- orientation: "horizontal",
305
- variant: "default",
306
- class: "start-3 top-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] h-(--timeline-connector-thickness) w-[calc(100%+0.5rem)]"
307
- },
308
- {
309
- orientation: "vertical",
310
- variant: "alternate",
311
- isAlternateRight: false,
312
- class: "top-2 -right-[calc(var(--timeline-connector-thickness)/2)] h-full w-(--timeline-connector-thickness)"
313
- },
314
- {
315
- orientation: "vertical",
316
- variant: "alternate",
317
- isAlternateRight: true,
318
- class: "top-2 -left-[calc(var(--timeline-connector-thickness)/2)] h-full w-(--timeline-connector-thickness)"
319
- },
320
- {
321
- orientation: "horizontal",
322
- variant: "alternate",
323
- class: "top-[calc(var(--timeline-dot-size)/2-var(--timeline-connector-thickness)/2)] left-3 row-start-2 h-(--timeline-connector-thickness) w-[calc(100%+0.5rem)]"
324
- }
325
- ],
326
- defaultVariants: {
327
- isCompleted: false,
328
- orientation: "vertical",
329
- variant: "default",
330
- isAlternateRight: false
331
- }
332
- });
333
- function Timeline({
334
- orientation = "vertical",
335
- variant = "default",
336
- dir: dirProp,
337
- activeIndex,
338
- asChild = false,
339
- className,
340
- ...props
341
- }) {
342
- const dir = useDirection(dirProp);
343
- const listenersRef = chunkN4TYSZSU_cjs.useLazyRef(() => /* @__PURE__ */ new Set());
344
- const stateRef = chunkN4TYSZSU_cjs.useLazyRef(() => ({
345
- items: /* @__PURE__ */ new Map()
346
- }));
347
- const store = React2__namespace.useMemo(() => {
348
- return {
349
- subscribe: (cb) => {
350
- listenersRef.current.add(cb);
351
- return () => listenersRef.current.delete(cb);
352
- },
353
- getState: () => stateRef.current,
354
- notify: () => {
355
- for (const cb of listenersRef.current) {
356
- cb();
357
- }
358
- },
359
- onItemRegister: (id, ref) => {
360
- stateRef.current.items.set(id, ref);
361
- store.notify();
362
- },
363
- onItemUnregister: (id) => {
364
- stateRef.current.items.delete(id);
365
- store.notify();
366
- },
367
- getNextItemStatus: (id, activeIndex2) => {
368
- const entries = Array.from(stateRef.current.items.entries());
369
- const sortedEntries = getSortedEntries(entries);
370
- const currentIndex = sortedEntries.findIndex(([key]) => key === id);
371
- if (currentIndex === -1 || currentIndex === sortedEntries.length - 1) {
372
- return void 0;
373
- }
374
- const nextItemIndex = currentIndex + 1;
375
- return getItemStatus(nextItemIndex, activeIndex2);
376
- },
377
- getItemIndex: (id) => {
378
- const entries = Array.from(stateRef.current.items.entries());
379
- const sortedEntries = getSortedEntries(entries);
380
- return sortedEntries.findIndex(([key]) => key === id);
381
- }
382
- };
383
- }, [listenersRef, stateRef]);
384
- const contextValue = React2__namespace.useMemo(
385
- () => ({
386
- dir,
387
- orientation,
388
- variant,
389
- activeIndex
390
- }),
391
- [dir, orientation, variant, activeIndex]
392
- );
393
- const RootPrimitive = asChild ? reactSlot.Slot : "div";
394
- return /* @__PURE__ */ jsxRuntime.jsx(TimelineStoreContext.Provider, { value: store, children: /* @__PURE__ */ jsxRuntime.jsx(TimelineContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
395
- RootPrimitive,
396
- {
397
- role: "list",
398
- "aria-orientation": orientation,
399
- "data-slot": "timeline",
400
- "data-orientation": orientation,
401
- "data-variant": variant,
402
- dir,
403
- ...props,
404
- className: chunkH2BWO3SI_cjs.cn(timelineVariants({ orientation, variant, className }))
405
- }
406
- ) }) });
407
- }
408
- function setRef(ref, value) {
409
- if (typeof ref === "function") {
410
- return ref(value);
411
- } else if (ref !== null && ref !== void 0) {
412
- ref.current = value;
413
- }
414
- }
415
- function composeRefs(...refs) {
416
- return (node) => {
417
- let hasCleanup = false;
418
- const cleanups = refs.map((ref) => {
419
- const cleanup = setRef(ref, node);
420
- if (!hasCleanup && typeof cleanup == "function") {
421
- hasCleanup = true;
422
- }
423
- return cleanup;
424
- });
425
- if (hasCleanup) {
426
- return () => {
427
- for (let i = 0; i < cleanups.length; i++) {
428
- const cleanup = cleanups[i];
429
- if (typeof cleanup == "function") {
430
- cleanup();
431
- } else {
432
- setRef(refs[i], null);
433
- }
434
- }
435
- };
436
- }
437
- };
438
- }
439
- function useComposedRefs(...refs) {
440
- return React2__namespace.useCallback(composeRefs(...refs), refs);
441
- }
442
- var TimelineItemContext = React2__namespace.createContext(null);
443
- function useTimelineItemContext(consumerName) {
444
- const context = React2__namespace.useContext(TimelineItemContext);
445
- if (!context) {
446
- throw new Error(`\`${consumerName}\` must be used within \`${TIMELINE_ITEM_NAME}\``);
447
- }
448
- return context;
449
- }
450
- function TimelineItem({ asChild = false, className, id, ref, ...props }) {
451
- const { dir, orientation, variant, activeIndex } = useTimelineContext(TIMELINE_ITEM_NAME);
452
- const store = useTimelineStoreContext(TIMELINE_ITEM_NAME);
453
- const instanceId = React2__namespace.useId();
454
- const itemId = id ?? instanceId;
455
- const itemRef = React2__namespace.useRef(null);
456
- const composedRef = useComposedRefs(ref, itemRef);
457
- const itemIndex = useTimelineStore((state) => state.getItemIndex(itemId));
458
- const status = React2__namespace.useMemo(
459
- function() {
460
- return itemIndex < 0 ? "pending" : getItemStatus(itemIndex, activeIndex);
461
- },
462
- [activeIndex, itemIndex]
463
- );
464
- chunkN4TYSZSU_cjs.useIsomorphicLayoutEffect(() => {
465
- store.onItemRegister(itemId, itemRef);
466
- return () => {
467
- store.onItemUnregister(itemId);
468
- };
469
- }, [id, store]);
470
- const isAlternateRight = variant === "alternate" && itemIndex % 2 === 1;
471
- const itemContextValue = React2__namespace.useMemo(
472
- () => ({ id: itemId, status, isAlternateRight }),
473
- [itemId, status, isAlternateRight]
474
- );
475
- const ItemPrimitive = asChild ? reactSlot.Slot : "div";
476
- return /* @__PURE__ */ jsxRuntime.jsx(TimelineItemContext.Provider, { value: itemContextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
477
- ItemPrimitive,
478
- {
479
- role: "listitem",
480
- "aria-current": status === "active" ? "step" : void 0,
481
- "data-slot": "timeline-item",
482
- "data-status": status,
483
- "data-orientation": orientation,
484
- "data-alternate-right": isAlternateRight ? "" : void 0,
485
- id: itemId,
486
- dir,
487
- ...props,
488
- ref: composedRef,
489
- className: chunkH2BWO3SI_cjs.cn(
490
- timelineItemVariants({
491
- orientation,
492
- variant,
493
- isAlternateRight,
494
- className
495
- })
496
- )
497
- }
498
- ) });
499
- }
500
- function TimelineContent({ asChild = false, className, ...props }) {
501
- const { variant, orientation } = useTimelineContext(TIMELINE_CONTENT_NAME);
502
- const { status, isAlternateRight } = useTimelineItemContext(TIMELINE_CONTENT_NAME);
503
- const ContentPrimitive = asChild ? reactSlot.Slot : "div";
504
- return /* @__PURE__ */ jsxRuntime.jsx(
505
- ContentPrimitive,
506
- {
507
- "data-slot": "timeline-content",
508
- "data-status": status,
509
- ...props,
510
- className: chunkH2BWO3SI_cjs.cn(
511
- timelineContentVariants({
512
- orientation,
513
- variant,
514
- isAlternateRight,
515
- className
516
- })
517
- )
518
- }
519
- );
520
- }
521
- function TimelineDot({ asChild = false, className, ...props }) {
522
- const { orientation, variant } = useTimelineContext(TIMELINE_DOT_NAME);
523
- const { status, isAlternateRight } = useTimelineItemContext(TIMELINE_DOT_NAME);
524
- const DotPrimitive = asChild ? reactSlot.Slot : "div";
525
- return /* @__PURE__ */ jsxRuntime.jsx(
526
- DotPrimitive,
527
- {
528
- "data-slot": "timeline-dot",
529
- "data-status": status,
530
- "data-orientation": orientation,
531
- ...props,
532
- className: chunkH2BWO3SI_cjs.cn(
533
- timelineDotVariants({
534
- status,
535
- orientation,
536
- variant,
537
- isAlternateRight,
538
- className
539
- })
540
- )
541
- }
542
- );
543
- }
544
- function TimelineConnector({ asChild = false, forceMount, className, ...props }) {
545
- const { orientation, variant, activeIndex } = useTimelineContext(TIMELINE_CONNECTOR_NAME);
546
- const { id, status, isAlternateRight } = useTimelineItemContext(TIMELINE_CONNECTOR_NAME);
547
- const nextItemStatus = useTimelineStore((state) => state.getNextItemStatus(id, activeIndex));
548
- const isLastItem = nextItemStatus === void 0;
549
- if (!forceMount && isLastItem) return null;
550
- const isConnectorCompleted = nextItemStatus === "completed" || nextItemStatus === "active";
551
- const ConnectorPrimitive = asChild ? reactSlot.Slot : "div";
552
- return /* @__PURE__ */ jsxRuntime.jsx(
553
- ConnectorPrimitive,
554
- {
555
- "aria-hidden": "true",
556
- "data-slot": "timeline-connector",
557
- "data-completed": isConnectorCompleted ? "" : void 0,
558
- "data-status": status,
559
- "data-orientation": orientation,
560
- ...props,
561
- className: chunkH2BWO3SI_cjs.cn(
562
- timelineConnectorVariants({
563
- isCompleted: isConnectorCompleted,
564
- orientation,
565
- variant,
566
- isAlternateRight,
567
- className
568
- })
569
- )
570
- }
571
- );
572
- }
573
- function TimelineHeader({ asChild, className, ...props }) {
574
- const HeaderPrimitive = asChild ? reactSlot.Slot : "div";
575
- return /* @__PURE__ */ jsxRuntime.jsx(HeaderPrimitive, { "data-slot": "timeline-header", className: chunkH2BWO3SI_cjs.cn("flex flex-col gap-1", className), ...props });
576
- }
577
- function TimelineTitle({ asChild = false, className, ...props }) {
578
- const TitlePrimitive = asChild ? reactSlot.Slot : "div";
579
- return /* @__PURE__ */ jsxRuntime.jsx(TitlePrimitive, { "data-slot": "timeline-title", className: chunkH2BWO3SI_cjs.cn("leading-none font-semibold", className), ...props });
580
- }
581
- function TimelineDescription({ asChild = false, className, ...props }) {
582
- const DescriptionPrimitive = asChild ? reactSlot.Slot : "div";
583
- return /* @__PURE__ */ jsxRuntime.jsx(
584
- DescriptionPrimitive,
585
- {
586
- "data-slot": "timeline-description",
587
- ...props,
588
- className: chunkH2BWO3SI_cjs.cn("text-muted-foreground text-sm", className)
589
- }
590
- );
591
- }
592
- function TimelineTime({ asChild = false, className, ...props }) {
593
- const TimePrimitive = asChild ? reactSlot.Slot : "time";
594
- return /* @__PURE__ */ jsxRuntime.jsx(TimePrimitive, { "data-slot": "timeline-time", className: chunkH2BWO3SI_cjs.cn("text-muted-foreground text-xs", className), ...props });
595
- }
596
-
597
- exports.Timeline = Timeline;
598
- exports.TimelineConnector = TimelineConnector;
599
- exports.TimelineContent = TimelineContent;
600
- exports.TimelineDescription = TimelineDescription;
601
- exports.TimelineDot = TimelineDot;
602
- exports.TimelineHeader = TimelineHeader;
603
- exports.TimelineItem = TimelineItem;
604
- exports.TimelineTime = TimelineTime;
605
- exports.TimelineTitle = TimelineTitle;
606
- exports.useComposedRefs = useComposedRefs;
607
- exports.useDirection = useDirection;
@@ -1,44 +0,0 @@
1
- 'use strict';
2
-
3
- var React2 = require('react');
4
-
5
- function _interopNamespace(e) {
6
- if (e && e.__esModule) return e;
7
- var n = Object.create(null);
8
- if (e) {
9
- Object.keys(e).forEach(function (k) {
10
- if (k !== 'default') {
11
- var d = Object.getOwnPropertyDescriptor(e, k);
12
- Object.defineProperty(n, k, d.get ? d : {
13
- enumerable: true,
14
- get: function () { return e[k]; }
15
- });
16
- }
17
- });
18
- }
19
- n.default = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
24
-
25
- // src/hooks/use-lazy-ref.tsx
26
- function useLazyRef(fn) {
27
- const ref = React2__namespace.useRef(null);
28
- if (ref.current === null) {
29
- ref.current = fn();
30
- }
31
- return ref;
32
- }
33
- var useIsomorphicLayoutEffect = typeof window === "undefined" ? React2__namespace.useEffect : React2__namespace.useLayoutEffect;
34
- function useAsRef(props) {
35
- const ref = React2__namespace.useRef(props);
36
- useIsomorphicLayoutEffect(() => {
37
- ref.current = props;
38
- });
39
- return ref;
40
- }
41
-
42
- exports.useAsRef = useAsRef;
43
- exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
44
- exports.useLazyRef = useLazyRef;