basalt-ui 2.27.2 → 2.29.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 (343) hide show
  1. package/CHANGELOG.md +466 -307
  2. package/MIGRATING.md +358 -12
  3. package/agent/rules/basalt-batteries.md +1 -1
  4. package/agent/rules/basalt-mantine.md +1 -1
  5. package/agent/rules/basalt-tokens.md +2 -2
  6. package/agent/skills/basalt-app/SKILL.md +3 -3
  7. package/agent/skills/basalt-charts/SKILL.md +1 -1
  8. package/agent/skills/basalt-design/SKILL.md +12 -6
  9. package/agent/skills/basalt-design/references/catalogue.md +42 -36
  10. package/agent/skills/basalt-design/references/recipes.md +47 -0
  11. package/agent/skills/basalt-design/references/states.md +1 -1
  12. package/configs/oxlint-basalt.json +2 -1
  13. package/configs/oxlint-plugin.js +112 -3
  14. package/configs/oxlint-plugin.test.ts +99 -4
  15. package/configs/oxlint.json +1 -0
  16. package/dist/agent/chat/thread-message.d.ts +1 -160
  17. package/dist/agent/chat/thread-message.d.ts.map +1 -1
  18. package/dist/agent/chat/thread-message.js +7 -162
  19. package/dist/agent/chat/virtualize.d.ts +5 -5
  20. package/dist/charts/ChartCard.d.ts +14 -7
  21. package/dist/charts/ChartCard.d.ts.map +1 -1
  22. package/dist/charts/ChartCard.js +112 -23
  23. package/dist/charts/Lines.d.ts.map +1 -1
  24. package/dist/charts/Lines.js +11 -4
  25. package/dist/charts/Sparkline.d.ts +14 -2
  26. package/dist/charts/Sparkline.d.ts.map +1 -1
  27. package/dist/charts/Sparkline.js +155 -44
  28. package/dist/charts/chart-box.module.css +59 -2
  29. package/dist/charts/chart-box.module.css.d.ts +5 -0
  30. package/dist/charts/chart-card.module.css +28 -17
  31. package/dist/charts/chart-card.module.css.d.ts +3 -0
  32. package/dist/charts/compile.d.ts +1 -1
  33. package/dist/charts/compile.d.ts.map +1 -1
  34. package/dist/charts/compile.js +38 -27
  35. package/dist/charts/labels.d.ts +13 -3
  36. package/dist/charts/labels.d.ts.map +1 -1
  37. package/dist/charts/labels.js +131 -20
  38. package/dist/charts/legend.d.ts.map +1 -1
  39. package/dist/charts/legend.js +1 -1
  40. package/dist/charts/ref-label.d.ts +37 -8
  41. package/dist/charts/ref-label.d.ts.map +1 -1
  42. package/dist/charts/ref-label.js +55 -10
  43. package/dist/charts/sparkline.module.css +50 -0
  44. package/dist/charts/sparkline.module.css.d.ts +3 -0
  45. package/dist/charts/state.d.ts +4 -4
  46. package/dist/charts/state.d.ts.map +1 -1
  47. package/dist/charts/state.js +23 -5
  48. package/dist/cli/doctor-upgrade.d.ts +11 -0
  49. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  50. package/dist/cli/doctor-upgrade.js +54 -0
  51. package/dist/cli/doctor.d.ts.map +1 -1
  52. package/dist/cli/doctor.js +32 -0
  53. package/dist/cli/help.d.ts.map +1 -1
  54. package/dist/cli/help.js +8 -3
  55. package/dist/cli/index.d.ts +13 -13
  56. package/dist/cli/index.d.ts.map +1 -1
  57. package/dist/cli/index.js +36 -2
  58. package/dist/cli/init.d.ts +6 -0
  59. package/dist/cli/init.d.ts.map +1 -1
  60. package/dist/cli/init.js +118 -27
  61. package/dist/cli/router-wiring.d.ts +3 -0
  62. package/dist/cli/router-wiring.d.ts.map +1 -1
  63. package/dist/cli/router-wiring.js +2 -0
  64. package/dist/cli/shot/capture.d.ts +34 -2
  65. package/dist/cli/shot/capture.d.ts.map +1 -1
  66. package/dist/cli/shot/capture.js +95 -12
  67. package/dist/cli/shot/detect.d.ts +4 -1
  68. package/dist/cli/shot/detect.d.ts.map +1 -1
  69. package/dist/cli/shot/detect.js +38 -16
  70. package/dist/cli/shot/index.d.ts.map +1 -1
  71. package/dist/cli/shot/index.js +9 -2
  72. package/dist/cli/shot/measure.d.ts.map +1 -1
  73. package/dist/cli/shot/measure.js +11 -2
  74. package/dist/cli/shot/types.d.ts +4 -1
  75. package/dist/cli/shot/types.d.ts.map +1 -1
  76. package/dist/cli/sync.d.ts.map +1 -1
  77. package/dist/cli/sync.js +10 -2
  78. package/dist/common/could-not-load.d.ts +13 -0
  79. package/dist/common/could-not-load.d.ts.map +1 -0
  80. package/dist/common/could-not-load.js +14 -0
  81. package/dist/common/empty-copy.d.ts +16 -0
  82. package/dist/common/empty-copy.d.ts.map +1 -0
  83. package/dist/common/empty-copy.js +9 -0
  84. package/dist/common/index.d.ts +1 -0
  85. package/dist/common/index.d.ts.map +1 -1
  86. package/dist/common/index.js +3 -0
  87. package/dist/common/props.d.ts +20 -0
  88. package/dist/common/props.d.ts.map +1 -1
  89. package/dist/common/props.js +13 -1
  90. package/dist/common/retry-button.module.css +7 -3
  91. package/dist/common/virtual-rows.d.ts +196 -0
  92. package/dist/common/virtual-rows.d.ts.map +1 -0
  93. package/dist/common/virtual-rows.js +290 -0
  94. package/dist/controls/controls.module.css +33 -1
  95. package/dist/controls/controls.module.css.d.ts +2 -0
  96. package/dist/controls/enum-filter.d.ts.map +1 -1
  97. package/dist/controls/enum-filter.js +8 -2
  98. package/dist/controls/filter-pill.d.ts +27 -3
  99. package/dist/controls/filter-pill.d.ts.map +1 -1
  100. package/dist/controls/filter-pill.js +15 -4
  101. package/dist/controls/form-layout.d.ts +9 -3
  102. package/dist/controls/form-layout.d.ts.map +1 -1
  103. package/dist/controls/form-layout.js +74 -12
  104. package/dist/controls/form-layout.module.css +112 -7
  105. package/dist/controls/form-layout.module.css.d.ts +1 -0
  106. package/dist/controls/multi-select-filter.d.ts +2 -2
  107. package/dist/controls/multi-select-filter.d.ts.map +1 -1
  108. package/dist/controls/multi-select-filter.js +12 -6
  109. package/dist/controls/range-filter.d.ts +1 -1
  110. package/dist/controls/range-filter.d.ts.map +1 -1
  111. package/dist/controls/range-filter.js +8 -2
  112. package/dist/dashboard/bar-list.d.ts +5 -5
  113. package/dist/dashboard/bar-list.d.ts.map +1 -1
  114. package/dist/dashboard/bar-list.js +15 -8
  115. package/dist/dashboard/bar-list.module.css +21 -5
  116. package/dist/dashboard/board-nav.d.ts +22 -0
  117. package/dist/dashboard/board-nav.d.ts.map +1 -0
  118. package/dist/dashboard/board-nav.js +49 -0
  119. package/dist/dashboard/board.d.ts +52 -0
  120. package/dist/dashboard/board.d.ts.map +1 -0
  121. package/dist/dashboard/board.js +247 -0
  122. package/dist/dashboard/board.module.css +179 -0
  123. package/dist/dashboard/board.module.css.d.ts +28 -0
  124. package/dist/dashboard/empty-state.d.ts +6 -6
  125. package/dist/dashboard/empty-state.d.ts.map +1 -1
  126. package/dist/dashboard/empty-state.js +17 -8
  127. package/dist/dashboard/event-list-model.d.ts +54 -0
  128. package/dist/dashboard/event-list-model.d.ts.map +1 -0
  129. package/dist/dashboard/event-list-model.js +76 -0
  130. package/dist/dashboard/event-list-rows.d.ts +23 -0
  131. package/dist/dashboard/event-list-rows.d.ts.map +1 -0
  132. package/dist/dashboard/event-list-rows.js +89 -0
  133. package/dist/dashboard/event-list-scroll.d.ts +55 -0
  134. package/dist/dashboard/event-list-scroll.d.ts.map +1 -0
  135. package/dist/dashboard/event-list-scroll.js +216 -0
  136. package/dist/dashboard/event-list-skeleton.d.ts +10 -0
  137. package/dist/dashboard/event-list-skeleton.d.ts.map +1 -0
  138. package/dist/dashboard/event-list-skeleton.js +34 -0
  139. package/dist/dashboard/event-list.d.ts +65 -0
  140. package/dist/dashboard/event-list.d.ts.map +1 -0
  141. package/dist/dashboard/event-list.js +208 -0
  142. package/dist/dashboard/event-list.module.css +336 -0
  143. package/dist/dashboard/event-list.module.css.d.ts +34 -0
  144. package/dist/dashboard/index.d.ts +2 -0
  145. package/dist/dashboard/index.d.ts.map +1 -1
  146. package/dist/dashboard/index.js +4 -0
  147. package/dist/dashboard/meter-model.d.ts +6 -3
  148. package/dist/dashboard/meter-model.d.ts.map +1 -1
  149. package/dist/dashboard/meter-model.js +9 -4
  150. package/dist/dashboard/meter-parts.d.ts +3 -0
  151. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  152. package/dist/dashboard/meter-parts.js +36 -6
  153. package/dist/dashboard/meter.d.ts +3 -3
  154. package/dist/dashboard/meter.d.ts.map +1 -1
  155. package/dist/dashboard/meter.js +10 -2
  156. package/dist/dashboard/meter.module.css +20 -12
  157. package/dist/dashboard/meter.module.css.d.ts +0 -1
  158. package/dist/dashboard/page-summary.d.ts +3 -3
  159. package/dist/dashboard/page-summary.d.ts.map +1 -1
  160. package/dist/dashboard/page-summary.js +7 -2
  161. package/dist/dashboard/page-summary.module.css +5 -2
  162. package/dist/dashboard/query-state.d.ts +9 -8
  163. package/dist/dashboard/query-state.d.ts.map +1 -1
  164. package/dist/dashboard/query-state.js +29 -11
  165. package/dist/dashboard/section.d.ts +11 -3
  166. package/dist/dashboard/section.d.ts.map +1 -1
  167. package/dist/dashboard/section.js +34 -7
  168. package/dist/dashboard/settings-section.d.ts +8 -5
  169. package/dist/dashboard/settings-section.d.ts.map +1 -1
  170. package/dist/dashboard/settings-section.js +12 -8
  171. package/dist/dashboard/settings-section.module.css +25 -4
  172. package/dist/dashboard/settings-section.module.css.d.ts +1 -0
  173. package/dist/dashboard/stat-card-parts.d.ts +5 -1
  174. package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
  175. package/dist/dashboard/stat-card-parts.js +8 -3
  176. package/dist/dashboard/stat-card.d.ts +3 -3
  177. package/dist/dashboard/stat-card.d.ts.map +1 -1
  178. package/dist/dashboard/stat-card.js +47 -12
  179. package/dist/dashboard/stat-card.module.css +42 -7
  180. package/dist/dashboard/stat-card.module.css.d.ts +3 -0
  181. package/dist/dashboard/stat-group.d.ts +2 -2
  182. package/dist/dashboard/stat-group.d.ts.map +1 -1
  183. package/dist/dashboard/stat-group.js +10 -3
  184. package/dist/dashboard/stat-strip.d.ts +5 -4
  185. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  186. package/dist/dashboard/stat-strip.js +41 -31
  187. package/dist/dashboard/stat-strip.module.css +8 -6
  188. package/dist/dashboard/visual-slot.d.ts +4 -0
  189. package/dist/dashboard/visual-slot.d.ts.map +1 -1
  190. package/dist/dashboard/visual-slot.js +2 -0
  191. package/dist/dashboard/widget-header.d.ts +6 -6
  192. package/dist/dashboard/widget-header.d.ts.map +1 -1
  193. package/dist/dashboard/widget-header.js +4 -2
  194. package/dist/dashboard/widget-header.module.css +12 -15
  195. package/dist/format/shared.d.ts.map +1 -1
  196. package/dist/format/shared.js +24 -1
  197. package/dist/guard/index.d.ts +1 -1
  198. package/dist/guard/index.d.ts.map +1 -1
  199. package/dist/guard/index.js +4 -1
  200. package/dist/index.d.ts +1 -1
  201. package/dist/index.d.ts.map +1 -1
  202. package/dist/index.js +4 -0
  203. package/dist/shell/app-main.module.css +18 -0
  204. package/dist/styles.css +69 -0
  205. package/dist/surfaces.d.ts +2 -2
  206. package/dist/surfaces.d.ts.map +1 -1
  207. package/dist/surfaces.js +8 -2
  208. package/dist/table/cell-kinds.d.ts +47 -0
  209. package/dist/table/cell-kinds.d.ts.map +1 -0
  210. package/dist/table/cell-kinds.js +180 -0
  211. package/dist/table/cell-kinds.module.css +55 -0
  212. package/dist/table/cell-kinds.module.css.d.ts +15 -0
  213. package/dist/table/data-table-fold.d.ts +155 -0
  214. package/dist/table/data-table-fold.d.ts.map +1 -0
  215. package/dist/table/data-table-fold.js +320 -0
  216. package/dist/table/data-table-state.d.ts +10 -3
  217. package/dist/table/data-table-state.d.ts.map +1 -1
  218. package/dist/table/data-table-state.js +11 -6
  219. package/dist/table/data-table.d.ts +13 -28
  220. package/dist/table/data-table.d.ts.map +1 -1
  221. package/dist/table/data-table.js +362 -255
  222. package/dist/table/data-table.module.css +282 -3
  223. package/dist/table/data-table.module.css.d.ts +16 -0
  224. package/dist/table/table-features.d.ts +34 -4
  225. package/dist/table/table-features.d.ts.map +1 -1
  226. package/dist/table/table-features.js +10 -0
  227. package/dist/theme/card-inset.module.css +35 -0
  228. package/dist/theme/controls.module.css +55 -2
  229. package/dist/theme/ctl-theme.d.ts.map +1 -1
  230. package/dist/theme/ctl-theme.js +5 -0
  231. package/dist/theme/index.d.ts.map +1 -1
  232. package/dist/theme/index.js +14 -10
  233. package/dist/tokens/core.d.ts +1 -0
  234. package/dist/tokens/core.d.ts.map +1 -1
  235. package/dist/tokens/core.js +1 -0
  236. package/dist/tokens/derive.js +1 -1
  237. package/dist/tokens/palette.d.ts +2 -1
  238. package/dist/tokens/palette.d.ts.map +1 -1
  239. package/llms.txt +295 -5
  240. package/package.json +1 -1
  241. package/src/agent/chat/thread-message.tsx +10 -403
  242. package/src/agent/chat/virtualize.ts +5 -5
  243. package/src/charts/ChartCard.tsx +175 -31
  244. package/src/charts/Lines.tsx +13 -4
  245. package/src/charts/Sparkline.tsx +213 -48
  246. package/src/charts/chart-box.module.css +59 -2
  247. package/src/charts/chart-box.module.css.d.ts +5 -0
  248. package/src/charts/chart-card.module.css +28 -17
  249. package/src/charts/chart-card.module.css.d.ts +3 -0
  250. package/src/charts/compile.ts +59 -33
  251. package/src/charts/labels.ts +175 -24
  252. package/src/charts/legend.tsx +3 -2
  253. package/src/charts/ref-label.ts +114 -18
  254. package/src/charts/sparkline.module.css +50 -0
  255. package/src/charts/sparkline.module.css.d.ts +3 -0
  256. package/src/charts/state.tsx +40 -10
  257. package/src/cli/doctor-upgrade.ts +75 -0
  258. package/src/cli/doctor.ts +36 -0
  259. package/src/cli/help.ts +16 -6
  260. package/src/cli/index.ts +73 -67
  261. package/src/cli/init.ts +157 -36
  262. package/src/cli/router-wiring.ts +2 -2
  263. package/src/cli/shot/capture.ts +138 -16
  264. package/src/cli/shot/detect.ts +46 -22
  265. package/src/cli/shot/index.ts +8 -2
  266. package/src/cli/shot/measure.ts +11 -2
  267. package/src/cli/shot/types.ts +4 -1
  268. package/src/cli/sync.ts +12 -2
  269. package/src/common/could-not-load.ts +22 -0
  270. package/src/common/empty-copy.ts +17 -0
  271. package/src/common/index.ts +1 -0
  272. package/src/common/props.ts +30 -0
  273. package/src/common/retry-button.module.css +7 -3
  274. package/src/common/virtual-rows.tsx +682 -0
  275. package/src/controls/controls.module.css +33 -1
  276. package/src/controls/controls.module.css.d.ts +2 -0
  277. package/src/controls/enum-filter.tsx +8 -2
  278. package/src/controls/filter-pill.tsx +80 -27
  279. package/src/controls/form-layout.module.css +112 -7
  280. package/src/controls/form-layout.module.css.d.ts +1 -0
  281. package/src/controls/form-layout.tsx +115 -22
  282. package/src/controls/multi-select-filter.tsx +22 -11
  283. package/src/controls/range-filter.tsx +9 -3
  284. package/src/dashboard/bar-list.module.css +21 -5
  285. package/src/dashboard/bar-list.tsx +53 -45
  286. package/src/dashboard/board-nav.ts +67 -0
  287. package/src/dashboard/board.module.css +179 -0
  288. package/src/dashboard/board.module.css.d.ts +28 -0
  289. package/src/dashboard/board.tsx +415 -0
  290. package/src/dashboard/empty-state.tsx +21 -11
  291. package/src/dashboard/event-list-model.ts +125 -0
  292. package/src/dashboard/event-list-rows.tsx +117 -0
  293. package/src/dashboard/event-list-scroll.ts +291 -0
  294. package/src/dashboard/event-list-skeleton.tsx +62 -0
  295. package/src/dashboard/event-list.module.css +336 -0
  296. package/src/dashboard/event-list.module.css.d.ts +34 -0
  297. package/src/dashboard/event-list.tsx +336 -0
  298. package/src/dashboard/index.ts +2 -0
  299. package/src/dashboard/meter-model.ts +16 -7
  300. package/src/dashboard/meter-parts.tsx +53 -14
  301. package/src/dashboard/meter.module.css +20 -12
  302. package/src/dashboard/meter.module.css.d.ts +0 -1
  303. package/src/dashboard/meter.tsx +36 -18
  304. package/src/dashboard/page-summary.module.css +5 -2
  305. package/src/dashboard/page-summary.tsx +13 -6
  306. package/src/dashboard/query-state.tsx +55 -30
  307. package/src/dashboard/section.tsx +83 -41
  308. package/src/dashboard/settings-section.module.css +25 -4
  309. package/src/dashboard/settings-section.module.css.d.ts +1 -0
  310. package/src/dashboard/settings-section.tsx +18 -8
  311. package/src/dashboard/stat-card-parts.tsx +20 -3
  312. package/src/dashboard/stat-card.module.css +42 -7
  313. package/src/dashboard/stat-card.module.css.d.ts +3 -0
  314. package/src/dashboard/stat-card.tsx +55 -13
  315. package/src/dashboard/stat-group.tsx +22 -14
  316. package/src/dashboard/stat-strip.module.css +8 -6
  317. package/src/dashboard/stat-strip.tsx +29 -20
  318. package/src/dashboard/visual-slot.ts +5 -0
  319. package/src/dashboard/widget-header.module.css +12 -15
  320. package/src/dashboard/widget-header.tsx +8 -5
  321. package/src/format/shared.ts +30 -1
  322. package/src/guard/index.ts +7 -1
  323. package/src/index.ts +4 -0
  324. package/src/shell/app-main.module.css +18 -0
  325. package/src/styles.css +69 -0
  326. package/src/surfaces.ts +7 -1
  327. package/src/table/cell-kinds.module.css +55 -0
  328. package/src/table/cell-kinds.module.css.d.ts +15 -0
  329. package/src/table/cell-kinds.tsx +263 -0
  330. package/src/table/data-table-fold.tsx +567 -0
  331. package/src/table/data-table-state.ts +24 -13
  332. package/src/table/data-table.module.css +282 -3
  333. package/src/table/data-table.module.css.d.ts +16 -0
  334. package/src/table/data-table.tsx +430 -362
  335. package/src/table/table-features.ts +44 -4
  336. package/src/theme/__snapshots__/plain-theme.test.ts.snap +2 -66
  337. package/src/theme/card-inset.module.css +35 -0
  338. package/src/theme/controls.module.css +55 -2
  339. package/src/theme/ctl-theme.tsx +8 -0
  340. package/src/theme/index.ts +12 -8
  341. package/src/tokens/core.ts +1 -0
  342. package/src/tokens/derive.ts +1 -1
  343. package/src/tokens/palette.ts +4 -1
@@ -15,11 +15,13 @@
15
15
  * escape hatch for a page that must place its branches in different DOM positions.
16
16
  */
17
17
  import { Center, Group, Loader, Skeleton, Stack, Text, VisuallyHidden } from '@mantine/core'
18
+ import { useContext } from 'react'
18
19
  import type { CSSProperties, ReactNode } from 'react'
19
20
  import { toErrorMessage } from '../common/errors'
20
- import { cx } from '../common/props'
21
+ import { couldNotLoad, HostTitleContext } from '../common/could-not-load'
22
+ import { cx, pickDataAttributes } from '../common/props'
21
23
  import { RetryButton } from '../common/retry-button'
22
- import type { BasaltProps, SlotStylesProps } from '../common/props'
24
+ import type { BasaltProps, DataAttributes, SlotStylesProps } from '../common/props'
23
25
  import { VX } from '../tokens'
24
26
  import { StatusDot } from '../theme/status-dot'
25
27
  import { EmptyState } from './empty-state'
@@ -57,12 +59,13 @@ export type QueryEmptyCopy = {
57
59
 
58
60
  // ── LoadingState ──────────────────────────────────────────────────────────────────────────────────
59
61
 
60
- export type LoadingStateProps = BasaltProps & {
61
- /** How loud this state is. Default `'page'`. */
62
- tier?: QueryStateTier
63
- /** Accessible name for the loading state. Say what is loading. */
64
- label?: string
65
- }
62
+ export type LoadingStateProps = BasaltProps &
63
+ DataAttributes & {
64
+ /** How loud this state is. Default `'page'`. */
65
+ tier?: QueryStateTier
66
+ /** Accessible name for the loading state. Say what is loading. */
67
+ label?: string
68
+ }
66
69
 
67
70
  /**
68
71
  * `tier="page"` centres a neutral spinner in a generous block (a route body whose shape is unknown);
@@ -74,11 +77,14 @@ export function LoadingState({
74
77
  label = 'Loading',
75
78
  className,
76
79
  style,
80
+ ...rest
77
81
  }: LoadingStateProps): ReactNode {
78
82
  const resolved = tier ?? 'page'
83
+ const data = pickDataAttributes(rest)
79
84
  if (resolved === 'section') {
80
85
  return (
81
86
  <Stack
87
+ {...data}
82
88
  component="output"
83
89
  gap="xs"
84
90
  aria-label={label}
@@ -98,6 +104,7 @@ export function LoadingState({
98
104
  // renders at today's 64px at level 0 and tracks every other density level with it.
99
105
  return (
100
106
  <Center
107
+ {...data}
101
108
  {...(className !== undefined && { className })}
102
109
  style={{ paddingBlock: 'calc(var(--vx-space-stack-xs, 0.25rem) * 16)', ...style }}
103
110
  >
@@ -108,21 +115,22 @@ export function LoadingState({
108
115
 
109
116
  // ── ErrorState ────────────────────────────────────────────────────────────────────────────────────
110
117
 
111
- export type ErrorStateProps = BasaltProps & {
112
- /** Whatever was thrown — the raw Eden/fetch envelope is fine, it gets decoded. */
113
- error: unknown
114
- /** Alert heading. Say what failed, e.g. `Could not load images`. */
115
- title?: string
116
- /** Shown only when the server body carries no readable message. */
117
- fallback?: string
118
- onRetry?: () => void
119
- /** Disables the retry button while a refetch is in flight. */
120
- retrying?: boolean
121
- /** How loud this state is. Default `'page'`. */
122
- tier?: QueryStateTier
123
- /** Extra controls beside Retry (e.g. a "Back to shares" link). */
124
- action?: ReactNode
125
- }
118
+ export type ErrorStateProps = BasaltProps &
119
+ DataAttributes & {
120
+ /** Whatever was thrown — the raw Eden/fetch envelope is fine, it gets decoded. */
121
+ error: unknown
122
+ /** Alert heading. Say what failed, e.g. `Could not load images`. */
123
+ title?: string
124
+ /** Shown only when the server body carries no readable message. */
125
+ fallback?: string
126
+ onRetry?: () => void
127
+ /** Disables the retry button while a refetch is in flight. */
128
+ retrying?: boolean
129
+ /** How loud this state is. Default `'page'`. */
130
+ tier?: QueryStateTier
131
+ /** Extra controls beside Retry (e.g. a "Back to shares" link). */
132
+ action?: ReactNode
133
+ }
126
134
 
127
135
  /**
128
136
  * The error branch: the REAL server message (via `toErrorMessage`) plus a retry. Usable on its own,
@@ -130,7 +138,7 @@ export type ErrorStateProps = BasaltProps & {
130
138
  */
131
139
  export function ErrorState({
132
140
  error,
133
- title = 'Could not load',
141
+ title: titleProp,
134
142
  fallback = 'The request failed.',
135
143
  onRetry,
136
144
  retrying = false,
@@ -138,7 +146,11 @@ export function ErrorState({
138
146
  action,
139
147
  className,
140
148
  style,
149
+ ...rest
141
150
  }: ErrorStateProps): ReactNode {
151
+ const data = pickDataAttributes(rest)
152
+ const hostTitle = useContext(HostTitleContext)
153
+ const title = titleProp ?? couldNotLoad(hostTitle)
142
154
  const resolved = tier ?? 'page'
143
155
  // D28: a status dot + a word + the message + the retry, on the neutral surface — never a
144
156
  // red-tinted filled panel (SPEC § 6.12).
@@ -146,12 +158,13 @@ export function ErrorState({
146
158
  <Stack
147
159
  gap="xs"
148
160
  role="alert"
161
+ {...(resolved === 'section' && data)}
149
162
  {...(resolved === 'section' && className !== undefined && { className })}
150
163
  {...(resolved === 'section' && style !== undefined && { style })}
151
164
  >
152
165
  <Group gap="xs" wrap="nowrap">
153
166
  <StatusDot color={VX.status.bad} />
154
- <Text size="sm" fw={500}>
167
+ <Text size={resolved === 'section' ? 'sm' : 'md'} fw={500}>
155
168
  {title}
156
169
  </Text>
157
170
  </Group>
@@ -170,6 +183,7 @@ export function ErrorState({
170
183
  return (
171
184
  <Stack
172
185
  py="md"
186
+ {...data}
173
187
  {...(className !== undefined && { className })}
174
188
  {...(style !== undefined && { style })}
175
189
  >
@@ -241,6 +255,7 @@ export function resolveQueryBranch<TData>(
241
255
  export type QueryStateSlot = 'root'
242
256
 
243
257
  export type QueryStateProps<TData> = BasaltProps &
258
+ DataAttributes &
244
259
  SlotStylesProps<QueryStateSlot> & {
245
260
  query: QueryStateLike<TData>
246
261
  /** A render function gets `data` narrowed to non-undefined; a plain node also works. */
@@ -249,7 +264,8 @@ export type QueryStateProps<TData> = BasaltProps &
249
264
  empty?: QueryEmptyCopy
250
265
  /** Override the default `[]` / `{ data: [] }` emptiness test — `() => false` disables it. */
251
266
  isEmpty?: (data: TData) => boolean
252
- /** Alert heading on the error branch — say what failed. */
267
+ /** Alert heading on the error branch — say what failed. Omitted inside a titled `Section`, it
268
+ * names that section ("Could not load practice record"); elsewhere it is "Could not load". */
253
269
  errorTitle?: string
254
270
  /** Shown only when the server body carries no readable message. */
255
271
  errorFallback?: string
@@ -285,7 +301,7 @@ export function QueryState<TData>({
285
301
  children,
286
302
  empty,
287
303
  isEmpty,
288
- errorTitle = 'Could not load',
304
+ errorTitle,
289
305
  errorFallback = 'The request failed.',
290
306
  errorAction,
291
307
  tier,
@@ -293,8 +309,12 @@ export function QueryState<TData>({
293
309
  className,
294
310
  style,
295
311
  classNames,
312
+ ...rest
296
313
  }: QueryStateProps<TData>): ReactNode {
297
314
  assertQueryStateLike('QueryState', query)
315
+ // The live branch's root carries the consumer's `data-*`. The READY branch renders `children`
316
+ // alone and has no root of its own, so an anchor there belongs on the host (`Section`, a card).
317
+ const dataAttrs = pickDataAttributes(rest)
298
318
  const resolvedTier = tier ?? 'page'
299
319
  // One class for every branch — see {@link QueryStateSlot}. `cx` returns `''` when both are
300
320
  // absent, and an empty `className` on a branch that previously carried none would be a DOM diff,
@@ -307,8 +327,9 @@ export function QueryState<TData>({
307
327
  if (isError && data === undefined) {
308
328
  return (
309
329
  <ErrorState
330
+ {...dataAttrs}
310
331
  error={error}
311
- title={errorTitle}
332
+ {...(errorTitle !== undefined && { title: errorTitle })}
312
333
  fallback={errorFallback}
313
334
  onRetry={retry}
314
335
  retrying={retrying}
@@ -322,10 +343,11 @@ export function QueryState<TData>({
322
343
 
323
344
  if (data === undefined) {
324
345
  if (fetchStatus === 'idle' && !isError)
325
- return empty ? renderEmpty(empty, resolvedTier, rootClassName, style) : null
346
+ return empty ? renderEmpty(empty, resolvedTier, rootClassName, style, dataAttrs) : null
326
347
  return (
327
348
  loading ?? (
328
349
  <LoadingState
350
+ {...dataAttrs}
329
351
  tier={resolvedTier}
330
352
  {...(rootClassName !== undefined && { className: rootClassName })}
331
353
  {...(style !== undefined && { style })}
@@ -337,7 +359,7 @@ export function QueryState<TData>({
337
359
  const emptyNow = isEmpty ? isEmpty(data) : defaultIsEmpty(data)
338
360
  const body = emptyNow
339
361
  ? empty
340
- ? renderEmpty(empty, resolvedTier, rootClassName, style)
362
+ ? renderEmpty(empty, resolvedTier, rootClassName, style, dataAttrs)
341
363
  : null
342
364
  : typeof children === 'function'
343
365
  ? children(data)
@@ -347,6 +369,7 @@ export function QueryState<TData>({
347
369
 
348
370
  return (
349
371
  <Stack
372
+ {...dataAttrs}
350
373
  gap="sm"
351
374
  {...(rootClassName !== undefined && { className: rootClassName })}
352
375
  {...(style !== undefined && { style })}
@@ -369,9 +392,11 @@ function renderEmpty(
369
392
  tier: QueryStateTier,
370
393
  className?: string,
371
394
  style?: CSSProperties,
395
+ data?: DataAttributes,
372
396
  ): ReactNode {
373
397
  return (
374
398
  <EmptyState
399
+ {...data}
375
400
  title={empty.title}
376
401
  tier={tier}
377
402
  {...(empty.description !== undefined && { description: empty.description })}
@@ -45,20 +45,24 @@
45
45
  * <UsageChart />
46
46
  * </Section>
47
47
  */
48
- import { useEffect, useId } from 'react'
48
+ import { Children, cloneElement, isValidElement, useContext, useEffect, useId } from 'react'
49
49
  import type { ReactNode } from 'react'
50
- import { cx } from '../common/props'
51
- import type { BasaltProps, SlotStylesProps } from '../common/props'
50
+ import { cx, splitDataAttributes } from '../common/props'
51
+ import type { BasaltProps, DataAttributes, SlotStylesProps } from '../common/props'
52
52
  import { BASALT_PREFIX } from '../common/errors'
53
53
  import { useValidateProps } from '../common/validate'
54
54
  import { CtlSlot } from '../theme'
55
55
  import { BarActionSlot } from '../controls/actions'
56
56
  import type { SectionActions } from '../controls/actions'
57
57
  import { useFilterSurface } from '../controls/filter-context'
58
- import { QueryState } from './query-state'
58
+ import { HostTitleContext } from '../common/could-not-load'
59
+ import { LoadingState, QueryState } from './query-state'
59
60
  import type { QueryEmptyCopy, QueryStateLike } from './query-state'
60
61
  import { usePersistedOrLocal } from '../state/persisted-or-local'
61
62
  import { PAGE_BAR_HEIGHT_VAR, useInPageBarShell } from '../shell'
63
+ import { BarList } from './bar-list'
64
+ import { EventList } from './event-list'
65
+ import { Meter } from './meter'
62
66
  import { WidgetHeader } from './widget-header'
63
67
  import type { WidgetHeaderProps } from './widget-header'
64
68
  import classes from './section.module.css'
@@ -95,6 +99,7 @@ type SectionBaseProps = Omit<
95
99
  'tier' | 'classNames' | 'actions' | 'title' | HeaderOnlyKey
96
100
  > &
97
101
  BasaltProps &
102
+ DataAttributes &
98
103
  SlotStylesProps<SectionSlot> & {
99
104
  /**
100
105
  * Header actions as typed data (law C15), projected through the SAME row `PageBar` uses — one
@@ -118,6 +123,14 @@ type SectionBaseProps = Omit<
118
123
  * without `query`.
119
124
  */
120
125
  empty?: QueryEmptyCopy
126
+ /**
127
+ * The loaded body's height in px. While `query` is pending the loading skeleton fills it, so
128
+ * the section does not jump when the data lands. Declared, not measured: a first load has no
129
+ * previous body to measure. Omitted, a body that is one `BarList`, `EventList` or `Meter`
130
+ * loads as that figure's own skeleton (set its `loadingRows` to the loaded count); any other
131
+ * body gets the three-bar default. Ignored without `query`.
132
+ */
133
+ loadingHeight?: number
121
134
  /** Rendered in the header row, in its own `CtlSlot` — hidden while the section is collapsed. */
122
135
  tabs?: ReactNode
123
136
  /** Renders a chevron toggle in the header; the header stays drawn when closed, only `children`
@@ -199,6 +212,18 @@ function ChevronToggle({
199
212
  )
200
213
  }
201
214
 
215
+ /**
216
+ * A body that is ONE figure with a row-shaped loading state loads as that figure, so the skeleton has
217
+ * the loaded footprint (rows, track) rather than a guess. Anything else has no shape to borrow.
218
+ */
219
+ function figureLoading(children: ReactNode): ReactNode {
220
+ const only = Children.toArray(children)
221
+ const [child] = only
222
+ if (only.length !== 1 || !isValidElement<{ loading?: boolean }>(child)) return null
223
+ if (child.type !== BarList && child.type !== EventList && child.type !== Meter) return null
224
+ return cloneElement(child, { loading: true })
225
+ }
226
+
202
227
  const ANCHOR_CLEARANCE = 'var(--vx-space-sticky-header-clearance)'
203
228
 
204
229
  /** The `scroll-margin-top` of an anchored Section; the bar term only exists without a shell. */
@@ -211,6 +236,7 @@ export function Section({
211
236
  actions,
212
237
  query,
213
238
  empty,
239
+ loadingHeight,
214
240
  tabs,
215
241
  collapsible = false,
216
242
  persistKey,
@@ -224,9 +250,11 @@ export function Section({
224
250
  style,
225
251
  classNames,
226
252
  'aria-label': ariaLabel,
227
- ...headerProps
253
+ ...headerAndData
228
254
  }: SectionProps) {
255
+ const { data, rest: headerProps } = splitDataAttributes(headerAndData)
229
256
  const { title } = headerProps
257
+ const outerTitle = useContext(HostTitleContext)
230
258
  const untitled = title === undefined
231
259
 
232
260
  // A `persistKey` with nothing to fold writes a localStorage key nobody ever reads back — the
@@ -297,42 +325,56 @@ export function Section({
297
325
  </>
298
326
  ) : undefined
299
327
 
328
+ const figure = query !== undefined && loadingHeight === undefined ? figureLoading(children) : null
329
+
300
330
  return (
301
- <div
302
- className={cx(classes.root, classNames?.root, className)}
303
- data-tier={tier}
304
- {...(untitled && ariaLabel !== undefined && { role: 'group', 'aria-label': ariaLabel })}
305
- {...(id !== undefined && { id })}
306
- {...(rootStyle !== undefined && { style: rootStyle })}
307
- >
308
- {untitled ? (
309
- <div className={cx(classes.tabsRow, classNames?.header)} data-basalt-hit-scope>
310
- {headerActions}
311
- </div>
312
- ) : (
313
- <WidgetHeader
314
- tier={tier}
315
- {...(headerProps as Pick<WidgetHeaderProps, HeaderOnlyKey>)}
316
- title={title}
317
- {...(classNames?.header !== undefined && { className: classNames.header })}
318
- {...(headerActions !== undefined && { actions: headerActions })}
319
- />
320
- )}
321
- {summary !== undefined && <div className={classes.summary}>{summary}</div>}
322
- {(open || untitled) && (
323
- <div id={bodyId} className={cx(classes.body, classNames?.body)}>
324
- {query === undefined ? (
325
- children
326
- ) : (
327
- // `tier="section"` is the compact one: a bare spinner rather than a 64px centred
328
- // block, and the error alert without the page-level stack around it. A Section IS the
329
- // region, so the state belongs inside its body, never around its header.
330
- <QueryState query={query} tier="section" {...(empty !== undefined && { empty })}>
331
- {children}
332
- </QueryState>
333
- )}
334
- </div>
335
- )}
336
- </div>
331
+ <HostTitleContext value={title ?? outerTitle}>
332
+ <div
333
+ {...data}
334
+ className={cx(classes.root, classNames?.root, className)}
335
+ data-tier={tier}
336
+ {...(untitled && ariaLabel !== undefined && { role: 'group', 'aria-label': ariaLabel })}
337
+ {...(id !== undefined && { id })}
338
+ {...(rootStyle !== undefined && { style: rootStyle })}
339
+ >
340
+ {untitled ? (
341
+ <div className={cx(classes.tabsRow, classNames?.header)} data-basalt-hit-scope>
342
+ {headerActions}
343
+ </div>
344
+ ) : (
345
+ <WidgetHeader
346
+ tier={tier}
347
+ {...(headerProps as Pick<WidgetHeaderProps, HeaderOnlyKey>)}
348
+ title={title}
349
+ {...(classNames?.header !== undefined && { className: classNames.header })}
350
+ {...(headerActions !== undefined && { actions: headerActions })}
351
+ />
352
+ )}
353
+ {summary !== undefined && <div className={classes.summary}>{summary}</div>}
354
+ {(open || untitled) && (
355
+ <div id={bodyId} className={cx(classes.body, classNames?.body)}>
356
+ {query === undefined ? (
357
+ children
358
+ ) : (
359
+ // `tier="section"` is the compact one: a bare spinner rather than a 64px centred
360
+ // block, and the error alert without the page-level stack around it. A Section IS the
361
+ // region, so the state belongs inside its body, never around its header.
362
+ <QueryState
363
+ query={query}
364
+ tier="section"
365
+ {...(empty !== undefined && { empty })}
366
+ {...(loadingHeight !== undefined
367
+ ? {
368
+ loading: <LoadingState tier="section" style={{ minHeight: loadingHeight }} />,
369
+ }
370
+ : figure !== null && { loading: figure })}
371
+ >
372
+ {children}
373
+ </QueryState>
374
+ )}
375
+ </div>
376
+ )}
377
+ </div>
378
+ </HostTitleContext>
337
379
  )
338
380
  }
@@ -21,13 +21,34 @@
21
21
  border-bottom: 1px solid var(--vx-divider);
22
22
  }
23
23
 
24
+ /* One row rule with FormRow (`controls/form-layout.module.css`): a 15rem label column, a control
25
+ * column capped at 20rem, left-packed; stacked under 600px of the section's OWN width. */
26
+ .rows {
27
+ container-type: inline-size;
28
+ container-name: basalt-form;
29
+ }
30
+
24
31
  .row {
25
- display: flex;
26
- align-items: flex-start;
27
- justify-content: space-between;
32
+ display: grid;
33
+ grid-template-columns: minmax(0, 15rem) minmax(0, 20rem);
34
+ justify-content: start;
35
+ align-items: start;
28
36
  gap: var(--vx-space-settings-row-gap);
29
37
  }
30
38
 
31
39
  .control {
32
- flex-shrink: 0;
40
+ min-inline-size: 0;
41
+ }
42
+
43
+ @container basalt-form (max-width: 599.9px) {
44
+ .row {
45
+ grid-template-columns: minmax(0, 1fr);
46
+ gap: var(--vx-space-stack-xs);
47
+ }
48
+ }
49
+
50
+ /* DangerZone's ring colour: the status token mixed into the panel surface — one formula in both
51
+ * schemes, never an alpha over whatever sits behind it. The component layers it on `shadow-card`. */
52
+ .danger {
53
+ --danger-ring: color-mix(in srgb, var(--vx-status-bad) 40%, var(--vx-surface-panel));
33
54
  }
@@ -7,5 +7,6 @@ declare const classes: {
7
7
  readonly rows: string
8
8
  readonly row: string
9
9
  readonly control: string
10
+ readonly danger: string
10
11
  }
11
12
  export default classes
@@ -33,9 +33,9 @@ import type { ReactNode } from 'react'
33
33
  import { WidgetHeader } from './widget-header'
34
34
  import type { WidgetHeaderTitleProps } from './widget-header'
35
35
  import { CtlSlot } from '../theme'
36
- import { alpha, VX } from '../tokens'
37
- import { cx } from '../common/props'
38
- import type { BasaltProps, SlotStylesProps } from '../common/props'
36
+ import { VX } from '../tokens'
37
+ import { cx, pickDataAttributes } from '../common/props'
38
+ import type { BasaltProps, DataAttributes, SlotStylesProps } from '../common/props'
39
39
  import classes from './settings-section.module.css'
40
40
 
41
41
  const eyebrowStyle = {
@@ -59,6 +59,7 @@ export type SettingsSectionSlot = 'root' | 'header' | 'body'
59
59
  * slices.
60
60
  */
61
61
  export type SettingsSectionProps = BasaltProps &
62
+ DataAttributes &
62
63
  SlotStylesProps<SettingsSectionSlot> &
63
64
  WidgetHeaderTitleProps & {
64
65
  /** Header-right slot — wrapped in `CtlSlot` (C1/C5). */
@@ -77,9 +78,10 @@ export function SettingsSection({
77
78
  className,
78
79
  style,
79
80
  classNames,
81
+ ...rest
80
82
  }: SettingsSectionProps) {
81
83
  return (
82
- <Card className={cx(classNames?.root, className)} style={style}>
84
+ <Card {...pickDataAttributes(rest)} className={cx(classNames?.root, className)} style={style}>
83
85
  <div className={cx(classes.header, classNames?.header)}>
84
86
  <WidgetHeader
85
87
  tier="section"
@@ -104,7 +106,10 @@ export type SettingsRowProps = BasaltProps &
104
106
  label: string
105
107
  /** Optional 12px muted description under the label. */
106
108
  description?: string
107
- /** Right-aligned control (input/switch/button). */
109
+ /**
110
+ * Right-aligned control (input/switch/button). Mounted in a `CtlSlot`: a bound input is the 32 px
111
+ * field (44 under a coarse pointer), not Mantine's 42 px `md`; a control's own `size` still wins.
112
+ */
108
113
  control?: ReactNode
109
114
  /** Alternative to `control` for a fully custom right-hand region. */
110
115
  children?: ReactNode
@@ -130,7 +135,9 @@ export function SettingsRow({
130
135
  <span style={{ fontSize: VX.text.xs, color: VX.muted }}>{description}</span>
131
136
  )}
132
137
  </Stack>
133
- <div className={cx(classes.control, classNames?.control)}>{control ?? children}</div>
138
+ <div className={cx(classes.control, classNames?.control)}>
139
+ <CtlSlot>{control ?? children}</CtlSlot>
140
+ </div>
134
141
  </div>
135
142
  )
136
143
  }
@@ -147,12 +154,15 @@ export function DangerZone({
147
154
  className,
148
155
  style,
149
156
  classNames,
157
+ ...rest
150
158
  }: DangerZoneProps) {
151
159
  return (
152
160
  <Card
153
- className={cx(classNames?.root, className)}
161
+ {...pickDataAttributes(rest)}
162
+ className={cx(classes.danger, classNames?.root, className)}
154
163
  style={{
155
- boxShadow: `${VX.shadowCard}, 0 0 0 1px ${alpha(VX.status.bad, 0.25)}`,
164
+ // The card's depth plus ONE edge in the class's scheme-independent ring colour.
165
+ boxShadow: `${VX.shadowCard}, 0 0 0 1px var(--danger-ring)`,
156
166
  ...style,
157
167
  }}
158
168
  >
@@ -106,12 +106,29 @@ export function rightSlotStyle(width: number, height: number): CSSProperties {
106
106
  } as CSSProperties
107
107
  }
108
108
 
109
- export function ValueSkeleton() {
110
- return <Skeleton className={classes.skeletonValue} radius="sm" />
109
+ /** The value bar, and a delta chip beside it when the loaded card carries a delta. */
110
+ export function ValueSkeleton({ delta }: { delta: boolean }) {
111
+ if (!delta) return <Skeleton className={classes.skeletonValue} radius="sm" />
112
+ return (
113
+ <div className={classes.skeletonValueRow}>
114
+ <Skeleton className={classes.skeletonValueWithDelta} radius="sm" />
115
+ <Skeleton className={classes.skeletonDelta} radius="sm" data-stat-skeleton-delta="" />
116
+ </div>
117
+ )
111
118
  }
112
119
 
120
+ /** A mild rise across the width in a 100 x 40 box: the sparkline's shape, not data. */
121
+ const SPARK_GHOST = '0,30 12,26 25,28 38,18 50,22 62,12 75,16 88,8 100,12'
122
+
123
+ /** The visual slot's loading shape: a line ghost at the sparkline's own height, no spinner. */
113
124
  export function VisualSkeleton() {
114
- return <Skeleton className={classes.skeletonVisual} />
125
+ return (
126
+ <div aria-hidden="true" className={classes.skeletonVisual} data-stat-skeleton-spark="">
127
+ <svg viewBox="0 0 100 40" preserveAspectRatio="none">
128
+ <polyline points={SPARK_GHOST} vectorEffect="non-scaling-stroke" />
129
+ </svg>
130
+ </div>
131
+ )
115
132
  }
116
133
 
117
134
  export function FooterSkeleton() {
@@ -213,14 +213,10 @@
213
213
 
214
214
  /* ── states ──────────────────────────────────────────────────────────────────────────────────── */
215
215
 
216
- /* The empty branch: one muted line in the figure's place, at the figure row's height. */
216
+ /* The empty branch (SPEC § 6.11): `EmptyState`'s section tile in the figure's place, at the card's
217
+ * own inset; `EmptyState`'s section tier sets its title at `sm`. */
217
218
  .empty {
218
- display: flex;
219
- align-items: center;
220
- margin: 0;
221
219
  min-height: var(--basalt-stat-figure-h);
222
- font-size: var(--vx-text-sm);
223
- color: var(--vx-muted);
224
220
  }
225
221
 
226
222
  /* The pending skeleton holds the card's own footprint: a value bar at the figure's height, the
@@ -233,10 +229,38 @@
233
229
  /* Inset on both sides, unlike the sparkline at rest (which bleeds): a placeholder that touches one
234
230
  * card edge and stops short of the other reads as misaligned, and a Meter in the slot is inset anyway. */
235
231
  .skeletonVisual {
236
- --skeleton-radius: 0;
237
232
  height: var(--basalt-stat-visual-h);
238
233
  }
239
234
 
235
+ .skeletonVisual svg {
236
+ display: block;
237
+ width: 100%;
238
+ height: 100%;
239
+ fill: none;
240
+ stroke: color-mix(in srgb, var(--vx-ink) 24%, var(--vx-surface-panel));
241
+ stroke-width: 2px;
242
+ stroke-linecap: round;
243
+ stroke-linejoin: round;
244
+ }
245
+
246
+ /* A skeleton value row with a delta: the value bar and the delta chip, on the loaded row's height. */
247
+ .skeletonValueRow {
248
+ display: flex;
249
+ align-items: center;
250
+ gap: var(--vx-space-stack-sm);
251
+ height: var(--basalt-stat-figure-h);
252
+ }
253
+
254
+ .skeletonValueWithDelta {
255
+ width: 28%;
256
+ height: 100%;
257
+ }
258
+
259
+ .skeletonDelta {
260
+ width: 22%;
261
+ height: 1rem;
262
+ }
263
+
240
264
  .sparklineRight .skeletonVisual {
241
265
  flex: 1 1 auto;
242
266
  }
@@ -413,6 +437,17 @@
413
437
  padding-top: var(--basalt-spark-readout-reserve);
414
438
  }
415
439
 
440
+ /* A sparkline that states its window has a caption line under its plot: the slot grows by it rather than
441
+ * letting the caption run into the footer. */
442
+ .sparklineBleed:has([data-basalt-sparkline-caption]) {
443
+ height: auto;
444
+ }
445
+
446
+ /* The slot bleeds past the card's inset, the plot with it; the caption is text and takes the inset back. */
447
+ .sparklineBleed [data-basalt-sparkline-caption] {
448
+ padding-inline: var(--vx-space-card-inset-x, 1rem);
449
+ }
450
+
416
451
  /* A Meter in the visual slot is a block, not a chart: it sizes to its content and keeps the card's
417
452
  * inline inset instead of the sparkline's fixed 22px and side bleed. */
418
453
  .sparklineBleed:has(> [data-basalt-meter]) {
@@ -19,6 +19,9 @@ declare const classes: {
19
19
  readonly empty: string
20
20
  readonly skeletonValue: string
21
21
  readonly skeletonVisual: string
22
+ readonly skeletonValueRow: string
23
+ readonly skeletonValueWithDelta: string
24
+ readonly skeletonDelta: string
22
25
  readonly skeletonFooter: string
23
26
  readonly skeletonRowBox: string
24
27
  readonly skeletonRow: string