@spaethtech/svelte-ui 0.20.1-dev.99.8654270 → 0.21.1-dev.108.1b2415e
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 +15 -6
- package/dist/components/Alert.svelte.d.ts +4 -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/Badge/Badge.svelte +34 -7
- package/dist/components/Badge/Badge.svelte.d.ts +10 -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/CardFooter.svelte +12 -1
- package/dist/components/CardFooter.svelte.d.ts +3 -0
- 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/EmailInput.svelte +2 -1
- package/dist/components/EmailInput.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/NumberInput.svelte +2 -1
- package/dist/components/NumberInput.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/PasswordInput.svelte +2 -1
- package/dist/components/PasswordInput.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/SearchInput.svelte +2 -1
- package/dist/components/SearchInput.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/dist/components/field-chrome.d.ts +22 -0
- package/dist/components/field-chrome.js +1 -0
- package/docs/components.md +27 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import CardFooter from "./CardFooter.svelte";
|
|
6
6
|
import Button from "./Button.svelte";
|
|
7
7
|
import type { ComponentProps, Snippet } from "svelte";
|
|
8
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
8
9
|
import type { Size } from "../types/sizes.js";
|
|
9
10
|
import type { Responsive } from "../types/responsive.js";
|
|
10
11
|
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
* consistent with every other surface. Pass `children` to replace the message body with custom
|
|
15
16
|
* content (the header + footer stay). For a fully custom modal, use `Dialog` directly.
|
|
16
17
|
*/
|
|
17
|
-
interface Props {
|
|
18
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class"> {
|
|
18
19
|
isOpen: boolean;
|
|
19
20
|
title?: string;
|
|
20
21
|
message?: string;
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
onShow,
|
|
58
59
|
onHide,
|
|
59
60
|
children,
|
|
61
|
+
...rest
|
|
60
62
|
}: Props = $props();
|
|
61
63
|
|
|
62
64
|
function handleConfirm() {
|
|
@@ -70,6 +72,7 @@
|
|
|
70
72
|
</script>
|
|
71
73
|
|
|
72
74
|
<Dialog
|
|
75
|
+
{...rest}
|
|
73
76
|
bind:isOpen
|
|
74
77
|
{dismissible}
|
|
75
78
|
{width}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Dialog from "./Dialog.svelte";
|
|
2
2
|
import type { ComponentProps, Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
4
|
import type { Size } from "../types/sizes.js";
|
|
4
5
|
import type { Responsive } from "../types/responsive.js";
|
|
5
6
|
/**
|
|
@@ -8,7 +9,7 @@ import type { Responsive } from "../types/responsive.js";
|
|
|
8
9
|
* consistent with every other surface. Pass `children` to replace the message body with custom
|
|
9
10
|
* content (the header + footer stay). For a fully custom modal, use `Dialog` directly.
|
|
10
11
|
*/
|
|
11
|
-
interface Props {
|
|
12
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class"> {
|
|
12
13
|
isOpen: boolean;
|
|
13
14
|
title?: string;
|
|
14
15
|
message?: string;
|
|
@@ -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
|
import Menu from "../Menu.svelte";
|
|
11
12
|
import type { MenuItem } from "../../data/table/types.js";
|
|
12
13
|
import type { Variant } from "../../types/variants.js";
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
disabled = false,
|
|
21
22
|
class: cls = "",
|
|
22
23
|
children,
|
|
24
|
+
...rest
|
|
23
25
|
}: {
|
|
24
26
|
items: MenuItem[];
|
|
25
27
|
size?: Responsive<Size>;
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
disabled?: boolean;
|
|
28
30
|
class?: string;
|
|
29
31
|
children: Snippet;
|
|
30
|
-
} = $props();
|
|
32
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
|
|
31
33
|
|
|
32
34
|
let open = $state(false);
|
|
33
35
|
let anchorEl = $state<HTMLElement>();
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
</script>
|
|
45
47
|
|
|
46
48
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
47
|
-
<div class="contents {cls}" oncontextmenu={onContextMenu}>
|
|
49
|
+
<div {...rest} class="contents {cls}" oncontextmenu={onContextMenu}>
|
|
48
50
|
{@render children()}
|
|
49
51
|
</div>
|
|
50
52
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import type { MenuItem } from "../../data/table/types.js";
|
|
3
4
|
import type { Variant } from "../../types/variants.js";
|
|
4
5
|
import type { Size } from "../../types/sizes.js";
|
|
@@ -10,7 +11,7 @@ type $$ComponentProps = {
|
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
class?: string;
|
|
12
13
|
children: Snippet;
|
|
13
|
-
}
|
|
14
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class">;
|
|
14
15
|
declare const ContextMenu: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
15
16
|
type ContextMenu = ReturnType<typeof ContextMenu>;
|
|
16
17
|
export default ContextMenu;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { uiI18n } from "../i18n.js";
|
|
14
14
|
const i18n = uiI18n();
|
|
15
15
|
import type { Snippet } from "svelte";
|
|
16
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
16
17
|
import IconDots from "~icons/mdi/dots-vertical";
|
|
17
18
|
import IconBulk from "~icons/mdi/format-list-checks";
|
|
18
19
|
import IconSortAsc from "~icons/mdi/sort-ascending";
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
truncate = true,
|
|
51
52
|
borderless = false,
|
|
52
53
|
variant,
|
|
54
|
+
...rest
|
|
53
55
|
}: {
|
|
54
56
|
grid: DataGrid<T>;
|
|
55
57
|
selectable?: boolean;
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
* `ghost` additionally drops ALL section fills (bands + body) for a bare,
|
|
98
100
|
* see-through table. Omit for the default grey tint. */
|
|
99
101
|
variant?: Variant;
|
|
100
|
-
} = $props();
|
|
102
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style"> = $props();
|
|
101
103
|
|
|
102
104
|
/** When a variant is set, override --ui-accent so the shared interactive
|
|
103
105
|
* tints re-mix from that colour (the `.ui-accent` class on the root does
|
|
@@ -228,6 +230,7 @@
|
|
|
228
230
|
</script>
|
|
229
231
|
|
|
230
232
|
<div
|
|
233
|
+
{...rest}
|
|
231
234
|
role="table"
|
|
232
235
|
class="ui-accent relative [color:var(--ui-color-text)]"
|
|
233
236
|
style="font-size: {textVar}; {accentVar}"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
3
|
import type { MenuItem, DataGrid } from "../data/table/index.js";
|
|
3
4
|
import type { Size } from "../types/sizes.js";
|
|
4
5
|
import { type Responsive } from "../types/responsive.js";
|
|
@@ -51,7 +52,7 @@ declare function $$render<T>(): {
|
|
|
51
52
|
* `ghost` additionally drops ALL section fills (bands + body) for a bare,
|
|
52
53
|
* see-through table. Omit for the default grey tint. */
|
|
53
54
|
variant?: Variant;
|
|
54
|
-
}
|
|
55
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style">;
|
|
55
56
|
exports: {};
|
|
56
57
|
bindings: "";
|
|
57
58
|
slots: {};
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<script lang="ts">
|
|
16
16
|
import { uiI18n } from "../i18n.js";
|
|
17
17
|
const i18n = uiI18n();
|
|
18
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
18
19
|
import type { Size } from "../types/sizes.js";
|
|
19
20
|
import { responsiveClasses, type Responsive } from "../types/responsive.js";
|
|
20
21
|
import { variantToken, type Variant } from "../types/variants.js";
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
import IconClose from "~icons/mdi/close";
|
|
28
29
|
|
|
29
30
|
type RangeValue = { start: string | null; end: string | null };
|
|
30
|
-
interface Props {
|
|
31
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class"> {
|
|
31
32
|
value?: string | RangeValue | null;
|
|
32
33
|
range?: boolean;
|
|
33
34
|
time?: boolean;
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
variant = "primary",
|
|
67
68
|
class: cls = "",
|
|
68
69
|
name,
|
|
70
|
+
...rest
|
|
69
71
|
}: Props = $props();
|
|
70
72
|
|
|
71
73
|
const accent = $derived(`var(${variantToken[variant]})`);
|
|
@@ -178,7 +180,7 @@
|
|
|
178
180
|
}
|
|
179
181
|
</script>
|
|
180
182
|
|
|
181
|
-
<div bind:this={anchorEl} class="w-full {cls}">
|
|
183
|
+
<div {...rest} bind:this={anchorEl} class="w-full {cls}">
|
|
182
184
|
<Input
|
|
183
185
|
value={label}
|
|
184
186
|
readonly
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
1
2
|
import type { Size } from "../types/sizes.js";
|
|
2
3
|
import { type Responsive } from "../types/responsive.js";
|
|
3
4
|
import { type Variant } from "../types/variants.js";
|
|
@@ -6,7 +7,7 @@ type RangeValue = {
|
|
|
6
7
|
start: string | null;
|
|
7
8
|
end: string | null;
|
|
8
9
|
};
|
|
9
|
-
interface Props {
|
|
10
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class"> {
|
|
10
11
|
value?: string | RangeValue | null;
|
|
11
12
|
range?: boolean;
|
|
12
13
|
time?: boolean;
|
|
@@ -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;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
import type { Size } from "../types/sizes.js";
|
|
6
6
|
import type { Responsive } from "../types/responsive.js";
|
|
7
7
|
import type { Variant } from "../types/variants.js";
|
|
8
|
+
import type { FieldChromeProps } from "./field-chrome.js";
|
|
8
9
|
|
|
9
|
-
interface Props extends Omit<HTMLInputAttributes, "type" | "size"
|
|
10
|
+
interface Props extends Omit<HTMLInputAttributes, "type" | "size">, FieldChromeProps {
|
|
10
11
|
value: string;
|
|
11
12
|
class?: string;
|
|
12
13
|
inputClass?: string;
|
|
@@ -2,7 +2,8 @@ import type { HTMLInputAttributes } from "svelte/elements";
|
|
|
2
2
|
import type { Size } from "../types/sizes.js";
|
|
3
3
|
import type { Responsive } from "../types/responsive.js";
|
|
4
4
|
import type { Variant } from "../types/variants.js";
|
|
5
|
-
|
|
5
|
+
import type { FieldChromeProps } from "./field-chrome.js";
|
|
6
|
+
interface Props extends Omit<HTMLInputAttributes, "type" | "size">, FieldChromeProps {
|
|
6
7
|
value: string;
|
|
7
8
|
class?: string;
|
|
8
9
|
inputClass?: string;
|
|
@@ -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;
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
import type { Size } from "../types/sizes.js";
|
|
12
12
|
import type { Responsive } from "../types/responsive.js";
|
|
13
13
|
import type { Variant } from "../types/variants.js";
|
|
14
|
+
import type { FieldChromeProps } from "./field-chrome.js";
|
|
14
15
|
|
|
15
|
-
interface Props extends Omit<HTMLInputAttributes, "type" | "value" | "size"
|
|
16
|
+
interface Props extends Omit<HTMLInputAttributes, "type" | "value" | "size">, FieldChromeProps {
|
|
16
17
|
value: number | null;
|
|
17
18
|
class?: string;
|
|
18
19
|
inputClass?: string;
|
|
@@ -2,7 +2,8 @@ import type { HTMLInputAttributes } from "svelte/elements";
|
|
|
2
2
|
import type { Size } from "../types/sizes.js";
|
|
3
3
|
import type { Responsive } from "../types/responsive.js";
|
|
4
4
|
import type { Variant } from "../types/variants.js";
|
|
5
|
-
|
|
5
|
+
import type { FieldChromeProps } from "./field-chrome.js";
|
|
6
|
+
interface Props extends Omit<HTMLInputAttributes, "type" | "value" | "size">, FieldChromeProps {
|
|
6
7
|
value: number | null;
|
|
7
8
|
class?: string;
|
|
8
9
|
inputClass?: string;
|