@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,57 @@
1
+ import { cn } from './chunk-MCKOWMLS.mjs';
2
+ import * as React from 'react';
3
+ import { cva } from 'class-variance-authority';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ var textAreaVariants = cva("nexus-textarea", {
7
+ variants: {
8
+ state: {
9
+ default: "nexus-textarea--default",
10
+ error: "nexus-textarea--error"
11
+ }
12
+ },
13
+ defaultVariants: { state: "default" }
14
+ });
15
+ var TextArea = React.forwardRef(
16
+ ({ className, error, showCount, maxLength, onValueChange, onChange, ...props }, ref) => {
17
+ const state = error ? "error" : "default";
18
+ const [count, setCount] = React.useState(0);
19
+ const handleChange = React.useCallback(
20
+ (e) => {
21
+ setCount(e.target.value.length);
22
+ onValueChange?.(e.target.value);
23
+ onChange?.(e);
24
+ },
25
+ [onValueChange, onChange]
26
+ );
27
+ return /* @__PURE__ */ jsxs("div", { className: "nexus-textarea-wrap", children: [
28
+ /* @__PURE__ */ jsx(
29
+ "textarea",
30
+ {
31
+ ref,
32
+ className: cn(textAreaVariants({ state }), className),
33
+ maxLength,
34
+ "aria-invalid": error || void 0,
35
+ onChange: handleChange,
36
+ ...props
37
+ }
38
+ ),
39
+ showCount && maxLength && /* @__PURE__ */ jsxs(
40
+ "p",
41
+ {
42
+ className: "nexus-textarea-count",
43
+ "aria-live": "polite",
44
+ "aria-atomic": "true",
45
+ children: [
46
+ /* @__PURE__ */ jsx("span", { className: "nexus-textarea-count__current", children: count.toLocaleString() }),
47
+ "/",
48
+ maxLength.toLocaleString()
49
+ ]
50
+ }
51
+ )
52
+ ] });
53
+ }
54
+ );
55
+ TextArea.displayName = "TextArea";
56
+
57
+ export { TextArea, textAreaVariants };
@@ -0,0 +1,36 @@
1
+ import { useState, useRef, useCallback } from 'react';
2
+
3
+ // src/hooks/useInView.ts
4
+ function useInView(options) {
5
+ const { triggerOnce = true, rootMargin = "200px", threshold = 0 } = options ?? {};
6
+ const [isInView, setIsInView] = useState(false);
7
+ const observerRef = useRef(null);
8
+ const ref = useCallback(
9
+ (node) => {
10
+ if (observerRef.current) {
11
+ observerRef.current.disconnect();
12
+ observerRef.current = null;
13
+ }
14
+ if (!node) return;
15
+ if (triggerOnce && isInView) return;
16
+ const observer = new IntersectionObserver(
17
+ ([entry]) => {
18
+ if (entry.isIntersecting) {
19
+ setIsInView(true);
20
+ if (triggerOnce) observer.disconnect();
21
+ } else if (!triggerOnce) {
22
+ setIsInView(false);
23
+ }
24
+ },
25
+ { rootMargin, threshold }
26
+ );
27
+ observer.observe(node);
28
+ observerRef.current = observer;
29
+ },
30
+ [triggerOnce, rootMargin, threshold, isInView]
31
+ );
32
+ return { ref, isInView };
33
+ }
34
+ var useInView_default = useInView;
35
+
36
+ export { useInView, useInView_default };
@@ -0,0 +1,98 @@
1
+ 'use strict';
2
+
3
+ var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
4
+ var React = require('react');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
+
27
+ var Marquee = React__namespace.forwardRef(
28
+ ({ direction = "left", speed = 40, pauseOnHover = false, gap = 16, children, className, style, ...props }, ref) => {
29
+ const containerRef = React__namespace.useRef(null);
30
+ const [copies, setCopies] = React__namespace.useState(2);
31
+ const [prefersReducedMotion, setPrefersReducedMotion] = React__namespace.useState(false);
32
+ React__namespace.useEffect(() => {
33
+ const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
34
+ setPrefersReducedMotion(mq.matches);
35
+ const handler = (e) => setPrefersReducedMotion(e.matches);
36
+ mq.addEventListener("change", handler);
37
+ return () => mq.removeEventListener("change", handler);
38
+ }, []);
39
+ const isHorizontal = direction === "left" || direction === "right";
40
+ const isReverse = direction === "right" || direction === "down";
41
+ React__namespace.useEffect(() => {
42
+ const container = containerRef.current;
43
+ if (!container) return;
44
+ const measure = () => {
45
+ const firstChild = container.firstElementChild;
46
+ if (!firstChild) return;
47
+ const containerSize = isHorizontal ? container.offsetWidth : container.offsetHeight;
48
+ const childSize = isHorizontal ? firstChild.offsetWidth : firstChild.offsetHeight;
49
+ if (childSize > 0) {
50
+ const needed = Math.ceil(containerSize / childSize) + 2;
51
+ setCopies(Math.max(2, needed));
52
+ }
53
+ };
54
+ measure();
55
+ const observer = new ResizeObserver(measure);
56
+ observer.observe(container);
57
+ return () => observer.disconnect();
58
+ }, [isHorizontal, children]);
59
+ const animationName = isHorizontal ? "nx-marquee-x" : "nx-marquee-y";
60
+ const translate = isHorizontal ? isReverse ? "translateX(0)" : "translateX(0)" : isReverse ? "translateY(0)" : "translateY(0)";
61
+ const endTranslate = isHorizontal ? `translateX(${isReverse ? "" : "-"}100%)` : `translateY(${isReverse ? "" : "-"}100%)`;
62
+ const innerStyle = {
63
+ display: "flex",
64
+ flexDirection: isHorizontal ? "row" : "column",
65
+ gap,
66
+ ...prefersReducedMotion ? {} : {
67
+ animation: `${animationName} ${speed}s linear infinite`,
68
+ ...isReverse ? { animationDirection: "reverse" } : {}
69
+ }
70
+ };
71
+ const keyframes = `
72
+ @keyframes ${animationName} {
73
+ from { transform: ${translate}; }
74
+ to { transform: ${endTranslate}; }
75
+ }
76
+ `;
77
+ return /* @__PURE__ */ jsxRuntime.jsxs(
78
+ "div",
79
+ {
80
+ ref,
81
+ className: chunkCZC76ZD5_js.cn(
82
+ "nexus-marquee",
83
+ pauseOnHover && "nexus-marquee--pause-on-hover",
84
+ className
85
+ ),
86
+ style,
87
+ ...props,
88
+ children: [
89
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: keyframes }),
90
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, style: innerStyle, children: Array.from({ length: copies }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: isHorizontal ? "row" : "column", gap, flexShrink: 0 }, children }, i)) })
91
+ ]
92
+ }
93
+ );
94
+ }
95
+ );
96
+ Marquee.displayName = "Marquee";
97
+
98
+ exports.Marquee = Marquee;
@@ -0,0 +1,139 @@
1
+ import { cn } from './chunk-MCKOWMLS.mjs';
2
+ import * as React from 'react';
3
+ import { cva } from 'class-variance-authority';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ var paginationVariants = cva("nexus-pagination", {
7
+ variants: {
8
+ size: {
9
+ sm: "nexus-pagination--sm",
10
+ md: "nexus-pagination--md"
11
+ }
12
+ },
13
+ defaultVariants: { size: "md" }
14
+ });
15
+ var pageButtonVariants = cva("nexus-page-btn", {
16
+ variants: {
17
+ size: {
18
+ sm: "nexus-page-btn--sm",
19
+ md: "nexus-page-btn--md"
20
+ },
21
+ active: {
22
+ true: "nexus-page-btn--active",
23
+ false: "nexus-page-btn--inactive"
24
+ }
25
+ },
26
+ defaultVariants: { size: "md", active: false }
27
+ });
28
+ function generatePages(current, total, siblingCount) {
29
+ const totalNumbers = siblingCount * 2 + 5;
30
+ if (total <= totalNumbers) {
31
+ return Array.from({ length: total }, (_, i) => i + 1);
32
+ }
33
+ const leftSibling = Math.max(current - siblingCount, 1);
34
+ const rightSibling = Math.min(current + siblingCount, total);
35
+ const showLeftDots = leftSibling > 2;
36
+ const showRightDots = rightSibling < total - 1;
37
+ if (!showLeftDots && showRightDots) {
38
+ const leftCount = 3 + 2 * siblingCount;
39
+ const leftRange = Array.from({ length: leftCount }, (_, i) => i + 1);
40
+ return [...leftRange, "dots", total];
41
+ }
42
+ if (showLeftDots && !showRightDots) {
43
+ const rightCount = 3 + 2 * siblingCount;
44
+ const rightRange = Array.from({ length: rightCount }, (_, i) => total - rightCount + i + 1);
45
+ return [1, "dots", ...rightRange];
46
+ }
47
+ const middleRange = Array.from(
48
+ { length: rightSibling - leftSibling + 1 },
49
+ (_, i) => leftSibling + i
50
+ );
51
+ return [1, "dots", ...middleRange, "dots", total];
52
+ }
53
+ var ChevronsLeft = ({ className }) => /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
54
+ /* @__PURE__ */ jsx("path", { d: "M7 4L3 8l4 4" }),
55
+ /* @__PURE__ */ jsx("path", { d: "M13 4L9 8l4 4" })
56
+ ] });
57
+ var ChevronLeft = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M10 4L6 8l4 4" }) });
58
+ var ChevronRight = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M6 4l4 4-4 4" }) });
59
+ var ChevronsRight = ({ className }) => /* @__PURE__ */ jsxs("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
60
+ /* @__PURE__ */ jsx("path", { d: "M3 4l4 4-4 4" }),
61
+ /* @__PURE__ */ jsx("path", { d: "M9 4l4 4-4 4" })
62
+ ] });
63
+ var Pagination = React.forwardRef(
64
+ ({ currentPage, totalPages, siblingCount = 1, showEdges = false, onPageChange, size, className }, ref) => {
65
+ const pages = generatePages(currentPage, totalPages, siblingCount);
66
+ const iconSize = size === "sm" ? "nexus-page-icon--sm" : "nexus-page-icon--md";
67
+ return /* @__PURE__ */ jsxs("nav", { ref, role: "navigation", "aria-label": "pagination", className: cn(paginationVariants({ size }), className), children: [
68
+ showEdges && /* @__PURE__ */ jsx(
69
+ "button",
70
+ {
71
+ type: "button",
72
+ className: cn(pageButtonVariants({ size, active: false })),
73
+ disabled: currentPage <= 1,
74
+ onClick: () => onPageChange(1),
75
+ "aria-label": "First page",
76
+ children: /* @__PURE__ */ jsx(ChevronsLeft, { className: iconSize })
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsx(
80
+ "button",
81
+ {
82
+ type: "button",
83
+ className: cn(pageButtonVariants({ size, active: false })),
84
+ disabled: currentPage <= 1,
85
+ onClick: () => onPageChange(currentPage - 1),
86
+ "aria-label": "Previous page",
87
+ children: /* @__PURE__ */ jsx(ChevronLeft, { className: iconSize })
88
+ }
89
+ ),
90
+ pages.map(
91
+ (page, i) => page === "dots" ? /* @__PURE__ */ jsx(
92
+ "span",
93
+ {
94
+ className: cn(pageButtonVariants({ size, active: false })),
95
+ style: { pointerEvents: "none" },
96
+ children: "\xB7\xB7\xB7"
97
+ },
98
+ `dots-${i}`
99
+ ) : /* @__PURE__ */ jsx(
100
+ "button",
101
+ {
102
+ type: "button",
103
+ className: cn(pageButtonVariants({ size, active: page === currentPage })),
104
+ onClick: () => onPageChange(page),
105
+ "aria-current": page === currentPage ? "page" : void 0,
106
+ "aria-label": `Page ${page}`,
107
+ children: page
108
+ },
109
+ page
110
+ )
111
+ ),
112
+ /* @__PURE__ */ jsx(
113
+ "button",
114
+ {
115
+ type: "button",
116
+ className: cn(pageButtonVariants({ size, active: false })),
117
+ disabled: currentPage >= totalPages,
118
+ onClick: () => onPageChange(currentPage + 1),
119
+ "aria-label": "Next page",
120
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: iconSize })
121
+ }
122
+ ),
123
+ showEdges && /* @__PURE__ */ jsx(
124
+ "button",
125
+ {
126
+ type: "button",
127
+ className: cn(pageButtonVariants({ size, active: false })),
128
+ disabled: currentPage >= totalPages,
129
+ onClick: () => onPageChange(totalPages),
130
+ "aria-label": "Last page",
131
+ children: /* @__PURE__ */ jsx(ChevronsRight, { className: iconSize })
132
+ }
133
+ )
134
+ ] });
135
+ }
136
+ );
137
+ Pagination.displayName = "Pagination";
138
+
139
+ export { Pagination, pageButtonVariants, paginationVariants };
@@ -0,0 +1,166 @@
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 tabListVariants = classVarianceAuthority.cva("nexus-tab-list", {
29
+ variants: {
30
+ variant: {
31
+ line: "",
32
+ pill: "nexus-tab-list--pill"
33
+ }
34
+ },
35
+ defaultVariants: { variant: "line" }
36
+ });
37
+ var tabTriggerVariants = classVarianceAuthority.cva("nexus-tab-trigger", {
38
+ variants: {
39
+ variant: {
40
+ line: "nexus-tab-trigger--line",
41
+ pill: "nexus-tab-trigger--pill"
42
+ },
43
+ size: {
44
+ sm: "nexus-tab-trigger--sm",
45
+ md: "nexus-tab-trigger--md"
46
+ },
47
+ active: {
48
+ true: "",
49
+ false: ""
50
+ }
51
+ },
52
+ compoundVariants: [
53
+ { variant: "line", active: true, className: "nexus-tab-trigger--line-active" },
54
+ { variant: "pill", active: true, className: "nexus-tab-trigger--pill-active" }
55
+ ],
56
+ defaultVariants: { variant: "line", size: "md", active: false }
57
+ });
58
+ function Tab({
59
+ items,
60
+ activeKey: controlledKey,
61
+ defaultActiveKey,
62
+ variant,
63
+ size,
64
+ destroyInactive = false,
65
+ onTabChange,
66
+ className,
67
+ tabListClassName,
68
+ tabPanelClassName
69
+ }) {
70
+ const [internalKey, setInternalKey] = React__namespace.useState(
71
+ defaultActiveKey ?? items[0]?.key ?? ""
72
+ );
73
+ const currentKey = controlledKey ?? internalKey;
74
+ const handleSelect = React__namespace.useCallback(
75
+ (key) => {
76
+ if (controlledKey === void 0) setInternalKey(key);
77
+ onTabChange?.(key);
78
+ },
79
+ [controlledKey, onTabChange]
80
+ );
81
+ const handleKeyDown = React__namespace.useCallback(
82
+ (e, index) => {
83
+ const enabledItems = items.filter((i) => !i.disabled);
84
+ const currentIdx = enabledItems.findIndex((i) => i.key === items[index].key);
85
+ let nextIdx = currentIdx;
86
+ if (e.key === "ArrowRight") nextIdx = (currentIdx + 1) % enabledItems.length;
87
+ if (e.key === "ArrowLeft") nextIdx = (currentIdx - 1 + enabledItems.length) % enabledItems.length;
88
+ if (e.key === "Home") nextIdx = 0;
89
+ if (e.key === "End") nextIdx = enabledItems.length - 1;
90
+ if (nextIdx !== currentIdx) {
91
+ e.preventDefault();
92
+ const next = enabledItems[nextIdx];
93
+ handleSelect(next.key);
94
+ const btn = e.currentTarget.parentElement?.querySelector(
95
+ `[data-tab-key="${next.key}"]`
96
+ );
97
+ btn?.focus();
98
+ }
99
+ },
100
+ [items, handleSelect]
101
+ );
102
+ const activeItem = items.find((i) => i.key === currentKey);
103
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
104
+ /* @__PURE__ */ jsxRuntime.jsx(
105
+ "div",
106
+ {
107
+ role: "tablist",
108
+ className: chunkCZC76ZD5_js.cn(tabListVariants({ variant }), tabListClassName),
109
+ children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(
110
+ "button",
111
+ {
112
+ type: "button",
113
+ role: "tab",
114
+ "data-tab-key": item.key,
115
+ id: `tab-${item.key}`,
116
+ "aria-selected": item.key === currentKey,
117
+ "aria-controls": `panel-${item.key}`,
118
+ "aria-disabled": item.disabled || void 0,
119
+ tabIndex: item.key === currentKey ? 0 : -1,
120
+ className: chunkCZC76ZD5_js.cn(
121
+ tabTriggerVariants({
122
+ variant,
123
+ size,
124
+ active: item.key === currentKey
125
+ }),
126
+ item.disabled && "nexus-tab-trigger--disabled"
127
+ ),
128
+ onClick: () => !item.disabled && handleSelect(item.key),
129
+ onKeyDown: (e) => handleKeyDown(e, i),
130
+ children: item.label
131
+ },
132
+ item.key
133
+ ))
134
+ }
135
+ ),
136
+ destroyInactive ? activeItem?.children !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
137
+ "div",
138
+ {
139
+ role: "tabpanel",
140
+ id: `panel-${currentKey}`,
141
+ "aria-labelledby": `tab-${currentKey}`,
142
+ className: tabPanelClassName,
143
+ children: activeItem.children
144
+ },
145
+ currentKey
146
+ ) : items.map(
147
+ (item) => item.children !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
148
+ "div",
149
+ {
150
+ role: "tabpanel",
151
+ id: `panel-${item.key}`,
152
+ "aria-labelledby": `tab-${item.key}`,
153
+ className: tabPanelClassName,
154
+ hidden: item.key !== currentKey,
155
+ children: item.children
156
+ },
157
+ item.key
158
+ ) : null
159
+ )
160
+ ] });
161
+ }
162
+ Tab.displayName = "Tab";
163
+
164
+ exports.Tab = Tab;
165
+ exports.tabListVariants = tabListVariants;
166
+ exports.tabTriggerVariants = tabTriggerVariants;
@@ -0,0 +1,135 @@
1
+ import { cn } from './chunk-MCKOWMLS.mjs';
2
+ import * as React from 'react';
3
+ import { cva } from 'class-variance-authority';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ var radioGroupVariants = cva("nexus-radio-group", {
7
+ variants: {
8
+ orientation: {
9
+ horizontal: "nexus-radio-group--horizontal",
10
+ vertical: "nexus-radio-group--vertical"
11
+ }
12
+ },
13
+ defaultVariants: { orientation: "vertical" }
14
+ });
15
+ var radioItemVariants = cva("nexus-radio-item", {
16
+ variants: {
17
+ size: {
18
+ sm: "nexus-radio-item--sm",
19
+ md: "nexus-radio-item--md"
20
+ }
21
+ },
22
+ defaultVariants: { size: "md" }
23
+ });
24
+ var RadioGroupCtx = React.createContext({
25
+ name: ""
26
+ });
27
+ var RadioGroup = React.forwardRef(
28
+ ({
29
+ className,
30
+ orientation,
31
+ name,
32
+ value: controlledValue,
33
+ defaultValue,
34
+ size = "md",
35
+ disabled,
36
+ onValueChange,
37
+ children,
38
+ ...props
39
+ }, ref) => {
40
+ const [uncontrolled, setUncontrolled] = React.useState(defaultValue ?? "");
41
+ const isControlled = controlledValue !== void 0;
42
+ const value = isControlled ? controlledValue : uncontrolled;
43
+ const handleChange = React.useCallback(
44
+ (v) => {
45
+ if (!isControlled) setUncontrolled(v);
46
+ onValueChange?.(v);
47
+ },
48
+ [isControlled, onValueChange]
49
+ );
50
+ const ctx = React.useMemo(
51
+ () => ({ name, value, size, disabled, onValueChange: handleChange }),
52
+ [name, value, size, disabled, handleChange]
53
+ );
54
+ return /* @__PURE__ */ jsx(RadioGroupCtx.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
55
+ "div",
56
+ {
57
+ ref,
58
+ role: "radiogroup",
59
+ className: cn(radioGroupVariants({ orientation }), className),
60
+ ...props,
61
+ children
62
+ }
63
+ ) });
64
+ }
65
+ );
66
+ RadioGroup.displayName = "RadioGroup";
67
+ var RadioItem = React.forwardRef(
68
+ ({
69
+ className,
70
+ value,
71
+ size: sizeProp,
72
+ disabled: disabledProp,
73
+ label,
74
+ children,
75
+ ...props
76
+ }, ref) => {
77
+ const ctx = React.useContext(RadioGroupCtx);
78
+ const size = sizeProp ?? ctx.size ?? "md";
79
+ const disabled = disabledProp ?? ctx.disabled;
80
+ const checked = ctx.value === value;
81
+ const content = label ?? children;
82
+ const handleChange = React.useCallback(() => {
83
+ ctx.onValueChange?.(value);
84
+ }, [ctx, value]);
85
+ return /* @__PURE__ */ jsxs(
86
+ "label",
87
+ {
88
+ className: cn(
89
+ radioItemVariants({ size }),
90
+ disabled ? "nexus-radio-item--disabled" : "nexus-radio-item--pointer",
91
+ className
92
+ ),
93
+ children: [
94
+ /* @__PURE__ */ jsx(
95
+ "input",
96
+ {
97
+ ref,
98
+ type: "radio",
99
+ className: "nexus-sr-only",
100
+ name: ctx.name,
101
+ value,
102
+ checked,
103
+ disabled,
104
+ onChange: handleChange,
105
+ ...props
106
+ }
107
+ ),
108
+ /* @__PURE__ */ jsx(
109
+ "span",
110
+ {
111
+ className: cn(
112
+ size === "sm" ? "nexus-radio__circle--sm" : "nexus-radio__circle--md",
113
+ "nexus-radio__circle",
114
+ checked ? "nexus-radio__circle--checked" : "nexus-radio__circle--unchecked"
115
+ ),
116
+ children: checked && /* @__PURE__ */ jsx(
117
+ "span",
118
+ {
119
+ className: cn(
120
+ "nexus-radio__dot",
121
+ size === "sm" ? "nexus-radio__dot--sm" : "nexus-radio__dot--md"
122
+ )
123
+ }
124
+ )
125
+ }
126
+ ),
127
+ content && /* @__PURE__ */ jsx("span", { className: "nexus-radio__label", children: content })
128
+ ]
129
+ }
130
+ );
131
+ }
132
+ );
133
+ RadioItem.displayName = "RadioItem";
134
+
135
+ export { RadioGroup, RadioItem, radioGroupVariants, radioItemVariants };