sveltacular 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/forms/button/button.stories.svelte +33 -0
- package/dist/forms/button/button.stories.svelte.d.ts +14 -0
- package/dist/forms/button/button.svelte +129 -0
- package/dist/forms/button/button.svelte.d.ts +26 -0
- package/dist/forms/check-box/check-box.stories.svelte +13 -0
- package/dist/forms/check-box/check-box.stories.svelte.d.ts +14 -0
- package/dist/forms/check-box/check-box.svelte +26 -0
- package/dist/forms/check-box/check-box.svelte.d.ts +21 -0
- package/dist/forms/check-box/check-input.svelte +32 -0
- package/dist/forms/check-box/check-input.svelte.d.ts +20 -0
- package/dist/forms/date-box/date-box.stories.svelte +17 -0
- package/dist/forms/date-box/date-box.stories.svelte.d.ts +14 -0
- package/dist/forms/date-box/date-box.svelte +68 -0
- package/dist/forms/date-box/date-box.svelte.d.ts +23 -0
- package/dist/forms/dropdown-box/dropdown-box.stories.svelte +15 -0
- package/dist/forms/dropdown-box/dropdown-box.stories.svelte.d.ts +14 -0
- package/dist/forms/dropdown-box/dropdown-box.svelte +36 -0
- package/dist/forms/dropdown-box/dropdown-box.svelte.d.ts +25 -0
- package/dist/forms/form-field.svelte +22 -0
- package/dist/forms/form-field.svelte.d.ts +19 -0
- package/dist/forms/form-label.svelte +14 -0
- package/dist/forms/form-label.svelte.d.ts +19 -0
- package/dist/forms/form.svelte +12 -0
- package/dist/forms/form.svelte.d.ts +20 -0
- package/dist/forms/number-box/number-box.stories.svelte +21 -0
- package/dist/forms/number-box/number-box.stories.svelte.d.ts +14 -0
- package/dist/forms/number-box/number-box.svelte +83 -0
- package/dist/forms/number-box/number-box.svelte.d.ts +28 -0
- package/dist/forms/switch/switch.stories.svelte +13 -0
- package/dist/forms/switch/switch.stories.svelte.d.ts +14 -0
- package/dist/forms/switch/switch.svelte +73 -0
- package/dist/forms/switch/switch.svelte.d.ts +20 -0
- package/dist/forms/text-area/text-area.stories.svelte +13 -0
- package/dist/forms/text-area/text-area.stories.svelte.d.ts +14 -0
- package/dist/forms/text-area/text-area.svelte +34 -0
- package/dist/forms/text-area/text-area.svelte.d.ts +25 -0
- package/dist/forms/text-box/text-box.stories.svelte +17 -0
- package/dist/forms/text-box/text-box.stories.svelte.d.ts +14 -0
- package/dist/forms/text-box/text-box.svelte +83 -0
- package/dist/forms/text-box/text-box.svelte.d.ts +30 -0
- package/dist/forms/upload-dropzone/upload-dropzone.stories.svelte +11 -0
- package/dist/forms/upload-dropzone/upload-dropzone.stories.svelte.d.ts +14 -0
- package/dist/forms/upload-dropzone/upload-dropzone.svelte +82 -0
- package/dist/forms/upload-dropzone/upload-dropzone.svelte.d.ts +18 -0
- package/dist/generic/card/card.stories.svelte +9 -0
- package/dist/generic/card/card.stories.svelte.d.ts +14 -0
- package/dist/generic/card/card.svelte +39 -0
- package/dist/generic/card/card.svelte.d.ts +19 -0
- package/dist/generic/divider/divider.stories.svelte +9 -0
- package/dist/generic/divider/divider.stories.svelte.d.ts +14 -0
- package/dist/generic/divider/divider.svelte +10 -0
- package/dist/generic/divider/divider.svelte.d.ts +23 -0
- package/dist/generic/link/link.stories.svelte +21 -0
- package/dist/generic/link/link.stories.svelte.d.ts +14 -0
- package/dist/generic/link/link.svelte +41 -0
- package/dist/generic/link/link.svelte.d.ts +22 -0
- package/dist/generic/overlay.svelte +24 -0
- package/dist/generic/overlay.svelte.d.ts +27 -0
- package/dist/generic/pill/pill.stories.svelte +29 -0
- package/dist/generic/pill/pill.stories.svelte.d.ts +14 -0
- package/dist/generic/pill/pill.svelte +35 -0
- package/dist/generic/pill/pill.svelte.d.ts +20 -0
- package/dist/generic/scorecard/scorecard.stories.svelte +9 -0
- package/dist/generic/scorecard/scorecard.stories.svelte.d.ts +14 -0
- package/dist/generic/scorecard/scorecard.svelte +28 -0
- package/dist/generic/scorecard/scorecard.svelte.d.ts +18 -0
- package/dist/icons/angle-right-icon.svelte +12 -0
- package/dist/icons/angle-right-icon.svelte.d.ts +14 -0
- package/dist/icons/angle-up-icon.svelte +9 -0
- package/dist/icons/angle-up-icon.svelte.d.ts +23 -0
- package/dist/icons/home-icon.svelte +8 -0
- package/dist/icons/home-icon.svelte.d.ts +14 -0
- package/dist/icons/svg-icon.svelte +16 -0
- package/dist/icons/svg-icon.svelte.d.ts +24 -0
- package/dist/icons/upload-icon.svelte +9 -0
- package/dist/icons/upload-icon.svelte.d.ts +23 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +2 -0
- package/dist/layout/flex-col.svelte +14 -0
- package/dist/layout/flex-col.svelte.d.ts +20 -0
- package/dist/layout/flex-item.svelte +7 -0
- package/dist/layout/flex-item.svelte.d.ts +27 -0
- package/dist/layout/flex-row.svelte +33 -0
- package/dist/layout/flex-row.svelte.d.ts +20 -0
- package/dist/modals/alert.stories.svelte +19 -0
- package/dist/modals/alert.stories.svelte.d.ts +14 -0
- package/dist/modals/alert.svelte +44 -0
- package/dist/modals/alert.svelte.d.ts +23 -0
- package/dist/modals/confirm.stories.svelte +9 -0
- package/dist/modals/confirm.stories.svelte.d.ts +14 -0
- package/dist/modals/confirm.svelte +57 -0
- package/dist/modals/confirm.svelte.d.ts +27 -0
- package/dist/modals/dialog-body.svelte +9 -0
- package/dist/modals/dialog-body.svelte.d.ts +27 -0
- package/dist/modals/dialog-footer.svelte +19 -0
- package/dist/modals/dialog-footer.svelte.d.ts +27 -0
- package/dist/modals/dialog-header.svelte +38 -0
- package/dist/modals/dialog-header.svelte.d.ts +20 -0
- package/dist/modals/dialog-window.svelte +33 -0
- package/dist/modals/dialog-window.svelte.d.ts +19 -0
- package/dist/modals/prompt.stories.svelte +9 -0
- package/dist/modals/prompt.stories.svelte.d.ts +14 -0
- package/dist/modals/prompt.svelte +66 -0
- package/dist/modals/prompt.svelte.d.ts +30 -0
- package/dist/navigation/accordian/accordian.stories.svelte +18 -0
- package/dist/navigation/accordian/accordian.stories.svelte.d.ts +14 -0
- package/dist/navigation/accordian/accordian.svelte +62 -0
- package/dist/navigation/accordian/accordian.svelte.d.ts +19 -0
- package/dist/navigation/app-bar/app-bar.stories.svelte +21 -0
- package/dist/navigation/app-bar/app-bar.stories.svelte.d.ts +14 -0
- package/dist/navigation/app-bar/app-bar.svelte +53 -0
- package/dist/navigation/app-bar/app-bar.svelte.d.ts +22 -0
- package/dist/navigation/breadcrumbs/breadcrumbs.stories.svelte +16 -0
- package/dist/navigation/breadcrumbs/breadcrumbs.stories.svelte.d.ts +14 -0
- package/dist/navigation/breadcrumbs/breadcrumbs.svelte +56 -0
- package/dist/navigation/breadcrumbs/breadcrumbs.svelte.d.ts +20 -0
- package/dist/navigation/side-bar/side-bar.stories.svelte +19 -0
- package/dist/navigation/side-bar/side-bar.stories.svelte.d.ts +14 -0
- package/dist/navigation/side-bar/side-bar.svelte +33 -0
- package/dist/navigation/side-bar/side-bar.svelte.d.ts +18 -0
- package/dist/navigation/tabs/tab-group.svelte +20 -0
- package/dist/navigation/tabs/tab-group.svelte.d.ts +21 -0
- package/dist/navigation/tabs/tab.svelte +87 -0
- package/dist/navigation/tabs/tab.svelte.d.ts +21 -0
- package/dist/navigation/tabs/tabs.stories.svelte +20 -0
- package/dist/navigation/tabs/tabs.stories.svelte.d.ts +14 -0
- package/dist/tables/data-grid.stories.svelte +40 -0
- package/dist/tables/data-grid.stories.svelte.d.ts +14 -0
- package/dist/tables/data-grid.svelte +43 -0
- package/dist/tables/data-grid.svelte.d.ts +18 -0
- package/dist/tables/table-body.svelte +3 -0
- package/dist/tables/table-body.svelte.d.ts +27 -0
- package/dist/tables/table-cell.svelte +13 -0
- package/dist/tables/table-cell.svelte.d.ts +18 -0
- package/dist/tables/table-footer-cell.svelte +12 -0
- package/dist/tables/table-footer-cell.svelte.d.ts +18 -0
- package/dist/tables/table-footer-row.svelte +3 -0
- package/dist/tables/table-footer-row.svelte.d.ts +27 -0
- package/dist/tables/table-footer.svelte +11 -0
- package/dist/tables/table-footer.svelte.d.ts +27 -0
- package/dist/tables/table-header-cell.svelte +18 -0
- package/dist/tables/table-header-cell.svelte.d.ts +18 -0
- package/dist/tables/table-header-row.svelte +4 -0
- package/dist/tables/table-header-row.svelte.d.ts +27 -0
- package/dist/tables/table-header.svelte +14 -0
- package/dist/tables/table-header.svelte.d.ts +27 -0
- package/dist/tables/table-row.svelte +15 -0
- package/dist/tables/table-row.svelte.d.ts +27 -0
- package/dist/tables/table.svelte +10 -0
- package/dist/tables/table.svelte.d.ts +27 -0
- package/package.json +73 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type AccordianProps = typeof __propDef.props;
|
|
10
|
+
export type AccordianEvents = typeof __propDef.events;
|
|
11
|
+
export type AccordianSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Accordian extends SvelteComponent<AccordianProps, AccordianEvents, AccordianSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script>import AngleUpIcon from "../../icons/angle-up-icon.svelte";
|
|
2
|
+
export let title;
|
|
3
|
+
export let expanded = false;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class:expanded class="accordian">
|
|
7
|
+
<button on:click={() => (expanded = !expanded)}>
|
|
8
|
+
<span class="title">
|
|
9
|
+
{title}
|
|
10
|
+
</span>
|
|
11
|
+
<span class="icon">
|
|
12
|
+
<AngleUpIcon />
|
|
13
|
+
</span>
|
|
14
|
+
</button>
|
|
15
|
+
<div class="menu">
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<style>.accordian {
|
|
21
|
+
background: #eee;
|
|
22
|
+
color: #000;
|
|
23
|
+
max-height: 3rem;
|
|
24
|
+
transition: max-height 1s ease;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
}
|
|
27
|
+
.accordian button {
|
|
28
|
+
appearance: none;
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: 1rem;
|
|
31
|
+
border: none;
|
|
32
|
+
text-align: left;
|
|
33
|
+
outline: none;
|
|
34
|
+
transition: background 0.3s ease;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
align-items: center;
|
|
38
|
+
font-size: 1rem;
|
|
39
|
+
}
|
|
40
|
+
.accordian button .icon {
|
|
41
|
+
width: 1rem;
|
|
42
|
+
height: 1rem;
|
|
43
|
+
display: block;
|
|
44
|
+
transition: transform 0.3s linear;
|
|
45
|
+
}
|
|
46
|
+
.accordian button:hover {
|
|
47
|
+
background: #ccc;
|
|
48
|
+
}
|
|
49
|
+
.accordian .menu {
|
|
50
|
+
padding: 1rem;
|
|
51
|
+
opacity: 0;
|
|
52
|
+
transition: opacity 0.3s linear;
|
|
53
|
+
}
|
|
54
|
+
.accordian.expanded {
|
|
55
|
+
max-height: 800px;
|
|
56
|
+
}
|
|
57
|
+
.accordian.expanded .menu {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
.accordian.expanded .icon {
|
|
61
|
+
transform: rotate(180deg);
|
|
62
|
+
}</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
title: string;
|
|
5
|
+
expanded?: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type AccordianProps = typeof __propDef.props;
|
|
15
|
+
export type AccordianEvents = typeof __propDef.events;
|
|
16
|
+
export type AccordianSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Accordian extends SvelteComponent<AccordianProps, AccordianEvents, AccordianSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import AppBar from "./app-bar.svelte";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<Meta title="Navigation/AppBar" component={AppBar} />
|
|
6
|
+
|
|
7
|
+
<Story name="Top (Medium)">
|
|
8
|
+
<AppBar size="md" position="top">
|
|
9
|
+
<strong>Site Header</strong>
|
|
10
|
+
</AppBar>
|
|
11
|
+
</Story>
|
|
12
|
+
|
|
13
|
+
<Story name="Top (X-Large)">
|
|
14
|
+
<AppBar size="xl" position="top">
|
|
15
|
+
<strong>Site Header</strong>
|
|
16
|
+
</AppBar>
|
|
17
|
+
</Story>
|
|
18
|
+
|
|
19
|
+
<Story name="Bottom (Small)">
|
|
20
|
+
<AppBar size="xs" position="bottom" isFixed={true}>This is the footer</AppBar>
|
|
21
|
+
</Story>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type AppBarProps = typeof __propDef.props;
|
|
10
|
+
export type AppBarEvents = typeof __propDef.events;
|
|
11
|
+
export type AppBarSlots = typeof __propDef.slots;
|
|
12
|
+
export default class AppBar extends SvelteComponent<AppBarProps, AppBarEvents, AppBarSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script>export let isFixed = true;
|
|
2
|
+
export let position = "top";
|
|
3
|
+
export let size = "md";
|
|
4
|
+
export let padding = "md";
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<header class="{position} {size} padding-{padding} {isFixed ? 'fixed' : 'absolute'}">
|
|
8
|
+
<slot />
|
|
9
|
+
</header>
|
|
10
|
+
|
|
11
|
+
<style>header {
|
|
12
|
+
display: block;
|
|
13
|
+
background: #fff;
|
|
14
|
+
color: #000;
|
|
15
|
+
padding: 0.5rem;
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
z-index: 999;
|
|
21
|
+
height: 3rem;
|
|
22
|
+
}
|
|
23
|
+
header.fixed {
|
|
24
|
+
position: fixed;
|
|
25
|
+
}
|
|
26
|
+
header.bottom {
|
|
27
|
+
top: auto;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
}
|
|
30
|
+
header.xs {
|
|
31
|
+
height: 1rem;
|
|
32
|
+
}
|
|
33
|
+
header.sm {
|
|
34
|
+
height: 2rem;
|
|
35
|
+
}
|
|
36
|
+
header.lg {
|
|
37
|
+
height: 4rem;
|
|
38
|
+
}
|
|
39
|
+
header.xl {
|
|
40
|
+
height: 5rem;
|
|
41
|
+
}
|
|
42
|
+
header.padding-none {
|
|
43
|
+
padding: 0;
|
|
44
|
+
}
|
|
45
|
+
header.padding-sm {
|
|
46
|
+
padding: 0.25rem;
|
|
47
|
+
}
|
|
48
|
+
header.padding-lg {
|
|
49
|
+
padding: 1rem;
|
|
50
|
+
}
|
|
51
|
+
header.padding-xl {
|
|
52
|
+
padding: 1.5rem;
|
|
53
|
+
}</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormFieldSizeOptions } from '../../../types/form.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
isFixed?: boolean | undefined;
|
|
6
|
+
position?: "top" | "bottom" | undefined;
|
|
7
|
+
size?: FormFieldSizeOptions | "xs" | undefined;
|
|
8
|
+
padding?: FormFieldSizeOptions | "none" | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {
|
|
14
|
+
default: {};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type AppBarProps = typeof __propDef.props;
|
|
18
|
+
export type AppBarEvents = typeof __propDef.events;
|
|
19
|
+
export type AppBarSlots = typeof __propDef.slots;
|
|
20
|
+
export default class AppBar extends SvelteComponent<AppBarProps, AppBarEvents, AppBarSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import Breadcrumbs from "./breadcrumbs.svelte";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<Meta title="Navigation/Breadcrumbs" component={Breadcrumbs} />
|
|
6
|
+
|
|
7
|
+
<Story name="Standard">
|
|
8
|
+
<Breadcrumbs
|
|
9
|
+
homeUrl="https://www.google.com"
|
|
10
|
+
crumbs={[
|
|
11
|
+
{ label: 'Search', href: 'https://www.google.com' },
|
|
12
|
+
{ label: 'Search Term', href: 'https://www.google.com' },
|
|
13
|
+
'Results'
|
|
14
|
+
]}
|
|
15
|
+
/>
|
|
16
|
+
</Story>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type BreadcrumbsProps = typeof __propDef.props;
|
|
10
|
+
export type BreadcrumbsEvents = typeof __propDef.events;
|
|
11
|
+
export type BreadcrumbsSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Breadcrumbs extends SvelteComponent<BreadcrumbsProps, BreadcrumbsEvents, BreadcrumbsSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script>import Link from "../../generic/link/link.svelte";
|
|
2
|
+
import AngleRightIcon from "../../icons/angle-right-icon.svelte";
|
|
3
|
+
import HomeIcon from "../../icons/home-icon.svelte";
|
|
4
|
+
export let homeUrl = null;
|
|
5
|
+
export let crumbs = [];
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<nav>
|
|
9
|
+
{#if homeUrl}
|
|
10
|
+
<li class="icon">
|
|
11
|
+
<Link href={homeUrl} display="block">
|
|
12
|
+
<HomeIcon />
|
|
13
|
+
</Link>
|
|
14
|
+
</li>
|
|
15
|
+
{/if}
|
|
16
|
+
{#each crumbs as crumb, i}
|
|
17
|
+
{#if typeof crumb === 'string'}
|
|
18
|
+
<li>{crumb}</li>
|
|
19
|
+
{:else}
|
|
20
|
+
<li>
|
|
21
|
+
<Link href={crumb.href}>
|
|
22
|
+
{crumb.label}
|
|
23
|
+
</Link>
|
|
24
|
+
</li>
|
|
25
|
+
{/if}
|
|
26
|
+
{#if i < crumbs.length - 1}
|
|
27
|
+
<li class="icon">
|
|
28
|
+
<AngleRightIcon />
|
|
29
|
+
</li>
|
|
30
|
+
{/if}
|
|
31
|
+
{/each}
|
|
32
|
+
</nav>
|
|
33
|
+
|
|
34
|
+
<style>nav {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
list-style: none;
|
|
38
|
+
padding: 0;
|
|
39
|
+
margin: 0;
|
|
40
|
+
line-height: 1.5rem;
|
|
41
|
+
}
|
|
42
|
+
nav li {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
vertical-align: middle;
|
|
46
|
+
margin-left: 0.5rem;
|
|
47
|
+
font-size: 0.75rem;
|
|
48
|
+
color: rgba(255, 255, 255, 0.5);
|
|
49
|
+
min-width: 12px;
|
|
50
|
+
}
|
|
51
|
+
nav li:first-child {
|
|
52
|
+
margin-left: 0;
|
|
53
|
+
}
|
|
54
|
+
nav li.icon {
|
|
55
|
+
padding-top: 2px;
|
|
56
|
+
}</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
homeUrl?: string | null | undefined;
|
|
5
|
+
crumbs?: (string | {
|
|
6
|
+
label: string;
|
|
7
|
+
href: string;
|
|
8
|
+
})[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type BreadcrumbsProps = typeof __propDef.props;
|
|
16
|
+
export type BreadcrumbsEvents = typeof __propDef.events;
|
|
17
|
+
export type BreadcrumbsSlots = typeof __propDef.slots;
|
|
18
|
+
export default class Breadcrumbs extends SvelteComponent<BreadcrumbsProps, BreadcrumbsEvents, BreadcrumbsSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import SideBar from "./side-bar.svelte";
|
|
3
|
+
let open = true;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<Meta title="Navigation/SideBar" component={SideBar} />
|
|
7
|
+
|
|
8
|
+
<Story name="Standard">
|
|
9
|
+
<SideBar {open}>
|
|
10
|
+
<ul>
|
|
11
|
+
<li>Item 1</li>
|
|
12
|
+
<li>Item 2</li>
|
|
13
|
+
</ul>
|
|
14
|
+
</SideBar>
|
|
15
|
+
|
|
16
|
+
<div style="text-align: right; position: relative; z-index: 99999">
|
|
17
|
+
<button on:click={() => (open = !open)}>Toggle</button>
|
|
18
|
+
</div>
|
|
19
|
+
</Story>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type SideBarProps = typeof __propDef.props;
|
|
10
|
+
export type SideBarEvents = typeof __propDef.events;
|
|
11
|
+
export type SideBarSlots = typeof __propDef.slots;
|
|
12
|
+
export default class SideBar extends SvelteComponent<SideBarProps, SideBarEvents, SideBarSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script>import Overlay from "../../generic/overlay.svelte";
|
|
2
|
+
export let open = false;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class:open>
|
|
6
|
+
<Overlay show={open} />
|
|
7
|
+
<aside>
|
|
8
|
+
<slot />
|
|
9
|
+
</aside>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<style>div aside {
|
|
13
|
+
width: 300px;
|
|
14
|
+
padding: 0 1rem;
|
|
15
|
+
margin: 0 auto;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
position: fixed;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: -300px;
|
|
20
|
+
bottom: 0;
|
|
21
|
+
background: #fff;
|
|
22
|
+
color: #000;
|
|
23
|
+
z-index: 9999;
|
|
24
|
+
transition: left 0.3s ease-in-out;
|
|
25
|
+
border-right: solid 1px #e5e5e5;
|
|
26
|
+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
|
|
27
|
+
}
|
|
28
|
+
div.open {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
div.open aside {
|
|
32
|
+
left: 0;
|
|
33
|
+
}</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
open?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type SideBarProps = typeof __propDef.props;
|
|
14
|
+
export type SideBarEvents = typeof __propDef.events;
|
|
15
|
+
export type SideBarSlots = typeof __propDef.slots;
|
|
16
|
+
export default class SideBar extends SvelteComponent<SideBarProps, SideBarEvents, SideBarSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script context="module">import { writable } from "svelte/store";
|
|
2
|
+
import { setContext } from "svelte";
|
|
3
|
+
export const tabContext = "tabContext";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<script>const ctx = {
|
|
7
|
+
active: writable(null)
|
|
8
|
+
};
|
|
9
|
+
setContext(tabContext, ctx);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<style>div {
|
|
17
|
+
position: relative;
|
|
18
|
+
display: block;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { type Writable } from 'svelte/store';
|
|
3
|
+
export interface TabContext {
|
|
4
|
+
active: Writable<string | null>;
|
|
5
|
+
}
|
|
6
|
+
export declare const tabContext = "tabContext";
|
|
7
|
+
declare const __propDef: {
|
|
8
|
+
props: Record<string, never>;
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type TabGroupProps = typeof __propDef.props;
|
|
17
|
+
export type TabGroupEvents = typeof __propDef.events;
|
|
18
|
+
export type TabGroupSlots = typeof __propDef.slots;
|
|
19
|
+
export default class TabGroup extends SvelteComponent<TabGroupProps, TabGroupEvents, TabGroupSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script>import { createEventDispatcher, getContext } from "svelte";
|
|
2
|
+
import { tabContext } from "./tab-group.svelte";
|
|
3
|
+
export let title;
|
|
4
|
+
export let active = false;
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
6
|
+
const ctx = getContext(tabContext);
|
|
7
|
+
const selectThisTab = () => {
|
|
8
|
+
dispatch("selectTab", title);
|
|
9
|
+
ctx.active.set(title);
|
|
10
|
+
};
|
|
11
|
+
if (active)
|
|
12
|
+
selectThisTab();
|
|
13
|
+
ctx.active.subscribe((value) => {
|
|
14
|
+
active = value === title;
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<section class:active>
|
|
19
|
+
<header>
|
|
20
|
+
<button on:click={selectThisTab} type="button">
|
|
21
|
+
{title}
|
|
22
|
+
</button>
|
|
23
|
+
</header>
|
|
24
|
+
<div>
|
|
25
|
+
{#if active}
|
|
26
|
+
<slot />
|
|
27
|
+
{/if}
|
|
28
|
+
</div>
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
<style>section {
|
|
32
|
+
display: inline;
|
|
33
|
+
}
|
|
34
|
+
section header {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
line-height: 2rem;
|
|
37
|
+
font-size: 0.8rem;
|
|
38
|
+
font-weight: 300;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
color: var(--sv-color-light);
|
|
41
|
+
height: 2rem;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
padding: 0 1rem;
|
|
44
|
+
border-width: 0.1rem 0.1rem 0 0.1rem;
|
|
45
|
+
border-style: solid;
|
|
46
|
+
border-radius: 0.5rem 0.5rem 0 0;
|
|
47
|
+
margin-right: 0.5rem;
|
|
48
|
+
border-color: transparent;
|
|
49
|
+
position: relative;
|
|
50
|
+
z-index: 2;
|
|
51
|
+
}
|
|
52
|
+
section header button {
|
|
53
|
+
appearance: none;
|
|
54
|
+
background: transparent;
|
|
55
|
+
border: none;
|
|
56
|
+
color: inherit;
|
|
57
|
+
font-size: 0.8rem;
|
|
58
|
+
padding: 0;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
section header button:focus {
|
|
64
|
+
outline: none;
|
|
65
|
+
}
|
|
66
|
+
section header:hover {
|
|
67
|
+
color: #aaa;
|
|
68
|
+
}
|
|
69
|
+
section div {
|
|
70
|
+
display: none;
|
|
71
|
+
width: 100%;
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 2rem;
|
|
74
|
+
left: 0;
|
|
75
|
+
border-top: solid 0.2rem #ccc;
|
|
76
|
+
padding-top: 1rem;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
color: var(--sv-color-fg);
|
|
79
|
+
}
|
|
80
|
+
section.active header {
|
|
81
|
+
font-weight: 700;
|
|
82
|
+
background: #ddd;
|
|
83
|
+
color: #000;
|
|
84
|
+
}
|
|
85
|
+
section.active div {
|
|
86
|
+
display: block;
|
|
87
|
+
}</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
title: string;
|
|
5
|
+
active?: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
selectTab: CustomEvent<string>;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type TabProps = typeof __propDef.props;
|
|
17
|
+
export type TabEvents = typeof __propDef.events;
|
|
18
|
+
export type TabSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Tab extends SvelteComponent<TabProps, TabEvents, TabSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import Tab from "./tab.svelte";
|
|
3
|
+
import TabGroup from "./tab-group.svelte";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<Meta title="Navigation/TabGroup" component={TabGroup} />
|
|
7
|
+
|
|
8
|
+
<Story name="Standard">
|
|
9
|
+
<TabGroup>
|
|
10
|
+
<Tab title="Tab 1" active>
|
|
11
|
+
<p>Tab 1 content</p>
|
|
12
|
+
</Tab>
|
|
13
|
+
<Tab title="Tab 2">
|
|
14
|
+
<p>Tab 2 content</p>
|
|
15
|
+
</Tab>
|
|
16
|
+
<Tab title="Tab 3">
|
|
17
|
+
<p>Tab 3 content</p>
|
|
18
|
+
</Tab>
|
|
19
|
+
</TabGroup>
|
|
20
|
+
</Story>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type TabsProps = typeof __propDef.props;
|
|
10
|
+
export type TabsEvents = typeof __propDef.events;
|
|
11
|
+
export type TabsSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Tabs extends SvelteComponent<TabsProps, TabsEvents, TabsSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import DataGrid from "./data-grid.svelte";
|
|
3
|
+
const data = [
|
|
4
|
+
{
|
|
5
|
+
id: 1,
|
|
6
|
+
name: "John Doe",
|
|
7
|
+
age: 30,
|
|
8
|
+
email: "john.doe@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: 2,
|
|
12
|
+
name: "Jane Doe",
|
|
13
|
+
age: 79,
|
|
14
|
+
email: "jd1954@aol.com"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 3,
|
|
18
|
+
name: "John Smith",
|
|
19
|
+
age: 35,
|
|
20
|
+
email: "johnnyboy23@yahoo.com"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 4,
|
|
24
|
+
name: "Jane Smith",
|
|
25
|
+
age: 40,
|
|
26
|
+
email: "countrySky983@live.com"
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
const cols = [
|
|
30
|
+
{ key: "name", label: "Name" },
|
|
31
|
+
{ key: "age", label: "Age" },
|
|
32
|
+
{ key: "email", label: "Email" }
|
|
33
|
+
];
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<Meta title="Tables/DataGrid" component={DataGrid} />
|
|
37
|
+
|
|
38
|
+
<Story name="Standard">
|
|
39
|
+
<DataGrid {data} {cols} />
|
|
40
|
+
</Story>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type DataGridProps = typeof __propDef.props;
|
|
10
|
+
export type DataGridEvents = typeof __propDef.events;
|
|
11
|
+
export type DataGridSlots = typeof __propDef.slots;
|
|
12
|
+
export default class DataGrid extends SvelteComponent<DataGridProps, DataGridEvents, DataGridSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|