feat(components): add Select, SelectItem, SelectItemGroup

Closes #31
This commit is contained in:
Eric Liu 2019-12-21 17:18:35 -08:00
commit 6c75c8a973
9 changed files with 243 additions and 0 deletions

View file

@ -0,0 +1,36 @@
import { withKnobs, text, boolean } from '@storybook/addon-knobs';
import Component from './Select.Story.svelte';
export default { title: 'Select', decorators: [withKnobs] };
const labelPositions = {
'Left (left)': 'left',
'Right (right)': 'right'
};
export const Default = () => ({
Component,
props: {
select: {
light: boolean('Light variant (light in <Select>)', false),
inline: boolean('Put control in-line with label (inline in <Select>)', false),
disabled: boolean('Disabled (disabled in <Select>)', false),
hideLabel: boolean('No label (hideLabel in <Select>)', false),
invalid: boolean('Show form validation UI (invalid in <Select>)', false),
invalidText: text(
'Form validation UI content (invalidText in <Select>)',
'A valid value is required'
),
labelText: text('Label text (helperText)', 'Select'),
helperText: text('Helper text (helperText)', 'Optional helper text.')
},
group: {
disabled: boolean('Disabled (disabled in <SelectItemGroup>)', false)
}
}
});
export const Skeleton = () => ({
Component,
props: { story: 'skeleton', hideLabel: boolean('No label (hideLabel in <Select>)', false) }
});