@skeletonlabs/skeleton 0.92.2 → 0.99.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Accordion/AccordionGroup.svelte +22 -35
- package/components/Accordion/AccordionItem.svelte +24 -40
- package/components/AppBar/AppBar.svelte +22 -38
- package/components/AppRail/AppRail.svelte +18 -39
- package/components/AppRail/AppRailTile.svelte +23 -37
- package/components/AppShell/AppShell.svelte +28 -38
- package/components/Avatar/Avatar.svelte +16 -33
- package/components/ConicGradient/ConicGradient.svelte +28 -44
- package/components/FileButton/FileButton.svelte +14 -11
- package/components/FileDropzone/FileDropzone.svelte +26 -46
- package/components/InputChip/InputChip.svelte +39 -69
- package/components/InputChip/InputChip.svelte.d.ts +0 -1
- package/components/ListBox/ListBox.svelte +27 -47
- package/components/ListBox/ListBoxItem.svelte +36 -52
- package/components/Paginator/Paginator.svelte +25 -41
- package/components/ProgressBar/ProgressBar.svelte +18 -30
- package/components/ProgressRadial/ProgressRadial.svelte +18 -36
- package/components/Radio/RadioGroup.svelte +23 -42
- package/components/Radio/RadioItem.svelte +24 -36
- package/components/RangeSlider/RangeSlider.svelte +17 -40
- package/components/SlideToggle/SlideToggle.svelte +42 -54
- package/components/Stepper/Step.svelte +57 -65
- package/components/Stepper/Stepper.svelte +30 -51
- package/components/SvgIcon/SvgIcon.svelte +11 -23
- package/components/Tab/Tab.svelte +30 -45
- package/components/Tab/TabGroup.svelte +30 -48
- package/components/Table/Table.svelte +20 -36
- package/components/TableOfContents/TableOfContents.svelte +62 -94
- package/index.d.ts +0 -5
- package/index.js +0 -5
- package/package.json +26 -25
- package/styles/all.css +3 -0
- package/styles/core.css +11 -2
- package/styles/elements/alerts.css +2 -28
- package/styles/elements/badges.css +0 -25
- package/styles/elements/breadcrumbs.css +3 -3
- package/styles/elements/buttons.css +32 -117
- package/styles/elements/cards.css +2 -29
- package/styles/elements/chips.css +9 -58
- package/styles/elements/lists.css +4 -3
- package/styles/elements/logo-clouds.css +2 -4
- package/styles/elements/tables.css +14 -10
- package/styles/forms.css +130 -113
- package/styles/tailwind.css +7 -3
- package/styles/typography.css +46 -62
- package/styles/variants.css +154 -0
- package/tailwind/core.cjs +37 -0
- package/tailwind/core.d.cts +5 -0
- package/tailwind/generated/intellisense-classes.cjs +1 -0
- package/tailwind/generated/{allComponents.d.cts → intellisense-classes.d.cts} +731 -931
- package/tailwind/intellisense.cjs +21 -0
- package/tailwind/intellisense.d.cts +5 -0
- package/tailwind/settings.cjs +16 -16
- package/tailwind/skeleton.cjs +13 -44
- package/tailwind/skeleton.d.cts +4 -2
- package/tailwind/theme/colors.cjs +7 -7
- package/tailwind/tokens/backgrounds.cjs +28 -30
- package/tailwind/tokens/border-radius.cjs +15 -15
- package/tailwind/tokens/borders.cjs +14 -14
- package/tailwind/tokens/fills.cjs +14 -14
- package/tailwind/tokens/rings.cjs +40 -32
- package/tailwind/tokens/rings.d.cts +5 -0
- package/tailwind/tokens/text.cjs +24 -26
- package/themes/theme-skeleton.css +6 -6
- package/utilities/CodeBlock/CodeBlock.svelte +26 -40
- package/utilities/DataTable/DataTable.js +1 -1
- package/utilities/Drawer/Drawer.svelte +82 -105
- package/utilities/LightSwitch/LightSwitch.svelte +32 -50
- package/utilities/LightSwitch/LightSwitch.svelte.d.ts +1 -1
- package/utilities/Modal/Modal.svelte +57 -92
- package/utilities/Modal/examples/ModalExampleEmbed.svelte +3 -6
- package/utilities/Modal/examples/ModalExampleForm.svelte +13 -19
- package/utilities/Modal/examples/ModalExampleImage.svelte +19 -0
- package/utilities/Modal/examples/ModalExampleImage.svelte.d.ts +16 -0
- package/utilities/Modal/examples/ModalExampleList.svelte +7 -10
- package/utilities/Toast/Toast.svelte +64 -86
- package/utilities/Toast/stores.js +13 -4
- package/components/Alert/Alert.svelte +0 -65
- package/components/Alert/Alert.svelte.d.ts +0 -30
- package/components/Breadcrumb/Breadcrumb.svelte +0 -24
- package/components/Breadcrumb/Breadcrumb.svelte.d.ts +0 -21
- package/components/Breadcrumb/Crumb.svelte +0 -37
- package/components/Breadcrumb/Crumb.svelte.d.ts +0 -26
- package/components/Divider/Divider.svelte +0 -21
- package/components/Divider/Divider.svelte.d.ts +0 -22
- package/components/GradientHeading/GradientHeading.svelte +0 -21
- package/components/GradientHeading/GradientHeading.svelte.d.ts +0 -22
- package/tailwind/generated/allComponents.cjs +0 -1
|
@@ -1,42 +1,29 @@
|
|
|
1
|
-
<script
|
|
2
|
-
// NOTE: we cannot describe the default slot.
|
|
3
|
-
import { onMount, setContext } from 'svelte';
|
|
4
|
-
/** Enable auto-collapse mode. */
|
|
1
|
+
<script>import { onMount, setContext } from "svelte";
|
|
5
2
|
export let collapse = true;
|
|
6
|
-
|
|
7
|
-
export let
|
|
8
|
-
|
|
9
|
-
export let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
setContext('hover', hover);
|
|
16
|
-
setContext('spacing', spacing);
|
|
17
|
-
setContext('padding', padding);
|
|
18
|
-
setContext('rounded', rounded);
|
|
19
|
-
// Classes
|
|
20
|
-
const cBase = 'rounded-container-token';
|
|
21
|
-
// Local
|
|
3
|
+
export let hover = "bg-primary-hover-token";
|
|
4
|
+
export let spacing = "space-y-4";
|
|
5
|
+
export let padding = "px-4 py-2";
|
|
6
|
+
export let rounded = "rounded-token";
|
|
7
|
+
setContext("hover", hover);
|
|
8
|
+
setContext("spacing", spacing);
|
|
9
|
+
setContext("padding", padding);
|
|
10
|
+
setContext("rounded", rounded);
|
|
11
|
+
const cBase = "rounded-container-token";
|
|
22
12
|
let elemAccordian;
|
|
23
|
-
// Lifecycle
|
|
24
13
|
onMount(() => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
details.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
}
|
|
14
|
+
if (collapse) {
|
|
15
|
+
const details = Array.from(elemAccordian.querySelectorAll("details"));
|
|
16
|
+
details.forEach((detail) => {
|
|
17
|
+
detail.addEventListener("click", (e) => {
|
|
18
|
+
const active = details.find((d) => d.open);
|
|
19
|
+
if (!e.currentTarget.open && active)
|
|
20
|
+
active.open = false;
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
37
24
|
});
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
$:
|
|
26
|
+
classesBase = `${cBase} ${spacing} ${$$props.class ?? ""}`;
|
|
40
27
|
</script>
|
|
41
28
|
|
|
42
29
|
<!-- @component The Accordion parent element. -->
|
|
@@ -1,43 +1,26 @@
|
|
|
1
|
-
<script
|
|
2
|
-
/**
|
|
3
|
-
* @slot {{}} content - Allows for an optional leading element, such as an icon.
|
|
4
|
-
* @slot {{}} lead - Provide the summary details of each item.
|
|
5
|
-
* @slot {{}} summary - Provide the content details of each item.
|
|
6
|
-
*/
|
|
7
|
-
// Events:
|
|
8
|
-
// FORWARDED: do not document these, breaks the type definition
|
|
9
|
-
// DISPATCHED: document directly above the definition, like props (ex: paginator)
|
|
10
|
-
import { getContext } from 'svelte';
|
|
11
|
-
// Props
|
|
12
|
-
/** Defines the default open state on page load .*/
|
|
1
|
+
<script>import { getContext } from "svelte";
|
|
13
2
|
export let open = false;
|
|
14
|
-
|
|
15
|
-
export let
|
|
16
|
-
|
|
17
|
-
export let
|
|
18
|
-
|
|
19
|
-
export let
|
|
20
|
-
|
|
21
|
-
export let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Reactive Classes
|
|
36
|
-
$: classesDetails = `${cBaseDetails} ${spacing} ${$$props.class ?? ''}`;
|
|
37
|
-
$: classesSummary = `${cBaseSummary} ${padding} ${rounded} ${hover} ${regionSummary}`;
|
|
38
|
-
$: classesIconState = open ? '-rotate-180' : '';
|
|
39
|
-
$: classesIcon = `${cBaseIcon} ${classesIconState}`;
|
|
40
|
-
$: classesContent = `${padding} ${regionContent}`;
|
|
3
|
+
export let summaryId = "";
|
|
4
|
+
export let contentId = "";
|
|
5
|
+
export let regionSummary = "";
|
|
6
|
+
export let regionContent = "";
|
|
7
|
+
export let hover = getContext("hover");
|
|
8
|
+
export let spacing = getContext("spacing");
|
|
9
|
+
export let padding = getContext("padding");
|
|
10
|
+
export let rounded = getContext("rounded");
|
|
11
|
+
const cBaseDetails = "";
|
|
12
|
+
const cBaseSummary = "list-none flex items-center space-x-4 cursor-pointer";
|
|
13
|
+
const cBaseIcon = "flex justify-center items-center w-3 fill-black dark:fill-white transition-all duration-[100ms]";
|
|
14
|
+
$:
|
|
15
|
+
classesDetails = `${cBaseDetails} ${spacing} ${$$props.class ?? ""}`;
|
|
16
|
+
$:
|
|
17
|
+
classesSummary = `${cBaseSummary} ${padding} ${rounded} ${hover} ${regionSummary}`;
|
|
18
|
+
$:
|
|
19
|
+
classesIconState = open ? "-rotate-180" : "";
|
|
20
|
+
$:
|
|
21
|
+
classesIcon = `${cBaseIcon} ${classesIconState}`;
|
|
22
|
+
$:
|
|
23
|
+
classesContent = `${padding} ${regionContent}`;
|
|
41
24
|
</script>
|
|
42
25
|
|
|
43
26
|
<!-- @component The Accordion child element. -->
|
|
@@ -70,4 +53,5 @@ $: classesContent = `${padding} ${regionContent}`;
|
|
|
70
53
|
/* Note: let's keep this localized in case users want the arrows elsewhere */
|
|
71
54
|
details summary::-webkit-details-marker {
|
|
72
55
|
display: none;
|
|
73
|
-
}
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -1,41 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
|
|
10
|
-
export let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export let slotTrail = '';
|
|
24
|
-
// Props (a11y)
|
|
25
|
-
/** Provide a semantic ID for the ARIA label. */
|
|
26
|
-
export let label = '';
|
|
27
|
-
/** Provide the ID of the element that labels the toolbar. */
|
|
28
|
-
export let labelledby = '';
|
|
29
|
-
// Base Classes
|
|
30
|
-
const cBase = 'flex items-center';
|
|
31
|
-
const cLead = 'flex-none flex justify-between items-center';
|
|
32
|
-
const cCenter = 'flex-auto';
|
|
33
|
-
const cTrail = 'flex-none flex items-center space-x-4';
|
|
34
|
-
// Reactive Classes
|
|
35
|
-
$: classesBase = `${cBase} ${background} ${border} ${padding} ${shadow} ${space} ${$$props.class ?? ''}`;
|
|
36
|
-
$: classesLead = `${cLead} ${slotLead}`;
|
|
37
|
-
$: classesCenter = `${cCenter} ${slotDefault}`;
|
|
38
|
-
$: classesTrail = `${cTrail} ${slotTrail}`;
|
|
1
|
+
<script>export let background = "bg-surface-100-800-token";
|
|
2
|
+
export let border = "";
|
|
3
|
+
export let padding = "p-4";
|
|
4
|
+
export let shadow = "shadow-lg";
|
|
5
|
+
export let space = "space-x-4";
|
|
6
|
+
export let slotLead = "";
|
|
7
|
+
export let slotDefault = "";
|
|
8
|
+
export let slotTrail = "";
|
|
9
|
+
export let label = "";
|
|
10
|
+
export let labelledby = "";
|
|
11
|
+
const cBase = "flex items-center";
|
|
12
|
+
const cLead = "flex-none flex justify-between items-center";
|
|
13
|
+
const cCenter = "flex-auto";
|
|
14
|
+
const cTrail = "flex-none flex items-center space-x-4";
|
|
15
|
+
$:
|
|
16
|
+
classesBase = `${cBase} ${background} ${border} ${padding} ${shadow} ${space} ${$$props.class ?? ""}`;
|
|
17
|
+
$:
|
|
18
|
+
classesLead = `${cLead} ${slotLead}`;
|
|
19
|
+
$:
|
|
20
|
+
classesCenter = `${cCenter} ${slotDefault}`;
|
|
21
|
+
$:
|
|
22
|
+
classesTrail = `${cTrail} ${slotTrail}`;
|
|
39
23
|
</script>
|
|
40
24
|
|
|
41
25
|
<div class="app-bar {classesBase}" data-testid="app-bar" role="toolbar" aria-label={label} aria-labelledby={labelledby}>
|
|
@@ -1,42 +1,21 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/** Provide classes to set the width. */
|
|
20
|
-
export let width = 'w-[70px] sm:w-20';
|
|
21
|
-
/** Provide classes to set the height. */
|
|
22
|
-
export let height = 'h-full';
|
|
23
|
-
/** Provide a class to set the grid gap. */
|
|
24
|
-
export let gap = 'gap-0';
|
|
25
|
-
// Props (regions)
|
|
26
|
-
/** Provide arbitrary classes to the lead region. */
|
|
27
|
-
export let regionLead = '';
|
|
28
|
-
/** Provide arbitrary classes to the default region. */
|
|
29
|
-
export let regionDefault = '';
|
|
30
|
-
/** Provide arbitrary classes to the trail region. */
|
|
31
|
-
export let regionTrail = '';
|
|
32
|
-
// Context
|
|
33
|
-
setContext('selected', selected);
|
|
34
|
-
setContext('active', active);
|
|
35
|
-
setContext('hover', hover);
|
|
36
|
-
// Base Classes
|
|
37
|
-
const cBase = 'grid grid-rows-[auto_1fr_auto] overflow-y-auto';
|
|
38
|
-
// Reactive
|
|
39
|
-
$: classesBase = `${cBase} ${background} ${width} ${height} ${gap} ${$$props.class || ''}`;
|
|
1
|
+
<script>import { setContext } from "svelte";
|
|
2
|
+
import { writable } from "svelte/store";
|
|
3
|
+
export let selected = writable(void 0);
|
|
4
|
+
export let background = "bg-surface-100-800-token";
|
|
5
|
+
export let active = "bg-primary-active-token";
|
|
6
|
+
export let hover = "bg-primary-hover-token";
|
|
7
|
+
export let width = "w-[70px] sm:w-20";
|
|
8
|
+
export let height = "h-full";
|
|
9
|
+
export let gap = "gap-0";
|
|
10
|
+
export let regionLead = "";
|
|
11
|
+
export let regionDefault = "";
|
|
12
|
+
export let regionTrail = "";
|
|
13
|
+
setContext("selected", selected);
|
|
14
|
+
setContext("active", active);
|
|
15
|
+
setContext("hover", hover);
|
|
16
|
+
const cBase = "grid grid-rows-[auto_1fr_auto] overflow-y-auto";
|
|
17
|
+
$:
|
|
18
|
+
classesBase = `${cBase} ${background} ${width} ${height} ${gap} ${$$props.class || ""}`;
|
|
40
19
|
</script>
|
|
41
20
|
|
|
42
21
|
<!-- @component A side navigation rail component. -->
|
|
@@ -1,44 +1,30 @@
|
|
|
1
|
-
<script>import { createEventDispatcher, getContext } from
|
|
2
|
-
// Event Handler
|
|
1
|
+
<script>import { createEventDispatcher, getContext } from "svelte";
|
|
3
2
|
const dispatch = createEventDispatcher();
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export let
|
|
10
|
-
|
|
11
|
-
export let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Props (region)
|
|
15
|
-
/** Provide abitrary classes to style the icon region. */
|
|
16
|
-
export let regionIcon = '';
|
|
17
|
-
/** Provide abitrary classes to style the label region. */
|
|
18
|
-
export let regionLabel = '';
|
|
19
|
-
// Context
|
|
20
|
-
export let selected = getContext('selected');
|
|
21
|
-
export let active = getContext('active');
|
|
22
|
-
export let hover = getContext('hover');
|
|
23
|
-
// Base Classes
|
|
24
|
-
const cBase = 'unstyled grid place-content-center place-items-center w-full aspect-square space-y-1.5 cursor-pointer';
|
|
25
|
-
const cLabel = 'text-xs text-center';
|
|
26
|
-
// Input Handler
|
|
3
|
+
export let value = void 0;
|
|
4
|
+
export let tag = "button";
|
|
5
|
+
export let label = "";
|
|
6
|
+
export let regionIcon = "";
|
|
7
|
+
export let regionLabel = "";
|
|
8
|
+
export let selected = getContext("selected");
|
|
9
|
+
export let active = getContext("active");
|
|
10
|
+
export let hover = getContext("hover");
|
|
11
|
+
const cBase = "unstyled grid place-content-center place-items-center w-full aspect-square space-y-1.5 cursor-pointer";
|
|
12
|
+
const cLabel = "text-xs text-center";
|
|
27
13
|
function onClickHandler(event) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
dispatch('click', event);
|
|
14
|
+
if (!$selected || !value)
|
|
15
|
+
return;
|
|
16
|
+
$selected = value;
|
|
17
|
+
dispatch("click", event);
|
|
33
18
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
$:
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
$:
|
|
20
|
+
classesActive = $selected && value && $selected === value ? `${active}` : "";
|
|
21
|
+
$:
|
|
22
|
+
classesBase = `${cBase} ${hover} ${classesActive} ${$$props.class || ""}`;
|
|
23
|
+
$:
|
|
24
|
+
classesLabel = `${cLabel} ${regionLabel}`;
|
|
39
25
|
function prunedRestProps() {
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
delete $$restProps.class;
|
|
27
|
+
return $$restProps;
|
|
42
28
|
}
|
|
43
29
|
</script>
|
|
44
30
|
|
|
@@ -1,41 +1,31 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const cSidebarRight = 'flex-none overflow-x-hidden overflow-y-auto';
|
|
30
|
-
// Reactive Classes
|
|
31
|
-
$: classesBase = `${cBaseAppShell} ${$$props.class ?? ''}`;
|
|
32
|
-
$: classesheader = `${slotHeader}`;
|
|
33
|
-
$: classesSidebarLeft = `${cSidebarLeft} ${slotSidebarLeft}`;
|
|
34
|
-
$: classesSidebarRight = `${cSidebarRight} ${slotSidebarRight}`;
|
|
35
|
-
$: classesPageHeader = `${slotPageHeader}`;
|
|
36
|
-
$: classesPageContent = `${slotPageContent}`;
|
|
37
|
-
$: classesPageFooter = `${slotPageFooter}`;
|
|
38
|
-
$: classesFooter = `${slotFooter}`;
|
|
1
|
+
<script>export let slotHeader = "z-10";
|
|
2
|
+
export let slotSidebarLeft = "w-auto";
|
|
3
|
+
export let slotSidebarRight = "w-auto";
|
|
4
|
+
export let slotPageHeader = "";
|
|
5
|
+
export let slotPageContent = "";
|
|
6
|
+
export let slotPageFooter = "";
|
|
7
|
+
export let slotFooter = "";
|
|
8
|
+
const cBaseAppShell = "w-full h-full flex flex-col overflow-hidden";
|
|
9
|
+
const cContentArea = "w-full h-full flex overflow-hidden";
|
|
10
|
+
const cPage = "flex-1 overflow-x-hidden overflow-y-auto flex flex-col";
|
|
11
|
+
const cSidebarLeft = "flex-none overflow-x-hidden overflow-y-auto";
|
|
12
|
+
const cSidebarRight = "flex-none overflow-x-hidden overflow-y-auto";
|
|
13
|
+
$:
|
|
14
|
+
classesBase = `${cBaseAppShell} ${$$props.class ?? ""}`;
|
|
15
|
+
$:
|
|
16
|
+
classesheader = `${slotHeader}`;
|
|
17
|
+
$:
|
|
18
|
+
classesSidebarLeft = `${cSidebarLeft} ${slotSidebarLeft}`;
|
|
19
|
+
$:
|
|
20
|
+
classesSidebarRight = `${cSidebarRight} ${slotSidebarRight}`;
|
|
21
|
+
$:
|
|
22
|
+
classesPageHeader = `${slotPageHeader}`;
|
|
23
|
+
$:
|
|
24
|
+
classesPageContent = `${slotPageContent}`;
|
|
25
|
+
$:
|
|
26
|
+
classesPageFooter = `${slotPageFooter}`;
|
|
27
|
+
$:
|
|
28
|
+
classesFooter = `${slotFooter}`;
|
|
39
29
|
</script>
|
|
40
30
|
|
|
41
31
|
<div id="appShell" class={classesBase} data-testid="app-shell">
|
|
@@ -1,36 +1,19 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
export let
|
|
4
|
-
|
|
5
|
-
export let
|
|
6
|
-
|
|
7
|
-
export let
|
|
8
|
-
|
|
9
|
-
export let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/** Initials only - Provide classes to set the SVG text fill color. */
|
|
18
|
-
export let fill = 'fill-token';
|
|
19
|
-
// Props (actions)
|
|
20
|
-
/** Provide the avatar image element source. */
|
|
21
|
-
export let src = '';
|
|
22
|
-
/**
|
|
23
|
-
* Image only. Provide an Svelte action reference, such as `filter`.
|
|
24
|
-
* @type {function}
|
|
25
|
-
*/
|
|
26
|
-
export let action = () => { };
|
|
27
|
-
/** Image only. Provide Svelte action params, such as Apollo. */
|
|
28
|
-
export let actionParams = '';
|
|
29
|
-
// Base Classes
|
|
30
|
-
let cBase = 'flex aspect-square text-surface-50 font-semibold justify-center items-center overflow-hidden isolate';
|
|
31
|
-
let cImage = 'w-full h-full object-cover';
|
|
32
|
-
// Reactive Classes
|
|
33
|
-
$: classesBase = `${cBase} ${background} ${width} ${border} ${rounded} ${shadow} ${cursor} ${$$props.class ?? ''}`;
|
|
1
|
+
<script>export let background = "bg-surface-400-500-token";
|
|
2
|
+
export let width = "w-12";
|
|
3
|
+
export let border = "";
|
|
4
|
+
export let rounded = "rounded-full";
|
|
5
|
+
export let shadow = "";
|
|
6
|
+
export let cursor = "";
|
|
7
|
+
export let initials = "AB";
|
|
8
|
+
export let fill = "fill-token";
|
|
9
|
+
export let src = "";
|
|
10
|
+
export let action = () => {
|
|
11
|
+
};
|
|
12
|
+
export let actionParams = "";
|
|
13
|
+
let cBase = "flex aspect-square text-surface-50 font-semibold justify-center items-center overflow-hidden isolate";
|
|
14
|
+
let cImage = "w-full h-full object-cover";
|
|
15
|
+
$:
|
|
16
|
+
classesBase = `${cBase} ${background} ${width} ${border} ${rounded} ${shadow} ${cursor} ${$$props.class ?? ""}`;
|
|
34
17
|
</script>
|
|
35
18
|
|
|
36
19
|
<figure class="avatar {classesBase}" data-testid="avatar" on:click on:keydown on:keyup on:keypress>
|
|
@@ -1,59 +1,43 @@
|
|
|
1
|
-
<script>import { tailwindDefaultColors } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Provide a data set of color stops and labels.
|
|
5
|
-
* @type {ConicStop[]}
|
|
6
|
-
*/
|
|
7
|
-
export let stops = [{ color: ['neutral', 500], start: 0, end: 100 }];
|
|
8
|
-
/** Allows for automatic generation of a legend below the conic gradient. */
|
|
1
|
+
<script>import { tailwindDefaultColors } from "./settings";
|
|
2
|
+
export let stops = [{ color: ["neutral", 500], start: 0, end: 100 }];
|
|
9
3
|
export let legend = false;
|
|
10
|
-
/** When enabled, the conic gradient will spin. */
|
|
11
4
|
export let spin = false;
|
|
12
|
-
|
|
13
|
-
export let
|
|
14
|
-
/** Provided classes to style the legend hover effect. */
|
|
15
|
-
export let hover = 'bg-primary-hover-token';
|
|
16
|
-
// Local
|
|
5
|
+
export let width = "w-full";
|
|
6
|
+
export let hover = "bg-primary-hover-token";
|
|
17
7
|
let cone;
|
|
18
8
|
let generatedLegendList;
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const cSwatch = 'block aspect-square bg-black w-5 rounded-full mr-2';
|
|
25
|
-
// Set Color
|
|
9
|
+
const cBase = "flex flex-col items-center space-y-4";
|
|
10
|
+
const cCaption = "text-center";
|
|
11
|
+
const cCone = "block aspect-square rounded-full";
|
|
12
|
+
const cLabel = "text-sm w-full";
|
|
13
|
+
const cSwatch = "block aspect-square bg-black w-5 rounded-full mr-2";
|
|
26
14
|
function setColorValue(color) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const colorSet = tailwindDefaultColors.find((c) => c.label === color[0]);
|
|
32
|
-
return colorSet?.shades[color[1]].hex;
|
|
15
|
+
if (typeof color === "string")
|
|
16
|
+
return color;
|
|
17
|
+
const colorSet = tailwindDefaultColors.find((c) => c.label === color[0]);
|
|
18
|
+
return colorSet?.shades[color[1]].hex;
|
|
33
19
|
}
|
|
34
|
-
// Generate Conic Gradient style
|
|
35
20
|
function genConicGradient() {
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
let d = stops.map((v) => `${setColorValue(v.color)} ${v.start}% ${v.end}%`);
|
|
22
|
+
cone = `conic-gradient(${d.join(", ")})`;
|
|
38
23
|
}
|
|
39
|
-
// Generate Legend
|
|
40
24
|
function genLegend() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
if (!legend)
|
|
26
|
+
return;
|
|
27
|
+
generatedLegendList = stops.map((v) => {
|
|
28
|
+
return {
|
|
29
|
+
label: v.label,
|
|
30
|
+
color: setColorValue(v.color),
|
|
31
|
+
value: v.end - v.start
|
|
32
|
+
};
|
|
33
|
+
});
|
|
50
34
|
}
|
|
51
|
-
// Lifecycle (on init)
|
|
52
35
|
genConicGradient();
|
|
53
36
|
genLegend();
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
$:
|
|
37
|
+
$:
|
|
38
|
+
classesBase = `${cBase} ${$$props.class ?? ""}`;
|
|
39
|
+
$:
|
|
40
|
+
classesCone = `${cCone} ${width}`;
|
|
57
41
|
</script>
|
|
58
42
|
|
|
59
43
|
<figure class="conic-gradient {classesBase}" data-testid="conic-gradient">
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
* @type {FileList}
|
|
4
|
-
*/
|
|
5
|
-
export let files;
|
|
6
|
-
/** Provide a button variant or other class styles. */
|
|
7
|
-
export let button = 'btn-filled-secondary';
|
|
1
|
+
<script>export let files;
|
|
2
|
+
export let button = "variant-filled-secondary";
|
|
8
3
|
let elemFileInput;
|
|
9
4
|
function onButtonClick() {
|
|
10
|
-
|
|
5
|
+
elemFileInput.click();
|
|
11
6
|
}
|
|
12
7
|
function prunedRestProps() {
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
delete $$restProps.class;
|
|
9
|
+
return $$restProps;
|
|
15
10
|
}
|
|
16
11
|
</script>
|
|
17
12
|
|
|
@@ -19,7 +14,15 @@ function prunedRestProps() {
|
|
|
19
14
|
<!-- Input: File -->
|
|
20
15
|
<input bind:this={elemFileInput} bind:files type="file" {...prunedRestProps()} class="file-button-input hidden" on:change />
|
|
21
16
|
<!-- Button -->
|
|
22
|
-
<button
|
|
17
|
+
<button
|
|
18
|
+
class="file-button-btn btn {button}"
|
|
19
|
+
type="button"
|
|
20
|
+
disabled={$$restProps.disabled}
|
|
21
|
+
on:click={onButtonClick}
|
|
22
|
+
on:keydown
|
|
23
|
+
on:keyup
|
|
24
|
+
on:keypress
|
|
25
|
+
>
|
|
23
26
|
<slot />
|
|
24
27
|
</button>
|
|
25
28
|
</div>
|