@cocso-ui/react 0.2.9 → 0.2.10
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.
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
4
4
|
|
|
5
|
-
type SwitchSize = '
|
|
5
|
+
type SwitchSize = 'sm' | 'md';
|
|
6
6
|
interface SwitchProps extends ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
|
|
7
7
|
id?: string;
|
|
8
8
|
size?: SwitchSize;
|
|
@@ -82,8 +82,8 @@ const Switch = /*#__PURE__*/react.forwardRef(({
|
|
|
82
82
|
})]
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
|
-
const getSwitchWidth = size => tsPattern.match(size).with('
|
|
86
|
-
const getSwitchHeight = size => tsPattern.match(size).with('
|
|
87
|
-
const getThumbSize = size => tsPattern.match(size).with('
|
|
85
|
+
const getSwitchWidth = size => tsPattern.match(size).with('md', () => spacing.spacing.s14).with('sm', () => spacing.spacing.s12).exhaustive();
|
|
86
|
+
const getSwitchHeight = size => tsPattern.match(size).with('md', () => spacing.spacing.s10).with('sm', () => spacing.spacing.s9).exhaustive();
|
|
87
|
+
const getThumbSize = size => tsPattern.match(size).with('md', () => spacing.spacing.s9).with('sm', () => spacing.spacing.s8).exhaustive();
|
|
88
88
|
|
|
89
89
|
exports.Switch = Switch;
|
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
4
4
|
|
|
5
|
-
type SwitchSize = '
|
|
5
|
+
type SwitchSize = 'sm' | 'md';
|
|
6
6
|
interface SwitchProps extends ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
|
|
7
7
|
id?: string;
|
|
8
8
|
size?: SwitchSize;
|
|
@@ -61,8 +61,8 @@ const Switch = /*#__PURE__*/forwardRef(({
|
|
|
61
61
|
})]
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
|
-
const getSwitchWidth = size => match(size).with('
|
|
65
|
-
const getSwitchHeight = size => match(size).with('
|
|
66
|
-
const getThumbSize = size => match(size).with('
|
|
64
|
+
const getSwitchWidth = size => match(size).with('md', () => spacing.s14).with('sm', () => spacing.s12).exhaustive();
|
|
65
|
+
const getSwitchHeight = size => match(size).with('md', () => spacing.s10).with('sm', () => spacing.s9).exhaustive();
|
|
66
|
+
const getThumbSize = size => match(size).with('md', () => spacing.s9).with('sm', () => spacing.s8).exhaustive();
|
|
67
67
|
|
|
68
68
|
export { Switch };
|