mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props
This commit is contained in:
parent
d38e6d8be6
commit
75d4b4cf03
219 changed files with 5168 additions and 5259 deletions
39
types/UIShell/SideNav/SideNav.d.ts
vendored
39
types/UIShell/SideNav/SideNav.d.ts
vendored
|
@ -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: {};
|
||||
};
|
||||
|
|
5
types/UIShell/SideNav/SideNavItems.d.ts
vendored
5
types/UIShell/SideNav/SideNavItems.d.ts
vendored
|
@ -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: {};
|
||||
};
|
||||
|
|
59
types/UIShell/SideNav/SideNavLink.d.ts
vendored
59
types/UIShell/SideNav/SideNavLink.d.ts
vendored
|
@ -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;
|
||||
|
|
49
types/UIShell/SideNav/SideNavMenu.d.ts
vendored
49
types/UIShell/SideNav/SideNavMenu.d.ts
vendored
|
@ -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: {};
|
||||
};
|
||||
|
|
47
types/UIShell/SideNav/SideNavMenuItem.d.ts
vendored
47
types/UIShell/SideNav/SideNavMenuItem.d.ts
vendored
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue