@nvidia/foundations-css 0.0.0-stage → 1.25.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 (306) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE.md +203 -0
  3. package/NOTICE.md +62 -0
  4. package/README.md +61 -2
  5. package/dist/base/a11y.css +1 -0
  6. package/dist/base/all.js +1225 -0
  7. package/dist/base/anchor.css +1 -0
  8. package/dist/base/base-external.css +15 -0
  9. package/dist/base/base-for-aem-only.css +15 -0
  10. package/dist/base/base.css +15 -0
  11. package/dist/base/fonts-external.css +1 -0
  12. package/dist/base/fonts.css +1 -0
  13. package/dist/base/icons.css +15 -0
  14. package/dist/base/motion.css +1 -0
  15. package/dist/base/reset.css +1 -0
  16. package/dist/base/theme-dark.css +1 -0
  17. package/dist/base/theme-density.css +1 -0
  18. package/dist/base/theme-light.css +1 -0
  19. package/dist/base/theme-only-dark.css +1 -0
  20. package/dist/base/top-layer-reset.css +1 -0
  21. package/dist/base/variables.css +1 -0
  22. package/dist/components/accordion.css +1 -0
  23. package/dist/components/all.css +1 -0
  24. package/dist/components/all.js +16789 -0
  25. package/dist/components/anchor.css +1 -0
  26. package/dist/components/animated-chevron.css +1 -0
  27. package/dist/components/app-bar.css +1 -0
  28. package/dist/components/attachment.css +1 -0
  29. package/dist/components/audio.css +1 -0
  30. package/dist/components/autocomplete.css +1 -0
  31. package/dist/components/avatar-group.css +1 -0
  32. package/dist/components/avatar.css +1 -0
  33. package/dist/components/badge.css +1 -0
  34. package/dist/components/banner.css +1 -0
  35. package/dist/components/block.css +1 -0
  36. package/dist/components/breadcrumbs.css +1 -0
  37. package/dist/components/button.css +1 -0
  38. package/dist/components/card.css +1 -0
  39. package/dist/components/carousel.css +1 -0
  40. package/dist/components/chat-bubble.css +1 -0
  41. package/dist/components/checkbox.css +1 -0
  42. package/dist/components/code-snippet.css +1 -0
  43. package/dist/components/collapsible.css +1 -0
  44. package/dist/components/combobox.css +1 -0
  45. package/dist/components/command.css +1 -0
  46. package/dist/components/context-menu.css +1 -0
  47. package/dist/components/date-picker.css +1 -0
  48. package/dist/components/divider.css +1 -0
  49. package/dist/components/dropdown.css +1 -0
  50. package/dist/components/flex.css +1 -0
  51. package/dist/components/form-field.css +1 -0
  52. package/dist/components/grid-item.css +1 -0
  53. package/dist/components/grid.css +1 -0
  54. package/dist/components/group.css +1 -0
  55. package/dist/components/halo.css +1 -0
  56. package/dist/components/hero.css +1 -0
  57. package/dist/components/horizontal-nav.css +1 -0
  58. package/dist/components/hover-card.css +1 -0
  59. package/dist/components/inline-notice.css +1 -0
  60. package/dist/components/input-shell.css +1 -0
  61. package/dist/components/jump-nav.css +1 -0
  62. package/dist/components/kbd.css +1 -0
  63. package/dist/components/key-value-editor.css +1 -0
  64. package/dist/components/key-value-group.css +1 -0
  65. package/dist/components/label.css +1 -0
  66. package/dist/components/legend.css +1 -0
  67. package/dist/components/list.css +1 -0
  68. package/dist/components/menu-bar.css +1 -0
  69. package/dist/components/menu.css +1 -0
  70. package/dist/components/meter.css +1 -0
  71. package/dist/components/modal.css +1 -0
  72. package/dist/components/notification.css +1 -0
  73. package/dist/components/otp-input.css +1 -0
  74. package/dist/components/page-header.css +1 -0
  75. package/dist/components/pagination.css +1 -0
  76. package/dist/components/panel.css +1 -0
  77. package/dist/components/popover.css +1 -0
  78. package/dist/components/primitive.css +1 -0
  79. package/dist/components/progress-bar.css +1 -0
  80. package/dist/components/radio-group.css +1 -0
  81. package/dist/components/range-slider.css +1 -0
  82. package/dist/components/rating.css +1 -0
  83. package/dist/components/reaction-group.css +1 -0
  84. package/dist/components/resizable.css +1 -0
  85. package/dist/components/segmented-control.css +1 -0
  86. package/dist/components/segmented-meter.css +1 -0
  87. package/dist/components/select.css +1 -0
  88. package/dist/components/severity.css +1 -0
  89. package/dist/components/side-panel.css +1 -0
  90. package/dist/components/skeleton.css +1 -0
  91. package/dist/components/slider.css +1 -0
  92. package/dist/components/spinner.css +1 -0
  93. package/dist/components/status-indicator.css +1 -0
  94. package/dist/components/status-message.css +1 -0
  95. package/dist/components/stepper.css +1 -0
  96. package/dist/components/switch.css +1 -0
  97. package/dist/components/table.css +1 -0
  98. package/dist/components/tabs.css +1 -0
  99. package/dist/components/tag-group.css +1 -0
  100. package/dist/components/tag.css +1 -0
  101. package/dist/components/terminal-line.css +1 -0
  102. package/dist/components/text-area.css +1 -0
  103. package/dist/components/text-content.css +1 -0
  104. package/dist/components/text.css +1 -0
  105. package/dist/components/toast.css +1 -0
  106. package/dist/components/toaster.css +1 -0
  107. package/dist/components/toggle-button-group.css +1 -0
  108. package/dist/components/toggle-button.css +1 -0
  109. package/dist/components/tooltip.css +1 -0
  110. package/dist/components/tree-nav.css +1 -0
  111. package/dist/components/upload.css +1 -0
  112. package/dist/components/vertical-nav.css +1 -0
  113. package/dist/css-sizes.js +1289 -0
  114. package/dist/index.cjs +3049 -0
  115. package/dist/index.d.cts +27 -0
  116. package/dist/index.d.ts +27 -0
  117. package/dist/index.js +3022 -0
  118. package/dist/plugins/tailwind-theme.css +505 -0
  119. package/dist/plugins/tailwind3-theme.js +683 -0
  120. package/dist/plugins/variables-sass.sass +415 -0
  121. package/dist/themes/kui11/_theme-selectors.css +1 -0
  122. package/dist/themes/kui11/accordion.css +1 -0
  123. package/dist/themes/kui11/app-bar.css +1 -0
  124. package/dist/themes/kui11/avatar.css +1 -0
  125. package/dist/themes/kui11/badge.css +1 -0
  126. package/dist/themes/kui11/banner.css +1 -0
  127. package/dist/themes/kui11/base.css +1 -0
  128. package/dist/themes/kui11/breadcrumbs.css +1 -0
  129. package/dist/themes/kui11/button.css +1 -0
  130. package/dist/themes/kui11/card.css +1 -0
  131. package/dist/themes/kui11/checkbox.css +1 -0
  132. package/dist/themes/kui11/components.css +1 -0
  133. package/dist/themes/kui11/date-picker.css +1 -0
  134. package/dist/themes/kui11/form-field.css +1 -0
  135. package/dist/themes/kui11/hero.css +1 -0
  136. package/dist/themes/kui11/horizontal-nav.css +1 -0
  137. package/dist/themes/kui11/input-shell.css +1 -0
  138. package/dist/themes/kui11/label.css +1 -0
  139. package/dist/themes/kui11/menu.css +1 -0
  140. package/dist/themes/kui11/modal.css +1 -0
  141. package/dist/themes/kui11/notification.css +1 -0
  142. package/dist/themes/kui11/page-header.css +1 -0
  143. package/dist/themes/kui11/pagination.css +1 -0
  144. package/dist/themes/kui11/popover.css +1 -0
  145. package/dist/themes/kui11/progress-bar.css +1 -0
  146. package/dist/themes/kui11/radio-group.css +1 -0
  147. package/dist/themes/kui11/range-slider.css +1 -0
  148. package/dist/themes/kui11/side-panel.css +1 -0
  149. package/dist/themes/kui11/slider.css +1 -0
  150. package/dist/themes/kui11/spinner.css +1 -0
  151. package/dist/themes/kui11/status-message.css +1 -0
  152. package/dist/themes/kui11/switch.css +1 -0
  153. package/dist/themes/kui11/table.css +1 -0
  154. package/dist/themes/kui11/tabs.css +1 -0
  155. package/dist/themes/kui11/tag.css +1 -0
  156. package/dist/themes/kui11/text-area.css +1 -0
  157. package/dist/themes/kui11/text-input.css +1 -0
  158. package/dist/themes/kui11/text.css +1 -0
  159. package/dist/themes/kui11/toast.css +1 -0
  160. package/dist/themes/kui11/tooltip.css +1 -0
  161. package/dist/themes/kui11/vertical-nav.css +1 -0
  162. package/dist/themes/kui11.base.css +1 -0
  163. package/dist/themes/kui11.base.js +935 -0
  164. package/dist/themes/kui11.components.css +1 -0
  165. package/dist/themes/kui11.components.js +2564 -0
  166. package/dist/themes/kui11.css +1 -0
  167. package/dist/themes/theme-partials.js +458 -0
  168. package/dist/utilities/all.js +442 -0
  169. package/dist/utilities/typography-utils.css +1 -0
  170. package/package.json +106 -3
  171. package/scripts/sync-skills.mjs +237 -0
  172. package/skills/kaizen-ui-html-css/SKILL.md +295 -0
  173. package/skills/kaizen-ui-html-css/assets/color-primitives-hex.md +141 -0
  174. package/skills/kaizen-ui-html-css/references/blocks/chat-input.md +94 -0
  175. package/skills/kaizen-ui-html-css/references/blocks/notification-center.md +320 -0
  176. package/skills/kaizen-ui-html-css/references/blocks/timeline.md +579 -0
  177. package/skills/kaizen-ui-html-css/references/components/Accordion.md +88 -0
  178. package/skills/kaizen-ui-html-css/references/components/Anchor.md +29 -0
  179. package/skills/kaizen-ui-html-css/references/components/AnimatedChevron.md +31 -0
  180. package/skills/kaizen-ui-html-css/references/components/AppBar.md +129 -0
  181. package/skills/kaizen-ui-html-css/references/components/Attachment.md +306 -0
  182. package/skills/kaizen-ui-html-css/references/components/Audio.md +21 -0
  183. package/skills/kaizen-ui-html-css/references/components/Autocomplete.md +29 -0
  184. package/skills/kaizen-ui-html-css/references/components/Avatar.md +28 -0
  185. package/skills/kaizen-ui-html-css/references/components/AvatarGroup.md +38 -0
  186. package/skills/kaizen-ui-html-css/references/components/Badge.md +121 -0
  187. package/skills/kaizen-ui-html-css/references/components/Banner.md +49 -0
  188. package/skills/kaizen-ui-html-css/references/components/Block.md +26 -0
  189. package/skills/kaizen-ui-html-css/references/components/Breadcrumbs.md +42 -0
  190. package/skills/kaizen-ui-html-css/references/components/Button.md +43 -0
  191. package/skills/kaizen-ui-html-css/references/components/ButtonGroup.md +32 -0
  192. package/skills/kaizen-ui-html-css/references/components/Card.md +39 -0
  193. package/skills/kaizen-ui-html-css/references/components/Carousel.md +53 -0
  194. package/skills/kaizen-ui-html-css/references/components/ChatBubble.md +28 -0
  195. package/skills/kaizen-ui-html-css/references/components/Checkbox.md +32 -0
  196. package/skills/kaizen-ui-html-css/references/components/CodeSnippet.md +33 -0
  197. package/skills/kaizen-ui-html-css/references/components/Collapsible.md +56 -0
  198. package/skills/kaizen-ui-html-css/references/components/Combobox.md +66 -0
  199. package/skills/kaizen-ui-html-css/references/components/Command.md +100 -0
  200. package/skills/kaizen-ui-html-css/references/components/ContextMenu.md +61 -0
  201. package/skills/kaizen-ui-html-css/references/components/DatePicker.md +30 -0
  202. package/skills/kaizen-ui-html-css/references/components/Divider.md +77 -0
  203. package/skills/kaizen-ui-html-css/references/components/Dropdown.md +94 -0
  204. package/skills/kaizen-ui-html-css/references/components/Flex.md +33 -0
  205. package/skills/kaizen-ui-html-css/references/components/FormField.md +35 -0
  206. package/skills/kaizen-ui-html-css/references/components/Grid.md +27 -0
  207. package/skills/kaizen-ui-html-css/references/components/Group.md +92 -0
  208. package/skills/kaizen-ui-html-css/references/components/Halo.md +26 -0
  209. package/skills/kaizen-ui-html-css/references/components/Hero.md +29 -0
  210. package/skills/kaizen-ui-html-css/references/components/HorizontalNav.md +34 -0
  211. package/skills/kaizen-ui-html-css/references/components/HoverCard.md +23 -0
  212. package/skills/kaizen-ui-html-css/references/components/Inline.md +49 -0
  213. package/skills/kaizen-ui-html-css/references/components/InlineNotice.md +96 -0
  214. package/skills/kaizen-ui-html-css/references/components/InputShell.md +26 -0
  215. package/skills/kaizen-ui-html-css/references/components/JumpNav.md +36 -0
  216. package/skills/kaizen-ui-html-css/references/components/Kbd.md +32 -0
  217. package/skills/kaizen-ui-html-css/references/components/KeyValueEditor.md +275 -0
  218. package/skills/kaizen-ui-html-css/references/components/KeyValueGroup.md +35 -0
  219. package/skills/kaizen-ui-html-css/references/components/Label.md +86 -0
  220. package/skills/kaizen-ui-html-css/references/components/Legend.md +148 -0
  221. package/skills/kaizen-ui-html-css/references/components/List.md +143 -0
  222. package/skills/kaizen-ui-html-css/references/components/Menu.md +103 -0
  223. package/skills/kaizen-ui-html-css/references/components/MenuBar.md +91 -0
  224. package/skills/kaizen-ui-html-css/references/components/Meter.md +27 -0
  225. package/skills/kaizen-ui-html-css/references/components/Modal.md +60 -0
  226. package/skills/kaizen-ui-html-css/references/components/Notification.md +48 -0
  227. package/skills/kaizen-ui-html-css/references/components/NumberInput.md +15 -0
  228. package/skills/kaizen-ui-html-css/references/components/OtpInput.md +51 -0
  229. package/skills/kaizen-ui-html-css/references/components/PageHeader.md +61 -0
  230. package/skills/kaizen-ui-html-css/references/components/Pagination.md +63 -0
  231. package/skills/kaizen-ui-html-css/references/components/Panel.md +133 -0
  232. package/skills/kaizen-ui-html-css/references/components/Popover.md +31 -0
  233. package/skills/kaizen-ui-html-css/references/components/ProgressBar.md +187 -0
  234. package/skills/kaizen-ui-html-css/references/components/RadioGroup.md +32 -0
  235. package/skills/kaizen-ui-html-css/references/components/RangeSlider.md +62 -0
  236. package/skills/kaizen-ui-html-css/references/components/Rating.md +69 -0
  237. package/skills/kaizen-ui-html-css/references/components/ReactionGroup.md +30 -0
  238. package/skills/kaizen-ui-html-css/references/components/Resizable.md +31 -0
  239. package/skills/kaizen-ui-html-css/references/components/SegmentedControl.md +36 -0
  240. package/skills/kaizen-ui-html-css/references/components/SegmentedMeter.md +200 -0
  241. package/skills/kaizen-ui-html-css/references/components/Select.md +39 -0
  242. package/skills/kaizen-ui-html-css/references/components/Severity.md +25 -0
  243. package/skills/kaizen-ui-html-css/references/components/SidePanel.md +42 -0
  244. package/skills/kaizen-ui-html-css/references/components/Skeleton.md +24 -0
  245. package/skills/kaizen-ui-html-css/references/components/Slider.md +32 -0
  246. package/skills/kaizen-ui-html-css/references/components/Spinner.md +63 -0
  247. package/skills/kaizen-ui-html-css/references/components/Stack.md +17 -0
  248. package/skills/kaizen-ui-html-css/references/components/StatusIndicator.md +30 -0
  249. package/skills/kaizen-ui-html-css/references/components/StatusMessage.md +78 -0
  250. package/skills/kaizen-ui-html-css/references/components/Stepper.md +57 -0
  251. package/skills/kaizen-ui-html-css/references/components/Switch.md +96 -0
  252. package/skills/kaizen-ui-html-css/references/components/Table.md +566 -0
  253. package/skills/kaizen-ui-html-css/references/components/Tabs.md +67 -0
  254. package/skills/kaizen-ui-html-css/references/components/Tag.md +194 -0
  255. package/skills/kaizen-ui-html-css/references/components/TagGroup.md +32 -0
  256. package/skills/kaizen-ui-html-css/references/components/TerminalLine.md +69 -0
  257. package/skills/kaizen-ui-html-css/references/components/Text.md +27 -0
  258. package/skills/kaizen-ui-html-css/references/components/TextArea.md +28 -0
  259. package/skills/kaizen-ui-html-css/references/components/TextContent.md +61 -0
  260. package/skills/kaizen-ui-html-css/references/components/TextInput.md +29 -0
  261. package/skills/kaizen-ui-html-css/references/components/TimeInput.md +17 -0
  262. package/skills/kaizen-ui-html-css/references/components/Toast.md +41 -0
  263. package/skills/kaizen-ui-html-css/references/components/Toaster.md +19 -0
  264. package/skills/kaizen-ui-html-css/references/components/ToggleButton.md +47 -0
  265. package/skills/kaizen-ui-html-css/references/components/ToggleButtonGroup.md +29 -0
  266. package/skills/kaizen-ui-html-css/references/components/Tooltip.md +45 -0
  267. package/skills/kaizen-ui-html-css/references/components/TreeNav.md +58 -0
  268. package/skills/kaizen-ui-html-css/references/components/Upload.md +90 -0
  269. package/skills/kaizen-ui-html-css/references/components/VerticalNav.md +65 -0
  270. package/skills/kaizen-ui-html-css/references/design-tokens/CHART_DATA_COLORS.md +56 -0
  271. package/skills/kaizen-ui-html-css/references/design-tokens/COLORS.md +148 -0
  272. package/skills/kaizen-ui-html-css/references/design-tokens/COLOR_PRIMITIVES.md +31 -0
  273. package/skills/kaizen-ui-html-css/references/design-tokens/EFFECTS_AND_LAYOUT.md +50 -0
  274. package/skills/kaizen-ui-html-css/references/design-tokens/SPACING_SCALE.md +36 -0
  275. package/skills/kaizen-ui-html-css/references/design-tokens/TYPOGRAPHY.md +44 -0
  276. package/skills/kaizen-ui-html-css/references/guides/CONFIGURATION.md +42 -0
  277. package/skills/kaizen-ui-html-css/references/guides/HTML_STRUCTURE.md +134 -0
  278. package/skills/kaizen-ui-html-css/references/patterns/activity-feed.md +132 -0
  279. package/skills/kaizen-ui-html-css/references/patterns/confirmations.md +133 -0
  280. package/skills/kaizen-ui-html-css/references/patterns/data-display.md +127 -0
  281. package/skills/kaizen-ui-html-css/references/patterns/data-visualization.md +73 -0
  282. package/skills/kaizen-ui-html-css/references/patterns/element-visibility.md +83 -0
  283. package/skills/kaizen-ui-html-css/references/patterns/empty-states.md +116 -0
  284. package/skills/kaizen-ui-html-css/references/patterns/entity-cards.md +172 -0
  285. package/skills/kaizen-ui-html-css/references/patterns/error-states.md +163 -0
  286. package/skills/kaizen-ui-html-css/references/patterns/feedback.md +77 -0
  287. package/skills/kaizen-ui-html-css/references/patterns/filters.md +167 -0
  288. package/skills/kaizen-ui-html-css/references/patterns/forms.md +215 -0
  289. package/skills/kaizen-ui-html-css/references/patterns/key-value-display.md +195 -0
  290. package/skills/kaizen-ui-html-css/references/patterns/loading.md +104 -0
  291. package/skills/kaizen-ui-html-css/references/patterns/navigation.md +154 -0
  292. package/skills/kaizen-ui-html-css/references/patterns/ranked-lists.md +60 -0
  293. package/skills/kaizen-ui-html-css/references/patterns/search.md +46 -0
  294. package/skills/kaizen-ui-html-css/references/patterns/settings.md +106 -0
  295. package/skills/kaizen-ui-html-css/references/patterns/stat-blocks.md +71 -0
  296. package/skills/kaizen-ui-html-css/references/templates/browse-page.md +92 -0
  297. package/skills/kaizen-ui-html-css/references/templates/dashboard.md +356 -0
  298. package/skills/kaizen-ui-html-css/references/templates/detail-page.md +424 -0
  299. package/skills/kaizen-ui-html-css/references/templates/detail-placement.md +68 -0
  300. package/skills/kaizen-ui-html-css/references/templates/error-page.md +82 -0
  301. package/skills/kaizen-ui-html-css/references/templates/form-page.md +256 -0
  302. package/skills/kaizen-ui-html-css/references/templates/layout-principles.md +152 -0
  303. package/skills/kaizen-ui-html-css/references/templates/list-view.md +229 -0
  304. package/skills/kaizen-ui-html-css/references/templates/page-modification.md +33 -0
  305. package/skills/kaizen-ui-html-css/references/templates/page-shell.md +225 -0
  306. package/skills/kaizen-ui-html-css/references/templates/workspace-page.md +427 -0
@@ -0,0 +1,134 @@
1
+ # HTML structure
2
+
3
+ KUI component classes style native HTML. A class changes appearance only, so the markup underneath it has to carry every meaning the component implies.
4
+
5
+ ## Choose the element first
6
+
7
+ Decide which element owns the behavior, then apply the classes:
8
+
9
+ ```html
10
+ <button
11
+ type="submit"
12
+ name="intent"
13
+ value="save"
14
+ class="nv-button nv-button--kind-primary"
15
+ >
16
+ Save
17
+ </button>
18
+
19
+ <a href="/models" class="nv-button nv-button--kind-secondary">Browse models</a>
20
+ ```
21
+
22
+ The same component class works on either element. Pick `button` for an action and `a` for navigation — the class does not make that decision, and a `div` with `nv-button` is not focusable, not keyboard operable, and not announced as a control.
23
+
24
+ ## Element and modifier classes
25
+
26
+ Each component has one or more element classes plus modifier classes for its variants. Both go on the same element, and a modifier without its element class does nothing:
27
+
28
+ ```html
29
+ <span class="nv-tag nv-tag--color-green">Running</span>
30
+ ```
31
+
32
+ Multi-part components apply their element classes to the matching parts of the structure:
33
+
34
+ ```html
35
+ <div class="nv-card-root">
36
+ <div class="nv-card-content">
37
+ <h3>Llama 3.1 405B</h3>
38
+ <p>Instruction-tuned text generation.</p>
39
+ </div>
40
+ </div>
41
+ ```
42
+
43
+ Each component reference lists its element classes and modifier groups. Read it before writing the markup rather than inferring a class name from a pattern.
44
+
45
+ ## Layout primitives and spacing
46
+
47
+ `Block`, `Flex`, `Grid`, `Inline`, and `Stack` share one spacing scale that no single component reference owns:
48
+
49
+ - A gap class such as `nv-primitive--gap-4` or `nv-primitive--gap-density-md` sets `gap` on a flex or grid container.
50
+ - A spacing class such as `nv-primitive--spacing-4` or `nv-primitive--spacing-density-md` sets padding.
51
+
52
+ Both take the same size suffix: a step on the numeric scale — `0`, `px`, `1` through `12`, then `14`, `16`, `18`, `20`, `24`, `28`, `32`, `36`, `40`, `44`, `48`, `52`, `56`, `60`, `64`, `72`, `80`, `96` — or a density step, written `density-` plus `xxs`, `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl`, or `5xl`. Prefer the density steps so spacing tracks the active theme.
53
+
54
+ ```html
55
+ <div class="nv-flex nv-flex--direction-col nv-primitive--gap-density-md">
56
+ <div>First</div>
57
+ <div>Second</div>
58
+ </div>
59
+ ```
60
+
61
+ `Grid` takes its track definition from custom properties rather than a class:
62
+
63
+ ```html
64
+ <div
65
+ class="nv-grid nv-primitive--gap-density-md"
66
+ style="--nv-grid-template-columns: repeat(3, minmax(0, 1fr))"
67
+ >
68
+ <div>One</div>
69
+ <div>Two</div>
70
+ <div>Three</div>
71
+ </div>
72
+ ```
73
+
74
+ For page-level structure, plain CSS against the token variables is usually clearer than stacking primitives.
75
+
76
+ ## Form controls
77
+
78
+ Keep the label, control, description, and validation state in the markup, wired by `id`:
79
+
80
+ ```html
81
+ <div class="nv-form-field-root">
82
+ <div class="nv-form-field-content-group">
83
+ <div class="nv-form-field-label-group">
84
+ <label for="email" class="nv-label">Email</label>
85
+ </div>
86
+ <div class="nv-input-shell">
87
+ <input
88
+ id="email"
89
+ name="email"
90
+ type="email"
91
+ required
92
+ aria-describedby="email-help"
93
+ />
94
+ </div>
95
+ </div>
96
+ <p id="email-help" class="nv-form-field-helper">Use your work email.</p>
97
+ </div>
98
+ ```
99
+
100
+ Keep the label group and the input shell together inside `nv-form-field-content-group`. The stylesheet aligns the label against the shell through that wrapper, and the left-label modifier targets it, so a field that omits it loses both.
101
+
102
+ The control inside the shell stays bare — the shell styles its own input. `required`, `type`, `name`, and `aria-describedby` drive validation, submitted values, and the accessible description. No stylesheet supplies them.
103
+
104
+ ## State
105
+
106
+ The stylesheets target native state and the documented state attributes, so express state on the element rather than inventing a class:
107
+
108
+ - `disabled` on a control, and `aria-disabled` where the element must stay focusable
109
+ - `aria-expanded` on a trigger that opens a menu, popover, or disclosure
110
+ - `aria-current` on the active navigation item
111
+ - `data-state` where a component reference documents it, for example `data-state="open"`
112
+ - `:hover`, `:focus-visible`, and `:active` are already styled — do not add classes for them
113
+
114
+ ## Behavior you have to supply
115
+
116
+ There is no component runtime here. Anything beyond static appearance is yours to implement and test:
117
+
118
+ - opening, closing, and positioning menus, popovers, tooltips, and side panels
119
+ - focus movement into and out of a dialog, and returning focus on close
120
+ - arrow-key navigation for tabs, menus, and tree navigation
121
+ - announcing toasts and other live updates
122
+ - pagination, filtering, sorting, and selection state
123
+
124
+ Prefer a native element that already does the work — `details`/`summary` for disclosure, `dialog` for modals, `select` for single-choice menus — before scripting a substitute.
125
+
126
+ ## Verification
127
+
128
+ For interactive and form markup, check:
129
+
130
+ - element semantics and accessible names
131
+ - keyboard access, focus order, and visible focus
132
+ - form submission, validation, and submitted values
133
+ - light and dark themes
134
+ - that every affordance the design implies actually works
@@ -0,0 +1,132 @@
1
+ # Activity Feed
2
+
3
+ A chronological list of actor → action → target events, rendered along a vertical timeline spine.
4
+
5
+ For a runnable example with queued live updates, use [timeline.md](../blocks/timeline.md).
6
+
7
+ ## When to use
8
+
9
+ Use an activity feed when:
10
+
11
+ - A history of actions, events, or changes needs to be visible to the user
12
+ - The content is chronological — newer events are more relevant than older
13
+ - Users need to monitor, review, or act on events that have occurred
14
+ - Multiple actors or systems generate activity over time
15
+
16
+ Don't use when:
17
+
18
+ - The data is better represented as a table (structured logs with many sortable/filterable columns). See [data-display.md](./data-display.md) — pick a table when the primary task is sorting/filtering across many columns; pick this feed when the primary task is reading a narrative history. (data-display also lists "audit logs" as a candidate for a collapsible section — that's only for _secondary, tucked-away_ history; a primary activity/history surface uses this pattern.)
19
+ - The content is not chronological
20
+ - There's a single actor and no collaboration or system events to track
21
+ - The items are the user's own recent notifications, checked from the app bar. Use [notification-center.md](../blocks/notification-center.md).
22
+
23
+ **Placement on a detail/workspace page:** history and activity outgrow a side panel. Put the feed on a full page or History/Activity tab. See [detail-placement.md](../templates/detail-placement.md). Timelines flow sequentially, so avoid an extra visual container around the entire feed.
24
+
25
+ ## Anatomy
26
+
27
+ Each entry is composed of required parts plus optional parts included when applicable.
28
+
29
+ ### Required
30
+
31
+ | Part | Purpose | Notes |
32
+ | --- | --- | --- |
33
+ | **Actor marker** | Who or what performed the action | [`Avatar`](../components/Avatar.md) + name for users; [StatusIndicator](../components/StatusIndicator.md) for system events. See [Composition rules → Status indicator](#status-indicator-dot-not-icon). |
34
+ | **Action** | What happened | Natural language: "left a comment in", "completed backup", "training failed" |
35
+ | **Meta line** | When + where | Single text-secondary line: `timestamp · source` (e.g., "Apr 28, 2026, 8:30 AM · System"). Relative time for events < 24hrs ago i.e. ("2 hours ago"), absolute timestamp otherwise |
36
+ | **Target link** | Navigable context | What the action was performed on, rendered as an [`Anchor`](../components/Anchor.md) to the relevant item |
37
+
38
+ ### Optional
39
+
40
+ Include when applicable.
41
+
42
+ | Part | Include when |
43
+ | --- | --- |
44
+ | **Detail body** | 1–2 lines explaining implication or auto-action ("Automation opened ticket NV-44102; rack isolated.") |
45
+ | **Detail metrics** | Quantitative details immediately useful without clicking in ("Size: 23 GB", "Duration: 4m 32s") |
46
+ | **Progress indicator** | Event relates to a measurable state with a threshold or capacity (memory at 87%) |
47
+ | **Error message** | Event is a failure and the user needs the cause |
48
+ | **Tags** | Event needs categorization or identifiers cross-reference other systems |
49
+ | **Inline actions** | User commonly needs to respond immediately ("Retry", "View Details", "Dismiss") |
50
+
51
+ ---
52
+
53
+ ## Variants
54
+
55
+ | Variant | Marker | Use when |
56
+ | --- | --- | --- |
57
+ | **User activity** | Avatar + name | Tracks actions performed by people |
58
+ | **System event** | Colored **status dot** | Tracks automated processes, system health, or operational events |
59
+ | **Mixed** | Both, differentiated visually | Both user and system entries belong in the same timeline |
60
+
61
+ For mixed feeds: keep entry structure consistent across types and sort chronologically regardless of type.
62
+
63
+ ---
64
+
65
+ ## Composition rules
66
+
67
+ Apply to all variants.
68
+
69
+ ### Status indicator: dot, not icon
70
+
71
+ System event entries use a medium labeled status dot, color-coded by severity. Do not add a checkmark, triangle, X, or another shape glyph.
72
+
73
+ | Severity | Color |
74
+ | --- | --- |
75
+ | Error | red |
76
+ | Warning | yellow |
77
+ | Success | green |
78
+ | Info | blue |
79
+
80
+ **Why a dot, not an icon?** A dot is the lightest possible status signal — it communicates severity through color alone, leaving the entry's text content to do the explanatory work. Icons add a second visual element (shape) that competes with the title for the eye, makes dense feeds feel cluttered, and forces a second decoding step.
81
+
82
+ The dot needs an `aria-label` describing the severity for screen-reader users (the color carries the meaning visually).
83
+
84
+ ### Timeline spine is required
85
+
86
+ A visible 1px vertical line on the left side of the entry list, connecting markers. Without it, the pattern reads as a plain list rather than a timeline.
87
+
88
+ - The status marker sits centered on the spine, over the spine rather than under it.
89
+ - The spine is **suppressed on the last entry** so the timeline visually closes.
90
+ - The marker carries severity via color + `aria-label`; the spine itself is `aria-hidden`.
91
+
92
+ **Anti-pattern:** rendering each entry as a standalone `<li>` with a leading dot and no connecting line. Without the spine, the visual chain between events is broken and the feed reads as a flat list.
93
+
94
+ ### System event entry: 3-line composition
95
+
96
+ | Line | Content | Style |
97
+ | --- | --- | --- |
98
+ | 1 | Status dot + event title | Title is `body/bold/md`. Dot sits at the same baseline as the title's first character. |
99
+ | 2 | Timestamp · Source (e.g., "Apr 28, 2026, 8:30 AM · System") | `body/regular/sm` + secondary color. The `·` separator distinguishes the two metadata items without using a comma (which reads as part of the timestamp). |
100
+ | 3 | Description body | `body/regular/sm` or `body/regular/md`. Optional but typical — explains the event's implication or auto-action. |
101
+
102
+ User-actor entries follow the same layout with the avatar replacing the dot on line 1.
103
+
104
+ ---
105
+
106
+ ## Modifiers
107
+
108
+ ### Time grouping
109
+
110
+ Group entries by time period when the feed spans multiple days or users scan for a specific period.
111
+
112
+ | Grouping | Use when |
113
+ | --- | --- |
114
+ | Today / Yesterday / [Date] | Daily activity matters |
115
+ | This Week / Last Week / [Week of Date] | Less frequent activity |
116
+ | This Month / [Month Year] | Long-running historical feeds |
117
+
118
+ Place the group heading above the first entry in that group, with clear visual hierarchy distinguishing it from entries. Skip grouping for recent-only feeds (last few hours) — chronological order with timestamps is enough.
119
+
120
+ ### Sizing
121
+
122
+ | Size | Use when |
123
+ | --- | --- |
124
+ | **Default** | Single-column reverse-chronological timeline, full container width |
125
+ | **Compact** | Sidebar/panel with limited width, high volume activity, or only essential info (actor, action, time) is needed. Omit metrics, progress, and inline actions — surface on click/expand. |
126
+ | **Expanded / detail** | Feed is primary page content, events carry significant detail (metrics, errors, progress) users need without clicking, activity volume is lower |
127
+
128
+ ### Loading and pagination
129
+
130
+ - Load most recent entries first (newest at top)
131
+ - Use infinite scroll or a "Load more" button for older entries rather than numbered pagination
132
+ - For live updates: show a "New activity" indicator at the top rather than auto-pushing content down (auto-push disorients the user's reading position)
@@ -0,0 +1,133 @@
1
+ # Confirmations
2
+
3
+ A confirmation turns a click that _might_ have been accidental into one that is _certainly_ intentional — without slowing down actions that don't need it. Friction must match consequence: confirming everything trains users to dismiss confirmations reflexively; confirming nothing makes accidents irreversible.
4
+
5
+ ## When to use
6
+
7
+ **The reversibility test is the gate.** If "oops" can be fixed by clicking Undo or re-running the action, it's reversible. If "oops" needs a support ticket or a backup restore, it's irreversible. Reversibility picks the level:
8
+
9
+ | Reversibility | Level |
10
+ | --- | --- |
11
+ | **Reversible in-session** (toggle a setting, archive a draft) | Level 0 — no modal, Toast with Undo |
12
+ | **Reversible with cleanup** (move to trash, deactivate, restart/pause shared infra) | Level 1 — confirm modal |
13
+ | **Irreversible** (permanently delete, terminate, revoke) | Level 2 — type-to-confirm modal |
14
+
15
+ **Impact names, it doesn't escalate.** Affecting shared infra or other users does _not_ raise the level — a reversible action stays reversible. Name the cross-user impact in the modal body or the success toast ("Cluster restart started — affects 4 active deployments") instead of forcing a stricter confirmation.
16
+
17
+ **Visibility comes first.** Only render a destructive action for a role allowed to perform it — gate the trigger per [`element-visibility.md`](./element-visibility.md) (lacks permission → hide, don't disable). Confirmation is a separate gate that applies _after_ the action is visible, not a substitute for authorization.
18
+
19
+ ---
20
+
21
+ ## Levels
22
+
23
+ Three levels of friction, plus two modifiers that layer onto Level 2.
24
+
25
+ | Level | Pattern | Friction | When |
26
+ | --- | --- | --- | --- |
27
+ | **0 — none** | Direct action + Toast with Undo | None | Reversible in-session |
28
+ | **1 — confirm** | Modal: Cancel + action button | One click | Reversible with cleanup |
29
+ | **2 — type-to-confirm** | Modal: type the entity name + Cancel + action | Type the name | Irreversible |
30
+
31
+ **Modifiers on Level 2:**
32
+
33
+ - **Bulk** — destructive action on many entities at once. Add a count + identifier list; type the count instead of a name. See [Bulk](#bulk-modifier).
34
+ - **Re-auth** — account-level, billing, or security-critical. Add a password / 2FA challenge before the action runs.
35
+
36
+ Don't skip levels in either direction: a type-to-confirm on a one-click toggle is over-friction; a bare toast on an irreversible bulk delete is under-friction.
37
+
38
+ ---
39
+
40
+ ## Anatomy
41
+
42
+ For any modal dialog (Level 1–2). Use [Modal](../components/Modal.md).
43
+
44
+ | Region | Content rule |
45
+ | --- | --- |
46
+ | **Heading** | Action verb + target. "Delete model 'llama-7b'?" not "Confirm deletion" or "Are you sure?" |
47
+ | **Body** | One sentence naming the consequence in user-task language: what's lost, what becomes inaccessible, what can't be undone. |
48
+ | **Cancel button** | Always present. Always says "Cancel" — not "No," not "Go back." |
49
+ | **Action button** | Verb + noun matching the heading: "Delete model." Color `danger` if destructive, else `brand`. |
50
+ | **Button order** | Trailing-primary: `[Cancel] [Action]` left-to-right. |
51
+ | **Initial focus** | **Cancel** for destructive actions; **Action** for non-destructive confirms. Default focus = the safer choice. |
52
+ | **Type-to-confirm input** (Level 2) | Button enables only on exact match. Show the expected value just above the input so the user can read-and-type. |
53
+
54
+ ### Body style
55
+
56
+ The body answers: _what specifically am I losing if I click through?_ Name the concrete consequence, not a generic warning. If you can't write that sentence, the action probably doesn't need a confirmation — or you don't understand the consequence.
57
+
58
+ | Bad body | Good body |
59
+ | --- | --- |
60
+ | "This action cannot be undone." | "Deleting removes the model weights and unloads it from any active deployments. This can't be undone." |
61
+ | "Are you sure you want to do this?" | "All in-progress jobs will fail and queued jobs will be cancelled. Active users will be disconnected." |
62
+
63
+ ---
64
+
65
+ ## Composition rules
66
+
67
+ ### Level 0 — Toast with Undo
68
+
69
+ The affordance is a [`Toast`](../components/Toast.md) `status="success"` with an Undo action ("Archived 3 jobs. Undo."). Undo reverses the action atomically; if reversal fails, the toast becomes an error with retry (see [`error-states.md`](./error-states.md)). Only actions with **no downstream side effects** are undoable — archiving locally is undoable; sending a message is not. After the toast dismisses, the action is permanent; don't surface a separate "undo last action" elsewhere.
70
+
71
+ ### Type-to-confirm (Level 2)
72
+
73
+ | Question | Rule |
74
+ | --- | --- |
75
+ | **What does the user type?** | The entity's name (model, cluster, workspace). Not "DELETE." Not a UUID. The name is what the user already knows. |
76
+ | **Where is the expected string shown?** | Directly above the input, in `text-secondary` or a code-style background. Read-and-type, not memorize. |
77
+ | **What enables the button?** | Exact match. Case-sensitive. Whitespace-trimmed. See [`forms.md`](./forms.md) for input validation. |
78
+ | **What if there's no name?** | Use a stable identifier the user has seen. If none exists, reconsider whether type-to-confirm fits. |
79
+
80
+ **Why the name, not "DELETE":** typing a literal word doesn't prove the user understood _what_ they're deleting. Typing "llama-7b" forces a "yes, this specific thing" moment. That moment is the point.
81
+
82
+ ### Bulk modifier
83
+
84
+ When a destructive action targets multiple selected entities:
85
+
86
+ | Aspect | Rule |
87
+ | --- | --- |
88
+ | **Heading** | Include the count: "Delete 5 clusters?" |
89
+ | **Body** | List the first 3 identifiers + "and N more"; for >10, show count and a link to the full list. |
90
+ | **Type-to-confirm** | Type the action verb + count: "delete 5". Entity names don't fit here. |
91
+ | **Action button** | "Delete 5 clusters" — match the count in the heading. |
92
+
93
+ Don't let the user deselect from inside the modal. Selection happened on the previous screen; going back to refine is the cancel path.
94
+
95
+ ### Anti-patterns
96
+
97
+ | Anti-pattern | Why it's wrong | Do this instead |
98
+ | --- | --- | --- |
99
+ | Says "cannot be undone" but… can be | Erodes trust in real warnings | Be honest: "moves to trash; restorable for 30 days" |
100
+ | Disabling Cancel during a long-running action | User has no escape if something goes wrong | Cancel stays enabled; cancellation may be best-effort but must remain a path |
101
+ | Type-to-confirm on a reversible action because it "affects shared infra" | Reversibility is the gate; impact alone doesn't justify it | Stay at the reversible level; name the impact in the body or toast |
102
+
103
+ ---
104
+
105
+ ## Inline confirmation (no modal)
106
+
107
+ For low-stakes destructive actions in dense UIs (a row delete in a table), an inline two-step confirm can replace the modal:
108
+
109
+ ```
110
+ [Delete] →click→ [Click again to confirm] ↻ [Delete]
111
+ ```
112
+
113
+ Use sparingly — only when:
114
+
115
+ - The action is reversible-with-cleanup, not truly irreversible
116
+ - The row's identity is visible (no navigating away to find it)
117
+ - The two-step button reverts after a 3–5 second timeout
118
+
119
+ **Never use inline confirm for Level 2 actions** — the button-replacement is too easy to dismiss accidentally for genuinely irreversible operations.
120
+
121
+ ---
122
+
123
+ ## Example
124
+
125
+ **Scenario:** User clicks "Delete model" on `llama-7b`. Deletion permanently removes weights and unloads from active deployments.
126
+
127
+ 1. Reversibility → irreversible → **Level 2** (type-to-confirm).
128
+ 2. The active deployments are cross-user impact → **named in the body**, not escalated. Single entity → no bulk modifier.
129
+ 3. Modal:
130
+ - Heading: "Delete model 'llama-7b'?"
131
+ - Body: "Deleting removes the model weights and unloads it from any active deployments (currently 3). Active inference requests will fail. This can't be undone."
132
+ - Type-to-confirm: input labeled "Type 'llama-7b' to confirm"; button disabled until exact match
133
+ - Buttons: `[Cancel] [Delete model]`, trailing-primary, `danger` on Delete
@@ -0,0 +1,127 @@
1
+ # Data Display
2
+
3
+ Rules for presenting collections of structured data.
4
+
5
+ Use when:
6
+
7
+ - Presenting a collection of structured data items
8
+ - Users need to scan, compare, filter, sort, or select items
9
+ - Each item has identifiable attributes (title, status, metadata)
10
+
11
+ Don't use when:
12
+
13
+ - Content is free-form prose or narrative — use typography/layout instead
14
+ - Displaying a single value with no comparison context — use a `Badge` or inline text
15
+ - Showing chronological events — use an [activity feed pattern](./activity-feed.md)
16
+ - Rendering key-value metadata pairs only — use a [key-value display pattern](./key-value-display.md)
17
+
18
+ ---
19
+
20
+ ## Variants
21
+
22
+ The central decision: **table vs cards vs list**. Choose based on content shape and user task.
23
+
24
+ | Variant | Use when | Avoid when |
25
+ | --- | --- | --- |
26
+ | **Table** | Data has consistent structure across items (same fields per row); users compare values across items; sorting/filtering by specific columns is needed; data is dense and benefits from tight vertical spacing; actions apply to individual rows (edit, delete, view) | Items have highly variable content; visual elements (images, charts) are important; mobile is a primary use case (tables don't adapt well) |
27
+ | **Cards** | Items are "objects" users browse or explore; each item has visual elements (images, icons, status indicators); content length varies significantly between items; users benefit from seeing more context per item; discovery or comparison is the goal | Users need to compare specific values across many items; sorting by multiple dimensions is important; screen space is limited and density matters |
28
+ | **List** | Items are simple (1–2 lines of content); users scan sequentially to find something; items represent actions, events, or navigation targets; vertical space is limited | Items have multiple attributes to display; comparison between items matters |
29
+
30
+ **Related anatomy specs:**
31
+
32
+ - For card content slots / order / typography → [entity-cards.md](./entity-cards.md)
33
+
34
+ ---
35
+
36
+ ## Composition rules
37
+
38
+ Apply across all variants.
39
+
40
+ ### Taxonomic labels in table cells: plain text, not pills
41
+
42
+ When a table cell holds multiple categorical values (e.g., a "Teams" column where each row has 2–4 team names, a "Tags" column with tech stack labels), **do not render each value as a `Tag` or `Badge`**. In dense data tables, pills compound into visual noise.
43
+
44
+ **Pattern:** render the values as plain text or navigable `Anchor` components, separated by commas or middle-dots.
45
+
46
+ **When `Tag` IS appropriate in a table:**
47
+
48
+ - A single-value category column where every row has exactly one Tag (e.g., a "Type" column: Model / Blueprint / Service) — one pill per row doesn't compound
49
+
50
+ **Why:** A scanning-optimized table prioritizes row-to-row comparison. Pills interrupt the visual row by breaking the text baseline and introducing color noise. Plain text preserves the scanning rhythm; `Anchor` adds affordance without visual weight.
51
+
52
+ ### Badge variant selection
53
+
54
+ Use `kind="solid"` for status badges in **detail views, side panels, and status bars** — the solid variant provides clear, immediate visual hierarchy for status. The outline variant is visually distracting when it appears alongside other bordered elements (panels, inputs, dividers).
55
+
56
+ Use `kind="outline"` only when the badge is **secondary information** that should not compete for attention — for example, metadata tags in a table cell or labels in a dense list where multiple badges appear per row.
57
+
58
+ | Context | Badge kind | Reason |
59
+ | --- | --- | --- |
60
+ | Side panel status | `solid` | Primary signal for triage; needs to stand out |
61
+ | Detail page status bar | `solid` | Key metadata, glanceable |
62
+ | Table cell (single status) | `solid` | Clear status at a glance |
63
+ | Table cell (multiple tags) | `outline` | Reduce visual noise in dense rows |
64
+ | Card metadata | `outline` | Card border + solid badge = too heavy |
65
+
66
+ ### Single selection among alternatives (compare flows)
67
+
68
+ When the user must **pick exactly one** option from a small set (e.g. compare two models, choose one deployment target), expose **one** primary selection affordance — not two competing ones.
69
+
70
+ **Preferred patterns (pick one):**
71
+
72
+ 1. **Card selection only** — clicking the card sets its selected state through the framework-specific API and preserves an accessible native selection control.
73
+ 2. **RadioGroup** — display options as a list of radio options using RadioGroup
74
+ 3. **Dense compare** — **table row** selection or a single-column list with one control per row.
75
+
76
+ ### Metric presentation
77
+
78
+ Rules for any displayed metric — stat blocks, table summary values, chart callouts, ranked-list columns. Composition for stat tiles lives in [stat-blocks.md](./stat-blocks.md) and for ranked columns in [ranked-lists.md](./ranked-lists.md); these formatting rules apply everywhere a number renders.
79
+
80
+ **The context triplet.** A headline metric renders **value + comparison + scope**. A bare number ("$4.82M" alone) forces the user to supply the baseline and the boundaries themselves — comparison is a delta vs. baseline, a share of a whole, or a distance to a target; scope is the period, denominator, or method that makes the value interpretable. In a table or ranked list the triplet may be distributed across columns (value column + share column + the panel's period subtitle) rather than packed into one element.
81
+
82
+ | Rule | Detail |
83
+ | --- | --- |
84
+ | Compact notation for large values | At ≥ 10,000 use compact one-decimal notation: `18.4K`, `4.8M`, `212.4B`. Keep full precision in tooltips and exports. |
85
+ | Currency precision | Cents only under ~$1,000 (`$13.76`); whole dollars to five digits (`$84,210`); compact above (`$4.82M`). |
86
+ | `tabular-nums` on aligned numbers | Any column of numbers, KPI values that update in place, and paired value/percent runs use `font-variant-numeric: tabular-nums` so digits align and don't jitter. |
87
+ | Right-align numeric columns | Tables and ranked lists right-align numbers so magnitudes compare down the column. |
88
+ | Name rate units explicitly | "$ / 1M tokens", "req / s" — never leave a rate's denominator implied. |
89
+ | Percentages | One decimal by default (`34.2%`); drop decimals only when everything on the surface is whole (`64%`). |
90
+ | No raw exponents or locale-less digits | `2.1e9` and `4820000` never render; format before display. |
91
+
92
+ ### Automated insights list
93
+
94
+ A short list of computed signals ("Spend concentration," "Largest 7-day mover," "Anomaly detected") summarizing what changed in the selected range. This is **not** an [activity feed](./activity-feed.md) — an activity feed renders _history_ (events that happened); an insights list renders _derived analysis_ of the current range.
95
+
96
+ **Anatomy per insight:** a leading tone-appropriate icon (`aria-hidden`) + a bold one-line title + one sentence naming the **metric, magnitude, and timeframe** ("claude-fable-5 increased by $138.70 versus the prior 7 days"). One accent color plus a warning tone for anomalies is enough — don't invent a per-tone rainbow.
97
+
98
+
99
+
100
+ **Rules:**
101
+
102
+ - Cap at ~4 insights per panel — beyond that it's a report, not a glanceable panel.
103
+ - Every insight is specific and quantified. "Usage changed significantly" is not an insight.
104
+ - When an insight is actionable, its row links to the filtered view that shows it.
105
+
106
+ ---
107
+
108
+ ## Modifiers
109
+
110
+ ### Reorderable rows
111
+
112
+ If rows or items are reorderable by drag, provide a non-drag alternative — up/down buttons, a "move to…" action, or keyboard reordering — so ordering isn't drag-only. A drag interaction with no single-pointer alternative excludes anyone who can't perform a drag gesture.
113
+
114
+ ### Progressive disclosure
115
+
116
+ Not all data needs to be visible at once. Pick the mechanism that matches how often users need the hidden content.
117
+
118
+ | Mechanism | Use when | Rules |
119
+ | --- | --- | --- |
120
+ | **Disclosure sections** | Content is detailed and rarely needed on initial view; users typically need only a subset; showing everything would overwhelm the primary content | Examples: environment variables, secrets, advanced configuration, a *secondary* audit log tucked below primary content. When activity/history is the primary surface, render it with [activity-feed.md](./activity-feed.md) instead of hiding it in a disclosure. |
121
+ | **Truncation with "Show more"** | Content is long but users sometimes need to see it all; full content would disrupt layout (e.g., long descriptions in cards) | Show enough to be useful (2–3 lines minimum); make truncation obvious (ellipsis + "Show more" link); expand in place, don't navigate away |
122
+ | **Separate tabs or pages** | Content is a complete alternate view (Logs, History, Metrics); users don't need both views simultaneously; each view has its own distinct purpose | Each view warrants its own route/tab |
123
+
124
+ ### Empty and loading states
125
+
126
+ - For empty data displays: [empty-states.md](./empty-states.md)
127
+ - For loading skeletons / placeholders: [loading.md](./loading.md)
@@ -0,0 +1,73 @@
1
+ # Data visualization
2
+
3
+ Choosing and coloring a chart. The chart type must serve the analytical task the user is performing, not just display numbers — the most common failure is picking the type that "looks like a dashboard" instead of the one the data shape requires.
4
+
5
+ ## When to use
6
+
7
+ Render a chart when the prompt or data shape implies comparison, trend, distribution, or proportion:
8
+
9
+ - The prompt names a chart, or the data compares values across categories
10
+ - The data shows change over time, or a part-to-whole breakdown
11
+ - The data groups values by a shared dimension (team, region, status)
12
+
13
+ Don't use when:
14
+
15
+ - The value is a single scalar with no comparable dimension and the prompt doesn't ask for a chart — use a stat tile or inline text instead
16
+ - The user needs exact values, many attributes per item, or to sort/filter — a [`Table`](./data-display.md) serves precision better than a chart
17
+ - The chart would sit on a dashboard — read [dashboard.md](../templates/dashboard.md) first for stat-block placement, chart-grid layout, and per-dashboard micro-rules (gridlines, hero chart spanning) before applying this file's chart-type and color rules inside each chart
18
+
19
+ ## Variants
20
+
21
+ Head each variant with the analytical task, not the chart's name.
22
+
23
+ | Situation | Chart | Notes |
24
+ | --- | --- | --- |
25
+ | Comparing 2–20 discrete categories | Bar | Horizontal when labels are long or there are 7+ categories. Stacked when sub-segments compose a total; grouped for 2–4 side-by-side sub-categories. |
26
+ | Change over time, continuous/sequential x-axis | Line | **Default for "trend" titles** — a title containing "trend," "over time," "progression," or a time range is a time series; do not default to a bar chart for it. |
27
+ | Volume/magnitude over time, or parts-of-a-whole over time | Area | Use sparingly — overlapping series obscure each other. Stacked area works best with 2–4 series. |
28
+ | Parts of a whole, 2–5 segments | Pie / donut | 6+ segments: use a horizontal bar chart instead — slices become indistinguishable. Prefer donut when a summary metric can sit in the center (value + one-word caption, `tabular-nums`); its legend sits beside it as label / value / percent rows, not bare swatches. |
29
+ | A single value's position in a defined range with meaningful thresholds | [`Meter`](../components/Meter.md) / [`SegmentedMeter`](../components/SegmentedMeter.md) | Not for comparing multiple values — that's a bar chart. |
30
+ | Compact inline trend (table row, card, stat block) | Sparkline | No axes, labels, or legends — shape and direction only. |
31
+ | Density/intensity across two dimensions | Heatmap | Large datasets where aggregate pattern matters more than individual points. |
32
+ | Relationship between two numeric variables | Scatter | Each point is an individual item, not an aggregate. |
33
+
34
+ **Bar vs. line is the highest-stakes call.** Bars imply discrete categorical comparison; lines imply continuity between points. A "Utilization trend" or "Daily active users" chart is a time series — line or area, never bars.
35
+
36
+ ## Composition rules
37
+
38
+ Apply to every chart, dashboard or not.
39
+
40
+ ### Tooltips are required, per-point labels usually aren't
41
+
42
+ Every chart shows a tooltip on hover/tap with the point's exact value, its label/category, and any context that makes it interpretable (date, percent of total). A small number of **selective callouts** (peak, latest point, an anomaly — 2–3 max) is fine on top of tooltips; labeling every point is the decluttering violation tooltips exist to prevent.
43
+
44
+ ### Legends
45
+
46
+ Include one whenever more than one series/color is in play — render a real [`Legend`](../components/Legend.md) next to the chart rather than inventing swatches, and keep entries in the same order as the series they describe (`Legend`'s own guidance covers pinning `color` when order can change). Place it above or beside the chart, never below — below competes with axis labels.
47
+
48
+ ### Axis labels
49
+
50
+ Label both axes, name the unit in the label ("Response Time (ms)", not "Response Time"), and keep tick intervals readable rather than dense.
51
+
52
+ ### Text alternative (accessibility)
53
+
54
+ A chart rendered as SVG is invisible to a screen reader — its takeaway must also exist as text:
55
+
56
+ - Give the chart an `aria-label` (or `<title>`/`<desc>`) stating the takeaway, not just the name — "Cost by week, trending up ~18% over 6 weeks," not "Cost chart."
57
+ - Make the underlying numbers reachable as data — a "View as table" toggle, a visually-hidden `<table>`, or the row's drill destination. A tooltip is hover-only and keyboard-inaccessible, so it does not satisfy this.
58
+
59
+ ## Modifiers
60
+
61
+ ### Color
62
+
63
+ See [chart and data-visualization color tokens](../design-tokens/CHART_DATA_COLORS.md) for the token families and when each applies. In short: categorical for unrelated series/segments, sequential for a single quantity's intensity, trend tokens only when a value has a favorable/unfavorable direction. Never use trend (semantic) colors for arbitrary categorical differentiation, and never rely on color alone to carry meaning — pair it with a label, pattern, or shape, and keep marker/line contrast ≥ 3:1 and any label text ≥ 4.5:1 against the panel background.
64
+
65
+ ## Anti-patterns
66
+
67
+ | Anti-pattern | Why it's wrong | Do this instead |
68
+ | --- | --- | --- |
69
+ | Bar chart for a time-series title ("Utilization trend," "Daily active users") | Bars read as discrete unordered categories, hiding the continuity the user actually needs to see | Line chart, or area for cumulative volume |
70
+ | Pie/donut with 6+ segments | Slices become too small to differentiate, and precise comparison is impossible | Horizontal bar chart |
71
+ | Labeling every point/bar when tooltips already exist | Duplicates the tooltip and clutters the chart | Tooltips plus at most 2–3 selective callouts (peak/latest/anomaly) |
72
+ | Shipping a chart with the charting library's default white background and black axis text in a dark-themed app | Reads as visibly unfinished and fails contrast against the surrounding surface | Theme the chart explicitly — background, text, gridlines, tooltip all pulled from app tokens |
73
+ | A chart with no text alternative | Invisible to screen readers — the insight the chart carries doesn't reach every user | `aria-label` stating the takeaway, plus the underlying values reachable as a table |