@skeletonlabs/skeleton 1.2.0 → 1.5.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/actions/Clipboard/clipboard.js +1 -1
- package/dist/actions/Filters/svg-filters/Emerald.svelte +1 -1
- package/dist/components/Accordion/Accordion.svelte +4 -1
- package/dist/components/Accordion/Accordion.svelte.d.ts +4 -0
- package/dist/components/Accordion/AccordionItem.svelte +2 -0
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +3 -1
- package/dist/components/AppRail/AppRail.svelte +1 -1
- package/dist/components/AppRail/AppRail.svelte.d.ts +3 -3
- package/dist/components/AppRail/AppRailTile.svelte +9 -2
- package/dist/components/AppRail/AppRailTile.svelte.d.ts +6 -6
- package/dist/components/AppShell/AppShell.svelte +2 -2
- package/dist/components/AppShell/AppShell.svelte.d.ts +8 -8
- package/dist/components/Autocomplete/Autocomplete.svelte +12 -10
- package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +7 -5
- package/dist/components/Autocomplete/types.d.ts +1 -1
- package/dist/components/Avatar/Avatar.svelte +10 -1
- package/dist/components/Avatar/Avatar.svelte.d.ts +2 -0
- package/dist/components/InputChip/InputChip.svelte +5 -1
- package/dist/components/InputChip/InputChip.svelte.d.ts +4 -2
- package/dist/components/ListBox/ListBox.svelte.d.ts +1 -1
- package/dist/components/ListBox/ListBoxItem.svelte +1 -1
- package/dist/components/Paginator/Paginator.svelte.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar.svelte +2 -2
- package/dist/components/Stepper/Step.svelte +2 -1
- package/dist/components/Tab/Tab.svelte +33 -1
- package/dist/components/Tab/TabGroup.svelte +4 -2
- package/dist/components/TableOfContents/TableOfContents.svelte +2 -2
- package/dist/utilities/CodeBlock/CodeBlock.svelte +12 -5
- package/dist/utilities/CodeBlock/CodeBlock.svelte.d.ts +2 -0
- package/dist/utilities/DataTable/actions.js +1 -1
- package/dist/utilities/Drawer/Drawer.svelte +3 -2
- package/dist/utilities/Drawer/Drawer.svelte.d.ts +1 -1
- package/dist/utilities/LightSwitch/LightSwitch.svelte +8 -2
- package/dist/utilities/LocalStorageStore/LocalStorageStore.js +4 -4
- package/dist/utilities/Popup/popup.d.ts +2 -2
- package/dist/utilities/Popup/popup.js +161 -211
- package/dist/utilities/Popup/types.d.ts +20 -12
- package/dist/utilities/Popup/types.js +0 -1
- package/dist/utilities/Toast/Toast.svelte +20 -4
- package/dist/utilities/Toast/Toast.svelte.d.ts +1 -1
- package/package.json +5 -2
- package/src/lib/styles/all.css +21 -9
- package/src/lib/styles/elements/breadcrumbs.css +10 -0
- package/src/lib/styles/elements/buttons.css +1 -1
- package/src/lib/styles/elements/codeblocks.css +16 -0
- package/src/lib/styles/elements/forms.css +15 -0
- package/src/lib/styles/elements/lists.css +2 -3
- package/src/lib/styles/elements/popups.css +2 -2
- package/src/lib/styles/{core.css → partials/core.css} +1 -0
- package/src/lib/styles/partials/elements.css +20 -0
- package/src/lib/styles/{tailwind.css → partials/tailwind.css} +1 -1
- package/src/lib/styles/{typography.css → partials/typography-next.css} +33 -35
- package/src/lib/styles/partials/typography-prose.css +51 -0
- package/src/lib/styles/partials/typography.css +99 -0
- package/src/lib/styles/{variants.css → partials/variants.css} +54 -6
- package/src/lib/styles/skeleton-minimal.css +30 -0
- package/src/lib/styles/skeleton.css +30 -0
- package/src/lib/tailwind/generated/intellisense-classes.cjs +1 -1
- package/src/lib/tailwind/intellisense.cjs +2 -2
- package/src/lib/styles/elements.css +0 -19
- package/src/lib/styles/highlight-js.css +0 -116
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- Emerald: `filter: url(#Emerald)` -->
|
|
2
2
|
<svg id="svg-filter-emerald" class="hidden">
|
|
3
3
|
<filter id="Emerald" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
4
|
-
<!-- RGB, RGB, RGB,
|
|
4
|
+
<!-- RGB, RGB, RGB, Opacity -->
|
|
5
5
|
<feColorMatrix
|
|
6
6
|
type="matrix"
|
|
7
7
|
in="SourceGraphic"
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
3
|
export let autocollapse = false;
|
|
4
4
|
export let duration = 200;
|
|
5
|
+
export let width = "w-full";
|
|
5
6
|
export let spacing = "space-y-1";
|
|
7
|
+
export let disabled = false;
|
|
6
8
|
export let padding = "py-2 px-4";
|
|
7
9
|
export let hover = "hover:bg-primary-hover-token";
|
|
8
10
|
export let rounded = "rounded-container-token";
|
|
@@ -15,6 +17,7 @@ const active = writable(null);
|
|
|
15
17
|
setContext("active", active);
|
|
16
18
|
setContext("autocollapse", autocollapse);
|
|
17
19
|
setContext("duration", duration);
|
|
20
|
+
setContext("disabled", disabled);
|
|
18
21
|
setContext("padding", padding);
|
|
19
22
|
setContext("hover", hover);
|
|
20
23
|
setContext("rounded", rounded);
|
|
@@ -24,7 +27,7 @@ setContext("regionControl", regionControl);
|
|
|
24
27
|
setContext("regionPanel", regionPanel);
|
|
25
28
|
setContext("regionCaret", regionCaret);
|
|
26
29
|
$:
|
|
27
|
-
classesBase = `${spacing} ${$$props.class ?? ""}`;
|
|
30
|
+
classesBase = `${width} ${spacing} ${$$props.class ?? ""}`;
|
|
28
31
|
</script>
|
|
29
32
|
|
|
30
33
|
<!-- @component The Accordion parent element. -->
|
|
@@ -6,8 +6,12 @@ declare const __propDef: {
|
|
|
6
6
|
autocollapse?: boolean | undefined;
|
|
7
7
|
/** Set the drawer animation duration in milliseconds.*/
|
|
8
8
|
duration?: number | undefined;
|
|
9
|
+
/** Provide classes to set the accordion width.*/
|
|
10
|
+
width?: string | undefined;
|
|
9
11
|
/** Provide classes to set the vertical spacing between items.*/
|
|
10
12
|
spacing?: string | undefined;
|
|
13
|
+
/** Set the accordion disabled state for all items.*/
|
|
14
|
+
disabled?: boolean | undefined;
|
|
11
15
|
/** Provide classes to set the accordion item padding styles.*/
|
|
12
16
|
padding?: string | undefined;
|
|
13
17
|
/** Provide classes to set the accordion item hover styles.*/
|
|
@@ -11,6 +11,7 @@ const cPanel = "";
|
|
|
11
11
|
export let autocollapse = getContext("autocollapse");
|
|
12
12
|
export let active = getContext("active");
|
|
13
13
|
export let duration = getContext("duration");
|
|
14
|
+
export let disabled = getContext("disabled");
|
|
14
15
|
export let padding = getContext("padding");
|
|
15
16
|
export let hover = getContext("hover");
|
|
16
17
|
export let rounded = getContext("rounded");
|
|
@@ -65,6 +66,7 @@ $:
|
|
|
65
66
|
on:keypress
|
|
66
67
|
aria-expanded={openState}
|
|
67
68
|
aria-controls="accordion-panel-{id}"
|
|
69
|
+
{disabled}
|
|
68
70
|
>
|
|
69
71
|
<!-- Lead -->
|
|
70
72
|
{#if $$slots.lead}
|
|
@@ -13,6 +13,8 @@ declare const __propDef: {
|
|
|
13
13
|
active?: Writable<string | null> | undefined;
|
|
14
14
|
/** Set the drawer animation duration.*/
|
|
15
15
|
duration?: number | undefined;
|
|
16
|
+
/** Set the disabled state for this item.*/
|
|
17
|
+
disabled?: boolean | undefined;
|
|
16
18
|
/** Provide classes to set the accordion item padding styles.*/
|
|
17
19
|
padding?: string | undefined;
|
|
18
20
|
/** Provide classes to set the accordion item hover styles.*/
|
|
@@ -38,7 +40,7 @@ declare const __propDef: {
|
|
|
38
40
|
} & {
|
|
39
41
|
[evt: string]: CustomEvent<any>;
|
|
40
42
|
};
|
|
41
|
-
|
|
43
|
+
slots: {
|
|
42
44
|
lead: {};
|
|
43
45
|
summary: {};
|
|
44
46
|
content: {};
|
|
@@ -21,7 +21,7 @@ $:
|
|
|
21
21
|
|
|
22
22
|
<!-- @component A vertical navigation rail component. -->
|
|
23
23
|
|
|
24
|
-
<div class="app-rail {classesBase}">
|
|
24
|
+
<div class="app-rail {classesBase}" data-testid="app-rail">
|
|
25
25
|
<!-- Slot: lead -->
|
|
26
26
|
<div class="app-bar-lead {regionLead}"><slot name="lead" /></div>
|
|
27
27
|
<!-- Slot: Default -->
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import { type Writable } from 'svelte/store';
|
|
2
|
+
import { type Readable, type Writable } from 'svelte/store';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
/** Provide a writable store to maintain navigation selection.*/
|
|
7
|
-
selected?: Writable<any> | undefined;
|
|
6
|
+
/** Provide a writable or readable store to maintain navigation selection.*/
|
|
7
|
+
selected?: Writable<any> | Readable<any> | undefined;
|
|
8
8
|
/** Provide classes to set the background color.*/
|
|
9
9
|
background?: string | undefined;
|
|
10
10
|
/** Provide classes to set the background color.*/
|
|
@@ -8,12 +8,19 @@ export let regionLabel = "";
|
|
|
8
8
|
export let selected = getContext("selected");
|
|
9
9
|
export let active = getContext("active");
|
|
10
10
|
export let hover = getContext("hover");
|
|
11
|
+
if ($$props.href) {
|
|
12
|
+
tag = "a";
|
|
13
|
+
if (value === void 0)
|
|
14
|
+
value = $$props.href;
|
|
15
|
+
}
|
|
11
16
|
const cBase = "unstyled grid place-content-center place-items-center w-full aspect-square space-y-1.5 cursor-pointer";
|
|
12
17
|
const cLabel = "font-bold text-xs text-center";
|
|
13
18
|
function onClickHandler(event) {
|
|
14
19
|
if (!String($selected) || !String(value))
|
|
15
20
|
return;
|
|
16
|
-
|
|
21
|
+
if (selected && "set" in selected) {
|
|
22
|
+
selected.set(value);
|
|
23
|
+
}
|
|
17
24
|
dispatch("click", event);
|
|
18
25
|
}
|
|
19
26
|
$:
|
|
@@ -30,7 +37,7 @@ function prunedRestProps() {
|
|
|
30
37
|
|
|
31
38
|
<!-- @component A navigation tile for the App Rail component. -->
|
|
32
39
|
|
|
33
|
-
<div on:click={onClickHandler} on:keydown on:keyup on:keypress>
|
|
40
|
+
<div on:click={onClickHandler} on:keydown on:keyup on:keypress data-testid="app-rail-tile">
|
|
34
41
|
<!-- IMPORTANT: avoid forwarding events on <svelte:element> tags per: -->
|
|
35
42
|
<!-- https://github.com/skeletonlabs/skeleton/issues/727#issuecomment-1356859261 -->
|
|
36
43
|
<svelte:element this={tag} {...prunedRestProps()} class="app-rail-tile {classesBase}">
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Writable } from 'svelte/store';
|
|
2
|
+
import type { Readable, Writable } from 'svelte/store';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
/** Provide a unique value, active tiles will be highlighted.*/
|
|
6
|
+
/** Provide a unique value, active tiles will be highlighted. href will be used if no value is provided.*/
|
|
7
7
|
value?: any | undefined;
|
|
8
8
|
/** Provide the element tag. Button or Anchor recommended.*/
|
|
9
9
|
tag?: string | undefined;
|
|
10
|
-
/** Provide the
|
|
10
|
+
/** Provide the visible text label.*/
|
|
11
11
|
label?: string | undefined;
|
|
12
12
|
/** Provide arbitrary classes to style the icon region.*/
|
|
13
13
|
regionIcon?: string | undefined;
|
|
14
14
|
/** Provide arbitrary classes to style the label region.*/
|
|
15
15
|
regionLabel?: string | undefined;
|
|
16
|
-
selected?: Writable<string> | undefined;
|
|
17
|
-
active?:
|
|
18
|
-
hover?:
|
|
16
|
+
selected?: Writable<string> | Readable<string> | undefined;
|
|
17
|
+
active?: string | undefined;
|
|
18
|
+
hover?: string | undefined;
|
|
19
19
|
};
|
|
20
20
|
events: {
|
|
21
21
|
keydown: KeyboardEvent;
|
|
@@ -14,7 +14,7 @@ const cSidebarRight = "flex-none overflow-x-hidden overflow-y-auto";
|
|
|
14
14
|
$:
|
|
15
15
|
classesBase = `${cBaseAppShell} ${$$props.class ?? ""}`;
|
|
16
16
|
$:
|
|
17
|
-
|
|
17
|
+
classesHeader = `${slotHeader}`;
|
|
18
18
|
$:
|
|
19
19
|
classesSidebarLeft = `${cSidebarLeft} ${slotSidebarLeft}`;
|
|
20
20
|
$:
|
|
@@ -32,7 +32,7 @@ $:
|
|
|
32
32
|
<div id="appShell" class={classesBase} data-testid="app-shell">
|
|
33
33
|
<!-- Slot: Header -->
|
|
34
34
|
{#if $$slots.header}
|
|
35
|
-
<header id="shell-header" class="flex-none {
|
|
35
|
+
<header id="shell-header" class="flex-none {classesHeader}"><slot name="header" /></header>
|
|
36
36
|
{/if}
|
|
37
37
|
|
|
38
38
|
<!-- Content Area -->
|
|
@@ -2,21 +2,21 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
/** Apply arbitrary
|
|
5
|
+
/** Apply arbitrary classes to the entire `#page` region.*/
|
|
6
6
|
regionPage?: string | undefined;
|
|
7
|
-
/** Apply arbitrary
|
|
7
|
+
/** Apply arbitrary classes to the `header` slot container element*/
|
|
8
8
|
slotHeader?: string | undefined;
|
|
9
|
-
/** Apply arbitrary
|
|
9
|
+
/** Apply arbitrary classes to the `sidebarLeft` slot container element*/
|
|
10
10
|
slotSidebarLeft?: string | undefined;
|
|
11
|
-
/** Apply arbitrary
|
|
11
|
+
/** Apply arbitrary classes to the `sidebarRight` slot container element*/
|
|
12
12
|
slotSidebarRight?: string | undefined;
|
|
13
|
-
/** Apply arbitrary
|
|
13
|
+
/** Apply arbitrary classes to the `pageHeader` slot container element*/
|
|
14
14
|
slotPageHeader?: string | undefined;
|
|
15
|
-
/** Apply arbitrary
|
|
15
|
+
/** Apply arbitrary classes to the `pageContent` slot container element*/
|
|
16
16
|
slotPageContent?: string | undefined;
|
|
17
|
-
/** Apply arbitrary
|
|
17
|
+
/** Apply arbitrary classes to the `pageFooter` slot container element*/
|
|
18
18
|
slotPageFooter?: string | undefined;
|
|
19
|
-
/** Apply arbitrary
|
|
19
|
+
/** Apply arbitrary classes to the `footer` slot container element*/
|
|
20
20
|
slotFooter?: string | undefined;
|
|
21
21
|
};
|
|
22
22
|
events: {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
-
import { slide } from "svelte/transition";
|
|
3
|
-
import { flip } from "svelte/animate";
|
|
4
2
|
const dispatch = createEventDispatcher();
|
|
5
3
|
export let input = void 0;
|
|
6
4
|
export let options = [];
|
|
5
|
+
export let limit = void 0;
|
|
7
6
|
export let allowlist = [];
|
|
8
7
|
export let denylist = [];
|
|
9
8
|
export let emptyState = "No Results Found.";
|
|
10
|
-
export let duration = 200;
|
|
11
9
|
export let regionNav = "";
|
|
12
10
|
export let regionList = "list-nav";
|
|
13
11
|
export let regionItem = "";
|
|
@@ -15,7 +13,8 @@ export let regionButton = "w-full";
|
|
|
15
13
|
export let regionEmpty = "text-center";
|
|
16
14
|
export let whitelist = [];
|
|
17
15
|
export let blacklist = [];
|
|
18
|
-
|
|
16
|
+
export let duration = 200;
|
|
17
|
+
const deprecated = [whitelist, blacklist, duration];
|
|
19
18
|
let listedOptions = options;
|
|
20
19
|
function filterByAllowed() {
|
|
21
20
|
if (allowlist.length) {
|
|
@@ -54,7 +53,9 @@ $:
|
|
|
54
53
|
$:
|
|
55
54
|
optionsFiltered = input ? filterOptions() : listedOptions;
|
|
56
55
|
$:
|
|
57
|
-
|
|
56
|
+
sliceLimit = limit !== void 0 ? limit : optionsFiltered.length;
|
|
57
|
+
$:
|
|
58
|
+
classesBase = `${$$props.class ?? ""}`;
|
|
58
59
|
$:
|
|
59
60
|
classesNav = `${regionNav}`;
|
|
60
61
|
$:
|
|
@@ -64,15 +65,16 @@ $:
|
|
|
64
65
|
$:
|
|
65
66
|
classesButton = `${regionButton}`;
|
|
66
67
|
$:
|
|
67
|
-
|
|
68
|
+
classesEmpty = `${regionEmpty}`;
|
|
68
69
|
</script>
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
<!-- animate:flip={{ duration }} transition:slide|local={{ duration }} -->
|
|
72
|
+
<div class="autocomplete {classesBase}" data-testid="autocomplete">
|
|
71
73
|
{#if optionsFiltered.length > 0}
|
|
72
74
|
<nav class="autocomplete-nav {classesNav}">
|
|
73
75
|
<ul class="autocomplete-list {classesList}">
|
|
74
|
-
{#each optionsFiltered as option, i (option)}
|
|
75
|
-
<li class="autocomplete-item {classesItem}"
|
|
76
|
+
{#each optionsFiltered.slice(0, sliceLimit) as option, i (option)}
|
|
77
|
+
<li class="autocomplete-item {classesItem}">
|
|
76
78
|
<button class="autocomplete-button {classesButton}" type="button" on:click={() => onSelection(option)} on:click on:keypress>
|
|
77
79
|
{@html option.label}
|
|
78
80
|
</button>
|
|
@@ -81,6 +83,6 @@ $:
|
|
|
81
83
|
</ul>
|
|
82
84
|
</nav>
|
|
83
85
|
{:else}
|
|
84
|
-
<div class="autocomplete-empty {
|
|
86
|
+
<div class="autocomplete-empty {classesEmpty}">{emptyState}</div>
|
|
85
87
|
{/if}
|
|
86
88
|
</div>
|
|
@@ -5,16 +5,16 @@ declare const __propDef: {
|
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
/** Bind the input value.*/
|
|
7
7
|
input?: unknown;
|
|
8
|
-
/** Define values for the list
|
|
8
|
+
/** Define values for the list.*/
|
|
9
9
|
options?: AutocompleteOption[] | undefined;
|
|
10
|
-
/**
|
|
10
|
+
/** Limit the total number of suggestions.*/
|
|
11
|
+
limit?: number | undefined;
|
|
12
|
+
/** Provide allowlist values.*/
|
|
11
13
|
allowlist?: unknown[] | undefined;
|
|
12
|
-
/** Provide denylist values
|
|
14
|
+
/** Provide denylist values.*/
|
|
13
15
|
denylist?: unknown[] | undefined;
|
|
14
16
|
/** Provide a HTML markup to display when no match is found.*/
|
|
15
17
|
emptyState?: string | undefined;
|
|
16
|
-
/** Set the animation duration. Use zero to disable.*/
|
|
17
|
-
duration?: number | undefined;
|
|
18
18
|
/** Provide arbitrary classes to nav element.*/
|
|
19
19
|
regionNav?: string | undefined;
|
|
20
20
|
/** Provide arbitrary classes to each list.*/
|
|
@@ -29,6 +29,8 @@ declare const __propDef: {
|
|
|
29
29
|
whitelist?: unknown[] | undefined;
|
|
30
30
|
/** DEPRECATED: replace with denylist*/
|
|
31
31
|
blacklist?: unknown[] | undefined;
|
|
32
|
+
/** DEPRECATED: Set the animation duration. Use zero to disable.*/
|
|
33
|
+
duration?: number | undefined;
|
|
32
34
|
};
|
|
33
35
|
events: {
|
|
34
36
|
click: MouseEvent;
|
|
@@ -3,7 +3,7 @@ export interface AutocompleteOption {
|
|
|
3
3
|
label: string;
|
|
4
4
|
/** Provide a unique option value. */
|
|
5
5
|
value: unknown;
|
|
6
|
-
/** Provide a comma
|
|
6
|
+
/** Provide a comma separated list of keywords. */
|
|
7
7
|
keywords?: any;
|
|
8
8
|
/** Pass arbitrary data per option. */
|
|
9
9
|
meta?: any;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>export let initials = "AB";
|
|
2
2
|
export let fill = "fill-token";
|
|
3
3
|
export let src = "";
|
|
4
|
+
export let fallback = "";
|
|
4
5
|
export let action = () => {
|
|
5
6
|
};
|
|
6
7
|
export let actionParams = "";
|
|
@@ -22,7 +23,15 @@ function prunedRestProps() {
|
|
|
22
23
|
|
|
23
24
|
<figure class="avatar {classesBase}" data-testid="avatar" on:click on:keydown on:keyup on:keypress>
|
|
24
25
|
{#if src}
|
|
25
|
-
<img
|
|
26
|
+
<img
|
|
27
|
+
class="avatar-image {cImage}"
|
|
28
|
+
style={$$props.style ?? ''}
|
|
29
|
+
{src}
|
|
30
|
+
alt={$$props.alt || ''}
|
|
31
|
+
use:action={actionParams}
|
|
32
|
+
on:error={() => (src = fallback)}
|
|
33
|
+
{...prunedRestProps()}
|
|
34
|
+
/>
|
|
26
35
|
{:else}
|
|
27
36
|
<svg class="avatar-initials w-full h-full" viewBox="0 0 512 512">
|
|
28
37
|
<text x="50%" y="50%" dominant-baseline="central" text-anchor="middle" font-weight="bold" font-size={150} class="avatar-text {fill}">
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
fill?: string | undefined;
|
|
9
9
|
/** Provide the avatar image element source.*/
|
|
10
10
|
src?: string | undefined;
|
|
11
|
+
/** Provide the fallback image element source.*/
|
|
12
|
+
fallback?: string | undefined;
|
|
11
13
|
/** Image only. Provide an Svelte action reference, such as `filter`.*/
|
|
12
14
|
action?: any;
|
|
13
15
|
/** Image only. Provide Svelte action params, such as Apollo.*/
|
|
@@ -50,8 +50,10 @@ function validate() {
|
|
|
50
50
|
function addChip(event) {
|
|
51
51
|
event.preventDefault();
|
|
52
52
|
inputValid = validate();
|
|
53
|
-
if (inputValid === false)
|
|
53
|
+
if (inputValid === false) {
|
|
54
|
+
dispatch("invalid", { event, input });
|
|
54
55
|
return;
|
|
56
|
+
}
|
|
55
57
|
input = allowUpperCase ? input : input.toLowerCase();
|
|
56
58
|
value.push(input);
|
|
57
59
|
value = value;
|
|
@@ -106,6 +108,8 @@ $:
|
|
|
106
108
|
class="input-chip-field {classesInputField}"
|
|
107
109
|
on:input={onInputHandler}
|
|
108
110
|
on:input
|
|
111
|
+
on:focus
|
|
112
|
+
on:blur
|
|
109
113
|
disabled={$$restProps.disabled}
|
|
110
114
|
/>
|
|
111
115
|
</form>
|
|
@@ -20,7 +20,7 @@ declare const __propDef: {
|
|
|
20
20
|
allowUpperCase?: boolean | undefined;
|
|
21
21
|
/** When enabled, allows for duplicate values.*/
|
|
22
22
|
allowDuplicates?: boolean | undefined;
|
|
23
|
-
/** Provide a custom
|
|
23
|
+
/** Provide a custom validator function.*/
|
|
24
24
|
validation?: ((...args: any[]) => boolean) | undefined;
|
|
25
25
|
/** The duration of the animated fly effect.*/
|
|
26
26
|
duration?: number | undefined;
|
|
@@ -28,7 +28,7 @@ declare const __propDef: {
|
|
|
28
28
|
required?: boolean | undefined;
|
|
29
29
|
/** Provide classes or a variant to style the chips.*/
|
|
30
30
|
chips?: string | undefined;
|
|
31
|
-
/**
|
|
31
|
+
/** {{ event: Event, input: any }} invalid - Fires when the input value is invalid.*/
|
|
32
32
|
invalid?: string | undefined;
|
|
33
33
|
/** Provide classes to set padding styles.*/
|
|
34
34
|
padding?: string | undefined;
|
|
@@ -38,6 +38,8 @@ declare const __propDef: {
|
|
|
38
38
|
events: {
|
|
39
39
|
/** Bind the input value.*/
|
|
40
40
|
input: Event;
|
|
41
|
+
focus: FocusEvent;
|
|
42
|
+
blur: FocusEvent;
|
|
41
43
|
click: MouseEvent;
|
|
42
44
|
keypress: KeyboardEvent;
|
|
43
45
|
keydown: KeyboardEvent;
|
|
@@ -4,7 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
/** Enable selection of multiple items.*/
|
|
6
6
|
multiple?: boolean | undefined;
|
|
7
|
-
/** Provide
|
|
7
|
+
/** Provide class to set the vertical spacing style.*/
|
|
8
8
|
spacing?: string | undefined;
|
|
9
9
|
/** Provide classes to set the listbox box radius styles.*/
|
|
10
10
|
rounded?: string | undefined;
|
|
@@ -8,7 +8,7 @@ export let active = getContext("active");
|
|
|
8
8
|
export let hover = getContext("hover");
|
|
9
9
|
export let padding = getContext("padding");
|
|
10
10
|
const cBase = "cursor-pointer -outline-offset-[3px]";
|
|
11
|
-
const cLabel = "flex space-x-4";
|
|
11
|
+
const cLabel = "flex items-center space-x-4";
|
|
12
12
|
let checked;
|
|
13
13
|
let elemInput;
|
|
14
14
|
$:
|
|
@@ -15,7 +15,7 @@ declare const __propDef: {
|
|
|
15
15
|
text?: string | undefined;
|
|
16
16
|
/** Set the text for the amount selection input.*/
|
|
17
17
|
amountText?: string | undefined;
|
|
18
|
-
/** Provide
|
|
18
|
+
/** Provide arbitrary classes to the next/previous buttons.*/
|
|
19
19
|
buttonClasses?: string | undefined;
|
|
20
20
|
/** Set the text label for the Previous button.*/
|
|
21
21
|
buttonTextPrevious?: string | undefined;
|
|
@@ -13,11 +13,11 @@ $:
|
|
|
13
13
|
$:
|
|
14
14
|
indeterminate = value === void 0 || value < 0;
|
|
15
15
|
$:
|
|
16
|
-
|
|
16
|
+
classesIndeterminate = indeterminate ? "animIndeterminate" : "";
|
|
17
17
|
$:
|
|
18
18
|
classesTrack = `${cTrack} ${height} ${rounded} ${track} ${$$props.class ?? ""}`;
|
|
19
19
|
$:
|
|
20
|
-
classesMeter = `${cMeter} ${rounded} ${
|
|
20
|
+
classesMeter = `${cMeter} ${rounded} ${classesIndeterminate} ${meter}`;
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<!-- Track -->
|
|
@@ -25,7 +25,8 @@ const cBase = "space-y-4";
|
|
|
25
25
|
const cHeader = "text-2xl font-bold";
|
|
26
26
|
const cContent = "space-y-4";
|
|
27
27
|
const cNavigation = "flex";
|
|
28
|
-
function onNext() {
|
|
28
|
+
async function onNext() {
|
|
29
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
29
30
|
if (locked)
|
|
30
31
|
return;
|
|
31
32
|
$state.current++;
|
|
@@ -16,6 +16,38 @@ function onKeyDown(event) {
|
|
|
16
16
|
if (["Enter", "Space"].includes(event.code)) {
|
|
17
17
|
event.preventDefault();
|
|
18
18
|
elemInput.click();
|
|
19
|
+
} else if (event.code === "ArrowRight") {
|
|
20
|
+
const tabList = elemInput.closest(".tab-list");
|
|
21
|
+
if (!tabList)
|
|
22
|
+
return;
|
|
23
|
+
const tabs = Array.from(tabList.querySelectorAll(".tab"));
|
|
24
|
+
const currTab = elemInput.closest(".tab");
|
|
25
|
+
if (!currTab)
|
|
26
|
+
return;
|
|
27
|
+
const currIndex = tabs.indexOf(currTab);
|
|
28
|
+
const nextIndex = currIndex + 1 >= tabs.length ? 0 : currIndex + 1;
|
|
29
|
+
const nextTab = tabs[nextIndex];
|
|
30
|
+
const nextTabInput = nextTab?.querySelector("input");
|
|
31
|
+
if (nextTab && nextTabInput) {
|
|
32
|
+
nextTabInput.click();
|
|
33
|
+
nextTab.focus();
|
|
34
|
+
}
|
|
35
|
+
} else if (event.code === "ArrowLeft") {
|
|
36
|
+
const tabList = elemInput.closest(".tab-list");
|
|
37
|
+
if (!tabList)
|
|
38
|
+
return;
|
|
39
|
+
const tabs = Array.from(tabList.querySelectorAll(".tab"));
|
|
40
|
+
const currTab = elemInput.closest(".tab");
|
|
41
|
+
if (!currTab)
|
|
42
|
+
return;
|
|
43
|
+
const currIndex = tabs.indexOf(currTab);
|
|
44
|
+
const nextIndex = currIndex - 1 < 0 ? tabs.length - 1 : currIndex - 1;
|
|
45
|
+
const nextTab = tabs[nextIndex];
|
|
46
|
+
const nextTabInput = nextTab?.querySelector("input");
|
|
47
|
+
if (nextTab && nextTabInput) {
|
|
48
|
+
nextTabInput.click();
|
|
49
|
+
nextTab.focus();
|
|
50
|
+
}
|
|
19
51
|
}
|
|
20
52
|
}
|
|
21
53
|
$:
|
|
@@ -40,7 +72,7 @@ function prunedRestProps() {
|
|
|
40
72
|
role="tab"
|
|
41
73
|
aria-controls={controls}
|
|
42
74
|
aria-selected={selected}
|
|
43
|
-
tabindex=
|
|
75
|
+
tabindex={selected ? 0 : -1}
|
|
44
76
|
on:keydown={onKeyDown}
|
|
45
77
|
on:keydown
|
|
46
78
|
on:keyup
|
|
@@ -18,7 +18,7 @@ setContext("padding", padding);
|
|
|
18
18
|
setContext("rounded", rounded);
|
|
19
19
|
setContext("spacing", spacing);
|
|
20
20
|
const cBase = "space-y-4";
|
|
21
|
-
const cList = "flex overflow-x-auto hide-
|
|
21
|
+
const cList = "flex overflow-x-auto hide-scrollbar";
|
|
22
22
|
const cPanel = "";
|
|
23
23
|
$:
|
|
24
24
|
classesBase = `${cBase} ${$$props.class ?? ""}`;
|
|
@@ -35,6 +35,8 @@ $:
|
|
|
35
35
|
</div>
|
|
36
36
|
<!-- Tab Panel -->
|
|
37
37
|
{#if $$slots.panel}
|
|
38
|
-
<div class="tab-panel {classesPanel}" role="tabpanel" aria-labelledby={panel}
|
|
38
|
+
<div class="tab-panel {classesPanel}" role="tabpanel" aria-labelledby={panel} tabindex="0">
|
|
39
|
+
<slot name="panel" />
|
|
40
|
+
</div>
|
|
39
41
|
{/if}
|
|
40
42
|
</div>
|
|
@@ -54,12 +54,12 @@ function scrollToHeading(headingElem) {
|
|
|
54
54
|
elemTarget.scrollIntoView({ behavior: "smooth" });
|
|
55
55
|
}
|
|
56
56
|
function pageScrollHandler() {
|
|
57
|
-
const
|
|
57
|
+
const headingSizeThreshold = 40;
|
|
58
58
|
let visibleHeadings = [];
|
|
59
59
|
allowedHeadingsList?.forEach((header) => {
|
|
60
60
|
const scrollableTop = elemScrollParent?.getBoundingClientRect().top || 0;
|
|
61
61
|
const headerBoundTop = header.getBoundingClientRect().top;
|
|
62
|
-
const offsetTop = headerBoundTop - scrollableTop +
|
|
62
|
+
const offsetTop = headerBoundTop - scrollableTop + headingSizeThreshold;
|
|
63
63
|
if (offsetTop >= 0)
|
|
64
64
|
visibleHeadings.push(header);
|
|
65
65
|
});
|
|
@@ -4,6 +4,7 @@ import { storeHighlightJs } from "./stores";
|
|
|
4
4
|
import { clipboard } from "../../actions/Clipboard/clipboard";
|
|
5
5
|
export let language = "plaintext";
|
|
6
6
|
export let code = "";
|
|
7
|
+
export let lineNumbers = false;
|
|
7
8
|
export let background = "bg-neutral-900/90";
|
|
8
9
|
export let blur = "";
|
|
9
10
|
export let text = "text-sm";
|
|
@@ -38,23 +39,29 @@ $:
|
|
|
38
39
|
displayCode = $storeHighlightJs.highlight(code, { language }).value.trim();
|
|
39
40
|
formatted = true;
|
|
40
41
|
}
|
|
42
|
+
$:
|
|
43
|
+
if (lineNumbers) {
|
|
44
|
+
displayCode = displayCode.replace(/^/gm, () => {
|
|
45
|
+
return '<span class="line"></span> ';
|
|
46
|
+
});
|
|
47
|
+
}
|
|
41
48
|
$:
|
|
42
49
|
classesBase = `${cBase} ${background} ${blur} ${text} ${color} ${rounded} ${shadow} ${$$props.class ?? ""}`;
|
|
43
50
|
</script>
|
|
44
51
|
|
|
45
52
|
<!-- prettier-ignore -->
|
|
46
53
|
{#if language && code}
|
|
47
|
-
<div class="
|
|
54
|
+
<div class="codeblock {classesBase}" data-testid="codeblock">
|
|
48
55
|
<!-- Header -->
|
|
49
|
-
<header class="
|
|
56
|
+
<header class="codeblock-header {cHeader}">
|
|
50
57
|
<!-- Language -->
|
|
51
|
-
<span class="
|
|
58
|
+
<span class="codeblock-language">{languageFormatter(language)}</span>
|
|
52
59
|
<!-- Copy Button -->
|
|
53
|
-
<button class="
|
|
60
|
+
<button class="codeblock-btn {button}" on:click={onCopyClick} use:clipboard={code}>
|
|
54
61
|
{!copyState ? buttonLabel : buttonCopied}
|
|
55
62
|
</button>
|
|
56
63
|
</header>
|
|
57
64
|
<!-- Pre/Code -->
|
|
58
|
-
<pre class="
|
|
65
|
+
<pre class="codeblock-pre {cPre}"><code class="codeblock-code language-{language} lineNumbers">{#if formatted}{@html displayCode}{:else}{code.trim()}{/if}</code></pre>
|
|
59
66
|
</div>
|
|
60
67
|
{/if}
|
|
@@ -6,6 +6,8 @@ declare const __propDef: {
|
|
|
6
6
|
language?: string | undefined;
|
|
7
7
|
/** Provide the code snippet to render. Be mindful to escape as needed!*/
|
|
8
8
|
code?: string | undefined;
|
|
9
|
+
/** Specify if line numbers should be added to the code block*/
|
|
10
|
+
lineNumbers?: boolean | undefined;
|
|
9
11
|
/** Provide classes to set the background color.*/
|
|
10
12
|
background?: string | undefined;
|
|
11
13
|
/** Provided classes to set the backdrop blur.*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import { fade, fly } from "svelte/transition";
|
|
2
|
-
import { createEventDispatcher
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
import { BROWSER } from "esm-env";
|
|
3
4
|
const dispatch = createEventDispatcher();
|
|
4
5
|
import { focusTrap } from "../../actions/FocusTrap/focusTrap";
|
|
5
6
|
import { drawerStore } from "./stores";
|
|
@@ -65,7 +66,7 @@ function applyPropSettings(settings) {
|
|
|
65
66
|
describedby = settings.describedby || propDefaults.describedby;
|
|
66
67
|
}
|
|
67
68
|
function applyAnimationSettings() {
|
|
68
|
-
if (
|
|
69
|
+
if (!BROWSER)
|
|
69
70
|
return;
|
|
70
71
|
switch (position) {
|
|
71
72
|
case "top":
|