@beydesign/storybook 0.1.11 → 0.1.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.
|
@@ -52,6 +52,6 @@ const IOSSwitch = styled((props) => (_jsx(Switch, { focusVisibleClassName: ".Mui
|
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
}));
|
|
55
|
-
export const Toggle = ({ checked, onChange, text = 'Click me', title, disabled = false, togglePosition = TogglePosition.Left, style, }) => {
|
|
56
|
-
return (_jsxs(Box, { display: "flex", alignItems: "flex-start", flexDirection: togglePosition === TogglePosition.Left ? 'row' : 'row-reverse', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', sx: style, children: [_jsx(IOSSwitch, { checked: checked, onChange: (e) => onChange(e.target.checked), disabled: disabled }), text && (_jsxs(Box, { display: "flex", flexDirection: "column", children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color:
|
|
55
|
+
export const Toggle = ({ checked, onChange, text = 'Click me', title, disabled = false, togglePosition = TogglePosition.Left, style, textColor = 'var(--colors-light-text-text-title)', titleColor = '#475467', }) => {
|
|
56
|
+
return (_jsxs(Box, { display: "flex", alignItems: "flex-start", flexDirection: togglePosition === TogglePosition.Left ? 'row' : 'row-reverse', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', sx: style, children: [_jsx(IOSSwitch, { checked: checked, onChange: (e) => onChange(e.target.checked), disabled: disabled }), text && (_jsxs(Box, { display: "flex", flexDirection: "column", children: [_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: textColor, children: text }), title && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: titleColor, children: title }))] }))] }));
|
|
57
57
|
};
|
|
@@ -54,6 +54,14 @@ const meta = {
|
|
|
54
54
|
description: 'Style of the toggle',
|
|
55
55
|
table: { type: { summary: 'object' } },
|
|
56
56
|
},
|
|
57
|
+
textColor: {
|
|
58
|
+
description: 'Color of the text',
|
|
59
|
+
table: { type: { summary: 'string' } },
|
|
60
|
+
},
|
|
61
|
+
titleColor: {
|
|
62
|
+
description: 'Color of the title',
|
|
63
|
+
table: { type: { summary: 'string' } },
|
|
64
|
+
},
|
|
57
65
|
},
|
|
58
66
|
};
|
|
59
67
|
export default meta;
|
|
@@ -65,5 +73,7 @@ export const Default = {
|
|
|
65
73
|
title: 'This is a toggle',
|
|
66
74
|
disabled: false,
|
|
67
75
|
togglePosition: TogglePosition.Right,
|
|
76
|
+
textColor: 'var(--colors-light-text-text-title)',
|
|
77
|
+
titleColor: '#475467',
|
|
68
78
|
},
|
|
69
79
|
};
|
|
@@ -101,6 +101,10 @@ export type ToggleProps = {
|
|
|
101
101
|
togglePosition?: TogglePosition;
|
|
102
102
|
/** Style of the toggle */
|
|
103
103
|
style?: SxProps<Theme>;
|
|
104
|
+
/** Text color of the toggle */
|
|
105
|
+
textColor?: string;
|
|
106
|
+
/** Title color of the toggle */
|
|
107
|
+
titleColor?: string;
|
|
104
108
|
};
|
|
105
109
|
export declare enum CheckboxType {
|
|
106
110
|
Radio = "Radio",
|