@skeletonlabs/skeleton 1.8.0 → 1.9.0-dev.81ab2306
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/dist/actions/Clipboard/additional-svelte-typings.d.ts +2 -2
- package/dist/actions/Clipboard/clipboard.d.ts +8 -2
- package/dist/actions/Clipboard/clipboard.js +8 -5
- package/dist/actions/Filters/filter.d.ts +5 -2
- package/dist/components/Accordion/AccordionItem.svelte +1 -1
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +7 -0
- package/dist/components/AppRail/AppRailTile.svelte +2 -0
- package/dist/components/AppShell/AppShell.svelte.d.ts +9 -3
- package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +1 -1
- package/dist/components/Avatar/Avatar.svelte +2 -0
- package/dist/components/Avatar/Avatar.svelte.d.ts +2 -2
- package/dist/components/ConicGradient/ConicGradient.svelte +2 -0
- package/dist/components/InputChip/InputChip.svelte +5 -5
- package/dist/components/InputChip/InputChip.svelte.d.ts +15 -0
- package/dist/components/Paginator/Paginator.svelte +16 -2
- package/dist/components/Paginator/Paginator.svelte.d.ts +10 -2
- package/dist/components/Radio/RadioGroup.svelte +3 -1
- package/dist/components/Ratings/Ratings.svelte +15 -4
- package/dist/components/Ratings/Ratings.svelte.d.ts +7 -0
- package/dist/components/SlideToggle/SlideToggle.svelte +3 -2
- package/dist/components/SlideToggle/SlideToggle.svelte.d.ts +1 -1
- package/dist/components/Stepper/Step.svelte.d.ts +2 -2
- package/dist/components/Stepper/Stepper.svelte +2 -2
- package/dist/components/Stepper/Stepper.svelte.d.ts +19 -2
- package/dist/components/Stepper/types.d.ts +20 -4
- package/dist/components/Tab/TabGroup.svelte +2 -0
- package/dist/components/Table/Table.svelte.d.ts +1 -1
- package/dist/components/TableOfContents/TableOfContents.svelte +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/utilities/CodeBlock/CodeBlock.svelte +1 -1
- package/dist/utilities/CodeBlock/CodeBlock.svelte.d.ts +2 -2
- package/dist/utilities/DataTable/DataTable.d.ts +2 -1
- package/dist/utilities/Drawer/Drawer.svelte +5 -1
- package/dist/utilities/Drawer/Drawer.svelte.d.ts +2 -2
- package/dist/utilities/Drawer/stores.d.ts +2 -1
- package/dist/utilities/LightSwitch/lightswitch.d.ts +1 -0
- package/dist/utilities/Modal/Modal.svelte +5 -3
- package/dist/utilities/Modal/Modal.svelte.d.ts +1 -1
- package/dist/utilities/Modal/stores.d.ts +2 -1
- package/dist/utilities/Toast/Toast.svelte +8 -9
- package/dist/utilities/Toast/stores.d.ts +2 -1
- package/package.json +11 -8
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type ClipboardArgs = string | {
|
|
2
|
+
element: string;
|
|
3
|
+
} | {
|
|
4
|
+
input: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function clipboard(node: HTMLElement, args: ClipboardArgs): {
|
|
7
|
+
update(newArgs: ClipboardArgs): void;
|
|
3
8
|
destroy(): void;
|
|
4
9
|
};
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Action: Clipboard
|
|
2
1
|
export function clipboard(node, args) {
|
|
3
2
|
const fireCopyCompleteEvent = () => {
|
|
4
3
|
node.dispatchEvent(new CustomEvent('copyComplete'));
|
|
@@ -7,15 +6,19 @@ export function clipboard(node, args) {
|
|
|
7
6
|
// Handle `data-clipboard` target based on object key
|
|
8
7
|
if (typeof args === 'object') {
|
|
9
8
|
// Element Inner HTML
|
|
10
|
-
if (
|
|
9
|
+
if ('element' in args) {
|
|
11
10
|
const element = document.querySelector(`[data-clipboard="${args.element}"]`);
|
|
12
|
-
|
|
11
|
+
if (!element)
|
|
12
|
+
throw new Error(`Missing HTMLElement with an attribute of [data-clipboard="${args.element}"]`);
|
|
13
|
+
copyToClipboard(element.innerHTML, 'text/html').then(fireCopyCompleteEvent);
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
16
|
// Form Input Value
|
|
16
|
-
if (
|
|
17
|
+
if ('input' in args) {
|
|
17
18
|
const input = document.querySelector(`[data-clipboard="${args.input}"]`);
|
|
18
|
-
|
|
19
|
+
if (!input)
|
|
20
|
+
throw new Error(`Missing HTMLInputElement with an attribute of [data-clipboard="${args.input}"]`);
|
|
21
|
+
copyToClipboard(input.value).then(fireCopyCompleteEvent);
|
|
19
22
|
return;
|
|
20
23
|
}
|
|
21
24
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type Filters = ['Apollo', 'BlueNight', 'Emerald', 'GreenFall', 'Noir', 'NoirLight', 'Rustic', 'Summer84', 'XPro'];
|
|
2
|
+
type FilterName = `#${Filters[number]}` | (string & {});
|
|
3
|
+
export declare function filter(node: HTMLElement, filterName: FilterName): {
|
|
4
|
+
update(newArgs: FilterName): void;
|
|
3
5
|
} | undefined;
|
|
6
|
+
export {};
|
|
@@ -37,6 +37,13 @@ declare const __propDef: {
|
|
|
37
37
|
keydown: KeyboardEvent;
|
|
38
38
|
keyup: KeyboardEvent;
|
|
39
39
|
keypress: KeyboardEvent;
|
|
40
|
+
/** {{ event: Event, id: string, open: boolean, autocollapse: boolean }} toggle - Fires when an accordion item is toggled.*/
|
|
41
|
+
toggle: CustomEvent<{
|
|
42
|
+
event?: Event | undefined;
|
|
43
|
+
id: string;
|
|
44
|
+
open: boolean;
|
|
45
|
+
autocollapse: boolean;
|
|
46
|
+
}>;
|
|
40
47
|
} & {
|
|
41
48
|
[evt: string]: CustomEvent<any>;
|
|
42
49
|
};
|
|
@@ -33,6 +33,8 @@ function prunedRestProps() {
|
|
|
33
33
|
|
|
34
34
|
<label class="app-rail-tile {classesBase}" data-testid="app-rail-tile" {title} on:mouseover on:mouseleave on:focus on:blur>
|
|
35
35
|
<!-- A11y attributes are not allowed on <label> -->
|
|
36
|
+
<!-- TODO: Remove for V2 -->
|
|
37
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
36
38
|
<div class="app-rail-wrapper {classesWrapper}" on:keydown on:keyup on:keypress>
|
|
37
39
|
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
38
40
|
<div class="h-0 w-0 overflow-hidden">
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
/** @slot header - Insert fixed header content, such as Skeleton's App Bar component.
|
|
3
|
+
* @slot sidebarLeft - Hidden when empty. Allows you to set fixed left sidebar content.
|
|
4
|
+
* @slot sidebarRight - Hidden when empty. Allows you to set fixed right sidebar content.
|
|
5
|
+
* @slot pageHeader - Insert content that resides above your page content. Great for global alerts.
|
|
6
|
+
* @slot pageFooter - Insert content that resides below your page content. Recommended for most layouts.
|
|
7
|
+
* @slot footer - Insert fixed footer content. Not recommended for most layouts.
|
|
8
|
+
*/
|
|
9
|
+
import type { SvelteEvent } from '../../index.js';
|
|
2
10
|
declare const __propDef: {
|
|
3
11
|
props: {
|
|
4
12
|
[x: string]: any;
|
|
@@ -20,9 +28,7 @@ declare const __propDef: {
|
|
|
20
28
|
slotFooter?: string | undefined;
|
|
21
29
|
};
|
|
22
30
|
events: {
|
|
23
|
-
scroll:
|
|
24
|
-
} & {
|
|
25
|
-
[evt: string]: CustomEvent<any>;
|
|
31
|
+
scroll: SvelteEvent<UIEvent, HTMLDivElement>;
|
|
26
32
|
};
|
|
27
33
|
slots: {
|
|
28
34
|
header: {};
|
|
@@ -36,7 +36,7 @@ declare const __propDef: {
|
|
|
36
36
|
click: MouseEvent;
|
|
37
37
|
keypress: KeyboardEvent;
|
|
38
38
|
/** {AutocompleteOption} selection - Fire on option select.*/
|
|
39
|
-
selection: CustomEvent<
|
|
39
|
+
selection: CustomEvent<AutocompleteOption>;
|
|
40
40
|
} & {
|
|
41
41
|
[evt: string]: CustomEvent<any>;
|
|
42
42
|
};
|
|
@@ -21,6 +21,8 @@ function prunedRestProps() {
|
|
|
21
21
|
}
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
|
+
<!-- TODO: Remove for V2 -->
|
|
25
|
+
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
24
26
|
<figure class="avatar {classesBase}" data-testid="avatar" on:click on:keydown on:keyup on:keypress>
|
|
25
27
|
{#if src}
|
|
26
28
|
<img
|
|
@@ -11,8 +11,8 @@ declare const __propDef: {
|
|
|
11
11
|
src?: string | undefined;
|
|
12
12
|
/** Provide the fallback image element source.*/
|
|
13
13
|
fallback?: string | undefined;
|
|
14
|
-
/** Image only. Provide
|
|
15
|
-
action?: Action<HTMLElement,
|
|
14
|
+
/** Image only. Provide a Svelte action reference, such as `filter`.*/
|
|
15
|
+
action?: Action<HTMLElement, string, Record<never, any>> | undefined;
|
|
16
16
|
/** Image only. Provide Svelte action params, such as Apollo.*/
|
|
17
17
|
actionParams?: string | undefined;
|
|
18
18
|
/** Provide classes to set background styles.*/
|
|
@@ -64,6 +64,8 @@ $:
|
|
|
64
64
|
{#if legend && generatedLegendList}
|
|
65
65
|
<ul class="conic-list list {classesLegend}">
|
|
66
66
|
{#each generatedLegendList as { color, label, value }}
|
|
67
|
+
<!-- TODO: Remove for V2 -->
|
|
68
|
+
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
67
69
|
<li class="conic-item {hover}" on:click on:keydown on:keyup on:keypress>
|
|
68
70
|
<span class="conic-swatch {cSwatch}" style:background={color} />
|
|
69
71
|
<span class="conic-label flex-auto">{label}</span>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { createEventDispatcher, onMount } from "svelte
|
|
1
|
+
<script>import { createEventDispatcher, onMount } from "svelte";
|
|
2
2
|
import { fly, scale } from "svelte/transition";
|
|
3
3
|
import { flip } from "svelte/animate";
|
|
4
4
|
const dispatch = createEventDispatcher();
|
|
@@ -23,9 +23,9 @@ const cInterface = "space-y-4";
|
|
|
23
23
|
const cChipList = "flex flex-wrap gap-2";
|
|
24
24
|
const cInputField = "unstyled bg-transparent border-0 !ring-0 p-0 w-full";
|
|
25
25
|
let inputValid = true;
|
|
26
|
-
let chipValues = value
|
|
26
|
+
let chipValues = value?.map((val) => {
|
|
27
27
|
return { val, id: Math.random() };
|
|
28
|
-
});
|
|
28
|
+
}) || [];
|
|
29
29
|
function resetFormHandler() {
|
|
30
30
|
value = [];
|
|
31
31
|
}
|
|
@@ -95,11 +95,11 @@ $:
|
|
|
95
95
|
$:
|
|
96
96
|
classesInputField = `${cInputField}`;
|
|
97
97
|
$:
|
|
98
|
-
chipValues = value
|
|
98
|
+
chipValues = value?.map((val, i) => {
|
|
99
99
|
if (chipValues[i]?.val === val)
|
|
100
100
|
return chipValues[i];
|
|
101
101
|
return { id: Math.random(), val };
|
|
102
|
-
});
|
|
102
|
+
}) || [];
|
|
103
103
|
</script>
|
|
104
104
|
|
|
105
105
|
<div class="input-chip {classesBase}" class:opacity-50={$$restProps.disabled}>
|
|
@@ -44,6 +44,21 @@ declare const __propDef: {
|
|
|
44
44
|
keypress: KeyboardEvent;
|
|
45
45
|
keydown: KeyboardEvent;
|
|
46
46
|
keyup: KeyboardEvent;
|
|
47
|
+
/** {{ event: Event, chipIndex: number, chipValue: string }} add - Fires when a chip is added.*/
|
|
48
|
+
add: CustomEvent<{
|
|
49
|
+
event: SubmitEvent;
|
|
50
|
+
chipIndex: number;
|
|
51
|
+
chipValue: string;
|
|
52
|
+
}>;
|
|
53
|
+
remove: CustomEvent<{
|
|
54
|
+
event: MouseEvent;
|
|
55
|
+
chipIndex: number;
|
|
56
|
+
chipValue: string;
|
|
57
|
+
}>;
|
|
58
|
+
invalid: CustomEvent<{
|
|
59
|
+
event: SubmitEvent;
|
|
60
|
+
input: string;
|
|
61
|
+
}>;
|
|
47
62
|
} & {
|
|
48
63
|
[evt: string]: CustomEvent<any>;
|
|
49
64
|
};
|
|
@@ -19,14 +19,18 @@ export let buttonTextPrevious = leftArrow;
|
|
|
19
19
|
export let buttonTextNext = rightArrow;
|
|
20
20
|
export let buttonTextFirst = leftAngles;
|
|
21
21
|
export let buttonTextLast = rightAngles;
|
|
22
|
+
export let labelFirst = "First page";
|
|
23
|
+
export let labelPrevious = "Previous page";
|
|
24
|
+
export let labelNext = "Next page";
|
|
25
|
+
export let labelLast = "Last page";
|
|
22
26
|
const cBase = "flex flex-col md:flex-row items-center space-y-4 md:space-y-0 md:space-x-4";
|
|
23
27
|
const cLabel = "w-full md:w-auto";
|
|
24
|
-
let lastPage = Math.ceil(settings.size / settings.limit - 1);
|
|
28
|
+
let lastPage = Math.max(0, Math.ceil(settings.size / settings.limit - 1));
|
|
25
29
|
let controlPages = getNumerals();
|
|
26
30
|
function onChangeLength() {
|
|
27
31
|
settings.offset = 0;
|
|
28
32
|
dispatch("amount", settings.limit);
|
|
29
|
-
lastPage = Math.ceil(settings.size / settings.limit - 1);
|
|
33
|
+
lastPage = Math.max(0, Math.ceil(settings.size / settings.limit - 1));
|
|
30
34
|
controlPages = getNumerals();
|
|
31
35
|
}
|
|
32
36
|
function gotoPage(page) {
|
|
@@ -68,12 +72,18 @@ function getNumerals() {
|
|
|
68
72
|
pages.push(lastPage);
|
|
69
73
|
return pages;
|
|
70
74
|
}
|
|
75
|
+
function updateSize(size) {
|
|
76
|
+
lastPage = Math.max(0, Math.ceil(size / settings.limit - 1));
|
|
77
|
+
controlPages = getNumerals();
|
|
78
|
+
}
|
|
71
79
|
$:
|
|
72
80
|
classesButtonActive = (page) => {
|
|
73
81
|
return page === settings.offset ? `${active} pointer-events-none` : "";
|
|
74
82
|
};
|
|
75
83
|
$:
|
|
76
84
|
maxNumerals, onChangeLength();
|
|
85
|
+
$:
|
|
86
|
+
updateSize(settings.size);
|
|
77
87
|
$:
|
|
78
88
|
classesBase = `${cBase} ${justify} ${$$props.class ?? ""}`;
|
|
79
89
|
$:
|
|
@@ -105,6 +115,7 @@ $:
|
|
|
105
115
|
{#if showFirstLastButtons}
|
|
106
116
|
<button
|
|
107
117
|
type="button"
|
|
118
|
+
aria-label={labelFirst}
|
|
108
119
|
class={buttonClasses}
|
|
109
120
|
on:click={() => {
|
|
110
121
|
gotoPage(0);
|
|
@@ -118,6 +129,7 @@ $:
|
|
|
118
129
|
{#if showPreviousNextButtons}
|
|
119
130
|
<button
|
|
120
131
|
type="button"
|
|
132
|
+
aria-label={labelPrevious}
|
|
121
133
|
class={buttonClasses}
|
|
122
134
|
on:click={() => {
|
|
123
135
|
gotoPage(settings.offset - 1);
|
|
@@ -147,6 +159,7 @@ $:
|
|
|
147
159
|
{#if showPreviousNextButtons}
|
|
148
160
|
<button
|
|
149
161
|
type="button"
|
|
162
|
+
aria-label={labelNext}
|
|
150
163
|
class={buttonClasses}
|
|
151
164
|
on:click={() => {
|
|
152
165
|
gotoPage(settings.offset + 1);
|
|
@@ -160,6 +173,7 @@ $:
|
|
|
160
173
|
{#if showFirstLastButtons}
|
|
161
174
|
<button
|
|
162
175
|
type="button"
|
|
176
|
+
aria-label={labelLast}
|
|
163
177
|
class={buttonClasses}
|
|
164
178
|
on:click={() => {
|
|
165
179
|
gotoPage(lastPage);
|
|
@@ -39,12 +39,20 @@ declare const __propDef: {
|
|
|
39
39
|
buttonTextFirst?: string | undefined;
|
|
40
40
|
/** Set the label for the Last button.*/
|
|
41
41
|
buttonTextLast?: string | undefined;
|
|
42
|
+
/** Provide the ARIA label for the First page button.*/
|
|
43
|
+
labelFirst?: string | undefined;
|
|
44
|
+
/** Provide the ARIA label for the Previous page button.*/
|
|
45
|
+
labelPrevious?: string | undefined;
|
|
46
|
+
/** Provide the ARIA label for the Next page button.*/
|
|
47
|
+
labelNext?: string | undefined;
|
|
48
|
+
/** Provide the ARIA label for the Last page button.*/
|
|
49
|
+
labelLast?: string | undefined;
|
|
42
50
|
};
|
|
43
51
|
events: {
|
|
44
52
|
/** {{ length: number }} amount - Fires when the amount selection input changes.*/
|
|
45
|
-
amount: CustomEvent<
|
|
53
|
+
amount: CustomEvent<number>;
|
|
46
54
|
/** {{ offset: number }} page Fires when the next/back buttons are pressed.*/
|
|
47
|
-
page: CustomEvent<
|
|
55
|
+
page: CustomEvent<number>;
|
|
48
56
|
} & {
|
|
49
57
|
[evt: string]: CustomEvent<any>;
|
|
50
58
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export let display = "inline-flex";
|
|
3
3
|
export let background = "bg-surface-200-700-token";
|
|
4
4
|
export let border = "border-token border-surface-400-500-token";
|
|
5
|
-
export let spacing = "
|
|
5
|
+
export let spacing = "";
|
|
6
6
|
export let rounded = "rounded-token";
|
|
7
7
|
export let padding = "px-4 py-1";
|
|
8
8
|
export let active = "variant-filled";
|
|
@@ -17,6 +17,8 @@ setContext("hover", hover);
|
|
|
17
17
|
setContext("color", color);
|
|
18
18
|
setContext("fill", fill);
|
|
19
19
|
const cBase = "p-1";
|
|
20
|
+
$:
|
|
21
|
+
spacing = `${display.includes("flex-col") ? "" : "space-x-1"}`;
|
|
20
22
|
$:
|
|
21
23
|
classesBase = `${cBase} ${display} ${background} ${border} ${spacing} ${rounded} ${$$props.class ?? ""}`;
|
|
22
24
|
</script>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
<script>import { createEventDispatcher } from "svelte
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
2
|
export let value = 0;
|
|
3
3
|
export let max = 5;
|
|
4
|
+
export let interactive = false;
|
|
4
5
|
export let text = "text-token";
|
|
5
6
|
export let fill = "fill-token";
|
|
6
7
|
export let justify = "justify-center";
|
|
@@ -13,6 +14,10 @@ function iconClick(index) {
|
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
const cBase = "w-full flex";
|
|
17
|
+
$:
|
|
18
|
+
elemInteractive = interactive ? "button" : "span";
|
|
19
|
+
$:
|
|
20
|
+
attrInteractive = interactive ? { type: "button" } : {};
|
|
16
21
|
$:
|
|
17
22
|
classesBase = `${cBase} ${text} ${fill} ${justify} ${spacing} ${$$props.class ?? ""}`;
|
|
18
23
|
</script>
|
|
@@ -21,11 +26,17 @@ $:
|
|
|
21
26
|
<!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
|
|
22
27
|
{#each Array(max) as _, i}
|
|
23
28
|
{#if Math.floor(value) >= i + 1}
|
|
24
|
-
<
|
|
29
|
+
<svelte:element this={elemInteractive} {...attrInteractive} class="rating-icon {regionIcon}" on:click={() => iconClick(i)}>
|
|
30
|
+
<slot name="full" />
|
|
31
|
+
</svelte:element>
|
|
25
32
|
{:else if value === i + 0.5}
|
|
26
|
-
<
|
|
33
|
+
<svelte:element this={elemInteractive} {...attrInteractive} class="rating-icon {regionIcon}" on:click={() => iconClick(i)}>
|
|
34
|
+
<slot name="half" />
|
|
35
|
+
</svelte:element>
|
|
27
36
|
{:else}
|
|
28
|
-
<
|
|
37
|
+
<svelte:element this={elemInteractive} {...attrInteractive} class="rating-icon {regionIcon}" on:click={() => iconClick(i)}>
|
|
38
|
+
<slot name="empty" />
|
|
39
|
+
</svelte:element>
|
|
29
40
|
{/if}
|
|
30
41
|
{/each}
|
|
31
42
|
</div>
|
|
@@ -6,6 +6,8 @@ declare const __propDef: {
|
|
|
6
6
|
value?: number | undefined;
|
|
7
7
|
/** Maximum rating value.*/
|
|
8
8
|
max?: number | undefined;
|
|
9
|
+
/** Enables interactive mode for each rating icon.*/
|
|
10
|
+
interactive?: boolean | undefined;
|
|
9
11
|
/** Provide classes to set the text color.*/
|
|
10
12
|
text?: string | undefined;
|
|
11
13
|
/** Provide classes to set the SVG fill color.*/
|
|
@@ -18,6 +20,11 @@ declare const __propDef: {
|
|
|
18
20
|
regionIcon?: string | undefined;
|
|
19
21
|
};
|
|
20
22
|
events: {
|
|
23
|
+
/** {{ index: number }} icon - Fires when an icons is clicked*/
|
|
24
|
+
icon: CustomEvent<{
|
|
25
|
+
index: number;
|
|
26
|
+
}>;
|
|
27
|
+
} & {
|
|
21
28
|
[evt: string]: CustomEvent<any>;
|
|
22
29
|
};
|
|
23
30
|
slots: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { createEventDispatcher } from "svelte
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
2
|
const dispatch = createEventDispatcher();
|
|
3
3
|
export let name;
|
|
4
4
|
export let checked = false;
|
|
@@ -27,7 +27,8 @@ function onKeyDown(event) {
|
|
|
27
27
|
if (["Enter", "Space"].includes(event.code)) {
|
|
28
28
|
event.preventDefault();
|
|
29
29
|
dispatch("keyup", event);
|
|
30
|
-
event.
|
|
30
|
+
const inputElem = event.currentTarget.firstChild;
|
|
31
|
+
inputElem.click();
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
$:
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
checked?: boolean | undefined;
|
|
9
9
|
/** Sets the size of the component.*/
|
|
10
10
|
size?: string | undefined;
|
|
11
|
-
/** Provide
|
|
11
|
+
/** Provide classes to set the inactive state background color.*/
|
|
12
12
|
background?: string | undefined;
|
|
13
13
|
/** Provide classes to set the active state background color.*/
|
|
14
14
|
active?: string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { Writable } from 'svelte/store';
|
|
3
|
-
import type {
|
|
3
|
+
import type { StepperEventDispatcher, StepperState } from './types.js';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
[x: string]: any;
|
|
@@ -12,7 +12,7 @@ declare const __propDef: {
|
|
|
12
12
|
/** Provide arbitrary classes to the step navigation region.*/
|
|
13
13
|
regionNavigation?: string | undefined;
|
|
14
14
|
state?: Writable<StepperState> | undefined;
|
|
15
|
-
dispatchParent?:
|
|
15
|
+
dispatchParent?: StepperEventDispatcher | undefined;
|
|
16
16
|
stepTerm?: string | undefined;
|
|
17
17
|
gap?: string | undefined;
|
|
18
18
|
justify?: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { createEventDispatcher, setContext } from "svelte";
|
|
2
2
|
import { writable } from "svelte/store";
|
|
3
3
|
import { fade } from "svelte/transition";
|
|
4
|
-
const
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
5
|
export let gap = "gap-4";
|
|
6
6
|
export let stepTerm = "Step";
|
|
7
7
|
export let badge = "variant-filled-surface";
|
|
@@ -22,7 +22,7 @@ export let regionHeader = "";
|
|
|
22
22
|
export let regionContent = "";
|
|
23
23
|
let state = writable({ current: start, total: 0 });
|
|
24
24
|
setContext("state", state);
|
|
25
|
-
setContext("dispatchParent",
|
|
25
|
+
setContext("dispatchParent", dispatch);
|
|
26
26
|
setContext("stepTerm", stepTerm);
|
|
27
27
|
setContext("gap", gap);
|
|
28
28
|
setContext("justify", justify);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { StepperButton } from './types.js';
|
|
2
|
+
import type { StepperButton, StepperState } from './types.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
@@ -41,11 +41,28 @@ declare const __propDef: {
|
|
|
41
41
|
regionContent?: string | undefined;
|
|
42
42
|
};
|
|
43
43
|
events: {
|
|
44
|
+
next: CustomEvent<{
|
|
45
|
+
step: number;
|
|
46
|
+
state: StepperState;
|
|
47
|
+
}>;
|
|
48
|
+
step: CustomEvent<{
|
|
49
|
+
step: number;
|
|
50
|
+
state: StepperState;
|
|
51
|
+
}>;
|
|
52
|
+
back: CustomEvent<{
|
|
53
|
+
step: number;
|
|
54
|
+
state: StepperState;
|
|
55
|
+
}>;
|
|
56
|
+
complete: CustomEvent<{
|
|
57
|
+
step: number;
|
|
58
|
+
state: StepperState;
|
|
59
|
+
}>;
|
|
60
|
+
} & {
|
|
44
61
|
[evt: string]: CustomEvent<any>;
|
|
45
62
|
};
|
|
46
63
|
slots: {
|
|
47
64
|
default: {};
|
|
48
|
-
};
|
|
65
|
+
};
|
|
49
66
|
};
|
|
50
67
|
export type StepperProps = typeof __propDef.props;
|
|
51
68
|
export type StepperEvents = typeof __propDef.events;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
import type { EventDispatcher } from 'svelte';
|
|
1
2
|
export interface StepperState {
|
|
2
3
|
current: number;
|
|
3
4
|
total: number;
|
|
4
5
|
}
|
|
5
6
|
export type StepperButton = 'submit' | 'reset' | 'button';
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export type StepperEvent = {
|
|
8
|
+
next: {
|
|
9
|
+
step: number;
|
|
10
|
+
state: StepperState;
|
|
11
|
+
};
|
|
12
|
+
step: {
|
|
13
|
+
step: number;
|
|
14
|
+
state: StepperState;
|
|
15
|
+
};
|
|
16
|
+
back: {
|
|
17
|
+
step: number;
|
|
18
|
+
state: StepperState;
|
|
19
|
+
};
|
|
20
|
+
complete: {
|
|
21
|
+
step: number;
|
|
22
|
+
state: StepperState;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type StepperEventDispatcher = EventDispatcher<StepperEvent>;
|
|
@@ -28,6 +28,8 @@ $:
|
|
|
28
28
|
classesPanel = `${cPanel} ${regionPanel}`;
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
+
<!-- TODO: Remove for V2 -->
|
|
32
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
31
33
|
<div class="tab-group {classesBase}" data-testid="tab-group" on:click on:keypress on:keydown on:keyup>
|
|
32
34
|
<!-- Tab List -->
|
|
33
35
|
<div class="tab-list {classesList}" role="tablist" aria-labelledby={labelledby}>
|
|
@@ -93,6 +93,8 @@ $:
|
|
|
93
93
|
<nav class="toc-list {classesList}">
|
|
94
94
|
<div class="toc-label {classesLabel}">{label}</div>
|
|
95
95
|
{#each filteredHeadingsList as headingElem}
|
|
96
|
+
<!-- TODO: Remove for V2 -->
|
|
97
|
+
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
96
98
|
<!-- prettier-ignore -->
|
|
97
99
|
<li
|
|
98
100
|
class="toc-list-item {classesListItem} {setHeadingClasses(headingElem)} {headingElem.id === activeHeaderId ? active : ''}"
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export type { TableSource } from './components/Table/types.js';
|
|
|
7
7
|
export type { PaginationSettings } from './components/Paginator/types.js';
|
|
8
8
|
export type { PopupSettings } from './utilities/Popup/types.js';
|
|
9
9
|
export type CssClasses = string;
|
|
10
|
+
export type SvelteEvent<E extends Event = Event, T extends EventTarget = Element> = E & {
|
|
11
|
+
currentTarget: EventTarget & T;
|
|
12
|
+
};
|
|
10
13
|
export { storeHighlightJs } from './utilities/CodeBlock/stores.js';
|
|
11
14
|
export { storePopup } from './utilities/Popup/popup.js';
|
|
12
15
|
export { drawerStore } from './utilities/Drawer/stores.js';
|
|
@@ -28,8 +28,8 @@ declare const __propDef: {
|
|
|
28
28
|
buttonCopied?: string | undefined;
|
|
29
29
|
};
|
|
30
30
|
events: {
|
|
31
|
-
/** {
|
|
32
|
-
copy: CustomEvent<
|
|
31
|
+
/** {} copy - Fires when the Copy button is pressed.*/
|
|
32
|
+
copy: CustomEvent<never>;
|
|
33
33
|
} & {
|
|
34
34
|
[evt: string]: CustomEvent<any>;
|
|
35
35
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
1
2
|
import type { DataTableModel, DataTableOptions } from './types.js';
|
|
2
3
|
export * from './types.js';
|
|
3
4
|
export * from './actions.js';
|
|
4
5
|
/** Creates the writeable store for the data table */
|
|
5
6
|
export declare function createDataTableStore<T extends Record<PropertyKey, any>>(source: T[], options?: DataTableOptions<T>): {
|
|
6
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<DataTableModel<T>>, invalidate?: (
|
|
7
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<DataTableModel<T>>, invalidate?: import("svelte/store").Invalidator<DataTableModel<T>> | undefined) => import("svelte/store").Unsubscriber;
|
|
7
8
|
set: (this: void, value: DataTableModel<T>) => void;
|
|
8
9
|
/** Sets a new data source while maintaining the state of the original source */
|
|
9
10
|
updateSource: (data: T[]) => void;
|
|
@@ -124,6 +124,8 @@ $:
|
|
|
124
124
|
|
|
125
125
|
{#if $drawerStore.open === true}
|
|
126
126
|
<!-- Backdrop -->
|
|
127
|
+
<!-- TODO: Remove for V2 -->
|
|
128
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
127
129
|
<div
|
|
128
130
|
bind:this={elemBackdrop}
|
|
129
131
|
class="drawer-backdrop {classesBackdrop}"
|
|
@@ -136,6 +138,7 @@ $:
|
|
|
136
138
|
use:focusTrap={true}
|
|
137
139
|
>
|
|
138
140
|
<!-- Drawer -->
|
|
141
|
+
<!-- separate In/Out so anim values update -->
|
|
139
142
|
<div
|
|
140
143
|
bind:this={elemDrawer}
|
|
141
144
|
class="drawer {classesDrawer}"
|
|
@@ -144,7 +147,8 @@ $:
|
|
|
144
147
|
aria-modal="true"
|
|
145
148
|
aria-labelledby={labelledby}
|
|
146
149
|
aria-describedby={describedby}
|
|
147
|
-
|
|
150
|
+
in:fly|local={{ x: anim.x, y: anim.y, duration }}
|
|
151
|
+
out:fly|local={{ x: anim.x, y: anim.y, duration }}
|
|
148
152
|
>
|
|
149
153
|
<!-- Slot: Default -->
|
|
150
154
|
<slot />
|
|
@@ -40,9 +40,9 @@ declare const __propDef: {
|
|
|
40
40
|
touchend: TouchEvent;
|
|
41
41
|
keypress: KeyboardEvent;
|
|
42
42
|
/** {{ event }} backdrop - Fires on backdrop interaction.*/
|
|
43
|
-
backdrop: CustomEvent<
|
|
43
|
+
backdrop: CustomEvent<MouseEvent>;
|
|
44
44
|
/** {{ event }} drawer - Fires on drawer interaction.*/
|
|
45
|
-
drawer: CustomEvent<
|
|
45
|
+
drawer: CustomEvent<MouseEvent>;
|
|
46
46
|
} & {
|
|
47
47
|
[evt: string]: CustomEvent<any>;
|
|
48
48
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
1
2
|
import type { DrawerSettings } from './types.js';
|
|
2
3
|
export declare const drawerStore: {
|
|
3
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<DrawerSettings>, invalidate?: (
|
|
4
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<DrawerSettings>, invalidate?: import("svelte/store").Invalidator<DrawerSettings> | undefined) => import("svelte/store").Unsubscriber;
|
|
4
5
|
set: (this: void, value: DrawerSettings) => void;
|
|
5
6
|
update: (this: void, updater: import("svelte/store").Updater<DrawerSettings>) => void;
|
|
6
7
|
/** Open the drawer. */
|
|
@@ -135,6 +135,8 @@ $:
|
|
|
135
135
|
{#if $modalStore.length > 0}
|
|
136
136
|
{#key $modalStore}
|
|
137
137
|
<!-- Backdrop -->
|
|
138
|
+
<!-- TODO: Remove for V2 -->
|
|
139
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
138
140
|
<div
|
|
139
141
|
class="modal-backdrop {classesBackdrop}"
|
|
140
142
|
data-testid="modal-backdrop"
|
|
@@ -142,11 +144,11 @@ $:
|
|
|
142
144
|
on:mouseup={onBackdropInteractionEnd}
|
|
143
145
|
on:touchstart
|
|
144
146
|
on:touchend
|
|
145
|
-
transition:fade={{ duration }}
|
|
147
|
+
transition:fade|global={{ duration }}
|
|
146
148
|
use:focusTrap={true}
|
|
147
149
|
>
|
|
148
150
|
<!-- Transition Layer -->
|
|
149
|
-
<div class="modal-transition {classesTransitionLayer}" transition:fly={{ duration, opacity: flyOpacity, x: flyX, y: flyY }}>
|
|
151
|
+
<div class="modal-transition {classesTransitionLayer}" transition:fly|global={{ duration, opacity: flyOpacity, x: flyX, y: flyY }}>
|
|
150
152
|
{#if $modalStore[0].type !== 'component'}
|
|
151
153
|
<!-- Modal: Presets -->
|
|
152
154
|
<div
|
|
@@ -155,7 +157,7 @@ $:
|
|
|
155
157
|
role="dialog"
|
|
156
158
|
aria-modal="true"
|
|
157
159
|
aria-label={$modalStore[0].title ?? ''}
|
|
158
|
-
transition:fly={{ duration, opacity: 0, y: 100 }}
|
|
160
|
+
transition:fly|global={{ duration, opacity: 0, y: 100 }}
|
|
159
161
|
>
|
|
160
162
|
<!-- Header -->
|
|
161
163
|
{#if $modalStore[0]?.title}
|
|
@@ -54,7 +54,7 @@ declare const __propDef: {
|
|
|
54
54
|
touchstart: TouchEvent;
|
|
55
55
|
touchend: TouchEvent;
|
|
56
56
|
/** {{ event }} backdrop - Fires on backdrop interaction.*/
|
|
57
|
-
backdrop: CustomEvent<
|
|
57
|
+
backdrop: CustomEvent<MouseEvent>;
|
|
58
58
|
} & {
|
|
59
59
|
[evt: string]: CustomEvent<any>;
|
|
60
60
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
1
2
|
import type { ModalSettings } from './types.js';
|
|
2
3
|
export declare const modalStore: {
|
|
3
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<ModalSettings[]>, invalidate?: (
|
|
4
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<ModalSettings[]>, invalidate?: import("svelte/store").Invalidator<ModalSettings[]> | undefined) => import("svelte/store").Unsubscriber;
|
|
4
5
|
set: (this: void, value: ModalSettings[]) => void;
|
|
5
6
|
update: (this: void, updater: import("svelte/store").Updater<ModalSettings[]>) => void;
|
|
6
7
|
/** Append to end of queue. */
|
|
@@ -114,23 +114,22 @@ const [send, receive] = crossfade({
|
|
|
114
114
|
{#each filteredToasts as t, i (t)}
|
|
115
115
|
<div
|
|
116
116
|
animate:flip={{ duration }}
|
|
117
|
-
in:receive={{ key: t.id }}
|
|
118
|
-
out:send={{ key: t.id }}
|
|
117
|
+
in:receive|global={{ key: t.id }}
|
|
118
|
+
out:send|global={{ key: t.id }}
|
|
119
119
|
on:mouseenter={() => onMouseEnter(i)}
|
|
120
120
|
on:mouseleave={() => onMouseLeave(i)}
|
|
121
|
+
role={t.hideDismiss ? 'alert' : 'alertdialog'}
|
|
122
|
+
aria-live="polite"
|
|
121
123
|
>
|
|
122
124
|
<!-- Toast -->
|
|
123
|
-
<div
|
|
124
|
-
class="toast {classesToast} {t.background ?? background} {t.classes ?? ''}"
|
|
125
|
-
role="alert"
|
|
126
|
-
aria-live="polite"
|
|
127
|
-
data-testid="toast"
|
|
128
|
-
>
|
|
125
|
+
<div class="toast {classesToast} {t.background ?? background} {t.classes ?? ''}" data-testid="toast">
|
|
129
126
|
<div class="text-base">{@html t.message}</div>
|
|
130
127
|
{#if t.action || !t.hideDismiss}
|
|
131
128
|
<div class="toast-actions {cToastActions}">
|
|
132
129
|
{#if t.action}<button class={buttonAction} on:click={() => onAction(i)}>{@html t.action.label}</button>{/if}
|
|
133
|
-
{#if !t.hideDismiss}<button class={buttonDismiss} on:click={() => toastStore.close(t.id)}
|
|
130
|
+
{#if !t.hideDismiss}<button class={buttonDismiss} aria-label="Dismiss toast" on:click={() => toastStore.close(t.id)}
|
|
131
|
+
>{buttonDismissLabel}</button
|
|
132
|
+
>{/if}
|
|
134
133
|
</div>
|
|
135
134
|
{/if}
|
|
136
135
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
1
2
|
import type { ToastSettings, Toast } from './types.js';
|
|
2
3
|
export declare const toastStore: {
|
|
3
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<Toast[]>, invalidate?: (
|
|
4
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<Toast[]>, invalidate?: import("svelte/store").Invalidator<Toast[]> | undefined) => import("svelte/store").Unsubscriber;
|
|
4
5
|
/** Add a new toast to the queue. */
|
|
5
6
|
trigger: (toast: ToastSettings) => string;
|
|
6
7
|
/** Remove toast in queue*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0-dev.81ab2306",
|
|
4
4
|
"description": "A SvelteKit component library.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"repository": {
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"homepage": "https://skeleton.dev/",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@sveltejs/adapter-auto": "2.1.0",
|
|
31
|
-
"@sveltejs/kit": "1.20.
|
|
32
|
-
"@sveltejs/package": "2.0
|
|
31
|
+
"@sveltejs/kit": "1.20.5",
|
|
32
|
+
"@sveltejs/package": "^2.1.0",
|
|
33
33
|
"@testing-library/dom": "9.3.0",
|
|
34
|
-
"@testing-library/svelte": "
|
|
34
|
+
"@testing-library/svelte": "4.0.1",
|
|
35
35
|
"@typescript-eslint/eslint-plugin": "5.59.9",
|
|
36
36
|
"@typescript-eslint/parser": "5.59.9",
|
|
37
37
|
"@vitest/coverage-c8": "0.32.0",
|
|
38
38
|
"autoprefixer": "10.4.14",
|
|
39
39
|
"eslint": "8.42.0",
|
|
40
40
|
"eslint-config-prettier": "8.8.0",
|
|
41
|
-
"eslint-plugin-svelte": "^2.
|
|
41
|
+
"eslint-plugin-svelte": "^2.31.0",
|
|
42
42
|
"jsdom": "21.1.1",
|
|
43
43
|
"postcss": "8.4.24",
|
|
44
44
|
"postcss-import": "15.1.0",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"postcss-load-config": "4.0.1",
|
|
47
47
|
"prettier": "2.8.8",
|
|
48
48
|
"prettier-plugin-svelte": "2.10.1",
|
|
49
|
-
"svelte
|
|
49
|
+
"svelte": "4.0.0",
|
|
50
|
+
"svelte-check": "^3.4.4",
|
|
50
51
|
"tailwindcss": "3.3.2",
|
|
51
52
|
"tslib": "2.5.3",
|
|
52
53
|
"typescript": "5.0.3",
|
|
@@ -55,8 +56,10 @@
|
|
|
55
56
|
},
|
|
56
57
|
"type": "module",
|
|
57
58
|
"dependencies": {
|
|
58
|
-
"esm-env": "1.0.0"
|
|
59
|
-
|
|
59
|
+
"esm-env": "1.0.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"svelte": "^3.56.0 || ^4.0.0"
|
|
60
63
|
},
|
|
61
64
|
"types": "./dist/index.d.ts",
|
|
62
65
|
"exports": {
|