Skip to content

Commit

Permalink
docs: auto-generate API docs
Browse files Browse the repository at this point in the history
Updates API docs in our markdown files with Lit Analyzer by manually running `npm run update-docs`

COPYBARA_INTEGRATE_REVIEW=#4946 from material-components:api-docs 1322ca9
PiperOrigin-RevId: 566834596
  • Loading branch information
e111077 authored and copybara-github committed Sep 20, 2023
1 parent 6132f1e commit 9f3e55d
Show file tree
Hide file tree
Showing 28 changed files with 2,144 additions and 44 deletions.
4 changes: 4 additions & 0 deletions catalog/site/css/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ main > details > summary {
margin-inline: auto;
}

main > table {
max-width: max-content;
}

table {
border-spacing: 0;
}
Expand Down
107 changes: 107 additions & 0 deletions docs/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -698,3 +698,110 @@ Token | Default value

<md-text-button>Text</md-text-button>
```

<!-- auto-generated API docs start -->

## API


### MdElevatedButton

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled.
`href` | `href` | `string` | `''` | The URL that the link button points to.
`target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options<br>include `_blank` to open in a new tab.
`trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the<br>inline start.<br><br>_Note:_ Link buttons cannot have trailing icons.
`hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not.
`type` | `type` | `string` | `'submit'` |
`value` | `value` | `string` | `''` |
`name` | | `string` | `undefined` |
`form` | | `HTMLFormElement` | `undefined` | The associated form element with which this element's value will submit.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

### MdFilledButton

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled.
`href` | `href` | `string` | `''` | The URL that the link button points to.
`target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options<br>include `_blank` to open in a new tab.
`trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the<br>inline start.<br><br>_Note:_ Link buttons cannot have trailing icons.
`hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not.
`type` | `type` | `string` | `'submit'` |
`value` | `value` | `string` | `''` |
`name` | | `string` | `undefined` |
`form` | | `HTMLFormElement` | `undefined` | The associated form element with which this element's value will submit.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

### MdFilledTonalButton

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled.
`href` | `href` | `string` | `''` | The URL that the link button points to.
`target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options<br>include `_blank` to open in a new tab.
`trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the<br>inline start.<br><br>_Note:_ Link buttons cannot have trailing icons.
`hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not.
`type` | `type` | `string` | `'submit'` |
`value` | `value` | `string` | `''` |
`name` | | `string` | `undefined` |
`form` | | `HTMLFormElement` | `undefined` | The associated form element with which this element's value will submit.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

### MdOutlinedButton

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled.
`href` | `href` | `string` | `''` | The URL that the link button points to.
`target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options<br>include `_blank` to open in a new tab.
`trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the<br>inline start.<br><br>_Note:_ Link buttons cannot have trailing icons.
`hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not.
`type` | `type` | `string` | `'submit'` |
`value` | `value` | `string` | `''` |
`name` | | `string` | `undefined` |
`form` | | `HTMLFormElement` | `undefined` | The associated form element with which this element's value will submit.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

### MdTextButton

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`disabled` | `disabled` | `boolean` | `false` | Whether or not the button is disabled.
`href` | `href` | `string` | `''` | The URL that the link button points to.
`target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options<br>include `_blank` to open in a new tab.
`trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the<br>inline start.<br><br>_Note:_ Link buttons cannot have trailing icons.
`hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not.
`type` | `type` | `string` | `'submit'` |
`value` | `value` | `string` | `''` |
`name` | | `string` | `undefined` |
`form` | | `HTMLFormElement` | `undefined` | The associated form element with which this element's value will submit.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

<!-- auto-generated API docs end -->
41 changes: 41 additions & 0 deletions docs/components/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,44 @@ Token | Default value
<md-checkbox touch-target="wrapper"></md-checkbox>
<md-checkbox touch-target="wrapper" checked></md-checkbox>
```

<!-- auto-generated API docs start -->

## API


### MdCheckbox

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`checked` | `checked` | `boolean` | `false` | Whether or not the checkbox is selected.
`disabled` | `disabled` | `boolean` | `false` | Whether or not the checkbox is disabled.
`indeterminate` | `indeterminate` | `boolean` | `false` | Whether or not the checkbox is indeterminate.<br><br>https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes
`required` | `required` | `boolean` | `false` | When true, require the checkbox to be selected when participating in<br>form submission.<br><br>https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation
`value` | `value` | `string` | `'on'` | The value of the checkbox that is submitted with a form when selected.<br><br>https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#value
`name` | | `string` | `undefined` | The HTML name to use in form submission.
`form` | | `HTMLFormElement` | `undefined` | The associated form element with which this element's value will submit.
`labels` | | `NodeList` | `undefined` | The labels this element is associated with.
`validity` | | `ValidityState` | `undefined` | Returns a ValidityState object that represents the validity states of the<br>checkbox.<br><br>Note that checkboxes will only set `valueMissing` if `required` and not<br>checked.<br><br>https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation
`validationMessage` | | `string` | `undefined` | Returns the native validation error message.<br><br>https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#constraint_validation_process
`willValidate` | | `boolean` | `undefined` | Returns whether an element will successfully validate based on forms<br>validation rules and constraints.<br><br>https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#constraint_validation_process

<!-- mdformat on(autogenerated might break rendering in catalog) -->

#### Methods

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Method | Parameters | Returns | Description
--- | --- | --- | ---
`checkValidity` | _None_ | `boolean` | Checks the checkbox's native validation and returns whether or not the<br>element is valid.<br><br>If invalid, this method will dispatch the `invalid` event.<br><br>https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity
`reportValidity` | _None_ | `boolean` | Checks the checkbox's native validation and returns whether or not the<br>element is valid.<br><br>If invalid, this method will dispatch the `invalid` event.<br><br>The `validationMessage` is reported to the user by the browser. Use<br>`setCustomValidity()` to customize the `validationMessage`.<br><br>https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity
`setCustomValidity` | `error` | `void` | Sets the checkbox's native validation error message. This is used to<br>customize `validationMessage`.<br><br>When the error is not an empty string, the checkbox is considered invalid<br>and `validity.customError` will be true.<br><br>https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity

<!-- mdformat on(autogenerated might break rendering in catalog) -->

<!-- auto-generated API docs end -->
93 changes: 93 additions & 0 deletions docs/components/chip.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,3 +480,96 @@ Token | Default value

<md-suggestion-chip label="Suggestion"></md-suggestion-chip>
```

<!-- auto-generated API docs start -->

## API


### MdChipSet

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`chips` | | `Chip[]` | `undefined` |

<!-- mdformat on(autogenerated might break rendering in catalog) -->

### MdAssistChip

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`elevated` | `elevated` | `boolean` | `false` |
`href` | `href` | `string` | `''` |
`target` | `target` | `string` | `''` |
`disabled` | `disabled` | `boolean` | `false` | Whether or not the chip is disabled.<br><br>Disabled chips are not focusable, unless `always-focusable` is set.
`alwaysFocusable` | `always-focusable` | `boolean` | `false` | When true, allow disabled chips to be focused with arrow keys.<br><br>Add this when a chip needs increased visibility when disabled. See<br>https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls<br>for more guidance on when this is needed.
`label` | `label` | `string` | `''` | The label of the chip.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

### MdFilterChip

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`elevated` | `elevated` | `boolean` | `false` |
`removable` | `removable` | `boolean` | `false` |
`selected` | `selected` | `boolean` | `false` |
`disabled` | `disabled` | `boolean` | `false` | Whether or not the chip is disabled.<br><br>Disabled chips are not focusable, unless `always-focusable` is set.
`alwaysFocusable` | `always-focusable` | `boolean` | `false` | When true, allow disabled chips to be focused with arrow keys.<br><br>Add this when a chip needs increased visibility when disabled. See<br>https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls<br>for more guidance on when this is needed.
`label` | `label` | `string` | `''` | The label of the chip.
`handleTrailingActionFocus` | | `() => void` | `undefined` |
`ariaLabelRemove` | | `string` | `undefined` |

<!-- mdformat on(autogenerated might break rendering in catalog) -->

### MdInputChip

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`avatar` | `avatar` | `boolean` | `false` |
`href` | `href` | `string` | `''` |
`target` | `target` | `string` | `''` |
`removeOnly` | `remove-only` | `boolean` | `false` |
`selected` | `selected` | `boolean` | `false` |
`disabled` | `disabled` | `boolean` | `false` | Whether or not the chip is disabled.<br><br>Disabled chips are not focusable, unless `always-focusable` is set.
`alwaysFocusable` | `always-focusable` | `boolean` | `false` | When true, allow disabled chips to be focused with arrow keys.<br><br>Add this when a chip needs increased visibility when disabled. See<br>https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls<br>for more guidance on when this is needed.
`label` | `label` | `string` | `''` | The label of the chip.
`handleTrailingActionFocus` | | `() => void` | `undefined` |
`ariaLabelRemove` | | `string` | `undefined` |

<!-- mdformat on(autogenerated might break rendering in catalog) -->

### MdSuggestionChip

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`elevated` | `elevated` | `boolean` | `false` |
`href` | `href` | `string` | `''` |
`target` | `target` | `string` | `''` |
`disabled` | `disabled` | `boolean` | `false` | Whether or not the chip is disabled.<br><br>Disabled chips are not focusable, unless `always-focusable` is set.
`alwaysFocusable` | `always-focusable` | `boolean` | `false` | When true, allow disabled chips to be focused with arrow keys.<br><br>Add this when a chip needs increased visibility when disabled. See<br>https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls<br>for more guidance on when this is needed.
`label` | `label` | `string` | `''` | The label of the chip.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

<!-- auto-generated API docs end -->
48 changes: 48 additions & 0 deletions docs/components/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,51 @@ Token | Default value
<div slot="content">Dialog content</div>
</md-dialog>
```

<!-- auto-generated API docs start -->

## API


### MdDialog

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`returnValue` | | `string` | `''` | Gets or sets the dialog's return value, usually to indicate which button<br>a user pressed to close it.<br><br>https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/returnValue
`type` | `type` | `string` | `undefined` | The type of dialog for accessibility. Set this to `alert` to announce a<br>dialog as an alert dialog.
`open` | `open` | `boolean` | `undefined` | Opens the dialog when set to `true` and closes it when set to `false`.
`getOpenAnimation` | | `() => DialogAnimation` | `function { ... }` | Gets the opening animation for a dialog. Set to a new function to customize<br>the animation.
`getCloseAnimation` | | `() => DialogAnimation` | `function { ... }` | Gets the closing animation for a dialog. Set to a new function to customize<br>the animation.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

#### Methods

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Method | Parameters | Returns | Description
--- | --- | --- | ---
`show` | _None_ | `Promise<void>` | Opens the dialog and fires a cancelable `open` event. After a dialog's<br>animation, an `opened` event is fired.<br><br>Add an `autocomplete` attribute to a child of the dialog that should<br>receive focus after opening.
`close` | `returnValue` | `Promise<void>` | Closes the dialog and fires a cancelable `close` event. After a dialog's<br>animation, a `closed` event is fired.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

#### Events

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Event | Type | Description
--- | --- | ---
`open` | `undefined` | Dispatched when the dialog is opening before any animations.
`opened` | `undefined` | Dispatched when the dialog has opened after any animations.
`close` | `undefined` | Dispatched when the dialog is closing before any animations.
`closed` | `undefined` | Dispatched when the dialog has closed after any animations.
`cancel` | `undefined` | Dispatched when the dialog has been canceled by clicking on the<br>scrim or pressing Escape.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

<!-- auto-generated API docs end -->
21 changes: 21 additions & 0 deletions docs/components/divider.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,24 @@ Token | Default value
<p>Lorem ipsum...</p>
</section>
```

<!-- auto-generated API docs start -->

## API


### MdDivider

#### Properties

<!-- mdformat off(autogenerated might break rendering in catalog) -->

Property | Attribute | Type | Default | Description
--- | --- | --- | --- | ---
`inset` | `inset` | `boolean` | `false` | Indents the divider with equal padding on both sides.
`insetStart` | `inset-start` | `boolean` | `false` | Indents the divider with padding on the leading side.
`insetEnd` | `inset-end` | `boolean` | `false` | Indents the divider with padding on the trailing side.

<!-- mdformat on(autogenerated might break rendering in catalog) -->

<!-- auto-generated API docs end -->
3 changes: 3 additions & 0 deletions docs/components/elevation.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,6 @@ Token | Default value
<!-- Content -->
</div>
```

<!-- auto-generated API docs start -->
<!-- auto-generated API docs end -->
Loading

0 comments on commit 9f3e55d

Please sign in to comment.