refactor: use $$restProps API

- add ref prop for applicable components (#196)
- add slot to Content Switcher `Switch` component (#183)
- remove fillArray, css utilities
This commit is contained in:
Eric Liu 2020-07-18 20:00:20 -07:00
commit e886d772c7
288 changed files with 4681 additions and 4498 deletions

View file

@ -1,40 +1,54 @@
import { withKnobs, text, select, boolean } from '@storybook/addon-knobs';
import Component from './RadioButtonGroup.Story.svelte';
import { withKnobs, text, select, boolean } from "@storybook/addon-knobs";
import Component from "./RadioButtonGroup.Story.svelte";
export default { title: 'RadioButtonGroup', decorators: [withKnobs] };
export default { title: "RadioButtonGroup", decorators: [withKnobs] };
const values = {
standard: 'standard',
'default-selected': 'default-selected',
disabled: 'disabled'
standard: "standard",
"default-selected": "default-selected",
disabled: "disabled",
};
const orientations = {
'Horizontal (horizontal)': 'horizontal',
'Vertical (vertical)': 'vertical'
"Horizontal (horizontal)": "horizontal",
"Vertical (vertical)": "vertical",
};
const labelPositions = {
'Left (left)': 'left',
'Right (right)': 'right'
"Left (left)": "left",
"Right (right)": "right",
};
export const Default = () => ({
Component,
props: {
group: {
name: text('The form control name (name in <RadioButtonGroup>)', 'radio-button-group'),
valueSelected: select(
'Value of the selected button (valueSelected in <RadioButtonGroup>)',
values,
'default-selected'
name: text(
"The form control name (name in <RadioButtonGroup>)",
"radio-button-group"
),
valueSelected: select(
"Value of the selected button (valueSelected in <RadioButtonGroup>)",
values,
"default-selected"
),
orientation: select(
"Radio button orientation (orientation)",
orientations,
"horizontal"
),
labelPosition: select(
"Label position (labelPosition)",
labelPositions,
"right"
),
orientation: select('Radio button orientation (orientation)', orientations, 'horizontal'),
labelPosition: select('Label position (labelPosition)', labelPositions, 'right')
},
radio: {
disabled: boolean('Disabled (disabled in <RadioButton>)', false),
labelText: text('Label text (labelText in <RadioButton>)', 'Radio button label')
}
}
disabled: boolean("Disabled (disabled in <RadioButton>)", false),
labelText: text(
"Label text (labelText in <RadioButton>)",
"Radio button label"
),
},
},
});