@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
@@ -12,6 +12,8 @@
12
12
  </script>
13
13
 
14
14
  <script lang="ts">
15
+ import ChartDataList from "./ChartDataList.svelte";
16
+
15
17
  type ScatterPlotProps = {
16
18
  data: ScatterPlotDatum[];
17
19
  width?: number;
@@ -95,51 +97,69 @@
95
97
  }));
96
98
  });
97
99
 
100
+ const dataValueItems = $derived(
101
+ data.map((d) => (d.label ? `${d.label}: x ${d.x}, y ${d.y}` : `x ${d.x}, y ${d.y}`))
102
+ );
103
+
104
+ function handleVisualPointerMove(event: PointerEvent) {
105
+ const target = event.target;
106
+ if (!(target instanceof Element)) {
107
+ hoveredIndex = null;
108
+ return;
109
+ }
110
+ const index = Number(target.getAttribute("data-chart-index"));
111
+ hoveredIndex = Number.isInteger(index) ? index : null;
112
+ }
113
+
98
114
  const classes = () => ["st-scatterPlot", className].filter(Boolean).join(" ");
99
115
  </script>
100
116
 
101
- <div class={classes()} role="img" aria-label={label}>
102
- <svg viewBox="0 0 {width} {height}" preserveAspectRatio="xMidYMid meet" width="100%" height="100%" focusable="false" aria-hidden="true">
103
- <!-- gridlines + ticks Y -->
104
- {#each scales.yTicks as t (t)}
105
- {@const y = MARGIN.top + scaleLinear(t, scales.yMin, scales.yMax, scales.plotH, 0)}
106
- <line class="st-scatterPlot__grid" x1={MARGIN.left} x2={width - MARGIN.right} y1={y} y2={y} />
107
- <text class="st-scatterPlot__tick" x={MARGIN.left - 6} y={y} text-anchor="end" dominant-baseline="middle">{fmt(t)}</text>
108
- {/each}
109
- <!-- ticks X -->
110
- {#each scales.xTicks as t (t)}
111
- {@const x = MARGIN.left + scaleLinear(t, scales.xMin, scales.xMax, 0, scales.plotW)}
112
- <text class="st-scatterPlot__tick" x={x} y={height - MARGIN.bottom + 16} text-anchor="middle">{fmt(t)}</text>
113
- {/each}
114
-
115
- <!-- axes -->
116
- <line class="st-scatterPlot__axis" x1={MARGIN.left} x2={MARGIN.left} y1={MARGIN.top} y2={height - MARGIN.bottom} />
117
- <line class="st-scatterPlot__axis" x1={MARGIN.left} x2={width - MARGIN.right} y1={height - MARGIN.bottom} y2={height - MARGIN.bottom} />
118
-
119
- {#if xLabel}
120
- <text class="st-scatterPlot__axisLabel" x={MARGIN.left + scales.plotW / 2} y={height - 4} text-anchor="middle">{xLabel}</text>
121
- {/if}
122
- {#if yLabel}
123
- <text class="st-scatterPlot__axisLabel" x={12} y={MARGIN.top + scales.plotH / 2} text-anchor="middle" transform="rotate(-90 12 {MARGIN.top + scales.plotH / 2})">{yLabel}</text>
124
- {/if}
125
-
126
- <!-- points -->
127
- {#each points as p, i (i)}
128
- <circle
129
- class="st-scatterPlot__point st-scatterPlot__point--{p.tone}"
130
- cx={p.cx}
131
- cy={p.cy}
132
- r={radius}
133
- tabindex="0"
134
- role="img"
135
- aria-label="{p.datum.label ? p.datum.label + ': ' : ''}x {p.datum.x}, y {p.datum.y}"
136
- onmouseenter={() => (hoveredIndex = i)}
137
- onmouseleave={() => (hoveredIndex = null)}
138
- onfocus={() => (hoveredIndex = i)}
139
- onblur={() => (hoveredIndex = null)}
140
- />
141
- {/each}
142
- </svg>
117
+ <div class={classes()}>
118
+ <div
119
+ class="st-scatterPlot__visual"
120
+ role="img"
121
+ aria-label={label}
122
+ onpointermove={handleVisualPointerMove}
123
+ onpointerleave={() => (hoveredIndex = null)}
124
+ >
125
+ <svg viewBox="0 0 {width} {height}" preserveAspectRatio="xMidYMid meet" width="100%" height="100%" focusable="false" aria-hidden="true">
126
+ <!-- gridlines + ticks Y -->
127
+ {#each scales.yTicks as t (t)}
128
+ {@const y = MARGIN.top + scaleLinear(t, scales.yMin, scales.yMax, scales.plotH, 0)}
129
+ <line class="st-scatterPlot__grid" x1={MARGIN.left} x2={width - MARGIN.right} y1={y} y2={y} />
130
+ <text class="st-scatterPlot__tick" x={MARGIN.left - 6} y={y} text-anchor="end" dominant-baseline="middle">{fmt(t)}</text>
131
+ {/each}
132
+ <!-- ticks X -->
133
+ {#each scales.xTicks as t (t)}
134
+ {@const x = MARGIN.left + scaleLinear(t, scales.xMin, scales.xMax, 0, scales.plotW)}
135
+ <text class="st-scatterPlot__tick" x={x} y={height - MARGIN.bottom + 16} text-anchor="middle">{fmt(t)}</text>
136
+ {/each}
137
+
138
+ <!-- axes -->
139
+ <line class="st-scatterPlot__axis" x1={MARGIN.left} x2={MARGIN.left} y1={MARGIN.top} y2={height - MARGIN.bottom} />
140
+ <line class="st-scatterPlot__axis" x1={MARGIN.left} x2={width - MARGIN.right} y1={height - MARGIN.bottom} y2={height - MARGIN.bottom} />
141
+
142
+ {#if xLabel}
143
+ <text class="st-scatterPlot__axisLabel" x={MARGIN.left + scales.plotW / 2} y={height - 4} text-anchor="middle">{xLabel}</text>
144
+ {/if}
145
+ {#if yLabel}
146
+ <text class="st-scatterPlot__axisLabel" x={12} y={MARGIN.top + scales.plotH / 2} text-anchor="middle" transform="rotate(-90 12 {MARGIN.top + scales.plotH / 2})">{yLabel}</text>
147
+ {/if}
148
+
149
+ <!-- points -->
150
+ {#each points as p, i (i)}
151
+ <circle
152
+ class="st-scatterPlot__point st-scatterPlot__point--{p.tone}"
153
+ cx={p.cx}
154
+ cy={p.cy}
155
+ r={radius}
156
+ data-chart-index={i}
157
+ />
158
+ {/each}
159
+ </svg>
160
+ </div>
161
+
162
+ <ChartDataList {label} items={dataValueItems} />
143
163
 
144
164
  {#if hoveredIndex !== null && points[hoveredIndex]}
145
165
  {@const p = points[hoveredIndex]}
@@ -152,14 +172,13 @@
152
172
 
153
173
  <style>
154
174
  .st-scatterPlot { color: var(--st-semantic-text-secondary); display: block; font-family: inherit; position: relative; width: 100%; }
155
- .st-scatterPlot svg { display: block; overflow: visible; }
175
+ .st-scatterPlot svg, .st-scatterPlot__visual { display: block; overflow: visible; }
156
176
  .st-scatterPlot__grid { stroke: var(--st-semantic-border-subtle); stroke-dasharray: 2 3; stroke-width: 1; opacity: 0.7; }
157
177
  .st-scatterPlot__axis { stroke: var(--st-semantic-border-subtle); stroke-width: 1; }
158
178
  .st-scatterPlot__tick { fill: var(--st-semantic-text-secondary); font-size: 0.6875rem; }
159
179
  .st-scatterPlot__axisLabel { fill: var(--st-semantic-text-secondary); font-size: 0.75rem; font-weight: 600; }
160
180
  .st-scatterPlot__point { cursor: pointer; fill-opacity: 0.85; transition: fill-opacity 120ms ease, r 120ms ease; }
161
- .st-scatterPlot__point:hover, .st-scatterPlot__point:focus-visible { fill-opacity: 1; }
162
- .st-scatterPlot__point:focus-visible { outline: 2px solid var(--st-semantic-border-interactive); outline-offset: 1px; }
181
+ .st-scatterPlot__point:hover { fill-opacity: 1; }
163
182
  .st-scatterPlot__point--category1 { fill: var(--st-semantic-data-category1); }
164
183
  .st-scatterPlot__point--category2 { fill: var(--st-semantic-data-category2); }
165
184
  .st-scatterPlot__point--category3 { fill: var(--st-semantic-data-category3); }
@@ -1 +1 @@
1
- {"version":3,"file":"ScatterPlot.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ScatterPlot.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,eAAe,GACvB,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GACrD,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA6HJ,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ScatterPlot.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ScatterPlot.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,eAAe,GACvB,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GACrD,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB,CAAC;AAMF,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgJJ,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -121,14 +121,17 @@
121
121
  the Input field box); bottom corners keep the field shape radius. */
122
122
  border-top-left-radius: var(--st-component-control-anatomy-field-radiusTop, var(--st-component-control-anatomy-shape-radius, 0.375rem));
123
123
  border-top-right-radius: var(--st-component-control-anatomy-field-radiusTop, var(--st-component-control-anatomy-shape-radius, 0.375rem));
124
- border-bottom-right-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
125
- border-bottom-left-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
124
+ border-bottom-right-radius: var(--st-component-control-anatomy-field-radiusBottom, var(--st-component-control-anatomy-shape-radius, 0.375rem));
125
+ border-bottom-left-radius: var(--st-component-control-anatomy-field-radiusBottom, var(--st-component-control-anatomy-shape-radius, 0.375rem));
126
126
  color: var(--st-component-control-text, var(--st-semantic-text-primary));
127
127
  display: inline-flex;
128
128
  /* P-D: field-box padding + input typography per theme. Default = the prior
129
129
  render (0 padding on the wrapper, inherited 16px / `normal` typography);
130
130
  DSFR pads 8/16px, Carbon 0/40px to match the measured reference input. */
131
- padding: var(--st-component-search-paddingBlock, 0) var(--st-component-search-paddingInline, 0);
131
+ padding: var(--st-component-search-paddingBlock, 0)
132
+ var(--st-component-search-paddingRight, var(--st-component-search-paddingInline, 0))
133
+ var(--st-component-search-paddingBlock, 0)
134
+ var(--st-component-search-paddingLeft, var(--st-component-search-paddingInline, 0));
132
135
  font-size: var(--st-component-search-fontSize, 1rem);
133
136
  line-height: var(--st-component-search-lineHeight, normal);
134
137
  letter-spacing: var(--st-component-search-letterSpacing, normal);
@@ -109,8 +109,8 @@
109
109
  rounded box with no underline shadow → base Sent Tech unchanged. */
110
110
  border-top-left-radius: var(--st-component-control-anatomy-field-radiusTop, var(--st-component-control-anatomy-shape-radius, 0.375rem));
111
111
  border-top-right-radius: var(--st-component-control-anatomy-field-radiusTop, var(--st-component-control-anatomy-shape-radius, 0.375rem));
112
- border-bottom-right-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
113
- border-bottom-left-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
112
+ border-bottom-right-radius: var(--st-component-control-anatomy-field-radiusBottom, var(--st-component-control-anatomy-shape-radius, 0.375rem));
113
+ border-bottom-left-radius: var(--st-component-control-anatomy-field-radiusBottom, var(--st-component-control-anatomy-shape-radius, 0.375rem));
114
114
  box-shadow: var(--st-component-control-anatomy-field-underline, none);
115
115
  color: var(--st-component-control-text, var(--st-semantic-text-primary));
116
116
  font-family: var(--st-component-control-anatomy-typography-family, inherit);
@@ -136,6 +136,12 @@
136
136
  width: 100%;
137
137
  }
138
138
 
139
+ .st-select:hover {
140
+ background:
141
+ var(--st-component-control-anatomy-field-selectChevron, none),
142
+ var(--st-component-control-hoverBackground, var(--st-component-control-anatomy-field-fillBg, var(--st-component-control-background, var(--st-semantic-surface-default))));
143
+ }
144
+
139
145
  .st-select--sm {
140
146
  min-height: var(--st-component-control-smHeight, 2rem);
141
147
  }
@@ -55,6 +55,12 @@
55
55
  text-decoration: none;
56
56
  }
57
57
 
58
+ .st-sidenav a:hover:not(:focus-visible):not(.st-sidenav__link--active),
59
+ .st-sidenav a:focus-visible:not(.st-sidenav__link--active) {
60
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
61
+ outline: none;
62
+ }
63
+
58
64
  .st-sidenav__link--active {
59
65
  background: var(--st-component-sideNav-activeBackground, var(--st-semantic-surface-subtle));
60
66
  color: var(--st-component-sideNav-activeText, var(--st-semantic-text-primary));
@@ -16,6 +16,8 @@
16
16
  </script>
17
17
 
18
18
  <script lang="ts">
19
+ import ChartDataList from "./ChartDataList.svelte";
20
+
19
21
  type StackedBarChartProps = {
20
22
  data: StackedBarDatum[];
21
23
  width?: number;
@@ -98,38 +100,58 @@
98
100
  });
99
101
  });
100
102
 
103
+ const dataValueItems = $derived(
104
+ data.flatMap((bar) => bar.segments.map((seg) => `${bar.label}, ${seg.label}: ${seg.value}`))
105
+ );
106
+
107
+ function handleVisualPointerMove(event: PointerEvent) {
108
+ const target = event.target;
109
+ if (!(target instanceof Element)) {
110
+ hovered = null;
111
+ return;
112
+ }
113
+ const bar = Number(target.getAttribute("data-bar-index"));
114
+ const seg = Number(target.getAttribute("data-segment-index"));
115
+ hovered = Number.isInteger(bar) && Number.isInteger(seg) ? { bar, seg } : null;
116
+ }
117
+
101
118
  const classes = () => ["st-stackedBar", className].filter(Boolean).join(" ");
102
119
  </script>
103
120
 
104
- <div class={classes()} role="img" aria-label={label}>
105
- <svg viewBox="0 0 {width} {height}" preserveAspectRatio="xMidYMid meet" width="100%" height="100%" focusable="false" aria-hidden="true">
106
- {#each scales.ticks as t (t)}
107
- {@const y = MARGIN.top + scaleLinear(t, 0, scales.domainMax, scales.plotH, 0)}
108
- <line class="st-stackedBar__grid" x1={MARGIN.left} x2={width - MARGIN.right} y1={y} y2={y} />
109
- <text class="st-stackedBar__tick" x={MARGIN.left - 6} y={y} text-anchor="end" dominant-baseline="middle">{fmt(t)}</text>
110
- {/each}
111
-
112
- <line class="st-stackedBar__axis" x1={MARGIN.left} x2={MARGIN.left} y1={MARGIN.top} y2={height - MARGIN.bottom} />
113
- <line class="st-stackedBar__axis" x1={MARGIN.left} x2={width - MARGIN.right} y1={height - MARGIN.bottom} y2={height - MARGIN.bottom} />
114
-
115
- {#each bars as bar, bi (bar.label)}
116
- <text class="st-stackedBar__categoryLabel" x={bar.cxLabel} y={height - MARGIN.bottom + 16} text-anchor="middle">{bar.label}</text>
117
- {#each bar.segs as s, si (s.seg.label)}
118
- <rect
119
- class="st-stackedBar__seg st-stackedBar__seg--{s.tone}"
120
- class:st-stackedBar__seg--dim={hovered !== null && !(hovered.bar === bi && hovered.seg === si)}
121
- x={s.x} y={s.y} width={s.width} height={s.height}
122
- tabindex="0"
123
- role="img"
124
- aria-label="{bar.label} — {s.seg.label}: {s.seg.value}"
125
- onmouseenter={() => (hovered = { bar: bi, seg: si })}
126
- onmouseleave={() => (hovered = null)}
127
- onfocus={() => (hovered = { bar: bi, seg: si })}
128
- onblur={() => (hovered = null)}
129
- />
121
+ <div class={classes()}>
122
+ <div
123
+ class="st-stackedBar__visual"
124
+ role="img"
125
+ aria-label={label}
126
+ onpointermove={handleVisualPointerMove}
127
+ onpointerleave={() => (hovered = null)}
128
+ >
129
+ <svg viewBox="0 0 {width} {height}" preserveAspectRatio="xMidYMid meet" width="100%" height="100%" focusable="false" aria-hidden="true">
130
+ {#each scales.ticks as t (t)}
131
+ {@const y = MARGIN.top + scaleLinear(t, 0, scales.domainMax, scales.plotH, 0)}
132
+ <line class="st-stackedBar__grid" x1={MARGIN.left} x2={width - MARGIN.right} y1={y} y2={y} />
133
+ <text class="st-stackedBar__tick" x={MARGIN.left - 6} y={y} text-anchor="end" dominant-baseline="middle">{fmt(t)}</text>
130
134
  {/each}
131
- {/each}
132
- </svg>
135
+
136
+ <line class="st-stackedBar__axis" x1={MARGIN.left} x2={MARGIN.left} y1={MARGIN.top} y2={height - MARGIN.bottom} />
137
+ <line class="st-stackedBar__axis" x1={MARGIN.left} x2={width - MARGIN.right} y1={height - MARGIN.bottom} y2={height - MARGIN.bottom} />
138
+
139
+ {#each bars as bar, bi (bar.label)}
140
+ <text class="st-stackedBar__categoryLabel" x={bar.cxLabel} y={height - MARGIN.bottom + 16} text-anchor="middle">{bar.label}</text>
141
+ {#each bar.segs as s, si (s.seg.label)}
142
+ <rect
143
+ class="st-stackedBar__seg st-stackedBar__seg--{s.tone}"
144
+ class:st-stackedBar__seg--dim={hovered !== null && !(hovered.bar === bi && hovered.seg === si)}
145
+ x={s.x} y={s.y} width={s.width} height={s.height}
146
+ data-bar-index={bi}
147
+ data-segment-index={si}
148
+ />
149
+ {/each}
150
+ {/each}
151
+ </svg>
152
+ </div>
153
+
154
+ <ChartDataList {label} items={dataValueItems} />
133
155
 
134
156
  {#if hovered && bars[hovered.bar]?.segs[hovered.seg]}
135
157
  {@const s = bars[hovered.bar].segs[hovered.seg]}
@@ -153,13 +175,12 @@
153
175
 
154
176
  <style>
155
177
  .st-stackedBar { color: var(--st-semantic-text-secondary); display: block; font-family: inherit; position: relative; width: 100%; }
156
- .st-stackedBar svg { display: block; overflow: visible; }
178
+ .st-stackedBar svg, .st-stackedBar__visual { display: block; overflow: visible; }
157
179
  .st-stackedBar__grid { stroke: var(--st-semantic-border-subtle); stroke-dasharray: 2 3; stroke-width: 1; opacity: 0.7; }
158
180
  .st-stackedBar__axis { stroke: var(--st-semantic-border-subtle); stroke-width: 1; }
159
181
  .st-stackedBar__tick, .st-stackedBar__categoryLabel { fill: var(--st-semantic-text-secondary); font-size: 0.6875rem; }
160
182
  .st-stackedBar__seg { cursor: pointer; stroke: var(--st-semantic-surface-default, #fff); stroke-width: 1; transition: opacity 120ms ease; }
161
183
  .st-stackedBar__seg--dim { opacity: 0.45; }
162
- .st-stackedBar__seg:focus-visible { outline: 2px solid var(--st-semantic-border-interactive); outline-offset: 1px; }
163
184
  .st-stackedBar__seg--category1 { fill: var(--st-semantic-data-category1); }
164
185
  .st-stackedBar__seg--category2 { fill: var(--st-semantic-data-category2); }
165
186
  .st-stackedBar__seg--category3 { fill: var(--st-semantic-data-category3); }
@@ -1 +1 @@
1
- {"version":3,"file":"StackedBarChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/StackedBarChart.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,cAAc,GACtB,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GACrD,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA6HJ,QAAA,MAAM,eAAe,0DAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"StackedBarChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/StackedBarChart.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,cAAc,GACtB,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GACrD,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC;AAMF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAiJJ,QAAA,MAAM,eAAe,0DAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -200,7 +200,7 @@
200
200
  {#each toolCalls() as toolCall}
201
201
  <li>
202
202
  <span>{toolCall.toolName}</span>
203
- <span> {toolCall.status}</span>
203
+ <span>: {toolCall.status}</span>
204
204
  </li>
205
205
  {/each}
206
206
  </ul>
@@ -245,7 +245,7 @@
245
245
  </ChatMessage>
246
246
 
247
247
  <style>
248
- .st-streamingMessage {
248
+ :global(.st-streamingMessage) {
249
249
  position: relative;
250
250
  }
251
251
 
@@ -66,6 +66,10 @@
66
66
  background: var(--st-component-selection-switchTrackChecked, var(--st-semantic-action-primary));
67
67
  }
68
68
 
69
+ .st-switch__input:not(:disabled):not(:checked):hover + .st-switch__track {
70
+ background: var(--st-component-control-hoverBackground, var(--st-component-selection-switchTrack));
71
+ }
72
+
69
73
  .st-switch__input:checked + .st-switch__track .st-switch__thumb {
70
74
  transform: translateX(calc(var(--st-component-selection-toggleTrackWidth, 2.25rem) - var(--st-component-selection-toggleThumbSize, 1rem) - 2 * var(--st-component-selection-toggleTrackPadding, 0.125rem)));
71
75
  }
package/dist/Table.svelte CHANGED
@@ -87,7 +87,10 @@
87
87
  }
88
88
 
89
89
  .st-table tbody tr:hover {
90
- background: var(--st-component-dataTable-rowHoverBackground, var(--st-semantic-surface-subtle));
90
+ background: var(
91
+ --st-component-control-hoverBackground,
92
+ var(--st-component-dataTable-rowHoverBackground, var(--st-semantic-surface-subtle))
93
+ );
91
94
  }
92
95
 
93
96
  .st-table tbody tr:last-child td {
@@ -0,0 +1,109 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+
4
+ export interface TableOfContentsItem {
5
+ id: string;
6
+ label: string;
7
+ level?: number;
8
+ }
9
+
10
+ type TableOfContentsProps = Omit<HTMLAttributes<HTMLElement>, "class" | "items"> & {
11
+ title?: string;
12
+ items: TableOfContentsItem[];
13
+ activeId?: string;
14
+ class?: string;
15
+ };
16
+
17
+ const normalizeItemId = (value: string) => value.replace(/^#/, "");
18
+
19
+ let {
20
+ title,
21
+ items,
22
+ activeId = "",
23
+ class: className,
24
+ ...rest
25
+ }: TableOfContentsProps = $props();
26
+
27
+ const normalizedActive = () => normalizeItemId(activeId);
28
+ const normalizedItems = () =>
29
+ items.map((item) => ({
30
+ ...item,
31
+ id: normalizeItemId(item.id),
32
+ level: Math.max(item.level ?? 1, 1)
33
+ }));
34
+
35
+ const classes = () => ["st-tableOfContents", className].filter(Boolean).join(" ");
36
+ </script>
37
+
38
+ <nav {...rest} class={classes()} aria-label={title ?? "Table des matières"}>
39
+ {#if title}
40
+ <p class="st-tableOfContents__title">{title}</p>
41
+ {/if}
42
+ <ol class="st-tableOfContents__list">
43
+ {#each normalizedItems() as item (item.id)}
44
+ {@const isActive = item.id === normalizedActive()}
45
+ <li
46
+ class="st-tableOfContents__item"
47
+ style={`--st-tableOfContents-level:${item.level - 1}`}
48
+ >
49
+ <a
50
+ class="st-tableOfContents__link"
51
+ href={`#${item.id}`}
52
+ aria-current={isActive ? "location" : undefined}
53
+ >
54
+ {item.label}
55
+ </a>
56
+ </li>
57
+ {/each}
58
+ </ol>
59
+ </nav>
60
+
61
+ <style>
62
+ .st-tableOfContents {
63
+ border: 1px solid var(--st-semantic-border-subtle);
64
+ border-radius: 0.5rem;
65
+ padding: 0.75rem 0.875rem;
66
+ }
67
+
68
+ .st-tableOfContents__title {
69
+ color: var(--st-semantic-text-primary);
70
+ font-size: 0.8125rem;
71
+ font-weight: 600;
72
+ margin-bottom: 0.5rem;
73
+ text-transform: uppercase;
74
+ }
75
+
76
+ .st-tableOfContents__list {
77
+ list-style: none;
78
+ margin: 0;
79
+ padding-left: 0;
80
+ }
81
+
82
+ .st-tableOfContents__item {
83
+ padding-inline-start: calc(var(--st-tableOfContents-level) * var(--st-spacing-4, 1rem));
84
+ }
85
+
86
+ .st-tableOfContents__item + .st-tableOfContents__item {
87
+ margin-top: 0.125rem;
88
+ }
89
+
90
+ .st-tableOfContents__link {
91
+ color: var(--st-semantic-text-secondary);
92
+ display: inline-block;
93
+ padding: 0.25rem 0;
94
+ text-decoration: none;
95
+ }
96
+
97
+ .st-tableOfContents__link:hover,
98
+ .st-tableOfContents__link:focus-visible {
99
+ color: var(--st-semantic-text-primary);
100
+ text-decoration: underline;
101
+ text-underline-offset: 0.15em;
102
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
103
+ }
104
+
105
+ .st-tableOfContents__link[aria-current="location"] {
106
+ color: var(--st-semantic-text-primary);
107
+ font-weight: 600;
108
+ }
109
+ </style>
@@ -0,0 +1,16 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ export interface TableOfContentsItem {
3
+ id: string;
4
+ label: string;
5
+ level?: number;
6
+ }
7
+ type TableOfContentsProps = Omit<HTMLAttributes<HTMLElement>, "class" | "items"> & {
8
+ title?: string;
9
+ items: TableOfContentsItem[];
10
+ activeId?: string;
11
+ class?: string;
12
+ };
13
+ declare const TableOfContents: import("svelte").Component<TableOfContentsProps, {}, "">;
14
+ type TableOfContents = ReturnType<typeof TableOfContents>;
15
+ export default TableOfContents;
16
+ //# sourceMappingURL=TableOfContents.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableOfContents.svelte.d.ts","sourceRoot":"","sources":["../src/lib/TableOfContents.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA+CJ,QAAA,MAAM,eAAe,0DAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
package/dist/Tag.svelte CHANGED
@@ -135,7 +135,7 @@
135
135
  }
136
136
 
137
137
  .st-tag__dismiss:hover:not(:disabled) {
138
- background: color-mix(in srgb, currentColor 18%, transparent);
138
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
139
139
  }
140
140
 
141
141
  .st-tag__dismiss:focus-visible {
@@ -93,8 +93,8 @@
93
93
  rounded box with no underline shadow → base Sent Tech unchanged. */
94
94
  border-top-left-radius: var(--st-component-control-anatomy-field-radiusTop, var(--st-component-control-anatomy-shape-radius, 0.375rem));
95
95
  border-top-right-radius: var(--st-component-control-anatomy-field-radiusTop, var(--st-component-control-anatomy-shape-radius, 0.375rem));
96
- border-bottom-right-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
97
- border-bottom-left-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
96
+ border-bottom-right-radius: var(--st-component-control-anatomy-field-radiusBottom, var(--st-component-control-anatomy-shape-radius, 0.375rem));
97
+ border-bottom-left-radius: var(--st-component-control-anatomy-field-radiusBottom, var(--st-component-control-anatomy-shape-radius, 0.375rem));
98
98
  box-shadow: var(--st-component-control-anatomy-field-underline, none);
99
99
  color: var(--st-component-control-text, var(--st-semantic-text-primary));
100
100
  font-family: var(--st-component-control-anatomy-typography-family, inherit);
@@ -117,6 +117,7 @@
117
117
  }
118
118
 
119
119
  .st-textarea:hover:not(:disabled) {
120
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
120
121
  border-color: var(--st-component-control-hoverBorder, var(--st-semantic-border-strong));
121
122
  }
122
123
 
package/dist/Tile.svelte CHANGED
@@ -115,6 +115,10 @@
115
115
 
116
116
  .st-tile--clickable:hover:not(.st-tile--disabled),
117
117
  .st-tile--selectable:hover:not(.st-tile--disabled) {
118
+ background: var(
119
+ --st-component-control-hoverBackground,
120
+ var(--st-semantic-surface-subtle)
121
+ );
118
122
  border-color: var(--st-component-control-hoverBorder, var(--st-semantic-border-strong));
119
123
  }
120
124
 
@@ -134,6 +134,10 @@
134
134
  }
135
135
 
136
136
  .st-tileGroup__tile:hover:not(.st-tileGroup__tile--disabled) {
137
+ background: var(
138
+ --st-component-control-hoverBackground,
139
+ var(--st-semantic-surface-subtle)
140
+ );
137
141
  border-color: var(
138
142
  --st-component-control-hoverBorder,
139
143
  var(--st-semantic-border-strong)
@@ -106,6 +106,10 @@
106
106
  background: var(--st-component-selection-switchTrackChecked, var(--st-semantic-action-primary));
107
107
  }
108
108
 
109
+ .st-toggle__input:not(:disabled):not(:checked):hover + .st-toggle__track {
110
+ background: var(--st-component-control-hoverBackground, var(--st-component-selection-switchTrack));
111
+ }
112
+
109
113
  .st-toggle__input:checked + .st-toggle__track .st-toggle__thumb {
110
114
  transform: translateX(calc(var(--st-toggle-trackWidth, 2.25rem) - var(--st-toggle-thumbSize, 1rem) - 2 * var(--st-component-selection-toggleTrackPadding, 0.125rem)));
111
115
  }
@@ -90,7 +90,7 @@
90
90
  }
91
91
 
92
92
  .st-toggletip__trigger:hover {
93
- background: var(--st-semantic-border-strong);
93
+ background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
94
94
  }
95
95
 
96
96
  /* Focus = stratégie d'anatomie partagée (outline DSFR / inset Carbon / ring base). */