basalt-ui 2.18.0 → 2.20.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/CHANGELOG.md +90 -0
- package/MIGRATING.md +238 -12
- package/agent/agents/basalt-design-reviewer.md +2 -2
- package/agent/rules/basalt-charts.md +1 -1
- package/agent/rules/basalt-mantine.md +1 -1
- package/agent/skills/basalt-app/SKILL.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/agent/templates/DESIGN.md.tpl +1 -1
- package/configs/oxlint-plugin.js +33 -19
- package/configs/oxlint-plugin.test.ts +32 -2
- package/dist/charts/ChartCard.d.ts +28 -3
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +33 -11
- package/dist/charts/Donut.d.ts.map +1 -1
- package/dist/charts/Donut.js +13 -1
- package/dist/charts/Heatmap.js +1 -1
- package/dist/charts/Sparkline.d.ts +7 -1
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +137 -18
- package/dist/charts/box.d.ts +2 -0
- package/dist/charts/box.d.ts.map +1 -1
- package/dist/charts/box.js +2 -0
- package/dist/charts/chart-box.module.css +30 -0
- package/dist/charts/chart-box.module.css.d.ts +1 -0
- package/dist/charts/chart-card.module.css +47 -0
- package/dist/charts/chart-card.module.css.d.ts +7 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +35 -8
- package/dist/charts/host.d.ts.map +1 -1
- package/dist/charts/host.js +2 -1
- package/dist/charts/index.d.ts +1 -1
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/sparkline.module.css +59 -0
- package/dist/charts/sparkline.module.css.d.ts +13 -0
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +32 -4
- package/dist/charts/types.d.ts +6 -0
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/commands/notifications/center.d.ts.map +1 -1
- package/dist/commands/notifications/center.js +18 -26
- package/dist/content/callout.d.ts +1 -1
- package/dist/content/callout.d.ts.map +1 -1
- package/dist/content/callout.js +10 -1
- package/dist/content/callout.module.css +15 -3
- package/dist/content/callout.module.css.d.ts +1 -0
- package/dist/controls/sync-button.d.ts +3 -0
- package/dist/controls/sync-button.d.ts.map +1 -1
- package/dist/dashboard/bar-list.d.ts +15 -4
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +56 -19
- package/dist/dashboard/bar-list.module.css +110 -17
- package/dist/dashboard/bar-list.module.css.d.ts +2 -0
- package/dist/dashboard/delta-badge.d.ts +8 -3
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +9 -2
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/meter-model.d.ts +68 -1
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +65 -4
- package/dist/dashboard/meter-parts.d.ts +5 -1
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +234 -60
- package/dist/dashboard/meter.d.ts +38 -6
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +4 -1
- package/dist/dashboard/meter.module.css +209 -13
- package/dist/dashboard/meter.module.css.d.ts +16 -0
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +14 -9
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +14 -25
- package/dist/dashboard/stat-card-parts.d.ts +3 -1
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +18 -3
- package/dist/dashboard/stat-card.d.ts +7 -6
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +51 -83
- package/dist/dashboard/stat-card.module.css +42 -14
- package/dist/dashboard/stat-group.d.ts +11 -2
- package/dist/dashboard/stat-group.d.ts.map +1 -1
- package/dist/dashboard/stat-group.js +9 -7
- package/dist/dashboard/stat-strip.d.ts +50 -0
- package/dist/dashboard/stat-strip.d.ts.map +1 -0
- package/dist/dashboard/stat-strip.js +85 -0
- package/dist/dashboard/stat-strip.module.css +208 -0
- package/dist/dashboard/stat-strip.module.css.d.ts +28 -0
- package/dist/dashboard/widget-header.d.ts +3 -3
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +2 -1
- package/dist/dashboard/widget-header.module.css +38 -7
- package/dist/format/date.d.ts.map +1 -1
- package/dist/format/date.js +4 -3
- package/dist/format/shared.d.ts +6 -0
- package/dist/format/shared.d.ts.map +1 -1
- package/dist/format/shared.js +6 -2
- package/dist/guard/index.d.ts +1 -1
- package/dist/guard/index.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/styles.css +6 -0
- package/dist/theme/card-inset.module.css +76 -0
- package/dist/theme/card-inset.module.css.d.ts +9 -0
- package/dist/theme/chrome-vars.d.ts +29 -17
- package/dist/theme/chrome-vars.d.ts.map +1 -1
- package/dist/theme/chrome-vars.js +18 -8
- package/dist/theme/controls.module.css +3 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +32 -5
- package/dist/theme/nav-link.module.css +8 -10
- package/dist/theme/status-dot.d.ts +7 -0
- package/dist/theme/status-dot.d.ts.map +1 -0
- package/dist/theme/status-dot.js +18 -0
- package/dist/theme/status-dot.module.css +9 -0
- package/dist/theme/status-dot.module.css.d.ts +8 -0
- package/dist/theme/status-verdict.d.ts +10 -0
- package/dist/theme/status-verdict.d.ts.map +1 -0
- package/dist/theme/status-verdict.js +14 -0
- package/dist/theme/status-verdict.module.css +25 -0
- package/dist/theme/status-verdict.module.css.d.ts +9 -0
- package/llms.txt +30 -6
- package/package.json +1 -1
- package/src/charts/ChartCard.tsx +70 -4
- package/src/charts/Donut.tsx +9 -1
- package/src/charts/Heatmap.tsx +1 -1
- package/src/charts/Sparkline.tsx +180 -18
- package/src/charts/box.tsx +2 -0
- package/src/charts/chart-box.module.css +30 -0
- package/src/charts/chart-box.module.css.d.ts +1 -0
- package/src/charts/chart-card.module.css +47 -0
- package/src/charts/chart-card.module.css.d.ts +7 -0
- package/src/charts/compile.ts +42 -9
- package/src/charts/host.tsx +6 -3
- package/src/charts/index.ts +1 -1
- package/src/charts/sparkline.module.css +59 -0
- package/src/charts/sparkline.module.css.d.ts +13 -0
- package/src/charts/state.tsx +44 -4
- package/src/charts/types.ts +6 -0
- package/src/commands/notifications/center.tsx +29 -32
- package/src/content/callout.module.css +15 -3
- package/src/content/callout.module.css.d.ts +1 -0
- package/src/content/callout.tsx +15 -2
- package/src/controls/sync-button.tsx +3 -0
- package/src/dashboard/bar-list.module.css +110 -17
- package/src/dashboard/bar-list.module.css.d.ts +2 -0
- package/src/dashboard/bar-list.tsx +102 -21
- package/src/dashboard/delta-badge.tsx +21 -5
- package/src/dashboard/index.ts +2 -0
- package/src/dashboard/meter-model.ts +132 -4
- package/src/dashboard/meter-parts.tsx +305 -25
- package/src/dashboard/meter.module.css +209 -13
- package/src/dashboard/meter.module.css.d.ts +16 -0
- package/src/dashboard/meter.tsx +42 -7
- package/src/dashboard/query-state.tsx +28 -19
- package/src/dashboard/settings-section.tsx +1 -8
- package/src/dashboard/stat-card-parts.tsx +22 -2
- package/src/dashboard/stat-card.module.css +42 -14
- package/src/dashboard/stat-card.tsx +23 -60
- package/src/dashboard/stat-group.tsx +19 -8
- package/src/dashboard/stat-strip.module.css +208 -0
- package/src/dashboard/stat-strip.module.css.d.ts +28 -0
- package/src/dashboard/stat-strip.tsx +183 -0
- package/src/dashboard/widget-header.module.css +38 -7
- package/src/dashboard/widget-header.tsx +7 -4
- package/src/format/date.ts +6 -3
- package/src/format/shared.ts +11 -2
- package/src/guard/index.ts +1 -1
- package/src/index.ts +7 -0
- package/src/styles.css +6 -0
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +242 -26
- package/src/theme/card-inset.module.css +76 -0
- package/src/theme/card-inset.module.css.d.ts +9 -0
- package/src/theme/chrome-vars.ts +48 -23
- package/src/theme/controls.module.css +3 -0
- package/src/theme/index.ts +40 -6
- package/src/theme/nav-link.module.css +8 -10
- package/src/theme/status-dot.module.css +9 -0
- package/src/theme/status-dot.module.css.d.ts +8 -0
- package/src/theme/status-dot.tsx +31 -0
- package/src/theme/status-verdict.module.css +25 -0
- package/src/theme/status-verdict.module.css.d.ts +9 -0
- package/src/theme/status-verdict.tsx +32 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* StatGroup `variant="strip"`: one joined surface, cells split by 1px hairlines.
|
|
3
|
+
*
|
|
4
|
+
* The hairlines are LEADING borders (inline-start + block-start) on every cell, and `.clip` hides
|
|
5
|
+
* the ones that lead a row or the strip by pulling the grid 1px up/left inside an `overflow: hidden`
|
|
6
|
+
* box. That is why the rail survives any column count and any wrap with no `nth-child` bookkeeping
|
|
7
|
+
* (`stat-group.module.css` needs it because its cells are not clipped). No shadow per cell, no
|
|
8
|
+
* coloured edge: the one surface is the Card's.
|
|
9
|
+
*
|
|
10
|
+
* The column law keys on the CONTAINER like `StatGroup`'s own: two columns at < 480px (the `regular` class boundary) with an odd
|
|
11
|
+
* last cell spanning, never one; up to three below 800px; the full `cols` from 800px.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
.container {
|
|
15
|
+
container-type: inline-size;
|
|
16
|
+
container-name: basalt-grid;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.clip {
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.cells {
|
|
24
|
+
display: grid;
|
|
25
|
+
grid-template-columns: repeat(var(--basalt-strip-cols-sm), minmax(0, 1fr));
|
|
26
|
+
margin: -1px 0 0 -1px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.cell {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: var(--vx-space-stack-sm);
|
|
33
|
+
min-width: 0;
|
|
34
|
+
padding: var(--vx-space-stack-md);
|
|
35
|
+
border-inline-start: 1px solid var(--vx-divider);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* The top line is adjacent-sibling: the first cell draws none (it leads the strip), every later one
|
|
39
|
+
* draws its top edge, which is the rule between wrapped rows. */
|
|
40
|
+
.cell + .cell {
|
|
41
|
+
border-block-start: 1px solid var(--vx-divider);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@container basalt-grid (max-width: 479.9px) {
|
|
45
|
+
.cells {
|
|
46
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.cells > .cell:last-child:nth-child(odd) {
|
|
50
|
+
grid-column: 1 / -1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@container basalt-grid (min-width: 800px) {
|
|
55
|
+
.cells {
|
|
56
|
+
grid-template-columns: repeat(var(--basalt-strip-cols), minmax(0, 1fr));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.captionLine {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
align-items: center;
|
|
64
|
+
column-gap: var(--vx-space-control-gap);
|
|
65
|
+
min-width: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Caption and info glyph are one unit: the caption truncates, the glyph never leaves its line. */
|
|
69
|
+
.lead {
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
column-gap: var(--vx-space-control-gap);
|
|
73
|
+
min-width: 0;
|
|
74
|
+
max-width: 100%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.caption {
|
|
78
|
+
margin: 0;
|
|
79
|
+
min-width: 0;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
text-overflow: ellipsis;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
font-family: var(--basalt-font-mono);
|
|
84
|
+
font-size: var(--vx-text-micro);
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
letter-spacing: 0.06em;
|
|
87
|
+
text-transform: uppercase;
|
|
88
|
+
color: var(--vx-faint);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* The lowercase qualifier is the muted sans (mono is for the UPPERCASE caption only). It is one flex
|
|
92
|
+
* item, so when it does not fit beside the caption it wraps WHOLE onto its own line below. */
|
|
93
|
+
.qualifier {
|
|
94
|
+
font-size: var(--vx-text-micro);
|
|
95
|
+
color: var(--vx-muted);
|
|
96
|
+
overflow-wrap: anywhere;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.valueRow {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
align-items: baseline;
|
|
103
|
+
column-gap: var(--vx-space-stack-sm);
|
|
104
|
+
min-width: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* The numeral face (proportional sans, lining figures; Wave 35 typography law): never mono. */
|
|
108
|
+
.value {
|
|
109
|
+
min-width: 0;
|
|
110
|
+
overflow-wrap: anywhere;
|
|
111
|
+
font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
|
|
112
|
+
font-size: var(--vx-text-kpi);
|
|
113
|
+
line-height: 1.25;
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
letter-spacing: -0.02em;
|
|
116
|
+
font-variant-numeric: lining-nums;
|
|
117
|
+
color: var(--vx-ink);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.unit {
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
font-size: var(--vx-text-sm);
|
|
123
|
+
font-weight: 500;
|
|
124
|
+
color: var(--vx-muted);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.skeletonValue {
|
|
128
|
+
width: 45%;
|
|
129
|
+
height: calc(var(--vx-text-kpi) * 1.25);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.cell[data-stale] {
|
|
133
|
+
/* The package's one dimmed-state value (controls.module.css, panel-row.module.css). */
|
|
134
|
+
opacity: 0.55;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.skeletonRow {
|
|
138
|
+
width: 100%;
|
|
139
|
+
height: 0.75rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.visual {
|
|
143
|
+
min-width: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* A Sparkline's hover readout takes this line above its plot (`charts/sparkline.module.css`). The
|
|
147
|
+
* cell's own stack gap already sits above it; the slot reserves the rest, so the chip never covers
|
|
148
|
+
* the value. */
|
|
149
|
+
.cell {
|
|
150
|
+
--basalt-spark-readout-h: 1.125rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.visual:has([data-basalt-sparkline]) {
|
|
154
|
+
padding-top: max(0px, calc(var(--basalt-spark-readout-h) - var(--vx-space-stack-sm)));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.footer {
|
|
158
|
+
margin-top: auto;
|
|
159
|
+
font-size: var(--vx-text-sm);
|
|
160
|
+
color: var(--vx-muted);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* ── multi-row cell: label · visual · value · delta ──────────────────────────────────────────── */
|
|
164
|
+
|
|
165
|
+
.rows {
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
gap: var(--vx-space-stack-sm);
|
|
169
|
+
margin: 0;
|
|
170
|
+
padding: 0;
|
|
171
|
+
list-style: none;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.row {
|
|
175
|
+
display: grid;
|
|
176
|
+
grid-template-columns: minmax(3.5rem, auto) minmax(0, 1fr) auto auto;
|
|
177
|
+
align-items: center;
|
|
178
|
+
column-gap: var(--vx-space-stack-sm);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.rowLabel {
|
|
182
|
+
font-size: var(--vx-text-sm);
|
|
183
|
+
color: var(--vx-muted);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.rowValue {
|
|
187
|
+
font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
|
|
188
|
+
font-size: var(--vx-text-sm);
|
|
189
|
+
font-weight: 500;
|
|
190
|
+
font-variant-numeric: lining-nums;
|
|
191
|
+
color: var(--vx-ink);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* ── footer row: wider cells under the cells, split by the same hairline ─────────────────────── */
|
|
195
|
+
|
|
196
|
+
.footerRow {
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-wrap: wrap;
|
|
199
|
+
margin-left: -1px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.footerCell {
|
|
203
|
+
flex: 1 1 14rem;
|
|
204
|
+
min-width: 0;
|
|
205
|
+
padding: var(--vx-space-stack-md);
|
|
206
|
+
border-inline-start: 1px solid var(--vx-divider);
|
|
207
|
+
border-block-start: 1px solid var(--vx-divider);
|
|
208
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly container: string
|
|
7
|
+
readonly clip: string
|
|
8
|
+
readonly cells: string
|
|
9
|
+
readonly cell: string
|
|
10
|
+
readonly captionLine: string
|
|
11
|
+
readonly lead: string
|
|
12
|
+
readonly caption: string
|
|
13
|
+
readonly qualifier: string
|
|
14
|
+
readonly valueRow: string
|
|
15
|
+
readonly value: string
|
|
16
|
+
readonly unit: string
|
|
17
|
+
readonly skeletonValue: string
|
|
18
|
+
readonly skeletonRow: string
|
|
19
|
+
readonly visual: string
|
|
20
|
+
readonly footer: string
|
|
21
|
+
readonly rows: string
|
|
22
|
+
readonly row: string
|
|
23
|
+
readonly rowLabel: string
|
|
24
|
+
readonly rowValue: string
|
|
25
|
+
readonly footerRow: string
|
|
26
|
+
readonly footerCell: string
|
|
27
|
+
}
|
|
28
|
+
export default classes
|
|
@@ -36,11 +36,11 @@ export type WidgetHeaderProps = BasaltProps & SlotStylesProps<WidgetHeaderSlot>
|
|
|
36
36
|
* click — so a keyboard user gets it too. Mantine-free: a plain state bubble, not a Tooltip.
|
|
37
37
|
*/
|
|
38
38
|
info?: string;
|
|
39
|
-
/** Pre-formatted metric value (
|
|
39
|
+
/** Pre-formatted metric value (sans, lining figures, hero size, never truncated). Renders on its own row with
|
|
40
40
|
* `delta` under the title row, or on the title row in a card 480px or wider. */
|
|
41
41
|
value?: string;
|
|
42
42
|
/**
|
|
43
|
-
* The value's unit, rendered immediately after it on the hero row: muted,
|
|
43
|
+
* The value's unit, rendered immediately after it on the hero row: muted, sans, `--vx-text-sm`.
|
|
44
44
|
*
|
|
45
45
|
* It exists because `value` is a pre-formatted `string` and a KPI's unit is not part of the
|
|
46
46
|
* number: `412` and `TSS` are two facts at two weights, and jamming them into one string paints
|
|
@@ -79,7 +79,7 @@ export type WidgetHeaderProps = BasaltProps & SlotStylesProps<WidgetHeaderSlot>
|
|
|
79
79
|
/** Trend visual slot, rendered below the metric row. Carries `data-placement="right"` so a
|
|
80
80
|
* wave-3 composer's `bleed` layout can select it. */
|
|
81
81
|
sparkline?: ReactNode;
|
|
82
|
-
/**
|
|
82
|
+
/** Count tag rendered after the title (C11 — every table/list states its count). `0` is a
|
|
83
83
|
* real count and renders, distinct from omitting the prop entirely. */
|
|
84
84
|
count?: number;
|
|
85
85
|
/** Right-aligned slot (`margin-inline-start: auto`) — the C1/C5 home for header actions. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-header.d.ts","sourceRoot":"","sources":["../../src/dashboard/widget-header.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAGjD,OAAO,KAAK,EAA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,+FAA+F;IAC/F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;2DAGuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,+BA2EA;AAED,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,iBAAiB,+BAmEnB"}
|
|
@@ -77,6 +77,7 @@ function InfoGlyph({
|
|
|
77
77
|
ref: triggerRef,
|
|
78
78
|
type: "button",
|
|
79
79
|
"data-basalt-hit": true,
|
|
80
|
+
"data-info-trigger": true,
|
|
80
81
|
className: classes.infoTrigger,
|
|
81
82
|
"aria-label": ariaLabel,
|
|
82
83
|
"aria-describedby": open ? tipId : void 0,
|
|
@@ -145,7 +146,7 @@ function WidgetHeader({
|
|
|
145
146
|
/* @__PURE__ */ jsxs("div", { className: classes.titleRow, children: [
|
|
146
147
|
/* @__PURE__ */ jsxs(Heading, { className: cx(classes.heading, classNames?.title), children: [
|
|
147
148
|
icon !== void 0 && /* @__PURE__ */ jsx(IconSlot, { className: cx(classes.icon, classNames?.icon), children: icon }),
|
|
148
|
-
/* @__PURE__ */ jsx("span", { className: classes.titleText, children: title })
|
|
149
|
+
/* @__PURE__ */ jsx("span", { className: classes.titleText, "data-widget-title": true, children: title })
|
|
149
150
|
] }),
|
|
150
151
|
info !== void 0 && /* @__PURE__ */ jsx(InfoGlyph, { text: info, ...subtitle !== void 0 && { note: subtitle } }),
|
|
151
152
|
info === void 0 && subtitle !== void 0 && /* @__PURE__ */ jsx(
|
|
@@ -143,7 +143,8 @@
|
|
|
143
143
|
border-radius: var(--vx-radius-ctrl);
|
|
144
144
|
background: var(--vx-surface-subtle);
|
|
145
145
|
padding: var(--vx-space-badge-inset-y) var(--vx-space-badge-inset-x);
|
|
146
|
-
font-family: var(--basalt-font-
|
|
146
|
+
font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
|
|
147
|
+
font-variant-numeric: lining-nums;
|
|
147
148
|
font-size: var(--vx-text-xs);
|
|
148
149
|
font-weight: 500;
|
|
149
150
|
color: var(--vx-faint);
|
|
@@ -172,7 +173,8 @@
|
|
|
172
173
|
.value {
|
|
173
174
|
min-width: 0;
|
|
174
175
|
overflow-wrap: anywhere;
|
|
175
|
-
font-family: var(--basalt-font-
|
|
176
|
+
font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
|
|
177
|
+
font-variant-numeric: lining-nums;
|
|
176
178
|
font-size: var(--vx-text-kpi);
|
|
177
179
|
font-weight: 500;
|
|
178
180
|
letter-spacing: -0.02em;
|
|
@@ -180,15 +182,16 @@
|
|
|
180
182
|
}
|
|
181
183
|
|
|
182
184
|
/*
|
|
183
|
-
* The unit beside the hero value.
|
|
184
|
-
* baseline
|
|
185
|
+
* The unit beside the hero value. Sans like the number it qualifies (so `412 TSS` sits on one
|
|
186
|
+
* baseline), `--vx-text-sm` and `--vx-muted` so it never competes with the numeral — the whole
|
|
185
187
|
* point is that a unit is the SMALL half of the pair. `flex-shrink: 0`: a unit clipped to `TS…`
|
|
186
188
|
* would state nothing.
|
|
187
189
|
*/
|
|
188
190
|
.unit {
|
|
189
191
|
flex-shrink: 0;
|
|
190
192
|
align-self: baseline;
|
|
191
|
-
font-family: var(--basalt-font-
|
|
193
|
+
font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
|
|
194
|
+
font-variant-numeric: lining-nums;
|
|
192
195
|
font-size: var(--vx-text-sm);
|
|
193
196
|
font-weight: 500;
|
|
194
197
|
color: var(--vx-muted);
|
|
@@ -247,12 +250,16 @@
|
|
|
247
250
|
* overlay — axe and assistive tech measure the element. The negative margin hands the extra
|
|
248
251
|
* (24 - 11) / 2 back on every side, so the glyph and the row around it keep their drawn size. */
|
|
249
252
|
.infoTrigger {
|
|
253
|
+
--basalt-info-glyph: 11px;
|
|
254
|
+
--basalt-info-ring-offset: 2px;
|
|
255
|
+
--basalt-info-ring-width: 2px;
|
|
250
256
|
display: inline-flex;
|
|
251
257
|
align-items: center;
|
|
252
258
|
justify-content: center;
|
|
253
259
|
min-width: 24px;
|
|
254
260
|
min-height: 24px;
|
|
255
|
-
margin: calc((
|
|
261
|
+
margin: calc((var(--basalt-info-glyph) - 24px) / 2);
|
|
262
|
+
position: relative;
|
|
256
263
|
appearance: none;
|
|
257
264
|
padding: 0;
|
|
258
265
|
border: none;
|
|
@@ -261,6 +268,29 @@
|
|
|
261
268
|
cursor: help;
|
|
262
269
|
}
|
|
263
270
|
|
|
271
|
+
/* The keyboard ring hugs the glyph, not the 24px hit box: drawn on the box it reached 6.5px past
|
|
272
|
+
* the glyph and painted over the title's last letter and a neighbouring status dot. The `::before`
|
|
273
|
+
* is the glyph + the offset on each side, outlined by the ring width, so the ring ends 4px from the
|
|
274
|
+
* glyph — inside the 6px control gap. (`::after` is the hit overlay's.)
|
|
275
|
+
* Forced colors: the ring is an `outline`, which the UA keeps and recolours to a system colour, so
|
|
276
|
+
* it stays visible without a `forced-colors` override. */
|
|
277
|
+
.infoTrigger:focus-visible {
|
|
278
|
+
outline: none;
|
|
279
|
+
|
|
280
|
+
&::before {
|
|
281
|
+
content: '';
|
|
282
|
+
position: absolute;
|
|
283
|
+
top: 50%;
|
|
284
|
+
left: 50%;
|
|
285
|
+
translate: -50% -50%;
|
|
286
|
+
width: calc(var(--basalt-info-glyph) + 2 * var(--basalt-info-ring-offset));
|
|
287
|
+
height: calc(var(--basalt-info-glyph) + 2 * var(--basalt-info-ring-offset));
|
|
288
|
+
border-radius: var(--vx-radius-fine);
|
|
289
|
+
outline: var(--basalt-info-ring-width) solid var(--vx-accent);
|
|
290
|
+
pointer-events: none;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
264
294
|
.infoTrigger:hover,
|
|
265
295
|
.infoTrigger:focus-visible,
|
|
266
296
|
.infoTrigger[data-open='true'] {
|
|
@@ -316,7 +346,8 @@
|
|
|
316
346
|
white-space: nowrap;
|
|
317
347
|
align-items: baseline;
|
|
318
348
|
gap: 3px;
|
|
319
|
-
font-family: var(--basalt-font-
|
|
349
|
+
font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
|
|
350
|
+
font-variant-numeric: lining-nums;
|
|
320
351
|
font-size: var(--vx-text-sm);
|
|
321
352
|
font-weight: 500;
|
|
322
353
|
line-height: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/format/date.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAiC1D,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG;IAC1C,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;CACrC,CAAA;AAED;;;uEAGuE;AACvE,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,MAAM,CAM3F;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG;IAC/C,uGAAuG;IACvG,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;IACnC,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC3B,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/format/date.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAA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,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CASrD;AAED,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG;IAC3C,4GAA4G;IAC5G,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;IACpC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;CACpC,CAAA;AASD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAClC,OAAO,GAAE,eAAoB,GAC5B,MAAM,CAwBR"}
|
package/dist/format/date.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dateFormat, NON_FINITE, numberFormat, toDate } from "./shared.js";
|
|
1
|
+
import { dateFormat, NON_FINITE, numberFormat, resolveLocale, toDate } from "./shared.js";
|
|
2
2
|
const CALENDAR_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
3
3
|
function calendarDate(value, utc) {
|
|
4
4
|
const match = CALENDAR_DATE.exec(value);
|
|
@@ -37,10 +37,11 @@ const RELATIVE_TIME_UNITS = [
|
|
|
37
37
|
const NEGATIVE_ZERO = -0;
|
|
38
38
|
const relativeTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
39
39
|
function relativeTimeFormat(locale, style, numeric) {
|
|
40
|
-
const
|
|
40
|
+
const resolved = resolveLocale(locale);
|
|
41
|
+
const key = `${resolved ?? "\0"}|${style}|${numeric}`;
|
|
41
42
|
const cached = relativeTimeFormatterCache.get(key);
|
|
42
43
|
if (cached !== void 0) return cached;
|
|
43
|
-
const created = new Intl.RelativeTimeFormat(
|
|
44
|
+
const created = new Intl.RelativeTimeFormat(resolved, { style, numeric });
|
|
44
45
|
relativeTimeFormatterCache.set(key, created);
|
|
45
46
|
return created;
|
|
46
47
|
}
|
package/dist/format/shared.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ export type FormatDefaults = {
|
|
|
32
32
|
export declare function defineFormat(next?: FormatDefaults): void;
|
|
33
33
|
/** Clears the {@link defineFormat} defaults back to the runtime's own locale and zone. */
|
|
34
34
|
export declare function resetFormatDefaults(): void;
|
|
35
|
+
/**
|
|
36
|
+
* The ONE locale resolution every formatter shares: the call's own tag, else the
|
|
37
|
+
* {@link defineFormat} default, else `undefined` (the runtime's own locale). Internal — not
|
|
38
|
+
* re-exported from the public barrel.
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveLocale(locale?: string): string | undefined;
|
|
35
41
|
export declare function numberFormat(locale: string | undefined, options: Intl.NumberFormatOptions): Intl.NumberFormat;
|
|
36
42
|
export declare function dateFormat(locale: string | undefined, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
37
43
|
/** What every number/measure formatter accepts. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/format/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,WAAM,CAAA;AAE7B,sDAAsD;AACtD,MAAM,MAAM,YAAY,GAAG;IACzB,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,CAAA;AAWD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,cAAmB,GAAG,IAAI,CAS5D;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,IAAI,IAAI,CAI1C;AAkCD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,mBAAmB,GAChC,IAAI,CAAC,YAAY,CAGnB;AAED,wBAAgB,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M,GAAG,MAAM,GAAG,SAAS,CAEjE;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,mBAAmB,GAChC,IAAI,CAAC,YAAY,CAGnB;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,qBAAqB,GAClC,IAAI,CAAC,cAAc,CAOrB;AAED,mDAAmD;AACnD,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAE/C;+DAC+D;AAC/D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAUlC;AAED;;;;0DAI0D;AAC1D,wBAAgB,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGjE"}
|
package/dist/format/shared.js
CHANGED
|
@@ -38,12 +38,15 @@ function memoize(caches, locale, options, create) {
|
|
|
38
38
|
cache.set(key, created);
|
|
39
39
|
return created;
|
|
40
40
|
}
|
|
41
|
+
function resolveLocale(locale) {
|
|
42
|
+
return locale ?? defaults.locale;
|
|
43
|
+
}
|
|
41
44
|
function numberFormat(locale, options) {
|
|
42
|
-
const resolved = locale
|
|
45
|
+
const resolved = resolveLocale(locale);
|
|
43
46
|
return memoize(numberCaches, resolved, options, () => new Intl.NumberFormat(resolved, options));
|
|
44
47
|
}
|
|
45
48
|
function dateFormat(locale, options) {
|
|
46
|
-
const resolved = locale
|
|
49
|
+
const resolved = resolveLocale(locale);
|
|
47
50
|
const withZone = options.timeZone === void 0 && defaults.timeZone !== void 0 ? { ...options, timeZone: defaults.timeZone } : options;
|
|
48
51
|
return memoize(dateCaches, resolved, withZone, () => new Intl.DateTimeFormat(resolved, withZone));
|
|
49
52
|
}
|
|
@@ -72,6 +75,7 @@ export {
|
|
|
72
75
|
isFiniteNumber,
|
|
73
76
|
numberFormat,
|
|
74
77
|
resetFormatDefaults,
|
|
78
|
+
resolveLocale,
|
|
75
79
|
scaleThousands,
|
|
76
80
|
toDate
|
|
77
81
|
};
|
package/dist/guard/index.d.ts
CHANGED
|
@@ -214,7 +214,7 @@ export declare const GUARD_RULES: {
|
|
|
214
214
|
readonly pattern: RegExp;
|
|
215
215
|
readonly enabled: (cfg: GuardConfig) => boolean;
|
|
216
216
|
readonly appliesTo: (relPath: string) => boolean;
|
|
217
|
-
readonly message: "withBorder on a Card/Paper double-draws the edge — card depth is --vx-shadow-card, which already bakes a 1px ring into the shadow. Drop the prop (docs/DESIGN-SPEC.md doctrine inversion #1) — and fix the inset in the same edit: an explicit p/padding or radius on that Card/Paper is the other half of the idiom, which only the oxlint lane sees (basalt/card-inset);
|
|
217
|
+
readonly message: "withBorder on a Card/Paper double-draws the edge — card depth is --vx-shadow-card, which already bakes a 1px ring into the shadow. Drop the prop (docs/DESIGN-SPEC.md doctrine inversion #1) — and fix the inset in the same edit: an explicit p/padding or radius on that Card/Paper is the other half of the idiom, which only the oxlint lane sees (basalt/card-inset); the theme owns both, so write neither.";
|
|
218
218
|
};
|
|
219
219
|
readonly 'off-system-surface-var': {
|
|
220
220
|
readonly kind: "off-system-surface-var";
|
package/dist/guard/index.js
CHANGED
|
@@ -816,7 +816,7 @@ const GUARD_RULES = {
|
|
|
816
816
|
enabled: (cfg) => cfg.cardWithBorder,
|
|
817
817
|
// JSX-tag-shaped (`<Card withBorder>`) — never appears in CSS text.
|
|
818
818
|
appliesTo: (relPath) => !relPath.endsWith(".css"),
|
|
819
|
-
message:
|
|
819
|
+
message: "withBorder on a Card/Paper double-draws the edge \u2014 card depth is --vx-shadow-card, which already bakes a 1px ring into the shadow. Drop the prop (docs/DESIGN-SPEC.md doctrine inversion #1) \u2014 and fix the inset in the same edit: an explicit p/padding or radius on that Card/Paper is the other half of the idiom, which only the oxlint lane sees (basalt/card-inset); the theme owns both, so write neither."
|
|
820
820
|
},
|
|
821
821
|
"off-system-surface-var": {
|
|
822
822
|
kind: "off-system-surface-var",
|
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,10 @@ export { defineNav, navGroup, navTarget, flattenNav, useBasaltNav, type NavItemI
|
|
|
12
12
|
export { scrollParentOf, useCoarsePointer, type Tone } from './common/index.js';
|
|
13
13
|
export { createBasaltTheme } from './theme/index.js';
|
|
14
14
|
export { ThemeToggle } from './theme/theme-toggle.js';
|
|
15
|
+
export { StatusDot, type StatusDotProps } from './theme/status-dot.js';
|
|
16
|
+
export { StatusVerdict, type StatusVerdictProps } from './theme/status-verdict.js';
|
|
15
17
|
export { BasaltShell, PageBar, PageAside, useSizeClass, PageTitle, type ShellBaseProps, type SidebarBlock, type SettingsMenuItem, } from './shell/index.js';
|
|
16
|
-
export { WidgetHeader, DeltaBadge, Section, StatCard, type StatCardBreakdownRow, type StatCardSparklineSize, StatGroup, EmptyState, SettingsSection, SettingsRow, DangerZone, Meter, type MeterProps, BarList, type BarListProps, } from './dashboard/index.js';
|
|
18
|
+
export { WidgetHeader, DeltaBadge, Section, StatCard, type StatCardBreakdownRow, type StatCardSparklineSize, StatGroup, type StatStripCell, type StatStripRow, EmptyState, SettingsSection, SettingsRow, DangerZone, Meter, type MeterProps, type MeterSegment, type MeterTick, type MeterZone, BarList, type BarListProps, } from './dashboard/index.js';
|
|
17
19
|
export { unwrap } from './unwrap.js';
|
|
18
20
|
export type { BasaltRegister, SeriesKey } from './register.js';
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"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SAAS,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
import { scrollParentOf, useCoarsePointer } from "./common/index.js";
|
|
14
14
|
import { createBasaltTheme } from "./theme/index.js";
|
|
15
15
|
import { ThemeToggle } from "./theme/theme-toggle.js";
|
|
16
|
+
import { StatusDot } from "./theme/status-dot.js";
|
|
17
|
+
import { StatusVerdict } from "./theme/status-verdict.js";
|
|
16
18
|
import {
|
|
17
19
|
BasaltShell,
|
|
18
20
|
PageBar,
|
|
@@ -50,6 +52,8 @@ export {
|
|
|
50
52
|
SettingsSection,
|
|
51
53
|
StatCard,
|
|
52
54
|
StatGroup,
|
|
55
|
+
StatusDot,
|
|
56
|
+
StatusVerdict,
|
|
53
57
|
ThemeToggle,
|
|
54
58
|
WidgetHeader,
|
|
55
59
|
basaltRouterOptions,
|
package/dist/styles.css
CHANGED
|
@@ -46,6 +46,9 @@
|
|
|
46
46
|
'Hubot Sans Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica,
|
|
47
47
|
Arial, sans-serif;
|
|
48
48
|
--basalt-font-mono: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', Menlo, monospace;
|
|
49
|
+
/* Hero values, unit/count/delta text, bar-list and meter figures: proportional sans, lining
|
|
50
|
+
figures. Set to `var(--basalt-font-mono)` to restore the pre-Wave-35 mono numerals. */
|
|
51
|
+
--basalt-font-numeral: var(--basalt-font-sans);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
|
|
@@ -153,6 +156,9 @@
|
|
|
153
156
|
h6,
|
|
154
157
|
.mantine-Title-root {
|
|
155
158
|
font-stretch: var(--basalt-font-head-stretch, 88%);
|
|
159
|
+
/* Hubot Sans draws a slashed zero by default; a heading numeral is a figure, not code. */
|
|
160
|
+
font-feature-settings: 'zero' 0;
|
|
161
|
+
font-variant-numeric: lining-nums;
|
|
156
162
|
}
|
|
157
163
|
|
|
158
164
|
/* Scrollbars (docs/DESIGN-SPEC.md §5): 9px, ink-mix thumb (stronger on hover), radius 6,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The theme owns the card inset (Wave 35, ledger rows 163/165). Mantine's own defaults miss the law:
|
|
3
|
+
* a bare `Card` is 16 px all round and a bare `Paper` is 0. Both resolve here to the density-scaled
|
|
4
|
+
* 12/16 tokens, so a consumer writes nothing.
|
|
5
|
+
*
|
|
6
|
+
* `--card-inset-y/x` are the one pair every part reads: the root's padding, a `Card.Section`'s
|
|
7
|
+
* negative margins (Mantine derives them from ONE `--card-padding`, which cannot express 12/16),
|
|
8
|
+
* and `variant="flush"`, which zeroes the pair — a flush card's sections then cancel nothing.
|
|
9
|
+
*
|
|
10
|
+
* Components that render a `Paper` of their own (Modal / Drawer content, Dialog, ActionBar,
|
|
11
|
+
* FloatingWindow) carry their padding on other parts; the `:not()` list keeps this off them. It sits in
|
|
12
|
+
* `:where()` so the rule stays (0,1,0) and a consumer's own class-based padding wins on source order.
|
|
13
|
+
*/
|
|
14
|
+
/* `--card-padding` is Mantine's: the class default is neutralised to the guaranteed-invalid value so
|
|
15
|
+
`var()` falls through to the token, while an inline `--card-padding` (what a Card `padding` prop
|
|
16
|
+
writes) is still seen and wins. Doubled class: it must out-rank Mantine's own `--card-padding`. */
|
|
17
|
+
.inset.inset {
|
|
18
|
+
--card-padding: initial;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.inset {
|
|
22
|
+
--card-inset-y: var(--card-padding, var(--vx-space-card-inset-y, 12px));
|
|
23
|
+
--card-inset-x: var(--card-padding, var(--vx-space-card-inset-x, 16px));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.inset[data-variant='flush'] {
|
|
27
|
+
--card-inset-y: 0px;
|
|
28
|
+
--card-inset-x: 0px;
|
|
29
|
+
padding: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.inset:where(
|
|
33
|
+
:not(
|
|
34
|
+
[data-variant='flush'],
|
|
35
|
+
[class*='mantine-Modal-'],
|
|
36
|
+
[class*='mantine-Drawer-'],
|
|
37
|
+
[class*='mantine-Dialog-'],
|
|
38
|
+
[class*='mantine-ActionBar-'],
|
|
39
|
+
[class*='mantine-FloatingWindow-']
|
|
40
|
+
)
|
|
41
|
+
) {
|
|
42
|
+
padding: var(--card-inset-y) var(--card-inset-x);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.section[data-orientation='vertical'] {
|
|
46
|
+
margin-inline: calc(var(--card-inset-x, 16px) * -1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.section[data-orientation='vertical']:first-child {
|
|
50
|
+
margin-top: calc(var(--card-inset-y, 12px) * -1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.section[data-orientation='vertical']:last-child {
|
|
54
|
+
margin-bottom: calc(var(--card-inset-y, 12px) * -1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.section[data-orientation='vertical'][data-inherit-padding] {
|
|
58
|
+
padding-inline: var(--card-inset-x, 16px);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.section[data-orientation='horizontal'] {
|
|
62
|
+
margin-block: calc(var(--card-inset-y, 12px) * -1);
|
|
63
|
+
margin-inline: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.section[data-orientation='horizontal']:first-child {
|
|
67
|
+
margin-inline-start: calc(var(--card-inset-x, 16px) * -1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.section[data-orientation='horizontal']:last-child {
|
|
71
|
+
margin-inline-end: calc(var(--card-inset-x, 16px) * -1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.section[data-orientation='horizontal'][data-inherit-padding] {
|
|
75
|
+
padding-block: var(--card-inset-y, 12px);
|
|
76
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly inset: string
|
|
7
|
+
readonly section: string
|
|
8
|
+
}
|
|
9
|
+
export default classes
|