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,73 +0,0 @@
|
|||
<script>
|
||||
export let story = undefined;
|
||||
|
||||
import ClickableTile from "./ClickableTile.svelte";
|
||||
import ExpandableTile from "./ExpandableTile.svelte";
|
||||
import RadioTile from "./RadioTile.svelte";
|
||||
import SelectableTile from "./SelectableTile.svelte";
|
||||
import Tile from "./Tile.svelte";
|
||||
import TileGroup from "./TileGroup.svelte";
|
||||
|
||||
const radioTiles = [
|
||||
{ value: "standard", id: "tile-1", labelText: "Selectable Tile" },
|
||||
{ value: "default-selected", id: "tile-2", labelText: "Selectable Tile" },
|
||||
{ value: "selected", id: "tile-3", labelText: "Selectable Tile" },
|
||||
];
|
||||
|
||||
$: selected = radioTiles[1].value;
|
||||
$: selectedTile1 = false;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
{#if story === 'filter'}
|
||||
<Tile {...$$props} />
|
||||
{:else if story === 'clickable'}
|
||||
<ClickableTile {...$$props}>Clickable Tile</ClickableTile>
|
||||
{:else if story === 'multi-select'}
|
||||
<div role="group" aria-label="selectable tiles">
|
||||
<SelectableTile
|
||||
{...$$props}
|
||||
id="tile-1"
|
||||
name="tiles"
|
||||
bind:selected="{selectedTile1}"
|
||||
on:select="{({ detail }) => {
|
||||
console.log('on:select', detail);
|
||||
}}"
|
||||
on:deselect="{({ detail }) => {
|
||||
console.log('on:deselect', detail);
|
||||
}}"
|
||||
>
|
||||
Multi-select Tile
|
||||
</SelectableTile>
|
||||
<SelectableTile {...$$props} id="tile-2" name="tiles">
|
||||
Multi-select Tile
|
||||
</SelectableTile>
|
||||
<SelectableTile {...$$props} id="tile-3" name="tiles">
|
||||
Multi-select Tile
|
||||
</SelectableTile>
|
||||
</div>
|
||||
{:else if story === 'selectable'}
|
||||
<TileGroup legend="Selectable Tile Group" bind:selected>
|
||||
{#each radioTiles as { value, id, labelText }, i (id)}
|
||||
<RadioTile
|
||||
{...$$props}
|
||||
value="{value}"
|
||||
id="{id}"
|
||||
labelText="{labelText}"
|
||||
on:keydown="{() => {
|
||||
console.log('keydown');
|
||||
}}"
|
||||
>
|
||||
Selectable Tile
|
||||
</RadioTile>
|
||||
{/each}
|
||||
</TileGroup>
|
||||
{:else if story === 'expandable'}
|
||||
<ExpandableTile {...$$props}>
|
||||
<div slot="above" style="height: 200px">Above the fold content here</div>
|
||||
<div slot="below" style="height: 400px">Below the fold content here</div>
|
||||
</ExpandableTile>
|
||||
{:else}
|
||||
<Tile {...$$props}>Default Tile</Tile>
|
||||
{/if}
|
||||
</div>
|
|
@ -1,57 +0,0 @@
|
|||
import { withKnobs, number, boolean, text } from "@storybook/addon-knobs";
|
||||
import Component from "./Tile.Story.svelte";
|
||||
|
||||
export default { title: "Tile", decorators: [withKnobs] };
|
||||
|
||||
export const Default = () => ({
|
||||
Component,
|
||||
props: { light: boolean("Light variant (light)", false) },
|
||||
});
|
||||
|
||||
export const Clickable = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: "clickable",
|
||||
href: text("Href for clickable UI (href)", "javascript:void(0)"),
|
||||
light: boolean("Light variant (light)", false),
|
||||
},
|
||||
});
|
||||
|
||||
export const MultiSelect = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: "multi-select",
|
||||
selected: boolean("Selected (selected)", false),
|
||||
light: boolean("Light variant (light)", false),
|
||||
},
|
||||
});
|
||||
|
||||
MultiSelect.story = { name: "Multi-select" };
|
||||
|
||||
export const Selectable = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: "selectable",
|
||||
name: text("Form item name (name in <RadioTile>)", "tiles"),
|
||||
light: boolean("Light variant (light)", false),
|
||||
},
|
||||
});
|
||||
|
||||
export const Expandable = () => ({
|
||||
Component,
|
||||
props: {
|
||||
story: "expandable",
|
||||
tabindex: text("Tab index (tabindex)", "0"),
|
||||
expanded: boolean("Expanded (expanded)", false),
|
||||
tileMaxHeight: number("Max height (tileMaxHeight)", 0),
|
||||
tileCollapsedIconText: text(
|
||||
"Collapsed icon text (tileCollapsedIconText)",
|
||||
"Interact to Expand tile"
|
||||
),
|
||||
tileExpandedIconText: text(
|
||||
"Collapsed icon text (tileExpandedIconText)",
|
||||
"Interact to Collapse tile"
|
||||
),
|
||||
light: boolean("Light variant (light)", false),
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue