@nexus-cross/design-system 1.0.6-beta.2 → 1.0.6

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 (135) hide show
  1. package/DESIGN.md +185 -0
  2. package/cursor-rules/nexus-ui-api.mdc +223 -7
  3. package/cursor-rules/nexus-ui-components.mdc +44 -17
  4. package/dist/alert.d.mts +17 -0
  5. package/dist/alert.d.ts +17 -0
  6. package/dist/alert.js +16 -0
  7. package/dist/alert.mjs +3 -0
  8. package/dist/badge.d.mts +18 -0
  9. package/dist/badge.d.ts +18 -0
  10. package/dist/badge.js +16 -0
  11. package/dist/badge.mjs +3 -0
  12. package/dist/breadcrumb.d.mts +15 -0
  13. package/dist/breadcrumb.d.ts +15 -0
  14. package/dist/breadcrumb.js +12 -0
  15. package/dist/breadcrumb.mjs +3 -0
  16. package/dist/chunks/chunk-2N2EPBO4.js +120 -0
  17. package/dist/chunks/{chunk-AFSEYJZT.js → chunk-2T7RUYEK.js} +175 -50
  18. package/dist/chunks/chunk-2UPGFY6E.mjs +76 -0
  19. package/dist/chunks/chunk-3ZWN66YH.js +53 -0
  20. package/dist/chunks/chunk-5PQ3UCKF.js +99 -0
  21. package/dist/chunks/chunk-6BWOKTVQ.mjs +87 -0
  22. package/dist/chunks/chunk-6DBRL6NA.mjs +81 -0
  23. package/dist/chunks/chunk-B5O6W3Z4.mjs +73 -0
  24. package/dist/chunks/chunk-BJM3NDT2.mjs +368 -0
  25. package/dist/chunks/chunk-C2DSAJTL.js +109 -0
  26. package/dist/chunks/chunk-CUTMLBC3.mjs +86 -0
  27. package/dist/chunks/chunk-CV4GMFWP.js +174 -0
  28. package/dist/chunks/chunk-DICN6GKE.js +99 -0
  29. package/dist/chunks/chunk-DYPPVXQF.js +143 -0
  30. package/dist/chunks/chunk-EJY7IVSK.mjs +31 -0
  31. package/dist/chunks/chunk-FUIBYZZ4.mjs +98 -0
  32. package/dist/chunks/{chunk-HNLI646G.mjs → chunk-GN6X27QI.mjs} +9 -2
  33. package/dist/chunks/chunk-H2G5FMRN.mjs +75 -0
  34. package/dist/chunks/chunk-H2V7RHYV.mjs +120 -0
  35. package/dist/chunks/chunk-MMCA33FW.mjs +85 -0
  36. package/dist/chunks/chunk-NZHK76R3.js +109 -0
  37. package/dist/chunks/chunk-P73MEU7N.mjs +150 -0
  38. package/dist/chunks/chunk-PDJTSQOC.js +59 -0
  39. package/dist/chunks/chunk-PXBZEAZQ.mjs +5 -0
  40. package/dist/chunks/chunk-QRNHFOLG.js +7 -0
  41. package/dist/chunks/chunk-S2GMEC43.js +109 -0
  42. package/dist/chunks/{chunk-VGO4Z2WH.js → chunk-SUIT4XKB.js} +8 -1
  43. package/dist/chunks/chunk-X3CTJ7TD.js +108 -0
  44. package/dist/chunks/chunk-XGIJZ3NZ.js +160 -0
  45. package/dist/chunks/chunk-YO5MSDPX.mjs +36 -0
  46. package/dist/chunks/chunk-ZI4LN2B2.js +96 -0
  47. package/dist/chunks/chunk-ZU4AWAFT.mjs +137 -0
  48. package/dist/date-picker.d.mts +17 -0
  49. package/dist/date-picker.d.ts +17 -0
  50. package/dist/date-picker.js +12 -0
  51. package/dist/date-picker.mjs +3 -0
  52. package/dist/dropdown-menu.d.mts +30 -0
  53. package/dist/dropdown-menu.d.ts +30 -0
  54. package/dist/dropdown-menu.js +32 -0
  55. package/dist/dropdown-menu.mjs +3 -0
  56. package/dist/empty-state.d.mts +16 -0
  57. package/dist/empty-state.d.ts +16 -0
  58. package/dist/empty-state.js +16 -0
  59. package/dist/empty-state.mjs +3 -0
  60. package/dist/index.d.mts +14 -0
  61. package/dist/index.d.ts +14 -0
  62. package/dist/index.js +269 -157
  63. package/dist/index.mjs +30 -18
  64. package/dist/modal/index.js +12 -12
  65. package/dist/modal/index.mjs +3 -3
  66. package/dist/number-input.d.mts +5 -6
  67. package/dist/number-input.d.ts +5 -6
  68. package/dist/number-input.js +4 -4
  69. package/dist/number-input.mjs +1 -1
  70. package/dist/nx-image.d.mts +13 -0
  71. package/dist/nx-image.d.ts +13 -0
  72. package/dist/nx-image.js +12 -0
  73. package/dist/nx-image.mjs +3 -0
  74. package/dist/progress.d.mts +18 -0
  75. package/dist/progress.d.ts +18 -0
  76. package/dist/progress.js +16 -0
  77. package/dist/progress.mjs +3 -0
  78. package/dist/schemas/_all.json +840 -13
  79. package/dist/schemas/alert.json +49 -0
  80. package/dist/schemas/badge.json +76 -0
  81. package/dist/schemas/breadcrumb.json +47 -0
  82. package/dist/schemas/datePicker.json +56 -0
  83. package/dist/schemas/dropdownMenu.json +83 -0
  84. package/dist/schemas/emptyState.json +44 -0
  85. package/dist/schemas/numberInput.json +27 -8
  86. package/dist/schemas/nxImage.json +56 -0
  87. package/dist/schemas/progress.json +63 -0
  88. package/dist/schemas/slider.json +78 -0
  89. package/dist/schemas/stepper.json +73 -0
  90. package/dist/schemas/tagInput.json +70 -0
  91. package/dist/schemas/textArea.json +26 -1
  92. package/dist/schemas/toggleGroup.json +88 -0
  93. package/dist/schemas.d.mts +628 -144
  94. package/dist/schemas.d.ts +628 -144
  95. package/dist/schemas.js +177 -7
  96. package/dist/schemas.mjs +166 -8
  97. package/dist/slider.d.mts +20 -0
  98. package/dist/slider.d.ts +20 -0
  99. package/dist/slider.js +16 -0
  100. package/dist/slider.mjs +3 -0
  101. package/dist/stepper.d.mts +20 -0
  102. package/dist/stepper.d.ts +20 -0
  103. package/dist/stepper.js +16 -0
  104. package/dist/stepper.mjs +3 -0
  105. package/dist/styles/layer.js +2 -2
  106. package/dist/styles/layer.mjs +1 -1
  107. package/dist/styles.css +1615 -185
  108. package/dist/styles.js +2 -2
  109. package/dist/styles.layered.css +1615 -185
  110. package/dist/styles.mjs +1 -1
  111. package/dist/table.d.mts +40 -25
  112. package/dist/table.d.ts +40 -25
  113. package/dist/table.js +7 -7
  114. package/dist/table.mjs +1 -1
  115. package/dist/tag-input.d.mts +21 -0
  116. package/dist/tag-input.d.ts +21 -0
  117. package/dist/tag-input.js +16 -0
  118. package/dist/tag-input.mjs +3 -0
  119. package/dist/text-area.d.mts +5 -1
  120. package/dist/text-area.d.ts +5 -1
  121. package/dist/text-area.js +3 -3
  122. package/dist/text-area.mjs +1 -1
  123. package/dist/toggle-group.d.mts +36 -0
  124. package/dist/toggle-group.d.ts +36 -0
  125. package/dist/toggle-group.js +16 -0
  126. package/dist/toggle-group.mjs +3 -0
  127. package/package.json +69 -3
  128. package/scripts/setup-cursor-rules.cjs +15 -1
  129. package/dist/chunks/chunk-26BUGBOY.mjs +0 -57
  130. package/dist/chunks/chunk-CLGH2RTS.js +0 -7
  131. package/dist/chunks/chunk-ECVAVQUY.mjs +0 -243
  132. package/dist/chunks/chunk-UPCWJWXR.mjs +0 -5
  133. package/dist/chunks/chunk-WR55D4ZS.js +0 -80
  134. package/dist/chunks/{chunk-3VFBPFZF.mjs → chunk-CWMLTXOH.mjs} +2 -2
  135. package/dist/chunks/{chunk-U53UA76K.js → chunk-HFBTS42N.js} +2 -2
@@ -0,0 +1,109 @@
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 badgeVariants = classVarianceAuthority.cva("nexus-badge", {
29
+ variants: {
30
+ variant: {
31
+ danger: "nexus-badge--danger",
32
+ primary: "nexus-badge--primary",
33
+ secondary: "nexus-badge--secondary",
34
+ info: "nexus-badge--info",
35
+ success: "nexus-badge--success",
36
+ warning: "nexus-badge--warning"
37
+ },
38
+ size: {
39
+ sm: "nexus-badge--sm",
40
+ md: "nexus-badge--md",
41
+ lg: "nexus-badge--lg"
42
+ }
43
+ },
44
+ defaultVariants: {
45
+ variant: "danger",
46
+ size: "md"
47
+ }
48
+ });
49
+ var Badge = React__namespace.forwardRef(
50
+ ({
51
+ className,
52
+ children,
53
+ variant,
54
+ size,
55
+ count,
56
+ max = 99,
57
+ dot = false,
58
+ showZero = false,
59
+ offset,
60
+ style,
61
+ ...props
62
+ }, ref) => {
63
+ const displayCount = count !== void 0 && max !== void 0 && count > max ? `${max}+` : count;
64
+ const isHidden = !dot && (count === void 0 || count === 0 && !showZero);
65
+ const badgeStyle = {
66
+ ...style,
67
+ ...offset ? { "--nexus-badge-offset-x": `${offset[0]}px`, "--nexus-badge-offset-y": `${offset[1]}px` } : {}
68
+ };
69
+ if (!children) {
70
+ if (isHidden) return null;
71
+ return /* @__PURE__ */ jsxRuntime.jsx(
72
+ "span",
73
+ {
74
+ ref,
75
+ className: chunkCZC76ZD5_js.cn(
76
+ badgeVariants({ variant, size }),
77
+ dot && "nexus-badge--dot",
78
+ className
79
+ ),
80
+ style: badgeStyle,
81
+ ...props,
82
+ children: !dot && displayCount
83
+ }
84
+ );
85
+ }
86
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nexus-badge-wrapper", style: { position: "relative", display: "inline-flex" }, children: [
87
+ children,
88
+ !isHidden && /* @__PURE__ */ jsxRuntime.jsx(
89
+ "span",
90
+ {
91
+ ref,
92
+ className: chunkCZC76ZD5_js.cn(
93
+ badgeVariants({ variant, size }),
94
+ dot && "nexus-badge--dot",
95
+ "nexus-badge--positioned",
96
+ className
97
+ ),
98
+ style: badgeStyle,
99
+ ...props,
100
+ children: !dot && displayCount
101
+ }
102
+ )
103
+ ] });
104
+ }
105
+ );
106
+ Badge.displayName = "Badge";
107
+
108
+ exports.Badge = Badge;
109
+ exports.badgeVariants = badgeVariants;
@@ -328,7 +328,14 @@ function Table({
328
328
  ] }) }) });
329
329
  }
330
330
 
331
- exports.Table = Table;
331
+ // src/table/index.ts
332
+ var Table2 = Object.assign(Table, {
333
+ Row: TableRow,
334
+ Column: TdColumn,
335
+ HighlightProvider: TableHighlightProvider
336
+ });
337
+
338
+ exports.Table = Table2;
332
339
  exports.TableHighlightProvider = TableHighlightProvider;
333
340
  exports.TableRow = TableRow;
334
341
  exports.TdColumn = TdColumn;
@@ -0,0 +1,108 @@
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 stepperVariants = classVarianceAuthority.cva("nexus-stepper", {
29
+ variants: {
30
+ orientation: {
31
+ horizontal: "nexus-stepper--horizontal",
32
+ vertical: "nexus-stepper--vertical"
33
+ },
34
+ size: {
35
+ sm: "nexus-stepper--sm",
36
+ md: "nexus-stepper--md"
37
+ }
38
+ },
39
+ defaultVariants: {
40
+ orientation: "horizontal",
41
+ size: "md"
42
+ }
43
+ });
44
+ var CheckIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.5 8.5l3 3 6-6", strokeLinecap: "round", strokeLinejoin: "round" }) });
45
+ var Stepper = React__namespace.forwardRef(
46
+ ({ className, orientation, size, steps, current = 0, status = "process", ...props }, ref) => {
47
+ const isHorizontal = orientation !== "vertical";
48
+ return /* @__PURE__ */ jsxRuntime.jsx(
49
+ "div",
50
+ {
51
+ ref,
52
+ className: chunkCZC76ZD5_js.cn(stepperVariants({ orientation, size }), className),
53
+ "aria-label": "Progress",
54
+ ...props,
55
+ children: steps.map((step, i) => {
56
+ const state = i < current ? "completed" : i === current ? status === "error" ? "error" : "active" : "pending";
57
+ const isFirst = i === 0;
58
+ const isLast = i === steps.length - 1;
59
+ const prevCompleted = i <= current;
60
+ const nextCompleted = i < current;
61
+ return /* @__PURE__ */ jsxRuntime.jsxs(
62
+ "div",
63
+ {
64
+ className: chunkCZC76ZD5_js.cn("nexus-stepper__step", `nexus-stepper__step--${state}`),
65
+ children: [
66
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-stepper__indicator-wrap", children: isHorizontal ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
67
+ /* @__PURE__ */ jsxRuntime.jsx(
68
+ "div",
69
+ {
70
+ className: chunkCZC76ZD5_js.cn(
71
+ "nexus-stepper__connector",
72
+ isFirst && "nexus-stepper__connector--hidden",
73
+ prevCompleted && "nexus-stepper__connector--completed"
74
+ )
75
+ }
76
+ ),
77
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-stepper__indicator", children: state === "completed" ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: "nexus-stepper__check" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: i + 1 }) }),
78
+ /* @__PURE__ */ jsxRuntime.jsx(
79
+ "div",
80
+ {
81
+ className: chunkCZC76ZD5_js.cn(
82
+ "nexus-stepper__connector",
83
+ isLast && "nexus-stepper__connector--hidden",
84
+ nextCompleted && "nexus-stepper__connector--completed"
85
+ )
86
+ }
87
+ )
88
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
89
+ !isFirst && /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkCZC76ZD5_js.cn("nexus-stepper__connector", prevCompleted && "nexus-stepper__connector--completed") }),
90
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-stepper__indicator", children: state === "completed" ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: "nexus-stepper__check" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: i + 1 }) })
91
+ ] }) }),
92
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-stepper__content", children: [
93
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-stepper__label", children: step.label }),
94
+ step.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-stepper__description", children: step.description })
95
+ ] })
96
+ ]
97
+ },
98
+ i
99
+ );
100
+ })
101
+ }
102
+ );
103
+ }
104
+ );
105
+ Stepper.displayName = "Stepper";
106
+
107
+ exports.Stepper = Stepper;
108
+ exports.stepperVariants = stepperVariants;
@@ -0,0 +1,160 @@
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 textAreaVariants = classVarianceAuthority.cva("nexus-textarea", {
29
+ variants: {
30
+ size: {
31
+ lg: "nexus-textarea--lg",
32
+ md: "nexus-textarea--md"
33
+ },
34
+ state: {
35
+ default: "nexus-textarea--default",
36
+ error: "nexus-textarea--error"
37
+ }
38
+ },
39
+ defaultVariants: { size: "lg", state: "default" }
40
+ });
41
+ var TextArea = React__namespace.forwardRef(
42
+ ({
43
+ className,
44
+ size,
45
+ error,
46
+ label,
47
+ description,
48
+ showCount,
49
+ resize = "default",
50
+ maxLength,
51
+ onValueChange,
52
+ onChange,
53
+ value: controlledValue,
54
+ defaultValue,
55
+ disabled,
56
+ id,
57
+ ...props
58
+ }, ref) => {
59
+ const fallbackId = React__namespace.useRef(
60
+ `nexus-ta-${Math.random().toString(36).slice(2, 9)}`
61
+ );
62
+ const inputId = id || fallbackId.current;
63
+ const textareaRef = React__namespace.useRef(null);
64
+ const setRef = React__namespace.useCallback(
65
+ (node) => {
66
+ textareaRef.current = node;
67
+ if (typeof ref === "function") ref(node);
68
+ else if (ref)
69
+ ref.current = node;
70
+ },
71
+ [ref]
72
+ );
73
+ const isControlled = controlledValue !== void 0;
74
+ const [internalValue, setInternalValue] = React__namespace.useState(
75
+ () => defaultValue != null ? String(defaultValue) : ""
76
+ );
77
+ const currentValue = isControlled ? String(controlledValue) : internalValue;
78
+ const charCount = currentValue.length;
79
+ const isOverLimit = !!(maxLength && charCount > maxLength);
80
+ const state = error || isOverLimit ? "error" : "default";
81
+ const hasField = !!(label || description || showCount);
82
+ const autoResize = React__namespace.useCallback(() => {
83
+ const el = textareaRef.current;
84
+ if (!el || resize !== "auto") return;
85
+ el.style.height = "auto";
86
+ el.style.height = `${el.scrollHeight}px`;
87
+ }, [resize]);
88
+ React__namespace.useEffect(() => {
89
+ autoResize();
90
+ }, [currentValue, autoResize]);
91
+ const handleChange = React__namespace.useCallback(
92
+ (e) => {
93
+ if (!isControlled) setInternalValue(e.target.value);
94
+ onValueChange?.(e.target.value);
95
+ onChange?.(e);
96
+ },
97
+ [isControlled, onValueChange, onChange]
98
+ );
99
+ const resizeClass = resize === "default" ? "nexus-textarea--resize-default" : resize === "auto" ? "nexus-textarea--resize-auto" : "";
100
+ const textarea = /* @__PURE__ */ jsxRuntime.jsx(
101
+ "textarea",
102
+ {
103
+ ref: setRef,
104
+ id: label ? inputId : id,
105
+ className: chunkCZC76ZD5_js.cn(
106
+ textAreaVariants({ size, state }),
107
+ disabled && "nexus-textarea--disabled",
108
+ resizeClass,
109
+ !hasField && className
110
+ ),
111
+ maxLength: showCount ? void 0 : maxLength,
112
+ disabled,
113
+ "aria-invalid": error || isOverLimit || void 0,
114
+ "aria-describedby": description ? `${inputId}-desc` : void 0,
115
+ value: isControlled ? controlledValue : void 0,
116
+ defaultValue: !isControlled ? defaultValue : void 0,
117
+ onChange: handleChange,
118
+ ...props
119
+ }
120
+ );
121
+ if (!hasField) return textarea;
122
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkCZC76ZD5_js.cn("nexus-textarea-field", className), children: [
123
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "nexus-textarea-field__label", htmlFor: inputId, children: label }),
124
+ textarea,
125
+ (description || showCount && maxLength) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-textarea-field__footer", children: [
126
+ description && /* @__PURE__ */ jsxRuntime.jsx(
127
+ "p",
128
+ {
129
+ id: `${inputId}-desc`,
130
+ className: chunkCZC76ZD5_js.cn(
131
+ "nexus-textarea-field__description",
132
+ (error || isOverLimit) && "nexus-textarea-field__description--error"
133
+ ),
134
+ children: description
135
+ }
136
+ ),
137
+ showCount && maxLength && /* @__PURE__ */ jsxRuntime.jsxs(
138
+ "span",
139
+ {
140
+ className: chunkCZC76ZD5_js.cn(
141
+ "nexus-textarea-field__count",
142
+ isOverLimit && "nexus-textarea-field__count--error"
143
+ ),
144
+ "aria-live": "polite",
145
+ "aria-atomic": "true",
146
+ children: [
147
+ charCount,
148
+ "/",
149
+ maxLength
150
+ ]
151
+ }
152
+ )
153
+ ] })
154
+ ] });
155
+ }
156
+ );
157
+ TextArea.displayName = "TextArea";
158
+
159
+ exports.TextArea = TextArea;
160
+ exports.textAreaVariants = textAreaVariants;
@@ -0,0 +1,36 @@
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 emptyStateVariants = cva("nexus-empty-state", {
7
+ variants: {
8
+ size: {
9
+ sm: "nexus-empty-state--sm",
10
+ md: "nexus-empty-state--md",
11
+ lg: "nexus-empty-state--lg"
12
+ }
13
+ },
14
+ defaultVariants: { size: "md" }
15
+ });
16
+ var DefaultIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx("path", { d: "M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4", strokeLinecap: "round", strokeLinejoin: "round" }) });
17
+ var EmptyState = React.forwardRef(
18
+ ({ className, size, icon, title, description, action, children, ...props }, ref) => /* @__PURE__ */ jsxs(
19
+ "div",
20
+ {
21
+ ref,
22
+ className: cn(emptyStateVariants({ size }), className),
23
+ ...props,
24
+ children: [
25
+ /* @__PURE__ */ jsx("div", { className: "nexus-empty-state__icon", children: icon ?? /* @__PURE__ */ jsx(DefaultIcon, { className: "nexus-empty-state__default-icon" }) }),
26
+ title && /* @__PURE__ */ jsx("h3", { className: "nexus-empty-state__title", children: title }),
27
+ description && /* @__PURE__ */ jsx("p", { className: "nexus-empty-state__description", children: description }),
28
+ children,
29
+ action && /* @__PURE__ */ jsx("div", { className: "nexus-empty-state__action", children: action })
30
+ ]
31
+ }
32
+ )
33
+ );
34
+ EmptyState.displayName = "EmptyState";
35
+
36
+ export { EmptyState, emptyStateVariants };
@@ -0,0 +1,96 @@
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 progressVariants = classVarianceAuthority.cva("nexus-progress", {
29
+ variants: {
30
+ variant: {
31
+ primary: "nexus-progress--primary",
32
+ success: "nexus-progress--success",
33
+ warning: "nexus-progress--warning",
34
+ danger: "nexus-progress--danger",
35
+ info: "nexus-progress--info"
36
+ },
37
+ size: {
38
+ sm: "nexus-progress--sm",
39
+ md: "nexus-progress--md",
40
+ lg: "nexus-progress--lg"
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ variant: "primary",
45
+ size: "md"
46
+ }
47
+ });
48
+ var Progress = React__namespace.forwardRef(
49
+ ({
50
+ className,
51
+ variant,
52
+ size,
53
+ value = 0,
54
+ max = 100,
55
+ showValue = false,
56
+ indeterminate = false,
57
+ label,
58
+ ...props
59
+ }, ref) => {
60
+ const percentage = Math.min(100, Math.max(0, value / max * 100));
61
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkCZC76ZD5_js.cn("nexus-progress-wrapper", className), ref, ...props, children: [
62
+ (label || showValue) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-progress__header", children: [
63
+ label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-progress__label", children: label }),
64
+ showValue && !indeterminate && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nexus-progress__value", children: [
65
+ Math.round(percentage),
66
+ "%"
67
+ ] })
68
+ ] }),
69
+ /* @__PURE__ */ jsxRuntime.jsx(
70
+ "div",
71
+ {
72
+ className: chunkCZC76ZD5_js.cn(progressVariants({ variant, size })),
73
+ role: "progressbar",
74
+ "aria-valuenow": indeterminate ? void 0 : value,
75
+ "aria-valuemin": 0,
76
+ "aria-valuemax": max,
77
+ "aria-label": label,
78
+ children: /* @__PURE__ */ jsxRuntime.jsx(
79
+ "div",
80
+ {
81
+ className: chunkCZC76ZD5_js.cn(
82
+ "nexus-progress__bar",
83
+ indeterminate && "nexus-progress__bar--indeterminate"
84
+ ),
85
+ style: indeterminate ? void 0 : { width: `${percentage}%` }
86
+ }
87
+ )
88
+ }
89
+ )
90
+ ] });
91
+ }
92
+ );
93
+ Progress.displayName = "Progress";
94
+
95
+ exports.Progress = Progress;
96
+ exports.progressVariants = progressVariants;
@@ -0,0 +1,137 @@
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 textAreaVariants = cva("nexus-textarea", {
7
+ variants: {
8
+ size: {
9
+ lg: "nexus-textarea--lg",
10
+ md: "nexus-textarea--md"
11
+ },
12
+ state: {
13
+ default: "nexus-textarea--default",
14
+ error: "nexus-textarea--error"
15
+ }
16
+ },
17
+ defaultVariants: { size: "lg", state: "default" }
18
+ });
19
+ var TextArea = React.forwardRef(
20
+ ({
21
+ className,
22
+ size,
23
+ error,
24
+ label,
25
+ description,
26
+ showCount,
27
+ resize = "default",
28
+ maxLength,
29
+ onValueChange,
30
+ onChange,
31
+ value: controlledValue,
32
+ defaultValue,
33
+ disabled,
34
+ id,
35
+ ...props
36
+ }, ref) => {
37
+ const fallbackId = React.useRef(
38
+ `nexus-ta-${Math.random().toString(36).slice(2, 9)}`
39
+ );
40
+ const inputId = id || fallbackId.current;
41
+ const textareaRef = React.useRef(null);
42
+ const setRef = React.useCallback(
43
+ (node) => {
44
+ textareaRef.current = node;
45
+ if (typeof ref === "function") ref(node);
46
+ else if (ref)
47
+ ref.current = node;
48
+ },
49
+ [ref]
50
+ );
51
+ const isControlled = controlledValue !== void 0;
52
+ const [internalValue, setInternalValue] = React.useState(
53
+ () => defaultValue != null ? String(defaultValue) : ""
54
+ );
55
+ const currentValue = isControlled ? String(controlledValue) : internalValue;
56
+ const charCount = currentValue.length;
57
+ const isOverLimit = !!(maxLength && charCount > maxLength);
58
+ const state = error || isOverLimit ? "error" : "default";
59
+ const hasField = !!(label || description || showCount);
60
+ const autoResize = React.useCallback(() => {
61
+ const el = textareaRef.current;
62
+ if (!el || resize !== "auto") return;
63
+ el.style.height = "auto";
64
+ el.style.height = `${el.scrollHeight}px`;
65
+ }, [resize]);
66
+ React.useEffect(() => {
67
+ autoResize();
68
+ }, [currentValue, autoResize]);
69
+ const handleChange = React.useCallback(
70
+ (e) => {
71
+ if (!isControlled) setInternalValue(e.target.value);
72
+ onValueChange?.(e.target.value);
73
+ onChange?.(e);
74
+ },
75
+ [isControlled, onValueChange, onChange]
76
+ );
77
+ const resizeClass = resize === "default" ? "nexus-textarea--resize-default" : resize === "auto" ? "nexus-textarea--resize-auto" : "";
78
+ const textarea = /* @__PURE__ */ jsx(
79
+ "textarea",
80
+ {
81
+ ref: setRef,
82
+ id: label ? inputId : id,
83
+ className: cn(
84
+ textAreaVariants({ size, state }),
85
+ disabled && "nexus-textarea--disabled",
86
+ resizeClass,
87
+ !hasField && className
88
+ ),
89
+ maxLength: showCount ? void 0 : maxLength,
90
+ disabled,
91
+ "aria-invalid": error || isOverLimit || void 0,
92
+ "aria-describedby": description ? `${inputId}-desc` : void 0,
93
+ value: isControlled ? controlledValue : void 0,
94
+ defaultValue: !isControlled ? defaultValue : void 0,
95
+ onChange: handleChange,
96
+ ...props
97
+ }
98
+ );
99
+ if (!hasField) return textarea;
100
+ return /* @__PURE__ */ jsxs("div", { className: cn("nexus-textarea-field", className), children: [
101
+ label && /* @__PURE__ */ jsx("label", { className: "nexus-textarea-field__label", htmlFor: inputId, children: label }),
102
+ textarea,
103
+ (description || showCount && maxLength) && /* @__PURE__ */ jsxs("div", { className: "nexus-textarea-field__footer", children: [
104
+ description && /* @__PURE__ */ jsx(
105
+ "p",
106
+ {
107
+ id: `${inputId}-desc`,
108
+ className: cn(
109
+ "nexus-textarea-field__description",
110
+ (error || isOverLimit) && "nexus-textarea-field__description--error"
111
+ ),
112
+ children: description
113
+ }
114
+ ),
115
+ showCount && maxLength && /* @__PURE__ */ jsxs(
116
+ "span",
117
+ {
118
+ className: cn(
119
+ "nexus-textarea-field__count",
120
+ isOverLimit && "nexus-textarea-field__count--error"
121
+ ),
122
+ "aria-live": "polite",
123
+ "aria-atomic": "true",
124
+ children: [
125
+ charCount,
126
+ "/",
127
+ maxLength
128
+ ]
129
+ }
130
+ )
131
+ ] })
132
+ ] });
133
+ }
134
+ );
135
+ TextArea.displayName = "TextArea";
136
+
137
+ export { TextArea, textAreaVariants };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+
3
+ interface DatePickerProps {
4
+ value?: Date;
5
+ defaultValue?: Date;
6
+ onChange?: (date: Date | undefined) => void;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ minDate?: Date;
10
+ maxDate?: Date;
11
+ locale?: 'ko' | 'en';
12
+ formatStr?: string;
13
+ className?: string;
14
+ }
15
+ declare const DatePicker: React.FC<DatePickerProps>;
16
+
17
+ export { DatePicker, type DatePickerProps };