@nexus-cross/design-system 1.0.11 → 1.0.12
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/dist/chunks/{chunk-CV4GMFWP.js → chunk-2WM23PO6.js} +5 -3
- package/dist/chunks/{chunk-XKJO5Y4J.mjs → chunk-5J63FUAS.mjs} +3 -3
- package/dist/chunks/{chunk-6J7TZ4GP.mjs → chunk-BQ6GJJB6.mjs} +1 -1
- package/dist/chunks/{chunk-P73MEU7N.mjs → chunk-HI5XZ4PB.mjs} +5 -3
- package/dist/chunks/{chunk-2XV3XP3Y.js → chunk-LAGQ7J5A.js} +3 -3
- package/dist/chunks/{chunk-7B2CTQKB.js → chunk-WXMMOQXZ.js} +1 -1
- package/dist/components/ImageUpload.d.ts.map +1 -1
- package/dist/components/ToggleGroup.d.ts +2 -0
- package/dist/components/ToggleGroup.d.ts.map +1 -1
- package/dist/image-upload.js +3 -3
- package/dist/image-upload.mjs +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +2 -2
- package/dist/schemas/_all.json +4 -0
- package/dist/schemas/toggle-group.d.ts +3 -0
- package/dist/schemas/toggle-group.d.ts.map +1 -1
- package/dist/schemas/toggleGroup.json +4 -0
- package/dist/schemas.js +1 -0
- package/dist/schemas.mjs +1 -0
- 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 +7 -4
- package/dist/styles.js +2 -2
- package/dist/styles.layered.css +7 -4
- 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
|
@@ -45,7 +45,7 @@ var toggleGroupVariants = classVarianceAuthority.cva("nexus-toggle-group", {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
var ToggleGroup = React__namespace.forwardRef(
|
|
48
|
-
({ className, variant, size, items, disabled, ...props }, ref) => {
|
|
48
|
+
({ className, variant, size, items, disabled, required, ...props }, ref) => {
|
|
49
49
|
const rootRef = React__namespace.useRef(null);
|
|
50
50
|
const [animated, setAnimated] = React__namespace.useState(false);
|
|
51
51
|
const [pos, setPos] = React__namespace.useState(null);
|
|
@@ -98,21 +98,23 @@ var ToggleGroup = React__namespace.forwardRef(
|
|
|
98
98
|
}, []);
|
|
99
99
|
const handleSingleChange = React__namespace.useCallback(
|
|
100
100
|
(val) => {
|
|
101
|
+
if (required && !val) return;
|
|
101
102
|
setTrackedValue(val);
|
|
102
103
|
if (props.type !== "multiple") {
|
|
103
104
|
props.onValueChange?.(val);
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
|
-
[props.type, props.onValueChange]
|
|
107
|
+
[props.type, props.onValueChange, required]
|
|
107
108
|
);
|
|
108
109
|
const handleMultipleChange = React__namespace.useCallback(
|
|
109
110
|
(val) => {
|
|
111
|
+
if (required && val.length === 0) return;
|
|
110
112
|
setTrackedValue(val);
|
|
111
113
|
if (props.type === "multiple") {
|
|
112
114
|
props.onValueChange?.(val);
|
|
113
115
|
}
|
|
114
116
|
},
|
|
115
|
-
[props.type, props.onValueChange]
|
|
117
|
+
[props.type, props.onValueChange, required]
|
|
116
118
|
);
|
|
117
119
|
const rootProps = props.type === "multiple" ? {
|
|
118
120
|
type: "multiple",
|
|
@@ -171,15 +171,15 @@ var ImageUpload = React.forwardRef(
|
|
|
171
171
|
!hasField && className
|
|
172
172
|
),
|
|
173
173
|
children: [
|
|
174
|
-
/* @__PURE__ */ jsxs("div", { className: "nexus-image-upload__preview-
|
|
175
|
-
/* @__PURE__ */ jsx(
|
|
174
|
+
/* @__PURE__ */ jsxs("div", { className: "nexus-image-upload__preview-area", children: [
|
|
175
|
+
/* @__PURE__ */ jsx("div", { className: "nexus-image-upload__preview-wrapper", children: /* @__PURE__ */ jsx(
|
|
176
176
|
"img",
|
|
177
177
|
{
|
|
178
178
|
src: preview,
|
|
179
179
|
alt: "Uploaded preview",
|
|
180
180
|
className: "nexus-image-upload__preview"
|
|
181
181
|
}
|
|
182
|
-
),
|
|
182
|
+
) }),
|
|
183
183
|
!disabled && /* @__PURE__ */ jsx(
|
|
184
184
|
"button",
|
|
185
185
|
{
|