mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 11:11:25 +00:00
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:
parent
4e2959080b
commit
e886d772c7
288 changed files with 4681 additions and 4498 deletions
|
@ -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"
|
||||
),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue