@skeletonlabs/skeleton 0.92.2 → 0.124.2
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 +0 -1
- package/actions/Filters/filter.js +6 -9
- package/components/Accordion/Accordion.svelte +30 -0
- package/components/Accordion/Accordion.svelte.d.ts +37 -0
- package/components/Accordion/AccordionItem.svelte +83 -63
- package/components/Accordion/AccordionItem.svelte.d.ts +20 -6
- package/components/AppBar/AppBar.svelte +48 -49
- package/components/AppBar/AppBar.svelte.d.ts +20 -1
- package/components/AppRail/AppRail.svelte +20 -40
- package/components/AppRail/AppRail.svelte.d.ts +13 -1
- package/components/AppRail/AppRailTile.svelte +32 -43
- package/components/AppRail/AppRailTile.svelte.d.ts +10 -4
- package/components/AppShell/AppShell.svelte +30 -39
- package/components/AppShell/AppShell.svelte.d.ts +11 -0
- package/components/Avatar/Avatar.svelte +18 -35
- package/components/Avatar/Avatar.svelte.d.ts +16 -5
- package/components/ConicGradient/ConicGradient.svelte +43 -49
- package/components/ConicGradient/ConicGradient.svelte.d.ts +11 -0
- package/components/ConicGradient/settings.d.ts +2 -4
- package/components/ConicGradient/settings.js +2 -2
- package/components/FileButton/FileButton.svelte +19 -14
- package/components/FileButton/FileButton.svelte.d.ts +3 -1
- package/components/FileDropzone/FileDropzone.svelte +48 -88
- package/components/FileDropzone/FileDropzone.svelte.d.ts +24 -8
- package/components/InputChip/InputChip.svelte +111 -96
- package/components/InputChip/InputChip.svelte.d.ts +28 -5
- package/components/ListBox/ListBox.svelte +18 -54
- package/components/ListBox/ListBox.svelte.d.ts +11 -10
- package/components/ListBox/ListBoxItem.svelte +69 -75
- package/components/ListBox/ListBoxItem.svelte.d.ts +11 -7
- package/components/Paginator/Paginator.svelte +27 -43
- package/components/Paginator/Paginator.svelte.d.ts +13 -2
- package/components/ProgressBar/ProgressBar.svelte +25 -44
- package/components/ProgressBar/ProgressBar.svelte.d.ts +9 -1
- package/components/ProgressRadial/ProgressRadial.svelte +20 -40
- package/components/ProgressRadial/ProgressRadial.svelte.d.ts +9 -2
- package/components/Radio/RadioGroup.svelte +22 -44
- package/components/Radio/RadioGroup.svelte.d.ts +15 -7
- package/components/Radio/RadioItem.svelte +37 -45
- package/components/Radio/RadioItem.svelte.d.ts +10 -6
- package/components/RangeSlider/RangeSlider.svelte +26 -57
- package/components/RangeSlider/RangeSlider.svelte.d.ts +11 -2
- package/components/SlideToggle/SlideToggle.svelte +43 -54
- package/components/SlideToggle/SlideToggle.svelte.d.ts +11 -3
- package/components/Stepper/Step.svelte +69 -120
- package/components/Stepper/Step.svelte.d.ts +17 -18
- package/components/Stepper/Stepper.svelte +61 -61
- package/components/Stepper/Stepper.svelte.d.ts +28 -14
- package/components/Tab/Tab.svelte +48 -61
- package/components/Tab/Tab.svelte.d.ts +19 -14
- package/components/Tab/TabGroup.svelte +35 -66
- package/components/Tab/TabGroup.svelte.d.ts +25 -9
- package/components/Table/Table.svelte +20 -36
- package/components/Table/Table.svelte.d.ts +9 -0
- package/components/TableOfContents/TableOfContents.svelte +63 -94
- package/components/TableOfContents/TableOfContents.svelte.d.ts +12 -0
- package/index.d.ts +2 -6
- package/index.js +1 -6
- package/package.json +39 -29
- package/styles/all.css +3 -3
- package/styles/core.css +11 -2
- package/styles/elements/alerts.css +2 -28
- package/styles/elements/badges.css +0 -25
- package/styles/elements/breadcrumbs.css +2 -3
- package/styles/elements/buttons.css +33 -120
- package/styles/elements/cards.css +2 -29
- package/styles/elements/chips.css +9 -58
- package/styles/elements/forms.css +269 -0
- package/styles/elements/lists.css +5 -4
- package/styles/elements/logo-clouds.css +2 -4
- package/styles/elements/tables.css +14 -10
- package/styles/elements.css +1 -0
- package/styles/tailwind.css +7 -3
- package/styles/typography.css +46 -62
- package/styles/variants.css +154 -0
- package/tailwind/core.cjs +37 -0
- package/tailwind/core.d.cts +5 -0
- package/tailwind/generated/intellisense-classes.cjs +1 -0
- package/tailwind/generated/{allComponents.d.cts → intellisense-classes.d.cts} +886 -1029
- package/tailwind/intellisense.cjs +21 -0
- package/tailwind/intellisense.d.cts +5 -0
- package/tailwind/settings.cjs +16 -16
- package/tailwind/skeleton.cjs +13 -44
- package/tailwind/skeleton.d.cts +4 -2
- package/tailwind/theme/colors.cjs +7 -7
- package/tailwind/tokens/backgrounds.cjs +28 -30
- package/tailwind/tokens/border-radius.cjs +15 -15
- package/tailwind/tokens/borders.cjs +14 -14
- package/tailwind/tokens/fills.cjs +14 -14
- package/tailwind/tokens/rings.cjs +40 -32
- package/tailwind/tokens/rings.d.cts +5 -0
- package/tailwind/tokens/text.cjs +24 -26
- package/themes/theme-skeleton.css +6 -6
- package/utilities/CodeBlock/CodeBlock.svelte +28 -40
- package/utilities/CodeBlock/CodeBlock.svelte.d.ts +8 -0
- package/utilities/DataTable/DataTable.js +1 -1
- package/utilities/Drawer/Drawer.svelte +82 -105
- package/utilities/Drawer/Drawer.svelte.d.ts +13 -0
- package/utilities/LightSwitch/LightSwitch.svelte +32 -50
- package/utilities/LightSwitch/LightSwitch.svelte.d.ts +3 -1
- package/utilities/Modal/Modal.svelte +58 -93
- package/utilities/Modal/Modal.svelte.d.ts +18 -0
- package/utilities/Modal/examples/ModalExampleEmbed.svelte +3 -6
- package/utilities/Modal/examples/ModalExampleForm.svelte +16 -22
- package/utilities/Modal/examples/ModalExampleImage.svelte +19 -0
- package/utilities/Modal/examples/ModalExampleImage.svelte.d.ts +16 -0
- package/utilities/Modal/examples/ModalExampleList.svelte +11 -15
- package/utilities/Toast/Toast.svelte +65 -87
- package/utilities/Toast/Toast.svelte.d.ts +12 -0
- package/utilities/Toast/stores.js +13 -4
- package/components/Accordion/AccordionGroup.svelte +0 -46
- package/components/Accordion/AccordionGroup.svelte.d.ts +0 -24
- package/components/Alert/Alert.svelte +0 -65
- package/components/Alert/Alert.svelte.d.ts +0 -30
- package/components/Breadcrumb/Breadcrumb.svelte +0 -24
- package/components/Breadcrumb/Breadcrumb.svelte.d.ts +0 -21
- package/components/Breadcrumb/Crumb.svelte +0 -37
- package/components/Breadcrumb/Crumb.svelte.d.ts +0 -26
- package/components/Divider/Divider.svelte +0 -21
- package/components/Divider/Divider.svelte.d.ts +0 -22
- package/components/GradientHeading/GradientHeading.svelte +0 -21
- package/components/GradientHeading/GradientHeading.svelte.d.ts +0 -22
- package/components/SvgIcon/SvgIcon.svelte +0 -45
- package/components/SvgIcon/SvgIcon.svelte.d.ts +0 -26
- package/components/SvgIcon/icons.d.ts +0 -1
- package/components/SvgIcon/icons.js +0 -25
- package/styles/forms.css +0 -178
- package/tailwind/generated/allComponents.cjs +0 -1
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
export let parent;
|
|
4
|
-
// Stores
|
|
5
|
-
import { modalStore } from '../../../index.ts';
|
|
6
|
-
// Form Data
|
|
1
|
+
<script>export let parent;
|
|
2
|
+
import { modalStore } from "../../../index.ts";
|
|
7
3
|
const formData = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
name: "Jane Doe",
|
|
5
|
+
tel: "214-555-1234",
|
|
6
|
+
email: "jdoe@email.com"
|
|
11
7
|
};
|
|
12
|
-
// We've created a custom submit function to pass the response and close the modal.
|
|
13
8
|
function onFormSubmit() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
if ($modalStore[0].response)
|
|
10
|
+
$modalStore[0].response(formData);
|
|
11
|
+
modalStore.close();
|
|
17
12
|
}
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const cForm = 'border border-surface-500 p-4 space-y-4 rounded-container-token';
|
|
13
|
+
const cBase = "space-y-4";
|
|
14
|
+
const cForm = "border border-surface-500 p-4 space-y-4 rounded-container-token";
|
|
21
15
|
</script>
|
|
22
16
|
|
|
23
17
|
<!-- @component This example creates a simple form modal. -->
|
|
@@ -26,17 +20,17 @@ const cForm = 'border border-surface-500 p-4 space-y-4 rounded-container-token';
|
|
|
26
20
|
<!-- Enable for debugging: -->
|
|
27
21
|
<!-- <pre>{JSON.stringify(formData, null, 2)}</pre> -->
|
|
28
22
|
<form class="modal-form {cForm}">
|
|
29
|
-
<label>
|
|
23
|
+
<label class="label">
|
|
30
24
|
<span>Name</span>
|
|
31
|
-
<input type="text" bind:value={formData.name} placeholder="Enter name..." />
|
|
25
|
+
<input class="input" type="text" bind:value={formData.name} placeholder="Enter name..." />
|
|
32
26
|
</label>
|
|
33
|
-
<label>
|
|
27
|
+
<label class="label">
|
|
34
28
|
<span>Phone Number</span>
|
|
35
|
-
<input type="tel" bind:value={formData.tel} placeholder="Enter phone..." />
|
|
29
|
+
<input class="input" type="tel" bind:value={formData.tel} placeholder="Enter phone..." />
|
|
36
30
|
</label>
|
|
37
|
-
<label>
|
|
31
|
+
<label class="label">
|
|
38
32
|
<span>Email</span>
|
|
39
|
-
<input type="email" bind:value={formData.email} placeholder="Enter email address..." />
|
|
33
|
+
<input class="input" type="email" bind:value={formData.email} placeholder="Enter email address..." />
|
|
40
34
|
</label>
|
|
41
35
|
</form>
|
|
42
36
|
<!-- prettier-ignore -->
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>import { fade } from "svelte/transition";
|
|
2
|
+
import { modalStore } from "../../../index.ts";
|
|
3
|
+
export let parent;
|
|
4
|
+
const cButton = "fixed top-4 right-4 z-50 font-bold";
|
|
5
|
+
const cImage = "";
|
|
6
|
+
let showButton = false;
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
showButton = true;
|
|
9
|
+
}, 500);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div>
|
|
13
|
+
<!-- Button -->
|
|
14
|
+
{#if showButton}
|
|
15
|
+
<button class="btn-icon btn-icon-lg variant-filled {cButton}" on:click={parent.onClose} transition:fade|local>×</button>
|
|
16
|
+
{/if}
|
|
17
|
+
<!-- Image -->
|
|
18
|
+
<img src={$modalStore[0]?.meta.src} class={cImage} alt="Example" />
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
parent: any;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export type ModalExampleImageProps = typeof __propDef.props;
|
|
12
|
+
export type ModalExampleImageEvents = typeof __propDef.events;
|
|
13
|
+
export type ModalExampleImageSlots = typeof __propDef.slots;
|
|
14
|
+
export default class ModalExampleImage extends SvelteComponentTyped<ModalExampleImageProps, ModalExampleImageEvents, ModalExampleImageSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { ListBox, ListBoxItem, modalStore } from '../../../index.ts';
|
|
3
|
-
// Props
|
|
4
|
-
/** Exposes parent props to this component. */
|
|
1
|
+
<script>import { ListBox, ListBoxItem, modalStore } from "../../../index.ts";
|
|
5
2
|
export let parent;
|
|
6
|
-
|
|
3
|
+
let flavor = "chocolate";
|
|
7
4
|
function onFormSubmit() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
if ($modalStore[0].response)
|
|
6
|
+
$modalStore[0].response(flavor);
|
|
7
|
+
modalStore.close();
|
|
11
8
|
}
|
|
12
|
-
|
|
13
|
-
const cBase = 'space-y-4';
|
|
9
|
+
const cBase = "space-y-4";
|
|
14
10
|
</script>
|
|
15
11
|
|
|
16
12
|
<!-- @component This example creates a simple form modal. -->
|
|
17
13
|
|
|
18
14
|
<div class="modal-example-form {cBase}">
|
|
19
|
-
<ListBox
|
|
20
|
-
<ListBoxItem value="chocolate">Chocolate</ListBoxItem>
|
|
21
|
-
<ListBoxItem value="vanilla">Vanilla</ListBoxItem>
|
|
22
|
-
<ListBoxItem value="strawberry">Strawberry</ListBoxItem>
|
|
23
|
-
<ListBoxItem value="peach">Peach</ListBoxItem>
|
|
15
|
+
<ListBox class="border border-surface-500 p-4 rounded-container-token">
|
|
16
|
+
<ListBoxItem bind:group={flavor} name="chocolate" value="chocolate">Chocolate</ListBoxItem>
|
|
17
|
+
<ListBoxItem bind:group={flavor} name="vanilla" value="vanilla">Vanilla</ListBoxItem>
|
|
18
|
+
<ListBoxItem bind:group={flavor} name="strawberry" value="strawberry">Strawberry</ListBoxItem>
|
|
19
|
+
<ListBoxItem bind:group={flavor} name="peach" value="peach">Peach</ListBoxItem>
|
|
24
20
|
</ListBox>
|
|
25
21
|
<!-- prettier-ignore -->
|
|
26
22
|
<footer class="modal-footer {parent.regionFooter}">
|
|
@@ -1,97 +1,75 @@
|
|
|
1
|
-
<script>import { fly } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// Props
|
|
5
|
-
/** Set the toast position.
|
|
6
|
-
* @type {'t' | 'b' | 'l' | 'r' | 'tl' | 'tr' | 'bl' | 'br'}
|
|
7
|
-
*/
|
|
8
|
-
export let position = 'b';
|
|
9
|
-
/** Maximum toasts that can show at once. */
|
|
1
|
+
<script>import { fly } from "svelte/transition";
|
|
2
|
+
import { toastStore } from "./stores";
|
|
3
|
+
export let position = "b";
|
|
10
4
|
export let max = 3;
|
|
11
|
-
/** The duration of the fly in/out animation. */
|
|
12
5
|
export let duration = 150;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export let
|
|
16
|
-
|
|
17
|
-
export let
|
|
18
|
-
|
|
19
|
-
export let
|
|
20
|
-
|
|
21
|
-
export let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export let rounded = 'rounded-container-token';
|
|
26
|
-
/** Provide classes to set the border box shadow. */
|
|
27
|
-
export let shadow = 'shadow-lg';
|
|
28
|
-
// Props (buttons)
|
|
29
|
-
/** Provide action button styles. */
|
|
30
|
-
export let buttonAction = 'btn-filled';
|
|
31
|
-
/** Provide dismiss button styles. */
|
|
32
|
-
export let buttonDismiss = 'btn-filled';
|
|
33
|
-
// Base Classes
|
|
34
|
-
const cWrapper = 'flex fixed top-0 left-0 right-0 bottom-0 z-[888] pointer-events-none';
|
|
35
|
-
const cSnackbar = 'flex flex-col space-y-2';
|
|
36
|
-
const cToast = 'flex justify-between items-center pointer-events-auto';
|
|
37
|
-
// Local
|
|
6
|
+
export let background = "bg-secondary-500";
|
|
7
|
+
export let width = "max-w-[640px]";
|
|
8
|
+
export let color = "text-on-secondary-token";
|
|
9
|
+
export let padding = "p-4";
|
|
10
|
+
export let spacing = "space-x-4";
|
|
11
|
+
export let rounded = "rounded-container-token";
|
|
12
|
+
export let shadow = "shadow-lg";
|
|
13
|
+
export let buttonAction = "variant-filled";
|
|
14
|
+
export let buttonDismiss = "variant-filled";
|
|
15
|
+
const cWrapper = "flex fixed top-0 left-0 right-0 bottom-0 z-[888] pointer-events-none";
|
|
16
|
+
const cSnackbar = "flex flex-col space-y-2";
|
|
17
|
+
const cToast = "flex justify-between items-center pointer-events-auto";
|
|
38
18
|
let cPosition;
|
|
39
|
-
let cAlign;
|
|
19
|
+
let cAlign;
|
|
40
20
|
let animAxis = { x: 0, y: 0 };
|
|
41
|
-
// Set Position
|
|
42
|
-
// prettier-ignore
|
|
43
21
|
switch (position) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
animAxis = { x: 100, y: 0 };
|
|
85
|
-
break;
|
|
22
|
+
case "t":
|
|
23
|
+
cPosition = "justify-center items-start";
|
|
24
|
+
cAlign = "items-center";
|
|
25
|
+
animAxis = { x: 0, y: -100 };
|
|
26
|
+
break;
|
|
27
|
+
case "b":
|
|
28
|
+
cPosition = "justify-center items-end";
|
|
29
|
+
cAlign = "items-center";
|
|
30
|
+
animAxis = { x: 0, y: 100 };
|
|
31
|
+
break;
|
|
32
|
+
case "l":
|
|
33
|
+
cPosition = "justify-start items-center";
|
|
34
|
+
cAlign = "items-start";
|
|
35
|
+
animAxis = { x: -100, y: 0 };
|
|
36
|
+
break;
|
|
37
|
+
case "r":
|
|
38
|
+
cPosition = "justify-end items-center";
|
|
39
|
+
cAlign = "items-end";
|
|
40
|
+
animAxis = { x: 100, y: 0 };
|
|
41
|
+
break;
|
|
42
|
+
case "tl":
|
|
43
|
+
cPosition = "justify-start items-start";
|
|
44
|
+
cAlign = "items-start";
|
|
45
|
+
animAxis = { x: -100, y: 0 };
|
|
46
|
+
break;
|
|
47
|
+
case "tr":
|
|
48
|
+
cPosition = "justify-end items-start";
|
|
49
|
+
cAlign = "items-end";
|
|
50
|
+
animAxis = { x: 100, y: 0 };
|
|
51
|
+
break;
|
|
52
|
+
case "bl":
|
|
53
|
+
cPosition = "justify-start items-end";
|
|
54
|
+
cAlign = "items-start";
|
|
55
|
+
animAxis = { x: -100, y: 0 };
|
|
56
|
+
break;
|
|
57
|
+
case "br":
|
|
58
|
+
cPosition = "justify-end items-end";
|
|
59
|
+
cAlign = "items-end";
|
|
60
|
+
animAxis = { x: 100, y: 0 };
|
|
61
|
+
break;
|
|
86
62
|
}
|
|
87
63
|
function onAction(index) {
|
|
88
|
-
|
|
89
|
-
|
|
64
|
+
$toastStore[index]?.action?.response();
|
|
65
|
+
toastStore.close($toastStore[index].id);
|
|
90
66
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
$:
|
|
94
|
-
|
|
67
|
+
$:
|
|
68
|
+
classesWrapper = `${cWrapper} ${cPosition} ${$$props.class || ""}`;
|
|
69
|
+
$:
|
|
70
|
+
classesSnackbar = `${cSnackbar} ${cAlign} ${padding}`;
|
|
71
|
+
$:
|
|
72
|
+
classesBase = `${cToast} ${background} ${width} ${color} ${padding} ${spacing} ${rounded} ${shadow}`;
|
|
95
73
|
</script>
|
|
96
74
|
|
|
97
75
|
{#if $toastStore.length}
|
|
@@ -100,7 +78,7 @@ $: classesBase = `${cToast} ${background} ${width} ${color} ${padding} ${spacing
|
|
|
100
78
|
<!-- List -->
|
|
101
79
|
<div class="snackbar {classesSnackbar}" transition:fly={{ x: animAxis.x, y: animAxis.y, duration }}>
|
|
102
80
|
{#each $toastStore as t, i}
|
|
103
|
-
{#if i < max
|
|
81
|
+
{#if i < max}
|
|
104
82
|
<!-- Toast -->
|
|
105
83
|
<div class="toast {classesBase} {t.classes}" role="alert" aria-live="polite" data-testid="toast">
|
|
106
84
|
<div class="text-base">{@html t.message}</div>
|
|
@@ -2,17 +2,29 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
+
/** Set the toast position.*/
|
|
5
6
|
position?: string | undefined;
|
|
7
|
+
/** Maximum toasts that can show at once.*/
|
|
6
8
|
max?: number | undefined;
|
|
9
|
+
/** The duration of the fly in/out animation.*/
|
|
7
10
|
duration?: number | undefined;
|
|
11
|
+
/** Provide classes to set the background color.*/
|
|
8
12
|
background?: string | undefined;
|
|
13
|
+
/** Provide classes to set width styles.*/
|
|
9
14
|
width?: string | undefined;
|
|
15
|
+
/** Provide classes to set the text color.*/
|
|
10
16
|
color?: string | undefined;
|
|
17
|
+
/** Provide classes to set the padding.*/
|
|
11
18
|
padding?: string | undefined;
|
|
19
|
+
/** Provide classes to set the horizontal spacing.*/
|
|
12
20
|
spacing?: string | undefined;
|
|
21
|
+
/** Provide classes to set the border radius styles.*/
|
|
13
22
|
rounded?: string | undefined;
|
|
23
|
+
/** Provide classes to set the border box shadow.*/
|
|
14
24
|
shadow?: string | undefined;
|
|
25
|
+
/** Provide action button styles.*/
|
|
15
26
|
buttonAction?: string | undefined;
|
|
27
|
+
/** Provide dismiss button styles.*/
|
|
16
28
|
buttonDismiss?: string | undefined;
|
|
17
29
|
};
|
|
18
30
|
events: {
|
|
@@ -26,16 +26,25 @@ function toastService() {
|
|
|
26
26
|
// prettier-ignore
|
|
27
27
|
switch (toast.preset) {
|
|
28
28
|
// Success/Error
|
|
29
|
+
// IMPORTANT: use full class names here. Do not construct the classes.
|
|
30
|
+
case ('primary'):
|
|
31
|
+
classes += '!bg-primary-500 text-on-primary-token';
|
|
32
|
+
break;
|
|
33
|
+
case ('secondary'):
|
|
34
|
+
classes += '!bg-secondary-500 text-on-secondary-token';
|
|
35
|
+
break;
|
|
36
|
+
case ('tertiary'):
|
|
37
|
+
classes += '!bg-tertiary-500 text-on-tertiary-token';
|
|
38
|
+
break;
|
|
29
39
|
case ('success'):
|
|
30
40
|
classes += '!bg-success-500 text-on-success-token';
|
|
31
41
|
break;
|
|
42
|
+
case ('warning'):
|
|
43
|
+
classes += '!bg-warning-500 text-on-warning-token';
|
|
44
|
+
break;
|
|
32
45
|
case ('error'):
|
|
33
46
|
classes += '!bg-error-500 text-on-error-token';
|
|
34
47
|
break;
|
|
35
|
-
// Theme
|
|
36
|
-
default:
|
|
37
|
-
classes += `!bg-${toast.preset}-500 text-on-${toast.preset}-token`;
|
|
38
|
-
break;
|
|
39
48
|
}
|
|
40
49
|
// Merge into store
|
|
41
50
|
const tMerged = { ...toastDefaults, ...toast, id, classes };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<script>// Slots:
|
|
2
|
-
// NOTE: we cannot describe the default slot.
|
|
3
|
-
import { onMount, setContext } from 'svelte';
|
|
4
|
-
/** Enable auto-collapse mode. */
|
|
5
|
-
export let collapse = true;
|
|
6
|
-
/** Provide classes to set the hover background color. */
|
|
7
|
-
export let hover = 'bg-primary-hover-token';
|
|
8
|
-
/** Provide classes to set vertical spacing. */
|
|
9
|
-
export let spacing = 'space-y-4';
|
|
10
|
-
/** Provide classes to set padding for summary and content regions. */
|
|
11
|
-
export let padding = 'px-4 py-2';
|
|
12
|
-
/** Provide classes to set summary border radius. */
|
|
13
|
-
export let rounded = 'rounded-token';
|
|
14
|
-
// Context
|
|
15
|
-
setContext('hover', hover);
|
|
16
|
-
setContext('spacing', spacing);
|
|
17
|
-
setContext('padding', padding);
|
|
18
|
-
setContext('rounded', rounded);
|
|
19
|
-
// Classes
|
|
20
|
-
const cBase = 'rounded-container-token';
|
|
21
|
-
// Local
|
|
22
|
-
let elemAccordian;
|
|
23
|
-
// Lifecycle
|
|
24
|
-
onMount(() => {
|
|
25
|
-
if (collapse) {
|
|
26
|
-
// Ensure only one detail element is open at a time
|
|
27
|
-
// https://nikitahl.com/native-html-accordion
|
|
28
|
-
const details = Array.from(elemAccordian.querySelectorAll('details'));
|
|
29
|
-
details.forEach((detail) => {
|
|
30
|
-
detail.addEventListener('click', (e) => {
|
|
31
|
-
const active = details.find((d) => d.open);
|
|
32
|
-
if (!e.currentTarget.open && active)
|
|
33
|
-
active.open = false;
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
// Reactive
|
|
39
|
-
$: classesBase = `${cBase} ${spacing} ${$$props.class ?? ''}`;
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<!-- @component The Accordion parent element. -->
|
|
43
|
-
|
|
44
|
-
<div bind:this={elemAccordian} class="accordion-group {classesBase}" data-testid="accordion-group">
|
|
45
|
-
<slot />
|
|
46
|
-
</div>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
collapse?: boolean | undefined;
|
|
6
|
-
hover?: string | undefined;
|
|
7
|
-
spacing?: string | undefined;
|
|
8
|
-
padding?: string | undefined;
|
|
9
|
-
rounded?: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
default: {};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type AccordionGroupProps = typeof __propDef.props;
|
|
19
|
-
export type AccordionGroupEvents = typeof __propDef.events;
|
|
20
|
-
export type AccordionGroupSlots = typeof __propDef.slots;
|
|
21
|
-
/** The Accordion parent element. */
|
|
22
|
-
export default class AccordionGroup extends SvelteComponentTyped<AccordionGroupProps, AccordionGroupEvents, AccordionGroupSlots> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<script>//Slots
|
|
2
|
-
/**
|
|
3
|
-
* @slot lead - Provide a leading element, such as an icon.
|
|
4
|
-
* @slot content - Provide the alert message text.
|
|
5
|
-
* @slot trail - Provide a trailing element, such as a call to action.
|
|
6
|
-
* @slot title - Provide the alert title text.
|
|
7
|
-
*/
|
|
8
|
-
import { fade } from 'svelte/transition';
|
|
9
|
-
// Props
|
|
10
|
-
/** Control visibility of the alert. */
|
|
11
|
-
export let visible = true;
|
|
12
|
-
/** Provide classes to set background color. */
|
|
13
|
-
export let background = 'bg-warning-500/20';
|
|
14
|
-
/** Provide classes to set the border styles. */
|
|
15
|
-
export let border = 'border border-warning-500';
|
|
16
|
-
/** Provide classes to set text color. */
|
|
17
|
-
export let color = '';
|
|
18
|
-
/** Provide classes to set border radius. */
|
|
19
|
-
export let rounded = 'rounded-container-token';
|
|
20
|
-
/** Svelte fade transition duration. Set 0 to disable. */
|
|
21
|
-
export let duration = 200; // ms
|
|
22
|
-
// Props (regions)
|
|
23
|
-
/** Classes to be applied to the lead slot region. */
|
|
24
|
-
export let slotLead = '';
|
|
25
|
-
/** Classes to be applied to the content slot region. */
|
|
26
|
-
export let slotContent = '';
|
|
27
|
-
/** Classes to be applied to the trail slot region. */
|
|
28
|
-
export let slotTrail = '';
|
|
29
|
-
// Base Classes
|
|
30
|
-
let cBaseCard = 'flex flex-col items-start lg:items-center lg:flex-row p-5 space-y-4 lg:space-y-0 lg:space-x-4';
|
|
31
|
-
let cLead = 'flex justify-center items-center';
|
|
32
|
-
let cContent = 'flex flex-col w-full justify-center space-y-2';
|
|
33
|
-
let cTrail = 'flex items-center space-x-4';
|
|
34
|
-
// Reactive Classes
|
|
35
|
-
$: classesCard = `${cBaseCard} ${background} ${border} ${color} ${rounded} ${$$props.class ?? ''}`;
|
|
36
|
-
$: classesLead = `${cLead} ${slotLead}`;
|
|
37
|
-
$: classesContent = `${cContent} ${slotContent}`;
|
|
38
|
-
$: classesTrail = `${cTrail} ${slotTrail}`;
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
{#if visible}
|
|
42
|
-
<div class="alert {classesCard}" transition:fade|local={{ duration }} data-testid="alert" role="alert" aria-live="polite">
|
|
43
|
-
<!-- Slot: Lead -->
|
|
44
|
-
{#if $$slots.lead}
|
|
45
|
-
<section class="alert-lead {classesLead}">
|
|
46
|
-
<slot name="lead" />
|
|
47
|
-
</section>
|
|
48
|
-
{/if}
|
|
49
|
-
|
|
50
|
-
<!-- Content -->
|
|
51
|
-
<section class="alert-content {classesContent}">
|
|
52
|
-
<!-- Slot: Title -->
|
|
53
|
-
{#if $$slots.title}<h3 class="alert-title"><slot name="title" /></h3>{/if}
|
|
54
|
-
<!-- Slot: Default -->
|
|
55
|
-
{#if $$slots.default}<div class="alert-message {color}"><slot /></div>{/if}
|
|
56
|
-
</section>
|
|
57
|
-
|
|
58
|
-
<!-- Slot: Trail -->
|
|
59
|
-
{#if $$slots.trail}
|
|
60
|
-
<section class="alert-trail {classesTrail}">
|
|
61
|
-
<slot name="trail" />
|
|
62
|
-
</section>
|
|
63
|
-
{/if}
|
|
64
|
-
</div>
|
|
65
|
-
{/if}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
visible?: boolean | undefined;
|
|
6
|
-
background?: string | undefined;
|
|
7
|
-
border?: string | undefined;
|
|
8
|
-
color?: string | undefined;
|
|
9
|
-
rounded?: string | undefined;
|
|
10
|
-
duration?: number | undefined;
|
|
11
|
-
slotLead?: string | undefined;
|
|
12
|
-
slotContent?: string | undefined;
|
|
13
|
-
slotTrail?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {
|
|
19
|
-
lead: {};
|
|
20
|
-
title: {};
|
|
21
|
-
default: {};
|
|
22
|
-
trail: {};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export type AlertProps = typeof __propDef.props;
|
|
26
|
-
export type AlertEvents = typeof __propDef.events;
|
|
27
|
-
export type AlertSlots = typeof __propDef.slots;
|
|
28
|
-
export default class Alert extends SvelteComponentTyped<AlertProps, AlertEvents, AlertSlots> {
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script>import { setContext } from 'svelte';
|
|
2
|
-
// Props
|
|
3
|
-
/** Accepts text or HTML and defines the crumb seperator. */
|
|
4
|
-
export let separator = '›';
|
|
5
|
-
/** Provide classes to set text size. */
|
|
6
|
-
export let text = '';
|
|
7
|
-
// Props (A11y)
|
|
8
|
-
/** A semantic ARIA label. */
|
|
9
|
-
export let label = 'breadcrumb';
|
|
10
|
-
// Context
|
|
11
|
-
setContext('separator', separator);
|
|
12
|
-
// Base Classes
|
|
13
|
-
const cBase = '';
|
|
14
|
-
const cList = 'flex align-center space-x-4';
|
|
15
|
-
// Reactive Classes
|
|
16
|
-
$: classesBase = `${cBase} ${$$props.class ?? ''}`;
|
|
17
|
-
$: classesList = `${cList} ${text}`;
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<nav class="breadcrumb {classesBase}" data-testid="breadcrumb" aria-label={label}>
|
|
21
|
-
<ol class="breadcrumb-list {classesList}">
|
|
22
|
-
<slot />
|
|
23
|
-
</ol>
|
|
24
|
-
</nav>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
separator?: string | undefined;
|
|
6
|
-
text?: string | undefined;
|
|
7
|
-
label?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {
|
|
13
|
-
default: {};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export type BreadcrumbProps = typeof __propDef.props;
|
|
17
|
-
export type BreadcrumbEvents = typeof __propDef.events;
|
|
18
|
-
export type BreadcrumbSlots = typeof __propDef.slots;
|
|
19
|
-
export default class Breadcrumb extends SvelteComponentTyped<BreadcrumbProps, BreadcrumbEvents, BreadcrumbSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script>// Slots
|
|
2
|
-
/** @slot lead - A leading slot intended for icons. */
|
|
3
|
-
import { getContext } from 'svelte';
|
|
4
|
-
// Props
|
|
5
|
-
/** Provide classes set the current page text color. */
|
|
6
|
-
export let color = '';
|
|
7
|
-
// Context
|
|
8
|
-
export let separator = getContext('separator');
|
|
9
|
-
// Local
|
|
10
|
-
const tag = $$props.href ? 'a' : 'span';
|
|
11
|
-
// Base Classes
|
|
12
|
-
const cBase = 'flex items-center space-x-4';
|
|
13
|
-
const cAnchor = 'flex justify-center items-center space-x-2';
|
|
14
|
-
const cSeperator = 'font-bold flex fill-surface-500 text-surface-500 w-2';
|
|
15
|
-
// Reactive Classes
|
|
16
|
-
$: classesBase = `${cBase} ${color} ${$$props.class ?? ''}`;
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<!-- NOTE: avoid forwarding events on <svelte:element> tags -->
|
|
20
|
-
<!-- https://github.com/skeletonlabs/skeleton/issues/727#issuecomment-1356859261 -->
|
|
21
|
-
<li class="crumb {classesBase}" data-testid="crumb" on:click on:keydown on:keyup on:keypress>
|
|
22
|
-
<!-- Anchor -->
|
|
23
|
-
<svelte:element
|
|
24
|
-
this={tag}
|
|
25
|
-
href={$$props.href}
|
|
26
|
-
class="crumb-anchor {cAnchor}"
|
|
27
|
-
data-testid="crumb-anchor"
|
|
28
|
-
aria-current={!$$props.href ? 'page' : undefined}
|
|
29
|
-
>
|
|
30
|
-
{#if $$slots.lead}<span class="crumb-lead"><slot name="lead" /></span>{/if}
|
|
31
|
-
<span class="crumb-text"><slot /></span>
|
|
32
|
-
</svelte:element>
|
|
33
|
-
<!-- Seperator -->
|
|
34
|
-
{#if $$props.href}
|
|
35
|
-
<div class="crumb-seperator {cSeperator}">{@html separator}</div>
|
|
36
|
-
{/if}
|
|
37
|
-
</li>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
color?: string | undefined;
|
|
6
|
-
separator?: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
click: MouseEvent;
|
|
10
|
-
keydown: KeyboardEvent;
|
|
11
|
-
keyup: KeyboardEvent;
|
|
12
|
-
keypress: KeyboardEvent;
|
|
13
|
-
} & {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {
|
|
17
|
-
lead: {};
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export type CrumbProps = typeof __propDef.props;
|
|
22
|
-
export type CrumbEvents = typeof __propDef.events;
|
|
23
|
-
export type CrumbSlots = typeof __propDef.slots;
|
|
24
|
-
export default class Crumb extends SvelteComponentTyped<CrumbProps, CrumbEvents, CrumbSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|