Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve API documentation of table components #2140

Merged
merged 69 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
352632d
Consistent mdx files
jattasNI May 21, 2024
9ebdbec
select API docs
jattasNI May 21, 2024
6c56348
combobox and select api docs
jattasNI May 21, 2024
58d3ea7
checkbox api docs
jattasNI May 21, 2024
ea3c1fb
switch api docs
jattasNI May 21, 2024
218cfff
text area api docs
jattasNI May 22, 2024
4193f4e
Text field api docs
jattasNI May 22, 2024
2e4ab1f
consistent ordering
jattasNI May 22, 2024
1a9ab97
consistent ordering
jattasNI May 22, 2024
79f2d2d
number field api docs
jattasNI May 22, 2024
dcbd9f6
radio group api docs
jattasNI May 22, 2024
c5815b5
Merge branch 'main' into api-docs-inputs
jattasNI May 22, 2024
ebc9f9a
Clarify non-attribute properties
jattasNI May 22, 2024
044feb4
lint fix
jattasNI May 22, 2024
26f0bad
Merge branch 'main' into api-docs-inputs
jattasNI May 22, 2024
4f09487
mdx updates
jattasNI May 22, 2024
e51ee02
spinner
jattasNI May 22, 2024
72b9a0f
Dialog api docs
jattasNI May 22, 2024
1244631
Drawer api docs
jattasNI May 22, 2024
d930b9c
Icon api docs
jattasNI May 22, 2024
8b37378
toolbar
jattasNI May 22, 2024
f580715
Tree api docs
jattasNI May 22, 2024
846bd7c
Theme provider api docs
jattasNI May 22, 2024
a4ec290
format
jattasNI May 22, 2024
473fb86
Breadcrumb API docs
jattasNI May 23, 2024
f46c622
Hide control for events
jattasNI May 23, 2024
ec14844
Merge branch 'api-docs-inputs' into api-docs-again
jattasNI May 23, 2024
0e161e3
Table API docs
jattasNI May 23, 2024
180586c
Column api docs
jattasNI May 24, 2024
9c6c98f
table column anchor api docs
jattasNI May 24, 2024
02d88c0
date text
jattasNI May 24, 2024
a2cfbe6
duration text
jattasNI May 24, 2024
20541dd
number text
jattasNI May 24, 2024
3ea07ba
text column
jattasNI May 24, 2024
b37e685
mapping column and mapping elements
jattasNI May 24, 2024
f74b392
Merge branch 'main' into api-docs-again
jattasNI May 24, 2024
b7fab09
Better slot docs
jattasNI May 24, 2024
351ada5
Merge branch 'api-docs-again' into api-docs-table
jattasNI May 24, 2024
dab4a33
Consistent location for Target Configuration
jattasNI May 28, 2024
bfc0316
Breadcrumb href guidance
jattasNI May 28, 2024
60734cb
spacing
jattasNI May 28, 2024
2c0a05f
Move Dialog autofocus docs to usage
jattasNI May 28, 2024
b98b613
Share preventDismiss description
jattasNI May 28, 2024
61d5583
Consistent language for event emitting
jattasNI May 28, 2024
b654a2f
More succinct prevent-dismiss description
jattasNI May 28, 2024
578642a
consistent naming of esc key
jattasNI May 28, 2024
cdf169f
Remove redundant spinner sizing info
jattasNI May 28, 2024
04e5ad8
Use sentence casing for non-API arguments
jattasNI May 28, 2024
ffbfe4a
Tree mode list capitalization
jattasNI May 28, 2024
69f463d
Share text content descriptions
jattasNI May 28, 2024
92f1bc1
Missing slot name
jattasNI May 28, 2024
fa2e6b9
Document footer content in slot
jattasNI May 28, 2024
29e985f
Instructions for dismissing dialog
jattasNI May 28, 2024
b632b1d
Merge branch 'main' into api-docs-again
jattasNI May 28, 2024
a649fdb
Trigger rebuild
jattasNI May 28, 2024
3ad59aa
Merge branch 'api-docs-again' into api-docs-table
jattasNI May 29, 2024
bb49719
Merge branch 'main' into api-docs-table
jattasNI May 29, 2024
c2d7e2e
Remove duplicate header
jattasNI May 29, 2024
f72f4f2
whitespace
jattasNI May 29, 2024
89b5717
Consistent language
jattasNI May 29, 2024
1df3a8e
Share checkValidity() description
jattasNI May 29, 2024
fa2f2b2
Consistent language for events
jattasNI May 29, 2024
ad12703
table story cleanup
jattasNI May 29, 2024
7b2db61
Disable snapshot for table column API table
jattasNI May 29, 2024
53db377
Sentence casing
jattasNI May 29, 2024
05a5178
Clarify expand toggle behavior for group rows
jattasNI May 29, 2024
f1962de
Link between table docs
jattasNI May 29, 2024
0ed5cde
mapping suggestions
jattasNI May 29, 2024
e066f22
Trigger new build
jattasNI May 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { html } from '@microsoft/fast-element';
import type { Meta, StoryObj } from '@storybook/html';
import { mappingKeyDescription } from '../base/story-helpers';
import { createUserSelectedThemeStory } from '../../../utilities/storybook';
import { apiCategory, createUserSelectedThemeStory } from '../../../utilities/storybook';
import { hiddenWrapper } from '../../../utilities/hidden';

const metadata: Meta = {
Expand All @@ -25,11 +25,13 @@ export const emptyMapping: StoryObj = {
argTypes: {
key: {
control: false,
description: mappingKeyDescription('nothing')
description: mappingKeyDescription('nothing'),
table: { category: apiCategory.attributes },
},
text: {
control: false,
description: 'A textual description of the value. This value will be displayed in group rows, but table cells will be empty. This attribute is required.'
description: 'A textual description of the value. This value will be displayed in group rows, but table cells will be empty. This attribute is required.',
table: { category: apiCategory.attributes },
}
},
args: {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { html } from '@microsoft/fast-element';
import type { Meta, StoryObj } from '@storybook/html';
import { mappingKeyDescription } from '../base/story-helpers';
import { createUserSelectedThemeStory } from '../../../utilities/storybook';
import { apiCategory, createUserSelectedThemeStory } from '../../../utilities/storybook';
import { hiddenWrapper } from '../../../utilities/hidden';

const metadata: Meta = {
Expand All @@ -23,28 +23,33 @@ export const iconMapping: StoryObj = {
argTypes: {
key: {
description: mappingKeyDescription('the mapped icon'),
control: false
control: false,
table: { category: apiCategory.attributes },
},
icon: {
control: false,
description: 'The tag name of the Nimble icon to render, e.g. `nimble-icon-check`.'
description: 'The tag name of the Nimble icon to render, e.g. `nimble-icon-check`.',
table: { category: apiCategory.attributes },
},
severity: {
control: false,
description:
'Must be one of the values in the `IconSeverity` enum. Controls the color of the icon.'
'Must be one of the values in the `IconSeverity` enum. Controls the color of the icon.',
jattasNI marked this conversation as resolved.
Show resolved Hide resolved
table: { category: apiCategory.attributes },
},
text: {
control: false,
description: `A textual description of the value. The text will be displayed next to the icon in a cell if \`text-hidden\` is not set,
or as the tooltip and accessible name of the icon if \`text-hidden\` is set. The text is also displayed next to the icon
in a group header. This attribute is required.`
in a group header. This attribute is required.`,
jattasNI marked this conversation as resolved.
Show resolved Hide resolved
table: { category: apiCategory.attributes },
},
textHidden: {
control: false,
name: 'text-hidden',
description:
"When set, the text is hidden within the table's cells. When unset, the text is rendered next to the icon within the cell."
"When set, the text is hidden within the table's cells. When unset, the text is rendered next to the icon within the cell.",
table: { category: apiCategory.attributes },
}
},
args: {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { html } from '@microsoft/fast-element';
import type { Meta, StoryObj } from '@storybook/html';
import { mappingKeyDescription } from '../base/story-helpers';
import { createUserSelectedThemeStory } from '../../../utilities/storybook';
import { apiCategory, createUserSelectedThemeStory } from '../../../utilities/storybook';
import { hiddenWrapper } from '../../../utilities/hidden';

const metadata: Meta = {
Expand All @@ -23,19 +23,22 @@ export const spinnerMapping: StoryObj = {
argTypes: {
key: {
description: mappingKeyDescription('a spinner'),
control: false
control: false,
table: { category: apiCategory.attributes },
},
text: {
control: false,
description: `A textual description of the value. The text will be displayed next to the spinner in a cell if \`text-hidden\` is not set,
or as the tooltip and accessible name of the spinner if \`text-hidden\` is set. The text is also displayed next to the spinner
in a group header. This attribute is required.`
in a group header. This attribute is required.`,
table: { category: apiCategory.attributes },
},
textHidden: {
control: false,
name: 'text-hidden',
description:
"When set, the text is hidden within the table's cells. When unset, the text is rendered next to the spinner within the cell."
"When set, the text is hidden within the table's cells. When unset, the text is rendered next to the spinner within the cell.",
table: { category: apiCategory.attributes },
}
},
args: {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { html } from '@microsoft/fast-element';
import type { Meta, StoryObj } from '@storybook/html';
import { mappingKeyDescription } from '../base/story-helpers';
import { createUserSelectedThemeStory } from '../../../utilities/storybook';
import { apiCategory, createUserSelectedThemeStory } from '../../../utilities/storybook';
import { hiddenWrapper } from '../../../utilities/hidden';

const metadata: Meta = {
Expand All @@ -23,10 +23,12 @@ export const textMapping: StoryObj = {
argTypes: {
key: {
description: mappingKeyDescription('the mapped display text'),
control: false
control: false,
table: { category: apiCategory.attributes },
},
text: {
description: 'The display text.'
description: 'The display text.',
table: { category: apiCategory.attributes },
}
},
args: {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { html } from '@microsoft/fast-element';
import type { Meta, StoryObj } from '@storybook/html';
import { createUserSelectedThemeStory } from '../../../utilities/storybook';
import { apiCategory, createUserSelectedThemeStory } from '../../../utilities/storybook';
import { hiddenWrapper } from '../../../utilities/hidden';

const metadata: Meta = {
Expand All @@ -22,12 +22,14 @@ export const userMapping: StoryObj = {
argTypes: {
key: {
description: 'A key (url) for each user that maps to a user',
jattasNI marked this conversation as resolved.
Show resolved Hide resolved
control: false
control: false,
table: { category: apiCategory.attributes },
},
displayName: {
name: 'display-name',
description:
'A string which renders the textual representation of user name'
'A string which renders the textual representation of user name',
jattasNI marked this conversation as resolved.
Show resolved Hide resolved
table: { category: apiCategory.attributes },
}
},
args: {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Controls, Canvas, Meta, Title } from '@storybook/blocks';
import TargetDocs from '../../patterns/anchor/target-docs.mdx';
import * as tableColumnAnchorStories from './table-column-anchor.stories';
import ComponentApisLink from '../../../docs/component-apis-link.mdx';
import { tableColumnAnchorTag } from '../../../../../nimble-components/src/table-column/anchor';
import { tableTag } from '../../../../../nimble-components/src/table';

Expand All @@ -14,6 +15,7 @@ The <Tag name={tableColumnAnchorTag}/> column is used to display string fields a
## API

<Controls of={tableColumnAnchorStories.anchorColumn} />
<ComponentApisLink />

### Target Configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
sharedTableArgs,
sharedTableArgTypes
} from '../base/table-column-stories-utils';
import { createUserSelectedThemeStory } from '../../../utilities/storybook';
import { apiCategory, createUserSelectedThemeStory } from '../../../utilities/storybook';

const metadata: Meta<SharedTableArgs> = {
title: 'Components/Table Column: Anchor',
Expand Down Expand Up @@ -102,28 +102,33 @@ export const anchorColumn: StoryObj<AnchorColumnTableArgs> = {
description:
'Set this attribute to identify which field in the data record contains the visible text value for each cell in the column. The field values must be of type `string`. If a given row does not define a property with this name, that row will use the url as the label.',
options: ['firstName', 'lastName'],
control: { type: 'radio' }
control: { type: 'radio' },
table: { category: apiCategory.attributes },
},
hrefFieldName: {
name: 'href-field-name',
description:
'Set this attribute to identify which field in the data record contains the link url for each cell in the column. If the field is not defined in a particular record, that cell will be displayed as plain text instead of a link. The field values must be of type `string`.',
control: false
control: false,
table: { category: apiCategory.attributes },
},
appearance: {
options: Object.keys(AnchorAppearance),
control: { type: 'radio' },
description:
'Set to `prominent` to make the anchor appear in a different color than normal text. This has no effect under the Color theme.'
'Set to `prominent` to make the anchor appear in a different color than normal text. This has no effect under the Color theme.',
table: { category: apiCategory.attributes },
},
underlineHidden: {
name: 'underline-hidden',
defaultValue: { summary: 'false' },
description: 'Causes the underline to be hidden except on hover.'
description: 'Causes the underline to be hidden except on hover.',
table: { category: apiCategory.attributes },
},
placeholder: {
description:
'The placeholder text to display when the label and href are both `undefined` or `null` for a record.'
'The placeholder text to display when the label and href are both `undefined` or `null` for a record.',
table: { category: apiCategory.attributes },
}
},
args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,49 @@
import { Controls, Canvas, Meta, Title, Description } from '@storybook/blocks';
import * as tableColumnStories from './table-column.stories';
import ComponentApisLink from '../../../docs/component-apis-link.mdx';

<Meta of={tableColumnStories} />
<Title of={tableColumnStories} />
<Description of={tableColumnStories} />

## Adding columns
## API

<Controls of={tableColumnStories.api} />
<ComponentApisLink />

## Examples

### Adding columns

<Description of={tableColumnStories.addingColumns} />
<Canvas of={tableColumnStories.addingColumns} />
<Controls of={tableColumnStories.addingColumns} />

## Setting header content
### Setting header content

<Description of={tableColumnStories.headerContent} />
<Canvas of={tableColumnStories.headerContent} />
<Controls of={tableColumnStories.headerContent} />

## Configuring common attributes
### Hiding

<Description of={tableColumnStories.commonAttributes} />
<Canvas of={tableColumnStories.commonAttributes} />
<Controls of={tableColumnStories.commonAttributes} />
<Description of={tableColumnStories.columnHidden} />
<Canvas of={tableColumnStories.columnHidden} />
<Controls of={tableColumnStories.columnHidden} />

## Sorting
### Sorting

<Description of={tableColumnStories.sorting} />
<Canvas of={tableColumnStories.sorting} />
<Controls of={tableColumnStories.sorting} />

## Grouping
### Grouping

<Description of={tableColumnStories.grouping} />
<Canvas of={tableColumnStories.grouping} />
<Controls of={tableColumnStories.grouping} />

## Column Width
### Column width

<Description of={tableColumnStories.width} />
<Canvas of={tableColumnStories.width} />
Expand Down
Loading
Loading