fix(types): include @default annotations for props that are undefined by default (#1020)

* chore(deps-dev): upgrade sveld to v0.12.1

* Run "yarn build:lib"

* Re-run "yarn build:lib"
This commit is contained in:
Eric Liu 2022-01-20 19:29:06 -08:00 committed by GitHub
commit 0d78c30b9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 373 additions and 260 deletions

View file

@ -11,6 +11,7 @@ export interface AccordionProps extends AccordionSkeletonProps {
/**
* Specify the size of the accordion
* @default undefined
*/
size?: "sm" | "xl";

View file

@ -17,6 +17,7 @@ export interface AccordionSkeletonProps
/**
* Specify the size of the accordion
* @default undefined
*/
size?: "sm" | "xl";

View file

@ -5,6 +5,7 @@ export interface BreadcrumbItemProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
/**
* Set the `href` to use an anchor link
* @default undefined
*/
href?: string;

View file

@ -8,6 +8,7 @@ export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584;
export interface BreakpointProps {
/**
* Determine the current Carbon grid breakpoint size
* @default undefined
*/
size?: BreakpointSize;

View file

@ -46,11 +46,13 @@ export interface ButtonProps
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the ARIA label for the button icon
* @default undefined
*/
iconDescription?: string;
@ -88,6 +90,7 @@ export interface ButtonProps
/**
* Set the `href` to use an anchor link
* @default undefined
*/
href?: string;

View file

@ -5,6 +5,7 @@ export interface ButtonSkeletonProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Set the `href` to use an anchor link
* @default undefined
*/
href?: string;

View file

@ -64,6 +64,7 @@ export interface CheckboxProps {
/**
* Specify the title attribute for the label element
* @default undefined
*/
title?: string;

View file

@ -12,6 +12,7 @@ export interface CodeSnippetProps {
* 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
* @default undefined
*/
code?: string;
@ -61,11 +62,13 @@ export interface CodeSnippetProps {
/**
* Specify the ARIA label for the copy button icon
* @default undefined
*/
copyButtonDescription?: string;
/**
* Specify the ARIA label of the copy button
* @default undefined
*/
copyLabel?: string;

View file

@ -24,6 +24,7 @@ export interface ComboBoxProps
/**
* Set the selected item by value id
* @default undefined
*/
selectedId?: ComboBoxItemId;
@ -41,6 +42,7 @@ export interface ComboBoxProps
/**
* Set the size of the combobox
* @default undefined
*/
size?: "sm" | "xl";
@ -112,6 +114,7 @@ export interface ComboBoxProps
/**
* Override the default translation ids
* @default undefined
*/
translateWithId?: (id: any) => string;
@ -123,6 +126,7 @@ export interface ComboBoxProps
/**
* Specify a name attribute for the input
* @default undefined
*/
name?: string;

View file

@ -5,6 +5,7 @@ export interface ComposedModalProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Set the size of the composed modal
* @default undefined
*/
size?: "xs" | "sm" | "lg";

View file

@ -17,6 +17,7 @@ export interface ModalFooterProps
/**
* Specify a class for the primary button
* @default undefined
*/
primaryClass?: string;
@ -35,6 +36,7 @@ export interface ModalFooterProps
/**
* Specify a class for the secondary button
* @default undefined
*/
secondaryClass?: string;

View file

@ -17,6 +17,7 @@ export interface ContentSwitcherProps
/**
* Specify the size of the content switcher
* @default undefined
*/
size?: "sm" | "xl";
}

View file

@ -24,6 +24,7 @@ export interface ContextMenuOptionProps
/**
* Specify the icon to render
* Icon is rendered to the left of the label text
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -11,6 +11,7 @@ export interface CopyButtonProps extends CopyProps {
/**
* Specify the text to copy
* @default undefined
*/
text?: string;

View file

@ -53,6 +53,7 @@ export interface DataTableProps
/**
* Set the size of the data table
* @default undefined
*/
size?: "compact" | "short" | "medium" | "tall";

View file

@ -20,6 +20,7 @@ export interface DataTableSkeletonProps
/**
* Set the size of the data table
* @default undefined
*/
size?: "compact" | "short" | "tall";

View file

@ -5,6 +5,7 @@ export interface TableProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["section"]> {
/**
* Set the size of the table
* @default undefined
*/
size?: "compact" | "short" | "medium" | "tall";

View file

@ -5,6 +5,7 @@ export interface DatePickerInputProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
/**
* Set the size of the input
* @default undefined
*/
size?: "sm" | "xl";
@ -88,6 +89,7 @@ export interface DatePickerInputProps
/**
* Set a name for the input element
* @default undefined
*/
name?: string;

View file

@ -26,6 +26,7 @@ export interface DropdownProps
/**
* Specify the selected item id
* @default undefined
*/
selectedId?: DropdownItemId;
@ -43,6 +44,7 @@ export interface DropdownProps
/**
* Specify the size of the dropdown field
* @default undefined
*/
size?: "sm" | "lg" | "xl";
@ -108,6 +110,7 @@ export interface DropdownProps
/**
* Specify the list box label
* @default undefined
*/
label?: string;
@ -119,6 +122,7 @@ export interface DropdownProps
/**
* Override the default translation ids
* @default undefined
*/
translateWithId?: (id: any) => string;
@ -130,6 +134,7 @@ export interface DropdownProps
/**
* Specify a name attribute for the list box
* @default undefined
*/
name?: string;

View file

@ -45,31 +45,37 @@ export interface ColumnProps
/**
* Specify the aspect ratio of the column
* @default undefined
*/
aspectRatio?: "2x1" | "16x9" | "9x16" | "1x2" | "4x3" | "3x4" | "1x1";
/**
* Set the small breakpoint
* @default undefined
*/
sm?: ColumnBreakpoint;
/**
* Set the medium breakpoint
* @default undefined
*/
md?: ColumnBreakpoint;
/**
* Set the large breakpoint
* @default undefined
*/
lg?: ColumnBreakpoint;
/**
* Set the extra large breakpoint
* @default undefined
*/
xlg?: ColumnBreakpoint;
/**
* Set the maximum breakpoint
* @default undefined
*/
max?: ColumnBreakpoint;
}

View file

@ -7,6 +7,7 @@ export interface IconProps
svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["svg"]> {
/**
* Specify the icon to render
* @default undefined
*/
render?: typeof import("svelte").SvelteComponent;

View file

@ -17,6 +17,7 @@ export interface ImageLoaderProps
/**
* Specify the aspect ratio for the image wrapper
* @default undefined
*/
ratio?: "2x1" | "16x9" | "4x3" | "1x1" | "3x4" | "3x2" | "9x16" | "1x2";

View file

@ -11,11 +11,13 @@ export interface InlineLoadingProps
/**
* Set the loading description
* @default undefined
*/
description?: string;
/**
* Specify the ARIA label for the loading icon
* @default undefined
*/
iconDescription?: string;

View file

@ -5,11 +5,13 @@ export interface LinkProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["p"]> {
/**
* Specify the size of the link
* @default undefined
*/
size?: "sm" | "lg";
/**
* Specify the href value
* @default undefined
*/
href?: string;
@ -22,6 +24,7 @@ export interface LinkProps
/**
* Specify the icon to render
* `inline` must be `false`
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -5,6 +5,7 @@ export interface ListBoxProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Set the size of the list box
* @default undefined
*/
size?: "sm" | "xl";

View file

@ -7,6 +7,7 @@ export interface ListBoxSelectionProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Specify the number of selected items
* @default undefined
*/
selectionCount?: number;

View file

@ -5,6 +5,7 @@ export interface ModalProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Set the size of the modal
* @default undefined
*/
size?: "xs" | "sm" | "lg";
@ -34,16 +35,19 @@ export interface ModalProps
/**
* Specify the modal heading
* @default undefined
*/
modalHeading?: string;
/**
* Specify the modal label
* @default undefined
*/
modalLabel?: string;
/**
* Specify the ARIA label for the modal
* @default undefined
*/
modalAriaLabel?: string;

View file

@ -38,6 +38,7 @@ export interface MultiSelectProps
/**
* Set the size of the combobox
* @default undefined
*/
size?: "sm" | "lg" | "xl";
@ -113,6 +114,7 @@ export interface MultiSelectProps
/**
* Override the default translation ids
* @default undefined
*/
translateWithId?: (id: any) => string;
@ -178,6 +180,7 @@ export interface MultiSelectProps
/**
* Specify a name attribute for the select
* @default undefined
*/
name?: string;

View file

@ -11,11 +11,13 @@ export interface NotificationButtonProps
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the title of the icon
* @default undefined
*/
title?: string;

View file

@ -7,6 +7,7 @@ export interface NumberInputProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
/**
* Set the size of the input
* @default undefined
*/
size?: "sm" | "xl";
@ -24,11 +25,13 @@ export interface NumberInputProps
/**
* Specify the maximum value
* @default undefined
*/
max?: number;
/**
* Specify the minimum value
* @default undefined
*/
min?: number;
@ -130,6 +133,7 @@ export interface NumberInputProps
/**
* Specify a name attribute for the input
* @default undefined
*/
name?: string;

View file

@ -5,6 +5,7 @@ export interface OverflowMenuProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
/**
* Specify the size of the overflow menu
* @default undefined
*/
size?: "sm" | "xl";
@ -34,16 +35,19 @@ export interface OverflowMenuProps
/**
* Specify the menu options class
* @default undefined
*/
menuOptionsClass?: string;
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the icon class
* @default undefined
*/
iconClass?: string;

View file

@ -5,6 +5,7 @@ export interface ProgressBarProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Specify the current value
* @default undefined
*/
value?: number;

View file

@ -5,6 +5,7 @@ export interface RadioButtonGroupProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Set the selected radio button value
* @default undefined
*/
selected?: string;
@ -34,6 +35,7 @@ export interface RadioButtonGroupProps
/**
* Set an id for the container div element
* @default undefined
*/
id?: string;
}

View file

@ -93,6 +93,7 @@ export interface SearchProps {
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -5,11 +5,13 @@ export interface SelectProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Specify the selected item value
* @default undefined
*/
selected?: string;
/**
* Set the size of the select input
* @default undefined
*/
size?: "sm" | "xl";
@ -39,6 +41,7 @@ export interface SelectProps
/**
* Specify a name attribute for the select element
* @default undefined
*/
name?: string;

View file

@ -5,6 +5,7 @@ export interface StructuredListProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Specify the selected structured list row value
* @default undefined
*/
selected?: string;

View file

@ -6,6 +6,7 @@ export interface TagProps
svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["span"]> {
/**
* Specify the type of tag
* @default undefined
*/
type?:
| "red"
@ -58,6 +59,7 @@ export interface TagProps
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -77,6 +77,7 @@ export interface TextAreaProps
/**
* Specify a name attribute for the input
* @default undefined
*/
name?: string;

View file

@ -5,6 +5,7 @@ export interface PasswordInputProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
/**
* Set the size of the input
* @default undefined
*/
size?: "sm" | "xl";
@ -118,6 +119,7 @@ export interface PasswordInputProps
/**
* Specify a name attribute for the input
* @default undefined
*/
name?: string;

View file

@ -5,6 +5,7 @@ export interface TextInputProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
/**
* Set the size of the input
* @default undefined
*/
size?: "sm" | "xl";
@ -52,6 +53,7 @@ export interface TextInputProps
/**
* Specify a name attribute for the input
* @default undefined
*/
name?: string;

View file

@ -31,6 +31,7 @@ export interface ThemeProps {
/**
* Render a toggle or select dropdown to control the theme
* @default undefined
*/
render?: "toggle" | "select";

View file

@ -24,6 +24,7 @@ export interface ClickableTileProps
/**
* Set the `href`
* @default undefined
*/
href?: string;
}

View file

@ -5,6 +5,7 @@ export interface TileGroupProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["fieldset"]> {
/**
* Specify the selected tile value
* @default undefined
*/
selected?: string;

View file

@ -5,6 +5,7 @@ export interface TimePickerProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["input"]> {
/**
* Specify the size of the input
* @default undefined
*/
size?: "sm" | "xl";
@ -82,6 +83,7 @@ export interface TimePickerProps
/**
* Specify a name attribute for the input
* @default undefined
*/
name?: string;

View file

@ -40,6 +40,7 @@ export interface TimePickerSelectProps
/**
* Specify a name attribute for the select element
* @default undefined
*/
name?: string;

View file

@ -47,6 +47,7 @@ export interface ToggleProps
/**
* Specify a name attribute for the checkbox input
* @default undefined
*/
name?: string;
}

View file

@ -41,6 +41,7 @@ export interface ToggleSmallProps
/**
* Specify a name attribute for the checkbox input
* @default undefined
*/
name?: string;
}

View file

@ -30,6 +30,7 @@ export interface TooltipProps
/**
* Specify the icon to render for the tooltip button
* Icon size must be 16px (e.g., `Add16`, `Task16`)
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -12,6 +12,7 @@ export interface TooltipIconProps
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -17,16 +17,19 @@ export interface HeaderProps
/**
* Specify the ARIA label for the header
* @default undefined
*/
uiShellAriaLabel?: string;
/**
* Specify the `href` attribute
* @default undefined
*/
href?: string;
/**
* Specify the company name
* @default undefined
*/
company?: string;
@ -64,12 +67,14 @@ export interface HeaderProps
/**
* Specify the icon to render for the closed state
* Defaults to `Menu20`
* @default undefined
*/
iconMenu?: typeof import("svelte").SvelteComponent;
/**
* Specify the icon to render for the opened state
* Defaults to `Close20`
* @default undefined
*/
iconClose?: typeof import("svelte").SvelteComponent;
}

View file

@ -17,17 +17,20 @@ export interface HeaderActionProps
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the icon to render when the action panel is open
* @default undefined
*/
closeIcon?: typeof import("svelte").SvelteComponent;
/**
* Specify the text
* Alternatively, use the named slot "text" (e.g., <div slot="text">...</div>)
* @default undefined
*/
text?: string;

View file

@ -11,11 +11,13 @@ export interface HeaderActionLinkProps
/**
* Specify the `href` attribute
* @default undefined
*/
href?: string;
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -5,6 +5,7 @@ export interface HeaderNavProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["nav"]> {
/**
* Specify the ARIA label for the nav
* @default undefined
*/
ariaLabel?: string;
}

View file

@ -5,11 +5,13 @@ export interface HeaderNavItemProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Specify the `href` attribute
* @default undefined
*/
href?: string;
/**
* Specify the text
* @default undefined
*/
text?: string;

View file

@ -17,6 +17,7 @@ export interface HeaderNavMenuProps
/**
* Specify the text
* @default undefined
*/
text?: string;

View file

@ -5,6 +5,7 @@ export interface HeaderPanelLinkProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Specify the `href` attribute
* @default undefined
*/
href?: string;

View file

@ -11,6 +11,7 @@ export interface HeaderGlobalActionProps
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -17,6 +17,7 @@ export interface SideNavProps
/**
* Specify the ARIA label for the nav
* @default undefined
*/
ariaLabel?: string;

View file

@ -11,16 +11,19 @@ export interface SideNavLinkProps
/**
* Specify the `href` attribute
* @default undefined
*/
href?: string;
/**
* Specify the text
* @default undefined
*/
text?: string;
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -11,11 +11,13 @@ export interface SideNavMenuProps
/**
* Specify the text
* @default undefined
*/
text?: string;
/**
* Specify the icon to render
* @default undefined
*/
icon?: typeof import("svelte").SvelteComponent;

View file

@ -11,11 +11,13 @@ export interface SideNavMenuItemProps
/**
* Specify the `href` attribute
* @default undefined
*/
href?: string;
/**
* Specify the item text
* @default undefined
*/
text?: string;