@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,267 @@
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 numberInputVariants = classVarianceAuthority.cva("nexus-number-input", {
29
+ variants: {
30
+ size: {
31
+ sm: "nexus-number-input--sm",
32
+ md: "nexus-number-input--md",
33
+ lg: "nexus-number-input--lg",
34
+ xl: "nexus-number-input--xl"
35
+ },
36
+ state: {
37
+ default: "nexus-number-input--default",
38
+ error: "nexus-number-input--error"
39
+ }
40
+ },
41
+ defaultVariants: { size: "md", state: "default" }
42
+ });
43
+ var ChevronUp = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "nexus-number-input__step-icon", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 7.5L6 4.5l3 3" }) });
44
+ var ChevronDown = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "nexus-number-input__step-icon", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 4.5L6 7.5l3-3" }) });
45
+ function clampValue(val, min, max) {
46
+ let result = val;
47
+ if (min !== void 0) result = Math.max(min, result);
48
+ if (max !== void 0) result = Math.min(max, result);
49
+ return result;
50
+ }
51
+ function roundToDigit(val, digit) {
52
+ const factor = Math.pow(10, digit);
53
+ return Math.round(val * factor) / factor;
54
+ }
55
+ function numberInputBind(ref, direction) {
56
+ return {
57
+ onPointerDown: (e) => {
58
+ if (direction === "increment") ref.current?.startIncrement(e);
59
+ else ref.current?.startDecrement(e);
60
+ },
61
+ onPointerUp: () => ref.current?.stop(),
62
+ onPointerLeave: () => ref.current?.stop()
63
+ };
64
+ }
65
+ var NumberInput = React__namespace.forwardRef(
66
+ ({
67
+ className,
68
+ size,
69
+ error,
70
+ value,
71
+ min,
72
+ max,
73
+ step = 1,
74
+ digit = 0,
75
+ hideButtons = false,
76
+ disabled,
77
+ readOnly,
78
+ onValueChange,
79
+ placeholder,
80
+ ...props
81
+ }, ref) => {
82
+ const inputRef = React__namespace.useRef(null);
83
+ const state = error ? "error" : "default";
84
+ const [internalValue, setInternalValue] = React__namespace.useState(value?.toString() ?? "");
85
+ const internalValueRef = React__namespace.useRef(internalValue);
86
+ const timeoutRef = React__namespace.useRef(null);
87
+ const pressCountRef = React__namespace.useRef(0);
88
+ React__namespace.useEffect(() => {
89
+ internalValueRef.current = internalValue;
90
+ }, [internalValue]);
91
+ React__namespace.useEffect(() => {
92
+ setInternalValue(value?.toString() ?? "");
93
+ }, [value]);
94
+ const commitValue = React__namespace.useCallback(
95
+ (raw) => {
96
+ if (raw === "" || raw === "-") {
97
+ setInternalValue(raw);
98
+ onValueChange?.(void 0);
99
+ return;
100
+ }
101
+ const parsed = parseFloat(raw);
102
+ if (isNaN(parsed)) return;
103
+ const clamped = clampValue(roundToDigit(parsed, digit), min, max);
104
+ setInternalValue(clamped.toString());
105
+ onValueChange?.(clamped);
106
+ },
107
+ [digit, min, max, onValueChange]
108
+ );
109
+ const handleInputChange = React__namespace.useCallback(
110
+ (e) => {
111
+ const raw = e.target.value;
112
+ const regex = digit > 0 ? /^-?\d*\.?\d*$/ : /^-?\d*$/;
113
+ if (!regex.test(raw)) return;
114
+ setInternalValue(raw);
115
+ },
116
+ [digit]
117
+ );
118
+ const handleBlur = React__namespace.useCallback(() => {
119
+ commitValue(internalValue);
120
+ }, [internalValue, commitValue]);
121
+ const adjust = React__namespace.useCallback(
122
+ (delta) => {
123
+ const current = parseFloat(internalValueRef.current) || 0;
124
+ const next = clampValue(roundToDigit(current + delta, digit), min, max);
125
+ const nextStr = next.toString();
126
+ internalValueRef.current = nextStr;
127
+ setInternalValue(nextStr);
128
+ onValueChange?.(next);
129
+ },
130
+ [digit, min, max, onValueChange]
131
+ );
132
+ const handleKeyDown = React__namespace.useCallback(
133
+ (e) => {
134
+ if (e.key === "Enter") commitValue(internalValue);
135
+ if (e.key === "ArrowUp") {
136
+ e.preventDefault();
137
+ adjust(step);
138
+ }
139
+ if (e.key === "ArrowDown") {
140
+ e.preventDefault();
141
+ adjust(-step);
142
+ }
143
+ },
144
+ [internalValue, commitValue, step, adjust]
145
+ );
146
+ const stopRepeat = React__namespace.useCallback(() => {
147
+ if (timeoutRef.current) clearTimeout(timeoutRef.current);
148
+ timeoutRef.current = null;
149
+ pressCountRef.current = 0;
150
+ }, []);
151
+ const startRepeat = React__namespace.useCallback(
152
+ (delta, e) => {
153
+ e.preventDefault();
154
+ adjust(delta);
155
+ pressCountRef.current = 0;
156
+ timeoutRef.current = setTimeout(() => {
157
+ const accelerate = () => {
158
+ adjust(delta);
159
+ pressCountRef.current += 1;
160
+ let delay = 100;
161
+ if (pressCountRef.current > 20) delay = 30;
162
+ else if (pressCountRef.current > 10) delay = 50;
163
+ else if (pressCountRef.current > 5) delay = 75;
164
+ timeoutRef.current = setTimeout(accelerate, delay);
165
+ };
166
+ accelerate();
167
+ }, 400);
168
+ },
169
+ [adjust]
170
+ );
171
+ React__namespace.useEffect(() => () => stopRepeat(), [stopRepeat]);
172
+ const startRepeatRef = React__namespace.useRef(startRepeat);
173
+ startRepeatRef.current = startRepeat;
174
+ const stopRepeatRef = React__namespace.useRef(stopRepeat);
175
+ stopRepeatRef.current = stopRepeat;
176
+ const adjustRef = React__namespace.useRef(adjust);
177
+ adjustRef.current = adjust;
178
+ React__namespace.useImperativeHandle(
179
+ ref,
180
+ () => ({
181
+ get input() {
182
+ return inputRef.current;
183
+ },
184
+ increment: () => adjustRef.current(step),
185
+ decrement: () => adjustRef.current(-step),
186
+ startIncrement: (e) => startRepeatRef.current(step, e),
187
+ startDecrement: (e) => startRepeatRef.current(-step, e),
188
+ stop: () => stopRepeatRef.current()
189
+ }),
190
+ [step]
191
+ );
192
+ const padSize = size === "sm" ? "nexus-number-input__field--sm" : size === "xl" ? "nexus-number-input__field--xl" : size === "lg" ? "nexus-number-input__field--lg" : "nexus-number-input__field--md";
193
+ const showButtons = !hideButtons && !readOnly && !disabled;
194
+ const numValue = parseFloat(internalValue) || 0;
195
+ const isMinDisabled = min !== void 0 && numValue <= min;
196
+ const isMaxDisabled = max !== void 0 && numValue >= max;
197
+ return /* @__PURE__ */ jsxRuntime.jsxs(
198
+ "div",
199
+ {
200
+ className: chunkCZC76ZD5_js.cn(
201
+ numberInputVariants({ size, state }),
202
+ disabled && "nexus-number-input--disabled",
203
+ className
204
+ ),
205
+ children: [
206
+ /* @__PURE__ */ jsxRuntime.jsx(
207
+ "input",
208
+ {
209
+ ref: inputRef,
210
+ type: "text",
211
+ inputMode: "decimal",
212
+ role: "spinbutton",
213
+ className: chunkCZC76ZD5_js.cn("nexus-number-input__field", padSize),
214
+ value: internalValue,
215
+ disabled,
216
+ readOnly,
217
+ placeholder,
218
+ "aria-invalid": error || void 0,
219
+ "aria-valuemin": min,
220
+ "aria-valuemax": max,
221
+ "aria-valuenow": internalValue ? parseFloat(internalValue) || void 0 : void 0,
222
+ onChange: handleInputChange,
223
+ onBlur: handleBlur,
224
+ onKeyDown: handleKeyDown,
225
+ ...props
226
+ }
227
+ ),
228
+ showButtons && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-number-input__buttons", children: [
229
+ /* @__PURE__ */ jsxRuntime.jsx(
230
+ "button",
231
+ {
232
+ type: "button",
233
+ tabIndex: -1,
234
+ disabled: isMaxDisabled,
235
+ className: "nexus-number-input__step nexus-number-input__step--up",
236
+ onPointerDown: (e) => startRepeat(step, e),
237
+ onPointerUp: stopRepeat,
238
+ onPointerLeave: stopRepeat,
239
+ "aria-label": "Increase",
240
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronUp, {})
241
+ }
242
+ ),
243
+ /* @__PURE__ */ jsxRuntime.jsx(
244
+ "button",
245
+ {
246
+ type: "button",
247
+ tabIndex: -1,
248
+ disabled: isMinDisabled,
249
+ className: "nexus-number-input__step nexus-number-input__step--down",
250
+ onPointerDown: (e) => startRepeat(-step, e),
251
+ onPointerUp: stopRepeat,
252
+ onPointerLeave: stopRepeat,
253
+ "aria-label": "Decrease",
254
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
255
+ }
256
+ )
257
+ ] })
258
+ ]
259
+ }
260
+ );
261
+ }
262
+ );
263
+ NumberInput.displayName = "NumberInput";
264
+
265
+ exports.NumberInput = NumberInput;
266
+ exports.numberInputBind = numberInputBind;
267
+ exports.numberInputVariants = numberInputVariants;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+
4
+ // src/components/ClientOnly.tsx
5
+ function ClientOnly({ children, fallback = null }) {
6
+ const [mounted, setMounted] = React.useState(false);
7
+ React.useEffect(() => {
8
+ setMounted(true);
9
+ }, []);
10
+ return mounted ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsx(Fragment, { children: fallback });
11
+ }
12
+ ClientOnly.displayName = "ClientOnly";
13
+
14
+ export { ClientOnly };
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ // src/hooks/useInView.ts
6
+ function useInView(options) {
7
+ const { triggerOnce = true, rootMargin = "200px", threshold = 0 } = options ?? {};
8
+ const [isInView, setIsInView] = react.useState(false);
9
+ const observerRef = react.useRef(null);
10
+ const ref = react.useCallback(
11
+ (node) => {
12
+ if (observerRef.current) {
13
+ observerRef.current.disconnect();
14
+ observerRef.current = null;
15
+ }
16
+ if (!node) return;
17
+ if (triggerOnce && isInView) return;
18
+ const observer = new IntersectionObserver(
19
+ ([entry]) => {
20
+ if (entry.isIntersecting) {
21
+ setIsInView(true);
22
+ if (triggerOnce) observer.disconnect();
23
+ } else if (!triggerOnce) {
24
+ setIsInView(false);
25
+ }
26
+ },
27
+ { rootMargin, threshold }
28
+ );
29
+ observer.observe(node);
30
+ observerRef.current = observer;
31
+ },
32
+ [triggerOnce, rootMargin, threshold, isInView]
33
+ );
34
+ return { ref, isInView };
35
+ }
36
+ var useInView_default = useInView;
37
+
38
+ exports.useInView = useInView;
39
+ exports.useInView_default = useInView_default;
@@ -0,0 +1,116 @@
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
+ var ChevronDown = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 6l4 4 4-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) });
8
+ var Ellipsis = ({
9
+ className,
10
+ content = "",
11
+ triggerMore = "more",
12
+ triggerLess = "less",
13
+ lineClamp = 2,
14
+ defaultShortened = true,
15
+ observingEnvs = [],
16
+ onShowMoreLessClick
17
+ }) => {
18
+ const contentRef = react.useRef(null);
19
+ const isMeasuringRef = react.useRef(false);
20
+ const prevObservingEnvs = react.useRef([...observingEnvs]);
21
+ const [shortened, setShortened] = react.useState(defaultShortened);
22
+ const [triggerVisible, setTriggerVisible] = react.useState(false);
23
+ const allocateContentElementStyle = react.useCallback(
24
+ (style) => {
25
+ const el = contentRef.current;
26
+ if (!el) return;
27
+ if (style) {
28
+ el.style.maxHeight = `${style.openHeight}px`;
29
+ el.style.minHeight = `${style.closeHeight}px`;
30
+ el.style.height = `${style.closeHeight}px`;
31
+ } else {
32
+ el.style.maxHeight = "";
33
+ el.style.minHeight = "";
34
+ el.style.height = "";
35
+ }
36
+ },
37
+ []
38
+ );
39
+ const resetContentElementAfterMeasuring = react.useCallback(
40
+ ({ openHeight, closeHeight }) => {
41
+ allocateContentElementStyle({ openHeight, closeHeight });
42
+ setTriggerVisible(closeHeight + 10 < openHeight);
43
+ setShortened(defaultShortened);
44
+ isMeasuringRef.current = false;
45
+ },
46
+ [defaultShortened, allocateContentElementStyle]
47
+ );
48
+ const initializeContentElement = react.useCallback(() => {
49
+ allocateContentElementStyle(null);
50
+ setShortened(true);
51
+ isMeasuringRef.current = true;
52
+ }, [allocateContentElementStyle]);
53
+ const handleToggle = react.useCallback((e) => {
54
+ e.stopPropagation();
55
+ setShortened((prev) => !prev);
56
+ }, []);
57
+ const contentStyle = react.useMemo(
58
+ () => shortened ? {
59
+ display: "-webkit-box",
60
+ WebkitLineClamp: lineClamp,
61
+ WebkitBoxOrient: "vertical",
62
+ overflow: "hidden",
63
+ height: contentRef.current?.style.minHeight
64
+ } : {
65
+ WebkitLineClamp: void 0,
66
+ height: contentRef.current?.style.maxHeight
67
+ },
68
+ [shortened, lineClamp]
69
+ );
70
+ react.useLayoutEffect(() => {
71
+ if (contentRef.current) initializeContentElement();
72
+ }, [initializeContentElement]);
73
+ react.useLayoutEffect(() => {
74
+ if (!contentRef.current) return;
75
+ const isEnvChanged = observingEnvs.length ? observingEnvs.some((env, i) => env !== prevObservingEnvs.current[i]) : false;
76
+ if (isEnvChanged) {
77
+ prevObservingEnvs.current = [...observingEnvs];
78
+ initializeContentElement();
79
+ }
80
+ }, [observingEnvs, initializeContentElement]);
81
+ react.useLayoutEffect(() => {
82
+ const el = contentRef.current;
83
+ if (shortened && isMeasuringRef.current && el) {
84
+ resetContentElementAfterMeasuring({
85
+ openHeight: el.scrollHeight,
86
+ closeHeight: el.offsetHeight
87
+ });
88
+ }
89
+ }, [shortened, content, observingEnvs, resetContentElementAfterMeasuring]);
90
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkCZC76ZD5_js.cn("nexus-ellipsis", className), children: [
91
+ /* @__PURE__ */ jsxRuntime.jsx(
92
+ "div",
93
+ {
94
+ ref: contentRef,
95
+ className: "nexus-ellipsis__content",
96
+ style: contentStyle,
97
+ children: typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { dangerouslySetInnerHTML: { __html: content } }) : content
98
+ }
99
+ ),
100
+ triggerVisible && /* @__PURE__ */ jsxRuntime.jsxs(
101
+ "button",
102
+ {
103
+ type: "button",
104
+ onClick: onShowMoreLessClick ?? handleToggle,
105
+ className: chunkCZC76ZD5_js.cn("nexus-ellipsis__trigger", !shortened && "nexus-ellipsis__trigger--expanded"),
106
+ "aria-expanded": !shortened,
107
+ children: [
108
+ shortened ? triggerMore : triggerLess,
109
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { className: "nexus-ellipsis__chevron" })
110
+ ]
111
+ }
112
+ )
113
+ ] });
114
+ };
115
+
116
+ exports.Ellipsis = Ellipsis;
@@ -0,0 +1,56 @@
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 Skeleton = React__namespace.forwardRef(
28
+ ({
29
+ className,
30
+ children,
31
+ as: Tag = "div",
32
+ circle = false,
33
+ width,
34
+ height,
35
+ style,
36
+ ...props
37
+ }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
38
+ Tag,
39
+ {
40
+ ref,
41
+ role: "status",
42
+ "aria-label": "Loading",
43
+ className: chunkCZC76ZD5_js.cn(
44
+ "nexus-skeleton",
45
+ circle ? "nexus-skeleton--circle" : "nexus-skeleton--rect",
46
+ className
47
+ ),
48
+ style: { width, height, ...style },
49
+ ...props,
50
+ children: children && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-skeleton__children", children })
51
+ }
52
+ )
53
+ );
54
+ Skeleton.displayName = "Skeleton";
55
+
56
+ exports.Skeleton = Skeleton;
@@ -0,0 +1,48 @@
1
+ import { cn } from './chunk-MCKOWMLS.mjs';
2
+ import * as React from 'react';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+
5
+ var Spinner = React.forwardRef(
6
+ ({ className, size = 20, "aria-label": ariaLabel = "Loading", ...props }, ref) => /* @__PURE__ */ jsxs(
7
+ "svg",
8
+ {
9
+ ref,
10
+ role: "status",
11
+ "aria-label": ariaLabel,
12
+ className: cn("nexus-spinner", className),
13
+ viewBox: "0 0 50 50",
14
+ fill: "none",
15
+ style: { width: size, height: size },
16
+ ...props,
17
+ children: [
18
+ /* @__PURE__ */ jsx(
19
+ "circle",
20
+ {
21
+ cx: "25",
22
+ cy: "25",
23
+ r: "20",
24
+ stroke: "currentColor",
25
+ strokeWidth: "5",
26
+ opacity: "0.3"
27
+ }
28
+ ),
29
+ /* @__PURE__ */ jsx(
30
+ "circle",
31
+ {
32
+ cx: "25",
33
+ cy: "25",
34
+ r: "20",
35
+ stroke: "currentColor",
36
+ strokeWidth: "5",
37
+ strokeLinecap: "round",
38
+ strokeDasharray: "90 150",
39
+ strokeDashoffset: "-35"
40
+ }
41
+ )
42
+ ]
43
+ }
44
+ )
45
+ );
46
+ Spinner.displayName = "Spinner";
47
+
48
+ export { Spinner };
@@ -0,0 +1,129 @@
1
+ 'use strict';
2
+
3
+ var chunkCZC76ZD5_js = require('./chunk-CZC76ZD5.js');
4
+ var React = require('react');
5
+ var vaul = require('vaul');
6
+ var classVarianceAuthority = require('class-variance-authority');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
+
29
+ var DrawerDirectionCtx = React__namespace.createContext("bottom");
30
+ var drawerOverlayVariants = classVarianceAuthority.cva("nexus-drawer-overlay", {
31
+ variants: {
32
+ blur: {
33
+ none: "",
34
+ sm: "nexus-drawer-overlay--blur-sm",
35
+ md: "nexus-drawer-overlay--blur-md"
36
+ }
37
+ },
38
+ defaultVariants: { blur: "none" }
39
+ });
40
+ var drawerContentVariants = classVarianceAuthority.cva("nexus-drawer-content", {
41
+ variants: {
42
+ direction: {
43
+ bottom: "nexus-drawer-content--bottom",
44
+ top: "nexus-drawer-content--top",
45
+ left: "nexus-drawer-content--left",
46
+ right: "nexus-drawer-content--right"
47
+ }
48
+ },
49
+ defaultVariants: { direction: "bottom" }
50
+ });
51
+ var DrawerRoot = ({ direction = "bottom", ...props }) => /* @__PURE__ */ jsxRuntime.jsx(DrawerDirectionCtx.Provider, { value: direction, children: /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Root, { shouldScaleBackground: false, direction, ...props }) });
52
+ var DrawerTrigger = (props) => /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Trigger, { ...props });
53
+ DrawerTrigger.displayName = "DrawerTrigger";
54
+ var DrawerContent = React__namespace.forwardRef(
55
+ ({
56
+ className,
57
+ children,
58
+ direction: directionProp,
59
+ showHandle = true,
60
+ blur,
61
+ overlayClassName,
62
+ ...props
63
+ }, ref) => {
64
+ const ctxDirection = React__namespace.useContext(DrawerDirectionCtx);
65
+ const direction = directionProp ?? ctxDirection;
66
+ return /* @__PURE__ */ jsxRuntime.jsxs(vaul.Drawer.Portal, { children: [
67
+ /* @__PURE__ */ jsxRuntime.jsx(
68
+ vaul.Drawer.Overlay,
69
+ {
70
+ className: chunkCZC76ZD5_js.cn(drawerOverlayVariants({ blur }), overlayClassName)
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsxRuntime.jsxs(
74
+ vaul.Drawer.Content,
75
+ {
76
+ ref,
77
+ className: chunkCZC76ZD5_js.cn(drawerContentVariants({ direction }), className),
78
+ ...props,
79
+ children: [
80
+ showHandle && (direction === "bottom" || direction === "top") && /* @__PURE__ */ jsxRuntime.jsx(
81
+ "div",
82
+ {
83
+ className: chunkCZC76ZD5_js.cn("nexus-drawer-handle", direction === "bottom" ? "nexus-drawer-handle--bottom" : "nexus-drawer-handle--top"),
84
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-drawer-handle__bar" })
85
+ }
86
+ ),
87
+ children
88
+ ]
89
+ }
90
+ )
91
+ ] });
92
+ }
93
+ );
94
+ DrawerContent.displayName = "DrawerContent";
95
+ var DrawerClose = (props) => /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Close, { ...props });
96
+ DrawerClose.displayName = "DrawerClose";
97
+ var DrawerTitle = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
98
+ vaul.Drawer.Title,
99
+ {
100
+ className: chunkCZC76ZD5_js.cn("nexus-drawer-title", className),
101
+ ...props
102
+ }
103
+ );
104
+ DrawerTitle.displayName = "DrawerTitle";
105
+ var DrawerDescription = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
106
+ vaul.Drawer.Description,
107
+ {
108
+ className: chunkCZC76ZD5_js.cn("nexus-drawer-description", className),
109
+ ...props
110
+ }
111
+ );
112
+ DrawerDescription.displayName = "DrawerDescription";
113
+ var Drawer = Object.assign(DrawerRoot, {
114
+ Trigger: DrawerTrigger,
115
+ Content: DrawerContent,
116
+ Close: DrawerClose,
117
+ Title: DrawerTitle,
118
+ Description: DrawerDescription
119
+ });
120
+
121
+ exports.Drawer = Drawer;
122
+ exports.DrawerClose = DrawerClose;
123
+ exports.DrawerContent = DrawerContent;
124
+ exports.DrawerDescription = DrawerDescription;
125
+ exports.DrawerRoot = DrawerRoot;
126
+ exports.DrawerTitle = DrawerTitle;
127
+ exports.DrawerTrigger = DrawerTrigger;
128
+ exports.drawerContentVariants = drawerContentVariants;
129
+ exports.drawerOverlayVariants = drawerOverlayVariants;