diff --git a/packages/frontend/src/components/shared/Select/index.ts b/packages/frontend/src/components/shared/Select/index.ts index 7669724..6540c2f 100644 --- a/packages/frontend/src/components/shared/Select/index.ts +++ b/packages/frontend/src/components/shared/Select/index.ts @@ -1,2 +1,3 @@ export * from './Select'; export * from './SelectItem'; +export * from './Select.theme'; diff --git a/packages/frontend/src/stories/Components/Select.stories.tsx b/packages/frontend/src/stories/Components/Select.stories.tsx index 488f671..ff41209 100644 --- a/packages/frontend/src/stories/Components/Select.stories.tsx +++ b/packages/frontend/src/stories/Components/Select.stories.tsx @@ -1,6 +1,21 @@ import { StoryObj, Meta } from '@storybook/react'; +import { PlusIcon } from 'components/shared/CustomIcon'; -import { Select } from 'components/shared/Select'; +import { Select, SelectOption, SelectTheme } from 'components/shared/Select'; + +const selectOrientation: SelectTheme['orientation'][] = [ + 'horizontal', + 'vertical', +]; +const selectVariants: SelectTheme['variant'][] = ['default', 'danger']; +const selectSizes: SelectTheme['size'][] = ['sm', 'md']; +const selectError: SelectTheme['error'][] = [true, false]; +const selectIsOpen: SelectTheme['isOpen'][] = [true, false]; +const selectOptions: SelectOption[] = [ + { label: 'Option 1', value: 'option1' }, + { label: 'Option 2', value: 'option2' }, + { label: 'Option 3', value: 'option3' }, +]; const meta: Meta = { title: 'Components/Select', @@ -17,13 +32,13 @@ const meta: Meta = { control: 'text', }, multiple: { - control: 'boolean', + type: 'boolean', }, searchable: { - control: 'boolean', + type: 'boolean', }, clearable: { - control: 'boolean', + type: 'boolean', }, leftIcon: { control: 'text', @@ -35,7 +50,7 @@ const meta: Meta = { control: 'text', }, hideValues: { - control: 'boolean', + type: 'boolean', }, value: { control: 'object', @@ -46,6 +61,29 @@ const meta: Meta = { onChange: { action: 'change', }, + orientation: { + control: 'radio', + options: selectOrientation, + }, + placeholder: { + control: 'text', + }, + variant: { + control: 'select', + options: selectVariants, + }, + size: { + control: 'select', + options: selectSizes, + }, + error: { + control: 'radio', + options: selectError, + }, + isOpen: { + control: 'radio', + options: selectIsOpen, + }, }, }; @@ -54,52 +92,94 @@ export default meta; type Story = StoryObj; export const Default: Story = { - render: ({ - options, - label, - description, - multiple, - searchable, - clearable, - leftIcon, - rightIcon, - helperText, - hideValues, - value, - onClear, - onChange, - }) => ( -