@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 +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/switch/switch.tsx +2 -2
package/CHANGELOG.md
CHANGED
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 &
|
|
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
package/src/switch/switch.tsx
CHANGED
|
@@ -16,13 +16,13 @@ const switchStyles = cva(['c-switch-root'], {
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
export type CustomSwitchProps = SwitchStylesProps &
|
|
19
|
-
|
|
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
|
);
|