@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.
@@ -22,7 +22,7 @@ var toggleGroupVariants = cva("nexus-toggle-group", {
22
22
  }
23
23
  });
24
24
  var ToggleGroup = React.forwardRef(
25
- ({ className, variant, size, items, disabled, ...props }, ref) => {
25
+ ({ className, variant, size, items, disabled, required, ...props }, ref) => {
26
26
  const rootRef = React.useRef(null);
27
27
  const [animated, setAnimated] = React.useState(false);
28
28
  const [pos, setPos] = React.useState(null);
@@ -75,21 +75,23 @@ var ToggleGroup = React.forwardRef(
75
75
  }, []);
76
76
  const handleSingleChange = React.useCallback(
77
77
  (val) => {
78
+ if (required && !val) return;
78
79
  setTrackedValue(val);
79
80
  if (props.type !== "multiple") {
80
81
  props.onValueChange?.(val);
81
82
  }
82
83
  },
83
- [props.type, props.onValueChange]
84
+ [props.type, props.onValueChange, required]
84
85
  );
85
86
  const handleMultipleChange = React.useCallback(
86
87
  (val) => {
88
+ if (required && val.length === 0) return;
87
89
  setTrackedValue(val);
88
90
  if (props.type === "multiple") {
89
91
  props.onValueChange?.(val);
90
92
  }
91
93
  },
92
- [props.type, props.onValueChange]
94
+ [props.type, props.onValueChange, required]
93
95
  );
94
96
  const rootProps = props.type === "multiple" ? {
95
97
  type: "multiple",
@@ -193,15 +193,15 @@ var ImageUpload = React__namespace.forwardRef(
193
193
  !hasField && className
194
194
  ),
195
195
  children: [
196
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-image-upload__preview-wrapper", children: [
197
- /* @__PURE__ */ jsxRuntime.jsx(
196
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nexus-image-upload__preview-area", children: [
197
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-image-upload__preview-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(
198
198
  "img",
199
199
  {
200
200
  src: preview,
201
201
  alt: "Uploaded preview",
202
202
  className: "nexus-image-upload__preview"
203
203
  }
204
- ),
204
+ ) }),
205
205
  !disabled && /* @__PURE__ */ jsxRuntime.jsx(
206
206
  "button",
207
207
  {