@nvidia/foundations-css 0.0.0-stage → 1.24.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 (304) hide show
  1. package/CHANGELOG.md +11 -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 +16546 -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.css +1 -0
  69. package/dist/components/meter.css +1 -0
  70. package/dist/components/modal.css +1 -0
  71. package/dist/components/notification.css +1 -0
  72. package/dist/components/otp-input.css +1 -0
  73. package/dist/components/page-header.css +1 -0
  74. package/dist/components/pagination.css +1 -0
  75. package/dist/components/panel.css +1 -0
  76. package/dist/components/popover.css +1 -0
  77. package/dist/components/primitive.css +1 -0
  78. package/dist/components/progress-bar.css +1 -0
  79. package/dist/components/radio-group.css +1 -0
  80. package/dist/components/range-slider.css +1 -0
  81. package/dist/components/rating.css +1 -0
  82. package/dist/components/reaction-group.css +1 -0
  83. package/dist/components/resizable.css +1 -0
  84. package/dist/components/segmented-control.css +1 -0
  85. package/dist/components/segmented-meter.css +1 -0
  86. package/dist/components/select.css +1 -0
  87. package/dist/components/severity.css +1 -0
  88. package/dist/components/side-panel.css +1 -0
  89. package/dist/components/skeleton.css +1 -0
  90. package/dist/components/slider.css +1 -0
  91. package/dist/components/spinner.css +1 -0
  92. package/dist/components/status-indicator.css +1 -0
  93. package/dist/components/status-message.css +1 -0
  94. package/dist/components/stepper.css +1 -0
  95. package/dist/components/switch.css +1 -0
  96. package/dist/components/table.css +1 -0
  97. package/dist/components/tabs.css +1 -0
  98. package/dist/components/tag-group.css +1 -0
  99. package/dist/components/tag.css +1 -0
  100. package/dist/components/terminal-line.css +1 -0
  101. package/dist/components/text-area.css +1 -0
  102. package/dist/components/text-content.css +1 -0
  103. package/dist/components/text.css +1 -0
  104. package/dist/components/toast.css +1 -0
  105. package/dist/components/toaster.css +1 -0
  106. package/dist/components/toggle-button-group.css +1 -0
  107. package/dist/components/toggle-button.css +1 -0
  108. package/dist/components/tooltip.css +1 -0
  109. package/dist/components/tree-nav.css +1 -0
  110. package/dist/components/upload.css +1 -0
  111. package/dist/components/vertical-nav.css +1 -0
  112. package/dist/css-sizes.js +1279 -0
  113. package/dist/index.cjs +3041 -0
  114. package/dist/index.d.cts +27 -0
  115. package/dist/index.d.ts +27 -0
  116. package/dist/index.js +3014 -0
  117. package/dist/plugins/tailwind-theme.css +504 -0
  118. package/dist/plugins/tailwind3-theme.js +682 -0
  119. package/dist/plugins/variables-sass.sass +414 -0
  120. package/dist/themes/kui11/_theme-selectors.css +1 -0
  121. package/dist/themes/kui11/accordion.css +1 -0
  122. package/dist/themes/kui11/app-bar.css +1 -0
  123. package/dist/themes/kui11/avatar.css +1 -0
  124. package/dist/themes/kui11/badge.css +1 -0
  125. package/dist/themes/kui11/banner.css +1 -0
  126. package/dist/themes/kui11/base.css +1 -0
  127. package/dist/themes/kui11/breadcrumbs.css +1 -0
  128. package/dist/themes/kui11/button.css +1 -0
  129. package/dist/themes/kui11/card.css +1 -0
  130. package/dist/themes/kui11/checkbox.css +1 -0
  131. package/dist/themes/kui11/components.css +1 -0
  132. package/dist/themes/kui11/date-picker.css +1 -0
  133. package/dist/themes/kui11/form-field.css +1 -0
  134. package/dist/themes/kui11/hero.css +1 -0
  135. package/dist/themes/kui11/horizontal-nav.css +1 -0
  136. package/dist/themes/kui11/input-shell.css +1 -0
  137. package/dist/themes/kui11/label.css +1 -0
  138. package/dist/themes/kui11/menu.css +1 -0
  139. package/dist/themes/kui11/modal.css +1 -0
  140. package/dist/themes/kui11/notification.css +1 -0
  141. package/dist/themes/kui11/page-header.css +1 -0
  142. package/dist/themes/kui11/pagination.css +1 -0
  143. package/dist/themes/kui11/popover.css +1 -0
  144. package/dist/themes/kui11/progress-bar.css +1 -0
  145. package/dist/themes/kui11/radio-group.css +1 -0
  146. package/dist/themes/kui11/range-slider.css +1 -0
  147. package/dist/themes/kui11/side-panel.css +1 -0
  148. package/dist/themes/kui11/slider.css +1 -0
  149. package/dist/themes/kui11/spinner.css +1 -0
  150. package/dist/themes/kui11/status-message.css +1 -0
  151. package/dist/themes/kui11/switch.css +1 -0
  152. package/dist/themes/kui11/table.css +1 -0
  153. package/dist/themes/kui11/tabs.css +1 -0
  154. package/dist/themes/kui11/tag.css +1 -0
  155. package/dist/themes/kui11/text-area.css +1 -0
  156. package/dist/themes/kui11/text-input.css +1 -0
  157. package/dist/themes/kui11/text.css +1 -0
  158. package/dist/themes/kui11/toast.css +1 -0
  159. package/dist/themes/kui11/tooltip.css +1 -0
  160. package/dist/themes/kui11/vertical-nav.css +1 -0
  161. package/dist/themes/kui11.base.css +1 -0
  162. package/dist/themes/kui11.base.js +935 -0
  163. package/dist/themes/kui11.components.css +1 -0
  164. package/dist/themes/kui11.components.js +2564 -0
  165. package/dist/themes/kui11.css +1 -0
  166. package/dist/themes/theme-partials.js +456 -0
  167. package/dist/utilities/all.js +442 -0
  168. package/dist/utilities/typography-utils.css +1 -0
  169. package/package.json +106 -3
  170. package/scripts/sync-skills.mjs +237 -0
  171. package/skills/kaizen-ui-html-css/SKILL.md +293 -0
  172. package/skills/kaizen-ui-html-css/assets/color-primitives-hex.md +141 -0
  173. package/skills/kaizen-ui-html-css/references/blocks/chat-input.md +94 -0
  174. package/skills/kaizen-ui-html-css/references/blocks/notification-center.md +320 -0
  175. package/skills/kaizen-ui-html-css/references/blocks/timeline.md +579 -0
  176. package/skills/kaizen-ui-html-css/references/components/Accordion.md +88 -0
  177. package/skills/kaizen-ui-html-css/references/components/Anchor.md +29 -0
  178. package/skills/kaizen-ui-html-css/references/components/AnimatedChevron.md +31 -0
  179. package/skills/kaizen-ui-html-css/references/components/AppBar.md +129 -0
  180. package/skills/kaizen-ui-html-css/references/components/Attachment.md +306 -0
  181. package/skills/kaizen-ui-html-css/references/components/Audio.md +21 -0
  182. package/skills/kaizen-ui-html-css/references/components/Autocomplete.md +29 -0
  183. package/skills/kaizen-ui-html-css/references/components/Avatar.md +28 -0
  184. package/skills/kaizen-ui-html-css/references/components/AvatarGroup.md +38 -0
  185. package/skills/kaizen-ui-html-css/references/components/Badge.md +121 -0
  186. package/skills/kaizen-ui-html-css/references/components/Banner.md +49 -0
  187. package/skills/kaizen-ui-html-css/references/components/Block.md +26 -0
  188. package/skills/kaizen-ui-html-css/references/components/Breadcrumbs.md +42 -0
  189. package/skills/kaizen-ui-html-css/references/components/Button.md +43 -0
  190. package/skills/kaizen-ui-html-css/references/components/ButtonGroup.md +32 -0
  191. package/skills/kaizen-ui-html-css/references/components/Card.md +39 -0
  192. package/skills/kaizen-ui-html-css/references/components/Carousel.md +53 -0
  193. package/skills/kaizen-ui-html-css/references/components/ChatBubble.md +28 -0
  194. package/skills/kaizen-ui-html-css/references/components/Checkbox.md +32 -0
  195. package/skills/kaizen-ui-html-css/references/components/CodeSnippet.md +33 -0
  196. package/skills/kaizen-ui-html-css/references/components/Collapsible.md +56 -0
  197. package/skills/kaizen-ui-html-css/references/components/Combobox.md +66 -0
  198. package/skills/kaizen-ui-html-css/references/components/Command.md +100 -0
  199. package/skills/kaizen-ui-html-css/references/components/ContextMenu.md +61 -0
  200. package/skills/kaizen-ui-html-css/references/components/DatePicker.md +30 -0
  201. package/skills/kaizen-ui-html-css/references/components/Divider.md +28 -0
  202. package/skills/kaizen-ui-html-css/references/components/Dropdown.md +94 -0
  203. package/skills/kaizen-ui-html-css/references/components/Flex.md +33 -0
  204. package/skills/kaizen-ui-html-css/references/components/FormField.md +35 -0
  205. package/skills/kaizen-ui-html-css/references/components/Grid.md +27 -0
  206. package/skills/kaizen-ui-html-css/references/components/Group.md +92 -0
  207. package/skills/kaizen-ui-html-css/references/components/Halo.md +26 -0
  208. package/skills/kaizen-ui-html-css/references/components/Hero.md +29 -0
  209. package/skills/kaizen-ui-html-css/references/components/HorizontalNav.md +34 -0
  210. package/skills/kaizen-ui-html-css/references/components/HoverCard.md +23 -0
  211. package/skills/kaizen-ui-html-css/references/components/Inline.md +49 -0
  212. package/skills/kaizen-ui-html-css/references/components/InlineNotice.md +96 -0
  213. package/skills/kaizen-ui-html-css/references/components/InputShell.md +26 -0
  214. package/skills/kaizen-ui-html-css/references/components/JumpNav.md +36 -0
  215. package/skills/kaizen-ui-html-css/references/components/Kbd.md +32 -0
  216. package/skills/kaizen-ui-html-css/references/components/KeyValueEditor.md +275 -0
  217. package/skills/kaizen-ui-html-css/references/components/KeyValueGroup.md +35 -0
  218. package/skills/kaizen-ui-html-css/references/components/Label.md +86 -0
  219. package/skills/kaizen-ui-html-css/references/components/Legend.md +148 -0
  220. package/skills/kaizen-ui-html-css/references/components/List.md +143 -0
  221. package/skills/kaizen-ui-html-css/references/components/Menu.md +103 -0
  222. package/skills/kaizen-ui-html-css/references/components/Meter.md +27 -0
  223. package/skills/kaizen-ui-html-css/references/components/Modal.md +60 -0
  224. package/skills/kaizen-ui-html-css/references/components/Notification.md +48 -0
  225. package/skills/kaizen-ui-html-css/references/components/NumberInput.md +15 -0
  226. package/skills/kaizen-ui-html-css/references/components/OtpInput.md +51 -0
  227. package/skills/kaizen-ui-html-css/references/components/PageHeader.md +61 -0
  228. package/skills/kaizen-ui-html-css/references/components/Pagination.md +63 -0
  229. package/skills/kaizen-ui-html-css/references/components/Panel.md +133 -0
  230. package/skills/kaizen-ui-html-css/references/components/Popover.md +31 -0
  231. package/skills/kaizen-ui-html-css/references/components/ProgressBar.md +187 -0
  232. package/skills/kaizen-ui-html-css/references/components/RadioGroup.md +32 -0
  233. package/skills/kaizen-ui-html-css/references/components/RangeSlider.md +62 -0
  234. package/skills/kaizen-ui-html-css/references/components/Rating.md +69 -0
  235. package/skills/kaizen-ui-html-css/references/components/ReactionGroup.md +30 -0
  236. package/skills/kaizen-ui-html-css/references/components/Resizable.md +31 -0
  237. package/skills/kaizen-ui-html-css/references/components/SegmentedControl.md +36 -0
  238. package/skills/kaizen-ui-html-css/references/components/SegmentedMeter.md +200 -0
  239. package/skills/kaizen-ui-html-css/references/components/Select.md +39 -0
  240. package/skills/kaizen-ui-html-css/references/components/Severity.md +25 -0
  241. package/skills/kaizen-ui-html-css/references/components/SidePanel.md +42 -0
  242. package/skills/kaizen-ui-html-css/references/components/Skeleton.md +24 -0
  243. package/skills/kaizen-ui-html-css/references/components/Slider.md +32 -0
  244. package/skills/kaizen-ui-html-css/references/components/Spinner.md +63 -0
  245. package/skills/kaizen-ui-html-css/references/components/Stack.md +17 -0
  246. package/skills/kaizen-ui-html-css/references/components/StatusIndicator.md +30 -0
  247. package/skills/kaizen-ui-html-css/references/components/StatusMessage.md +78 -0
  248. package/skills/kaizen-ui-html-css/references/components/Stepper.md +57 -0
  249. package/skills/kaizen-ui-html-css/references/components/Switch.md +96 -0
  250. package/skills/kaizen-ui-html-css/references/components/Table.md +566 -0
  251. package/skills/kaizen-ui-html-css/references/components/Tabs.md +67 -0
  252. package/skills/kaizen-ui-html-css/references/components/Tag.md +194 -0
  253. package/skills/kaizen-ui-html-css/references/components/TagGroup.md +32 -0
  254. package/skills/kaizen-ui-html-css/references/components/TerminalLine.md +69 -0
  255. package/skills/kaizen-ui-html-css/references/components/Text.md +27 -0
  256. package/skills/kaizen-ui-html-css/references/components/TextArea.md +28 -0
  257. package/skills/kaizen-ui-html-css/references/components/TextContent.md +61 -0
  258. package/skills/kaizen-ui-html-css/references/components/TextInput.md +29 -0
  259. package/skills/kaizen-ui-html-css/references/components/TimeInput.md +17 -0
  260. package/skills/kaizen-ui-html-css/references/components/Toast.md +41 -0
  261. package/skills/kaizen-ui-html-css/references/components/Toaster.md +19 -0
  262. package/skills/kaizen-ui-html-css/references/components/ToggleButton.md +47 -0
  263. package/skills/kaizen-ui-html-css/references/components/ToggleButtonGroup.md +29 -0
  264. package/skills/kaizen-ui-html-css/references/components/Tooltip.md +45 -0
  265. package/skills/kaizen-ui-html-css/references/components/TreeNav.md +58 -0
  266. package/skills/kaizen-ui-html-css/references/components/Upload.md +90 -0
  267. package/skills/kaizen-ui-html-css/references/components/VerticalNav.md +65 -0
  268. package/skills/kaizen-ui-html-css/references/design-tokens/CHART_DATA_COLORS.md +56 -0
  269. package/skills/kaizen-ui-html-css/references/design-tokens/COLORS.md +148 -0
  270. package/skills/kaizen-ui-html-css/references/design-tokens/COLOR_PRIMITIVES.md +31 -0
  271. package/skills/kaizen-ui-html-css/references/design-tokens/EFFECTS_AND_LAYOUT.md +50 -0
  272. package/skills/kaizen-ui-html-css/references/design-tokens/SPACING_SCALE.md +36 -0
  273. package/skills/kaizen-ui-html-css/references/design-tokens/TYPOGRAPHY.md +44 -0
  274. package/skills/kaizen-ui-html-css/references/guides/CONFIGURATION.md +51 -0
  275. package/skills/kaizen-ui-html-css/references/guides/HTML_STRUCTURE.md +134 -0
  276. package/skills/kaizen-ui-html-css/references/patterns/activity-feed.md +132 -0
  277. package/skills/kaizen-ui-html-css/references/patterns/confirmations.md +133 -0
  278. package/skills/kaizen-ui-html-css/references/patterns/data-display.md +127 -0
  279. package/skills/kaizen-ui-html-css/references/patterns/data-visualization.md +73 -0
  280. package/skills/kaizen-ui-html-css/references/patterns/element-visibility.md +83 -0
  281. package/skills/kaizen-ui-html-css/references/patterns/empty-states.md +116 -0
  282. package/skills/kaizen-ui-html-css/references/patterns/entity-cards.md +172 -0
  283. package/skills/kaizen-ui-html-css/references/patterns/error-states.md +163 -0
  284. package/skills/kaizen-ui-html-css/references/patterns/feedback.md +77 -0
  285. package/skills/kaizen-ui-html-css/references/patterns/filters.md +167 -0
  286. package/skills/kaizen-ui-html-css/references/patterns/forms.md +215 -0
  287. package/skills/kaizen-ui-html-css/references/patterns/key-value-display.md +195 -0
  288. package/skills/kaizen-ui-html-css/references/patterns/loading.md +104 -0
  289. package/skills/kaizen-ui-html-css/references/patterns/navigation.md +154 -0
  290. package/skills/kaizen-ui-html-css/references/patterns/ranked-lists.md +60 -0
  291. package/skills/kaizen-ui-html-css/references/patterns/search.md +46 -0
  292. package/skills/kaizen-ui-html-css/references/patterns/settings.md +106 -0
  293. package/skills/kaizen-ui-html-css/references/patterns/stat-blocks.md +71 -0
  294. package/skills/kaizen-ui-html-css/references/templates/browse-page.md +92 -0
  295. package/skills/kaizen-ui-html-css/references/templates/dashboard.md +356 -0
  296. package/skills/kaizen-ui-html-css/references/templates/detail-page.md +424 -0
  297. package/skills/kaizen-ui-html-css/references/templates/detail-placement.md +68 -0
  298. package/skills/kaizen-ui-html-css/references/templates/error-page.md +82 -0
  299. package/skills/kaizen-ui-html-css/references/templates/form-page.md +256 -0
  300. package/skills/kaizen-ui-html-css/references/templates/layout-principles.md +152 -0
  301. package/skills/kaizen-ui-html-css/references/templates/list-view.md +229 -0
  302. package/skills/kaizen-ui-html-css/references/templates/page-modification.md +33 -0
  303. package/skills/kaizen-ui-html-css/references/templates/page-shell.md +225 -0
  304. package/skills/kaizen-ui-html-css/references/templates/workspace-page.md +427 -0
@@ -0,0 +1,49 @@
1
+ # Inline
2
+
3
+ A layout primitive that pads a short run of content without breaking the line of text it sits in.
4
+
5
+ ## When to use
6
+
7
+ Use Inline to pad a short run of content inside a line of text, such as a highlighted term, a code snippet, or a timestamp. Use [Flex](./Flex.md) to space, align, or wrap a row of items, such as the buttons in a card footer. Use [Block](./Block.md) or [Stack](./Stack.md) when the content should start its own line.
8
+
9
+ ## Usage guidelines
10
+
11
+ - Take padding from the spacing scale instead of pixel values. Fixed steps such as `1` and `2` never change, while `density-*` steps such as `density-xs` shrink in compact density and grow in spacious density, so you write no density-specific CSS. The density keys are `density-xxs`, `density-xs`, `density-sm`, `density-md`, `density-lg`, `density-xl`, and `density-2xl` through `density-5xl`. At standard density, `xxs` is 2px, `xs` 4px, `sm` 6px, and `md` 8px. In CSS they are the `--spacing-density-*` custom properties, such as `var(--spacing-density-xs)`, and a fixed step is `calc(var(--spacing) * <step>)`.
12
+ - Pad only the sides that need room. A horizontal padding separates a term from the words around it.
13
+ - Padding sits inside the element's background. When a backgrounded run needs density-aware space from the words beside it, put a margin outside it, such as `margin-inline-start: var(--spacing-density-sm)`. Do not add padding to the run itself.
14
+ - There is no Inline class. Put a primitive spacing class on a native inline element such as `<span>`, `<code>`, or `<time>`, for example `nv-primitive--spacing-x-1` or `nv-primitive--spacing-x-density-xs`. Write a decimal step with an underscore, as in `nv-primitive--spacing-0_5`, and use the y, t, r, b, and l variants for the other axes and sides.
15
+ - The element stays `display: inline`, so vertical padding enlarges the background but does not push neighboring lines apart. To space and center an icon beside its word inside a line, add `display: inline-flex; align-items: center` to the span with a gap class such as `nv-primitive--gap-density-xs`. A gap class does nothing on an inline span. Use Flex for a row on its own line.
16
+
17
+ ## Examples
18
+
19
+ ```html
20
+ <p>
21
+ New models deploy to
22
+ <span class="nv-primitive--spacing-x-1" style="background: var(--background-color-surface-sunken)">Kaizen Cloud</span>
23
+ by default.
24
+ </p>
25
+ ```
26
+
27
+ ### Density
28
+
29
+ Use a `density-*` step when the padding should follow the active density, such as keyword highlights in table cells.
30
+
31
+ ```html
32
+ <p>
33
+ Matched
34
+ <span class="nv-primitive--spacing-x-density-xs" style="background: var(--background-color-surface-sunken)">gpu</span>
35
+ in 3 job names.
36
+ </p>
37
+ ```
38
+
39
+ ### Pad a semantic element
40
+
41
+ Put the spacing class directly on the semantic element, such as `<code>`, `<time>`, or `<a>`, with no wrapper.
42
+
43
+ ```html
44
+ <p>
45
+ Run
46
+ <code class="nv-primitive--spacing-x-1">pnpm build</code>
47
+ before you deploy.
48
+ </p>
49
+ ```
@@ -0,0 +1,96 @@
1
+ # InlineNotice
2
+
3
+ A neutral, low-emphasis message beside the content it explains, such as a tip, a note, or a pointer to more information.
4
+
5
+ ## When to use
6
+
7
+ Use InlineNotice for guidance the reader can skip, placed next to the content it explains: a tip, a note, or a link to more information. Use [Banner](./Banner.md) when the message reports a status or outcome, such as an expiring key or a failed deployment, or asks the reader to act. Use [Toast](./Toast.md) for brief feedback after an action, and [Tooltip](./Tooltip.md) for help that only appears on demand.
8
+
9
+ ## Usage guidelines
10
+
11
+ - Keep the notice neutral. It has no status color, so don't restyle it as info, success, warning, or error; a message that needs that weight belongs in a Banner.
12
+ - Lead with a short label such as "Tip" or "Note" in the heading, and put the message in the subheading.
13
+ - Use the default inline layout for a one-line message. Use the stack layout when the message is long or the notice holds block content, such as a code sample.
14
+ - Give the notice at most one action, a link to more information. A notice that needs a button to fix something is a Banner.
15
+ - Offer dismissal only when hiding the notice loses nothing the reader needs, and remove the notice when it is dismissed. When the dismiss button had focus, move focus to the content the notice described.
16
+ - The notice renders with `role="note"`. When it has a link or a dismiss button, it is also named by its heading, so screen readers announce the notice's subject as focus enters a control.
17
+ - Leave out the heading, subheading, content, action, or close-button element when it has nothing to show. The classes only style the notice, so your script removes it on dismiss.
18
+ - Put block content in `nv-inline-notice-content` so it lines up with the message. The code snippet classes only style a code sample; highlighting and a copy button need your own script.
19
+
20
+ ## Examples
21
+
22
+ ```html
23
+ <div role="note" class="nv-inline-notice-root">
24
+ <div class="nv-inline-notice-icon" aria-hidden="true">
25
+ <i class="nv-icon nv-icon--fill nv-icon-lightbulb" role="img" aria-hidden="true"></i>
26
+ </div>
27
+ <div class="nv-inline-notice-heading">Tip</div>
28
+ <div class="nv-inline-notice-subheading">Drag a column header to change the column order.</div>
29
+ </div>
30
+ ```
31
+
32
+ ### Stack layout
33
+
34
+ ```html
35
+ <div class="nv-inline-notice-root nv-inline-notice-root--layout-stack" role="note">
36
+ <div class="nv-inline-notice-icon" aria-hidden="true">
37
+ <i class="nv-icon nv-icon--fill nv-icon-lightbulb"></i>
38
+ </div>
39
+ <div class="nv-inline-notice-heading">Tip</div>
40
+ <div class="nv-inline-notice-subheading">To install a package under a different name, alias it when you add it.</div>
41
+ <div class="nv-inline-notice-content">
42
+ <div class="nv-code-snippet-root">
43
+ <div class="nv-code-snippet-code">
44
+ <pre><code>pnpm add charts@npm:@acme/charts@^2.0.0</code></pre>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ ```
50
+
51
+ ### Flat kind
52
+
53
+ The default `solid` kind sets the notice on a bordered surface. `flat` drops the surface so the notice reads as part of the surrounding content. Use it under a form field, chart, or table, where a bordered surface would compete with the content it explains.
54
+
55
+ ```html
56
+ <div role="note" class="nv-inline-notice-root nv-inline-notice-root--kind-flat">
57
+ <div class="nv-inline-notice-icon" aria-hidden="true">
58
+ <i class="nv-icon nv-icon--fill nv-icon-lightbulb" role="img" aria-hidden="true"></i>
59
+ </div>
60
+ <div class="nv-inline-notice-heading">Note</div>
61
+ <div class="nv-inline-notice-subheading">Usage figures refresh every hour, so recent activity can take a while to appear.</div>
62
+ </div>
63
+ ```
64
+
65
+ ### Link and dismiss button
66
+
67
+ ```html
68
+ <div role="note" class="nv-inline-notice-root" aria-labelledby="_R_0_">
69
+ <div class="nv-inline-notice-icon" aria-hidden="true">
70
+ <i class="nv-icon nv-icon--fill nv-icon-lightbulb" role="img" aria-hidden="true"></i>
71
+ </div>
72
+ <div class="nv-inline-notice-heading" id="_R_0_">Tip</div>
73
+ <div class="nv-inline-notice-subheading">Press ? on any page to see every keyboard shortcut.</div>
74
+ <div class="nv-inline-notice-action">
75
+ <a class="nv-text nv-text--body-regular-md nv-anchor nv-anchor--kind-standalone" href="/settings/shortcuts"> View shortcuts </a>
76
+ </div>
77
+ <div class="nv-inline-notice-close-button-section">
78
+ <button class="nv-button nv-button--size-tiny nv-button--kind-tertiary nv-button--color-neutral" type="button" aria-label="Dismiss notice">
79
+ <i style="--icon-font-size: 12px" class="nv-icon nv-icon-close" role="img" aria-hidden="true"></i>
80
+ </button>
81
+ </div>
82
+ </div>
83
+ ```
84
+
85
+ ## CSS classes
86
+
87
+ ### Elements
88
+
89
+ `nv-inline-notice-action`, `nv-inline-notice-close-button-section`, `nv-inline-notice-content`, `nv-inline-notice-heading`, `nv-inline-notice-icon`, `nv-inline-notice-root`, `nv-inline-notice-subheading`
90
+
91
+ ### Modifiers
92
+
93
+ | Group | Classes |
94
+ | --- | --- |
95
+ | kind | `nv-inline-notice-root--kind-flat` |
96
+ | layout | `nv-inline-notice-root--layout-stack` |
@@ -0,0 +1,26 @@
1
+ # InputShell
2
+
3
+ A low-level wrapper that styles any element as a KUI input. Reach for the higher-level inputs first; use this only when composing a custom control.
4
+
5
+ ## Examples
6
+
7
+ ```html
8
+ <div class="nv-input-shell">
9
+ <input type="text" placeholder="Default input" />
10
+ </div>
11
+ ```
12
+
13
+ ## CSS classes
14
+
15
+ ### Elements
16
+
17
+ `nv-input-shell`, `nv-input-shell-control`
18
+
19
+ ### Modifiers
20
+
21
+ | Group | Classes |
22
+ | --- | --- |
23
+ | kind | `nv-input-shell--kind-floating` |
24
+ | layout | `nv-input-shell--layout-vertical` |
25
+ | size | `nv-input-shell--size-large`, `nv-input-shell--size-small` |
26
+ | state | `nv-input-shell--validated` |
@@ -0,0 +1,36 @@
1
+ # JumpNav
2
+
3
+ In-page navigation for jumping between sections of a long page.
4
+
5
+ ## Examples
6
+
7
+ ```html
8
+ <div class="nv-grid nv-primitive--gap-density-2xl" style="--nv-grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; overflow-wrap: break-word;">
9
+ <nav class="nv-jump-nav-root" aria-label="Deployment guide">
10
+ <ul class="nv-jump-nav-list">
11
+ <li class="nv-jump-nav-list-item">
12
+ <a class="nv-jump-nav-item" href="#html-configure" aria-current="location">Configure deployment</a>
13
+ </li>
14
+ <li class="nv-jump-nav-list-item">
15
+ <a class="nv-jump-nav-item" href="#html-policies">Review policies</a>
16
+ </li>
17
+ </ul>
18
+ </nav>
19
+ <div style="min-width: 0;">
20
+ <section aria-labelledby="html-configure">
21
+ <h2 id="html-configure">Configure deployment</h2>
22
+ <p>Choose the model and compute resources for your deployment.</p>
23
+ </section>
24
+ <section aria-labelledby="html-policies">
25
+ <h2 id="html-policies">Review policies</h2>
26
+ <p>Review access and resource policies before deploying.</p>
27
+ </section>
28
+ </div>
29
+ </div>
30
+ ```
31
+
32
+ ## CSS classes
33
+
34
+ ### Elements
35
+
36
+ `nv-jump-nav-heading`, `nv-jump-nav-item`, `nv-jump-nav-list`, `nv-jump-nav-root`, `nv-jump-nav-title`
@@ -0,0 +1,32 @@
1
+ # Kbd
2
+
3
+ A visual representation of a keyboard key or shortcut. Place it beside the control or instruction it describes.
4
+
5
+ ## Examples
6
+
7
+ ```html
8
+ <kbd class="nv-kbd-key nv-kbd--size-medium">Esc</kbd>
9
+
10
+ <kbd class="nv-kbd-root nv-kbd--size-medium">
11
+ <kbd class="nv-kbd-key">Cmd</kbd>
12
+ <span class="nv-kbd-separator">+</span>
13
+ <kbd class="nv-kbd-key">K</kbd>
14
+ </kbd>
15
+ ```
16
+
17
+ ## CSS classes
18
+
19
+ ### Elements
20
+
21
+ `nv-kbd-key`, `nv-kbd-root`, `nv-kbd-separator`
22
+
23
+ ### Modifiers
24
+
25
+ | Group | Classes |
26
+ | --- | --- |
27
+ | kind | `nv-kbd--kind-flat`, `nv-kbd--kind-solid` |
28
+ | size | `nv-kbd--size-large`, `nv-kbd--size-medium`, `nv-kbd--size-small` |
29
+
30
+ ## See also
31
+
32
+ - [CodeSnippet](./CodeSnippet.md)
@@ -0,0 +1,275 @@
1
+ # KeyValueEditor
2
+
3
+ Also known as: AttributeEditor, TagEditor, KeyValuePairs
4
+
5
+ An editable list of key-value pairs or multi-field rows, such as resource tags or filter rules, that keeps focus with the rows the app adds, removes, and moves.
6
+
7
+ ## When to use
8
+
9
+ Use KeyValueEditor when people enter a variable number of name and value pairs, such as resource tags, labels, or environment variables, or a list of rows with more fields, such as filter rules. Use [Key Value Group](./KeyValueGroup.md) to show pairs that cannot be edited, and a set of [Form Field](./FormField.md)s when the fields are fixed.
10
+
11
+ ## Usage guidelines
12
+
13
+ - The editor keeps no list of its own. Apply each add, remove, and move to your data and render the rows again. The editor watches the rows change and moves focus to the last new row's first input, to the same place in the row that took a removed row's place, or back to the moved row, so any button works for these actions.
14
+ - Rows hold one control per field column. Use two columns for pairs, and more when each row needs them, such as field, operator, and value.
15
+ - When order matters, let people reorder rows. Start each row with a drag handle, which also moves with the arrow keys, and end it with a menu holding Move up and Move down, which work without dragging and without script. Without script the handles stay hidden.
16
+ - Give every input an accessible name that includes its row, such as `aria-label="Key 1"` and `aria-label="Value 1"`, and every remove button one that names its row, such as `aria-label="Remove row 1"`. A label built from the key goes stale once someone edits it. The column headers are visual only. Name the drag handle and row menu after their row too, such as "Move row 1" and "Actions for row 1".
17
+ - Give each input a `name` that carries its row, such as `tags[0][key]`, so the pairs submit with their form.
18
+ - To keep a pair from being removed, leave out its remove button. To keep a key from being edited, make its input read-only so it still submits. To stop new rows, disable the add button.
19
+ - `density` sizes the text inputs and buttons in the rows and the add button. A button that sets its own `size` keeps it, as does a text input set to a size other than `medium`.
20
+ - The editor never blocks a click. A button with `aria-disabled="true"` still fires `click`, so return early in its handler, or use the click to explain why the action is unavailable.
21
+ - Put `role="group"` and a name on `div.nv-key-value-editor-root`. Inside it, `div.nv-key-value-editor-column-headers` holds one `span.nv-key-value-editor-column-header` per column, each `div.nv-key-value-editor-row` holds one control per column and an optional remove `button.nv-button` as direct children, and `div.nv-key-value-editor-actions` holds the add button. Set `--nv-key-value-editor-columns` on the root for more than two columns.
22
+ - Rows can be reordered only through submit buttons: put them in a `div.nv-key-value-editor-row-menu` at the end of each row, as in [Forms without JavaScript](#forms-without-javascript). Leave out the drag handle, which needs script.
23
+ - No script runs: add and remove through submit buttons as in [Forms without JavaScript](#forms-without-javascript), or handle the buttons' `click` events and move focus yourself.
24
+ - Add `nv-key-value-editor-root--density-compact` for the compact density.
25
+
26
+ ## Examples
27
+
28
+ ```html
29
+ <div class="nv-key-value-editor-root" role="group" aria-describedby="tags-description" aria-labelledby="tags-heading" id="tags" style="--nv-key-value-editor-columns: minmax(0, 1fr) minmax(0, 1fr)">
30
+ <div class="nv-key-value-editor-heading" id="tags-heading"><h3>Tags</h3></div>
31
+ <p class="nv-key-value-editor-description" id="tags-description">Tags are applied to every resource in this deployment.</p>
32
+ <div class="nv-key-value-editor-column-headers">
33
+ <span class="nv-key-value-editor-column-header">Key</span>
34
+ <span class="nv-key-value-editor-column-header">Value</span>
35
+ </div>
36
+ <div class="nv-key-value-editor-row">
37
+ <div class="nv-input-shell nv-text-input-root">
38
+ <input type="text" aria-label="Key 1" name="tags[0][key]" value="Environment" />
39
+ </div>
40
+ <div class="nv-input-shell nv-text-input-root">
41
+ <input type="text" aria-label="Value 1" name="tags[0][value]" value="production" />
42
+ </div>
43
+ <button class="nv-button nv-button--kind-tertiary" type="button" aria-label="Remove row 1">
44
+ <i class="nv-icon nv-icon-trash" role="img" aria-hidden="true"></i>
45
+ </button>
46
+ </div>
47
+ <div class="nv-key-value-editor-row">
48
+ <div class="nv-input-shell nv-text-input-root">
49
+ <input type="text" aria-label="Key 2" name="tags[1][key]" value="Region" />
50
+ </div>
51
+ <div class="nv-input-shell nv-text-input-root">
52
+ <input type="text" aria-label="Value 2" name="tags[1][value]" value="us-west-2" />
53
+ </div>
54
+ <button class="nv-button nv-button--kind-tertiary" type="button" aria-label="Remove row 2">
55
+ <i class="nv-icon nv-icon-trash" role="img" aria-hidden="true"></i>
56
+ </button>
57
+ </div>
58
+ <div class="nv-key-value-editor-actions">
59
+ <button class="nv-button nv-button--kind-secondary" type="button">
60
+ <i class="nv-icon nv-icon-add" role="img" aria-hidden="true"></i>
61
+ Add new item
62
+ </button>
63
+ </div>
64
+ <span aria-atomic="true" aria-live="polite" class="nv-sr-only"></span>
65
+ </div>
66
+ ```
67
+
68
+ ### Locked rows
69
+
70
+ ```html
71
+ <div class="nv-key-value-editor-root" role="group" style="--nv-key-value-editor-columns: minmax(0, 1fr) minmax(0, 1fr)" aria-label="Tags">
72
+ <div class="nv-key-value-editor-column-headers">
73
+ <span class="nv-key-value-editor-column-header">Key</span>
74
+ <span class="nv-key-value-editor-column-header">Value</span>
75
+ </div>
76
+ <div class="nv-key-value-editor-row">
77
+ <div class="nv-input-shell nv-text-input-root">
78
+ <input type="text" aria-label="Key 1" readonly="" name="tags[0][key]" value="Environment" />
79
+ </div>
80
+ <div class="nv-input-shell nv-text-input-root">
81
+ <input type="text" aria-label="Value 1" name="tags[0][value]" value="production" />
82
+ </div>
83
+ </div>
84
+ <div class="nv-key-value-editor-row">
85
+ <div class="nv-input-shell nv-text-input-root">
86
+ <input type="text" aria-label="Key 2" readonly="" name="tags[1][key]" value="Region" />
87
+ </div>
88
+ <div class="nv-input-shell nv-text-input-root">
89
+ <input type="text" aria-label="Value 2" name="tags[1][value]" value="us-west-2" />
90
+ </div>
91
+ <button class="nv-button nv-button--kind-tertiary" type="button" aria-label="Remove row 2">
92
+ <i class="nv-icon nv-icon-trash" role="img" aria-hidden="true"></i>
93
+ </button>
94
+ </div>
95
+ <div class="nv-key-value-editor-actions">
96
+ <button class="nv-button nv-button--kind-secondary" disabled="" type="button">
97
+ <i class="nv-icon nv-icon-add" role="img" aria-hidden="true"></i>
98
+ Add new item
99
+ </button>
100
+ </div>
101
+ <span aria-atomic="true" aria-live="polite" class="nv-sr-only"></span>
102
+ </div>
103
+ ```
104
+
105
+ ### Density
106
+
107
+ Use `compact` in dense surfaces such as side panels. It renders small inputs and tiny buttons; `standard` renders medium inputs and small buttons.
108
+
109
+ ```html
110
+ <div class="nv-key-value-editor-root nv-key-value-editor-root--density-compact" role="group" style="--nv-key-value-editor-columns: minmax(0, 1fr) minmax(0, 1fr)" aria-label="Tags">
111
+ <div class="nv-key-value-editor-column-headers">
112
+ <span class="nv-key-value-editor-column-header">Key</span>
113
+ <span class="nv-key-value-editor-column-header">Value</span>
114
+ </div>
115
+ <div class="nv-key-value-editor-row">
116
+ <div class="nv-input-shell nv-text-input-root">
117
+ <input type="text" aria-label="Key 1" name="tags[0][key]" value="Environment" />
118
+ </div>
119
+ <div class="nv-input-shell nv-text-input-root">
120
+ <input type="text" aria-label="Value 1" name="tags[0][value]" value="production" />
121
+ </div>
122
+ <button class="nv-button nv-button--kind-tertiary" type="button" aria-label="Remove row 1">
123
+ <i class="nv-icon nv-icon-trash" role="img" aria-hidden="true"></i>
124
+ </button>
125
+ </div>
126
+ <div class="nv-key-value-editor-actions">
127
+ <button class="nv-button nv-button--kind-secondary" type="button">
128
+ <i class="nv-icon nv-icon-add" role="img" aria-hidden="true"></i>
129
+ Add new item
130
+ </button>
131
+ </div>
132
+ <span aria-atomic="true" aria-live="polite" class="nv-sr-only"></span>
133
+ </div>
134
+ ```
135
+
136
+ ### Forms without JavaScript
137
+
138
+ Make the add and remove buttons `type="submit"` with a `name` and `value`, so the server can apply the change and render the form again with what was typed. Move items submit a `from:to` value under their `name`, such as `move=0:1`, so the server can reorder the rows. Pressing Enter in a text field submits through the form's first submit button, so put a hidden submit button for the form's main action before the editor.
139
+
140
+ ```html
141
+ <form class="grid gap-4" method="post">
142
+ <button hidden="" type="submit" value="save" name="intent"></button>
143
+ <div class="nv-key-value-editor-root" role="group" style="--nv-key-value-editor-columns: minmax(0, 1fr) minmax(0, 1fr)" aria-label="Environment variables">
144
+ <div class="nv-key-value-editor-column-headers">
145
+ <span class="nv-key-value-editor-column-header">Key</span>
146
+ <span class="nv-key-value-editor-column-header">Value</span>
147
+ </div>
148
+ <div class="nv-key-value-editor-row">
149
+ <div class="nv-input-shell nv-text-input-root">
150
+ <input type="text" aria-label="Key 1" name="env[0][key]" value="LOG_LEVEL" />
151
+ </div>
152
+ <div class="nv-input-shell nv-text-input-root">
153
+ <input type="text" aria-label="Value 1" name="env[0][value]" value="info" />
154
+ </div>
155
+ <button class="nv-button nv-button--kind-tertiary" type="submit" aria-label="Remove row 1" value="0" name="remove">
156
+ <i class="nv-icon nv-icon-trash" role="img" aria-hidden="true"></i>
157
+ </button>
158
+ <div class="nv-key-value-editor-row-menu">
159
+ <button
160
+ class="nv-button nv-button--kind-tertiary nv-dropdown-trigger"
161
+ type="button"
162
+ popovertarget="nv-dropdown-_R_8ou_"
163
+ data-state="closed"
164
+ aria-haspopup="menu"
165
+ aria-controls="nv-dropdown-_R_8ou_"
166
+ style="--nv-anchor-self: --nv-dropdown-anchor-_R_8ou_"
167
+ aria-label="Actions for row 1"
168
+ >
169
+ <i class="nv-icon nv-icon--fill nv-icon-more-vert" role="img" aria-hidden="true"></i>
170
+ </button>
171
+ <menu
172
+ class="nv-menu-root nv-dropdown-content"
173
+ role="menu"
174
+ aria-orientation="vertical"
175
+ id="nv-dropdown-_R_8ou_"
176
+ popover="auto"
177
+ data-align="end"
178
+ data-side="bottom"
179
+ tabindex="-1"
180
+ style="position-anchor: --nv-dropdown-anchor-_R_8ou_"
181
+ aria-label="Actions for row 1"
182
+ >
183
+ <button class="nv-menu-item nv-menu-item--disabled" role="menuitem" data-disabled="true" disabled="" type="submit" name="move">
184
+ <span class="nv-menu-item-label">Move up</span>
185
+ </button>
186
+ <button class="nv-menu-item" role="menuitem" type="submit" value="0:1" name="move">
187
+ <span class="nv-menu-item-label">Move down</span>
188
+ </button>
189
+ </menu>
190
+ </div>
191
+ </div>
192
+ <div class="nv-key-value-editor-row">
193
+ <div class="nv-input-shell nv-text-input-root">
194
+ <input type="text" aria-label="Key 2" name="env[1][key]" value="TIMEOUT" />
195
+ </div>
196
+ <div class="nv-input-shell nv-text-input-root">
197
+ <input type="text" aria-label="Value 2" name="env[1][value]" value="30s" />
198
+ </div>
199
+ <button class="nv-button nv-button--kind-tertiary" type="submit" aria-label="Remove row 2" value="1" name="remove">
200
+ <i class="nv-icon nv-icon-trash" role="img" aria-hidden="true"></i>
201
+ </button>
202
+ <div class="nv-key-value-editor-row-menu">
203
+ <button
204
+ class="nv-button nv-button--kind-tertiary nv-dropdown-trigger"
205
+ type="button"
206
+ popovertarget="nv-dropdown-_R_98u_"
207
+ data-state="closed"
208
+ aria-haspopup="menu"
209
+ aria-controls="nv-dropdown-_R_98u_"
210
+ style="--nv-anchor-self: --nv-dropdown-anchor-_R_98u_"
211
+ aria-label="Actions for row 2"
212
+ >
213
+ <i class="nv-icon nv-icon--fill nv-icon-more-vert" role="img" aria-hidden="true"></i>
214
+ </button>
215
+ <menu
216
+ class="nv-menu-root nv-dropdown-content"
217
+ role="menu"
218
+ aria-orientation="vertical"
219
+ id="nv-dropdown-_R_98u_"
220
+ popover="auto"
221
+ data-align="end"
222
+ data-side="bottom"
223
+ tabindex="-1"
224
+ style="position-anchor: --nv-dropdown-anchor-_R_98u_"
225
+ aria-label="Actions for row 2"
226
+ >
227
+ <button class="nv-menu-item" role="menuitem" type="submit" value="1:0" name="move">
228
+ <span class="nv-menu-item-label">Move up</span>
229
+ </button>
230
+ <button class="nv-menu-item nv-menu-item--disabled" role="menuitem" data-disabled="true" disabled="" type="submit" name="move">
231
+ <span class="nv-menu-item-label">Move down</span>
232
+ </button>
233
+ </menu>
234
+ </div>
235
+ </div>
236
+ <div class="nv-key-value-editor-actions">
237
+ <button class="nv-button nv-button--kind-secondary" type="submit" value="1" name="add">
238
+ <i class="nv-icon nv-icon-add" role="img" aria-hidden="true"></i>
239
+ Add new item
240
+ </button>
241
+ </div>
242
+ <span aria-atomic="true" aria-live="polite" class="nv-sr-only"></span>
243
+ </div>
244
+ <button class="nv-button nv-button--color-brand justify-self-start" type="submit" value="save" name="intent">Save</button>
245
+ </form>
246
+ ```
247
+
248
+ ## Accessibility
249
+
250
+ The editor is a group named by its heading or `aria-label`. The column headers are visual only, so every control carries a name that includes its row, such as "Key 1" and "Remove row 1". Name the drag handle and the row menu after their row too, such as "Move row 1" and "Actions for row 1".
251
+
252
+ After a press in the editor adds rows, focus moves to the last new row's first input. When the focused row is removed, focus moves to the control at the same place in the row that took its place, or to that row's last control if it is shorter, then to the footer, so keyboard and screen reader users stay in the list. Rows that arrive without a press in the editor, such as from a fetch, leave focus alone.
253
+
254
+ ### Reordering
255
+
256
+ Every way to move a row works without dragging:
257
+
258
+ - **Keyboard:** Tab to a row's handle, then press Up or Down arrow to move the row one place, or Home or End to move it to the start or end. Escape cancels a drag in progress.
259
+ - **Pointer without dragging:** the row menu's Move up and Move down move the row one place with a single click or tap. They stay in the menu after script runs, because dragging is not possible for everyone, such as people using a head pointer, switch control, or voice control (WCAG 2.5.7 Dragging Movements). They are disabled at the first and last row.
260
+ - **Without script:** the handle stays hidden and out of the tab order, and the Move items submit the form.
261
+
262
+ Once your app renders the moved row, the editor announces its new position, such as "Row moved to position 2 of 3.", and puts focus back on the control in the moved row that had it if the move took it away. The editor notices a move from the focused row changing position while the number of rows stays the same, so a move from the handle, the menu, or your own control is announced the same way. A move the app turns down announces nothing. Key each row by a stable id, not its index, so the editor can find the moved row again.
263
+
264
+ ## CSS classes
265
+
266
+ ### Elements
267
+
268
+ `nv-key-value-editor-actions`, `nv-key-value-editor-column-header`, `nv-key-value-editor-column-headers`, `nv-key-value-editor-description`, `nv-key-value-editor-drag-handle`, `nv-key-value-editor-heading`, `nv-key-value-editor-root`, `nv-key-value-editor-row`, `nv-key-value-editor-row-menu`
269
+
270
+ ### Modifiers
271
+
272
+ | Group | Classes |
273
+ | --- | --- |
274
+ | density | `nv-key-value-editor-root--density-compact` |
275
+ | state | `nv-key-value-editor-root--draggable` |
@@ -0,0 +1,35 @@
1
+ # KeyValueGroup
2
+
3
+ A description list of labeled values, such as the properties of one resource. Renders a native `<dl>`.
4
+
5
+ ## Examples
6
+
7
+ ```html
8
+ <dl class="nv-key-value-group-root nv-key-value-group-root--orientation-vertical" data-orientation="vertical">
9
+ <div class="nv-key-value-group-item nv-key-value-group-item--orientation-horizontal" data-orientation="horizontal">
10
+ <dt class="nv-key-value-group-key">Owner</dt>
11
+ <dd class="nv-key-value-group-value">Jordan Lee</dd>
12
+ </div>
13
+ <div class="nv-key-value-group-item nv-key-value-group-item--orientation-horizontal" data-orientation="horizontal">
14
+ <dt class="nv-key-value-group-key">Region</dt>
15
+ <dd class="nv-key-value-group-value">us-west-2</dd>
16
+ </div>
17
+ </dl>
18
+ ```
19
+
20
+ ## CSS classes
21
+
22
+ ### Elements
23
+
24
+ `nv-key-value-group-item`, `nv-key-value-group-key`, `nv-key-value-group-root`, `nv-key-value-group-value`
25
+
26
+ ### Modifiers
27
+
28
+ | Group | Classes |
29
+ | --- | --- |
30
+ | orientation | `nv-key-value-group-item--orientation-horizontal`, `nv-key-value-group-item--orientation-vertical`, `nv-key-value-group-root--orientation-horizontal`, `nv-key-value-group-root--orientation-vertical` |
31
+
32
+ ## See also
33
+
34
+ - [Table](./Table.md)
35
+ - [List](./List.md)
@@ -0,0 +1,86 @@
1
+ # Label
2
+
3
+ A text label that names a form control.
4
+
5
+ ## When to use
6
+
7
+ Reach for [FormField](./FormField.md) first. Its classes lay out the label, the helper text, and the validation message. Set `aria-describedby` on the control to the helper's `id`, and `aria-invalid="true"` when it shows an error. Use the `nv-label` class directly when you compose a custom field layout that FormField does not cover.
8
+
9
+ ## Usage guidelines
10
+
11
+ The required indicator belongs on the label that names the field, and only once. It is presentational: assistive technology hears required state from the control, so set `required` (or `aria-required`) on the control as well.
12
+
13
+ - A label names one control. Name a group of checkboxes or radios with a `<fieldset>` and its `<legend>`, and give each option its own label.
14
+ - `disabled` only dims the label. Use it alongside a control that is itself disabled, so the two do not disagree.
15
+ - Match the label size to the control it names.
16
+
17
+ ## Examples
18
+
19
+ ```html
20
+ <div class="nv-flex nv-flex--align-stretch nv-flex--direction-col nv-flex--justify-start nv-flex--wrap-nowrap nv-primitive--gap-density-md">
21
+ <label class="nv-label nv-label--size-medium" for="label-email">Email address</label>
22
+ <div class="nv-input-shell nv-text-input-root"><input id="label-email" type="email" name="email" /></div>
23
+ </div>
24
+ ```
25
+
26
+ ### Required
27
+
28
+ ```html
29
+ <div class="nv-flex nv-flex--align-stretch nv-flex--direction-col nv-flex--justify-start nv-flex--wrap-nowrap nv-primitive--gap-density-md">
30
+ <label class="nv-label nv-label--required nv-label--size-medium" for="label-required-email">Email address</label>
31
+ <div class="nv-input-shell nv-text-input-root">
32
+ <input id="label-required-email" required="" type="email" placeholder="name@example.com" name="email" />
33
+ </div>
34
+ </div>
35
+ ```
36
+
37
+ ### Size
38
+
39
+ ```html
40
+ <div class="nv-flex nv-flex--align-stretch nv-flex--direction-col nv-flex--justify-start nv-flex--wrap-nowrap nv-primitive--gap-density-xl">
41
+ <div class="nv-flex nv-flex--align-stretch nv-flex--direction-col nv-flex--justify-start nv-flex--wrap-nowrap nv-primitive--gap-density-md">
42
+ <label class="nv-label nv-label--size-small" for="label-size-small">Small</label>
43
+ <div class="nv-input-shell nv-input-shell--size-small nv-text-input-root">
44
+ <input id="label-size-small" type="text" name="small" />
45
+ </div>
46
+ </div>
47
+ <div class="nv-flex nv-flex--align-stretch nv-flex--direction-col nv-flex--justify-start nv-flex--wrap-nowrap nv-primitive--gap-density-md">
48
+ <label class="nv-label nv-label--size-medium" for="label-size-medium">Medium</label>
49
+ <div class="nv-input-shell nv-text-input-root"><input id="label-size-medium" type="text" name="medium" /></div>
50
+ </div>
51
+ <div class="nv-flex nv-flex--align-stretch nv-flex--direction-col nv-flex--justify-start nv-flex--wrap-nowrap nv-primitive--gap-density-md">
52
+ <label class="nv-label nv-label--size-large" for="label-size-large">Large</label>
53
+ <div class="nv-input-shell nv-input-shell--size-large nv-text-input-root">
54
+ <input id="label-size-large" type="text" name="large" />
55
+ </div>
56
+ </div>
57
+ </div>
58
+ ```
59
+
60
+ ### Disabled
61
+
62
+ ```html
63
+ <div class="nv-flex nv-flex--align-stretch nv-flex--direction-col nv-flex--justify-start nv-flex--wrap-nowrap nv-primitive--gap-density-md">
64
+ <label class="nv-label nv-label--disabled nv-label--size-medium" for="label-disabled-organization"> Organization </label>
65
+ <div class="nv-input-shell nv-text-input-root">
66
+ <input id="label-disabled-organization" type="text" disabled="" name="organization" value="NVIDIA" />
67
+ </div>
68
+ </div>
69
+ ```
70
+
71
+ ## Accessibility
72
+
73
+ Point `for` on the `<label>` at the control's `id`, or nest the control inside the `<label>`. Without one of the two, the label names nothing and the control is unlabelled.
74
+
75
+ ## CSS classes
76
+
77
+ ### Elements
78
+
79
+ `nv-label`
80
+
81
+ ### Modifiers
82
+
83
+ | Group | Classes |
84
+ | --- | --- |
85
+ | size | `nv-label--size-large`, `nv-label--size-medium`, `nv-label--size-small` |
86
+ | state | `nv-label--disabled`, `nv-label--required` |