@indico-data/design-system 2.12.1 → 2.13.0
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.
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Canvas, Meta, Controls } from '@storybook/blocks';
|
|
2
|
+
import * as Select from './Select.stories';
|
|
3
|
+
|
|
4
|
+
<Meta title="Forms/Select" name="Select" />
|
|
5
|
+
|
|
6
|
+
# Select
|
|
7
|
+
|
|
8
|
+
The select component is a flexible dropdown component that allows users to choose from a list of options. It supports various configurations, such as searchable, clearable, and custom components. It is recommended to use this component with [React Hook Form](https://react-hook-form.com/) for better form state management and best practices. The `Select` component is built using `react-select`, so refer to its [documentation](https://react-select.com/props) for full details on available props.
|
|
9
|
+
|
|
10
|
+
<Canvas of={Select.Default} />
|
|
11
|
+
|
|
12
|
+
<Controls of={Select.Default} />
|
|
@@ -83,6 +83,18 @@ const meta: Meta<SelectProps<SelectOption>> = {
|
|
|
83
83
|
},
|
|
84
84
|
defaultValue: { summary: '' },
|
|
85
85
|
},
|
|
86
|
+
classNamePrefix: {
|
|
87
|
+
control: 'text',
|
|
88
|
+
description:
|
|
89
|
+
'The prefix to use for the CSS class names. Changing this will result in losing all default styles',
|
|
90
|
+
table: {
|
|
91
|
+
category: 'Props',
|
|
92
|
+
type: {
|
|
93
|
+
summary: 'string',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
defaultValue: { summary: 'select' },
|
|
97
|
+
},
|
|
86
98
|
onChange: {
|
|
87
99
|
control: false,
|
|
88
100
|
description: 'Event handler for when the selected value changes',
|
|
@@ -115,4 +127,11 @@ export const Default: Story = {
|
|
|
115
127
|
isDisabled: false,
|
|
116
128
|
isLoading: false,
|
|
117
129
|
},
|
|
130
|
+
decorators: [
|
|
131
|
+
(Story) => (
|
|
132
|
+
<div style={{ height: 175 }}>
|
|
133
|
+
<Story />
|
|
134
|
+
</div>
|
|
135
|
+
),
|
|
136
|
+
],
|
|
118
137
|
};
|