@sentropic/design-system-svelte 0.10.2 → 0.10.4

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 (87) hide show
  1. package/dist/AreaChart.svelte +38 -26
  2. package/dist/AreaChart.svelte.d.ts.map +1 -1
  3. package/dist/BackToTop.svelte +157 -0
  4. package/dist/BackToTop.svelte.d.ts +14 -0
  5. package/dist/BackToTop.svelte.d.ts.map +1 -0
  6. package/dist/BarChart.svelte +38 -39
  7. package/dist/BarChart.svelte.d.ts.map +1 -1
  8. package/dist/Card.svelte +2 -0
  9. package/dist/ChartDataList.svelte +33 -0
  10. package/dist/ChartDataList.svelte.d.ts +9 -0
  11. package/dist/ChartDataList.svelte.d.ts.map +1 -0
  12. package/dist/ChatComposer.svelte +20 -3
  13. package/dist/ChatComposer.svelte.d.ts +6 -30
  14. package/dist/ChatComposer.svelte.d.ts.map +1 -1
  15. package/dist/Checkbox.svelte +4 -0
  16. package/dist/Combobox.svelte +1 -1
  17. package/dist/ContentSwitcher.svelte +1 -0
  18. package/dist/DataTable.svelte +4 -1
  19. package/dist/DatePicker.svelte +1 -1
  20. package/dist/DisplaySettings.svelte +210 -0
  21. package/dist/DisplaySettings.svelte.d.ts +24 -0
  22. package/dist/DisplaySettings.svelte.d.ts.map +1 -0
  23. package/dist/DonutChart.svelte +44 -29
  24. package/dist/DonutChart.svelte.d.ts.map +1 -1
  25. package/dist/Dropdown.svelte +1 -1
  26. package/dist/FileUploader.svelte +2 -2
  27. package/dist/ForceGraph.svelte +485 -22
  28. package/dist/ForceGraph.svelte.d.ts +48 -0
  29. package/dist/ForceGraph.svelte.d.ts.map +1 -1
  30. package/dist/GraphLegend.svelte +142 -0
  31. package/dist/GraphLegend.svelte.d.ts +12 -0
  32. package/dist/GraphLegend.svelte.d.ts.map +1 -0
  33. package/dist/Header.svelte +2 -1
  34. package/dist/IconButton.svelte +1 -1
  35. package/dist/InlineLoading.svelte +10 -1
  36. package/dist/InlineLoading.svelte.d.ts.map +1 -1
  37. package/dist/Input.svelte +3 -2
  38. package/dist/LanguageSelector.svelte +2 -1
  39. package/dist/LineChart.svelte +38 -26
  40. package/dist/LineChart.svelte.d.ts.map +1 -1
  41. package/dist/Link.svelte +7 -1
  42. package/dist/MediaContent.svelte +124 -0
  43. package/dist/MediaContent.svelte.d.ts +22 -0
  44. package/dist/MediaContent.svelte.d.ts.map +1 -0
  45. package/dist/Menu.svelte +56 -3
  46. package/dist/Menu.svelte.d.ts.map +1 -1
  47. package/dist/MessageStatusBadge.svelte +1 -1
  48. package/dist/MultiSelect.svelte +2 -2
  49. package/dist/Notification.svelte +150 -0
  50. package/dist/Notification.svelte.d.ts +17 -0
  51. package/dist/Notification.svelte.d.ts.map +1 -0
  52. package/dist/NumberInput.svelte +1 -0
  53. package/dist/OverflowMenu.svelte +84 -13
  54. package/dist/OverflowMenu.svelte.d.ts.map +1 -1
  55. package/dist/Pagination.svelte +7 -0
  56. package/dist/PaginationNav.svelte +2 -2
  57. package/dist/ProgressIndicator.svelte +13 -1
  58. package/dist/ProgressIndicator.svelte.d.ts +1 -0
  59. package/dist/ProgressIndicator.svelte.d.ts.map +1 -1
  60. package/dist/Radio.svelte +7 -3
  61. package/dist/ScatterPlot.svelte +64 -45
  62. package/dist/ScatterPlot.svelte.d.ts.map +1 -1
  63. package/dist/Search.svelte +6 -3
  64. package/dist/Select.svelte +8 -2
  65. package/dist/SideNav.svelte +6 -0
  66. package/dist/StackedBarChart.svelte +51 -30
  67. package/dist/StackedBarChart.svelte.d.ts.map +1 -1
  68. package/dist/StreamingMessage.svelte +2 -2
  69. package/dist/Switch.svelte +4 -0
  70. package/dist/Table.svelte +4 -1
  71. package/dist/TableOfContents.svelte +109 -0
  72. package/dist/TableOfContents.svelte.d.ts +16 -0
  73. package/dist/TableOfContents.svelte.d.ts.map +1 -0
  74. package/dist/Tag.svelte +1 -1
  75. package/dist/Textarea.svelte +3 -2
  76. package/dist/Tile.svelte +4 -0
  77. package/dist/TileGroup.svelte +4 -0
  78. package/dist/Toggle.svelte +4 -0
  79. package/dist/Toggletip.svelte +1 -1
  80. package/dist/Transcription.svelte +135 -0
  81. package/dist/Transcription.svelte.d.ts +19 -0
  82. package/dist/Transcription.svelte.d.ts.map +1 -0
  83. package/dist/TreeView.svelte +2 -2
  84. package/dist/index.d.ts +12 -1
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +8 -0
  87. package/package.json +2 -2
@@ -16,6 +16,8 @@
16
16
  </script>
17
17
 
18
18
  <script lang="ts">
19
+ import ChartDataList from "./ChartDataList.svelte";
20
+
19
21
  type AreaChartProps = {
20
22
  data: (number | AreaChartDatum)[];
21
23
  width?: number;
@@ -85,6 +87,8 @@
85
87
  });
86
88
  });
87
89
 
90
+ const dataValueItems = $derived(normalizedData.map((d) => `${d.x}: ${d.y}`));
91
+
88
92
  let hoveredIndex: number | null = $state(null);
89
93
 
90
94
  const plotWidth = $derived(Math.max(width - MARGIN.left - MARGIN.right, 1));
@@ -197,12 +201,18 @@
197
201
  return entries;
198
202
  });
199
203
 
200
- function handleEnter(i: number) {
201
- hoveredIndex = i;
202
- }
203
204
  function handleLeave() {
204
205
  hoveredIndex = null;
205
206
  }
207
+ function handleVisualPointerMove(event: PointerEvent) {
208
+ const target = event.target;
209
+ if (!(target instanceof Element)) {
210
+ hoveredIndex = null;
211
+ return;
212
+ }
213
+ const index = Number(target.getAttribute("data-chart-index"));
214
+ hoveredIndex = Number.isInteger(index) ? index : null;
215
+ }
206
216
 
207
217
  // Generates a unique gradient id to avoid conflicts when rendering multiple charts on the same page
208
218
  const gradientId = $derived.by(() => {
@@ -213,15 +223,22 @@
213
223
  ["st-areaChart", `st-areaChart--${tone}`, className].filter(Boolean).join(" ");
214
224
  </script>
215
225
 
216
- <div class={classes()} role="img" aria-label={label}>
217
- <svg
218
- viewBox="0 0 {width} {height}"
219
- preserveAspectRatio="xMidYMid meet"
220
- width="100%"
221
- height="100%"
222
- focusable="false"
223
- aria-hidden="true"
226
+ <div class={classes()}>
227
+ <div
228
+ class="st-areaChart__visual"
229
+ role="img"
230
+ aria-label={label}
231
+ onpointermove={handleVisualPointerMove}
232
+ onpointerleave={handleLeave}
224
233
  >
234
+ <svg
235
+ viewBox="0 0 {width} {height}"
236
+ preserveAspectRatio="xMidYMid meet"
237
+ width="100%"
238
+ height="100%"
239
+ focusable="false"
240
+ aria-hidden="true"
241
+ >
225
242
  <defs>
226
243
  <linearGradient id={gradientId} x1="0" y1="0" x2="0" y2="1">
227
244
  <stop offset="0%" stop-color="currentColor" stop-opacity="0.3" />
@@ -297,16 +314,13 @@
297
314
  cx={p.x}
298
315
  cy={p.y}
299
316
  r="4"
300
- tabindex="0"
301
- role="img"
302
- aria-label="{p.datum.x}: {p.datum.y}"
303
- onmouseenter={() => handleEnter(p.index)}
304
- onmouseleave={handleLeave}
305
- onfocus={() => handleEnter(p.index)}
306
- onblur={handleLeave}
317
+ data-chart-index={p.index}
307
318
  />
308
319
  {/each}
309
- </svg>
320
+ </svg>
321
+ </div>
322
+
323
+ <ChartDataList {label} items={dataValueItems} />
310
324
 
311
325
  {#if hoveredIndex !== null && points[hoveredIndex]}
312
326
  {@const p = points[hoveredIndex]}
@@ -344,6 +358,10 @@
344
358
  overflow: visible;
345
359
  }
346
360
 
361
+ .st-areaChart__visual {
362
+ display: block;
363
+ }
364
+
347
365
  .st-areaChart__grid {
348
366
  stroke: var(--st-component-areaChart-gridStroke, var(--st-semantic-border-subtle));
349
367
  stroke-dasharray: 2 3;
@@ -377,16 +395,10 @@
377
395
  transition: r 120ms ease;
378
396
  }
379
397
 
380
- .st-areaChart__dot:hover,
381
- .st-areaChart__dot:focus-visible {
398
+ .st-areaChart__dot:hover {
382
399
  r: 5.5;
383
400
  }
384
401
 
385
- .st-areaChart__dot:focus-visible {
386
- outline: 2px solid var(--st-semantic-border-interactive);
387
- outline-offset: 1px;
388
- }
389
-
390
402
  @media (prefers-reduced-motion: reduce) {
391
403
  .st-areaChart__dot {
392
404
  transition: none;
@@ -1 +1 @@
1
- {"version":3,"file":"AreaChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/AreaChart.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAsPJ,QAAA,MAAM,SAAS,oDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"AreaChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/AreaChart.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAMF,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,CAAC,MAAM,GAAG,cAAc,CAAC,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAmQJ,QAAA,MAAM,SAAS,oDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -0,0 +1,157 @@
1
+ <script lang="ts">
2
+ import { ArrowUp } from "@lucide/svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type BackToTopProps = Omit<HTMLAttributes<HTMLButtonElement>, "class"> & {
6
+ label?: string;
7
+ disabled?: boolean;
8
+ targetId?: string;
9
+ threshold?: number;
10
+ autoHide?: boolean;
11
+ smooth?: boolean;
12
+ class?: string;
13
+ };
14
+
15
+ let {
16
+ label = "Retour en haut",
17
+ targetId = "top",
18
+ threshold = 240,
19
+ autoHide = true,
20
+ smooth = true,
21
+ disabled = false,
22
+ class: className,
23
+ ...rest
24
+ }: BackToTopProps = $props();
25
+
26
+ const normalizedTarget = () => (targetId ? `#${targetId.replace(/^#/, "")}` : "#top");
27
+
28
+ let visible = $state(false);
29
+ let hideOnScroll = $state(true);
30
+
31
+ $effect(() => {
32
+ hideOnScroll = autoHide;
33
+ visible = !autoHide;
34
+ });
35
+
36
+ $effect(() => {
37
+ if (!hideOnScroll || typeof window === "undefined") {
38
+ if (!hideOnScroll) {
39
+ visible = true;
40
+ }
41
+ return;
42
+ }
43
+
44
+ const updateVisibility = () => {
45
+ visible = window.scrollY > threshold;
46
+ };
47
+
48
+ updateVisibility();
49
+ window.addEventListener("scroll", updateVisibility, { passive: true });
50
+
51
+ return () => {
52
+ window.removeEventListener("scroll", updateVisibility);
53
+ };
54
+ });
55
+
56
+ function goTop() {
57
+ const target = normalizedTarget();
58
+ const anchor = target.startsWith("#") ? target.slice(1) : target;
59
+ const element = anchor ? document.getElementById(anchor) : null;
60
+
61
+ if (element) {
62
+ element.scrollIntoView({
63
+ behavior: smooth ? "smooth" : "auto",
64
+ block: "start"
65
+ });
66
+ return;
67
+ }
68
+
69
+ window.scrollTo({
70
+ top: 0,
71
+ behavior: smooth ? "smooth" : "auto"
72
+ });
73
+ }
74
+
75
+ const classes = () => ["st-backToTop", className].filter(Boolean).join(" ");
76
+ </script>
77
+
78
+ <button
79
+ type="button"
80
+ class={classes()}
81
+ onclick={goTop}
82
+ aria-label={label}
83
+ aria-hidden={autoHide && !visible}
84
+ aria-live={autoHide && !visible ? "polite" : undefined}
85
+ tabindex={autoHide && !visible ? -1 : undefined}
86
+ {disabled}
87
+ {...rest}
88
+ >
89
+ <span class="st-backToTop__icon" aria-hidden="true">
90
+ <ArrowUp size={16} />
91
+ </span>
92
+ <span class="st-backToTop__label">{label}</span>
93
+ </button>
94
+
95
+ <style>
96
+ .st-backToTop {
97
+ align-items: center;
98
+ background: var(--st-component-control-background, var(--st-semantic-surface-contrast, #0f172a));
99
+ border: 1px solid var(--st-component-control-border, #334155);
100
+ border-radius: 999px;
101
+ bottom: var(--st-spacing-4, 1rem);
102
+ color: var(--st-semantic-text-inverse, #fff);
103
+ cursor: var(--st-cursor-interactive, pointer);
104
+ display: inline-flex;
105
+ gap: 0.5rem;
106
+ opacity: 0;
107
+ padding: 0.6rem 0.8rem;
108
+ position: fixed;
109
+ pointer-events: none;
110
+ right: var(--st-spacing-4, 1rem);
111
+ transform: translateY(0.75rem);
112
+ transition: opacity var(--st-motion-fast, 120ms) var(--st-motion-easing, ease),
113
+ transform var(--st-motion-fast, 120ms) var(--st-motion-easing, ease);
114
+ z-index: var(--st-zindex-toast, 70);
115
+ }
116
+
117
+ .st-backToTop:not([aria-hidden="true"]) {
118
+ opacity: 1;
119
+ pointer-events: auto;
120
+ transform: translateY(0);
121
+ }
122
+
123
+ .st-backToTop:hover:not(:disabled),
124
+ .st-backToTop:focus-visible {
125
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
126
+ box-shadow: 0 0 0 2px var(--st-component-control-focusRing, #38bdf8);
127
+ outline: none;
128
+ }
129
+
130
+ .st-backToTop:focus-visible {
131
+ outline: 2px solid var(--st-component-control-focusRing, #38bdf8);
132
+ outline-offset: 2px;
133
+ }
134
+
135
+ .st-backToTop__label {
136
+ font-size: 0.8125rem;
137
+ font-weight: 600;
138
+ line-height: 1.2;
139
+ }
140
+
141
+ .st-backToTop__icon {
142
+ align-items: center;
143
+ display: inline-flex;
144
+ }
145
+
146
+ @media (max-width: 38rem) {
147
+ .st-backToTop__label {
148
+ display: none;
149
+ }
150
+ }
151
+
152
+ @media (prefers-reduced-motion: reduce) {
153
+ .st-backToTop {
154
+ transition: none;
155
+ }
156
+ }
157
+ </style>
@@ -0,0 +1,14 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ type BackToTopProps = Omit<HTMLAttributes<HTMLButtonElement>, "class"> & {
3
+ label?: string;
4
+ disabled?: boolean;
5
+ targetId?: string;
6
+ threshold?: number;
7
+ autoHide?: boolean;
8
+ smooth?: boolean;
9
+ class?: string;
10
+ };
11
+ declare const BackToTop: import("svelte").Component<BackToTopProps, {}, "">;
12
+ type BackToTop = ReturnType<typeof BackToTop>;
13
+ export default BackToTop;
14
+ //# sourceMappingURL=BackToTop.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackToTop.svelte.d.ts","sourceRoot":"","sources":["../src/lib/BackToTop.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,GAAG;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgFJ,QAAA,MAAM,SAAS,oDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -17,6 +17,8 @@
17
17
  </script>
18
18
 
19
19
  <script lang="ts">
20
+ import ChartDataList from "./ChartDataList.svelte";
21
+
20
22
  type BarChartProps = {
21
23
  data: BarChartDatum[];
22
24
  width?: number;
@@ -72,8 +74,6 @@
72
74
  }
73
75
 
74
76
  let hoveredIndex: number | null = $state(null);
75
- let containerRect: { left: number; top: number } = $state({ left: 0, top: 0 });
76
- let chartRoot: HTMLDivElement | null = $state(null);
77
77
 
78
78
  const scales = $derived.by(() => {
79
79
  const values = data.map((d) => d.value);
@@ -133,6 +133,8 @@
133
133
  });
134
134
  });
135
135
 
136
+ const dataValueItems = $derived(data.map((d) => `${d.label}: ${d.value}`));
137
+
136
138
  const valueAxisTicks = $derived.by(() => {
137
139
  const { ticks, domainMin, domainMax, plotWidth, plotHeight } = scales;
138
140
  if (orientation === "vertical") {
@@ -157,36 +159,38 @@
157
159
  }));
158
160
  });
159
161
 
160
- function handleEnter(index: number, event: Event) {
161
- hoveredIndex = index;
162
- if (chartRoot) {
163
- const r = chartRoot.getBoundingClientRect();
164
- containerRect = { left: r.left, top: r.top };
165
- }
166
- event.stopPropagation();
167
- }
168
-
169
162
  function handleLeave() {
170
163
  hoveredIndex = null;
171
164
  }
165
+ function handleVisualPointerMove(event: PointerEvent) {
166
+ const target = event.target;
167
+ if (!(target instanceof Element)) {
168
+ hoveredIndex = null;
169
+ return;
170
+ }
171
+ const index = Number(target.getAttribute("data-chart-index"));
172
+ hoveredIndex = Number.isInteger(index) ? index : null;
173
+ }
172
174
 
173
175
  const classes = () => ["st-barChart", className].filter(Boolean).join(" ");
174
176
  </script>
175
177
 
176
- <div
177
- class={classes()}
178
- role="img"
179
- aria-label={label}
180
- bind:this={chartRoot}
181
- >
182
- <svg
183
- viewBox="0 0 {width} {height}"
184
- preserveAspectRatio="xMidYMid meet"
185
- width="100%"
186
- height="100%"
187
- focusable="false"
188
- aria-hidden="true"
178
+ <div class={classes()}>
179
+ <div
180
+ class="st-barChart__visual"
181
+ role="img"
182
+ aria-label={label}
183
+ onpointermove={handleVisualPointerMove}
184
+ onpointerleave={handleLeave}
189
185
  >
186
+ <svg
187
+ viewBox="0 0 {width} {height}"
188
+ preserveAspectRatio="xMidYMid meet"
189
+ width="100%"
190
+ height="100%"
191
+ focusable="false"
192
+ aria-hidden="true"
193
+ >
190
194
  <!-- gridlines + value axis ticks -->
191
195
  {#if orientation === "vertical"}
192
196
  {#each valueAxisTicks as tick (tick.value)}
@@ -276,16 +280,13 @@
276
280
  width={bar.width}
277
281
  height={bar.height}
278
282
  rx="2"
279
- tabindex="0"
280
- role="img"
281
- aria-label="{bar.datum.label}: {bar.datum.value}"
282
- onmouseenter={(e) => handleEnter(i, e)}
283
- onmouseleave={handleLeave}
284
- onfocus={(e) => handleEnter(i, e)}
285
- onblur={handleLeave}
283
+ data-chart-index={i}
286
284
  />
287
285
  {/each}
288
- </svg>
286
+ </svg>
287
+ </div>
288
+
289
+ <ChartDataList {label} items={dataValueItems} />
289
290
 
290
291
  {#if hoveredIndex !== null && bars[hoveredIndex]}
291
292
  {@const bar = bars[hoveredIndex]}
@@ -314,6 +315,10 @@
314
315
  overflow: visible;
315
316
  }
316
317
 
318
+ .st-barChart__visual {
319
+ display: block;
320
+ }
321
+
317
322
  .st-barChart__grid {
318
323
  stroke: var(--st-component-barChart-gridStroke, var(--st-semantic-border-subtle));
319
324
  stroke-dasharray: 2 3;
@@ -337,16 +342,10 @@
337
342
  transition: opacity 120ms ease;
338
343
  }
339
344
 
340
- .st-barChart__bar:hover,
341
- .st-barChart__bar:focus-visible {
345
+ .st-barChart__bar:hover {
342
346
  opacity: 0.82;
343
347
  }
344
348
 
345
- .st-barChart__bar:focus-visible {
346
- outline: 2px solid var(--st-semantic-border-interactive);
347
- outline-offset: 1px;
348
- }
349
-
350
349
  .st-barChart__bar--category1 { fill: var(--st-semantic-data-category1); }
351
350
  .st-barChart__bar--category2 { fill: var(--st-semantic-data-category2); }
352
351
  .st-barChart__bar--category3 { fill: var(--st-semantic-data-category3); }
@@ -1 +1 @@
1
- {"version":3,"file":"BarChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/BarChart.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgNJ,QAAA,MAAM,QAAQ,mDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"BarChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/BarChart.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB,CAAC;AAMF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAqNJ,QAAA,MAAM,QAAQ,mDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
package/dist/Card.svelte CHANGED
@@ -40,11 +40,13 @@
40
40
  .st-card--interactive {
41
41
  cursor: var(--st-cursor-interactive, pointer);
42
42
  transition:
43
+ background-color var(--st-motion-normal, 180ms) var(--st-motion-easing, ease),
43
44
  box-shadow var(--st-motion-normal, 180ms) var(--st-motion-easing, ease),
44
45
  transform var(--st-motion-normal, 180ms) var(--st-motion-easing, ease);
45
46
  }
46
47
 
47
48
  .st-card--interactive:hover {
49
+ background: var(--st-component-card-anatomy-states-hover-bg, var(--st-component-card-background, var(--st-semantic-surface-raised)));
48
50
  box-shadow: var(--st-shadow-medium, 0 8px 24px rgb(15 23 42 / 0.12));
49
51
  transform: var(--st-component-card-anatomy-states-hover-transform, translateY(-1px));
50
52
  }
@@ -0,0 +1,33 @@
1
+ <script lang="ts">
2
+ type ChartDataListProps = {
3
+ label: string;
4
+ items: string[];
5
+ class?: string;
6
+ };
7
+
8
+ let { label, items = [], class: className }: ChartDataListProps = $props();
9
+
10
+ const classes = () => ["st-chartDataList", className].filter(Boolean).join(" ");
11
+ </script>
12
+
13
+ {#if items.length > 0}
14
+ <ul class={classes()} aria-label={`Data values for ${label}`}>
15
+ {#each items as item, i (i)}
16
+ <li>{item}</li>
17
+ {/each}
18
+ </ul>
19
+ {/if}
20
+
21
+ <style>
22
+ .st-chartDataList {
23
+ border: 0;
24
+ clip: rect(0 0 0 0);
25
+ height: 1px;
26
+ margin: -1px;
27
+ overflow: hidden;
28
+ padding: 0;
29
+ position: absolute;
30
+ white-space: nowrap;
31
+ width: 1px;
32
+ }
33
+ </style>
@@ -0,0 +1,9 @@
1
+ type ChartDataListProps = {
2
+ label: string;
3
+ items: string[];
4
+ class?: string;
5
+ };
6
+ declare const ChartDataList: import("svelte").Component<ChartDataListProps, {}, "">;
7
+ type ChartDataList = ReturnType<typeof ChartDataList>;
8
+ export default ChartDataList;
9
+ //# sourceMappingURL=ChartDataList.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartDataList.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ChartDataList.svelte.ts"],"names":[],"mappings":"AAGE,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAqBJ,QAAA,MAAM,aAAa,wDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { Send, Square } from "@lucide/svelte";
3
+ import type { Snippet } from "svelte";
3
4
  import type { HTMLFormAttributes } from "svelte/elements";
4
5
  import Button from "./Button.svelte";
5
6
 
@@ -27,6 +28,9 @@
27
28
  clearOnSubmit?: boolean;
28
29
  onsubmit?: ChatComposerSubmitEvent;
29
30
  onstop?: () => void;
31
+ attachments?: Snippet;
32
+ actionsLeft?: Snippet;
33
+ actionsRight?: Snippet;
30
34
  };
31
35
 
32
36
  let {
@@ -47,6 +51,9 @@
47
51
  clearOnSubmit = true,
48
52
  onsubmit,
49
53
  onstop,
54
+ attachments,
55
+ actionsLeft,
56
+ actionsRight,
50
57
  ...rest
51
58
  }: ChatComposerProps = $props();
52
59
 
@@ -129,15 +136,21 @@
129
136
  onkeydown={handleTextareaKeydown}
130
137
  ></textarea>
131
138
  </div>
132
- <slot name="attachments"></slot>
139
+ {#if attachments}
140
+ {@render attachments()}
141
+ {/if}
133
142
  </div>
134
143
 
135
144
  <div class="st-chatComposer__toolbar">
136
145
  <div class="st-chatComposer__actions st-chatComposer__actions--left">
137
- <slot name="actions-left"></slot>
146
+ {#if actionsLeft}
147
+ {@render actionsLeft()}
148
+ {/if}
138
149
  </div>
139
150
  <div class="st-chatComposer__actions st-chatComposer__actions--right">
140
- <slot name="actions-right"></slot>
151
+ {#if actionsRight}
152
+ {@render actionsRight()}
153
+ {/if}
141
154
  {#if hasActivity() && stoppable && onstop}
142
155
  <Button type="button" variant="danger" onclick={handleStop} aria-label={stopAriaLabel}>
143
156
  <Square size={16} strokeWidth={2} aria-hidden="true" />
@@ -197,6 +210,10 @@
197
210
  outline: none;
198
211
  }
199
212
 
213
+ .st-chatComposer__inputShell:hover .st-chatComposer__textarea:not(:disabled) {
214
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
215
+ }
216
+
200
217
  .st-chatComposer__textarea[aria-disabled="true"] {
201
218
  background: var(--st-component-control-disabledBackground, var(--st-semantic-surface-subtle));
202
219
  color: var(--st-component-control-disabledText, var(--st-semantic-text-muted));
@@ -1,3 +1,4 @@
1
+ import type { Snippet } from "svelte";
1
2
  import type { HTMLFormAttributes } from "svelte/elements";
2
3
  type ChatComposerSubmitEvent = (payload: {
3
4
  message: string;
@@ -22,36 +23,11 @@ type ChatComposerProps = Omit<HTMLFormAttributes, "class" | "onsubmit"> & {
22
23
  clearOnSubmit?: boolean;
23
24
  onsubmit?: ChatComposerSubmitEvent;
24
25
  onstop?: () => void;
26
+ attachments?: Snippet;
27
+ actionsLeft?: Snippet;
28
+ actionsRight?: Snippet;
25
29
  };
26
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
27
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
28
- $$bindings?: Bindings;
29
- } & Exports;
30
- (internal: unknown, props: Props & {
31
- $$events?: Events;
32
- $$slots?: Slots;
33
- }): Exports & {
34
- $set?: any;
35
- $on?: any;
36
- };
37
- z_$$bindings?: Bindings;
38
- }
39
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
40
- default: any;
41
- } ? Props extends Record<string, never> ? any : {
42
- children?: any;
43
- } : {});
44
- declare const ChatComposer: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<ChatComposerProps, {
45
- attachments: {};
46
- 'actions-left': {};
47
- 'actions-right': {};
48
- }>, {
49
- [evt: string]: CustomEvent<any>;
50
- }, {
51
- attachments: {};
52
- 'actions-left': {};
53
- 'actions-right': {};
54
- }, {}, "value">;
55
- type ChatComposer = InstanceType<typeof ChatComposer>;
30
+ declare const ChatComposer: import("svelte").Component<ChatComposerProps, {}, "value">;
31
+ type ChatComposer = ReturnType<typeof ChatComposer>;
56
32
  export default ChatComposer;
57
33
  //# sourceMappingURL=ChatComposer.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatComposer.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ChatComposer.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,KAAK,uBAAuB,GAAG,CAAC,OAAO,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC9B,KAAK,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC;CACrC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE3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,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAiIJ,QAAA,MAAM,YAAY,4DAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -48,6 +48,10 @@
48
48
  0 0 0 2px var(--st-component-control-focusRing, var(--st-semantic-border-interactive)));
49
49
  }
50
50
 
51
+ .st-choice:hover .st-choice__input {
52
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
53
+ }
54
+
51
55
  .st-choice__input[aria-invalid="true"] {
52
56
  accent-color: var(--st-component-control-invalidBorder, var(--st-semantic-feedback-error));
53
57
  outline-color: var(--st-component-control-invalidBorder, var(--st-semantic-feedback-error));
@@ -398,7 +398,7 @@
398
398
  .st-combobox__option:hover:not(:disabled),
399
399
  .st-combobox__option--active {
400
400
  background: var(
401
- --st-component-dropdown-optionHoverBackground,
401
+ --st-component-control-hoverBackground,
402
402
  var(--st-semantic-surface-subtle)
403
403
  );
404
404
  }
@@ -105,6 +105,7 @@
105
105
  }
106
106
 
107
107
  .st-contentSwitcher__option:hover:not([disabled]):not(.st-contentSwitcher__option--selected) {
108
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
108
109
  color: var(--st-semantic-text-primary);
109
110
  }
110
111
 
@@ -396,7 +396,10 @@
396
396
  }
397
397
 
398
398
  .st-dataTable tbody tr:hover {
399
- background: var(--st-component-dataTable-rowHoverBackground, var(--st-semantic-surface-subtle));
399
+ background: var(
400
+ --st-component-control-hoverBackground,
401
+ var(--st-component-dataTable-rowHoverBackground, var(--st-semantic-surface-subtle))
402
+ );
400
403
  }
401
404
 
402
405
  .st-dataTable tbody tr:last-child td {