basalt-ui 2.19.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/MIGRATING.md +174 -12
  3. package/agent/rules/basalt-charts.md +1 -1
  4. package/agent/rules/basalt-mantine.md +1 -1
  5. package/agent/skills/basalt-app/SKILL.md +1 -1
  6. package/agent/skills/basalt-design/SKILL.md +1 -1
  7. package/agent/templates/DESIGN.md.tpl +1 -1
  8. package/configs/oxlint-plugin.js +33 -19
  9. package/configs/oxlint-plugin.test.ts +32 -2
  10. package/dist/charts/ChartCard.d.ts +28 -3
  11. package/dist/charts/ChartCard.d.ts.map +1 -1
  12. package/dist/charts/ChartCard.js +33 -11
  13. package/dist/charts/Donut.d.ts.map +1 -1
  14. package/dist/charts/Donut.js +13 -1
  15. package/dist/charts/Heatmap.js +1 -1
  16. package/dist/charts/Sparkline.d.ts +7 -1
  17. package/dist/charts/Sparkline.d.ts.map +1 -1
  18. package/dist/charts/Sparkline.js +137 -18
  19. package/dist/charts/box.d.ts +2 -0
  20. package/dist/charts/box.d.ts.map +1 -1
  21. package/dist/charts/box.js +2 -0
  22. package/dist/charts/chart-box.module.css +30 -0
  23. package/dist/charts/chart-box.module.css.d.ts +1 -0
  24. package/dist/charts/chart-card.module.css +47 -0
  25. package/dist/charts/chart-card.module.css.d.ts +7 -0
  26. package/dist/charts/compile.d.ts.map +1 -1
  27. package/dist/charts/compile.js +35 -8
  28. package/dist/charts/host.d.ts.map +1 -1
  29. package/dist/charts/host.js +2 -1
  30. package/dist/charts/index.d.ts +1 -1
  31. package/dist/charts/index.d.ts.map +1 -1
  32. package/dist/charts/sparkline.module.css +59 -0
  33. package/dist/charts/sparkline.module.css.d.ts +13 -0
  34. package/dist/charts/state.d.ts.map +1 -1
  35. package/dist/charts/state.js +32 -4
  36. package/dist/charts/types.d.ts +6 -0
  37. package/dist/charts/types.d.ts.map +1 -1
  38. package/dist/controls/sync-button.d.ts +3 -0
  39. package/dist/controls/sync-button.d.ts.map +1 -1
  40. package/dist/dashboard/bar-list.d.ts +15 -4
  41. package/dist/dashboard/bar-list.d.ts.map +1 -1
  42. package/dist/dashboard/bar-list.js +39 -15
  43. package/dist/dashboard/bar-list.module.css +77 -2
  44. package/dist/dashboard/bar-list.module.css.d.ts +1 -0
  45. package/dist/dashboard/delta-badge.d.ts +8 -3
  46. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  47. package/dist/dashboard/delta-badge.js +9 -2
  48. package/dist/dashboard/index.d.ts +2 -0
  49. package/dist/dashboard/index.d.ts.map +1 -1
  50. package/dist/dashboard/meter-model.d.ts +19 -0
  51. package/dist/dashboard/meter-model.d.ts.map +1 -1
  52. package/dist/dashboard/meter-model.js +18 -1
  53. package/dist/dashboard/meter-parts.d.ts +5 -1
  54. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  55. package/dist/dashboard/meter-parts.js +114 -74
  56. package/dist/dashboard/meter.d.ts +22 -1
  57. package/dist/dashboard/meter.d.ts.map +1 -1
  58. package/dist/dashboard/meter.js +4 -1
  59. package/dist/dashboard/meter.module.css +90 -12
  60. package/dist/dashboard/meter.module.css.d.ts +5 -0
  61. package/dist/dashboard/query-state.d.ts.map +1 -1
  62. package/dist/dashboard/query-state.js +14 -9
  63. package/dist/dashboard/settings-section.d.ts.map +1 -1
  64. package/dist/dashboard/settings-section.js +14 -25
  65. package/dist/dashboard/stat-card-parts.js +1 -1
  66. package/dist/dashboard/stat-card.d.ts +1 -1
  67. package/dist/dashboard/stat-card.d.ts.map +1 -1
  68. package/dist/dashboard/stat-card.js +3 -6
  69. package/dist/dashboard/stat-card.module.css +15 -7
  70. package/dist/dashboard/stat-group.d.ts +11 -2
  71. package/dist/dashboard/stat-group.d.ts.map +1 -1
  72. package/dist/dashboard/stat-group.js +9 -7
  73. package/dist/dashboard/stat-strip.d.ts +50 -0
  74. package/dist/dashboard/stat-strip.d.ts.map +1 -0
  75. package/dist/dashboard/stat-strip.js +85 -0
  76. package/dist/dashboard/stat-strip.module.css +208 -0
  77. package/dist/dashboard/stat-strip.module.css.d.ts +28 -0
  78. package/dist/dashboard/widget-header.d.ts +3 -3
  79. package/dist/dashboard/widget-header.module.css +10 -6
  80. package/dist/format/date.d.ts.map +1 -1
  81. package/dist/format/date.js +4 -3
  82. package/dist/format/shared.d.ts +6 -0
  83. package/dist/format/shared.d.ts.map +1 -1
  84. package/dist/format/shared.js +6 -2
  85. package/dist/guard/index.d.ts +1 -1
  86. package/dist/guard/index.js +1 -1
  87. package/dist/index.d.ts +3 -1
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +4 -0
  90. package/dist/styles.css +6 -0
  91. package/dist/theme/card-inset.module.css +76 -0
  92. package/dist/theme/card-inset.module.css.d.ts +9 -0
  93. package/dist/theme/controls.module.css +3 -0
  94. package/dist/theme/index.d.ts.map +1 -1
  95. package/dist/theme/index.js +23 -0
  96. package/dist/theme/nav-link.module.css +8 -10
  97. package/dist/theme/status-dot.d.ts +3 -2
  98. package/dist/theme/status-dot.d.ts.map +1 -1
  99. package/dist/theme/status-dot.js +12 -3
  100. package/dist/theme/status-verdict.d.ts +3 -2
  101. package/dist/theme/status-verdict.d.ts.map +1 -1
  102. package/dist/theme/status-verdict.js +3 -2
  103. package/dist/theme/status-verdict.module.css +4 -2
  104. package/llms.txt +30 -6
  105. package/package.json +1 -1
  106. package/src/charts/ChartCard.tsx +70 -4
  107. package/src/charts/Donut.tsx +9 -1
  108. package/src/charts/Heatmap.tsx +1 -1
  109. package/src/charts/Sparkline.tsx +180 -18
  110. package/src/charts/box.tsx +2 -0
  111. package/src/charts/chart-box.module.css +30 -0
  112. package/src/charts/chart-box.module.css.d.ts +1 -0
  113. package/src/charts/chart-card.module.css +47 -0
  114. package/src/charts/chart-card.module.css.d.ts +7 -0
  115. package/src/charts/compile.ts +42 -9
  116. package/src/charts/host.tsx +6 -3
  117. package/src/charts/index.ts +1 -1
  118. package/src/charts/sparkline.module.css +59 -0
  119. package/src/charts/sparkline.module.css.d.ts +13 -0
  120. package/src/charts/state.tsx +44 -4
  121. package/src/charts/types.ts +6 -0
  122. package/src/controls/sync-button.tsx +3 -0
  123. package/src/dashboard/bar-list.module.css +77 -2
  124. package/src/dashboard/bar-list.module.css.d.ts +1 -0
  125. package/src/dashboard/bar-list.tsx +86 -18
  126. package/src/dashboard/delta-badge.tsx +21 -5
  127. package/src/dashboard/index.ts +2 -0
  128. package/src/dashboard/meter-model.ts +35 -0
  129. package/src/dashboard/meter-parts.tsx +119 -23
  130. package/src/dashboard/meter.module.css +90 -12
  131. package/src/dashboard/meter.module.css.d.ts +5 -0
  132. package/src/dashboard/meter.tsx +26 -2
  133. package/src/dashboard/query-state.tsx +28 -19
  134. package/src/dashboard/settings-section.tsx +1 -8
  135. package/src/dashboard/stat-card-parts.tsx +1 -1
  136. package/src/dashboard/stat-card.module.css +15 -7
  137. package/src/dashboard/stat-card.tsx +5 -8
  138. package/src/dashboard/stat-group.tsx +19 -8
  139. package/src/dashboard/stat-strip.module.css +208 -0
  140. package/src/dashboard/stat-strip.module.css.d.ts +28 -0
  141. package/src/dashboard/stat-strip.tsx +183 -0
  142. package/src/dashboard/widget-header.module.css +10 -6
  143. package/src/dashboard/widget-header.tsx +3 -3
  144. package/src/format/date.ts +6 -3
  145. package/src/format/shared.ts +11 -2
  146. package/src/guard/index.ts +1 -1
  147. package/src/index.ts +7 -0
  148. package/src/styles.css +6 -0
  149. package/src/theme/__snapshots__/plain-theme.test.ts.snap +168 -24
  150. package/src/theme/card-inset.module.css +76 -0
  151. package/src/theme/card-inset.module.css.d.ts +9 -0
  152. package/src/theme/controls.module.css +3 -0
  153. package/src/theme/index.ts +30 -0
  154. package/src/theme/nav-link.module.css +8 -10
  155. package/src/theme/status-dot.tsx +17 -5
  156. package/src/theme/status-verdict.module.css +4 -2
  157. package/src/theme/status-verdict.tsx +9 -4
@@ -49,7 +49,7 @@ export type StatCardSparklineSize = {
49
49
  * three slices.
50
50
  */
51
51
  export type StatCardProps = BasaltProps & SlotStylesProps<StatCardSlot> & Omit<WidgetHeaderTitleProps, 'subtitle'> & Omit<WidgetHeaderMetricProps, 'value'> & WidgetHeaderDeltaProps & {
52
- /** Pre-formatted hero figure (mono `kpi`, weight 500, ink). Required here, unlike on
52
+ /** Pre-formatted hero figure (sans `kpi`, weight 500, lining, ink). Required here, unlike on
53
53
  * `WidgetHeader`: see the type's own doc. */
54
54
  value: string;
55
55
  /**
@@ -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,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEzE,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,eAAe,CAAA;AAGhE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CACrB,CAAA;AAaD;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAmCD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GACrC,eAAe,CAAC,YAAY,CAAC,GAC7B,IAAI,CAAC,sBAAsB,EAAE,U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CAAC,OAAO,CAAC,CAAA;IAC/B;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,qBAAqB,KAAK,SAAS,CAAC,CAAA;IACpE;;qBAEiB;IACjB,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IACtC;oGACgG;IAChG,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB;;;;6BAIyB;IACzB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AA0EH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,SAAS,EACT,KAAK,EACL,OAAe,EACf,SAAqC,EACrC,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,kBAA4B,EAC5B,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,EACL,UAAU,GACX,EAAE,aAAa,+BA8Kf"}
@@ -167,11 +167,9 @@ function StatCard({
167
167
  {
168
168
  className: cx(classNames?.root, className),
169
169
  style: {
170
- // Card inset = the `cardInsetY`/`cardInsetX` role tokens (12/16 at level 0, the `sm`/`md`
171
- // rungs of the spacing grid), matching every other basalt card because `ChartCard` reads
172
- // the SAME two vars. Below `sm` the horizontal one steps a rung down (to 12) on its own:
173
- // the responsive half of the ladder lives in `spaceMobileDecls` (`tokens/index.ts`), which
174
- // is the only home that can reach an inline style like this one.
170
+ // The inset is the theme's (`card-inset.module.css`: the `cardInsetY`/`cardInsetX` tokens, 12/16
171
+ // at level 0, stepping the horizontal one down a rung below `sm`), so it is NOT restated here —
172
+ // an inline copy would bypass `variant="flush"`.
175
173
  //
176
174
  // `overflow: hidden` clips the full-bleed sparkline to the card's rounded corners. An
177
175
  // element's own `box-shadow` renders outside its border box and is NOT clipped by its own
@@ -179,7 +177,6 @@ function StatCard({
179
177
  //
180
178
  // NO `minHeight`: the content states the height (the foot reserves its own), and cards in a
181
179
  // grid row stretch to the tallest.
182
- padding: "var(--vx-space-card-inset-y, 0.75rem) var(--vx-space-card-inset-x, 1rem)",
183
180
  overflow: "hidden",
184
181
  // Consumers may anchor overlays (badges, menus) to the card, so it stays a positioned box.
185
182
  position: "relative",
@@ -12,6 +12,9 @@
12
12
  --basalt-stat-visual-h: 1.375rem;
13
13
  --basalt-stat-footer-h: 1.25rem;
14
14
  --basalt-stat-foot-gap: 0.25rem;
15
+ /* The line a Sparkline's hover readout takes above its plot (`charts/sparkline.module.css` reads
16
+ * it too). A slot that cannot spare it reserves it as padding, so the chip never covers the hero. */
17
+ --basalt-spark-readout-h: 1.125rem;
15
18
  /* The figure's size and line box, in one place: `.value`, the empty line and the pending skeleton
16
19
  * all read them, so nothing moves when a reading lands. */
17
20
  --basalt-stat-figure-size: var(--vx-text-kpi);
@@ -86,7 +89,6 @@
86
89
  }
87
90
 
88
91
  .qualifier {
89
- font-family: var(--basalt-font-mono);
90
92
  font-size: var(--vx-text-micro);
91
93
  color: var(--vx-muted);
92
94
  /* Wraps before it is ever cut: a qualifier too long for the row on its own line breaks its words. */
@@ -128,7 +130,8 @@
128
130
  .value {
129
131
  min-width: 0;
130
132
  overflow-wrap: anywhere;
131
- font-family: var(--basalt-font-mono);
133
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
134
+ font-variant-numeric: lining-nums;
132
135
  font-size: var(--basalt-stat-figure-size);
133
136
  line-height: var(--basalt-stat-figure-line);
134
137
  font-weight: 500;
@@ -136,11 +139,12 @@
136
139
  color: var(--vx-ink);
137
140
  }
138
141
 
139
- /* Mono like the number it qualifies, `sm` and muted: the SMALL half of the pair. Never shrinks — a
142
+ /* Sans like the number it qualifies, `sm` and muted: the SMALL half of the pair. Never shrinks — a
140
143
  * unit clipped to `TS…` would state nothing. */
141
144
  .unit {
142
145
  flex-shrink: 0;
143
- font-family: var(--basalt-font-mono);
146
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
147
+ font-variant-numeric: lining-nums;
144
148
  font-size: var(--vx-text-sm);
145
149
  font-weight: 500;
146
150
  color: var(--vx-muted);
@@ -306,12 +310,13 @@
306
310
  color: var(--vx-muted);
307
311
  }
308
312
 
309
- /* Mono and ink — a breakdown value is a number, and it is the half of the row worth reading. Never
313
+ /* Sans and ink — a breakdown value is a number, and it is the half of the row worth reading. Never
310
314
  * shrinks: the LABEL is the prose half and the one that may ellipsize. */
311
315
  .breakdownValue {
312
316
  flex-shrink: 0;
313
317
  margin: 0;
314
- font-family: var(--basalt-font-mono);
318
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
319
+ font-variant-numeric: lining-nums;
315
320
  font-size: var(--vx-text-sm);
316
321
  font-weight: 500;
317
322
  color: var(--vx-ink);
@@ -353,6 +358,7 @@
353
358
  .sparklineRight:has(> [data-basalt-meter]) {
354
359
  flex: 1 1 auto;
355
360
  height: auto;
361
+ padding-top: 0;
356
362
  overflow: visible;
357
363
  align-items: stretch;
358
364
  }
@@ -367,7 +373,9 @@
367
373
  display: flex;
368
374
  flex: 0 1 var(--basalt-stat-sparkline-w, 4.5rem);
369
375
  min-width: 0;
370
- height: var(--basalt-stat-sparkline-h, 1.375rem);
376
+ /* The slot clips, so it holds the Sparkline's readout line inside its own box (padding-top). */
377
+ height: calc(var(--basalt-stat-sparkline-h, 1.375rem) + var(--basalt-spark-readout-h));
378
+ padding-top: var(--basalt-spark-readout-h);
371
379
  align-items: flex-end;
372
380
  align-self: flex-end;
373
381
  overflow: hidden;
@@ -21,6 +21,8 @@
21
21
  * rule on the GROUP, so the cells stay whatever they are; on `StatCard`s (which carry their own
22
22
  * panel and shadow ring) the rail reads as a second frame, so pair it with unadorned children.
23
23
  *
24
+ * `variant="strip"` is the joined-surface form with typed cells and a footer row (`stat-strip.tsx`).
25
+ *
24
26
  * @example
25
27
  * import { StatCard, StatGroup } from 'basalt-ui'
26
28
  *
@@ -32,9 +34,11 @@
32
34
  */
33
35
  import type { ReactNode } from 'react';
34
36
  import type { BasaltProps } from '../common/props.js';
37
+ import type { StatStripProps } from './stat-strip.js';
35
38
  /** The desktop KPI column count. */
36
39
  export type StatGroupCols = 2 | 3 | 4 | 5;
37
- export type StatGroupProps = BasaltProps & {
40
+ export type StatGridProps = BasaltProps & {
41
+ variant?: 'grid';
38
42
  /** The DESKTOP column count (`lg` and up). Default `4`. `sm` gets `min(cols, 3)` — except `4`, which gets 2 rather than an orphan row. A phone gets 2.
39
43
  * Never a responsive object — the law is basalt's, see the module docblock. */
40
44
  cols?: StatGroupCols;
@@ -43,5 +47,10 @@ export type StatGroupProps = BasaltProps & {
43
47
  /** The KPI cells — normally `StatCard`s. */
44
48
  children: ReactNode;
45
49
  };
46
- export declare function StatGroup({ cols, divided, children, className, style, }: StatGroupProps): import("react").JSX.Element;
50
+ /** `variant="strip"`: one joined surface of typed `cells` split by hairlines, plus an optional
51
+ * `footer` row — see `StatStripProps`. `cols` here may be 6 (the strip's desktop count). */
52
+ export type StatGroupProps = StatGridProps | ({
53
+ variant: 'strip';
54
+ } & StatStripProps);
55
+ export declare function StatGroup(props: StatGroupProps): import("react").JSX.Element;
47
56
  //# sourceMappingURL=stat-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stat-group.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-group.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC;mFAC+E;IAC/E,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAQ,EACR,OAAe,EACf,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,cAAc,+BAqChB"}
1
+ {"version":3,"file":"stat-group.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-group.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAGlD,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEzC,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;mFAC+E;IAC/E,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED;4FAC4F;AAC5F,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,cAAc,CAAC,CAAA;AAEpF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAM9C"}
@@ -1,13 +1,15 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { cx } from "../common/props.js";
3
+ import { StatStrip } from "./stat-strip.js";
3
4
  import classes from "./stat-group.module.css";
4
- function StatGroup({
5
- cols = 4,
6
- divided = false,
7
- children,
8
- className,
9
- style
10
- }) {
5
+ function StatGroup(props) {
6
+ if (props.variant === "strip") {
7
+ const { variant: _variant, ...strip } = props;
8
+ return /* @__PURE__ */ jsx(StatStrip, { ...strip });
9
+ }
10
+ return /* @__PURE__ */ jsx(StatGrid, { ...props });
11
+ }
12
+ function StatGrid({ cols = 4, divided = false, children, className, style }) {
11
13
  const smCols = cols === 4 ? 2 : Math.min(cols, 3);
12
14
  return (
13
15
  // Two boxes, and the outer one is not decoration: a size container is a container for its
@@ -0,0 +1,50 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { BasaltProps, Tone } from '../common/props.js';
3
+ export type StatStripRow = {
4
+ key: string;
5
+ label: string;
6
+ /** `null` = no reading, printed as `—`. Pre-join the unit (`'48 ms'`). */
7
+ value: string | null;
8
+ visual?: ReactNode;
9
+ /** A `DeltaBadge`. */
10
+ delta?: ReactNode;
11
+ };
12
+ export type StatStripCell = {
13
+ key: string;
14
+ caption: string;
15
+ /** Muted, on the caption line: `CAPTION · qualifier`. */
16
+ qualifier?: string;
17
+ /** The definition behind the caption, in the info-glyph tooltip. */
18
+ info?: string;
19
+ /** `null` = no reading, printed as `—`. Omit only when `rows` carries the cell. */
20
+ value?: string | null;
21
+ unit?: string;
22
+ /** A `DeltaBadge`. */
23
+ delta?: ReactNode;
24
+ /** The micro-visual slot (Meter / Sparkline / BandStrip). */
25
+ visual?: ReactNode;
26
+ /** A muted line pinned to the cell foot. */
27
+ footer?: ReactNode;
28
+ /** Aligned signals under the hero (or alone when `value` is omitted). */
29
+ rows?: readonly StatStripRow[];
30
+ /** Inks the value only — set it when the reading is a verdict. */
31
+ tone?: Tone;
32
+ /** Skeleton in place of the readings. */
33
+ loading?: boolean;
34
+ /** Dims the cell while placeholder data shows. */
35
+ stale?: boolean;
36
+ };
37
+ export type StatStripProps = BasaltProps & {
38
+ /** The strip's accessible name. */
39
+ label: string;
40
+ cells: readonly StatStripCell[];
41
+ /** Wider cells under the cells. */
42
+ footer?: readonly {
43
+ key: string;
44
+ content: ReactNode;
45
+ }[];
46
+ /** The DESKTOP column count. Default: the cell count, capped at 6. */
47
+ cols?: 2 | 3 | 4 | 5 | 6;
48
+ };
49
+ export declare function StatStrip({ label, cells, footer, cols, className, style }: StatStripProps): import("react").JSX.Element;
50
+ //# sourceMappingURL=stat-strip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../../src/dashboard/stat-strip.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAKxD,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,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,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IAC9B,kEAAkE;IAClE,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kDAAkD;IAClD,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,mCAAmC;IACnC,MAAM,CAAC,EAAE,SAAS;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,SAAS,CAAA;KAAE,EAAE,CAAA;IACvD,sEAAsE;IACtE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CACzB,CAAA;AAuED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,cAAc,+BAyCzF"}
@@ -0,0 +1,85 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Card, Skeleton } from "@mantine/core";
3
+ import { useId } from "react";
4
+ import { cx } from "../common/props.js";
5
+ import { VX } from "../tokens/index.js";
6
+ import { InfoGlyph } from "./widget-header.js";
7
+ import classes from "./stat-strip.module.css";
8
+ const EMPTY = "\u2014";
9
+ function StripCell({ cell }) {
10
+ const captionId = useId();
11
+ const { rows, loading } = cell;
12
+ const hasHero = cell.value !== void 0 || rows === void 0;
13
+ return /* @__PURE__ */ jsxs(
14
+ "article",
15
+ {
16
+ className: classes.cell,
17
+ "data-strip-cell": cell.key,
18
+ "data-shot": `strip-${cell.key}`,
19
+ "aria-labelledby": captionId,
20
+ ...cell.stale && { "data-stale": "true" },
21
+ children: [
22
+ /* @__PURE__ */ jsxs("div", { className: classes.captionLine, children: [
23
+ /* @__PURE__ */ jsxs("span", { className: classes.lead, children: [
24
+ /* @__PURE__ */ jsx("span", { className: classes.caption, id: captionId, title: cell.caption, "data-strip-caption": true, children: cell.caption }),
25
+ cell.info !== void 0 && /* @__PURE__ */ jsx(InfoGlyph, { text: cell.info })
26
+ ] }),
27
+ cell.qualifier !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.qualifier, children: cell.qualifier })
28
+ ] }),
29
+ hasHero && (loading ? /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonValue, radius: "sm" }) : /* @__PURE__ */ jsxs("div", { className: classes.valueRow, children: [
30
+ /* @__PURE__ */ jsx(
31
+ "span",
32
+ {
33
+ className: classes.value,
34
+ "data-strip-value": true,
35
+ style: cell.tone !== void 0 ? { color: VX.status[cell.tone] } : void 0,
36
+ children: cell.value ?? EMPTY
37
+ }
38
+ ),
39
+ cell.value !== void 0 && cell.value !== null && cell.unit !== void 0 && /* @__PURE__ */ jsx("span", { className: classes.unit, children: cell.unit }),
40
+ cell.delta
41
+ ] })),
42
+ cell.visual !== void 0 && /* @__PURE__ */ jsx("div", { className: classes.visual, children: cell.visual }),
43
+ rows !== void 0 && (loading ? /* @__PURE__ */ jsx("div", { className: classes.rows, "aria-hidden": "true", children: rows.map((row) => /* @__PURE__ */ jsx(Skeleton, { className: classes.skeletonRow, radius: "sm" }, row.key)) }) : /* @__PURE__ */ jsx("ul", { className: classes.rows, children: rows.map((row) => /* @__PURE__ */ jsxs("li", { className: classes.row, "data-strip-row": row.key, children: [
44
+ /* @__PURE__ */ jsx("span", { className: classes.rowLabel, children: row.label }),
45
+ /* @__PURE__ */ jsx("span", { className: classes.visual, children: row.visual }),
46
+ /* @__PURE__ */ jsx("span", { className: classes.rowValue, children: row.value ?? EMPTY }),
47
+ /* @__PURE__ */ jsx("span", { children: row.delta })
48
+ ] }, row.key)) })),
49
+ cell.footer !== void 0 && /* @__PURE__ */ jsx("div", { className: classes.footer, children: cell.footer })
50
+ ]
51
+ }
52
+ );
53
+ }
54
+ function StatStrip({ label, cells, footer, cols, className, style }) {
55
+ const desktop = cols ?? Math.min(Math.max(cells.length, 2), 6);
56
+ const mid = desktop === 4 ? 2 : Math.min(desktop, 3);
57
+ return /* @__PURE__ */ jsx("div", { className: cx(classes.container, className), style, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(
58
+ Card.Section,
59
+ {
60
+ component: "section",
61
+ "aria-label": label,
62
+ className: classes.clip,
63
+ style: {
64
+ "--basalt-strip-cols": desktop,
65
+ "--basalt-strip-cols-sm": mid
66
+ },
67
+ children: [
68
+ /* @__PURE__ */ jsx("div", { className: classes.cells, children: cells.map((cell) => /* @__PURE__ */ jsx(StripCell, { cell }, cell.key)) }),
69
+ footer !== void 0 && footer.length > 0 && /* @__PURE__ */ jsx("div", { className: classes.footerRow, children: footer.map((entry) => /* @__PURE__ */ jsx(
70
+ "div",
71
+ {
72
+ className: classes.footerCell,
73
+ "data-strip-footer-cell": entry.key,
74
+ "data-shot": `strip-footer-${entry.key}`,
75
+ children: entry.content
76
+ },
77
+ entry.key
78
+ )) })
79
+ ]
80
+ }
81
+ ) }) });
82
+ }
83
+ export {
84
+ StatStrip
85
+ };
@@ -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 (mono, hero size, never truncated). Renders on its own row with
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, mono, `--vx-text-sm`.
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
- /** Mono count tag rendered after the title (C11 — every table/list states its count). `0` is a
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. */
@@ -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-mono);
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-mono);
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. Mono like the number it qualifies (so `412 TSS` sits on one
184
- * baseline grid), `--vx-text-sm` and `--vx-muted` so it never competes with the numeral — the whole
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-mono);
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);
@@ -343,7 +346,8 @@
343
346
  white-space: nowrap;
344
347
  align-items: baseline;
345
348
  gap: 3px;
346
- font-family: var(--basalt-font-mono);
349
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
350
+ font-variant-numeric: lining-nums;
347
351
  font-size: var(--vx-text-sm);
348
352
  font-weight: 500;
349
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,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