basalt-ui 2.21.0 → 2.22.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.
Files changed (226) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/MIGRATING.md +277 -12
  3. package/agent/agents/basalt-design-reviewer.md +1 -1
  4. package/agent/rules/basalt-tokens.md +1 -1
  5. package/agent/skills/basalt-design/SKILL.md +1 -1
  6. package/agent/skills/basalt-design/references/anti-defaults.md +1 -1
  7. package/agent/skills/basalt-design/references/catalogue.md +1 -0
  8. package/dist/charts/BandStrip.d.ts.map +1 -1
  9. package/dist/charts/BandStrip.js +27 -3
  10. package/dist/charts/Bars.d.ts.map +1 -1
  11. package/dist/charts/Bars.js +5 -0
  12. package/dist/charts/CartesianChart.d.ts +8 -0
  13. package/dist/charts/CartesianChart.d.ts.map +1 -1
  14. package/dist/charts/CartesianChart.js +8 -5
  15. package/dist/charts/ChartCard.d.ts +12 -3
  16. package/dist/charts/ChartCard.d.ts.map +1 -1
  17. package/dist/charts/ChartCard.js +29 -8
  18. package/dist/charts/DualPanel.d.ts.map +1 -1
  19. package/dist/charts/DualPanel.js +5 -8
  20. package/dist/charts/Heatmap.d.ts +12 -1
  21. package/dist/charts/Heatmap.d.ts.map +1 -1
  22. package/dist/charts/Heatmap.js +34 -5
  23. package/dist/charts/Lines.d.ts +3 -0
  24. package/dist/charts/Lines.d.ts.map +1 -1
  25. package/dist/charts/Lines.js +29 -6
  26. package/dist/charts/MirroredBars.d.ts.map +1 -1
  27. package/dist/charts/MirroredBars.js +4 -6
  28. package/dist/charts/Sparkline.d.ts +7 -1
  29. package/dist/charts/Sparkline.d.ts.map +1 -1
  30. package/dist/charts/Sparkline.js +39 -14
  31. package/dist/charts/StackedArea.d.ts +4 -1
  32. package/dist/charts/StackedArea.d.ts.map +1 -1
  33. package/dist/charts/StackedArea.js +9 -3
  34. package/dist/charts/band-fold.d.ts +20 -1
  35. package/dist/charts/band-fold.d.ts.map +1 -1
  36. package/dist/charts/band-fold.js +9 -0
  37. package/dist/charts/chart-box.module.css +19 -0
  38. package/dist/charts/chart-card.module.css +25 -0
  39. package/dist/charts/chart-legend.module.css +7 -0
  40. package/dist/charts/compile.d.ts +17 -6
  41. package/dist/charts/compile.d.ts.map +1 -1
  42. package/dist/charts/compile.js +145 -74
  43. package/dist/charts/labels.d.ts +15 -4
  44. package/dist/charts/labels.d.ts.map +1 -1
  45. package/dist/charts/labels.js +34 -10
  46. package/dist/charts/legend.d.ts +2 -0
  47. package/dist/charts/legend.d.ts.map +1 -1
  48. package/dist/charts/legend.js +7 -21
  49. package/dist/charts/marks.js +1 -1
  50. package/dist/charts/panel.d.ts +0 -6
  51. package/dist/charts/panel.d.ts.map +1 -1
  52. package/dist/charts/panel.js +1 -10
  53. package/dist/charts/ref-label.d.ts +26 -0
  54. package/dist/charts/ref-label.d.ts.map +1 -0
  55. package/dist/charts/ref-label.js +63 -0
  56. package/dist/charts/scales.d.ts +4 -1
  57. package/dist/charts/scales.d.ts.map +1 -1
  58. package/dist/charts/scales.js +14 -3
  59. package/dist/charts/sparkline.module.css +10 -11
  60. package/dist/charts/sparkline.module.css.d.ts +1 -2
  61. package/dist/charts/state.d.ts +2 -0
  62. package/dist/charts/state.d.ts.map +1 -1
  63. package/dist/charts/state.js +2 -1
  64. package/dist/charts/types.d.ts +14 -5
  65. package/dist/charts/types.d.ts.map +1 -1
  66. package/dist/cli/doctor-upgrade.d.ts +1 -0
  67. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  68. package/dist/cli/doctor-upgrade.js +1 -0
  69. package/dist/cli/init.d.ts +2 -0
  70. package/dist/cli/init.d.ts.map +1 -1
  71. package/dist/cli/init.js +68 -4
  72. package/dist/cli/shot/capture.d.ts +21 -2
  73. package/dist/cli/shot/capture.d.ts.map +1 -1
  74. package/dist/cli/shot/capture.js +194 -32
  75. package/dist/cli/shot/detect.d.ts.map +1 -1
  76. package/dist/cli/shot/detect.js +14 -1
  77. package/dist/cli/shot/playwright.d.ts +5 -2
  78. package/dist/cli/shot/playwright.d.ts.map +1 -1
  79. package/dist/cli/shot/types.d.ts +2 -0
  80. package/dist/cli/shot/types.d.ts.map +1 -1
  81. package/dist/cli/shot/types.js +2 -0
  82. package/dist/controls/controls.module.css +11 -1
  83. package/dist/controls/filter-pill.d.ts.map +1 -1
  84. package/dist/controls/filter-pill.js +1 -0
  85. package/dist/controls/sync-button.d.ts.map +1 -1
  86. package/dist/controls/sync-button.js +22 -3
  87. package/dist/controls/sync-button.module.css +34 -2
  88. package/dist/controls/sync-button.module.css.d.ts +1 -0
  89. package/dist/dashboard/bar-list.d.ts.map +1 -1
  90. package/dist/dashboard/bar-list.js +7 -8
  91. package/dist/dashboard/bar-list.module.css +53 -0
  92. package/dist/dashboard/bar-list.module.css.d.ts +1 -0
  93. package/dist/dashboard/index.d.ts +1 -0
  94. package/dist/dashboard/index.d.ts.map +1 -1
  95. package/dist/dashboard/index.js +2 -0
  96. package/dist/dashboard/meter-model.d.ts +77 -3
  97. package/dist/dashboard/meter-model.d.ts.map +1 -1
  98. package/dist/dashboard/meter-model.js +88 -15
  99. package/dist/dashboard/meter-parts.d.ts +8 -0
  100. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  101. package/dist/dashboard/meter-parts.js +238 -71
  102. package/dist/dashboard/meter.d.ts +43 -60
  103. package/dist/dashboard/meter.d.ts.map +1 -1
  104. package/dist/dashboard/meter.js +20 -3
  105. package/dist/dashboard/meter.module.css +61 -0
  106. package/dist/dashboard/meter.module.css.d.ts +5 -0
  107. package/dist/dashboard/page-summary.d.ts +20 -0
  108. package/dist/dashboard/page-summary.d.ts.map +1 -0
  109. package/dist/dashboard/page-summary.js +28 -0
  110. package/dist/dashboard/page-summary.module.css +89 -0
  111. package/dist/dashboard/page-summary.module.css.d.ts +15 -0
  112. package/dist/dashboard/section.d.ts +25 -2
  113. package/dist/dashboard/section.d.ts.map +1 -1
  114. package/dist/dashboard/section.js +10 -5
  115. package/dist/dashboard/section.module.css +23 -0
  116. package/dist/dashboard/section.module.css.d.ts +1 -0
  117. package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
  118. package/dist/dashboard/stat-card-parts.js +1 -1
  119. package/dist/dashboard/stat-card.d.ts +4 -2
  120. package/dist/dashboard/stat-card.d.ts.map +1 -1
  121. package/dist/dashboard/stat-card.js +7 -5
  122. package/dist/dashboard/stat-card.module.css +17 -0
  123. package/dist/dashboard/stat-strip.d.ts +7 -1
  124. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  125. package/dist/dashboard/stat-strip.js +74 -46
  126. package/dist/dashboard/stat-strip.module.css +67 -20
  127. package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
  128. package/dist/dashboard/visual-slot.d.ts +7 -1
  129. package/dist/dashboard/visual-slot.d.ts.map +1 -1
  130. package/dist/dashboard/visual-slot.js +3 -1
  131. package/dist/guard/vx-names.d.ts.map +1 -1
  132. package/dist/guard/vx-names.js +2 -0
  133. package/dist/index.d.ts +1 -1
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +3 -1
  136. package/dist/styles.css +34 -2
  137. package/dist/theme/chrome-vars.d.ts +20 -5
  138. package/dist/theme/chrome-vars.d.ts.map +1 -1
  139. package/dist/theme/chrome-vars.js +46 -3
  140. package/dist/theme/controls.module.css +23 -0
  141. package/dist/theme/controls.module.css.d.ts +1 -0
  142. package/dist/theme/index.d.ts.map +1 -1
  143. package/dist/theme/index.js +8 -20
  144. package/dist/tokens/core.d.ts +2 -1
  145. package/dist/tokens/core.d.ts.map +1 -1
  146. package/dist/tokens/core.js +6 -1
  147. package/dist/tokens/derive.d.ts +3 -1
  148. package/dist/tokens/derive.d.ts.map +1 -1
  149. package/dist/tokens/derive.js +16 -1
  150. package/dist/tokens/palette.d.ts +4 -0
  151. package/dist/tokens/palette.d.ts.map +1 -1
  152. package/dist/tokens/palette.js +4 -0
  153. package/dist/tokens/status-text.d.ts.map +1 -1
  154. package/dist/tokens/status-text.js +3 -1
  155. package/llms.txt +38 -20
  156. package/package.json +1 -1
  157. package/src/charts/BandStrip.tsx +33 -3
  158. package/src/charts/Bars.tsx +6 -0
  159. package/src/charts/CartesianChart.tsx +16 -3
  160. package/src/charts/ChartCard.tsx +34 -6
  161. package/src/charts/DualPanel.tsx +3 -6
  162. package/src/charts/Heatmap.tsx +54 -5
  163. package/src/charts/Lines.tsx +56 -10
  164. package/src/charts/MirroredBars.tsx +3 -5
  165. package/src/charts/Sparkline.tsx +50 -13
  166. package/src/charts/StackedArea.tsx +14 -4
  167. package/src/charts/band-fold.ts +31 -1
  168. package/src/charts/chart-box.module.css +19 -0
  169. package/src/charts/chart-card.module.css +25 -0
  170. package/src/charts/chart-legend.module.css +7 -0
  171. package/src/charts/compile.ts +210 -85
  172. package/src/charts/labels.ts +48 -14
  173. package/src/charts/legend.tsx +10 -20
  174. package/src/charts/marks.ts +1 -1
  175. package/src/charts/panel.tsx +1 -16
  176. package/src/charts/ref-label.ts +104 -0
  177. package/src/charts/scales.ts +22 -2
  178. package/src/charts/sparkline.module.css +10 -11
  179. package/src/charts/sparkline.module.css.d.ts +1 -2
  180. package/src/charts/state.tsx +3 -1
  181. package/src/charts/types.ts +14 -5
  182. package/src/cli/doctor-upgrade.ts +1 -1
  183. package/src/cli/init.ts +100 -3
  184. package/src/cli/shot/capture.ts +251 -32
  185. package/src/cli/shot/detect.ts +18 -1
  186. package/src/cli/shot/playwright.ts +2 -2
  187. package/src/cli/shot/types.ts +3 -0
  188. package/src/controls/controls.module.css +11 -1
  189. package/src/controls/filter-pill.tsx +2 -0
  190. package/src/controls/sync-button.module.css +34 -2
  191. package/src/controls/sync-button.module.css.d.ts +1 -0
  192. package/src/controls/sync-button.tsx +40 -4
  193. package/src/dashboard/bar-list.module.css +53 -0
  194. package/src/dashboard/bar-list.module.css.d.ts +1 -0
  195. package/src/dashboard/bar-list.tsx +78 -69
  196. package/src/dashboard/index.ts +1 -0
  197. package/src/dashboard/meter-model.ts +186 -20
  198. package/src/dashboard/meter-parts.tsx +285 -64
  199. package/src/dashboard/meter.module.css +61 -0
  200. package/src/dashboard/meter.module.css.d.ts +5 -0
  201. package/src/dashboard/meter.tsx +60 -10
  202. package/src/dashboard/page-summary.module.css +89 -0
  203. package/src/dashboard/page-summary.module.css.d.ts +15 -0
  204. package/src/dashboard/page-summary.tsx +95 -0
  205. package/src/dashboard/section.module.css +23 -0
  206. package/src/dashboard/section.module.css.d.ts +1 -0
  207. package/src/dashboard/section.tsx +59 -11
  208. package/src/dashboard/stat-card-parts.tsx +5 -1
  209. package/src/dashboard/stat-card.module.css +17 -0
  210. package/src/dashboard/stat-card.tsx +12 -6
  211. package/src/dashboard/stat-strip.module.css +67 -20
  212. package/src/dashboard/stat-strip.module.css.d.ts +4 -0
  213. package/src/dashboard/stat-strip.tsx +118 -72
  214. package/src/dashboard/visual-slot.ts +12 -3
  215. package/src/guard/vx-names.ts +2 -0
  216. package/src/index.ts +2 -0
  217. package/src/styles.css +34 -2
  218. package/src/theme/__snapshots__/plain-theme.test.ts.snap +186 -60
  219. package/src/theme/chrome-vars.ts +77 -8
  220. package/src/theme/controls.module.css +23 -0
  221. package/src/theme/controls.module.css.d.ts +1 -0
  222. package/src/theme/index.ts +12 -25
  223. package/src/tokens/core.ts +4 -1
  224. package/src/tokens/derive.ts +32 -3
  225. package/src/tokens/palette.ts +4 -0
  226. package/src/tokens/status-text.ts +2 -0
@@ -28,6 +28,26 @@
28
28
  position: relative;
29
29
  }
30
30
 
31
+ /* A `stops` track is one gradient through the consumer's colours; the reading is a marker on it. */
32
+ .track[data-meter-stops] {
33
+ background: linear-gradient(var(--basalt-stop-dir, to right), var(--basalt-stops));
34
+ }
35
+
36
+ .trackBox:dir(rtl) {
37
+ --basalt-stop-dir: to left;
38
+ }
39
+
40
+ /* `track={false}`: no drawn track, still in the accessibility tree (the role and value stay). */
41
+ .trackHidden {
42
+ position: absolute;
43
+ width: 1px;
44
+ height: 1px;
45
+ margin: -1px;
46
+ overflow: hidden;
47
+ clip-path: inset(50%);
48
+ white-space: nowrap;
49
+ }
50
+
31
51
  .fill {
32
52
  flex: none;
33
53
  height: 100%;
@@ -63,6 +83,8 @@
63
83
  /* A hidden name keeps its box (so it can be measured again) and may sit past the row's end. */
64
84
  overflow-x: clip;
65
85
  height: 1.25em;
86
+ /* Read by the layout: the least two captions keep apart (one gap step). */
87
+ column-gap: var(--vx-space-control-gap, 0.375rem);
66
88
  font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
67
89
  font-variant-numeric: lining-nums;
68
90
  font-size: var(--basalt-meter-caption);
@@ -164,6 +186,20 @@
164
186
  color: var(--vx-muted);
165
187
  }
166
188
 
189
+ /* Captions at their marks: each is placed (inline `inset-inline-start`) by the measured layout. */
190
+ .captionsAnchored {
191
+ position: relative;
192
+ display: block;
193
+ height: 1lh;
194
+ }
195
+
196
+ .captionsAnchored > * {
197
+ position: absolute;
198
+ top: 0;
199
+ margin: 0;
200
+ white-space: nowrap;
201
+ }
202
+
167
203
  /* Captions never truncate: the row wraps, and a caption wider than the row wraps inside itself. */
168
204
  .caption {
169
205
  min-width: 0;
@@ -207,6 +243,20 @@
207
243
  overflow-wrap: anywhere;
208
244
  }
209
245
 
246
+ /* Every part's caption fits under its own segment: the list is positioned, not wrapped. */
247
+ .partCaptionsUnder {
248
+ position: relative;
249
+ display: block;
250
+ height: 1lh;
251
+ }
252
+
253
+ /* Under its segment a caption is one line by construction: it was measured to fit as one. */
254
+ .partCaptionsUnder > .partCaption {
255
+ position: absolute;
256
+ top: 0;
257
+ white-space: nowrap;
258
+ }
259
+
210
260
  /* A shape cue beside the name, so the part never reads by colour alone. */
211
261
  .swatch {
212
262
  flex: none;
@@ -265,6 +315,17 @@
265
315
  stroke: var(--vx-line);
266
316
  }
267
317
 
318
+ /* A ring tick: an ink mark with a track-coloured halo, so it reads over the arc and the track. */
319
+ .ringTick {
320
+ stroke: var(--vx-ink);
321
+ stroke-width: 1.5;
322
+ }
323
+
324
+ .ringTickHalo {
325
+ stroke: var(--vx-surface-subtle);
326
+ stroke-width: 3;
327
+ }
328
+
268
329
  .ringValue {
269
330
  position: relative;
270
331
  font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
@@ -7,6 +7,7 @@ declare const classes: {
7
7
  readonly summary: string
8
8
  readonly track: string
9
9
  readonly trackBox: string
10
+ readonly trackHidden: string
10
11
  readonly fill: string
11
12
  readonly forecastFill: string
12
13
  readonly zone: string
@@ -22,8 +23,10 @@ declare const classes: {
22
23
  readonly captions: string
23
24
  readonly caption: string
24
25
  readonly captionEnd: string
26
+ readonly captionsAnchored: string
25
27
  readonly partCaptions: string
26
28
  readonly partCaption: string
29
+ readonly partCaptionsUnder: string
27
30
  readonly swatch: string
28
31
  readonly empty: string
29
32
  readonly skeletonTrack: string
@@ -32,6 +35,8 @@ declare const classes: {
32
35
  readonly ring: string
33
36
  readonly ringTrack: string
34
37
  readonly ringArc: string
38
+ readonly ringTick: string
39
+ readonly ringTickHalo: string
35
40
  readonly ringValue: string
36
41
  readonly skeletonRing: string
37
42
  readonly row: string
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { BasaltProps } from '../common/props.js';
3
+ type Fact = ReactNode | null | false | undefined;
4
+ type PageSummaryContent = {
5
+ /** The headline sentence. It must state a live number — never describe the page. */
6
+ sentence: ReactNode;
7
+ /** Short facts under the headline, e.g. `['3 need you', oldest && `oldest ${oldest}`]`. */
8
+ facts?: readonly Fact[];
9
+ /** Right of the headline: a date or a freshness word. */
10
+ aside?: ReactNode;
11
+ loading?: false;
12
+ };
13
+ /** While the sentence's data loads: a skeleton of the same shape, no content props needed. */
14
+ type PageSummaryLoading = Partial<Omit<PageSummaryContent, 'loading'>> & {
15
+ loading: true;
16
+ };
17
+ export type PageSummaryProps = BasaltProps & (PageSummaryContent | PageSummaryLoading);
18
+ export declare function PageSummary(props: PageSummaryProps): import("react").JSX.Element;
19
+ export {};
20
+ //# sourceMappingURL=page-summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-summary.d.ts","sourceRoot":"","sources":["../../src/dashboard/page-summary.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,KAAK,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,CAAA;AAEhD,KAAK,kBAAkB,GAAG;IACxB,oFAAoF;IACpF,QAAQ,EAAE,SAAS,CAAA;IACnB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAA;IACvB,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB,CAAA;AAED,8FAA8F;AAC9F,KAAK,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAA;AAE1F,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,CAAC,kBAAkB,GAAG,kBAAkB,CAAC,CAAA;AAOtF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAkClD"}
@@ -0,0 +1,28 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Skeleton } from "@mantine/core";
3
+ import { cx } from "../common/props.js";
4
+ import classes from "./page-summary.module.css";
5
+ const NO_FACTS = [];
6
+ const isShown = (fact) => fact !== null && fact !== false && fact !== void 0 && fact !== "";
7
+ function PageSummary(props) {
8
+ const { className, style } = props;
9
+ const common = { className: cx(classes.root, className), "data-page-summary": "", style };
10
+ if (props.loading === true) {
11
+ return /* @__PURE__ */ jsxs("div", { ...common, "aria-busy": "true", children: [
12
+ /* @__PURE__ */ jsx(Skeleton, { className: classes.sentenceSkeleton, width: "55%", radius: "sm" }),
13
+ props.facts !== void 0 && /* @__PURE__ */ jsx(Skeleton, { className: classes.factsSkeleton, width: "35%", radius: "sm" })
14
+ ] });
15
+ }
16
+ const { sentence, facts = NO_FACTS, aside } = props;
17
+ const shown = facts.filter(isShown);
18
+ return /* @__PURE__ */ jsxs("div", { ...common, children: [
19
+ /* @__PURE__ */ jsxs("div", { className: classes.top, children: [
20
+ /* @__PURE__ */ jsx("h2", { className: classes.sentence, children: sentence }),
21
+ aside !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.aside, children: aside })
22
+ ] }),
23
+ shown.length > 0 && /* @__PURE__ */ jsx("p", { className: classes.facts, "data-page-summary-facts": true, children: shown.map((fact, i) => /* @__PURE__ */ jsx("span", { className: classes.fact, "data-page-summary-fact": true, children: fact }, i)) })
24
+ ] });
25
+ }
26
+ export {
27
+ PageSummary
28
+ };
@@ -0,0 +1,89 @@
1
+ /*
2
+ * PageSummary (SPEC § 6.9). A page's opening: headline, then one facts line. No surface of its own —
3
+ * it sits on the page background above the first Section.
4
+ */
5
+ .root {
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: var(--vx-space-stack-xs);
9
+ min-width: 0;
10
+ }
11
+
12
+ .top {
13
+ display: flex;
14
+ align-items: baseline;
15
+ justify-content: space-between;
16
+ gap: var(--vx-space-stack-md);
17
+ min-width: 0;
18
+ }
19
+
20
+ /* `h1` step, head face, tight tracking (SPEC row "Page headline"). Sans with lining figures: the
21
+ * sentence carries the live number, and D33 keeps figures proportional. */
22
+ .sentence {
23
+ margin: 0;
24
+ min-width: 0;
25
+ font-family: var(--basalt-font-head);
26
+ font-size: var(--vx-text-h1);
27
+ font-weight: 550;
28
+ font-stretch: 88%;
29
+ letter-spacing: -0.02em;
30
+ line-height: 1.2;
31
+ color: var(--vx-ink);
32
+ text-wrap: balance;
33
+ }
34
+
35
+ .aside {
36
+ flex: none;
37
+ font-size: var(--vx-text-xs);
38
+ color: var(--vx-muted);
39
+ white-space: nowrap;
40
+ }
41
+
42
+ /*
43
+ * The facts line: sans `xs`, muted, `·`-separated. A wrapping flex list, `--facts-gap` between facts.
44
+ * Each fact draws its own dot one gap to its inline-start, centred in it, and the list clips inline overflow: the fact
45
+ * that opens a line starts at the list's left edge, so its dot lands outside the clip and a wrapped
46
+ * line never leads with `·` (argo UPSTREAM § Wave 26). Clip, not hidden — the block axis stays free.
47
+ */
48
+ .facts {
49
+ --facts-gap: var(--vx-space-stack-md);
50
+
51
+ display: flex;
52
+ flex-wrap: wrap;
53
+ column-gap: var(--facts-gap);
54
+ row-gap: 0;
55
+ margin: 0;
56
+ overflow-x: clip;
57
+ font-size: var(--vx-text-xs);
58
+ line-height: 1.4;
59
+ color: var(--vx-muted);
60
+ }
61
+
62
+ .fact {
63
+ position: relative;
64
+ min-width: 0;
65
+ }
66
+
67
+ .fact::before {
68
+ content: '·';
69
+ position: absolute;
70
+ inset-inline-start: calc(-1 * var(--facts-gap));
71
+ width: var(--facts-gap);
72
+ text-align: center;
73
+ color: var(--vx-faint);
74
+ }
75
+
76
+ /* The list clips inline overflow, so a focus ring on a link inside a fact is drawn inward: an
77
+ * outset ring would be cut at the list's edges. */
78
+ .fact :where(a, button, [tabindex]):focus-visible {
79
+ outline-offset: -2px;
80
+ }
81
+
82
+ /* Skeleton: the headline bar is one h1 line, the facts bar one xs line. */
83
+ .sentenceSkeleton {
84
+ height: calc(var(--vx-text-h1) * 1.2);
85
+ }
86
+
87
+ .factsSkeleton {
88
+ height: calc(var(--vx-text-xs) * 1.4);
89
+ }
@@ -0,0 +1,15 @@
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 root: string
7
+ readonly top: string
8
+ readonly sentence: string
9
+ readonly aside: string
10
+ readonly facts: string
11
+ readonly fact: string
12
+ readonly sentenceSkeleton: string
13
+ readonly factsSkeleton: string
14
+ }
15
+ export default classes
@@ -10,7 +10,9 @@ import type { WidgetHeaderProps } from './widget-header.js';
10
10
  * box a consumer positions.
11
11
  */
12
12
  export type SectionSlot = 'root' | 'header' | 'body';
13
- export type SectionProps = Omit<WidgetHeaderProps, 'tier' | 'classNames' | 'actions'> & BasaltProps & SlotStylesProps<SectionSlot> & {
13
+ /** The props only a drawn heading can carry; an untitled `Section` forbids each (`?: never`). */
14
+ type HeaderOnlyKey = 'icon' | 'subtitle' | 'info' | 'value' | 'unit' | 'delta' | 'deltaPeriod' | 'deltaPolarity' | 'deltaFormat' | 'deltaGlyph' | 'sparkline' | 'count';
15
+ type SectionBaseProps = Omit<WidgetHeaderProps, 'tier' | 'classNames' | 'actions' | 'title' | HeaderOnlyKey> & BasaltProps & SlotStylesProps<SectionSlot> & {
14
16
  /**
15
17
  * Header actions as typed data (law C15), projected through the SAME row `PageBar` uses — one
16
18
  * kebab below `sm`. At most three: a fourth is a tsc error (law C6, `docs/V2-SPEC.md` §3).
@@ -60,5 +62,26 @@ export type SectionProps = Omit<WidgetHeaderProps, 'tier' | 'classNames' | 'acti
60
62
  id?: string;
61
63
  children: ReactNode;
62
64
  };
63
- export declare function Section({ actions, query, empty, tabs, collapsible, persistKey, defaultOpen, open: openProp, onOpenChange, summary, id, children, className, style, classNames, ...headerProps }: SectionProps): import("react").JSX.Element;
65
+ /**
66
+ * A Section names itself with `title` — or, with no title, by its `tabs` alone (argo's m365 phone
67
+ * pane switch: a heading restating the open pane's name beside the tabs that already say it). The
68
+ * header row then collapses to the tabs (and `actions`): no heading, no fold, and none of the
69
+ * heading-only props (`count`, `info`, `subtitle`, `icon`, the hero metric) — each is a type error.
70
+ *
71
+ * Naming: a `ViewTabs` in `tabs` already names its own tablist, so the section adds no second name
72
+ * and no `group` role. Pass `aria-label` only when the tabs are not self-naming — it then makes the
73
+ * root a labelled `group`.
74
+ */
75
+ export type SectionProps = SectionBaseProps & ((Pick<WidgetHeaderProps, HeaderOnlyKey> & {
76
+ title: string;
77
+ 'aria-label'?: never;
78
+ }) | ({
79
+ title?: undefined;
80
+ tabs: ReactNode;
81
+ 'aria-label'?: string;
82
+ } & {
83
+ [K in HeaderOnlyKey]?: never;
84
+ }));
85
+ export declare function Section({ actions, query, empty, tabs, collapsible, persistKey, defaultOpen, open: openProp, onOpenChange, summary, id, children, className, style, classNames, 'aria-label': ariaLabel, ...headerProps }: SectionProps): import("react").JSX.Element;
86
+ export {};
64
87
  //# sourceMappingURL=section.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/dashboard/section.tsx"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGxD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;AAMpD,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC,GACnF,WAAW,GACX,eAAe,CAAC,WAAW,CAAC,GAAG;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAC/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,gGAAgG;IAChG,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;8CAC0C;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;uBACmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;sGAEkG;IAClG,IAAI,CAAC,EAAE,OAAO,CAA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WAAmB,EACnB,UAAU,EACV,WAAkB,EAClB,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,OAAO,EACP,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,EACV,YAAY,EAAE,SAAS,EACvB,GAAG,WAAW,EACf,EAAE,YAAY,+BA8Gd"}
@@ -64,9 +64,11 @@ function Section({
64
64
  className,
65
65
  style,
66
66
  classNames,
67
+ "aria-label": ariaLabel,
67
68
  ...headerProps
68
69
  }) {
69
70
  const { title } = headerProps;
71
+ const untitled = title === void 0;
70
72
  useValidateProps(
71
73
  "Section",
72
74
  () => [
@@ -92,30 +94,33 @@ function Section({
92
94
  const inShell = useInPageBarShell();
93
95
  const anchorStyle = id === void 0 ? void 0 : { scrollMarginTop: anchorOffset(inShell) };
94
96
  const rootStyle = anchorStyle === void 0 && style === void 0 ? void 0 : { ...anchorStyle, ...style };
95
- const headerActions = tabs !== void 0 || actions !== void 0 || collapsible ? /* @__PURE__ */ jsxs(Fragment, { children: [
96
- tabs !== void 0 && open && /* @__PURE__ */ jsx(CtlSlot, { children: tabs }),
97
+ const foldable = collapsible && !untitled;
98
+ const headerActions = tabs !== void 0 || actions !== void 0 || foldable ? /* @__PURE__ */ jsxs(Fragment, { children: [
99
+ tabs !== void 0 && (open || untitled) && /* @__PURE__ */ jsx(CtlSlot, { children: tabs }),
97
100
  actions !== void 0 && /* @__PURE__ */ jsx(CtlSlot, { children: /* @__PURE__ */ jsx(BarActionSlot, { actions }) }),
98
- collapsible && /* @__PURE__ */ jsx(ChevronToggle, { open, onToggle: () => setOpen(!open), controls: bodyId })
101
+ foldable && /* @__PURE__ */ jsx(ChevronToggle, { open, onToggle: () => setOpen(!open), controls: bodyId })
99
102
  ] }) : void 0;
100
103
  return /* @__PURE__ */ jsxs(
101
104
  "div",
102
105
  {
103
106
  className: cx(classes.root, classNames?.root, className),
104
107
  "data-tier": tier,
108
+ ...untitled && ariaLabel !== void 0 && { role: "group", "aria-label": ariaLabel },
105
109
  ...id !== void 0 && { id },
106
110
  ...rootStyle !== void 0 && { style: rootStyle },
107
111
  children: [
108
- /* @__PURE__ */ jsx(
112
+ untitled ? /* @__PURE__ */ jsx("div", { className: cx(classes.tabsRow, classNames?.header), "data-basalt-hit-scope": true, children: headerActions }) : /* @__PURE__ */ jsx(
109
113
  WidgetHeader,
110
114
  {
111
115
  tier,
112
116
  ...headerProps,
117
+ title,
113
118
  ...classNames?.header !== void 0 && { className: classNames.header },
114
119
  ...headerActions !== void 0 && { actions: headerActions }
115
120
  }
116
121
  ),
117
122
  summary !== void 0 && /* @__PURE__ */ jsx("div", { className: classes.summary, children: summary }),
118
- open && /* @__PURE__ */ jsx("div", { id: bodyId, className: cx(classes.body, classNames?.body), children: query === void 0 ? children : (
123
+ (open || untitled) && /* @__PURE__ */ jsx("div", { id: bodyId, className: cx(classes.body, classNames?.body), children: query === void 0 ? children : (
119
124
  // `tier="section"` is the compact one: a bare spinner rather than a 64px centred
120
125
  // block, and the error alert without the page-level stack around it. A Section IS the
121
126
  // region, so the state belongs inside its body, never around its header.
@@ -41,6 +41,29 @@
41
41
  gap: 0;
42
42
  }
43
43
 
44
+ /*
45
+ * Three type sizes in one section, not four (argo calendar next-days counted group head 11 + row
46
+ * title 13 + meta 12 + section title 15). The `group` tier is the one head this package draws below
47
+ * the section title, and it was on `micro` (11) — a step of its own. It joins the `xs` (12) step the
48
+ * rows' meta already uses; the head stays a mono UPPERCASE caption, which is the one place D33 keeps
49
+ * mono, so only its size moves and the rank is still carried by case, face and tracking. Section
50
+ * title (15), row title (13) and meta + group head (12) are then the whole ladder.
51
+ */
52
+ .root[data-tier='group'] [data-widget-title] {
53
+ font-size: var(--vx-text-xs);
54
+ }
55
+
56
+ /*
57
+ * The untitled header: `tabs` (and `actions`) alone, one control row at the `ctl` height, so the
58
+ * row costs what the controls cost and nothing for a heading that is not there.
59
+ */
60
+ .tabsRow {
61
+ display: flex;
62
+ align-items: center;
63
+ gap: var(--vx-space-control-gap);
64
+ min-width: 0;
65
+ }
66
+
44
67
  /*
45
68
  * `summary` — the always-visible row under the header. No border, no background (the Section owns
46
69
  * neither); it is a plain flow row, so a consumer's `Group` of stats or one line of `Text` lands
@@ -6,6 +6,7 @@ declare const classes: {
6
6
  readonly root: string
7
7
  readonly body: string
8
8
  readonly summary: string
9
+ readonly tabsRow: string
9
10
  readonly chevron: string
10
11
  }
11
12
  export default classes
@@ -1 +1 @@
1
- {"version":3,"file":"stat-card-parts.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-card-parts.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAI3C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AASD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,eAAe,+BAgC1F;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,+FAA+F;IAC/F,OAAO,EAAE,OAAO,CAAA;IAChB;qFACiF;IACjF,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,SAAS,CAAA;IACrB,UAAU,EAAE,SAAS,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,SAAS,sCAQ9E;AAED;0FAC0F;AAC1F,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM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,GAAG,aAAa,CAK3E;AAED,wBAAgB,aAAa,gCAE5B;AAED,wBAAgB,cAAc,gCAE7B;AAED,wBAAgB,cAAc,gCAE7B;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,+BAU3D"}
@@ -29,7 +29,7 @@ function CaptionRow({ title, icon, info, qualifier, tone, actions }) {
29
29
  }
30
30
  )
31
31
  ] }),
32
- qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, children: qualifier })
32
+ qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, title: qualifier, children: qualifier })
33
33
  ] }),
34
34
  actions !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.actions, "data-basalt-hit-scope": true, children: /* @__PURE__ */ jsx(CtlSlot, { tier: "widget", children: actions }) })
35
35
  ] });
@@ -54,8 +54,10 @@ export type StatCardProps = BasaltProps & SlotStylesProps<StatCardSlot> & Omit<W
54
54
  value: string;
55
55
  /**
56
56
  * Right-aligned on the caption row, `micro` muted: the period, target or source the figure is
57
- * measured over (`30 days`, `target 99.9%`). Wraps under the caption when the card is too narrow
58
- * for both. Not a restatement of the caption.
57
+ * measured over (`30 days`, `target 99.9%`). Wraps under the caption when the card is too
58
+ * narrow for both. Only in a card narrower than 240px does it truncate instead (the full text
59
+ * is its `title`); between 240px and the width it fits, a long one still wraps and moves the
60
+ * value down a line. Not a restatement of the caption.
59
61
  */
60
62
  qualifier?: string;
61
63
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"stat-card.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-card.tsx"],"names":[],"mappings":"AA6FA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUtC,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,KAAK,EAAE,WAAW,E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AAI,EACJ,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,aAAa,+BAgLf"}
@@ -14,7 +14,7 @@ import { DeltaBadge } from "./delta-badge.js";
14
14
  import { cx } from "../common/props.js";
15
15
  import { ErrorState, QueryState, resolveQueryBranch } from "./query-state.js";
16
16
  import classes from "./stat-card.module.css";
17
- import { VisualSlotContext } from "./visual-slot.js";
17
+ import { HOSTED, VisualSlotContext } from "./visual-slot.js";
18
18
  const SPARKLINE_RIGHT_WIDTH = 72;
19
19
  const SPARKLINE_HEIGHT = 22;
20
20
  function useSlotWidth(active) {
@@ -51,7 +51,7 @@ function renderValueBody({
51
51
  ErrorState,
52
52
  {
53
53
  error: resolved.error,
54
- title: "Could not load this figure",
54
+ title: "Could not load",
55
55
  tier: "section",
56
56
  onRetry: () => void resolved.query.refetch(),
57
57
  retrying: resolved.query.fetchStatus === "fetching"
@@ -76,10 +76,12 @@ function renderVisualNode({
76
76
  }
77
77
  function renderFooterNode({
78
78
  subtitle,
79
- pending
79
+ pending,
80
+ ready
80
81
  }) {
81
82
  if (subtitle === void 0) return null;
82
83
  if (pending) return /* @__PURE__ */ jsx(FooterSkeleton, {});
84
+ if (!ready) return null;
83
85
  return /* @__PURE__ */ jsx("p", { className: classes.footer, title: subtitle, children: subtitle });
84
86
  }
85
87
  function StatCard({
@@ -137,7 +139,7 @@ function StatCard({
137
139
  classNames?.sparkline
138
140
  ),
139
141
  ...!bleeds && { style: rightSlotStyle(SPARKLINE_RIGHT_WIDTH, SPARKLINE_HEIGHT) },
140
- children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: true, children: isRender ? measured.width > 0 && sparkline(measured) : sparkline })
142
+ children: /* @__PURE__ */ jsx(VisualSlotContext.Provider, { value: tone === void 0 ? HOSTED : { tone }, children: isRender ? measured.width > 0 && sparkline(measured) : sparkline })
141
143
  }
142
144
  );
143
145
  const figure = /* @__PURE__ */ jsxs("div", { className: classes.valueRow, children: [
@@ -162,7 +164,7 @@ function StatCard({
162
164
  const rightRow = !bleeds && (ready ? breakdownContent !== null || sparklineSlot !== null : pending && (hasBreakdown || sparkline !== void 0));
163
165
  const hasBleedVisual = sparkline !== void 0 && bleeds;
164
166
  const visualNode = renderVisualNode({ show: hasBleedVisual, pending, slot: sparklineSlot });
165
- const footerNode = renderFooterNode({ subtitle, pending });
167
+ const footerNode = renderFooterNode({ subtitle, pending, ready });
166
168
  return /* @__PURE__ */ jsx(
167
169
  Card,
168
170
  {
@@ -96,6 +96,23 @@
96
96
  min-width: 0;
97
97
  }
98
98
 
99
+ /* A card too narrow to share its caption row (a two-column phone cell, ~170px) never wraps the
100
+ * qualifier under the caption: that second line pushed the value below its row neighbours'. The
101
+ * caption row stays one line; the qualifier truncates (full text in its `title`). */
102
+ @container basalt-card (max-width: 239.9px) {
103
+ .captionMain {
104
+ flex-wrap: nowrap;
105
+ }
106
+
107
+ .qualifier {
108
+ flex: 0 1 auto;
109
+ overflow: hidden;
110
+ text-overflow: ellipsis;
111
+ white-space: nowrap;
112
+ text-align: end;
113
+ }
114
+ }
115
+
99
116
  /* Law C15: the shared hit overlay; `--vx-hit-gap` caps the expansion at the control gap. */
100
117
  .actions {
101
118
  --vx-hit-gap: var(--vx-space-control-gap);
@@ -8,6 +8,8 @@ export type StatStripRow = {
8
8
  visual?: ReactNode;
9
9
  /** A `DeltaBadge`. */
10
10
  delta?: ReactNode;
11
+ /** The reading is already shown (the hero): print the label alone. `value` is ignored. */
12
+ hideValue?: boolean;
11
13
  };
12
14
  /** What a cell shows instead of its readings. Mirrors `StatCard`'s `query` branches. */
13
15
  type StatStripCellState = {
@@ -26,8 +28,12 @@ type StatStripCellState = {
26
28
  export type StatStripCell = {
27
29
  key: string;
28
30
  caption: string;
29
- /** Muted, on the caption line: `CAPTION · qualifier`. */
31
+ /** Muted, on the caption line: `CAPTION · qualifier`. It wraps whole under the caption when it
32
+ * does not fit (by design: no truncation, so no `title`). */
30
33
  qualifier?: string;
34
+ /** A control at the end of the caption line (a popover trigger). Never wraps the line: the
35
+ * caption truncates first. */
36
+ action?: ReactNode;
31
37
  /** The definition behind the caption, in the info-glyph tooltip. */
32
38
  info?: string;
33
39
  /** `null` = no reading, printed as `—`. Omit only when `rows` carries the cell. */
@@ -1 +1 @@
1
- {"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-strip.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAQxD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,wFAAwF;AACxF,KAAK,kBAAkB,GACnB;IACE,IAAI,EAAE,OAAO,CAAA;IACb,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GACD;IACE,IAAI,EAAE,OAAO,CAAA;IACb,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAEL,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,s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