mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +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
4
types/Accordion/AccordionItem.svelte.d.ts
vendored
4
types/Accordion/AccordionItem.svelte.d.ts
vendored
|
@ -5,8 +5,8 @@ type RestProps = SvelteHTMLElements["li"];
|
|||
|
||||
export interface AccordionItemProps extends RestProps {
|
||||
/**
|
||||
* 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>`)
|
||||
* @default "title"
|
||||
*/
|
||||
title?: string;
|
||||
|
|
26
types/CodeSnippet/CodeSnippet.svelte.d.ts
vendored
26
types/CodeSnippet/CodeSnippet.svelte.d.ts
vendored
|
@ -8,15 +8,18 @@ export interface CodeSnippetProps {
|
|||
type?: "single" | "inline" | "multi";
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @default undefined
|
||||
*/
|
||||
code?: string;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @default async (code) => { try { await navigator.clipboard.writeText(code); } catch (e) { console.log(e); } }
|
||||
*/
|
||||
copy?: (code: string) => void;
|
||||
|
@ -34,15 +37,16 @@ export interface CodeSnippetProps {
|
|||
hideCopyButton?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` for the disabled variant
|
||||
* Set to `true` for the disabled variant.
|
||||
* Only applies to the "single", "multi" types
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @default false
|
||||
*/
|
||||
wrapText?: boolean;
|
||||
|
@ -84,15 +88,17 @@ export interface CodeSnippetProps {
|
|||
feedbackTimeout?: number;
|
||||
|
||||
/**
|
||||
* Specify the show less text
|
||||
* `type` must be "multi"
|
||||
* Specify the show less text.
|
||||
*
|
||||
* NOTE: this prop only works with the `type="multi"` variant
|
||||
* @default "Show less"
|
||||
*/
|
||||
showLessText?: string;
|
||||
|
||||
/**
|
||||
* Specify the show more text
|
||||
* `type` must be "multi"
|
||||
*
|
||||
* NOTE: this prop only works with the `type="multi"` variant
|
||||
* @default "Show more"
|
||||
*/
|
||||
showMoreText?: string;
|
||||
|
|
4
types/ContentSwitcher/Switch.svelte.d.ts
vendored
4
types/ContentSwitcher/Switch.svelte.d.ts
vendored
|
@ -5,8 +5,8 @@ type RestProps = SvelteHTMLElements["button"];
|
|||
|
||||
export interface SwitchProps extends RestProps {
|
||||
/**
|
||||
* 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>`)
|
||||
* @default "Provide text"
|
||||
*/
|
||||
text?: string;
|
||||
|
|
|
@ -30,8 +30,8 @@ export interface ContextMenuOptionProps extends RestProps {
|
|||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
|
||||
/**
|
||||
* 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>`)
|
||||
* @default ""
|
||||
*/
|
||||
labelText?: string;
|
||||
|
@ -50,8 +50,8 @@ export interface ContextMenuOptionProps extends RestProps {
|
|||
selectable?: boolean;
|
||||
|
||||
/**
|
||||
* 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>`)
|
||||
* @default ""
|
||||
*/
|
||||
shortcutText?: string;
|
||||
|
|
|
@ -5,8 +5,8 @@ type RestProps = SvelteHTMLElements["li"];
|
|||
|
||||
export interface OverflowMenuItemProps extends RestProps {
|
||||
/**
|
||||
* Specify the item text
|
||||
* Alternatively, use the default slot for a custom element
|
||||
* Specify the item text.
|
||||
* Alternatively, use the default slot
|
||||
* @default "Provide text"
|
||||
*/
|
||||
text?: string;
|
||||
|
|
2
types/Slider/Slider.svelte.d.ts
vendored
2
types/Slider/Slider.svelte.d.ts
vendored
|
@ -97,7 +97,7 @@ export interface SliderProps extends RestProps {
|
|||
|
||||
/**
|
||||
* 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>`)
|
||||
* @default ""
|
||||
*/
|
||||
labelText?: string;
|
||||
|
|
4
types/Tabs/Tab.svelte.d.ts
vendored
4
types/Tabs/Tab.svelte.d.ts
vendored
|
@ -5,8 +5,8 @@ type RestProps = SvelteHTMLElements["li"];
|
|||
|
||||
export interface TabProps extends RestProps {
|
||||
/**
|
||||
* 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>`)
|
||||
* @default ""
|
||||
*/
|
||||
label?: string;
|
||||
|
|
4
types/UIShell/HeaderAction.svelte.d.ts
vendored
4
types/UIShell/HeaderAction.svelte.d.ts
vendored
|
@ -25,8 +25,8 @@ export interface HeaderActionProps extends RestProps {
|
|||
closeIcon?: typeof import("svelte").SvelteComponent<any>;
|
||||
|
||||
/**
|
||||
* 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>`)
|
||||
* @default undefined
|
||||
*/
|
||||
text?: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue