mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore: remove storybook
This commit is contained in:
parent
856086dc71
commit
378fe06e03
116 changed files with 103 additions and 14249 deletions
|
@ -1,45 +0,0 @@
|
|||
<script>
|
||||
export let story = undefined;
|
||||
|
||||
import { Button } from "../Button";
|
||||
import Dropdown from "./Dropdown.svelte";
|
||||
import DropdownSkeleton from "./Dropdown.Skeleton.svelte";
|
||||
|
||||
$: items = [
|
||||
{ id: "option-0", text: "Option 1" },
|
||||
{ id: "option-1", text: "Option 2" },
|
||||
{ id: "option-2", text: "Option 3" },
|
||||
{ id: "option-3", text: "Option 4" },
|
||||
];
|
||||
$: selectedIndex = -1;
|
||||
</script>
|
||||
|
||||
{#if story === 'skeleton'}
|
||||
<div style="width: 300px">
|
||||
<DropdownSkeleton />
|
||||
|
||||
<DropdownSkeleton inline />
|
||||
</div>
|
||||
{:else}
|
||||
<p>
|
||||
<code>items</code> must be an array of objects; mandatory fields are `id` and
|
||||
`text`.
|
||||
</p>
|
||||
<pre style="margin-top: 1rem;">
|
||||
<code
|
||||
>{'items = Array<{ id: string; text: string; }>'}</code>
|
||||
</pre>
|
||||
<div style="margin-top: 2rem; margin-bottom: 2rem;">
|
||||
<Button
|
||||
size="small"
|
||||
on:click="{() => {
|
||||
selectedIndex = selectedIndex > -1 ? -1 : 1;
|
||||
}}"
|
||||
>
|
||||
{selectedIndex > -1 ? 'Clear selected item' : 'Set item to "Option 2"'}
|
||||
</Button>
|
||||
</div>
|
||||
<div style="width: 300px">
|
||||
<Dropdown {...$$props} bind:selectedIndex items="{items}" />
|
||||
</div>
|
||||
{/if}
|
|
@ -1,38 +0,0 @@
|
|||
import { withKnobs, select, text, boolean } from "@storybook/addon-knobs";
|
||||
import Component from "./Dropdown.Story.svelte";
|
||||
|
||||
export default { title: "Dropdown", decorators: [withKnobs] };
|
||||
|
||||
const types = {
|
||||
"Default (default)": "default",
|
||||
"Inline (inline)": "inline",
|
||||
};
|
||||
|
||||
const sizes = {
|
||||
"Extra large size (xl)": "xl",
|
||||
"Regular size (lg)": "",
|
||||
"Small size (sm)": "sm",
|
||||
};
|
||||
|
||||
export const Default = () => ({
|
||||
Component,
|
||||
props: {
|
||||
id: text("Dropdown id", "carbon-dropdown-id"),
|
||||
name: text("Dropdown name", "carbon-dropdown-name"),
|
||||
type: select("Dropdown type (type)", types, "default"),
|
||||
size: select("Field size (size)", sizes, "") || undefined,
|
||||
label: text("Label (label)", "Dropdown menu options"),
|
||||
"aria-label": text("Aria Label (aria-label)", "Dropdown"),
|
||||
disabled: boolean("Disabled (disabled)", false),
|
||||
light: boolean("Light variant (light)", false),
|
||||
titleText: text("Title (titleText)", "This is not a dropdown title."),
|
||||
helperText: text("Helper text (helperText)", "Optional helper text here"),
|
||||
invalid: boolean("Show form validation UI (invalid)", false),
|
||||
invalidText: text(
|
||||
"Form validation UI content (invalidText)",
|
||||
"A valid value is required"
|
||||
),
|
||||
},
|
||||
});
|
||||
|
||||
export const Skeleton = () => ({ Component, props: { story: "skeleton" } });
|
Loading…
Add table
Add a link
Reference in a new issue