@spaethtech/svelte-ui 0.20.1-dev.105.894ecae → 0.20.1-dev.99.8654270

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 +6 -15
  2. package/dist/components/Alert.svelte.d.ts +1 -4
  3. package/dist/components/Avatar/Avatar.svelte +2 -4
  4. package/dist/components/Avatar/Avatar.svelte.d.ts +1 -2
  5. package/dist/components/Avatar/AvatarGroup.svelte +1 -4
  6. package/dist/components/Avatar/AvatarGroup.svelte.d.ts +1 -2
  7. package/dist/components/Badge/Badge.svelte +2 -9
  8. package/dist/components/Badge/Badge.svelte.d.ts +1 -2
  9. package/dist/components/Banner.svelte +1 -4
  10. package/dist/components/Banner.svelte.d.ts +1 -2
  11. package/dist/components/Breadcrumbs/Breadcrumbs.svelte +2 -4
  12. package/dist/components/Breadcrumbs/Breadcrumbs.svelte.d.ts +1 -2
  13. package/dist/components/CardFooter.svelte +1 -12
  14. package/dist/components/CardFooter.svelte.d.ts +0 -3
  15. package/dist/components/Carousel/Carousel.svelte +1 -4
  16. package/dist/components/Carousel/Carousel.svelte.d.ts +1 -2
  17. package/dist/components/Chip/Chip.svelte +1 -4
  18. package/dist/components/Chip/Chip.svelte.d.ts +1 -2
  19. package/dist/components/Combobox/Combobox.svelte +1 -4
  20. package/dist/components/Combobox/Combobox.svelte.d.ts +1 -2
  21. package/dist/components/CommandPalette/CommandPalette.svelte +2 -4
  22. package/dist/components/CommandPalette/CommandPalette.svelte.d.ts +1 -2
  23. package/dist/components/ConfirmDialog.svelte +1 -4
  24. package/dist/components/ConfirmDialog.svelte.d.ts +1 -2
  25. package/dist/components/ContextMenu/ContextMenu.svelte +2 -4
  26. package/dist/components/ContextMenu/ContextMenu.svelte.d.ts +1 -2
  27. package/dist/components/DataTable.svelte +1 -4
  28. package/dist/components/DataTable.svelte.d.ts +1 -2
  29. package/dist/components/DatePicker.svelte +2 -4
  30. package/dist/components/DatePicker.svelte.d.ts +1 -2
  31. package/dist/components/Divider/Divider.svelte +3 -6
  32. package/dist/components/Divider/Divider.svelte.d.ts +1 -2
  33. package/dist/components/Drawer/Drawer.svelte +1 -4
  34. package/dist/components/Drawer/Drawer.svelte.d.ts +1 -2
  35. package/dist/components/EmailInput.svelte +1 -2
  36. package/dist/components/EmailInput.svelte.d.ts +1 -2
  37. package/dist/components/EmptyState/EmptyState.svelte +2 -4
  38. package/dist/components/EmptyState/EmptyState.svelte.d.ts +1 -2
  39. package/dist/components/FileUpload/FileUpload.svelte +2 -4
  40. package/dist/components/FileUpload/FileUpload.svelte.d.ts +1 -2
  41. package/dist/components/Grid.svelte +2 -4
  42. package/dist/components/Grid.svelte.d.ts +1 -2
  43. package/dist/components/Kbd/Kbd.svelte +3 -5
  44. package/dist/components/Kbd/Kbd.svelte.d.ts +1 -2
  45. package/dist/components/List.svelte +2 -4
  46. package/dist/components/List.svelte.d.ts +1 -2
  47. package/dist/components/Menu.svelte +1 -4
  48. package/dist/components/Menu.svelte.d.ts +1 -2
  49. package/dist/components/NumberInput.svelte +1 -2
  50. package/dist/components/NumberInput.svelte.d.ts +1 -2
  51. package/dist/components/Pagination/Pagination.svelte +1 -4
  52. package/dist/components/Pagination/Pagination.svelte.d.ts +1 -2
  53. package/dist/components/PasswordInput.svelte +1 -2
  54. package/dist/components/PasswordInput.svelte.d.ts +1 -2
  55. package/dist/components/Popup.svelte +1 -8
  56. package/dist/components/Popup.svelte.d.ts +1 -2
  57. package/dist/components/Progress/Progress.svelte +2 -4
  58. package/dist/components/Progress/Progress.svelte.d.ts +1 -2
  59. package/dist/components/Query.svelte +2 -4
  60. package/dist/components/Query.svelte.d.ts +1 -2
  61. package/dist/components/ScrollArea/ScrollArea.svelte +2 -5
  62. package/dist/components/ScrollArea/ScrollArea.svelte.d.ts +1 -2
  63. package/dist/components/SearchInput.svelte +1 -2
  64. package/dist/components/SearchInput.svelte.d.ts +1 -2
  65. package/dist/components/Select.svelte +1 -3
  66. package/dist/components/Select.svelte.d.ts +1 -3
  67. package/dist/components/SideBarMenu/SideBarMenu.svelte +1 -7
  68. package/dist/components/SideBarMenu/SideBarMenu.svelte.d.ts +1 -2
  69. package/dist/components/Skeleton/Skeleton.svelte +2 -7
  70. package/dist/components/Skeleton/Skeleton.svelte.d.ts +1 -2
  71. package/dist/components/Slider/Slider.svelte +2 -4
  72. package/dist/components/Slider/Slider.svelte.d.ts +1 -2
  73. package/dist/components/Spinner/Spinner.svelte +1 -4
  74. package/dist/components/Spinner/Spinner.svelte.d.ts +1 -2
  75. package/dist/components/Splitter/Splitter.svelte +1 -4
  76. package/dist/components/Splitter/Splitter.svelte.d.ts +1 -2
  77. package/dist/components/Stat/Stat.svelte +2 -4
  78. package/dist/components/Stat/Stat.svelte.d.ts +1 -2
  79. package/dist/components/Stepper/Stepper.svelte +1 -4
  80. package/dist/components/Stepper/Stepper.svelte.d.ts +1 -2
  81. package/dist/components/ThemeSelector.svelte +2 -10
  82. package/dist/components/ThemeSelector.svelte.d.ts +1 -2
  83. package/dist/components/ThemeToggle.svelte +1 -10
  84. package/dist/components/ThemeToggle.svelte.d.ts +1 -2
  85. package/dist/components/TimeRangeInput.svelte +1 -5
  86. package/dist/components/TimeRangeInput.svelte.d.ts +1 -3
  87. package/dist/components/Timeline/Timeline.svelte +2 -4
  88. package/dist/components/Timeline/Timeline.svelte.d.ts +1 -2
  89. package/dist/components/TokenInput/TokenInput.svelte +1 -6
  90. package/dist/components/TokenInput/TokenInput.svelte.d.ts +1 -2
  91. package/dist/components/Tree/Tree.svelte +2 -11
  92. package/dist/components/Tree/Tree.svelte.d.ts +1 -2
  93. package/docs/components.md +1 -17
  94. package/package.json +1 -1
  95. package/dist/components/field-chrome.d.ts +0 -22
  96. package/dist/components/field-chrome.js +0 -1
@@ -1,11 +1,10 @@
1
1
  import type { Size } from "../types/sizes.js";
2
2
  import { type Responsive } from "../types/responsive.js";
3
3
  import type { Variant } from "../types/variants.js";
4
- import type { HTMLAttributes } from "svelte/elements";
5
4
  type $$ComponentProps = {
6
5
  size?: Responsive<Size>;
7
6
  variant?: Variant;
8
- } & Omit<HTMLAttributes<HTMLDivElement>, "class">;
7
+ };
9
8
  declare const ThemeSelector: import("svelte").Component<$$ComponentProps, {}, "">;
10
9
  type ThemeSelector = ReturnType<typeof ThemeSelector>;
11
10
  export default ThemeSelector;
@@ -9,18 +9,12 @@
9
9
  import type { Size } from "../types/sizes.js";
10
10
  import type { Variant } from "../types/variants.js";
11
11
  import type { Responsive } from "../types/responsive.js";
12
- import type { HTMLButtonAttributes } from "svelte/elements";
13
12
  import { applyTheme, readStoredTheme, resolveTheme, type ThemeValue } from "./theme.js";
14
13
  import IconSun from "~icons/mdi/weather-sunny";
15
14
  import IconMoon from "~icons/mdi/weather-night";
16
15
 
17
16
  // Shared axes, forwarded to the underlying Button. Icon-only, so it defaults to the chromeless ghost.
18
- let {
19
- size = "md",
20
- variant = "ghost",
21
- ...rest
22
- }: { size?: Responsive<Size>; variant?: Variant } & Omit<HTMLButtonAttributes, "class"> =
23
- $props();
17
+ let { size = "md", variant = "ghost" }: { size?: Responsive<Size>; variant?: Variant } = $props();
24
18
 
25
19
  // The stored value ("auto" until the user picks) and the tracked system preference.
26
20
  let theme = $state<ThemeValue>("auto");
@@ -50,10 +44,7 @@
50
44
  }
51
45
  </script>
52
46
 
53
- <!-- rest is fully typed on this component's own Props (below); the cast only sidesteps a TS
54
- "union too complex" limit when spreading a wide attrs type into Button's ButtonProps|AnchorProps. -->
55
47
  <Button
56
- {...rest as Record<string, unknown>}
57
48
  {size}
58
49
  {variant}
59
50
  onclick={toggle}
@@ -1,11 +1,10 @@
1
1
  import type { Size } from "../types/sizes.js";
2
2
  import type { Variant } from "../types/variants.js";
3
3
  import type { Responsive } from "../types/responsive.js";
4
- import type { HTMLButtonAttributes } from "svelte/elements";
5
4
  type $$ComponentProps = {
6
5
  size?: Responsive<Size>;
7
6
  variant?: Variant;
8
- } & Omit<HTMLButtonAttributes, "class">;
7
+ };
9
8
  declare const ThemeToggle: import("svelte").Component<$$ComponentProps, {}, "">;
10
9
  type ThemeToggle = ReturnType<typeof ThemeToggle>;
11
10
  export default ThemeToggle;
@@ -11,8 +11,6 @@
11
11
  <script lang="ts">
12
12
  import { uiI18n } from "../i18n.js";
13
13
  const i18n = uiI18n();
14
- import type { HTMLInputAttributes } from "svelte/elements";
15
- import type { FieldChromeProps } from "./field-chrome.js";
16
14
  import type { Size } from "../types/sizes.js";
17
15
  import { responsiveClasses, type Responsive } from "../types/responsive.js";
18
16
  import { resolveStep, type StepSpec } from "../types/time.js";
@@ -23,9 +21,7 @@
23
21
  import IconClock from "~icons/mdi/clock-outline";
24
22
 
25
23
  type RangeValue = { start: string | null; end: string | null };
26
- interface Props
27
- extends Omit<HTMLInputAttributes, "type" | "value" | "size" | "step" | "class">,
28
- FieldChromeProps {
24
+ interface Props {
29
25
  /** `{ start, end }` with 24h `HH:MM` (or `HH:MM:SS` when `seconds`), or null. Bindable. */
30
26
  value?: RangeValue | null;
31
27
  /** Column interval: a number = minute step, or `{ hour, minute, second }`. Default 1 (minute). */
@@ -1,5 +1,3 @@
1
- import type { HTMLInputAttributes } from "svelte/elements";
2
- import type { FieldChromeProps } from "./field-chrome.js";
3
1
  import type { Size } from "../types/sizes.js";
4
2
  import { type Responsive } from "../types/responsive.js";
5
3
  import { type StepSpec } from "../types/time.js";
@@ -8,7 +6,7 @@ type RangeValue = {
8
6
  start: string | null;
9
7
  end: string | null;
10
8
  };
11
- interface Props extends Omit<HTMLInputAttributes, "type" | "value" | "size" | "step" | "class">, FieldChromeProps {
9
+ interface Props {
12
10
  /** `{ start, end }` with 24h `HH:MM` (or `HH:MM:SS` when `seconds`), or null. Bindable. */
13
11
  value?: RangeValue | null;
14
12
  /** Column interval: a number = minute step, or `{ hour, minute, second }`. Default 1 (minute). */
@@ -19,7 +19,6 @@
19
19
  </script>
20
20
 
21
21
  <script lang="ts">
22
- import type { HTMLAttributes } from "svelte/elements";
23
22
  import { variantToken } from "../../types/variants.js";
24
23
  import type { Size } from "../../types/sizes.js";
25
24
  import { responsiveClasses, type Responsive } from "../../types/responsive.js";
@@ -29,13 +28,12 @@
29
28
  variant = "primary",
30
29
  size = "md",
31
30
  class: cls = "",
32
- ...rest
33
31
  }: {
34
32
  items: TimelineItem[];
35
33
  variant?: Variant;
36
34
  size?: Responsive<Size>;
37
35
  class?: string;
38
- } & Omit<HTMLAttributes<HTMLOListElement>, "class"> = $props();
36
+ } = $props();
39
37
 
40
38
  const dotSize: Record<Size, string> = { sm: "w-2.5 h-2.5", md: "w-3 h-3", lg: "w-3.5 h-3.5" };
41
39
  const iconBox: Record<Size, string> = {
@@ -47,7 +45,7 @@
47
45
  const tokenFor = (item: TimelineItem) => variantToken[item.variant ?? variant];
48
46
  </script>
49
47
 
50
- <ol class="flex flex-col {cls}" {...rest}>
48
+ <ol class="flex flex-col {cls}">
51
49
  {#each items as item, i (i)}
52
50
  {@const last = i === items.length - 1}
53
51
  <li class="flex gap-3">
@@ -8,7 +8,6 @@ export type TimelineItem = {
8
8
  variant?: Variant;
9
9
  content?: Snippet;
10
10
  };
11
- import type { HTMLAttributes } from "svelte/elements";
12
11
  import type { Size } from "../../types/sizes.js";
13
12
  import { type Responsive } from "../../types/responsive.js";
14
13
  type $$ComponentProps = {
@@ -16,7 +15,7 @@ type $$ComponentProps = {
16
15
  variant?: Variant;
17
16
  size?: Responsive<Size>;
18
17
  class?: string;
19
- } & Omit<HTMLAttributes<HTMLOListElement>, "class">;
18
+ };
20
19
  declare const Timeline: import("svelte").Component<$$ComponentProps, {}, "">;
21
20
  type Timeline = ReturnType<typeof Timeline>;
22
21
  export default Timeline;
@@ -8,7 +8,6 @@
8
8
  -->
9
9
  <script lang="ts">
10
10
  import type { Snippet } from "svelte";
11
- import type { HTMLAttributes } from "svelte/elements";
12
11
  import FieldChrome, { nextFieldId } from "../FieldChrome.svelte";
13
12
  import Chip from "../Chip/Chip.svelte";
14
13
  import type { Variant } from "../../types/variants.js";
@@ -31,7 +30,6 @@
31
30
  id,
32
31
  required = false,
33
32
  class: cls = "",
34
- ...rest
35
33
  }: {
36
34
  values?: string[];
37
35
  allowDuplicates?: boolean;
@@ -47,9 +45,7 @@
47
45
  id?: string;
48
46
  required?: boolean;
49
47
  class?: string;
50
- // Forwarded onto the field frame (`<label class="tok-field">`). `style` omitted — that frame
51
- // computes its own (`--tok-border` vars). `class` goes to FieldChrome's chrome stack (existing).
52
- } & Omit<HTMLAttributes<HTMLLabelElement>, "class" | "style"> = $props();
48
+ } = $props();
53
49
 
54
50
  const controlId = id ?? nextFieldId();
55
51
  const token = $derived(variantToken[variant]);
@@ -112,7 +108,6 @@
112
108
  {#snippet control({ describedBy })}
113
109
  <!-- A <label> so clicking anywhere in the field focuses the input natively (no JS handler). -->
114
110
  <label
115
- {...rest}
116
111
  for={controlId}
117
112
  class="tok-field flex flex-wrap items-center rounded-[var(--ui-border-radius)] border transition-colors {responsiveClasses(
118
113
  size,
@@ -1,5 +1,4 @@
1
1
  import type { Snippet } from "svelte";
2
- import type { HTMLAttributes } from "svelte/elements";
3
2
  import type { Variant } from "../../types/variants.js";
4
3
  import type { Size } from "../../types/sizes.js";
5
4
  import { type Responsive } from "../../types/responsive.js";
@@ -18,7 +17,7 @@ type $$ComponentProps = {
18
17
  id?: string;
19
18
  required?: boolean;
20
19
  class?: string;
21
- } & Omit<HTMLAttributes<HTMLLabelElement>, "class" | "style">;
20
+ };
22
21
  declare const TokenInput: import("svelte").Component<$$ComponentProps, {}, "values">;
23
22
  type TokenInput = ReturnType<typeof TokenInput>;
24
23
  export default TokenInput;
@@ -19,7 +19,6 @@
19
19
 
20
20
  <script lang="ts">
21
21
  import IconChevronRight from "~icons/mdi/chevron-right";
22
- import type { HTMLAttributes } from "svelte/elements";
23
22
  import type { Variant } from "../../types/variants.js";
24
23
  import { variantToken } from "../../types/variants.js";
25
24
  import type { Size } from "../../types/sizes.js";
@@ -33,7 +32,6 @@
33
32
  variant = "primary",
34
33
  size = "md",
35
34
  class: cls = "",
36
- ...rest
37
35
  }: {
38
36
  items: TreeNode[];
39
37
  /** Keys of expanded nodes (bindable). */
@@ -44,9 +42,7 @@
44
42
  variant?: Variant;
45
43
  size?: Responsive<Size>;
46
44
  class?: string;
47
- // `style` omitted — rows compute their own inline style (indent + active tint). `onselect` omitted
48
- // too: it collides with the DOM `onselect` in HTMLAttributes but has this component's own signature.
49
- } & Omit<HTMLAttributes<HTMLElement>, "class" | "style" | "onselect"> = $props();
45
+ } = $props();
50
46
 
51
47
  const token = $derived(variantToken[variant]);
52
48
  const rowH: Record<Size, string> = { sm: "h-7 text-xs", md: "h-8 text-sm", lg: "h-10 text-base" };
@@ -141,12 +137,7 @@
141
137
  </script>
142
138
 
143
139
  <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
144
- <ul
145
- {...rest}
146
- role="tree"
147
- class="flex flex-col {responsiveClasses(size, iconCls)} {cls}"
148
- onkeydown={onKeydown}
149
- >
140
+ <ul role="tree" class="flex flex-col {responsiveClasses(size, iconCls)} {cls}" onkeydown={onKeydown}>
150
141
  {#each flat as f (f.key)}
151
142
  {@const active = selected === f.key}
152
143
  <li role="none" class="list-none">
@@ -7,7 +7,6 @@ export type TreeNode = {
7
7
  children?: TreeNode[];
8
8
  disabled?: boolean;
9
9
  };
10
- import type { HTMLAttributes } from "svelte/elements";
11
10
  import type { Variant } from "../../types/variants.js";
12
11
  import type { Size } from "../../types/sizes.js";
13
12
  import { type Responsive } from "../../types/responsive.js";
@@ -21,7 +20,7 @@ type $$ComponentProps = {
21
20
  variant?: Variant;
22
21
  size?: Responsive<Size>;
23
22
  class?: string;
24
- } & Omit<HTMLAttributes<HTMLElement>, "class" | "style" | "onselect">;
23
+ };
25
24
  declare const Tree: import("svelte").Component<$$ComponentProps, {}, "selected" | "expanded">;
26
25
  type Tree = ReturnType<typeof Tree>;
27
26
  export default Tree;
@@ -17,18 +17,6 @@ Most sizeable/themeable components share two props (defined in `types/variants.t
17
17
  - **`size`** — `sm` (24px), `md` (32px, **default**), `lg` (40px). Tied to the theme's
18
18
  `--ui-height-sm` / `--ui-height` / `--ui-height-lg`.
19
19
 
20
- ## HTML attribute passthrough
21
-
22
- Components forward the standard HTML attributes you pass — **`class`** (merged onto the root, appended
23
- last so your classes win), **`data-*`** (e.g. a stable `data-testid` for e2e), **`aria-*`**, **`id`**,
24
- **`title`**, and event handlers — onto their root element, typed against the matching `HTML*Attributes`.
25
- So `<Badge data-testid="status" class="ml-2">` or `<Card onmouseenter={…}>` just work and type-check.
26
-
27
- Exceptions: components that compute their own root **`style`** (themed `color-mix`, dimensions, drag
28
- transforms — e.g. `Badge`, `Alert`, `Skeleton`, `DataTable`) do **not** accept a `style` override —
29
- use `class`. Field-shaped components (`Input`, the specialized inputs, `Slider`, `TokenInput`,
30
- `FileUpload`) route `class` to their outer field wrapper and land other attributes on the control.
31
-
32
20
  ## Field chrome (shared)
33
21
 
34
22
  Every field-shaped component — `Input`, `Select`, `TextArea`, `Checkbox`, `Toggle` (and the
@@ -602,11 +590,7 @@ Status indicator / label.
602
590
  - **Location**: `src/lib/components/Badge/Badge.svelte`
603
591
  - **Axes**: `size`
604
592
  - **Variants**: `default`, `primary`, `success`, `warning`, `danger`, `info`
605
- - **Props**: `text`, `variant`, `size`, `dismissible`, `rounded`, `href`, `children`; dispatches `dismiss`
606
- - **Attribute passthrough**: leftover HTML attributes — `class` (merged, appended last), `data-*`
607
- (e.g. a `data-testid` e2e hook), `aria-*`, `id`, `title`, event handlers — spread onto the chip's
608
- root element. **`style` is not** passed through (the chip computes its own themed `style`); use
609
- `class` for style overrides.
593
+ - **Props**: `text`, `variant`, `size`, `dismissible`, `rounded`, `children`; dispatches `dismiss`
610
594
 
611
595
  ### NotesEditor
612
596
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaethtech/svelte-ui",
3
- "version": "0.20.1-dev.105.894ecae",
3
+ "version": "0.20.1-dev.99.8654270",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/spaethtech/svelte-ui.git"
@@ -1,22 +0,0 @@
1
- import type { Snippet } from "svelte";
2
- /**
3
- * The shared **FieldChrome** vocabulary (`label` / `aside` / `error` / `description`) that `Input`,
4
- * `TextArea`, and the specialized inputs (`PasswordInput` / `EmailInput` / `NumberInput` /
5
- * `SearchInput`) all render through `FieldChrome`. See `FieldChrome.spec.md`.
6
- *
7
- * The specialized inputs forward `{...restProps}` into `<Input>` at runtime, so these props already
8
- * WORK on them — they just weren't TYPED (their `Props` derived from `HTMLInputAttributes` alone,
9
- * which has no `label`/`aside`/`error`/`description`). Extending this interface types them without any
10
- * runtime change. `required`/`id` are NOT here — they are genuine `HTMLInputAttributes` and come from
11
- * the base. Keep in sync with the chrome props declared on `Input`/`TextArea`.
12
- */
13
- export interface FieldChromeProps {
14
- /** Renders above the control; `null`/omitted → no label row. */
15
- label?: string | null;
16
- /** Right-aligned snippet in the label row. */
17
- aside?: Snippet;
18
- /** Inline error row (string → `{@html}`); also drives the shared error state (border + aria-invalid). */
19
- error?: string | Snippet | null;
20
- /** Muted help row below the control (string → `{@html}`). */
21
- description?: string | Snippet | null;
22
- }
@@ -1 +0,0 @@
1
- export {};