@crystallize/design-system 1.24.17 → 1.24.18

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @crystallize/design-system
2
2
 
3
+ ## 1.24.18
4
+
5
+ ### Patch Changes
6
+
7
+ - 1e62463: Adjust switch component types
8
+
3
9
  ## 1.24.17
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -477,7 +477,7 @@ type SwitchStylesProps = VariantProps<typeof switchStyles>;
477
477
  declare const switchStyles: (props?: ({
478
478
  size?: "xs" | "sm" | null | undefined;
479
479
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
480
- type CustomSwitchProps = SwitchStylesProps & Exclude<SwitchProps, 'checked'> & {
480
+ type CustomSwitchProps = SwitchStylesProps & Omit<SwitchProps, 'checked'> & {
481
481
  checked?: boolean | null;
482
482
  };
483
483
  declare function Switch({ size, checked, ...props }: CustomSwitchProps): JSX.Element;
package/dist/index.js CHANGED
@@ -40570,7 +40570,7 @@ var switchStyles = (0, import_class_variance_authority24.cva)(["c-switch-root"],
40570
40570
  function Switch2({ size, checked, ...props }) {
40571
40571
  return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(RadixSwitch.Root, {
40572
40572
  ...props,
40573
- checked,
40573
+ checked: checked === null ? false : checked,
40574
40574
  className: switchStyles({ size }),
40575
40575
  children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(RadixSwitch.Thumb, {
40576
40576
  className: (0, import_class_variance_authority24.cx)("c-switch-thumb", checked === null ? "middle-position" : "")
package/dist/index.mjs CHANGED
@@ -584,7 +584,7 @@ var switchStyles = cva7(["c-switch-root"], {
584
584
  function Switch({ size, checked, ...props }) {
585
585
  return /* @__PURE__ */ jsx17(RadixSwitch.Root, {
586
586
  ...props,
587
- checked,
587
+ checked: checked === null ? false : checked,
588
588
  className: switchStyles({ size }),
589
589
  children: /* @__PURE__ */ jsx17(RadixSwitch.Thumb, {
590
590
  className: cx9("c-switch-thumb", checked === null ? "middle-position" : "")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystallize/design-system",
3
- "version": "1.24.17",
3
+ "version": "1.24.18",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -16,13 +16,13 @@ const switchStyles = cva(['c-switch-root'], {
16
16
  });
17
17
 
18
18
  export type CustomSwitchProps = SwitchStylesProps &
19
- Exclude<SwitchProps, 'checked'> & {
19
+ Omit<SwitchProps, 'checked'> & {
20
20
  checked?: boolean | null;
21
21
  };
22
22
 
23
23
  export function Switch({ size, checked, ...props }: CustomSwitchProps) {
24
24
  return (
25
- <RadixSwitch.Root {...props} checked={checked} className={switchStyles({ size })}>
25
+ <RadixSwitch.Root {...props} checked={checked === null ? false : checked} className={switchStyles({ size })}>
26
26
  <RadixSwitch.Thumb className={cx('c-switch-thumb', checked === null ? 'middle-position' : '')} />
27
27
  </RadixSwitch.Root>
28
28
  );