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,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;