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,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
marginY?: number | undefined;
|
|
5
|
+
marginX?: number | undefined;
|
|
6
|
+
gap?: number | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type FlexColProps = typeof __propDef.props;
|
|
16
|
+
export type FlexColEvents = typeof __propDef.events;
|
|
17
|
+
export type FlexColSlots = typeof __propDef.slots;
|
|
18
|
+
export default class FlexCol extends SvelteComponent<FlexColProps, FlexColEvents, FlexColSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} FlexItemProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} FlexItemEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} FlexItemSlots */
|
|
4
|
+
export default class FlexItem extends SvelteComponent<{
|
|
5
|
+
grow?: boolean | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type FlexItemProps = typeof __propDef.props;
|
|
13
|
+
export type FlexItemEvents = typeof __propDef.events;
|
|
14
|
+
export type FlexItemSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponent } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
grow?: boolean | undefined;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script>export let gap = 1;
|
|
2
|
+
export let layout = "stretch";
|
|
3
|
+
export let size = "full";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div style={`gap: ${gap}rem`} class="{layout} {size}">
|
|
7
|
+
<slot />
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<style>div {
|
|
11
|
+
display: flex;
|
|
12
|
+
width: 100%;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
div *.auto {
|
|
17
|
+
width: auto;
|
|
18
|
+
}
|
|
19
|
+
div.stretch {
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
align-items: stretch;
|
|
22
|
+
}
|
|
23
|
+
div.stretch div {
|
|
24
|
+
flex: 1;
|
|
25
|
+
}
|
|
26
|
+
div.end {
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
align-items: flex-end;
|
|
29
|
+
}
|
|
30
|
+
div.start {
|
|
31
|
+
justify-content: flex-start;
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
}</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
gap?: number | undefined;
|
|
5
|
+
layout?: "stretch" | "center" | "end" | "start" | undefined;
|
|
6
|
+
size?: "full" | "auto" | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type FlexRowProps = typeof __propDef.props;
|
|
16
|
+
export type FlexRowEvents = typeof __propDef.events;
|
|
17
|
+
export type FlexRowSlots = typeof __propDef.slots;
|
|
18
|
+
export default class FlexRow extends SvelteComponent<FlexRowProps, FlexRowEvents, FlexRowSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import Alert from "./alert.svelte";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<Meta title="Modals/Alert" component={Alert} />
|
|
6
|
+
|
|
7
|
+
<Story name="Alert">
|
|
8
|
+
<Alert title="Error" open>Something went wrong and we need to make sure you see this.</Alert>
|
|
9
|
+
</Story>
|
|
10
|
+
|
|
11
|
+
<Story name="Alert (No Title)">
|
|
12
|
+
<Alert open>Something went wrong and we need to make sure you see this.</Alert>
|
|
13
|
+
</Story>
|
|
14
|
+
|
|
15
|
+
<Story name="Alert (X-Large)">
|
|
16
|
+
<Alert title="Extra Large" open size="xl"
|
|
17
|
+
>Something went wrong and we need to make sure you see this.</Alert
|
|
18
|
+
>
|
|
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 AlertProps = typeof __propDef.props;
|
|
10
|
+
export type AlertEvents = typeof __propDef.events;
|
|
11
|
+
export type AlertSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Alert extends SvelteComponent<AlertProps, AlertEvents, AlertSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script>import DialogBody from "./dialog-body.svelte";
|
|
2
|
+
import DialogFooter from "./dialog-footer.svelte";
|
|
3
|
+
import DialogHeader from "./dialog-header.svelte";
|
|
4
|
+
import Dialog from "./dialog-window.svelte";
|
|
5
|
+
import Divider from "../generic/divider/divider.svelte";
|
|
6
|
+
import Overlay from "../generic/overlay.svelte";
|
|
7
|
+
import Button from "../forms/button/button.svelte";
|
|
8
|
+
export let open = false;
|
|
9
|
+
export let title = void 0;
|
|
10
|
+
export let size = "md";
|
|
11
|
+
export let buttonText = "OK";
|
|
12
|
+
export let showCloseButton = true;
|
|
13
|
+
const close = () => open = false;
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
{#if open}
|
|
17
|
+
<Overlay>
|
|
18
|
+
<Dialog {size}>
|
|
19
|
+
<div>
|
|
20
|
+
{#if title}
|
|
21
|
+
<DialogHeader on:close={close} {showCloseButton}>
|
|
22
|
+
{title}
|
|
23
|
+
</DialogHeader>
|
|
24
|
+
<Divider />
|
|
25
|
+
{/if}
|
|
26
|
+
<DialogBody>
|
|
27
|
+
<slot />
|
|
28
|
+
</DialogBody>
|
|
29
|
+
<Divider />
|
|
30
|
+
</div>
|
|
31
|
+
<DialogFooter>
|
|
32
|
+
<Button on:click={close} size="full">
|
|
33
|
+
{buttonText}
|
|
34
|
+
</Button>
|
|
35
|
+
</DialogFooter>
|
|
36
|
+
</Dialog>
|
|
37
|
+
</Overlay>
|
|
38
|
+
{/if}
|
|
39
|
+
|
|
40
|
+
<style>
|
|
41
|
+
div {
|
|
42
|
+
padding-bottom: 3rem;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormFieldSizeOptions } from '../../types/form.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
open?: boolean | undefined;
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
size?: FormFieldSizeOptions | undefined;
|
|
8
|
+
buttonText?: string | undefined;
|
|
9
|
+
showCloseButton?: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {
|
|
15
|
+
default: {};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type AlertProps = typeof __propDef.props;
|
|
19
|
+
export type AlertEvents = typeof __propDef.events;
|
|
20
|
+
export type AlertSlots = typeof __propDef.slots;
|
|
21
|
+
export default class Alert extends SvelteComponent<AlertProps, AlertEvents, AlertSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import Confirm from "./confirm.svelte";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<Meta title="Modals/Confirm" component={Confirm} />
|
|
6
|
+
|
|
7
|
+
<Story name="Confirm">
|
|
8
|
+
<Confirm title="Something Will Happen" open>Do you want to do this thing?</Confirm>
|
|
9
|
+
</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 ConfirmProps = typeof __propDef.props;
|
|
10
|
+
export type ConfirmEvents = typeof __propDef.events;
|
|
11
|
+
export type ConfirmSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Confirm extends SvelteComponent<ConfirmProps, ConfirmEvents, ConfirmSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script>import DialogBody from "./dialog-body.svelte";
|
|
2
|
+
import DialogFooter from "./dialog-footer.svelte";
|
|
3
|
+
import DialogHeader from "./dialog-header.svelte";
|
|
4
|
+
import Dialog from "./dialog-window.svelte";
|
|
5
|
+
import Overlay from "../generic/overlay.svelte";
|
|
6
|
+
import { createEventDispatcher } from "svelte";
|
|
7
|
+
import Button from "../forms/button/button.svelte";
|
|
8
|
+
import Divider from "../generic/divider/divider.svelte";
|
|
9
|
+
export let open = false;
|
|
10
|
+
export let title = void 0;
|
|
11
|
+
export let size = "md";
|
|
12
|
+
export let yesText = "Yes";
|
|
13
|
+
export let noText = "No";
|
|
14
|
+
export let showCloseButton = true;
|
|
15
|
+
const dispatch = createEventDispatcher();
|
|
16
|
+
const no = () => {
|
|
17
|
+
open = false;
|
|
18
|
+
dispatch("no");
|
|
19
|
+
};
|
|
20
|
+
const yes = () => {
|
|
21
|
+
open = false;
|
|
22
|
+
dispatch("yes");
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
{#if open}
|
|
27
|
+
<Overlay>
|
|
28
|
+
<Dialog {size}>
|
|
29
|
+
<div class="body">
|
|
30
|
+
{#if title}
|
|
31
|
+
<DialogHeader on:close={no} {showCloseButton}>
|
|
32
|
+
{title}
|
|
33
|
+
</DialogHeader>
|
|
34
|
+
<Divider />
|
|
35
|
+
{/if}
|
|
36
|
+
<DialogBody>
|
|
37
|
+
<slot />
|
|
38
|
+
</DialogBody>
|
|
39
|
+
<Divider />
|
|
40
|
+
</div>
|
|
41
|
+
<DialogFooter>
|
|
42
|
+
<Button on:click={no} style="secondary" size="full">
|
|
43
|
+
{noText}
|
|
44
|
+
</Button>
|
|
45
|
+
<Button on:click={yes} style="primary" size="full">
|
|
46
|
+
{yesText}
|
|
47
|
+
</Button>
|
|
48
|
+
</DialogFooter>
|
|
49
|
+
</Dialog>
|
|
50
|
+
</Overlay>
|
|
51
|
+
{/if}
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
.body {
|
|
55
|
+
padding-bottom: 3rem;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormFieldSizeOptions } from '../../types/form.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
open?: boolean | undefined;
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
size?: FormFieldSizeOptions | undefined;
|
|
8
|
+
yesText?: string | undefined;
|
|
9
|
+
noText?: string | undefined;
|
|
10
|
+
showCloseButton?: boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
yes: CustomEvent<void>;
|
|
14
|
+
no: CustomEvent<void>;
|
|
15
|
+
} & {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {
|
|
19
|
+
default: {};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type ConfirmProps = typeof __propDef.props;
|
|
23
|
+
export type ConfirmEvents = typeof __propDef.events;
|
|
24
|
+
export type ConfirmSlots = typeof __propDef.slots;
|
|
25
|
+
export default class Confirm extends SvelteComponent<ConfirmProps, ConfirmEvents, ConfirmSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} DialogBodyProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} DialogBodyEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} DialogBodySlots */
|
|
4
|
+
export default class DialogBody extends SvelteComponent<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type DialogBodyProps = typeof __propDef.props;
|
|
13
|
+
export type DialogBodyEvents = typeof __propDef.events;
|
|
14
|
+
export type DialogBodySlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponent } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import FlexRow from '../layout/flex-row.svelte';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<footer>
|
|
6
|
+
<FlexRow layout="stretch">
|
|
7
|
+
<slot />
|
|
8
|
+
</FlexRow>
|
|
9
|
+
</footer>
|
|
10
|
+
|
|
11
|
+
<style>footer {
|
|
12
|
+
position: absolute;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
height: 4rem;
|
|
17
|
+
padding: 0 0.5rem;
|
|
18
|
+
text-align: center;
|
|
19
|
+
}</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} DialogFooterProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} DialogFooterEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} DialogFooterSlots */
|
|
4
|
+
export default class DialogFooter extends SvelteComponent<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type DialogFooterProps = typeof __propDef.props;
|
|
13
|
+
export type DialogFooterEvents = typeof __propDef.events;
|
|
14
|
+
export type DialogFooterSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponent } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
const dispatch = createEventDispatcher();
|
|
3
|
+
export let showCloseButton = true;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<header>
|
|
7
|
+
<h1><slot /></h1>
|
|
8
|
+
{#if showCloseButton}
|
|
9
|
+
<div>
|
|
10
|
+
<button on:click={() => dispatch('close')}>X</button>
|
|
11
|
+
</div>
|
|
12
|
+
{/if}
|
|
13
|
+
</header>
|
|
14
|
+
|
|
15
|
+
<style>header {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
height: 2rem;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
color: #000;
|
|
22
|
+
}
|
|
23
|
+
header h1 {
|
|
24
|
+
margin: 0;
|
|
25
|
+
flex-grow: 1;
|
|
26
|
+
font-size: 1.25rem;
|
|
27
|
+
line-height: 2rem;
|
|
28
|
+
}
|
|
29
|
+
header div {
|
|
30
|
+
text-align: right;
|
|
31
|
+
}
|
|
32
|
+
header div button {
|
|
33
|
+
appearance: none;
|
|
34
|
+
border: none;
|
|
35
|
+
background-color: transparent;
|
|
36
|
+
font-size: 1.5rem;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
showCloseButton?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
close: CustomEvent<void>;
|
|
8
|
+
} & {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type DialogHeaderProps = typeof __propDef.props;
|
|
16
|
+
export type DialogHeaderEvents = typeof __propDef.events;
|
|
17
|
+
export type DialogHeaderSlots = typeof __propDef.slots;
|
|
18
|
+
export default class DialogHeader extends SvelteComponent<DialogHeaderProps, DialogHeaderEvents, DialogHeaderSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script>export let size = "md";
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<div class={size}>
|
|
5
|
+
<slot />
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<style>div {
|
|
9
|
+
position: absolute;
|
|
10
|
+
border: solid 0.1rem #000;
|
|
11
|
+
padding: 1rem;
|
|
12
|
+
margin: 1rem;
|
|
13
|
+
background-color: #fff;
|
|
14
|
+
border-radius: 1rem;
|
|
15
|
+
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
16
|
+
width: 20rem;
|
|
17
|
+
max-width: 70%;
|
|
18
|
+
z-index: 9999;
|
|
19
|
+
top: 50%;
|
|
20
|
+
left: 50%;
|
|
21
|
+
transform: translate(-50%, -50%);
|
|
22
|
+
}
|
|
23
|
+
div.sm {
|
|
24
|
+
width: 15rem;
|
|
25
|
+
max-width: 50%;
|
|
26
|
+
}
|
|
27
|
+
div.lg {
|
|
28
|
+
width: 25rem;
|
|
29
|
+
max-width: 80%;
|
|
30
|
+
}
|
|
31
|
+
div.xl {
|
|
32
|
+
width: 90%;
|
|
33
|
+
}</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormFieldSizeOptions } from '../../types/form.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
size?: FormFieldSizeOptions | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type DialogWindowProps = typeof __propDef.props;
|
|
15
|
+
export type DialogWindowEvents = typeof __propDef.events;
|
|
16
|
+
export type DialogWindowSlots = typeof __propDef.slots;
|
|
17
|
+
export default class DialogWindow extends SvelteComponent<DialogWindowProps, DialogWindowEvents, DialogWindowSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import Prompt from "./prompt.svelte";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<Meta title="Modals/Prompt" component={Prompt} />
|
|
6
|
+
|
|
7
|
+
<Story name="Default">
|
|
8
|
+
<Prompt open title="Rename File">What would you like to rename this file to?</Prompt>
|
|
9
|
+
</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 PromptProps = typeof __propDef.props;
|
|
10
|
+
export type PromptEvents = typeof __propDef.events;
|
|
11
|
+
export type PromptSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Prompt extends SvelteComponent<PromptProps, PromptEvents, PromptSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script>import DialogBody from "./dialog-body.svelte";
|
|
2
|
+
import DialogFooter from "./dialog-footer.svelte";
|
|
3
|
+
import DialogHeader from "./dialog-header.svelte";
|
|
4
|
+
import Dialog from "./dialog-window.svelte";
|
|
5
|
+
import Overlay from "../generic/overlay.svelte";
|
|
6
|
+
import { createEventDispatcher } from "svelte";
|
|
7
|
+
import Button from "../forms/button/button.svelte";
|
|
8
|
+
import Divider from "../generic/divider/divider.svelte";
|
|
9
|
+
import TextBox from "../forms/text-box/text-box.svelte";
|
|
10
|
+
export let open = false;
|
|
11
|
+
export let title = void 0;
|
|
12
|
+
export let size = "md";
|
|
13
|
+
export let okText = "Yes";
|
|
14
|
+
export let cancelText = "No";
|
|
15
|
+
export let showCloseButton = true;
|
|
16
|
+
export let placeholder = "";
|
|
17
|
+
export let type = "text";
|
|
18
|
+
export let required = false;
|
|
19
|
+
let value = "";
|
|
20
|
+
const dispatch = createEventDispatcher();
|
|
21
|
+
const no = () => {
|
|
22
|
+
open = false;
|
|
23
|
+
dispatch("cancel");
|
|
24
|
+
};
|
|
25
|
+
const yes = () => {
|
|
26
|
+
if (required && !value)
|
|
27
|
+
return;
|
|
28
|
+
open = false;
|
|
29
|
+
dispatch("ok", value);
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#if open}
|
|
34
|
+
<Overlay>
|
|
35
|
+
<Dialog {size}>
|
|
36
|
+
<div class="body">
|
|
37
|
+
{#if title}
|
|
38
|
+
<DialogHeader on:close={no} {showCloseButton}>
|
|
39
|
+
{title}
|
|
40
|
+
</DialogHeader>
|
|
41
|
+
<Divider />
|
|
42
|
+
{/if}
|
|
43
|
+
<DialogBody>
|
|
44
|
+
<TextBox bind:value {placeholder} {type} {required} size="full">
|
|
45
|
+
<slot />
|
|
46
|
+
</TextBox>
|
|
47
|
+
</DialogBody>
|
|
48
|
+
<Divider />
|
|
49
|
+
</div>
|
|
50
|
+
<DialogFooter>
|
|
51
|
+
<Button on:click={no} style="secondary" size="full">
|
|
52
|
+
{cancelText}
|
|
53
|
+
</Button>
|
|
54
|
+
<Button on:click={yes} style="primary" size="full">
|
|
55
|
+
{okText}
|
|
56
|
+
</Button>
|
|
57
|
+
</DialogFooter>
|
|
58
|
+
</Dialog>
|
|
59
|
+
</Overlay>
|
|
60
|
+
{/if}
|
|
61
|
+
|
|
62
|
+
<style>
|
|
63
|
+
.body {
|
|
64
|
+
padding-bottom: 3rem;
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { AllowedTextInputTypes, FormFieldSizeOptions } from '../../types/form.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
open?: boolean | undefined;
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
size?: FormFieldSizeOptions | undefined;
|
|
8
|
+
okText?: string | undefined;
|
|
9
|
+
cancelText?: string | undefined;
|
|
10
|
+
showCloseButton?: boolean | undefined;
|
|
11
|
+
placeholder?: string | undefined;
|
|
12
|
+
type?: AllowedTextInputTypes | undefined;
|
|
13
|
+
required?: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
events: {
|
|
16
|
+
ok: CustomEvent<string>;
|
|
17
|
+
cancel: CustomEvent<void>;
|
|
18
|
+
} & {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {
|
|
22
|
+
default: {};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type PromptProps = typeof __propDef.props;
|
|
26
|
+
export type PromptEvents = typeof __propDef.events;
|
|
27
|
+
export type PromptSlots = typeof __propDef.slots;
|
|
28
|
+
export default class Prompt extends SvelteComponent<PromptProps, PromptEvents, PromptSlots> {
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import { Meta, Story } from "@storybook/addon-svelte-csf";
|
|
2
|
+
import Accordian from "./accordian.svelte";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<Meta title="Navigation/Accordian" component={Accordian} />
|
|
6
|
+
|
|
7
|
+
<Story name="Standard">
|
|
8
|
+
<Accordian title="Card title">
|
|
9
|
+
<nav>
|
|
10
|
+
<li>Item 1</li>
|
|
11
|
+
<li>Item 2</li>
|
|
12
|
+
<li>Item 3</li>
|
|
13
|
+
<li>Item 4</li>
|
|
14
|
+
<li>Item 5</li>
|
|
15
|
+
<li>Item 6</li>
|
|
16
|
+
</nav>
|
|
17
|
+
</Accordian>
|
|
18
|
+
</Story>
|