@commercetools/nimbus-mcp 2.10.0 → 3.0.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/data/docs/route-manifest.json +288 -0
- package/data/docs/routes/components-data-display-card.json +71 -5
- package/data/docs/routes/components-feedback-toast.json +1 -1
- package/data/docs/routes/components-layout-defaultpage.json +4 -4
- package/data/docs/routes/components-layout-modalpage.json +4 -4
- package/data/docs/routes/components-layout-scrollarea.json +428 -0
- package/data/docs/routes/components-media-avatar.json +24 -2
- package/data/docs/routes/patterns-actions-form-action-bar.json +412 -0
- package/data/docs/routes/patterns-dialogs-info-dialog.json +315 -0
- package/data/docs/routes/patterns-dialogs.json +78 -0
- package/data/docs/search-index.json +1 -1
- package/data/docs/types/AccordionHeader.json +33 -33
- package/data/docs/types/AccordionRoot.json +2 -2
- package/data/docs/types/AlertDescription.json +8 -8
- package/data/docs/types/AlertDismissButton.json +52 -52
- package/data/docs/types/AlertTitle.json +8 -8
- package/data/docs/types/Avatar.json +8 -8
- 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/Button.json +24 -24
- package/data/docs/types/Caption.json +6 -6
- package/data/docs/types/Card.json +1 -1
- package/data/docs/types/{CardContent.json → CardBody.json} +2 -2
- package/data/docs/types/CardFooter.json +27 -0
- package/data/docs/types/CardRoot.json +18 -48
- package/data/docs/types/Cell.json +6 -6
- package/data/docs/types/Checkbox.json +2 -2
- package/data/docs/types/Code.json +10 -10
- 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 +6 -6
- package/data/docs/types/ComboBoxPopover.json +8 -8
- package/data/docs/types/ComboBoxRoot.json +24 -24
- package/data/docs/types/ComboBoxSection.json +6 -6
- package/data/docs/types/ComboBoxTrigger.json +6 -6
- package/data/docs/types/DataTable.json +2 -2
- package/data/docs/types/DataTableBody.json +6 -6
- package/data/docs/types/DataTableHeader.json +7 -7
- package/data/docs/types/DataTableRoot.json +2 -2
- package/data/docs/types/DataTableTable.json +6 -6
- package/data/docs/types/DatePicker.json +16 -16
- package/data/docs/types/DateRangePickerField.json +17 -17
- package/data/docs/types/DefaultPageRoot.json +2 -2
- package/data/docs/types/DialogCloseTrigger.json +52 -52
- package/data/docs/types/DraggableListField.json +10 -10
- package/data/docs/types/DraggableListItem.json +6 -6
- package/data/docs/types/DraggableListRoot.json +8 -8
- package/data/docs/types/DrawerCloseTrigger.json +52 -52
- package/data/docs/types/FieldErrors.json +2 -2
- package/data/docs/types/Flex.json +22 -22
- package/data/docs/types/Footer.json +6 -6
- package/data/docs/types/FormActionBar.json +200 -0
- package/data/docs/types/FormFieldRoot.json +2 -2
- package/data/docs/types/Grid.json +24 -24
- package/data/docs/types/Group.json +2 -2
- 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 +24 -24
- package/data/docs/types/IconToggleButton.json +17 -17
- package/data/docs/types/Image.json +38 -38
- package/data/docs/types/Indicator.json +6 -6
- package/data/docs/types/InfoDialog.json +104 -0
- package/data/docs/types/InlineSvg.json +2 -2
- package/data/docs/types/Item.json +6 -6
- package/data/docs/types/Kbd.json +8 -8
- package/data/docs/types/Link.json +8 -8
- package/data/docs/types/ListIndicator.json +6 -6
- package/data/docs/types/ListItem.json +6 -6
- package/data/docs/types/ListRoot.json +10 -10
- package/data/docs/types/LoadingSpinner.json +2 -2
- package/data/docs/types/MenuTrigger.json +33 -33
- package/data/docs/types/MultilineTextInput.json +34 -34
- package/data/docs/types/MultilineTextInputField.json +19 -19
- package/data/docs/types/NumberInput.json +19 -19
- package/data/docs/types/NumberInputField.json +38 -38
- package/data/docs/types/PageContentColumn.json +6 -6
- package/data/docs/types/PageContentRoot.json +20 -20
- package/data/docs/types/PasswordInput.json +17 -17
- package/data/docs/types/PasswordInputField.json +17 -17
- package/data/docs/types/ProgressBar.json +21 -21
- package/data/docs/types/RichTextInput.json +2 -2
- package/data/docs/types/Root.json +10 -10
- package/data/docs/types/Row.json +6 -6
- package/data/docs/types/ScrollArea.json +129 -32
- package/data/docs/types/ScrollAreaElementIds.json +9 -0
- package/data/docs/types/ScrollAreaProps.json +9 -0
- package/data/docs/types/SearchInput.json +19 -19
- package/data/docs/types/SearchInputField.json +25 -25
- package/data/docs/types/SelectRoot.json +15 -15
- package/data/docs/types/Separator.json +4 -4
- package/data/docs/types/SimpleGrid.json +28 -28
- package/data/docs/types/SplitButton.json +2 -2
- package/data/docs/types/Stack.json +2 -2
- package/data/docs/types/StepsRoot.json +2 -2
- package/data/docs/types/Switch.json +2 -2
- package/data/docs/types/TabNavItem.json +19 -19
- package/data/docs/types/TabNavRoot.json +18 -18
- 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 +18 -18
- package/data/docs/types/TableRow.json +6 -6
- package/data/docs/types/TableScrollArea.json +6 -6
- package/data/docs/types/TabsTab.json +17 -17
- package/data/docs/types/Text.json +8 -8
- package/data/docs/types/TextInput.json +16 -16
- package/data/docs/types/TextInputField.json +17 -17
- package/data/docs/types/ToggleButton.json +17 -17
- package/data/docs/types/ToggleButtonGroupButton.json +6 -6
- package/data/docs/types/ToggleButtonGroupRoot.json +6 -6
- package/data/docs/types/Toolbar.json +16 -16
- package/data/docs/types/TooltipContent.json +21 -21
- package/data/docs/types/TooltipRoot.json +3 -3
- package/data/docs/types/manifest.json +16 -11
- package/data/docs/types/toast.json +2 -17
- package/package.json +6 -6
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-ScrollArea",
|
|
4
|
+
"title": "ScrollArea",
|
|
5
|
+
"exportName": "ScrollArea",
|
|
6
|
+
"description": "A scrollable container with custom-styled scrollbar overlays. Useful for constrained content areas like panels, sidebars, and dialog bodies.",
|
|
7
|
+
"lifecycleState": "Stable",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/scroll-area/scroll-area.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Layout",
|
|
13
|
+
"ScrollArea"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/layout/scrollarea",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"scroll-area",
|
|
19
|
+
"layout",
|
|
20
|
+
"overflow",
|
|
21
|
+
"scrollbar"
|
|
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": "Orientation",
|
|
57
|
+
"href": "#orientation",
|
|
58
|
+
"depth": 3,
|
|
59
|
+
"numbering": [
|
|
60
|
+
1,
|
|
61
|
+
2,
|
|
62
|
+
1
|
|
63
|
+
],
|
|
64
|
+
"parent": "root"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"value": "Visibility",
|
|
68
|
+
"href": "#visibility",
|
|
69
|
+
"depth": 3,
|
|
70
|
+
"numbering": [
|
|
71
|
+
1,
|
|
72
|
+
2,
|
|
73
|
+
2
|
|
74
|
+
],
|
|
75
|
+
"parent": "root"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"value": "Size",
|
|
79
|
+
"href": "#size",
|
|
80
|
+
"depth": 3,
|
|
81
|
+
"numbering": [
|
|
82
|
+
1,
|
|
83
|
+
2,
|
|
84
|
+
3
|
|
85
|
+
],
|
|
86
|
+
"parent": "root"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"layout": "app-frame",
|
|
90
|
+
"tabs": [
|
|
91
|
+
{
|
|
92
|
+
"key": "overview",
|
|
93
|
+
"title": "Overview",
|
|
94
|
+
"order": 0
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"key": "dev",
|
|
98
|
+
"title": "Implementation",
|
|
99
|
+
"order": 3
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"key": "a11y",
|
|
103
|
+
"title": "Accessibility",
|
|
104
|
+
"order": 4
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"mdx": "\n## Overview\n\nScrollArea constrains content within a fixed region and provides themed\nscrollbar overlays that replace native browser scrollbars. The scrollbar\nappears on hover or during scrolling by default, keeping the interface clean\nuntil the user needs to scroll. The component is keyboard accessible — when\ncontent overflows, the area becomes focusable via Tab and scrollable with\narrow keys.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-scrollarea--docs)\n[Chakra UI ScrollArea](https://chakra-ui.com/docs/components/scroll-area)\n\n## Variables\n\nGet familiar with the features.\n\n### Orientation\n\nControl which axes are scrollable. The default is `both`, so overflow on\neither axis surfaces a visible scrollbar.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"600\">\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Both (default)</Text>\n <ScrollArea maxH=\"120px\" maxW=\"300px\" variant=\"always\">\n <Box whiteSpace=\"nowrap\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">{\"Bidirectional content \".repeat(15)}</Text>\n ))}\n </Box>\n </ScrollArea>\n </Box>\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Vertical</Text>\n <ScrollArea maxH=\"120px\" w=\"300px\" orientation=\"vertical\" variant=\"always\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}: Sample content for vertical scrolling.</Text>\n ))}\n </ScrollArea>\n </Box>\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Horizontal</Text>\n <ScrollArea maxW=\"300px\" orientation=\"horizontal\" variant=\"always\">\n <Box whiteSpace=\"nowrap\">\n {Array.from({ length: 5 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">{\"Horizontal content \".repeat(15)}</Text>\n ))}\n </Box>\n </ScrollArea>\n </Box>\n </Stack>\n);\n```\n\n### Visibility\n\nThe scrollbar can appear on hover (default) or stay permanently visible.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"600\" direction=\"row\">\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Hover (default)</Text>\n <ScrollArea maxH=\"120px\" w=\"200px\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}</Text>\n ))}\n </ScrollArea>\n </Box>\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Always visible</Text>\n <ScrollArea maxH=\"120px\" w=\"200px\" variant=\"always\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}</Text>\n ))}\n </ScrollArea>\n </Box>\n </Stack>\n);\n```\n\n### Size\n\nControl the scrollbar thickness. Available sizes: `xs`, `sm` (default), `md`, `lg`.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"600\" direction=\"row\" flexWrap=\"wrap\">\n {[\"xs\", \"sm\", \"md\", \"lg\"].map((size) => (\n <Box key={size}>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">{size}</Text>\n <ScrollArea maxH=\"120px\" w=\"180px\" size={size} variant=\"always\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}</Text>\n ))}\n </ScrollArea>\n </Box>\n ))}\n </Stack>\n);\n```\n",
|
|
109
|
+
"views": {
|
|
110
|
+
"overview": {
|
|
111
|
+
"mdx": "\n## Overview\n\nScrollArea constrains content within a fixed region and provides themed\nscrollbar overlays that replace native browser scrollbars. The scrollbar\nappears on hover or during scrolling by default, keeping the interface clean\nuntil the user needs to scroll. The component is keyboard accessible — when\ncontent overflows, the area becomes focusable via Tab and scrollable with\narrow keys.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-scrollarea--docs)\n[Chakra UI ScrollArea](https://chakra-ui.com/docs/components/scroll-area)\n\n## Variables\n\nGet familiar with the features.\n\n### Orientation\n\nControl which axes are scrollable. The default is `both`, so overflow on\neither axis surfaces a visible scrollbar.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"600\">\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Both (default)</Text>\n <ScrollArea maxH=\"120px\" maxW=\"300px\" variant=\"always\">\n <Box whiteSpace=\"nowrap\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">{\"Bidirectional content \".repeat(15)}</Text>\n ))}\n </Box>\n </ScrollArea>\n </Box>\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Vertical</Text>\n <ScrollArea maxH=\"120px\" w=\"300px\" orientation=\"vertical\" variant=\"always\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}: Sample content for vertical scrolling.</Text>\n ))}\n </ScrollArea>\n </Box>\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Horizontal</Text>\n <ScrollArea maxW=\"300px\" orientation=\"horizontal\" variant=\"always\">\n <Box whiteSpace=\"nowrap\">\n {Array.from({ length: 5 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">{\"Horizontal content \".repeat(15)}</Text>\n ))}\n </Box>\n </ScrollArea>\n </Box>\n </Stack>\n);\n```\n\n### Visibility\n\nThe scrollbar can appear on hover (default) or stay permanently visible.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"600\" direction=\"row\">\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Hover (default)</Text>\n <ScrollArea maxH=\"120px\" w=\"200px\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}</Text>\n ))}\n </ScrollArea>\n </Box>\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">Always visible</Text>\n <ScrollArea maxH=\"120px\" w=\"200px\" variant=\"always\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}</Text>\n ))}\n </ScrollArea>\n </Box>\n </Stack>\n);\n```\n\n### Size\n\nControl the scrollbar thickness. Available sizes: `xs`, `sm` (default), `md`, `lg`.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"600\" direction=\"row\" flexWrap=\"wrap\">\n {[\"xs\", \"sm\", \"md\", \"lg\"].map((size) => (\n <Box key={size}>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">{size}</Text>\n <ScrollArea maxH=\"120px\" w=\"180px\" size={size} variant=\"always\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}</Text>\n ))}\n </ScrollArea>\n </Box>\n ))}\n </Stack>\n);\n```\n",
|
|
112
|
+
"toc": [
|
|
113
|
+
{
|
|
114
|
+
"value": "Overview",
|
|
115
|
+
"href": "#overview",
|
|
116
|
+
"depth": 2,
|
|
117
|
+
"numbering": [
|
|
118
|
+
1,
|
|
119
|
+
1
|
|
120
|
+
],
|
|
121
|
+
"parent": "root"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"value": "Resources",
|
|
125
|
+
"href": "#resources",
|
|
126
|
+
"depth": 3,
|
|
127
|
+
"numbering": [
|
|
128
|
+
1,
|
|
129
|
+
1,
|
|
130
|
+
1
|
|
131
|
+
],
|
|
132
|
+
"parent": "root"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"value": "Variables",
|
|
136
|
+
"href": "#variables",
|
|
137
|
+
"depth": 2,
|
|
138
|
+
"numbering": [
|
|
139
|
+
1,
|
|
140
|
+
2
|
|
141
|
+
],
|
|
142
|
+
"parent": "root"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"value": "Orientation",
|
|
146
|
+
"href": "#orientation",
|
|
147
|
+
"depth": 3,
|
|
148
|
+
"numbering": [
|
|
149
|
+
1,
|
|
150
|
+
2,
|
|
151
|
+
1
|
|
152
|
+
],
|
|
153
|
+
"parent": "root"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"value": "Visibility",
|
|
157
|
+
"href": "#visibility",
|
|
158
|
+
"depth": 3,
|
|
159
|
+
"numbering": [
|
|
160
|
+
1,
|
|
161
|
+
2,
|
|
162
|
+
2
|
|
163
|
+
],
|
|
164
|
+
"parent": "root"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"value": "Size",
|
|
168
|
+
"href": "#size",
|
|
169
|
+
"depth": 3,
|
|
170
|
+
"numbering": [
|
|
171
|
+
1,
|
|
172
|
+
2,
|
|
173
|
+
3
|
|
174
|
+
],
|
|
175
|
+
"parent": "root"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
"a11y": {
|
|
180
|
+
"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```jsx live\nconst App = () => (\n <ScrollArea maxH=\"200px\" w=\"400px\" role=\"region\" aria-label=\"Example content\">\n {Array.from({ length: 20 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">\n Line {i + 1}: Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Text>\n ))}\n </ScrollArea>\n);\n```\n\n### Accessibility standards\n\n- **Keyboard focusable:** The scrollable viewport receives `tabIndex={0}`\n when content overflows on either axis, making it reachable via Tab and\n scrollable with Arrow keys, Page Up/Down, Home, and End.\n- **Conditional focusability:** When content does not overflow, `tabIndex` is\n not set, so the container does not appear in the Tab order unnecessarily.\n- **Keyboard-only focus ring:** A Nimbus focus ring appears on the root\n element only during keyboard navigation (`:focus-visible`), not on mouse\n click.\n- **Decorative scrollbars:** The custom scrollbar overlays are purely visual.\n Actual scrolling is handled by the browser's native scroll mechanism.\n- **ARIA landmarks:** When the scroll area represents a distinct page section,\n consider adding `role=\"region\"` with `aria-label` or `aria-labelledby` to\n create a named landmark for screen reader navigation.\n- **No keyboard trap:** Standard browser tab order is maintained. Focus moves\n naturally into and out of the scroll area.\n",
|
|
181
|
+
"toc": [
|
|
182
|
+
{
|
|
183
|
+
"value": "Accessibility",
|
|
184
|
+
"href": "#accessibility",
|
|
185
|
+
"depth": 2,
|
|
186
|
+
"numbering": [
|
|
187
|
+
1,
|
|
188
|
+
1
|
|
189
|
+
],
|
|
190
|
+
"parent": "root"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"value": "Accessibility standards",
|
|
194
|
+
"href": "#accessibility-standards",
|
|
195
|
+
"depth": 3,
|
|
196
|
+
"numbering": [
|
|
197
|
+
1,
|
|
198
|
+
1,
|
|
199
|
+
1
|
|
200
|
+
],
|
|
201
|
+
"parent": "root"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
"dev": {
|
|
206
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { ScrollArea, type ScrollAreaProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\nWrap content in a `ScrollArea` with a size constraint. The scrollbar appears on\nhover or during scrolling:\n\n```jsx live-dev\nconst App = () => (\n <ScrollArea maxH=\"200px\" w=\"400px\">\n {Array.from({ length: 20 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">\n Line {i + 1}: Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Text>\n ))}\n </ScrollArea>\n)\n```\n\n## Usage examples\n\n### Orientation\n\nUse the `orientation` prop to control which scrollbar axes are rendered:\n\n```jsx live-dev\nconst App = () => (\n <Stack gap=\"600\">\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">both (default)</Text>\n <ScrollArea maxH=\"120px\" maxW=\"300px\" variant=\"always\">\n <Box whiteSpace=\"nowrap\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">{\"Both axes content \".repeat(15)}</Text>\n ))}\n </Box>\n </ScrollArea>\n </Box>\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">vertical</Text>\n <ScrollArea maxH=\"120px\" w=\"300px\" orientation=\"vertical\" variant=\"always\">\n {Array.from({ length: 15 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">Line {i + 1}</Text>\n ))}\n </ScrollArea>\n </Box>\n <Box>\n <Text fontSize=\"sm\" mb=\"200\" fontWeight=\"bold\">horizontal</Text>\n <ScrollArea maxW=\"300px\" orientation=\"horizontal\" variant=\"always\">\n <Box whiteSpace=\"nowrap\">\n {Array.from({ length: 5 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">{\"Long horizontal content \".repeat(15)}</Text>\n ))}\n </Box>\n </ScrollArea>\n </Box>\n </Stack>\n)\n```\n\n### Content padding\n\nPadding props on `ScrollArea` are forwarded to the content area inside the\nscrollable viewport, so `p`, `px`, `py`, etc. work as expected:\n\n```jsx live-dev\nconst App = () => (\n <ScrollArea maxH=\"200px\" w=\"400px\" bg=\"neutral.2\" borderRadius=\"300\" variant=\"always\" p=\"200\">\n {Array.from({ length: 20 }, (_, i) => (\n <Text key={i} fontSize=\"sm\">\n Line {i + 1}: Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </Text>\n ))}\n </ScrollArea>\n)\n```\n\n### Programmatic scroll access\n\n#### Using `viewportRef`\n\nUse the `viewportRef` prop to get a direct reference to the scrollable viewport\nelement. This is the recommended approach when you need to programmatically\nscroll, attach scroll event listeners, or read scroll position. The ref gives\nyou direct access to the native DOM `scrollTo()` method:\n\n```tsx\nconst viewportRef = useRef<HTMLDivElement>(null);\n\n<ScrollArea viewportRef={viewportRef} maxH=\"400px\">\n {content}\n</ScrollArea>\n\n// Native DOM scrollTo — same API as any scrollable element\nviewportRef.current.scrollTo({ top: 0, behavior: 'smooth' })\n// Or: viewportRef.current.addEventListener('scroll', handler)\n```\n\n#### Using `ids`\n\nWhen ref-forwarding is impractical (e.g., the scroll container is rendered in a\ndifferent component tree), use the `ids` prop to set a known ID on the viewport\nelement for `getElementById` access:\n\n```tsx\n<ScrollArea ids={{ viewport: 'my-scroll-viewport' }} maxH=\"400px\">\n {content}\n</ScrollArea>\n\n// Later: document.getElementById('my-scroll-viewport').scrollTop\n```\n\n#### Using `useScrollArea` (external control)\n\nWhen you need to read scroll state or call scroll methods from *outside* the\n`ScrollArea` tree (e.g., in a parent component), create the machine externally\nwith `useScrollArea` and pass it via the `value` prop. Unlike `viewportRef`\n(which gives you a native DOM element), the `useScrollArea` hook returns a\nstate-machine API with scroll state and convenience methods:\n\n```tsx\nimport { ScrollArea, useScrollArea } from '@commercetools/nimbus';\n\nfunction ParentComponent() {\n const scrollArea = useScrollArea();\n\n return (\n <>\n <button onClick={() => scrollArea.scrollToEdge({ edge: 'top' })}>\n Scroll to top\n </button>\n <p>Has vertical overflow: {String(scrollArea.hasOverflowY)}</p>\n <ScrollArea maxH=\"400px\" value={scrollArea}>\n {content}\n </ScrollArea>\n </>\n );\n}\n```\n\nThe returned object exposes state (`hasOverflowX`, `hasOverflowY`, `isAtTop`,\n`isAtBottom`, `isAtLeft`, `isAtRight`) and methods (`scrollTo()`,\n`scrollToEdge()`, `getScrollProgress()`).\n\n#### Using `useScrollAreaContext` (internal access)\n\nFor components rendered *inside* a `ScrollArea`, the `useScrollAreaContext` hook\nreads the existing machine from React context — no `value` prop needed:\n\n```tsx\nimport { useScrollAreaContext } from '@commercetools/nimbus';\n\nfunction ScrollToTopButton() {\n const { scrollToEdge, isAtTop } = useScrollAreaContext();\n if (isAtTop) return null;\n return <Button onPress={() => scrollToEdge({ edge: 'top', behavior: 'smooth' })}>Back to top</Button>;\n}\n```\n\n## Component requirements\n\n- The component must have a size constraint (`maxH`, `maxW`, `h`, `w`) for scrolling to occur\n\n## Accessibility\n\nThe ScrollArea component ensures keyboard accessibility:\n\n- **Keyboard focusable**: The scrollable viewport receives `tabIndex={0}` when content overflows, making it reachable via Tab\n- **Focus ring**: A Nimbus focus ring appears on the root element when the viewport receives keyboard focus (via `:focus-visible`)\n- **ARIA landmarks**: When the scroll area represents a distinct page section, consider adding `role=\"region\"` with an `aria-label` or `aria-labelledby` to create a named landmark for screen reader navigation\n\n## API reference\n\n<PropsTable id=\"ScrollArea\" />\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using ScrollArea within your application. As the component's internal functionality is already tested by Nimbus, these patterns help you verify your integration and application-specific logic.\n\n### Basic Usage\n\nBasic vertical scrollable container\n\n```tsx\nimport React from \"react\";\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport {\n ScrollArea,\n NimbusProvider,\n useScrollArea,\n Box,\n Text,\n} from \"@commercetools/nimbus\";\n\ndescribe(\"ScrollArea - Basic usage\", () => {\n it(\"renders children inside a scrollable container\", () => {\n render(\n <NimbusProvider>\n <ScrollArea maxH=\"200px\">\n <OverflowingContent />\n </ScrollArea>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Line 1\")).toBeInTheDocument();\n });\n\n it(\"renders with always-visible scrollbars\", () => {\n const { container } = render(\n <NimbusProvider>\n <ScrollArea maxH=\"200px\" variant=\"always\">\n <OverflowingContent />\n </ScrollArea>\n </NimbusProvider>\n );\n\n expect(\n container.querySelector('[data-part=\"scrollbar\"]')\n ).toBeInTheDocument();\n });\n});\n```\n\n### Orientation\n\nControlling which scrollbar axes render\n\n```tsx\nimport React from \"react\";\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport {\n ScrollArea,\n NimbusProvider,\n useScrollArea,\n Box,\n Text,\n} from \"@commercetools/nimbus\";\n\ndescribe(\"ScrollArea - Orientation\", () => {\n it(\"renders horizontal scrollbar\", () => {\n const { container } = render(\n <NimbusProvider>\n <ScrollArea maxW=\"300px\" orientation=\"horizontal\">\n <Box whiteSpace=\"nowrap\">\n <Text>{\"Wide content \".repeat(30)}</Text>\n </Box>\n </ScrollArea>\n </NimbusProvider>\n );\n\n const scrollbar = container.querySelector('[data-part=\"scrollbar\"]');\n expect(scrollbar).toHaveAttribute(\"data-orientation\", \"horizontal\");\n });\n\n it(\"renders both axes with a corner\", () => {\n const { container } = render(\n <NimbusProvider>\n <ScrollArea maxH=\"200px\" maxW=\"300px\" orientation=\"both\">\n <Box whiteSpace=\"nowrap\">\n <OverflowingContent />\n </Box>\n </ScrollArea>\n </NimbusProvider>\n );\n\n const scrollbars = container.querySelectorAll('[data-part=\"scrollbar\"]');\n expect(scrollbars).toHaveLength(2);\n expect(container.querySelector('[data-part=\"corner\"]')).toBeInTheDocument();\n });\n});\n```\n\n### Programmatic scroll access\n\nAccessing the scrollable viewport via ref or external hook\n\n```tsx\nimport React from \"react\";\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport {\n ScrollArea,\n NimbusProvider,\n useScrollArea,\n Box,\n Text,\n} from \"@commercetools/nimbus\";\n\ndescribe(\"ScrollArea - Programmatic access\", () => {\n it(\"forwards a ref to the viewport via viewportRef\", () => {\n const ref = React.createRef<HTMLDivElement>();\n\n render(\n <NimbusProvider>\n <ScrollArea maxH=\"200px\" viewportRef={ref}>\n <OverflowingContent />\n </ScrollArea>\n </NimbusProvider>\n );\n\n expect(ref.current).toHaveAttribute(\"data-part\", \"viewport\");\n expect(typeof ref.current?.scrollTo).toBe(\"function\");\n });\n\n it(\"supports external control via useScrollArea + value prop\", () => {\n const ExternalControl = () => {\n const scrollArea = useScrollArea();\n return (\n <ScrollArea maxH=\"200px\" value={scrollArea}>\n <OverflowingContent />\n </ScrollArea>\n );\n };\n\n render(\n <NimbusProvider>\n <ExternalControl />\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Line 1\")).toBeInTheDocument();\n });\n});\n```\n\n### Content Padding\n\nApplying padding via an inner Box wrapper\n\n```tsx\nimport React from \"react\";\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport {\n ScrollArea,\n NimbusProvider,\n useScrollArea,\n Box,\n Text,\n} from \"@commercetools/nimbus\";\n\ndescribe(\"ScrollArea - Content padding\", () => {\n it(\"renders padded content via a nested Box\", () => {\n render(\n <NimbusProvider>\n <ScrollArea maxH=\"200px\">\n <Box p=\"200\">\n <OverflowingContent />\n </Box>\n </ScrollArea>\n </NimbusProvider>\n );\n\n expect(screen.getByText(\"Line 1\")).toBeInTheDocument();\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-scrollarea--docs)\n- [Chakra UI ScrollArea](https://chakra-ui.com/docs/components/scroll-area)\n",
|
|
207
|
+
"toc": [
|
|
208
|
+
{
|
|
209
|
+
"value": "Getting started",
|
|
210
|
+
"href": "#getting-started",
|
|
211
|
+
"depth": 2,
|
|
212
|
+
"numbering": [
|
|
213
|
+
1,
|
|
214
|
+
1
|
|
215
|
+
],
|
|
216
|
+
"parent": "root"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"value": "Import",
|
|
220
|
+
"href": "#import",
|
|
221
|
+
"depth": 3,
|
|
222
|
+
"numbering": [
|
|
223
|
+
1,
|
|
224
|
+
1,
|
|
225
|
+
1
|
|
226
|
+
],
|
|
227
|
+
"parent": "root"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"value": "Basic usage",
|
|
231
|
+
"href": "#basic-usage",
|
|
232
|
+
"depth": 3,
|
|
233
|
+
"numbering": [
|
|
234
|
+
1,
|
|
235
|
+
1,
|
|
236
|
+
2
|
|
237
|
+
],
|
|
238
|
+
"parent": "root"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"value": "Usage examples",
|
|
242
|
+
"href": "#usage-examples",
|
|
243
|
+
"depth": 2,
|
|
244
|
+
"numbering": [
|
|
245
|
+
1,
|
|
246
|
+
2
|
|
247
|
+
],
|
|
248
|
+
"parent": "root"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"value": "Orientation",
|
|
252
|
+
"href": "#orientation",
|
|
253
|
+
"depth": 3,
|
|
254
|
+
"numbering": [
|
|
255
|
+
1,
|
|
256
|
+
2,
|
|
257
|
+
1
|
|
258
|
+
],
|
|
259
|
+
"parent": "root"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"value": "Content padding",
|
|
263
|
+
"href": "#content-padding",
|
|
264
|
+
"depth": 3,
|
|
265
|
+
"numbering": [
|
|
266
|
+
1,
|
|
267
|
+
2,
|
|
268
|
+
2
|
|
269
|
+
],
|
|
270
|
+
"parent": "root"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"value": "Programmatic scroll access",
|
|
274
|
+
"href": "#programmatic-scroll-access",
|
|
275
|
+
"depth": 3,
|
|
276
|
+
"numbering": [
|
|
277
|
+
1,
|
|
278
|
+
2,
|
|
279
|
+
3
|
|
280
|
+
],
|
|
281
|
+
"parent": "root"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"value": "Using viewportRef",
|
|
285
|
+
"href": "#using-viewportref",
|
|
286
|
+
"depth": 4,
|
|
287
|
+
"numbering": [
|
|
288
|
+
1,
|
|
289
|
+
2,
|
|
290
|
+
3,
|
|
291
|
+
1
|
|
292
|
+
],
|
|
293
|
+
"parent": "root"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"value": "Using ids",
|
|
297
|
+
"href": "#using-ids",
|
|
298
|
+
"depth": 4,
|
|
299
|
+
"numbering": [
|
|
300
|
+
1,
|
|
301
|
+
2,
|
|
302
|
+
3,
|
|
303
|
+
2
|
|
304
|
+
],
|
|
305
|
+
"parent": "root"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"value": "Using useScrollArea (external control)",
|
|
309
|
+
"href": "#using-usescrollarea-external-control",
|
|
310
|
+
"depth": 4,
|
|
311
|
+
"numbering": [
|
|
312
|
+
1,
|
|
313
|
+
2,
|
|
314
|
+
3,
|
|
315
|
+
3
|
|
316
|
+
],
|
|
317
|
+
"parent": "root"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"value": "Using useScrollAreaContext (internal access)",
|
|
321
|
+
"href": "#using-usescrollareacontext-internal-access",
|
|
322
|
+
"depth": 4,
|
|
323
|
+
"numbering": [
|
|
324
|
+
1,
|
|
325
|
+
2,
|
|
326
|
+
3,
|
|
327
|
+
4
|
|
328
|
+
],
|
|
329
|
+
"parent": "root"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"value": "Component requirements",
|
|
333
|
+
"href": "#component-requirements",
|
|
334
|
+
"depth": 2,
|
|
335
|
+
"numbering": [
|
|
336
|
+
1,
|
|
337
|
+
3
|
|
338
|
+
],
|
|
339
|
+
"parent": "root"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"value": "Accessibility",
|
|
343
|
+
"href": "#accessibility",
|
|
344
|
+
"depth": 2,
|
|
345
|
+
"numbering": [
|
|
346
|
+
1,
|
|
347
|
+
4
|
|
348
|
+
],
|
|
349
|
+
"parent": "root"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"value": "API reference",
|
|
353
|
+
"href": "#api-reference",
|
|
354
|
+
"depth": 2,
|
|
355
|
+
"numbering": [
|
|
356
|
+
1,
|
|
357
|
+
5
|
|
358
|
+
],
|
|
359
|
+
"parent": "root"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"value": "Testing your implementation",
|
|
363
|
+
"href": "#testing-your-implementation",
|
|
364
|
+
"depth": 2,
|
|
365
|
+
"numbering": [
|
|
366
|
+
1,
|
|
367
|
+
6
|
|
368
|
+
],
|
|
369
|
+
"parent": "root"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"value": "Basic Usage",
|
|
373
|
+
"href": "#basic-usage-1",
|
|
374
|
+
"depth": 3,
|
|
375
|
+
"numbering": [
|
|
376
|
+
1,
|
|
377
|
+
6,
|
|
378
|
+
1
|
|
379
|
+
],
|
|
380
|
+
"parent": "root"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"value": "Orientation",
|
|
384
|
+
"href": "#orientation-1",
|
|
385
|
+
"depth": 3,
|
|
386
|
+
"numbering": [
|
|
387
|
+
1,
|
|
388
|
+
6,
|
|
389
|
+
2
|
|
390
|
+
],
|
|
391
|
+
"parent": "root"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"value": "Programmatic scroll access",
|
|
395
|
+
"href": "#programmatic-scroll-access-1",
|
|
396
|
+
"depth": 3,
|
|
397
|
+
"numbering": [
|
|
398
|
+
1,
|
|
399
|
+
6,
|
|
400
|
+
3
|
|
401
|
+
],
|
|
402
|
+
"parent": "root"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"value": "Content Padding",
|
|
406
|
+
"href": "#content-padding-1",
|
|
407
|
+
"depth": 3,
|
|
408
|
+
"numbering": [
|
|
409
|
+
1,
|
|
410
|
+
6,
|
|
411
|
+
4
|
|
412
|
+
],
|
|
413
|
+
"parent": "root"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"value": "Resources",
|
|
417
|
+
"href": "#resources",
|
|
418
|
+
"depth": 2,
|
|
419
|
+
"numbering": [
|
|
420
|
+
1,
|
|
421
|
+
7
|
|
422
|
+
],
|
|
423
|
+
"parent": "root"
|
|
424
|
+
}
|
|
425
|
+
]
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
]
|
|
181
181
|
},
|
|
182
182
|
"a11y": {
|
|
183
|
-
"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```jsx live\nconst App = () => (\n <Avatar firstName=\"Adam\" lastName=\"Vadam\" src=\"https://thispersondoesnotexist.com/ \" />\n)\n```\n\n### Accessibility standards\n\n- **Non-text content:** Avatars must have a text alternative. Use the `alt`\n attribute on the `<img>` tag (if the avatar is an image) or through `ARIA` if\n the avatar is more complex. The alt text should describe the avatar's purpose\n or what it represents (e.g., \"User profile picture,\" \"John Doe's avatar,\"\n \"Company logo\"). If the avatar is purely decorative and doesn't convey any\n meaningful information, the alt attribute should be empty (`alt=\"\"`).\n- **Info and relationships:** If the avatar is associated with other information\n (e.g., a username, profile link), the relationship should be programmatically\n determinable. This can be achieved using semantic `HTML` (e.g., placing the\n avatar and username within a single element) or ARIA attributes (e.g.,\n `aria-labelledby` or `aria-describedby`).\n- **Use of color:** Don't rely on color alone to convey information about the\n avatar (e.g., using a colored border to indicate status). Any information\n conveyed by color must also be available through other means.\n- **Color contrast:** If the avatar contains any text (which is less common),\n that text must meet minimum contrast ratio requirements.\n- **Keyboard accessibility:** If the avatar is interactive (e.g., clicking it\n opens a profile), it must be operable using the keyboard. Users should be able\n to navigate to the avatar using the Tab key and activate it using the Enter or\n Space key.\n- **Link purpose:** If the avatar is a link, its purpose should be clear from\n the surrounding context or from the avatar's alt text. Avoid generic link text\n like \"Click here.\"\n- **Focus visible:** If the avatar is interactive, it should have a visible\n focus indicator when it receives keyboard focus.\n- **On focus:** If the avatar is interactive and its appearance changes on\n focus, the change should not be disorienting or unexpected.\n- **Name, role, value:** Assistive technologies should be able to correctly\n interpret the role of the avatar (e.g., `image`, `link`) and its name (from\n the alt text).\n",
|
|
183
|
+
"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```jsx live\nconst App = () => (\n <Avatar firstName=\"Adam\" lastName=\"Vadam\" src=\"https://thispersondoesnotexist.com/ \" />\n)\n```\n\n### Accessibility standards\n\n- **Non-text content:** Avatars must have a text alternative. Use the `alt`\n attribute on the `<img>` tag (if the avatar is an image) or through `ARIA` if\n the avatar is more complex. The alt text should describe the avatar's purpose\n or what it represents (e.g., \"User profile picture,\" \"John Doe's avatar,\"\n \"Company logo\"). If the avatar is purely decorative and doesn't convey any\n meaningful information, the alt attribute should be empty (`alt=\"\"`).\n- **Generic label fallback:** When `firstName` and `lastName` are both\n missing, empty, or whitespace-only, the Avatar renders a generic\n `Person` icon and applies a localized generic `aria-label`\n (`\"User avatar\"` in English, with translations for all supported\n locales). This guarantees screen readers always announce a meaningful\n label even when user identity data is incomplete. Consumers can still\n override with an explicit `aria-label` prop when more specific context\n is available.\n- **Info and relationships:** If the avatar is associated with other information\n (e.g., a username, profile link), the relationship should be programmatically\n determinable. This can be achieved using semantic `HTML` (e.g., placing the\n avatar and username within a single element) or ARIA attributes (e.g.,\n `aria-labelledby` or `aria-describedby`).\n- **Use of color:** Don't rely on color alone to convey information about the\n avatar (e.g., using a colored border to indicate status). Any information\n conveyed by color must also be available through other means.\n- **Color contrast:** If the avatar contains any text (which is less common),\n that text must meet minimum contrast ratio requirements.\n- **Keyboard accessibility:** If the avatar is interactive (e.g., clicking it\n opens a profile), it must be operable using the keyboard. Users should be able\n to navigate to the avatar using the Tab key and activate it using the Enter or\n Space key.\n- **Link purpose:** If the avatar is a link, its purpose should be clear from\n the surrounding context or from the avatar's alt text. Avoid generic link text\n like \"Click here.\"\n- **Focus visible:** If the avatar is interactive, it should have a visible\n focus indicator when it receives keyboard focus.\n- **On focus:** If the avatar is interactive and its appearance changes on\n focus, the change should not be disorienting or unexpected.\n- **Name, role, value:** Assistive technologies should be able to correctly\n interpret the role of the avatar (e.g., `image`, `link`) and its name (from\n the alt text).\n",
|
|
184
184
|
"toc": [
|
|
185
185
|
{
|
|
186
186
|
"value": "Accessibility",
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
]
|
|
207
207
|
},
|
|
208
208
|
"dev": {
|
|
209
|
-
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { Avatar, type AvatarProps } from \"@commercetools/nimbus\";\n```\n\n### Basic usage\n\nThe simplest implementation displays an avatar with initials derived from first\nand last names:\n\n```jsx live-dev\nconst App = () => (\n <Avatar firstName=\"John\" lastName=\"Doe\" />\n)\n```\n\n## Usage examples\n\n### Size options\n\nThe `2xs`, `xs`, and `md` size variants are available to match your interface\ndensity:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"2xs\" />\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"xs\" />\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"md\" />\n </Stack>\n)\n```\n\n### Color palettes\n\nAvatars support different color palettes to convey semantic meaning or match\nyour design theme:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar firstName=\"John\" lastName=\"Doe\" colorPalette=\"primary\" />\n <Avatar firstName=\"Jane\" lastName=\"Smith\" colorPalette=\"positive\" />\n <Avatar firstName=\"Alex\" lastName=\"Chen\" colorPalette=\"info\" />\n <Avatar firstName=\"Maria\" lastName=\"Garcia\" colorPalette=\"critical\" />\n <Avatar firstName=\"Sam\" lastName=\"Wilson\" colorPalette=\"cyan\" />\n </Stack>\n)\n```\n\n### With image\n\nWhen a `src` prop is provided, the Avatar displays the image. If the image fails\nto load, it automatically falls back to initials:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar\n firstName=\"Jane\"\n lastName=\"Smith\"\n src=\"https://i.pravatar.cc/150?img=1\"\n alt=\"Jane Smith's profile picture\"\n />\n <Avatar\n firstName=\"Alex\"\n lastName=\"Johnson\"\n src=\"https://i.pravatar.cc/150?img=2\"\n alt=\"Alex Johnson's profile picture\"\n />\n </Stack>\n)\n```\n\n### Initials fallback\n\nThe Avatar automatically extracts and displays initials from the provided first\nand last names. This serves as a fallback when no image is available or when the\nimage fails to load:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\">\n <Avatar\n firstName=\"Maria\"\n lastName=\"Garcia\"\n src=\"https://www.gravatar.com/avatar/thisWill404?s=200&d=404\" />\n <Avatar\n firstName=\"Chen\"\n lastName=\"Wei\"\n src=\"https://www.gravatar.com/avatar/thisWill404?s=200&d=404\" />\n <Avatar\n firstName=\"Aisha\"\n lastName=\"Patel\"\n src=\"https://www.gravatar.com/avatar/thisWill404?s=200&d=404\" />\n </Stack>\n)\n```\n\n## Component requirements\n\n## Accessibility\n\nThe Avatar component handles most accessibility requirements internally,\nincluding automatic labeling with the user's full name.\n\n- **Labeling**: The component automatically generates an internationalized\n accessible label from the `firstName` and `lastName` props. When providing an\n image via the `src` prop, always include an `alt` attribute for screen\n readers.\n- **Role**: Renders as a `<figure>` element with an `aria-label` that includes\n the full name (e.g., \"Avatar image for John Doe\").\n\nIf your use case requires tracking and analytics for this component, it is good\npractice to add a **persistent**, **unique** id to the component:\n\n```tsx\nconst PERSISTENT_ID = \"example-avatar\";\n\nexport const Example = () => (\n <Avatar id={PERSISTENT_ID} firstName=\"John\" lastName=\"Doe\" />\n);\n```\n\n#### Keyboard navigation\n\nAvatars are non-interactive elements and do not receive focus or support\nkeyboard interaction by default. If you need to make an avatar interactive\n(e.g., clickable), wrap it in a button or interactive element:\n\n```tsx\n<button onClick={handleClick} aria-label=\"View profile\">\n <Avatar firstName=\"John\" lastName=\"Doe\" />\n</button>\n```\n\n## API reference\n\n<PropsTable id=\"Avatar\" />\n\n## Common patterns\n\n### User profile header\n\nCombine Avatar with text components to create a user profile header:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar\n firstName=\"Sarah\"\n lastName=\"Johnson\"\n src=\"https://i.pravatar.cc/150?img=5\"\n size=\"md\"\n />\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"md\" fontWeight=\"600\">Sarah Johnson</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">Product Manager</Text>\n </Stack>\n </Stack>\n)\n```\n\n### Comment or message list\n\nDisplay avatars alongside user content in comments or messages:\n\n```jsx live-dev\nconst App = () => {\n const comments = [\n { id: 1, author: { firstName: \"Alex\", lastName: \"Chen\" }, text: \"Great work on this feature!\", time: \"2 hours ago\" },\n { id: 2, author: { firstName: \"Maria\", lastName: \"Garcia\" }, text: \"I agree, this is really helpful.\", time: \"1 hour ago\" },\n { id: 3, author: { firstName: \"James\", lastName: \"Wilson\" }, text: \"Looking forward to the next update.\", time: \"30 minutes ago\" },\n ];\n\n return (\n <Stack direction=\"column\" gap=\"600\">\n {comments.map((comment) => (\n <Stack key={comment.id} direction=\"row\" gap=\"400\">\n <Avatar\n firstName={comment.author.firstName}\n lastName={comment.author.lastName}\n size=\"xs\"\n />\n <Stack direction=\"column\" gap=\"100\" flex=\"1\">\n <Stack direction=\"row\" gap=\"200\" alignItems=\"baseline\">\n <Text fontSize=\"sm\" fontWeight=\"600\">\n {comment.author.firstName} {comment.author.lastName}\n </Text>\n <Text fontSize=\"xs\" color=\"neutral.11\">{comment.time}</Text>\n </Stack>\n <Text fontSize=\"sm\">{comment.text}</Text>\n </Stack>\n </Stack>\n ))}\n </Stack>\n );\n}\n```\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using Avatar\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### Basic rendering tests\n\nVerify the Avatar renders with expected elements and labels\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Avatar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Avatar - Basic rendering\", () => {\n it(\"renders avatar with initials\", () => {\n render(\n <NimbusProvider>\n <Avatar firstName=\"John\" lastName=\"Doe\" />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"figure\")).toBeInTheDocument();\n expect(screen.getByLabelText(/John Doe/i)).toBeInTheDocument();\n expect(screen.getByText(\"JD\")).toBeInTheDocument();\n });\n\n it(\"renders avatar with image\", () => {\n render(\n <NimbusProvider>\n <Avatar\n firstName=\"Jane\"\n lastName=\"Smith\"\n src=\"https://example.com/avatar.jpg\"\n alt=\"Jane Smith profile\"\n />\n </NimbusProvider>\n );\n\n const image = screen.getByAltText(\"Jane Smith profile\");\n expect(image).toBeInTheDocument();\n expect(image).toHaveAttribute(\"src\", \"https://example.com/avatar.jpg\");\n });\n});\n```\n\n### Size variant tests\n\nTest different size options\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Avatar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Avatar - Size variants\", () => {\n it(\"renders different sizes correctly\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"2xs\" />\n </NimbusProvider>\n );\n\n let avatar = screen.getByRole(\"figure\");\n expect(avatar).toBeInTheDocument();\n\n rerender(\n <NimbusProvider>\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"xs\" />\n </NimbusProvider>\n );\n\n avatar = screen.getByRole(\"figure\");\n expect(avatar).toBeInTheDocument();\n\n rerender(\n <NimbusProvider>\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"md\" />\n </NimbusProvider>\n );\n\n avatar = screen.getByRole(\"figure\");\n expect(avatar).toBeInTheDocument();\n });\n});\n```\n\n### Accessibility tests\n\nVerify accessibility attributes and labeling\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Avatar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Avatar - Accessibility\", () => {\n it(\"has correct aria-label with full name\", () => {\n render(\n <NimbusProvider>\n <Avatar firstName=\"Maria\" lastName=\"Garcia\" />\n </NimbusProvider>\n );\n\n const avatar = screen.getByLabelText(/Maria Garcia/i);\n expect(avatar).toBeInTheDocument();\n expect(avatar.tagName).toBe(\"FIGURE\");\n });\n\n it(\"applies custom id for tracking\", () => {\n const PERSISTENT_ID = \"test-avatar-id\";\n\n render(\n <NimbusProvider>\n <Avatar id={PERSISTENT_ID} firstName=\"John\" lastName=\"Doe\" />\n </NimbusProvider>\n );\n\n const avatar = screen.getByRole(\"figure\");\n expect(avatar).toHaveAttribute(\"id\", PERSISTENT_ID);\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-avatar--docs)\n",
|
|
209
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { Avatar, type AvatarProps } from \"@commercetools/nimbus\";\n```\n\n### Basic usage\n\nThe simplest implementation displays an avatar with initials derived from first\nand last names:\n\n```jsx live-dev\nconst App = () => (\n <Avatar firstName=\"John\" lastName=\"Doe\" />\n)\n```\n\n## Usage examples\n\n### Size options\n\nThe `2xs`, `xs`, and `md` size variants are available to match your interface\ndensity:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"2xs\" />\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"xs\" />\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"md\" />\n </Stack>\n)\n```\n\n### Color palettes\n\nAvatars support different color palettes to convey semantic meaning or match\nyour design theme:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar firstName=\"John\" lastName=\"Doe\" colorPalette=\"primary\" />\n <Avatar firstName=\"Jane\" lastName=\"Smith\" colorPalette=\"positive\" />\n <Avatar firstName=\"Alex\" lastName=\"Chen\" colorPalette=\"info\" />\n <Avatar firstName=\"Maria\" lastName=\"Garcia\" colorPalette=\"critical\" />\n <Avatar firstName=\"Sam\" lastName=\"Wilson\" colorPalette=\"cyan\" />\n </Stack>\n)\n```\n\n### With image\n\nWhen a `src` prop is provided, the Avatar displays the image. If the image fails\nto load, it automatically falls back to initials:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar\n firstName=\"Jane\"\n lastName=\"Smith\"\n src=\"https://i.pravatar.cc/150?img=1\"\n alt=\"Jane Smith's profile picture\"\n />\n <Avatar\n firstName=\"Alex\"\n lastName=\"Johnson\"\n src=\"https://i.pravatar.cc/150?img=2\"\n alt=\"Alex Johnson's profile picture\"\n />\n </Stack>\n)\n```\n\n### Initials fallback\n\nThe Avatar automatically extracts and displays initials from the provided first\nand last names. This serves as a fallback when no image is available or when the\nimage fails to load:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\">\n <Avatar\n firstName=\"Maria\"\n lastName=\"Garcia\"\n src=\"https://www.gravatar.com/avatar/thisWill404?s=200&d=404\" />\n <Avatar\n firstName=\"Chen\"\n lastName=\"Wei\"\n src=\"https://www.gravatar.com/avatar/thisWill404?s=200&d=404\" />\n <Avatar\n firstName=\"Aisha\"\n lastName=\"Patel\"\n src=\"https://www.gravatar.com/avatar/thisWill404?s=200&d=404\" />\n </Stack>\n)\n```\n\n### Missing or partial names\n\n`firstName` and `lastName` are both **optional**. The Avatar handles missing,\nempty, and whitespace-only values defensively:\n\n- If only one name is usable (after trimming whitespace), a single initial\n is rendered.\n- If neither name yields a usable character, a generic `Person` icon is\n rendered as the fallback and a localized generic `aria-label`\n (`\"User avatar\"`) is applied.\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar firstName=\"John\" /> {/* renders \"J\" */}\n <Avatar lastName=\"Doe\" /> {/* renders \"D\" */}\n <Avatar firstName=\"\" lastName=\"\" /> {/* renders the Person icon */}\n <Avatar /> {/* renders the Person icon */}\n </Stack>\n)\n```\n\nThis is intended for cases where user records have incomplete name data —\ncommon in legacy systems and partial profiles. The component's TypeScript\ncontract permits `undefined` so call sites do not need non-null assertions\nor empty-string fallbacks.\n\nInitials extraction is also Unicode codepoint-safe (emoji and astral-plane\ncharacters are not split mid-surrogate) and trim-aware (leading/trailing\nwhitespace is discarded before extracting the first character).\n\n## Component requirements\n\n## Accessibility\n\nThe Avatar component handles most accessibility requirements internally,\nincluding automatic labeling with the user's full name.\n\n- **Labeling**: The component automatically generates an internationalized\n accessible label from the `firstName` and `lastName` props. When providing an\n image via the `src` prop, always include an `alt` attribute for screen\n readers.\n- **Role**: Renders as a `<figure>` element with an `aria-label` that includes\n the full name (e.g., \"Avatar image for John Doe\").\n\nIf your use case requires tracking and analytics for this component, it is good\npractice to add a **persistent**, **unique** id to the component:\n\n```tsx\nconst PERSISTENT_ID = \"example-avatar\";\n\nexport const Example = () => (\n <Avatar id={PERSISTENT_ID} firstName=\"John\" lastName=\"Doe\" />\n);\n```\n\n#### Keyboard navigation\n\nAvatars are non-interactive elements and do not receive focus or support\nkeyboard interaction by default. If you need to make an avatar interactive\n(e.g., clickable), wrap it in a button or interactive element:\n\n```tsx\n<button onClick={handleClick} aria-label=\"View profile\">\n <Avatar firstName=\"John\" lastName=\"Doe\" />\n</button>\n```\n\n## API reference\n\n<PropsTable id=\"Avatar\" />\n\n## Common patterns\n\n### User profile header\n\nCombine Avatar with text components to create a user profile header:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"center\">\n <Avatar\n firstName=\"Sarah\"\n lastName=\"Johnson\"\n src=\"https://i.pravatar.cc/150?img=5\"\n size=\"md\"\n />\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"md\" fontWeight=\"600\">Sarah Johnson</Text>\n <Text fontSize=\"sm\" color=\"neutral.11\">Product Manager</Text>\n </Stack>\n </Stack>\n)\n```\n\n### Comment or message list\n\nDisplay avatars alongside user content in comments or messages:\n\n```jsx live-dev\nconst App = () => {\n const comments = [\n { id: 1, author: { firstName: \"Alex\", lastName: \"Chen\" }, text: \"Great work on this feature!\", time: \"2 hours ago\" },\n { id: 2, author: { firstName: \"Maria\", lastName: \"Garcia\" }, text: \"I agree, this is really helpful.\", time: \"1 hour ago\" },\n { id: 3, author: { firstName: \"James\", lastName: \"Wilson\" }, text: \"Looking forward to the next update.\", time: \"30 minutes ago\" },\n ];\n\n return (\n <Stack direction=\"column\" gap=\"600\">\n {comments.map((comment) => (\n <Stack key={comment.id} direction=\"row\" gap=\"400\">\n <Avatar\n firstName={comment.author.firstName}\n lastName={comment.author.lastName}\n size=\"xs\"\n />\n <Stack direction=\"column\" gap=\"100\" flex=\"1\">\n <Stack direction=\"row\" gap=\"200\" alignItems=\"baseline\">\n <Text fontSize=\"sm\" fontWeight=\"600\">\n {comment.author.firstName} {comment.author.lastName}\n </Text>\n <Text fontSize=\"xs\" color=\"neutral.11\">{comment.time}</Text>\n </Stack>\n <Text fontSize=\"sm\">{comment.text}</Text>\n </Stack>\n </Stack>\n ))}\n </Stack>\n );\n}\n```\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using Avatar\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### Basic rendering tests\n\nVerify the Avatar renders with expected elements and labels\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Avatar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Avatar - Basic rendering\", () => {\n it(\"renders avatar with initials\", () => {\n render(\n <NimbusProvider>\n <Avatar firstName=\"John\" lastName=\"Doe\" />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"figure\")).toBeInTheDocument();\n expect(screen.getByLabelText(/John Doe/i)).toBeInTheDocument();\n expect(screen.getByText(\"JD\")).toBeInTheDocument();\n });\n\n it(\"renders avatar with image\", () => {\n render(\n <NimbusProvider>\n <Avatar\n firstName=\"Jane\"\n lastName=\"Smith\"\n src=\"https://example.com/avatar.jpg\"\n alt=\"Jane Smith profile\"\n />\n </NimbusProvider>\n );\n\n const image = screen.getByAltText(\"Jane Smith profile\");\n expect(image).toBeInTheDocument();\n expect(image).toHaveAttribute(\"src\", \"https://example.com/avatar.jpg\");\n });\n});\n```\n\n### Size variant tests\n\nTest different size options\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Avatar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Avatar - Size variants\", () => {\n it(\"renders different sizes correctly\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"2xs\" />\n </NimbusProvider>\n );\n\n let avatar = screen.getByRole(\"figure\");\n expect(avatar).toBeInTheDocument();\n\n rerender(\n <NimbusProvider>\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"xs\" />\n </NimbusProvider>\n );\n\n avatar = screen.getByRole(\"figure\");\n expect(avatar).toBeInTheDocument();\n\n rerender(\n <NimbusProvider>\n <Avatar firstName=\"John\" lastName=\"Doe\" size=\"md\" />\n </NimbusProvider>\n );\n\n avatar = screen.getByRole(\"figure\");\n expect(avatar).toBeInTheDocument();\n });\n});\n```\n\n### Accessibility tests\n\nVerify accessibility attributes and labeling\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Avatar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Avatar - Accessibility\", () => {\n it(\"has correct aria-label with full name\", () => {\n render(\n <NimbusProvider>\n <Avatar firstName=\"Maria\" lastName=\"Garcia\" />\n </NimbusProvider>\n );\n\n const avatar = screen.getByLabelText(/Maria Garcia/i);\n expect(avatar).toBeInTheDocument();\n expect(avatar.tagName).toBe(\"FIGURE\");\n });\n\n it(\"applies custom id for tracking\", () => {\n const PERSISTENT_ID = \"test-avatar-id\";\n\n render(\n <NimbusProvider>\n <Avatar id={PERSISTENT_ID} firstName=\"John\" lastName=\"Doe\" />\n </NimbusProvider>\n );\n\n const avatar = screen.getByRole(\"figure\");\n expect(avatar).toHaveAttribute(\"id\", PERSISTENT_ID);\n });\n});\n```\n\n### Missing-name fallback tests\n\nVerify the Avatar renders a generic icon and label when\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { Avatar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"Avatar - Missing names\", () => {\n it(\"renders the Person icon and generic aria-label when both names are missing\", () => {\n render(\n <NimbusProvider>\n <Avatar />\n </NimbusProvider>\n );\n\n const avatar = screen.getByRole(\"figure\");\n // Generic localized aria-label (\"Generic user avatar\" in English)\n expect(avatar).toHaveAttribute(\"aria-label\", \"Generic user avatar\");\n // Person icon is rendered as the visual fallback\n expect(avatar.querySelector(\"svg\")).not.toBeNull();\n // No initials text is rendered\n expect(avatar.textContent?.trim()).toBe(\"\");\n });\n\n it(\"renders a single initial when only firstName is provided\", () => {\n render(\n <NimbusProvider>\n <Avatar firstName=\"John\" />\n </NimbusProvider>\n );\n\n const avatar = screen.getByRole(\"figure\");\n expect(avatar.textContent?.trim()).toBe(\"J\");\n expect(avatar.querySelector(\"svg\")).toBeNull();\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-avatar--docs)\n",
|
|
210
210
|
"toc": [
|
|
211
211
|
{
|
|
212
212
|
"value": "Getting started",
|
|
@@ -294,6 +294,17 @@
|
|
|
294
294
|
],
|
|
295
295
|
"parent": "root"
|
|
296
296
|
},
|
|
297
|
+
{
|
|
298
|
+
"value": "Missing or partial names",
|
|
299
|
+
"href": "#missing-or-partial-names",
|
|
300
|
+
"depth": 3,
|
|
301
|
+
"numbering": [
|
|
302
|
+
1,
|
|
303
|
+
2,
|
|
304
|
+
5
|
|
305
|
+
],
|
|
306
|
+
"parent": "root"
|
|
307
|
+
},
|
|
297
308
|
{
|
|
298
309
|
"value": "Component requirements",
|
|
299
310
|
"href": "#component-requirements",
|
|
@@ -411,6 +422,17 @@
|
|
|
411
422
|
],
|
|
412
423
|
"parent": "root"
|
|
413
424
|
},
|
|
425
|
+
{
|
|
426
|
+
"value": "Missing-name fallback tests",
|
|
427
|
+
"href": "#missing-name-fallback-tests",
|
|
428
|
+
"depth": 3,
|
|
429
|
+
"numbering": [
|
|
430
|
+
1,
|
|
431
|
+
7,
|
|
432
|
+
4
|
|
433
|
+
],
|
|
434
|
+
"parent": "root"
|
|
435
|
+
},
|
|
414
436
|
{
|
|
415
437
|
"value": "Resources",
|
|
416
438
|
"href": "#resources",
|