@skeletonlabs/skeleton 1.1.0 → 1.2.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/{actions → dist/actions}/FocusTrap/focusTrap.js +3 -3
- package/{components → dist/components}/Accordion/AccordionItem.svelte.d.ts +1 -1
- package/{components → dist/components}/AppRail/AppRailTile.svelte +2 -2
- package/{components → dist/components}/Autocomplete/Autocomplete.svelte +22 -15
- package/{components → dist/components}/Autocomplete/Autocomplete.svelte.d.ts +8 -4
- package/{components → dist/components}/Avatar/Avatar.svelte +1 -1
- package/{components → dist/components}/InputChip/InputChip.svelte +22 -7
- package/{components → dist/components}/ListBox/ListBox.svelte +1 -1
- package/{components → dist/components}/ListBox/ListBoxItem.svelte +31 -29
- 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}/Tab/Tab.svelte +24 -22
- package/{components → dist/components}/Table/Table.svelte +4 -2
- package/{components → dist/components}/Table/Table.svelte.d.ts +4 -0
- 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 +15 -8
- 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}/elements/buttons.css +7 -3
- package/{styles → src/lib/styles}/elements/forms.css +1 -1
- package/{styles → src/lib/styles}/elements/lists.css +3 -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}/Clipboard/clipboard.js +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 +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}/Accordion/Accordion.svelte +0 -0
- package/{components → dist/components}/Accordion/Accordion.svelte.d.ts +0 -0
- package/{components → dist/components}/Accordion/AccordionItem.svelte +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}/AppRail/AppRailTile.svelte.d.ts +0 -0
- package/{components → dist/components}/AppShell/AppShell.svelte +0 -0
- package/{components → dist/components}/AppShell/AppShell.svelte.d.ts +0 -0
- package/{components → dist/components}/Autocomplete/types.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}/InputChip/InputChip.svelte.d.ts +0 -0
- package/{components → dist/components}/ListBox/ListBox.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/Paginator.svelte.d.ts +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 +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 +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 +0 -0
- 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 +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/actions.js +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.d.ts +0 -0
- package/{utilities → dist/utilities}/Popup/types.js +0 -0
- package/{utilities → dist/utilities}/Toast/Toast.svelte +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}/core.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}/tailwind.css +0 -0
- /package/{styles → src/lib/styles}/typography.css +0 -0
- /package/{styles → src/lib/styles}/variants.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
|
@@ -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
|
}
|
|
@@ -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
|
$:
|
|
@@ -4,8 +4,8 @@ import { flip } from "svelte/animate";
|
|
|
4
4
|
const dispatch = createEventDispatcher();
|
|
5
5
|
export let input = void 0;
|
|
6
6
|
export let options = [];
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
7
|
+
export let allowlist = [];
|
|
8
|
+
export let denylist = [];
|
|
9
9
|
export let emptyState = "No Results Found.";
|
|
10
10
|
export let duration = 200;
|
|
11
11
|
export let regionNav = "";
|
|
@@ -13,17 +13,24 @@ export let regionList = "list-nav";
|
|
|
13
13
|
export let regionItem = "";
|
|
14
14
|
export let regionButton = "w-full";
|
|
15
15
|
export let regionEmpty = "text-center";
|
|
16
|
+
export let whitelist = [];
|
|
17
|
+
export let blacklist = [];
|
|
18
|
+
const deprecated = [whitelist, blacklist];
|
|
16
19
|
let listedOptions = options;
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
function filterByAllowed() {
|
|
21
|
+
if (allowlist.length) {
|
|
22
|
+
listedOptions = [...options].filter((option) => allowlist.includes(option.value));
|
|
23
|
+
} else {
|
|
24
|
+
listedOptions = [...options];
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
function filterByDenied() {
|
|
28
|
+
if (denylist.length) {
|
|
29
|
+
const denySet = new Set(denylist);
|
|
30
|
+
listedOptions = [...options].filter((option) => !denySet.has(option.value));
|
|
31
|
+
} else {
|
|
32
|
+
listedOptions = [...options];
|
|
33
|
+
}
|
|
27
34
|
}
|
|
28
35
|
function filterOptions() {
|
|
29
36
|
let _options = [...listedOptions];
|
|
@@ -39,11 +46,11 @@ function onSelection(option) {
|
|
|
39
46
|
dispatch("selection", option);
|
|
40
47
|
}
|
|
41
48
|
$:
|
|
42
|
-
if (
|
|
43
|
-
|
|
49
|
+
if (allowlist)
|
|
50
|
+
filterByAllowed();
|
|
44
51
|
$:
|
|
45
|
-
if (
|
|
46
|
-
|
|
52
|
+
if (denylist)
|
|
53
|
+
filterByDenied();
|
|
47
54
|
$:
|
|
48
55
|
optionsFiltered = input ? filterOptions() : listedOptions;
|
|
49
56
|
$:
|
|
@@ -7,10 +7,10 @@ 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
16
|
/** Set the animation duration. Use zero to disable.*/
|
|
@@ -25,6 +25,10 @@ declare const __propDef: {
|
|
|
25
25
|
regionButton?: string | undefined;
|
|
26
26
|
/** Provide arbitrary classes to empty message.*/
|
|
27
27
|
regionEmpty?: string | undefined;
|
|
28
|
+
/** DEPRECATED: replace with allowlist*/
|
|
29
|
+
whitelist?: unknown[] | undefined;
|
|
30
|
+
/** DEPRECATED: replace with denylist*/
|
|
31
|
+
blacklist?: unknown[] | undefined;
|
|
28
32
|
};
|
|
29
33
|
events: {
|
|
30
34
|
click: MouseEvent;
|
|
@@ -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)
|
|
@@ -48,16 +52,21 @@ function addChip(event) {
|
|
|
48
52
|
inputValid = validate();
|
|
49
53
|
if (inputValid === false)
|
|
50
54
|
return;
|
|
51
|
-
input = input.trim();
|
|
52
55
|
input = allowUpperCase ? input : input.toLowerCase();
|
|
53
|
-
value
|
|
56
|
+
value.push(input);
|
|
57
|
+
value = value;
|
|
58
|
+
chipValues.push({ val: input, id: Math.random() });
|
|
59
|
+
chipValues = chipValues;
|
|
54
60
|
dispatch("add", { event, chipIndex: value.length - 1, chipValue: input });
|
|
55
61
|
input = "";
|
|
56
62
|
}
|
|
57
63
|
function removeChip(event, chipIndex, chipValue) {
|
|
58
64
|
if ($$restProps.disabled)
|
|
59
65
|
return;
|
|
60
|
-
value
|
|
66
|
+
value.splice(chipIndex, 1);
|
|
67
|
+
value = value;
|
|
68
|
+
chipValues.splice(chipIndex, 1);
|
|
69
|
+
chipValues = chipValues;
|
|
61
70
|
dispatch("remove", { event, chipIndex, chipValue });
|
|
62
71
|
}
|
|
63
72
|
$:
|
|
@@ -70,6 +79,12 @@ $:
|
|
|
70
79
|
classesChipList = `${cChipList}`;
|
|
71
80
|
$:
|
|
72
81
|
classesInputField = `${cInputField}`;
|
|
82
|
+
$:
|
|
83
|
+
chipValues = value.map((val, i) => {
|
|
84
|
+
if (chipValues[i]?.val === val)
|
|
85
|
+
return chipValues[i];
|
|
86
|
+
return { id: Math.random(), val };
|
|
87
|
+
});
|
|
73
88
|
</script>
|
|
74
89
|
|
|
75
90
|
<div class="input-chip {classesBase}" class:opacity-50={$$restProps.disabled}>
|
|
@@ -95,16 +110,16 @@ $:
|
|
|
95
110
|
/>
|
|
96
111
|
</form>
|
|
97
112
|
<!-- Chip List -->
|
|
98
|
-
{#if
|
|
113
|
+
{#if chipValues.length}
|
|
99
114
|
<div class="input-chip-list {classesChipList}" transition:fly|local={{ duration, opacity: 0, y: -20 }}>
|
|
100
|
-
{#each
|
|
115
|
+
{#each chipValues as { id, val }, i (id)}
|
|
101
116
|
<!-- Wrapping div required for FLIP animation -->
|
|
102
117
|
<div animate:flip={{ duration }}>
|
|
103
118
|
<button
|
|
104
119
|
type="button"
|
|
105
120
|
class="chip {chips}"
|
|
106
121
|
on:click={(e) => {
|
|
107
|
-
removeChip(e, i,
|
|
122
|
+
removeChip(e, i, val);
|
|
108
123
|
}}
|
|
109
124
|
on:click
|
|
110
125
|
on:keypress
|
|
@@ -112,7 +127,7 @@ $:
|
|
|
112
127
|
on:keyup
|
|
113
128
|
transition:scale|local={{ duration, opacity: 0 }}
|
|
114
129
|
>
|
|
115
|
-
<span>{
|
|
130
|
+
<span>{val}</span>
|
|
116
131
|
<span>✕</span>
|
|
117
132
|
</button>
|
|
118
133
|
</div>
|
|
@@ -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>
|
|
@@ -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>
|
|
@@ -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;
|
|
@@ -12,7 +12,7 @@ export let spacing = getContext("spacing");
|
|
|
12
12
|
const cBase = "text-center cursor-pointer transition-colors duration-100";
|
|
13
13
|
const cInterface = "";
|
|
14
14
|
let elemInput;
|
|
15
|
-
function
|
|
15
|
+
function onKeyDown(event) {
|
|
16
16
|
if (["Enter", "Space"].includes(event.code)) {
|
|
17
17
|
event.preventDefault();
|
|
18
18
|
elemInput.click();
|
|
@@ -32,26 +32,28 @@ function prunedRestProps() {
|
|
|
32
32
|
}
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
<label
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
<label>
|
|
36
|
+
<!-- A11y attributes are not allowed on <label> -->
|
|
37
|
+
<div
|
|
38
|
+
class="tab {classesBase}"
|
|
39
|
+
data-testid="tab"
|
|
40
|
+
role="tab"
|
|
41
|
+
aria-controls={controls}
|
|
42
|
+
aria-selected={selected}
|
|
43
|
+
tabindex="0"
|
|
44
|
+
on:keydown={onKeyDown}
|
|
45
|
+
on:keydown
|
|
46
|
+
on:keyup
|
|
47
|
+
on:keypress
|
|
48
|
+
>
|
|
49
|
+
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
50
|
+
<div class="h-0 w-0 overflow-hidden">
|
|
51
|
+
<input bind:this={elemInput} type="radio" bind:group {name} {value} {...prunedRestProps()} tabindex="-1" on:click on:change />
|
|
52
|
+
</div>
|
|
53
|
+
<!-- Interface -->
|
|
54
|
+
<div class="tab-interface {classesInterface}">
|
|
55
|
+
{#if $$slots.lead}<div class="tab-lead"><slot name="lead" /></div>{/if}
|
|
56
|
+
<div class="tab-label"><slot /></div>
|
|
57
|
+
</div>
|
|
56
58
|
</div>
|
|
57
59
|
</label>
|
|
@@ -7,9 +7,11 @@ export let element = "table";
|
|
|
7
7
|
export let text = "";
|
|
8
8
|
export let color = "";
|
|
9
9
|
export let regionHead = "";
|
|
10
|
+
export let regionHeadCell = "";
|
|
10
11
|
export let regionBody = "";
|
|
11
12
|
export let regionCell = "";
|
|
12
13
|
export let regionFoot = "";
|
|
14
|
+
export let regionFootCell = "";
|
|
13
15
|
function onRowClick(event, rowIndex) {
|
|
14
16
|
if (!interactive)
|
|
15
17
|
return;
|
|
@@ -42,7 +44,7 @@ $:
|
|
|
42
44
|
<thead class="table-head {regionHead}">
|
|
43
45
|
<tr>
|
|
44
46
|
{#each source.head as heading }
|
|
45
|
-
<th>{@html heading}</th>
|
|
47
|
+
<th class="{regionHeadCell}">{@html heading}</th>
|
|
46
48
|
{/each}
|
|
47
49
|
</tr>
|
|
48
50
|
</thead>
|
|
@@ -76,7 +78,7 @@ $:
|
|
|
76
78
|
<tfoot class="table-foot {regionFoot}">
|
|
77
79
|
<tr>
|
|
78
80
|
{#each source.foot as cell }
|
|
79
|
-
<td>{@html cell}</td>
|
|
81
|
+
<td class="{regionFootCell}">{@html cell}</td>
|
|
80
82
|
{/each}
|
|
81
83
|
</tr>
|
|
82
84
|
</tfoot>
|
|
@@ -15,12 +15,16 @@ declare const __propDef: {
|
|
|
15
15
|
color?: string | undefined;
|
|
16
16
|
/** Provide arbitrary classes for the table head.*/
|
|
17
17
|
regionHead?: string | undefined;
|
|
18
|
+
/** Provide arbitrary classes for the table head cells.*/
|
|
19
|
+
regionHeadCell?: string | undefined;
|
|
18
20
|
/** Provide arbitrary classes for the table body.*/
|
|
19
21
|
regionBody?: string | undefined;
|
|
20
22
|
/** Provide arbitrary classes for the table cells.*/
|
|
21
23
|
regionCell?: string | undefined;
|
|
22
24
|
/** Provide arbitrary classes for the table foot.*/
|
|
23
25
|
regionFoot?: string | undefined;
|
|
26
|
+
/** Provide arbitrary classes for the table foot cells.*/
|
|
27
|
+
regionFootCell?: string | undefined;
|
|
24
28
|
};
|
|
25
29
|
events: {
|
|
26
30
|
/** {rowMetaData} selected - Fires when a table row is clicked.*/
|
|
@@ -26,7 +26,7 @@ const presets = {
|
|
|
26
26
|
right: { alignment: "justify-end", width: "w-[90%]", height: "h-full", rounded: "rounded-tl-container-token rounded-bl-container-token" }
|
|
27
27
|
};
|
|
28
28
|
const cBackdrop = "fixed top-0 left-0 right-0 bottom-0 flex";
|
|
29
|
-
const cDrawer = "
|
|
29
|
+
const cDrawer = "overflow-y-auto transition-transform";
|
|
30
30
|
let elemBackdrop;
|
|
31
31
|
let elemDrawer;
|
|
32
32
|
let anim = { x: 0, y: 0 };
|
|
@@ -50,11 +50,13 @@ modalStore.subscribe((modals) => {
|
|
|
50
50
|
function onBackdropInteraction(event) {
|
|
51
51
|
if (!(event.target instanceof Element))
|
|
52
52
|
return;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
const classList = event.target.classList;
|
|
54
|
+
if (classList.contains("modal-backdrop") || classList.contains("modal-transition")) {
|
|
55
|
+
if ($modalStore[0].response)
|
|
56
|
+
$modalStore[0].response(void 0);
|
|
57
|
+
modalStore.close();
|
|
58
|
+
dispatch("backdrop", event);
|
|
59
|
+
}
|
|
58
60
|
}
|
|
59
61
|
function onClose() {
|
|
60
62
|
if ($modalStore[0].response)
|
|
@@ -89,10 +91,12 @@ $:
|
|
|
89
91
|
$:
|
|
90
92
|
parent = {
|
|
91
93
|
position,
|
|
94
|
+
// ---
|
|
92
95
|
duration,
|
|
93
96
|
flyOpacity,
|
|
94
97
|
flyX,
|
|
95
98
|
flyY,
|
|
99
|
+
// ---
|
|
96
100
|
background,
|
|
97
101
|
width,
|
|
98
102
|
height,
|
|
@@ -100,15 +104,18 @@ $:
|
|
|
100
104
|
spacing,
|
|
101
105
|
rounded,
|
|
102
106
|
shadow,
|
|
107
|
+
// ---
|
|
103
108
|
buttonNeutral,
|
|
104
109
|
buttonPositive,
|
|
105
110
|
buttonTextCancel,
|
|
106
111
|
buttonTextConfirm,
|
|
107
112
|
buttonTextSubmit,
|
|
113
|
+
// ---
|
|
108
114
|
regionBackdrop,
|
|
109
115
|
regionHeader,
|
|
110
116
|
regionBody,
|
|
111
117
|
regionFooter,
|
|
118
|
+
// ---
|
|
112
119
|
onClose
|
|
113
120
|
};
|
|
114
121
|
</script>
|
|
@@ -184,7 +191,9 @@ $:
|
|
|
184
191
|
aria-label={$modalStore[0].title ?? ''}
|
|
185
192
|
>
|
|
186
193
|
<svelte:component this={currentComponent?.ref} {...currentComponent?.props} {parent}>
|
|
187
|
-
{
|
|
194
|
+
{#if currentComponent?.slot}
|
|
195
|
+
{@html currentComponent?.slot}
|
|
196
|
+
{/if}
|
|
188
197
|
</svelte:component>
|
|
189
198
|
</div>
|
|
190
199
|
{/if}
|
|
@@ -85,6 +85,18 @@ export function popup(node, args) {
|
|
|
85
85
|
focusableElems[0]?.focus();
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
// Close popup if element matching closeQuery is clicked
|
|
89
|
+
function closeOnQueryClick(clickedEl) {
|
|
90
|
+
if (!clickedEl)
|
|
91
|
+
return;
|
|
92
|
+
const interactiveMenuElems = elemPopup?.querySelectorAll(args.closeQuery || 'a[href], button');
|
|
93
|
+
if (!interactiveMenuElems?.length)
|
|
94
|
+
return;
|
|
95
|
+
interactiveMenuElems.forEach((elem) => {
|
|
96
|
+
if (elem.contains(clickedEl))
|
|
97
|
+
close();
|
|
98
|
+
});
|
|
99
|
+
}
|
|
88
100
|
// Window Click Handler
|
|
89
101
|
const onWindowClick = (event) => {
|
|
90
102
|
if (!node || !elemPopup)
|
|
@@ -101,14 +113,7 @@ export function popup(node, args) {
|
|
|
101
113
|
close();
|
|
102
114
|
}
|
|
103
115
|
else {
|
|
104
|
-
|
|
105
|
-
const interactiveMenuElems = elemPopup?.querySelectorAll(args.closeQuery || '');
|
|
106
|
-
if (!interactiveMenuElems.length)
|
|
107
|
-
return;
|
|
108
|
-
interactiveMenuElems.forEach((elem) => {
|
|
109
|
-
if (elem.contains(event.target))
|
|
110
|
-
close();
|
|
111
|
-
});
|
|
116
|
+
closeOnQueryClick(event.target);
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
};
|
|
@@ -241,6 +246,8 @@ export function popup(node, args) {
|
|
|
241
246
|
elemPopup.addEventListener('focusin', onFocusIn, true);
|
|
242
247
|
// when we focus off the end of the list, close the popup
|
|
243
248
|
elemPopup.addEventListener('focusout', onFocusOut, true);
|
|
249
|
+
// when an element inside the popup is clicked, close the popup if the element matches the closeQuery
|
|
250
|
+
elemPopup.addEventListener('click', onWindowClick, true);
|
|
244
251
|
}
|
|
245
252
|
if (args.event === 'focus-click') {
|
|
246
253
|
// we must use mousedown instead of click because click fires after focusin, meaning isVisible would always be true
|