@skeletonlabs/skeleton 0.132.5 → 1.0.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.d.ts +2 -2
- package/components/AppRail/AppRailTile.svelte +1 -1
- package/components/AppRail/AppRailTile.svelte.d.ts +4 -4
- package/components/AppShell/AppShell.svelte +1 -1
- package/components/AppShell/AppShell.svelte.d.ts +8 -8
- package/components/Avatar/Avatar.svelte +1 -1
- package/components/ConicGradient/ConicGradient.svelte +2 -2
- package/components/ConicGradient/ConicGradient.svelte.d.ts +6 -6
- package/components/FileButton/FileButton.svelte +9 -3
- package/components/FileButton/FileButton.svelte.d.ts +2 -0
- package/components/FileDropzone/FileDropzone.svelte +5 -2
- package/components/FileDropzone/FileDropzone.svelte.d.ts +7 -5
- package/components/InputChip/InputChip.svelte +1 -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 +10 -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/package.json +1 -1
- package/styles/elements/buttons.css +4 -0
- package/styles/elements/forms.css +4 -1
- 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 +230 -121
- 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 +1 -1
- package/tailwind/tokens/text.cjs +1 -1
- package/themes/theme-gold-nouveau.css +3 -10
- package/themes/theme-rocket.css +5 -5
- package/themes/theme-skeleton.css +3 -14
- 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.d.ts +2 -2
- package/utilities/Drawer/types.d.ts +3 -3
- package/utilities/LightSwitch/LightSwitch.svelte +2 -2
- package/utilities/Modal/Modal.svelte.d.ts +1 -1
- package/utilities/Modal/types.d.ts +5 -5
- package/utilities/Popup/popup.js +10 -6
- 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");
|
|
@@ -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;
|
|
@@ -30,7 +30,7 @@ function prunedRestProps() {
|
|
|
30
30
|
|
|
31
31
|
<!-- @component A navigation tile for the App Rail component. -->
|
|
32
32
|
|
|
33
|
-
<div on:click={onClickHandler} on:keydown on:keyup on:keypress>
|
|
33
|
+
<div on:click={onClickHandler} on:click on:keydown on:keyup on:keypress>
|
|
34
34
|
<!-- IMPORTANT: avoid forwarding events on <svelte:element> tags per: -->
|
|
35
35
|
<!-- https://github.com/skeletonlabs/skeleton/issues/727#issuecomment-1356859261 -->
|
|
36
36
|
<svelte:element this={tag} {...prunedRestProps()} class="app-rail-tile {classesBase}">
|
|
@@ -9,20 +9,20 @@ 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;
|
|
18
18
|
hover?: Writable<string> | undefined;
|
|
19
19
|
};
|
|
20
20
|
events: {
|
|
21
|
+
/** {{ event }} click - Fires when the component is clicked.*/
|
|
22
|
+
click: CustomEvent<any>;
|
|
21
23
|
keydown: KeyboardEvent;
|
|
22
24
|
keyup: KeyboardEvent;
|
|
23
25
|
keypress: KeyboardEvent;
|
|
24
|
-
/** {{ event }} click - Fires when the component is clicked.*/
|
|
25
|
-
click: CustomEvent<MouseEvent>;
|
|
26
26
|
} & {
|
|
27
27
|
[evt: string]: CustomEvent<any>;
|
|
28
28
|
};
|
|
@@ -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: {
|
|
@@ -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 = "";
|
|
@@ -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,7 @@
|
|
|
1
1
|
<script>export let name;
|
|
2
|
+
export let width = "";
|
|
2
3
|
export let button = "variant-filled";
|
|
4
|
+
const cButton = "btn";
|
|
3
5
|
let elemFileInput;
|
|
4
6
|
function onButtonClick() {
|
|
5
7
|
elemFileInput.click();
|
|
@@ -8,17 +10,21 @@ function prunedRestProps() {
|
|
|
8
10
|
delete $$restProps.class;
|
|
9
11
|
return $$restProps;
|
|
10
12
|
}
|
|
13
|
+
$:
|
|
14
|
+
classesBase = `${$$props.class ?? ""}`;
|
|
15
|
+
$:
|
|
16
|
+
classesButton = `${cButton} ${button} ${width}`;
|
|
11
17
|
</script>
|
|
12
18
|
|
|
13
|
-
<div class="file-button {
|
|
19
|
+
<div class="file-button {classesBase}" data-testid="file-button">
|
|
14
20
|
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
15
|
-
<div class="h-0 overflow-hidden">
|
|
21
|
+
<div class="w-0 h-0 overflow-hidden">
|
|
16
22
|
<input type="file" bind:this={elemFileInput} {name} {...prunedRestProps()} on:change />
|
|
17
23
|
</div>
|
|
18
24
|
<!-- Button -->
|
|
19
25
|
<button
|
|
20
26
|
type="button"
|
|
21
|
-
class="file-button-btn
|
|
27
|
+
class="file-button-btn {classesButton}"
|
|
22
28
|
disabled={$$restProps.disabled}
|
|
23
29
|
on:click={onButtonClick}
|
|
24
30
|
on:keydown
|
|
@@ -4,6 +4,8 @@ declare const __propDef: {
|
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
/** Required. Set a unique name for the file input.*/
|
|
6
6
|
name: string;
|
|
7
|
+
/** Provide classes to set the width.*/
|
|
8
|
+
width?: string | undefined;
|
|
7
9
|
/** Provide a button variant or other class styles.*/
|
|
8
10
|
button?: string | undefined;
|
|
9
11
|
};
|
|
@@ -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: {
|
|
@@ -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.*/
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export let group;
|
|
3
3
|
export let name;
|
|
4
4
|
export let value;
|
|
5
|
+
export let title = "";
|
|
5
6
|
export let label = "";
|
|
6
7
|
export let rounded = getContext("rounded");
|
|
7
8
|
export let padding = getContext("padding");
|
|
@@ -25,7 +26,7 @@ $:
|
|
|
25
26
|
$:
|
|
26
27
|
classesDisabled = $$props.disabled ? cDisabled : "";
|
|
27
28
|
$:
|
|
28
|
-
classesBase = `${cBase} ${padding} ${rounded} ${classesActive} ${classesDisabled}`;
|
|
29
|
+
classesBase = `${cBase} ${padding} ${rounded} ${classesActive} ${classesDisabled} ${$$props.class ?? ""}`;
|
|
29
30
|
function prunedRestProps() {
|
|
30
31
|
delete $$restProps.class;
|
|
31
32
|
return $$restProps;
|
|
@@ -35,6 +36,7 @@ function prunedRestProps() {
|
|
|
35
36
|
<!-- WARNING: avoid click handlers on <label>; will fire twice -->
|
|
36
37
|
<label
|
|
37
38
|
class="radio-item {classesBase}"
|
|
39
|
+
{title}
|
|
38
40
|
role="radio"
|
|
39
41
|
aria-checked={checked}
|
|
40
42
|
aria-label={label}
|
|
@@ -6,7 +6,7 @@ export let min = 0;
|
|
|
6
6
|
export let max = 100;
|
|
7
7
|
export let step = 1;
|
|
8
8
|
export let ticked = false;
|
|
9
|
-
export let accent = "accent-
|
|
9
|
+
export let accent = "accent-surface-900 dark:accent-surface-50";
|
|
10
10
|
export let label = "";
|
|
11
11
|
const cBase = "space-y-2";
|
|
12
12
|
const cBaseLabel = "";
|
|
@@ -11,10 +11,13 @@ export let stepTerm = getContext("stepTerm");
|
|
|
11
11
|
export let gap = getContext("gap");
|
|
12
12
|
export let justify = getContext("justify");
|
|
13
13
|
export let buttonBack = getContext("buttonBack");
|
|
14
|
+
export let buttonBackType = getContext("buttonBackType");
|
|
14
15
|
export let buttonBackLabel = getContext("buttonBackLabel");
|
|
15
16
|
export let buttonNext = getContext("buttonNext");
|
|
17
|
+
export let buttonNextType = getContext("buttonNextType");
|
|
16
18
|
export let buttonNextLabel = getContext("buttonNextLabel");
|
|
17
19
|
export let buttonComplete = getContext("buttonComplete");
|
|
20
|
+
export let buttonCompleteType = getContext("buttonCompleteType");
|
|
18
21
|
export let buttonCompleteLabel = getContext("buttonCompleteLabel");
|
|
19
22
|
const stepIndex = $state.total;
|
|
20
23
|
$state.total++;
|
|
@@ -27,10 +30,12 @@ function onNext() {
|
|
|
27
30
|
return;
|
|
28
31
|
$state.current++;
|
|
29
32
|
dispatchParent("next", { step: stepIndex, state: $state });
|
|
33
|
+
dispatchParent("step", { step: stepIndex, state: $state });
|
|
30
34
|
}
|
|
31
35
|
function onBack() {
|
|
32
36
|
$state.current--;
|
|
33
37
|
dispatchParent("back", { step: stepIndex, state: $state });
|
|
38
|
+
dispatchParent("step", { step: stepIndex, state: $state });
|
|
34
39
|
}
|
|
35
40
|
function onComplete() {
|
|
36
41
|
dispatchParent("complete", { step: stepIndex, state: $state });
|
|
@@ -61,9 +66,11 @@ onDestroy(() => {
|
|
|
61
66
|
<!-- Navigation -->
|
|
62
67
|
{#if $state.total > 1}
|
|
63
68
|
<div class="step-navigation {classesNavigation}" transition:fade|local={{ duration: 100 }}>
|
|
64
|
-
<button type=
|
|
69
|
+
<button type={buttonBackType} class="btn {buttonBack}" on:click={onBack} disabled={$state.current === 0}
|
|
70
|
+
>{@html buttonBackLabel}</button
|
|
71
|
+
>
|
|
65
72
|
{#if stepIndex < $state.total - 1}
|
|
66
|
-
<button type=
|
|
73
|
+
<button type={buttonNextType} class="btn {buttonNext}" on:click={onNext} disabled={locked}>
|
|
67
74
|
{#if locked}
|
|
68
75
|
<svg class="w-3 aspect-square" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
69
76
|
<path
|
|
@@ -74,7 +81,7 @@ onDestroy(() => {
|
|
|
74
81
|
<span>{@html buttonNextLabel}</span>
|
|
75
82
|
</button>
|
|
76
83
|
{:else}
|
|
77
|
-
<button type=
|
|
84
|
+
<button type={buttonCompleteType} class="btn {buttonComplete}" on:click={onComplete}>{@html buttonCompleteLabel}</button>
|
|
78
85
|
{/if}
|
|
79
86
|
</div>
|
|
80
87
|
{/if}
|
|
@@ -16,10 +16,13 @@ declare const __propDef: {
|
|
|
16
16
|
gap?: string | undefined;
|
|
17
17
|
justify?: string | undefined;
|
|
18
18
|
buttonBack?: string | undefined;
|
|
19
|
+
buttonBackType?: "button" | "reset" | "submit" | undefined;
|
|
19
20
|
buttonBackLabel?: string | undefined;
|
|
20
21
|
buttonNext?: string | undefined;
|
|
22
|
+
buttonNextType?: "button" | "reset" | "submit" | undefined;
|
|
21
23
|
buttonNextLabel?: string | undefined;
|
|
22
24
|
buttonComplete?: string | undefined;
|
|
25
|
+
buttonCompleteType?: "button" | "reset" | "submit" | undefined;
|
|
23
26
|
buttonCompleteLabel?: string | undefined;
|
|
24
27
|
};
|
|
25
28
|
events: {
|
|
@@ -7,26 +7,33 @@ export let stepTerm = "Step";
|
|
|
7
7
|
export let badge = "variant-filled-surface";
|
|
8
8
|
export let active = "variant-filled";
|
|
9
9
|
export let border = "border-surface-400-500-token";
|
|
10
|
+
export let start = 0;
|
|
10
11
|
export let justify = "justify-between";
|
|
11
12
|
export let buttonBack = "variant-ghost";
|
|
13
|
+
export let buttonBackType = "button";
|
|
12
14
|
export let buttonBackLabel = "← Back";
|
|
13
15
|
export let buttonNext = "variant-filled";
|
|
16
|
+
export let buttonNextType = "button";
|
|
14
17
|
export let buttonNextLabel = "Next →";
|
|
15
18
|
export let buttonComplete = "variant-filled-primary";
|
|
19
|
+
export let buttonCompleteType = "button";
|
|
16
20
|
export let buttonCompleteLabel = "Complete";
|
|
17
21
|
export let regionHeader = "";
|
|
18
22
|
export let regionContent = "";
|
|
19
|
-
let state = writable({ current:
|
|
23
|
+
let state = writable({ current: start, total: 0 });
|
|
20
24
|
setContext("state", state);
|
|
21
25
|
setContext("dispatchParent", dispatchParent);
|
|
22
26
|
setContext("stepTerm", stepTerm);
|
|
23
27
|
setContext("gap", gap);
|
|
24
28
|
setContext("justify", justify);
|
|
25
29
|
setContext("buttonBack", buttonBack);
|
|
30
|
+
setContext("buttonBackType", buttonBackType);
|
|
26
31
|
setContext("buttonBackLabel", buttonBackLabel);
|
|
27
32
|
setContext("buttonNext", buttonNext);
|
|
33
|
+
setContext("buttonNextType", buttonNextType);
|
|
28
34
|
setContext("buttonNextLabel", buttonNextLabel);
|
|
29
35
|
setContext("buttonComplete", buttonComplete);
|
|
36
|
+
setContext("buttonCompleteType", buttonCompleteType);
|
|
30
37
|
setContext("buttonCompleteLabel", buttonCompleteLabel);
|
|
31
38
|
const cBase = "space-y-4";
|
|
32
39
|
const cHeader = "flex items-center border-t mt-[15px]";
|
|
@@ -12,18 +12,26 @@ declare const __propDef: {
|
|
|
12
12
|
active?: string | undefined;
|
|
13
13
|
/** Provide classes to style the stepper header border.*/
|
|
14
14
|
border?: string | undefined;
|
|
15
|
+
/** Provide the initially selected step*/
|
|
16
|
+
start?: number | undefined;
|
|
15
17
|
/** Set the justification for the step navigation buttons.*/
|
|
16
18
|
justify?: string | undefined;
|
|
17
|
-
/** Provide
|
|
19
|
+
/** Provide arbitrary classes to style the back button.*/
|
|
18
20
|
buttonBack?: string | undefined;
|
|
21
|
+
/** Set the type of the back button.*/
|
|
22
|
+
buttonBackType?: "button" | "reset" | "submit" | undefined;
|
|
19
23
|
/** Provide the HTML label content for the back button.*/
|
|
20
24
|
buttonBackLabel?: string | undefined;
|
|
21
|
-
/** Provide
|
|
25
|
+
/** Provide arbitrary classes to style the next button.*/
|
|
22
26
|
buttonNext?: string | undefined;
|
|
27
|
+
/** Set the type of the next button.*/
|
|
28
|
+
buttonNextType?: "button" | "reset" | "submit" | undefined;
|
|
23
29
|
/** Provide the HTML label content for the next button.*/
|
|
24
30
|
buttonNextLabel?: string | undefined;
|
|
25
|
-
/** Provide
|
|
31
|
+
/** Provide arbitrary classes to style the complete button.*/
|
|
26
32
|
buttonComplete?: string | undefined;
|
|
33
|
+
/** Set the type of the complete button.*/
|
|
34
|
+
buttonCompleteType?: "button" | "reset" | "submit" | undefined;
|
|
27
35
|
/** Provide the HTML label content for the complete button.*/
|
|
28
36
|
buttonCompleteLabel?: string | undefined;
|
|
29
37
|
/** Provide arbitrary classes to the stepper header region.*/
|
|
@@ -8,6 +8,7 @@ export let hover = getContext("hover");
|
|
|
8
8
|
export let flex = getContext("flex");
|
|
9
9
|
export let padding = getContext("padding");
|
|
10
10
|
export let rounded = getContext("rounded");
|
|
11
|
+
export let spacing = getContext("spacing");
|
|
11
12
|
const cBase = "text-center cursor-pointer transition-colors duration-100";
|
|
12
13
|
const cInterface = "";
|
|
13
14
|
let elemInput;
|
|
@@ -24,7 +25,7 @@ $:
|
|
|
24
25
|
$:
|
|
25
26
|
classesBase = `${cBase} ${flex} ${padding} ${rounded} ${classesActive} ${$$props.class ?? ""}`;
|
|
26
27
|
$:
|
|
27
|
-
classesInterface = `${cInterface}`;
|
|
28
|
+
classesInterface = `${cInterface} ${spacing}`;
|
|
28
29
|
function prunedRestProps() {
|
|
29
30
|
delete $$restProps.class;
|
|
30
31
|
return $$restProps;
|
|
@@ -20,6 +20,8 @@ declare const __propDef: {
|
|
|
20
20
|
padding?: string | undefined;
|
|
21
21
|
/** Provide classes to style each tab's box radius styles.*/
|
|
22
22
|
rounded?: string | undefined;
|
|
23
|
+
/** Provide classes to set the vertical spacing between items.*/
|
|
24
|
+
spacing?: string | undefined;
|
|
23
25
|
};
|
|
24
26
|
events: {
|
|
25
27
|
keypress: KeyboardEvent;
|
|
@@ -6,6 +6,7 @@ export let hover = "hover:variant-soft";
|
|
|
6
6
|
export let flex = "flex-none";
|
|
7
7
|
export let padding = "px-4 py-2";
|
|
8
8
|
export let rounded = "rounded-tl-container-token rounded-tr-container-token";
|
|
9
|
+
export let spacing = "space-y-1";
|
|
9
10
|
export let regionList = "";
|
|
10
11
|
export let regionPanel = "";
|
|
11
12
|
export let labelledby = "";
|
|
@@ -15,8 +16,9 @@ setContext("hover", hover);
|
|
|
15
16
|
setContext("flex", flex);
|
|
16
17
|
setContext("padding", padding);
|
|
17
18
|
setContext("rounded", rounded);
|
|
18
|
-
|
|
19
|
-
const
|
|
19
|
+
setContext("spacing", spacing);
|
|
20
|
+
const cBase = "space-y-4";
|
|
21
|
+
const cList = "flex overflow-x-auto hide-scrollbars";
|
|
20
22
|
const cPanel = "";
|
|
21
23
|
$:
|
|
22
24
|
classesBase = `${cBase} ${$$props.class ?? ""}`;
|
|
@@ -16,6 +16,8 @@ declare const __propDef: {
|
|
|
16
16
|
padding?: string | undefined;
|
|
17
17
|
/** Provide classes to style each tab's box radius styles.*/
|
|
18
18
|
rounded?: string | undefined;
|
|
19
|
+
/** Provide classes to set the vertical spacing between items.*/
|
|
20
|
+
spacing?: string | undefined;
|
|
19
21
|
/** Provide arbitrary classes to style the tab list region.*/
|
|
20
22
|
regionList?: string | undefined;
|
|
21
23
|
/** Provide arbitrary classes to style the tab panel region.*/
|