@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.
@@ -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
- outline: "nexus-toggle-group--outline"
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 || !isDefault) return;
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, isDefault]);
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
- isDefault && /* @__PURE__ */ jsxRuntime.jsx(
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 })