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
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * The pill reads the filter's name while the selection carries no information — empty (no
5
5
  * constraint) or every option (the same thing said the long way) — and switches to a count once it
6
- * does: `All channels` → `3 channels`. `noun` is the plural read in that count and defaults to the
7
- * label lowercased, so `label="Channels"` needs no second prop.
6
+ * does: `Channels` → `Channels 3 selected` (label muted, count bright — the pill anatomy in
7
+ * `filter-pill.tsx`). A `noun` replaces `selected`: `Channels 3 channels`.
8
8
  *
9
9
  * @example
10
10
  * <MultiSelectFilter field={analytics.field.channels} label="All channels" noun="channels" />
@@ -31,7 +31,7 @@ import type { MultiField } from '../state/fields'
31
31
  import type { FilterBase, FilterOption } from './filter-base'
32
32
  import classes from './controls.module.css'
33
33
  import { POPOVER_ROW_HIT_GAP, useFilterRegistration, useFilterSurface } from './filter-context'
34
- import { FilterClearButton, FilterPill } from './filter-pill'
34
+ import { FilterClearButton, FilterPill, filterReading } from './filter-pill'
35
35
  import { useControlName } from './control-name'
36
36
  import { CheckGlyph } from './glyphs'
37
37
  import { PanelRow } from './panel-row'
@@ -52,9 +52,9 @@ export type MultiSelectFilterProps<T extends string> = UncontrolledProps &
52
52
  */
53
53
  readonly clearable?: boolean
54
54
  /**
55
- * The plural noun in the `3 channels` count.
55
+ * The word after the count, in place of `selected`: `3 channels`.
56
56
  *
57
- * @default the label, lowercased
57
+ * @default 'selected'
58
58
  */
59
59
  readonly noun?: string
60
60
  /**
@@ -106,14 +106,20 @@ export function MultiSelectFilter<T extends string>(props: MultiSelectFilterProp
106
106
  const clearFilter = (): void => {
107
107
  field.clear()
108
108
  }
109
- useFilterRegistration(!isDefault, clearFilter)
110
109
 
111
110
  // The prop wins whole, never merged — same rule as `EnumFilter`: a catalogue that dropped a row
112
- // must be able to drop it, and `All channels` is counted against the rows actually shown.
111
+ // must be able to drop it, and `All channels` is judged against the rows actually shown.
113
112
  const options: readonly FilterOption[] = optionsProp ?? field.options
114
113
  const inSheet = surface === 'sheet'
115
114
  const inPanel = surface === 'panel'
116
- const carriesInformation = value.length > 0 && value.length < options.length
115
+ // ONE predicate for "this filter is filtering" — registration (the `Filters (n)` count and `Reset
116
+ // all`), the Clear button, the muted/bright anatomy and the accent border all read it. An empty
117
+ // selection or one holding EVERY offered option says nothing; "every" is set equality against the
118
+ // option values, never a length comparison (a deep link `[web, social]` over a catalogue
119
+ // `[web, email]` has the same length and still filters `email` out).
120
+ const everyOffered = options.every((option) => value.includes(option.value as T))
121
+ const informative = !isDefault && value.length > 0 && !everyOffered
122
+ useFilterRegistration(informative, clearFilter)
117
123
  const { labelId } = useControlName(label, inSheet || inPanel)
118
124
 
119
125
  // One toggle, shared by both list forms — the rows are rendered from `options`, whose values
@@ -175,14 +181,19 @@ export function MultiSelectFilter<T extends string>(props: MultiSelectFilterProp
175
181
  />
176
182
  ))}
177
183
  </Stack>
178
- {clearable && !isDefault && disabled !== true && <FilterClearButton onClear={clearFilter} />}
184
+ {clearable && informative && disabled !== true && <FilterClearButton onClear={clearFilter} />}
179
185
  </Checkbox.Group>
180
186
  )
181
187
 
182
188
  return (
183
189
  <FilterPill
184
- label={carriesInformation ? `${value.length} ${noun ?? label.toLowerCase()}` : label}
185
- active={!isDefault}
190
+ {...filterReading({
191
+ name: label,
192
+ informative,
193
+ value: `${value.length} ${noun ?? 'selected'}`,
194
+ unsetText: label,
195
+ })}
196
+ active={informative}
186
197
  {...(disabled === true && { disabled: true })}
187
198
  {...(icon !== undefined && { icon })}
188
199
  {...(className !== undefined && { className })}
@@ -40,7 +40,7 @@ import type { RangeField, RangeValue } from '../state/fields'
40
40
  import classes from './controls.module.css'
41
41
  import { useFilterRegistration, useFilterSurface } from './filter-context'
42
42
  import type { FilterBase } from './filter-base'
43
- import { FilterPill } from './filter-pill'
43
+ import { FilterPill, filterReading } from './filter-pill'
44
44
  import { CalendarGlyph } from './glyphs'
45
45
  import { useControlName } from './control-name'
46
46
  import { PanelRow } from './panel-row'
@@ -67,7 +67,7 @@ export type RangeCustomPickerProps = {
67
67
  /** Everything about the props that does not depend on the field's `custom` flag. */
68
68
  type RangeFilterCommon<P extends string, C extends boolean> = UncontrolledProps &
69
69
  Omit<FilterBase, 'clearable' | 'label'> & {
70
- /** Sheet-form heading. The pill's own label is the VALUE, which is what a bar reads. @default 'Range' */
70
+ /** The filter's name: the sheet-form heading, and the pill's muted label once a range is chosen (`Window 7d`); at the default the pill reads the range alone. @default 'Range' */
71
71
  readonly label?: string
72
72
  /**
73
73
  * A range handle from either store factory. Generic over the field's `custom` flag so a
@@ -214,9 +214,15 @@ export function RangeFilter<P extends string>(
214
214
  </Stack>
215
215
  )
216
216
 
217
+ const rangeText = rangeLabel(value, options)
217
218
  return (
218
219
  <FilterPill
219
- label={rangeLabel(value, options)}
220
+ {...filterReading({
221
+ name: label,
222
+ informative: !isDefault,
223
+ value: rangeText,
224
+ unsetText: rangeText,
225
+ })}
220
226
  active={!isDefault}
221
227
  numeric={numeric && value.preset !== 'custom'}
222
228
  {...(disabled === true && { disabled: true })}
@@ -69,6 +69,8 @@
69
69
  .label {
70
70
  position: relative;
71
71
  min-width: 0;
72
+ /* A name truncates before it touches the value, whatever the column gap. */
73
+ padding-inline-end: var(--vx-space-stack-md, 0.75rem);
72
74
  overflow: hidden;
73
75
  text-overflow: ellipsis;
74
76
  white-space: nowrap;
@@ -96,8 +98,6 @@
96
98
 
97
99
  .empty {
98
100
  grid-column: 1 / -1;
99
- font-size: var(--vx-text-sm);
100
- color: var(--vx-muted);
101
101
  }
102
102
 
103
103
  /* A real row with a skeleton laid over it: the row sets the height, the skeleton paints it. */
@@ -233,10 +233,26 @@
233
233
  }
234
234
 
235
235
  /*
236
- * A column of DeltaBadges: glyph and figure are ONE unit, end-aligned as a whole, so the glyph never drifts
237
- * from its figure however wide the column ("▲ 9%" and "▲13%" share their right edge and keep the badge's own
238
- * gap). Tabular figures keep the right edges even (D33: only in a table-like column, not a hero metric).
236
+ * A column of DeltaBadges is a start-aligned two-track grid: the glyph track, then the figure. Every
237
+ * glyph shares one x and sits one fixed gap from its own figure ("▲ 9%" and "▲ 13%" alike); the
238
+ * figures are ragged on the right. End-aligning them in a fixed-width track kept the right edge but
239
+ * left a digit-wide hole between a short figure and its glyph (about 8px, Wave 50 S4).
239
240
  */
240
241
  .secondary [data-delta] {
242
+ /* A block that hugs its content and sits on the cell's start, whatever the cell's `text-align`, so
243
+ * every glyph shares one x. */
244
+ display: grid;
245
+ width: max-content;
246
+ margin-inline-end: auto;
247
+ grid-auto-flow: column;
248
+ grid-template-columns: auto auto;
249
+ justify-items: start;
241
250
  font-variant-numeric: tabular-nums;
251
+ /* The row's line box, not the badge's own `line-height: 1`: its baseline then sits on the value's. */
252
+ line-height: inherit;
253
+ }
254
+
255
+ /* A zero delta has no glyph: its figure is the only track. */
256
+ .secondary [data-delta]:not(:has([data-delta-glyph])) {
257
+ grid-template-columns: auto;
242
258
  }
@@ -18,9 +18,10 @@
18
18
  * the one scale, so a name stays beside its value and a full-scale bar ends at the track end.
19
19
  *
20
20
  * The secondary column aligns by content (override: `secondaryAlign`): a text secondary (a status word,
21
- * `StatusVerdict`/`StatusDot`) starts on one x so the dots line up; figures ("41%", "+€7"), numbers and a
22
- * `DeltaBadge` end. A delta column also gets a fixed-width glyph slot and a tabular figure slot, so the
23
- * glyphs AND the figures' right edges line up (a column of deltas is table-like, D33 allows tabular there).
21
+ * `StatusVerdict`/`StatusDot`) starts on one x so the dots line up; figures ("41%", "+€7") and numbers
22
+ * end. A `DeltaBadge` starts on one x too: a glyph track, then the figure, so every glyph shares an x and
23
+ * sits one fixed gap from its own figure; the figures are ragged on the right (a column of deltas is
24
+ * table-like, D33 allows tabular there).
24
25
  *
25
26
  * Colour law: bars are neutral. `accentLeader` (opt-in) lets the top row take the accent — the
26
27
  * leader bar, and nothing else. Each value is rendered as text, never only a bar length.
@@ -46,13 +47,15 @@
46
47
  * />
47
48
  */
48
49
  import { Skeleton, VisuallyHidden } from '@mantine/core'
50
+ import { EmptyState } from './empty-state'
49
51
  import { isValidElement } from 'react'
50
52
  import type { ReactNode } from 'react'
51
- import { cx } from '../common/props'
52
- import type { BasaltProps } from '../common/props'
53
+ import { cx, pickDataAttributes } from '../common/props'
54
+ import type { BasaltProps, DataAttributes } from '../common/props'
53
55
  import classes from './bar-list.module.css'
54
56
  import { StatusDot } from '../theme/status-dot'
55
57
  import { StatusVerdict } from '../theme/status-verdict'
58
+ import { skeletonRowCount } from './event-list-model'
56
59
  import { asText, barPercent } from './scale'
57
60
 
58
61
  type BarListItem = {
@@ -68,37 +71,38 @@ type BarListItem = {
68
71
  tickLabel?: string
69
72
  }
70
73
 
71
- export type BarListProps = BasaltProps & {
72
- /** Accessible name of the list. Required. */
73
- label: string
74
- /** Rows in display order (sort them yourself; the list does not reorder). */
75
- items: readonly BarListItem[]
76
- /**
77
- * Formats each number. `part` is `'max'` for a row's denominator, `'value'` otherwise (the value and
78
- * the tick), so a unit can sit on one side only: `'32 / 40 pts'`. Default: the number as written.
79
- */
80
- format?: (value: number, part: 'value' | 'max') => string
81
- /** Scale end shared by rows without their own `max`. Default: the largest of those rows' values. */
82
- max?: number
83
- /**
84
- * `thin` (default): label on its own line above a thin bar, value right-aligned on that line.
85
- * `inline`: the label sits inside a heavier track, the value outside it.
86
- */
87
- variant?: 'thin' | 'inline'
88
- /** The first row's bar takes the accent. Off by default. */
89
- accentLeader?: boolean
90
- /**
91
- * Which edge the secondary column aligns to. Default: by content — text (a status word, a status
92
- * mark) starts, figures and other elements end.
93
- */
94
- secondaryAlign?: 'start' | 'end'
95
- /** Renders row-shaped skeletons. */
96
- loading?: boolean
97
- /** Skeleton rows while loading. Default 5. */
98
- loadingRows?: number
99
- /** Muted line shown when `items` is empty. */
100
- emptyText?: string
101
- }
74
+ export type BarListProps = BasaltProps &
75
+ DataAttributes & {
76
+ /** Accessible name of the list. Required. */
77
+ label: string
78
+ /** Rows in display order (sort them yourself; the list does not reorder). */
79
+ items: readonly BarListItem[]
80
+ /**
81
+ * Formats each number. `part` is `'max'` for a row's denominator, `'value'` otherwise (the value and
82
+ * the tick), so a unit can sit on one side only: `'32 / 40 pts'`. Default: the number as written.
83
+ */
84
+ format?: (value: number, part: 'value' | 'max') => string
85
+ /** Scale end shared by rows without their own `max`. Default: the largest of those rows' values. */
86
+ max?: number
87
+ /**
88
+ * `thin` (default): label on its own line above a thin bar, value right-aligned on that line.
89
+ * `inline`: the label sits inside a heavier track, the value outside it.
90
+ */
91
+ variant?: 'thin' | 'inline'
92
+ /** The first row's bar takes the accent. Off by default. */
93
+ accentLeader?: boolean
94
+ /**
95
+ * Which edge the secondary column aligns to. Default: by content — text (a status word, a status
96
+ * mark) starts, figures and other elements end.
97
+ */
98
+ secondaryAlign?: 'start' | 'end'
99
+ /** Renders row-shaped skeletons. */
100
+ loading?: boolean
101
+ /** Skeleton rows while loading. Default: the rows `items` holds now (a refetch, capped at 30), else 5. */
102
+ loadingRows?: number
103
+ /** Title of the `EmptyState` tile shown when `items` is empty. Default "No items to compare yet"; pass the cause for your list. */
104
+ emptyText?: string
105
+ }
102
106
 
103
107
  /** `null`, `undefined`, `false` and `true` render nothing, so they are not a secondary value. */
104
108
  const hasContent = (node: ReactNode): boolean =>
@@ -126,19 +130,21 @@ export function BarList({
126
130
  accentLeader = false,
127
131
  secondaryAlign,
128
132
  loading = false,
129
- loadingRows = 5,
130
- emptyText = 'No data',
133
+ loadingRows,
134
+ emptyText = 'No items to compare yet',
131
135
  className,
132
136
  style,
137
+ ...rest
133
138
  }: BarListProps) {
139
+ const data = pickDataAttributes(rest)
134
140
  if (loading) {
135
141
  // Each row is a real, empty row with a skeleton laid over it, so the list takes the height of
136
142
  // the rows it will become in every layout instead of a fixed guess.
137
143
  return (
138
- <div className={cx(classes.frame, className)} style={style}>
144
+ <div {...data} className={cx(classes.frame, className)} style={style}>
139
145
  <div className={classes.root} aria-busy="true" data-variant={variant}>
140
146
  <VisuallyHidden>{`Loading ${label}`}</VisuallyHidden>
141
- {Array.from({ length: loadingRows }, (_, i) => (
147
+ {Array.from({ length: skeletonRowCount(loadingRows, items.length) }, (_, i) => (
142
148
  <div
143
149
  key={i}
144
150
  className={cx(classes.row, classes.skeletonRow)}
@@ -157,10 +163,12 @@ export function BarList({
157
163
  }
158
164
  if (items.length === 0) {
159
165
  return (
160
- <div className={cx(classes.frame, className)} style={style}>
161
- <output className={classes.root} aria-label={label}>
162
- <span className={classes.empty}>{emptyText}</span>
163
- </output>
166
+ <div {...data} className={cx(classes.frame, className)} style={style}>
167
+ {/* oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- a polite live region whose name is the visually hidden label inside; `<output>` cannot hold the tile's block content */}
168
+ <div className={classes.root} role="status">
169
+ <VisuallyHidden>{label}</VisuallyHidden>
170
+ <EmptyState tier="section" title={emptyText} className={classes.empty} />
171
+ </div>
164
172
  </div>
165
173
  )
166
174
  }
@@ -176,7 +184,7 @@ export function BarList({
176
184
  const align = secondaryAlign ?? (items.some((i) => isText(i.secondary)) ? 'start' : 'end')
177
185
  return (
178
186
  // The frame is the width container the wide layout keys on (a container cannot restyle its own grid).
179
- <div className={cx(classes.frame, className)} style={style}>
187
+ <div {...data} className={cx(classes.frame, className)} style={style}>
180
188
  {/* The explicit role is deliberate: `list-style: none` makes Safari/VoiceOver drop the implicit one. */}
181
189
  <ul
182
190
  className={classes.root}
@@ -0,0 +1,67 @@
1
+ /** Roving-focus movement for `Board`: pure, so the keyboard law is testable without a DOM. */
2
+
3
+ export type BoardKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End'
4
+
5
+ export const BOARD_KEYS = [
6
+ 'ArrowUp',
7
+ 'ArrowDown',
8
+ 'ArrowLeft',
9
+ 'ArrowRight',
10
+ 'Home',
11
+ 'End',
12
+ ] as const satisfies readonly BoardKey[]
13
+
14
+ export function isBoardKey(key: string): key is BoardKey {
15
+ return (BOARD_KEYS as readonly string[]).includes(key)
16
+ }
17
+
18
+ export type BoardPos = { col: number; row: number }
19
+
20
+ /**
21
+ * The position `key` moves to from `from`, or `null` when it stays put. `sizes` is the card count of
22
+ * every column in order. Up/Down/Home/End stay in the column; Left/Right jump to the nearest
23
+ * non-empty column in that direction and land on the same row index, clamped to its last card.
24
+ */
25
+ export function moveOnBoard(
26
+ sizes: readonly number[],
27
+ from: BoardPos,
28
+ key: BoardKey,
29
+ ): BoardPos | null {
30
+ const size = sizes[from.col] ?? 0
31
+ let next: BoardPos
32
+ switch (key) {
33
+ case 'ArrowUp':
34
+ next = { col: from.col, row: from.row - 1 }
35
+ break
36
+ case 'ArrowDown':
37
+ next = { col: from.col, row: from.row + 1 }
38
+ break
39
+ case 'Home':
40
+ next = { col: from.col, row: 0 }
41
+ break
42
+ case 'End':
43
+ next = { col: from.col, row: size - 1 }
44
+ break
45
+ case 'ArrowLeft':
46
+ case 'ArrowRight': {
47
+ const step = key === 'ArrowLeft' ? -1 : 1
48
+ let col = from.col + step
49
+ while (col >= 0 && col < sizes.length && (sizes[col] ?? 0) === 0) col += step
50
+ if (col < 0 || col >= sizes.length) return null
51
+ next = { col, row: Math.min(from.row, (sizes[col] ?? 1) - 1) }
52
+ break
53
+ }
54
+ }
55
+ if (next.row < 0 || next.row >= (sizes[next.col] ?? 0)) return null
56
+ return next.col === from.col && next.row === from.row ? null : next
57
+ }
58
+
59
+ /**
60
+ * Only http(s) and relative references render as links; anything else (`javascript:`, `data:`,
61
+ * `mailto:`) stays text. The scheme is case-insensitive (`HTTPS://` is http). A leading `/` must not
62
+ * be followed by another `/` or a `\` — browsers read both as a host (`//evil`, `/\evil`) — and a
63
+ * leading `\` is rejected the same way.
64
+ */
65
+ export function isSafeHref(href: string): boolean {
66
+ return /^https?:\/\//i.test(href) || /^(?:\/(?![/\\])|\.{1,2}\/|#|\?)/.test(href)
67
+ }
@@ -0,0 +1,179 @@
1
+ /*
2
+ * Board (docs/waves/design-parity/SPEC.md § 6.8). Columns share the row; each scrolls alone inside a
3
+ * Mantine ScrollArea bounded by `height`. Cards are Mantine Cards: the theme owns inset, radius and
4
+ * surface, so nothing here sets them. The open button is stretched over its card (one click target,
5
+ * one tab stop); the record link and the meter slot sit above that overlay.
6
+ */
7
+ .root {
8
+ inline-size: 100%;
9
+ min-width: 0;
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: var(--vx-space-stack-sm);
13
+ }
14
+
15
+ .columns {
16
+ display: flex;
17
+ align-items: flex-start;
18
+ gap: var(--vx-space-stack-sm);
19
+ }
20
+
21
+ .column {
22
+ flex: 1 1 0;
23
+ min-width: 0;
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: var(--vx-space-stack-sm);
27
+ }
28
+
29
+ /* A bottom fade while more cards sit below the fold (`data-more`, set by `ColumnScroll`). A mask, not a
30
+ gradient of the page colour: a Board in a `Section` sits on the panel surface, and a fade to the
31
+ page colour (W50) left a 16 px band that read as no fade at all. The mask dissolves the cards
32
+ themselves, so it shows on any backdrop, and adds no height. */
33
+ .viewport[data-more] {
34
+ --board-fade: calc(var(--vx-space-stack-lg, 1.5rem) * 2);
35
+ mask-image: linear-gradient(to bottom, black calc(100% - var(--board-fade)), transparent);
36
+ }
37
+
38
+ /* A quiet thumb: 6 px, a faint ink tint that firms on hover, no rail behind it (Mantine's default is a
39
+ heavy grey bar that read as chrome on the page). */
40
+ .thumb {
41
+ background: color-mix(in srgb, var(--vx-ink) 22%, transparent);
42
+ }
43
+
44
+ .thumb:hover {
45
+ background: color-mix(in srgb, var(--vx-ink) 40%, transparent);
46
+ }
47
+
48
+ .head {
49
+ display: flex;
50
+ align-items: center;
51
+ gap: var(--vx-space-control-gap);
52
+ min-width: 0;
53
+ }
54
+
55
+ .title {
56
+ margin: 0;
57
+ min-width: 0;
58
+ overflow: hidden;
59
+ text-overflow: ellipsis;
60
+ white-space: nowrap;
61
+ font-size: var(--vx-text-sm);
62
+ font-weight: 500;
63
+ color: var(--vx-ink);
64
+ }
65
+
66
+ .count {
67
+ font-family: var(--basalt-font-mono);
68
+ font-size: var(--vx-text-micro);
69
+ color: var(--vx-muted);
70
+ }
71
+
72
+ .total {
73
+ margin-inline-start: auto;
74
+ font-family: var(--basalt-font-mono);
75
+ font-size: var(--vx-text-micro);
76
+ color: var(--vx-muted);
77
+ white-space: nowrap;
78
+ }
79
+
80
+ .list {
81
+ margin: 0;
82
+ padding: 0;
83
+ list-style: none;
84
+ display: flex;
85
+ flex-direction: column;
86
+ /* 6 px at level 0, riding the density multiplier like every other step. */
87
+ gap: calc(var(--vx-space-stack-xs) * 1.5);
88
+ }
89
+
90
+ .card {
91
+ position: relative;
92
+ display: flex;
93
+ flex-direction: column;
94
+ gap: var(--vx-space-stack-xs);
95
+ min-width: 0;
96
+ overflow-wrap: anywhere;
97
+ }
98
+
99
+ .caption {
100
+ margin: 0;
101
+ font-family: var(--basalt-font-mono);
102
+ font-size: var(--vx-text-micro);
103
+ color: var(--vx-muted);
104
+ }
105
+
106
+ .open {
107
+ all: unset;
108
+ display: block;
109
+ font-size: var(--vx-text-sm);
110
+ color: var(--vx-ink);
111
+ cursor: pointer;
112
+ }
113
+
114
+ /* The whole card is the target. */
115
+ .open::after {
116
+ content: '';
117
+ position: absolute;
118
+ inset: 0;
119
+ border-radius: inherit;
120
+ }
121
+
122
+ .open:focus-visible::after {
123
+ outline: 2px solid var(--vx-focus-ring, var(--mantine-primary-color-filled));
124
+ outline-offset: 1px;
125
+ }
126
+
127
+ .record,
128
+ .meter {
129
+ position: relative;
130
+ z-index: 1;
131
+ font-size: var(--vx-text-xs);
132
+ }
133
+
134
+ /* The record link is chrome, not an accent site (SPEC § 6.12): ink in both schemes, and a visited
135
+ record never changes colour. */
136
+ a.record,
137
+ a.record:visited {
138
+ color: var(--vx-ink);
139
+ text-decoration: none;
140
+ }
141
+
142
+ a.record:hover {
143
+ text-decoration: underline;
144
+ }
145
+
146
+ a.record:focus-visible {
147
+ outline: 2px solid var(--vx-focus-ring, var(--mantine-primary-color-filled));
148
+ outline-offset: 1px;
149
+ }
150
+
151
+ .status {
152
+ margin: 0;
153
+ font-size: var(--vx-text-xs);
154
+ color: var(--vx-muted);
155
+ }
156
+
157
+ .empty {
158
+ display: block;
159
+ }
160
+
161
+ .skeletonTitle {
162
+ inline-size: 40%;
163
+ block-size: 0.75rem;
164
+ }
165
+
166
+ .skeletonCaption {
167
+ inline-size: 35%;
168
+ block-size: 0.5rem;
169
+ }
170
+
171
+ .skeletonLine {
172
+ inline-size: 85%;
173
+ block-size: 0.75rem;
174
+ }
175
+
176
+ .skeletonStatus {
177
+ inline-size: 50%;
178
+ block-size: 0.5rem;
179
+ }
@@ -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 root: string
7
+ readonly columns: string
8
+ readonly column: string
9
+ readonly viewport: string
10
+ readonly head: string
11
+ readonly title: string
12
+ readonly thumb: string
13
+ readonly count: string
14
+ readonly total: string
15
+ readonly list: string
16
+ readonly card: string
17
+ readonly caption: string
18
+ readonly open: string
19
+ readonly record: string
20
+ readonly meter: string
21
+ readonly status: string
22
+ readonly empty: string
23
+ readonly skeletonTitle: string
24
+ readonly skeletonCaption: string
25
+ readonly skeletonLine: string
26
+ readonly skeletonStatus: string
27
+ }
28
+ export default classes