@nexus-cross/design-system 1.0.12 → 1.0.13
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.
- package/cursor-rules/CLAUDE.md +80 -0
- package/dist/chunks/{chunk-BQ6GJJB6.mjs → chunk-6ECGMUT6.mjs} +1 -1
- package/dist/chunks/{chunk-2WM23PO6.js → chunk-K574BYHQ.js} +7 -7
- package/dist/chunks/{chunk-WXMMOQXZ.js → chunk-V35IEPRL.js} +1 -1
- package/dist/chunks/{chunk-HI5XZ4PB.mjs → chunk-Z4YM7LU3.mjs} +7 -7
- package/dist/components/ToggleGroup.d.ts +2 -1
- package/dist/components/ToggleGroup.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/dist/schemas/_all.json +8 -2
- package/dist/schemas/toggle-group.d.ts +10 -5
- package/dist/schemas/toggle-group.d.ts.map +1 -1
- package/dist/schemas/toggleGroup.json +8 -2
- package/dist/schemas.js +4 -3
- package/dist/schemas.mjs +4 -3
- package/dist/styles/.generated/built.d.ts +1 -1
- package/dist/styles/.generated/built.d.ts.map +1 -1
- package/dist/styles/layer.js +2 -2
- package/dist/styles/layer.mjs +1 -1
- package/dist/styles.css +24 -12
- package/dist/styles.js +2 -2
- package/dist/styles.layered.css +24 -12
- package/dist/styles.mjs +1 -1
- package/dist/toggle-group.js +3 -3
- package/dist/toggle-group.mjs +1 -1
- package/package.json +2 -2
- package/scripts/setup-cursor-rules.cjs +14 -0
|
@@ -31,7 +31,8 @@ var toggleGroupVariants = classVarianceAuthority.cva("nexus-toggle-group", {
|
|
|
31
31
|
variants: {
|
|
32
32
|
variant: {
|
|
33
33
|
default: "nexus-toggle-group--default",
|
|
34
|
-
|
|
34
|
+
primary: "nexus-toggle-group--primary",
|
|
35
|
+
secondary: "nexus-toggle-group--secondary"
|
|
35
36
|
},
|
|
36
37
|
size: {
|
|
37
38
|
sm: "nexus-toggle-group--sm",
|
|
@@ -45,7 +46,7 @@ var toggleGroupVariants = classVarianceAuthority.cva("nexus-toggle-group", {
|
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
48
|
var ToggleGroup = React__namespace.forwardRef(
|
|
48
|
-
({ className, variant, size, items, disabled, required, ...props }, ref) => {
|
|
49
|
+
({ className, variant, size, items, disabled, required = true, ...props }, ref) => {
|
|
49
50
|
const rootRef = React__namespace.useRef(null);
|
|
50
51
|
const [animated, setAnimated] = React__namespace.useState(false);
|
|
51
52
|
const [pos, setPos] = React__namespace.useState(null);
|
|
@@ -62,10 +63,9 @@ var ToggleGroup = React__namespace.forwardRef(
|
|
|
62
63
|
React__namespace.useEffect(() => {
|
|
63
64
|
if (currentValue !== void 0) setTrackedValue(currentValue);
|
|
64
65
|
}, [currentValue]);
|
|
65
|
-
const isDefault = variant !== "outline";
|
|
66
66
|
React__namespace.useLayoutEffect(() => {
|
|
67
67
|
const root = rootRef.current;
|
|
68
|
-
if (!root
|
|
68
|
+
if (!root) return;
|
|
69
69
|
const activeVal = Array.isArray(trackedValue) ? trackedValue[0] : trackedValue;
|
|
70
70
|
if (!activeVal) {
|
|
71
71
|
setPos(null);
|
|
@@ -89,7 +89,7 @@ var ToggleGroup = React__namespace.forwardRef(
|
|
|
89
89
|
x: elRect.left - rootRect.left,
|
|
90
90
|
y: elRect.top - rootRect.top
|
|
91
91
|
});
|
|
92
|
-
}, [trackedValue, items
|
|
92
|
+
}, [trackedValue, items]);
|
|
93
93
|
React__namespace.useEffect(() => {
|
|
94
94
|
const frame = requestAnimationFrame(() => {
|
|
95
95
|
requestAnimationFrame(() => setAnimated(true));
|
|
@@ -141,7 +141,7 @@ var ToggleGroup = React__namespace.forwardRef(
|
|
|
141
141
|
disabled,
|
|
142
142
|
...rootProps,
|
|
143
143
|
children: [
|
|
144
|
-
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
145
145
|
"span",
|
|
146
146
|
{
|
|
147
147
|
className: chunkCZC76ZD5_js.cn(
|
|
@@ -157,7 +157,7 @@ var ToggleGroup = React__namespace.forwardRef(
|
|
|
157
157
|
{
|
|
158
158
|
value: item.value,
|
|
159
159
|
disabled: item.disabled,
|
|
160
|
-
className: "nexus-toggle-group__item",
|
|
160
|
+
className: chunkCZC76ZD5_js.cn("nexus-toggle-group__item", item.className),
|
|
161
161
|
children: [
|
|
162
162
|
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nexus-toggle-group__icon", children: item.icon }),
|
|
163
163
|
item.label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|