@happyvertical/smrt-ui 0.55.24 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -0
- package/dist/charts/Chart.svelte +285 -0
- package/dist/charts/Chart.svelte.d.ts +15 -0
- package/dist/charts/Chart.svelte.d.ts.map +1 -0
- package/dist/charts/format.d.ts +13 -0
- package/dist/charts/format.d.ts.map +1 -0
- package/dist/charts/format.js +48 -0
- package/dist/charts/index.d.ts +5 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +2 -0
- package/dist/charts/strings.d.ts +10 -0
- package/dist/charts/strings.d.ts.map +1 -0
- package/dist/charts/strings.js +10 -0
- package/dist/charts/types.d.ts +13 -0
- package/dist/charts/types.d.ts.map +1 -0
- package/dist/charts/types.js +1 -0
- package/dist/components/data/DataTable.svelte +1 -1
- package/dist/components/feedback/ConfirmDialog.svelte +1 -1
- package/dist/components/forms/Radio.svelte +1 -1
- package/dist/components/forms/SegmentedControl.svelte +1 -1
- package/dist/components/forms/Textarea.svelte +1 -1
- package/dist/components/layout/EmptyState.svelte +2 -2
- package/dist/components/nav/FilterChips.svelte +1 -1
- package/dist/themes/CUSTOM_THEME_GUIDE.md +6 -6
- package/dist/themes/required-tokens.generated.json +12 -0
- package/package.json +11 -2
package/AGENTS.md
CHANGED
|
@@ -50,6 +50,7 @@ components are exempt — they *are* the primitives.
|
|
|
50
50
|
| `./data` | `CollectionToolbar`, `CollectionList`/`ContentList`, `DataTable` (footer rows and column `summaries`: [agents/data-table.md](agents/data-table.md)) and their types — a **component barrel**: it re-exports `.svelte` files, so a plain Node `import()` of it throws `ERR_UNKNOWN_FILE_EXTENSION` |
|
|
51
51
|
| `./data-surface` | **Svelte-free**: registry contracts and shared protocol limits (`DATA_SURFACE_MAX_REQUEST_BYTES`, `DATA_SURFACE_IDENTIFIER_MAX_LENGTH`, …). Server adapters must import these from here, not from `./data` — a server entry that reaches the barrel breaks the `smrt` CLI's plain-Node `.smrt/register.js` load (issue #2924) |
|
|
52
52
|
| `./layout` | `Container`, `Grid`, `Header`, `Footer`, `PageHeader`, `EmptyState`, … |
|
|
53
|
+
| `./charts` | Pure `Chart` renderer (`bar`, `line`, `table`, `pie`, `stat`), structural `ChartData`, and minor-unit number formatting; `./charts/format` is Svelte-free |
|
|
53
54
|
| `./calendar` | `CalendarView` (time-zone-aware month/week grids + phone agenda) and its Svelte-free date model (`toEntries`, `layoutMonth`, `layoutWeek`, `dateKeyInZone`, …); deprecated `Calendar`, `DayView` |
|
|
54
55
|
| `./chat` | `MessageBubble`, `ReactionPicker`, `TypingIndicator` |
|
|
55
56
|
| `./forms` | Provider-free fields, choice controls, sliders/ranges, combobox/listbox/multiselect/tags, date/time/file controls, `CameraCapture`/`SignaturePad` capture, plus the transport-neutral control interaction registry |
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Chart widget (#3727, #3888): bars, a line, a plain table, a donut or a single
|
|
4
|
+
* headline value over labelled values, drawn from the loaded data. Every chart
|
|
5
|
+
* carries its numbers as text (bar values inline, a visible table for `table`,
|
|
6
|
+
* a visually hidden table for the line and the donut, the value itself for
|
|
7
|
+
* `stat`) so it is readable without sight.
|
|
8
|
+
*/
|
|
9
|
+
import { useI18n } from '../i18n/index.js';
|
|
10
|
+
import { formatWidgetValue } from './format.js';
|
|
11
|
+
import { M } from './strings.js';
|
|
12
|
+
import type { ChartData } from './types.js';
|
|
13
|
+
|
|
14
|
+
export interface Props {
|
|
15
|
+
/** Validated chart data to render, or null for the empty state. */
|
|
16
|
+
data: ChartData | null;
|
|
17
|
+
/** Requested chart presentation; unsupported values fall back to bars. */
|
|
18
|
+
style?: string;
|
|
19
|
+
/** Accessible heading shown above the chart. */
|
|
20
|
+
title?: string;
|
|
21
|
+
/** Locale used to format displayed numeric values. */
|
|
22
|
+
locale?: string;
|
|
23
|
+
}
|
|
24
|
+
let {
|
|
25
|
+
data,
|
|
26
|
+
style: requestedStyle = 'bar',
|
|
27
|
+
title = '',
|
|
28
|
+
locale = 'en',
|
|
29
|
+
}: Props = $props();
|
|
30
|
+
|
|
31
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
32
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const { t } = useI18n();
|
|
36
|
+
const MAX_POINTS = 60;
|
|
37
|
+
|
|
38
|
+
const chart = $derived(isRecord(data) ? data : null);
|
|
39
|
+
const points = $derived.by(() => {
|
|
40
|
+
if (!chart || !Array.isArray(chart.points)) return [];
|
|
41
|
+
const out: { label: string; value: number }[] = [];
|
|
42
|
+
for (const point of chart.points.slice(0, MAX_POINTS)) {
|
|
43
|
+
if (
|
|
44
|
+
isRecord(point) &&
|
|
45
|
+
typeof point.label === 'string' &&
|
|
46
|
+
typeof point.value === 'number' &&
|
|
47
|
+
Number.isFinite(point.value)
|
|
48
|
+
) {
|
|
49
|
+
out.push({ label: point.label, value: point.value });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
});
|
|
54
|
+
const STYLES = ['bar', 'line', 'table', 'pie', 'stat'] as const;
|
|
55
|
+
const style = $derived(
|
|
56
|
+
STYLES.find((candidate) => candidate === requestedStyle) ?? 'bar',
|
|
57
|
+
);
|
|
58
|
+
const fmt = (value: number): string =>
|
|
59
|
+
formatWidgetValue(value, {
|
|
60
|
+
format: chart?.format ?? 'integer',
|
|
61
|
+
currency: chart?.currency,
|
|
62
|
+
locale,
|
|
63
|
+
});
|
|
64
|
+
const max = $derived(Math.max(0, ...points.map((point) => point.value)));
|
|
65
|
+
const min = $derived(Math.min(0, ...points.map((point) => point.value)));
|
|
66
|
+
const span = $derived(max - min || 1);
|
|
67
|
+
const polyline = $derived(
|
|
68
|
+
points
|
|
69
|
+
.map((point, index) => {
|
|
70
|
+
const x = points.length === 1 ? 50 : (index / (points.length - 1)) * 100;
|
|
71
|
+
const y = 36 - ((point.value - min) / span) * 32;
|
|
72
|
+
return `${x.toFixed(2)},${y.toFixed(2)}`;
|
|
73
|
+
})
|
|
74
|
+
.join(' '),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
// Donut: slices are percentages of the positive total on a circle whose
|
|
78
|
+
// path length is 100, so a segment's dash length is its share.
|
|
79
|
+
const total = $derived(
|
|
80
|
+
points.reduce((sum, point) => sum + Math.max(0, point.value), 0),
|
|
81
|
+
);
|
|
82
|
+
const slices = $derived.by(() => {
|
|
83
|
+
let offset = 0;
|
|
84
|
+
return points.map((point, index) => {
|
|
85
|
+
const share = total > 0 ? (Math.max(0, point.value) / total) * 100 : 0;
|
|
86
|
+
const slice = { ...point, index, share, offset };
|
|
87
|
+
offset += share;
|
|
88
|
+
return slice;
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
const percent = (share: number): string =>
|
|
92
|
+
formatWidgetValue(share / 100, { format: 'percent', locale });
|
|
93
|
+
|
|
94
|
+
// Stat: the latest value, and its change against the one before.
|
|
95
|
+
const latest = $derived(points.at(-1));
|
|
96
|
+
const delta = $derived.by((): number | null => {
|
|
97
|
+
if (
|
|
98
|
+
chart &&
|
|
99
|
+
typeof chart.delta === 'number' &&
|
|
100
|
+
Number.isFinite(chart.delta)
|
|
101
|
+
) {
|
|
102
|
+
return chart.delta;
|
|
103
|
+
}
|
|
104
|
+
const previous = points.at(-2);
|
|
105
|
+
if (!latest || !previous || previous.value === 0) return null;
|
|
106
|
+
return ((latest.value - previous.value) / Math.abs(previous.value)) * 100;
|
|
107
|
+
});
|
|
108
|
+
const deltaText = $derived(
|
|
109
|
+
delta === null || delta === 0
|
|
110
|
+
? ''
|
|
111
|
+
: t(
|
|
112
|
+
M[
|
|
113
|
+
delta > 0
|
|
114
|
+
? 'ui.overview.metric.change_up'
|
|
115
|
+
: 'ui.overview.metric.change_down'
|
|
116
|
+
],
|
|
117
|
+
{
|
|
118
|
+
value: formatWidgetValue(Math.abs(delta) / 100, {
|
|
119
|
+
format: 'percent',
|
|
120
|
+
locale,
|
|
121
|
+
}),
|
|
122
|
+
},
|
|
123
|
+
),
|
|
124
|
+
);
|
|
125
|
+
const summary = $derived(
|
|
126
|
+
`${title}. ${t(M['ui.overview.chart.summary'], { count: points.length })}`,
|
|
127
|
+
);
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
{#snippet dataTable(hidden: boolean)}
|
|
131
|
+
<table class={hidden ? 'smrt-chart__table' : 'smrt-chart__data'}>
|
|
132
|
+
<caption>{t(M['ui.overview.chart.table'])}</caption>
|
|
133
|
+
<thead>
|
|
134
|
+
<tr>
|
|
135
|
+
<th scope="col">{t(M['ui.overview.chart.label_column'])}</th>
|
|
136
|
+
<th scope="col">{t(M['ui.overview.chart.value_column'])}</th>
|
|
137
|
+
</tr>
|
|
138
|
+
</thead>
|
|
139
|
+
<tbody>
|
|
140
|
+
{#each points as point, index (index)}
|
|
141
|
+
<tr><th scope="row">{point.label}</th><td>{fmt(point.value)}</td></tr>
|
|
142
|
+
{/each}
|
|
143
|
+
</tbody>
|
|
144
|
+
</table>
|
|
145
|
+
{/snippet}
|
|
146
|
+
|
|
147
|
+
{#if points.length === 0}
|
|
148
|
+
<p class="smrt-chart__empty" data-smrt-component="Chart">{t(M['ui.overview.no_data'])}</p>
|
|
149
|
+
{:else if style === 'table'}
|
|
150
|
+
<div class="smrt-chart smrt-chart--table" data-smrt-component="Chart">
|
|
151
|
+
{@render dataTable(false)}
|
|
152
|
+
</div>
|
|
153
|
+
{:else if style === 'stat'}
|
|
154
|
+
{#if latest}
|
|
155
|
+
<div class="smrt-chart smrt-chart--stat" data-smrt-component="Chart">
|
|
156
|
+
<p class="smrt-chart__headline">{fmt(latest.value)}</p>
|
|
157
|
+
<p class="smrt-chart__caption">{latest.label}</p>
|
|
158
|
+
{#if deltaText}
|
|
159
|
+
<p class="smrt-chart__delta" data-direction={(delta ?? 0) > 0 ? 'up' : 'down'}>
|
|
160
|
+
<span aria-hidden="true">{(delta ?? 0) > 0 ? '▲' : '▼'}</span>
|
|
161
|
+
{deltaText}
|
|
162
|
+
</p>
|
|
163
|
+
{/if}
|
|
164
|
+
</div>
|
|
165
|
+
{/if}
|
|
166
|
+
{:else if style === 'pie'}
|
|
167
|
+
{#if total > 0}
|
|
168
|
+
<div class="smrt-chart smrt-chart--pie" data-smrt-component="Chart">
|
|
169
|
+
<svg class="smrt-chart__donut" viewBox="0 0 42 42" role="img" aria-label={summary}>
|
|
170
|
+
{#each slices as slice (slice.index)}
|
|
171
|
+
{#if slice.share > 0}
|
|
172
|
+
<circle
|
|
173
|
+
class="smrt-chart__slice"
|
|
174
|
+
data-slot={slice.index % 8}
|
|
175
|
+
cx="21"
|
|
176
|
+
cy="21"
|
|
177
|
+
r="15.9155"
|
|
178
|
+
fill="none"
|
|
179
|
+
stroke-width="6"
|
|
180
|
+
pathLength="100"
|
|
181
|
+
stroke-dasharray="{slice.share} {100 - slice.share}"
|
|
182
|
+
stroke-dashoffset={-slice.offset}
|
|
183
|
+
transform="rotate(-90 21 21)"
|
|
184
|
+
/>
|
|
185
|
+
{/if}
|
|
186
|
+
{/each}
|
|
187
|
+
</svg>
|
|
188
|
+
<ul class="smrt-chart__legend" aria-hidden="true">
|
|
189
|
+
{#each slices as slice (slice.index)}
|
|
190
|
+
<li class="smrt-chart__legend-item">
|
|
191
|
+
<span class="smrt-chart__swatch" data-slot={slice.index % 8}></span>
|
|
192
|
+
<span class="smrt-chart__label">{slice.label}</span>
|
|
193
|
+
<span class="smrt-chart__value">{fmt(slice.value)} · {percent(slice.share)}</span>
|
|
194
|
+
</li>
|
|
195
|
+
{/each}
|
|
196
|
+
</ul>
|
|
197
|
+
{@render dataTable(true)}
|
|
198
|
+
</div>
|
|
199
|
+
{:else}
|
|
200
|
+
<p class="smrt-chart__empty" data-smrt-component="Chart">{t(M['ui.overview.no_data'])}</p>
|
|
201
|
+
{/if}
|
|
202
|
+
{:else if style === 'line'}
|
|
203
|
+
<div class="smrt-chart" data-smrt-component="Chart">
|
|
204
|
+
<svg class="smrt-chart__line" viewBox="0 0 100 40" preserveAspectRatio="none" role="img" aria-label={summary}>
|
|
205
|
+
<polyline points={polyline} fill="none" stroke="currentColor" stroke-width="2" vector-effect="non-scaling-stroke" />
|
|
206
|
+
</svg>
|
|
207
|
+
<p class="smrt-chart__axis" aria-hidden="true">
|
|
208
|
+
<span>{points[0].label}</span>
|
|
209
|
+
<span>{points[points.length - 1].label}</span>
|
|
210
|
+
</p>
|
|
211
|
+
{@render dataTable(true)}
|
|
212
|
+
</div>
|
|
213
|
+
{:else}
|
|
214
|
+
<ul class="smrt-chart__bars" aria-label={summary} data-smrt-component="Chart">
|
|
215
|
+
{#each points as point, index (index)}
|
|
216
|
+
<li class="smrt-chart__row">
|
|
217
|
+
<span class="smrt-chart__label">{point.label}</span>
|
|
218
|
+
<span class="smrt-chart__track" aria-hidden="true">
|
|
219
|
+
<span class="smrt-chart__bar" style:inline-size="{max > 0 ? (Math.max(0, point.value) / max) * 100 : 0}%"></span>
|
|
220
|
+
</span>
|
|
221
|
+
<span class="smrt-chart__value">{fmt(point.value)}</span>
|
|
222
|
+
</li>
|
|
223
|
+
{/each}
|
|
224
|
+
</ul>
|
|
225
|
+
{/if}
|
|
226
|
+
|
|
227
|
+
<style>
|
|
228
|
+
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
229
|
+
@layer smrt.theme {
|
|
230
|
+
.smrt-chart { display: grid; gap: var(--smrt-spacing-1); color: var(--smrt-color-primary); }
|
|
231
|
+
.smrt-chart__line { inline-size: 100%; block-size: 7rem; overflow: visible; }
|
|
232
|
+
.smrt-chart__axis { display: flex; justify-content: space-between; margin: 0; color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-label-large-size, 0.75rem); }
|
|
233
|
+
.smrt-chart__bars { display: grid; gap: var(--smrt-spacing-2); margin: 0; padding: 0; list-style: none; }
|
|
234
|
+
.smrt-chart__row { display: grid; grid-template-columns: minmax(4rem, 30%) minmax(0, 1fr) auto; align-items: center; gap: var(--smrt-spacing-2); font-size: var(--smrt-typography-body-medium-size, 0.875rem); color: var(--smrt-color-on-surface); }
|
|
235
|
+
.smrt-chart__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
236
|
+
.smrt-chart__track { display: block; block-size: 0.625rem; border-radius: var(--smrt-radius-full); background: var(--smrt-color-surface-container-high); overflow: hidden; }
|
|
237
|
+
.smrt-chart__bar { display: block; block-size: 100%; border-radius: inherit; background: var(--smrt-color-primary); }
|
|
238
|
+
.smrt-chart__value { font-variant-numeric: tabular-nums; color: var(--smrt-color-on-surface-variant); }
|
|
239
|
+
.smrt-chart__empty { margin: 0; color: var(--smrt-color-on-surface-variant); }
|
|
240
|
+
.smrt-chart--table { color: var(--smrt-color-on-surface); }
|
|
241
|
+
.smrt-chart__data { inline-size: 100%; border-collapse: collapse; font-size: var(--smrt-typography-body-medium-size, 0.875rem); }
|
|
242
|
+
.smrt-chart__data caption { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
|
|
243
|
+
.smrt-chart__data th, .smrt-chart__data td { padding: var(--smrt-spacing-1) var(--smrt-spacing-2); border-block-end: var(--smrt-hairline); text-align: start; }
|
|
244
|
+
.smrt-chart__data thead th { background: var(--smrt-surface-sunken); color: var(--smrt-color-on-surface-variant); font-weight: var(--smrt-typography-weight-medium, 500); }
|
|
245
|
+
.smrt-chart__data tbody th { font-weight: inherit; overflow-wrap: anywhere; }
|
|
246
|
+
.smrt-chart__data td, .smrt-chart__data thead th:last-child { text-align: end; font-variant-numeric: tabular-nums; }
|
|
247
|
+
.smrt-chart--stat { gap: var(--smrt-spacing-1); color: var(--smrt-color-on-surface); }
|
|
248
|
+
.smrt-chart__headline { margin: 0; font-size: var(--smrt-typography-display-small-size, 2rem); font-weight: var(--smrt-typography-weight-medium, 500); line-height: 1.1; font-variant-numeric: tabular-nums; }
|
|
249
|
+
.smrt-chart__caption { margin: 0; color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-body-medium-size, 0.875rem); }
|
|
250
|
+
.smrt-chart__delta { margin: 0; color: var(--smrt-color-on-surface-variant); font-size: var(--smrt-typography-label-large-size, 0.875rem); }
|
|
251
|
+
.smrt-chart--pie { grid-template-columns: minmax(6rem, 10rem) minmax(0, 1fr); align-items: center; gap: var(--smrt-spacing-4); }
|
|
252
|
+
.smrt-chart__donut { inline-size: 100%; block-size: auto; }
|
|
253
|
+
.smrt-chart__slice[data-slot='0'], .smrt-chart__swatch[data-slot='0'] { stroke: var(--smrt-color-primary); background: var(--smrt-color-primary); }
|
|
254
|
+
.smrt-chart__slice[data-slot='1'], .smrt-chart__swatch[data-slot='1'] { stroke: var(--smrt-color-secondary); background: var(--smrt-color-secondary); }
|
|
255
|
+
.smrt-chart__slice[data-slot='2'], .smrt-chart__swatch[data-slot='2'] { stroke: var(--smrt-color-tertiary); background: var(--smrt-color-tertiary); }
|
|
256
|
+
.smrt-chart__slice[data-slot='3'], .smrt-chart__swatch[data-slot='3'] { stroke: var(--smrt-color-info); background: var(--smrt-color-info); }
|
|
257
|
+
.smrt-chart__slice[data-slot='4'], .smrt-chart__swatch[data-slot='4'] { stroke: var(--smrt-color-primary-container); background: var(--smrt-color-primary-container); }
|
|
258
|
+
.smrt-chart__slice[data-slot='5'], .smrt-chart__swatch[data-slot='5'] { stroke: var(--smrt-color-secondary-container); background: var(--smrt-color-secondary-container); }
|
|
259
|
+
.smrt-chart__slice[data-slot='6'], .smrt-chart__swatch[data-slot='6'] { stroke: var(--smrt-color-tertiary-container); background: var(--smrt-color-tertiary-container); }
|
|
260
|
+
.smrt-chart__slice[data-slot='7'], .smrt-chart__swatch[data-slot='7'] { stroke: var(--smrt-color-info-container); background: var(--smrt-color-info-container); }
|
|
261
|
+
.smrt-chart__legend { display: grid; gap: var(--smrt-spacing-1); margin: 0; padding: 0; list-style: none; color: var(--smrt-color-on-surface); font-size: var(--smrt-typography-body-medium-size, 0.875rem); }
|
|
262
|
+
.smrt-chart__legend-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--smrt-spacing-2); }
|
|
263
|
+
.smrt-chart__swatch { inline-size: 0.75rem; block-size: 0.75rem; border-radius: var(--smrt-radius-small); }
|
|
264
|
+
.smrt-chart__legend .smrt-chart__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
265
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
266
|
+
.smrt-chart__slice { transition: stroke-dasharray var(--smrt-duration-normal) var(--smrt-easing-standard), stroke-dashoffset var(--smrt-duration-normal) var(--smrt-easing-standard); }
|
|
267
|
+
.smrt-chart__bar { transition: inline-size var(--smrt-duration-normal) var(--smrt-easing-standard); }
|
|
268
|
+
}
|
|
269
|
+
.smrt-chart__table { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
|
|
270
|
+
@media (forced-colors: active) {
|
|
271
|
+
.smrt-chart__slice[data-slot='0'], .smrt-chart__swatch[data-slot='0'] { stroke: CanvasText; background: CanvasText; }
|
|
272
|
+
.smrt-chart__slice[data-slot='1'], .smrt-chart__swatch[data-slot='1'] { stroke: Highlight; background: Highlight; }
|
|
273
|
+
.smrt-chart__slice[data-slot='2'], .smrt-chart__swatch[data-slot='2'] { stroke: LinkText; background: LinkText; }
|
|
274
|
+
.smrt-chart__slice[data-slot='3'], .smrt-chart__swatch[data-slot='3'] { stroke: VisitedText; background: VisitedText; }
|
|
275
|
+
.smrt-chart__slice[data-slot='4'], .smrt-chart__swatch[data-slot='4'] { stroke: ActiveText; background: ActiveText; }
|
|
276
|
+
.smrt-chart__slice[data-slot='5'], .smrt-chart__swatch[data-slot='5'] { stroke: GrayText; background: GrayText; }
|
|
277
|
+
.smrt-chart__slice[data-slot='6'], .smrt-chart__swatch[data-slot='6'] { stroke: ButtonText; background: ButtonText; }
|
|
278
|
+
.smrt-chart__slice[data-slot='7'], .smrt-chart__swatch[data-slot='7'] { stroke: MarkText; background: MarkText; }
|
|
279
|
+
.smrt-chart__swatch { border: var(--smrt-hairline-strong); }
|
|
280
|
+
.smrt-chart__slice { stroke-linecap: butt; }
|
|
281
|
+
.smrt-chart__track { background: Canvas; border: var(--smrt-hairline-strong); }
|
|
282
|
+
.smrt-chart__bar { background: Highlight; }
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ChartData } from './types.js';
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** Validated chart data to render, or null for the empty state. */
|
|
4
|
+
data: ChartData | null;
|
|
5
|
+
/** Requested chart presentation; unsupported values fall back to bars. */
|
|
6
|
+
style?: string;
|
|
7
|
+
/** Accessible heading shown above the chart. */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Locale used to format displayed numeric values. */
|
|
10
|
+
locale?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Chart: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type Chart = ReturnType<typeof Chart>;
|
|
14
|
+
export default Chart;
|
|
15
|
+
//# sourceMappingURL=Chart.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chart.svelte.d.ts","sourceRoot":"","sources":["../../src/charts/Chart.svelte.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,MAAM,WAAW,KAAK;IACpB,mEAAmE;IACnE,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA2MD,QAAA,MAAM,KAAK,2CAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type WidgetValueFormat = 'integer' | 'decimal' | 'percent' | 'money';
|
|
2
|
+
export interface FormatWidgetValueOptions {
|
|
3
|
+
format?: WidgetValueFormat;
|
|
4
|
+
/** ISO 4217 code for `money` (default USD). */
|
|
5
|
+
currency?: string;
|
|
6
|
+
locale: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Format a metric value. `money` takes integer minor units, `percent` takes a
|
|
10
|
+
* fraction (0.25 is 25%). Non-finite input renders as an en dash.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatWidgetValue(value: unknown, { format, currency, locale }: FormatWidgetValueOptions): string;
|
|
13
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/charts/format.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5E,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAYD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,EAAE,MAAkB,EAAE,QAAgB,EAAE,MAAM,EAAE,EAAE,wBAAwB,GACzE,MAAM,CA4BR"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number formatting for overview widgets (#3727). Deterministic for a given
|
|
3
|
+
* locale so a server render and the client hydrate to the same text. Money is
|
|
4
|
+
* integer minor units end to end (never a decimal in data).
|
|
5
|
+
*/
|
|
6
|
+
import { ISO_4217_MINOR_UNITS } from '../currency.js';
|
|
7
|
+
function currencyMinorDigits(currency) {
|
|
8
|
+
return ISO_4217_MINOR_UNITS.get(currency.trim().toUpperCase()) ?? 2;
|
|
9
|
+
}
|
|
10
|
+
const EN_DASH = '–';
|
|
11
|
+
function safeLocale(locale) {
|
|
12
|
+
try {
|
|
13
|
+
return Intl.getCanonicalLocales(locale)[0] ?? 'en';
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return 'en';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Format a metric value. `money` takes integer minor units, `percent` takes a
|
|
21
|
+
* fraction (0.25 is 25%). Non-finite input renders as an en dash.
|
|
22
|
+
*/
|
|
23
|
+
export function formatWidgetValue(value, { format = 'integer', currency = 'USD', locale }) {
|
|
24
|
+
if (typeof value !== 'number' || !Number.isFinite(value))
|
|
25
|
+
return EN_DASH;
|
|
26
|
+
const tag = safeLocale(locale);
|
|
27
|
+
switch (format) {
|
|
28
|
+
case 'money': {
|
|
29
|
+
const code = /^[A-Za-z]{3}$/.test(currency)
|
|
30
|
+
? currency.toUpperCase()
|
|
31
|
+
: 'USD';
|
|
32
|
+
const digits = currencyMinorDigits(code);
|
|
33
|
+
return new Intl.NumberFormat(tag, {
|
|
34
|
+
style: 'currency',
|
|
35
|
+
currency: code,
|
|
36
|
+
}).format(value / 10 ** digits);
|
|
37
|
+
}
|
|
38
|
+
case 'percent':
|
|
39
|
+
return new Intl.NumberFormat(tag, {
|
|
40
|
+
style: 'percent',
|
|
41
|
+
maximumFractionDigits: 1,
|
|
42
|
+
}).format(value);
|
|
43
|
+
case 'decimal':
|
|
44
|
+
return new Intl.NumberFormat(tag, { maximumFractionDigits: 2 }).format(value);
|
|
45
|
+
default:
|
|
46
|
+
return new Intl.NumberFormat(tag, { maximumFractionDigits: 0 }).format(value);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/charts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const M: {
|
|
2
|
+
readonly 'ui.overview.no_data': "ui.overview.no_data";
|
|
3
|
+
readonly 'ui.overview.metric.change_up': "ui.overview.metric.change_up";
|
|
4
|
+
readonly 'ui.overview.metric.change_down': "ui.overview.metric.change_down";
|
|
5
|
+
readonly 'ui.overview.chart.summary': "ui.overview.chart.summary";
|
|
6
|
+
readonly 'ui.overview.chart.table': "ui.overview.chart.table";
|
|
7
|
+
readonly 'ui.overview.chart.label_column': "ui.overview.chart.label_column";
|
|
8
|
+
readonly 'ui.overview.chart.value_column': "ui.overview.chart.value_column";
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=strings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/charts/strings.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC;;;;;;;;CAQZ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineMessages } from '../i18n/registry.js';
|
|
2
|
+
export const M = defineMessages({
|
|
3
|
+
'ui.overview.no_data': 'Nothing to show yet.',
|
|
4
|
+
'ui.overview.metric.change_up': 'Up {value} from the previous period',
|
|
5
|
+
'ui.overview.metric.change_down': 'Down {value} from the previous period',
|
|
6
|
+
'ui.overview.chart.summary': 'Chart with {count} values',
|
|
7
|
+
'ui.overview.chart.table': 'Chart data',
|
|
8
|
+
'ui.overview.chart.label_column': 'Label',
|
|
9
|
+
'ui.overview.chart.value_column': 'Value',
|
|
10
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WidgetValueFormat } from './format.js';
|
|
2
|
+
/** Transport-neutral chart data. Money values use integer minor units. */
|
|
3
|
+
export interface ChartData {
|
|
4
|
+
points: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
}[];
|
|
8
|
+
format?: WidgetValueFormat;
|
|
9
|
+
currency?: string;
|
|
10
|
+
/** Explicit percentage change for a stat; otherwise derived from its last two points. */
|
|
11
|
+
delta?: number | null;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/charts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2379,7 +2379,7 @@ $effect(() => {
|
|
|
2379
2379
|
}
|
|
2380
2380
|
.data-table-container[data-density='touch'] { --smrt-control-target-min: var(--smrt-touch-target-min); }
|
|
2381
2381
|
.data-table-container[data-density='comfortable'] { --smrt-control-target-min: 0px; }
|
|
2382
|
-
.data-table__sort-button { min-height: var(--smrt-control-target-min
|
|
2382
|
+
.data-table__sort-button { min-height: var(--smrt-control-target-min); min-width: var(--smrt-control-target-min); }
|
|
2383
2383
|
.data-table-container--narrow .data-table { table-layout: fixed; }
|
|
2384
2384
|
.data-table-container--narrow .data-table__cell { white-space: normal; overflow-wrap: anywhere; }
|
|
2385
2385
|
.data-table-container--narrow .data-table__sort-button { max-width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
|
|
@@ -202,7 +202,7 @@ function handleKeydown(e: KeyboardEvent) {
|
|
|
202
202
|
|
|
203
203
|
.dialog-content {
|
|
204
204
|
background-color: var(--smrt-color-surface-container-high);
|
|
205
|
-
border-radius: var(--smrt-radius-3xl
|
|
205
|
+
border-radius: var(--smrt-radius-3xl);
|
|
206
206
|
padding: var(--smrt-spacing-6);
|
|
207
207
|
max-width: 400px;
|
|
208
208
|
width: 100%;
|
|
@@ -44,7 +44,7 @@ function handleChange(event: Event & { currentTarget: HTMLInputElement }) {
|
|
|
44
44
|
input:checked + .radio__mark { border-color: var(--smrt-color-primary); }
|
|
45
45
|
input:checked + .radio__mark::after { transform: scale(1); }
|
|
46
46
|
input:focus-visible + .radio__mark { outline: var(--smrt-focus-ring-width) solid var(--smrt-focus-ring-color); outline-offset: var(--smrt-focus-ring-offset); }
|
|
47
|
-
.radio { min-height: var(--smrt-control-target-min
|
|
47
|
+
.radio { min-height: var(--smrt-control-target-min); min-width: var(--smrt-control-target-min); }
|
|
48
48
|
|
|
49
49
|
/* Table cells: grow vertically only, never into a neighbouring cell. */
|
|
50
50
|
:global(:is(td, th)) .radio::before { inline-size: var(--smrt-radio-box); margin-inline-start: calc(var(--smrt-radio-box) / -2); }
|
|
@@ -261,7 +261,7 @@ useControlRegistration(() => {
|
|
|
261
261
|
|
|
262
262
|
.segmented[data-density='touch'] { --smrt-control-target-min: var(--smrt-touch-target-min); }
|
|
263
263
|
.segmented[data-density='comfortable'] { --smrt-control-target-min: 0px; }
|
|
264
|
-
label { min-height: max(2.5rem, var(--smrt-control-target-min
|
|
264
|
+
label { min-height: max(2.5rem, var(--smrt-control-target-min)); min-width: var(--smrt-control-target-min); }
|
|
265
265
|
input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
|
|
266
266
|
/* Forced colors (#3908): system colours where colour alone carries meaning. */
|
|
267
267
|
@media (forced-colors: active) {
|
|
@@ -206,6 +206,6 @@ export function getElement(): HTMLTextAreaElement | null {
|
|
|
206
206
|
|
|
207
207
|
.textarea[data-density='touch'] { --smrt-control-target-min: var(--smrt-touch-target-min); }
|
|
208
208
|
.textarea[data-density='comfortable'] { --smrt-control-target-min: 0px; }
|
|
209
|
-
.textarea { min-height: max(80px, var(--smrt-control-target-min
|
|
209
|
+
.textarea { min-height: max(80px, var(--smrt-control-target-min)); }
|
|
210
210
|
}
|
|
211
211
|
</style>
|
|
@@ -118,7 +118,7 @@ const icons = {
|
|
|
118
118
|
margin-bottom: 2rem;
|
|
119
119
|
background-color: var(--smrt-color-secondary-container);
|
|
120
120
|
color: var(--smrt-color-on-secondary-container);
|
|
121
|
-
border-radius: var(--smrt-radius-3xl
|
|
121
|
+
border-radius: var(--smrt-radius-3xl); /* M3 extra large shape */
|
|
122
122
|
padding: var(--smrt-spacing-6);
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -134,7 +134,7 @@ const icons = {
|
|
|
134
134
|
width: 120px;
|
|
135
135
|
height: 120px;
|
|
136
136
|
margin-bottom: 2.5rem;
|
|
137
|
-
border-radius: var(--smrt-radius-3xl
|
|
137
|
+
border-radius: var(--smrt-radius-3xl);
|
|
138
138
|
padding: var(--smrt-spacing-8);
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -157,7 +157,7 @@ function handleClick(value: string) {
|
|
|
157
157
|
|
|
158
158
|
.filter-chips[data-density='touch'] { --smrt-control-target-min: var(--smrt-touch-target-min); }
|
|
159
159
|
.filter-chips[data-density='comfortable'] { --smrt-control-target-min: 0px; }
|
|
160
|
-
.filter-chip { min-height: var(--smrt-control-target-min
|
|
160
|
+
.filter-chip { min-height: var(--smrt-control-target-min); min-width: var(--smrt-control-target-min); }
|
|
161
161
|
/* Forced colors (#3908): system colours where colour alone carries meaning. */
|
|
162
162
|
@media (forced-colors: active) {
|
|
163
163
|
.filter-chip.active { background-color: Highlight; color: HighlightText; border-color: Highlight; }
|
|
@@ -331,8 +331,8 @@ Every theme (presets and `createTheme()` output) must define these names. Genera
|
|
|
331
331
|
`--smrt-<component>-*` knobs are excluded.
|
|
332
332
|
|
|
333
333
|
- **color** (42): `--smrt-color-background`, `--smrt-color-error`, `--smrt-color-error-container`, `--smrt-color-info`, `--smrt-color-info-container`, `--smrt-color-inverse-on-surface`, `--smrt-color-inverse-surface`, `--smrt-color-on-background`, `--smrt-color-on-error`, `--smrt-color-on-error-container`, `--smrt-color-on-primary`, `--smrt-color-on-primary-container`, `--smrt-color-on-secondary`, `--smrt-color-on-secondary-container`, `--smrt-color-on-success-container`, `--smrt-color-on-surface`, `--smrt-color-on-surface-variant`, `--smrt-color-on-tertiary`, `--smrt-color-on-tertiary-container`, `--smrt-color-on-warning-container`, `--smrt-color-outline`, `--smrt-color-outline-variant`, `--smrt-color-primary`, `--smrt-color-primary-container`, `--smrt-color-scrim`, `--smrt-color-secondary`, `--smrt-color-secondary-container`, `--smrt-color-shadow`, `--smrt-color-success`, `--smrt-color-success-container`, `--smrt-color-surface`, `--smrt-color-surface-container`, `--smrt-color-surface-container-high`, `--smrt-color-surface-container-highest`, `--smrt-color-surface-container-low`, `--smrt-color-surface-container-lowest`, `--smrt-color-surface-dim`, `--smrt-color-surface-variant`, `--smrt-color-tertiary`, `--smrt-color-tertiary-container`, `--smrt-color-warning`, `--smrt-color-warning-container`
|
|
334
|
-
- **control** (
|
|
335
|
-
- **duration** (
|
|
334
|
+
- **control** (6): `--smrt-control-height`, `--smrt-control-height-small`, `--smrt-control-radius`, `--smrt-control-radius-small`, `--smrt-control-target-min`, `--smrt-control-weight`
|
|
335
|
+
- **duration** (7): `--smrt-duration-fast`, `--smrt-duration-medium1`, `--smrt-duration-medium2`, `--smrt-duration-normal`, `--smrt-duration-short2`, `--smrt-duration-short3`, `--smrt-duration-short4`
|
|
336
336
|
- **easing** (3): `--smrt-easing-emphasized`, `--smrt-easing-emphasized-decelerate`, `--smrt-easing-standard`
|
|
337
337
|
- **elevation** (5): `--smrt-elevation-1`, `--smrt-elevation-2`, `--smrt-elevation-3`, `--smrt-elevation-4`, `--smrt-elevation-5`
|
|
338
338
|
- **focus** (3): `--smrt-focus-ring-color`, `--smrt-focus-ring-offset`, `--smrt-focus-ring-width`
|
|
@@ -340,14 +340,14 @@ Every theme (presets and `createTheme()` output) must define these names. Genera
|
|
|
340
340
|
- **glass** (4): `--smrt-glass-blur`, `--smrt-glass-saturation`, `--smrt-glass-surface`, `--smrt-glass-surface-strong`
|
|
341
341
|
- **hairline** (4): `--smrt-hairline`, `--smrt-hairline-color`, `--smrt-hairline-strong`, `--smrt-hairline-strong-color`
|
|
342
342
|
- **inset** (1): `--smrt-inset-highlight`
|
|
343
|
-
- **radius** (
|
|
343
|
+
- **radius** (13): `--smrt-radius-2xl`, `--smrt-radius-3xl`, `--smrt-radius-extra-large`, `--smrt-radius-extra-small`, `--smrt-radius-full`, `--smrt-radius-large`, `--smrt-radius-lg`, `--smrt-radius-md`, `--smrt-radius-medium`, `--smrt-radius-none`, `--smrt-radius-sm`, `--smrt-radius-small`, `--smrt-radius-xl`
|
|
344
344
|
- **scrollbar** (2): `--smrt-scrollbar-thumb`, `--smrt-scrollbar-track`
|
|
345
|
-
- **spacing** (
|
|
345
|
+
- **spacing** (20): `--smrt-spacing-0`, `--smrt-spacing-0_5`, `--smrt-spacing-1`, `--smrt-spacing-10`, `--smrt-spacing-11`, `--smrt-spacing-12`, `--smrt-spacing-1_5`, `--smrt-spacing-2`, `--smrt-spacing-2xl`, `--smrt-spacing-3`, `--smrt-spacing-3xl`, `--smrt-spacing-4`, `--smrt-spacing-5`, `--smrt-spacing-6`, `--smrt-spacing-8`, `--smrt-spacing-lg`, `--smrt-spacing-md`, `--smrt-spacing-sm`, `--smrt-spacing-xl`, `--smrt-spacing-xs`
|
|
346
346
|
- **state** (5): `--smrt-state-disabled`, `--smrt-state-dragged`, `--smrt-state-hover`, `--smrt-state-pressed`, `--smrt-state-selected`
|
|
347
347
|
- **surface** (6): `--smrt-surface-control`, `--smrt-surface-ground`, `--smrt-surface-overlay`, `--smrt-surface-panel`, `--smrt-surface-raised`, `--smrt-surface-sunken`
|
|
348
348
|
- **touch** (1): `--smrt-touch-target-min`
|
|
349
|
-
- **typography** (
|
|
350
|
-
- **z** (
|
|
349
|
+
- **typography** (60): `--smrt-typography-body-large-font`, `--smrt-typography-body-large-line-height`, `--smrt-typography-body-large-size`, `--smrt-typography-body-large-tracking`, `--smrt-typography-body-medium-font`, `--smrt-typography-body-medium-line-height`, `--smrt-typography-body-medium-size`, `--smrt-typography-body-medium-tracking`, `--smrt-typography-body-medium-weight`, `--smrt-typography-body-small-font`, `--smrt-typography-body-small-line-height`, `--smrt-typography-body-small-size`, `--smrt-typography-body-small-weight`, `--smrt-typography-display-medium-line-height`, `--smrt-typography-display-medium-size`, `--smrt-typography-display-small-size`, `--smrt-typography-display-small-weight`, `--smrt-typography-headline-large-line-height`, `--smrt-typography-headline-large-size`, `--smrt-typography-headline-large-weight`, `--smrt-typography-headline-medium-font`, `--smrt-typography-headline-medium-line-height`, `--smrt-typography-headline-medium-size`, `--smrt-typography-headline-medium-weight`, `--smrt-typography-headline-small-font`, `--smrt-typography-headline-small-line-height`, `--smrt-typography-headline-small-size`, `--smrt-typography-headline-small-weight`, `--smrt-typography-label-large-font`, `--smrt-typography-label-large-line-height`, `--smrt-typography-label-large-size`, `--smrt-typography-label-large-tracking`, `--smrt-typography-label-large-weight`, `--smrt-typography-label-medium-font`, `--smrt-typography-label-medium-size`, `--smrt-typography-label-medium-tracking`, `--smrt-typography-label-medium-weight`, `--smrt-typography-label-small-font`, `--smrt-typography-label-small-line-height`, `--smrt-typography-label-small-size`, `--smrt-typography-label-small-tracking`, `--smrt-typography-label-small-weight`, `--smrt-typography-title-large-font`, `--smrt-typography-title-large-line-height`, `--smrt-typography-title-large-size`, `--smrt-typography-title-large-weight`, `--smrt-typography-title-medium-font`, `--smrt-typography-title-medium-font-family`, `--smrt-typography-title-medium-line-height`, `--smrt-typography-title-medium-size`, `--smrt-typography-title-medium-tracking`, `--smrt-typography-title-medium-weight`, `--smrt-typography-title-small-font`, `--smrt-typography-title-small-size`, `--smrt-typography-title-small-tracking`, `--smrt-typography-title-small-weight`, `--smrt-typography-weight-bold`, `--smrt-typography-weight-medium`, `--smrt-typography-weight-normal`, `--smrt-typography-weight-semibold`
|
|
350
|
+
- **z** (9): `--smrt-z-index-dialog`, `--smrt-z-index-dropdown`, `--smrt-z-index-loading`, `--smrt-z-index-modal`, `--smrt-z-index-overlay`, `--smrt-z-index-popover`, `--smrt-z-index-sticky`, `--smrt-z-index-toast`, `--smrt-z-index-tooltip`
|
|
351
351
|
|
|
352
352
|
<!-- smrt-required-tokens:end -->
|
|
353
353
|
|
|
@@ -47,8 +47,11 @@
|
|
|
47
47
|
"--smrt-control-height-small",
|
|
48
48
|
"--smrt-control-radius",
|
|
49
49
|
"--smrt-control-radius-small",
|
|
50
|
+
"--smrt-control-target-min",
|
|
51
|
+
"--smrt-control-weight",
|
|
50
52
|
"--smrt-duration-fast",
|
|
51
53
|
"--smrt-duration-medium1",
|
|
54
|
+
"--smrt-duration-medium2",
|
|
52
55
|
"--smrt-duration-normal",
|
|
53
56
|
"--smrt-duration-short2",
|
|
54
57
|
"--smrt-duration-short3",
|
|
@@ -76,6 +79,7 @@
|
|
|
76
79
|
"--smrt-hairline-strong-color",
|
|
77
80
|
"--smrt-inset-highlight",
|
|
78
81
|
"--smrt-radius-2xl",
|
|
82
|
+
"--smrt-radius-3xl",
|
|
79
83
|
"--smrt-radius-extra-large",
|
|
80
84
|
"--smrt-radius-extra-small",
|
|
81
85
|
"--smrt-radius-full",
|
|
@@ -83,11 +87,13 @@
|
|
|
83
87
|
"--smrt-radius-lg",
|
|
84
88
|
"--smrt-radius-md",
|
|
85
89
|
"--smrt-radius-medium",
|
|
90
|
+
"--smrt-radius-none",
|
|
86
91
|
"--smrt-radius-sm",
|
|
87
92
|
"--smrt-radius-small",
|
|
88
93
|
"--smrt-radius-xl",
|
|
89
94
|
"--smrt-scrollbar-thumb",
|
|
90
95
|
"--smrt-scrollbar-track",
|
|
96
|
+
"--smrt-spacing-0",
|
|
91
97
|
"--smrt-spacing-0_5",
|
|
92
98
|
"--smrt-spacing-1",
|
|
93
99
|
"--smrt-spacing-10",
|
|
@@ -135,9 +141,11 @@
|
|
|
135
141
|
"--smrt-typography-display-medium-line-height",
|
|
136
142
|
"--smrt-typography-display-medium-size",
|
|
137
143
|
"--smrt-typography-display-small-size",
|
|
144
|
+
"--smrt-typography-display-small-weight",
|
|
138
145
|
"--smrt-typography-headline-large-line-height",
|
|
139
146
|
"--smrt-typography-headline-large-size",
|
|
140
147
|
"--smrt-typography-headline-large-weight",
|
|
148
|
+
"--smrt-typography-headline-medium-font",
|
|
141
149
|
"--smrt-typography-headline-medium-line-height",
|
|
142
150
|
"--smrt-typography-headline-medium-size",
|
|
143
151
|
"--smrt-typography-headline-medium-weight",
|
|
@@ -146,6 +154,7 @@
|
|
|
146
154
|
"--smrt-typography-headline-small-size",
|
|
147
155
|
"--smrt-typography-headline-small-weight",
|
|
148
156
|
"--smrt-typography-label-large-font",
|
|
157
|
+
"--smrt-typography-label-large-line-height",
|
|
149
158
|
"--smrt-typography-label-large-size",
|
|
150
159
|
"--smrt-typography-label-large-tracking",
|
|
151
160
|
"--smrt-typography-label-large-weight",
|
|
@@ -161,6 +170,7 @@
|
|
|
161
170
|
"--smrt-typography-title-large-font",
|
|
162
171
|
"--smrt-typography-title-large-line-height",
|
|
163
172
|
"--smrt-typography-title-large-size",
|
|
173
|
+
"--smrt-typography-title-large-weight",
|
|
164
174
|
"--smrt-typography-title-medium-font",
|
|
165
175
|
"--smrt-typography-title-medium-font-family",
|
|
166
176
|
"--smrt-typography-title-medium-line-height",
|
|
@@ -177,8 +187,10 @@
|
|
|
177
187
|
"--smrt-typography-weight-semibold",
|
|
178
188
|
"--smrt-z-index-dialog",
|
|
179
189
|
"--smrt-z-index-dropdown",
|
|
190
|
+
"--smrt-z-index-loading",
|
|
180
191
|
"--smrt-z-index-modal",
|
|
181
192
|
"--smrt-z-index-overlay",
|
|
193
|
+
"--smrt-z-index-popover",
|
|
182
194
|
"--smrt-z-index-sticky",
|
|
183
195
|
"--smrt-z-index-toast",
|
|
184
196
|
"--smrt-z-index-tooltip"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Domain-agnostic Svelte 5 UI runtime for SMRT: primitives, i18n client, theme system, and module UI registry",
|
|
6
6
|
"type": "module",
|
|
@@ -127,6 +127,15 @@
|
|
|
127
127
|
"./test-support/*": {
|
|
128
128
|
"types": "./dist/test-support/*.d.ts",
|
|
129
129
|
"default": "./dist/test-support/*.js"
|
|
130
|
+
},
|
|
131
|
+
"./charts": {
|
|
132
|
+
"types": "./dist/charts/index.d.ts",
|
|
133
|
+
"svelte": "./dist/charts/index.js",
|
|
134
|
+
"import": "./dist/charts/index.js"
|
|
135
|
+
},
|
|
136
|
+
"./charts/format": {
|
|
137
|
+
"types": "./dist/charts/format.d.ts",
|
|
138
|
+
"import": "./dist/charts/format.js"
|
|
130
139
|
}
|
|
131
140
|
},
|
|
132
141
|
"files": [
|
|
@@ -155,7 +164,7 @@
|
|
|
155
164
|
"access": "public"
|
|
156
165
|
},
|
|
157
166
|
"dependencies": {
|
|
158
|
-
"@happyvertical/smrt-types": "0.
|
|
167
|
+
"@happyvertical/smrt-types": "0.56.0",
|
|
159
168
|
"esm-env": "^1.2.2"
|
|
160
169
|
},
|
|
161
170
|
"peerDependencies": {
|