feat(types): loosen icon prop type to allow any Svelte component #806 (#853)

* feat(types): loosen type for Carbon icons #806

* Add closeIcon option and remove stopPropagation on:click in HeaderAction (#840)

* Remove stopPropagation on:click

Remove stopPropagation on:click helps when you have more then one acction to switch between actions tabs

* fix bug for default icon

* add closeIcon attribute to HeaderAction

* feat(types): loosen type for Carbon icons #806

* chore: update TreeView, HeaderAction icon types

Co-authored-by: Daniel Miedzik <daniel.miedzik@gmail.com>
This commit is contained in:
Eric Liu 2021-10-15 16:40:23 -07:00 committed by GitHub
commit b21600c9d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 169 additions and 169 deletions

View file

@ -47,7 +47,7 @@ export interface ButtonProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the ARIA label for the button icon

View file

@ -25,7 +25,7 @@ export interface ContextMenuOptionProps
* Specify the icon from `carbon-icons-svelte` to render
* Icon is rendered to the left of the label text
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the label text

View file

@ -8,7 +8,7 @@ export interface IconProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
render?: typeof import("carbon-icons-svelte").CarbonIcon;
render?: typeof import("svelte").SvelteComponent;
/**
* Set to `true` to display the skeleton state

View file

@ -23,7 +23,7 @@ export interface LinkProps
* Specify the icon from `carbon-icons-svelte` to render
* `inline` must be `false`
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Set to `true` to disable the checkbox

View file

@ -12,7 +12,7 @@ export interface NotificationButtonProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the title of the icon

View file

@ -40,7 +40,7 @@ export interface OverflowMenuProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the icon class

View file

@ -94,7 +94,7 @@ export interface SearchProps {
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Set an id for the input element

2
types/Tag/Tag.d.ts vendored
View file

@ -58,7 +58,7 @@ export interface TagProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Set an id for the filterable tag

View file

@ -31,7 +31,7 @@ export interface TooltipProps
* Specify the icon from `carbon-icons-svelte` to render for the tooltip button
* Icon size must be 16px (e.g., `Add16`, `Task16`)
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the ARIA label for the tooltip button

View file

@ -13,7 +13,7 @@ export interface TooltipIconProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Set to `true` to disable the tooltip icon

View file

@ -6,7 +6,7 @@ export type TreeNodeId = string | number;
export interface TreeNode {
id: TreeNodeId;
text: string;
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
disabled?: boolean;
expanded?: boolean;
}

View file

@ -65,13 +65,13 @@ export interface HeaderProps
* Specify the icon from `carbon-icons-svelte` to render for the closed state
* Defaults to `Menu20`
*/
iconMenu?: typeof import("carbon-icons-svelte").CarbonIcon;
iconMenu?: typeof import("svelte").SvelteComponent;
/**
* Specify the icon from `carbon-icons-svelte` to render for the opened state
* Defaults to `Close20`
*/
iconClose?: typeof import("carbon-icons-svelte").CarbonIcon;
iconClose?: typeof import("svelte").SvelteComponent;
}
export default class Header extends SvelteComponentTyped<

View file

@ -18,12 +18,12 @@ export interface HeaderActionProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Specify the close icon from `carbon-icons-svelte` to render
*/
closeIcon?: typeof import("carbon-icons-svelte").CarbonIcon;
closeIcon?: typeof import("svelte").SvelteComponent;
/**
* Specify the text

View file

@ -17,7 +17,7 @@ export interface HeaderActionLinkProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Obtain a reference to the HTML anchor element

View file

@ -12,7 +12,7 @@ export interface HeaderGlobalActionProps
/**
* Specify the icon to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Obtain a reference to the HTML button element

View file

@ -22,7 +22,7 @@ export interface SideNavLinkProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Obtain a reference to the HTML anchor element

View file

@ -17,7 +17,7 @@ export interface SideNavMenuProps
/**
* Specify the icon from `carbon-icons-svelte` to render
*/
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
icon?: typeof import("svelte").SvelteComponent;
/**
* Obtain a reference to the HTML button element