@dorsk/tsumikit 0.38.1 → 0.40.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 (145) hide show
  1. package/dist/autoresize.d.ts +2 -0
  2. package/dist/autoresize.js +15 -1
  3. package/dist/components/atoms/Artwork.svelte +19 -18
  4. package/dist/components/atoms/Artwork.svelte.d.ts +3 -2
  5. package/dist/components/atoms/Badge.svelte +60 -26
  6. package/dist/components/atoms/Badge.svelte.d.ts +14 -3
  7. package/dist/components/atoms/Button.svelte +30 -12
  8. package/dist/components/atoms/Button.svelte.d.ts +4 -2
  9. package/dist/components/atoms/Card.svelte +47 -30
  10. package/dist/components/atoms/Card.svelte.d.ts +12 -3
  11. package/dist/components/atoms/Checkbox.svelte +16 -2
  12. package/dist/components/atoms/Checkbox.svelte.d.ts +2 -0
  13. package/dist/components/atoms/Dot.svelte +17 -11
  14. package/dist/components/atoms/Dot.svelte.d.ts +5 -2
  15. package/dist/components/atoms/Gauge.svelte +19 -18
  16. package/dist/components/atoms/Gauge.svelte.d.ts +3 -2
  17. package/dist/components/atoms/Heading.svelte +20 -19
  18. package/dist/components/atoms/Heading.svelte.d.ts +3 -2
  19. package/dist/components/atoms/Icon.svelte +36 -13
  20. package/dist/components/atoms/Icon.svelte.d.ts +20 -2
  21. package/dist/components/atoms/Input.svelte +17 -3
  22. package/dist/components/atoms/Input.svelte.d.ts +2 -1
  23. package/dist/components/atoms/Kbd.svelte +25 -3
  24. package/dist/components/atoms/Kbd.svelte.d.ts +5 -1
  25. package/dist/components/atoms/Link.svelte +16 -12
  26. package/dist/components/atoms/Link.svelte.d.ts +6 -2
  27. package/dist/components/atoms/Progress.svelte +119 -4
  28. package/dist/components/atoms/Progress.svelte.d.ts +28 -2
  29. package/dist/components/atoms/Scrim.svelte +7 -2
  30. package/dist/components/atoms/Scrim.svelte.d.ts +2 -0
  31. package/dist/components/atoms/SegmentedProgress.svelte +14 -2
  32. package/dist/components/atoms/SegmentedProgress.svelte.d.ts +5 -2
  33. package/dist/components/atoms/Select.svelte +18 -6
  34. package/dist/components/atoms/Select.svelte.d.ts +3 -3
  35. package/dist/components/atoms/Skeleton.svelte +12 -11
  36. package/dist/components/atoms/Skeleton.svelte.d.ts +3 -2
  37. package/dist/components/atoms/Slider.svelte +45 -3
  38. package/dist/components/atoms/Slider.svelte.d.ts +7 -0
  39. package/dist/components/atoms/Spinner.svelte +2 -0
  40. package/dist/components/atoms/Spinner.svelte.d.ts +2 -0
  41. package/dist/components/atoms/Switch.svelte +70 -18
  42. package/dist/components/atoms/Switch.svelte.d.ts +5 -1
  43. package/dist/components/atoms/Text.svelte +39 -26
  44. package/dist/components/atoms/Text.svelte.d.ts +7 -3
  45. package/dist/components/atoms/Textarea.svelte +47 -10
  46. package/dist/components/atoms/Textarea.svelte.d.ts +10 -3
  47. package/dist/components/layouts/AppShell.svelte +7 -3
  48. package/dist/components/layouts/AppShell.svelte.d.ts +2 -0
  49. package/dist/components/layouts/AutoGrid.svelte +8 -0
  50. package/dist/components/layouts/AutoGrid.svelte.d.ts +2 -0
  51. package/dist/components/layouts/Cluster.svelte +62 -1
  52. package/dist/components/layouts/Cluster.svelte.d.ts +9 -0
  53. package/dist/components/layouts/NavItem.svelte +22 -1
  54. package/dist/components/layouts/NavItem.svelte.d.ts +5 -0
  55. package/dist/components/layouts/NavSection.svelte +4 -1
  56. package/dist/components/layouts/NavSection.svelte.d.ts +2 -0
  57. package/dist/components/layouts/ResizablePanel.svelte +14 -3
  58. package/dist/components/layouts/ResizablePanel.svelte.d.ts +5 -0
  59. package/dist/components/layouts/Stack.svelte +41 -0
  60. package/dist/components/layouts/Stack.svelte.d.ts +9 -0
  61. package/dist/components/layouts/Toolbar.svelte +122 -0
  62. package/dist/components/layouts/Toolbar.svelte.d.ts +22 -0
  63. package/dist/components/molecules/AttachmentList.svelte +59 -0
  64. package/dist/components/molecules/AttachmentList.svelte.d.ts +13 -0
  65. package/dist/components/molecules/Breadcrumb.svelte +6 -2
  66. package/dist/components/molecules/Breadcrumb.svelte.d.ts +2 -0
  67. package/dist/components/molecules/Callout.svelte +10 -4
  68. package/dist/components/molecules/Callout.svelte.d.ts +1 -1
  69. package/dist/components/molecules/CapBar.svelte +5 -1
  70. package/dist/components/molecules/ChatBubble.svelte +158 -0
  71. package/dist/components/molecules/ChatBubble.svelte.d.ts +26 -0
  72. package/dist/components/molecules/CodeBlock.svelte +36 -3
  73. package/dist/components/molecules/CodeBlock.svelte.d.ts +8 -0
  74. package/dist/components/molecules/Composer.svelte +195 -0
  75. package/dist/components/molecules/Composer.svelte.d.ts +27 -0
  76. package/dist/components/molecules/ConfirmModal.svelte +15 -5
  77. package/dist/components/molecules/ConfirmModal.svelte.d.ts +5 -1
  78. package/dist/components/molecules/Drawer.svelte +9 -6
  79. package/dist/components/molecules/Dropzone.svelte +9 -3
  80. package/dist/components/molecules/Dropzone.svelte.d.ts +2 -0
  81. package/dist/components/molecules/EmptyState.svelte +9 -5
  82. package/dist/components/molecules/EmptyState.svelte.d.ts +3 -1
  83. package/dist/components/molecules/Field.svelte +7 -1
  84. package/dist/components/molecules/Field.svelte.d.ts +2 -0
  85. package/dist/components/molecules/FileButton.svelte +2 -1
  86. package/dist/components/molecules/FileButton.svelte.d.ts +2 -1
  87. package/dist/components/molecules/FilterInput.svelte +13 -3
  88. package/dist/components/molecules/FilterInput.svelte.d.ts +4 -1
  89. package/dist/components/molecules/FontScalePicker.svelte +8 -1
  90. package/dist/components/molecules/IconButton.svelte +32 -7
  91. package/dist/components/molecules/IconButton.svelte.d.ts +9 -1
  92. package/dist/components/molecules/KeyValue.svelte +4 -1
  93. package/dist/components/molecules/KeyValue.svelte.d.ts +2 -1
  94. package/dist/components/molecules/Menu.svelte +50 -5
  95. package/dist/components/molecules/Menu.svelte.d.ts +10 -1
  96. package/dist/components/molecules/Meter.svelte +91 -0
  97. package/dist/components/molecules/Meter.svelte.d.ts +29 -0
  98. package/dist/components/molecules/Metric.svelte +134 -8
  99. package/dist/components/molecules/Metric.svelte.d.ts +20 -2
  100. package/dist/components/molecules/Modal.svelte +26 -12
  101. package/dist/components/molecules/Modal.svelte.d.ts +7 -1
  102. package/dist/components/molecules/Pagination.svelte +25 -1
  103. package/dist/components/molecules/Pagination.svelte.d.ts +9 -2
  104. package/dist/components/molecules/Popover.svelte +16 -5
  105. package/dist/components/molecules/Popover.svelte.d.ts +5 -0
  106. package/dist/components/molecules/Prose.svelte +140 -0
  107. package/dist/components/molecules/Prose.svelte.d.ts +13 -0
  108. package/dist/components/molecules/RadioGroup.svelte +42 -2
  109. package/dist/components/molecules/RadioGroup.svelte.d.ts +4 -1
  110. package/dist/components/molecules/SectionHeader.svelte +5 -2
  111. package/dist/components/molecules/SectionHeader.svelte.d.ts +1 -1
  112. package/dist/components/molecules/SegmentedControl.svelte +36 -1
  113. package/dist/components/molecules/SegmentedControl.svelte.d.ts +11 -1
  114. package/dist/components/molecules/SelectButton.svelte +64 -4
  115. package/dist/components/molecules/SelectButton.svelte.d.ts +18 -1
  116. package/dist/components/molecules/Tabs.svelte +21 -3
  117. package/dist/components/molecules/Tabs.svelte.d.ts +6 -0
  118. package/dist/components/molecules/Timestamp.svelte +13 -6
  119. package/dist/components/molecules/Timestamp.svelte.d.ts +4 -0
  120. package/dist/components/molecules/Toaster.svelte +54 -38
  121. package/dist/components/molecules/Toaster.svelte.d.ts +5 -1
  122. package/dist/components/molecules/Toggle.svelte +2 -1
  123. package/dist/components/molecules/Toggle.svelte.d.ts +2 -1
  124. package/dist/components/molecules/Tooltip.svelte +32 -5
  125. package/dist/components/molecules/Tooltip.svelte.d.ts +9 -0
  126. package/dist/components/molecules/Truncate.svelte +156 -18
  127. package/dist/components/molecules/Truncate.svelte.d.ts +17 -1
  128. package/dist/components/molecules/WorkingDir.svelte +6 -0
  129. package/dist/components/molecules/WorkingDir.svelte.d.ts +2 -0
  130. package/dist/components/organisms/DataTable.svelte +38 -10
  131. package/dist/components/organisms/DataTable.svelte.d.ts +4 -0
  132. package/dist/components/organisms/FilterSearchBar.svelte +9 -2
  133. package/dist/components/organisms/FilterSearchBar.svelte.d.ts +4 -1
  134. package/dist/index.d.ts +10 -2
  135. package/dist/index.js +8 -1
  136. package/dist/size.d.ts +2 -0
  137. package/dist/size.js +1 -0
  138. package/dist/styles/tokens.css +3 -0
  139. package/dist/timestamp.d.ts +2 -2
  140. package/dist/timestamp.js +4 -4
  141. package/dist/tone.d.ts +1 -1
  142. package/dist/tone.js +1 -1
  143. package/dist/truncate.d.ts +13 -1
  144. package/dist/truncate.js +39 -0
  145. package/package.json +5 -3
@@ -1,13 +1,16 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
1
2
  type Status = 'active' | 'stale' | 'dead' | 'hibernated';
2
- type $$ComponentProps = {
3
+ type Own = {
3
4
  status?: Status;
4
5
  color?: string;
5
6
  label?: string;
6
7
  glow?: boolean;
7
8
  ring?: boolean;
9
+ /** Focusable (`tabindex=0`, `role=img`) so it can anchor a Tooltip. */
10
+ interactive?: boolean;
8
11
  class?: string;
9
- [key: string]: unknown;
10
12
  };
13
+ type $$ComponentProps = Omit<HTMLAttributes<HTMLSpanElement>, keyof Own> & Own;
11
14
  declare const Dot: import("svelte").Component<$$ComponentProps, {}, "">;
12
15
  type Dot = ReturnType<typeof Dot>;
13
16
  export default Dot;
@@ -20,24 +20,10 @@
20
20
  </script>
21
21
 
22
22
  <script lang="ts">
23
+ import type { HTMLAttributes } from 'svelte/elements';
23
24
  import type { Snippet } from 'svelte';
24
25
 
25
- let {
26
- value,
27
- variant = 'continuous',
28
- segments = 3,
29
- tone,
30
- warnAt = 70,
31
- dangerAt = 90,
32
- label,
33
- as = 'div',
34
- width,
35
- height,
36
- corner,
37
- class: klass = '',
38
- style = '',
39
- ...rest
40
- }: {
26
+ type Own = {
41
27
  value: number;
42
28
  variant?: 'continuous' | 'segments';
43
29
  // `segments` variant only: number of stacked bars, lit bottom-up.
@@ -53,8 +39,23 @@
53
39
  corner?: Snippet;
54
40
  class?: string;
55
41
  style?: string;
56
- [key: string]: unknown;
57
- } = $props();
42
+ };
43
+ let {
44
+ value,
45
+ variant = 'continuous',
46
+ segments = 3,
47
+ tone,
48
+ warnAt = 70,
49
+ dangerAt = 90,
50
+ label,
51
+ as = 'div',
52
+ width,
53
+ height,
54
+ corner,
55
+ class: klass = '',
56
+ style = '',
57
+ ...rest
58
+ }: Omit<HTMLAttributes<HTMLElement>, keyof Own> & Own = $props();
58
59
 
59
60
  const pct = $derived(clampPct(value));
60
61
  const resolvedTone = $derived(tone ?? gaugeTone(pct, warnAt, dangerAt));
@@ -2,8 +2,9 @@ export type GaugeTone = 'ok' | 'warn' | 'danger';
2
2
  export declare function clampPct(value: number): number;
3
3
  export declare function gaugeTone(value: number, warnAt?: number, dangerAt?: number): GaugeTone;
4
4
  export declare function litSegments(value: number, segments?: number): number;
5
+ import type { HTMLAttributes } from 'svelte/elements';
5
6
  import type { Snippet } from 'svelte';
6
- type $$ComponentProps = {
7
+ type Own = {
7
8
  value: number;
8
9
  variant?: 'continuous' | 'segments';
9
10
  segments?: number;
@@ -17,8 +18,8 @@ type $$ComponentProps = {
17
18
  corner?: Snippet;
18
19
  class?: string;
19
20
  style?: string;
20
- [key: string]: unknown;
21
21
  };
22
+ type $$ComponentProps = Omit<HTMLAttributes<HTMLElement>, keyof Own> & Own;
22
23
  declare const Gauge: import("svelte").Component<$$ComponentProps, {}, "">;
23
24
  type Gauge = ReturnType<typeof Gauge>;
24
25
  export default Gauge;
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
2
3
  // Heading primitive: the ONLY place an <h1>–<h6> is emitted. `level` picks both
3
4
  // the semantic tag and the default display size; `size` overrides the visual
4
5
  // size independently of the level (e.g. toolbar chrome pinned smaller than its
@@ -7,23 +8,7 @@
7
8
 
8
9
  type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
9
10
 
10
- let {
11
- level = 2,
12
- size,
13
- tone = 'default',
14
- truncate = false,
15
- italic = false,
16
- nowrap = false,
17
- wrap = 'normal',
18
- uppercase = false,
19
- leading,
20
- measure,
21
- grow = false,
22
- scale = true,
23
- class: klass = '',
24
- children,
25
- ...rest
26
- }: {
11
+ type Own = {
27
12
  level?: 1 | 2 | 3 | 4 | 5 | 6;
28
13
  size?: Size;
29
14
  tone?: 'default' | 'muted' | 'faint';
@@ -40,8 +25,24 @@
40
25
  scale?: boolean;
41
26
  class?: string;
42
27
  children?: Snippet;
43
- [key: string]: unknown;
44
- } = $props();
28
+ };
29
+ let {
30
+ level = 2,
31
+ size,
32
+ tone = 'default',
33
+ truncate = false,
34
+ italic = false,
35
+ nowrap = false,
36
+ wrap = 'normal',
37
+ uppercase = false,
38
+ leading,
39
+ measure,
40
+ grow = false,
41
+ scale = true,
42
+ class: klass = '',
43
+ children,
44
+ ...rest
45
+ }: Omit<HTMLAttributes<HTMLHeadingElement>, keyof Own> & Own = $props();
45
46
 
46
47
  // Default display size per rank (h1 biggest). `size` overrides it.
47
48
  const DEFAULT_SIZE: Record<number, Size> = { 1: '2xl', 2: 'xl', 3: 'lg', 4: 'md', 5: 'sm', 6: 'xs' };
@@ -1,6 +1,7 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
1
2
  import type { Snippet } from 'svelte';
2
3
  type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
3
- type $$ComponentProps = {
4
+ type Own = {
4
5
  level?: 1 | 2 | 3 | 4 | 5 | 6;
5
6
  size?: Size;
6
7
  tone?: 'default' | 'muted' | 'faint';
@@ -15,8 +16,8 @@ type $$ComponentProps = {
15
16
  scale?: boolean;
16
17
  class?: string;
17
18
  children?: Snippet;
18
- [key: string]: unknown;
19
19
  };
20
+ type $$ComponentProps = Omit<HTMLAttributes<HTMLHeadingElement>, keyof Own> & Own;
20
21
  declare const Heading: import("svelte").Component<$$ComponentProps, {}, "">;
21
22
  type Heading = ReturnType<typeof Heading>;
22
23
  export default Heading;
@@ -65,10 +65,20 @@
65
65
  unlink: '<path d="m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" /><path d="m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" /><line x1="8" x2="8" y1="2" y2="5" /><line x1="2" x2="5" y1="8" y2="8" /><line x1="16" x2="16" y1="19" y2="22" /><line x1="19" x2="22" y1="16" y2="16" />',
66
66
  'text-cursor': '<path d="M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1" /><path d="M7 22h1a4 4 0 0 0 4-4" /><path d="M7 2h1a4 4 0 0 1 4 4" />',
67
67
  tag: '<path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z" /><circle cx="7.5" cy="7.5" r=".5" fill="currentColor" />',
68
+ pin: '<path d="M12 17v5" /><path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />',
69
+ 'pin-off': '<path d="M12 17v5" /><path d="M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" /><path d="m2 2 20 20" /><path d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" />',
70
+ 'life-buoy': '<circle cx="12" cy="12" r="10" /><path d="m4.93 4.93 4.24 4.24" /><path d="m14.83 9.17 4.24-4.24" /><path d="m14.83 14.83 4.24 4.24" /><path d="m9.17 14.83-4.24 4.24" /><circle cx="12" cy="12" r="4" />',
68
71
  bookmark: '<path d="M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z" />',
69
72
  star: '<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" />',
70
73
  heart: '<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5" />',
71
74
  fork: '<circle cx="12" cy="18" r="3" /><circle cx="6" cy="6" r="3" /><circle cx="18" cy="6" r="3" /><path d="M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9" /><path d="M12 12v3" />',
75
+ 'pull-request': '<circle cx="18" cy="18" r="3" /><circle cx="6" cy="6" r="3" /><path d="M13 6h3a2 2 0 0 1 2 2v7" /><line x1="6" x2="6" y1="9" y2="21" />',
76
+ 'git-branch': '<line x1="6" x2="6" y1="3" y2="15" /><circle cx="18" cy="6" r="3" /><circle cx="6" cy="18" r="3" /><path d="M18 9a9 9 0 0 1-9 9" />',
77
+ 'git-commit': '<circle cx="12" cy="12" r="3" /><line x1="3" x2="9" y1="12" y2="12" /><line x1="15" x2="21" y1="12" y2="12" />',
78
+ 'key-round': '<path d="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z" /><circle cx="16.5" cy="7.5" r=".5" fill="currentColor" />',
79
+ 'layout-grid': '<rect width="7" height="7" x="3" y="3" rx="1" /><rect width="7" height="7" x="14" y="3" rx="1" /><rect width="7" height="7" x="14" y="14" rx="1" /><rect width="7" height="7" x="3" y="14" rx="1" />',
80
+ palette: '<path d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z" /><circle cx="13.5" cy="6.5" r=".5" fill="currentColor" /><circle cx="17.5" cy="10.5" r=".5" fill="currentColor" /><circle cx="6.5" cy="12.5" r=".5" fill="currentColor" /><circle cx="8.5" cy="7.5" r=".5" fill="currentColor" />',
81
+ 'git-merge': '<circle cx="18" cy="18" r="3" /><circle cx="6" cy="6" r="3" /><path d="M6 21V9a9 9 0 0 0 9 9" />',
72
82
  live: '<circle cx="12" cy="12" r="5" />',
73
83
  eye: '<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /><circle cx="12" cy="12" r="3" />',
74
84
  'eye-off': '<path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" /><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242" /><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" /><path d="m2 2 20 20" />',
@@ -109,16 +119,11 @@
109
119
  </script>
110
120
 
111
121
  <script lang="ts">
122
+ import type { SVGAttributes } from 'svelte/elements';
112
123
  import type { Snippet } from 'svelte';
124
+ import { canonicalTone, type Tone } from '../../tone';
113
125
 
114
- let {
115
- name,
116
- size,
117
- label,
118
- spin = false,
119
- children,
120
- ...rest
121
- }: {
126
+ type Own = {
122
127
  /** Named glyph from the registry. Omit when supplying `children`. */
123
128
  name?: IconName;
124
129
  /** Explicit pixel size. Omit to track the surrounding text (1em) — best
@@ -133,17 +138,35 @@
133
138
  /** Raw SVG markup (24×24 viewBox) — overrides `name`. Pass a lucide-svelte
134
139
  * component's contents here to render any icon not in the registry. */
135
140
  children?: Snippet;
136
- [key: string]: unknown;
137
- } = $props();
141
+ /** Force fill (or outline) regardless of the glyph's default. */
142
+ filled?: boolean;
143
+ /** Semantic colour. */
144
+ tone?: Tone;
145
+ class?: string;
146
+ style?: string;
147
+ };
148
+ let {
149
+ name,
150
+ size,
151
+ label,
152
+ spin = false,
153
+ filled: filledProp,
154
+ tone,
155
+ children,
156
+ class: klass = '',
157
+ style: styleProp = '',
158
+ ...rest
159
+ }: Omit<SVGAttributes<SVGSVGElement>, keyof Own> & Own = $props();
138
160
 
139
- const filled = $derived(name ? FILLED.has(name) : false);
161
+ const filled = $derived(filledProp ?? (name ? FILLED.has(name) : false));
162
+ const toneColor = $derived(tone && tone !== 'neutral' ? `var(--${canonicalTone(tone)})` : undefined);
140
163
  </script>
141
164
 
142
165
  <svg
143
166
  data-tsu="Icon"
144
- class="icon"
167
+ class="icon {klass}"
145
168
  class:spin
146
- style={size ? `font-size: ${size}px` : undefined}
169
+ style="{size ? `font-size: ${size}px;` : ''}{toneColor ? `color: ${toneColor};` : ''}{styleProp}"
147
170
  viewBox="0 0 24 24"
148
171
  fill={filled ? 'currentColor' : 'none'}
149
172
  stroke={filled ? 'none' : 'currentColor'}
@@ -48,10 +48,20 @@ declare const ICONS: {
48
48
  readonly unlink: "<path d=\"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" /><path d=\"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" /><line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"5\" /><line x1=\"2\" x2=\"5\" y1=\"8\" y2=\"8\" /><line x1=\"16\" x2=\"16\" y1=\"19\" y2=\"22\" /><line x1=\"19\" x2=\"22\" y1=\"16\" y2=\"16\" />";
49
49
  readonly 'text-cursor': "<path d=\"M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1\" /><path d=\"M7 22h1a4 4 0 0 0 4-4\" /><path d=\"M7 2h1a4 4 0 0 1 4 4\" />";
50
50
  readonly tag: "<path d=\"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\" /><circle cx=\"7.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />";
51
+ readonly pin: "<path d=\"M12 17v5\" /><path d=\"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\" />";
52
+ readonly 'pin-off': "<path d=\"M12 17v5\" /><path d=\"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89\" /><path d=\"m2 2 20 20\" /><path d=\"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11\" />";
53
+ readonly 'life-buoy': "<circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"m4.93 4.93 4.24 4.24\" /><path d=\"m14.83 9.17 4.24-4.24\" /><path d=\"m14.83 14.83 4.24 4.24\" /><path d=\"m9.17 14.83-4.24 4.24\" /><circle cx=\"12\" cy=\"12\" r=\"4\" />";
51
54
  readonly bookmark: "<path d=\"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z\" />";
52
55
  readonly star: "<path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\" />";
53
56
  readonly heart: "<path d=\"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\" />";
54
57
  readonly fork: "<circle cx=\"12\" cy=\"18\" r=\"3\" /><circle cx=\"6\" cy=\"6\" r=\"3\" /><circle cx=\"18\" cy=\"6\" r=\"3\" /><path d=\"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9\" /><path d=\"M12 12v3\" />";
58
+ readonly 'pull-request': "<circle cx=\"18\" cy=\"18\" r=\"3\" /><circle cx=\"6\" cy=\"6\" r=\"3\" /><path d=\"M13 6h3a2 2 0 0 1 2 2v7\" /><line x1=\"6\" x2=\"6\" y1=\"9\" y2=\"21\" />";
59
+ readonly 'git-branch': "<line x1=\"6\" x2=\"6\" y1=\"3\" y2=\"15\" /><circle cx=\"18\" cy=\"6\" r=\"3\" /><circle cx=\"6\" cy=\"18\" r=\"3\" /><path d=\"M18 9a9 9 0 0 1-9 9\" />";
60
+ readonly 'git-commit': "<circle cx=\"12\" cy=\"12\" r=\"3\" /><line x1=\"3\" x2=\"9\" y1=\"12\" y2=\"12\" /><line x1=\"15\" x2=\"21\" y1=\"12\" y2=\"12\" />";
61
+ readonly 'key-round': "<path d=\"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z\" /><circle cx=\"16.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />";
62
+ readonly 'layout-grid': "<rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" /><rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" /><rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" /><rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />";
63
+ readonly palette: "<path d=\"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z\" /><circle cx=\"13.5\" cy=\"6.5\" r=\".5\" fill=\"currentColor\" /><circle cx=\"17.5\" cy=\"10.5\" r=\".5\" fill=\"currentColor\" /><circle cx=\"6.5\" cy=\"12.5\" r=\".5\" fill=\"currentColor\" /><circle cx=\"8.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />";
64
+ readonly 'git-merge': "<circle cx=\"18\" cy=\"18\" r=\"3\" /><circle cx=\"6\" cy=\"6\" r=\"3\" /><path d=\"M6 21V9a9 9 0 0 0 9 9\" />";
55
65
  readonly live: "<circle cx=\"12\" cy=\"12\" r=\"5\" />";
56
66
  readonly eye: "<path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" /><circle cx=\"12\" cy=\"12\" r=\"3\" />";
57
67
  readonly 'eye-off': "<path d=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" /><path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" /><path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" /><path d=\"m2 2 20 20\" />";
@@ -77,8 +87,10 @@ declare const ICONS: {
77
87
  export type IconName = keyof typeof ICONS;
78
88
  /** True when `s` is a registered glyph name (vs. e.g. a raw emoji string). */
79
89
  export declare function isIconName(s: string): s is IconName;
90
+ import type { SVGAttributes } from 'svelte/elements';
80
91
  import type { Snippet } from 'svelte';
81
- type $$ComponentProps = {
92
+ import { type Tone } from '../../tone';
93
+ type Own = {
82
94
  /** Named glyph from the registry. Omit when supplying `children`. */
83
95
  name?: IconName;
84
96
  /** Explicit pixel size. Omit to track the surrounding text (1em) — best
@@ -93,8 +105,14 @@ type $$ComponentProps = {
93
105
  /** Raw SVG markup (24×24 viewBox) — overrides `name`. Pass a lucide-svelte
94
106
  * component's contents here to render any icon not in the registry. */
95
107
  children?: Snippet;
96
- [key: string]: unknown;
108
+ /** Force fill (or outline) regardless of the glyph's default. */
109
+ filled?: boolean;
110
+ /** Semantic colour. */
111
+ tone?: Tone;
112
+ class?: string;
113
+ style?: string;
97
114
  };
115
+ type $$ComponentProps = Omit<SVGAttributes<SVGSVGElement>, keyof Own> & Own;
98
116
  declare const Icon: import("svelte").Component<$$ComponentProps, {}, "">;
99
117
  type Icon = ReturnType<typeof Icon>;
100
118
  export default Icon;
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import type { ControlSize } from '../../size';
2
3
  // Text input primitive. Owns its styling from theme tokens; supports
3
4
  // `bind:value` and passes through every native <input> attribute. `mono`
4
5
  // switches to the monospace family (paths, tokens, env values). A wrapper is
@@ -12,7 +13,7 @@
12
13
  // layouts) to expose a height preset instead.
13
14
  type Props = Omit<HTMLInputAttributes, 'size'> & {
14
15
  mono?: boolean;
15
- size?: 'sm' | 'md';
16
+ size?: ControlSize;
16
17
  /** Fill the available width of a flex/Cluster row (flex: 1) instead of
17
18
  * needing a raw `style="flex:1"` at the call-site. */
18
19
  grow?: boolean;
@@ -90,6 +91,7 @@
90
91
  class="input {klass}"
91
92
  class:mono
92
93
  class:input-sm={size === 'sm'}
94
+ class:input-lg={size === 'lg'}
93
95
  class:input-grow={grow}
94
96
  class:input-fixed={!!width && !wrapped}
95
97
  class:input-pill={shape === 'pill'}
@@ -128,7 +130,9 @@
128
130
  <style>
129
131
  .input {
130
132
  width: 100%;
131
- padding: var(--sp-3);
133
+ min-height: var(--control-height-default);
134
+ padding: var(--sp-2) var(--sp-3);
135
+ line-height: var(--lh-tight);
132
136
  background: var(--bg);
133
137
  border: 1px solid var(--border-strong);
134
138
  border-radius: var(--r-md);
@@ -139,10 +143,20 @@
139
143
  outline: none;
140
144
  border-color: var(--accent);
141
145
  }
146
+ .input:focus-visible {
147
+ outline: var(--focus-ring);
148
+ outline-offset: var(--focus-ring-offset);
149
+ }
142
150
  .input-sm {
143
- padding: var(--sp-2);
151
+ min-height: var(--control-height-compact);
152
+ padding: var(--sp-1) var(--sp-2);
144
153
  font-size: var(--fs-sm);
145
154
  }
155
+ .input-lg {
156
+ min-height: var(--control-height-large);
157
+ padding: var(--sp-3) var(--sp-4);
158
+ font-size: var(--fs-base);
159
+ }
146
160
  .input-grow {
147
161
  flex: 1 1 0;
148
162
  width: auto;
@@ -1,8 +1,9 @@
1
+ import type { ControlSize } from '../../size';
1
2
  import type { HTMLInputAttributes } from 'svelte/elements';
2
3
  import { type IconName } from './Icon.svelte';
3
4
  type Props = Omit<HTMLInputAttributes, 'size'> & {
4
5
  mono?: boolean;
5
- size?: 'sm' | 'md';
6
+ size?: ControlSize;
6
7
  /** Fill the available width of a flex/Cluster row (flex: 1) instead of
7
8
  * needing a raw `style="flex:1"` at the call-site. */
8
9
  grow?: boolean;
@@ -1,14 +1,18 @@
1
1
  <script lang="ts">
2
+ import type { ControlSize } from '../../size';
2
3
  // Keyboard shortcut chip: `keys="mod+enter"` (or an array of tokens) renders
3
4
  // one <kbd> per key with platform-aware glyphs — `mod` is ⌘ on Mac, Ctrl
4
5
  // elsewhere (Ctrl during SSR).
5
6
  type Props = {
6
7
  keys: string | string[];
7
- size?: 'sm' | 'md';
8
+ size?: ControlSize;
9
+ grow?: boolean;
10
+ shrink?: boolean;
11
+ block?: boolean;
8
12
  class?: string;
9
13
  };
10
14
 
11
- let { keys, size = 'sm', class: klass = '' }: Props = $props();
15
+ let { keys, size = 'sm', grow = false, shrink = true, block = false, class: klass = '' }: Props = $props();
12
16
 
13
17
  const isMac =
14
18
  typeof navigator !== 'undefined' &&
@@ -59,7 +63,14 @@
59
63
  );
60
64
  </script>
61
65
 
62
- <span data-tsu="Kbd" class="kbd-group {klass}" class:kbd-md={size === 'md'}>
66
+ <span
67
+ data-tsu="Kbd"
68
+ class="kbd-group {klass}"
69
+ class:kbd-md={size === 'md'}
70
+ class:grow={grow}
71
+ class:no-shrink={!shrink}
72
+ class:block={block}
73
+ >
63
74
  {#each tokens as token, i (i)}
64
75
  {#if i > 0}<span class="kbd-sep" aria-hidden="true">+</span>{/if}
65
76
  <kbd class="kbd">{token}</kbd>
@@ -67,6 +78,17 @@
67
78
  </span>
68
79
 
69
80
  <style>
81
+ .grow {
82
+ flex: 1 1 0;
83
+ min-width: 0;
84
+ }
85
+ .no-shrink {
86
+ flex: none;
87
+ }
88
+ .block {
89
+ display: flex;
90
+ width: 100%;
91
+ }
70
92
  .kbd-group {
71
93
  display: inline-flex;
72
94
  align-items: center;
@@ -1,6 +1,10 @@
1
+ import type { ControlSize } from '../../size';
1
2
  type Props = {
2
3
  keys: string | string[];
3
- size?: 'sm' | 'md';
4
+ size?: ControlSize;
5
+ grow?: boolean;
6
+ shrink?: boolean;
7
+ block?: boolean;
4
8
  class?: string;
5
9
  };
6
10
  declare const Kbd: import("svelte").Component<Props, {}, "">;
@@ -1,9 +1,22 @@
1
1
  <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
2
3
  // Inline text link — underlined accent text with no button chrome. Renders an
3
4
  // <a> when `href` is given, otherwise a <button> (for in-page actions that
4
5
  // read as links, e.g. "Open ChatGPT again").
5
6
  import type { Snippet } from 'svelte';
6
7
 
8
+ type Own = {
9
+ href?: string;
10
+ target?: string;
11
+ rel?: string;
12
+ download?: string | boolean;
13
+ tone?: 'accent' | 'info' | 'muted' | 'inherit';
14
+ underline?: 'always' | 'hover' | 'none';
15
+ // Text alignment of the <button> form; multi-line titles want `start`.
16
+ align?: 'start' | 'center';
17
+ class?: string;
18
+ children?: Snippet;
19
+ };
7
20
  let {
8
21
  href,
9
22
  tone = 'accent',
@@ -12,16 +25,7 @@
12
25
  class: klass = '',
13
26
  children,
14
27
  ...rest
15
- }: {
16
- href?: string;
17
- tone?: 'accent' | 'info' | 'muted' | 'inherit';
18
- underline?: 'always' | 'hover' | 'none';
19
- // Text alignment of the <button> form; multi-line titles want `start`.
20
- align?: 'start' | 'center';
21
- class?: string;
22
- children?: Snippet;
23
- [key: string]: unknown;
24
- } = $props();
28
+ }: Omit<HTMLAttributes<HTMLElement>, keyof Own> & Own = $props();
25
29
  </script>
26
30
 
27
31
  {#if href}
@@ -33,10 +37,10 @@
33
37
  >
34
38
  {:else}
35
39
  <button
36
- type="button"
37
40
  class="link tone-{tone} underline-{underline} align-{align} {klass}"
38
41
  data-tsu="Link"
39
- {...rest}>{@render children?.()}</button
42
+ {...rest}
43
+ type="button">{@render children?.()}</button
40
44
  >
41
45
  {/if}
42
46
 
@@ -1,13 +1,17 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
1
2
  import type { Snippet } from 'svelte';
2
- type $$ComponentProps = {
3
+ type Own = {
3
4
  href?: string;
5
+ target?: string;
6
+ rel?: string;
7
+ download?: string | boolean;
4
8
  tone?: 'accent' | 'info' | 'muted' | 'inherit';
5
9
  underline?: 'always' | 'hover' | 'none';
6
10
  align?: 'start' | 'center';
7
11
  class?: string;
8
12
  children?: Snippet;
9
- [key: string]: unknown;
10
13
  };
14
+ type $$ComponentProps = Omit<HTMLAttributes<HTMLElement>, keyof Own> & Own;
11
15
  declare const Link: import("svelte").Component<$$ComponentProps, {}, "">;
12
16
  type Link = ReturnType<typeof Link>;
13
17
  export default Link;