lutra 0.0.17 → 0.0.19
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/data/Stat.svelte.d.ts +12 -6
- package/dist/display/Avatar.svelte.d.ts +5 -0
- package/dist/display/Badge.svelte.d.ts +10 -6
- package/dist/display/Callout.svelte +8 -4
- package/dist/display/Callout.svelte.d.ts +11 -9
- package/dist/display/Close.svelte +58 -0
- package/dist/display/Close.svelte.d.ts +21 -0
- package/dist/display/Code.svelte.d.ts +10 -8
- package/dist/display/ContextTip.svelte +1 -2
- package/dist/display/ContextTip.svelte.d.ts +5 -0
- package/dist/display/Details.svelte.d.ts +11 -5
- package/dist/display/Hero.svelte.d.ts +9 -4
- package/dist/display/Icon.svelte +4 -6
- package/dist/display/Icon.svelte.d.ts +6 -0
- package/dist/display/IconButton.svelte +2 -3
- package/dist/display/IconButton.svelte.d.ts +8 -4
- package/dist/display/Image.svelte +63 -13
- package/dist/display/Image.svelte.d.ts +15 -2
- package/dist/display/Indicator.svelte.d.ts +5 -3
- package/dist/display/Inset.svelte.d.ts +5 -0
- package/dist/display/Notification.svelte +104 -0
- package/dist/display/Notification.svelte.d.ts +42 -0
- package/dist/display/Popup.svelte.d.ts +10 -4
- package/dist/display/Table.svelte +3 -0
- package/dist/display/Table.svelte.d.ts +11 -0
- package/dist/display/Tag.svelte.d.ts +11 -7
- package/dist/display/Tooltip.svelte.d.ts +9 -3
- package/dist/display/notifications.svelte.d.ts +21 -0
- package/dist/display/notifications.svelte.js +31 -0
- package/dist/form/Button.svelte.d.ts +12 -0
- package/dist/form/FieldActions.svelte +1 -1
- package/dist/form/FieldActions.svelte.d.ts +6 -0
- package/dist/form/FieldContainer.svelte +5 -0
- package/dist/form/FieldContainer.svelte.d.ts +6 -0
- package/dist/form/FieldContent.svelte +3 -0
- package/dist/form/FieldContent.svelte.d.ts +23 -0
- package/dist/form/FieldError.svelte.d.ts +4 -0
- package/dist/form/FieldSection.svelte +15 -1
- package/dist/form/FieldSection.svelte.d.ts +11 -0
- package/dist/form/Fieldset.svelte.d.ts +15 -7
- package/dist/form/Form.svelte +14 -12
- package/dist/form/Form.svelte.d.ts +10 -0
- package/dist/form/Input.svelte +4 -2
- package/dist/form/Input.svelte.d.ts +66 -55
- package/dist/form/InputLength.svelte.d.ts +4 -2
- package/dist/form/Label.svelte.d.ts +9 -3
- package/dist/form/Select.svelte +0 -1
- package/dist/form/Select.svelte.d.ts +44 -27
- package/dist/form/form.js +1 -1
- package/dist/grid/Column.svelte.d.ts +5 -0
- package/dist/grid/Grid.svelte.d.ts +6 -0
- package/dist/grid/Row.svelte.d.ts +6 -1
- package/dist/layout/Layout.svelte +2 -0
- package/dist/layout/Layout.svelte.d.ts +6 -2
- package/dist/layout/LayoutFooter.svelte.d.ts +3 -1
- package/dist/layout/LayoutGrid.svelte.d.ts +13 -5
- package/dist/layout/LayoutHeader.svelte.d.ts +13 -12
- package/dist/layout/LayoutSideMenu.svelte +54 -0
- package/dist/layout/LayoutSideMenu.svelte.d.ts +25 -0
- package/dist/layout/Overlay.svelte +20 -0
- package/dist/layout/Overlay.svelte.d.ts +35 -0
- package/dist/layout/OverlayContainer.svelte +28 -0
- package/dist/layout/OverlayContainer.svelte.d.ts +16 -0
- package/dist/layout/OverlayLayer.svelte +145 -0
- package/dist/layout/OverlayLayer.svelte.d.ts +22 -0
- package/dist/layout/PageContent.svelte +9 -1
- package/dist/layout/PageContent.svelte.d.ts +8 -3
- package/dist/layout/Theme.svelte +8 -0
- package/dist/layout/Theme.svelte.d.ts +6 -0
- package/dist/layout/UIContent.svelte.d.ts +5 -0
- package/dist/layout/overlays.svelte.d.ts +34 -0
- package/dist/layout/overlays.svelte.js +44 -0
- package/dist/nav/Breadcrumb.svelte.d.ts +9 -5
- package/dist/nav/Menu.svelte +43 -62
- package/dist/nav/Menu.svelte.d.ts +11 -4
- package/dist/nav/MenuItem.svelte +25 -7
- package/dist/nav/MenuItem.svelte.d.ts +9 -0
- package/dist/nav/NavMenu.svelte.d.ts +3 -1
- package/dist/nav/TabbedContent.svelte.d.ts +5 -3
- package/dist/nav/Tabs.svelte.d.ts +6 -4
- package/dist/style.css +74 -36
- package/dist/typo/Clamp.svelte.d.ts +8 -3
- package/dist/typo/H.svelte.d.ts +10 -5
- package/dist/typo/H1.svelte.d.ts +9 -4
- package/dist/typo/H2.svelte.d.ts +9 -4
- package/dist/typo/H3.svelte.d.ts +9 -4
- package/dist/typo/H4.svelte.d.ts +9 -4
- package/dist/typo/H5.svelte.d.ts +9 -4
- package/dist/typo/H6.svelte.d.ts +9 -4
- package/dist/typo/P.svelte.d.ts +9 -4
- package/dist/utils/StringOrComponentOrSnippet.svelte +3 -2
- package/dist/utils/StringOrComponentOrSnippet.svelte.d.ts +7 -0
- package/dist/utils/attr.d.ts +2 -2
- package/dist/utils/attr.js +2 -2
- package/dist/utils/dom.d.ts +15 -0
- package/dist/utils/dom.js +74 -0
- package/dist/utils/keyboard.svelte.d.ts +19 -0
- package/dist/utils/keyboard.svelte.js +22 -3
- package/dist/utils/transitions.d.ts +1 -0
- package/dist/utils/transitions.js +9 -2
- package/package.json +11 -9
@@ -3,21 +3,15 @@ import type { ComponentType } from "svelte";
|
|
3
3
|
import { type StatusColorOrString } from "../utils/color.js";
|
4
4
|
declare const __propDef: {
|
5
5
|
props: {
|
6
|
-
/** The title of the stat. */
|
7
6
|
title?: string | undefined;
|
8
|
-
/** The value to display. */
|
9
7
|
value?: string | number | Date | undefined;
|
10
|
-
/** The prefix to display before the value. Can be a string, a URL, a Snippet, or a Svelte component. */
|
11
8
|
prefix?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
12
9
|
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
13
10
|
}) | ComponentType | undefined;
|
14
|
-
/** The suffix to display after the value. Can be a string, a URL, a Snippet, or a Svelte component. */
|
15
11
|
suffix?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
16
12
|
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
17
13
|
}) | ComponentType | undefined;
|
18
|
-
/** The color of the stat. */
|
19
14
|
color?: StatusColorOrString | undefined;
|
20
|
-
/** A function to format the value. Can be an [Intl.NumberFormat object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat), an [Intl.DateTimeFormat object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat), or a function that takes in a value and returns a string. */
|
21
15
|
formatter?: Intl.NumberFormat | Intl.DateTimeFormat | ((value: number | string | Date | undefined) => string) | undefined;
|
22
16
|
};
|
23
17
|
events: {
|
@@ -29,5 +23,17 @@ export type StatProps = typeof __propDef.props;
|
|
29
23
|
export type StatEvents = typeof __propDef.events;
|
30
24
|
export type StatSlots = typeof __propDef.slots;
|
31
25
|
export default class Stat extends SvelteComponent<StatProps, StatEvents, StatSlots> {
|
26
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
27
|
+
title?: string | undefined;
|
28
|
+
value?: string | number | Date | undefined;
|
29
|
+
prefix?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
30
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
31
|
+
}) | ComponentType | undefined;
|
32
|
+
suffix?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
33
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
34
|
+
}) | ComponentType | undefined;
|
35
|
+
color?: StatusColorOrString | undefined;
|
36
|
+
formatter?: Intl.NumberFormat | Intl.DateTimeFormat | ((value: string | number | Date | undefined) => string) | undefined;
|
37
|
+
}>);
|
32
38
|
}
|
33
39
|
export {};
|
@@ -14,5 +14,10 @@ export type AvatarProps = typeof __propDef.props;
|
|
14
14
|
export type AvatarEvents = typeof __propDef.events;
|
15
15
|
export type AvatarSlots = typeof __propDef.slots;
|
16
16
|
export default class Avatar extends SvelteComponent<AvatarProps, AvatarEvents, AvatarSlots> {
|
17
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
18
|
+
src?: string | undefined;
|
19
|
+
name?: string | undefined;
|
20
|
+
shape?: "circle" | "square" | "rounded" | undefined;
|
21
|
+
}>);
|
17
22
|
}
|
18
23
|
export {};
|
@@ -2,17 +2,11 @@ import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { StatusColorOrString } from "../utils/color.js";
|
3
3
|
declare const __propDef: {
|
4
4
|
props: {
|
5
|
-
/** Count to display in the badge. */
|
6
5
|
count?: number | undefined;
|
7
|
-
/** The maximum count to display. */
|
8
6
|
max?: number | undefined;
|
9
|
-
/** The color of the tag. */
|
10
7
|
color?: StatusColorOrString | undefined;
|
11
|
-
/** Whether to add a glow to the badge. */
|
12
8
|
glow?: boolean | undefined;
|
13
|
-
/** Whether to add an outline to the badge. */
|
14
9
|
outline?: boolean | undefined;
|
15
|
-
/** The content to display inside the badge. */
|
16
10
|
children?: ((this: void) => typeof import("svelte").SnippetReturn & {
|
17
11
|
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
18
12
|
}) | undefined;
|
@@ -26,5 +20,15 @@ export type BadgeProps = typeof __propDef.props;
|
|
26
20
|
export type BadgeEvents = typeof __propDef.events;
|
27
21
|
export type BadgeSlots = typeof __propDef.slots;
|
28
22
|
export default class Badge extends SvelteComponent<BadgeProps, BadgeEvents, BadgeSlots> {
|
23
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
24
|
+
count?: number | undefined;
|
25
|
+
max?: number | undefined;
|
26
|
+
color?: StatusColorOrString | undefined;
|
27
|
+
glow?: boolean | undefined;
|
28
|
+
outline?: boolean | undefined;
|
29
|
+
children?: ((this: void) => typeof import("svelte").SnippetReturn & {
|
30
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
31
|
+
}) | undefined;
|
32
|
+
}>);
|
29
33
|
}
|
30
34
|
export {};
|
@@ -37,14 +37,12 @@ if (!icon) {
|
|
37
37
|
}
|
38
38
|
</script>
|
39
39
|
|
40
|
-
<div class="Callout {type}" class:hasIcon={!!icon} class:contained class:rounded class:dismissable>
|
40
|
+
<div class="Callout {type}" class:hasIcon={!!icon} class:contained class:rounded class:dismissable style="--margin-scale: 0.5;">
|
41
41
|
{#if icon}
|
42
42
|
<Icon {icon} --icon-width="1.5rem" --icon-height="1.5rem" />
|
43
43
|
{/if}
|
44
44
|
<div class="CalloutText">
|
45
|
-
<
|
46
|
-
<slot />
|
47
|
-
</PageContent>
|
45
|
+
<slot />
|
48
46
|
</div>
|
49
47
|
{#if dismissable}
|
50
48
|
<div class="Dismiss">
|
@@ -67,6 +65,10 @@ if (!icon) {
|
|
67
65
|
display: grid;
|
68
66
|
gap: var(--gap, 1rem);
|
69
67
|
align-items: var(--align-items, start);
|
68
|
+
--text-heading: hsla(240, 10%, 98%);
|
69
|
+
--text: hsla(240, 10%, 95%);
|
70
|
+
--text-subtle: hsla(240, 10%, 90%);
|
71
|
+
color: var(--text-heading);
|
70
72
|
}
|
71
73
|
.Callout.contained {
|
72
74
|
border: var(--border);
|
@@ -102,4 +104,6 @@ if (!icon) {
|
|
102
104
|
padding: 0.75rem;
|
103
105
|
cursor: pointer;
|
104
106
|
}
|
107
|
+
.CalloutText {
|
108
|
+
}
|
105
109
|
</style>
|
@@ -2,22 +2,13 @@ import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { ComponentType } from "svelte";
|
3
3
|
declare const __propDef: {
|
4
4
|
props: {
|
5
|
-
/** The icon to display. If not specified, it will default to the type. */
|
6
5
|
icon?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
7
6
|
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
8
7
|
}) | ComponentType | undefined;
|
9
|
-
/** The type of callout. If not specified and no icon is provided, no icon will be displayed. */
|
10
8
|
type?: "ok" | "alert" | "warn" | "info" | "task" | undefined;
|
11
|
-
/** Whether to contain the element in a box. */
|
12
9
|
contained?: boolean | undefined;
|
13
|
-
/** Whether to round the corners of the element. */
|
14
10
|
rounded?: boolean | undefined;
|
15
|
-
/** Whether the callout is dismissable. */
|
16
11
|
dismissable?: boolean | undefined;
|
17
|
-
} & {
|
18
|
-
children?: ((this: void) => typeof import("svelte").SnippetReturn & {
|
19
|
-
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
20
|
-
}) | undefined;
|
21
12
|
};
|
22
13
|
events: {
|
23
14
|
[evt: string]: CustomEvent<any>;
|
@@ -30,5 +21,16 @@ export type CalloutProps = typeof __propDef.props;
|
|
30
21
|
export type CalloutEvents = typeof __propDef.events;
|
31
22
|
export type CalloutSlots = typeof __propDef.slots;
|
32
23
|
export default class Callout extends SvelteComponent<CalloutProps, CalloutEvents, CalloutSlots> {
|
24
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<__sveltets_2_PropsWithChildren<{
|
25
|
+
icon?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
26
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
27
|
+
}) | ComponentType | undefined;
|
28
|
+
type?: "ok" | "alert" | "warn" | "info" | "task" | undefined;
|
29
|
+
contained?: boolean | undefined;
|
30
|
+
rounded?: boolean | undefined;
|
31
|
+
dismissable?: boolean | undefined;
|
32
|
+
}, {
|
33
|
+
default: {};
|
34
|
+
}>>);
|
33
35
|
}
|
34
36
|
export {};
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<script lang="ts">let {
|
2
|
+
onclick,
|
3
|
+
position
|
4
|
+
} = $props();
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<button class="Close {position}" {onclick}>
|
8
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
9
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
10
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
11
|
+
</svg>
|
12
|
+
</button>
|
13
|
+
|
14
|
+
<style>
|
15
|
+
.Close {
|
16
|
+
cursor: pointer;
|
17
|
+
padding: var(--close-padding, 0.5rem);
|
18
|
+
border-radius: 50%;
|
19
|
+
color: var(--text);
|
20
|
+
cursor: pointer;
|
21
|
+
pointer-events: auto;
|
22
|
+
}
|
23
|
+
|
24
|
+
svg {
|
25
|
+
width: max(1.5rem, 16px);
|
26
|
+
height: max(1.5rem, 16px);
|
27
|
+
}
|
28
|
+
|
29
|
+
.Close:hover {
|
30
|
+
color: var(--text-subtle);
|
31
|
+
}
|
32
|
+
|
33
|
+
.Close.top {
|
34
|
+
position: absolute;
|
35
|
+
top: 0;
|
36
|
+
right: 0;
|
37
|
+
z-index: 100;
|
38
|
+
}
|
39
|
+
|
40
|
+
.Close.bottom {
|
41
|
+
position: absolute;
|
42
|
+
bottom: 0;
|
43
|
+
right: 0;
|
44
|
+
}
|
45
|
+
|
46
|
+
.Close.left {
|
47
|
+
position: absolute;
|
48
|
+
top: 0;
|
49
|
+
left: 0;
|
50
|
+
right: auto;
|
51
|
+
}
|
52
|
+
|
53
|
+
.Close.right {
|
54
|
+
position: absolute;
|
55
|
+
top: 0;
|
56
|
+
right: 0;
|
57
|
+
}
|
58
|
+
</style>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
2
|
+
declare const __propDef: {
|
3
|
+
props: {
|
4
|
+
onclick?: ((e: MouseEvent) => void) | undefined;
|
5
|
+
position?: "top left" | "top right" | "bottom left" | "bottom right" | undefined;
|
6
|
+
};
|
7
|
+
events: {
|
8
|
+
[evt: string]: CustomEvent<any>;
|
9
|
+
};
|
10
|
+
slots: {};
|
11
|
+
};
|
12
|
+
export type CloseProps = typeof __propDef.props;
|
13
|
+
export type CloseEvents = typeof __propDef.events;
|
14
|
+
export type CloseSlots = typeof __propDef.slots;
|
15
|
+
export default class Close extends SvelteComponent<CloseProps, CloseEvents, CloseSlots> {
|
16
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
17
|
+
onclick?: ((e: MouseEvent) => void) | undefined;
|
18
|
+
position?: "top left" | "top right" | "bottom left" | "bottom right" | undefined;
|
19
|
+
}>);
|
20
|
+
}
|
21
|
+
export {};
|
@@ -1,19 +1,12 @@
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
2
2
|
declare const __propDef: {
|
3
3
|
props: {
|
4
|
-
|
5
|
-
code: string;
|
6
|
-
/** A function to highlight parts of the code. */
|
4
|
+
code: import("svelte").Bindable<string>;
|
7
5
|
highlight?: ((code: string) => string) | undefined;
|
8
|
-
/** Whether the code is copyable. */
|
9
6
|
copyable?: boolean | undefined;
|
10
|
-
/** Whether to contain the element in a box. */
|
11
7
|
contained?: boolean | undefined;
|
12
|
-
/** Whether to round the corners of the element. */
|
13
8
|
rounded?: boolean | undefined;
|
14
|
-
/** Whether to show line numbers. */
|
15
9
|
lineNumbers?: boolean | undefined;
|
16
|
-
/** Whether the code is readonly. */
|
17
10
|
readonly?: boolean | undefined;
|
18
11
|
};
|
19
12
|
events: {
|
@@ -25,5 +18,14 @@ export type CodeProps = typeof __propDef.props;
|
|
25
18
|
export type CodeEvents = typeof __propDef.events;
|
26
19
|
export type CodeSlots = typeof __propDef.slots;
|
27
20
|
export default class Code extends SvelteComponent<CodeProps, CodeEvents, CodeSlots> {
|
21
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
22
|
+
code: import("svelte").Bindable<string>;
|
23
|
+
highlight?: ((code: string) => string) | undefined;
|
24
|
+
copyable?: boolean | undefined;
|
25
|
+
contained?: boolean | undefined;
|
26
|
+
rounded?: boolean | undefined;
|
27
|
+
lineNumbers?: boolean | undefined;
|
28
|
+
readonly?: boolean | undefined;
|
29
|
+
}>);
|
28
30
|
}
|
29
31
|
export {};
|
@@ -8,7 +8,7 @@ let {
|
|
8
8
|
|
9
9
|
<Tooltip {tip}>
|
10
10
|
<a href="#foo" onclick={(e) => { e.preventDefault(); e.stopPropagation(); }}>
|
11
|
-
<Icon icon={Help} --icon-width="16px" --icon-height="16px" --cursor="help" />
|
11
|
+
<Icon icon={Help} --icon-width="16px" --icon-height="16px" --cursor="help" --vertical-align="baseline" />
|
12
12
|
</a>
|
13
13
|
</Tooltip>
|
14
14
|
|
@@ -22,6 +22,5 @@ let {
|
|
22
22
|
}
|
23
23
|
a:focus,
|
24
24
|
a:active {
|
25
|
-
outline-offset: -2px;
|
26
25
|
}
|
27
26
|
</style>
|
@@ -13,5 +13,10 @@ export type ContextTipProps = typeof __propDef.props;
|
|
13
13
|
export type ContextTipEvents = typeof __propDef.events;
|
14
14
|
export type ContextTipSlots = typeof __propDef.slots;
|
15
15
|
export default class ContextTip extends SvelteComponent<ContextTipProps, ContextTipEvents, ContextTipSlots> {
|
16
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
17
|
+
tip: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
18
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
19
|
+
});
|
20
|
+
}>);
|
16
21
|
}
|
17
22
|
export {};
|
@@ -2,15 +2,10 @@ import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { Snippet } from "svelte";
|
3
3
|
declare const __propDef: {
|
4
4
|
props: {
|
5
|
-
/** The summary of the element. Can be a string or a snippet. */
|
6
5
|
summary: string | Snippet;
|
7
|
-
/** Contain the element in a box. */
|
8
6
|
contained?: boolean | undefined;
|
9
|
-
/** Round the corners of the element if contained. */
|
10
7
|
rounded?: boolean | undefined;
|
11
|
-
/** Whether the details are open. */
|
12
8
|
open?: boolean | undefined;
|
13
|
-
/** The content of the element. */
|
14
9
|
children: Snippet;
|
15
10
|
};
|
16
11
|
events: {
|
@@ -22,5 +17,16 @@ export type DetailsProps = typeof __propDef.props;
|
|
22
17
|
export type DetailsEvents = typeof __propDef.events;
|
23
18
|
export type DetailsSlots = typeof __propDef.slots;
|
24
19
|
export default class Details extends SvelteComponent<DetailsProps, DetailsEvents, DetailsSlots> {
|
20
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
21
|
+
summary: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
22
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
23
|
+
});
|
24
|
+
contained?: boolean | undefined;
|
25
|
+
rounded?: boolean | undefined;
|
26
|
+
open?: boolean | undefined;
|
27
|
+
children: (this: void) => typeof import("svelte").SnippetReturn & {
|
28
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
29
|
+
};
|
30
|
+
}>);
|
25
31
|
}
|
26
32
|
export {};
|
@@ -3,13 +3,9 @@ import { type Snippet } from "svelte";
|
|
3
3
|
declare const __propDef: {
|
4
4
|
props: {
|
5
5
|
children: Snippet;
|
6
|
-
/** Add padding to the container. Pass in either a boolean or an array of booleans to specify padding on the block and inline axes. */
|
7
6
|
pad?: string | boolean | [boolean, boolean] | [boolean, boolean, boolean] | [boolean, boolean, boolean, boolean] | [string, string] | [string, string, string] | [string, string, string, string] | undefined;
|
8
|
-
/** Center the content. */
|
9
7
|
center?: boolean | undefined;
|
10
|
-
/** Make the hero full width to the container (nearest element with `container-type: inline-size;`) */
|
11
8
|
fullWidth?: boolean | undefined;
|
12
|
-
/** Contain the hero to the container (nearest element with `container-type: inline-size;`) */
|
13
9
|
contained?: boolean | undefined;
|
14
10
|
};
|
15
11
|
events: {
|
@@ -21,5 +17,14 @@ export type HeroProps = typeof __propDef.props;
|
|
21
17
|
export type HeroEvents = typeof __propDef.events;
|
22
18
|
export type HeroSlots = typeof __propDef.slots;
|
23
19
|
export default class Hero extends SvelteComponent<HeroProps, HeroEvents, HeroSlots> {
|
20
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
21
|
+
children: (this: void) => typeof import("svelte").SnippetReturn & {
|
22
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
23
|
+
};
|
24
|
+
pad?: string | boolean | [boolean, boolean] | [boolean, boolean, boolean] | [boolean, boolean, boolean, boolean] | [string, string] | [string, string, string] | [string, string, string, string] | undefined;
|
25
|
+
center?: boolean | undefined;
|
26
|
+
fullWidth?: boolean | undefined;
|
27
|
+
contained?: boolean | undefined;
|
28
|
+
}>);
|
24
29
|
}
|
25
30
|
export {};
|
package/dist/display/Icon.svelte
CHANGED
@@ -17,18 +17,16 @@ let {
|
|
17
17
|
|
18
18
|
<style>
|
19
19
|
.Icon {
|
20
|
-
display: flex;
|
20
|
+
display: inline-flex;
|
21
21
|
align-items: center;
|
22
22
|
justify-content: center;
|
23
23
|
font-size: 1em;
|
24
|
+
line-height: inherit;
|
24
25
|
width: max(
|
25
26
|
var(--icon-width,
|
26
27
|
var(--icon-height, 1rem)
|
27
28
|
), 16px);
|
28
|
-
height: max(
|
29
|
-
var(--icon-height,
|
30
|
-
var(--icon-width, 1rem)
|
31
|
-
), 16px);
|
29
|
+
height: max(var(--icon-height, auto), 16px);
|
32
30
|
overflow: clip;
|
33
31
|
vertical-align: var(--vertical-align, text-bottom);
|
34
32
|
cursor: var(--cursor, default);
|
@@ -36,7 +34,7 @@ let {
|
|
36
34
|
img,
|
37
35
|
.Icon :global(svg) {
|
38
36
|
width: 100%;
|
39
|
-
height:
|
37
|
+
height: auto;
|
40
38
|
display: block;
|
41
39
|
}
|
42
40
|
</style>
|
@@ -14,5 +14,11 @@ export type IconProps = typeof __propDef.props;
|
|
14
14
|
export type IconEvents = typeof __propDef.events;
|
15
15
|
export type IconSlots = typeof __propDef.slots;
|
16
16
|
export default class Icon extends SvelteComponent<IconProps, IconEvents, IconSlots> {
|
17
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
18
|
+
icon: string | ((this: void) => typeof import("svelte").SnippetReturn & {
|
19
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
20
|
+
}) | ComponentType;
|
21
|
+
alt?: string | undefined;
|
22
|
+
}>);
|
17
23
|
}
|
18
24
|
export {};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<script lang="ts">import Icon from "./Icon.svelte";
|
2
|
-
import {
|
2
|
+
import { fly } from "svelte/transition";
|
3
3
|
import { popBezier, popBezierInverse } from "../utils/transitions.js";
|
4
|
-
import { cubicIn, cubicOut } from "svelte/easing";
|
5
4
|
let {
|
6
5
|
icon,
|
7
6
|
disabled,
|
@@ -70,7 +69,7 @@ let {
|
|
70
69
|
grid-area: icon;
|
71
70
|
display: inline-flex;
|
72
71
|
}
|
73
|
-
@media(max-width:
|
72
|
+
@media(max-width: 960px) {
|
74
73
|
.IconMask {
|
75
74
|
padding-inline: calc(var(--padding, 0.75em) * 0.75);
|
76
75
|
padding-block: calc(var(--padding, 0.75em) * 0.75);
|
@@ -2,15 +2,11 @@ import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { ComponentType } from "svelte";
|
3
3
|
declare const __propDef: {
|
4
4
|
props: {
|
5
|
-
/** The icon to display. */
|
6
5
|
icon: string | ComponentType;
|
7
|
-
/** The children to display. */
|
8
6
|
children?: ((this: void) => typeof import("svelte").SnippetReturn & {
|
9
7
|
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
10
8
|
}) | undefined;
|
11
|
-
/** The onclick event. */
|
12
9
|
onclick?: ((event: MouseEvent) => void) | undefined;
|
13
|
-
/** Whether the button is disabled. */
|
14
10
|
disabled?: boolean | undefined;
|
15
11
|
};
|
16
12
|
events: {
|
@@ -22,5 +18,13 @@ export type IconButtonProps = typeof __propDef.props;
|
|
22
18
|
export type IconButtonEvents = typeof __propDef.events;
|
23
19
|
export type IconButtonSlots = typeof __propDef.slots;
|
24
20
|
export default class IconButton extends SvelteComponent<IconButtonProps, IconButtonEvents, IconButtonSlots> {
|
21
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
22
|
+
icon: string | ComponentType;
|
23
|
+
children?: ((this: void) => typeof import("svelte").SnippetReturn & {
|
24
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
25
|
+
}) | undefined;
|
26
|
+
onclick?: ((event: MouseEvent) => void) | undefined;
|
27
|
+
disabled?: boolean | undefined;
|
28
|
+
}>);
|
25
29
|
}
|
26
30
|
export {};
|
@@ -1,16 +1,23 @@
|
|
1
|
-
<script lang="ts">
|
1
|
+
<script lang="ts">import { decode } from "blurhash";
|
2
|
+
import { fade } from "svelte/transition";
|
3
|
+
let {
|
4
|
+
hash,
|
5
|
+
width,
|
6
|
+
height,
|
2
7
|
aspectRatio,
|
3
8
|
fit,
|
4
9
|
src,
|
5
10
|
srcset,
|
6
11
|
alt,
|
7
|
-
width,
|
8
|
-
height,
|
9
12
|
style,
|
10
13
|
class: className
|
11
14
|
} = $props();
|
15
|
+
let canvas = $state(null);
|
16
|
+
let el = $state(null);
|
17
|
+
let elWidth = $state(32);
|
18
|
+
let elHeight = $state(32);
|
12
19
|
if (!src && srcset) {
|
13
|
-
const [src1
|
20
|
+
const [src1] = srcset.split(", ");
|
14
21
|
src = src1.split(" ")[0];
|
15
22
|
}
|
16
23
|
if (!style) {
|
@@ -18,20 +25,63 @@ if (!style) {
|
|
18
25
|
} else {
|
19
26
|
style += ` aspect-ratio: ${aspectRatio};`;
|
20
27
|
}
|
28
|
+
let decoded = $state(false);
|
29
|
+
let loaded = $state(false);
|
30
|
+
const onload = () => {
|
31
|
+
loaded = true;
|
32
|
+
};
|
33
|
+
$effect(() => {
|
34
|
+
if (hash) {
|
35
|
+
setTimeout(() => {
|
36
|
+
const pixels = decode(hash, elWidth, elHeight);
|
37
|
+
const ctx = canvas.getContext("2d");
|
38
|
+
const imageData = ctx.createImageData(elWidth, elHeight);
|
39
|
+
imageData.data.set(pixels);
|
40
|
+
ctx.putImageData(imageData, 0, 0);
|
41
|
+
decoded = true;
|
42
|
+
}, 0);
|
43
|
+
}
|
44
|
+
});
|
21
45
|
</script>
|
22
46
|
|
23
|
-
<
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
47
|
+
<div class="BlurHashImage" class:loaded>
|
48
|
+
<img
|
49
|
+
bind:this={el}
|
50
|
+
bind:clientWidth={elWidth}
|
51
|
+
bind:clientHeight={elHeight}
|
52
|
+
onload={onload}
|
53
|
+
src={src}
|
54
|
+
srcset={srcset}
|
55
|
+
alt={alt}
|
56
|
+
width={width}
|
57
|
+
height={height}
|
58
|
+
style={style}
|
59
|
+
class="{className} {fit}"
|
60
|
+
/>
|
61
|
+
{#if !loaded && hash}
|
62
|
+
<canvas class:decoded out:fade={{ duration: 100 }} width={elWidth} height={elHeight} bind:this={canvas}></canvas>
|
63
|
+
{/if}
|
64
|
+
</div>
|
32
65
|
|
33
66
|
<style>
|
67
|
+
.BlurHashImage {
|
68
|
+
position: relative;
|
69
|
+
display: grid;
|
70
|
+
grid-template-areas: "img";
|
71
|
+
}
|
72
|
+
canvas {
|
73
|
+
z-index: 2;
|
74
|
+
opacity: 0;
|
75
|
+
width: 100%;
|
76
|
+
grid-area: img;
|
77
|
+
transition: opacity 200ms;
|
78
|
+
}
|
79
|
+
canvas.decoded {
|
80
|
+
opacity: 1;
|
81
|
+
}
|
34
82
|
img {
|
83
|
+
z-index: 1;
|
84
|
+
grid-area: img;
|
35
85
|
display: inline-block;
|
36
86
|
vertical-align: middle;
|
37
87
|
}
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
2
2
|
declare const __propDef: {
|
3
3
|
props: {
|
4
|
+
hash?: string | undefined;
|
4
5
|
aspectRatio?: string | undefined;
|
5
6
|
fit?: "cover" | "contain" | "scale-down" | undefined;
|
6
7
|
src?: string | undefined;
|
7
8
|
srcset?: string | undefined;
|
8
9
|
alt?: string | undefined;
|
9
|
-
width?: string | undefined;
|
10
|
-
height?: string | undefined;
|
10
|
+
width?: string | number | undefined;
|
11
|
+
height?: string | number | undefined;
|
11
12
|
style?: string | undefined;
|
12
13
|
class?: string | undefined;
|
13
14
|
};
|
@@ -20,5 +21,17 @@ export type ImageProps = typeof __propDef.props;
|
|
20
21
|
export type ImageEvents = typeof __propDef.events;
|
21
22
|
export type ImageSlots = typeof __propDef.slots;
|
22
23
|
export default class Image extends SvelteComponent<ImageProps, ImageEvents, ImageSlots> {
|
24
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
25
|
+
hash?: string | undefined;
|
26
|
+
aspectRatio?: string | undefined;
|
27
|
+
fit?: "cover" | "contain" | "scale-down" | undefined;
|
28
|
+
src?: string | undefined;
|
29
|
+
srcset?: string | undefined;
|
30
|
+
alt?: string | undefined;
|
31
|
+
width?: string | number | undefined;
|
32
|
+
height?: string | number | undefined;
|
33
|
+
style?: string | undefined;
|
34
|
+
class?: string | undefined;
|
35
|
+
}>);
|
23
36
|
}
|
24
37
|
export {};
|
@@ -2,11 +2,8 @@ import { SvelteComponent } from "svelte";
|
|
2
2
|
import { type StatusColorOrString } from "../utils/color.js";
|
3
3
|
declare const __propDef: {
|
4
4
|
props: {
|
5
|
-
/** The color of the tag. Select from default status colors or provide a CSS Color value. */
|
6
5
|
color?: StatusColorOrString | undefined;
|
7
|
-
/** Possible motion to apply to the indicator. */
|
8
6
|
motion?: "highlight" | "pulse" | "spin" | "blink" | "bulge" | "tunnel" | "typing" | undefined;
|
9
|
-
/** ARIA label to use when a custom color is applied */
|
10
7
|
label?: string | undefined;
|
11
8
|
};
|
12
9
|
events: {
|
@@ -18,5 +15,10 @@ export type IndicatorProps = typeof __propDef.props;
|
|
18
15
|
export type IndicatorEvents = typeof __propDef.events;
|
19
16
|
export type IndicatorSlots = typeof __propDef.slots;
|
20
17
|
export default class Indicator extends SvelteComponent<IndicatorProps, IndicatorEvents, IndicatorSlots> {
|
18
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
19
|
+
color?: StatusColorOrString | undefined;
|
20
|
+
motion?: "highlight" | "pulse" | "spin" | "blink" | "bulge" | "tunnel" | "typing" | undefined;
|
21
|
+
label?: string | undefined;
|
22
|
+
}>);
|
21
23
|
}
|
22
24
|
export {};
|
@@ -13,5 +13,10 @@ export type InsetProps = typeof __propDef.props;
|
|
13
13
|
export type InsetEvents = typeof __propDef.events;
|
14
14
|
export type InsetSlots = typeof __propDef.slots;
|
15
15
|
export default class Inset extends SvelteComponent<InsetProps, InsetEvents, InsetSlots> {
|
16
|
+
constructor(options?: import("svelte").ComponentConstructorOptions<{
|
17
|
+
children: (this: void) => typeof import("svelte").SnippetReturn & {
|
18
|
+
_: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
|
19
|
+
};
|
20
|
+
}>);
|
16
21
|
}
|
17
22
|
export {};
|