@spaethtech/svelte-ui 0.20.1-dev.99.8654270 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/components/Alert.svelte +15 -6
  2. package/dist/components/Alert.svelte.d.ts +4 -1
  3. package/dist/components/Avatar/Avatar.svelte +4 -2
  4. package/dist/components/Avatar/Avatar.svelte.d.ts +2 -1
  5. package/dist/components/Avatar/AvatarGroup.svelte +4 -1
  6. package/dist/components/Avatar/AvatarGroup.svelte.d.ts +2 -1
  7. package/dist/components/Badge/Badge.svelte +34 -7
  8. package/dist/components/Badge/Badge.svelte.d.ts +10 -1
  9. package/dist/components/Banner.svelte +4 -1
  10. package/dist/components/Banner.svelte.d.ts +2 -1
  11. package/dist/components/Breadcrumbs/Breadcrumbs.svelte +4 -2
  12. package/dist/components/Breadcrumbs/Breadcrumbs.svelte.d.ts +2 -1
  13. package/dist/components/CardFooter.svelte +12 -1
  14. package/dist/components/CardFooter.svelte.d.ts +3 -0
  15. package/dist/components/Carousel/Carousel.svelte +4 -1
  16. package/dist/components/Carousel/Carousel.svelte.d.ts +2 -1
  17. package/dist/components/Chip/Chip.svelte +4 -1
  18. package/dist/components/Chip/Chip.svelte.d.ts +2 -1
  19. package/dist/components/Combobox/Combobox.svelte +4 -1
  20. package/dist/components/Combobox/Combobox.svelte.d.ts +2 -1
  21. package/dist/components/CommandPalette/CommandPalette.svelte +4 -2
  22. package/dist/components/CommandPalette/CommandPalette.svelte.d.ts +2 -1
  23. package/dist/components/ConfirmDialog.svelte +4 -1
  24. package/dist/components/ConfirmDialog.svelte.d.ts +2 -1
  25. package/dist/components/ContextMenu/ContextMenu.svelte +4 -2
  26. package/dist/components/ContextMenu/ContextMenu.svelte.d.ts +2 -1
  27. package/dist/components/DataTable.svelte +4 -1
  28. package/dist/components/DataTable.svelte.d.ts +2 -1
  29. package/dist/components/DatePicker.svelte +4 -2
  30. package/dist/components/DatePicker.svelte.d.ts +2 -1
  31. package/dist/components/Divider/Divider.svelte +6 -3
  32. package/dist/components/Divider/Divider.svelte.d.ts +2 -1
  33. package/dist/components/Drawer/Drawer.svelte +4 -1
  34. package/dist/components/Drawer/Drawer.svelte.d.ts +2 -1
  35. package/dist/components/EmailInput.svelte +2 -1
  36. package/dist/components/EmailInput.svelte.d.ts +2 -1
  37. package/dist/components/EmptyState/EmptyState.svelte +4 -2
  38. package/dist/components/EmptyState/EmptyState.svelte.d.ts +2 -1
  39. package/dist/components/FileUpload/FileUpload.svelte +4 -2
  40. package/dist/components/FileUpload/FileUpload.svelte.d.ts +2 -1
  41. package/dist/components/Grid.svelte +4 -2
  42. package/dist/components/Grid.svelte.d.ts +2 -1
  43. package/dist/components/Kbd/Kbd.svelte +5 -3
  44. package/dist/components/Kbd/Kbd.svelte.d.ts +2 -1
  45. package/dist/components/List.svelte +4 -2
  46. package/dist/components/List.svelte.d.ts +2 -1
  47. package/dist/components/Menu.svelte +4 -1
  48. package/dist/components/Menu.svelte.d.ts +2 -1
  49. package/dist/components/NumberInput.svelte +2 -1
  50. package/dist/components/NumberInput.svelte.d.ts +2 -1
  51. package/dist/components/Pagination/Pagination.svelte +4 -1
  52. package/dist/components/Pagination/Pagination.svelte.d.ts +2 -1
  53. package/dist/components/PasswordInput.svelte +2 -1
  54. package/dist/components/PasswordInput.svelte.d.ts +2 -1
  55. package/dist/components/Popup.svelte +8 -1
  56. package/dist/components/Popup.svelte.d.ts +2 -1
  57. package/dist/components/Progress/Progress.svelte +4 -2
  58. package/dist/components/Progress/Progress.svelte.d.ts +2 -1
  59. package/dist/components/Query.svelte +4 -2
  60. package/dist/components/Query.svelte.d.ts +2 -1
  61. package/dist/components/ScrollArea/ScrollArea.svelte +5 -2
  62. package/dist/components/ScrollArea/ScrollArea.svelte.d.ts +2 -1
  63. package/dist/components/SearchInput.svelte +2 -1
  64. package/dist/components/SearchInput.svelte.d.ts +2 -1
  65. package/dist/components/Select.svelte +3 -1
  66. package/dist/components/Select.svelte.d.ts +3 -1
  67. package/dist/components/SideBarMenu/SideBarMenu.svelte +7 -1
  68. package/dist/components/SideBarMenu/SideBarMenu.svelte.d.ts +2 -1
  69. package/dist/components/Skeleton/Skeleton.svelte +7 -2
  70. package/dist/components/Skeleton/Skeleton.svelte.d.ts +2 -1
  71. package/dist/components/Slider/Slider.svelte +4 -2
  72. package/dist/components/Slider/Slider.svelte.d.ts +2 -1
  73. package/dist/components/Spinner/Spinner.svelte +4 -1
  74. package/dist/components/Spinner/Spinner.svelte.d.ts +2 -1
  75. package/dist/components/Splitter/Splitter.svelte +4 -1
  76. package/dist/components/Splitter/Splitter.svelte.d.ts +2 -1
  77. package/dist/components/Stat/Stat.svelte +4 -2
  78. package/dist/components/Stat/Stat.svelte.d.ts +2 -1
  79. package/dist/components/Stepper/Stepper.svelte +4 -1
  80. package/dist/components/Stepper/Stepper.svelte.d.ts +2 -1
  81. package/dist/components/ThemeSelector.svelte +10 -2
  82. package/dist/components/ThemeSelector.svelte.d.ts +2 -1
  83. package/dist/components/ThemeToggle.svelte +10 -1
  84. package/dist/components/ThemeToggle.svelte.d.ts +2 -1
  85. package/dist/components/TimeRangeInput.svelte +5 -1
  86. package/dist/components/TimeRangeInput.svelte.d.ts +3 -1
  87. package/dist/components/Timeline/Timeline.svelte +4 -2
  88. package/dist/components/Timeline/Timeline.svelte.d.ts +2 -1
  89. package/dist/components/TokenInput/TokenInput.svelte +6 -1
  90. package/dist/components/TokenInput/TokenInput.svelte.d.ts +2 -1
  91. package/dist/components/Tree/Tree.svelte +11 -2
  92. package/dist/components/Tree/Tree.svelte.d.ts +2 -1
  93. package/dist/components/field-chrome.d.ts +22 -0
  94. package/dist/components/field-chrome.js +1 -0
  95. package/docs/components.md +27 -1
  96. package/package.json +1 -1
@@ -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;
@@ -6,8 +6,9 @@
6
6
  import type { Size } from "../types/sizes.js";
7
7
  import type { Responsive } from "../types/responsive.js";
8
8
  import type { Variant } from "../types/variants.js";
9
+ import type { FieldChromeProps } from "./field-chrome.js";
9
10
 
10
- interface Props extends Omit<HTMLInputAttributes, "type" | "size"> {
11
+ interface Props extends Omit<HTMLInputAttributes, "type" | "size">, FieldChromeProps {
11
12
  value: string;
12
13
  class?: string;
13
14
  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
- interface Props extends Omit<HTMLInputAttributes, "type" | "size"> {
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;
@@ -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
- } = $props();
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
- } = $props();
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;
@@ -6,8 +6,9 @@
6
6
  import type { Size } from "../types/sizes.js";
7
7
  import type { Responsive } from "../types/responsive.js";
8
8
  import type { Variant } from "../types/variants.js";
9
+ import type { FieldChromeProps } from "./field-chrome.js";
9
10
 
10
- interface Props extends Omit<HTMLInputAttributes, "type" | "size"> {
11
+ interface Props extends Omit<HTMLInputAttributes, "type" | "size">, FieldChromeProps {
11
12
  value: string;
12
13
  class?: string;
13
14
  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
- interface Props extends Omit<HTMLInputAttributes, "type" | "size"> {
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;
@@ -1,5 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from "svelte";
3
+ import type { HTMLInputAttributes } from "svelte/elements";
4
+ import type { FieldChromeProps } from "./field-chrome.js";
3
5
  import ChevronDown from "~icons/mdi/chevron-down";
4
6
  import Input from "./Input.svelte";
5
7
  import List from "./List.svelte";
@@ -77,7 +79,7 @@
77
79
  borderless?: boolean;
78
80
  /** When set, render a hidden <input name> carrying the value so the Select submits in a form. */
79
81
  name?: string;
80
- } & Record<string, any> = $props();
82
+ } & Omit<HTMLInputAttributes, "type" | "value" | "size" | "class"> & FieldChromeProps = $props();
81
83
 
82
84
  let isOpen = $state(false);
83
85
  let containerElement = $state<HTMLElement>();
@@ -1,4 +1,6 @@
1
1
  import type { Snippet } from "svelte";
2
+ import type { HTMLInputAttributes } from "svelte/elements";
3
+ import type { FieldChromeProps } from "./field-chrome.js";
2
4
  import type { Size } from "../types/sizes.js";
3
5
  import type { Responsive } from "../types/responsive.js";
4
6
  import type { Variant } from "../types/variants.js";
@@ -39,7 +41,7 @@ type $$ComponentProps = {
39
41
  borderless?: boolean;
40
42
  /** When set, render a hidden <input name> carrying the value so the Select submits in a form. */
41
43
  name?: string;
42
- } & Record<string, any>;
44
+ } & Omit<HTMLInputAttributes, "type" | "value" | "size" | "class"> & FieldChromeProps;
43
45
  declare const Select: import("svelte").Component<$$ComponentProps, {}, "value" | "searchTerm" | "methods">;
44
46
  type Select = ReturnType<typeof Select>;
45
47
  export default Select;
@@ -128,6 +128,7 @@
128
128
  import IconChevronRight from "~icons/mdi/chevron-right";
129
129
  import IconChevronUp from "~icons/mdi/chevron-up";
130
130
  import IconChevronDown from "~icons/mdi/chevron-down";
131
+ import type { HTMLAttributes } from "svelte/elements";
131
132
  import type { Placement } from "../../positioning/anchored.js";
132
133
  import type { Size } from "../../types/sizes.js";
133
134
  import { variantToken, type Variant } from "../../types/variants.js";
@@ -156,6 +157,7 @@
156
157
  activeMode = $bindable(),
157
158
  publishWidthVar,
158
159
  class: additionalClass = "",
160
+ ...rest
159
161
  }: {
160
162
  items?: SideBarMenuItem[];
161
163
  bottomItems?: SideBarMenuItem[];
@@ -244,7 +246,10 @@
244
246
  * when you run more than one). Unset → nothing published. */
245
247
  publishWidthVar?: boolean | string;
246
248
  class?: string;
247
- } = $props();
249
+ // Leftover HTML attributes are forwarded onto the strip's root `<aside>` (the primary content
250
+ // container; the outer wrapper is `display:contents` in every non-hover-expand mode). `style` is
251
+ // omitted — the aside computes its own (`--sbm-accent`), as does the wrapper (spacer width).
252
+ } & Omit<HTMLAttributes<HTMLElement>, "class" | "style"> = $props();
248
253
 
249
254
  // Per-instance, hydration-stable id prefix so popout DOM ids are unique when more than one
250
255
  // SideBarMenu renders on a page (otherwise `sbm-popout-top-1` collides, breaking `aria-controls`
@@ -1174,6 +1179,7 @@
1174
1179
  style="{hoverExpandActive ? `width: ${collapsedW}px;` : ''}"
1175
1180
  >
1176
1181
  <aside
1182
+ {...rest}
1177
1183
  bind:this={asideRef}
1178
1184
  bind:clientHeight={asideH}
1179
1185
  data-sbm-aside={uid}
@@ -94,6 +94,7 @@ export type SideBarMenuItem = {
94
94
  * the default `currentPath` segment-boundary match against `link`. */
95
95
  activeMatch?: SideBarMenuActiveRule;
96
96
  };
97
+ import type { HTMLAttributes } from "svelte/elements";
97
98
  import type { Size } from "../../types/sizes.js";
98
99
  import { type Variant } from "../../types/variants.js";
99
100
  import { type Breakpoint } from "../../types/breakpoints.js";
@@ -186,7 +187,7 @@ type $$ComponentProps = {
186
187
  * when you run more than one). Unset → nothing published. */
187
188
  publishWidthVar?: boolean | string;
188
189
  class?: string;
189
- };
190
+ } & Omit<HTMLAttributes<HTMLElement>, "class" | "style">;
190
191
  declare const SideBarMenu: import("svelte").Component<$$ComponentProps, {}, "open" | "stepLevel" | "api" | "activeMode">;
191
192
  type SideBarMenu = ReturnType<typeof SideBarMenu>;
192
193
  export default SideBarMenu;
@@ -6,6 +6,8 @@
6
6
  */
7
7
  -->
8
8
  <script lang="ts">
9
+ import type { HTMLAttributes } from "svelte/elements";
10
+
9
11
  let {
10
12
  shape = "text",
11
13
  width,
@@ -14,6 +16,7 @@
14
16
  radius,
15
17
  animate = true,
16
18
  class: cls = "",
19
+ ...rest
17
20
  }: {
18
21
  shape?: "text" | "rect" | "circle";
19
22
  width?: string | number;
@@ -22,7 +25,8 @@
22
25
  radius?: string;
23
26
  animate?: boolean;
24
27
  class?: string;
25
- } = $props();
28
+ // `style` omitted — dimensions come from `width`/`height`/`radius`, applied as the element's style.
29
+ } & Omit<HTMLAttributes<HTMLElement>, "class" | "style"> = $props();
26
30
 
27
31
  const css = (v: string | number | undefined): string | undefined =>
28
32
  typeof v === "number" ? `${v}px` : v;
@@ -39,7 +43,7 @@
39
43
  </script>
40
44
 
41
45
  {#if shape === "text" && lines > 1}
42
- <div class="flex flex-col gap-2 {cls}" aria-hidden="true">
46
+ <div class="flex flex-col gap-2 {cls}" aria-hidden="true" {...rest}>
43
47
  {#each Array(lines) as _, i (i)}
44
48
  <span
45
49
  class={blockClass}
@@ -52,6 +56,7 @@
52
56
  class="{blockClass} {cls}"
53
57
  style="width: {w}; height: {h}; border-radius: {rad};"
54
58
  aria-hidden="true"
59
+ {...rest}
55
60
  ></span>
56
61
  {/if}
57
62
 
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
1
2
  type $$ComponentProps = {
2
3
  shape?: "text" | "rect" | "circle";
3
4
  width?: string | number;
@@ -6,7 +7,7 @@ type $$ComponentProps = {
6
7
  radius?: string;
7
8
  animate?: boolean;
8
9
  class?: string;
9
- };
10
+ } & Omit<HTMLAttributes<HTMLElement>, "class" | "style">;
10
11
  declare const Skeleton: import("svelte").Component<$$ComponentProps, {}, "">;
11
12
  type Skeleton = ReturnType<typeof Skeleton>;
12
13
  export default Skeleton;
@@ -12,6 +12,7 @@
12
12
  import { variantToken } from "../../types/variants.js";
13
13
  import type { Size } from "../../types/sizes.js";
14
14
  import { responsiveClasses, type Responsive } from "../../types/responsive.js";
15
+ import type { HTMLAttributes } from "svelte/elements";
15
16
 
16
17
  let {
17
18
  value = $bindable(0),
@@ -31,6 +32,7 @@
31
32
  required = false,
32
33
  id,
33
34
  class: cls = "",
35
+ ...rest
34
36
  }: {
35
37
  value?: number | [number, number];
36
38
  min?: number;
@@ -49,7 +51,7 @@
49
51
  required?: boolean;
50
52
  id?: string;
51
53
  class?: string;
52
- } = $props();
54
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class" | "id"> = $props();
53
55
 
54
56
  const controlId = id ?? nextFieldId();
55
57
  const isRange = $derived(range || Array.isArray(value));
@@ -166,7 +168,7 @@
166
168
 
167
169
  <FieldChrome {label} {aside} {error} {description} {required} {controlId} {size} class={cls}>
168
170
  {#snippet control({ describedBy })}
169
- <div class="flex items-center gap-3 select-none">
171
+ <div {...rest} class="flex items-center gap-3 select-none">
170
172
  <!-- The track is the click-to-position surface; the thumbs below carry role="slider". -->
171
173
  <!-- svelte-ignore a11y_no_static_element_interactions -->
172
174
  <!-- Disabled keeps pointer events (so the not-allowed cursor shows) but every handler no-ops on
@@ -2,6 +2,7 @@ import type { Snippet } from "svelte";
2
2
  import type { Variant } from "../../types/variants.js";
3
3
  import type { Size } from "../../types/sizes.js";
4
4
  import { type Responsive } from "../../types/responsive.js";
5
+ import type { HTMLAttributes } from "svelte/elements";
5
6
  type $$ComponentProps = {
6
7
  value?: number | [number, number];
7
8
  min?: number;
@@ -20,7 +21,7 @@ type $$ComponentProps = {
20
21
  required?: boolean;
21
22
  id?: string;
22
23
  class?: string;
23
- };
24
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class" | "id">;
24
25
  declare const Slider: import("svelte").Component<$$ComponentProps, {}, "value">;
25
26
  type Slider = ReturnType<typeof Slider>;
26
27
  export default Slider;
@@ -8,6 +8,7 @@
8
8
  */
9
9
  -->
10
10
  <script lang="ts">
11
+ import type { HTMLAttributes } from "svelte/elements";
11
12
  import type { Variant } from "../../types/variants.js";
12
13
  import { variantToken } from "../../types/variants.js";
13
14
  import type { Size } from "../../types/sizes.js";
@@ -18,6 +19,7 @@
18
19
  size = "md",
19
20
  label = "Loading",
20
21
  class: cls = "",
22
+ ...rest
21
23
  }: {
22
24
  /** Colour accent. Omit to inherit `currentColor` (e.g. inside a filled Button). */
23
25
  variant?: Variant;
@@ -25,7 +27,7 @@
25
27
  /** Accessible label (visually hidden). */
26
28
  label?: string;
27
29
  class?: string;
28
- } = $props();
30
+ } & Omit<HTMLAttributes<HTMLSpanElement>, "class" | "style"> = $props();
29
31
 
30
32
  // 16 / 20 / 24px rings on the shared size axis.
31
33
  const sizeClass: Record<Size, string> = {
@@ -46,6 +48,7 @@
46
48
  <span
47
49
  role="status"
48
50
  aria-live="polite"
51
+ {...rest}
49
52
  class="inline-block shrink-0 animate-spin rounded-full border-solid align-[-0.125em] {responsiveClasses(
50
53
  size,
51
54
  sizeClass,
@@ -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";
@@ -8,7 +9,7 @@ type $$ComponentProps = {
8
9
  /** Accessible label (visually hidden). */
9
10
  label?: string;
10
11
  class?: string;
11
- };
12
+ } & Omit<HTMLAttributes<HTMLSpanElement>, "class" | "style">;
12
13
  declare const Spinner: import("svelte").Component<$$ComponentProps, {}, "">;
13
14
  type Spinner = ReturnType<typeof Spinner>;
14
15
  export default Spinner;
@@ -9,6 +9,7 @@
9
9
  import type { Snippet } from "svelte";
10
10
  import type { Variant } from "../../types/variants.js";
11
11
  import { variantToken } from "../../types/variants.js";
12
+ import type { HTMLAttributes } from "svelte/elements";
12
13
 
13
14
  let {
14
15
  start,
@@ -21,6 +22,7 @@
21
22
  variant = "primary",
22
23
  disabled = false,
23
24
  class: cls = "",
25
+ ...rest
24
26
  }: {
25
27
  start: Snippet;
26
28
  end: Snippet;
@@ -33,7 +35,7 @@
33
35
  variant?: Variant;
34
36
  disabled?: boolean;
35
37
  class?: string;
36
- } = $props();
38
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style"> = $props();
37
39
 
38
40
  const isH = $derived(orientation === "horizontal");
39
41
  const token = $derived(variantToken[variant]);
@@ -82,6 +84,7 @@
82
84
  </script>
83
85
 
84
86
  <div
87
+ {...rest}
85
88
  bind:this={containerEl}
86
89
  class="flex {isH ? 'flex-row' : 'flex-col'} {cls}"
87
90
  style={dragging ? "user-select: none;" : ""}
@@ -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
  type $$ComponentProps = {
4
5
  start: Snippet;
5
6
  end: Snippet;
@@ -12,7 +13,7 @@ type $$ComponentProps = {
12
13
  variant?: Variant;
13
14
  disabled?: boolean;
14
15
  class?: string;
15
- };
16
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class" | "style">;
16
17
  declare const Splitter: import("svelte").Component<$$ComponentProps, {}, "size">;
17
18
  type Splitter = ReturnType<typeof Splitter>;
18
19
  export default Splitter;
@@ -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 Card from "../Card.svelte";
10
11
  import IconUp from "~icons/mdi/trending-up";
11
12
  import IconDown from "~icons/mdi/trending-down";
@@ -24,6 +25,7 @@
24
25
  variant = "neutral",
25
26
  size = "md",
26
27
  class: cls = "",
28
+ ...rest
27
29
  }: {
28
30
  label: string;
29
31
  value: string | number;
@@ -37,7 +39,7 @@
37
39
  variant?: Variant;
38
40
  size?: Responsive<Size>;
39
41
  class?: string;
40
- } = $props();
42
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class"> = $props();
41
43
 
42
44
  const token = $derived(variantToken[variant]);
43
45
  const deltaNum = $derived(typeof delta === "number" ? delta : null);
@@ -60,7 +62,7 @@
60
62
  };
61
63
  </script>
62
64
 
63
- <Card class="p-4 {cls}">
65
+ <Card class="p-4 {cls}" {...rest}>
64
66
  <div class="flex items-start justify-between gap-3">
65
67
  <div class="min-w-0">
66
68
  <div class="truncate text-sm [color:color-mix(in_srgb,var(--ui-color-text)_60%,transparent)]">
@@ -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";
@@ -15,7 +16,7 @@ type $$ComponentProps = {
15
16
  variant?: Variant;
16
17
  size?: Responsive<Size>;
17
18
  class?: string;
18
- };
19
+ } & Omit<HTMLAttributes<HTMLDivElement>, "class">;
19
20
  declare const Stat: import("svelte").Component<$$ComponentProps, {}, "">;
20
21
  type Stat = ReturnType<typeof Stat>;
21
22
  export default Stat;