@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.
- package/CHANGELOG.md +11 -0
- package/LICENSE.md +203 -0
- package/NOTICE.md +62 -0
- package/README.md +61 -2
- package/dist/base/a11y.css +1 -0
- package/dist/base/all.js +1225 -0
- package/dist/base/anchor.css +1 -0
- package/dist/base/base-external.css +15 -0
- package/dist/base/base-for-aem-only.css +15 -0
- package/dist/base/base.css +15 -0
- package/dist/base/fonts-external.css +1 -0
- package/dist/base/fonts.css +1 -0
- package/dist/base/icons.css +15 -0
- package/dist/base/motion.css +1 -0
- package/dist/base/reset.css +1 -0
- package/dist/base/theme-dark.css +1 -0
- package/dist/base/theme-density.css +1 -0
- package/dist/base/theme-light.css +1 -0
- package/dist/base/theme-only-dark.css +1 -0
- package/dist/base/top-layer-reset.css +1 -0
- package/dist/base/variables.css +1 -0
- package/dist/components/accordion.css +1 -0
- package/dist/components/all.css +1 -0
- package/dist/components/all.js +16546 -0
- package/dist/components/anchor.css +1 -0
- package/dist/components/animated-chevron.css +1 -0
- package/dist/components/app-bar.css +1 -0
- package/dist/components/attachment.css +1 -0
- package/dist/components/audio.css +1 -0
- package/dist/components/autocomplete.css +1 -0
- package/dist/components/avatar-group.css +1 -0
- package/dist/components/avatar.css +1 -0
- package/dist/components/badge.css +1 -0
- package/dist/components/banner.css +1 -0
- package/dist/components/block.css +1 -0
- package/dist/components/breadcrumbs.css +1 -0
- package/dist/components/button.css +1 -0
- package/dist/components/card.css +1 -0
- package/dist/components/carousel.css +1 -0
- package/dist/components/chat-bubble.css +1 -0
- package/dist/components/checkbox.css +1 -0
- package/dist/components/code-snippet.css +1 -0
- package/dist/components/collapsible.css +1 -0
- package/dist/components/combobox.css +1 -0
- package/dist/components/command.css +1 -0
- package/dist/components/context-menu.css +1 -0
- package/dist/components/date-picker.css +1 -0
- package/dist/components/divider.css +1 -0
- package/dist/components/dropdown.css +1 -0
- package/dist/components/flex.css +1 -0
- package/dist/components/form-field.css +1 -0
- package/dist/components/grid-item.css +1 -0
- package/dist/components/grid.css +1 -0
- package/dist/components/group.css +1 -0
- package/dist/components/halo.css +1 -0
- package/dist/components/hero.css +1 -0
- package/dist/components/horizontal-nav.css +1 -0
- package/dist/components/hover-card.css +1 -0
- package/dist/components/inline-notice.css +1 -0
- package/dist/components/input-shell.css +1 -0
- package/dist/components/jump-nav.css +1 -0
- package/dist/components/kbd.css +1 -0
- package/dist/components/key-value-editor.css +1 -0
- package/dist/components/key-value-group.css +1 -0
- package/dist/components/label.css +1 -0
- package/dist/components/legend.css +1 -0
- package/dist/components/list.css +1 -0
- package/dist/components/menu.css +1 -0
- package/dist/components/meter.css +1 -0
- package/dist/components/modal.css +1 -0
- package/dist/components/notification.css +1 -0
- package/dist/components/otp-input.css +1 -0
- package/dist/components/page-header.css +1 -0
- package/dist/components/pagination.css +1 -0
- package/dist/components/panel.css +1 -0
- package/dist/components/popover.css +1 -0
- package/dist/components/primitive.css +1 -0
- package/dist/components/progress-bar.css +1 -0
- package/dist/components/radio-group.css +1 -0
- package/dist/components/range-slider.css +1 -0
- package/dist/components/rating.css +1 -0
- package/dist/components/reaction-group.css +1 -0
- package/dist/components/resizable.css +1 -0
- package/dist/components/segmented-control.css +1 -0
- package/dist/components/segmented-meter.css +1 -0
- package/dist/components/select.css +1 -0
- package/dist/components/severity.css +1 -0
- package/dist/components/side-panel.css +1 -0
- package/dist/components/skeleton.css +1 -0
- package/dist/components/slider.css +1 -0
- package/dist/components/spinner.css +1 -0
- package/dist/components/status-indicator.css +1 -0
- package/dist/components/status-message.css +1 -0
- package/dist/components/stepper.css +1 -0
- package/dist/components/switch.css +1 -0
- package/dist/components/table.css +1 -0
- package/dist/components/tabs.css +1 -0
- package/dist/components/tag-group.css +1 -0
- package/dist/components/tag.css +1 -0
- package/dist/components/terminal-line.css +1 -0
- package/dist/components/text-area.css +1 -0
- package/dist/components/text-content.css +1 -0
- package/dist/components/text.css +1 -0
- package/dist/components/toast.css +1 -0
- package/dist/components/toaster.css +1 -0
- package/dist/components/toggle-button-group.css +1 -0
- package/dist/components/toggle-button.css +1 -0
- package/dist/components/tooltip.css +1 -0
- package/dist/components/tree-nav.css +1 -0
- package/dist/components/upload.css +1 -0
- package/dist/components/vertical-nav.css +1 -0
- package/dist/css-sizes.js +1279 -0
- package/dist/index.cjs +3041 -0
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +3014 -0
- package/dist/plugins/tailwind-theme.css +504 -0
- package/dist/plugins/tailwind3-theme.js +682 -0
- package/dist/plugins/variables-sass.sass +414 -0
- package/dist/themes/kui11/_theme-selectors.css +1 -0
- package/dist/themes/kui11/accordion.css +1 -0
- package/dist/themes/kui11/app-bar.css +1 -0
- package/dist/themes/kui11/avatar.css +1 -0
- package/dist/themes/kui11/badge.css +1 -0
- package/dist/themes/kui11/banner.css +1 -0
- package/dist/themes/kui11/base.css +1 -0
- package/dist/themes/kui11/breadcrumbs.css +1 -0
- package/dist/themes/kui11/button.css +1 -0
- package/dist/themes/kui11/card.css +1 -0
- package/dist/themes/kui11/checkbox.css +1 -0
- package/dist/themes/kui11/components.css +1 -0
- package/dist/themes/kui11/date-picker.css +1 -0
- package/dist/themes/kui11/form-field.css +1 -0
- package/dist/themes/kui11/hero.css +1 -0
- package/dist/themes/kui11/horizontal-nav.css +1 -0
- package/dist/themes/kui11/input-shell.css +1 -0
- package/dist/themes/kui11/label.css +1 -0
- package/dist/themes/kui11/menu.css +1 -0
- package/dist/themes/kui11/modal.css +1 -0
- package/dist/themes/kui11/notification.css +1 -0
- package/dist/themes/kui11/page-header.css +1 -0
- package/dist/themes/kui11/pagination.css +1 -0
- package/dist/themes/kui11/popover.css +1 -0
- package/dist/themes/kui11/progress-bar.css +1 -0
- package/dist/themes/kui11/radio-group.css +1 -0
- package/dist/themes/kui11/range-slider.css +1 -0
- package/dist/themes/kui11/side-panel.css +1 -0
- package/dist/themes/kui11/slider.css +1 -0
- package/dist/themes/kui11/spinner.css +1 -0
- package/dist/themes/kui11/status-message.css +1 -0
- package/dist/themes/kui11/switch.css +1 -0
- package/dist/themes/kui11/table.css +1 -0
- package/dist/themes/kui11/tabs.css +1 -0
- package/dist/themes/kui11/tag.css +1 -0
- package/dist/themes/kui11/text-area.css +1 -0
- package/dist/themes/kui11/text-input.css +1 -0
- package/dist/themes/kui11/text.css +1 -0
- package/dist/themes/kui11/toast.css +1 -0
- package/dist/themes/kui11/tooltip.css +1 -0
- package/dist/themes/kui11/vertical-nav.css +1 -0
- package/dist/themes/kui11.base.css +1 -0
- package/dist/themes/kui11.base.js +935 -0
- package/dist/themes/kui11.components.css +1 -0
- package/dist/themes/kui11.components.js +2564 -0
- package/dist/themes/kui11.css +1 -0
- package/dist/themes/theme-partials.js +456 -0
- package/dist/utilities/all.js +442 -0
- package/dist/utilities/typography-utils.css +1 -0
- package/package.json +106 -3
- package/scripts/sync-skills.mjs +237 -0
- package/skills/kaizen-ui-html-css/SKILL.md +293 -0
- package/skills/kaizen-ui-html-css/assets/color-primitives-hex.md +141 -0
- package/skills/kaizen-ui-html-css/references/blocks/chat-input.md +94 -0
- package/skills/kaizen-ui-html-css/references/blocks/notification-center.md +320 -0
- package/skills/kaizen-ui-html-css/references/blocks/timeline.md +579 -0
- package/skills/kaizen-ui-html-css/references/components/Accordion.md +88 -0
- package/skills/kaizen-ui-html-css/references/components/Anchor.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/AnimatedChevron.md +31 -0
- package/skills/kaizen-ui-html-css/references/components/AppBar.md +129 -0
- package/skills/kaizen-ui-html-css/references/components/Attachment.md +306 -0
- package/skills/kaizen-ui-html-css/references/components/Audio.md +21 -0
- package/skills/kaizen-ui-html-css/references/components/Autocomplete.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/Avatar.md +28 -0
- package/skills/kaizen-ui-html-css/references/components/AvatarGroup.md +38 -0
- package/skills/kaizen-ui-html-css/references/components/Badge.md +121 -0
- package/skills/kaizen-ui-html-css/references/components/Banner.md +49 -0
- package/skills/kaizen-ui-html-css/references/components/Block.md +26 -0
- package/skills/kaizen-ui-html-css/references/components/Breadcrumbs.md +42 -0
- package/skills/kaizen-ui-html-css/references/components/Button.md +43 -0
- package/skills/kaizen-ui-html-css/references/components/ButtonGroup.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/Card.md +39 -0
- package/skills/kaizen-ui-html-css/references/components/Carousel.md +53 -0
- package/skills/kaizen-ui-html-css/references/components/ChatBubble.md +28 -0
- package/skills/kaizen-ui-html-css/references/components/Checkbox.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/CodeSnippet.md +33 -0
- package/skills/kaizen-ui-html-css/references/components/Collapsible.md +56 -0
- package/skills/kaizen-ui-html-css/references/components/Combobox.md +66 -0
- package/skills/kaizen-ui-html-css/references/components/Command.md +100 -0
- package/skills/kaizen-ui-html-css/references/components/ContextMenu.md +61 -0
- package/skills/kaizen-ui-html-css/references/components/DatePicker.md +30 -0
- package/skills/kaizen-ui-html-css/references/components/Divider.md +28 -0
- package/skills/kaizen-ui-html-css/references/components/Dropdown.md +94 -0
- package/skills/kaizen-ui-html-css/references/components/Flex.md +33 -0
- package/skills/kaizen-ui-html-css/references/components/FormField.md +35 -0
- package/skills/kaizen-ui-html-css/references/components/Grid.md +27 -0
- package/skills/kaizen-ui-html-css/references/components/Group.md +92 -0
- package/skills/kaizen-ui-html-css/references/components/Halo.md +26 -0
- package/skills/kaizen-ui-html-css/references/components/Hero.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/HorizontalNav.md +34 -0
- package/skills/kaizen-ui-html-css/references/components/HoverCard.md +23 -0
- package/skills/kaizen-ui-html-css/references/components/Inline.md +49 -0
- package/skills/kaizen-ui-html-css/references/components/InlineNotice.md +96 -0
- package/skills/kaizen-ui-html-css/references/components/InputShell.md +26 -0
- package/skills/kaizen-ui-html-css/references/components/JumpNav.md +36 -0
- package/skills/kaizen-ui-html-css/references/components/Kbd.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/KeyValueEditor.md +275 -0
- package/skills/kaizen-ui-html-css/references/components/KeyValueGroup.md +35 -0
- package/skills/kaizen-ui-html-css/references/components/Label.md +86 -0
- package/skills/kaizen-ui-html-css/references/components/Legend.md +148 -0
- package/skills/kaizen-ui-html-css/references/components/List.md +143 -0
- package/skills/kaizen-ui-html-css/references/components/Menu.md +103 -0
- package/skills/kaizen-ui-html-css/references/components/Meter.md +27 -0
- package/skills/kaizen-ui-html-css/references/components/Modal.md +60 -0
- package/skills/kaizen-ui-html-css/references/components/Notification.md +48 -0
- package/skills/kaizen-ui-html-css/references/components/NumberInput.md +15 -0
- package/skills/kaizen-ui-html-css/references/components/OtpInput.md +51 -0
- package/skills/kaizen-ui-html-css/references/components/PageHeader.md +61 -0
- package/skills/kaizen-ui-html-css/references/components/Pagination.md +63 -0
- package/skills/kaizen-ui-html-css/references/components/Panel.md +133 -0
- package/skills/kaizen-ui-html-css/references/components/Popover.md +31 -0
- package/skills/kaizen-ui-html-css/references/components/ProgressBar.md +187 -0
- package/skills/kaizen-ui-html-css/references/components/RadioGroup.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/RangeSlider.md +62 -0
- package/skills/kaizen-ui-html-css/references/components/Rating.md +69 -0
- package/skills/kaizen-ui-html-css/references/components/ReactionGroup.md +30 -0
- package/skills/kaizen-ui-html-css/references/components/Resizable.md +31 -0
- package/skills/kaizen-ui-html-css/references/components/SegmentedControl.md +36 -0
- package/skills/kaizen-ui-html-css/references/components/SegmentedMeter.md +200 -0
- package/skills/kaizen-ui-html-css/references/components/Select.md +39 -0
- package/skills/kaizen-ui-html-css/references/components/Severity.md +25 -0
- package/skills/kaizen-ui-html-css/references/components/SidePanel.md +42 -0
- package/skills/kaizen-ui-html-css/references/components/Skeleton.md +24 -0
- package/skills/kaizen-ui-html-css/references/components/Slider.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/Spinner.md +63 -0
- package/skills/kaizen-ui-html-css/references/components/Stack.md +17 -0
- package/skills/kaizen-ui-html-css/references/components/StatusIndicator.md +30 -0
- package/skills/kaizen-ui-html-css/references/components/StatusMessage.md +78 -0
- package/skills/kaizen-ui-html-css/references/components/Stepper.md +57 -0
- package/skills/kaizen-ui-html-css/references/components/Switch.md +96 -0
- package/skills/kaizen-ui-html-css/references/components/Table.md +566 -0
- package/skills/kaizen-ui-html-css/references/components/Tabs.md +67 -0
- package/skills/kaizen-ui-html-css/references/components/Tag.md +194 -0
- package/skills/kaizen-ui-html-css/references/components/TagGroup.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/TerminalLine.md +69 -0
- package/skills/kaizen-ui-html-css/references/components/Text.md +27 -0
- package/skills/kaizen-ui-html-css/references/components/TextArea.md +28 -0
- package/skills/kaizen-ui-html-css/references/components/TextContent.md +61 -0
- package/skills/kaizen-ui-html-css/references/components/TextInput.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/TimeInput.md +17 -0
- package/skills/kaizen-ui-html-css/references/components/Toast.md +41 -0
- package/skills/kaizen-ui-html-css/references/components/Toaster.md +19 -0
- package/skills/kaizen-ui-html-css/references/components/ToggleButton.md +47 -0
- package/skills/kaizen-ui-html-css/references/components/ToggleButtonGroup.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/Tooltip.md +45 -0
- package/skills/kaizen-ui-html-css/references/components/TreeNav.md +58 -0
- package/skills/kaizen-ui-html-css/references/components/Upload.md +90 -0
- package/skills/kaizen-ui-html-css/references/components/VerticalNav.md +65 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/CHART_DATA_COLORS.md +56 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/COLORS.md +148 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/COLOR_PRIMITIVES.md +31 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/EFFECTS_AND_LAYOUT.md +50 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/SPACING_SCALE.md +36 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/TYPOGRAPHY.md +44 -0
- package/skills/kaizen-ui-html-css/references/guides/CONFIGURATION.md +51 -0
- package/skills/kaizen-ui-html-css/references/guides/HTML_STRUCTURE.md +134 -0
- package/skills/kaizen-ui-html-css/references/patterns/activity-feed.md +132 -0
- package/skills/kaizen-ui-html-css/references/patterns/confirmations.md +133 -0
- package/skills/kaizen-ui-html-css/references/patterns/data-display.md +127 -0
- package/skills/kaizen-ui-html-css/references/patterns/data-visualization.md +73 -0
- package/skills/kaizen-ui-html-css/references/patterns/element-visibility.md +83 -0
- package/skills/kaizen-ui-html-css/references/patterns/empty-states.md +116 -0
- package/skills/kaizen-ui-html-css/references/patterns/entity-cards.md +172 -0
- package/skills/kaizen-ui-html-css/references/patterns/error-states.md +163 -0
- package/skills/kaizen-ui-html-css/references/patterns/feedback.md +77 -0
- package/skills/kaizen-ui-html-css/references/patterns/filters.md +167 -0
- package/skills/kaizen-ui-html-css/references/patterns/forms.md +215 -0
- package/skills/kaizen-ui-html-css/references/patterns/key-value-display.md +195 -0
- package/skills/kaizen-ui-html-css/references/patterns/loading.md +104 -0
- package/skills/kaizen-ui-html-css/references/patterns/navigation.md +154 -0
- package/skills/kaizen-ui-html-css/references/patterns/ranked-lists.md +60 -0
- package/skills/kaizen-ui-html-css/references/patterns/search.md +46 -0
- package/skills/kaizen-ui-html-css/references/patterns/settings.md +106 -0
- package/skills/kaizen-ui-html-css/references/patterns/stat-blocks.md +71 -0
- package/skills/kaizen-ui-html-css/references/templates/browse-page.md +92 -0
- package/skills/kaizen-ui-html-css/references/templates/dashboard.md +356 -0
- package/skills/kaizen-ui-html-css/references/templates/detail-page.md +424 -0
- package/skills/kaizen-ui-html-css/references/templates/detail-placement.md +68 -0
- package/skills/kaizen-ui-html-css/references/templates/error-page.md +82 -0
- package/skills/kaizen-ui-html-css/references/templates/form-page.md +256 -0
- package/skills/kaizen-ui-html-css/references/templates/layout-principles.md +152 -0
- package/skills/kaizen-ui-html-css/references/templates/list-view.md +229 -0
- package/skills/kaizen-ui-html-css/references/templates/page-modification.md +33 -0
- package/skills/kaizen-ui-html-css/references/templates/page-shell.md +225 -0
- package/skills/kaizen-ui-html-css/references/templates/workspace-page.md +427 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Typography tokens
|
|
2
|
+
|
|
3
|
+
KUI implements the NVIDIA Brand typography system as named variants exposed through framework APIs and CSS utility classes. Pick a variant so font size, weight, and line height remain consistent. **Do not hand-tune `font-size`, `font-weight`, or `line-height` directly.**
|
|
4
|
+
|
|
5
|
+
## Picking a kind
|
|
6
|
+
|
|
7
|
+
Five categories. Pick by **purpose**, not by visual size.
|
|
8
|
+
|
|
9
|
+
| Category | Purpose | Sizes |
|
|
10
|
+
| -------- | -------------------------------------- | -------------------------------- |
|
|
11
|
+
| display | Large hero headings and page titles. | `2xl xl lg md sm xs` |
|
|
12
|
+
| title | Section headings and subheadings. | `2xl xl lg md sm xs` |
|
|
13
|
+
| body | Paragraphs and main content. | `3xl 2xl xl lg md sm xs` |
|
|
14
|
+
| label | UI labels, captions, dense small text. | `3xl 2xl xl lg md sm xs` |
|
|
15
|
+
| mono | Code snippets and monospace. | `md sm` (and a few larger sizes) |
|
|
16
|
+
|
|
17
|
+
`body` and `label` also accept a **weight**: `regular`, `semibold`, `bold`, `light`, `italic`. A complete variant name looks like `body/bold/md` and maps to the `text-body-bold-md` CSS utility.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Apply the corresponding CSS utility class to semantic text, for example `class="text-body-bold-md"`. These utilities come from `@nvidia/foundations-css/typography.css`.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
`display` and `title` are bold-only — no weight in the name (`display/xl`, `text-title-lg`).
|
|
29
|
+
|
|
30
|
+
## Defaults when unsure
|
|
31
|
+
|
|
32
|
+
- Page heading → `display/xl` or `display/lg`.
|
|
33
|
+
- Section heading → `title/lg` or `title/md`.
|
|
34
|
+
- Paragraph copy → `body/regular/md`.
|
|
35
|
+
- Form labels and table headers → `label/regular/sm` or `label/semibold/sm`.
|
|
36
|
+
- Code → `mono/md`.
|
|
37
|
+
|
|
38
|
+
## Tailwind class shape
|
|
39
|
+
|
|
40
|
+
The utility class is the variant name with slashes replaced by dashes: `body/bold/md` becomes `text-body-bold-md`.
|
|
41
|
+
|
|
42
|
+
## Fonts and semantics
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
Install the stylesheet package. No component runtime is required.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @nvidia/foundations-css
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Import the base styles before the component styles:
|
|
12
|
+
|
|
13
|
+
```css
|
|
14
|
+
@import "@nvidia/foundations-css/base.css";
|
|
15
|
+
@import "@nvidia/foundations-css/components.css";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Use `base-external.css` in place of `base.css` for non-NVIDIA applications, where proprietary NVIDIA Sans font should not be used:
|
|
19
|
+
|
|
20
|
+
```css
|
|
21
|
+
@import "@nvidia/foundations-css/base-external.css";
|
|
22
|
+
@import "@nvidia/foundations-css/components.css";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Prototypes and HTML-only projects without a package manager can load the same stylesheets from the NVIDIA web assets CDN. Pin the version so an application does not pick up component changes unexpectedly.
|
|
26
|
+
|
|
27
|
+
## Themes
|
|
28
|
+
|
|
29
|
+
Apply a color theme and a density theme near the root of the document. Both are plain classes, so they can also be applied to a subtree to scope a region.
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<html class="nv-light nv-density-standard">
|
|
33
|
+
<body>
|
|
34
|
+
<button class="nv-button nv-button--kind-primary nv-button--color-brand">
|
|
35
|
+
Start training
|
|
36
|
+
</button>
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Color themes are `nv-light` and `nv-dark`. Every semantic token resolves against the nearest theme class, so a component inside `nv-dark` needs no dark-specific classes of its own.
|
|
42
|
+
|
|
43
|
+
## Typography
|
|
44
|
+
|
|
45
|
+
The base stylesheet supplies typography tokens, but `components.css` does not include standalone typography utilities. Import `@nvidia/foundations-css/typography.css` for classes such as `text-display-xl`, or generate them with the Tailwind plugin.
|
|
46
|
+
|
|
47
|
+
## Tokens
|
|
48
|
+
|
|
49
|
+
Design tokens are available as CSS variables once the base stylesheet is imported, for example `var(--background-color-surface-raised)`. Use them for any custom rule so the result follows the active theme and density.
|
|
50
|
+
|
|
51
|
+
Spacing and color utilities such as `p-density-lg` and `bg-surface-raised` require `@nvidia/foundations-tailwind-plugin`, which is a separate opt-in. Without it, write plain CSS against the token variables; standalone typography classes remain available through the stylesheet above.
|
|
@@ -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)
|