mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
chore: remove storybook
This commit is contained in:
parent
856086dc71
commit
378fe06e03
116 changed files with 103 additions and 14249 deletions
|
@ -1,53 +0,0 @@
|
|||
<script>
|
||||
export let story = undefined;
|
||||
/**
|
||||
* Set to `true` to enable the light variant
|
||||
* @type {boolean} [light=false]
|
||||
*/
|
||||
export let light = false;
|
||||
|
||||
import ContentSwitcher from "./ContentSwitcher.svelte";
|
||||
import Switch from "./Switch.svelte";
|
||||
import Add16 from "carbon-icons-svelte/lib/Add16";
|
||||
|
||||
$: selectedIndex = 0;
|
||||
$: console.log("bind selectedIndex", selectedIndex);
|
||||
</script>
|
||||
|
||||
{#if story === 'selected'}
|
||||
<ContentSwitcher
|
||||
light="{light}"
|
||||
on:change="{({ detail }) => {
|
||||
console.log('on:change', detail);
|
||||
}}"
|
||||
>
|
||||
<Switch {...$$props} text="First section" />
|
||||
<Switch {...$$props} text="Second section" selected />
|
||||
<Switch {...$$props} text="Third section" />
|
||||
</ContentSwitcher>
|
||||
{:else}
|
||||
<ContentSwitcher
|
||||
light="{light}"
|
||||
bind:selectedIndex
|
||||
on:change="{({ detail }) => {
|
||||
console.log('on:change', detail);
|
||||
}}"
|
||||
>
|
||||
<Switch {...$$props} text="First section" />
|
||||
<Switch {...$$props} text="Second section" />
|
||||
<Switch {...$$props}>
|
||||
<div style="display: flex; align-items:center;">
|
||||
<Add16 style="margin-right: .25rem;" />
|
||||
Third section
|
||||
</div>
|
||||
</Switch>
|
||||
</ContentSwitcher>
|
||||
<div
|
||||
style="margin-top: 1.5rem"
|
||||
on:click="{() => {
|
||||
selectedIndex = 1;
|
||||
}}"
|
||||
>
|
||||
Programmatically set to second index
|
||||
</div>
|
||||
{/if}
|
|
@ -1,21 +0,0 @@
|
|||
import { withKnobs, boolean } from "@storybook/addon-knobs";
|
||||
import Component from "./ContentSwitcher.Story.svelte";
|
||||
|
||||
export default { title: "ContentSwitcher", decorators: [withKnobs] };
|
||||
|
||||
export const Default = () => ({
|
||||
Component,
|
||||
props: {
|
||||
disabled: boolean("Disabled (disabled)", false),
|
||||
light: boolean("Light variant (light)", false),
|
||||
},
|
||||
});
|
||||
|
||||
export const Selected = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: "selected",
|
||||
disabled: boolean("Disabled (disabled)", false),
|
||||
light: boolean("Light variant (light)", false),
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue