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,39 +1,52 @@
import { withKnobs, boolean, text } from '@storybook/addon-knobs';
import Component from './CodeSnippet.Story.svelte';
import { withKnobs, boolean, text } from "@storybook/addon-knobs";
import Component from "./CodeSnippet.Story.svelte";
export default { title: 'CodeSnippet', decorators: [withKnobs] };
export default { title: "CodeSnippet", decorators: [withKnobs] };
export const Inline = () => ({
Component,
props: {
story: 'inline',
light: boolean('Light variant (light)', false),
feedback: text('Feedback text (feedback)', 'Feedback Enabled 👍'),
copyLabel: text('ARIA label for the snippet/copy button (copyLabel)', 'copyable code snippet')
}
story: "inline",
light: boolean("Light variant (light)", false),
feedback: text("Feedback text (feedback)", "Feedback Enabled 👍"),
copyLabel: text(
"ARIA label for the snippet/copy button (copyLabel)",
"copyable code snippet"
),
},
});
export const SingleLine = () => ({
Component,
props: {
story: 'single line',
feedback: text('Feedback text (feedback)', 'Feedback Enabled 👍'),
story: "single line",
light: boolean("Light variant (light)", false),
feedback: text("Feedback text (feedback)", "Feedback Enabled 👍"),
copyButtonDescription: text(
'Copy icon description (copyButtonDescription)',
'copyable code snippet'
"Copy icon description (copyButtonDescription)",
"copyable code snippet"
),
'aria-label': text('ARIA label of the container (ariaLabel)', 'Container label')
}
"aria-label": text(
"ARIA label of the container (ariaLabel)",
"Container label"
),
},
});
export const MultiLine = () => ({
Component,
props: {
story: 'multi line',
feedback: text('Feedback text (feedback)', 'Feedback Enabled 👍'),
showMoreText: text('Text for "show more" button (showMoreText)', 'Show more'),
showLessText: text('Text for "show less" button (showLessText)', 'Show less')
}
story: "multi line",
feedback: text("Feedback text (feedback)", "Feedback Enabled 👍"),
showMoreText: text(
'Text for "show more" button (showMoreText)',
"Show more"
),
showLessText: text(
'Text for "show less" button (showLessText)',
"Show less"
),
},
});
export const Skeleton = () => ({ Component, props: { story: 'skeleton' } });
export const Skeleton = () => ({ Component, props: { story: "skeleton" } });