@skeletonlabs/skeleton 1.7.1-dev.efcbd99a → 1.8.0-dev.2c3d2fbb
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/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 +8 -0
- package/dist/components/Paginator/Paginator.svelte.d.ts +10 -2
- package/dist/components/Radio/RadioGroup.svelte +3 -1
- package/dist/components/Ratings/Ratings.svelte +42 -0
- package/dist/components/Ratings/Ratings.svelte.d.ts +41 -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 +4 -0
- package/dist/index.js +1 -0
- package/dist/tailwind/generated/intellisense-classes.cjs +1 -1
- package/dist/tailwind/generated/intellisense-classes.d.cts +2037 -236
- 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 +30 -11
- package/dist/utilities/Toast/stores.d.ts +8 -3
- package/dist/utilities/Toast/stores.js +32 -14
- package/dist/utilities/Toast/types.d.ts +4 -0
- package/package.json +12 -9
|
@@ -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. */
|
|
@@ -69,6 +69,18 @@ function onAction(index) {
|
|
|
69
69
|
$toastStore[index]?.action?.response();
|
|
70
70
|
toastStore.close($toastStore[index].id);
|
|
71
71
|
}
|
|
72
|
+
function onMouseEnter(index) {
|
|
73
|
+
if ($toastStore[index]?.hoverable) {
|
|
74
|
+
toastStore.freeze(index);
|
|
75
|
+
classesSnackbar += " scale-[105%]";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function onMouseLeave(index) {
|
|
79
|
+
if ($toastStore[index]?.hoverable) {
|
|
80
|
+
toastStore.unfreeze(index);
|
|
81
|
+
classesSnackbar = classesSnackbar.replace(" scale-[105%]", "");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
72
84
|
$:
|
|
73
85
|
classesWrapper = `${cWrapper} ${cPosition} ${zIndex} ${$$props.class || ""}`;
|
|
74
86
|
$:
|
|
@@ -100,19 +112,26 @@ const [send, receive] = crossfade({
|
|
|
100
112
|
<!-- List -->
|
|
101
113
|
<div class="snackbar {classesSnackbar}">
|
|
102
114
|
{#each filteredToasts as t, i (t)}
|
|
103
|
-
<div
|
|
115
|
+
<div
|
|
116
|
+
animate:flip={{ duration }}
|
|
117
|
+
in:receive|global={{ key: t.id }}
|
|
118
|
+
out:send|global={{ key: t.id }}
|
|
119
|
+
on:mouseenter={() => onMouseEnter(i)}
|
|
120
|
+
on:mouseleave={() => onMouseLeave(i)}
|
|
121
|
+
role={t.hideDismiss ? 'alert' : 'alertdialog'}
|
|
122
|
+
aria-live="polite"
|
|
123
|
+
>
|
|
104
124
|
<!-- Toast -->
|
|
105
|
-
<div
|
|
106
|
-
class="toast {classesToast} {t.background ?? background} {t.classes ?? ''}"
|
|
107
|
-
role="alert"
|
|
108
|
-
aria-live="polite"
|
|
109
|
-
data-testid="toast"
|
|
110
|
-
>
|
|
125
|
+
<div class="toast {classesToast} {t.background ?? background} {t.classes ?? ''}" data-testid="toast">
|
|
111
126
|
<div class="text-base">{@html t.message}</div>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
127
|
+
{#if t.action || !t.hideDismiss}
|
|
128
|
+
<div class="toast-actions {cToastActions}">
|
|
129
|
+
{#if t.action}<button class={buttonAction} on:click={() => onAction(i)}>{@html t.action.label}</button>{/if}
|
|
130
|
+
{#if !t.hideDismiss}<button class={buttonDismiss} aria-label="Dismiss toast" on:click={() => toastStore.close(t.id)}
|
|
131
|
+
>{buttonDismissLabel}</button
|
|
132
|
+
>{/if}
|
|
133
|
+
</div>
|
|
134
|
+
{/if}
|
|
116
135
|
</div>
|
|
117
136
|
</div>
|
|
118
137
|
{/each}
|
|
@@ -1,10 +1,15 @@
|
|
|
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
|
-
trigger: (toast: ToastSettings) =>
|
|
6
|
-
/** Remove
|
|
6
|
+
trigger: (toast: ToastSettings) => string;
|
|
7
|
+
/** Remove toast in queue*/
|
|
7
8
|
close: (id: string) => void;
|
|
9
|
+
/** remain visible on hover */
|
|
10
|
+
freeze: (index: number) => void;
|
|
11
|
+
/** cancel remain visible on leave */
|
|
12
|
+
unfreeze: (index: number) => void;
|
|
8
13
|
/** Remove all toasts from queue */
|
|
9
14
|
clear: () => void;
|
|
10
15
|
};
|
|
@@ -19,21 +19,27 @@ function toastService() {
|
|
|
19
19
|
return {
|
|
20
20
|
subscribe,
|
|
21
21
|
/** Add a new toast to the queue. */
|
|
22
|
-
trigger: (toast) =>
|
|
22
|
+
trigger: (toast) => {
|
|
23
23
|
const id = randomUUID();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
toast.callback
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
update((tStore) => {
|
|
25
|
+
// Trigger Callback
|
|
26
|
+
if (toast && toast.callback)
|
|
27
|
+
toast.callback({ id, status: 'queued' });
|
|
28
|
+
// activate autohide when dismiss button is hidden.
|
|
29
|
+
if (toast.hideDismiss)
|
|
30
|
+
toast.autohide = true;
|
|
31
|
+
// Merge with defaults
|
|
32
|
+
const tMerged = { ...toastDefaults, ...toast, id };
|
|
33
|
+
// Handle auto-hide, if needed
|
|
34
|
+
tMerged.timeoutId = handleAutoHide(tMerged);
|
|
35
|
+
// Push into store
|
|
36
|
+
tStore.push(tMerged);
|
|
37
|
+
// Return
|
|
38
|
+
return tStore;
|
|
39
|
+
});
|
|
40
|
+
return id;
|
|
41
|
+
},
|
|
42
|
+
/** Remove toast in queue*/
|
|
37
43
|
close: (id) => update((tStore) => {
|
|
38
44
|
if (tStore.length > 0) {
|
|
39
45
|
const index = tStore.findIndex((t) => t.id === id);
|
|
@@ -51,6 +57,18 @@ function toastService() {
|
|
|
51
57
|
}
|
|
52
58
|
return tStore;
|
|
53
59
|
}),
|
|
60
|
+
/** remain visible on hover */
|
|
61
|
+
freeze: (index) => update((tStore) => {
|
|
62
|
+
if (tStore.length > 0)
|
|
63
|
+
clearTimeout(tStore[index].timeoutId);
|
|
64
|
+
return tStore;
|
|
65
|
+
}),
|
|
66
|
+
/** cancel remain visible on leave */
|
|
67
|
+
unfreeze: (index) => update((tStore) => {
|
|
68
|
+
if (tStore.length > 0)
|
|
69
|
+
tStore[index].timeoutId = handleAutoHide(tStore[index]);
|
|
70
|
+
return tStore;
|
|
71
|
+
}),
|
|
54
72
|
/** Remove all toasts from queue */
|
|
55
73
|
clear: () => set([])
|
|
56
74
|
};
|
|
@@ -14,6 +14,10 @@ export interface ToastSettings {
|
|
|
14
14
|
/** The function triggered when the button is pressed. */
|
|
15
15
|
response: () => void;
|
|
16
16
|
};
|
|
17
|
+
/** Hide dismiss button */
|
|
18
|
+
hideDismiss?: boolean;
|
|
19
|
+
/** Remain visible on Hover */
|
|
20
|
+
hoverable?: boolean;
|
|
17
21
|
/** Provide arbitrary CSS classes to style the toast. */
|
|
18
22
|
classes?: string;
|
|
19
23
|
/** Callback function that fires on trigger and close. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-dev.2c3d2fbb",
|
|
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": {
|
|
@@ -94,7 +97,7 @@
|
|
|
94
97
|
"format": "prettier --ignore-path .prettierignore --write --plugin-search-dir=. .",
|
|
95
98
|
"test": "vitest",
|
|
96
99
|
"coverage": "vitest run --coverage",
|
|
97
|
-
"sync": "svelte-kit sync",
|
|
100
|
+
"sync": "svelte-kit sync && pnpm build:jss",
|
|
98
101
|
"build:jss": "node ./scripts/generate-jss.js --package"
|
|
99
102
|
},
|
|
100
103
|
"typesVersions": {
|