@spaethtech/svelte-ui 0.20.1-dev.102.3c5719c → 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.
Files changed (53) hide show
  1. package/dist/components/Alert.svelte +4 -1
  2. package/dist/components/Alert.svelte.d.ts +2 -1
  3. package/dist/components/Banner.svelte +4 -1
  4. package/dist/components/Banner.svelte.d.ts +2 -1
  5. package/dist/components/Carousel/Carousel.svelte +4 -1
  6. package/dist/components/Carousel/Carousel.svelte.d.ts +2 -1
  7. package/dist/components/Chip/Chip.svelte +4 -1
  8. package/dist/components/Chip/Chip.svelte.d.ts +2 -1
  9. package/dist/components/Combobox/Combobox.svelte +4 -1
  10. package/dist/components/Combobox/Combobox.svelte.d.ts +2 -1
  11. package/dist/components/CommandPalette/CommandPalette.svelte +4 -2
  12. package/dist/components/CommandPalette/CommandPalette.svelte.d.ts +2 -1
  13. package/dist/components/ConfirmDialog.svelte +4 -1
  14. package/dist/components/ConfirmDialog.svelte.d.ts +2 -1
  15. package/dist/components/ContextMenu/ContextMenu.svelte +4 -2
  16. package/dist/components/ContextMenu/ContextMenu.svelte.d.ts +2 -1
  17. package/dist/components/DataTable.svelte +4 -1
  18. package/dist/components/DataTable.svelte.d.ts +2 -1
  19. package/dist/components/DatePicker.svelte +4 -2
  20. package/dist/components/DatePicker.svelte.d.ts +2 -1
  21. package/dist/components/Drawer/Drawer.svelte +4 -1
  22. package/dist/components/Drawer/Drawer.svelte.d.ts +2 -1
  23. package/dist/components/FileUpload/FileUpload.svelte +4 -2
  24. package/dist/components/FileUpload/FileUpload.svelte.d.ts +2 -1
  25. package/dist/components/Menu.svelte +4 -1
  26. package/dist/components/Menu.svelte.d.ts +2 -1
  27. package/dist/components/Pagination/Pagination.svelte +4 -1
  28. package/dist/components/Pagination/Pagination.svelte.d.ts +2 -1
  29. package/dist/components/Popup.svelte +8 -1
  30. package/dist/components/Popup.svelte.d.ts +2 -1
  31. package/dist/components/Query.svelte +4 -2
  32. package/dist/components/Query.svelte.d.ts +2 -1
  33. package/dist/components/ScrollArea/ScrollArea.svelte +5 -2
  34. package/dist/components/ScrollArea/ScrollArea.svelte.d.ts +2 -1
  35. package/dist/components/SideBarMenu/SideBarMenu.svelte +7 -1
  36. package/dist/components/SideBarMenu/SideBarMenu.svelte.d.ts +2 -1
  37. package/dist/components/Slider/Slider.svelte +4 -2
  38. package/dist/components/Slider/Slider.svelte.d.ts +2 -1
  39. package/dist/components/Spinner/Spinner.svelte +4 -1
  40. package/dist/components/Spinner/Spinner.svelte.d.ts +2 -1
  41. package/dist/components/Splitter/Splitter.svelte +4 -1
  42. package/dist/components/Splitter/Splitter.svelte.d.ts +2 -1
  43. package/dist/components/Stepper/Stepper.svelte +4 -1
  44. package/dist/components/Stepper/Stepper.svelte.d.ts +2 -1
  45. package/dist/components/ThemeSelector.svelte +10 -2
  46. package/dist/components/ThemeSelector.svelte.d.ts +2 -1
  47. package/dist/components/ThemeToggle.svelte +10 -1
  48. package/dist/components/ThemeToggle.svelte.d.ts +2 -1
  49. package/dist/components/TokenInput/TokenInput.svelte +6 -1
  50. package/dist/components/TokenInput/TokenInput.svelte.d.ts +2 -1
  51. package/dist/components/Tree/Tree.svelte +11 -2
  52. package/dist/components/Tree/Tree.svelte.d.ts +2 -1
  53. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from "svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
3
4
  import type { Size } from "../types/sizes.js";
4
5
  import { responsiveClasses, type Responsive } from "../types/responsive.js";
5
6
 
@@ -10,7 +11,7 @@
10
11
  */
11
12
  type AlertVariant =
12
13
  "neutral" | "primary" | "secondary" | "success" | "info" | "warning" | "danger" | "ghost";
13
- interface Props {
14
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class" | "style"> {
14
15
  variant?: AlertVariant;
15
16
  size?: Responsive<Size>;
16
17
  text?: string;
@@ -40,6 +41,7 @@
40
41
  iconPosition = "left",
41
42
  class: cls = "",
42
43
  children,
44
+ ...rest
43
45
  }: Props = $props();
44
46
 
45
47
  // Variant → semantic token (danger maps to the renamed --ui-color-error).
@@ -95,6 +97,7 @@
95
97
  {#if has}
96
98
  <div
97
99
  role="alert"
100
+ {...rest}
98
101
  class="flex {title ? 'items-start' : 'items-center'} [border-radius:var(--ui-border-radius)] border {responsiveClasses(
99
102
  size,
100
103
  sizeClass,
@@ -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
  /**
@@ -7,7 +8,7 @@ import { type Responsive } from "../types/responsive.js";
7
8
  * hand-rolled `[color:var(--ui-color-error)]` divs. Renders nothing when empty (drop-in for `{#if err}`).
8
9
  */
9
10
  type AlertVariant = "neutral" | "primary" | "secondary" | "success" | "info" | "warning" | "danger" | "ghost";
10
- interface Props {
11
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class" | "style"> {
11
12
  variant?: AlertVariant;
12
13
  size?: Responsive<Size>;
13
14
  text?: string;
@@ -2,6 +2,7 @@
2
2
  import { uiI18n } from "../i18n.js";
3
3
  const i18n = uiI18n();
4
4
  import type { Snippet } from "svelte";
5
+ import type { HTMLAttributes } from "svelte/elements";
5
6
  import type { Size } from "../types/sizes.js";
6
7
  import { responsiveClasses, type Responsive } from "../types/responsive.js";
7
8
  import IconClose from "~icons/mdi/close";
@@ -14,7 +15,7 @@
14
15
  */
15
16
  type BannerVariant =
16
17
  "neutral" | "primary" | "secondary" | "success" | "info" | "warning" | "danger" | "ghost";
17
- interface Props {
18
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class" | "style"> {
18
19
  variant?: BannerVariant;
19
20
  size?: Responsive<Size>;
20
21
  text?: string;
@@ -43,6 +44,7 @@
43
44
  onClose,
44
45
  class: cls = "",
45
46
  children,
47
+ ...rest
46
48
  }: Props = $props();
47
49
 
48
50
  // Variant → semantic token (danger maps to --ui-color-error).
@@ -104,6 +106,7 @@
104
106
  {#if open}
105
107
  <div
106
108
  role="status"
109
+ {...rest}
107
110
  class="flex w-full items-center border [border-radius:var(--ui-border-radius)] [&_svg]:fill-current {responsiveClasses(
108
111
  size,
109
112
  sizeClass,
@@ -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
  /**
@@ -8,7 +9,7 @@ import { type Responsive } from "../types/responsive.js";
8
9
  * inline field/form status, use <Alert> instead. Honours the shared Size axis (scalar OR responsive).
9
10
  */
10
11
  type BannerVariant = "neutral" | "primary" | "secondary" | "success" | "info" | "warning" | "danger" | "ghost";
11
- interface Props {
12
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class" | "style"> {
12
13
  variant?: BannerVariant;
13
14
  size?: Responsive<Size>;
14
15
  text?: string;
@@ -17,6 +17,7 @@
17
17
  import IconNext from "~icons/mdi/chevron-right";
18
18
  import type { Variant } from "../../types/variants.js";
19
19
  import { variantToken } from "../../types/variants.js";
20
+ import type { HTMLAttributes } from "svelte/elements";
20
21
 
21
22
  let {
22
23
  items,
@@ -29,6 +30,7 @@
29
30
  variant = "primary",
30
31
  ariaLabel = "Carousel",
31
32
  class: cls = "",
33
+ ...rest
32
34
  }: {
33
35
  items: T[];
34
36
  slide: Snippet<[T, number]>;
@@ -41,7 +43,7 @@
41
43
  variant?: Variant;
42
44
  ariaLabel?: string;
43
45
  class?: string;
44
- } = $props();
46
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
45
47
 
46
48
  const n = $derived(items.length);
47
49
  const token = $derived(variantToken[variant]);
@@ -77,6 +79,7 @@
77
79
 
78
80
  <!-- svelte-ignore a11y_no_noninteractive_element_interactions a11y_no_noninteractive_tabindex (focusable carousel region for keyboard nav) -->
79
81
  <div
82
+ {...rest}
80
83
  role="region"
81
84
  aria-roledescription="carousel"
82
85
  aria-label={ariaLabel}
@@ -1,5 +1,6 @@
1
1
  import type { Snippet } from "svelte";
2
2
  import type { Variant } from "../../types/variants.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
3
4
  declare function $$render<T>(): {
4
5
  props: {
5
6
  items: T[];
@@ -13,7 +14,7 @@ declare function $$render<T>(): {
13
14
  variant?: Variant;
14
15
  ariaLabel?: string;
15
16
  class?: string;
16
- };
17
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class">;
17
18
  exports: {};
18
19
  bindings: "index";
19
20
  slots: {};
@@ -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 IconClose from "~icons/mdi/close";
14
15
  import type { Variant } from "../../types/variants.js";
15
16
  import { variantToken } from "../../types/variants.js";
@@ -30,6 +31,7 @@
30
31
  rounded = true,
31
32
  class: cls = "",
32
33
  children,
34
+ ...rest
33
35
  }: {
34
36
  text?: string;
35
37
  icon?: Snippet;
@@ -44,7 +46,7 @@
44
46
  rounded?: boolean;
45
47
  class?: string;
46
48
  children?: Snippet;
47
- } = $props();
49
+ } & Omit<HTMLAttributes<HTMLElement>, "class" | "style"> = $props();
48
50
 
49
51
  const interactive = $derived(!!onclick || !!href);
50
52
  const isButton = $derived(!!onclick && !href); // role=button (href navigates instead)
@@ -107,6 +109,7 @@
107
109
 
108
110
  <svelte:element
109
111
  this={href ? "a" : "span"}
112
+ {...rest}
110
113
  {href}
111
114
  role={isButton ? "button" : undefined}
112
115
  tabindex={isButton ? (disabled ? -1 : 0) : undefined}
@@ -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";
@@ -16,7 +17,7 @@ type $$ComponentProps = {
16
17
  rounded?: boolean;
17
18
  class?: string;
18
19
  children?: Snippet;
19
- };
20
+ } & Omit<HTMLAttributes<HTMLElement>, "class" | "style">;
20
21
  declare const Chip: import("svelte").Component<$$ComponentProps, {}, "">;
21
22
  type Chip = ReturnType<typeof Chip>;
22
23
  export default Chip;
@@ -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 Input from "../Input.svelte";
11
12
  import Popup from "../Popup.svelte";
12
13
  import IconChevronDown from "~icons/mdi/chevron-down";
@@ -35,6 +36,7 @@
35
36
  id,
36
37
  required = false,
37
38
  class: cls = "",
39
+ ...rest
38
40
  }: {
39
41
  value?: string;
40
42
  options?: string[];
@@ -55,7 +57,7 @@
55
57
  id?: string;
56
58
  required?: boolean;
57
59
  class?: string;
58
- } = $props();
60
+ } & Omit<HTMLAttributes<HTMLInputElement>, "class"> = $props();
59
61
 
60
62
  const baseId = $props.id();
61
63
  const listId = `${baseId}-listbox`;
@@ -155,6 +157,7 @@
155
157
  </script>
156
158
 
157
159
  <Input
160
+ {...rest}
158
161
  bind:value
159
162
  bind:element={inputEl}
160
163
  bind:fieldElement={fieldEl}
@@ -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";
@@ -22,7 +23,7 @@ type $$ComponentProps = {
22
23
  id?: string;
23
24
  required?: boolean;
24
25
  class?: string;
25
- };
26
+ } & Omit<HTMLAttributes<HTMLInputElement>, "class">;
26
27
  declare const Combobox: import("svelte").Component<$$ComponentProps, {}, "value">;
27
28
  type Combobox = ReturnType<typeof Combobox>;
28
29
  export default Combobox;
@@ -22,6 +22,7 @@
22
22
  <script lang="ts">
23
23
  import { uiI18n } from "../../i18n.js";
24
24
  const i18n = uiI18n();
25
+ import type { HTMLAttributes } from "svelte/elements";
25
26
  import Input from "../Input.svelte";
26
27
  import Kbd from "../Kbd/Kbd.svelte";
27
28
  import IconSearch from "~icons/mdi/magnify";
@@ -33,6 +34,7 @@
33
34
  placeholder = "Type a command or search…",
34
35
  empty = "No matching commands",
35
36
  onopen,
37
+ ...rest
36
38
  }: {
37
39
  open?: boolean;
38
40
  commands: Command[];
@@ -41,7 +43,7 @@
41
43
  placeholder?: string;
42
44
  empty?: string;
43
45
  onopen?: () => void;
44
- } = $props();
46
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
45
47
 
46
48
  let query = $state("");
47
49
  let highlight = $state(0);
@@ -139,7 +141,7 @@
139
141
 
140
142
  {#if open}
141
143
  <!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
142
- <div use:portal class="fixed inset-0 z-[9999] flex justify-center bg-black/40 p-4 pt-[12vh]" role="presentation"
144
+ <div use:portal {...rest} class="fixed inset-0 z-[9999] flex justify-center bg-black/40 p-4 pt-[12vh]" role="presentation"
143
145
  onclick={(e) => { if (e.target === e.currentTarget) open = false; }}>
144
146
  <div
145
147
  class="h-max w-full max-w-xl overflow-hidden rounded-[var(--ui-border-radius)] border shadow-2xl [background-color:var(--ui-color-background)] [border-color:var(--ui-border-color)]"
@@ -9,6 +9,7 @@ export type Command = {
9
9
  disabled?: boolean;
10
10
  onrun: () => void;
11
11
  };
12
+ import type { HTMLAttributes } from "svelte/elements";
12
13
  type $$ComponentProps = {
13
14
  open?: boolean;
14
15
  commands: Command[];
@@ -17,7 +18,7 @@ type $$ComponentProps = {
17
18
  placeholder?: string;
18
19
  empty?: string;
19
20
  onopen?: () => void;
20
- };
21
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class">;
21
22
  declare const CommandPalette: import("svelte").Component<$$ComponentProps, {}, "open">;
22
23
  type CommandPalette = ReturnType<typeof CommandPalette>;
23
24
  export default CommandPalette;
@@ -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;
@@ -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;
@@ -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;
@@ -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
  >