@sentropic/design-system-svelte 0.10.3 → 0.10.5
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.
- package/dist/AreaChart.svelte +38 -26
- package/dist/AreaChart.svelte.d.ts.map +1 -1
- package/dist/BackToTop.svelte +157 -0
- package/dist/BackToTop.svelte.d.ts +14 -0
- package/dist/BackToTop.svelte.d.ts.map +1 -0
- package/dist/BarChart.svelte +38 -39
- package/dist/BarChart.svelte.d.ts.map +1 -1
- package/dist/Card.svelte +2 -0
- package/dist/ChartDataList.svelte +33 -0
- package/dist/ChartDataList.svelte.d.ts +9 -0
- package/dist/ChartDataList.svelte.d.ts.map +1 -0
- package/dist/ChatComposer.svelte +20 -3
- package/dist/ChatComposer.svelte.d.ts +6 -30
- package/dist/ChatComposer.svelte.d.ts.map +1 -1
- package/dist/ChatMessage.svelte +9 -2
- package/dist/ChatMessage.svelte.d.ts +7 -1
- package/dist/ChatMessage.svelte.d.ts.map +1 -1
- package/dist/Checkbox.svelte +4 -0
- package/dist/Combobox.svelte +1 -1
- package/dist/ContentSwitcher.svelte +1 -0
- package/dist/DataTable.svelte +4 -1
- package/dist/DatePicker.svelte +1 -1
- package/dist/DisplaySettings.svelte +210 -0
- package/dist/DisplaySettings.svelte.d.ts +24 -0
- package/dist/DisplaySettings.svelte.d.ts.map +1 -0
- package/dist/DonutChart.svelte +44 -29
- package/dist/DonutChart.svelte.d.ts.map +1 -1
- package/dist/Dropdown.svelte +1 -1
- package/dist/FileUploader.svelte +2 -2
- package/dist/ForceGraph.svelte +692 -38
- package/dist/ForceGraph.svelte.d.ts +59 -0
- package/dist/ForceGraph.svelte.d.ts.map +1 -1
- package/dist/GraphLegend.svelte +143 -0
- package/dist/GraphLegend.svelte.d.ts +12 -0
- package/dist/GraphLegend.svelte.d.ts.map +1 -0
- package/dist/Header.svelte +2 -1
- package/dist/IconButton.svelte +1 -1
- package/dist/InlineLoading.svelte +10 -1
- package/dist/InlineLoading.svelte.d.ts.map +1 -1
- package/dist/Input.svelte +3 -2
- package/dist/LanguageSelector.svelte +2 -1
- package/dist/LineChart.svelte +38 -26
- package/dist/LineChart.svelte.d.ts.map +1 -1
- package/dist/Link.svelte +7 -1
- package/dist/MediaContent.svelte +124 -0
- package/dist/MediaContent.svelte.d.ts +22 -0
- package/dist/MediaContent.svelte.d.ts.map +1 -0
- package/dist/Menu.svelte +56 -3
- package/dist/Menu.svelte.d.ts.map +1 -1
- package/dist/MessageStatusBadge.svelte +1 -1
- package/dist/MultiSelect.svelte +2 -2
- package/dist/Notification.svelte +150 -0
- package/dist/Notification.svelte.d.ts +17 -0
- package/dist/Notification.svelte.d.ts.map +1 -0
- package/dist/NumberInput.svelte +1 -0
- package/dist/OverflowMenu.svelte +84 -13
- package/dist/OverflowMenu.svelte.d.ts.map +1 -1
- package/dist/Pagination.svelte +7 -0
- package/dist/PaginationNav.svelte +2 -2
- package/dist/ProgressIndicator.svelte +13 -1
- package/dist/ProgressIndicator.svelte.d.ts +1 -0
- package/dist/ProgressIndicator.svelte.d.ts.map +1 -1
- package/dist/Radio.svelte +7 -3
- package/dist/ScatterPlot.svelte +64 -45
- package/dist/ScatterPlot.svelte.d.ts.map +1 -1
- package/dist/Search.svelte +6 -3
- package/dist/Select.svelte +8 -2
- package/dist/SideNav.svelte +6 -0
- package/dist/StackedBarChart.svelte +51 -30
- package/dist/StackedBarChart.svelte.d.ts.map +1 -1
- package/dist/StreamingMessage.svelte +2 -2
- package/dist/Switch.svelte +4 -0
- package/dist/Table.svelte +4 -1
- package/dist/TableOfContents.svelte +109 -0
- package/dist/TableOfContents.svelte.d.ts +16 -0
- package/dist/TableOfContents.svelte.d.ts.map +1 -0
- package/dist/Tag.svelte +1 -1
- package/dist/Textarea.svelte +3 -2
- package/dist/Tile.svelte +4 -0
- package/dist/TileGroup.svelte +4 -0
- package/dist/Toggle.svelte +4 -0
- package/dist/Toggletip.svelte +1 -1
- package/dist/Transcription.svelte +135 -0
- package/dist/Transcription.svelte.d.ts +19 -0
- package/dist/Transcription.svelte.d.ts.map +1 -0
- package/dist/TreeView.svelte +2 -2
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export type ForceGraphTone = "category1" | "category2" | "category3" | "category4" | "category5" | "category6" | "category7" | "category8";
|
|
2
|
+
export type ForceGraphNodeShape = "dot" | "circle" | "diamond" | "star" | "hexagon" | "box" | "square" | "roundedbox" | "triangle";
|
|
3
|
+
/** Stroke dash style for typed edges. */
|
|
4
|
+
export type ForceGraphEdgeDash = "solid" | "dashed" | "dotted" | "long-dash";
|
|
2
5
|
export type ForceGraphNode = {
|
|
3
6
|
/** Stable identifier; referenced by edges. */
|
|
4
7
|
id: string;
|
|
@@ -16,6 +19,11 @@ export type ForceGraphNode = {
|
|
|
16
19
|
/** Pin the node to a fixed position (ignored by the simulation). */
|
|
17
20
|
fx?: number;
|
|
18
21
|
fy?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Visual shape for the node. Defaults to 'dot' (circle).
|
|
24
|
+
* Supported: 'dot'|'circle', 'diamond', 'star', 'hexagon', 'box'|'square', 'triangle'.
|
|
25
|
+
*/
|
|
26
|
+
shape?: ForceGraphNodeShape;
|
|
19
27
|
};
|
|
20
28
|
export type ForceGraphEdge = {
|
|
21
29
|
/** Source node id. */
|
|
@@ -27,9 +35,44 @@ export type ForceGraphEdge = {
|
|
|
27
35
|
/**
|
|
28
36
|
* When true the link renders as a dashed/faded "weak" link. Lets callers
|
|
29
37
|
* map a confidence dimension onto link strength without extra props.
|
|
38
|
+
* Equivalent to `dash: "dashed"` plus a faded stroke (kept for back-compat).
|
|
30
39
|
*/
|
|
31
40
|
weak?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Typed dash pattern for the stroke. Independent of `weak`.
|
|
43
|
+
* "solid" = none, "dashed" = "6 4", "dotted" = "1 4", "long-dash" = "12 6".
|
|
44
|
+
* When omitted, falls back to the `weak` styling.
|
|
45
|
+
*/
|
|
46
|
+
dash?: ForceGraphEdgeDash;
|
|
47
|
+
/**
|
|
48
|
+
* Emphasise the edge (e.g. a reconciliation/match relation) with a thicker,
|
|
49
|
+
* fully-opaque stroke. Defaults to false.
|
|
50
|
+
*/
|
|
51
|
+
emphasis?: boolean;
|
|
52
|
+
/** Explicit stroke width override in px. Takes precedence over `emphasis`. */
|
|
53
|
+
width?: number;
|
|
32
54
|
};
|
|
55
|
+
export type ForceGraphLegendEntry = {
|
|
56
|
+
/** Label shown in the legend. */
|
|
57
|
+
label: string;
|
|
58
|
+
/** Shape for this entry (node legend). Absent = line-style legend entry. */
|
|
59
|
+
shape?: ForceGraphNodeShape;
|
|
60
|
+
/** Tone for this entry. Defaults to category1. */
|
|
61
|
+
tone?: ForceGraphTone;
|
|
62
|
+
/** When true, renders as a dashed line (edge legend). */
|
|
63
|
+
weak?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Typed dash pattern for an edge legend swatch. Independent of `weak`.
|
|
66
|
+
* When set, the swatch line uses the matching dash-array.
|
|
67
|
+
*/
|
|
68
|
+
dash?: ForceGraphEdgeDash;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Maps a dash style (or the legacy `weak` flag) to an SVG stroke-dasharray.
|
|
72
|
+
* Returns null for a solid stroke.
|
|
73
|
+
*/
|
|
74
|
+
export declare function edgeDashArray(dash: ForceGraphEdgeDash | undefined, weak?: boolean): string | null;
|
|
75
|
+
export declare function nodeShapePath(shape: ForceGraphNodeShape | undefined, r: number): string | null;
|
|
33
76
|
type ForceGraphProps = {
|
|
34
77
|
nodes: ForceGraphNode[];
|
|
35
78
|
edges: ForceGraphEdge[];
|
|
@@ -67,6 +110,22 @@ type ForceGraphProps = {
|
|
|
67
110
|
* Fires with the node's stable id.
|
|
68
111
|
*/
|
|
69
112
|
onOpenEntity?: (id: string) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Called when the user hovers an edge.
|
|
115
|
+
* Fires with the edge object (source/target/relation/weak).
|
|
116
|
+
*/
|
|
117
|
+
onEdgeHover?: (edge: ForceGraphEdge) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Legend entries rendered as a corner overlay.
|
|
120
|
+
* Each entry has a label + optional shape (node) or weak (edge).
|
|
121
|
+
*/
|
|
122
|
+
legend?: ForceGraphLegendEntry[];
|
|
123
|
+
/**
|
|
124
|
+
* Edge curvature, 0..1. 0 = straight <line> (back-compat). Larger values
|
|
125
|
+
* bow each edge into a quadratic <path>, offset perpendicular to the chord
|
|
126
|
+
* by `edgeCurve * dist * factor`. Defaults to a light 0.15.
|
|
127
|
+
*/
|
|
128
|
+
edgeCurve?: number;
|
|
70
129
|
class?: string;
|
|
71
130
|
};
|
|
72
131
|
declare const ForceGraph: import("svelte").Component<ForceGraphProps, {}, "">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForceGraph.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ForceGraph.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,cAAc,GAAG;IAC3B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,gEAAgE;IAChE,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ForceGraph.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ForceGraph.svelte.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
// Re-export types so GraphLegend can be used standalone without importing from ForceGraph.
|
|
3
|
+
export type { ForceGraphLegendEntry, ForceGraphNodeShape, ForceGraphTone, ForceGraphEdgeDash } from "./ForceGraph.svelte";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import { nodeShapePath, edgeDashArray } from "./ForceGraph.svelte";
|
|
8
|
+
import type { ForceGraphLegendEntry } from "./ForceGraph.svelte";
|
|
9
|
+
|
|
10
|
+
type GraphLegendProps = {
|
|
11
|
+
entries: ForceGraphLegendEntry[];
|
|
12
|
+
/** Optional heading shown above entries. */
|
|
13
|
+
title?: string;
|
|
14
|
+
class?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
let { entries, title, class: className }: GraphLegendProps = $props();
|
|
18
|
+
|
|
19
|
+
const classes = () =>
|
|
20
|
+
["st-graphLegend", className].filter(Boolean).join(" ");
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div class={classes()} aria-label={title ?? "Graph legend"}>
|
|
24
|
+
{#if title}
|
|
25
|
+
<p class="st-graphLegend__title">{title}</p>
|
|
26
|
+
{/if}
|
|
27
|
+
<ul class="st-graphLegend__list" role="list">
|
|
28
|
+
{#each entries as entry}
|
|
29
|
+
{@const swatchPath = entry.shape !== undefined ? nodeShapePath(entry.shape, 7) : null}
|
|
30
|
+
{@const swatchTone = entry.tone ?? "category1"}
|
|
31
|
+
{@const swatchDash = entry.shape === undefined ? edgeDashArray(entry.dash, entry.weak) : null}
|
|
32
|
+
<li class="st-graphLegend__entry">
|
|
33
|
+
{#if entry.shape !== undefined}
|
|
34
|
+
<svg
|
|
35
|
+
class="st-graphLegend__swatch"
|
|
36
|
+
viewBox="-13 -13 26 26"
|
|
37
|
+
width="16"
|
|
38
|
+
height="16"
|
|
39
|
+
aria-hidden="true"
|
|
40
|
+
>
|
|
41
|
+
{#if swatchPath}
|
|
42
|
+
<path
|
|
43
|
+
d={swatchPath}
|
|
44
|
+
class="st-graphLegend__shape st-graphLegend__shape--{swatchTone}"
|
|
45
|
+
/>
|
|
46
|
+
{:else}
|
|
47
|
+
<circle
|
|
48
|
+
r="7"
|
|
49
|
+
class="st-graphLegend__shape st-graphLegend__shape--{swatchTone}"
|
|
50
|
+
/>
|
|
51
|
+
{/if}
|
|
52
|
+
</svg>
|
|
53
|
+
{:else}
|
|
54
|
+
<svg
|
|
55
|
+
class="st-graphLegend__swatch"
|
|
56
|
+
viewBox="0 0 16 8"
|
|
57
|
+
width="16"
|
|
58
|
+
height="8"
|
|
59
|
+
aria-hidden="true"
|
|
60
|
+
>
|
|
61
|
+
<line
|
|
62
|
+
x1="0"
|
|
63
|
+
y1="4"
|
|
64
|
+
x2="16"
|
|
65
|
+
y2="4"
|
|
66
|
+
class="st-graphLegend__edge"
|
|
67
|
+
class:st-graphLegend__edge--weak={entry.weak}
|
|
68
|
+
stroke-dasharray={swatchDash}
|
|
69
|
+
/>
|
|
70
|
+
</svg>
|
|
71
|
+
{/if}
|
|
72
|
+
<span class="st-graphLegend__label">{entry.label}</span>
|
|
73
|
+
</li>
|
|
74
|
+
{/each}
|
|
75
|
+
</ul>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<style>
|
|
79
|
+
.st-graphLegend {
|
|
80
|
+
background: var(--st-semantic-surface-overlay, rgba(0,0,0,0.45));
|
|
81
|
+
border-radius: var(--st-radius-sm, 0.25rem);
|
|
82
|
+
color: var(--st-semantic-text-inverse, #fff);
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
font-size: 0.6875rem;
|
|
86
|
+
gap: 0.25rem;
|
|
87
|
+
padding: 0.375rem 0.5rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.st-graphLegend__title {
|
|
91
|
+
font-size: 0.625rem;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
letter-spacing: 0.04em;
|
|
94
|
+
margin: 0 0 0.125rem;
|
|
95
|
+
opacity: 0.75;
|
|
96
|
+
text-transform: uppercase;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.st-graphLegend__list {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
gap: 0.25rem;
|
|
103
|
+
list-style: none;
|
|
104
|
+
margin: 0;
|
|
105
|
+
padding: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.st-graphLegend__entry {
|
|
109
|
+
align-items: center;
|
|
110
|
+
display: flex;
|
|
111
|
+
gap: 0.375rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.st-graphLegend__swatch { flex-shrink: 0; }
|
|
115
|
+
|
|
116
|
+
.st-graphLegend__label { white-space: nowrap; }
|
|
117
|
+
|
|
118
|
+
.st-graphLegend__shape {
|
|
119
|
+
fill-opacity: 0.9;
|
|
120
|
+
stroke: var(--st-semantic-surface-default, #fff);
|
|
121
|
+
stroke-width: 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.st-graphLegend__shape--category1 { fill: var(--st-semantic-data-category1); }
|
|
125
|
+
.st-graphLegend__shape--category2 { fill: var(--st-semantic-data-category2); }
|
|
126
|
+
.st-graphLegend__shape--category3 { fill: var(--st-semantic-data-category3); }
|
|
127
|
+
.st-graphLegend__shape--category4 { fill: var(--st-semantic-data-category4); }
|
|
128
|
+
.st-graphLegend__shape--category5 { fill: var(--st-semantic-data-category5); }
|
|
129
|
+
.st-graphLegend__shape--category6 { fill: var(--st-semantic-data-category6); }
|
|
130
|
+
.st-graphLegend__shape--category7 { fill: var(--st-semantic-data-category7); }
|
|
131
|
+
.st-graphLegend__shape--category8 { fill: var(--st-semantic-data-category8); }
|
|
132
|
+
|
|
133
|
+
.st-graphLegend__edge {
|
|
134
|
+
stroke: var(--st-semantic-border-strong, #888);
|
|
135
|
+
stroke-width: 1.5;
|
|
136
|
+
opacity: 0.8;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.st-graphLegend__edge--weak {
|
|
140
|
+
stroke: var(--st-semantic-border-subtle, #aaa);
|
|
141
|
+
opacity: 0.65;
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { ForceGraphLegendEntry, ForceGraphNodeShape, ForceGraphTone, ForceGraphEdgeDash } from "./ForceGraph.svelte";
|
|
2
|
+
import type { ForceGraphLegendEntry } from "./ForceGraph.svelte";
|
|
3
|
+
type GraphLegendProps = {
|
|
4
|
+
entries: ForceGraphLegendEntry[];
|
|
5
|
+
/** Optional heading shown above entries. */
|
|
6
|
+
title?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const GraphLegend: import("svelte").Component<GraphLegendProps, {}, "">;
|
|
10
|
+
type GraphLegend = ReturnType<typeof GraphLegend>;
|
|
11
|
+
export default GraphLegend;
|
|
12
|
+
//# sourceMappingURL=GraphLegend.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphLegend.svelte.d.ts","sourceRoot":"","sources":["../src/lib/GraphLegend.svelte.ts"],"names":[],"mappings":"AAIE,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI5H,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA+CJ,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
package/dist/Header.svelte
CHANGED
|
@@ -256,6 +256,7 @@
|
|
|
256
256
|
|
|
257
257
|
.st-header__account-trigger:hover,
|
|
258
258
|
.st-header__account-trigger:focus-visible {
|
|
259
|
+
background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
|
|
259
260
|
border-color: var(--st-semantic-border-interactive, var(--st-semantic-action-primary));
|
|
260
261
|
outline: none;
|
|
261
262
|
}
|
|
@@ -350,7 +351,7 @@
|
|
|
350
351
|
|
|
351
352
|
.st-header__signin:hover,
|
|
352
353
|
.st-header__signin:focus-visible {
|
|
353
|
-
background: var(--st-semantic-surface-subtle
|
|
354
|
+
background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
|
|
354
355
|
outline: none;
|
|
355
356
|
}
|
|
356
357
|
</style>
|
package/dist/IconButton.svelte
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.st-iconButton:hover:not(:disabled) {
|
|
86
|
-
background: var(--st-component-
|
|
86
|
+
background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
.st-iconButton--secondary:hover:not(:disabled) {
|
|
@@ -8,10 +8,18 @@
|
|
|
8
8
|
class?: string;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
const FALLBACK_LABELS = {
|
|
12
|
+
active: "Loading",
|
|
13
|
+
success: "Completed",
|
|
14
|
+
error: "Error",
|
|
15
|
+
inactive: "Inactive"
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
11
18
|
let {
|
|
12
19
|
label,
|
|
13
20
|
status = "active",
|
|
14
21
|
class: className,
|
|
22
|
+
"aria-label": ariaLabel,
|
|
15
23
|
...rest
|
|
16
24
|
}: InlineLoadingProps = $props();
|
|
17
25
|
|
|
@@ -19,9 +27,10 @@
|
|
|
19
27
|
["st-inlineLoading", `st-inlineLoading--${status}`, className].filter(Boolean).join(" ");
|
|
20
28
|
|
|
21
29
|
const role = () => (status === "error" ? "alert" : "status");
|
|
30
|
+
const accessibleLabel = () => ariaLabel ?? (label ? undefined : FALLBACK_LABELS[status]);
|
|
22
31
|
</script>
|
|
23
32
|
|
|
24
|
-
<div {...rest} class={classes()} role={role()} aria-live="polite">
|
|
33
|
+
<div {...rest} class={classes()} role={role()} aria-label={accessibleLabel()} aria-live="polite">
|
|
25
34
|
<span class="st-inlineLoading__icon" aria-hidden="true">
|
|
26
35
|
{#if status === "active"}
|
|
27
36
|
<span class="st-inlineLoading__spinner">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineLoading.svelte.d.ts","sourceRoot":"","sources":["../src/lib/InlineLoading.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIpD,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,GAAG;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"InlineLoading.svelte.d.ts","sourceRoot":"","sources":["../src/lib/InlineLoading.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIpD,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,GAAG;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA+CJ,QAAA,MAAM,aAAa,wDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
package/dist/Input.svelte
CHANGED
|
@@ -96,8 +96,8 @@
|
|
|
96
96
|
corners → the base Sent Tech field stays a uniform rounded box. */
|
|
97
97
|
border-top-left-radius: var(--st-component-control-anatomy-field-radiusTop, var(--st-component-control-anatomy-shape-radius, 0.375rem));
|
|
98
98
|
border-top-right-radius: var(--st-component-control-anatomy-field-radiusTop, var(--st-component-control-anatomy-shape-radius, 0.375rem));
|
|
99
|
-
border-bottom-right-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
|
|
100
|
-
border-bottom-left-radius: var(--st-component-control-anatomy-shape-radius, 0.375rem);
|
|
99
|
+
border-bottom-right-radius: var(--st-component-control-anatomy-field-radiusBottom, var(--st-component-control-anatomy-shape-radius, 0.375rem));
|
|
100
|
+
border-bottom-left-radius: var(--st-component-control-anatomy-field-radiusBottom, var(--st-component-control-anatomy-shape-radius, 0.375rem));
|
|
101
101
|
/* Bottom rule as a box-shadow inset (anatomy v1.3.0, real DSFR/Carbon
|
|
102
102
|
technique) instead of a border-bottom — keeps the box height honest.
|
|
103
103
|
Fallback = none → the base boxed field draws its rule via the 4 borders. */
|
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
.st-control:hover:not(:disabled) {
|
|
139
|
+
background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
|
|
139
140
|
border-color: var(--st-component-control-hoverBorder, var(--st-semantic-border-strong));
|
|
140
141
|
}
|
|
141
142
|
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
.st-languageSelector__trigger:hover:not(:disabled) {
|
|
107
|
+
background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
|
|
107
108
|
border-color: var(--st-component-control-hoverBorder, var(--st-semantic-border-strong));
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -164,7 +165,7 @@
|
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
.st-languageSelector__option:hover {
|
|
167
|
-
background: var(--st-semantic-surface-subtle);
|
|
168
|
+
background: var(--st-component-control-hoverBackground, var(--st-semantic-surface-subtle));
|
|
168
169
|
color: var(--st-semantic-text-primary);
|
|
169
170
|
}
|
|
170
171
|
|
package/dist/LineChart.svelte
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<script lang="ts">
|
|
19
|
+
import ChartDataList from "./ChartDataList.svelte";
|
|
20
|
+
|
|
19
21
|
type LineChartProps = {
|
|
20
22
|
data: LineChartDatum[];
|
|
21
23
|
width?: number;
|
|
@@ -128,6 +130,8 @@
|
|
|
128
130
|
});
|
|
129
131
|
});
|
|
130
132
|
|
|
133
|
+
const dataValueItems = $derived(data.map((d) => `${d.x}: ${d.y}`));
|
|
134
|
+
|
|
131
135
|
function buildLinearPath(pts: { x: number; y: number }[]): string {
|
|
132
136
|
return pts.map((p, i) => `${i === 0 ? "M" : "L"}${p.x.toFixed(2)},${p.y.toFixed(2)}`).join(" ");
|
|
133
137
|
}
|
|
@@ -190,26 +194,39 @@
|
|
|
190
194
|
return entries;
|
|
191
195
|
});
|
|
192
196
|
|
|
193
|
-
function handleEnter(i: number) {
|
|
194
|
-
hoveredIndex = i;
|
|
195
|
-
}
|
|
196
197
|
function handleLeave() {
|
|
197
198
|
hoveredIndex = null;
|
|
198
199
|
}
|
|
200
|
+
function handleVisualPointerMove(event: PointerEvent) {
|
|
201
|
+
const target = event.target;
|
|
202
|
+
if (!(target instanceof Element)) {
|
|
203
|
+
hoveredIndex = null;
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const index = Number(target.getAttribute("data-chart-index"));
|
|
207
|
+
hoveredIndex = Number.isInteger(index) ? index : null;
|
|
208
|
+
}
|
|
199
209
|
|
|
200
210
|
const classes = () =>
|
|
201
211
|
["st-lineChart", `st-lineChart--${tone}`, className].filter(Boolean).join(" ");
|
|
202
212
|
</script>
|
|
203
213
|
|
|
204
|
-
<div class={classes()}
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
aria-hidden="true"
|
|
214
|
+
<div class={classes()}>
|
|
215
|
+
<div
|
|
216
|
+
class="st-lineChart__visual"
|
|
217
|
+
role="img"
|
|
218
|
+
aria-label={label}
|
|
219
|
+
onpointermove={handleVisualPointerMove}
|
|
220
|
+
onpointerleave={handleLeave}
|
|
212
221
|
>
|
|
222
|
+
<svg
|
|
223
|
+
viewBox="0 0 {width} {height}"
|
|
224
|
+
preserveAspectRatio="xMidYMid meet"
|
|
225
|
+
width="100%"
|
|
226
|
+
height="100%"
|
|
227
|
+
focusable="false"
|
|
228
|
+
aria-hidden="true"
|
|
229
|
+
>
|
|
213
230
|
<!-- gridlines + Y axis ticks -->
|
|
214
231
|
{#each gridLines as g (g.value)}
|
|
215
232
|
<line
|
|
@@ -278,16 +295,13 @@
|
|
|
278
295
|
cx={p.x}
|
|
279
296
|
cy={p.y}
|
|
280
297
|
r="4"
|
|
281
|
-
|
|
282
|
-
role="img"
|
|
283
|
-
aria-label="{p.datum.x}: {p.datum.y}"
|
|
284
|
-
onmouseenter={() => handleEnter(p.index)}
|
|
285
|
-
onmouseleave={handleLeave}
|
|
286
|
-
onfocus={() => handleEnter(p.index)}
|
|
287
|
-
onblur={handleLeave}
|
|
298
|
+
data-chart-index={p.index}
|
|
288
299
|
/>
|
|
289
300
|
{/each}
|
|
290
|
-
|
|
301
|
+
</svg>
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
<ChartDataList {label} items={dataValueItems} />
|
|
291
305
|
|
|
292
306
|
{#if hoveredIndex !== null && points[hoveredIndex]}
|
|
293
307
|
{@const p = points[hoveredIndex]}
|
|
@@ -325,6 +339,10 @@
|
|
|
325
339
|
overflow: visible;
|
|
326
340
|
}
|
|
327
341
|
|
|
342
|
+
.st-lineChart__visual {
|
|
343
|
+
display: block;
|
|
344
|
+
}
|
|
345
|
+
|
|
328
346
|
.st-lineChart__grid {
|
|
329
347
|
stroke: var(--st-component-lineChart-gridStroke, var(--st-semantic-border-subtle));
|
|
330
348
|
stroke-dasharray: 2 3;
|
|
@@ -360,16 +378,10 @@
|
|
|
360
378
|
transition: r 120ms ease;
|
|
361
379
|
}
|
|
362
380
|
|
|
363
|
-
.st-lineChart__dot:hover
|
|
364
|
-
.st-lineChart__dot:focus-visible {
|
|
381
|
+
.st-lineChart__dot:hover {
|
|
365
382
|
r: 5.5;
|
|
366
383
|
}
|
|
367
384
|
|
|
368
|
-
.st-lineChart__dot:focus-visible {
|
|
369
|
-
outline: 2px solid var(--st-semantic-border-interactive);
|
|
370
|
-
outline-offset: 1px;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
385
|
.st-lineChart__tooltip {
|
|
374
386
|
background: var(--st-component-lineChart-tooltipBackground, var(--st-semantic-surface-inverse));
|
|
375
387
|
border-radius: var(--st-radius-sm, 0.25rem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/LineChart.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;
|
|
1
|
+
{"version":3,"file":"LineChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/LineChart.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,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA+OJ,QAAA,MAAM,SAAS,oDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
package/dist/Link.svelte
CHANGED
|
@@ -67,6 +67,9 @@
|
|
|
67
67
|
text-decoration: var(--st-component-link-anatomy-typography-textDecoration, underline);
|
|
68
68
|
text-decoration-thickness: var(--st-component-link-anatomy-typography-decorationThickness, auto);
|
|
69
69
|
text-underline-offset: var(--st-component-link-anatomy-typography-decorationOffset, 0.18em);
|
|
70
|
+
transition-property: color, text-decoration-thickness, text-underline-offset;
|
|
71
|
+
transition-duration: var(--st-motion-normal, 180ms);
|
|
72
|
+
transition-timing-function: var(--st-motion-easing, cubic-bezier(0.4, 0, 0.2, 1));
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
.st-link--standalone {
|
|
@@ -83,8 +86,11 @@
|
|
|
83
86
|
color: var(--st-component-link-anatomy-states-hover-text, var(--st-component-link-hoverText, var(--st-semantic-action-primary)));
|
|
84
87
|
/* Anatomy v1.1.0: hover decoration sourced from states.hover.decoration
|
|
85
88
|
(= link typography textDecorationHover). Carbon: none → underline; DSFR/base:
|
|
86
|
-
underline → underline (no-op). The DSFR animated underline
|
|
89
|
+
underline → underline (no-op). The DSFR animated underline now
|
|
90
|
+
transitions thickness/offset via anatomy-hover vars when provided. */
|
|
87
91
|
text-decoration-line: var(--st-component-link-anatomy-states-hover-decoration, underline);
|
|
92
|
+
text-decoration-thickness: var(--st-component-link-anatomy-typography-decorationThicknessHover, var(--st-component-link-anatomy-typography-decorationThickness, auto));
|
|
93
|
+
text-underline-offset: var(--st-component-link-anatomy-typography-decorationOffsetHover, var(--st-component-link-anatomy-typography-decorationOffset, 0.18em));
|
|
88
94
|
}
|
|
89
95
|
|
|
90
96
|
/* Focus = shared mixin. --st-radius-* fixed to the valid `sm` token (was the
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
type MediaKind = "image" | "video";
|
|
6
|
+
|
|
7
|
+
type MediaContentProps = Omit<HTMLAttributes<HTMLElement>, "children" | "class"> & {
|
|
8
|
+
title?: string;
|
|
9
|
+
caption?: string;
|
|
10
|
+
byline?: string;
|
|
11
|
+
media?: string;
|
|
12
|
+
mediaAlt?: string;
|
|
13
|
+
mediaKind?: MediaKind;
|
|
14
|
+
mediaControls?: boolean;
|
|
15
|
+
aspectRatio?: string;
|
|
16
|
+
mediaCaptions?: string;
|
|
17
|
+
mediaCaptionsLabel?: string;
|
|
18
|
+
mediaCaptionsLang?: string;
|
|
19
|
+
class?: string;
|
|
20
|
+
children?: Snippet;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
title,
|
|
25
|
+
caption,
|
|
26
|
+
byline,
|
|
27
|
+
media,
|
|
28
|
+
mediaAlt = "",
|
|
29
|
+
mediaKind = "image",
|
|
30
|
+
mediaControls = true,
|
|
31
|
+
aspectRatio = "16/9",
|
|
32
|
+
mediaCaptions,
|
|
33
|
+
mediaCaptionsLabel = "Français",
|
|
34
|
+
mediaCaptionsLang = "fr",
|
|
35
|
+
class: className,
|
|
36
|
+
children,
|
|
37
|
+
...rest
|
|
38
|
+
}: MediaContentProps = $props();
|
|
39
|
+
|
|
40
|
+
const defaultCaptions = "data:text/vtt,WEBVTT";
|
|
41
|
+
|
|
42
|
+
const hasMedia = () => Boolean(media?.trim());
|
|
43
|
+
const classes = () => ["st-mediaContent", className].filter(Boolean).join(" ");
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<figure class={classes()} {...rest}>
|
|
47
|
+
<div class="st-mediaContent__media" style={`--st-mediaContent-ratio:${aspectRatio}`}>
|
|
48
|
+
{#if hasMedia()}
|
|
49
|
+
{#if mediaKind === "video"}
|
|
50
|
+
<video controls={mediaControls} src={media} aria-label={title || "Contenu média"} preload="metadata">
|
|
51
|
+
<track
|
|
52
|
+
kind="captions"
|
|
53
|
+
src={mediaCaptions ?? defaultCaptions}
|
|
54
|
+
srclang={mediaCaptionsLang}
|
|
55
|
+
label={mediaCaptionsLabel}
|
|
56
|
+
default
|
|
57
|
+
/>
|
|
58
|
+
</video>
|
|
59
|
+
{:else}
|
|
60
|
+
<img src={media} alt={mediaAlt} loading="lazy" decoding="async" />
|
|
61
|
+
{/if}
|
|
62
|
+
{:else}
|
|
63
|
+
{@render children?.()}
|
|
64
|
+
{/if}
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
{#if title || caption || byline}
|
|
68
|
+
<figcaption class="st-mediaContent__caption">
|
|
69
|
+
{#if title}
|
|
70
|
+
<p class="st-mediaContent__title">{title}</p>
|
|
71
|
+
{/if}
|
|
72
|
+
{#if caption}
|
|
73
|
+
<p>{caption}</p>
|
|
74
|
+
{/if}
|
|
75
|
+
{#if byline}
|
|
76
|
+
<p class="st-mediaContent__byline">{byline}</p>
|
|
77
|
+
{/if}
|
|
78
|
+
</figcaption>
|
|
79
|
+
{/if}
|
|
80
|
+
</figure>
|
|
81
|
+
|
|
82
|
+
<style>
|
|
83
|
+
.st-mediaContent {
|
|
84
|
+
border: 1px solid var(--st-semantic-border-subtle);
|
|
85
|
+
border-radius: 0.5rem;
|
|
86
|
+
margin: 0;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.st-mediaContent__media {
|
|
91
|
+
aspect-ratio: var(--st-mediaContent-ratio);
|
|
92
|
+
background: var(--st-semantic-surface-subtle);
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.st-mediaContent__media > :global(img),
|
|
97
|
+
.st-mediaContent__media > :global(video) {
|
|
98
|
+
block-size: 100%;
|
|
99
|
+
inline-size: 100%;
|
|
100
|
+
object-fit: cover;
|
|
101
|
+
display: block;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.st-mediaContent__caption {
|
|
105
|
+
background: var(--st-semantic-surface-primary);
|
|
106
|
+
color: var(--st-semantic-text-primary);
|
|
107
|
+
font-size: 0.875rem;
|
|
108
|
+
padding: 0.6rem 0.75rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.st-mediaContent__title {
|
|
112
|
+
color: var(--st-semantic-text-primary);
|
|
113
|
+
font-weight: 600;
|
|
114
|
+
margin: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.st-mediaContent__caption p {
|
|
118
|
+
margin: 0.25rem 0 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.st-mediaContent__byline {
|
|
122
|
+
color: var(--st-semantic-text-secondary);
|
|
123
|
+
}
|
|
124
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
type MediaKind = "image" | "video";
|
|
4
|
+
type MediaContentProps = Omit<HTMLAttributes<HTMLElement>, "children" | "class"> & {
|
|
5
|
+
title?: string;
|
|
6
|
+
caption?: string;
|
|
7
|
+
byline?: string;
|
|
8
|
+
media?: string;
|
|
9
|
+
mediaAlt?: string;
|
|
10
|
+
mediaKind?: MediaKind;
|
|
11
|
+
mediaControls?: boolean;
|
|
12
|
+
aspectRatio?: string;
|
|
13
|
+
mediaCaptions?: string;
|
|
14
|
+
mediaCaptionsLabel?: string;
|
|
15
|
+
mediaCaptionsLang?: string;
|
|
16
|
+
class?: string;
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
};
|
|
19
|
+
declare const MediaContent: import("svelte").Component<MediaContentProps, {}, "">;
|
|
20
|
+
type MediaContent = ReturnType<typeof MediaContent>;
|
|
21
|
+
export default MediaContent;
|
|
22
|
+
//# sourceMappingURL=MediaContent.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaContent.svelte.d.ts","sourceRoot":"","sources":["../src/lib/MediaContent.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,KAAK,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnC,KAAK,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAgEJ,QAAA,MAAM,YAAY,uDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|