diff --git a/src/components/select/select-atom.stories.jsx b/src/components/select/select-atom.stories.jsx new file mode 100644 index 00000000..1f5a70d5 --- /dev/null +++ b/src/components/select/select-atom.stories.jsx @@ -0,0 +1,154 @@ +import React from 'react'; +import Select from './select'; + +const options = [ + { id: '1', name: 'Red' }, + { id: '2', name: 'Orange' }, + { id: '3', name: 'Yellow' }, + { id: '4', name: 'Green' }, + { id: '5', name: 'Cyan' }, + { id: '6', name: 'Blue' }, + { id: '7', name: 'Purple' }, + { id: '8', name: 'Pink' }, +]; + +export default { + title: 'Atoms/Select', + component: Select, + parameters: { + layout: 'centered', + }, + tags: [ 'atoms', 'autodocs' ], + argTypes: { + size: { + control: { type: 'radio' }, + options: [ 'sm', 'md', 'lg' ], + description: 'Defines the size of the Select component.', + defaultValue: 'md', + }, + multiple: { + control: { type: 'boolean' }, + description: 'If true, multiple options can be selected.', + defaultValue: false, + }, + combobox: { + control: { type: 'boolean' }, + description: 'If true, it will enable search functionality.', + defaultValue: false, + }, + disabled: { + control: { type: 'boolean' }, + description: 'If true, disables the Select component.', + defaultValue: false, + }, + onChange: { + action: 'onChange', + description: 'Callback function when the selection changes.', + }, + value: { + control: { type: 'text' }, + description: 'Controlled value for the select component.', + defaultValue: undefined, + }, + defaultValue: { + control: { type: 'text' }, + description: 'Default value for the select (for uncontrolled component).', + defaultValue: undefined, + }, + placeholder: { + control: { type: 'text' }, + description: 'Placeholder text when no option is selected.', + defaultValue: 'Select an option', + }, + label: { + control: { type: 'text' }, + description: 'Label for the Select component.', + defaultValue: 'Select Color', + }, + }, +}; + +// Single Select Story +export const SingleSelect = ( args ) => ( +