diff --git a/packages/frontend/src/components/shared/SegmentedControls/index.ts b/packages/frontend/src/components/shared/SegmentedControls/index.ts index 5d569509..424fde07 100644 --- a/packages/frontend/src/components/shared/SegmentedControls/index.ts +++ b/packages/frontend/src/components/shared/SegmentedControls/index.ts @@ -1,2 +1,3 @@ export * from './SegmentedControlItem'; export * from './SegmentedControls'; +export * from './SegmentedControls.theme'; diff --git a/packages/frontend/src/stories/Components/SegmentedControls.stories.tsx b/packages/frontend/src/stories/Components/SegmentedControls.stories.tsx index 4deb0447..7b03149d 100644 --- a/packages/frontend/src/stories/Components/SegmentedControls.stories.tsx +++ b/packages/frontend/src/stories/Components/SegmentedControls.stories.tsx @@ -1,6 +1,24 @@ import { StoryObj, Meta } from '@storybook/react'; -import { SegmentedControls } from 'components/shared/SegmentedControls'; +import { + SegmentedControls, + SegmentedControlsVariants, + SegmentedControlsOption, +} from 'components/shared/SegmentedControls'; + +const segmentedControlsTypes: SegmentedControlsVariants['type'][] = [ + 'fixed-width', + 'full-width', +]; +const segmentedControlsSizes: SegmentedControlsVariants['size'][] = [ + 'sm', + 'md', +]; +const segmentedControlsOptions: SegmentedControlsOption[] = [ + { label: 'Option 1', value: '1' }, + { label: 'Option 2', value: '2' }, + { label: 'Option 3', value: '3' }, +]; const meta: Meta = { title: 'Components/SegmentedControls', @@ -14,8 +32,21 @@ const meta: Meta = { control: 'text', }, onChange: { - action: 'onChange', + action: 'change', }, + type: { + control: 'select', + options: segmentedControlsTypes, + }, + size: { + control: 'select', + options: segmentedControlsSizes, + }, + }, + args: { + options: segmentedControlsOptions, + value: '1', + size: 'md', }, }; @@ -24,15 +55,16 @@ export default meta; type Story = StoryObj; export const Default: Story = { - render: ({ options, value, onChange }) => ( - + render: ({ options, value, onChange, ...args }) => ( + ), args: { - options: [ - { label: 'Option 1', value: '1' }, - { label: 'Option 2', value: '2' }, - { label: 'Option 3', value: '3' }, - ], + options: segmentedControlsOptions, value: '1', }, };