@nexus-cross/design-system 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/cursor-rules/nexus-project-setup.mdc +292 -0
  2. package/cursor-rules/nexus-ui-api.mdc +698 -0
  3. package/cursor-rules/nexus-ui-components.mdc +136 -0
  4. package/dist/accordion.d.mts +28 -0
  5. package/dist/accordion.d.ts +28 -0
  6. package/dist/accordion.js +28 -0
  7. package/dist/accordion.mjs +3 -0
  8. package/dist/avatar.d.mts +17 -0
  9. package/dist/avatar.d.ts +17 -0
  10. package/dist/avatar.js +16 -0
  11. package/dist/avatar.mjs +3 -0
  12. package/dist/button.d.mts +17 -0
  13. package/dist/button.d.ts +17 -0
  14. package/dist/button.js +16 -0
  15. package/dist/button.mjs +3 -0
  16. package/dist/carousel.d.mts +36 -0
  17. package/dist/carousel.d.ts +36 -0
  18. package/dist/carousel.js +32 -0
  19. package/dist/carousel.mjs +3 -0
  20. package/dist/checkbox.d.mts +21 -0
  21. package/dist/checkbox.d.ts +21 -0
  22. package/dist/checkbox.js +20 -0
  23. package/dist/checkbox.mjs +3 -0
  24. package/dist/chip.d.mts +16 -0
  25. package/dist/chip.d.ts +16 -0
  26. package/dist/chip.js +16 -0
  27. package/dist/chip.mjs +3 -0
  28. package/dist/chunks/chunk-22ULI3BF.js +21 -0
  29. package/dist/chunks/chunk-26BUGBOY.mjs +57 -0
  30. package/dist/chunks/chunk-2JTPRBHZ.mjs +36 -0
  31. package/dist/chunks/chunk-2MC7XJSE.js +98 -0
  32. package/dist/chunks/chunk-2RPRCWKV.mjs +139 -0
  33. package/dist/chunks/chunk-2ZXDXO4I.js +166 -0
  34. package/dist/chunks/chunk-33UFQJIO.mjs +135 -0
  35. package/dist/chunks/chunk-3HHJORN7.mjs +137 -0
  36. package/dist/chunks/chunk-3PCNRCTB.js +61 -0
  37. package/dist/chunks/chunk-3VFBPFZF.mjs +640 -0
  38. package/dist/chunks/chunk-4J3GCZ7W.mjs +102 -0
  39. package/dist/chunks/chunk-54IA2P2Z.mjs +40 -0
  40. package/dist/chunks/chunk-54RBL7J4.mjs +179 -0
  41. package/dist/chunks/chunk-5JHJNN2K.js +83 -0
  42. package/dist/chunks/chunk-5JHN4FCY.mjs +58 -0
  43. package/dist/chunks/chunk-6FMDO6TT.mjs +114 -0
  44. package/dist/chunks/chunk-6H7V2I3X.mjs +270 -0
  45. package/dist/chunks/chunk-7AISZYWL.js +7 -0
  46. package/dist/chunks/chunk-7G65JBTN.js +133 -0
  47. package/dist/chunks/chunk-ADO7PDLY.mjs +66 -0
  48. package/dist/chunks/chunk-AFSEYJZT.js +267 -0
  49. package/dist/chunks/chunk-AOXXE5UQ.mjs +14 -0
  50. package/dist/chunks/chunk-AZ2URLDD.js +39 -0
  51. package/dist/chunks/chunk-B6G5TJRO.js +116 -0
  52. package/dist/chunks/chunk-BLGQHR3M.js +56 -0
  53. package/dist/chunks/chunk-BPUQ2CO2.mjs +48 -0
  54. package/dist/chunks/chunk-BSZ2LN6E.js +129 -0
  55. package/dist/chunks/chunk-CA3SOLI3.mjs +78 -0
  56. package/dist/chunks/chunk-CSJDDREF.js +90 -0
  57. package/dist/chunks/chunk-CVYXRSXT.mjs +8 -0
  58. package/dist/chunks/chunk-CZC76ZD5.js +10 -0
  59. package/dist/chunks/chunk-D6FII7HW.js +202 -0
  60. package/dist/chunks/chunk-DLFV7ZZV.js +112 -0
  61. package/dist/chunks/chunk-DO6VK2QQ.mjs +108 -0
  62. package/dist/chunks/chunk-ECVAVQUY.mjs +243 -0
  63. package/dist/chunks/chunk-EHAUUUWB.mjs +120 -0
  64. package/dist/chunks/chunk-EVOOTSY5.js +59 -0
  65. package/dist/chunks/chunk-GX6GSWX3.mjs +38 -0
  66. package/dist/chunks/chunk-HHXDOKXY.js +108 -0
  67. package/dist/chunks/chunk-HNLI646G.mjs +325 -0
  68. package/dist/chunks/chunk-HUPAHDJ7.js +273 -0
  69. package/dist/chunks/chunk-I252NERB.mjs +21 -0
  70. package/dist/chunks/chunk-IE4DGLMH.js +75 -0
  71. package/dist/chunks/chunk-INP2AH3B.js +27 -0
  72. package/dist/chunks/chunk-IOSIQLZL.js +70 -0
  73. package/dist/chunks/chunk-J5ZKGPBY.js +132 -0
  74. package/dist/chunks/chunk-JNMCYWGY.js +10 -0
  75. package/dist/chunks/chunk-LI7SFBUQ.mjs +89 -0
  76. package/dist/chunks/chunk-LMMON5AU.mjs +81 -0
  77. package/dist/chunks/chunk-LOQXCHKL.js +74 -0
  78. package/dist/chunks/chunk-MA2VCCIY.js +71 -0
  79. package/dist/chunks/chunk-MCKOWMLS.mjs +8 -0
  80. package/dist/chunks/chunk-MRRKW5QN.mjs +108 -0
  81. package/dist/chunks/chunk-MTX7GD3H.js +80 -0
  82. package/dist/chunks/chunk-NFIPQZ4O.js +100 -0
  83. package/dist/chunks/chunk-NHDGKOAM.js +104 -0
  84. package/dist/chunks/chunk-OMN5YQCE.js +143 -0
  85. package/dist/chunks/chunk-OTGS6BDQ.mjs +25 -0
  86. package/dist/chunks/chunk-P2T72N62.mjs +34 -0
  87. package/dist/chunks/chunk-P3DZKXG4.js +116 -0
  88. package/dist/chunks/chunk-QK6NCII4.js +36 -0
  89. package/dist/chunks/chunk-QZ4QR3XV.mjs +142 -0
  90. package/dist/chunks/chunk-RS3SBY3I.js +163 -0
  91. package/dist/chunks/chunk-RX5UKRYK.mjs +76 -0
  92. package/dist/chunks/chunk-SGNRVYYQ.mjs +99 -0
  93. package/dist/chunks/chunk-SJMCPSVH.mjs +76 -0
  94. package/dist/chunks/chunk-T2IY2TSR.js +43 -0
  95. package/dist/chunks/chunk-U53UA76K.js +653 -0
  96. package/dist/chunks/chunk-U56AGSLE.mjs +106 -0
  97. package/dist/chunks/chunk-ULGYTBCT.mjs +47 -0
  98. package/dist/chunks/chunk-V5OTJP6H.mjs +5 -0
  99. package/dist/chunks/chunk-VGO4Z2WH.js +336 -0
  100. package/dist/chunks/chunk-VIGRCJAE.mjs +37 -0
  101. package/dist/chunks/chunk-VVXQZ4XH.mjs +93 -0
  102. package/dist/chunks/chunk-W4GG5A7K.mjs +51 -0
  103. package/dist/chunks/chunk-WKCXACMZ.js +99 -0
  104. package/dist/chunks/chunk-WR55D4ZS.js +80 -0
  105. package/dist/chunks/chunk-X2SHTVZQ.js +89 -0
  106. package/dist/chunks/chunk-XEHFB62A.js +82 -0
  107. package/dist/chunks/chunk-XG6QG65W.mjs +63 -0
  108. package/dist/chunks/chunk-YB5ZKHVB.js +64 -0
  109. package/dist/chunks/chunk-YCG4FZC3.js +167 -0
  110. package/dist/chunks/chunk-YEWKPWK3.mjs +80 -0
  111. package/dist/chunks/chunk-YLO4UKSC.mjs +48 -0
  112. package/dist/chunks/chunk-YZV6FWE7.js +160 -0
  113. package/dist/chunks/chunk-ZWSIIGA3.mjs +58 -0
  114. package/dist/client-only.d.mts +13 -0
  115. package/dist/client-only.d.ts +13 -0
  116. package/dist/client-only.js +11 -0
  117. package/dist/client-only.mjs +2 -0
  118. package/dist/countdown.d.mts +27 -0
  119. package/dist/countdown.d.ts +27 -0
  120. package/dist/countdown.js +16 -0
  121. package/dist/countdown.mjs +3 -0
  122. package/dist/counter.d.mts +15 -0
  123. package/dist/counter.d.ts +15 -0
  124. package/dist/counter.js +11 -0
  125. package/dist/counter.mjs +2 -0
  126. package/dist/data-list.d.mts +33 -0
  127. package/dist/data-list.d.ts +33 -0
  128. package/dist/data-list.js +14 -0
  129. package/dist/data-list.mjs +5 -0
  130. package/dist/divider.d.mts +14 -0
  131. package/dist/divider.d.ts +14 -0
  132. package/dist/divider.js +16 -0
  133. package/dist/divider.mjs +3 -0
  134. package/dist/drawer.d.mts +42 -0
  135. package/dist/drawer.d.ts +42 -0
  136. package/dist/drawer.js +44 -0
  137. package/dist/drawer.mjs +3 -0
  138. package/dist/ellipsis.d.mts +16 -0
  139. package/dist/ellipsis.d.ts +16 -0
  140. package/dist/ellipsis.js +12 -0
  141. package/dist/ellipsis.mjs +3 -0
  142. package/dist/error-boundary.d.mts +20 -0
  143. package/dist/error-boundary.d.ts +20 -0
  144. package/dist/error-boundary.js +11 -0
  145. package/dist/error-boundary.mjs +2 -0
  146. package/dist/hooks/useCheckDevice.d.mts +47 -0
  147. package/dist/hooks/useCheckDevice.d.ts +47 -0
  148. package/dist/hooks/useCheckDevice.js +8 -0
  149. package/dist/hooks/useCheckDevice.mjs +2 -0
  150. package/dist/hooks/useClickOutside.d.mts +12 -0
  151. package/dist/hooks/useClickOutside.d.ts +12 -0
  152. package/dist/hooks/useClickOutside.js +8 -0
  153. package/dist/hooks/useClickOutside.mjs +2 -0
  154. package/dist/hooks/useDraggableBottomSheet.d.mts +24 -0
  155. package/dist/hooks/useDraggableBottomSheet.d.ts +24 -0
  156. package/dist/hooks/useDraggableBottomSheet.js +11 -0
  157. package/dist/hooks/useDraggableBottomSheet.mjs +2 -0
  158. package/dist/hooks/useDraggableWindow.d.mts +21 -0
  159. package/dist/hooks/useDraggableWindow.d.ts +21 -0
  160. package/dist/hooks/useDraggableWindow.js +11 -0
  161. package/dist/hooks/useDraggableWindow.mjs +2 -0
  162. package/dist/hooks/useInView.d.mts +14 -0
  163. package/dist/hooks/useInView.d.ts +14 -0
  164. package/dist/hooks/useInView.js +17 -0
  165. package/dist/hooks/useInView.mjs +2 -0
  166. package/dist/hooks/useModal.d.mts +2 -0
  167. package/dist/hooks/useModal.d.ts +2 -0
  168. package/dist/hooks/useModal.js +11 -0
  169. package/dist/hooks/useModal.mjs +2 -0
  170. package/dist/index.d.mts +76 -0
  171. package/dist/index.d.ts +76 -0
  172. package/dist/index.js +746 -0
  173. package/dist/index.mjs +328 -0
  174. package/dist/infinite-scroll.d.mts +26 -0
  175. package/dist/infinite-scroll.d.ts +26 -0
  176. package/dist/infinite-scroll.js +12 -0
  177. package/dist/infinite-scroll.mjs +3 -0
  178. package/dist/marquee.d.mts +12 -0
  179. package/dist/marquee.d.ts +12 -0
  180. package/dist/marquee.js +12 -0
  181. package/dist/marquee.mjs +3 -0
  182. package/dist/modal/index.d.mts +87 -0
  183. package/dist/modal/index.d.ts +87 -0
  184. package/dist/modal/index.js +54 -0
  185. package/dist/modal/index.mjs +9 -0
  186. package/dist/number-input.d.mts +38 -0
  187. package/dist/number-input.d.ts +38 -0
  188. package/dist/number-input.js +20 -0
  189. package/dist/number-input.mjs +3 -0
  190. package/dist/pagination.d.mts +22 -0
  191. package/dist/pagination.d.ts +22 -0
  192. package/dist/pagination.js +20 -0
  193. package/dist/pagination.mjs +3 -0
  194. package/dist/popover.d.mts +25 -0
  195. package/dist/popover.d.ts +25 -0
  196. package/dist/popover.js +32 -0
  197. package/dist/popover.mjs +3 -0
  198. package/dist/radio-group.d.mts +29 -0
  199. package/dist/radio-group.d.ts +29 -0
  200. package/dist/radio-group.js +24 -0
  201. package/dist/radio-group.mjs +3 -0
  202. package/dist/schemas/_all.json +2250 -0
  203. package/dist/schemas/accordion.json +101 -0
  204. package/dist/schemas/avatar.json +55 -0
  205. package/dist/schemas/button.json +71 -0
  206. package/dist/schemas/carousel.json +32 -0
  207. package/dist/schemas/carouselButton.json +20 -0
  208. package/dist/schemas/carouselDots.json +17 -0
  209. package/dist/schemas/carouselSlide.json +20 -0
  210. package/dist/schemas/checkBox.json +57 -0
  211. package/dist/schemas/chip.json +49 -0
  212. package/dist/schemas/clientOnly.json +19 -0
  213. package/dist/schemas/countdown.json +58 -0
  214. package/dist/schemas/counter.json +57 -0
  215. package/dist/schemas/dataList.json +56 -0
  216. package/dist/schemas/divider.json +40 -0
  217. package/dist/schemas/drawer.json +27 -0
  218. package/dist/schemas/drawerContent.json +50 -0
  219. package/dist/schemas/ellipsis.json +49 -0
  220. package/dist/schemas/errorBoundary.json +22 -0
  221. package/dist/schemas/infiniteScroll.json +65 -0
  222. package/dist/schemas/marquee.json +46 -0
  223. package/dist/schemas/modalCall.json +21 -0
  224. package/dist/schemas/modalTemplate.json +123 -0
  225. package/dist/schemas/numberInput.json +77 -0
  226. package/dist/schemas/pagination.json +50 -0
  227. package/dist/schemas/popover.json +67 -0
  228. package/dist/schemas/radioGroup.json +61 -0
  229. package/dist/schemas/radioItem.json +35 -0
  230. package/dist/schemas/select.json +62 -0
  231. package/dist/schemas/selectItem.json +31 -0
  232. package/dist/schemas/skeleton.json +48 -0
  233. package/dist/schemas/spinner.json +27 -0
  234. package/dist/schemas/switch.json +41 -0
  235. package/dist/schemas/tab.json +89 -0
  236. package/dist/schemas/table.json +75 -0
  237. package/dist/schemas/tableRow.json +32 -0
  238. package/dist/schemas/tdColumn.json +107 -0
  239. package/dist/schemas/textArea.json +44 -0
  240. package/dist/schemas/textInput.json +67 -0
  241. package/dist/schemas/themeProvider.json +65 -0
  242. package/dist/schemas/toaster.json +31 -0
  243. package/dist/schemas/tooltip.json +67 -0
  244. package/dist/schemas/virtualGrid.json +59 -0
  245. package/dist/schemas/virtualList.json +54 -0
  246. package/dist/schemas.d.mts +1263 -0
  247. package/dist/schemas.d.ts +1263 -0
  248. package/dist/schemas.js +513 -0
  249. package/dist/schemas.mjs +469 -0
  250. package/dist/select.d.mts +31 -0
  251. package/dist/select.d.ts +31 -0
  252. package/dist/select.js +24 -0
  253. package/dist/select.mjs +3 -0
  254. package/dist/skeleton.d.mts +15 -0
  255. package/dist/skeleton.d.ts +15 -0
  256. package/dist/skeleton.js +12 -0
  257. package/dist/skeleton.mjs +3 -0
  258. package/dist/spinner.d.mts +9 -0
  259. package/dist/spinner.d.ts +9 -0
  260. package/dist/spinner.js +12 -0
  261. package/dist/spinner.mjs +3 -0
  262. package/dist/styles/layer.d.mts +3 -0
  263. package/dist/styles/layer.d.ts +3 -0
  264. package/dist/styles/layer.js +18 -0
  265. package/dist/styles/layer.mjs +16 -0
  266. package/dist/styles.css +2401 -0
  267. package/dist/styles.d.mts +3 -0
  268. package/dist/styles.d.ts +3 -0
  269. package/dist/styles.js +16 -0
  270. package/dist/styles.layered.css +2404 -0
  271. package/dist/styles.mjs +14 -0
  272. package/dist/switch.d.mts +15 -0
  273. package/dist/switch.d.ts +15 -0
  274. package/dist/switch.js +16 -0
  275. package/dist/switch.mjs +3 -0
  276. package/dist/tab.d.mts +36 -0
  277. package/dist/tab.d.ts +36 -0
  278. package/dist/tab.js +20 -0
  279. package/dist/tab.mjs +3 -0
  280. package/dist/table.d.mts +80 -0
  281. package/dist/table.d.ts +80 -0
  282. package/dist/table.js +33 -0
  283. package/dist/table.mjs +4 -0
  284. package/dist/text-area.d.mts +15 -0
  285. package/dist/text-area.d.ts +15 -0
  286. package/dist/text-area.js +16 -0
  287. package/dist/text-area.mjs +3 -0
  288. package/dist/text-input.d.mts +21 -0
  289. package/dist/text-input.d.ts +21 -0
  290. package/dist/text-input.js +16 -0
  291. package/dist/text-input.mjs +3 -0
  292. package/dist/theme-provider.d.mts +25 -0
  293. package/dist/theme-provider.d.ts +25 -0
  294. package/dist/theme-provider.js +15 -0
  295. package/dist/theme-provider.mjs +2 -0
  296. package/dist/toast.d.mts +42 -0
  297. package/dist/toast.d.ts +42 -0
  298. package/dist/toast.js +20 -0
  299. package/dist/toast.mjs +3 -0
  300. package/dist/tooltip.d.mts +24 -0
  301. package/dist/tooltip.d.ts +24 -0
  302. package/dist/tooltip.js +20 -0
  303. package/dist/tooltip.mjs +3 -0
  304. package/dist/useModal-BsGIcP8t.d.mts +128 -0
  305. package/dist/useModal-BsGIcP8t.d.ts +128 -0
  306. package/dist/utils/cn.d.mts +5 -0
  307. package/dist/utils/cn.d.ts +5 -0
  308. package/dist/utils/cn.js +11 -0
  309. package/dist/utils/cn.mjs +2 -0
  310. package/dist/utils/scroll.d.mts +4 -0
  311. package/dist/utils/scroll.d.ts +4 -0
  312. package/dist/utils/scroll.js +15 -0
  313. package/dist/utils/scroll.mjs +2 -0
  314. package/dist/virtual-scroll.d.mts +34 -0
  315. package/dist/virtual-scroll.d.ts +34 -0
  316. package/dist/virtual-scroll.js +16 -0
  317. package/dist/virtual-scroll.mjs +3 -0
  318. package/package.json +291 -0
  319. package/scripts/setup-cursor-rules.cjs +92 -0
@@ -0,0 +1,89 @@
1
+ 'use strict';
2
+
3
+ var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
4
+ var React = require('react');
5
+ var classVarianceAuthority = require('class-variance-authority');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
+
28
+ var switchVariants = classVarianceAuthority.cva("nexus-switch", {
29
+ variants: {
30
+ size: {
31
+ sm: "nexus-switch--sm",
32
+ md: "nexus-switch--md"
33
+ }
34
+ },
35
+ defaultVariants: { size: "md" }
36
+ });
37
+ var Switch = React__namespace.forwardRef(
38
+ ({ className, size, checked, disabled, readOnly, onCheckedChange, onChange, ...props }, ref) => {
39
+ const handleChange = React__namespace.useCallback(
40
+ (e) => {
41
+ onCheckedChange?.(e.target.checked);
42
+ onChange?.(e);
43
+ },
44
+ [onCheckedChange, onChange]
45
+ );
46
+ return /* @__PURE__ */ jsxRuntime.jsxs(
47
+ "label",
48
+ {
49
+ className: chunkCZC76ZD5_js.cn(
50
+ switchVariants({ size }),
51
+ checked ? "nexus-switch--checked" : "nexus-switch--unchecked",
52
+ className
53
+ ),
54
+ children: [
55
+ /* @__PURE__ */ jsxRuntime.jsx(
56
+ "input",
57
+ {
58
+ ref,
59
+ type: "checkbox",
60
+ role: "switch",
61
+ className: "nexus-sr-only",
62
+ checked,
63
+ disabled,
64
+ readOnly,
65
+ "aria-checked": checked,
66
+ onChange: handleChange,
67
+ ...props
68
+ }
69
+ ),
70
+ /* @__PURE__ */ jsxRuntime.jsx(
71
+ "span",
72
+ {
73
+ "aria-hidden": "true",
74
+ className: chunkCZC76ZD5_js.cn(
75
+ "nexus-switch__thumb",
76
+ size === "sm" ? "nexus-switch__thumb--sm" : "nexus-switch__thumb--md",
77
+ checked ? size === "sm" ? "nexus-switch__thumb--sm-on" : "nexus-switch__thumb--md-on" : "nexus-switch__thumb--off"
78
+ )
79
+ }
80
+ )
81
+ ]
82
+ }
83
+ );
84
+ }
85
+ );
86
+ Switch.displayName = "Switch";
87
+
88
+ exports.Switch = Switch;
89
+ exports.switchVariants = switchVariants;
@@ -0,0 +1,82 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ // src/hooks/useCheckDevice.ts
6
+ function getMatchMedia(query) {
7
+ if (typeof window === "undefined") return false;
8
+ return window.matchMedia(query).matches;
9
+ }
10
+ var DEFAULT_BREAKPOINTS = {
11
+ mobile: 0,
12
+ tablet: 768,
13
+ desktop: 1280
14
+ };
15
+ function buildQueries(bp) {
16
+ const sorted = Object.entries(bp).sort(([, a], [, b]) => a - b);
17
+ const queries = {};
18
+ sorted.forEach(([name, minWidth], i) => {
19
+ const next = sorted[i + 1];
20
+ if (minWidth === 0 && next) {
21
+ queries[name] = `(max-width: ${next[1] - 1}px)`;
22
+ } else if (!next) {
23
+ queries[name] = `(min-width: ${minWidth}px)`;
24
+ } else {
25
+ queries[name] = `(min-width: ${minWidth}px) and (max-width: ${next[1] - 1}px)`;
26
+ }
27
+ });
28
+ return queries;
29
+ }
30
+ function isLegacy(bp) {
31
+ if (!bp || typeof bp !== "object") return false;
32
+ return Object.values(bp).some((v) => typeof v === "string");
33
+ }
34
+ function toLegacyQueries(bp) {
35
+ return {
36
+ isDesktop: bp?.isDesktop ?? "(min-width: 1280px)",
37
+ isTablet: bp?.isTablet ?? "screen and (min-width: 768px) and (max-width: 1279px)",
38
+ isMobile: bp?.isMobile ?? "(max-width: 767px)"
39
+ };
40
+ }
41
+ function useCheckDevice(breakPoints) {
42
+ const serialized = breakPoints ? JSON.stringify(breakPoints) : "";
43
+ const queries = react.useMemo(() => {
44
+ if (!breakPoints) return buildQueries(DEFAULT_BREAKPOINTS);
45
+ if (isLegacy(breakPoints)) return toLegacyQueries(breakPoints);
46
+ return buildQueries(breakPoints);
47
+ }, [serialized]);
48
+ const [result, setResult] = react.useState(() => {
49
+ const init = {};
50
+ for (const [key, query] of Object.entries(queries)) {
51
+ init[key] = getMatchMedia(query);
52
+ }
53
+ return init;
54
+ });
55
+ react.useEffect(() => {
56
+ if (typeof window === "undefined") return;
57
+ const mqls = Object.entries(queries).map(([key, query]) => ({
58
+ key,
59
+ mql: window.matchMedia(query)
60
+ }));
61
+ const update = () => {
62
+ setResult((prev) => {
63
+ const next = {};
64
+ let changed = false;
65
+ for (const { key, mql } of mqls) {
66
+ next[key] = mql.matches;
67
+ if (next[key] !== prev[key]) changed = true;
68
+ }
69
+ return changed ? next : prev;
70
+ });
71
+ };
72
+ for (const { mql } of mqls) mql.addEventListener("change", update);
73
+ update();
74
+ return () => {
75
+ for (const { mql } of mqls) mql.removeEventListener("change", update);
76
+ };
77
+ }, [queries]);
78
+ return result;
79
+ }
80
+ var useCheckDevice_default = useCheckDevice;
81
+
82
+ exports.useCheckDevice_default = useCheckDevice_default;
@@ -0,0 +1,63 @@
1
+ import { cn } from './chunk-MCKOWMLS.mjs';
2
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
3
+ import * as React from 'react';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ var ChevronDown = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M4 6l4 4 4-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) });
7
+ var AccordionRoot = AccordionPrimitive.Root;
8
+ var AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Item, { ref, className: cn("nexus-accordion-item", className), ...props }));
9
+ AccordionItem.displayName = "AccordionItem";
10
+ var AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "nexus-accordion-header", children: /* @__PURE__ */ jsxs(
11
+ AccordionPrimitive.Trigger,
12
+ {
13
+ ref,
14
+ className: cn("nexus-accordion-trigger", className),
15
+ ...props,
16
+ children: [
17
+ children,
18
+ /* @__PURE__ */ jsx(ChevronDown, { className: "nexus-accordion-chevron" })
19
+ ]
20
+ }
21
+ ) }));
22
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
23
+ var AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
24
+ AccordionPrimitive.Content,
25
+ {
26
+ ref,
27
+ className: "nexus-accordion-content",
28
+ ...props,
29
+ children: /* @__PURE__ */ jsx("div", { className: cn("nexus-accordion-content__inner", className), children })
30
+ }
31
+ ));
32
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
33
+ var Accordion = ({
34
+ items,
35
+ type = "single",
36
+ collapsible = true,
37
+ value,
38
+ defaultValue,
39
+ className,
40
+ onValueChange
41
+ }) => {
42
+ const accordionProps = {
43
+ className,
44
+ ...type === "single" ? {
45
+ type: "single",
46
+ collapsible,
47
+ value,
48
+ defaultValue,
49
+ onValueChange
50
+ } : {
51
+ type: "multiple",
52
+ value,
53
+ defaultValue,
54
+ onValueChange
55
+ }
56
+ };
57
+ return /* @__PURE__ */ jsx(AccordionRoot, { ...accordionProps, children: items.map((item) => /* @__PURE__ */ jsxs(AccordionItem, { value: item.id, className: item.className, disabled: item.disabled, children: [
58
+ /* @__PURE__ */ jsx(AccordionTrigger, { className: item.triggerClassName, children: item.trigger }),
59
+ /* @__PURE__ */ jsx(AccordionContent, { className: item.contentClassName, children: item.content })
60
+ ] }, item.id)) });
61
+ };
62
+
63
+ export { Accordion, AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger };
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+
3
+ var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
4
+ var sonner = require('sonner');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ function Toaster({
8
+ position = "top-center",
9
+ unstyled = false,
10
+ toastOptions,
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ jsxRuntime.jsx(
14
+ sonner.Toaster,
15
+ {
16
+ position,
17
+ toastOptions: {
18
+ unstyled,
19
+ ...toastOptions,
20
+ classNames: {
21
+ toast: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast", toastOptions?.classNames?.toast),
22
+ title: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast__title", toastOptions?.classNames?.title),
23
+ description: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast__desc", toastOptions?.classNames?.description),
24
+ success: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast--success", toastOptions?.classNames?.success),
25
+ error: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast--error", toastOptions?.classNames?.error),
26
+ warning: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast--warning", toastOptions?.classNames?.warning),
27
+ info: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast--info", toastOptions?.classNames?.info),
28
+ actionButton: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast__action-btn", toastOptions?.classNames?.actionButton),
29
+ cancelButton: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast__cancel-btn", toastOptions?.classNames?.cancelButton),
30
+ closeButton: chunkCZC76ZD5_js.cn(!unstyled && "nexus-toast__close-btn", toastOptions?.classNames?.closeButton),
31
+ ...toastOptions?.classNames
32
+ }
33
+ },
34
+ ...props
35
+ }
36
+ );
37
+ }
38
+ function useToast() {
39
+ const showToast = (message, options) => sonner.toast(message, options);
40
+ const successToast = (message, options) => sonner.toast.success(message, options);
41
+ const errorToast = (message, options) => sonner.toast.error(message, options);
42
+ const warningToast = (message, options) => sonner.toast.warning(message, options);
43
+ const infoToast = (message, options) => sonner.toast.info(message, options);
44
+ const promiseToast = (promise, msgs, options) => sonner.toast.promise(promise, { ...msgs, ...options });
45
+ const customToast = (jsx2, options) => sonner.toast.custom(jsx2, options);
46
+ const dismissToast = (id) => sonner.toast.dismiss(id);
47
+ return {
48
+ toast: showToast,
49
+ successToast,
50
+ errorToast,
51
+ warningToast,
52
+ infoToast,
53
+ promiseToast,
54
+ customToast,
55
+ dismissToast
56
+ };
57
+ }
58
+
59
+ Object.defineProperty(exports, "toast", {
60
+ enumerable: true,
61
+ get: function () { return sonner.toast; }
62
+ });
63
+ exports.Toaster = Toaster;
64
+ exports.useToast = useToast;
@@ -0,0 +1,167 @@
1
+ 'use strict';
2
+
3
+ var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
4
+ var React = require('react');
5
+ var useEmblaCarousel = require('embla-carousel-react');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
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 React__namespace = /*#__PURE__*/_interopNamespace(React);
29
+ var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
30
+
31
+ var CarouselContext = React__namespace.createContext(null);
32
+ function useCarousel() {
33
+ const ctx = React__namespace.useContext(CarouselContext);
34
+ if (!ctx) throw new Error("useCarousel must be used within <Carousel>");
35
+ return ctx;
36
+ }
37
+ var Carousel = React__namespace.forwardRef(
38
+ ({ opts, plugins, onApiChange, className, children, ...props }, ref) => {
39
+ const [emblaRef, api] = useEmblaCarousel__default.default(
40
+ { loop: false, ...opts },
41
+ plugins
42
+ );
43
+ const [canScrollPrev, setCanScrollPrev] = React__namespace.useState(false);
44
+ const [canScrollNext, setCanScrollNext] = React__namespace.useState(false);
45
+ const [selectedIndex, setSelectedIndex] = React__namespace.useState(0);
46
+ const [scrollSnapCount, setScrollSnapCount] = React__namespace.useState(0);
47
+ const onSelect = React__namespace.useCallback(() => {
48
+ if (!api) return;
49
+ setCanScrollPrev(api.canScrollPrev());
50
+ setCanScrollNext(api.canScrollNext());
51
+ setSelectedIndex(api.selectedScrollSnap());
52
+ }, [api]);
53
+ React__namespace.useEffect(() => {
54
+ if (!api) return;
55
+ setScrollSnapCount(api.scrollSnapList().length);
56
+ onSelect();
57
+ api.on("reInit", onSelect);
58
+ api.on("select", onSelect);
59
+ onApiChange?.(api);
60
+ return () => {
61
+ api.off("reInit", onSelect);
62
+ api.off("select", onSelect);
63
+ };
64
+ }, [api, onSelect, onApiChange]);
65
+ const scrollPrev = React__namespace.useCallback(() => api?.scrollPrev(), [api]);
66
+ const scrollNext = React__namespace.useCallback(() => api?.scrollNext(), [api]);
67
+ const slides = [];
68
+ const extras = [];
69
+ React__namespace.Children.forEach(children, (child) => {
70
+ if (React__namespace.isValidElement(child) && typeof child.type !== "string" && child.type.displayName === "CarouselSlide") {
71
+ slides.push(child);
72
+ } else {
73
+ extras.push(child);
74
+ }
75
+ });
76
+ return /* @__PURE__ */ jsxRuntime.jsx(
77
+ CarouselContext.Provider,
78
+ {
79
+ value: { api, canScrollPrev, canScrollNext, scrollPrev, scrollNext, selectedIndex, scrollSnapCount },
80
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkCZC76ZD5_js.cn("nexus-carousel", className), role: "region", "aria-roledescription": "carousel", "aria-label": props["aria-label"] ?? "Carousel", ...props, children: [
81
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: emblaRef, className: "nexus-carousel__viewport", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-carousel__container", children: slides }) }),
82
+ extras
83
+ ] })
84
+ }
85
+ );
86
+ }
87
+ );
88
+ Carousel.displayName = "Carousel";
89
+ var CarouselSlide = React__namespace.forwardRef(
90
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
91
+ "div",
92
+ {
93
+ ref,
94
+ role: "group",
95
+ "aria-roledescription": "slide",
96
+ className: chunkCZC76ZD5_js.cn("nexus-carousel-slide", className),
97
+ ...props
98
+ }
99
+ )
100
+ );
101
+ CarouselSlide.displayName = "CarouselSlide";
102
+ var ChevronLeftIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "nexus-carousel-btn__icon", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 4L6 8l4 4" }) });
103
+ var ChevronRightIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "nexus-carousel-btn__icon", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 4l4 4-4 4" }) });
104
+ var CarouselPrev = React__namespace.forwardRef(
105
+ ({ className, children, ...props }, ref) => {
106
+ const { canScrollPrev, scrollPrev } = useCarousel();
107
+ return /* @__PURE__ */ jsxRuntime.jsx(
108
+ "button",
109
+ {
110
+ ref,
111
+ type: "button",
112
+ className: chunkCZC76ZD5_js.cn("nexus-carousel-btn nexus-carousel-btn--prev", className),
113
+ disabled: !canScrollPrev,
114
+ onClick: scrollPrev,
115
+ "aria-label": "Previous slide",
116
+ ...props,
117
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, {})
118
+ }
119
+ );
120
+ }
121
+ );
122
+ CarouselPrev.displayName = "CarouselPrev";
123
+ var CarouselNext = React__namespace.forwardRef(
124
+ ({ className, children, ...props }, ref) => {
125
+ const { canScrollNext, scrollNext } = useCarousel();
126
+ return /* @__PURE__ */ jsxRuntime.jsx(
127
+ "button",
128
+ {
129
+ ref,
130
+ type: "button",
131
+ className: chunkCZC76ZD5_js.cn("nexus-carousel-btn nexus-carousel-btn--next", className),
132
+ disabled: !canScrollNext,
133
+ onClick: scrollNext,
134
+ "aria-label": "Next slide",
135
+ ...props,
136
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, {})
137
+ }
138
+ );
139
+ }
140
+ );
141
+ CarouselNext.displayName = "CarouselNext";
142
+ function CarouselDots({ className }) {
143
+ const { selectedIndex, scrollSnapCount, api } = useCarousel();
144
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "tablist", "aria-label": "Slide navigation", className: chunkCZC76ZD5_js.cn("nexus-carousel-dots", className), children: Array.from({ length: scrollSnapCount }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(
145
+ "button",
146
+ {
147
+ type: "button",
148
+ role: "tab",
149
+ "aria-selected": i === selectedIndex,
150
+ className: chunkCZC76ZD5_js.cn(
151
+ "nexus-carousel-dot",
152
+ i === selectedIndex ? "nexus-carousel-dot--active" : "nexus-carousel-dot--inactive"
153
+ ),
154
+ onClick: () => api?.scrollTo(i),
155
+ "aria-label": `Go to slide ${i + 1}`
156
+ },
157
+ i
158
+ )) });
159
+ }
160
+ CarouselDots.displayName = "CarouselDots";
161
+
162
+ exports.Carousel = Carousel;
163
+ exports.CarouselDots = CarouselDots;
164
+ exports.CarouselNext = CarouselNext;
165
+ exports.CarouselPrev = CarouselPrev;
166
+ exports.CarouselSlide = CarouselSlide;
167
+ exports.useCarousel = useCarousel;
@@ -0,0 +1,80 @@
1
+ import { useMemo, useState, useEffect } from 'react';
2
+
3
+ // src/hooks/useCheckDevice.ts
4
+ function getMatchMedia(query) {
5
+ if (typeof window === "undefined") return false;
6
+ return window.matchMedia(query).matches;
7
+ }
8
+ var DEFAULT_BREAKPOINTS = {
9
+ mobile: 0,
10
+ tablet: 768,
11
+ desktop: 1280
12
+ };
13
+ function buildQueries(bp) {
14
+ const sorted = Object.entries(bp).sort(([, a], [, b]) => a - b);
15
+ const queries = {};
16
+ sorted.forEach(([name, minWidth], i) => {
17
+ const next = sorted[i + 1];
18
+ if (minWidth === 0 && next) {
19
+ queries[name] = `(max-width: ${next[1] - 1}px)`;
20
+ } else if (!next) {
21
+ queries[name] = `(min-width: ${minWidth}px)`;
22
+ } else {
23
+ queries[name] = `(min-width: ${minWidth}px) and (max-width: ${next[1] - 1}px)`;
24
+ }
25
+ });
26
+ return queries;
27
+ }
28
+ function isLegacy(bp) {
29
+ if (!bp || typeof bp !== "object") return false;
30
+ return Object.values(bp).some((v) => typeof v === "string");
31
+ }
32
+ function toLegacyQueries(bp) {
33
+ return {
34
+ isDesktop: bp?.isDesktop ?? "(min-width: 1280px)",
35
+ isTablet: bp?.isTablet ?? "screen and (min-width: 768px) and (max-width: 1279px)",
36
+ isMobile: bp?.isMobile ?? "(max-width: 767px)"
37
+ };
38
+ }
39
+ function useCheckDevice(breakPoints) {
40
+ const serialized = breakPoints ? JSON.stringify(breakPoints) : "";
41
+ const queries = useMemo(() => {
42
+ if (!breakPoints) return buildQueries(DEFAULT_BREAKPOINTS);
43
+ if (isLegacy(breakPoints)) return toLegacyQueries(breakPoints);
44
+ return buildQueries(breakPoints);
45
+ }, [serialized]);
46
+ const [result, setResult] = useState(() => {
47
+ const init = {};
48
+ for (const [key, query] of Object.entries(queries)) {
49
+ init[key] = getMatchMedia(query);
50
+ }
51
+ return init;
52
+ });
53
+ useEffect(() => {
54
+ if (typeof window === "undefined") return;
55
+ const mqls = Object.entries(queries).map(([key, query]) => ({
56
+ key,
57
+ mql: window.matchMedia(query)
58
+ }));
59
+ const update = () => {
60
+ setResult((prev) => {
61
+ const next = {};
62
+ let changed = false;
63
+ for (const { key, mql } of mqls) {
64
+ next[key] = mql.matches;
65
+ if (next[key] !== prev[key]) changed = true;
66
+ }
67
+ return changed ? next : prev;
68
+ });
69
+ };
70
+ for (const { mql } of mqls) mql.addEventListener("change", update);
71
+ update();
72
+ return () => {
73
+ for (const { mql } of mqls) mql.removeEventListener("change", update);
74
+ };
75
+ }, [queries]);
76
+ return result;
77
+ }
78
+ var useCheckDevice_default = useCheckDevice;
79
+
80
+ export { useCheckDevice_default };
@@ -0,0 +1,48 @@
1
+ import { cn } from './chunk-MCKOWMLS.mjs';
2
+ import * as React from 'react';
3
+ import { cva } from 'class-variance-authority';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ var avatarVariants = cva("nexus-avatar", {
7
+ variants: {
8
+ size: {
9
+ xs: "nexus-avatar--xs",
10
+ sm: "nexus-avatar--sm",
11
+ md: "nexus-avatar--md",
12
+ lg: "nexus-avatar--lg",
13
+ xl: "nexus-avatar--xl"
14
+ },
15
+ shape: {
16
+ circle: "nexus-avatar--circle",
17
+ square: "nexus-avatar--square"
18
+ }
19
+ },
20
+ defaultVariants: { size: "md", shape: "circle" }
21
+ });
22
+ var DefaultIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z" }) });
23
+ var Avatar = React.forwardRef(
24
+ ({ className, size, shape, src, alt, fallback, children, onImageError, ...props }, ref) => {
25
+ const [imgError, setImgError] = React.useState(false);
26
+ React.useEffect(() => {
27
+ setImgError(false);
28
+ }, [src]);
29
+ const handleError = React.useCallback(() => {
30
+ setImgError(true);
31
+ onImageError?.();
32
+ }, [onImageError]);
33
+ const showFallback = !src || imgError;
34
+ const iconSize = size === "xs" ? "nexus-avatar__icon--xs" : size === "sm" ? "nexus-avatar__icon--sm" : size === "lg" ? "nexus-avatar__icon--lg" : size === "xl" ? "nexus-avatar__icon--xl" : "nexus-avatar__icon--md";
35
+ return /* @__PURE__ */ jsx("div", { ref, role: "img", "aria-label": alt ?? void 0, className: cn(avatarVariants({ size, shape }), className), ...props, children: children ? children : showFallback ? fallback ?? /* @__PURE__ */ jsx(DefaultIcon, { className: iconSize }) : /* @__PURE__ */ jsx(
36
+ "img",
37
+ {
38
+ src,
39
+ alt: alt ?? "",
40
+ className: "nexus-avatar__img",
41
+ onError: handleError
42
+ }
43
+ ) });
44
+ }
45
+ );
46
+ Avatar.displayName = "Avatar";
47
+
48
+ export { Avatar, avatarVariants };