@commercetools/nimbus-mcp 3.3.0 → 3.5.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 +714 -14
- package/data/docs/routes/components-data-display-data-table.json +172 -14
- 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-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-inputs-range-slider.json +633 -0
- package/data/docs/routes/components-inputs-slider.json +611 -0
- package/data/docs/routes/components-navigation-breadcrumbs.json +565 -0
- package/data/docs/routes/home-getting-started-installation.json +2 -2
- package/data/docs/routes/icons.json +3 -3
- package/data/docs/search-index.json +1 -1
- package/data/docs/types/AccordionContent.json +27 -27
- package/data/docs/types/AccordionHeader.json +89 -89
- package/data/docs/types/AccordionItem.json +22 -22
- package/data/docs/types/AccordionRoot.json +14 -14
- package/data/docs/types/ActivityIndicator.json +2 -2
- package/data/docs/types/AlertDescription.json +8 -8
- package/data/docs/types/AlertDismissButton.json +80 -80
- package/data/docs/types/AlertTitle.json +8 -8
- package/data/docs/types/Avatar.json +2 -2
- package/data/docs/types/Badge.json +3 -3
- 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 +88 -88
- 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 +20 -20
- package/data/docs/types/ChatMessageAvatar.json +2 -2
- package/data/docs/types/ChatMessageListRoot.json +2 -2
- package/data/docs/types/ChatMessageRoot.json +2 -2
- package/data/docs/types/Checkbox.json +88 -88
- package/data/docs/types/Code.json +10 -10
- package/data/docs/types/CollapsibleMotionContent.json +2 -2
- package/data/docs/types/CollapsibleMotionRoot.json +2 -2
- package/data/docs/types/CollapsibleMotionTrigger.json +4 -4
- package/data/docs/types/Column.json +8 -8
- package/data/docs/types/ColumnGroup.json +8 -8
- package/data/docs/types/ColumnHeader.json +18 -18
- package/data/docs/types/ComboBoxListBox.json +70 -70
- package/data/docs/types/ComboBoxOption.json +64 -64
- package/data/docs/types/ComboBoxPopover.json +148 -72
- package/data/docs/types/ComboBoxRoot.json +8 -8
- package/data/docs/types/ComboBoxSection.json +25 -25
- package/data/docs/types/ComboBoxTrigger.json +6 -6
- package/data/docs/types/Content.json +2 -2
- package/data/docs/types/DataTable.json +38 -23
- package/data/docs/types/DataTableBody.json +60 -79
- package/data/docs/types/DataTableCell.json +434 -0
- package/data/docs/types/DataTableColumn.json +540 -0
- package/data/docs/types/DataTableHeader.json +62 -85
- package/data/docs/types/DataTableRoot.json +38 -23
- package/data/docs/types/DataTableRow.json +790 -0
- package/data/docs/types/DataTableTable.json +20 -20
- package/data/docs/types/DateInput.json +72 -72
- 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/DefaultPageBackLink.json +16 -16
- package/data/docs/types/DefaultPageRoot.json +2 -2
- package/data/docs/types/DialogCloseTrigger.json +78 -78
- package/data/docs/types/DialogTrigger.json +2 -2
- package/data/docs/types/DraggableListField.json +62 -62
- package/data/docs/types/DraggableListItem.json +100 -53
- package/data/docs/types/DraggableListRoot.json +62 -62
- package/data/docs/types/DrawerCloseTrigger.json +78 -78
- package/data/docs/types/DrawerTrigger.json +2 -2
- package/data/docs/types/DropZone.json +14 -14
- package/data/docs/types/FieldErrors.json +2 -2
- package/data/docs/types/Flex.json +22 -22
- package/data/docs/types/FloatingActionButton.json +88 -88
- package/data/docs/types/Footer.json +6 -6
- 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 +88 -88
- package/data/docs/types/IconToggleButton.json +72 -72
- package/data/docs/types/Image.json +30 -30
- 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 +30 -30
- 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/MakeElementFocusable.json +18 -18
- package/data/docs/types/Markdown.json +6 -6
- package/data/docs/types/MenuItem.json +63 -63
- package/data/docs/types/MenuRoot.json +56 -56
- package/data/docs/types/MenuSection.json +31 -31
- package/data/docs/types/MenuSubmenuTrigger.json +4 -4
- package/data/docs/types/MenuTrigger.json +89 -89
- 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 +10 -10
- 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/SplitButton.json +10 -10
- package/data/docs/types/Stack.json +2 -2
- package/data/docs/types/StepsNextTrigger.json +2 -2
- package/data/docs/types/StepsPrevTrigger.json +2 -2
- package/data/docs/types/StepsRoot.json +2 -2
- package/data/docs/types/StepsTrigger.json +2 -2
- package/data/docs/types/Switch.json +36 -36
- package/data/docs/types/TabNavItem.json +18 -18
- package/data/docs/types/TabNavRoot.json +2 -2
- package/data/docs/types/TableBody.json +6 -6
- package/data/docs/types/TableCaption.json +6 -6
- package/data/docs/types/TableCell.json +20 -20
- package/data/docs/types/TableColumn.json +8 -8
- package/data/docs/types/TableColumnGroup.json +8 -8
- package/data/docs/types/TableColumnHeader.json +18 -18
- package/data/docs/types/TableFooter.json +6 -6
- package/data/docs/types/TableHeader.json +6 -6
- package/data/docs/types/TableRoot.json +32 -32
- package/data/docs/types/TableRow.json +6 -6
- package/data/docs/types/TableScrollArea.json +6 -6
- 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 +15 -15
- 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 +74 -74
- package/data/docs/types/ToggleButtonGroupButton.json +32 -32
- 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/TreeIndicator.json +82 -82
- package/data/docs/types/TreeItem.json +100 -51
- package/data/docs/types/TreeRoot.json +57 -57
- package/data/docs/types/Trigger.json +4 -4
- 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 +28 -0
- package/data/docs/types/useRegion.json +2 -2
- package/data/docs/types/useTree.json +24 -24
- package/data/tokens.json +42 -0
- package/package.json +7 -7
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-SkeletonText",
|
|
4
|
+
"title": "SkeletonText",
|
|
5
|
+
"exportName": "SkeletonText",
|
|
6
|
+
"description": "A stack of placeholder lines that approximates a paragraph of text while content loads.",
|
|
7
|
+
"lifecycleState": "Stable",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/skeleton/derivatives/skeleton-text/skeleton-text.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Feedback",
|
|
13
|
+
"SkeletonText"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/feedback/skeletontext",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"skeleton",
|
|
19
|
+
"loading",
|
|
20
|
+
"placeholder",
|
|
21
|
+
"feedback",
|
|
22
|
+
"text"
|
|
23
|
+
],
|
|
24
|
+
"toc": [
|
|
25
|
+
{
|
|
26
|
+
"value": "Overview",
|
|
27
|
+
"href": "#overview",
|
|
28
|
+
"depth": 2,
|
|
29
|
+
"numbering": [
|
|
30
|
+
1,
|
|
31
|
+
1
|
|
32
|
+
],
|
|
33
|
+
"parent": "root"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"value": "Resources",
|
|
37
|
+
"href": "#resources",
|
|
38
|
+
"depth": 3,
|
|
39
|
+
"numbering": [
|
|
40
|
+
1,
|
|
41
|
+
1,
|
|
42
|
+
1
|
|
43
|
+
],
|
|
44
|
+
"parent": "root"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"value": "Variables",
|
|
48
|
+
"href": "#variables",
|
|
49
|
+
"depth": 2,
|
|
50
|
+
"numbering": [
|
|
51
|
+
1,
|
|
52
|
+
2
|
|
53
|
+
],
|
|
54
|
+
"parent": "root"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"value": "Line count",
|
|
58
|
+
"href": "#line-count",
|
|
59
|
+
"depth": 3,
|
|
60
|
+
"numbering": [
|
|
61
|
+
1,
|
|
62
|
+
2,
|
|
63
|
+
1
|
|
64
|
+
],
|
|
65
|
+
"parent": "root"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"value": "Matching text size",
|
|
69
|
+
"href": "#matching-text-size",
|
|
70
|
+
"depth": 3,
|
|
71
|
+
"numbering": [
|
|
72
|
+
1,
|
|
73
|
+
2,
|
|
74
|
+
2
|
|
75
|
+
],
|
|
76
|
+
"parent": "root"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"value": "Last line width",
|
|
80
|
+
"href": "#last-line-width",
|
|
81
|
+
"depth": 3,
|
|
82
|
+
"numbering": [
|
|
83
|
+
1,
|
|
84
|
+
2,
|
|
85
|
+
3
|
|
86
|
+
],
|
|
87
|
+
"parent": "root"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"value": "Guidelines",
|
|
91
|
+
"href": "#guidelines",
|
|
92
|
+
"depth": 2,
|
|
93
|
+
"numbering": [
|
|
94
|
+
1,
|
|
95
|
+
3
|
|
96
|
+
],
|
|
97
|
+
"parent": "root"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"value": "Best practices",
|
|
101
|
+
"href": "#best-practices",
|
|
102
|
+
"depth": 3,
|
|
103
|
+
"numbering": [
|
|
104
|
+
1,
|
|
105
|
+
3,
|
|
106
|
+
1
|
|
107
|
+
],
|
|
108
|
+
"parent": "root"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"value": "When to use",
|
|
112
|
+
"href": "#when-to-use",
|
|
113
|
+
"depth": 3,
|
|
114
|
+
"numbering": [
|
|
115
|
+
1,
|
|
116
|
+
3,
|
|
117
|
+
2
|
|
118
|
+
],
|
|
119
|
+
"parent": "root"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"layout": "app-frame",
|
|
123
|
+
"tabs": [
|
|
124
|
+
{
|
|
125
|
+
"key": "overview",
|
|
126
|
+
"title": "Overview",
|
|
127
|
+
"order": 0
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"key": "dev",
|
|
131
|
+
"title": "Implementation",
|
|
132
|
+
"order": 3
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"mdx": "\n## Overview\n\n`SkeletonText` renders a stack of placeholder lines that stand in for a\nparagraph of text while it loads. The last line is narrower by default to mimic\na natural paragraph ending, and the lines are sized to the same vertical rhythm\nas the real text they replace — so the transition to loaded content stays\nsmooth.\n\n`SkeletonText` is part of the Skeleton family, built from\n[Skeleton](/components/feedback/skeleton) lines. For single blocks, images, or\ncustom shapes use `Skeleton` directly; for avatars and icons use\n[SkeletonCircle](/components/feedback/skeletoncircle).\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system)\n\n## Variables\n\nGet familiar with the features.\n\n### Line count\n\nUse `lines` to set how many placeholder lines to render. Set the block's\n`width` to match the column the text will occupy.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"row\" gap=\"800\" width=\"600px\">\n <SkeletonText lines={2} width=\"100%\" />\n <SkeletonText lines={4} width=\"100%\" />\n </Stack>\n)\n```\n\n### Matching text size\n\nSet `textStyle` (default `body`) so the placeholder lines match the size and\nline spacing of the text they stand in for — from small captions to large\nheadings. Each bar's height and the gaps between them resize together, keeping\nthe same vertical rhythm as real text of that style.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"600\" width=\"300px\">\n <SkeletonText textStyle=\"caption\" />\n <SkeletonText textStyle=\"body\" />\n <SkeletonText textStyle=\"3xl\" lines={2} />\n </Stack>\n)\n```\n\n### Last line width\n\nThe last line is narrower by default (`lastLineWidth=\"60%\"`) to mimic a\nparagraph ending. Adjust it to match the content, or set it to `\"100%\"` for a\njustified block.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"row\" gap=\"800\" width=\"600px\">\n <SkeletonText lines={3} width=\"100%\" lastLineWidth=\"40%\" />\n <SkeletonText lines={3} width=\"100%\" lastLineWidth=\"100%\" />\n </Stack>\n)\n```\n\n## Guidelines\n\n### Best practices\n\n- Match `textStyle` to the text you are standing in for so the placeholder\n occupies the same space as the loaded content and avoids layout shift.\n- Use `SkeletonText` for multi-line paragraphs; for a single heading or line,\n the base `Skeleton` gives you more direct control over height and width.\n- Keep the line count realistic — approximating the real paragraph length keeps\n the transition to loaded content smooth.\n\n### When to use\n\n> [!TIP]\\\n> Use SkeletonText when:\n- You are loading a paragraph, description, or block of running text\n- You want the placeholder to match a specific text style's size and rhythm\n- A detail panel or card contains several lines of text\n\n> [!CAUTION]\\\n> When NOT to use SkeletonText:\n- For a single line, heading, or non-text block — use\n [Skeleton](/components/feedback/skeleton) instead\n- For circular content such as avatars — use\n [SkeletonCircle](/components/feedback/skeletoncircle)\n",
|
|
137
|
+
"views": {
|
|
138
|
+
"overview": {
|
|
139
|
+
"mdx": "\n## Overview\n\n`SkeletonText` renders a stack of placeholder lines that stand in for a\nparagraph of text while it loads. The last line is narrower by default to mimic\na natural paragraph ending, and the lines are sized to the same vertical rhythm\nas the real text they replace — so the transition to loaded content stays\nsmooth.\n\n`SkeletonText` is part of the Skeleton family, built from\n[Skeleton](/components/feedback/skeleton) lines. For single blocks, images, or\ncustom shapes use `Skeleton` directly; for avatars and icons use\n[SkeletonCircle](/components/feedback/skeletoncircle).\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system)\n\n## Variables\n\nGet familiar with the features.\n\n### Line count\n\nUse `lines` to set how many placeholder lines to render. Set the block's\n`width` to match the column the text will occupy.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"row\" gap=\"800\" width=\"600px\">\n <SkeletonText lines={2} width=\"100%\" />\n <SkeletonText lines={4} width=\"100%\" />\n </Stack>\n)\n```\n\n### Matching text size\n\nSet `textStyle` (default `body`) so the placeholder lines match the size and\nline spacing of the text they stand in for — from small captions to large\nheadings. Each bar's height and the gaps between them resize together, keeping\nthe same vertical rhythm as real text of that style.\n\n```jsx live\nconst App = () => (\n <Stack gap=\"600\" width=\"300px\">\n <SkeletonText textStyle=\"caption\" />\n <SkeletonText textStyle=\"body\" />\n <SkeletonText textStyle=\"3xl\" lines={2} />\n </Stack>\n)\n```\n\n### Last line width\n\nThe last line is narrower by default (`lastLineWidth=\"60%\"`) to mimic a\nparagraph ending. Adjust it to match the content, or set it to `\"100%\"` for a\njustified block.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"row\" gap=\"800\" width=\"600px\">\n <SkeletonText lines={3} width=\"100%\" lastLineWidth=\"40%\" />\n <SkeletonText lines={3} width=\"100%\" lastLineWidth=\"100%\" />\n </Stack>\n)\n```\n\n## Guidelines\n\n### Best practices\n\n- Match `textStyle` to the text you are standing in for so the placeholder\n occupies the same space as the loaded content and avoids layout shift.\n- Use `SkeletonText` for multi-line paragraphs; for a single heading or line,\n the base `Skeleton` gives you more direct control over height and width.\n- Keep the line count realistic — approximating the real paragraph length keeps\n the transition to loaded content smooth.\n\n### When to use\n\n> [!TIP]\\\n> Use SkeletonText when:\n- You are loading a paragraph, description, or block of running text\n- You want the placeholder to match a specific text style's size and rhythm\n- A detail panel or card contains several lines of text\n\n> [!CAUTION]\\\n> When NOT to use SkeletonText:\n- For a single line, heading, or non-text block — use\n [Skeleton](/components/feedback/skeleton) instead\n- For circular content such as avatars — use\n [SkeletonCircle](/components/feedback/skeletoncircle)\n",
|
|
140
|
+
"toc": [
|
|
141
|
+
{
|
|
142
|
+
"value": "Overview",
|
|
143
|
+
"href": "#overview",
|
|
144
|
+
"depth": 2,
|
|
145
|
+
"numbering": [
|
|
146
|
+
1,
|
|
147
|
+
1
|
|
148
|
+
],
|
|
149
|
+
"parent": "root"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"value": "Resources",
|
|
153
|
+
"href": "#resources",
|
|
154
|
+
"depth": 3,
|
|
155
|
+
"numbering": [
|
|
156
|
+
1,
|
|
157
|
+
1,
|
|
158
|
+
1
|
|
159
|
+
],
|
|
160
|
+
"parent": "root"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"value": "Variables",
|
|
164
|
+
"href": "#variables",
|
|
165
|
+
"depth": 2,
|
|
166
|
+
"numbering": [
|
|
167
|
+
1,
|
|
168
|
+
2
|
|
169
|
+
],
|
|
170
|
+
"parent": "root"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"value": "Line count",
|
|
174
|
+
"href": "#line-count",
|
|
175
|
+
"depth": 3,
|
|
176
|
+
"numbering": [
|
|
177
|
+
1,
|
|
178
|
+
2,
|
|
179
|
+
1
|
|
180
|
+
],
|
|
181
|
+
"parent": "root"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"value": "Matching text size",
|
|
185
|
+
"href": "#matching-text-size",
|
|
186
|
+
"depth": 3,
|
|
187
|
+
"numbering": [
|
|
188
|
+
1,
|
|
189
|
+
2,
|
|
190
|
+
2
|
|
191
|
+
],
|
|
192
|
+
"parent": "root"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"value": "Last line width",
|
|
196
|
+
"href": "#last-line-width",
|
|
197
|
+
"depth": 3,
|
|
198
|
+
"numbering": [
|
|
199
|
+
1,
|
|
200
|
+
2,
|
|
201
|
+
3
|
|
202
|
+
],
|
|
203
|
+
"parent": "root"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"value": "Guidelines",
|
|
207
|
+
"href": "#guidelines",
|
|
208
|
+
"depth": 2,
|
|
209
|
+
"numbering": [
|
|
210
|
+
1,
|
|
211
|
+
3
|
|
212
|
+
],
|
|
213
|
+
"parent": "root"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"value": "Best practices",
|
|
217
|
+
"href": "#best-practices",
|
|
218
|
+
"depth": 3,
|
|
219
|
+
"numbering": [
|
|
220
|
+
1,
|
|
221
|
+
3,
|
|
222
|
+
1
|
|
223
|
+
],
|
|
224
|
+
"parent": "root"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"value": "When to use",
|
|
228
|
+
"href": "#when-to-use",
|
|
229
|
+
"depth": 3,
|
|
230
|
+
"numbering": [
|
|
231
|
+
1,
|
|
232
|
+
3,
|
|
233
|
+
2
|
|
234
|
+
],
|
|
235
|
+
"parent": "root"
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
"dev": {
|
|
240
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { SkeletonText, type SkeletonTextProps } from '@commercetools/nimbus';\n```\n\n`SkeletonText` is built on [Skeleton](/components/feedback/skeleton). For single\nblocks use `Skeleton`; for circular placeholders see\n[SkeletonCircle](/components/feedback/skeletoncircle).\n\n### Basic usage\n\n`SkeletonText` renders a configurable number of placeholder lines to approximate\na paragraph. The last line is narrower by default (`lastLineWidth=\"60%\"`) to\nmimic a natural paragraph ending.\n\n```jsx live-dev\nconst App = () => (\n <SkeletonText lines={4} width=\"300px\" />\n)\n```\n\n## Usage examples\n\n### Matching text size with `textStyle`\n\n`SkeletonText` accepts a `textStyle` prop (default `\"body\"`) that makes the\nplaceholder lines occupy the same vertical rhythm as real text of that style.\nEach line becomes a `1lh` line-box sized by the style, with a `0.75em`\n(≈ cap-height) bar centered in it — so the bar sits where real glyphs sit and the\npitch scales automatically: a `body` skeleton uses a 26 px line pitch, a `3xl`\nheading skeleton a 36 px pitch. Pass any Nimbus text style to match the content\nyou are standing in for.\n\n```jsx live-dev\nconst App = () => (\n <Stack gap=\"600\" width=\"300px\">\n <SkeletonText textStyle=\"caption\" />\n <SkeletonText textStyle=\"body\" />\n <SkeletonText textStyle=\"3xl\" lines={2} />\n </Stack>\n)\n```\n\n### Conditional rendering (standalone pattern)\n\nLike the rest of the family, `SkeletonText` has no `isLoaded` prop. Render it\nwhile loading and swap it for the real text with conditional rendering.\n\n```jsx live-dev\nconst App = () => {\n const [isLoading, setIsLoading] = React.useState(true);\n\n return (\n <Stack gap=\"400\" width=\"320px\">\n <Button onPress={() => setIsLoading(v => !v)}>Toggle loading</Button>\n <div aria-busy={isLoading}>\n {isLoading ? (\n <SkeletonText lines={3} width=\"100%\" />\n ) : (\n <Text>\n A short product description that replaces the placeholder once the\n data has finished loading.\n </Text>\n )}\n </div>\n </Stack>\n )\n}\n```\n\n## Component requirements\n\n### Accessibility\n\n`SkeletonText` is **decorative by default** — its container and lines render\nwith `aria-hidden=\"true\"` so screen readers skip over them.\n\nTo communicate loading state to assistive technology, set `aria-busy=\"true\"` on\nthe **container** that wraps the skeleton region, then clear it and render the\nreal content once loading completes.\n\n```tsx\n<section aria-busy={isLoading} aria-label=\"Product description\">\n {isLoading ? (\n <SkeletonText lines={3} width=\"100%\" />\n ) : (\n <ProductDescription product={product} />\n )}\n</section>\n```\n\nAnnounce the loading region on the wrapping container rather than labelling the\nskeleton itself — see [Skeleton](/components/feedback/skeleton) for the full\nrationale.\n\n#### Reduced motion\n\nWhen the user has enabled `prefers-reduced-motion: reduce`, the line animations\nare automatically disabled regardless of the `animation` prop value. No\nadditional configuration is required.\n\n#### Keyboard navigation\n\n`SkeletonText` is non-interactive and decorative. It does not receive focus or\nsupport keyboard interaction.\n\n## API reference\n\n<PropsTable id=\"SkeletonText\" />\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using SkeletonText 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 Rendering\n\nRender a `SkeletonText` block and confirm it renders one placeholder line per `lines`; the container is decorative (`aria-hidden`) by default, so assistive technology skips it.\n\n```tsx\nimport { useState } from \"react\";\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport {\n SkeletonText,\n Stack,\n Text,\n Button,\n NimbusProvider,\n} from \"@commercetools/nimbus\";\n\ndescribe(\"SkeletonText - Basic rendering\", () => {\n it(\"renders one placeholder line per `lines`\", () => {\n render(\n <NimbusProvider>\n <SkeletonText data-testid=\"skeleton-text\" lines={3} width=\"300px\" />\n </NimbusProvider>\n );\n\n const container = screen.getByTestId(\"skeleton-text\");\n expect(container).toBeInTheDocument();\n expect(container).toHaveAttribute(\"aria-hidden\", \"true\");\n // One Skeleton line is rendered for each of the three requested lines.\n expect(container.children).toHaveLength(3);\n });\n});\n```\n\n### Standalone Loading Pattern\n\nThe recommended way to use SkeletonText: render placeholder lines while the text is loading, then swap in the real paragraph with conditional rendering — SkeletonText has no `isLoaded` prop, so the consumer owns the loading state.\n\n```tsx\nimport { useState } from \"react\";\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport {\n SkeletonText,\n Stack,\n Text,\n Button,\n NimbusProvider,\n} from \"@commercetools/nimbus\";\n\ndescribe(\"SkeletonText - Standalone loading pattern\", () => {\n /**\n * A representative consumer component: show placeholder lines while\n * `isLoading`, then render the real description once loading completes.\n */\n function ProductDescription({ isLoading }: { isLoading: boolean }) {\n return isLoading ? (\n <SkeletonText lines={3} width=\"100%\" />\n ) : (\n <Text>\n Wireless keyboard with a compact layout and long battery life.\n </Text>\n );\n }\n\n it(\"shows placeholder lines while loading, then the real text\", async () => {\n const description =\n \"Wireless keyboard with a compact layout and long battery life.\";\n\n const Example = () => {\n const [isLoading, setIsLoading] = useState(true);\n return (\n <Stack gap=\"400\" width=\"320px\">\n <ProductDescription isLoading={isLoading} />\n <Button onPress={() => setIsLoading(false)}>Finish loading</Button>\n </Stack>\n );\n };\n\n render(\n <NimbusProvider>\n <Example />\n </NimbusProvider>\n );\n\n // While loading: real text is absent.\n expect(screen.queryByText(description)).toBeNull();\n\n await userEvent.click(\n screen.getByRole(\"button\", { name: \"Finish loading\" })\n );\n\n // After loading: real text is present.\n expect(screen.getByText(description)).toBeInTheDocument();\n });\n});\n```\n\n### Announcing Loading with aria-busy\n\nSkeletonText is decorative (`aria-hidden`), so it is not announced on its own; communicate the loading state to assistive technology by setting `aria-busy` on the surrounding container instead.\n\n```tsx\nimport { useState } from \"react\";\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport {\n SkeletonText,\n Stack,\n Text,\n Button,\n NimbusProvider,\n} from \"@commercetools/nimbus\";\n\ndescribe(\"SkeletonText - Container aria-busy pattern\", () => {\n it(\"announces loading state via aria-busy on the container\", () => {\n render(\n <NimbusProvider>\n <section\n data-testid=\"container\"\n aria-busy={true}\n aria-label=\"Product description\"\n >\n <SkeletonText lines={3} width=\"100%\" />\n </section>\n </NimbusProvider>\n );\n\n const container = screen.getByTestId(\"container\");\n expect(container).toHaveAttribute(\"aria-busy\", \"true\");\n expect(container).toHaveAttribute(\"aria-label\", \"Product description\");\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-skeleton--docs)\n- [Skeleton](/components/feedback/skeleton)\n- [SkeletonCircle](/components/feedback/skeletoncircle)\n",
|
|
241
|
+
"toc": [
|
|
242
|
+
{
|
|
243
|
+
"value": "Getting started",
|
|
244
|
+
"href": "#getting-started",
|
|
245
|
+
"depth": 2,
|
|
246
|
+
"numbering": [
|
|
247
|
+
1,
|
|
248
|
+
1
|
|
249
|
+
],
|
|
250
|
+
"parent": "root"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"value": "Import",
|
|
254
|
+
"href": "#import",
|
|
255
|
+
"depth": 3,
|
|
256
|
+
"numbering": [
|
|
257
|
+
1,
|
|
258
|
+
1,
|
|
259
|
+
1
|
|
260
|
+
],
|
|
261
|
+
"parent": "root"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"value": "Basic usage",
|
|
265
|
+
"href": "#basic-usage",
|
|
266
|
+
"depth": 3,
|
|
267
|
+
"numbering": [
|
|
268
|
+
1,
|
|
269
|
+
1,
|
|
270
|
+
2
|
|
271
|
+
],
|
|
272
|
+
"parent": "root"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"value": "Usage examples",
|
|
276
|
+
"href": "#usage-examples",
|
|
277
|
+
"depth": 2,
|
|
278
|
+
"numbering": [
|
|
279
|
+
1,
|
|
280
|
+
2
|
|
281
|
+
],
|
|
282
|
+
"parent": "root"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"value": "Matching text size with textStyle",
|
|
286
|
+
"href": "#matching-text-size-with-textstyle",
|
|
287
|
+
"depth": 3,
|
|
288
|
+
"numbering": [
|
|
289
|
+
1,
|
|
290
|
+
2,
|
|
291
|
+
1
|
|
292
|
+
],
|
|
293
|
+
"parent": "root"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"value": "Conditional rendering (standalone pattern)",
|
|
297
|
+
"href": "#conditional-rendering-standalone-pattern",
|
|
298
|
+
"depth": 3,
|
|
299
|
+
"numbering": [
|
|
300
|
+
1,
|
|
301
|
+
2,
|
|
302
|
+
2
|
|
303
|
+
],
|
|
304
|
+
"parent": "root"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"value": "Component requirements",
|
|
308
|
+
"href": "#component-requirements",
|
|
309
|
+
"depth": 2,
|
|
310
|
+
"numbering": [
|
|
311
|
+
1,
|
|
312
|
+
3
|
|
313
|
+
],
|
|
314
|
+
"parent": "root"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"value": "Accessibility",
|
|
318
|
+
"href": "#accessibility",
|
|
319
|
+
"depth": 3,
|
|
320
|
+
"numbering": [
|
|
321
|
+
1,
|
|
322
|
+
3,
|
|
323
|
+
1
|
|
324
|
+
],
|
|
325
|
+
"parent": "root"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"value": "Reduced motion",
|
|
329
|
+
"href": "#reduced-motion",
|
|
330
|
+
"depth": 4,
|
|
331
|
+
"numbering": [
|
|
332
|
+
1,
|
|
333
|
+
3,
|
|
334
|
+
1,
|
|
335
|
+
1
|
|
336
|
+
],
|
|
337
|
+
"parent": "root"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"value": "Keyboard navigation",
|
|
341
|
+
"href": "#keyboard-navigation",
|
|
342
|
+
"depth": 4,
|
|
343
|
+
"numbering": [
|
|
344
|
+
1,
|
|
345
|
+
3,
|
|
346
|
+
1,
|
|
347
|
+
2
|
|
348
|
+
],
|
|
349
|
+
"parent": "root"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"value": "API reference",
|
|
353
|
+
"href": "#api-reference",
|
|
354
|
+
"depth": 2,
|
|
355
|
+
"numbering": [
|
|
356
|
+
1,
|
|
357
|
+
4
|
|
358
|
+
],
|
|
359
|
+
"parent": "root"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"value": "Testing your implementation",
|
|
363
|
+
"href": "#testing-your-implementation",
|
|
364
|
+
"depth": 2,
|
|
365
|
+
"numbering": [
|
|
366
|
+
1,
|
|
367
|
+
5
|
|
368
|
+
],
|
|
369
|
+
"parent": "root"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"value": "Basic Rendering",
|
|
373
|
+
"href": "#basic-rendering",
|
|
374
|
+
"depth": 3,
|
|
375
|
+
"numbering": [
|
|
376
|
+
1,
|
|
377
|
+
5,
|
|
378
|
+
1
|
|
379
|
+
],
|
|
380
|
+
"parent": "root"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"value": "Standalone Loading Pattern",
|
|
384
|
+
"href": "#standalone-loading-pattern",
|
|
385
|
+
"depth": 3,
|
|
386
|
+
"numbering": [
|
|
387
|
+
1,
|
|
388
|
+
5,
|
|
389
|
+
2
|
|
390
|
+
],
|
|
391
|
+
"parent": "root"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"value": "Announcing Loading with aria-busy",
|
|
395
|
+
"href": "#announcing-loading-with-aria-busy",
|
|
396
|
+
"depth": 3,
|
|
397
|
+
"numbering": [
|
|
398
|
+
1,
|
|
399
|
+
5,
|
|
400
|
+
3
|
|
401
|
+
],
|
|
402
|
+
"parent": "root"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"value": "Resources",
|
|
406
|
+
"href": "#resources",
|
|
407
|
+
"depth": 2,
|
|
408
|
+
"numbering": [
|
|
409
|
+
1,
|
|
410
|
+
6
|
|
411
|
+
],
|
|
412
|
+
"parent": "root"
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|