basalt-ui 2.27.2 → 2.28.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 (238) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/MIGRATING.md +168 -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-design/SKILL.md +1 -1
  7. package/agent/skills/basalt-design/references/catalogue.md +40 -36
  8. package/agent/skills/basalt-design/references/recipes.md +47 -0
  9. package/configs/oxlint-basalt.json +2 -1
  10. package/configs/oxlint-plugin.js +110 -2
  11. package/configs/oxlint-plugin.test.ts +99 -4
  12. package/dist/agent/chat/thread-message.d.ts +1 -160
  13. package/dist/agent/chat/thread-message.d.ts.map +1 -1
  14. package/dist/agent/chat/thread-message.js +7 -162
  15. package/dist/agent/chat/virtualize.d.ts +5 -5
  16. package/dist/charts/ChartCard.d.ts +5 -2
  17. package/dist/charts/ChartCard.d.ts.map +1 -1
  18. package/dist/charts/ChartCard.js +46 -13
  19. package/dist/charts/Lines.d.ts.map +1 -1
  20. package/dist/charts/Lines.js +11 -4
  21. package/dist/charts/Sparkline.d.ts +9 -2
  22. package/dist/charts/Sparkline.d.ts.map +1 -1
  23. package/dist/charts/Sparkline.js +104 -41
  24. package/dist/charts/chart-box.module.css +50 -0
  25. package/dist/charts/chart-box.module.css.d.ts +5 -0
  26. package/dist/charts/chart-card.module.css +12 -4
  27. package/dist/charts/chart-card.module.css.d.ts +1 -0
  28. package/dist/charts/compile.d.ts.map +1 -1
  29. package/dist/charts/compile.js +20 -18
  30. package/dist/charts/labels.d.ts +13 -3
  31. package/dist/charts/labels.d.ts.map +1 -1
  32. package/dist/charts/labels.js +131 -20
  33. package/dist/charts/legend.d.ts.map +1 -1
  34. package/dist/charts/legend.js +1 -1
  35. package/dist/charts/ref-label.d.ts +31 -8
  36. package/dist/charts/ref-label.d.ts.map +1 -1
  37. package/dist/charts/ref-label.js +40 -9
  38. package/dist/charts/sparkline.module.css +6 -0
  39. package/dist/charts/state.d.ts +3 -3
  40. package/dist/charts/state.d.ts.map +1 -1
  41. package/dist/charts/state.js +20 -2
  42. package/dist/cli/shot/capture.d.ts +6 -1
  43. package/dist/cli/shot/capture.d.ts.map +1 -1
  44. package/dist/cli/shot/capture.js +18 -5
  45. package/dist/common/empty-copy.d.ts +16 -0
  46. package/dist/common/empty-copy.d.ts.map +1 -0
  47. package/dist/common/empty-copy.js +9 -0
  48. package/dist/common/virtual-rows.d.ts +196 -0
  49. package/dist/common/virtual-rows.d.ts.map +1 -0
  50. package/dist/common/virtual-rows.js +290 -0
  51. package/dist/controls/controls.module.css +33 -1
  52. package/dist/controls/controls.module.css.d.ts +2 -0
  53. package/dist/controls/enum-filter.d.ts.map +1 -1
  54. package/dist/controls/enum-filter.js +8 -2
  55. package/dist/controls/filter-pill.d.ts +27 -3
  56. package/dist/controls/filter-pill.d.ts.map +1 -1
  57. package/dist/controls/filter-pill.js +15 -4
  58. package/dist/controls/form-layout.d.ts +9 -3
  59. package/dist/controls/form-layout.d.ts.map +1 -1
  60. package/dist/controls/form-layout.js +74 -12
  61. package/dist/controls/form-layout.module.css +112 -7
  62. package/dist/controls/form-layout.module.css.d.ts +1 -0
  63. package/dist/controls/multi-select-filter.d.ts +2 -2
  64. package/dist/controls/multi-select-filter.d.ts.map +1 -1
  65. package/dist/controls/multi-select-filter.js +12 -6
  66. package/dist/controls/range-filter.d.ts +1 -1
  67. package/dist/controls/range-filter.d.ts.map +1 -1
  68. package/dist/controls/range-filter.js +8 -2
  69. package/dist/dashboard/bar-list.d.ts +1 -1
  70. package/dist/dashboard/bar-list.d.ts.map +1 -1
  71. package/dist/dashboard/bar-list.js +6 -2
  72. package/dist/dashboard/bar-list.module.css +0 -2
  73. package/dist/dashboard/board-nav.d.ts +22 -0
  74. package/dist/dashboard/board-nav.d.ts.map +1 -0
  75. package/dist/dashboard/board-nav.js +49 -0
  76. package/dist/dashboard/board.d.ts +52 -0
  77. package/dist/dashboard/board.d.ts.map +1 -0
  78. package/dist/dashboard/board.js +228 -0
  79. package/dist/dashboard/board.module.css +160 -0
  80. package/dist/dashboard/board.module.css.d.ts +26 -0
  81. package/dist/dashboard/empty-state.d.ts +3 -3
  82. package/dist/dashboard/empty-state.d.ts.map +1 -1
  83. package/dist/dashboard/empty-state.js +13 -6
  84. package/dist/dashboard/event-list-model.d.ts +51 -0
  85. package/dist/dashboard/event-list-model.d.ts.map +1 -0
  86. package/dist/dashboard/event-list-model.js +72 -0
  87. package/dist/dashboard/event-list-rows.d.ts +23 -0
  88. package/dist/dashboard/event-list-rows.d.ts.map +1 -0
  89. package/dist/dashboard/event-list-rows.js +93 -0
  90. package/dist/dashboard/event-list-scroll.d.ts +27 -0
  91. package/dist/dashboard/event-list-scroll.d.ts.map +1 -0
  92. package/dist/dashboard/event-list-scroll.js +103 -0
  93. package/dist/dashboard/event-list-skeleton.d.ts +10 -0
  94. package/dist/dashboard/event-list-skeleton.d.ts.map +1 -0
  95. package/dist/dashboard/event-list-skeleton.js +36 -0
  96. package/dist/dashboard/event-list.d.ts +65 -0
  97. package/dist/dashboard/event-list.d.ts.map +1 -0
  98. package/dist/dashboard/event-list.js +178 -0
  99. package/dist/dashboard/event-list.module.css +283 -0
  100. package/dist/dashboard/event-list.module.css.d.ts +33 -0
  101. package/dist/dashboard/index.d.ts +2 -0
  102. package/dist/dashboard/index.d.ts.map +1 -1
  103. package/dist/dashboard/index.js +4 -0
  104. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  105. package/dist/dashboard/meter-parts.js +5 -3
  106. package/dist/dashboard/meter.module.css +2 -1
  107. package/dist/dashboard/query-state.js +1 -1
  108. package/dist/dashboard/settings-section.d.ts +4 -1
  109. package/dist/dashboard/settings-section.d.ts.map +1 -1
  110. package/dist/dashboard/settings-section.js +1 -1
  111. package/dist/dashboard/settings-section.module.css +19 -4
  112. package/dist/dashboard/stat-card-parts.d.ts +5 -1
  113. package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
  114. package/dist/dashboard/stat-card-parts.js +8 -3
  115. package/dist/dashboard/stat-card.d.ts.map +1 -1
  116. package/dist/dashboard/stat-card.js +25 -6
  117. package/dist/dashboard/stat-card.module.css +31 -7
  118. package/dist/dashboard/stat-card.module.css.d.ts +3 -0
  119. package/dist/dashboard/stat-strip.module.css +4 -1
  120. package/dist/dashboard/widget-header.module.css +17 -1
  121. package/dist/guard/index.d.ts.map +1 -1
  122. package/dist/guard/index.js +2 -0
  123. package/dist/index.d.ts +1 -1
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +4 -0
  126. package/dist/shell/app-main.module.css +18 -0
  127. package/dist/styles.css +46 -0
  128. package/dist/surfaces.d.ts +2 -2
  129. package/dist/surfaces.d.ts.map +1 -1
  130. package/dist/surfaces.js +8 -2
  131. package/dist/table/cell-kinds.d.ts +44 -0
  132. package/dist/table/cell-kinds.d.ts.map +1 -0
  133. package/dist/table/cell-kinds.js +169 -0
  134. package/dist/table/cell-kinds.module.css +55 -0
  135. package/dist/table/cell-kinds.module.css.d.ts +15 -0
  136. package/dist/table/data-table-fold.d.ts +147 -0
  137. package/dist/table/data-table-fold.d.ts.map +1 -0
  138. package/dist/table/data-table-fold.js +288 -0
  139. package/dist/table/data-table-state.d.ts +10 -3
  140. package/dist/table/data-table-state.d.ts.map +1 -1
  141. package/dist/table/data-table-state.js +11 -6
  142. package/dist/table/data-table.d.ts +11 -26
  143. package/dist/table/data-table.d.ts.map +1 -1
  144. package/dist/table/data-table.js +354 -254
  145. package/dist/table/data-table.module.css +210 -3
  146. package/dist/table/data-table.module.css.d.ts +12 -0
  147. package/dist/table/table-features.d.ts +34 -4
  148. package/dist/table/table-features.d.ts.map +1 -1
  149. package/dist/table/table-features.js +10 -0
  150. package/dist/theme/card-inset.module.css +35 -0
  151. package/dist/theme/controls.module.css +32 -0
  152. package/dist/theme/ctl-theme.d.ts.map +1 -1
  153. package/dist/theme/ctl-theme.js +5 -0
  154. package/dist/theme/index.d.ts.map +1 -1
  155. package/dist/theme/index.js +14 -10
  156. package/dist/tokens/core.d.ts +1 -0
  157. package/dist/tokens/core.d.ts.map +1 -1
  158. package/dist/tokens/core.js +1 -0
  159. package/dist/tokens/derive.js +1 -1
  160. package/dist/tokens/palette.d.ts +2 -1
  161. package/dist/tokens/palette.d.ts.map +1 -1
  162. package/llms.txt +34 -5
  163. package/package.json +1 -1
  164. package/src/agent/chat/thread-message.tsx +10 -403
  165. package/src/agent/chat/virtualize.ts +5 -5
  166. package/src/charts/ChartCard.tsx +79 -17
  167. package/src/charts/Lines.tsx +13 -4
  168. package/src/charts/Sparkline.tsx +131 -45
  169. package/src/charts/chart-box.module.css +50 -0
  170. package/src/charts/chart-box.module.css.d.ts +5 -0
  171. package/src/charts/chart-card.module.css +12 -4
  172. package/src/charts/chart-card.module.css.d.ts +1 -0
  173. package/src/charts/compile.ts +22 -18
  174. package/src/charts/labels.ts +175 -24
  175. package/src/charts/legend.tsx +3 -2
  176. package/src/charts/ref-label.ts +86 -17
  177. package/src/charts/sparkline.module.css +6 -0
  178. package/src/charts/state.tsx +36 -7
  179. package/src/cli/shot/capture.ts +29 -6
  180. package/src/common/empty-copy.ts +17 -0
  181. package/src/common/virtual-rows.tsx +682 -0
  182. package/src/controls/controls.module.css +33 -1
  183. package/src/controls/controls.module.css.d.ts +2 -0
  184. package/src/controls/enum-filter.tsx +8 -2
  185. package/src/controls/filter-pill.tsx +80 -27
  186. package/src/controls/form-layout.module.css +112 -7
  187. package/src/controls/form-layout.module.css.d.ts +1 -0
  188. package/src/controls/form-layout.tsx +115 -22
  189. package/src/controls/multi-select-filter.tsx +22 -11
  190. package/src/controls/range-filter.tsx +9 -3
  191. package/src/dashboard/bar-list.module.css +0 -2
  192. package/src/dashboard/bar-list.tsx +8 -5
  193. package/src/dashboard/board-nav.ts +67 -0
  194. package/src/dashboard/board.module.css +160 -0
  195. package/src/dashboard/board.module.css.d.ts +26 -0
  196. package/src/dashboard/board.tsx +394 -0
  197. package/src/dashboard/empty-state.tsx +16 -9
  198. package/src/dashboard/event-list-model.ts +113 -0
  199. package/src/dashboard/event-list-rows.tsx +120 -0
  200. package/src/dashboard/event-list-scroll.ts +145 -0
  201. package/src/dashboard/event-list-skeleton.tsx +58 -0
  202. package/src/dashboard/event-list.module.css +283 -0
  203. package/src/dashboard/event-list.module.css.d.ts +33 -0
  204. package/src/dashboard/event-list.tsx +309 -0
  205. package/src/dashboard/index.ts +2 -0
  206. package/src/dashboard/meter-parts.tsx +9 -2
  207. package/src/dashboard/meter.module.css +2 -1
  208. package/src/dashboard/query-state.tsx +1 -1
  209. package/src/dashboard/settings-section.module.css +19 -4
  210. package/src/dashboard/settings-section.tsx +7 -2
  211. package/src/dashboard/stat-card-parts.tsx +20 -3
  212. package/src/dashboard/stat-card.module.css +31 -7
  213. package/src/dashboard/stat-card.module.css.d.ts +3 -0
  214. package/src/dashboard/stat-card.tsx +24 -5
  215. package/src/dashboard/stat-strip.module.css +4 -1
  216. package/src/dashboard/widget-header.module.css +17 -1
  217. package/src/guard/index.ts +2 -0
  218. package/src/index.ts +4 -0
  219. package/src/shell/app-main.module.css +18 -0
  220. package/src/styles.css +46 -0
  221. package/src/surfaces.ts +7 -1
  222. package/src/table/cell-kinds.module.css +55 -0
  223. package/src/table/cell-kinds.module.css.d.ts +15 -0
  224. package/src/table/cell-kinds.tsx +234 -0
  225. package/src/table/data-table-fold.tsx +514 -0
  226. package/src/table/data-table-state.ts +24 -13
  227. package/src/table/data-table.module.css +210 -3
  228. package/src/table/data-table.module.css.d.ts +12 -0
  229. package/src/table/data-table.tsx +406 -359
  230. package/src/table/table-features.ts +44 -4
  231. package/src/theme/__snapshots__/plain-theme.test.ts.snap +2 -66
  232. package/src/theme/card-inset.module.css +35 -0
  233. package/src/theme/controls.module.css +32 -0
  234. package/src/theme/ctl-theme.tsx +8 -0
  235. package/src/theme/index.ts +12 -8
  236. package/src/tokens/core.ts +1 -0
  237. package/src/tokens/derive.ts +1 -1
  238. 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 })}
@@ -96,8 +96,6 @@
96
96
 
97
97
  .empty {
98
98
  grid-column: 1 / -1;
99
- font-size: var(--vx-text-sm);
100
- color: var(--vx-muted);
101
99
  }
102
100
 
103
101
  /* A real row with a skeleton laid over it: the row sets the height, the skeleton paints it. */
@@ -46,6 +46,7 @@
46
46
  * />
47
47
  */
48
48
  import { Skeleton, VisuallyHidden } from '@mantine/core'
49
+ import { EmptyState } from './empty-state'
49
50
  import { isValidElement } from 'react'
50
51
  import type { ReactNode } from 'react'
51
52
  import { cx } from '../common/props'
@@ -96,7 +97,7 @@ export type BarListProps = BasaltProps & {
96
97
  loading?: boolean
97
98
  /** Skeleton rows while loading. Default 5. */
98
99
  loadingRows?: number
99
- /** Muted line shown when `items` is empty. */
100
+ /** Title of the `EmptyState` tile shown when `items` is empty. Default "No items to compare yet"; pass the cause for your list. */
100
101
  emptyText?: string
101
102
  }
102
103
 
@@ -127,7 +128,7 @@ export function BarList({
127
128
  secondaryAlign,
128
129
  loading = false,
129
130
  loadingRows = 5,
130
- emptyText = 'No data',
131
+ emptyText = 'No items to compare yet',
131
132
  className,
132
133
  style,
133
134
  }: BarListProps) {
@@ -158,9 +159,11 @@ export function BarList({
158
159
  if (items.length === 0) {
159
160
  return (
160
161
  <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>
162
+ {/* 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 */}
163
+ <div className={classes.root} role="status">
164
+ <VisuallyHidden>{label}</VisuallyHidden>
165
+ <EmptyState tier="section" title={emptyText} className={classes.empty} />
166
+ </div>
164
167
  </div>
165
168
  )
166
169
  }
@@ -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,160 @@
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
+ .head {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: var(--vx-space-control-gap);
33
+ min-width: 0;
34
+ }
35
+
36
+ .title {
37
+ margin: 0;
38
+ min-width: 0;
39
+ overflow: hidden;
40
+ text-overflow: ellipsis;
41
+ white-space: nowrap;
42
+ font-size: var(--vx-text-sm);
43
+ font-weight: 500;
44
+ color: var(--vx-ink);
45
+ }
46
+
47
+ .count {
48
+ font-family: var(--basalt-font-mono);
49
+ font-size: var(--vx-text-micro);
50
+ color: var(--vx-muted);
51
+ }
52
+
53
+ .total {
54
+ margin-inline-start: auto;
55
+ font-family: var(--basalt-font-mono);
56
+ font-size: var(--vx-text-micro);
57
+ color: var(--vx-muted);
58
+ white-space: nowrap;
59
+ }
60
+
61
+ .list {
62
+ margin: 0;
63
+ padding: 0;
64
+ list-style: none;
65
+ display: flex;
66
+ flex-direction: column;
67
+ /* 6 px at level 0, riding the density multiplier like every other step. */
68
+ gap: calc(var(--vx-space-stack-xs) * 1.5);
69
+ }
70
+
71
+ .card {
72
+ position: relative;
73
+ display: flex;
74
+ flex-direction: column;
75
+ gap: var(--vx-space-stack-xs);
76
+ min-width: 0;
77
+ overflow-wrap: anywhere;
78
+ }
79
+
80
+ .caption {
81
+ margin: 0;
82
+ font-family: var(--basalt-font-mono);
83
+ font-size: var(--vx-text-micro);
84
+ color: var(--vx-muted);
85
+ }
86
+
87
+ .open {
88
+ all: unset;
89
+ display: block;
90
+ font-size: var(--vx-text-sm);
91
+ color: var(--vx-ink);
92
+ cursor: pointer;
93
+ }
94
+
95
+ /* The whole card is the target. */
96
+ .open::after {
97
+ content: '';
98
+ position: absolute;
99
+ inset: 0;
100
+ border-radius: inherit;
101
+ }
102
+
103
+ .open:focus-visible::after {
104
+ outline: 2px solid var(--vx-focus-ring, var(--mantine-primary-color-filled));
105
+ outline-offset: 1px;
106
+ }
107
+
108
+ .record,
109
+ .meter {
110
+ position: relative;
111
+ z-index: 1;
112
+ font-size: var(--vx-text-xs);
113
+ }
114
+
115
+ /* The record link is chrome, not an accent site (SPEC § 6.12): ink in both schemes, and a visited
116
+ record never changes colour. */
117
+ a.record,
118
+ a.record:visited {
119
+ color: var(--vx-ink);
120
+ text-decoration: none;
121
+ }
122
+
123
+ a.record:hover {
124
+ text-decoration: underline;
125
+ }
126
+
127
+ a.record:focus-visible {
128
+ outline: 2px solid var(--vx-focus-ring, var(--mantine-primary-color-filled));
129
+ outline-offset: 1px;
130
+ }
131
+
132
+ .status {
133
+ margin: 0;
134
+ font-size: var(--vx-text-xs);
135
+ color: var(--vx-muted);
136
+ }
137
+
138
+ .empty {
139
+ display: block;
140
+ }
141
+
142
+ .skeletonTitle {
143
+ inline-size: 40%;
144
+ block-size: 0.75rem;
145
+ }
146
+
147
+ .skeletonCaption {
148
+ inline-size: 35%;
149
+ block-size: 0.5rem;
150
+ }
151
+
152
+ .skeletonLine {
153
+ inline-size: 85%;
154
+ block-size: 0.75rem;
155
+ }
156
+
157
+ .skeletonStatus {
158
+ inline-size: 50%;
159
+ block-size: 0.5rem;
160
+ }
@@ -0,0 +1,26 @@
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 head: string
10
+ readonly title: string
11
+ readonly count: string
12
+ readonly total: string
13
+ readonly list: string
14
+ readonly card: string
15
+ readonly caption: string
16
+ readonly open: string
17
+ readonly record: string
18
+ readonly meter: string
19
+ readonly status: string
20
+ readonly empty: string
21
+ readonly skeletonTitle: string
22
+ readonly skeletonCaption: string
23
+ readonly skeletonLine: string
24
+ readonly skeletonStatus: string
25
+ }
26
+ export default classes