basalt-ui 2.15.0 → 2.17.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 +157 -105
- package/MIGRATING.md +160 -12
- package/agent/agents/basalt-design-reviewer.md +3 -3
- package/agent/rules/basalt-mantine.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +2 -2
- package/configs/card-inset.test.ts +57 -0
- package/configs/oxlint-basalt.json +1 -1
- package/configs/oxlint-plugin.js +42 -18
- package/configs/oxlint-plugin.test.ts +37 -6
- package/dist/agent/chat/thread-message.js +1 -1
- package/dist/agent/chat/thread-outcome-card.js +1 -1
- package/dist/charts/ChartCard.js +1 -1
- package/dist/charts/Donut.d.ts.map +1 -1
- package/dist/charts/Donut.js +2 -2
- package/dist/charts/DualPanel.js +2 -2
- package/dist/charts/Heatmap.d.ts.map +1 -1
- package/dist/charts/Heatmap.js +2 -2
- package/dist/charts/MirroredBars.js +2 -2
- package/dist/charts/Sparkline.d.ts +4 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +3 -3
- package/dist/charts/chart-card.module.css +2 -2
- package/dist/charts/compile.d.ts +8 -3
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +19 -9
- package/dist/charts/cursor.d.ts +14 -1
- package/dist/charts/cursor.d.ts.map +1 -1
- package/dist/charts/cursor.js +29 -3
- package/dist/charts/date-tick-format.d.ts +17 -0
- package/dist/charts/date-tick-format.d.ts.map +1 -0
- package/dist/charts/date-tick-format.js +81 -0
- package/dist/charts/panel.d.ts +2 -1
- package/dist/charts/panel.d.ts.map +1 -1
- package/dist/charts/panel.js +3 -2
- package/dist/charts/types.d.ts +5 -1
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/cli/shot/board.js +1 -1
- package/dist/cli/shot/capture.d.ts +16 -0
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +24 -3
- package/dist/cli/shot/measure.d.ts +21 -2
- package/dist/cli/shot/measure.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +20 -5
- package/dist/cli/shot/playwright.d.ts +4 -0
- package/dist/cli/shot/playwright.d.ts.map +1 -1
- package/dist/cli/shot/types.d.ts +3 -2
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.d.ts +2 -2
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +12 -14
- package/dist/dashboard/query-state.d.ts +35 -0
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +12 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +5 -2
- package/dist/dashboard/stat-card-parts.d.ts +40 -0
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -0
- package/dist/dashboard/stat-card-parts.js +55 -0
- package/dist/dashboard/stat-card.d.ts +46 -34
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +157 -88
- package/dist/dashboard/stat-card.module.css +222 -9
- package/dist/dashboard/stat-card.module.css.d.ts +20 -0
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +73 -9
- package/dist/dashboard/widget-header.module.css +28 -20
- package/dist/guard/guard-hook.d.ts.map +1 -1
- package/dist/guard/index.d.ts +4 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +18 -4
- package/dist/guard/vx-names.d.ts.map +1 -1
- package/dist/guard/vx-names.js +1 -0
- package/dist/shell/app-mobile-nav.module.css +2 -2
- package/dist/shell/app-sidebar-account.js +1 -1
- package/dist/shell/app-sidebar.js +2 -2
- package/dist/shell/app-sidebar.module.css +8 -8
- package/dist/shell/index.js +5 -1
- package/dist/shell/page-bar.js +1 -1
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +3 -0
- package/dist/theme/chrome-vars.d.ts +82 -0
- package/dist/theme/chrome-vars.d.ts.map +1 -0
- package/dist/theme/chrome-vars.js +36 -0
- package/dist/theme/controls.module.css +20 -1
- package/dist/theme/controls.module.css.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +61 -54
- package/dist/tokens/core.d.ts +10 -4
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +16 -10
- package/dist/tokens/ctl-vars.d.ts +15 -0
- package/dist/tokens/ctl-vars.d.ts.map +1 -0
- package/dist/tokens/ctl-vars.js +22 -0
- package/dist/tokens/derive.d.ts.map +1 -1
- package/dist/tokens/derive.js +2 -2
- package/dist/tokens/palette.d.ts +37 -29
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +32 -21
- package/dist/tokens/space-scale.d.ts +14 -0
- package/dist/tokens/space-scale.d.ts.map +1 -0
- package/dist/tokens/space-scale.js +10 -0
- package/llms.txt +6 -3
- package/package.json +1 -1
- package/src/agent/chat/thread-message.tsx +1 -1
- package/src/agent/chat/thread-outcome-card.tsx +2 -2
- package/src/charts/ChartCard.tsx +1 -1
- package/src/charts/Donut.tsx +2 -2
- package/src/charts/DualPanel.tsx +2 -2
- package/src/charts/Heatmap.tsx +2 -2
- package/src/charts/MirroredBars.tsx +2 -2
- package/src/charts/Sparkline.tsx +7 -5
- package/src/charts/chart-card.module.css +2 -2
- package/src/charts/compile.ts +31 -11
- package/src/charts/cursor.ts +48 -3
- package/src/charts/date-tick-format.ts +132 -0
- package/src/charts/panel.tsx +5 -3
- package/src/charts/types.ts +5 -1
- package/src/cli/shot/board.ts +1 -1
- package/src/cli/shot/capture.ts +35 -3
- package/src/cli/shot/measure.ts +33 -6
- package/src/cli/shot/playwright.ts +1 -1
- package/src/cli/shot/types.ts +3 -2
- package/src/dashboard/delta-badge.tsx +24 -18
- package/src/dashboard/query-state.tsx +38 -0
- package/src/dashboard/settings-section.tsx +5 -2
- package/src/dashboard/stat-card-parts.tsx +108 -0
- package/src/dashboard/stat-card.module.css +222 -9
- package/src/dashboard/stat-card.module.css.d.ts +20 -0
- package/src/dashboard/stat-card.tsx +291 -183
- package/src/dashboard/widget-header.module.css +28 -20
- package/src/dashboard/widget-header.tsx +103 -7
- package/src/guard/guard-hook.ts +3 -1
- package/src/guard/index.ts +27 -13
- package/src/guard/vx-names.ts +1 -0
- package/src/shell/app-mobile-nav.module.css +2 -2
- package/src/shell/app-sidebar-account.tsx +1 -1
- package/src/shell/app-sidebar.module.css +8 -8
- package/src/shell/app-sidebar.tsx +2 -2
- package/src/shell/index.tsx +10 -4
- package/src/shell/page-bar.tsx +1 -1
- package/src/table/data-table.tsx +10 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +185 -85
- package/src/theme/chrome-vars.ts +111 -0
- package/src/theme/controls.module.css +20 -1
- package/src/theme/controls.module.css.d.ts +1 -0
- package/src/theme/ctl-theme.tsx +1 -1
- package/src/theme/index.ts +82 -124
- package/src/tokens/core.ts +16 -8
- package/src/tokens/ctl-vars.ts +32 -0
- package/src/tokens/derive.ts +7 -2
- package/src/tokens/palette.ts +40 -29
- package/src/tokens/space-scale.ts +13 -0
|
@@ -5,7 +5,18 @@
|
|
|
5
5
|
* than 480px (`container: basalt-card`, set on the Card root in `stat-card.tsx`).
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/* Foot geometry, single-sourced: the visual slot (SPEC § 6.2: 22), one `sm` footer line (20) and the
|
|
9
|
+
* 4px between them. The foot reserves all three whenever it exists (`.foot`), which is what keeps a
|
|
10
|
+
* card with a sparkline and one without a footer the same height. */
|
|
8
11
|
.body {
|
|
12
|
+
--basalt-stat-visual-h: 1.375rem;
|
|
13
|
+
--basalt-stat-footer-h: 1.25rem;
|
|
14
|
+
--basalt-stat-foot-gap: 0.25rem;
|
|
15
|
+
/* The figure's size and line box, in one place: `.value`, the empty line and the pending skeleton
|
|
16
|
+
* all read them, so nothing moves when a reading lands. */
|
|
17
|
+
--basalt-stat-figure-size: var(--vx-text-kpi);
|
|
18
|
+
--basalt-stat-figure-line: 1.25;
|
|
19
|
+
--basalt-stat-figure-h: calc(var(--basalt-stat-figure-size) * var(--basalt-stat-figure-line));
|
|
9
20
|
display: flex;
|
|
10
21
|
flex-direction: column;
|
|
11
22
|
gap: var(--vx-space-stat-card-gap);
|
|
@@ -16,6 +27,210 @@
|
|
|
16
27
|
min-width: 0;
|
|
17
28
|
}
|
|
18
29
|
|
|
30
|
+
/* ── caption row ─────────────────────────────────────────────────────────────────────────────── */
|
|
31
|
+
|
|
32
|
+
/* `captionMain` takes the row; the actions slot sits at its end. The row is 24px (the widget control
|
|
33
|
+
* step) so a card with a kebab is the same height as one without. */
|
|
34
|
+
.captionRow {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: flex-start;
|
|
37
|
+
gap: var(--vx-space-control-gap, 0.375rem);
|
|
38
|
+
min-height: calc(var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Wraps on purpose: when caption + info + qualifier do not fit, the qualifier drops UNDER the caption
|
|
42
|
+
* instead of truncating either — the container's width decides, never the viewport's. */
|
|
43
|
+
.captionMain {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex: 1 1 0;
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
align-items: center;
|
|
48
|
+
/* Caption left, qualifier right; a qualifier that wraps is alone on its line, so it sits at the start. */
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
column-gap: var(--vx-space-control-gap, 0.375rem);
|
|
51
|
+
min-width: 0;
|
|
52
|
+
min-height: calc(var(--vx-space-control-height-widget, 1.5rem) * var(--mantine-scale, 1));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Caption and info glyph travel together: the pair is the first item of the row. */
|
|
56
|
+
.lead {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
column-gap: var(--vx-space-control-gap, 0.375rem);
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.caption {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 5px;
|
|
67
|
+
margin: 0;
|
|
68
|
+
min-width: 0;
|
|
69
|
+
font-family: var(--basalt-font-mono);
|
|
70
|
+
font-size: var(--vx-text-micro);
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
text-transform: uppercase;
|
|
73
|
+
letter-spacing: 0.06em;
|
|
74
|
+
color: var(--vx-faint);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.captionText {
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.icon {
|
|
84
|
+
color: var(--vx-faint);
|
|
85
|
+
--vx-space-icon-size: 0.875rem;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.qualifier {
|
|
89
|
+
font-family: var(--basalt-font-mono);
|
|
90
|
+
font-size: var(--vx-text-micro);
|
|
91
|
+
color: var(--vx-muted);
|
|
92
|
+
/* Wraps before it is ever cut: a qualifier too long for the row on its own line breaks its words. */
|
|
93
|
+
overflow-wrap: anywhere;
|
|
94
|
+
min-width: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Law C15: the shared hit overlay; `--vx-hit-gap` caps the expansion at the control gap. */
|
|
98
|
+
.actions {
|
|
99
|
+
--vx-hit-gap: var(--vx-space-control-gap);
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
flex: none;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: var(--vx-space-control-gap, 0.375rem);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ── value row ───────────────────────────────────────────────────────────────────────────────── */
|
|
107
|
+
|
|
108
|
+
/* The figure and its unit share a baseline; the delta follows them, on the same baseline, and wraps
|
|
109
|
+
* under when the card is too narrow for all three. Three sizes only: micro, sm, hero. */
|
|
110
|
+
.valueRow {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-wrap: wrap;
|
|
113
|
+
align-items: baseline;
|
|
114
|
+
column-gap: var(--vx-space-stack-sm);
|
|
115
|
+
row-gap: 2px;
|
|
116
|
+
min-width: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.figure {
|
|
120
|
+
display: inline-flex;
|
|
121
|
+
align-items: baseline;
|
|
122
|
+
gap: 4px;
|
|
123
|
+
min-width: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* NEVER truncated: the numeral IS the content. It shrinks with the card's own width instead (the
|
|
127
|
+
* `cqi` clamp below), and `overflow-wrap` breaks a pathological string rather than clipping it. */
|
|
128
|
+
.value {
|
|
129
|
+
min-width: 0;
|
|
130
|
+
overflow-wrap: anywhere;
|
|
131
|
+
font-family: var(--basalt-font-mono);
|
|
132
|
+
font-size: var(--basalt-stat-figure-size);
|
|
133
|
+
line-height: var(--basalt-stat-figure-line);
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
letter-spacing: -0.02em;
|
|
136
|
+
color: var(--vx-ink);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Mono like the number it qualifies, `sm` and muted: the SMALL half of the pair. Never shrinks — a
|
|
140
|
+
* unit clipped to `TS…` would state nothing. */
|
|
141
|
+
.unit {
|
|
142
|
+
flex-shrink: 0;
|
|
143
|
+
font-family: var(--basalt-font-mono);
|
|
144
|
+
font-size: var(--vx-text-sm);
|
|
145
|
+
font-weight: 500;
|
|
146
|
+
color: var(--vx-muted);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* The numeral shrinks with its card (`cqi` resolves against the card's container wherever the var is
|
|
150
|
+
* read). `(width >= 0px)` is always true but only inside a `basalt-card` container. */
|
|
151
|
+
@container basalt-card (width >= 0px) {
|
|
152
|
+
.body {
|
|
153
|
+
--basalt-stat-figure-size: clamp(var(--vx-text-lg), 8cqi, var(--vx-text-kpi));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* ── states ──────────────────────────────────────────────────────────────────────────────────── */
|
|
158
|
+
|
|
159
|
+
/* The empty branch: one muted line in the figure's place, at the figure row's height. */
|
|
160
|
+
.empty {
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
margin: 0;
|
|
164
|
+
min-height: var(--basalt-stat-figure-h);
|
|
165
|
+
font-size: var(--vx-text-sm);
|
|
166
|
+
color: var(--vx-muted);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* The pending skeleton holds the card's own footprint: a value bar at the figure's height, the
|
|
170
|
+
* visual slot at 22, the footer at one `sm` line. */
|
|
171
|
+
.skeletonValue {
|
|
172
|
+
width: 45%;
|
|
173
|
+
height: var(--basalt-stat-figure-h);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.skeletonVisual {
|
|
177
|
+
--skeleton-radius: 0;
|
|
178
|
+
height: var(--basalt-stat-visual-h);
|
|
179
|
+
margin-inline: calc(-1 * var(--vx-space-card-inset-x, 1rem));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.sparklineRight .skeletonVisual {
|
|
183
|
+
flex: 1 1 auto;
|
|
184
|
+
margin-inline: 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.skeletonRowBox {
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
min-height: var(--vx-space-control-height-tag);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.skeletonRow {
|
|
194
|
+
width: 60%;
|
|
195
|
+
height: 0.625rem;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.skeletonFooter {
|
|
199
|
+
width: 55%;
|
|
200
|
+
height: 0.75rem;
|
|
201
|
+
margin-block: 0.25rem;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* ── foot: the visual and its footer line ────────────────────────────────────────────────────── */
|
|
205
|
+
|
|
206
|
+
/* Pinned to the card's bottom (`margin-top: auto`) and reserving visual + gap + footer whenever it
|
|
207
|
+
* exists, bottom-aligned, so the visual and the footer never move when one of them is absent. */
|
|
208
|
+
.foot {
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
justify-content: flex-end;
|
|
212
|
+
gap: var(--basalt-stat-foot-gap);
|
|
213
|
+
margin-top: auto;
|
|
214
|
+
min-width: 0;
|
|
215
|
+
min-height: calc(
|
|
216
|
+
var(--basalt-stat-visual-h) + var(--basalt-stat-foot-gap) + var(--basalt-stat-footer-h)
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.foot[data-band='false'] {
|
|
221
|
+
min-height: var(--basalt-stat-footer-h);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.footer {
|
|
225
|
+
margin: 0;
|
|
226
|
+
overflow: hidden;
|
|
227
|
+
text-overflow: ellipsis;
|
|
228
|
+
white-space: nowrap;
|
|
229
|
+
font-size: var(--vx-text-sm);
|
|
230
|
+
line-height: var(--basalt-stat-footer-h);
|
|
231
|
+
color: var(--vx-muted);
|
|
232
|
+
}
|
|
233
|
+
|
|
19
234
|
/*
|
|
20
235
|
* `right` placement's second row (measured defect: the "···" actions trigger, and the "Data"
|
|
21
236
|
* select, sat ~74-88px in from the card's right edge — a phone-only 13px is correct). The cause was
|
|
@@ -122,9 +337,8 @@
|
|
|
122
337
|
}
|
|
123
338
|
|
|
124
339
|
.sparklineBleed {
|
|
125
|
-
|
|
126
|
-
margin-inline: calc(-1 * var(--
|
|
127
|
-
margin-bottom: calc(-1 * var(--mantine-spacing-xs));
|
|
340
|
+
height: var(--basalt-stat-visual-h);
|
|
341
|
+
margin-inline: calc(-1 * var(--vx-space-card-inset-x, 1rem));
|
|
128
342
|
}
|
|
129
343
|
|
|
130
344
|
/* Asks for `StatCard`'s `SPARKLINE_RIGHT_WIDTH`/`_HEIGHT` (handed down as custom properties, so this
|
|
@@ -132,12 +346,12 @@
|
|
|
132
346
|
* this restructure keeps at the SPARKLINE's own level rather than the row's: `.metricsRow` does not
|
|
133
347
|
* set `align-items: flex-end` itself, because a card with no breakdown would then need nothing to
|
|
134
348
|
* anchor against — only the sparkline opts into sitting at the row's bottom edge, which matters once
|
|
135
|
-
* a breakdown taller than the trend's own
|
|
349
|
+
* a breakdown taller than the trend's own 22px is the row's other child. */
|
|
136
350
|
.sparklineRight {
|
|
137
351
|
display: flex;
|
|
138
352
|
flex: 0 1 var(--basalt-stat-sparkline-w, 4.5rem);
|
|
139
353
|
min-width: 0;
|
|
140
|
-
height: var(--basalt-stat-sparkline-h, 1.
|
|
354
|
+
height: var(--basalt-stat-sparkline-h, 1.375rem);
|
|
141
355
|
align-items: flex-end;
|
|
142
356
|
align-self: flex-end;
|
|
143
357
|
overflow: hidden;
|
|
@@ -151,15 +365,14 @@
|
|
|
151
365
|
}
|
|
152
366
|
|
|
153
367
|
/* The row became a COLUMN, so `flex-basis` is now the main-axis HEIGHT — the 72px width would
|
|
154
|
-
* become a 72px-tall box around
|
|
155
|
-
* same
|
|
368
|
+
* become a 72px-tall box around 22px of bars. `flex: none` + the height keeps the bled trend the
|
|
369
|
+
* same 22px it is beside a hero row. `align-self: stretch` resets the row-only `flex-end` above:
|
|
156
370
|
* the cross axis is horizontal now, and this slot must fill the card's width like `.sparklineBleed`
|
|
157
371
|
* does, not shrink to its content and sit flush right. */
|
|
158
372
|
.metricsRow .sparklineRight {
|
|
159
373
|
flex: none;
|
|
160
374
|
align-self: stretch;
|
|
161
375
|
margin-top: auto;
|
|
162
|
-
margin-inline: calc(-1 * var(--
|
|
163
|
-
margin-bottom: calc(-1 * var(--mantine-spacing-xs));
|
|
376
|
+
margin-inline: calc(-1 * var(--vx-space-card-inset-x, 1rem));
|
|
164
377
|
}
|
|
165
378
|
}
|
|
@@ -4,6 +4,26 @@
|
|
|
4
4
|
*/
|
|
5
5
|
declare const classes: {
|
|
6
6
|
readonly body: string
|
|
7
|
+
readonly captionRow: string
|
|
8
|
+
readonly captionMain: string
|
|
9
|
+
readonly lead: string
|
|
10
|
+
readonly caption: string
|
|
11
|
+
readonly captionText: string
|
|
12
|
+
readonly icon: string
|
|
13
|
+
readonly qualifier: string
|
|
14
|
+
readonly actions: string
|
|
15
|
+
readonly valueRow: string
|
|
16
|
+
readonly figure: string
|
|
17
|
+
readonly value: string
|
|
18
|
+
readonly unit: string
|
|
19
|
+
readonly empty: string
|
|
20
|
+
readonly skeletonValue: string
|
|
21
|
+
readonly skeletonVisual: string
|
|
22
|
+
readonly skeletonFooter: string
|
|
23
|
+
readonly skeletonRowBox: string
|
|
24
|
+
readonly skeletonRow: string
|
|
25
|
+
readonly foot: string
|
|
26
|
+
readonly footer: string
|
|
7
27
|
readonly header: string
|
|
8
28
|
readonly metricsRow: string
|
|
9
29
|
readonly breakdown: string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-header.d.ts","sourceRoot":"","sources":["../../src/dashboard/widget-header.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,SAAS,
|
|
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,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAGlD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE7D;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEnE,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,eAAe,CAAC,gBAAgB,CAAC,GAAG;IAClC;;;;gDAI4C;IAC5C,IAAI,EAAE,gBAAgB,CAAA;IACtB,iDAAiD;IAC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EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,+FAA+F;IAC/F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;2DAGuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,+BA0EA;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,+BAiEnB"}
|
|
@@ -1,9 +1,48 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useId, useRef, useState } from "react";
|
|
3
|
+
import { useIsomorphicLayoutEffect } from "../common/isomorphic-layout-effect.js";
|
|
3
4
|
import { cx } from "../common/props.js";
|
|
4
5
|
import { IconSlot } from "../theme/icon-slot.js";
|
|
5
6
|
import { DeltaBadge } from "./delta-badge.js";
|
|
6
7
|
import classes from "./widget-header.module.css";
|
|
8
|
+
const BUBBLE_GAP = 7;
|
|
9
|
+
const BUBBLE_EDGE = 8;
|
|
10
|
+
function useBubblePosition(open, triggerRef, bubbleRef) {
|
|
11
|
+
const [pos, setPos] = useState(null);
|
|
12
|
+
useIsomorphicLayoutEffect(() => {
|
|
13
|
+
if (!open) return;
|
|
14
|
+
const bubbleEl = bubbleRef.current;
|
|
15
|
+
if (bubbleEl !== null && typeof bubbleEl.showPopover === "function") bubbleEl.showPopover();
|
|
16
|
+
const place = () => {
|
|
17
|
+
const trigger = triggerRef.current;
|
|
18
|
+
const bubble = bubbleRef.current;
|
|
19
|
+
if (trigger === null || bubble === null) return;
|
|
20
|
+
const t = trigger.getBoundingClientRect();
|
|
21
|
+
const b = bubble.getBoundingClientRect();
|
|
22
|
+
const viewW = document.documentElement.clientWidth;
|
|
23
|
+
const viewH = document.documentElement.clientHeight;
|
|
24
|
+
const below = t.bottom + BUBBLE_GAP;
|
|
25
|
+
const above = t.top - BUBBLE_GAP - b.height;
|
|
26
|
+
const top = below + b.height > viewH - BUBBLE_EDGE && above >= BUBBLE_EDGE ? above : below;
|
|
27
|
+
const left = Math.max(BUBBLE_EDGE, Math.min(t.left, viewW - BUBBLE_EDGE - b.width));
|
|
28
|
+
setPos((prev) => prev?.top === top && prev.left === left ? prev : { top, left });
|
|
29
|
+
};
|
|
30
|
+
place();
|
|
31
|
+
window.addEventListener("scroll", place, true);
|
|
32
|
+
window.addEventListener("resize", place);
|
|
33
|
+
const observer = typeof ResizeObserver === "undefined" || bubbleRef.current === null ? void 0 : new ResizeObserver(place);
|
|
34
|
+
if (observer !== void 0 && bubbleRef.current !== null) observer.observe(bubbleRef.current);
|
|
35
|
+
return () => {
|
|
36
|
+
window.removeEventListener("scroll", place, true);
|
|
37
|
+
window.removeEventListener("resize", place);
|
|
38
|
+
observer?.disconnect();
|
|
39
|
+
if (bubbleEl !== null && typeof bubbleEl.hidePopover === "function" && bubbleEl.matches(":popover-open")) {
|
|
40
|
+
bubbleEl.hidePopover();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, [open, triggerRef, bubbleRef]);
|
|
44
|
+
return { pos, setPos };
|
|
45
|
+
}
|
|
7
46
|
function InfoGlyph({
|
|
8
47
|
text,
|
|
9
48
|
note,
|
|
@@ -13,15 +52,24 @@ function InfoGlyph({
|
|
|
13
52
|
const [open, setOpen] = useState(false);
|
|
14
53
|
const tipId = useId();
|
|
15
54
|
const triggerRef = useRef(null);
|
|
55
|
+
const bubbleRef = useRef(null);
|
|
56
|
+
const { pos, setPos } = useBubblePosition(open, triggerRef, bubbleRef);
|
|
57
|
+
const close = () => {
|
|
58
|
+
setOpen(false);
|
|
59
|
+
setPos(null);
|
|
60
|
+
};
|
|
16
61
|
useEffect(() => {
|
|
17
62
|
if (!open) return;
|
|
18
63
|
const handlePointerDown = (event) => {
|
|
19
|
-
|
|
64
|
+
const target = event.target;
|
|
65
|
+
if (!(target instanceof Node)) return;
|
|
66
|
+
if (triggerRef.current?.contains(target) || bubbleRef.current?.contains(target)) return;
|
|
20
67
|
setOpen(false);
|
|
68
|
+
setPos(null);
|
|
21
69
|
};
|
|
22
70
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
23
71
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
24
|
-
}, [open]);
|
|
72
|
+
}, [open, setPos]);
|
|
25
73
|
return /* @__PURE__ */ jsxs("span", { className: cx(classes.info, className), children: [
|
|
26
74
|
/* @__PURE__ */ jsx(
|
|
27
75
|
"button",
|
|
@@ -34,20 +82,36 @@ function InfoGlyph({
|
|
|
34
82
|
"aria-describedby": open ? tipId : void 0,
|
|
35
83
|
"data-open": open,
|
|
36
84
|
onMouseEnter: () => setOpen(true),
|
|
37
|
-
onMouseLeave:
|
|
85
|
+
onMouseLeave: close,
|
|
38
86
|
onFocus: () => setOpen(true),
|
|
39
|
-
onBlur:
|
|
87
|
+
onBlur: close,
|
|
40
88
|
onClick: () => setOpen(true),
|
|
41
89
|
onKeyDown: (event) => {
|
|
42
|
-
if (event.key === "Escape")
|
|
90
|
+
if (event.key === "Escape") close();
|
|
43
91
|
},
|
|
44
92
|
children: /* @__PURE__ */ jsx("svg", { width: 11, height: 11, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm0 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm0 5a1 1 0 0 1 1 1v7a1 1 0 1 1-2 0v-7a1 1 0 0 1 1-1z" }) })
|
|
45
93
|
}
|
|
46
94
|
),
|
|
47
|
-
open &&
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
95
|
+
open && // Rendered IN PLACE as a manual popover, shown into the top layer by `useBubblePosition`: the top
|
|
96
|
+
// layer escapes every ancestor's `overflow: hidden` and `container-type` (a card's), so the
|
|
97
|
+
// bubble needs no portal — `react-dom` is outside `./charts`' allowed import set
|
|
98
|
+
// (`scripts/check-dist-layering.mjs`, V2-SPEC § 9.8). Hidden until the first measure lands: a
|
|
99
|
+
// bubble painted at 0,0 for one frame is a flash in the corner.
|
|
100
|
+
/* @__PURE__ */ jsxs(
|
|
101
|
+
"span",
|
|
102
|
+
{
|
|
103
|
+
ref: bubbleRef,
|
|
104
|
+
id: tipId,
|
|
105
|
+
role: "tooltip",
|
|
106
|
+
popover: "manual",
|
|
107
|
+
className: classes.infoBubble,
|
|
108
|
+
style: pos === null ? { top: 0, left: 0, visibility: "hidden" } : { top: pos.top, left: pos.left },
|
|
109
|
+
children: [
|
|
110
|
+
text,
|
|
111
|
+
note !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.foldNote, children: note })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
)
|
|
51
115
|
] });
|
|
52
116
|
}
|
|
53
117
|
function WidgetHeader({
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
|
|
103
103
|
/*
|
|
104
104
|
* The icon slot PINS its glyph's box. A consumer's icon arrives at whatever size its own component
|
|
105
|
-
* chose (the playground's is 18px), and an 18px mark beside a
|
|
105
|
+
* chose (the playground's is 18px), and an 18px mark beside a 13px title is a bullet, not a label
|
|
106
106
|
* icon — so the tier states the size here rather than asking every call site to pass one.
|
|
107
107
|
*/
|
|
108
108
|
/*
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
overflow-wrap: anywhere;
|
|
175
175
|
font-family: var(--basalt-font-mono);
|
|
176
176
|
font-size: var(--vx-text-kpi);
|
|
177
|
-
font-weight:
|
|
177
|
+
font-weight: 500;
|
|
178
178
|
letter-spacing: -0.02em;
|
|
179
179
|
color: var(--vx-ink);
|
|
180
180
|
}
|
|
@@ -267,7 +267,9 @@
|
|
|
267
267
|
color: var(--vx-muted);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
/* Folded-subtitle pieces: hidden until a `basalt-card` narrower than 480px shows them (below).
|
|
270
|
+
/* Folded-subtitle pieces: hidden until a `basalt-card` narrower than 480px shows them (below). The
|
|
271
|
+
* bubble is a top-layer popover but stays in the card's DOM subtree, so these ancestor-based rules
|
|
272
|
+
* (container query, short-card flag) still reach `.foldNote` inside it. */
|
|
271
273
|
.foldGlyph,
|
|
272
274
|
.foldNote {
|
|
273
275
|
display: none;
|
|
@@ -275,20 +277,26 @@
|
|
|
275
277
|
|
|
276
278
|
/*
|
|
277
279
|
* The tooltip bubble reads like every other floating surface — panel bg + `shadow-card` + card
|
|
278
|
-
* radius (docs/DESIGN-SPEC.md §5). It opens DOWNWARD
|
|
279
|
-
*
|
|
280
|
-
*
|
|
280
|
+
* radius (docs/DESIGN-SPEC.md §5). It opens DOWNWARD and flips up at the viewport edge.
|
|
281
|
+
* `pointer-events: none` so it can never swallow the pointer on its way back to the trigger's
|
|
282
|
+
* `mouseleave`. Mantine-free by design (this whole folder is), so it is a plain
|
|
281
283
|
* state-driven bubble rather than a Mantine Tooltip — which is also what makes it composable from
|
|
282
284
|
* inside the `charts/` boundary.
|
|
283
285
|
*/
|
|
284
286
|
.infoBubble {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
/* A `popover="manual"` element in the top layer, so no card's `overflow: hidden` or
|
|
288
|
+
* `container-type` clips it; placed from the trigger's rect (`useBubblePosition`), `top`/`left`
|
|
289
|
+
* arrive inline. The UA popover styles (centred, bordered, padded, Canvas background) are reset. */
|
|
290
|
+
position: fixed;
|
|
291
|
+
inset: auto;
|
|
292
|
+
margin: 0;
|
|
293
|
+
border: 0;
|
|
294
|
+
overflow: visible;
|
|
295
|
+
z-index: var(--mantine-z-index-popover, 300);
|
|
289
296
|
width: max-content;
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
/* 100% of the viewport (fixed): 2 × BUBBLE_EDGE in widget-header.tsx. */
|
|
298
|
+
max-width: min(260px, calc(100% - 16px));
|
|
299
|
+
padding: var(--vx-space-stack-sm) var(--vx-space-row-inset-x);
|
|
292
300
|
border-radius: var(--vx-radius-card);
|
|
293
301
|
background-color: var(--vx-surface-panel);
|
|
294
302
|
box-shadow: var(--vx-shadow-card);
|
|
@@ -306,24 +314,24 @@
|
|
|
306
314
|
display: inline-flex;
|
|
307
315
|
flex: none;
|
|
308
316
|
white-space: nowrap;
|
|
309
|
-
align-items:
|
|
317
|
+
align-items: baseline;
|
|
310
318
|
gap: 3px;
|
|
311
|
-
border-radius: var(--vx-radius-ctrl);
|
|
312
|
-
padding: var(--vx-space-badge-inset-y) var(--vx-space-badge-inset-x);
|
|
313
319
|
font-family: var(--basalt-font-mono);
|
|
314
|
-
font-size: var(--vx-text-
|
|
315
|
-
font-weight:
|
|
320
|
+
font-size: var(--vx-text-sm);
|
|
321
|
+
font-weight: 500;
|
|
316
322
|
line-height: 1;
|
|
317
323
|
}
|
|
318
324
|
|
|
325
|
+
/* The glyph is direction, not a figure: the `micro` rung, so it never lands between two sizes. */
|
|
319
326
|
.deltaGlyph {
|
|
320
|
-
font-size:
|
|
327
|
+
font-size: var(--vx-text-micro);
|
|
321
328
|
}
|
|
322
329
|
|
|
323
330
|
.deltaPeriod {
|
|
324
331
|
margin-inline-start: 4px;
|
|
325
|
-
font-
|
|
326
|
-
|
|
332
|
+
font-size: var(--vx-text-micro);
|
|
333
|
+
font-weight: 400;
|
|
334
|
+
color: var(--vx-muted);
|
|
327
335
|
}
|
|
328
336
|
|
|
329
337
|
/* Card narrower than 480px: the subtitle folds into the info glyph (`InfoGlyph`'s `note`, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard-hook.d.ts","sourceRoot":"","sources":["../../src/guard/guard-hook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guard-hook.d.ts","sourceRoot":"","sources":["../../src/guard/guard-hook.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1D;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAmDrE;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,EAAE,OAAO,GAAG,MAAM,CAAA;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qCAAqC;AACrC,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAA;CACzC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,WAAW,EAChB,IAAI,CAAC,EAAE,wBAAwB,GAC9B,eAAe,CA0BjB"}
|
package/dist/guard/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ./guard — headless policy core. Mantine-free
|
|
2
|
+
* ./guard — headless policy core. Mantine-free and light: it may import dependency-free leaves
|
|
3
|
+
* (`tokens/space-scale`, `common/*`), never `tokens/palette` or `derive` (colour math on every
|
|
4
|
+
* Write/Edit).
|
|
3
5
|
*
|
|
4
6
|
* GUARD_RULES: the closed registry of all 26 violation kinds.
|
|
5
7
|
* checkSource: pure (text, relPath, cfg) → Finding[]. No FS, no walk, no console.
|
|
@@ -212,7 +214,7 @@ export declare const GUARD_RULES: {
|
|
|
212
214
|
readonly pattern: RegExp;
|
|
213
215
|
readonly enabled: (cfg: GuardConfig) => boolean;
|
|
214
216
|
readonly appliesTo: (relPath: string) => boolean;
|
|
215
|
-
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); leave both to the theme or use py=\"
|
|
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); leave both to the theme or use py=\"sm\" px=\"md\".";
|
|
216
218
|
};
|
|
217
219
|
readonly 'off-system-surface-var': {
|
|
218
220
|
readonly kind: "off-system-surface-var";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAO7E,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA;AAgU9D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CA8BpE,CAAA;AA8cD,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,WAiBlC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;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H,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAM9F"}
|
package/dist/guard/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { vxFamilyOf } from "../common/vx-family.js";
|
|
|
2
2
|
import { BASALT_VX_FAMILIES } from "../common/vx-families.js";
|
|
3
3
|
import { FONTS_CSS_HINT } from "./fonts-hint.js";
|
|
4
4
|
import { BASALT_VX_NAMES } from "./vx-names.js";
|
|
5
|
+
import { SPACE_SCALE_LEVEL0 } from "../tokens/space-scale.js";
|
|
5
6
|
const HEX = /#(?!(?<=&#)\d+;)[0-9a-fA-F]{3,8}\b/g;
|
|
6
7
|
const FUNC = /\b(?:rgba?|hsla?)\((?!\s*\$\{)/g;
|
|
7
8
|
const LOCALSTORAGE_THEME = /localStorage\s*\.\s*getItem\s*\(\s*['"]theme['"]\s*\)/g;
|
|
@@ -124,7 +125,7 @@ const INLINE_SPACING = new RegExp(
|
|
|
124
125
|
`(?<![\\w-])(?:${SPACING_PROP})\\s*:\\s*(?!var\\()['"]?[-+]?(?!0(?![.\\d]))${SPACING_NUMBER}`,
|
|
125
126
|
"g"
|
|
126
127
|
);
|
|
127
|
-
const MICRO_SPACING_CEILING_PX =
|
|
128
|
+
const MICRO_SPACING_CEILING_PX = SPACE_SCALE_LEVEL0.xs - 1;
|
|
128
129
|
const STYLE_ATTRIBUTE_OPENER = /\b(?:style|styles|sx|css)\s*=\s*\{?\s*$/;
|
|
129
130
|
const OBJECT_DECLARATION = /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::([^=]*))?=\s*$/;
|
|
130
131
|
const STYLE_OBJECT_NAME = /(?:Style|Styles|Css)$|^(?:style|styles|css|sx)$/;
|
|
@@ -233,7 +234,9 @@ const BASALT_ANY_IMPORT = /\b(?:from|import)\s+['"]basalt-ui(?:\/[^'"]*)?['"]/;
|
|
|
233
234
|
const MANTINE_FORM_IMPORT = /from\s+['"]@mantine\/form['"]/;
|
|
234
235
|
const STYLES_INPUT_PART = /\bstyles\s*=\s*\{\{\s*input\s*:\s*\{([^}]*)\}/g;
|
|
235
236
|
const SUB_16_FONT_SIZE = /font-?[Ss]ize\s*:\s*['"]?(-?\d+(?:\.\d+)?)(?:px)?['"]?(?=[,\s}]|$)/g;
|
|
236
|
-
const DEFAULT_SPACING_STEPS =
|
|
237
|
+
const DEFAULT_SPACING_STEPS = Object.values(SPACE_SCALE_LEVEL0).toSorted(
|
|
238
|
+
(a, b) => a - b
|
|
239
|
+
);
|
|
237
240
|
const DEFAULT_FORBIDDEN_ACCENTS = ["teal", "violet", "grape", "indigo", "pink"];
|
|
238
241
|
const DEFAULT_GUARD_CONFIG = {
|
|
239
242
|
spacingSteps: DEFAULT_SPACING_STEPS,
|
|
@@ -253,7 +256,18 @@ const DEFAULT_GUARD_CONFIG = {
|
|
|
253
256
|
exemptRules: {},
|
|
254
257
|
severity: {}
|
|
255
258
|
};
|
|
256
|
-
const GRACE_PERIOD_KINDS = {
|
|
259
|
+
const GRACE_PERIOD_KINDS = {
|
|
260
|
+
"raw-spacing": {
|
|
261
|
+
since: "2.16.0",
|
|
262
|
+
promote: "2.24.0",
|
|
263
|
+
why: "The spacing scale moved to 8/12/16/20/24 in 2.16.0: a prop value equal to a NEW step (p={16}) is newly a finding."
|
|
264
|
+
},
|
|
265
|
+
"inline-spacing": {
|
|
266
|
+
since: "2.16.0",
|
|
267
|
+
promote: "2.24.0",
|
|
268
|
+
why: "The scale moved to 8/12/16/20/24 and the CSS micro ceiling dropped 10 \u2192 7 in 2.16.0: a literal 8px/10px in CSS is newly a finding."
|
|
269
|
+
}
|
|
270
|
+
};
|
|
257
271
|
function severityOf(kind, cfg) {
|
|
258
272
|
return cfg.severity?.[kind] ?? (Object.hasOwn(GRACE_PERIOD_KINDS, kind) ? "warn" : "error");
|
|
259
273
|
}
|
|
@@ -802,7 +816,7 @@ const GUARD_RULES = {
|
|
|
802
816
|
enabled: (cfg) => cfg.cardWithBorder,
|
|
803
817
|
// JSX-tag-shaped (`<Card withBorder>`) — never appears in CSS text.
|
|
804
818
|
appliesTo: (relPath) => !relPath.endsWith(".css"),
|
|
805
|
-
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); leave both to the theme or use py="
|
|
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); leave both to the theme or use py="sm" px="md".'
|
|
806
820
|
},
|
|
807
821
|
"off-system-surface-var": {
|
|
808
822
|
kind: "off-system-surface-var",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vx-names.d.ts","sourceRoot":"","sources":["../../src/guard/vx-names.ts"],"names":[],"mappings":"AAEA,6FAA6F;AAC7F,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"vx-names.d.ts","sourceRoot":"","sources":["../../src/guard/vx-names.ts"],"names":[],"mappings":"AAEA,6FAA6F;AAC7F,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EA8N5C,CAAA"}
|
package/dist/guard/vx-names.js
CHANGED
|
@@ -108,6 +108,7 @@ const BASALT_VX_NAMES = [
|
|
|
108
108
|
"--vx-space-control-gap",
|
|
109
109
|
"--vx-space-control-height",
|
|
110
110
|
"--vx-space-control-height-ctl",
|
|
111
|
+
"--vx-space-control-height-dense",
|
|
111
112
|
"--vx-space-control-height-tag",
|
|
112
113
|
"--vx-space-control-height-widget",
|
|
113
114
|
"--vx-space-guide-body-gap-bottom",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
.menuItem :global(.mantine-Menu-itemLabel) {
|
|
161
|
-
font-size: var(--mantine-font-size-
|
|
161
|
+
font-size: var(--mantine-font-size-sm) !important;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
/* An active destination reads the same in the More surface as it does in the sheet. */
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
* touch target with a `min-height` floor and symmetric inset, so growing one side of it would make
|
|
246
246
|
* that row read as a different size from its siblings. */
|
|
247
247
|
.menuDropdown .menuSectionStart {
|
|
248
|
-
margin-top:
|
|
248
|
+
margin-top: var(--vx-space-stack-sm);
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
/*
|