@skeletonlabs/skeleton 1.11.0-dev.fa91c649 → 2.0.0-rc.0
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/components/Accordion/Accordion.svelte +15 -3
- package/dist/components/Accordion/Accordion.svelte.d.ts +17 -23
- package/dist/components/Accordion/AccordionItem.svelte +8 -3
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +15 -25
- package/dist/components/AppRail/AppRailTile.svelte +1 -1
- package/dist/components/Autocomplete/Autocomplete.svelte +17 -7
- package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +17 -27
- package/dist/components/Avatar/Avatar.svelte +1 -1
- package/dist/components/ConicGradient/ConicGradient.svelte +1 -1
- package/dist/components/InputChip/InputChip.svelte +25 -4
- package/dist/components/InputChip/InputChip.svelte.d.ts +22 -27
- package/dist/components/Paginator/Paginator.svelte +18 -16
- package/dist/components/Paginator/Paginator.svelte.d.ts +2 -2
- package/dist/components/Paginator/types.d.ts +2 -2
- package/dist/components/Ratings/Ratings.svelte +1 -1
- package/dist/components/Stepper/Step.svelte +11 -2
- package/dist/components/Stepper/Step.svelte.d.ts +15 -12
- package/dist/components/Stepper/Stepper.svelte +21 -3
- package/dist/components/Stepper/Stepper.svelte.d.ts +17 -27
- package/dist/components/Tab/TabGroup.svelte +1 -1
- package/dist/components/Table/Table.svelte +1 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.js +10 -12
- package/dist/internal/transitions.d.ts +10 -0
- package/dist/internal/transitions.js +11 -0
- package/dist/transitions/crossfade.d.ts +1 -0
- package/dist/transitions/crossfade.js +21 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +1 -0
- package/dist/utilities/Drawer/Drawer.svelte +33 -12
- package/dist/utilities/Drawer/Drawer.svelte.d.ts +4 -2
- package/dist/utilities/Drawer/stores.d.ts +20 -1
- package/dist/utilities/Drawer/stores.js +27 -2
- package/dist/utilities/Drawer/types.d.ts +2 -0
- package/dist/utilities/Modal/Modal.svelte +21 -23
- package/dist/utilities/Modal/Modal.svelte.d.ts +17 -37
- package/dist/utilities/Modal/stores.d.ts +20 -1
- package/dist/utilities/Modal/stores.js +27 -1
- package/dist/utilities/PrefersReducedMotion/PrefersReducedMotion.d.ts +7 -0
- package/dist/utilities/PrefersReducedMotion/PrefersReducedMotion.js +26 -0
- package/dist/utilities/TableOfContents/TableOfContents.svelte +56 -0
- package/dist/utilities/TableOfContents/TableOfContents.svelte.d.ts +34 -0
- package/dist/utilities/TableOfContents/crawler.d.ts +14 -0
- package/dist/utilities/TableOfContents/crawler.js +76 -0
- package/dist/utilities/TableOfContents/stores.d.ts +6 -0
- package/dist/utilities/TableOfContents/stores.js +5 -0
- package/dist/utilities/TableOfContents/types.d.ts +5 -0
- package/dist/utilities/TableOfContents/types.js +2 -0
- package/dist/utilities/Toast/Toast.svelte +24 -23
- package/dist/utilities/Toast/Toast.svelte.d.ts +17 -24
- package/dist/utilities/Toast/stores.d.ts +23 -5
- package/dist/utilities/Toast/stores.js +56 -29
- package/dist/utilities/index.d.ts +18 -0
- package/dist/utilities/index.js +25 -0
- package/package.json +3 -16
- package/dist/components/TableOfContents/TableOfContents.svelte +0 -111
- package/dist/components/TableOfContents/TableOfContents.svelte.d.ts +0 -44
- package/dist/styles/all.css +0 -30
- package/dist/styles/elements/alerts.css +0 -17
- package/dist/styles/elements/badges.css +0 -31
- package/dist/styles/elements/breadcrumbs.css +0 -36
- package/dist/styles/elements/buttons.css +0 -109
- package/dist/styles/elements/cards.css +0 -32
- package/dist/styles/elements/chips.css +0 -22
- package/dist/styles/elements/codeblocks.css +0 -16
- package/dist/styles/elements/forms.css +0 -283
- package/dist/styles/elements/lists.css +0 -51
- package/dist/styles/elements/logo-clouds.css +0 -29
- package/dist/styles/elements/modals.css +0 -15
- package/dist/styles/elements/placeholders.css +0 -17
- package/dist/styles/elements/popups.css +0 -16
- package/dist/styles/elements/tables.css +0 -102
- package/dist/styles/partials/core.css +0 -66
- package/dist/styles/partials/elements.css +0 -20
- package/dist/styles/partials/tailwind.css +0 -16
- package/dist/styles/partials/typography-next.css +0 -99
- package/dist/styles/partials/typography-prose.css +0 -49
- package/dist/styles/partials/typography.css +0 -99
- package/dist/styles/partials/variants.css +0 -204
- package/dist/styles/skeleton-minimal.css +0 -30
- package/dist/styles/skeleton.css +0 -30
- package/dist/tailwind/core.cjs +0 -37
- package/dist/tailwind/core.d.cts +0 -5
- package/dist/tailwind/generated/intellisense-classes.cjs +0 -1
- package/dist/tailwind/generated/intellisense-classes.d.cts +0 -2729
- package/dist/tailwind/intellisense.cjs +0 -21
- package/dist/tailwind/intellisense.d.cts +0 -5
- package/dist/tailwind/settings.cjs +0 -20
- package/dist/tailwind/settings.d.cts +0 -6
- package/dist/tailwind/skeleton.cjs +0 -19
- package/dist/tailwind/skeleton.d.cts +0 -7
- package/dist/tailwind/theme/colors.cjs +0 -18
- package/dist/tailwind/theme/colors.d.cts +0 -2
- package/dist/tailwind/tokens/backgrounds.cjs +0 -39
- package/dist/tailwind/tokens/backgrounds.d.cts +0 -2
- package/dist/tailwind/tokens/border-radius.cjs +0 -21
- package/dist/tailwind/tokens/border-radius.d.cts +0 -33
- package/dist/tailwind/tokens/borders.cjs +0 -20
- package/dist/tailwind/tokens/borders.d.cts +0 -6
- package/dist/tailwind/tokens/fills.cjs +0 -20
- package/dist/tailwind/tokens/fills.d.cts +0 -15
- package/dist/tailwind/tokens/rings.cjs +0 -50
- package/dist/tailwind/tokens/rings.d.cts +0 -22
- package/dist/tailwind/tokens/text.cjs +0 -31
- package/dist/tailwind/tokens/text.d.cts +0 -21
- package/dist/themes/theme-crimson.css +0 -100
- package/dist/themes/theme-gold-nouveau.css +0 -143
- package/dist/themes/theme-hamlindigo.css +0 -109
- package/dist/themes/theme-modern.css +0 -134
- package/dist/themes/theme-rocket.css +0 -120
- package/dist/themes/theme-sahara.css +0 -133
- package/dist/themes/theme-seafoam.css +0 -128
- package/dist/themes/theme-seasonal.css +0 -114
- package/dist/themes/theme-skeleton.css +0 -119
- package/dist/themes/theme-test.css +0 -96
- package/dist/themes/theme-vintage.css +0 -131
- package/dist/utilities/DataTable/DataTable.d.ts +0 -19
- package/dist/utilities/DataTable/DataTable.js +0 -137
- package/dist/utilities/DataTable/types.d.ts +0 -33
- package/dist/utilities/DataTable/types.js +0 -2
- /package/dist/{utilities/DataTable → components/Table}/actions.d.ts +0 -0
- /package/dist/{utilities/DataTable → components/Table}/actions.js +0 -0
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
/// <reference types="svelte" />
|
|
2
2
|
import type { ToastSettings, Toast } from './types.js';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves the `toastStore`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { getToastStore } from "@skeletonlabs/skeleton";
|
|
9
|
+
*
|
|
10
|
+
* const toastStore = getToastStore();
|
|
11
|
+
*
|
|
12
|
+
* toastStore.open({ message: "Welcome!" });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function getToastStore(): ToastStore;
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the `toastStore`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function initializeToastStore(): ToastStore;
|
|
20
|
+
type ToastStore = ReturnType<typeof toastService>;
|
|
21
|
+
declare function toastService(): {
|
|
4
22
|
subscribe: (this: void, run: import("svelte/store").Subscriber<Toast[]>, invalidate?: import("svelte/store").Invalidator<Toast[]> | undefined) => import("svelte/store").Unsubscriber;
|
|
23
|
+
close: (id: string) => void;
|
|
5
24
|
/** Add a new toast to the queue. */
|
|
6
25
|
trigger: (toast: ToastSettings) => string;
|
|
7
|
-
/**
|
|
8
|
-
close: (id: string) => void;
|
|
9
|
-
/** remain visible on hover */
|
|
26
|
+
/** Remain visible on hover */
|
|
10
27
|
freeze: (index: number) => void;
|
|
11
|
-
/**
|
|
28
|
+
/** Cancel remain visible on leave */
|
|
12
29
|
unfreeze: (index: number) => void;
|
|
13
30
|
/** Remove all toasts from queue */
|
|
14
31
|
clear: () => void;
|
|
15
32
|
};
|
|
33
|
+
export {};
|
|
@@ -1,23 +1,69 @@
|
|
|
1
1
|
// Toast Store Queue
|
|
2
2
|
import { writable } from 'svelte/store';
|
|
3
|
+
import { getContext, setContext } from 'svelte';
|
|
3
4
|
const toastDefaults = { message: 'Missing Toast Message', autohide: true, timeout: 5000 };
|
|
5
|
+
const TOAST_STORE_KEY = 'toastStore';
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves the `toastStore`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { getToastStore } from "@skeletonlabs/skeleton";
|
|
12
|
+
*
|
|
13
|
+
* const toastStore = getToastStore();
|
|
14
|
+
*
|
|
15
|
+
* toastStore.open({ message: "Welcome!" });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export function getToastStore() {
|
|
19
|
+
const toastStore = getContext(TOAST_STORE_KEY);
|
|
20
|
+
if (!toastStore)
|
|
21
|
+
throw new Error('toastStore is not initialized. Please ensure that `initializeStores()` is invoked in the root layout file of this app!');
|
|
22
|
+
return toastStore;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Initializes the `toastStore`.
|
|
26
|
+
*/
|
|
27
|
+
export function initializeToastStore() {
|
|
28
|
+
const toastStore = toastService();
|
|
29
|
+
return setContext(TOAST_STORE_KEY, toastStore);
|
|
30
|
+
}
|
|
4
31
|
// Note for security; differentiates the queued toasts
|
|
5
32
|
function randomUUID() {
|
|
6
33
|
const random = Math.random();
|
|
7
34
|
return Number(random).toString(32);
|
|
8
35
|
}
|
|
9
|
-
// If toast should auto-hide, wait X time, then close by ID
|
|
10
|
-
function handleAutoHide(toast) {
|
|
11
|
-
if (toast.autohide === true) {
|
|
12
|
-
return setTimeout(() => {
|
|
13
|
-
toastStore.close(toast.id);
|
|
14
|
-
}, toast.timeout);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
36
|
function toastService() {
|
|
18
37
|
const { subscribe, set, update } = writable([]);
|
|
38
|
+
/** Remove toast in queue*/
|
|
39
|
+
const close = (id) => update((tStore) => {
|
|
40
|
+
if (tStore.length > 0) {
|
|
41
|
+
const index = tStore.findIndex((t) => t.id === id);
|
|
42
|
+
const selectedToast = tStore[index];
|
|
43
|
+
if (selectedToast) {
|
|
44
|
+
// Trigger Callback
|
|
45
|
+
if (selectedToast.callback)
|
|
46
|
+
selectedToast.callback({ id, status: 'closed' });
|
|
47
|
+
// Clear timeout
|
|
48
|
+
if (selectedToast.timeoutId)
|
|
49
|
+
clearTimeout(selectedToast.timeoutId);
|
|
50
|
+
// Remove
|
|
51
|
+
tStore.splice(index, 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return tStore;
|
|
55
|
+
});
|
|
56
|
+
// If toast should auto-hide, wait X time, then close by ID
|
|
57
|
+
function handleAutoHide(toast) {
|
|
58
|
+
if (toast.autohide === true) {
|
|
59
|
+
return setTimeout(() => {
|
|
60
|
+
close(toast.id);
|
|
61
|
+
}, toast.timeout);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
19
64
|
return {
|
|
20
65
|
subscribe,
|
|
66
|
+
close,
|
|
21
67
|
/** Add a new toast to the queue. */
|
|
22
68
|
trigger: (toast) => {
|
|
23
69
|
const id = randomUUID();
|
|
@@ -39,31 +85,13 @@ function toastService() {
|
|
|
39
85
|
});
|
|
40
86
|
return id;
|
|
41
87
|
},
|
|
42
|
-
/**
|
|
43
|
-
close: (id) => update((tStore) => {
|
|
44
|
-
if (tStore.length > 0) {
|
|
45
|
-
const index = tStore.findIndex((t) => t.id === id);
|
|
46
|
-
const selectedToast = tStore[index];
|
|
47
|
-
if (selectedToast) {
|
|
48
|
-
// Trigger Callback
|
|
49
|
-
if (selectedToast.callback)
|
|
50
|
-
selectedToast.callback({ id, status: 'closed' });
|
|
51
|
-
// Clear timeout
|
|
52
|
-
if (selectedToast.timeoutId)
|
|
53
|
-
clearTimeout(selectedToast.timeoutId);
|
|
54
|
-
// Remove
|
|
55
|
-
tStore.splice(index, 1);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return tStore;
|
|
59
|
-
}),
|
|
60
|
-
/** remain visible on hover */
|
|
88
|
+
/** Remain visible on hover */
|
|
61
89
|
freeze: (index) => update((tStore) => {
|
|
62
90
|
if (tStore.length > 0)
|
|
63
91
|
clearTimeout(tStore[index].timeoutId);
|
|
64
92
|
return tStore;
|
|
65
93
|
}),
|
|
66
|
-
/**
|
|
94
|
+
/** Cancel remain visible on leave */
|
|
67
95
|
unfreeze: (index) => update((tStore) => {
|
|
68
96
|
if (tStore.length > 0)
|
|
69
97
|
tStore[index].timeoutId = handleAutoHide(tStore[index]);
|
|
@@ -73,4 +101,3 @@ function toastService() {
|
|
|
73
101
|
clear: () => set([])
|
|
74
102
|
};
|
|
75
103
|
}
|
|
76
|
-
export const toastStore = toastService();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to initialize the stores for the `Modal`, `Toast`, and `Drawer` utilities.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```svelte
|
|
6
|
+
* <!-- App's root +layout.svelte -->
|
|
7
|
+
* <script>
|
|
8
|
+
* import { initializeStores, Toast, Modal, Drawer } from "@skeletonlabs/skeleton";
|
|
9
|
+
*
|
|
10
|
+
* initializeStores();
|
|
11
|
+
* </script>
|
|
12
|
+
*
|
|
13
|
+
* <Toast />
|
|
14
|
+
* <Modal />
|
|
15
|
+
* <Drawer />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function initializeStores(): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { initializeModalStore } from './Modal/stores.js';
|
|
2
|
+
import { initializeToastStore } from './Toast/stores.js';
|
|
3
|
+
import { initializeDrawerStore } from './Drawer/stores.js';
|
|
4
|
+
/**
|
|
5
|
+
* Used to initialize the stores for the `Modal`, `Toast`, and `Drawer` utilities.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```svelte
|
|
9
|
+
* <!-- App's root +layout.svelte -->
|
|
10
|
+
* <script>
|
|
11
|
+
* import { initializeStores, Toast, Modal, Drawer } from "@skeletonlabs/skeleton";
|
|
12
|
+
*
|
|
13
|
+
* initializeStores();
|
|
14
|
+
* </script>
|
|
15
|
+
*
|
|
16
|
+
* <Toast />
|
|
17
|
+
* <Modal />
|
|
18
|
+
* <Drawer />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function initializeStores() {
|
|
22
|
+
initializeModalStore();
|
|
23
|
+
initializeToastStore();
|
|
24
|
+
initializeDrawerStore();
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"description": "A SvelteKit component library.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"repository": {
|
|
@@ -67,12 +67,6 @@
|
|
|
67
67
|
"types": "./dist/index.d.ts",
|
|
68
68
|
"svelte": "./dist/index.js",
|
|
69
69
|
"default": "./dist/index.js"
|
|
70
|
-
},
|
|
71
|
-
"./styles/*": "./dist/styles/*",
|
|
72
|
-
"./themes/*": "./dist/themes/*",
|
|
73
|
-
"./tailwind/skeleton.cjs": {
|
|
74
|
-
"types": "./dist/tailwind/skeleton.cts",
|
|
75
|
-
"default": "./dist/tailwind/skeleton.cjs"
|
|
76
70
|
}
|
|
77
71
|
},
|
|
78
72
|
"files": [
|
|
@@ -81,15 +75,12 @@
|
|
|
81
75
|
"./dist/**/*.d.ts",
|
|
82
76
|
"./dist/**/*.cjs",
|
|
83
77
|
"./dist/**/*.d.cts",
|
|
84
|
-
"./dist/styles/*",
|
|
85
|
-
"./dist/tailwind/*",
|
|
86
|
-
"./dist/themes/*",
|
|
87
78
|
"!./dist/**/*.test.*"
|
|
88
79
|
],
|
|
89
80
|
"scripts": {
|
|
90
81
|
"dev": "vite dev",
|
|
91
82
|
"build": "vite build",
|
|
92
|
-
"package": "node ./scripts/pre-build.js &&
|
|
83
|
+
"package": "node ./scripts/pre-build.js && svelte-kit sync && svelte-package && node ./scripts/post-build.js",
|
|
93
84
|
"preview": "vite preview",
|
|
94
85
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
95
86
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
@@ -97,16 +88,12 @@
|
|
|
97
88
|
"format": "prettier --ignore-path .prettierignore --write --plugin-search-dir=. .",
|
|
98
89
|
"test": "vitest",
|
|
99
90
|
"coverage": "vitest run --coverage",
|
|
100
|
-
"sync": "svelte-kit sync
|
|
101
|
-
"build:jss": "node ./scripts/generate-jss.js --package"
|
|
91
|
+
"sync": "svelte-kit sync"
|
|
102
92
|
},
|
|
103
93
|
"typesVersions": {
|
|
104
94
|
">4.0": {
|
|
105
95
|
"index.d.ts": [
|
|
106
96
|
"./dist/index.d.ts"
|
|
107
|
-
],
|
|
108
|
-
"tailwind/skeleton.cjs": [
|
|
109
|
-
"./dist/tailwind/skeleton.d.cts"
|
|
110
97
|
]
|
|
111
98
|
}
|
|
112
99
|
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
<script>import { onDestroy, onMount } from "svelte";
|
|
2
|
-
import { fade } from "svelte/transition";
|
|
3
|
-
export let scrollParent = "#page";
|
|
4
|
-
export let target = "#page";
|
|
5
|
-
export let allowedHeadings = "h2, h3";
|
|
6
|
-
export let label = "On This Page";
|
|
7
|
-
export let width = "w-[240px]";
|
|
8
|
-
export let spacing = "space-y-4";
|
|
9
|
-
export let text = "text-surface-600-300-token";
|
|
10
|
-
export let hover = "hover:bg-primary-hover-token";
|
|
11
|
-
export let active = "bg-primary-active-token !text-on-primary-token";
|
|
12
|
-
export let rounded = "rounded-token";
|
|
13
|
-
export let regionLabel = "font-bold";
|
|
14
|
-
export let regionList = "";
|
|
15
|
-
const cLabel = "p-4 pt-0";
|
|
16
|
-
const cList = "list-none space-y-1";
|
|
17
|
-
const cListItem = "px-4 py-2 cursor-pointer";
|
|
18
|
-
let elemScrollParent;
|
|
19
|
-
let allowedHeadingsList;
|
|
20
|
-
let filteredHeadingsList = [];
|
|
21
|
-
let activeHeaderId;
|
|
22
|
-
function queryAllowedHeadingsList() {
|
|
23
|
-
const elemTarget = document.querySelector(target);
|
|
24
|
-
allowedHeadingsList = elemTarget?.querySelectorAll(allowedHeadings);
|
|
25
|
-
}
|
|
26
|
-
function generateHeadingList() {
|
|
27
|
-
allowedHeadingsList?.forEach((elem) => {
|
|
28
|
-
if (elem.hasAttribute("data-toc-ignore"))
|
|
29
|
-
return;
|
|
30
|
-
if (!elem.id) {
|
|
31
|
-
let newId = elem.innerText.replaceAll(/[^a-zA-Z0-9 ]/g, "").replaceAll(" ", "-").toLowerCase();
|
|
32
|
-
elem.id = `${newId}`;
|
|
33
|
-
}
|
|
34
|
-
if (!elem.querySelector(".permalink")) {
|
|
35
|
-
elem.innerHTML += `<a href="#${elem.id}" class="permalink">\u{1F517}</a>`;
|
|
36
|
-
}
|
|
37
|
-
filteredHeadingsList.push(elem);
|
|
38
|
-
});
|
|
39
|
-
filteredHeadingsList = [...filteredHeadingsList];
|
|
40
|
-
}
|
|
41
|
-
function setHeadingClasses(headingElem) {
|
|
42
|
-
if (headingElem.tagName === "H3")
|
|
43
|
-
return "ml-3";
|
|
44
|
-
if (headingElem.tagName === "H4")
|
|
45
|
-
return "ml-6";
|
|
46
|
-
if (headingElem.tagName === "H5")
|
|
47
|
-
return "ml-9";
|
|
48
|
-
if (headingElem.tagName === "H6")
|
|
49
|
-
return "ml-12";
|
|
50
|
-
return "";
|
|
51
|
-
}
|
|
52
|
-
function scrollToHeading(headingElem) {
|
|
53
|
-
const elemTarget = document.querySelector(`#${headingElem.id}`);
|
|
54
|
-
if (elemTarget)
|
|
55
|
-
elemTarget.scrollIntoView({ behavior: "smooth" });
|
|
56
|
-
}
|
|
57
|
-
function pageScrollHandler() {
|
|
58
|
-
const headingSizeThreshold = 40;
|
|
59
|
-
let visibleHeadings = [];
|
|
60
|
-
allowedHeadingsList?.forEach((header) => {
|
|
61
|
-
const scrollableTop = elemScrollParent?.getBoundingClientRect().top || 0;
|
|
62
|
-
const headerBoundTop = header.getBoundingClientRect().top;
|
|
63
|
-
const offsetTop = headerBoundTop - scrollableTop + headingSizeThreshold;
|
|
64
|
-
if (offsetTop >= 0)
|
|
65
|
-
visibleHeadings.push(header);
|
|
66
|
-
});
|
|
67
|
-
activeHeaderId = visibleHeadings[0]?.id;
|
|
68
|
-
}
|
|
69
|
-
onMount(() => {
|
|
70
|
-
queryAllowedHeadingsList();
|
|
71
|
-
generateHeadingList();
|
|
72
|
-
elemScrollParent = document.querySelector(scrollParent);
|
|
73
|
-
elemScrollParent?.addEventListener("scroll", pageScrollHandler);
|
|
74
|
-
pageScrollHandler();
|
|
75
|
-
});
|
|
76
|
-
onDestroy(() => {
|
|
77
|
-
elemScrollParent?.removeEventListener("scroll", pageScrollHandler);
|
|
78
|
-
});
|
|
79
|
-
$:
|
|
80
|
-
classesBase = `${width} ${spacing} ${$$props.class ?? ""}`;
|
|
81
|
-
$:
|
|
82
|
-
classesLabel = `${cLabel} ${regionLabel}`;
|
|
83
|
-
$:
|
|
84
|
-
classesList = `${cList} ${regionList}`;
|
|
85
|
-
$:
|
|
86
|
-
classesListItem = `${cListItem} ${text} ${hover} ${rounded}`;
|
|
87
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<!-- @component Allows you to quickly navigate the hierarchy of headings for the current page. -->
|
|
90
|
-
|
|
91
|
-
{#if filteredHeadingsList.length > 0}
|
|
92
|
-
<div class="toc {classesBase}" transition:fade|local={{ duration: 100 }}>
|
|
93
|
-
<nav class="toc-list {classesList}">
|
|
94
|
-
<div class="toc-label {classesLabel}">{label}</div>
|
|
95
|
-
{#each filteredHeadingsList as headingElem}
|
|
96
|
-
<!-- TODO: Remove for V2 -->
|
|
97
|
-
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
98
|
-
<!-- prettier-ignore -->
|
|
99
|
-
<li
|
|
100
|
-
class="toc-list-item {classesListItem} {setHeadingClasses(headingElem)} {headingElem.id === activeHeaderId ? active : ''}"
|
|
101
|
-
on:click={() => { scrollToHeading(headingElem); }}
|
|
102
|
-
on:click
|
|
103
|
-
on:keypress
|
|
104
|
-
>
|
|
105
|
-
<!-- {headingElem.innerText} -->
|
|
106
|
-
{headingElem.firstChild?.nodeValue}
|
|
107
|
-
</li>
|
|
108
|
-
{/each}
|
|
109
|
-
</nav>
|
|
110
|
-
</div>
|
|
111
|
-
{/if}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
/** Query selector for the scrollable page element.*/
|
|
6
|
-
scrollParent?: string | undefined;
|
|
7
|
-
/** Query selector for the element to scan for headings.*/
|
|
8
|
-
target?: string | undefined;
|
|
9
|
-
/** Query selector for the allowed headings. From H2-H6.*/
|
|
10
|
-
allowedHeadings?: string | undefined;
|
|
11
|
-
/** Set the label text.*/
|
|
12
|
-
label?: string | undefined;
|
|
13
|
-
/** Set the component width style.*/
|
|
14
|
-
width?: string | undefined;
|
|
15
|
-
/** Set the vertical spacing styles.*/
|
|
16
|
-
spacing?: string | undefined;
|
|
17
|
-
/** Set the row text color styles.*/
|
|
18
|
-
text?: string | undefined;
|
|
19
|
-
/** Set the row hover styles.*/
|
|
20
|
-
hover?: string | undefined;
|
|
21
|
-
/** Set the active row styles*/
|
|
22
|
-
active?: string | undefined;
|
|
23
|
-
/** Set the row border radius styles.*/
|
|
24
|
-
rounded?: string | undefined;
|
|
25
|
-
/** Provide arbitrary styles for the label element.*/
|
|
26
|
-
regionLabel?: string | undefined;
|
|
27
|
-
/** Provide arbitrary styles for the list element.*/
|
|
28
|
-
regionList?: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
events: {
|
|
31
|
-
click: MouseEvent;
|
|
32
|
-
keypress: KeyboardEvent;
|
|
33
|
-
} & {
|
|
34
|
-
[evt: string]: CustomEvent<any>;
|
|
35
|
-
};
|
|
36
|
-
slots: {};
|
|
37
|
-
};
|
|
38
|
-
export type TableOfContentsProps = typeof __propDef.props;
|
|
39
|
-
export type TableOfContentsEvents = typeof __propDef.events;
|
|
40
|
-
export type TableOfContentsSlots = typeof __propDef.slots;
|
|
41
|
-
/** Allows you to quickly navigate the hierarchy of headings for the current page. */
|
|
42
|
-
export default class TableOfContents extends SvelteComponentTyped<TableOfContentsProps, TableOfContentsEvents, TableOfContentsSlots> {
|
|
43
|
-
}
|
|
44
|
-
export {};
|
package/dist/styles/all.css
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* Stylesheet: skeleton.css */
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
- Will be replaced by `skeleton.css` in the next major release.
|
|
5
|
-
- All available stylesheets are imported
|
|
6
|
-
- Typography using on-by-default system
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/* NOTE: The order shown below is required */
|
|
10
|
-
/* Import AFTER your theme, but BEFORE your global stylesheet. */
|
|
11
|
-
|
|
12
|
-
/* Tailwind Directives */
|
|
13
|
-
@import 'partials/tailwind.css';
|
|
14
|
-
|
|
15
|
-
/* === OPTIONAL STYLESHEETS === */
|
|
16
|
-
|
|
17
|
-
/* Core Styles */
|
|
18
|
-
@import 'partials/core.css';
|
|
19
|
-
|
|
20
|
-
/* Typography Settings */
|
|
21
|
-
@import 'partials/typography.css';
|
|
22
|
-
/* DEPRECATED: 'partials/typography-prose.css' must now be imported directly */
|
|
23
|
-
|
|
24
|
-
/* === REQUIRED STYLESHEETS === */
|
|
25
|
-
|
|
26
|
-
/* Imports all Tailwind Elements */
|
|
27
|
-
@import 'partials/elements.css';
|
|
28
|
-
|
|
29
|
-
/* Imports all Variant Styles */
|
|
30
|
-
@import 'partials/variants.css';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* Tailwind Elements: alerts.css */
|
|
2
|
-
|
|
3
|
-
@layer components {
|
|
4
|
-
.alert {
|
|
5
|
-
@apply flex flex-col items-start lg:items-center lg:flex-row p-4 space-y-4 lg:space-y-0 lg:space-x-4;
|
|
6
|
-
/* Text */
|
|
7
|
-
@apply text-surface-900-50-token;
|
|
8
|
-
/* Rounded */
|
|
9
|
-
@apply rounded-container-token;
|
|
10
|
-
}
|
|
11
|
-
.alert-message {
|
|
12
|
-
@apply flex-auto space-y-2;
|
|
13
|
-
}
|
|
14
|
-
.alert-actions {
|
|
15
|
-
@apply flex items-center space-x-2;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* Tailwind Elements: badges.css */
|
|
2
|
-
|
|
3
|
-
@layer components {
|
|
4
|
-
.badge {
|
|
5
|
-
/* Core */
|
|
6
|
-
@apply inline-flex justify-center items-center space-x-2 whitespace-nowrap;
|
|
7
|
-
/* Text */
|
|
8
|
-
@apply font-semibold text-xs;
|
|
9
|
-
/* Padding */
|
|
10
|
-
@apply px-2 py-1;
|
|
11
|
-
/* Theme: Rounded */
|
|
12
|
-
@apply rounded-token;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.badge-icon {
|
|
16
|
-
/* Core */
|
|
17
|
-
@apply w-5 h-5 flex justify-center items-center rounded-full;
|
|
18
|
-
/* Text */
|
|
19
|
-
@apply font-semibold text-xs;
|
|
20
|
-
/* Shadow */
|
|
21
|
-
@apply shadow;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* === Variants === */
|
|
25
|
-
|
|
26
|
-
/* Glass */
|
|
27
|
-
.badge-glass {
|
|
28
|
-
@apply bg-surface-500/20 dark:bg-surface-500/20 backdrop-blur-lg;
|
|
29
|
-
@apply ring-[1px] ring-neutral-900/5 dark:ring-neutral-50/5 ring-inset;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/* Tailwind Elements: breadcrumbs.css */
|
|
2
|
-
|
|
3
|
-
@layer components {
|
|
4
|
-
/* Hide Scrollbars */
|
|
5
|
-
/* Duplicated from core.css to support `skeleton-minimal.css` */
|
|
6
|
-
.hide-scrollbar::-webkit-scrollbar {
|
|
7
|
-
display: none;
|
|
8
|
-
}
|
|
9
|
-
.hide-scrollbar {
|
|
10
|
-
-ms-overflow-style: none; /* IE/Edge */
|
|
11
|
-
scrollbar-width: none; /* Firefox */
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.breadcrumb,
|
|
15
|
-
.breadcrumb-nonresponsive {
|
|
16
|
-
@apply flex items-center space-x-4 w-full hide-scrollbar overflow-x-auto;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.crumb {
|
|
20
|
-
@apply flex justify-center items-center space-x-2;
|
|
21
|
-
}
|
|
22
|
-
.crumb-separator {
|
|
23
|
-
@apply flex text-surface-700-200-token opacity-50;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* === Auto-Responsive === */
|
|
27
|
-
|
|
28
|
-
.breadcrumb li {
|
|
29
|
-
@apply hidden md:block;
|
|
30
|
-
}
|
|
31
|
-
.breadcrumb li:nth-last-child(3),
|
|
32
|
-
.breadcrumb li:nth-last-child(2),
|
|
33
|
-
.breadcrumb li:nth-last-child(1) {
|
|
34
|
-
@apply block;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/* Tailwind Elements: button.css */
|
|
2
|
-
|
|
3
|
-
@layer components {
|
|
4
|
-
/* === States === */
|
|
5
|
-
|
|
6
|
-
button:disabled {
|
|
7
|
-
@apply !opacity-50 !cursor-not-allowed active:scale-100 hover:brightness-100;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.button-base-styles {
|
|
11
|
-
/* Size (match base) */
|
|
12
|
-
@apply text-base;
|
|
13
|
-
/* Padding */
|
|
14
|
-
@apply px-5 py-[9px];
|
|
15
|
-
/* Core */
|
|
16
|
-
@apply text-center whitespace-nowrap;
|
|
17
|
-
/* Flex Columns */
|
|
18
|
-
@apply inline-flex justify-center items-center space-x-2;
|
|
19
|
-
/* States */
|
|
20
|
-
@apply hover:brightness-[1.15];
|
|
21
|
-
/* Transitions */
|
|
22
|
-
@apply transition-all;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* === Button === */
|
|
26
|
-
/* Standard button/anchor tag elements. */
|
|
27
|
-
|
|
28
|
-
.btn {
|
|
29
|
-
@apply button-base-styles rounded-token active:scale-[95%] active:brightness-90;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* Button: Sizes */
|
|
33
|
-
/* Note: Default values are built into `.btn` */
|
|
34
|
-
.btn-sm {
|
|
35
|
-
@apply text-sm px-3 py-1.5;
|
|
36
|
-
}
|
|
37
|
-
.btn-lg {
|
|
38
|
-
@apply text-lg px-7 py-3;
|
|
39
|
-
}
|
|
40
|
-
.btn-xl {
|
|
41
|
-
@apply text-xl px-9 py-4;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* === Icon Button === */
|
|
45
|
-
/* A circular button meant for housing icons. */
|
|
46
|
-
|
|
47
|
-
.btn-icon {
|
|
48
|
-
/* Extend Base Button Classes */
|
|
49
|
-
@apply button-base-styles;
|
|
50
|
-
/* Padding */
|
|
51
|
-
@apply p-0;
|
|
52
|
-
/* Size (match base) */
|
|
53
|
-
@apply text-base aspect-square w-[43px];
|
|
54
|
-
/* Rounded */
|
|
55
|
-
@apply rounded-full;
|
|
56
|
-
/* Active */
|
|
57
|
-
@apply active:scale-[95%] active:brightness-90;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Icon Button: Size */
|
|
61
|
-
.btn-icon-sm {
|
|
62
|
-
@apply text-sm aspect-square w-[33px];
|
|
63
|
-
}
|
|
64
|
-
.btn-icon-base {
|
|
65
|
-
@apply text-base aspect-square w-[43px];
|
|
66
|
-
}
|
|
67
|
-
.btn-icon-lg {
|
|
68
|
-
@apply text-lg aspect-square w-[53px];
|
|
69
|
-
}
|
|
70
|
-
.btn-icon-xl {
|
|
71
|
-
@apply text-xl aspect-square w-[63px];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* File Input Button */
|
|
75
|
-
input[type='file']:not(.file-dropzone-input)::file-selector-button {
|
|
76
|
-
@apply border-0 btn variant-filled btn-sm mr-2;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* === Button Groups === */
|
|
80
|
-
|
|
81
|
-
.btn-group {
|
|
82
|
-
@apply inline-flex flex-row space-x-0 overflow-hidden rounded-token;
|
|
83
|
-
/* Safari: hover overflow fix for border radius */
|
|
84
|
-
isolation: isolate;
|
|
85
|
-
}
|
|
86
|
-
.btn-group-vertical {
|
|
87
|
-
@apply btn-group flex-col space-y-0 rounded-container-token;
|
|
88
|
-
/* Safari: hover overflow fix for border radius */
|
|
89
|
-
isolation: isolate;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* Button / Anchors */
|
|
93
|
-
.btn-group button,
|
|
94
|
-
.btn-group a,
|
|
95
|
-
.btn-group-vertical button,
|
|
96
|
-
.btn-group-vertical a {
|
|
97
|
-
@apply button-base-styles hover:bg-surface-50/[3%] active:bg-surface-900/[3%];
|
|
98
|
-
/* Reset Anchor Styles */
|
|
99
|
-
@apply !no-underline !text-inherit;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* Set Neutral Divider */
|
|
103
|
-
.btn-group * + * {
|
|
104
|
-
@apply border-t-0 border-l border-surface-500/20;
|
|
105
|
-
}
|
|
106
|
-
.btn-group-vertical * + * {
|
|
107
|
-
@apply border-t border-l-0 border-surface-500/20;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* Tailwind Elements: cards.css */
|
|
2
|
-
|
|
3
|
-
@layer components {
|
|
4
|
-
.card {
|
|
5
|
-
/* background */
|
|
6
|
-
@apply bg-surface-100-800-token;
|
|
7
|
-
/* Ring */
|
|
8
|
-
@apply ring-outline-token;
|
|
9
|
-
/* Theme: Rounded */
|
|
10
|
-
@apply rounded-container-token;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/* === Regions === */
|
|
14
|
-
|
|
15
|
-
.card-header {
|
|
16
|
-
@apply p-4 pb-0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.card-footer {
|
|
20
|
-
@apply p-4 pt-0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* === States === */
|
|
24
|
-
|
|
25
|
-
a.card {
|
|
26
|
-
@apply transition-all hover:brightness-105;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.card-hover {
|
|
30
|
-
@apply transition-all hover:scale-[101%] hover:shadow-xl;
|
|
31
|
-
}
|
|
32
|
-
}
|