mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 03:01:25 +00:00
fix(types): improve formatting of prop comments (#1779)
This commit is contained in:
parent
239f1b10e5
commit
be763706ca
18 changed files with 170 additions and 158 deletions
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the title of the accordion item heading
|
||||
* Alternatively, use the "title" slot (e.g., <div slot="title">...</div>)
|
||||
* Specify the title of the accordion item heading.
|
||||
* Alternatively, use the "title" slot (e.g., `<div slot="title">...</div>`)
|
||||
*/
|
||||
export let title = "title";
|
||||
|
||||
|
|
|
@ -12,15 +12,18 @@
|
|||
export let type = "single";
|
||||
|
||||
/**
|
||||
* Set the code snippet text
|
||||
* Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)
|
||||
* You must use the `code` prop to copy the code
|
||||
* Set the code snippet text.
|
||||
* Alternatively, use the default slot (e.g., `<CodeSnippet>{code}</CodeSnippet>`).
|
||||
*
|
||||
* NOTE: you *must* use the `code` prop for the copy-to-clipboard functionality.
|
||||
* @type {string}
|
||||
*/
|
||||
export let code = undefined;
|
||||
|
||||
/**
|
||||
* Override the default copy behavior of using the navigator.clipboard.writeText API to copy text
|
||||
* By default, this component uses `navigator.clipboard.writeText` API to copy text to the user's clipboard.
|
||||
*
|
||||
* Provide a custom function to override this behavior.
|
||||
* @type {(code: string) => void}
|
||||
*/
|
||||
export let copy = async (code) => {
|
||||
|
@ -38,14 +41,15 @@
|
|||
export let hideCopyButton = false;
|
||||
|
||||
/**
|
||||
* Set to `true` for the disabled variant
|
||||
* Set to `true` for the disabled variant.
|
||||
* Only applies to the "single", "multi" types
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to wrap the text
|
||||
* Note that `type` must be "multi"
|
||||
* Set to `true` to wrap the text.
|
||||
*
|
||||
* NOTE: this prop only works with the `type="multi"` variant
|
||||
*/
|
||||
export let wrapText = false;
|
||||
|
||||
|
@ -74,14 +78,16 @@
|
|||
export let feedbackTimeout = 2000;
|
||||
|
||||
/**
|
||||
* Specify the show less text
|
||||
* `type` must be "multi"
|
||||
* Specify the show less text.
|
||||
*
|
||||
* NOTE: this prop only works with the `type="multi"` variant
|
||||
*/
|
||||
export let showLessText = "Show less";
|
||||
|
||||
/**
|
||||
* Specify the show more text
|
||||
* `type` must be "multi"
|
||||
*
|
||||
* NOTE: this prop only works with the `type="multi"` variant
|
||||
*/
|
||||
export let showMoreText = "Show more";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the switch text
|
||||
* Alternatively, use the "text" slot (e.g., <span slot="text">...</span>)
|
||||
* Specify the switch text.
|
||||
* Alternatively, use the "text" slot (e.g., `<span slot="text">...</span>`)
|
||||
*/
|
||||
export let text = "Provide text";
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
export let icon = undefined;
|
||||
|
||||
/**
|
||||
* Specify the label text
|
||||
* Alternatively, use the "labelText" slot (e.g., <span slot="labelText">...</span>)
|
||||
* Specify the label text.
|
||||
* Alternatively, use the "labelText" slot (e.g., `<span slot="labelText">...</span>`)
|
||||
*/
|
||||
export let labelText = "";
|
||||
|
||||
|
@ -34,8 +34,8 @@
|
|||
export let selectable = false;
|
||||
|
||||
/**
|
||||
* Specify the shortcut text
|
||||
* Alternatively, use the "shortcutText" slot (e.g., <span slot="shortcutText">...</span>)
|
||||
* Specify the shortcut text.
|
||||
* Alternatively, use the "shortcutText" slot (e.g., `<span slot="shortcutText">...</span>`)
|
||||
*/
|
||||
export let shortcutText = "";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the item text
|
||||
* Alternatively, use the default slot for a custom element
|
||||
* Specify the item text.
|
||||
* Alternatively, use the default slot
|
||||
*/
|
||||
export let text = "Provide text";
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
/**
|
||||
* Specify the label text.
|
||||
* Alternatively, use the "labelText" slot (e.g., <span slot="labelText">...</span>)
|
||||
* Alternatively, use the "labelText" slot (e.g., `<span slot="labelText">...</span>`)
|
||||
*/
|
||||
export let labelText = "";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the tab label
|
||||
* Alternatively, use the default slot (e.g., <Tab><span>Label</span></Tab>)
|
||||
* Specify the tab label.
|
||||
* Alternatively, use the default slot (e.g., `<Tab><span>Label</span></Tab>`)
|
||||
*/
|
||||
export let label = "";
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
export let closeIcon = Close;
|
||||
|
||||
/**
|
||||
* Specify the text
|
||||
* Alternatively, use the named slot "text" (e.g., <div slot="text">...</div>)
|
||||
* Specify the text.
|
||||
* Alternatively, use the named slot "text" (e.g., `<div slot="text">...</div>`)
|
||||
* @type {string}
|
||||
*/
|
||||
export let text = undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue