@skeletonlabs/skeleton 2.10.0 → 3.0.0-next.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/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -0
- package/dist/plugin/index.cjs +419 -0
- package/dist/plugin/index.cjs.map +1 -0
- package/dist/plugin/index.d.ts +270 -0
- package/dist/themes/index.d.ts +1117 -0
- package/dist/themes/index.js +935 -0
- package/dist/themes/index.js.map +1 -0
- package/package.json +32 -51
- package/README.md +0 -38
- package/dist/actions/Clipboard/clipboard.d.ts +0 -11
- package/dist/actions/Clipboard/clipboard.js +0 -64
- package/dist/actions/Filters/filter.d.ts +0 -6
- package/dist/actions/Filters/filter.js +0 -16
- package/dist/actions/Filters/svg-filters/Apollo.svelte +0 -13
- package/dist/actions/Filters/svg-filters/Apollo.svelte.d.ts +0 -23
- package/dist/actions/Filters/svg-filters/BlueNight.svelte +0 -12
- package/dist/actions/Filters/svg-filters/BlueNight.svelte.d.ts +0 -23
- package/dist/actions/Filters/svg-filters/Emerald.svelte +0 -23
- package/dist/actions/Filters/svg-filters/Emerald.svelte.d.ts +0 -23
- package/dist/actions/Filters/svg-filters/GreenFall.svelte +0 -27
- package/dist/actions/Filters/svg-filters/GreenFall.svelte.d.ts +0 -23
- package/dist/actions/Filters/svg-filters/Noir.svelte +0 -17
- package/dist/actions/Filters/svg-filters/Noir.svelte.d.ts +0 -23
- package/dist/actions/Filters/svg-filters/NoirLight.svelte +0 -19
- package/dist/actions/Filters/svg-filters/NoirLight.svelte.d.ts +0 -23
- package/dist/actions/Filters/svg-filters/Rustic.svelte +0 -14
- package/dist/actions/Filters/svg-filters/Rustic.svelte.d.ts +0 -23
- package/dist/actions/Filters/svg-filters/Summer84.svelte +0 -12
- package/dist/actions/Filters/svg-filters/Summer84.svelte.d.ts +0 -23
- package/dist/actions/Filters/svg-filters/XPro.svelte +0 -12
- package/dist/actions/Filters/svg-filters/XPro.svelte.d.ts +0 -23
- package/dist/actions/FocusTrap/focusTrap.d.ts +0 -4
- package/dist/actions/FocusTrap/focusTrap.js +0 -89
- package/dist/components/Accordion/Accordion.svelte +0 -49
- package/dist/components/Accordion/Accordion.svelte.d.ts +0 -56
- package/dist/components/Accordion/AccordionItem.svelte +0 -126
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +0 -73
- package/dist/components/AppBar/AppBar.svelte +0 -53
- package/dist/components/AppBar/AppBar.svelte.d.ts +0 -49
- package/dist/components/AppRail/AppRail.svelte +0 -41
- package/dist/components/AppRail/AppRail.svelte.d.ts +0 -45
- package/dist/components/AppRail/AppRailAnchor.svelte +0 -47
- package/dist/components/AppRail/AppRailAnchor.svelte.d.ts +0 -38
- package/dist/components/AppRail/AppRailTile.svelte +0 -60
- package/dist/components/AppRail/AppRailTile.svelte.d.ts +0 -45
- package/dist/components/AppShell/AppShell.svelte +0 -72
- package/dist/components/AppShell/AppShell.svelte.d.ts +0 -44
- package/dist/components/Autocomplete/Autocomplete.svelte +0 -98
- package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +0 -58
- package/dist/components/Autocomplete/types.d.ts +0 -10
- package/dist/components/Autocomplete/types.js +0 -2
- package/dist/components/Avatar/Avatar.svelte +0 -52
- package/dist/components/Avatar/Avatar.svelte.d.ts +0 -45
- package/dist/components/ConicGradient/ConicGradient.svelte +0 -75
- package/dist/components/ConicGradient/ConicGradient.svelte.d.ts +0 -37
- package/dist/components/ConicGradient/settings.d.ts +0 -9
- package/dist/components/ConicGradient/settings.js +0 -334
- package/dist/components/ConicGradient/types.d.ts +0 -10
- package/dist/components/ConicGradient/types.js +0 -2
- package/dist/components/FileButton/FileButton.svelte +0 -37
- package/dist/components/FileButton/FileButton.svelte.d.ts +0 -33
- package/dist/components/FileDropzone/FileDropzone.svelte +0 -63
- package/dist/components/FileDropzone/FileDropzone.svelte.d.ts +0 -55
- package/dist/components/InputChip/InputChip.svelte +0 -203
- package/dist/components/InputChip/InputChip.svelte.d.ts +0 -114
- package/dist/components/ListBox/ListBox.svelte +0 -29
- package/dist/components/ListBox/ListBox.svelte.d.ts +0 -40
- package/dist/components/ListBox/ListBoxItem.svelte +0 -117
- package/dist/components/ListBox/ListBoxItem.svelte.d.ts +0 -41
- package/dist/components/Paginator/Paginator.svelte +0 -190
- package/dist/components/Paginator/Paginator.svelte.d.ts +0 -68
- package/dist/components/Paginator/icons.d.ts +0 -4
- package/dist/components/Paginator/icons.js +0 -4
- package/dist/components/Paginator/types.d.ts +0 -10
- package/dist/components/Paginator/types.js +0 -2
- package/dist/components/ProgressBar/ProgressBar.svelte +0 -50
- package/dist/components/ProgressBar/ProgressBar.svelte.d.ts +0 -36
- package/dist/components/ProgressRadial/ProgressRadial.svelte +0 -73
- package/dist/components/ProgressRadial/ProgressRadial.svelte.d.ts +0 -38
- package/dist/components/Radio/RadioGroup.svelte +0 -29
- package/dist/components/Radio/RadioGroup.svelte.d.ts +0 -44
- package/dist/components/Radio/RadioItem.svelte +0 -61
- package/dist/components/Radio/RadioItem.svelte.d.ts +0 -41
- package/dist/components/RangeSlider/RangeSlider.svelte +0 -72
- package/dist/components/RangeSlider/RangeSlider.svelte.d.ts +0 -41
- package/dist/components/Ratings/Ratings.svelte +0 -52
- package/dist/components/Ratings/Ratings.svelte.d.ts +0 -41
- package/dist/components/SlideToggle/SlideToggle.svelte +0 -91
- package/dist/components/SlideToggle/SlideToggle.svelte.d.ts +0 -44
- package/dist/components/Stepper/Step.svelte +0 -97
- package/dist/components/Stepper/Step.svelte.d.ts +0 -56
- package/dist/components/Stepper/Stepper.svelte +0 -107
- package/dist/components/Stepper/Stepper.svelte.d.ts +0 -85
- package/dist/components/Stepper/types.d.ts +0 -25
- package/dist/components/Stepper/types.js +0 -1
- package/dist/components/Tab/Tab.svelte +0 -95
- package/dist/components/Tab/Tab.svelte.d.ts +0 -49
- package/dist/components/Tab/TabAnchor.svelte +0 -45
- package/dist/components/Tab/TabAnchor.svelte.d.ts +0 -44
- package/dist/components/Tab/TabGroup.svelte +0 -42
- package/dist/components/Tab/TabGroup.svelte.d.ts +0 -43
- package/dist/components/Table/Table.svelte +0 -86
- package/dist/components/Table/Table.svelte.d.ts +0 -42
- package/dist/components/Table/actions.d.ts +0 -8
- package/dist/components/Table/actions.js +0 -114
- package/dist/components/Table/types.d.ts +0 -10
- package/dist/components/Table/types.js +0 -1
- package/dist/components/Table/utils.d.ts +0 -7
- package/dist/components/Table/utils.js +0 -33
- package/dist/components/TreeView/RecursiveTreeView.svelte +0 -64
- package/dist/components/TreeView/RecursiveTreeView.svelte.d.ts +0 -63
- package/dist/components/TreeView/RecursiveTreeViewItem.svelte +0 -141
- package/dist/components/TreeView/RecursiveTreeViewItem.svelte.d.ts +0 -38
- package/dist/components/TreeView/TreeView.svelte +0 -68
- package/dist/components/TreeView/TreeView.svelte.d.ts +0 -55
- package/dist/components/TreeView/TreeViewItem.svelte +0 -319
- package/dist/components/TreeView/TreeViewItem.svelte.d.ts +0 -145
- package/dist/components/TreeView/types.d.ts +0 -17
- package/dist/components/TreeView/types.js +0 -1
- package/dist/index.d.ts +0 -75
- package/dist/index.js +0 -79
- package/dist/internal/transitions.d.ts +0 -10
- package/dist/internal/transitions.js +0 -11
- package/dist/transitions/crossfade.d.ts +0 -1
- package/dist/transitions/crossfade.js +0 -21
- package/dist/types.d.ts +0 -8
- package/dist/types.js +0 -1
- package/dist/utilities/CodeBlock/CodeBlock.svelte +0 -70
- package/dist/utilities/CodeBlock/CodeBlock.svelte.d.ts +0 -43
- package/dist/utilities/CodeBlock/stores.d.ts +0 -2
- package/dist/utilities/CodeBlock/stores.js +0 -3
- package/dist/utilities/Drawer/Drawer.svelte +0 -182
- package/dist/utilities/Drawer/Drawer.svelte.d.ts +0 -62
- package/dist/utilities/Drawer/stores.d.ts +0 -34
- package/dist/utilities/Drawer/stores.js +0 -50
- package/dist/utilities/Drawer/types.d.ts +0 -42
- package/dist/utilities/Drawer/types.js +0 -2
- package/dist/utilities/LightSwitch/LightSwitch.svelte +0 -78
- package/dist/utilities/LightSwitch/LightSwitch.svelte.d.ts +0 -39
- package/dist/utilities/LightSwitch/lightswitch.d.ts +0 -21
- package/dist/utilities/LightSwitch/lightswitch.js +0 -72
- package/dist/utilities/LocalStorageStore/LocalStorageStore.d.ts +0 -12
- package/dist/utilities/LocalStorageStore/LocalStorageStore.js +0 -49
- package/dist/utilities/Modal/Modal.svelte +0 -247
- package/dist/utilities/Modal/Modal.svelte.d.ts +0 -72
- package/dist/utilities/Modal/ModalTest.svelte +0 -8
- package/dist/utilities/Modal/ModalTest.svelte.d.ts +0 -17
- package/dist/utilities/Modal/stores.d.ts +0 -36
- package/dist/utilities/Modal/stores.js +0 -54
- package/dist/utilities/Modal/types.d.ts +0 -41
- package/dist/utilities/Modal/types.js +0 -2
- package/dist/utilities/Popup/popup.d.ts +0 -7
- package/dist/utilities/Popup/popup.js +0 -240
- package/dist/utilities/Popup/types.d.ts +0 -40
- package/dist/utilities/Popup/types.js +0 -2
- package/dist/utilities/PrefersReducedMotion/PrefersReducedMotion.d.ts +0 -7
- package/dist/utilities/PrefersReducedMotion/PrefersReducedMotion.js +0 -26
- package/dist/utilities/TableOfContents/TableOfContents.svelte +0 -56
- package/dist/utilities/TableOfContents/TableOfContents.svelte.d.ts +0 -34
- package/dist/utilities/TableOfContents/crawler.d.ts +0 -16
- package/dist/utilities/TableOfContents/crawler.js +0 -78
- package/dist/utilities/TableOfContents/stores.d.ts +0 -6
- package/dist/utilities/TableOfContents/stores.js +0 -5
- package/dist/utilities/TableOfContents/types.d.ts +0 -5
- package/dist/utilities/TableOfContents/types.js +0 -2
- package/dist/utilities/Toast/Toast.svelte +0 -150
- package/dist/utilities/Toast/Toast.svelte.d.ts +0 -55
- package/dist/utilities/Toast/ToastTest.svelte +0 -16
- package/dist/utilities/Toast/ToastTest.svelte.d.ts +0 -20
- package/dist/utilities/Toast/stores.d.ts +0 -37
- package/dist/utilities/Toast/stores.js +0 -107
- package/dist/utilities/Toast/types.d.ts +0 -35
- package/dist/utilities/Toast/types.js +0 -2
- package/dist/utilities/index.d.ts +0 -18
- package/dist/utilities/index.js +0 -25
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
/** Provide classes to set background color.*/
|
|
6
|
-
background?: string | undefined;
|
|
7
|
-
/** Provide classes to set border styles.*/
|
|
8
|
-
border?: string | undefined;
|
|
9
|
-
/** Provide classes to set padding.*/
|
|
10
|
-
padding?: string | undefined;
|
|
11
|
-
/** Provide classes to define a box shadow.*/
|
|
12
|
-
shadow?: string | undefined;
|
|
13
|
-
/** Provide classes to set the vertical spacing between rows.*/
|
|
14
|
-
spacing?: string | undefined;
|
|
15
|
-
/** Provide classes to set grid columns for the main row.*/
|
|
16
|
-
gridColumns?: string | undefined;
|
|
17
|
-
/** Provide classes to set gap spacing for the main row.*/
|
|
18
|
-
gap?: string | undefined;
|
|
19
|
-
/** Provide arbitrary classes to style the top (main) row.*/
|
|
20
|
-
regionRowMain?: string | undefined;
|
|
21
|
-
/** Provide arbitrary classes to style the bottom (headline) row.*/
|
|
22
|
-
regionRowHeadline?: string | undefined;
|
|
23
|
-
/** Classes to apply to the lead slot container element*/
|
|
24
|
-
slotLead?: string | undefined;
|
|
25
|
-
/** Classes to apply to the default slot container element*/
|
|
26
|
-
slotDefault?: string | undefined;
|
|
27
|
-
/** Classes to apply to the trail slot container element*/
|
|
28
|
-
slotTrail?: string | undefined;
|
|
29
|
-
/** Provide a semantic ID for the ARIA label.*/
|
|
30
|
-
label?: string | undefined;
|
|
31
|
-
/** Provide the ID of the element that labels the toolbar.*/
|
|
32
|
-
labelledby?: string | undefined;
|
|
33
|
-
};
|
|
34
|
-
events: {
|
|
35
|
-
[evt: string]: CustomEvent<any>;
|
|
36
|
-
};
|
|
37
|
-
slots: {
|
|
38
|
-
lead: {};
|
|
39
|
-
default: {};
|
|
40
|
-
trail: {};
|
|
41
|
-
headline: {};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export type AppBarProps = typeof __propDef.props;
|
|
45
|
-
export type AppBarEvents = typeof __propDef.events;
|
|
46
|
-
export type AppBarSlots = typeof __propDef.slots;
|
|
47
|
-
export default class AppBar extends SvelteComponentTyped<AppBarProps, AppBarEvents, AppBarSlots> {
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<script>import { setContext } from "svelte";
|
|
2
|
-
export let background = "bg-surface-100-800-token";
|
|
3
|
-
export let border = "";
|
|
4
|
-
export let width = "w-20";
|
|
5
|
-
export let height = "h-full";
|
|
6
|
-
export let gap = "gap-0";
|
|
7
|
-
export let regionLead = "";
|
|
8
|
-
export let regionDefault = "";
|
|
9
|
-
export let regionTrail = "";
|
|
10
|
-
export let hover = "bg-primary-hover-token";
|
|
11
|
-
export let active = "bg-primary-active-token";
|
|
12
|
-
export let spacing = "space-y-1";
|
|
13
|
-
export let aspectRatio = "aspect-square";
|
|
14
|
-
setContext("active", active);
|
|
15
|
-
setContext("hover", hover);
|
|
16
|
-
setContext("spacing", spacing);
|
|
17
|
-
setContext("aspectRatio", aspectRatio);
|
|
18
|
-
const cBase = "grid grid-rows-[auto_1fr_auto] overflow-y-auto";
|
|
19
|
-
const cRegionLead = "box-border";
|
|
20
|
-
const cRegionDefault = "box-border";
|
|
21
|
-
const cRegionTrail = "box-border";
|
|
22
|
-
$:
|
|
23
|
-
classesBase = `${cBase} ${background} ${border} ${width} ${height} ${gap} ${$$props.class || ""}`;
|
|
24
|
-
$:
|
|
25
|
-
classesRegionLead = `${cRegionLead} ${regionLead}`;
|
|
26
|
-
$:
|
|
27
|
-
classesRegionDefault = `${cRegionDefault} ${regionDefault}`;
|
|
28
|
-
$:
|
|
29
|
-
classesRegionTrail = `${cRegionTrail} ${regionTrail}`;
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<!-- @component A vertical navigation rail component. -->
|
|
33
|
-
|
|
34
|
-
<div class="app-rail {classesBase}" data-testid="app-rail">
|
|
35
|
-
<!-- Slot: lead -->
|
|
36
|
-
<div class="app-bar-lead {classesRegionLead}"><slot name="lead" /></div>
|
|
37
|
-
<!-- Slot: Default -->
|
|
38
|
-
<div class="app-bar-default {classesRegionDefault}"><slot /></div>
|
|
39
|
-
<!-- Slot: lead -->
|
|
40
|
-
<div class="app-bar-trail {classesRegionTrail}"><slot name="trail" /></div>
|
|
41
|
-
</div>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
/** Rail: Provide classes to set the background color.*/
|
|
6
|
-
background?: string | undefined;
|
|
7
|
-
/** Rail: Provide classes to set the border color.*/
|
|
8
|
-
border?: string | undefined;
|
|
9
|
-
/** Rail: Provide classes to set the width.*/
|
|
10
|
-
width?: string | undefined;
|
|
11
|
-
/** Rail: Provide classes to set the height.*/
|
|
12
|
-
height?: string | undefined;
|
|
13
|
-
/** Rail: Provide a class to set the grid gap.*/
|
|
14
|
-
gap?: string | undefined;
|
|
15
|
-
/** Rail: Provide arbitrary classes to the lead region.*/
|
|
16
|
-
regionLead?: string | undefined;
|
|
17
|
-
/** Rail: Provide arbitrary classes to the default region.*/
|
|
18
|
-
regionDefault?: string | undefined;
|
|
19
|
-
/** Rail: Provide arbitrary classes to the trail region.*/
|
|
20
|
-
regionTrail?: string | undefined;
|
|
21
|
-
/** Provide classes to set the tile/anchor hover background color.*/
|
|
22
|
-
hover?: string | undefined;
|
|
23
|
-
/** Provide classes to set the tile/anchor active tile background.*/
|
|
24
|
-
active?: string | undefined;
|
|
25
|
-
/** Provide classes to set the tile/anchor vertical spacing.*/
|
|
26
|
-
spacing?: string | undefined;
|
|
27
|
-
/** Provide classes to set the tile/anchor aspect ratio.*/
|
|
28
|
-
aspectRatio?: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
events: {
|
|
31
|
-
[evt: string]: CustomEvent<any>;
|
|
32
|
-
};
|
|
33
|
-
slots: {
|
|
34
|
-
lead: {};
|
|
35
|
-
default: {};
|
|
36
|
-
trail: {};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export type AppRailProps = typeof __propDef.props;
|
|
40
|
-
export type AppRailEvents = typeof __propDef.events;
|
|
41
|
-
export type AppRailSlots = typeof __propDef.slots;
|
|
42
|
-
/** A vertical navigation rail component. */
|
|
43
|
-
export default class AppRail extends SvelteComponentTyped<AppRailProps, AppRailEvents, AppRailSlots> {
|
|
44
|
-
}
|
|
45
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<script>import { getContext } from "svelte";
|
|
2
|
-
export let selected = false;
|
|
3
|
-
export let regionLead = "flex justify-center items-center";
|
|
4
|
-
export let regionLabel = "";
|
|
5
|
-
export let hover = getContext("hover");
|
|
6
|
-
export let active = getContext("active");
|
|
7
|
-
export let spacing = getContext("spacing");
|
|
8
|
-
export let aspectRatio = getContext("aspectRatio");
|
|
9
|
-
const cBase = "unstyled";
|
|
10
|
-
const cWrapper = "w-full flex flex-col justify-center items-stretch text-center space-y-1";
|
|
11
|
-
const cLabel = "font-bold text-xs";
|
|
12
|
-
$:
|
|
13
|
-
classActive = selected ? active : "";
|
|
14
|
-
$:
|
|
15
|
-
classesBase = `${cBase} ${$$props.class || ""}`;
|
|
16
|
-
$:
|
|
17
|
-
classesWrapper = `${cWrapper} ${aspectRatio} ${hover} ${spacing} ${classActive}`;
|
|
18
|
-
$:
|
|
19
|
-
classesLead = `${regionLead}`;
|
|
20
|
-
$:
|
|
21
|
-
classesLabel = `${cLabel} ${regionLabel}`;
|
|
22
|
-
function prunedRestProps() {
|
|
23
|
-
delete $$restProps.class;
|
|
24
|
-
return $$restProps;
|
|
25
|
-
}
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<a
|
|
29
|
-
class="app-rail-anchor {classesBase}"
|
|
30
|
-
href={$$props.href}
|
|
31
|
-
{...prunedRestProps()}
|
|
32
|
-
role="button"
|
|
33
|
-
on:click
|
|
34
|
-
on:keydown
|
|
35
|
-
on:keyup
|
|
36
|
-
on:keypress
|
|
37
|
-
on:mouseover
|
|
38
|
-
on:mouseleave
|
|
39
|
-
on:focus
|
|
40
|
-
on:blur
|
|
41
|
-
data-testid="app-rail-anchor"
|
|
42
|
-
>
|
|
43
|
-
<div class="app-rail-wrapper {classesWrapper}">
|
|
44
|
-
{#if $$slots.lead}<div class="app-rail-lead {classesLead}"><slot name="lead" /></div>{/if}
|
|
45
|
-
<div class="app-rail-label {classesLabel}"><slot /></div>
|
|
46
|
-
</div>
|
|
47
|
-
</a>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
/** Enables the active state styles when set true.*/
|
|
6
|
-
selected?: boolean | undefined;
|
|
7
|
-
/** Provide arbitrary classes to style the lead region.*/
|
|
8
|
-
regionLead?: string | undefined;
|
|
9
|
-
/** Provide arbitrary classes to style the label region.*/
|
|
10
|
-
regionLabel?: string | undefined;
|
|
11
|
-
hover?: string | undefined;
|
|
12
|
-
active?: string | undefined;
|
|
13
|
-
spacing?: string | undefined;
|
|
14
|
-
aspectRatio?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
click: MouseEvent;
|
|
18
|
-
keydown: KeyboardEvent;
|
|
19
|
-
keyup: KeyboardEvent;
|
|
20
|
-
keypress: KeyboardEvent;
|
|
21
|
-
mouseover: MouseEvent;
|
|
22
|
-
mouseleave: MouseEvent;
|
|
23
|
-
focus: FocusEvent;
|
|
24
|
-
blur: FocusEvent;
|
|
25
|
-
} & {
|
|
26
|
-
[evt: string]: CustomEvent<any>;
|
|
27
|
-
};
|
|
28
|
-
slots: {
|
|
29
|
-
lead: {};
|
|
30
|
-
default: {};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export type AppRailAnchorProps = typeof __propDef.props;
|
|
34
|
-
export type AppRailAnchorEvents = typeof __propDef.events;
|
|
35
|
-
export type AppRailAnchorSlots = typeof __propDef.slots;
|
|
36
|
-
export default class AppRailAnchor extends SvelteComponentTyped<AppRailAnchorProps, AppRailAnchorEvents, AppRailAnchorSlots> {
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<script>import { getContext } from "svelte";
|
|
2
|
-
export let group;
|
|
3
|
-
export let name;
|
|
4
|
-
export let value;
|
|
5
|
-
export let title = "";
|
|
6
|
-
export let regionLead = "";
|
|
7
|
-
export let regionLabel = "";
|
|
8
|
-
export let hover = getContext("hover");
|
|
9
|
-
export let active = getContext("active");
|
|
10
|
-
export let spacing = getContext("spacing");
|
|
11
|
-
export let width = getContext("width");
|
|
12
|
-
export let aspectRatio = getContext("aspectRatio");
|
|
13
|
-
const cBase = "cursor-pointer";
|
|
14
|
-
const cWrapper = "flex flex-col justify-center items-stretch w-full";
|
|
15
|
-
const cInterface = "text-center";
|
|
16
|
-
const cLabel = "font-bold text-xs";
|
|
17
|
-
let elemInput;
|
|
18
|
-
$:
|
|
19
|
-
classActive = group === value ? active : "";
|
|
20
|
-
$:
|
|
21
|
-
classesBase = `${cBase} ${$$props.class || ""}`;
|
|
22
|
-
$:
|
|
23
|
-
classesWrapper = `${cWrapper} ${aspectRatio} ${width} ${hover} ${classActive}`;
|
|
24
|
-
$:
|
|
25
|
-
classesInterface = `${cInterface} ${spacing}`;
|
|
26
|
-
$:
|
|
27
|
-
classesLead = `${regionLead}`;
|
|
28
|
-
$:
|
|
29
|
-
classesLabel = `${cLabel} ${regionLabel}`;
|
|
30
|
-
function onKeyDown(event) {
|
|
31
|
-
if (["Enter", "Space"].includes(event.code)) {
|
|
32
|
-
event.preventDefault();
|
|
33
|
-
selectElemInput();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function selectElemInput() {
|
|
37
|
-
elemInput.click();
|
|
38
|
-
}
|
|
39
|
-
function prunedRestProps() {
|
|
40
|
-
delete $$restProps.class;
|
|
41
|
-
return $$restProps;
|
|
42
|
-
}
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<label class="app-rail-tile {classesBase}" data-testid="app-rail-tile" {title} on:mouseover on:mouseleave on:focus on:blur>
|
|
46
|
-
<!-- A11y attributes are not allowed on <label> -->
|
|
47
|
-
<!-- FIXME: resolve a11y warnings -->
|
|
48
|
-
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
49
|
-
<button class="app-rail-wrapper {classesWrapper}" tabindex="0" on:click={selectElemInput} on:keydown={onKeyDown} on:keyup on:keypress>
|
|
50
|
-
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
51
|
-
<div class="h-0 w-0 overflow-hidden">
|
|
52
|
-
<input bind:this={elemInput} type="radio" bind:group {name} {value} {...prunedRestProps()} tabindex="-1" on:click on:change />
|
|
53
|
-
</div>
|
|
54
|
-
<!-- Interface -->
|
|
55
|
-
<div class="app-rail-interface {classesInterface}">
|
|
56
|
-
{#if $$slots.lead}<div class="app-rail-lead {classesLead}"><slot name="lead" /></div>{/if}
|
|
57
|
-
<div class="app-rail-label {classesLabel}"><slot /></div>
|
|
58
|
-
</div>
|
|
59
|
-
</button>
|
|
60
|
-
</label>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
/** Set the radio group binding value.*/
|
|
6
|
-
group: any;
|
|
7
|
-
/** Set a unique name value for the input.*/
|
|
8
|
-
name: string;
|
|
9
|
-
/** Set the input's value.*/
|
|
10
|
-
value: any;
|
|
11
|
-
/** Provide a hoverable title attribute for the tile.*/
|
|
12
|
-
title?: string | undefined;
|
|
13
|
-
/** Provide arbitrary classes to style the lead region.*/
|
|
14
|
-
regionLead?: string | undefined;
|
|
15
|
-
/** Provide arbitrary classes to style the label region.*/
|
|
16
|
-
regionLabel?: string | undefined;
|
|
17
|
-
hover?: string | undefined;
|
|
18
|
-
active?: string | undefined;
|
|
19
|
-
spacing?: string | undefined;
|
|
20
|
-
width?: string | undefined;
|
|
21
|
-
aspectRatio?: string | undefined;
|
|
22
|
-
};
|
|
23
|
-
events: {
|
|
24
|
-
mouseover: MouseEvent;
|
|
25
|
-
mouseleave: MouseEvent;
|
|
26
|
-
focus: FocusEvent;
|
|
27
|
-
blur: FocusEvent;
|
|
28
|
-
keyup: KeyboardEvent;
|
|
29
|
-
keypress: KeyboardEvent;
|
|
30
|
-
click: MouseEvent;
|
|
31
|
-
change: Event;
|
|
32
|
-
} & {
|
|
33
|
-
[evt: string]: CustomEvent<any>;
|
|
34
|
-
};
|
|
35
|
-
slots: {
|
|
36
|
-
lead: {};
|
|
37
|
-
default: {};
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export type AppRailTileProps = typeof __propDef.props;
|
|
41
|
-
export type AppRailTileEvents = typeof __propDef.events;
|
|
42
|
-
export type AppRailTileSlots = typeof __propDef.slots;
|
|
43
|
-
export default class AppRailTile extends SvelteComponentTyped<AppRailTileProps, AppRailTileEvents, AppRailTileSlots> {
|
|
44
|
-
}
|
|
45
|
-
export {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<script>export let scrollbarGutter = "auto";
|
|
2
|
-
export let regionPage = "";
|
|
3
|
-
export let slotHeader = "z-10";
|
|
4
|
-
export let slotSidebarLeft = "w-auto";
|
|
5
|
-
export let slotSidebarRight = "w-auto";
|
|
6
|
-
export let slotPageHeader = "";
|
|
7
|
-
export let slotPageContent = "";
|
|
8
|
-
export let slotPageFooter = "";
|
|
9
|
-
export let slotFooter = "";
|
|
10
|
-
const cBaseAppShell = "w-full h-full flex flex-col overflow-hidden";
|
|
11
|
-
const cContentArea = "w-full h-full flex overflow-hidden";
|
|
12
|
-
const cPage = "flex-1 overflow-x-hidden flex flex-col";
|
|
13
|
-
const cSidebarLeft = "flex-none overflow-x-hidden overflow-y-auto";
|
|
14
|
-
const cSidebarRight = "flex-none overflow-x-hidden overflow-y-auto";
|
|
15
|
-
$:
|
|
16
|
-
classesBase = `${cBaseAppShell} ${$$props.class ?? ""}`;
|
|
17
|
-
$:
|
|
18
|
-
classesHeader = `${slotHeader}`;
|
|
19
|
-
$:
|
|
20
|
-
classesSidebarLeft = `${cSidebarLeft} ${slotSidebarLeft}`;
|
|
21
|
-
$:
|
|
22
|
-
classesSidebarRight = `${cSidebarRight} ${slotSidebarRight}`;
|
|
23
|
-
$:
|
|
24
|
-
classesPageHeader = `${slotPageHeader}`;
|
|
25
|
-
$:
|
|
26
|
-
classesPageContent = `${slotPageContent}`;
|
|
27
|
-
$:
|
|
28
|
-
classesPageFooter = `${slotPageFooter}`;
|
|
29
|
-
$:
|
|
30
|
-
classesFooter = `${slotFooter}`;
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<div id="appShell" class={classesBase} data-testid="app-shell">
|
|
34
|
-
<!-- Slot: Header -->
|
|
35
|
-
{#if $$slots.header}
|
|
36
|
-
<header id="shell-header" class="flex-none {classesHeader}"><slot name="header" /></header>
|
|
37
|
-
{/if}
|
|
38
|
-
|
|
39
|
-
<!-- Content Area -->
|
|
40
|
-
<div class="flex-auto {cContentArea}">
|
|
41
|
-
<!-- Slot: Sidebar (left) -->
|
|
42
|
-
{#if $$slots.sidebarLeft}
|
|
43
|
-
<aside id="sidebar-left" class={classesSidebarLeft}><slot name="sidebarLeft" /></aside>
|
|
44
|
-
{/if}
|
|
45
|
-
|
|
46
|
-
<!-- Page -->
|
|
47
|
-
<div id="page" class="{regionPage} {cPage}" style:scrollbar-gutter={scrollbarGutter} on:scroll>
|
|
48
|
-
<!-- Slot: Page Header -->
|
|
49
|
-
{#if $$slots.pageHeader}
|
|
50
|
-
<header id="page-header" class="flex-none {classesPageHeader}"><slot name="pageHeader">(slot:header)</slot></header>
|
|
51
|
-
{/if}
|
|
52
|
-
|
|
53
|
-
<!-- Slot: Page Content (default) -->
|
|
54
|
-
<main id="page-content" class="flex-auto {classesPageContent}"><slot /></main>
|
|
55
|
-
|
|
56
|
-
<!-- Slot: Page Footer -->
|
|
57
|
-
{#if $$slots.pageFooter}
|
|
58
|
-
<footer id="page-footer" class="flex-none {classesPageFooter}"><slot name="pageFooter">(slot:footer)</slot></footer>
|
|
59
|
-
{/if}
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<!-- Slot: Sidebar (right) -->
|
|
63
|
-
{#if $$slots.sidebarRight}
|
|
64
|
-
<aside id="sidebar-right" class={classesSidebarRight}><slot name="sidebarRight" /></aside>
|
|
65
|
-
{/if}
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<!-- Slot: footer -->
|
|
69
|
-
{#if $$slots.footer}
|
|
70
|
-
<footer id="shell-footer" class="flex-none {classesFooter}"><slot name="footer" /></footer>
|
|
71
|
-
{/if}
|
|
72
|
-
</div>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
/** Set `scrollbar-gutter` style.*/
|
|
6
|
-
scrollbarGutter?: string | undefined;
|
|
7
|
-
/** Apply arbitrary classes to the entire `#page` region.*/
|
|
8
|
-
regionPage?: string | undefined;
|
|
9
|
-
/** Apply arbitrary classes to the `header` slot container element*/
|
|
10
|
-
slotHeader?: string | undefined;
|
|
11
|
-
/** Apply arbitrary classes to the `sidebarLeft` slot container element*/
|
|
12
|
-
slotSidebarLeft?: string | undefined;
|
|
13
|
-
/** Apply arbitrary classes to the `sidebarRight` slot container element*/
|
|
14
|
-
slotSidebarRight?: string | undefined;
|
|
15
|
-
/** Apply arbitrary classes to the `pageHeader` slot container element*/
|
|
16
|
-
slotPageHeader?: string | undefined;
|
|
17
|
-
/** Apply arbitrary classes to the `pageContent` slot container element*/
|
|
18
|
-
slotPageContent?: string | undefined;
|
|
19
|
-
/** Apply arbitrary classes to the `pageFooter` slot container element*/
|
|
20
|
-
slotPageFooter?: string | undefined;
|
|
21
|
-
/** Apply arbitrary classes to the `footer` slot container element*/
|
|
22
|
-
slotFooter?: string | undefined;
|
|
23
|
-
};
|
|
24
|
-
events: {
|
|
25
|
-
scroll: Event;
|
|
26
|
-
} & {
|
|
27
|
-
[evt: string]: CustomEvent<any>;
|
|
28
|
-
};
|
|
29
|
-
slots: {
|
|
30
|
-
header: {};
|
|
31
|
-
sidebarLeft: {};
|
|
32
|
-
pageHeader: {};
|
|
33
|
-
default: {};
|
|
34
|
-
pageFooter: {};
|
|
35
|
-
sidebarRight: {};
|
|
36
|
-
footer: {};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export type AppShellProps = typeof __propDef.props;
|
|
40
|
-
export type AppShellEvents = typeof __propDef.events;
|
|
41
|
-
export type AppShellSlots = typeof __propDef.slots;
|
|
42
|
-
export default class AppShell extends SvelteComponentTyped<AppShellProps, AppShellEvents, AppShellSlots> {
|
|
43
|
-
}
|
|
44
|
-
export {};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<script context="module">import { slide } from "svelte/transition";
|
|
2
|
-
import { prefersReducedMotionStore } from "../../index.js";
|
|
3
|
-
import { dynamicTransition } from "../../internal/transitions.js";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<script
|
|
7
|
-
|
|
8
|
-
generics="Value = unknown, Meta = unknown,
|
|
9
|
-
TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition"
|
|
10
|
-
>import { createEventDispatcher } from "svelte";
|
|
11
|
-
const dispatch = createEventDispatcher();
|
|
12
|
-
export let input = void 0;
|
|
13
|
-
export let options = [];
|
|
14
|
-
export let limit = void 0;
|
|
15
|
-
export let allowlist = [];
|
|
16
|
-
export let denylist = [];
|
|
17
|
-
export let emptyState = "No Results Found.";
|
|
18
|
-
export let regionNav = "";
|
|
19
|
-
export let regionList = "list-nav";
|
|
20
|
-
export let regionItem = "";
|
|
21
|
-
export let regionButton = "w-full";
|
|
22
|
-
export let regionEmpty = "text-center";
|
|
23
|
-
export let filter = filterOptions;
|
|
24
|
-
export let transitions = !$prefersReducedMotionStore;
|
|
25
|
-
export let transitionIn = slide;
|
|
26
|
-
export let transitionInParams = { duration: 200 };
|
|
27
|
-
export let transitionOut = slide;
|
|
28
|
-
export let transitionOutParams = { duration: 200 };
|
|
29
|
-
$:
|
|
30
|
-
listedOptions = options;
|
|
31
|
-
function filterByAllowDeny(allowlist2, denylist2) {
|
|
32
|
-
let _options = [...options];
|
|
33
|
-
if (allowlist2.length) {
|
|
34
|
-
_options = _options.filter((option) => allowlist2.includes(option.value));
|
|
35
|
-
}
|
|
36
|
-
if (denylist2.length) {
|
|
37
|
-
_options = _options.filter((option) => !denylist2.includes(option.value));
|
|
38
|
-
}
|
|
39
|
-
if (!allowlist2.length && !denylist2.length) {
|
|
40
|
-
_options = options;
|
|
41
|
-
}
|
|
42
|
-
listedOptions = _options;
|
|
43
|
-
}
|
|
44
|
-
function filterOptions() {
|
|
45
|
-
let _options = [...listedOptions];
|
|
46
|
-
_options = _options.filter((option) => {
|
|
47
|
-
const inputFormatted = String(input).toLowerCase().trim();
|
|
48
|
-
let optionFormatted = JSON.stringify([option.label, option.value, option.keywords]).toLowerCase();
|
|
49
|
-
if (optionFormatted.includes(inputFormatted))
|
|
50
|
-
return option;
|
|
51
|
-
});
|
|
52
|
-
return _options;
|
|
53
|
-
}
|
|
54
|
-
function onSelection(option) {
|
|
55
|
-
dispatch("selection", option);
|
|
56
|
-
}
|
|
57
|
-
$:
|
|
58
|
-
filterByAllowDeny(allowlist, denylist);
|
|
59
|
-
$:
|
|
60
|
-
optionsFiltered = input ? filter() : listedOptions;
|
|
61
|
-
$:
|
|
62
|
-
sliceLimit = limit ?? optionsFiltered.length;
|
|
63
|
-
$:
|
|
64
|
-
classesBase = `${$$props.class ?? ""}`;
|
|
65
|
-
$:
|
|
66
|
-
classesNav = `${regionNav}`;
|
|
67
|
-
$:
|
|
68
|
-
classesList = `${regionList}`;
|
|
69
|
-
$:
|
|
70
|
-
classesItem = `${regionItem}`;
|
|
71
|
-
$:
|
|
72
|
-
classesButton = `${regionButton}`;
|
|
73
|
-
$:
|
|
74
|
-
classesEmpty = `${regionEmpty}`;
|
|
75
|
-
</script>
|
|
76
|
-
|
|
77
|
-
<!-- animate:flip={{ duration }} -->
|
|
78
|
-
<div class="autocomplete {classesBase}" data-testid="autocomplete">
|
|
79
|
-
{#if optionsFiltered.length > 0}
|
|
80
|
-
<nav class="autocomplete-nav {classesNav}">
|
|
81
|
-
<ul class="autocomplete-list {classesList}">
|
|
82
|
-
{#each optionsFiltered.slice(0, sliceLimit) as option (option)}
|
|
83
|
-
<li
|
|
84
|
-
class="autocomplete-item {classesItem}"
|
|
85
|
-
in:dynamicTransition|local={{ transition: transitionIn, params: transitionInParams, enabled: transitions }}
|
|
86
|
-
out:dynamicTransition|local={{ transition: transitionOut, params: transitionOutParams, enabled: transitions }}
|
|
87
|
-
>
|
|
88
|
-
<button class="autocomplete-button {classesButton}" type="button" on:click={() => onSelection(option)} on:click on:keypress>
|
|
89
|
-
{@html option.label}
|
|
90
|
-
</button>
|
|
91
|
-
</li>
|
|
92
|
-
{/each}
|
|
93
|
-
</ul>
|
|
94
|
-
</nav>
|
|
95
|
-
{:else}
|
|
96
|
-
<div class="autocomplete-empty {classesEmpty}">{@html emptyState}</div>
|
|
97
|
-
{/if}
|
|
98
|
-
</div>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import { slide } from 'svelte/transition';
|
|
3
|
-
import { type Transition, type TransitionParams } from '../../index.js';
|
|
4
|
-
type SlideTransition = typeof slide;
|
|
5
|
-
import type { AutocompleteOption } from './types.js';
|
|
6
|
-
declare class __sveltets_Render<Value = unknown, Meta = unknown, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> {
|
|
7
|
-
props(): {
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
/** Bind the input value.*/
|
|
10
|
-
input?: unknown;
|
|
11
|
-
/** Define values for the list.*/
|
|
12
|
-
options?: AutocompleteOption<Value, Meta>[] | undefined;
|
|
13
|
-
/** Limit the total number of suggestions.*/
|
|
14
|
-
limit?: number | undefined;
|
|
15
|
-
/** Provide allowlist values.*/
|
|
16
|
-
allowlist?: Value[] | undefined;
|
|
17
|
-
/** Provide denylist values.*/
|
|
18
|
-
denylist?: Value[] | undefined;
|
|
19
|
-
/** Provide a HTML markup to display when no match is found.*/
|
|
20
|
-
emptyState?: string | undefined;
|
|
21
|
-
/** Provide arbitrary classes to nav element.*/
|
|
22
|
-
regionNav?: string | undefined;
|
|
23
|
-
/** Provide arbitrary classes to each list.*/
|
|
24
|
-
regionList?: string | undefined;
|
|
25
|
-
/** Provide arbitrary classes to each list item.*/
|
|
26
|
-
regionItem?: string | undefined;
|
|
27
|
-
/** Provide arbitrary classes to each button.*/
|
|
28
|
-
regionButton?: string | undefined;
|
|
29
|
-
/** Provide arbitrary classes to empty message.*/
|
|
30
|
-
regionEmpty?: string | undefined;
|
|
31
|
-
/** Provide a custom filter function.*/
|
|
32
|
-
filter?: (() => AutocompleteOption<Value, Meta>[]) | undefined;
|
|
33
|
-
/** Enable/Disable transitions*/
|
|
34
|
-
transitions?: boolean | undefined;
|
|
35
|
-
/** Provide the transition used on entry.*/
|
|
36
|
-
transitionIn?: TransitionIn | undefined;
|
|
37
|
-
/** Transition params provided to `transitionIn`.*/
|
|
38
|
-
transitionInParams?: TransitionParams<TransitionIn> | undefined;
|
|
39
|
-
/** Provide the transition used on exit.*/
|
|
40
|
-
transitionOut?: TransitionOut | undefined;
|
|
41
|
-
/** Transition params provided to `transitionOut`.*/
|
|
42
|
-
transitionOutParams?: TransitionParams<TransitionOut> | undefined;
|
|
43
|
-
};
|
|
44
|
-
events(): {
|
|
45
|
-
click: MouseEvent;
|
|
46
|
-
keypress: KeyboardEvent;
|
|
47
|
-
selection: CustomEvent<AutocompleteOption<Value, Meta>>;
|
|
48
|
-
} & {
|
|
49
|
-
[evt: string]: CustomEvent<any>;
|
|
50
|
-
};
|
|
51
|
-
slots(): {};
|
|
52
|
-
}
|
|
53
|
-
export type AutocompleteProps<Value = unknown, Meta = unknown, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<Value, Meta, TransitionIn, TransitionOut>['props']>;
|
|
54
|
-
export type AutocompleteEvents<Value = unknown, Meta = unknown, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<Value, Meta, TransitionIn, TransitionOut>['events']>;
|
|
55
|
-
export type AutocompleteSlots<Value = unknown, Meta = unknown, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> = ReturnType<__sveltets_Render<Value, Meta, TransitionIn, TransitionOut>['slots']>;
|
|
56
|
-
export default class Autocomplete<Value = unknown, Meta = unknown, TransitionIn extends Transition = SlideTransition, TransitionOut extends Transition = SlideTransition> extends SvelteComponentTyped<AutocompleteProps<Value, Meta, TransitionIn, TransitionOut>, AutocompleteEvents<Value, Meta, TransitionIn, TransitionOut>, AutocompleteSlots<Value, Meta, TransitionIn, TransitionOut>> {
|
|
57
|
-
}
|
|
58
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface AutocompleteOption<Value = unknown, Meta = unknown> {
|
|
2
|
-
/** Provide a unique display label per option. Supports HTML. */
|
|
3
|
-
label: string;
|
|
4
|
-
/** Provide a unique option value. */
|
|
5
|
-
value: Value;
|
|
6
|
-
/** Provide a comma separated list of keywords. */
|
|
7
|
-
keywords?: string;
|
|
8
|
-
/** Pass arbitrary data per option. */
|
|
9
|
-
meta?: Meta;
|
|
10
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script>export let initials = "";
|
|
2
|
-
export let fill = "fill-token";
|
|
3
|
-
export let fontSize = 150;
|
|
4
|
-
export let src = "";
|
|
5
|
-
export let fallback = "";
|
|
6
|
-
export let action = () => {
|
|
7
|
-
};
|
|
8
|
-
export let actionParams = "";
|
|
9
|
-
export let background = "bg-surface-400-500-token";
|
|
10
|
-
export let width = "w-16";
|
|
11
|
-
export let border = "";
|
|
12
|
-
export let rounded = "rounded-full";
|
|
13
|
-
export let shadow = "";
|
|
14
|
-
export let cursor = "";
|
|
15
|
-
let cBase = "flex aspect-square text-surface-50 font-semibold justify-center items-center overflow-hidden isolate";
|
|
16
|
-
let cImage = "w-full object-cover";
|
|
17
|
-
$:
|
|
18
|
-
classesBase = `${cBase} ${background} ${width} ${border} ${rounded} ${shadow} ${cursor} ${$$props.class ?? ""}`;
|
|
19
|
-
function prunedRestProps() {
|
|
20
|
-
delete $$restProps.class;
|
|
21
|
-
return $$restProps;
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<figure class="avatar {classesBase}" data-testid="avatar" {...prunedRestProps()}>
|
|
26
|
-
{#if src || fallback}
|
|
27
|
-
<img
|
|
28
|
-
class="avatar-image {cImage}"
|
|
29
|
-
style={$$props.style ?? ''}
|
|
30
|
-
{src}
|
|
31
|
-
alt={$$props.alt || ''}
|
|
32
|
-
use:action={actionParams}
|
|
33
|
-
on:error={() => (src = fallback)}
|
|
34
|
-
/>
|
|
35
|
-
{:else if initials}
|
|
36
|
-
<svg class="avatar-initials w-full h-full" viewBox="0 0 512 512">
|
|
37
|
-
<text
|
|
38
|
-
x="50%"
|
|
39
|
-
y="50%"
|
|
40
|
-
dominant-baseline="central"
|
|
41
|
-
text-anchor="middle"
|
|
42
|
-
font-weight="bold"
|
|
43
|
-
font-size={fontSize}
|
|
44
|
-
class="avatar-text {fill}"
|
|
45
|
-
>
|
|
46
|
-
{String(initials).substring(0, 2).toUpperCase()}
|
|
47
|
-
</text>
|
|
48
|
-
</svg>
|
|
49
|
-
{:else}
|
|
50
|
-
<slot />
|
|
51
|
-
{/if}
|
|
52
|
-
</figure>
|