Skip to content

Commit f4711f6

Browse files
authored
Restructure docs for simple descriptions (#2870)
1 parent 2112783 commit f4711f6

File tree

10 files changed

+198
-138
lines changed

10 files changed

+198
-138
lines changed

packages/ui-extensions/src/surfaces/admin/components/Banner/shared.ts

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
const shared = {
22
name: 'Banner',
3-
description: `
4-
Use \`s-banner\` to communicate important status updates or required actions that users must take. Banners will automatically adjust their design to match the context in which they are used.
5-
6-
#### Outside of a section
7-
Banners placed outside of a section will display in their own card and should be located at the top of the page.
8-
They're useful for conveying messages that apply to the entire page or areas not visible within the viewport, such as validation errors further down the page.
9-
10-
#### In a section
11-
Banners placed inside a section will have styles applied contextually. They're useful for conveying messages relevant to a specific section or piece of content.
12-
13-
#### Best practices
14-
- Seeing these banners can be stressful, so use them sparingly to avoid overwhelming users.
3+
description:
4+
'Use `s-banner` to communicate important status updates or required actions that users must take. Banners will automatically adjust their design to match the context in which they are used.',
5+
thumbnail: '/assets/templated-apis-screenshots/admin/components/banner.png',
6+
isVisualComponent: true,
7+
subSections: [
8+
{
9+
title: 'Outside of a section',
10+
type: 'Generic' as const,
11+
anchorLink: 'outside-of-a-section',
12+
sectionContent: `Banners placed outside of a section will display in their own card and should be located at the top of the page. They're useful for conveying messages that apply to the entire page or areas not visible within the viewport, such as validation errors further down the page.`,
13+
},
14+
{
15+
title: 'In a section',
16+
type: 'Generic' as const,
17+
anchorLink: 'in-a-section',
18+
sectionContent: `Banners placed inside a section will have styles applied contextually. They're useful for conveying messages relevant to a specific section or piece of content.`,
19+
},
20+
{
21+
title: 'Best practices',
22+
type: 'Generic' as const,
23+
anchorLink: 'best-practices',
24+
sectionContent: `- Seeing these banners can be stressful, so use them sparingly to avoid overwhelming users.
1525
- Focus on a single piece of information or required action to avoid overwhelming users.
1626
- Make the message concise and scannable. Users shouldn’t need to spend a lot of time figuring out what they need to know and do.
1727
- Info, Warning and Critical banners should contain a call to action and clear next steps. Users should know what to do after seeing the banner.
18-
- Avoid banners that can't be dismissed unless the user is required to take action.
19-
20-
`,
21-
thumbnail: '/assets/templated-apis-screenshots/admin/components/banner.png',
22-
isVisualComponent: true,
28+
- Avoid banners that can't be dismissed unless the user is required to take action.`,
29+
},
30+
],
2331
definitions: [
2432
{
2533
title: 'Properties',

packages/ui-extensions/src/surfaces/admin/components/Box/shared.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
const shared = {
22
name: 'Box',
3-
description: `
4-
Use \`s-box\` to build custom interfaces with your own design language.
5-
6-
#### Useful for:
7-
- Creating custom designs when you can't build what you need with the existing components.
8-
- Setting up specific stylings such as background colors, paddings, and borders.
9-
- Nesting with other components.
10-
`,
3+
description:
4+
'Use `s-box` to build custom interfaces with your own design language.',
115
thumbnail: '/assets/templated-apis-screenshots/admin/components/box.png',
126
isVisualComponent: true,
7+
subSections: [
8+
{
9+
title: 'Useful for',
10+
type: 'Generic' as const,
11+
anchorLink: 'useful-for',
12+
sectionContent: `- Creating custom designs when you can't build what you need with the existing components.
13+
- Setting up specific stylings such as background colors, paddings, and borders.
14+
- Nesting with other components.`,
15+
},
16+
],
1317
definitions: [
1418
{
1519
title: 'Properties',

packages/ui-extensions/src/surfaces/admin/components/Divider/shared.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
const shared = {
22
name: 'Divider',
3-
description: `
4-
Use \`s-divider\` to create a clear visual separation between different elements in your user interface.
5-
6-
#### Useful for:
7-
- Separating elements inside sections.
8-
- Visually grouping related content in forms and lists.
9-
`,
10-
3+
description:
4+
'Use `s-divider` to create a clear visual separation between different elements in your user interface.',
5+
subSections: [
6+
{
7+
title: 'Useful for',
8+
type: 'Generic' as const,
9+
anchorLink: 'useful-for',
10+
sectionContent: `- Separating elements inside sections.
11+
- Visually grouping related content in forms and lists.`,
12+
},
13+
],
1114
thumbnail: '/assets/templated-apis-screenshots/admin/components/divider.png',
1215
isVisualComponent: true,
1316
definitions: [

packages/ui-extensions/src/surfaces/admin/components/Grid/shared.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
const shared = {
22
name: 'Grid',
3-
description: `
4-
Use \`s-grid\` to organize your content in a matrix of rows and columns and make responsive layouts for pages. Grid follows the same pattern as the [CSS grid layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout).
5-
6-
#### Useful for:
7-
- Organizing content into a grid-like layout with columns and rows with consistent alignment and spacing.
8-
- Creating responsive layouts with consistent spacing.
9-
10-
#### Considerations
11-
- Grid doesn't include any padding by default. If you need padding around your grid, use \`base\` to apply the default padding.
12-
- Grid will allow children to overflow unless template rows/columns are properly set.
13-
- Grid will always wrap children to a new line. If you need to control the wrapping behavior, use \`s-stack\` or \`s-box\`.
14-
`,
15-
3+
description:
4+
'Use `s-grid` to organize your content in a matrix of rows and columns and make responsive layouts for pages. Grid follows the same pattern as the [CSS grid layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout).',
5+
subSections: [
6+
{
7+
title: 'Useful for',
8+
type: 'Generic' as const,
9+
anchorLink: 'useful-for',
10+
sectionContent: `- Organizing content into a grid-like layout with columns and rows with consistent alignment and spacing.
11+
- Creating responsive layouts with consistent spacing.`,
12+
},
13+
{
14+
title: 'Considerations',
15+
type: 'Generic' as const,
16+
anchorLink: 'considerations',
17+
sectionContent: `- Grid doesn't include any padding by default. If you need padding around your grid, use \`base\` to apply the default padding.
18+
- Grid will allow children to overflow unless template rows/columns are properly set.
19+
- Grid will always wrap children to a new line. If you need to control the wrapping behavior, use \`s-stack\` or \`s-box\`.`,
20+
},
21+
],
1622
thumbnail: '/assets/templated-apis-screenshots/admin/components/grid.png',
1723
isVisualComponent: true,
1824
definitions: [

packages/ui-extensions/src/surfaces/admin/components/Heading/shared.ts

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
const shared = {
22
name: 'Heading',
3-
description: `
4-
Use \`s-heading\` to create hierarchical titles similar to HTML's \`h1-h6\` elements.
5-
6-
#### Useful for:
7-
- Creating titles and subtitles for your content that are consistent across your app.
8-
- Helping users with visual impairments navigate through content effectively using assistive technologies like screen readers.
9-
10-
#### Considerations
11-
- The level of the heading is automatically determined by how deeply it's nested inside other components, starting from h2.
12-
- Default to using the \`heading\` property in \`s-section\`. The \`s-heading\` component should only be used if you need to implement a custom layout for your heading in the UI.
13-
14-
#### Best practices
15-
- Use short headings to make your content scannable.
16-
- Use plain and clear terms.
17-
- Don't use jargon or technical language.
18-
- Don't use different terms to describe the same thing.
19-
- Don't duplicate content.
20-
21-
`,
3+
description:
4+
"Use `s-heading` to create hierarchical titles similar to HTML's `h1-h6` elements.",
225
thumbnail: '/assets/templated-apis-screenshots/admin/components/heading.png',
236
isVisualComponent: true,
7+
subSections: [
8+
{
9+
title: 'Useful for',
10+
type: 'Generic' as const,
11+
anchorLink: 'useful-for',
12+
sectionContent: `- Creating titles and subtitles for your content that are consistent across your app.
13+
- Helping users with visual impairments navigate through content effectively using assistive technologies like screen readers.`,
14+
},
15+
{
16+
title: 'Considerations',
17+
type: 'Generic' as const,
18+
anchorLink: 'considerations',
19+
sectionContent: `- The level of the heading is automatically determined by how deeply it's nested inside other components, starting from h2.
20+
- Default to using the \`heading\` property in \`s-section\`. The \`s-heading\` component should only be used if you need to implement a custom layout for your heading in the UI.`,
21+
},
22+
{
23+
title: 'Best practices',
24+
type: 'Generic' as const,
25+
anchorLink: 'best-practices',
26+
sectionContent: `- Use short headings to make your content scannable.
27+
- Use plain and clear terms.
28+
- Don't use jargon or technical language.
29+
- Don't use different terms to describe the same thing.
30+
- Don't duplicate content.`,
31+
},
32+
],
2433
definitions: [
2534
{
2635
title: 'Properties',

packages/ui-extensions/src/surfaces/admin/components/Image/shared.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
const shared = {
22
name: 'Image',
3-
description: `
4-
Use \`s-image\` to display images in your app.
5-
6-
#### Useful for:
7-
- Adding illustrations and photos.
8-
9-
#### Best practices
10-
- Use high-resolution images to ensure a professional and high-quality experience.
11-
- Use optimized images so your app loads as fast as possible.
12-
- Use images intentionally, these should add clarity and lead users to the next step.
13-
14-
`,
3+
description: 'Use `s-image` to display images in your app.',
154
thumbnail: '/assets/templated-apis-screenshots/admin/components/image.png',
165
isVisualComponent: true,
6+
subSections: [
7+
{
8+
title: 'Useful for',
9+
type: 'Generic' as const,
10+
anchorLink: 'useful-for',
11+
sectionContent: `- Adding illustrations and photos.`,
12+
},
13+
{
14+
title: 'Best practices',
15+
type: 'Generic' as const,
16+
anchorLink: 'best-practices',
17+
sectionContent: `- Use high-resolution images to ensure a professional and high-quality experience.
18+
- Use optimized images so your app loads as fast as possible.
19+
- Use images intentionally, these should add clarity and lead users to the next step.`,
20+
},
21+
],
1722
definitions: [
1823
{
1924
title: 'Properties',

packages/ui-extensions/src/surfaces/admin/components/Paragraph/shared.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
const shared = {
22
name: 'Paragraph',
3-
description: `
4-
Use \`s-paragraph\` to display a block of text similar to the \`<p>\` tag in HTML. This component can also contain other elements such as buttons, links, or text.
5-
6-
#### Useful for:
7-
- Displaying text content in a paragraph format.
8-
- Grouping elements with the same style. For instance, icons inside a paragraph will automatically adopt the paragraph's tone.
9-
10-
#### Best practices
11-
- Use short paragraphs to make your content scannable.
12-
- Use plain and clear terms.
13-
- Don't use jargon or technical language.
14-
- Don't use different terms to describe the same thing.
15-
- Don't duplicate content.
16-
17-
`,
3+
description:
4+
'Use `s-paragraph` to display a block of text similar to the `<p>` tag in HTML. This component can also contain other elements such as buttons, links, or text.',
185
thumbnail:
196
'/assets/templated-apis-screenshots/admin/components/paragraph.png',
207
isVisualComponent: true,
8+
subSections: [
9+
{
10+
title: 'Useful for',
11+
type: 'Generic' as const,
12+
anchorLink: 'useful-for',
13+
sectionContent: `- Displaying text content in a paragraph format.
14+
- Grouping elements with the same style. For instance, icons inside a paragraph will automatically adopt the paragraph's tone.`,
15+
},
16+
{
17+
title: 'Best practices',
18+
type: 'Generic' as const,
19+
anchorLink: 'best-practices',
20+
sectionContent: `- Use short paragraphs to make your content scannable.
21+
- Use plain and clear terms.
22+
- Don't use jargon or technical language.
23+
- Don't use different terms to describe the same thing.
24+
- Don't duplicate content.`,
25+
},
26+
],
2127
definitions: [
2228
{
2329
title: 'Properties',

packages/ui-extensions/src/surfaces/admin/components/Section/shared.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
const shared = {
22
name: 'Section',
3-
description: `
4-
Use \`s-section\` to organize your page content. Sections have defined styling, and will display differently depending on how deeply they are nested in the page.
5-
6-
- **Level 1:** Display as responsive cards with background color, rounded corners, and shadow effects. Includes outer padding that can be removed when content like \`s-table\` needs to expand to the full width of the section.
7-
- **Nested sections:** Don't have any background color or effects by default.
8-
9-
#### Useful for:
10-
- Organizing your page in a logical structure based on nesting levels.
11-
- Creating consistency across pages.
12-
13-
#### Considerations
14-
- When adding headings inside sections they automatically use a specific style, which helps keep the content organized and clear.
15-
- Built-in spacing is added between nested sections, as well as between heading and content.
16-
17-
`,
18-
3+
description:
4+
'Use `s-section` to organize your page content. Sections have defined styling, and will display differently depending on how deeply they are nested in the page.',
195
isVisualComponent: true,
206
thumbnail: '/assets/templated-apis-screenshots/admin/components/section.png',
7+
subSections: [
8+
{
9+
title: 'Useful for',
10+
type: 'Generic' as const,
11+
anchorLink: 'useful-for',
12+
sectionContent: `- Organizing your page in a logical structure based on nesting levels.
13+
- Creating consistency across pages.`,
14+
},
15+
{
16+
title: 'Considerations',
17+
type: 'Generic' as const,
18+
anchorLink: 'considerations',
19+
sectionContent: `- When adding headings inside sections they automatically use a specific style, which helps keep the content organized and clear.
20+
- Built-in spacing is added between nested sections, as well as between heading and content.
21+
- **Level 1:** Display as responsive cards with background color, rounded corners, and shadow effects. Includes outer padding that can be removed when content like \`s-table\` needs to expand to the full width of the section.
22+
- **Nested sections:** Don't have any background color or effects by default.`,
23+
},
24+
],
2125
definitions: [
2226
{
2327
title: 'Properties',

packages/ui-extensions/src/surfaces/admin/components/Stack/shared.ts

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
const shared = {
22
name: 'Stack',
3-
description: `
4-
Use \`s-stack\` to organize elements along the [block or inline axes](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_display/Block_and_inline_layout_in_normal_flow) of the page.
5-
6-
#### Useful for:
7-
- Placing items in rows or columns when sections don't work for your layout.
8-
- Controlling the spacing between elements.
9-
10-
#### Considerations
11-
- Stack doesn't add any padding by default. If you want padding around your stacked elements, use \`base\` to apply the default padding.
12-
- When spacing becomes limited, Stack will always wrap children to a new line.
13-
14-
#### Best practices
15-
- Use smaller gaps between small elements and larger gaps between big ones.
16-
- Maintain consistent spacing in stacks across all pages of your app.
17-
`,
3+
description:
4+
'Use `s-stack` to organize elements along the [block or inline axes](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_display/Block_and_inline_layout_in_normal_flow) of the page.',
185
thumbnail: '/assets/templated-apis-screenshots/admin/components/stack.png',
196
isVisualComponent: true,
7+
subSections: [
8+
{
9+
title: 'Useful for',
10+
type: 'Generic' as const,
11+
anchorLink: 'useful-for',
12+
sectionContent: `- Placing items in rows or columns when sections don't work for your layout.
13+
- Controlling the spacing between elements.`,
14+
},
15+
{
16+
title: 'Considerations',
17+
type: 'Generic' as const,
18+
anchorLink: 'considerations',
19+
sectionContent: `- Stack doesn't add any padding by default. If you want padding around your stacked elements, use \`base\` to apply the default padding.
20+
- When spacing becomes limited, Stack will always wrap children to a new line.`,
21+
},
22+
{
23+
title: 'Best practices',
24+
type: 'Generic' as const,
25+
anchorLink: 'best-practices',
26+
sectionContent: `- Use smaller gaps between small elements and larger gaps between big ones.
27+
- Maintain consistent spacing in stacks across all pages of your app.`,
28+
},
29+
],
2030
definitions: [
2131
{
2232
title: 'Properties',

0 commit comments

Comments
 (0)