@commercetools/nimbus-mcp 3.2.0 → 3.4.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/README.md +9 -1
- package/data/docs/route-manifest.json +1608 -143
- package/data/docs/routes/components-buttons-button.json +25 -2
- package/data/docs/routes/components-chat-chat-message-list.json +448 -0
- package/data/docs/routes/components-chat-chat-message.json +580 -0
- package/data/docs/routes/components-content-markdown.json +548 -0
- package/data/docs/routes/components-data-display-item-group.json +413 -0
- package/data/docs/routes/components-data-display-item.json +611 -0
- package/data/docs/routes/components-feedback-activity-indicator.json +396 -0
- package/data/docs/routes/components-feedback-skeleton.json +481 -0
- package/data/docs/routes/components-feedback-skeletoncircle.json +429 -0
- package/data/docs/routes/components-feedback-skeletontext.json +417 -0
- package/data/docs/routes/components-feedback-tooltip.json +23 -1
- package/data/docs/routes/components-inputs-drop-zone.json +562 -0
- package/data/docs/routes/components-inputs-file-trigger.json +421 -0
- package/data/docs/routes/components-inputs-range-slider.json +633 -0
- package/data/docs/routes/components-inputs-slider.json +611 -0
- package/data/docs/routes/components-layout-splitter.json +3 -3
- package/data/docs/routes/components-media-avatar.json +16 -5
- package/data/docs/routes/components-navigation-breadcrumbs.json +565 -0
- package/data/docs/routes/components-navigation-menu.json +1 -1
- package/data/docs/routes/components-navigation-tabnav.json +80 -14
- package/data/docs/routes/components-navigation-tabs.json +44 -11
- package/data/docs/routes/components-navigation-tree.json +445 -0
- package/data/docs/routes/home-getting-started-mcp-server-overview.json +2 -2
- package/data/docs/routes/home-getting-started-mcp-server-setup.json +2 -2
- package/data/docs/routes/icons.json +3 -3
- package/data/docs/routes/patterns-buttons-floating-action-button.json +392 -0
- package/data/docs/routes/patterns-buttons.json +58 -0
- package/data/docs/search-index.json +1 -1
- package/data/docs/types/AccordionContent.json +24 -24
- package/data/docs/types/AccordionHeader.json +88 -88
- package/data/docs/types/AccordionItem.json +20 -20
- package/data/docs/types/AccordionRoot.json +14 -14
- package/data/docs/types/ActivityIndicator.json +202 -0
- package/data/docs/types/AlertDescription.json +8 -8
- package/data/docs/types/AlertDismissButton.json +98 -81
- package/data/docs/types/AlertTitle.json +8 -8
- package/data/docs/types/Avatar.json +19 -2
- package/data/docs/types/Badge.json +2 -2
- package/data/docs/types/Body.json +6 -6
- package/data/docs/types/Box.json +6 -6
- package/data/docs/types/Breadcrumbs.json +12 -0
- package/data/docs/types/BreadcrumbsItem.json +296 -0
- package/data/docs/types/BreadcrumbsItemProps.json +9 -0
- package/data/docs/types/BreadcrumbsProps.json +9 -0
- package/data/docs/types/BreadcrumbsRoot.json +110 -0
- package/data/docs/types/Button.json +106 -89
- package/data/docs/types/Calendar.json +56 -56
- package/data/docs/types/Caption.json +6 -6
- package/data/docs/types/CardRoot.json +2 -2
- package/data/docs/types/Cell.json +6 -6
- package/data/docs/types/ChatMessage.json +12 -0
- package/data/docs/types/ChatMessageActions.json +42 -0
- package/data/docs/types/ChatMessageAvatar.json +140 -0
- package/data/docs/types/ChatMessageBody.json +42 -0
- package/data/docs/types/ChatMessageList.json +12 -0
- package/data/docs/types/ChatMessageListItem.json +42 -0
- package/data/docs/types/ChatMessageListRoot.json +78 -0
- package/data/docs/types/ChatMessageMeta.json +42 -0
- package/data/docs/types/ChatMessageRoot.json +119 -0
- package/data/docs/types/ChatMessageTyping.json +42 -0
- package/data/docs/types/Checkbox.json +86 -86
- package/data/docs/types/Code.json +11 -11
- package/data/docs/types/Column.json +6 -6
- package/data/docs/types/ColumnGroup.json +6 -6
- package/data/docs/types/ColumnHeader.json +6 -6
- package/data/docs/types/ComboBoxListBox.json +70 -70
- package/data/docs/types/ComboBoxOption.json +64 -64
- package/data/docs/types/ComboBoxPopover.json +91 -70
- package/data/docs/types/ComboBoxRoot.json +8 -8
- package/data/docs/types/ComboBoxSection.json +24 -24
- package/data/docs/types/ComboBoxTrigger.json +6 -6
- package/data/docs/types/DataTable.json +2 -2
- package/data/docs/types/DataTableBody.json +20 -20
- package/data/docs/types/DataTableHeader.json +25 -25
- package/data/docs/types/DataTableRoot.json +2 -2
- package/data/docs/types/DataTableTable.json +6 -6
- package/data/docs/types/DateInput.json +73 -73
- package/data/docs/types/DatePicker.json +58 -58
- package/data/docs/types/DateRangePicker.json +86 -86
- package/data/docs/types/DateRangePickerField.json +86 -86
- package/data/docs/types/DefaultPageRoot.json +2 -2
- package/data/docs/types/DialogCloseTrigger.json +96 -79
- package/data/docs/types/DraggableListField.json +88 -60
- package/data/docs/types/DraggableListItem.json +52 -52
- package/data/docs/types/DraggableListRoot.json +88 -60
- package/data/docs/types/DrawerCloseTrigger.json +96 -79
- package/data/docs/types/DropZone.json +161 -0
- package/data/docs/types/FieldErrors.json +2 -2
- package/data/docs/types/FileTrigger.json +130 -0
- package/data/docs/types/Flex.json +22 -22
- package/data/docs/types/FloatingActionButton.json +1036 -0
- package/data/docs/types/Footer.json +6 -6
- package/data/docs/types/FormActionBar.json +1 -1
- package/data/docs/types/FormFieldRoot.json +2 -2
- package/data/docs/types/Grid.json +24 -24
- package/data/docs/types/Group.json +12 -12
- package/data/docs/types/Header.json +6 -6
- package/data/docs/types/Heading.json +8 -8
- package/data/docs/types/Icon.json +4 -4
- package/data/docs/types/IconButton.json +106 -89
- package/data/docs/types/IconToggleButton.json +71 -71
- package/data/docs/types/Image.json +43 -43
- package/data/docs/types/Indicator.json +6 -6
- package/data/docs/types/InlineSvg.json +2 -2
- package/data/docs/types/Item.json +6 -6
- package/data/docs/types/ItemActions.json +27 -0
- package/data/docs/types/ItemContent.json +27 -0
- package/data/docs/types/ItemDescription.json +27 -0
- package/data/docs/types/ItemFooter.json +27 -0
- package/data/docs/types/ItemGroup.json +12 -0
- package/data/docs/types/ItemGroupRoot.json +27 -0
- package/data/docs/types/ItemGroupSeparator.json +27 -0
- package/data/docs/types/ItemHeader.json +27 -0
- package/data/docs/types/ItemMedia.json +56 -0
- package/data/docs/types/ItemRoot.json +239 -0
- package/data/docs/types/ItemTitle.json +27 -0
- package/data/docs/types/Kbd.json +8 -8
- package/data/docs/types/Link.json +14 -14
- package/data/docs/types/ListIndicator.json +6 -6
- package/data/docs/types/ListItem.json +6 -6
- package/data/docs/types/ListRoot.json +11 -11
- package/data/docs/types/LoadingSpinner.json +2 -2
- package/data/docs/types/MakeElementFocusable.json +18 -18
- package/data/docs/types/Markdown.json +183 -0
- package/data/docs/types/MenuItem.json +62 -62
- package/data/docs/types/MenuRoot.json +55 -55
- package/data/docs/types/MenuSection.json +30 -30
- package/data/docs/types/MenuSubmenuTrigger.json +4 -4
- package/data/docs/types/MenuTrigger.json +88 -88
- package/data/docs/types/MultilineTextInput.json +104 -104
- package/data/docs/types/MultilineTextInputField.json +102 -102
- package/data/docs/types/NumberInput.json +86 -86
- package/data/docs/types/NumberInputField.json +82 -82
- package/data/docs/types/PageContentColumn.json +6 -6
- package/data/docs/types/PageContentRoot.json +6 -6
- package/data/docs/types/PasswordInput.json +100 -100
- package/data/docs/types/PasswordInputField.json +100 -100
- package/data/docs/types/ProgressBar.json +13 -13
- package/data/docs/types/RadioInputOption.json +56 -56
- package/data/docs/types/RadioInputRoot.json +48 -48
- package/data/docs/types/RangeCalendar.json +58 -58
- package/data/docs/types/RangeSlider.json +337 -0
- package/data/docs/types/RangeSliderProps.json +9 -0
- package/data/docs/types/Region.json +6 -6
- package/data/docs/types/RegionTarget.json +6 -6
- package/data/docs/types/RichTextInput.json +2 -2
- package/data/docs/types/Root.json +11 -11
- package/data/docs/types/Row.json +6 -6
- package/data/docs/types/ScrollArea.json +2 -2
- package/data/docs/types/SearchInput.json +106 -106
- package/data/docs/types/SearchInputField.json +102 -102
- package/data/docs/types/SelectOption.json +54 -54
- package/data/docs/types/SelectOptionGroup.json +18 -18
- package/data/docs/types/SelectOptions.json +64 -64
- package/data/docs/types/SelectRoot.json +92 -92
- package/data/docs/types/Separator.json +4 -4
- package/data/docs/types/SimpleGrid.json +28 -28
- package/data/docs/types/Skeleton.json +129 -0
- package/data/docs/types/SkeletonCircle.json +103 -0
- package/data/docs/types/SkeletonCircleProps.json +9 -0
- package/data/docs/types/SkeletonProps.json +9 -0
- package/data/docs/types/SkeletonText.json +62 -0
- package/data/docs/types/SkeletonTextProps.json +9 -0
- package/data/docs/types/Slider.json +337 -0
- package/data/docs/types/SlidingIndicatorGeometry.json +9 -0
- package/data/docs/types/SlidingIndicatorRects.json +9 -0
- package/data/docs/types/SplitButton.json +16 -20
- package/data/docs/types/Stack.json +2 -2
- package/data/docs/types/StepsRoot.json +2 -2
- package/data/docs/types/Switch.json +34 -34
- package/data/docs/types/TabNavItem.json +5 -5
- package/data/docs/types/TabNavRoot.json +5 -5
- package/data/docs/types/TableBody.json +6 -6
- package/data/docs/types/TableCaption.json +6 -6
- package/data/docs/types/TableCell.json +6 -6
- package/data/docs/types/TableColumn.json +6 -6
- package/data/docs/types/TableColumnGroup.json +6 -6
- package/data/docs/types/TableColumnHeader.json +6 -6
- package/data/docs/types/TableFooter.json +6 -6
- package/data/docs/types/TableHeader.json +6 -6
- package/data/docs/types/TableRoot.json +19 -19
- package/data/docs/types/TableRow.json +6 -6
- package/data/docs/types/TableScrollArea.json +6 -6
- package/data/docs/types/TabsList.json +2 -2
- package/data/docs/types/TabsPanel.json +2 -2
- package/data/docs/types/TabsPanels.json +2 -2
- package/data/docs/types/TabsRoot.json +3 -3
- package/data/docs/types/TabsTab.json +2 -2
- package/data/docs/types/TagGroupRoot.json +24 -24
- package/data/docs/types/TagGroupTag.json +56 -56
- package/data/docs/types/TagGroupTagList.json +14 -14
- package/data/docs/types/Text.json +8 -8
- package/data/docs/types/TextInput.json +102 -102
- package/data/docs/types/TextInputField.json +100 -100
- package/data/docs/types/TimeInput.json +68 -68
- package/data/docs/types/ToggleButton.json +73 -73
- package/data/docs/types/ToggleButtonGroupButton.json +30 -30
- package/data/docs/types/ToggleButtonGroupRoot.json +20 -20
- package/data/docs/types/Toolbar.json +9 -9
- package/data/docs/types/TooltipContent.json +28 -28
- package/data/docs/types/TooltipRoot.json +16 -16
- package/data/docs/types/Tree.json +12 -0
- package/data/docs/types/TreeIndicator.json +828 -0
- package/data/docs/types/TreeItem.json +559 -0
- package/data/docs/types/TreeItemContent.json +27 -0
- package/data/docs/types/TreeRoot.json +636 -0
- package/data/docs/types/TreeSubTree.json +40 -0
- package/data/docs/types/VisuallyHidden.json +6 -6
- package/data/docs/types/createItemsFromCsvDrop.json +4 -4
- package/data/docs/types/createItemsFromDirectoryDrop.json +4 -4
- package/data/docs/types/createItemsFromFileDrop.json +4 -4
- package/data/docs/types/createItemsFromImageDrop.json +4 -4
- package/data/docs/types/createItemsFromJsonDrop.json +4 -4
- package/data/docs/types/manifest.json +50 -0
- package/data/docs/types/useRegion.json +2 -2
- package/data/docs/types/useSlidingIndicator.json +145 -0
- package/data/docs/types/useTree.json +267 -0
- package/data/tokens.json +21 -0
- package/data/uikit-tokens.json +894 -0
- package/dist/index.js +3298 -109
- package/package.json +8 -6
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-Item",
|
|
4
|
+
"title": "Item",
|
|
5
|
+
"exportName": "Item",
|
|
6
|
+
"description": "A horizontal content row with leading media, a title and description, and trailing actions — for settings, notification, and resource rows.",
|
|
7
|
+
"lifecycleState": "Beta",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/item/item.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Data Display",
|
|
13
|
+
"Item"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/data-display/item",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"item",
|
|
19
|
+
"row",
|
|
20
|
+
"list",
|
|
21
|
+
"content"
|
|
22
|
+
],
|
|
23
|
+
"toc": [
|
|
24
|
+
{
|
|
25
|
+
"value": "Overview",
|
|
26
|
+
"href": "#overview",
|
|
27
|
+
"depth": 2,
|
|
28
|
+
"numbering": [
|
|
29
|
+
1,
|
|
30
|
+
1
|
|
31
|
+
],
|
|
32
|
+
"parent": "root"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"value": "Resources",
|
|
36
|
+
"href": "#resources",
|
|
37
|
+
"depth": 3,
|
|
38
|
+
"numbering": [
|
|
39
|
+
1,
|
|
40
|
+
1,
|
|
41
|
+
1
|
|
42
|
+
],
|
|
43
|
+
"parent": "root"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"value": "Variables",
|
|
47
|
+
"href": "#variables",
|
|
48
|
+
"depth": 2,
|
|
49
|
+
"numbering": [
|
|
50
|
+
1,
|
|
51
|
+
2
|
|
52
|
+
],
|
|
53
|
+
"parent": "root"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"value": "Media",
|
|
57
|
+
"href": "#media",
|
|
58
|
+
"depth": 3,
|
|
59
|
+
"numbering": [
|
|
60
|
+
1,
|
|
61
|
+
2,
|
|
62
|
+
1
|
|
63
|
+
],
|
|
64
|
+
"parent": "root"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"value": "Size",
|
|
68
|
+
"href": "#size",
|
|
69
|
+
"depth": 3,
|
|
70
|
+
"numbering": [
|
|
71
|
+
1,
|
|
72
|
+
2,
|
|
73
|
+
2
|
|
74
|
+
],
|
|
75
|
+
"parent": "root"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"value": "Variant",
|
|
79
|
+
"href": "#variant",
|
|
80
|
+
"depth": 3,
|
|
81
|
+
"numbering": [
|
|
82
|
+
1,
|
|
83
|
+
2,
|
|
84
|
+
3
|
|
85
|
+
],
|
|
86
|
+
"parent": "root"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"value": "Header and footer",
|
|
90
|
+
"href": "#header-and-footer",
|
|
91
|
+
"depth": 3,
|
|
92
|
+
"numbering": [
|
|
93
|
+
1,
|
|
94
|
+
2,
|
|
95
|
+
4
|
|
96
|
+
],
|
|
97
|
+
"parent": "root"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"value": "Link rows and actions",
|
|
101
|
+
"href": "#link-rows-and-actions",
|
|
102
|
+
"depth": 3,
|
|
103
|
+
"numbering": [
|
|
104
|
+
1,
|
|
105
|
+
2,
|
|
106
|
+
5
|
|
107
|
+
],
|
|
108
|
+
"parent": "root"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"layout": "app-frame",
|
|
112
|
+
"tabs": [
|
|
113
|
+
{
|
|
114
|
+
"key": "overview",
|
|
115
|
+
"title": "Overview",
|
|
116
|
+
"order": 0
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"key": "guidelines",
|
|
120
|
+
"title": "Guidelines",
|
|
121
|
+
"order": 2
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"key": "dev",
|
|
125
|
+
"title": "Implementation",
|
|
126
|
+
"order": 3
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"key": "a11y",
|
|
130
|
+
"title": "Accessibility",
|
|
131
|
+
"order": 4
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"mdx": "\n## Overview\n\n`Item` lays out **one horizontal content row**: leading media, a title and\ndescription column, and trailing actions, with optional full-width bands above\nand below. It is the shape behind settings rows, notification entries,\nfile/resource rows, and summary rows — the pattern teams otherwise rebuild ad\nhoc with slightly different spacing every time.\n\n`Item` is deliberately restrained. It is presentational by default and only\nbecomes interactive in one way: passing `href` upgrades the entire row to an\naccessible link. There is no button mode and no built-in selection state — real\nactions live as `Button`/`IconButton` controls inside `Item.Actions`, and\nselectable, navigable collections stay the job of `Menu`. `Item` complements\n`Card`, which composes vertical containers, the same way it complements those\ninteractive collections: each owns a different shape.\n\nTo stack several rows into a list with dividers between them, pair `Item` with\nthe separate `ItemGroup` component.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/gHbAJGfcrCv7f2bgzUQgHq/NIMBUS-Guidelines?m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Media\n\n`Item.Media` is a fixed, non-shrinking slot for an icon, avatar, or image. Its\n`variant` sizes and shapes the content independently of the row's own `variant`:\n`default` imposes no sizing (use it for a custom-sized avatar), `icon` sizes an\ninline glyph, and `image` constrains a thumbnail into a rounded box.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root variant=\"outline\">\n <Item.Media variant=\"icon\">\n <Icons.Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>Icon media</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root variant=\"outline\">\n <Item.Media variant=\"image\">\n <img src=\"/images/card/card-discount-template.png\" alt=\"\" />\n </Item.Media>\n <Item.Content>\n <Item.Title>Image media</Item.Title>\n </Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Size\n\nThe `size` prop scales the row's padding and gap. Use `xs` and `sm` for dense\nlists of rows, and `md` (the default) for standalone or spacious layouts.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root size=\"xs\" variant=\"outline\">\n <Item.Content>\n <Item.Title>Extra small</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root size=\"sm\" variant=\"outline\">\n <Item.Content>\n <Item.Title>Small</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root size=\"md\" variant=\"outline\">\n <Item.Content>\n <Item.Title>Medium (default)</Item.Title>\n </Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Variant\n\nThe `variant` prop controls the row's visual treatment: `plain` (default) has no\nborder or fill, `outline` adds a token-based border, and `subtle` fills the row\nwith a muted surface color.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root variant=\"plain\">\n <Item.Content>\n <Item.Title>Plain</Item.Title>\n <Item.Description>No border, no fill.</Item.Description>\n </Item.Content>\n </Item.Root>\n <Item.Root variant=\"outline\">\n <Item.Content>\n <Item.Title>Outline</Item.Title>\n <Item.Description>A token-based border.</Item.Description>\n </Item.Content>\n </Item.Root>\n <Item.Root variant=\"subtle\">\n <Item.Content>\n <Item.Title>Subtle</Item.Title>\n <Item.Description>A muted surface fill.</Item.Description>\n </Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Header and footer\n\n`Item.Header` and `Item.Footer` are optional full-width bands rendered above and\nbelow the media·content·actions row — useful for a category label or a timestamp\nthat shouldn't compete with the title for horizontal space.\n\n```jsx live\nconst App = () => (\n <Item.Root variant=\"outline\">\n <Item.Header>\n <Text fontWeight=\"600\">This week</Text>\n </Item.Header>\n <Item.Media variant=\"icon\">\n <Icons.Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>Weekly digest</Item.Title>\n <Item.Description>Summarizes activity across your team.</Item.Description>\n </Item.Content>\n <Item.Footer>\n <Text textStyle=\"sm\" color=\"neutral.11\">\n Sent Monday at 9:00am\n </Text>\n </Item.Footer>\n </Item.Root>\n);\n```\n\n### Link rows and actions\n\nPassing `href` upgrades the row to an accessible link — the whole row is\nkeyboard focusable and navigable. Controls placed in `Item.Actions` stay\nindependently operable: pressing one fires its own handler without triggering\nthe row's navigation.\n\n```jsx live\nconst App = () => (\n <Item.Root href=\"#settings\" variant=\"outline\">\n <Item.Media variant=\"icon\">\n <Icons.Settings />\n </Item.Media>\n <Item.Content>\n <Item.Title>Settings</Item.Title>\n <Item.Description>Navigate to your account settings</Item.Description>\n </Item.Content>\n <Item.Actions>\n <IconButton aria-label=\"Remove shortcut\" size=\"xs\" variant=\"ghost\">\n <Icons.Delete />\n </IconButton>\n </Item.Actions>\n </Item.Root>\n);\n```\n",
|
|
136
|
+
"views": {
|
|
137
|
+
"overview": {
|
|
138
|
+
"mdx": "\n## Overview\n\n`Item` lays out **one horizontal content row**: leading media, a title and\ndescription column, and trailing actions, with optional full-width bands above\nand below. It is the shape behind settings rows, notification entries,\nfile/resource rows, and summary rows — the pattern teams otherwise rebuild ad\nhoc with slightly different spacing every time.\n\n`Item` is deliberately restrained. It is presentational by default and only\nbecomes interactive in one way: passing `href` upgrades the entire row to an\naccessible link. There is no button mode and no built-in selection state — real\nactions live as `Button`/`IconButton` controls inside `Item.Actions`, and\nselectable, navigable collections stay the job of `Menu`. `Item` complements\n`Card`, which composes vertical containers, the same way it complements those\ninteractive collections: each owns a different shape.\n\nTo stack several rows into a list with dividers between them, pair `Item` with\nthe separate `ItemGroup` component.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/gHbAJGfcrCv7f2bgzUQgHq/NIMBUS-Guidelines?m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Media\n\n`Item.Media` is a fixed, non-shrinking slot for an icon, avatar, or image. Its\n`variant` sizes and shapes the content independently of the row's own `variant`:\n`default` imposes no sizing (use it for a custom-sized avatar), `icon` sizes an\ninline glyph, and `image` constrains a thumbnail into a rounded box.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root variant=\"outline\">\n <Item.Media variant=\"icon\">\n <Icons.Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>Icon media</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root variant=\"outline\">\n <Item.Media variant=\"image\">\n <img src=\"/images/card/card-discount-template.png\" alt=\"\" />\n </Item.Media>\n <Item.Content>\n <Item.Title>Image media</Item.Title>\n </Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Size\n\nThe `size` prop scales the row's padding and gap. Use `xs` and `sm` for dense\nlists of rows, and `md` (the default) for standalone or spacious layouts.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root size=\"xs\" variant=\"outline\">\n <Item.Content>\n <Item.Title>Extra small</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root size=\"sm\" variant=\"outline\">\n <Item.Content>\n <Item.Title>Small</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root size=\"md\" variant=\"outline\">\n <Item.Content>\n <Item.Title>Medium (default)</Item.Title>\n </Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Variant\n\nThe `variant` prop controls the row's visual treatment: `plain` (default) has no\nborder or fill, `outline` adds a token-based border, and `subtle` fills the row\nwith a muted surface color.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root variant=\"plain\">\n <Item.Content>\n <Item.Title>Plain</Item.Title>\n <Item.Description>No border, no fill.</Item.Description>\n </Item.Content>\n </Item.Root>\n <Item.Root variant=\"outline\">\n <Item.Content>\n <Item.Title>Outline</Item.Title>\n <Item.Description>A token-based border.</Item.Description>\n </Item.Content>\n </Item.Root>\n <Item.Root variant=\"subtle\">\n <Item.Content>\n <Item.Title>Subtle</Item.Title>\n <Item.Description>A muted surface fill.</Item.Description>\n </Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Header and footer\n\n`Item.Header` and `Item.Footer` are optional full-width bands rendered above and\nbelow the media·content·actions row — useful for a category label or a timestamp\nthat shouldn't compete with the title for horizontal space.\n\n```jsx live\nconst App = () => (\n <Item.Root variant=\"outline\">\n <Item.Header>\n <Text fontWeight=\"600\">This week</Text>\n </Item.Header>\n <Item.Media variant=\"icon\">\n <Icons.Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>Weekly digest</Item.Title>\n <Item.Description>Summarizes activity across your team.</Item.Description>\n </Item.Content>\n <Item.Footer>\n <Text textStyle=\"sm\" color=\"neutral.11\">\n Sent Monday at 9:00am\n </Text>\n </Item.Footer>\n </Item.Root>\n);\n```\n\n### Link rows and actions\n\nPassing `href` upgrades the row to an accessible link — the whole row is\nkeyboard focusable and navigable. Controls placed in `Item.Actions` stay\nindependently operable: pressing one fires its own handler without triggering\nthe row's navigation.\n\n```jsx live\nconst App = () => (\n <Item.Root href=\"#settings\" variant=\"outline\">\n <Item.Media variant=\"icon\">\n <Icons.Settings />\n </Item.Media>\n <Item.Content>\n <Item.Title>Settings</Item.Title>\n <Item.Description>Navigate to your account settings</Item.Description>\n </Item.Content>\n <Item.Actions>\n <IconButton aria-label=\"Remove shortcut\" size=\"xs\" variant=\"ghost\">\n <Icons.Delete />\n </IconButton>\n </Item.Actions>\n </Item.Root>\n);\n```\n",
|
|
139
|
+
"toc": [
|
|
140
|
+
{
|
|
141
|
+
"value": "Overview",
|
|
142
|
+
"href": "#overview",
|
|
143
|
+
"depth": 2,
|
|
144
|
+
"numbering": [
|
|
145
|
+
1,
|
|
146
|
+
1
|
|
147
|
+
],
|
|
148
|
+
"parent": "root"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"value": "Resources",
|
|
152
|
+
"href": "#resources",
|
|
153
|
+
"depth": 3,
|
|
154
|
+
"numbering": [
|
|
155
|
+
1,
|
|
156
|
+
1,
|
|
157
|
+
1
|
|
158
|
+
],
|
|
159
|
+
"parent": "root"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"value": "Variables",
|
|
163
|
+
"href": "#variables",
|
|
164
|
+
"depth": 2,
|
|
165
|
+
"numbering": [
|
|
166
|
+
1,
|
|
167
|
+
2
|
|
168
|
+
],
|
|
169
|
+
"parent": "root"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"value": "Media",
|
|
173
|
+
"href": "#media",
|
|
174
|
+
"depth": 3,
|
|
175
|
+
"numbering": [
|
|
176
|
+
1,
|
|
177
|
+
2,
|
|
178
|
+
1
|
|
179
|
+
],
|
|
180
|
+
"parent": "root"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"value": "Size",
|
|
184
|
+
"href": "#size",
|
|
185
|
+
"depth": 3,
|
|
186
|
+
"numbering": [
|
|
187
|
+
1,
|
|
188
|
+
2,
|
|
189
|
+
2
|
|
190
|
+
],
|
|
191
|
+
"parent": "root"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"value": "Variant",
|
|
195
|
+
"href": "#variant",
|
|
196
|
+
"depth": 3,
|
|
197
|
+
"numbering": [
|
|
198
|
+
1,
|
|
199
|
+
2,
|
|
200
|
+
3
|
|
201
|
+
],
|
|
202
|
+
"parent": "root"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"value": "Header and footer",
|
|
206
|
+
"href": "#header-and-footer",
|
|
207
|
+
"depth": 3,
|
|
208
|
+
"numbering": [
|
|
209
|
+
1,
|
|
210
|
+
2,
|
|
211
|
+
4
|
|
212
|
+
],
|
|
213
|
+
"parent": "root"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"value": "Link rows and actions",
|
|
217
|
+
"href": "#link-rows-and-actions",
|
|
218
|
+
"depth": 3,
|
|
219
|
+
"numbering": [
|
|
220
|
+
1,
|
|
221
|
+
2,
|
|
222
|
+
5
|
|
223
|
+
],
|
|
224
|
+
"parent": "root"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
"a11y": {
|
|
229
|
+
"mdx": "\n## Accessibility\n\nAccessibility ensures that digital content and functionality are usable by\neveryone, including people with disabilities, by addressing visual, auditory,\ncognitive, and physical limitations.\n\n### Presentational by default\n\n`Item.Root` renders a plain `<div>` when no `href` is provided — no role, no\naccessible name, and no focus stop of its own. Nothing in the row is announced\nas interactive unless you either pass `href` or nest real interactive controls\nin `Item.Actions`.\n\n```jsx live\nconst App = () => (\n <Item.Root variant=\"outline\" data-testid=\"static-row\">\n <Item.Media variant=\"icon\" aria-hidden>\n <Icons.Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>Profile</Item.Title>\n <Item.Description>Name, avatar, and contact details</Item.Description>\n </Item.Content>\n </Item.Root>\n);\n```\n\n### Link-mode accessible name\n\nWhen `href` upgrades `Item.Root` to an `<a>`, its accessible name is computed\nthe standard way for a link: from its visible text content — the title, the\ndescription, and anything else rendered inside the row. `Item` does not wire\nup `aria-labelledby`/`aria-describedby` slots the way `Card` does, so a long\ndescription becomes part of a long announced name. If that verbosity is\nundesirable, override it explicitly with `aria-label` or `aria-labelledby`.\n\n```jsx live\nconst App = () => (\n <Item.Root\n href=\"#settings\"\n variant=\"outline\"\n aria-label=\"Open account settings\"\n >\n <Item.Media variant=\"icon\" aria-hidden>\n <Icons.Settings />\n </Item.Media>\n <Item.Content>\n <Item.Title>Settings</Item.Title>\n <Item.Description>\n Manage your profile, notifications, and connected accounts\n </Item.Description>\n </Item.Content>\n </Item.Root>\n);\n```\n\n### Media is decorative unless you name it\n\n`Item.Media` injects no accessible name of its own — it is a layout slot, not\na labeling one. Mark purely decorative media `aria-hidden` (as in the examples\nabove) so it doesn't add an unlabeled node to the accessibility tree. Only give\nmedia its own name when it conveys information the title and description\ndon't already state.\n\n### Actions keep an independent focus order\n\nControls placed in `Item.Actions` are always their own focusable, operable\nstops — this holds whether `Item.Root` is a plain `<div>` or a link. When the\nrow is a link, activating a control inside `Item.Actions` (by click, `Enter`,\nor `Space`) does **not** also activate the row's navigation: a capture-phase\nguard on the link cancels the row's own navigation whenever the originating\nevent comes from inside `Item.Actions`, while the action's own handler still\nruns.\n\n```jsx live\nconst App = () => (\n <Item.Root href=\"#item-target\" variant=\"outline\">\n <Item.Content>\n <Item.Title>Report Q3</Item.Title>\n <Item.Description>Opens the report</Item.Description>\n </Item.Content>\n <Item.Actions>\n <IconButton aria-label=\"Delete\" size=\"xs\" variant=\"ghost\">\n <Icons.Delete />\n </IconButton>\n </Item.Actions>\n </Item.Root>\n);\n```\n\n### Interactive controls in a link row are a content-model tradeoff\n\nCombining an `href` on `Item.Root` with an interactive control in\n`Item.Actions` nests that control inside the row's `<a>`. The HTML content\nmodel disallows interactive content inside an `<a>`, so this arrangement is\ntechnically invalid — the same reason a whole row can't be a single button\n(see below).\n\nNimbus supports it anyway as the way to pair navigation with a row action: it\nis a common, well-understood pattern, the capture-phase guard above keeps the\nclick behavior correct, and the nested control remains a first-class focus\nstop. Two things to keep in mind about the tradeoff:\n\n- **Automated a11y checks won't flag it, and that's expected.** `axe`'s\n `nested-interactive` rule only applies to elements whose role makes their\n children presentational (for example `button`); it does **not** apply to\n links, so a control inside a link row passes the a11y test suite. The absence\n of a violation here is not evidence that the markup is valid.\n- **If strict content-model validity matters** in your context, don't give a\n single row both an `href` and interactive `Item.Actions`. Make the row\n presentational (a `<div>`) and let its controls stand on their own, or let\n the whole row navigate with no competing actions.\n\n### `Item.Actions` is for controls, not links\n\nPlace JS-activated controls — `Button`, `IconButton` — in `Item.Actions`. Do\n**not** put a navigating `<a href>` there inside a link row: the row's\ncapture-phase guard cancels navigation for anything originating in\n`Item.Actions`, so the inner link would silently do nothing. If a row needs a\nsecond destination, express it as a control the guard leaves alone (an\n`onPress` that routes), or restructure so the destinations aren't nested.\n\n### No row-as-button mode\n\n`Item.Root` intentionally offers no button/pressable-row mode. Rendering the\nwhole row as a single button would announce the entire title, description,\nand media subtree as one control and would make every nested `Item.Actions`\ncontrol an invalid button-inside-button. When a row needs to perform an\naction rather than navigate, put that action in `Item.Actions` as a\n`Button`/`IconButton` — don't attach a press handler to `Item.Root` itself.\n\n### Stacking rows\n\n`Item` lays out a single row and has no opinion about the list that contains\nit. To stack multiple rows, use the separate `ItemGroup` component — see its\nown accessibility documentation for how it composes rows into a group.\n\n### Accessibility standards\n\n- **Name, role, value:** A link-mode `Item.Root` is a genuine `<a>` with a\n computed or explicit accessible name; a non-link `Item.Root` has none, which\n is correct for presentational content.\n- **Info and relationships:** `Item.Media`, `Item.Title`, and\n `Item.Description` are plain, unrelated `<div>`s — nothing but visible\n layout ties them together, so don't depend on assistive technology inferring\n a relationship beyond DOM order.\n- **Use of color:** `variant` (`plain`/`outline`/`subtle`) and `colorPalette`\n are visual cues only; don't use color alone to signal that a row is\n interactive or to distinguish one row's meaning from another's — pair it\n with visible text.\n- **Non-text content:** Keep decorative media `aria-hidden`; give meaningful\n media (an avatar that identifies a specific person, for example) its own\n name.\n- **Focus order / no keyboard trap:** Controls in `Item.Actions` are always\n independent focus stops, never captured by or hidden behind the row's link.\n- **Target size:** Size interactive controls placed in `Item.Actions` (for\n example `IconButton`) per your target-size requirements — `Item` does not\n enforce a minimum hit area on nested controls.\n",
|
|
230
|
+
"toc": [
|
|
231
|
+
{
|
|
232
|
+
"value": "Accessibility",
|
|
233
|
+
"href": "#accessibility",
|
|
234
|
+
"depth": 2,
|
|
235
|
+
"numbering": [
|
|
236
|
+
1,
|
|
237
|
+
1
|
|
238
|
+
],
|
|
239
|
+
"parent": "root"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"value": "Presentational by default",
|
|
243
|
+
"href": "#presentational-by-default",
|
|
244
|
+
"depth": 3,
|
|
245
|
+
"numbering": [
|
|
246
|
+
1,
|
|
247
|
+
1,
|
|
248
|
+
1
|
|
249
|
+
],
|
|
250
|
+
"parent": "root"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"value": "Link-mode accessible name",
|
|
254
|
+
"href": "#link-mode-accessible-name",
|
|
255
|
+
"depth": 3,
|
|
256
|
+
"numbering": [
|
|
257
|
+
1,
|
|
258
|
+
1,
|
|
259
|
+
2
|
|
260
|
+
],
|
|
261
|
+
"parent": "root"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"value": "Media is decorative unless you name it",
|
|
265
|
+
"href": "#media-is-decorative-unless-you-name-it",
|
|
266
|
+
"depth": 3,
|
|
267
|
+
"numbering": [
|
|
268
|
+
1,
|
|
269
|
+
1,
|
|
270
|
+
3
|
|
271
|
+
],
|
|
272
|
+
"parent": "root"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"value": "Actions keep an independent focus order",
|
|
276
|
+
"href": "#actions-keep-an-independent-focus-order",
|
|
277
|
+
"depth": 3,
|
|
278
|
+
"numbering": [
|
|
279
|
+
1,
|
|
280
|
+
1,
|
|
281
|
+
4
|
|
282
|
+
],
|
|
283
|
+
"parent": "root"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"value": "Interactive controls in a link row are a content-model tradeoff",
|
|
287
|
+
"href": "#interactive-controls-in-a-link-row-are-a-content-model-tradeoff",
|
|
288
|
+
"depth": 3,
|
|
289
|
+
"numbering": [
|
|
290
|
+
1,
|
|
291
|
+
1,
|
|
292
|
+
5
|
|
293
|
+
],
|
|
294
|
+
"parent": "root"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"value": "Item.Actions is for controls, not links",
|
|
298
|
+
"href": "#itemactions-is-for-controls-not-links",
|
|
299
|
+
"depth": 3,
|
|
300
|
+
"numbering": [
|
|
301
|
+
1,
|
|
302
|
+
1,
|
|
303
|
+
6
|
|
304
|
+
],
|
|
305
|
+
"parent": "root"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"value": "No row-as-button mode",
|
|
309
|
+
"href": "#no-row-as-button-mode",
|
|
310
|
+
"depth": 3,
|
|
311
|
+
"numbering": [
|
|
312
|
+
1,
|
|
313
|
+
1,
|
|
314
|
+
7
|
|
315
|
+
],
|
|
316
|
+
"parent": "root"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"value": "Stacking rows",
|
|
320
|
+
"href": "#stacking-rows",
|
|
321
|
+
"depth": 3,
|
|
322
|
+
"numbering": [
|
|
323
|
+
1,
|
|
324
|
+
1,
|
|
325
|
+
8
|
|
326
|
+
],
|
|
327
|
+
"parent": "root"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"value": "Accessibility standards",
|
|
331
|
+
"href": "#accessibility-standards",
|
|
332
|
+
"depth": 3,
|
|
333
|
+
"numbering": [
|
|
334
|
+
1,
|
|
335
|
+
1,
|
|
336
|
+
9
|
|
337
|
+
],
|
|
338
|
+
"parent": "root"
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
"dev": {
|
|
343
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { Item, type ItemRootProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\n`Item` is a compound component. Wrap `Item.Media`, `Item.Content` (itself\nwrapping `Item.Title` and `Item.Description`), and `Item.Actions` inside\n`Item.Root`. `Item.Root` renders a plain `<div>` unless you pass `href`.\n\n```jsx live-dev\nconst App = () => (\n <Item.Root variant=\"outline\">\n <Item.Media variant=\"icon\">\n <Icons.Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>Profile</Item.Title>\n <Item.Description>Name, avatar, and contact details</Item.Description>\n </Item.Content>\n <Item.Actions>\n <IconButton aria-label=\"Settings\" size=\"xs\" variant=\"ghost\">\n <Icons.Settings />\n </IconButton>\n </Item.Actions>\n </Item.Root>\n);\n```\n\n## Usage examples\n\n### Sizes\n\nThe `size` prop (`xs`, `sm`, `md`) scales the row's padding and gap via the\n`nimbusItem` recipe's density tokens. `md` is the default.\n\n```jsx live-dev\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root size=\"xs\" variant=\"outline\">\n <Item.Media variant=\"icon\"><Icons.Person /></Item.Media>\n <Item.Content>\n <Item.Title>Extra small</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root size=\"sm\" variant=\"outline\">\n <Item.Media variant=\"icon\"><Icons.Person /></Item.Media>\n <Item.Content>\n <Item.Title>Small</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root size=\"md\" variant=\"outline\">\n <Item.Media variant=\"icon\"><Icons.Person /></Item.Media>\n <Item.Content>\n <Item.Title>Medium (default)</Item.Title>\n </Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Variants\n\n`variant` (`plain`, `outline`, `subtle`) controls the row's border and fill.\n`plain` is the default.\n\n```jsx live-dev\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root variant=\"plain\">\n <Item.Content><Item.Title>Plain (default)</Item.Title></Item.Content>\n </Item.Root>\n <Item.Root variant=\"outline\">\n <Item.Content><Item.Title>Outline</Item.Title></Item.Content>\n </Item.Root>\n <Item.Root variant=\"subtle\">\n <Item.Content><Item.Title>Subtle</Item.Title></Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Media variants\n\n`Item.Media` carries its own `variant` (`default`, `icon`, `image`), applied\nvia a `data-variant` attribute rather than the shared recipe context — this\nkeeps it independent of `Item.Root`'s `variant` prop. `default` applies no\nsizing, so use it when you need to size the media yourself (for example a\ncustom avatar component).\n\n```jsx live-dev\nconst App = () => (\n <Stack gap=\"400\">\n <Item.Root variant=\"outline\">\n <Item.Media variant=\"icon\">\n <Icons.Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>Icon media</Item.Title>\n </Item.Content>\n </Item.Root>\n <Item.Root variant=\"outline\">\n <Item.Media variant=\"image\">\n <img\n src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\"\n alt=\"Placeholder thumbnail\"\n />\n </Item.Media>\n <Item.Content>\n <Item.Title>Image media</Item.Title>\n </Item.Content>\n </Item.Root>\n </Stack>\n);\n```\n\n### Header and footer bands\n\n`Item.Header` and `Item.Footer` set `flex-basis: 100%` inside the row's\n`flex-wrap` layout, so they occupy their own full-width band above or below\nthe media·content·actions line.\n\n```jsx live-dev\nconst App = () => (\n <Item.Root variant=\"outline\">\n <Item.Header>\n <Text fontWeight=\"600\">Header band</Text>\n </Item.Header>\n <Item.Media variant=\"icon\">\n <Icons.Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>With header and footer</Item.Title>\n <Item.Description>Both bands span the full row width.</Item.Description>\n </Item.Content>\n <Item.Footer>\n <Text textStyle=\"sm\">Footer band</Text>\n </Item.Footer>\n </Item.Root>\n);\n```\n\n### Link-upgrade\n\nPassing `href` (plus optional `target`, `rel`, `download`, `ping`,\n`referrerPolicy`, `routerOptions`, `onPress`) switches `Item.Root`'s rendered\nelement from `<div>` to `<a>` and wires it up with React Aria's `useLink` —\nthe same hook Nimbus's own `Link` uses internally. `Item`'s recipe stays\nauthoritative on appearance; `useLink` only supplies keyboard, focus, and\npress behavior.\n\n```jsx live-dev\nconst App = () => (\n <Item.Root href=\"#item-target\" variant=\"outline\">\n <Item.Media variant=\"icon\">\n <Icons.Settings />\n </Item.Media>\n <Item.Content>\n <Item.Title>Settings</Item.Title>\n <Item.Description>Navigate to settings</Item.Description>\n </Item.Content>\n </Item.Root>\n);\n```\n\n### Actions inside a link row\n\n`Item.Actions` controls remain independently operable even when `Item.Root`\nis a link: an internal capture-phase guard on the link cancels the row's own\nnavigation whenever the originating click comes from inside `Item.Actions`,\nwhile the action's own handler still runs normally. There is no button mode\nfor `Item.Root` itself — a row rendered as a `<button>` would make every\nnested `Item.Actions` control an invalid button-inside-button, so real\nactions always live in `Item.Actions`.\n\n```jsx live-dev\nconst App = () => (\n <Item.Root href=\"#item-target\" variant=\"outline\">\n <Item.Content>\n <Item.Title>Report Q3</Item.Title>\n <Item.Description>Opens the report</Item.Description>\n </Item.Content>\n <Item.Actions>\n <IconButton\n aria-label=\"Delete\"\n size=\"xs\"\n variant=\"ghost\"\n onPress={() => console.log(\"delete\")}\n >\n <Icons.Delete />\n </IconButton>\n </Item.Actions>\n </Item.Root>\n);\n```\n\n### Color palette\n\nThe row inherits the `slate` color palette by default (media, title, and\ndescription colors, plus the `subtle`/`outline` variant surfaces all read from\n`colorPalette.*` tokens). Override `colorPalette` like any other Chakra style\nprop to tint a row semantically, for example a destructive row.\n\n```jsx live-dev\nconst App = () => (\n <Item.Root variant=\"subtle\" colorPalette=\"critical\">\n <Item.Media variant=\"icon\">\n <Icons.Delete />\n </Item.Media>\n <Item.Content>\n <Item.Title>Delete account</Item.Title>\n <Item.Description>This action cannot be undone.</Item.Description>\n </Item.Content>\n </Item.Root>\n);\n```\n\n### Stacking rows with ItemGroup\n\n`Item` only lays out a single row. To stack several rows into a list, with\noptional dividers between them, wrap `Item.Root` rows in the separate\n`ItemGroup` component rather than nesting them inside one `Item.Root`.\n\n```jsx live-dev\nconst App = () => (\n <ItemGroup.Root>\n <Item.Root href=\"#profile\">\n <Item.Content><Item.Title>Profile</Item.Title></Item.Content>\n </Item.Root>\n <ItemGroup.Separator />\n <Item.Root href=\"#billing\">\n <Item.Content><Item.Title>Billing</Item.Title></Item.Content>\n </Item.Root>\n </ItemGroup.Root>\n);\n```\n\n## Component requirements\n\n- Nest `Item.Media`, `Item.Content`, and `Item.Actions` as direct children of\n `Item.Root`; wrap `Item.Title` and `Item.Description` inside `Item.Content`.\n- `Item.Header` and `Item.Footer` are optional and render as full-width bands;\n place them as direct children of `Item.Root` alongside the other parts.\n- Passing `href` is the only thing that changes `Item.Root`'s rendered\n element and interaction model — every other prop behaves the same on the\n `<div>` and `<a>` paths.\n- `Item.Root` does not accept `as`/`asChild`; it is not polymorphic.\n\n### Accessibility\n\n`Item.Root` renders a plain, unlabeled `<div>` by default — no role or\naccessible name is implied. When it upgrades to a link, its accessible name is\ncomputed the standard way, from its visible text content (title, description,\nand any other text inside the row), unless you override it with `aria-label`\nor `aria-labelledby`. `Item.Media` injects no accessible name of its own: mark\ndecorative media `aria-hidden` (as shown in the link-upgrade example above) or\ngive it an explicit name when the media conveys information the title doesn't\nalready state.\n\nIf your use case requires tracking and analytics for this component, it is\ngood practice to add a **persistent**, **unique** id to the component:\n\n```tsx\nconst PERSISTENT_ID = \"settings-item-row\";\n\nexport const Example = () => (\n <Item.Root id={PERSISTENT_ID} href=\"/settings\">\n <Item.Content>\n <Item.Title>Settings</Item.Title>\n </Item.Content>\n </Item.Root>\n);\n```\n\n#### Keyboard navigation\n\n- `Tab`: When `href` is set, the row is one focusable stop, like any link;\n controls inside `Item.Actions` are additional, independent focusable stops.\n Without `href`, `Item.Root` introduces no focusable stop of its own.\n- `Enter`: Activates the row's link.\n- Activating a control inside `Item.Actions` (by click, `Enter`, or `Space`)\n does not activate the row's link, even when the row is a link.\n\n## API reference\n\n<PropsTable id=\"Item\" />\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using Item\nwithin your application. As the component's internal functionality is already\ntested by Nimbus, these patterns help you verify your integration and\napplication-specific logic.\n\n### State Management\n\nDrive a list of Item rows from application state and toggle a row's state from its own action, without navigating the row\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { useState } from \"react\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { Item, IconButton, NimbusProvider } from \"@commercetools/nimbus\";\nimport { Person, Settings } from \"@commercetools/nimbus-icons\";\n\ndescribe(\"Item - State management\", () => {\n it(\"toggles a row's pinned state from its action while leaving the link intact\", async () => {\n const user = userEvent.setup();\n\n type Row = { id: string; title: string; pinned: boolean };\n\n const PinnableList = () => {\n const [rows, setRows] = useState<Row[]>([\n { id: \"profile\", title: \"Profile\", pinned: false },\n { id: \"billing\", title: \"Billing\", pinned: true },\n ]);\n\n const togglePinned = (id: string) =>\n setRows((prev) =>\n prev.map((row) =>\n row.id === id ? { ...row, pinned: !row.pinned } : row\n )\n );\n\n return (\n <div>\n {rows.map((row) => (\n <Item.Root key={row.id} href={`#${row.id}`} variant=\"outline\">\n <Item.Media variant=\"icon\">\n <Person />\n </Item.Media>\n <Item.Content>\n <Item.Title>{row.title}</Item.Title>\n <Item.Description>\n {row.pinned ? \"Pinned\" : \"Not pinned\"}\n </Item.Description>\n </Item.Content>\n <Item.Actions>\n <IconButton\n aria-label={`${row.pinned ? \"Unpin\" : \"Pin\"} ${row.title}`}\n size=\"xs\"\n variant=\"ghost\"\n onPress={() => togglePinned(row.id)}\n >\n <Settings />\n </IconButton>\n </Item.Actions>\n </Item.Root>\n ))}\n </div>\n );\n };\n\n render(\n <NimbusProvider>\n <PinnableList />\n </NimbusProvider>\n );\n\n // Each row is a link, and each row's action is a separate control.\n expect(screen.getAllByRole(\"link\")).toHaveLength(2);\n\n // Activating a row action updates state without navigating the row.\n await user.click(screen.getByRole(\"button\", { name: \"Pin Profile\" }));\n expect(\n screen.getByRole(\"button\", { name: \"Unpin Profile\" })\n ).toBeInTheDocument();\n // The row link is still present — the action did not navigate away.\n expect(screen.getByRole(\"link\", { name: /Profile/ })).toBeInTheDocument();\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-item--docs)\n",
|
|
344
|
+
"toc": [
|
|
345
|
+
{
|
|
346
|
+
"value": "Getting started",
|
|
347
|
+
"href": "#getting-started",
|
|
348
|
+
"depth": 2,
|
|
349
|
+
"numbering": [
|
|
350
|
+
1,
|
|
351
|
+
1
|
|
352
|
+
],
|
|
353
|
+
"parent": "root"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"value": "Import",
|
|
357
|
+
"href": "#import",
|
|
358
|
+
"depth": 3,
|
|
359
|
+
"numbering": [
|
|
360
|
+
1,
|
|
361
|
+
1,
|
|
362
|
+
1
|
|
363
|
+
],
|
|
364
|
+
"parent": "root"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"value": "Basic usage",
|
|
368
|
+
"href": "#basic-usage",
|
|
369
|
+
"depth": 3,
|
|
370
|
+
"numbering": [
|
|
371
|
+
1,
|
|
372
|
+
1,
|
|
373
|
+
2
|
|
374
|
+
],
|
|
375
|
+
"parent": "root"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"value": "Usage examples",
|
|
379
|
+
"href": "#usage-examples",
|
|
380
|
+
"depth": 2,
|
|
381
|
+
"numbering": [
|
|
382
|
+
1,
|
|
383
|
+
2
|
|
384
|
+
],
|
|
385
|
+
"parent": "root"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"value": "Sizes",
|
|
389
|
+
"href": "#sizes",
|
|
390
|
+
"depth": 3,
|
|
391
|
+
"numbering": [
|
|
392
|
+
1,
|
|
393
|
+
2,
|
|
394
|
+
1
|
|
395
|
+
],
|
|
396
|
+
"parent": "root"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"value": "Variants",
|
|
400
|
+
"href": "#variants",
|
|
401
|
+
"depth": 3,
|
|
402
|
+
"numbering": [
|
|
403
|
+
1,
|
|
404
|
+
2,
|
|
405
|
+
2
|
|
406
|
+
],
|
|
407
|
+
"parent": "root"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"value": "Media variants",
|
|
411
|
+
"href": "#media-variants",
|
|
412
|
+
"depth": 3,
|
|
413
|
+
"numbering": [
|
|
414
|
+
1,
|
|
415
|
+
2,
|
|
416
|
+
3
|
|
417
|
+
],
|
|
418
|
+
"parent": "root"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"value": "Header and footer bands",
|
|
422
|
+
"href": "#header-and-footer-bands",
|
|
423
|
+
"depth": 3,
|
|
424
|
+
"numbering": [
|
|
425
|
+
1,
|
|
426
|
+
2,
|
|
427
|
+
4
|
|
428
|
+
],
|
|
429
|
+
"parent": "root"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"value": "Link-upgrade",
|
|
433
|
+
"href": "#link-upgrade",
|
|
434
|
+
"depth": 3,
|
|
435
|
+
"numbering": [
|
|
436
|
+
1,
|
|
437
|
+
2,
|
|
438
|
+
5
|
|
439
|
+
],
|
|
440
|
+
"parent": "root"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"value": "Actions inside a link row",
|
|
444
|
+
"href": "#actions-inside-a-link-row",
|
|
445
|
+
"depth": 3,
|
|
446
|
+
"numbering": [
|
|
447
|
+
1,
|
|
448
|
+
2,
|
|
449
|
+
6
|
|
450
|
+
],
|
|
451
|
+
"parent": "root"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"value": "Color palette",
|
|
455
|
+
"href": "#color-palette",
|
|
456
|
+
"depth": 3,
|
|
457
|
+
"numbering": [
|
|
458
|
+
1,
|
|
459
|
+
2,
|
|
460
|
+
7
|
|
461
|
+
],
|
|
462
|
+
"parent": "root"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"value": "Stacking rows with ItemGroup",
|
|
466
|
+
"href": "#stacking-rows-with-itemgroup",
|
|
467
|
+
"depth": 3,
|
|
468
|
+
"numbering": [
|
|
469
|
+
1,
|
|
470
|
+
2,
|
|
471
|
+
8
|
|
472
|
+
],
|
|
473
|
+
"parent": "root"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"value": "Component requirements",
|
|
477
|
+
"href": "#component-requirements",
|
|
478
|
+
"depth": 2,
|
|
479
|
+
"numbering": [
|
|
480
|
+
1,
|
|
481
|
+
3
|
|
482
|
+
],
|
|
483
|
+
"parent": "root"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"value": "Accessibility",
|
|
487
|
+
"href": "#accessibility",
|
|
488
|
+
"depth": 3,
|
|
489
|
+
"numbering": [
|
|
490
|
+
1,
|
|
491
|
+
3,
|
|
492
|
+
1
|
|
493
|
+
],
|
|
494
|
+
"parent": "root"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"value": "Keyboard navigation",
|
|
498
|
+
"href": "#keyboard-navigation",
|
|
499
|
+
"depth": 4,
|
|
500
|
+
"numbering": [
|
|
501
|
+
1,
|
|
502
|
+
3,
|
|
503
|
+
1,
|
|
504
|
+
1
|
|
505
|
+
],
|
|
506
|
+
"parent": "root"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"value": "API reference",
|
|
510
|
+
"href": "#api-reference",
|
|
511
|
+
"depth": 2,
|
|
512
|
+
"numbering": [
|
|
513
|
+
1,
|
|
514
|
+
4
|
|
515
|
+
],
|
|
516
|
+
"parent": "root"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"value": "Testing your implementation",
|
|
520
|
+
"href": "#testing-your-implementation",
|
|
521
|
+
"depth": 2,
|
|
522
|
+
"numbering": [
|
|
523
|
+
1,
|
|
524
|
+
5
|
|
525
|
+
],
|
|
526
|
+
"parent": "root"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"value": "State Management",
|
|
530
|
+
"href": "#state-management",
|
|
531
|
+
"depth": 3,
|
|
532
|
+
"numbering": [
|
|
533
|
+
1,
|
|
534
|
+
5,
|
|
535
|
+
1
|
|
536
|
+
],
|
|
537
|
+
"parent": "root"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"value": "Resources",
|
|
541
|
+
"href": "#resources",
|
|
542
|
+
"depth": 2,
|
|
543
|
+
"numbering": [
|
|
544
|
+
1,
|
|
545
|
+
6
|
|
546
|
+
],
|
|
547
|
+
"parent": "root"
|
|
548
|
+
}
|
|
549
|
+
]
|
|
550
|
+
},
|
|
551
|
+
"guidelines": {
|
|
552
|
+
"mdx": "\n## Guidelines\n\nItem guidelines focus on keeping a single content row scannable, restrained,\nand predictable, so a page built from many rows stays easy to read and use.\n\n### Best practices\n\n- **One row, one subject:** Keep each row focused on a single item — a\n setting, a notification, a file. Don't merge two unrelated things into one\n row's title and description.\n- **Concise title and description:** The title should read as a short label;\n push supporting detail into the description rather than lengthening the\n title itself.\n- **Limited, obvious actions:** Place only the actions a row actually needs in\n `Item.Actions`. A row crowded with icon buttons is harder to scan and harder\n to hit accurately.\n- **Consistent rows within a group:** When several rows sit together (via\n `ItemGroup`), keep their structure consistent — if one row has media and\n actions, give its siblings the same shape, even if a slot is empty.\n- **Choose one interaction model per row:** A row either navigates (`href`) or\n hosts actions (`Item.Actions`), or both together — it never behaves like a\n button in its own right. Don't design a row that expects a whole-row click\n to trigger something other than navigation.\n- **Match density to context:** Use `size=\"xs\"` or `size=\"sm\"` for dense\n lists with many rows, and `size=\"md\"` for standalone or spacious rows.\n\n### Usage\n\n`Item` is the shape behind the horizontal rows that make up settings screens,\nnotification lists, and resource/file browsers — content that is naturally a\nsequence of similar, scannable lines rather than a single detailed view.\n\n> [!TIP]\\\n> When to use\n\n- **Settings and preference rows:** A label, a short description, and a\n control or a link to a detail page.\n- **Notifications and activity entries:** An icon or avatar, a short message,\n and optional actions like dismiss or mark-as-read.\n- **File or resource rows:** A thumbnail or type icon, a name and metadata,\n and actions like download or delete.\n- **Navigational rows:** A row that exists purely to link somewhere else, with\n a leading icon and a trailing chevron as the visual cue.\n\n> [!CAUTION]\\\n> When not to use\n\n- **A single, detailed item:** When you need to present a lot of information\n about one specific thing, use `Card` or a dedicated page instead of forcing\n it into one row.\n- **Selectable or multi-select collections:** `Item` has no selection state.\n If users need to select one or more rows, reach for `Menu` or a purpose-built\n selectable list instead.\n- **A row that should act like a button:** If activating the whole row should\n trigger an action rather than navigate, don't attach a press handler to\n `Item.Root` — put a `Button`/`IconButton` in `Item.Actions` instead.\n- **Comparing structured data across many attributes:** When rows would need\n many aligned columns to be useful, a table communicates that better than a\n row layout.\n\n### Content\n\nKeep a row's text short enough to scan at a glance. The title carries the\nsubject; the description adds just enough context to disambiguate it from\nits neighbors.\n\n> [!TIP]\\\n> **Do**\n>\n> - Write titles as short, specific labels (\"Two-factor authentication\", not\n> \"Settings related to your account security\").\n> - Use the description for one supporting detail, not a second paragraph.\n\n```jsx live\nconst App = () => (\n <Item.Root variant=\"outline\" width=\"384px\">\n <Item.Media variant=\"icon\">\n <Icons.Security />\n </Item.Media>\n <Item.Content>\n <Item.Title>Two-factor authentication</Item.Title>\n <Item.Description>Adds a second step when you sign in.</Item.Description>\n </Item.Content>\n <Item.Actions>\n <Button size=\"xs\" variant=\"outline\">Enable</Button>\n </Item.Actions>\n </Item.Root>\n);\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Don't stack multiple unrelated facts into the title.\n> - Don't let the description grow into a paragraph — a link-mode row's\n> accessible name is built from that same text, so a long description makes\n> for a long, awkward announcement.\n\n```jsx live\nconst App = () => (\n <Item.Root variant=\"outline\" width=\"384px\">\n <Item.Content>\n <Item.Title>Two-factor authentication and password and email</Item.Title>\n <Item.Description>\n Adds a second step when you sign in, also lets you change your\n password, and also shows your current recovery email address plus a\n button to change it if you no longer have access to it.\n </Item.Description>\n </Item.Content>\n </Item.Root>\n);\n```\n\n### Actions\n\nKeep the trailing actions short, obvious, and limited to what that specific\nrow needs — a row is meant to be scanned quickly, not studied.\n\n> [!TIP]\\\n> **Do**\n>\n> - Use one primary action per row, and reach for an icon button only when its\n> meaning is unambiguous (a trash icon for delete).\n> - When a row also links somewhere, keep any action clearly separated from\n> the row's own navigation — for example a trailing chevron for \"go to\n> details\" versus a distinct trash icon for \"delete this\".\n\n```jsx live\nconst App = () => (\n <Item.Root href=\"#report\" variant=\"outline\" width=\"384px\">\n <Item.Media variant=\"icon\">\n <Icons.Description />\n </Item.Media>\n <Item.Content>\n <Item.Title>Q3 report</Item.Title>\n <Item.Description>Updated 2 days ago</Item.Description>\n </Item.Content>\n <Item.Actions>\n <IconButton aria-label=\"Delete report\" size=\"xs\" variant=\"ghost\">\n <Icons.Delete />\n </IconButton>\n </Item.Actions>\n </Item.Root>\n);\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Don't crowd a row with many actions — split them into a menu behind a\n> single overflow control instead.\n> - Don't rely on a whole-row click to do something a visible action should do\n> instead; nested actions must stay independently operable.\n\n```jsx live\nconst App = () => (\n <Item.Root href=\"#report\" variant=\"outline\" width=\"384px\">\n <Item.Media variant=\"icon\">\n <Icons.Description />\n </Item.Media>\n <Item.Content>\n <Item.Title>Q3 report</Item.Title>\n <Item.Description>Updated 2 days ago</Item.Description>\n </Item.Content>\n <Item.Actions>\n <IconButton aria-label=\"Share\" size=\"xs\" variant=\"ghost\">\n <Icons.Share />\n </IconButton>\n <IconButton aria-label=\"Rename\" size=\"xs\" variant=\"ghost\">\n <Icons.Edit />\n </IconButton>\n <IconButton aria-label=\"Archive\" size=\"xs\" variant=\"ghost\">\n <Icons.Archive />\n </IconButton>\n <IconButton aria-label=\"Delete report\" size=\"xs\" variant=\"ghost\">\n <Icons.Delete />\n </IconButton>\n </Item.Actions>\n </Item.Root>\n);\n```\n",
|
|
553
|
+
"toc": [
|
|
554
|
+
{
|
|
555
|
+
"value": "Guidelines",
|
|
556
|
+
"href": "#guidelines",
|
|
557
|
+
"depth": 2,
|
|
558
|
+
"numbering": [
|
|
559
|
+
1,
|
|
560
|
+
1
|
|
561
|
+
],
|
|
562
|
+
"parent": "root"
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"value": "Best practices",
|
|
566
|
+
"href": "#best-practices",
|
|
567
|
+
"depth": 3,
|
|
568
|
+
"numbering": [
|
|
569
|
+
1,
|
|
570
|
+
1,
|
|
571
|
+
1
|
|
572
|
+
],
|
|
573
|
+
"parent": "root"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"value": "Usage",
|
|
577
|
+
"href": "#usage",
|
|
578
|
+
"depth": 3,
|
|
579
|
+
"numbering": [
|
|
580
|
+
1,
|
|
581
|
+
1,
|
|
582
|
+
2
|
|
583
|
+
],
|
|
584
|
+
"parent": "root"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"value": "Content",
|
|
588
|
+
"href": "#content",
|
|
589
|
+
"depth": 3,
|
|
590
|
+
"numbering": [
|
|
591
|
+
1,
|
|
592
|
+
1,
|
|
593
|
+
3
|
|
594
|
+
],
|
|
595
|
+
"parent": "root"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"value": "Actions",
|
|
599
|
+
"href": "#actions",
|
|
600
|
+
"depth": 3,
|
|
601
|
+
"numbering": [
|
|
602
|
+
1,
|
|
603
|
+
1,
|
|
604
|
+
4
|
|
605
|
+
],
|
|
606
|
+
"parent": "root"
|
|
607
|
+
}
|
|
608
|
+
]
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|