basalt-ui 2.19.0 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/MIGRATING.md +174 -12
  3. package/agent/rules/basalt-charts.md +1 -1
  4. package/agent/rules/basalt-mantine.md +1 -1
  5. package/agent/skills/basalt-app/SKILL.md +1 -1
  6. package/agent/skills/basalt-design/SKILL.md +1 -1
  7. package/agent/templates/DESIGN.md.tpl +1 -1
  8. package/configs/oxlint-plugin.js +33 -19
  9. package/configs/oxlint-plugin.test.ts +32 -2
  10. package/dist/charts/ChartCard.d.ts +28 -3
  11. package/dist/charts/ChartCard.d.ts.map +1 -1
  12. package/dist/charts/ChartCard.js +33 -11
  13. package/dist/charts/Donut.d.ts.map +1 -1
  14. package/dist/charts/Donut.js +13 -1
  15. package/dist/charts/Heatmap.js +1 -1
  16. package/dist/charts/Sparkline.d.ts +7 -1
  17. package/dist/charts/Sparkline.d.ts.map +1 -1
  18. package/dist/charts/Sparkline.js +137 -18
  19. package/dist/charts/box.d.ts +2 -0
  20. package/dist/charts/box.d.ts.map +1 -1
  21. package/dist/charts/box.js +2 -0
  22. package/dist/charts/chart-box.module.css +30 -0
  23. package/dist/charts/chart-box.module.css.d.ts +1 -0
  24. package/dist/charts/chart-card.module.css +47 -0
  25. package/dist/charts/chart-card.module.css.d.ts +7 -0
  26. package/dist/charts/compile.d.ts.map +1 -1
  27. package/dist/charts/compile.js +35 -8
  28. package/dist/charts/host.d.ts.map +1 -1
  29. package/dist/charts/host.js +2 -1
  30. package/dist/charts/index.d.ts +1 -1
  31. package/dist/charts/index.d.ts.map +1 -1
  32. package/dist/charts/sparkline.module.css +59 -0
  33. package/dist/charts/sparkline.module.css.d.ts +13 -0
  34. package/dist/charts/state.d.ts.map +1 -1
  35. package/dist/charts/state.js +32 -4
  36. package/dist/charts/types.d.ts +6 -0
  37. package/dist/charts/types.d.ts.map +1 -1
  38. package/dist/controls/sync-button.d.ts +3 -0
  39. package/dist/controls/sync-button.d.ts.map +1 -1
  40. package/dist/dashboard/bar-list.d.ts +15 -4
  41. package/dist/dashboard/bar-list.d.ts.map +1 -1
  42. package/dist/dashboard/bar-list.js +39 -15
  43. package/dist/dashboard/bar-list.module.css +77 -2
  44. package/dist/dashboard/bar-list.module.css.d.ts +1 -0
  45. package/dist/dashboard/delta-badge.d.ts +8 -3
  46. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  47. package/dist/dashboard/delta-badge.js +9 -2
  48. package/dist/dashboard/index.d.ts +2 -0
  49. package/dist/dashboard/index.d.ts.map +1 -1
  50. package/dist/dashboard/meter-model.d.ts +19 -0
  51. package/dist/dashboard/meter-model.d.ts.map +1 -1
  52. package/dist/dashboard/meter-model.js +18 -1
  53. package/dist/dashboard/meter-parts.d.ts +5 -1
  54. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  55. package/dist/dashboard/meter-parts.js +114 -74
  56. package/dist/dashboard/meter.d.ts +22 -1
  57. package/dist/dashboard/meter.d.ts.map +1 -1
  58. package/dist/dashboard/meter.js +4 -1
  59. package/dist/dashboard/meter.module.css +90 -12
  60. package/dist/dashboard/meter.module.css.d.ts +5 -0
  61. package/dist/dashboard/query-state.d.ts.map +1 -1
  62. package/dist/dashboard/query-state.js +14 -9
  63. package/dist/dashboard/settings-section.d.ts.map +1 -1
  64. package/dist/dashboard/settings-section.js +14 -25
  65. package/dist/dashboard/stat-card-parts.js +1 -1
  66. package/dist/dashboard/stat-card.d.ts +1 -1
  67. package/dist/dashboard/stat-card.d.ts.map +1 -1
  68. package/dist/dashboard/stat-card.js +3 -6
  69. package/dist/dashboard/stat-card.module.css +15 -7
  70. package/dist/dashboard/stat-group.d.ts +11 -2
  71. package/dist/dashboard/stat-group.d.ts.map +1 -1
  72. package/dist/dashboard/stat-group.js +9 -7
  73. package/dist/dashboard/stat-strip.d.ts +50 -0
  74. package/dist/dashboard/stat-strip.d.ts.map +1 -0
  75. package/dist/dashboard/stat-strip.js +85 -0
  76. package/dist/dashboard/stat-strip.module.css +208 -0
  77. package/dist/dashboard/stat-strip.module.css.d.ts +28 -0
  78. package/dist/dashboard/widget-header.d.ts +3 -3
  79. package/dist/dashboard/widget-header.module.css +10 -6
  80. package/dist/format/date.d.ts.map +1 -1
  81. package/dist/format/date.js +4 -3
  82. package/dist/format/shared.d.ts +6 -0
  83. package/dist/format/shared.d.ts.map +1 -1
  84. package/dist/format/shared.js +6 -2
  85. package/dist/guard/index.d.ts +1 -1
  86. package/dist/guard/index.js +1 -1
  87. package/dist/index.d.ts +3 -1
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +4 -0
  90. package/dist/styles.css +6 -0
  91. package/dist/theme/card-inset.module.css +76 -0
  92. package/dist/theme/card-inset.module.css.d.ts +9 -0
  93. package/dist/theme/controls.module.css +3 -0
  94. package/dist/theme/index.d.ts.map +1 -1
  95. package/dist/theme/index.js +23 -0
  96. package/dist/theme/nav-link.module.css +8 -10
  97. package/dist/theme/status-dot.d.ts +3 -2
  98. package/dist/theme/status-dot.d.ts.map +1 -1
  99. package/dist/theme/status-dot.js +12 -3
  100. package/dist/theme/status-verdict.d.ts +3 -2
  101. package/dist/theme/status-verdict.d.ts.map +1 -1
  102. package/dist/theme/status-verdict.js +3 -2
  103. package/dist/theme/status-verdict.module.css +4 -2
  104. package/llms.txt +30 -6
  105. package/package.json +1 -1
  106. package/src/charts/ChartCard.tsx +70 -4
  107. package/src/charts/Donut.tsx +9 -1
  108. package/src/charts/Heatmap.tsx +1 -1
  109. package/src/charts/Sparkline.tsx +180 -18
  110. package/src/charts/box.tsx +2 -0
  111. package/src/charts/chart-box.module.css +30 -0
  112. package/src/charts/chart-box.module.css.d.ts +1 -0
  113. package/src/charts/chart-card.module.css +47 -0
  114. package/src/charts/chart-card.module.css.d.ts +7 -0
  115. package/src/charts/compile.ts +42 -9
  116. package/src/charts/host.tsx +6 -3
  117. package/src/charts/index.ts +1 -1
  118. package/src/charts/sparkline.module.css +59 -0
  119. package/src/charts/sparkline.module.css.d.ts +13 -0
  120. package/src/charts/state.tsx +44 -4
  121. package/src/charts/types.ts +6 -0
  122. package/src/controls/sync-button.tsx +3 -0
  123. package/src/dashboard/bar-list.module.css +77 -2
  124. package/src/dashboard/bar-list.module.css.d.ts +1 -0
  125. package/src/dashboard/bar-list.tsx +86 -18
  126. package/src/dashboard/delta-badge.tsx +21 -5
  127. package/src/dashboard/index.ts +2 -0
  128. package/src/dashboard/meter-model.ts +35 -0
  129. package/src/dashboard/meter-parts.tsx +119 -23
  130. package/src/dashboard/meter.module.css +90 -12
  131. package/src/dashboard/meter.module.css.d.ts +5 -0
  132. package/src/dashboard/meter.tsx +26 -2
  133. package/src/dashboard/query-state.tsx +28 -19
  134. package/src/dashboard/settings-section.tsx +1 -8
  135. package/src/dashboard/stat-card-parts.tsx +1 -1
  136. package/src/dashboard/stat-card.module.css +15 -7
  137. package/src/dashboard/stat-card.tsx +5 -8
  138. package/src/dashboard/stat-group.tsx +19 -8
  139. package/src/dashboard/stat-strip.module.css +208 -0
  140. package/src/dashboard/stat-strip.module.css.d.ts +28 -0
  141. package/src/dashboard/stat-strip.tsx +183 -0
  142. package/src/dashboard/widget-header.module.css +10 -6
  143. package/src/dashboard/widget-header.tsx +3 -3
  144. package/src/format/date.ts +6 -3
  145. package/src/format/shared.ts +11 -2
  146. package/src/guard/index.ts +1 -1
  147. package/src/index.ts +7 -0
  148. package/src/styles.css +6 -0
  149. package/src/theme/__snapshots__/plain-theme.test.ts.snap +168 -24
  150. package/src/theme/card-inset.module.css +76 -0
  151. package/src/theme/card-inset.module.css.d.ts +9 -0
  152. package/src/theme/controls.module.css +3 -0
  153. package/src/theme/index.ts +30 -0
  154. package/src/theme/nav-link.module.css +8 -10
  155. package/src/theme/status-dot.tsx +17 -5
  156. package/src/theme/status-verdict.module.css +4 -2
  157. package/src/theme/status-verdict.tsx +9 -4
@@ -1,19 +1,31 @@
1
1
  /**
2
2
  * `StatusDot` — the one status mark: a 6px round dot that carries a colour and nothing else. It is
3
3
  * decoration (`aria-hidden`); the meaning always travels as a word beside it (`StatusVerdict`), so a
4
- * verdict is never colour alone. INTERNAL: not on any barrel.
4
+ * verdict is never colour alone. Exported from the root.
5
+ *
6
+ * @example
7
+ * <StatusDot color={VX.status.ok} />
5
8
  */
6
9
  import type { CSSProperties } from 'react'
10
+ import { cx } from '../common/props'
11
+ import type { BasaltProps } from '../common/props'
7
12
  import classes from './status-dot.module.css'
8
13
 
9
- export type StatusDotProps = {
14
+ export type StatusDotProps = BasaltProps & {
10
15
  /** Any CSS colour; callers pass a `VX.status.*` token so it re-resolves per scheme. */
11
16
  color: string
12
17
  }
13
18
 
14
19
  type DotStyle = CSSProperties & { '--basalt-status-dot': string }
15
20
 
16
- export function StatusDot({ color }: StatusDotProps) {
17
- const style: DotStyle = { '--basalt-status-dot': color }
18
- return <span className={classes.dot} data-basalt-status-dot="" aria-hidden="true" style={style} />
21
+ export function StatusDot({ color, className, style }: StatusDotProps) {
22
+ const merged: DotStyle = { ...style, '--basalt-status-dot': color }
23
+ return (
24
+ <span
25
+ className={cx(classes.dot, className)}
26
+ data-basalt-status-dot=""
27
+ aria-hidden="true"
28
+ style={merged}
29
+ />
30
+ )
19
31
  }
@@ -1,11 +1,13 @@
1
1
  /* A status dot plus its word: the dot carries the colour, the word is muted ink. `flex: none` keeps
2
- * it whole when a neighbouring caption or title truncates. */
2
+ * it whole when a neighbouring caption or title truncates. The word is the proportional sans, at the
3
+ * micro size: it is a sentence fragment ("Blocked · Waits on the API change"), not an UPPERCASE
4
+ * caption, so it never takes the mono. */
3
5
  .verdict {
4
6
  display: inline-flex;
5
7
  flex: none;
6
8
  align-items: center;
7
9
  gap: 5px;
8
- font-family: var(--basalt-font-mono);
10
+ font-family: var(--basalt-font-sans);
9
11
  font-size: var(--vx-text-micro);
10
12
  color: var(--vx-muted);
11
13
  }
@@ -1,12 +1,17 @@
1
1
  /**
2
2
  * `StatusVerdict` — a `StatusDot` plus its word in muted ink. With `phrase`, the visible word is
3
3
  * hidden from assistive tech and the full phrase is read instead, so a screen reader never hears a
4
- * bare "Over". INTERNAL: not on any barrel; `StatCard` and the notification centre compose it.
4
+ * bare "Over". Exported from the root; `StatCard` and the notification centre compose it.
5
+ *
6
+ * @example
7
+ * <StatusVerdict color={VX.status.error} word="Over" phrase="Over budget" />
5
8
  */
9
+ import { cx } from '../common/props'
10
+ import type { BasaltProps } from '../common/props'
6
11
  import { StatusDot } from './status-dot'
7
12
  import classes from './status-verdict.module.css'
8
13
 
9
- export type StatusVerdictProps = {
14
+ export type StatusVerdictProps = BasaltProps & {
10
15
  color: string
11
16
  /** The short visible word ("Over", "Error"). */
12
17
  word: string
@@ -14,9 +19,9 @@ export type StatusVerdictProps = {
14
19
  phrase?: string
15
20
  }
16
21
 
17
- export function StatusVerdict({ color, word, phrase }: StatusVerdictProps) {
22
+ export function StatusVerdict({ color, word, phrase, className, style }: StatusVerdictProps) {
18
23
  return (
19
- <span className={classes.verdict}>
24
+ <span className={cx(classes.verdict, className)} {...(style !== undefined && { style })}>
20
25
  <StatusDot color={color} />
21
26
  <span data-verdict-word="" {...(phrase !== undefined && { 'aria-hidden': true })}>
22
27
  {word}