@skeletonlabs/skeleton 0.132.5 → 1.1.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/README.md +7 -6
- package/components/Accordion/Accordion.svelte.d.ts +3 -3
- package/components/Accordion/AccordionItem.svelte +1 -1
- package/components/AppBar/AppBar.svelte +1 -1
- package/components/AppBar/AppBar.svelte.d.ts +2 -2
- package/components/AppRail/AppRailTile.svelte.d.ts +2 -2
- package/components/AppShell/AppShell.svelte +1 -1
- package/components/AppShell/AppShell.svelte.d.ts +8 -8
- package/components/Autocomplete/Autocomplete.svelte +79 -0
- package/components/Autocomplete/Autocomplete.svelte.d.ts +44 -0
- package/components/Autocomplete/types.d.ts +10 -0
- package/components/Autocomplete/types.js +2 -0
- package/components/Avatar/Avatar.svelte +6 -2
- package/components/ConicGradient/ConicGradient.svelte +2 -2
- package/components/ConicGradient/ConicGradient.svelte.d.ts +6 -6
- package/components/FileButton/FileButton.svelte +12 -5
- package/components/FileButton/FileButton.svelte.d.ts +4 -0
- package/components/FileDropzone/FileDropzone.svelte +5 -2
- package/components/FileDropzone/FileDropzone.svelte.d.ts +7 -5
- package/components/InputChip/InputChip.svelte +14 -13
- package/components/InputChip/InputChip.svelte.d.ts +3 -0
- package/components/ListBox/ListBox.svelte +1 -1
- package/components/ListBox/ListBox.svelte.d.ts +1 -0
- package/components/ProgressBar/ProgressBar.svelte +1 -1
- package/components/ProgressRadial/ProgressRadial.svelte +3 -2
- package/components/ProgressRadial/ProgressRadial.svelte.d.ts +2 -0
- package/components/Radio/RadioGroup.svelte.d.ts +1 -0
- package/components/Radio/RadioItem.svelte +3 -1
- package/components/Radio/RadioItem.svelte.d.ts +2 -0
- package/components/RangeSlider/RangeSlider.svelte +1 -1
- package/components/Stepper/Step.svelte +12 -3
- package/components/Stepper/Step.svelte.d.ts +3 -0
- package/components/Stepper/Stepper.svelte +8 -1
- package/components/Stepper/Stepper.svelte.d.ts +11 -3
- package/components/Tab/Tab.svelte +2 -1
- package/components/Tab/Tab.svelte.d.ts +2 -0
- package/components/Tab/TabGroup.svelte +4 -2
- package/components/Tab/TabGroup.svelte.d.ts +2 -0
- package/components/Table/Table.svelte +2 -0
- package/components/Table/Table.svelte.d.ts +2 -0
- package/components/TableOfContents/TableOfContents.svelte +25 -18
- package/fonts/quicksand/Quicksand-VariableFont_wght.ttf +0 -0
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/package.json +5 -1
- package/styles/elements/buttons.css +4 -0
- package/styles/elements/forms.css +4 -1
- package/styles/elements/lists.css +2 -0
- package/styles/elements/logo-clouds.css +1 -1
- package/styles/elements/tables.css +4 -3
- package/styles/tailwind.css +1 -1
- package/styles/typography.css +12 -10
- package/styles/variants.css +3 -1
- package/tailwind/generated/intellisense-classes.cjs +1 -1
- package/tailwind/generated/intellisense-classes.d.cts +316 -117
- package/tailwind/intellisense.cjs +1 -1
- package/tailwind/tokens/backgrounds.cjs +1 -1
- package/tailwind/tokens/border-radius.cjs +1 -1
- package/tailwind/tokens/borders.cjs +1 -1
- package/tailwind/tokens/fills.cjs +1 -1
- package/tailwind/tokens/rings.cjs +3 -3
- package/tailwind/tokens/text.cjs +1 -1
- package/themes/theme-gold-nouveau.css +3 -11
- package/themes/theme-hamlindigo.css +1 -3
- package/themes/theme-modern.css +0 -1
- package/themes/theme-rocket.css +6 -9
- package/themes/theme-sahara.css +4 -7
- package/themes/theme-seafoam.css +1 -2
- package/themes/theme-seasonal.css +0 -1
- package/themes/theme-skeleton.css +3 -17
- package/themes/theme-vintage.css +2 -4
- package/types/tailwind.d.ts +1 -1
- package/types/tailwind.js +1 -1
- package/utilities/CodeBlock/CodeBlock.svelte.d.ts +9 -9
- package/utilities/Drawer/Drawer.svelte +3 -2
- package/utilities/Drawer/Drawer.svelte.d.ts +4 -2
- package/utilities/Drawer/types.d.ts +3 -3
- package/utilities/LightSwitch/LightSwitch.svelte +2 -2
- package/utilities/LightSwitch/lightswitch.js +3 -3
- package/utilities/Modal/Modal.svelte +5 -3
- package/utilities/Modal/Modal.svelte.d.ts +3 -1
- package/utilities/Modal/types.d.ts +5 -5
- package/utilities/Popup/popup.d.ts +1 -1
- package/utilities/Popup/popup.js +83 -28
- package/utilities/Popup/types.d.ts +1 -1
- package/utilities/Toast/Toast.svelte +3 -2
- package/utilities/Toast/Toast.svelte.d.ts +2 -0
- package/utilities/Toast/types.d.ts +1 -4
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
# 💀 Skeleton
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Skeleton is an open source UI toolkit built with Svelte + Tailwind that allows you to create reactive web interfaces using [Svelte](https://svelte.dev/) + [Tailwind CSS](https://tailwindcss.com/).
|
|
10
10
|
|
|
11
11
|
## 🔗 Useful Links
|
|
12
12
|
|
|
13
13
|
- [Documentation](https://skeleton.dev/)
|
|
14
14
|
- [Contribution Guide](https://skeleton.dev/docs/contributing)
|
|
15
|
-
- [Project Roadmap](https://github.com/skeletonlabs/skeleton/wiki/%F0%9F%9B%A3%EF%B8%8F-The-Skeleton-Roadmap)
|
|
15
|
+
<!-- - [Project Roadmap](https://github.com/skeletonlabs/skeleton/wiki/%F0%9F%9B%A3%EF%B8%8F-The-Skeleton-Roadmap) -->
|
|
16
16
|
|
|
17
17
|
## 👋 Community
|
|
18
18
|
|
|
@@ -22,16 +22,17 @@ A fully featured Svelte UI toolkit for Svelte + Tailwind. Skeleton allows you to
|
|
|
22
22
|
## 👍 Sponsor the Project
|
|
23
23
|
|
|
24
24
|
- [Ko-Fi](https://ko-fi.com/skeletonlabs)
|
|
25
|
+
- [GitHub Sponsors](https://github.com/sponsors/skeletonlabs)
|
|
25
26
|
- [Patreon](https://patreon.com/user?u=83786276)
|
|
26
27
|
|
|
27
28
|
## 🐞 Report an Issue
|
|
28
29
|
|
|
29
|
-
- [
|
|
30
|
+
- [File a Ticket](https://github.com/skeletonlabs/skeleton/issues/new/choose)
|
|
30
31
|
|
|
31
32
|
## 🛠️ Contributions
|
|
32
33
|
|
|
33
|
-
We've provided a detailed [contribution guide](https://www.skeleton.dev/docs/
|
|
34
|
+
We've provided a detailed [contribution guide](https://www.skeleton.dev/docs/contributing) to help you get started. [Find an open issue](https://github.com/skeletonlabs/skeleton/issues), discuss the requirements with other contributors, then send a PR!
|
|
34
35
|
|
|
35
|
-
##
|
|
36
|
+
## Maintainers
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
Skeleton was created by [Chris Simmons](https://github.com/endigo9740) (@endigo9740) and is currently maintained by [Skeleton Labs](https://www.skeletonlabs.co/) and the open source community.
|
|
@@ -6,7 +6,7 @@ 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 vertical spacing between
|
|
9
|
+
/** Provide classes to set the vertical spacing between items.*/
|
|
10
10
|
spacing?: string | undefined;
|
|
11
11
|
/** Provide classes to set the accordion item padding styles.*/
|
|
12
12
|
padding?: string | undefined;
|
|
@@ -20,9 +20,9 @@ declare const __propDef: {
|
|
|
20
20
|
caretClosed?: string | undefined;
|
|
21
21
|
/** Provide arbitrary classes to the trigger button region.*/
|
|
22
22
|
regionControl?: string | undefined;
|
|
23
|
-
/** Provide arbitrary classes to content panel region.*/
|
|
23
|
+
/** Provide arbitrary classes to the content panel region.*/
|
|
24
24
|
regionPanel?: string | undefined;
|
|
25
|
-
/** Provide arbitrary classes caret icon region.*/
|
|
25
|
+
/** Provide arbitrary classes to the caret icon region.*/
|
|
26
26
|
regionCaret?: string | undefined;
|
|
27
27
|
};
|
|
28
28
|
events: {
|
|
@@ -6,7 +6,7 @@ export let open = false;
|
|
|
6
6
|
export let id = String(Math.random());
|
|
7
7
|
const cBase = "";
|
|
8
8
|
const cControl = "text-left w-full flex items-center space-x-4";
|
|
9
|
-
const cControlCaret = "fill-
|
|
9
|
+
const cControlCaret = "fill-current w-3 transition-transform duration-[200ms]";
|
|
10
10
|
const cPanel = "";
|
|
11
11
|
export let autocollapse = getContext("autocollapse");
|
|
12
12
|
export let active = getContext("active");
|
|
@@ -12,7 +12,7 @@ export let slotDefault = "";
|
|
|
12
12
|
export let slotTrail = "";
|
|
13
13
|
export let label = "";
|
|
14
14
|
export let labelledby = "";
|
|
15
|
-
const cBase = "flex flex-col
|
|
15
|
+
const cBase = "flex flex-col";
|
|
16
16
|
const cRowMain = "grid items-center";
|
|
17
17
|
const cRowHeadline = "";
|
|
18
18
|
const cSlotLead = "flex-none flex justify-between items-center";
|
|
@@ -16,9 +16,9 @@ declare const __propDef: {
|
|
|
16
16
|
gridColumns?: string | undefined;
|
|
17
17
|
/** Provide classes to set gap spacing for the main row.*/
|
|
18
18
|
gap?: string | undefined;
|
|
19
|
-
/** Provide
|
|
19
|
+
/** Provide arbitrary classes to style the top (main) row.*/
|
|
20
20
|
regionRowMain?: string | undefined;
|
|
21
|
-
/** Provide
|
|
21
|
+
/** Provide arbitrary classes to style the bottom (headline) row.*/
|
|
22
22
|
regionRowHeadline?: string | undefined;
|
|
23
23
|
/** Classes to apply to the lead slot container element*/
|
|
24
24
|
slotLead?: string | undefined;
|
|
@@ -9,9 +9,9 @@ declare const __propDef: {
|
|
|
9
9
|
tag?: string | undefined;
|
|
10
10
|
/** Provide the vislble text label.*/
|
|
11
11
|
label?: string | undefined;
|
|
12
|
-
/** Provide
|
|
12
|
+
/** Provide arbitrary classes to style the icon region.*/
|
|
13
13
|
regionIcon?: string | undefined;
|
|
14
|
-
/** Provide
|
|
14
|
+
/** Provide arbitrary classes to style the label region.*/
|
|
15
15
|
regionLabel?: string | undefined;
|
|
16
16
|
selected?: Writable<string> | undefined;
|
|
17
17
|
active?: Writable<string> | undefined;
|
|
@@ -8,7 +8,7 @@ export let slotPageFooter = "";
|
|
|
8
8
|
export let slotFooter = "";
|
|
9
9
|
const cBaseAppShell = "w-full h-full flex flex-col overflow-hidden";
|
|
10
10
|
const cContentArea = "w-full h-full flex overflow-hidden";
|
|
11
|
-
const cPage = "flex-1 overflow-x-hidden
|
|
11
|
+
const cPage = "flex-1 overflow-x-hidden flex flex-col";
|
|
12
12
|
const cSidebarLeft = "flex-none overflow-x-hidden overflow-y-auto";
|
|
13
13
|
const cSidebarRight = "flex-none overflow-x-hidden overflow-y-auto";
|
|
14
14
|
$:
|
|
@@ -2,21 +2,21 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
/** Apply
|
|
5
|
+
/** Apply arbitrary clases to the entire `#page` region.*/
|
|
6
6
|
regionPage?: string | undefined;
|
|
7
|
-
/** Apply
|
|
7
|
+
/** Apply arbitrary clases to the `header` slot container element*/
|
|
8
8
|
slotHeader?: string | undefined;
|
|
9
|
-
/** Apply
|
|
9
|
+
/** Apply arbitrary clases to the `sidebarLeft` slot container element*/
|
|
10
10
|
slotSidebarLeft?: string | undefined;
|
|
11
|
-
/** Apply
|
|
11
|
+
/** Apply arbitrary clases to the `sidebarRight` slot container element*/
|
|
12
12
|
slotSidebarRight?: string | undefined;
|
|
13
|
-
/** Apply
|
|
13
|
+
/** Apply arbitrary clases to the `pageHeader` slot container element*/
|
|
14
14
|
slotPageHeader?: string | undefined;
|
|
15
|
-
/** Apply
|
|
15
|
+
/** Apply arbitrary clases to the `pageContent` slot container element*/
|
|
16
16
|
slotPageContent?: string | undefined;
|
|
17
|
-
/** Apply
|
|
17
|
+
/** Apply arbitrary clases to the `pageFooter` slot container element*/
|
|
18
18
|
slotPageFooter?: string | undefined;
|
|
19
|
-
/** Apply
|
|
19
|
+
/** Apply arbitrary clases to the `footer` slot container element*/
|
|
20
20
|
slotFooter?: string | undefined;
|
|
21
21
|
};
|
|
22
22
|
events: {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { slide } from "svelte/transition";
|
|
3
|
+
import { flip } from "svelte/animate";
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
export let input = void 0;
|
|
6
|
+
export let options = [];
|
|
7
|
+
export let whitelist = [];
|
|
8
|
+
export let blacklist = [];
|
|
9
|
+
export let emptyState = "No Results Found.";
|
|
10
|
+
export let duration = 200;
|
|
11
|
+
export let regionNav = "";
|
|
12
|
+
export let regionList = "list-nav";
|
|
13
|
+
export let regionItem = "";
|
|
14
|
+
export let regionButton = "w-full";
|
|
15
|
+
export let regionEmpty = "text-center";
|
|
16
|
+
let listedOptions = options;
|
|
17
|
+
function whitelistOptions() {
|
|
18
|
+
if (!whitelist.length)
|
|
19
|
+
return;
|
|
20
|
+
listedOptions = [...options].filter((option) => whitelist.includes(option.value));
|
|
21
|
+
}
|
|
22
|
+
function blacklistOptions() {
|
|
23
|
+
if (!blacklist.length)
|
|
24
|
+
return;
|
|
25
|
+
const toBlacklist = new Set(blacklist);
|
|
26
|
+
listedOptions = [...options].filter((option) => !toBlacklist.has(option.value));
|
|
27
|
+
}
|
|
28
|
+
function filterOptions() {
|
|
29
|
+
let _options = [...listedOptions];
|
|
30
|
+
_options = _options.filter((option) => {
|
|
31
|
+
const inputFormatted = String(input).toLowerCase().trim();
|
|
32
|
+
let optionFormatted = JSON.stringify([option.label, option.value, option.keywords]).toLowerCase();
|
|
33
|
+
if (optionFormatted.includes(inputFormatted))
|
|
34
|
+
return option;
|
|
35
|
+
});
|
|
36
|
+
return _options;
|
|
37
|
+
}
|
|
38
|
+
function onSelection(option) {
|
|
39
|
+
dispatch("selection", option);
|
|
40
|
+
}
|
|
41
|
+
$:
|
|
42
|
+
if (whitelist)
|
|
43
|
+
whitelistOptions();
|
|
44
|
+
$:
|
|
45
|
+
if (blacklist)
|
|
46
|
+
blacklistOptions();
|
|
47
|
+
$:
|
|
48
|
+
optionsFiltered = input ? filterOptions() : listedOptions;
|
|
49
|
+
$:
|
|
50
|
+
classsesBase = `${$$props.class ?? ""}`;
|
|
51
|
+
$:
|
|
52
|
+
classesNav = `${regionNav}`;
|
|
53
|
+
$:
|
|
54
|
+
classesList = `${regionList}`;
|
|
55
|
+
$:
|
|
56
|
+
classesItem = `${regionItem}`;
|
|
57
|
+
$:
|
|
58
|
+
classesButton = `${regionButton}`;
|
|
59
|
+
$:
|
|
60
|
+
classesEmtpy = `${regionEmpty}`;
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<div class="autocomplete {classsesBase}" data-testid="autocomplete">
|
|
64
|
+
{#if optionsFiltered.length > 0}
|
|
65
|
+
<nav class="autocomplete-nav {classesNav}">
|
|
66
|
+
<ul class="autocomplete-list {classesList}">
|
|
67
|
+
{#each optionsFiltered as option, i (option)}
|
|
68
|
+
<li class="autocomplete-item {classesItem}" animate:flip={{ duration }} transition:slide|local={{ duration }}>
|
|
69
|
+
<button class="autocomplete-button {classesButton}" type="button" on:click={() => onSelection(option)} on:click on:keypress>
|
|
70
|
+
{@html option.label}
|
|
71
|
+
</button>
|
|
72
|
+
</li>
|
|
73
|
+
{/each}
|
|
74
|
+
</ul>
|
|
75
|
+
</nav>
|
|
76
|
+
{:else}
|
|
77
|
+
<div class="autocomplete-empty {classesEmtpy}">{emptyState}</div>
|
|
78
|
+
{/if}
|
|
79
|
+
</div>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AutocompleteOption } from './types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
/** Bind the input value.*/
|
|
7
|
+
input?: unknown;
|
|
8
|
+
/** Define values for the list*/
|
|
9
|
+
options?: AutocompleteOption[] | undefined;
|
|
10
|
+
/** Provide whitelisted values*/
|
|
11
|
+
whitelist?: unknown[] | undefined;
|
|
12
|
+
/** Provide blacklist values*/
|
|
13
|
+
blacklist?: unknown[] | undefined;
|
|
14
|
+
/** Provide a HTML markup to display when no match is found.*/
|
|
15
|
+
emptyState?: string | undefined;
|
|
16
|
+
/** Set the animation duration. Use zero to disable.*/
|
|
17
|
+
duration?: number | undefined;
|
|
18
|
+
/** Provide arbitrary classes to nav element.*/
|
|
19
|
+
regionNav?: string | undefined;
|
|
20
|
+
/** Provide arbitrary classes to each list.*/
|
|
21
|
+
regionList?: string | undefined;
|
|
22
|
+
/** Provide arbitrary classes to each list item.*/
|
|
23
|
+
regionItem?: string | undefined;
|
|
24
|
+
/** Provide arbitrary classes to each button.*/
|
|
25
|
+
regionButton?: string | undefined;
|
|
26
|
+
/** Provide arbitrary classes to empty message.*/
|
|
27
|
+
regionEmpty?: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
events: {
|
|
30
|
+
click: MouseEvent;
|
|
31
|
+
keypress: KeyboardEvent;
|
|
32
|
+
/** {AutocompleteOption} selection - Fire on option select.*/
|
|
33
|
+
selection: CustomEvent<any>;
|
|
34
|
+
} & {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
};
|
|
37
|
+
slots: {};
|
|
38
|
+
};
|
|
39
|
+
export type AutocompleteProps = typeof __propDef.props;
|
|
40
|
+
export type AutocompleteEvents = typeof __propDef.events;
|
|
41
|
+
export type AutocompleteSlots = typeof __propDef.slots;
|
|
42
|
+
export default class Autocomplete extends SvelteComponentTyped<AutocompleteProps, AutocompleteEvents, AutocompleteSlots> {
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface AutocompleteOption {
|
|
2
|
+
/** provide a unique display label per option. Supports HTML. */
|
|
3
|
+
label: string;
|
|
4
|
+
/** Provide a unique option value. */
|
|
5
|
+
value: unknown;
|
|
6
|
+
/** Provide a comma seperated list of keywords. */
|
|
7
|
+
keywords?: any;
|
|
8
|
+
/** Pass arbitrary data per option. */
|
|
9
|
+
meta?: any;
|
|
10
|
+
}
|
|
@@ -5,7 +5,7 @@ export let action = () => {
|
|
|
5
5
|
};
|
|
6
6
|
export let actionParams = "";
|
|
7
7
|
export let background = "bg-surface-400-500-token";
|
|
8
|
-
export let width = "w-
|
|
8
|
+
export let width = "w-16";
|
|
9
9
|
export let border = "";
|
|
10
10
|
export let rounded = "rounded-full";
|
|
11
11
|
export let shadow = "";
|
|
@@ -14,11 +14,15 @@ let cBase = "flex aspect-square text-surface-50 font-semibold justify-center ite
|
|
|
14
14
|
let cImage = "w-full h-full object-cover";
|
|
15
15
|
$:
|
|
16
16
|
classesBase = `${cBase} ${background} ${width} ${border} ${rounded} ${shadow} ${cursor} ${$$props.class ?? ""}`;
|
|
17
|
+
function prunedRestProps() {
|
|
18
|
+
delete $$restProps.class;
|
|
19
|
+
return $$restProps;
|
|
20
|
+
}
|
|
17
21
|
</script>
|
|
18
22
|
|
|
19
23
|
<figure class="avatar {classesBase}" data-testid="avatar" on:click on:keydown on:keyup on:keypress>
|
|
20
24
|
{#if src}
|
|
21
|
-
<img class="avatar-image {cImage}" style={$$props.style ?? ''} {src} alt={$$props.alt || ''} use:action={actionParams} />
|
|
25
|
+
<img class="avatar-image {cImage}" style={$$props.style ?? ''} {src} alt={$$props.alt || ''} use:action={actionParams} {...prunedRestProps()} />
|
|
22
26
|
{:else}
|
|
23
27
|
<svg class="avatar-initials w-full h-full" viewBox="0 0 512 512">
|
|
24
28
|
<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-weight="bold" font-size={150} class="avatar-text {fill}">
|
|
@@ -3,14 +3,14 @@ import { tailwindDefaultColors } from "./settings";
|
|
|
3
3
|
export let stops = [{ color: ["neutral", 500], start: 0, end: 100 }];
|
|
4
4
|
export let legend = false;
|
|
5
5
|
export let spin = false;
|
|
6
|
-
export let width = "w-
|
|
6
|
+
export let width = "w-24";
|
|
7
7
|
export let hover = "bg-primary-hover-token";
|
|
8
8
|
export let regionCaption = "";
|
|
9
9
|
export let regionCone = "";
|
|
10
10
|
export let regionLegend = "";
|
|
11
11
|
let cone;
|
|
12
12
|
let generatedLegendList;
|
|
13
|
-
const cBase = "flex flex-col items-center space-y-4";
|
|
13
|
+
const cBase = "flex flex-col items-center space-y-4 w-";
|
|
14
14
|
const cCaption = "text-center";
|
|
15
15
|
const cCone = "block aspect-square rounded-full";
|
|
16
16
|
const cLegend = "text-sm w-full";
|
|
@@ -5,19 +5,19 @@ declare const __propDef: {
|
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
/** Provide a data set of color stops and labels.*/
|
|
7
7
|
stops?: ConicStop[] | undefined;
|
|
8
|
-
/**
|
|
8
|
+
/** Enable a contextual legend.*/
|
|
9
9
|
legend?: boolean | undefined;
|
|
10
10
|
/** When enabled, the conic gradient will spin.*/
|
|
11
11
|
spin?: boolean | undefined;
|
|
12
|
-
/**
|
|
12
|
+
/** Style the conic gradient width.*/
|
|
13
13
|
width?: string | undefined;
|
|
14
|
-
/**
|
|
14
|
+
/** Style the legend hover effect.*/
|
|
15
15
|
hover?: string | undefined;
|
|
16
|
-
/**
|
|
16
|
+
/** Style the caption region above the gradient.*/
|
|
17
17
|
regionCaption?: string | undefined;
|
|
18
|
-
/**
|
|
18
|
+
/** Style the conic gradient region.*/
|
|
19
19
|
regionCone?: string | undefined;
|
|
20
|
-
/**
|
|
20
|
+
/** Style the legend region below the gradient.*/
|
|
21
21
|
regionLegend?: string | undefined;
|
|
22
22
|
};
|
|
23
23
|
events: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
<script>export let
|
|
1
|
+
<script>export let files = void 0;
|
|
2
|
+
export let name;
|
|
3
|
+
export let width = "";
|
|
2
4
|
export let button = "variant-filled";
|
|
5
|
+
const cButton = "btn";
|
|
3
6
|
let elemFileInput;
|
|
4
7
|
function onButtonClick() {
|
|
5
8
|
elemFileInput.click();
|
|
@@ -8,17 +11,21 @@ function prunedRestProps() {
|
|
|
8
11
|
delete $$restProps.class;
|
|
9
12
|
return $$restProps;
|
|
10
13
|
}
|
|
14
|
+
$:
|
|
15
|
+
classesBase = `${$$props.class ?? ""}`;
|
|
16
|
+
$:
|
|
17
|
+
classesButton = `${cButton} ${button} ${width}`;
|
|
11
18
|
</script>
|
|
12
19
|
|
|
13
|
-
<div class="file-button {
|
|
20
|
+
<div class="file-button {classesBase}" data-testid="file-button">
|
|
14
21
|
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
15
|
-
<div class="h-0 overflow-hidden">
|
|
16
|
-
<input type="file" bind:this={elemFileInput} {name} {...prunedRestProps()} on:change />
|
|
22
|
+
<div class="w-0 h-0 overflow-hidden">
|
|
23
|
+
<input type="file" bind:this={elemFileInput} bind:files {name} {...prunedRestProps()} on:change />
|
|
17
24
|
</div>
|
|
18
25
|
<!-- Button -->
|
|
19
26
|
<button
|
|
20
27
|
type="button"
|
|
21
|
-
class="file-button-btn
|
|
28
|
+
class="file-button-btn {classesButton}"
|
|
22
29
|
disabled={$$restProps.disabled}
|
|
23
30
|
on:click={onButtonClick}
|
|
24
31
|
on:keydown
|
|
@@ -2,8 +2,12 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
+
/** Bind FileList to the file input.*/
|
|
6
|
+
files?: FileList | undefined;
|
|
5
7
|
/** Required. Set a unique name for the file input.*/
|
|
6
8
|
name: string;
|
|
9
|
+
/** Provide classes to set the width.*/
|
|
10
|
+
width?: string | undefined;
|
|
7
11
|
/** Provide a button variant or other class styles.*/
|
|
8
12
|
button?: string | undefined;
|
|
9
13
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>export let
|
|
1
|
+
<script>export let files = void 0;
|
|
2
|
+
export let name;
|
|
2
3
|
export let border = "border-2 border-dashed";
|
|
3
4
|
export let padding = "p-4 py-8";
|
|
4
5
|
export let rounded = "rounded-container-token";
|
|
@@ -8,7 +9,7 @@ export let slotLead = "mb-4";
|
|
|
8
9
|
export let slotMessage = "";
|
|
9
10
|
export let slotMeta = "opacity-75";
|
|
10
11
|
const cBase = "textarea relative flex justify-center items-center";
|
|
11
|
-
const cInput = "absolute top-0 left-0 right-0 bottom-0 z-[1] opacity-0 disabled:!opacity-0 cursor-pointer";
|
|
12
|
+
const cInput = "w-full absolute top-0 left-0 right-0 bottom-0 z-[1] opacity-0 disabled:!opacity-0 cursor-pointer";
|
|
12
13
|
const cInterface = "flex justify-center items-center text-center";
|
|
13
14
|
$:
|
|
14
15
|
classesBase = `${cBase} ${border} ${padding} ${rounded} ${$$props.class ?? ""}`;
|
|
@@ -24,7 +25,9 @@ function prunedRestProps() {
|
|
|
24
25
|
|
|
25
26
|
<div class="dropzone {classesBase}" class:opacity-50={$$restProps.disabled} data-testid="file-dropzone">
|
|
26
27
|
<!-- Input: File (hidden) -->
|
|
28
|
+
<!-- NOTE: keep `bind:files` here, unlike FileButton -->
|
|
27
29
|
<input
|
|
30
|
+
bind:files
|
|
28
31
|
type="file"
|
|
29
32
|
{name}
|
|
30
33
|
class="dropzone-input {classesInput}"
|
|
@@ -2,6 +2,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
+
/** Bind FileList to the file input.*/
|
|
6
|
+
files?: FileList | undefined;
|
|
5
7
|
/** Required. Set a unique name for the file input.*/
|
|
6
8
|
name: string;
|
|
7
9
|
/** Provide classes to set the border styles.*/
|
|
@@ -10,15 +12,15 @@ declare const __propDef: {
|
|
|
10
12
|
padding?: string | undefined;
|
|
11
13
|
/** Provide classes to set the box radius styles.*/
|
|
12
14
|
rounded?: string | undefined;
|
|
13
|
-
/** Provide
|
|
15
|
+
/** Provide arbitrary styles for the UI region.*/
|
|
14
16
|
regionInterface?: string | undefined;
|
|
15
|
-
/** Provide
|
|
17
|
+
/** Provide arbitrary styles for the UI text region.*/
|
|
16
18
|
regionInterfaceText?: string | undefined;
|
|
17
|
-
/** Provide
|
|
19
|
+
/** Provide arbitrary styles for lead slot container.*/
|
|
18
20
|
slotLead?: string | undefined;
|
|
19
|
-
/** Provide
|
|
21
|
+
/** Provide arbitrary styles for message slot container.*/
|
|
20
22
|
slotMessage?: string | undefined;
|
|
21
|
-
/** Provide
|
|
23
|
+
/** Provide arbitrary styles for meta text slot container.*/
|
|
22
24
|
slotMeta?: string | undefined;
|
|
23
25
|
};
|
|
24
26
|
events: {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { fly, scale } from "svelte/transition";
|
|
3
3
|
import { flip } from "svelte/animate";
|
|
4
4
|
const dispatch = createEventDispatcher();
|
|
5
|
+
export let input = "";
|
|
5
6
|
export let name;
|
|
6
7
|
export let value = [];
|
|
7
8
|
export let whitelist = [];
|
|
@@ -21,25 +22,24 @@ const cBase = "textarea cursor-pointer";
|
|
|
21
22
|
const cInterface = "space-y-4";
|
|
22
23
|
const cChipList = "flex flex-wrap gap-2";
|
|
23
24
|
const cInputField = "unstyled bg-transparent border-0 !ring-0 p-0 w-full";
|
|
24
|
-
let inputValue = "";
|
|
25
25
|
let inputValid = true;
|
|
26
26
|
function onInputHandler() {
|
|
27
27
|
inputValid = true;
|
|
28
28
|
}
|
|
29
29
|
function validate() {
|
|
30
|
-
if (!
|
|
30
|
+
if (!input)
|
|
31
31
|
return false;
|
|
32
|
-
if (validation !== void 0 && !validation(
|
|
32
|
+
if (validation !== void 0 && !validation(input))
|
|
33
33
|
return false;
|
|
34
34
|
if (max !== -1 && value.length >= max)
|
|
35
35
|
return false;
|
|
36
|
-
if (minlength !== -1 &&
|
|
36
|
+
if (minlength !== -1 && input.length < minlength)
|
|
37
37
|
return false;
|
|
38
|
-
if (maxlength !== -1 &&
|
|
38
|
+
if (maxlength !== -1 && input.length > maxlength)
|
|
39
39
|
return false;
|
|
40
|
-
if (whitelist.length > 0 && !whitelist.includes(
|
|
40
|
+
if (whitelist.length > 0 && !whitelist.includes(input))
|
|
41
41
|
return false;
|
|
42
|
-
if (allowDuplicates === false && value.includes(
|
|
42
|
+
if (allowDuplicates === false && value.includes(input))
|
|
43
43
|
return false;
|
|
44
44
|
return true;
|
|
45
45
|
}
|
|
@@ -48,11 +48,11 @@ function addChip(event) {
|
|
|
48
48
|
inputValid = validate();
|
|
49
49
|
if (inputValid === false)
|
|
50
50
|
return;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
value = [...value,
|
|
54
|
-
dispatch("add", { event, chipIndex: value.length - 1, chipValue:
|
|
55
|
-
|
|
51
|
+
input = input.trim();
|
|
52
|
+
input = allowUpperCase ? input : input.toLowerCase();
|
|
53
|
+
value = [...value, input];
|
|
54
|
+
dispatch("add", { event, chipIndex: value.length - 1, chipValue: input });
|
|
55
|
+
input = "";
|
|
56
56
|
}
|
|
57
57
|
function removeChip(event, chipIndex, chipValue) {
|
|
58
58
|
if ($$restProps.disabled)
|
|
@@ -86,7 +86,7 @@ $:
|
|
|
86
86
|
<form on:submit={addChip}>
|
|
87
87
|
<input
|
|
88
88
|
type="text"
|
|
89
|
-
bind:value={
|
|
89
|
+
bind:value={input}
|
|
90
90
|
placeholder={$$restProps.placeholder ?? 'Enter values...'}
|
|
91
91
|
class="input-chip-field {classesInputField}"
|
|
92
92
|
on:input={onInputHandler}
|
|
@@ -101,6 +101,7 @@ $:
|
|
|
101
101
|
<!-- Wrapping div required for FLIP animation -->
|
|
102
102
|
<div animate:flip={{ duration }}>
|
|
103
103
|
<button
|
|
104
|
+
type="button"
|
|
104
105
|
class="chip {chips}"
|
|
105
106
|
on:click={(e) => {
|
|
106
107
|
removeChip(e, i, c);
|
|
@@ -2,6 +2,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
+
/** Bind the input value.*/
|
|
6
|
+
input?: string | undefined;
|
|
5
7
|
/** Set a unique select input name.*/
|
|
6
8
|
name: string;
|
|
7
9
|
/** An array of values.*/
|
|
@@ -34,6 +36,7 @@ declare const __propDef: {
|
|
|
34
36
|
rounded?: string | undefined;
|
|
35
37
|
};
|
|
36
38
|
events: {
|
|
39
|
+
/** Bind the input value.*/
|
|
37
40
|
input: Event;
|
|
38
41
|
click: MouseEvent;
|
|
39
42
|
keypress: KeyboardEvent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { setContext } from "svelte";
|
|
2
2
|
export let multiple = false;
|
|
3
|
-
export let spacing =
|
|
3
|
+
export let spacing = "space-y-1";
|
|
4
4
|
export let rounded = "rounded-token";
|
|
5
5
|
export let active = "variant-filled";
|
|
6
6
|
export let hover = "hover:variant-soft";
|
|
@@ -4,7 +4,7 @@ export let max = 100;
|
|
|
4
4
|
export let height = "h-2";
|
|
5
5
|
export let rounded = "rounded-token";
|
|
6
6
|
export let meter = "bg-surface-900-50-token";
|
|
7
|
-
export let track = "
|
|
7
|
+
export let track = "bg-surface-200-700-token";
|
|
8
8
|
export let labelledby = "";
|
|
9
9
|
const cTrack = "w-full overflow-hidden";
|
|
10
10
|
const cMeter = "h-full";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<!-- Reference: https://css-tricks.com/building-progress-ring-quickly/ -->
|
|
2
2
|
<script>import { afterUpdate } from "svelte";
|
|
3
3
|
export let value = void 0;
|
|
4
|
-
export let stroke =
|
|
4
|
+
export let stroke = 40;
|
|
5
5
|
export let font = 56;
|
|
6
|
+
export let width = "w-36";
|
|
6
7
|
export let meter = "stroke-surface-900 dark:stroke-surface-50";
|
|
7
8
|
export let track = "stroke-surface-500/30";
|
|
8
9
|
export let fill = "fill-token";
|
|
@@ -23,7 +24,7 @@ afterUpdate(() => {
|
|
|
23
24
|
setProgress(value === void 0 ? 25 : value);
|
|
24
25
|
});
|
|
25
26
|
$:
|
|
26
|
-
classesBase = `${cBase} ${$$props.class ?? ""}`;
|
|
27
|
+
classesBase = `${cBase} ${width} ${$$props.class ?? ""}`;
|
|
27
28
|
</script>
|
|
28
29
|
|
|
29
30
|
<figure
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
stroke?: number | undefined;
|
|
9
9
|
/** Sets the base font size. Scales responsively.*/
|
|
10
10
|
font?: number | undefined;
|
|
11
|
+
/** Provide classes to set the width.*/
|
|
12
|
+
width?: string | undefined;
|
|
11
13
|
/** Provide classes to set meter color.*/
|
|
12
14
|
meter?: string | undefined;
|
|
13
15
|
/** Provide classes to set track color.*/
|