refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props

This commit is contained in:
Eric Liu 2020-11-06 11:30:46 -08:00
commit 75d4b4cf03
219 changed files with 5168 additions and 5259 deletions

View file

@ -1,14 +1,15 @@
/// <reference types="svelte" />
export default class Content {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["main"]> & {
/**
* Specify the id for the main element
* @default "main-content"
*/
id?: string;
};
export interface ContentProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["main"]> {
/**
* Specify the id for the main element
* @default "main-content"
*/
id?: string;
}
export default class Content {
$$prop_def: ContentProps;
$$slot_def: {
default: {};
};

View file

@ -1,52 +1,53 @@
/// <reference types="svelte" />
export interface HeaderProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Set to `false` to hide the side nav by default
* @default true
*/
expandedByDefault?: boolean;
/**
* Set to `true` to open the side nav
* @default false
*/
isSideNavOpen?: boolean;
/**
* Specify the ARIA label for the header
*/
uiShellAriaLabel?: string;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the company name
*/
company?: string;
/**
* Specify the platform name
* Alternatively, use the named slot "platform" (e.g. <span slot="platform">...</span>)
* @default ""
*/
platformName?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
}
export default class Header {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `false` to hide the side nav by default
* @default true
*/
expandedByDefault?: boolean;
/**
* Set to `true` to open the side nav
* @default false
*/
isSideNavOpen?: boolean;
/**
* Specify the ARIA label for the header
*/
uiShellAriaLabel?: string;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the company name
*/
company?: string;
/**
* Specify the platform name
* Alternatively, use the named slot "platform" (e.g. <span slot="platform">...</span>)
* @default ""
*/
platformName?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$prop_def: HeaderProps;
$$slot_def: {
default: {};
["skip-to-content"]: {};
platform: {};
["skip-to-content"]: {};
};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;

View file

@ -1,31 +1,32 @@
/// <reference types="svelte" />
export interface HeaderActionProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
/**
* Set to `true` to open the panel
* @default false
*/
isOpen?: boolean;
/**
* Specify the icon props
*/
icon?: { render: import("carbon-icons-svelte").CarbonIcon; skeleton: boolean };
/**
* Specify the text
* Alternatively, use the named slot "text" (e.g. <div slot="text">...</div>)
*/
text?: string;
/**
* Obtain a reference to the button HTML element
* @default null
*/
ref?: null | HTMLButtonElement;
}
export default class HeaderAction {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> & {
/**
* Set to `true` to open the panel
* @default false
*/
isOpen?: boolean;
/**
* Specify the icon props
*/
icon?: { render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean };
/**
* Specify the text
* Alternatively, use the named slot "text" (e.g. <div slot="text">...</div>)
*/
text?: string;
/**
* Obtain a reference to the button HTML element
* @default null
*/
ref?: null | HTMLButtonElement;
};
$$prop_def: HeaderActionProps;
$$slot_def: {
default: {};
text: {};

View file

@ -1,30 +1,31 @@
/// <reference types="svelte" />
export interface HeaderActionLinkProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Set to `true` to use the active state
* @default false
*/
linkIsActive?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the icon props
*/
icon?: { render: import("carbon-icons-svelte").CarbonIcon; skeleton: boolean };
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
}
export default class HeaderActionLink {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to use the active state
* @default false
*/
linkIsActive?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the icon props
*/
icon?: { render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean };
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$prop_def: HeaderActionLinkProps;
$$slot_def: {};
$on(eventname: string, cb: (event: Event) => void): () => void;

View file

@ -1,14 +1,15 @@
/// <reference types="svelte" />
export default class HeaderActionSearch {
$$prop_def: {
/**
* Set to `true` to focus the search
* @default false
*/
searchIsActive?: boolean;
};
export interface HeaderActionSearchProps {
/**
* Set to `true` to focus the search
* @default false
*/
searchIsActive?: boolean;
}
export default class HeaderActionSearch {
$$prop_def: HeaderActionSearchProps;
$$slot_def: {};
$on(eventname: "inputSearch", cb: (event: CustomEvent<{ action: "search"; textInput: string }>) => void): () => void;

View file

@ -1,13 +1,14 @@
/// <reference types="svelte" />
export default class HeaderNav {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["nav"]> & {
/**
* Specify the ARIA label for the nav
*/
ariaLabel?: string;
};
export interface HeaderNavProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["nav"]> {
/**
* Specify the ARIA label for the nav
*/
ariaLabel?: string;
}
export default class HeaderNav {
$$prop_def: HeaderNavProps;
$$slot_def: {
default: {};
};

View file

@ -1,24 +1,25 @@
/// <reference types="svelte" />
export interface HeaderNavItemProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
}
export default class HeaderNavItem {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$prop_def: HeaderNavItemProps;
$$slot_def: {};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;

View file

@ -1,37 +1,38 @@
/// <reference types="svelte" />
export interface HeaderNavMenuProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Set to `true` to toggle the expanded state
* @default false
*/
expanded?: boolean;
/**
* Specify the `href` attribute
* @default "/"
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
/**
* Specify the ARIA label for the chevron icon
* @default "Expand/Collapse"
*/
iconDescription?: string;
}
export default class HeaderNavMenu {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to toggle the expanded state
* @default false
*/
expanded?: boolean;
/**
* Specify the `href` attribute
* @default "/"
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
/**
* Specify the ARIA label for the chevron icon
* @default "Expand/Collapse"
*/
iconDescription?: string;
};
$$prop_def: HeaderNavMenuProps;
$$slot_def: {
default: {};
};

View file

@ -1,8 +1,9 @@
/// <reference types="svelte" />
export default class HeaderPanelDivider {
$$prop_def: {};
export interface HeaderPanelDividerProps {}
export default class HeaderPanelDivider {
$$prop_def: HeaderPanelDividerProps;
$$slot_def: {
default: {};
};

View file

@ -1,19 +1,20 @@
/// <reference types="svelte" />
export interface HeaderPanelLinkProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
}
export default class HeaderPanelLink {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$prop_def: HeaderPanelLinkProps;
$$slot_def: {
default: {};
};

View file

@ -1,8 +1,9 @@
/// <reference types="svelte" />
export default class HeaderPanelLinks {
$$prop_def: {};
export interface HeaderPanelLinksProps {}
export default class HeaderPanelLinks {
$$prop_def: HeaderPanelLinksProps;
$$slot_def: {
default: {};
};

View file

@ -1,8 +1,9 @@
/// <reference types="svelte" />
export default class HeaderUtilities {
$$prop_def: {};
export interface HeaderUtilitiesProps {}
export default class HeaderUtilities {
$$prop_def: HeaderUtilitiesProps;
$$slot_def: {
default: {};
};

View file

@ -1,25 +1,26 @@
/// <reference types="svelte" />
export interface HeaderGlobalActionProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
/**
* Set to `true` to use the active variant
* @default false
*/
isActive?: boolean;
/**
* Specify the icon to render
*/
icon?: import("carbon-icons-svelte").CarbonIcon;
/**
* Obtain a reference to the HTML button element
* @default null
*/
ref?: null | HTMLButtonElement;
}
export default class HeaderGlobalAction {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> & {
/**
* Set to `true` to use the active variant
* @default false
*/
isActive?: boolean;
/**
* Specify the icon to render
*/
icon?: typeof import("carbon-icons-svelte/lib/Add16").default;
/**
* Obtain a reference to the HTML button element
* @default null
*/
ref?: null | HTMLButtonElement;
};
$$prop_def: HeaderGlobalActionProps;
$$slot_def: {
default: {};
};

View file

@ -1,25 +1,26 @@
/// <reference types="svelte" />
export interface SideNavProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["nav"]> {
/**
* Set to `true` to use the fixed variant
* @default false
*/
fixed?: boolean;
/**
* Specify the ARIA label for the nav
*/
ariaLabel?: string;
/**
* Set to `true` to toggle the expanded state
* @default false
*/
isOpen?: boolean;
}
export default class SideNav {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["nav"]> & {
/**
* Set to `true` to use the fixed variant
* @default false
*/
fixed?: boolean;
/**
* Specify the ARIA label for the nav
*/
ariaLabel?: string;
/**
* Set to `true` to toggle the expanded state
* @default false
*/
isOpen?: boolean;
};
$$prop_def: SideNavProps;
$$slot_def: {
default: {};
};

View file

@ -1,8 +1,9 @@
/// <reference types="svelte" />
export default class SideNavItems {
$$prop_def: {};
export interface SideNavItemsProps {}
export default class SideNavItems {
$$prop_def: SideNavItemsProps;
$$slot_def: {
default: {};
};

View file

@ -1,35 +1,36 @@
/// <reference types="svelte" />
export interface SideNavLinkProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Set to `true` to select the current link
* @default false
*/
isSelected?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Specify the icon props
*/
icon?: { render: import("carbon-icons-svelte").CarbonIcon; skeleton: boolean };
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
}
export default class SideNavLink {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to select the current link
* @default false
*/
isSelected?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the text
*/
text?: string;
/**
* Specify the icon props
*/
icon?: { render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean };
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$prop_def: SideNavLinkProps;
$$slot_def: {};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;

View file

@ -1,30 +1,31 @@
/// <reference types="svelte" />
export interface SideNavMenuProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
/**
* Set to `true` to toggle the expanded state
* @default false
*/
expanded?: boolean;
/**
* Specify the text
*/
text?: string;
/**
* Specify the icon props
*/
icon?: { render: import("carbon-icons-svelte").CarbonIcon; skeleton: boolean };
/**
* Obtain a reference to the HTML button element
* @default null
*/
ref?: null | HTMLButtonElement;
}
export default class SideNavMenu {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> & {
/**
* Set to `true` to toggle the expanded state
* @default false
*/
expanded?: boolean;
/**
* Specify the text
*/
text?: string;
/**
* Specify the icon props
*/
icon?: { render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean };
/**
* Obtain a reference to the HTML button element
* @default null
*/
ref?: null | HTMLButtonElement;
};
$$prop_def: SideNavMenuProps;
$$slot_def: {
default: {};
};

View file

@ -1,29 +1,30 @@
/// <reference types="svelte" />
export interface SideNavMenuItemProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Set to `true` to select the item
*/
isSelected?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the item text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
}
export default class SideNavMenuItem {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Set to `true` to select the item
*/
isSelected?: boolean;
/**
* Specify the `href` attribute
*/
href?: string;
/**
* Specify the item text
*/
text?: string;
/**
* Obtain a reference to the HTML anchor element
* @default null
*/
ref?: null | HTMLAnchorElement;
};
$$prop_def: SideNavMenuItemProps;
$$slot_def: {};
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;

View file

@ -1,20 +1,21 @@
/// <reference types="svelte" />
export interface SkipToContentProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> {
/**
* Specify the `href` attribute
* @default "#main-content"
*/
href?: string;
/**
* Specify the tabindex
* @default "0"
*/
tabindex?: string;
}
export default class SkipToContent {
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["a"]> & {
/**
* Specify the `href` attribute
* @default "#main-content"
*/
href?: string;
/**
* Specify the tabindex
* @default "0"
*/
tabindex?: string;
};
$$prop_def: SkipToContentProps;
$$slot_def: {
default: {};
};