@spaethtech/svelte-ui 0.20.1-dev.101.530be6a → 0.20.1-dev.103.a762c22
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/components/Alert.svelte +4 -1
- package/dist/components/Alert.svelte.d.ts +2 -1
- package/dist/components/Avatar/Avatar.svelte +4 -2
- package/dist/components/Avatar/Avatar.svelte.d.ts +2 -1
- package/dist/components/Avatar/AvatarGroup.svelte +4 -1
- package/dist/components/Avatar/AvatarGroup.svelte.d.ts +2 -1
- package/dist/components/Banner.svelte +4 -1
- package/dist/components/Banner.svelte.d.ts +2 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.svelte +4 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.svelte.d.ts +2 -1
- package/dist/components/Carousel/Carousel.svelte +4 -1
- package/dist/components/Carousel/Carousel.svelte.d.ts +2 -1
- package/dist/components/Chip/Chip.svelte +4 -1
- package/dist/components/Chip/Chip.svelte.d.ts +2 -1
- package/dist/components/Combobox/Combobox.svelte +4 -1
- package/dist/components/Combobox/Combobox.svelte.d.ts +2 -1
- package/dist/components/CommandPalette/CommandPalette.svelte +4 -2
- package/dist/components/CommandPalette/CommandPalette.svelte.d.ts +2 -1
- package/dist/components/ConfirmDialog.svelte +4 -1
- package/dist/components/ConfirmDialog.svelte.d.ts +2 -1
- package/dist/components/ContextMenu/ContextMenu.svelte +4 -2
- package/dist/components/ContextMenu/ContextMenu.svelte.d.ts +2 -1
- package/dist/components/DataTable.svelte +4 -1
- package/dist/components/DataTable.svelte.d.ts +2 -1
- package/dist/components/DatePicker.svelte +4 -2
- package/dist/components/DatePicker.svelte.d.ts +2 -1
- package/dist/components/Divider/Divider.svelte +6 -3
- package/dist/components/Divider/Divider.svelte.d.ts +2 -1
- package/dist/components/Drawer/Drawer.svelte +4 -1
- package/dist/components/Drawer/Drawer.svelte.d.ts +2 -1
- package/dist/components/EmptyState/EmptyState.svelte +4 -2
- package/dist/components/EmptyState/EmptyState.svelte.d.ts +2 -1
- package/dist/components/FileUpload/FileUpload.svelte +4 -2
- package/dist/components/FileUpload/FileUpload.svelte.d.ts +2 -1
- package/dist/components/Grid.svelte +4 -2
- package/dist/components/Grid.svelte.d.ts +2 -1
- package/dist/components/Kbd/Kbd.svelte +5 -3
- package/dist/components/Kbd/Kbd.svelte.d.ts +2 -1
- package/dist/components/List.svelte +4 -2
- package/dist/components/List.svelte.d.ts +2 -1
- package/dist/components/Menu.svelte +4 -1
- package/dist/components/Menu.svelte.d.ts +2 -1
- package/dist/components/Pagination/Pagination.svelte +4 -1
- package/dist/components/Pagination/Pagination.svelte.d.ts +2 -1
- package/dist/components/Popup.svelte +8 -1
- package/dist/components/Popup.svelte.d.ts +2 -1
- package/dist/components/Progress/Progress.svelte +4 -2
- package/dist/components/Progress/Progress.svelte.d.ts +2 -1
- package/dist/components/Query.svelte +4 -2
- package/dist/components/Query.svelte.d.ts +2 -1
- package/dist/components/ScrollArea/ScrollArea.svelte +5 -2
- package/dist/components/ScrollArea/ScrollArea.svelte.d.ts +2 -1
- package/dist/components/Select.svelte +3 -1
- package/dist/components/Select.svelte.d.ts +3 -1
- package/dist/components/SideBarMenu/SideBarMenu.svelte +7 -1
- package/dist/components/SideBarMenu/SideBarMenu.svelte.d.ts +2 -1
- package/dist/components/Skeleton/Skeleton.svelte +7 -2
- package/dist/components/Skeleton/Skeleton.svelte.d.ts +2 -1
- package/dist/components/Slider/Slider.svelte +4 -2
- package/dist/components/Slider/Slider.svelte.d.ts +2 -1
- package/dist/components/Spinner/Spinner.svelte +4 -1
- package/dist/components/Spinner/Spinner.svelte.d.ts +2 -1
- package/dist/components/Splitter/Splitter.svelte +4 -1
- package/dist/components/Splitter/Splitter.svelte.d.ts +2 -1
- package/dist/components/Stat/Stat.svelte +4 -2
- package/dist/components/Stat/Stat.svelte.d.ts +2 -1
- package/dist/components/Stepper/Stepper.svelte +4 -1
- package/dist/components/Stepper/Stepper.svelte.d.ts +2 -1
- package/dist/components/ThemeSelector.svelte +10 -2
- package/dist/components/ThemeSelector.svelte.d.ts +2 -1
- package/dist/components/ThemeToggle.svelte +10 -1
- package/dist/components/ThemeToggle.svelte.d.ts +2 -1
- package/dist/components/TimeRangeInput.svelte +5 -1
- package/dist/components/TimeRangeInput.svelte.d.ts +3 -1
- package/dist/components/Timeline/Timeline.svelte +4 -2
- package/dist/components/Timeline/Timeline.svelte.d.ts +2 -1
- package/dist/components/TokenInput/TokenInput.svelte +6 -1
- package/dist/components/TokenInput/TokenInput.svelte.d.ts +2 -1
- package/dist/components/Tree/Tree.svelte +11 -2
- package/dist/components/Tree/Tree.svelte.d.ts +2 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
-->
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import type { Snippet } from "svelte";
|
|
10
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
10
11
|
|
|
11
12
|
let {
|
|
12
13
|
orientation = "horizontal",
|
|
@@ -14,13 +15,14 @@
|
|
|
14
15
|
labelAlign = "center",
|
|
15
16
|
class: cls = "",
|
|
16
17
|
children,
|
|
18
|
+
...rest
|
|
17
19
|
}: {
|
|
18
20
|
orientation?: "horizontal" | "vertical";
|
|
19
21
|
label?: string;
|
|
20
22
|
labelAlign?: "start" | "center" | "end";
|
|
21
23
|
class?: string;
|
|
22
24
|
children?: Snippet;
|
|
23
|
-
} = $props();
|
|
25
|
+
} & Omit<HTMLAttributes<HTMLElement>, "class"> = $props();
|
|
24
26
|
|
|
25
27
|
const hasLabel = $derived(orientation === "horizontal" && (!!label || !!children));
|
|
26
28
|
</script>
|
|
@@ -30,9 +32,10 @@
|
|
|
30
32
|
role="separator"
|
|
31
33
|
aria-orientation="vertical"
|
|
32
34
|
class="inline-block w-px self-stretch [background-color:var(--ui-border-color)] {cls}"
|
|
35
|
+
{...rest}
|
|
33
36
|
></div>
|
|
34
37
|
{:else if hasLabel}
|
|
35
|
-
<div role="separator" aria-orientation="horizontal" class="flex items-center gap-3 {cls}">
|
|
38
|
+
<div role="separator" aria-orientation="horizontal" class="flex items-center gap-3 {cls}" {...rest}>
|
|
36
39
|
{#if labelAlign !== "start"}
|
|
37
40
|
<div class="h-px flex-1 [background-color:var(--ui-border-color)]"></div>
|
|
38
41
|
{/if}
|
|
@@ -44,5 +47,5 @@
|
|
|
44
47
|
{/if}
|
|
45
48
|
</div>
|
|
46
49
|
{:else}
|
|
47
|
-
<hr class="w-full border-0 h-px [background-color:var(--ui-border-color)] {cls}" />
|
|
50
|
+
<hr class="w-full border-0 h-px [background-color:var(--ui-border-color)] {cls}" {...rest} />
|
|
48
51
|
{/if}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
type $$ComponentProps = {
|
|
3
4
|
orientation?: "horizontal" | "vertical";
|
|
4
5
|
label?: string;
|
|
5
6
|
labelAlign?: "start" | "center" | "end";
|
|
6
7
|
class?: string;
|
|
7
8
|
children?: Snippet;
|
|
8
|
-
}
|
|
9
|
+
} & Omit<HTMLAttributes<HTMLElement>, "class">;
|
|
9
10
|
declare const Divider: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
11
|
type Divider = ReturnType<typeof Divider>;
|
|
11
12
|
export default Divider;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
-->
|
|
9
9
|
<script lang="ts">
|
|
10
10
|
import type { Snippet } from "svelte";
|
|
11
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
11
12
|
import { cubicOut } from "svelte/easing";
|
|
12
13
|
import type { TransitionConfig } from "svelte/transition";
|
|
13
14
|
import { fade } from "svelte/transition";
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
ariaLabel,
|
|
33
34
|
class: cls = "",
|
|
34
35
|
children,
|
|
36
|
+
...rest
|
|
35
37
|
}: {
|
|
36
38
|
open?: boolean;
|
|
37
39
|
side?: "left" | "right" | "top" | "bottom";
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
ariaLabel?: string;
|
|
45
47
|
class?: string;
|
|
46
48
|
children?: Snippet;
|
|
47
|
-
} = $props();
|
|
49
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style"> = $props();
|
|
48
50
|
|
|
49
51
|
const FOCUSABLE =
|
|
50
52
|
'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
@@ -169,6 +171,7 @@
|
|
|
169
171
|
></div>
|
|
170
172
|
{/if}
|
|
171
173
|
<div
|
|
174
|
+
{...rest}
|
|
172
175
|
bind:this={panelEl}
|
|
173
176
|
class="fixed {sideClass} overflow-auto z-[10000] shadow-xl [background-color:var(--ui-color-background)] [border-color:var(--ui-border-color)] {cls}"
|
|
174
177
|
style={panelStyle}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
interface DrawerShowContext {
|
|
3
4
|
panel: HTMLElement;
|
|
4
5
|
autoFocus: string | HTMLElement | false;
|
|
@@ -18,7 +19,7 @@ type $$ComponentProps = {
|
|
|
18
19
|
ariaLabel?: string;
|
|
19
20
|
class?: string;
|
|
20
21
|
children?: Snippet;
|
|
21
|
-
}
|
|
22
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style">;
|
|
22
23
|
declare const Drawer: import("svelte").Component<$$ComponentProps, {}, "open">;
|
|
23
24
|
type Drawer = ReturnType<typeof Drawer>;
|
|
24
25
|
export default Drawer;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script lang="ts">
|
|
8
8
|
import type { Snippet } from "svelte";
|
|
9
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
9
10
|
import IconInbox from "~icons/mdi/inbox-outline";
|
|
10
11
|
import type { Variant } from "../../types/variants.js";
|
|
11
12
|
import { variantToken } from "../../types/variants.js";
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
size = "md",
|
|
22
23
|
class: cls = "",
|
|
23
24
|
children,
|
|
25
|
+
...rest
|
|
24
26
|
}: {
|
|
25
27
|
title?: string;
|
|
26
28
|
description?: string;
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
size?: Responsive<Size>;
|
|
33
35
|
class?: string;
|
|
34
36
|
children?: Snippet;
|
|
35
|
-
} = $props();
|
|
37
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
|
|
36
38
|
|
|
37
39
|
const token = $derived(variantToken[variant]);
|
|
38
40
|
const iconBox: Record<Size, string> = {
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
const padSize: Record<Size, string> = { sm: "py-6 gap-2", md: "py-10 gap-3", lg: "py-16 gap-4" };
|
|
45
47
|
</script>
|
|
46
48
|
|
|
47
|
-
<div class="flex flex-col items-center text-center {responsiveClasses(size, padSize)} {cls}">
|
|
49
|
+
<div class="flex flex-col items-center text-center {responsiveClasses(size, padSize)} {cls}" {...rest}>
|
|
48
50
|
<div
|
|
49
51
|
class="inline-flex items-center justify-center rounded-full {responsiveClasses(size, iconBox)}"
|
|
50
52
|
style="background-color: color-mix(in srgb, var({token}) 14%, transparent); color: color-mix(in srgb, var({token}) var(--ui-tint-strong), var(--ui-color-text));"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import type { Variant } from "../../types/variants.js";
|
|
3
4
|
import type { Size } from "../../types/sizes.js";
|
|
4
5
|
import { type Responsive } from "../../types/responsive.js";
|
|
@@ -13,7 +14,7 @@ type $$ComponentProps = {
|
|
|
13
14
|
size?: Responsive<Size>;
|
|
14
15
|
class?: string;
|
|
15
16
|
children?: Snippet;
|
|
16
|
-
}
|
|
17
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class">;
|
|
17
18
|
declare const EmptyState: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
18
19
|
type EmptyState = ReturnType<typeof EmptyState>;
|
|
19
20
|
export default EmptyState;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
const i18n = uiI18n();
|
|
12
12
|
import { onDestroy, untrack } from "svelte";
|
|
13
13
|
import type { Snippet } from "svelte";
|
|
14
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
14
15
|
import FieldChrome, { nextFieldId } from "../FieldChrome.svelte";
|
|
15
16
|
import Button from "../Button.svelte";
|
|
16
17
|
import Progress from "../Progress/Progress.svelte";
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
id,
|
|
40
41
|
required = false,
|
|
41
42
|
class: cls = "",
|
|
43
|
+
...rest
|
|
42
44
|
}: {
|
|
43
45
|
files?: File[];
|
|
44
46
|
accept?: string;
|
|
@@ -56,7 +58,7 @@
|
|
|
56
58
|
id?: string;
|
|
57
59
|
required?: boolean;
|
|
58
60
|
class?: string;
|
|
59
|
-
} = $props();
|
|
61
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
|
|
60
62
|
|
|
61
63
|
const controlId = id ?? nextFieldId();
|
|
62
64
|
let inputEl = $state<HTMLInputElement>();
|
|
@@ -118,7 +120,7 @@
|
|
|
118
120
|
|
|
119
121
|
<FieldChrome {label} {aside} error={error ?? (reject || null)} {description} {required} {controlId} {size} class={cls}>
|
|
120
122
|
{#snippet control({ describedBy })}
|
|
121
|
-
<div class="flex flex-col gap-2">
|
|
123
|
+
<div {...rest} class="flex flex-col gap-2">
|
|
122
124
|
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
123
125
|
<div
|
|
124
126
|
role="button"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import type { Variant } from "../../types/variants.js";
|
|
3
4
|
import type { Size } from "../../types/sizes.js";
|
|
4
5
|
import { type Responsive } from "../../types/responsive.js";
|
|
@@ -19,7 +20,7 @@ type $$ComponentProps = {
|
|
|
19
20
|
id?: string;
|
|
20
21
|
required?: boolean;
|
|
21
22
|
class?: string;
|
|
22
|
-
}
|
|
23
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class">;
|
|
23
24
|
declare const FileUpload: import("svelte").Component<$$ComponentProps, {}, "files">;
|
|
24
25
|
type FileUpload = ReturnType<typeof FileUpload>;
|
|
25
26
|
export default FileUpload;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<script lang="ts">
|
|
12
12
|
import type { Snippet } from "svelte";
|
|
13
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
13
14
|
import { gridColsClass, gapClass, type Columns, type Gap } from "./field-group.js";
|
|
14
15
|
|
|
15
16
|
let {
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
gap = 4,
|
|
18
19
|
class: cls = "",
|
|
19
20
|
children,
|
|
21
|
+
...rest
|
|
20
22
|
}: {
|
|
21
23
|
/** Track count — a number (1–6) or a responsive map like `{ base: 1, md: 3 }`. Default 1. */
|
|
22
24
|
columns?: Columns;
|
|
@@ -24,11 +26,11 @@
|
|
|
24
26
|
gap?: Gap;
|
|
25
27
|
class?: string;
|
|
26
28
|
children: Snippet;
|
|
27
|
-
} = $props();
|
|
29
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
|
|
28
30
|
|
|
29
31
|
const gridClass = $derived(`grid ${gridColsClass(columns)} ${gapClass(gap, 4)}`);
|
|
30
32
|
</script>
|
|
31
33
|
|
|
32
|
-
<div class="{gridClass} {cls}">
|
|
34
|
+
<div class="{gridClass} {cls}" {...rest}>
|
|
33
35
|
{@render children()}
|
|
34
36
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import { type Columns, type Gap } from "./field-group.js";
|
|
3
4
|
type $$ComponentProps = {
|
|
4
5
|
/** Track count — a number (1–6) or a responsive map like `{ base: 1, md: 3 }`. Default 1. */
|
|
@@ -7,7 +8,7 @@ type $$ComponentProps = {
|
|
|
7
8
|
gap?: Gap;
|
|
8
9
|
class?: string;
|
|
9
10
|
children: Snippet;
|
|
10
|
-
}
|
|
11
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class">;
|
|
11
12
|
declare const Grid: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
12
13
|
type Grid = ReturnType<typeof Grid>;
|
|
13
14
|
export default Grid;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script lang="ts">
|
|
8
8
|
import type { Snippet } from "svelte";
|
|
9
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
9
10
|
import type { Size } from "../../types/sizes.js";
|
|
10
11
|
import { responsiveClasses, type Responsive } from "../../types/responsive.js";
|
|
11
12
|
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
size = "md",
|
|
16
17
|
class: cls = "",
|
|
17
18
|
children,
|
|
19
|
+
...rest
|
|
18
20
|
}: {
|
|
19
21
|
/** A combo — each string is rendered as its own keycap, joined with "+". */
|
|
20
22
|
keys?: string[];
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
size?: Responsive<Size>;
|
|
24
26
|
class?: string;
|
|
25
27
|
children?: Snippet;
|
|
26
|
-
} = $props();
|
|
28
|
+
} & Omit<HTMLAttributes<HTMLElement>, "class"> = $props();
|
|
27
29
|
|
|
28
30
|
const list = $derived(keys ?? null);
|
|
29
31
|
|
|
@@ -38,7 +40,7 @@
|
|
|
38
40
|
</script>
|
|
39
41
|
|
|
40
42
|
{#if list}
|
|
41
|
-
<span class="inline-flex items-center gap-1 {cls}">
|
|
43
|
+
<span class="inline-flex items-center gap-1 {cls}" {...rest}>
|
|
42
44
|
{#each list as k, i (i)}
|
|
43
45
|
{#if i > 0}<span class="text-xs [color:color-mix(in_srgb,var(--ui-color-text)_50%,transparent)]"
|
|
44
46
|
>+</span
|
|
@@ -47,7 +49,7 @@
|
|
|
47
49
|
{/each}
|
|
48
50
|
</span>
|
|
49
51
|
{:else}
|
|
50
|
-
<kbd class="{cap} {responsiveClasses(size, capSize)} {cls}"
|
|
52
|
+
<kbd class="{cap} {responsiveClasses(size, capSize)} {cls}" {...rest}
|
|
51
53
|
>{#if children}{@render children()}{:else}{text}{/if}</kbd
|
|
52
54
|
>
|
|
53
55
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import type { Size } from "../../types/sizes.js";
|
|
3
4
|
import { type Responsive } from "../../types/responsive.js";
|
|
4
5
|
type $$ComponentProps = {
|
|
@@ -9,7 +10,7 @@ type $$ComponentProps = {
|
|
|
9
10
|
size?: Responsive<Size>;
|
|
10
11
|
class?: string;
|
|
11
12
|
children?: Snippet;
|
|
12
|
-
}
|
|
13
|
+
} & Omit<HTMLAttributes<HTMLElement>, "class">;
|
|
13
14
|
declare const Kbd: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
14
15
|
type Kbd = ReturnType<typeof Kbd>;
|
|
15
16
|
export default Kbd;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const i18n = uiI18n();
|
|
4
4
|
import { untrack } from "svelte";
|
|
5
5
|
import type { Snippet } from "svelte";
|
|
6
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
6
7
|
import type { Size } from "../types/sizes.js";
|
|
7
8
|
import { responsiveClasses, type Responsive } from "../types/responsive.js";
|
|
8
9
|
import { variantToken, type Variant } from "../types/variants.js";
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
label: string;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
interface Props {
|
|
16
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class"> {
|
|
16
17
|
options: Option[];
|
|
17
18
|
value?: string | string[]; // Bindable selected value - string[] when multiSelect is true
|
|
18
19
|
multiSelect?: boolean; // Enable multi-select mode
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
onLoadStart,
|
|
82
83
|
onLoadEnd,
|
|
83
84
|
onSelection,
|
|
85
|
+
...rest
|
|
84
86
|
}: Props = $props();
|
|
85
87
|
|
|
86
88
|
// Size axis (see types/sizes.ts): option text scales with the trigger (forwarded by Select).
|
|
@@ -499,7 +501,7 @@
|
|
|
499
501
|
});
|
|
500
502
|
</script>
|
|
501
503
|
|
|
502
|
-
<div class="relative {className}">
|
|
504
|
+
<div class="relative {className}" {...rest}>
|
|
503
505
|
<div class="relative">
|
|
504
506
|
<div
|
|
505
507
|
bind:this={listElement}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import type { Size } from "../types/sizes.js";
|
|
3
4
|
import { type Responsive } from "../types/responsive.js";
|
|
4
5
|
import { type Variant } from "../types/variants.js";
|
|
@@ -6,7 +7,7 @@ type Option = Record<string, any> & {
|
|
|
6
7
|
value: string;
|
|
7
8
|
label: string;
|
|
8
9
|
};
|
|
9
|
-
interface Props {
|
|
10
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class"> {
|
|
10
11
|
options: Option[];
|
|
11
12
|
value?: string | string[];
|
|
12
13
|
multiSelect?: boolean;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
-->
|
|
10
10
|
<script lang="ts">
|
|
11
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
11
12
|
import Popup from "./Popup.svelte";
|
|
12
13
|
import type { Side, Align, Boundary } from "../positioning/anchored.js";
|
|
13
14
|
import type { MenuItem, MenuAction, MenuSeparator } from "../data/table/types.js";
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
boundary = "viewport",
|
|
25
26
|
size = "md",
|
|
26
27
|
variant,
|
|
28
|
+
...rest
|
|
27
29
|
}: {
|
|
28
30
|
anchor: HTMLElement | undefined;
|
|
29
31
|
open?: boolean;
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
/** Tints the highlighted item with a semantic colour (via `.ui-accent` / `--ui-accent`) instead
|
|
36
38
|
* of neutral grey. Omit for the default. */
|
|
37
39
|
variant?: Variant;
|
|
38
|
-
} = $props();
|
|
40
|
+
} & Omit<HTMLAttributes<HTMLElement>, "class" | "style"> = $props();
|
|
39
41
|
|
|
40
42
|
let active = $state(-1);
|
|
41
43
|
const isSeparator = (i: MenuItem): i is MenuSeparator => "divider" in i;
|
|
@@ -87,6 +89,7 @@
|
|
|
87
89
|
<Popup {anchor} bind:open {side} {align} {boundary}>
|
|
88
90
|
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
89
91
|
<ul
|
|
92
|
+
{...rest}
|
|
90
93
|
role="menu"
|
|
91
94
|
tabindex="0"
|
|
92
95
|
{onkeydown}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
1
2
|
import type { Side, Align, Boundary } from "../positioning/anchored.js";
|
|
2
3
|
import type { MenuItem } from "../data/table/types.js";
|
|
3
4
|
import type { Size } from "../types/sizes.js";
|
|
@@ -14,7 +15,7 @@ type $$ComponentProps = {
|
|
|
14
15
|
/** Tints the highlighted item with a semantic colour (via `.ui-accent` / `--ui-accent`) instead
|
|
15
16
|
* of neutral grey. Omit for the default. */
|
|
16
17
|
variant?: Variant;
|
|
17
|
-
}
|
|
18
|
+
} & Omit<HTMLAttributes<HTMLElement>, "class" | "style">;
|
|
18
19
|
declare const Menu: import("svelte").Component<$$ComponentProps, {}, "open">;
|
|
19
20
|
type Menu = ReturnType<typeof Menu>;
|
|
20
21
|
export default Menu;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
<script lang="ts">
|
|
11
11
|
import { uiI18n } from "../../i18n.js";
|
|
12
12
|
const i18n = uiI18n();
|
|
13
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
13
14
|
import Button from "../Button.svelte";
|
|
14
15
|
import Select from "../Select.svelte";
|
|
15
16
|
import NumberInput from "../NumberInput.svelte";
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
borderless = false,
|
|
35
36
|
disabled = false,
|
|
36
37
|
class: cls = "",
|
|
38
|
+
...rest
|
|
37
39
|
}: {
|
|
38
40
|
page?: number;
|
|
39
41
|
total: number;
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
borderless?: boolean;
|
|
53
55
|
disabled?: boolean;
|
|
54
56
|
class?: string;
|
|
55
|
-
} = $props();
|
|
57
|
+
} & Omit<HTMLAttributes<HTMLElement>, "class" | "style"> = $props();
|
|
56
58
|
|
|
57
59
|
const pageCount = $derived(Math.max(1, Math.ceil((total || 0) / (perPage || 1))));
|
|
58
60
|
// Keep `page` in range as total/perPage change.
|
|
@@ -106,6 +108,7 @@
|
|
|
106
108
|
|
|
107
109
|
<nav
|
|
108
110
|
aria-label={i18n.messages.pagination}
|
|
111
|
+
{...rest}
|
|
109
112
|
class="ui-accent flex flex-wrap items-center justify-between gap-3 border rounded-[var(--ui-border-radius)] {bandPad} {cls}"
|
|
110
113
|
style="border-color: {bandBorder}; background-color: {bandBg}; {accentVar}"
|
|
111
114
|
>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
1
2
|
import type { Variant } from "../../types/variants.js";
|
|
2
3
|
import type { Size } from "../../types/sizes.js";
|
|
3
4
|
import { type Responsive } from "../../types/responsive.js";
|
|
@@ -19,7 +20,7 @@ type $$ComponentProps = {
|
|
|
19
20
|
borderless?: boolean;
|
|
20
21
|
disabled?: boolean;
|
|
21
22
|
class?: string;
|
|
22
|
-
}
|
|
23
|
+
} & Omit<HTMLAttributes<HTMLElement>, "class" | "style">;
|
|
23
24
|
declare const Pagination: import("svelte").Component<$$ComponentProps, {}, "perPage" | "page">;
|
|
24
25
|
type Pagination = ReturnType<typeof Pagination>;
|
|
25
26
|
export default Pagination;
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
-->
|
|
18
18
|
<script lang="ts">
|
|
19
19
|
import type { Snippet } from "svelte";
|
|
20
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
20
21
|
import {
|
|
21
22
|
anchored,
|
|
22
23
|
type Side,
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
onclose,
|
|
47
48
|
onplaced,
|
|
48
49
|
children,
|
|
50
|
+
...rest
|
|
49
51
|
}: {
|
|
50
52
|
/** The trigger element to position against. */
|
|
51
53
|
anchor: HTMLElement | undefined;
|
|
@@ -80,7 +82,11 @@
|
|
|
80
82
|
* the box actually landed (e.g. edge-flush borders). */
|
|
81
83
|
onplaced?: (p: Placement) => void;
|
|
82
84
|
children: Snippet;
|
|
83
|
-
|
|
85
|
+
// Leftover HTML attributes are forwarded onto the popover box (the top-layer positioner `<div>`,
|
|
86
|
+
// which is this component's primary content container). `style` omitted — the box computes its own
|
|
87
|
+
// (the panel border when `surface`). `onclose` omitted — it collides with the DOM `onclose` event
|
|
88
|
+
// but is this component's own dismissal callback (`() => void`).
|
|
89
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style" | "onclose"> = $props();
|
|
84
90
|
|
|
85
91
|
// Themed-panel styling (only used when `surface`). Border tints from the variant token; `borderless`
|
|
86
92
|
// paints it the panel's background. Padding scales with `size`.
|
|
@@ -137,6 +143,7 @@
|
|
|
137
143
|
</script>
|
|
138
144
|
|
|
139
145
|
<div
|
|
146
|
+
{...rest}
|
|
140
147
|
bind:this={el}
|
|
141
148
|
popover="manual"
|
|
142
149
|
data-open={open}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import { type Side, type Align, type Boundary, type Placement } from "../positioning/anchored.js";
|
|
3
4
|
import type { Size } from "../types/sizes.js";
|
|
4
5
|
import { type Responsive } from "../types/responsive.js";
|
|
@@ -37,7 +38,7 @@ type $$ComponentProps = {
|
|
|
37
38
|
* the box actually landed (e.g. edge-flush borders). */
|
|
38
39
|
onplaced?: (p: Placement) => void;
|
|
39
40
|
children: Snippet;
|
|
40
|
-
}
|
|
41
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style" | "onclose">;
|
|
41
42
|
declare const Popup: import("svelte").Component<$$ComponentProps, {}, "open">;
|
|
42
43
|
type Popup = ReturnType<typeof Popup>;
|
|
43
44
|
export default Popup;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
-->
|
|
8
8
|
<script lang="ts">
|
|
9
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
9
10
|
import type { Variant } from "../../types/variants.js";
|
|
10
11
|
import { variantToken } from "../../types/variants.js";
|
|
11
12
|
import type { Size } from "../../types/sizes.js";
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
label,
|
|
21
22
|
showValue = false,
|
|
22
23
|
class: cls = "",
|
|
24
|
+
...rest
|
|
23
25
|
}: {
|
|
24
26
|
value?: number;
|
|
25
27
|
max?: number;
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
label?: string;
|
|
30
32
|
showValue?: boolean;
|
|
31
33
|
class?: string;
|
|
32
|
-
} = $props();
|
|
34
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
|
|
33
35
|
|
|
34
36
|
const token = $derived(variantToken[variant]);
|
|
35
37
|
const pct = $derived(
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
const textClass: Record<Size, string> = { sm: "text-xs", md: "text-sm", lg: "text-sm" };
|
|
42
44
|
</script>
|
|
43
45
|
|
|
44
|
-
<div class="w-full {cls}">
|
|
46
|
+
<div class="w-full {cls}" {...rest}>
|
|
45
47
|
{#if label || (showValue && !indeterminate)}
|
|
46
48
|
<div
|
|
47
49
|
class="mb-1 flex items-center justify-between {responsiveClasses(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
1
2
|
import type { Variant } from "../../types/variants.js";
|
|
2
3
|
import type { Size } from "../../types/sizes.js";
|
|
3
4
|
import { type Responsive } from "../../types/responsive.js";
|
|
@@ -10,7 +11,7 @@ type $$ComponentProps = {
|
|
|
10
11
|
label?: string;
|
|
11
12
|
showValue?: boolean;
|
|
12
13
|
class?: string;
|
|
13
|
-
}
|
|
14
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class">;
|
|
14
15
|
declare const Progress: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
15
16
|
type Progress = ReturnType<typeof Progress>;
|
|
16
17
|
export default Progress;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { uiI18n } from "../i18n.js";
|
|
11
11
|
const i18n = uiI18n();
|
|
12
12
|
import { tick } from "svelte";
|
|
13
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
13
14
|
import IconSearch from "~icons/mdi/magnify";
|
|
14
15
|
import IconClose from "~icons/mdi/close";
|
|
15
16
|
import IconHelp from "~icons/mdi/help-circle-outline";
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
size = "md",
|
|
29
30
|
variant = "neutral",
|
|
30
31
|
borderless = false,
|
|
32
|
+
...rest
|
|
31
33
|
}: {
|
|
32
34
|
dataset: DataSet;
|
|
33
35
|
placeholder?: string;
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
size?: Responsive<Size>;
|
|
36
38
|
variant?: Variant;
|
|
37
39
|
borderless?: boolean;
|
|
38
|
-
} = $props();
|
|
40
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
|
|
39
41
|
|
|
40
42
|
let inputEl = $state<HTMLInputElement>();
|
|
41
43
|
let wrapperEl = $state<HTMLElement>();
|
|
@@ -134,7 +136,7 @@
|
|
|
134
136
|
const bc = "border-[color-mix(in_srgb,var(--ui-color-secondary)_30%,transparent)]";
|
|
135
137
|
</script>
|
|
136
138
|
|
|
137
|
-
<div class="w-full [color:var(--ui-color-text)]">
|
|
139
|
+
<div {...rest} class="w-full [color:var(--ui-color-text)]">
|
|
138
140
|
<!-- Built on the core <Input> so the frame/border/hover/focus glow + themed autofill are shared,
|
|
139
141
|
not re-rolled. Search is the left icon; clear + help live in the `actions` slot; the parse
|
|
140
142
|
error reuses Input's own validation (danger) styling. -->
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
1
2
|
import type { DataSet } from "../data/dataset.js";
|
|
2
3
|
import type { Size } from "../types/sizes.js";
|
|
3
4
|
import type { Responsive } from "../types/responsive.js";
|
|
@@ -9,7 +10,7 @@ type $$ComponentProps = {
|
|
|
9
10
|
size?: Responsive<Size>;
|
|
10
11
|
variant?: Variant;
|
|
11
12
|
borderless?: boolean;
|
|
12
|
-
}
|
|
13
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class">;
|
|
13
14
|
declare const Query: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
14
15
|
type Query = ReturnType<typeof Query>;
|
|
15
16
|
export default Query;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script lang="ts">
|
|
8
8
|
import type { Snippet } from "svelte";
|
|
9
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
9
10
|
import type { Variant } from "../../types/variants.js";
|
|
10
11
|
import { variantToken } from "../../types/variants.js";
|
|
11
12
|
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
variant,
|
|
17
18
|
class: cls = "",
|
|
18
19
|
children,
|
|
20
|
+
...rest
|
|
19
21
|
}: {
|
|
20
22
|
orientation?: "vertical" | "horizontal" | "both";
|
|
21
23
|
/** Cap the height (any CSS length) — content beyond scrolls. */
|
|
@@ -25,7 +27,8 @@
|
|
|
25
27
|
variant?: Variant;
|
|
26
28
|
class?: string;
|
|
27
29
|
children: Snippet;
|
|
28
|
-
|
|
30
|
+
// `style` omitted — the container computes its own (thumb tint vars + height/max-height).
|
|
31
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style"> = $props();
|
|
29
32
|
|
|
30
33
|
const overflow = $derived(
|
|
31
34
|
orientation === "horizontal"
|
|
@@ -43,7 +46,7 @@
|
|
|
43
46
|
);
|
|
44
47
|
</script>
|
|
45
48
|
|
|
46
|
-
<div class="ui-scroll {overflow} {cls}" {style}>
|
|
49
|
+
<div {...rest} class="ui-scroll {overflow} {cls}" {style}>
|
|
47
50
|
{@render children()}
|
|
48
51
|
</div>
|
|
49
52
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import type { Variant } from "../../types/variants.js";
|
|
3
4
|
type $$ComponentProps = {
|
|
4
5
|
orientation?: "vertical" | "horizontal" | "both";
|
|
@@ -9,7 +10,7 @@ type $$ComponentProps = {
|
|
|
9
10
|
variant?: Variant;
|
|
10
11
|
class?: string;
|
|
11
12
|
children: Snippet;
|
|
12
|
-
}
|
|
13
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style">;
|
|
13
14
|
declare const ScrollArea: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
14
15
|
type ScrollArea = ReturnType<typeof ScrollArea>;
|
|
15
16
|
export default ScrollArea;
|