@skeletonlabs/skeleton 1.1.0 → 1.2.5
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/{actions → dist/actions}/Clipboard/clipboard.js +1 -1
- package/{actions → dist/actions}/Filters/svg-filters/Emerald.svelte +1 -1
- package/{actions → dist/actions}/FocusTrap/focusTrap.js +3 -3
- package/{components → dist/components}/Accordion/Accordion.svelte +2 -0
- package/{components → dist/components}/Accordion/Accordion.svelte.d.ts +2 -0
- package/{components → dist/components}/Accordion/AccordionItem.svelte +2 -0
- package/{components → dist/components}/Accordion/AccordionItem.svelte.d.ts +2 -0
- package/{components → dist/components}/AppRail/AppRailTile.svelte +2 -2
- package/{components → dist/components}/AppRail/AppRailTile.svelte.d.ts +1 -1
- package/{components → dist/components}/AppShell/AppShell.svelte +2 -2
- package/{components → dist/components}/AppShell/AppShell.svelte.d.ts +8 -8
- package/{components → dist/components}/Autocomplete/Autocomplete.svelte +29 -23
- package/{components → dist/components}/Autocomplete/Autocomplete.svelte.d.ts +10 -6
- package/{components → dist/components}/Autocomplete/types.d.ts +1 -1
- package/{components → dist/components}/Avatar/Avatar.svelte +1 -1
- package/{components → dist/components}/InputChip/InputChip.svelte +27 -8
- package/{components → dist/components}/InputChip/InputChip.svelte.d.ts +4 -2
- package/{components → dist/components}/ListBox/ListBox.svelte +1 -1
- package/{components → dist/components}/ListBox/ListBox.svelte.d.ts +1 -1
- package/{components → dist/components}/ListBox/ListBoxItem.svelte +31 -29
- package/{components → dist/components}/Paginator/Paginator.svelte.d.ts +1 -1
- package/{components → dist/components}/ProgressBar/ProgressBar.svelte +2 -2
- package/{components → dist/components}/Radio/RadioItem.svelte +20 -18
- package/{components → dist/components}/RangeSlider/RangeSlider.svelte +4 -2
- package/{components → dist/components}/RangeSlider/RangeSlider.svelte.d.ts +1 -1
- package/{components → dist/components}/SlideToggle/SlideToggle.svelte.d.ts +1 -1
- package/{components → dist/components}/Stepper/Step.svelte +2 -1
- package/{components → dist/components}/Tab/Tab.svelte +24 -22
- package/{components → dist/components}/Tab/TabGroup.svelte +1 -1
- package/{components → dist/components}/Table/Table.svelte +4 -2
- package/{components → dist/components}/Table/Table.svelte.d.ts +4 -0
- package/{components → dist/components}/TableOfContents/TableOfContents.svelte +2 -2
- package/{utilities → dist/utilities}/DataTable/actions.js +1 -1
- package/{utilities → dist/utilities}/Drawer/Drawer.svelte +1 -1
- package/{utilities → dist/utilities}/Modal/Modal.svelte +15 -6
- package/{utilities → dist/utilities}/Popup/popup.js +19 -13
- package/{utilities → dist/utilities}/Popup/types.d.ts +2 -2
- package/{utilities → dist/utilities}/Toast/Toast.svelte +20 -4
- package/{utilities → dist/utilities}/Toast/stores.js +15 -9
- package/{utilities → dist/utilities}/Toast/types.d.ts +2 -0
- package/package.json +108 -171
- package/{styles → src/lib/styles}/core.css +1 -0
- package/{styles → src/lib/styles}/elements/buttons.css +8 -4
- package/{styles → src/lib/styles}/elements/forms.css +1 -1
- package/{styles → src/lib/styles}/elements/lists.css +3 -1
- package/{styles → src/lib/styles}/tailwind.css +1 -1
- package/{styles → src/lib/styles}/variants.css +1 -1
- package/src/lib/tailwind/.DS_Store +0 -0
- package/src/lib/tailwind/generated/intellisense-classes.cjs +1 -0
- package/src/lib/themes/theme-test.css +96 -0
- package/fonts/quicksand/Quicksand-VariableFont_wght.ttf +0 -0
- package/tailwind/core.d.cts +0 -5
- package/tailwind/generated/intellisense-classes.cjs +0 -1
- package/tailwind/generated/intellisense-classes.d.cts +0 -2069
- package/tailwind/intellisense.d.cts +0 -5
- package/tailwind/settings.d.cts +0 -6
- package/tailwind/skeleton.d.cts +0 -7
- package/tailwind/theme/colors.d.cts +0 -2
- package/tailwind/tokens/backgrounds.d.cts +0 -2
- package/tailwind/tokens/border-radius.d.cts +0 -33
- package/tailwind/tokens/borders.d.cts +0 -6
- package/tailwind/tokens/fills.d.cts +0 -15
- package/tailwind/tokens/rings.d.cts +0 -22
- package/tailwind/tokens/text.d.cts +0 -21
- package/{actions → dist/actions}/Clipboard/clipboard.d.ts +0 -0
- package/{actions → dist/actions}/Filters/filter.d.ts +0 -0
- package/{actions → dist/actions}/Filters/filter.js +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Apollo.svelte +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Apollo.svelte.d.ts +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/BlueNight.svelte +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/BlueNight.svelte.d.ts +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Emerald.svelte.d.ts +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/GreenFall.svelte +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/GreenFall.svelte.d.ts +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Noir.svelte +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Noir.svelte.d.ts +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/NoirLight.svelte +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/NoirLight.svelte.d.ts +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Rustic.svelte +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Rustic.svelte.d.ts +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Summer84.svelte +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/Summer84.svelte.d.ts +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/XPro.svelte +0 -0
- package/{actions → dist/actions}/Filters/svg-filters/XPro.svelte.d.ts +0 -0
- package/{actions → dist/actions}/FocusTrap/focusTrap.d.ts +0 -0
- package/{components → dist/components}/AppBar/AppBar.svelte +0 -0
- package/{components → dist/components}/AppBar/AppBar.svelte.d.ts +0 -0
- package/{components → dist/components}/AppRail/AppRail.svelte +0 -0
- package/{components → dist/components}/AppRail/AppRail.svelte.d.ts +0 -0
- package/{components → dist/components}/Autocomplete/types.js +0 -0
- package/{components → dist/components}/Avatar/Avatar.svelte.d.ts +0 -0
- package/{components → dist/components}/ConicGradient/ConicGradient.svelte +0 -0
- package/{components → dist/components}/ConicGradient/ConicGradient.svelte.d.ts +0 -0
- package/{components → dist/components}/ConicGradient/settings.d.ts +0 -0
- package/{components → dist/components}/ConicGradient/settings.js +0 -0
- package/{components → dist/components}/ConicGradient/types.d.ts +0 -0
- package/{components → dist/components}/ConicGradient/types.js +0 -0
- package/{components → dist/components}/FileButton/FileButton.svelte +0 -0
- package/{components → dist/components}/FileButton/FileButton.svelte.d.ts +0 -0
- package/{components → dist/components}/FileDropzone/FileDropzone.svelte +0 -0
- package/{components → dist/components}/FileDropzone/FileDropzone.svelte.d.ts +0 -0
- package/{components → dist/components}/ListBox/ListBoxItem.svelte.d.ts +0 -0
- package/{components → dist/components}/Paginator/Paginator.svelte +0 -0
- package/{components → dist/components}/Paginator/types.d.ts +0 -0
- package/{components → dist/components}/Paginator/types.js +0 -0
- package/{components → dist/components}/ProgressBar/ProgressBar.svelte.d.ts +0 -0
- package/{components → dist/components}/ProgressRadial/ProgressRadial.svelte +0 -0
- package/{components → dist/components}/ProgressRadial/ProgressRadial.svelte.d.ts +0 -0
- package/{components → dist/components}/Radio/RadioGroup.svelte +0 -0
- package/{components → dist/components}/Radio/RadioGroup.svelte.d.ts +0 -0
- package/{components → dist/components}/Radio/RadioItem.svelte.d.ts +0 -0
- package/{components → dist/components}/SlideToggle/SlideToggle.svelte +0 -0
- package/{components → dist/components}/Stepper/Step.svelte.d.ts +0 -0
- package/{components → dist/components}/Stepper/Stepper.svelte +0 -0
- package/{components → dist/components}/Stepper/Stepper.svelte.d.ts +0 -0
- package/{components → dist/components}/Tab/Tab.svelte.d.ts +1 -1
- package/{components → dist/components}/Tab/TabGroup.svelte.d.ts +0 -0
- package/{components → dist/components}/Table/types.d.ts +0 -0
- package/{components → dist/components}/Table/types.js +0 -0
- package/{components → dist/components}/Table/utils.d.ts +0 -0
- package/{components → dist/components}/Table/utils.js +0 -0
- package/{components → dist/components}/TableOfContents/TableOfContents.svelte.d.ts +0 -0
- package/{index.d.ts → dist/index.d.ts} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/{types → dist/types}/index.js +0 -0
- package/{types → dist/types}/tailwind.d.ts +0 -0
- package/{types → dist/types}/tailwind.js +0 -0
- package/{utilities → dist/utilities}/CodeBlock/CodeBlock.svelte +0 -0
- package/{utilities → dist/utilities}/CodeBlock/CodeBlock.svelte.d.ts +0 -0
- package/{utilities → dist/utilities}/CodeBlock/stores.d.ts +0 -0
- package/{utilities → dist/utilities}/CodeBlock/stores.js +0 -0
- package/{utilities → dist/utilities}/DataTable/DataTable.d.ts +0 -0
- package/{utilities → dist/utilities}/DataTable/DataTable.js +0 -0
- package/{utilities → dist/utilities}/DataTable/actions.d.ts +0 -0
- package/{utilities → dist/utilities}/DataTable/types.d.ts +0 -0
- package/{utilities → dist/utilities}/DataTable/types.js +0 -0
- package/{utilities → dist/utilities}/Drawer/Drawer.svelte.d.ts +0 -0
- package/{utilities → dist/utilities}/Drawer/stores.d.ts +0 -0
- package/{utilities → dist/utilities}/Drawer/stores.js +0 -0
- package/{utilities → dist/utilities}/Drawer/types.d.ts +0 -0
- package/{utilities → dist/utilities}/Drawer/types.js +0 -0
- package/{utilities → dist/utilities}/LightSwitch/LightSwitch.svelte +0 -0
- package/{utilities → dist/utilities}/LightSwitch/LightSwitch.svelte.d.ts +0 -0
- package/{utilities → dist/utilities}/LightSwitch/lightswitch.d.ts +0 -0
- package/{utilities → dist/utilities}/LightSwitch/lightswitch.js +0 -0
- package/{utilities → dist/utilities}/LocalStorageStore/LocalStorageStore.d.ts +0 -0
- package/{utilities → dist/utilities}/LocalStorageStore/LocalStorageStore.js +0 -0
- package/{utilities → dist/utilities}/Modal/Modal.svelte.d.ts +0 -0
- package/{utilities → dist/utilities}/Modal/stores.d.ts +0 -0
- package/{utilities → dist/utilities}/Modal/stores.js +0 -0
- package/{utilities → dist/utilities}/Modal/types.d.ts +0 -0
- package/{utilities → dist/utilities}/Modal/types.js +0 -0
- package/{utilities → dist/utilities}/Popup/popup.d.ts +0 -0
- package/{utilities → dist/utilities}/Popup/types.js +0 -0
- package/{utilities → dist/utilities}/Toast/Toast.svelte.d.ts +0 -0
- package/{utilities → dist/utilities}/Toast/stores.d.ts +0 -0
- package/{utilities → dist/utilities}/Toast/types.js +0 -0
- package/{styles → src/lib/styles}/all.css +0 -0
- package/{styles → src/lib/styles}/elements/alerts.css +0 -0
- package/{styles → src/lib/styles}/elements/badges.css +0 -0
- package/{styles → src/lib/styles}/elements/breadcrumbs.css +0 -0
- package/{styles → src/lib/styles}/elements/cards.css +0 -0
- package/{styles → src/lib/styles}/elements/chips.css +0 -0
- package/{styles → src/lib/styles}/elements/logo-clouds.css +0 -0
- package/{styles → src/lib/styles}/elements/modals.css +0 -0
- package/{styles → src/lib/styles}/elements/placeholders.css +0 -0
- package/{styles → src/lib/styles}/elements/popups.css +0 -0
- package/{styles → src/lib/styles}/elements/tables.css +2 -2
- /package/{styles → src/lib/styles}/elements.css +0 -0
- /package/{styles → src/lib/styles}/highlight-js.css +0 -0
- /package/{styles → src/lib/styles}/typography.css +0 -0
- /package/{tailwind → src/lib/tailwind}/core.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/intellisense.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/settings.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/skeleton.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/theme/colors.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/tokens/backgrounds.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/tokens/border-radius.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/tokens/borders.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/tokens/fills.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/tokens/rings.cjs +0 -0
- /package/{tailwind → src/lib/tailwind}/tokens/text.cjs +0 -0
- /package/{themes → src/lib/themes}/theme-crimson.css +0 -0
- /package/{themes → src/lib/themes}/theme-gold-nouveau.css +0 -0
- /package/{themes → src/lib/themes}/theme-hamlindigo.css +0 -0
- /package/{themes → src/lib/themes}/theme-modern.css +0 -0
- /package/{themes → src/lib/themes}/theme-rocket.css +0 -0
- /package/{themes → src/lib/themes}/theme-sahara.css +0 -0
- /package/{themes → src/lib/themes}/theme-seafoam.css +0 -0
- /package/{themes → src/lib/themes}/theme-seasonal.css +0 -0
- /package/{themes → src/lib/themes}/theme-skeleton.css +0 -0
- /package/{themes → src/lib/themes}/theme-vintage.css +0 -0
|
@@ -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"
|
|
@@ -34,7 +34,7 @@ export function focusTrap(node, enabled) {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
onInit();
|
|
37
|
-
function
|
|
37
|
+
function onDestroy() {
|
|
38
38
|
if (elemFirst)
|
|
39
39
|
elemFirst.removeEventListener('keydown', onFirstElemKeydown);
|
|
40
40
|
if (elemLast)
|
|
@@ -44,10 +44,10 @@ export function focusTrap(node, enabled) {
|
|
|
44
44
|
return {
|
|
45
45
|
update(newArgs) {
|
|
46
46
|
enabled = newArgs;
|
|
47
|
-
newArgs ? onInit() :
|
|
47
|
+
newArgs ? onInit() : onDestroy();
|
|
48
48
|
},
|
|
49
49
|
destroy() {
|
|
50
|
-
|
|
50
|
+
onDestroy();
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
}
|
|
@@ -3,6 +3,7 @@ import { setContext } from "svelte";
|
|
|
3
3
|
export let autocollapse = false;
|
|
4
4
|
export let duration = 200;
|
|
5
5
|
export let spacing = "space-y-1";
|
|
6
|
+
export let disabled = false;
|
|
6
7
|
export let padding = "py-2 px-4";
|
|
7
8
|
export let hover = "hover:bg-primary-hover-token";
|
|
8
9
|
export let rounded = "rounded-container-token";
|
|
@@ -15,6 +16,7 @@ const active = writable(null);
|
|
|
15
16
|
setContext("active", active);
|
|
16
17
|
setContext("autocollapse", autocollapse);
|
|
17
18
|
setContext("duration", duration);
|
|
19
|
+
setContext("disabled", disabled);
|
|
18
20
|
setContext("padding", padding);
|
|
19
21
|
setContext("hover", hover);
|
|
20
22
|
setContext("rounded", rounded);
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
duration?: number | undefined;
|
|
9
9
|
/** Provide classes to set the vertical spacing between items.*/
|
|
10
10
|
spacing?: string | undefined;
|
|
11
|
+
/** Set the accordion disabled state for all items.*/
|
|
12
|
+
disabled?: boolean | undefined;
|
|
11
13
|
/** Provide classes to set the accordion item padding styles.*/
|
|
12
14
|
padding?: string | undefined;
|
|
13
15
|
/** 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.*/
|
|
@@ -11,13 +11,13 @@ export let hover = getContext("hover");
|
|
|
11
11
|
const cBase = "unstyled grid place-content-center place-items-center w-full aspect-square space-y-1.5 cursor-pointer";
|
|
12
12
|
const cLabel = "font-bold text-xs text-center";
|
|
13
13
|
function onClickHandler(event) {
|
|
14
|
-
if (
|
|
14
|
+
if (!String($selected) || !String(value))
|
|
15
15
|
return;
|
|
16
16
|
$selected = value;
|
|
17
17
|
dispatch("click", event);
|
|
18
18
|
}
|
|
19
19
|
$:
|
|
20
|
-
classesActive = $selected && value && $selected === value ? `${active}` : "";
|
|
20
|
+
classesActive = String($selected) && String(value) && $selected === value ? `${active}` : "";
|
|
21
21
|
$:
|
|
22
22
|
classesBase = `${cBase} ${hover} ${classesActive} ${$$props.class || ""}`;
|
|
23
23
|
$:
|
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
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,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,29 +1,34 @@
|
|
|
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 = [];
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
5
|
+
export let allowlist = [];
|
|
6
|
+
export let denylist = [];
|
|
9
7
|
export let emptyState = "No Results Found.";
|
|
10
|
-
export let duration = 200;
|
|
11
8
|
export let regionNav = "";
|
|
12
9
|
export let regionList = "list-nav";
|
|
13
10
|
export let regionItem = "";
|
|
14
11
|
export let regionButton = "w-full";
|
|
15
12
|
export let regionEmpty = "text-center";
|
|
13
|
+
export let whitelist = [];
|
|
14
|
+
export let blacklist = [];
|
|
15
|
+
export let duration = 200;
|
|
16
|
+
const deprecated = [whitelist, blacklist, duration];
|
|
16
17
|
let listedOptions = options;
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
function filterByAllowed() {
|
|
19
|
+
if (allowlist.length) {
|
|
20
|
+
listedOptions = [...options].filter((option) => allowlist.includes(option.value));
|
|
21
|
+
} else {
|
|
22
|
+
listedOptions = [...options];
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
function filterByDenied() {
|
|
26
|
+
if (denylist.length) {
|
|
27
|
+
const denySet = new Set(denylist);
|
|
28
|
+
listedOptions = [...options].filter((option) => !denySet.has(option.value));
|
|
29
|
+
} else {
|
|
30
|
+
listedOptions = [...options];
|
|
31
|
+
}
|
|
27
32
|
}
|
|
28
33
|
function filterOptions() {
|
|
29
34
|
let _options = [...listedOptions];
|
|
@@ -39,15 +44,15 @@ function onSelection(option) {
|
|
|
39
44
|
dispatch("selection", option);
|
|
40
45
|
}
|
|
41
46
|
$:
|
|
42
|
-
if (
|
|
43
|
-
|
|
47
|
+
if (allowlist)
|
|
48
|
+
filterByAllowed();
|
|
44
49
|
$:
|
|
45
|
-
if (
|
|
46
|
-
|
|
50
|
+
if (denylist)
|
|
51
|
+
filterByDenied();
|
|
47
52
|
$:
|
|
48
53
|
optionsFiltered = input ? filterOptions() : listedOptions;
|
|
49
54
|
$:
|
|
50
|
-
|
|
55
|
+
classesBase = `${$$props.class ?? ""}`;
|
|
51
56
|
$:
|
|
52
57
|
classesNav = `${regionNav}`;
|
|
53
58
|
$:
|
|
@@ -57,15 +62,16 @@ $:
|
|
|
57
62
|
$:
|
|
58
63
|
classesButton = `${regionButton}`;
|
|
59
64
|
$:
|
|
60
|
-
|
|
65
|
+
classesEmpty = `${regionEmpty}`;
|
|
61
66
|
</script>
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
<!-- animate:flip={{ duration }} transition:slide|local={{ duration }} -->
|
|
69
|
+
<div class="autocomplete {classesBase}" data-testid="autocomplete">
|
|
64
70
|
{#if optionsFiltered.length > 0}
|
|
65
71
|
<nav class="autocomplete-nav {classesNav}">
|
|
66
72
|
<ul class="autocomplete-list {classesList}">
|
|
67
73
|
{#each optionsFiltered as option, i (option)}
|
|
68
|
-
<li class="autocomplete-item {classesItem}"
|
|
74
|
+
<li class="autocomplete-item {classesItem}">
|
|
69
75
|
<button class="autocomplete-button {classesButton}" type="button" on:click={() => onSelection(option)} on:click on:keypress>
|
|
70
76
|
{@html option.label}
|
|
71
77
|
</button>
|
|
@@ -74,6 +80,6 @@ $:
|
|
|
74
80
|
</ul>
|
|
75
81
|
</nav>
|
|
76
82
|
{:else}
|
|
77
|
-
<div class="autocomplete-empty {
|
|
83
|
+
<div class="autocomplete-empty {classesEmpty}">{emptyState}</div>
|
|
78
84
|
{/if}
|
|
79
85
|
</div>
|
|
@@ -7,14 +7,12 @@ declare const __propDef: {
|
|
|
7
7
|
input?: unknown;
|
|
8
8
|
/** Define values for the list*/
|
|
9
9
|
options?: AutocompleteOption[] | undefined;
|
|
10
|
-
/** Provide
|
|
11
|
-
|
|
12
|
-
/** Provide
|
|
13
|
-
|
|
10
|
+
/** Provide allowlist values*/
|
|
11
|
+
allowlist?: unknown[] | undefined;
|
|
12
|
+
/** Provide denylist values*/
|
|
13
|
+
denylist?: unknown[] | undefined;
|
|
14
14
|
/** Provide a HTML markup to display when no match is found.*/
|
|
15
15
|
emptyState?: string | undefined;
|
|
16
|
-
/** Set the animation duration. Use zero to disable.*/
|
|
17
|
-
duration?: number | undefined;
|
|
18
16
|
/** Provide arbitrary classes to nav element.*/
|
|
19
17
|
regionNav?: string | undefined;
|
|
20
18
|
/** Provide arbitrary classes to each list.*/
|
|
@@ -25,6 +23,12 @@ declare const __propDef: {
|
|
|
25
23
|
regionButton?: string | undefined;
|
|
26
24
|
/** Provide arbitrary classes to empty message.*/
|
|
27
25
|
regionEmpty?: string | undefined;
|
|
26
|
+
/** DEPRECATED: replace with allowlist*/
|
|
27
|
+
whitelist?: unknown[] | undefined;
|
|
28
|
+
/** DEPRECATED: replace with denylist*/
|
|
29
|
+
blacklist?: unknown[] | undefined;
|
|
30
|
+
/** DEPRECATED: Set the animation duration. Use zero to disable.*/
|
|
31
|
+
duration?: number | undefined;
|
|
28
32
|
};
|
|
29
33
|
events: {
|
|
30
34
|
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;
|
|
@@ -25,7 +25,7 @@ function prunedRestProps() {
|
|
|
25
25
|
<img class="avatar-image {cImage}" style={$$props.style ?? ''} {src} alt={$$props.alt || ''} use:action={actionParams} {...prunedRestProps()} />
|
|
26
26
|
{:else}
|
|
27
27
|
<svg class="avatar-initials w-full h-full" viewBox="0 0 512 512">
|
|
28
|
-
<text x="50%" y="50%" dominant-baseline="
|
|
28
|
+
<text x="50%" y="50%" dominant-baseline="central" text-anchor="middle" font-weight="bold" font-size={150} class="avatar-text {fill}">
|
|
29
29
|
{String(initials).substring(0, 2).toUpperCase()}
|
|
30
30
|
</text>
|
|
31
31
|
</svg>
|
|
@@ -23,12 +23,16 @@ 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.map((val) => {
|
|
27
|
+
return { val, id: Math.random() };
|
|
28
|
+
});
|
|
26
29
|
function onInputHandler() {
|
|
27
30
|
inputValid = true;
|
|
28
31
|
}
|
|
29
32
|
function validate() {
|
|
30
33
|
if (!input)
|
|
31
34
|
return false;
|
|
35
|
+
input = input.trim();
|
|
32
36
|
if (validation !== void 0 && !validation(input))
|
|
33
37
|
return false;
|
|
34
38
|
if (max !== -1 && value.length >= max)
|
|
@@ -46,18 +50,25 @@ function validate() {
|
|
|
46
50
|
function addChip(event) {
|
|
47
51
|
event.preventDefault();
|
|
48
52
|
inputValid = validate();
|
|
49
|
-
if (inputValid === false)
|
|
53
|
+
if (inputValid === false) {
|
|
54
|
+
dispatch("invalid", { event, input });
|
|
50
55
|
return;
|
|
51
|
-
|
|
56
|
+
}
|
|
52
57
|
input = allowUpperCase ? input : input.toLowerCase();
|
|
53
|
-
value
|
|
58
|
+
value.push(input);
|
|
59
|
+
value = value;
|
|
60
|
+
chipValues.push({ val: input, id: Math.random() });
|
|
61
|
+
chipValues = chipValues;
|
|
54
62
|
dispatch("add", { event, chipIndex: value.length - 1, chipValue: input });
|
|
55
63
|
input = "";
|
|
56
64
|
}
|
|
57
65
|
function removeChip(event, chipIndex, chipValue) {
|
|
58
66
|
if ($$restProps.disabled)
|
|
59
67
|
return;
|
|
60
|
-
value
|
|
68
|
+
value.splice(chipIndex, 1);
|
|
69
|
+
value = value;
|
|
70
|
+
chipValues.splice(chipIndex, 1);
|
|
71
|
+
chipValues = chipValues;
|
|
61
72
|
dispatch("remove", { event, chipIndex, chipValue });
|
|
62
73
|
}
|
|
63
74
|
$:
|
|
@@ -70,6 +81,12 @@ $:
|
|
|
70
81
|
classesChipList = `${cChipList}`;
|
|
71
82
|
$:
|
|
72
83
|
classesInputField = `${cInputField}`;
|
|
84
|
+
$:
|
|
85
|
+
chipValues = value.map((val, i) => {
|
|
86
|
+
if (chipValues[i]?.val === val)
|
|
87
|
+
return chipValues[i];
|
|
88
|
+
return { id: Math.random(), val };
|
|
89
|
+
});
|
|
73
90
|
</script>
|
|
74
91
|
|
|
75
92
|
<div class="input-chip {classesBase}" class:opacity-50={$$restProps.disabled}>
|
|
@@ -91,20 +108,22 @@ $:
|
|
|
91
108
|
class="input-chip-field {classesInputField}"
|
|
92
109
|
on:input={onInputHandler}
|
|
93
110
|
on:input
|
|
111
|
+
on:focus
|
|
112
|
+
on:blur
|
|
94
113
|
disabled={$$restProps.disabled}
|
|
95
114
|
/>
|
|
96
115
|
</form>
|
|
97
116
|
<!-- Chip List -->
|
|
98
|
-
{#if
|
|
117
|
+
{#if chipValues.length}
|
|
99
118
|
<div class="input-chip-list {classesChipList}" transition:fly|local={{ duration, opacity: 0, y: -20 }}>
|
|
100
|
-
{#each
|
|
119
|
+
{#each chipValues as { id, val }, i (id)}
|
|
101
120
|
<!-- Wrapping div required for FLIP animation -->
|
|
102
121
|
<div animate:flip={{ duration }}>
|
|
103
122
|
<button
|
|
104
123
|
type="button"
|
|
105
124
|
class="chip {chips}"
|
|
106
125
|
on:click={(e) => {
|
|
107
|
-
removeChip(e, i,
|
|
126
|
+
removeChip(e, i, val);
|
|
108
127
|
}}
|
|
109
128
|
on:click
|
|
110
129
|
on:keypress
|
|
@@ -112,7 +131,7 @@ $:
|
|
|
112
131
|
on:keyup
|
|
113
132
|
transition:scale|local={{ duration, opacity: 0 }}
|
|
114
133
|
>
|
|
115
|
-
<span>{
|
|
134
|
+
<span>{val}</span>
|
|
116
135
|
<span>✕</span>
|
|
117
136
|
</button>
|
|
118
137
|
</div>
|
|
@@ -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;
|
|
@@ -11,7 +11,7 @@ setContext("rounded", rounded);
|
|
|
11
11
|
setContext("active", active);
|
|
12
12
|
setContext("hover", hover);
|
|
13
13
|
setContext("padding", padding);
|
|
14
|
-
const cBase = "
|
|
14
|
+
const cBase = "";
|
|
15
15
|
$:
|
|
16
16
|
classesBase = `${cBase} ${spacing} ${rounded} ${$$props.class ?? ""}`;
|
|
17
17
|
</script>
|
|
@@ -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;
|
|
@@ -7,7 +7,7 @@ export let rounded = getContext("rounded");
|
|
|
7
7
|
export let active = getContext("active");
|
|
8
8
|
export let hover = getContext("hover");
|
|
9
9
|
export let padding = getContext("padding");
|
|
10
|
-
const cBase = "
|
|
10
|
+
const cBase = "cursor-pointer -outline-offset-[3px]";
|
|
11
11
|
const cLabel = "flex space-x-4";
|
|
12
12
|
let checked;
|
|
13
13
|
let elemInput;
|
|
@@ -50,33 +50,35 @@ $:
|
|
|
50
50
|
classesLabel = `${cLabel}`;
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
<label
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
53
|
+
<label>
|
|
54
|
+
<!-- A11y attributes are not allowed on <label> -->
|
|
55
|
+
<div
|
|
56
|
+
class="listbox-item {classesBase}"
|
|
57
|
+
data-testid="listbox-item"
|
|
58
|
+
role="option"
|
|
59
|
+
aria-selected={selected}
|
|
60
|
+
tabindex="0"
|
|
61
|
+
on:keydown={onKeyDown}
|
|
62
|
+
on:keydown
|
|
63
|
+
on:keyup
|
|
64
|
+
on:keypress
|
|
65
|
+
>
|
|
66
|
+
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
67
|
+
<div class="h-0 w-0 overflow-hidden">
|
|
68
|
+
{#if multiple}
|
|
69
|
+
<input bind:this={elemInput} type="checkbox" {name} {value} bind:checked tabindex="-1" on:click on:change />
|
|
70
|
+
{:else}
|
|
71
|
+
<input bind:this={elemInput} type="radio" bind:group {name} {value} tabindex="-1" on:click on:change />
|
|
72
|
+
{/if}
|
|
73
|
+
</div>
|
|
74
|
+
<!-- <slot /> -->
|
|
75
|
+
<div class="listbox-label {classesLabel}">
|
|
76
|
+
<!-- Slot: Lead -->
|
|
77
|
+
{#if $$slots.lead}<div class="listbox-label-lead"><slot name="lead" /></div>{/if}
|
|
78
|
+
<!-- Slot: Default -->
|
|
79
|
+
<div class="listbox-label-content flex-1"><slot /></div>
|
|
80
|
+
<!-- Slot: Trail -->
|
|
81
|
+
{#if $$slots.trail}<div class="listbox-label-trail"><slot name="trail" /></div>{/if}
|
|
82
|
+
</div>
|
|
81
83
|
</div>
|
|
82
84
|
</label>
|
|
@@ -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 -->
|
|
@@ -33,23 +33,25 @@ function prunedRestProps() {
|
|
|
33
33
|
}
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
<label
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
36
|
+
<label>
|
|
37
|
+
<!-- A11y attributes are not allowed on <label> -->
|
|
38
|
+
<div
|
|
39
|
+
class="radio-item {classesBase}"
|
|
40
|
+
data-testid="radio-item"
|
|
41
|
+
role="radio"
|
|
42
|
+
aria-checked={checked}
|
|
43
|
+
aria-label={label}
|
|
44
|
+
tabindex="0"
|
|
45
|
+
{title}
|
|
46
|
+
on:keydown={onKeyDown}
|
|
47
|
+
on:keydown
|
|
48
|
+
on:keyup
|
|
49
|
+
on:keypress
|
|
50
|
+
>
|
|
51
|
+
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
52
|
+
<div class="h-0 w-0 overflow-hidden">
|
|
53
|
+
<input bind:this={elemInput} type="radio" bind:group {name} {value} {...prunedRestProps()} tabindex="-1" on:click on:change />
|
|
54
|
+
</div>
|
|
55
|
+
<slot />
|
|
53
56
|
</div>
|
|
54
|
-
<slot />
|
|
55
57
|
</label>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { afterUpdate } from "svelte";
|
|
1
|
+
<script>import { afterUpdate, tick } from "svelte";
|
|
2
2
|
export let name;
|
|
3
3
|
export let id = String(Math.random());
|
|
4
4
|
export let value = 0;
|
|
@@ -16,8 +16,10 @@ let tickmarks;
|
|
|
16
16
|
function setTicks() {
|
|
17
17
|
if (ticked == false)
|
|
18
18
|
return;
|
|
19
|
-
tickmarks = Array.from({ length: max - min + 1 }, (_, i) => i +
|
|
19
|
+
tickmarks = Array.from({ length: max - min + 1 }, (_, i) => i + min);
|
|
20
20
|
}
|
|
21
|
+
if (ticked)
|
|
22
|
+
setTicks();
|
|
21
23
|
afterUpdate(() => {
|
|
22
24
|
setTicks();
|
|
23
25
|
});
|
|
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
/** Required. Set a unique name for the
|
|
5
|
+
/** Required. Set a unique name for the input.*/
|
|
6
6
|
name: string;
|
|
7
7
|
/** Provide a unique input id. Auto-generated by default*/
|
|
8
8
|
id?: string | undefined;
|
|
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
/** Required. Set a unique name for the
|
|
5
|
+
/** Required. Set a unique name for the input.*/
|
|
6
6
|
name: string;
|
|
7
7
|
/** The checked state of the input element.*/
|
|
8
8
|
checked?: boolean | undefined;
|