@beydesign/storybook 0.0.13 → 0.0.14

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.
@@ -54,7 +54,7 @@ const IOSSwitch = styled((props) => (_jsx(Switch, { focusVisibleClassName: ".Mui
54
54
  },
55
55
  },
56
56
  }));
57
- export const Toggle = ({ checked, onChange, text = 'Click me', title, disabled, togglePosition = TogglePosition.Right, style, }) => {
57
+ export const Toggle = ({ checked, onChange, text = 'Click me', title, disabled = false, togglePosition = TogglePosition.Left, style, }) => {
58
58
  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, { text: text, size: TypographySize.TextS, weight: TypographyWeight.Medium, color: 'var(--colors-light-text-text-title)', style: { lineHeight: '20px' } }), title && (_jsx(Typography, { text: title, size: TypographySize.TextS, weight: TypographyWeight.Medium, color: "#475467", style: { lineHeight: '20px' } }))] }))] }));
59
59
  };
60
60
  export const Components = () => {
@@ -27,7 +27,7 @@ export const ToggleButtonGroup = ({ onChange, options, selectedOption, disabled,
27
27
  borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)',
28
28
  overflow: 'hidden',
29
29
  backgroundColor: 'var(--colors-light-background-bg-component)',
30
- }, gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', border: `1px solid var(--colors-light-border-border-component)`, children: options.map((option) => {
30
+ }, gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)', border: `1px solid var(--colors-light-border-border-component)`, width: 'fit-content', children: options.map((option) => {
31
31
  const isSelected = option === selectedOption;
32
32
  return (_jsx(MainButton, { text: option, onClick: () => onChange(option), size: getButtonSize(), hierarchy: ButtonHierarchy.Tetriary, type: ButtonType.Button, style: isSelected ? selectedOptionStyle : unselectedOptionStyle, disabled: disabled }, option));
33
33
  }) }));
@@ -11,9 +11,9 @@ export declare enum TogglePosition {
11
11
  */
12
12
  export type ToggleProps = {
13
13
  /** Text of the toggle */
14
- text: string;
14
+ text?: string;
15
15
  /** Title of the toggle */
16
- title: string;
16
+ title?: string;
17
17
  /** Whether the toggle is checked */
18
18
  checked: boolean;
19
19
  /** Callback function when the toggle is checked */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.0.13",
4
+ "version": "0.0.14",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",