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

@ -33,7 +33,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -14,7 +14,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* Icon is rendered to the left of the label text
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -12,7 +12,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let render = undefined;

View file

@ -17,7 +17,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* `inline` must be `false`
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -7,7 +7,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = Close20;

View file

@ -32,7 +32,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = OverflowMenuVertical16;

View file

@ -60,7 +60,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = Search16;

View file

@ -27,7 +27,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -26,7 +26,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render for the tooltip button
* Icon size must be 16px (e.g., `Add16`, `Task16`)
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = Information16;

View file

@ -7,7 +7,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -1,7 +1,7 @@
<script>
/**
* @typedef {string | number} TreeNodeId
* @typedef {{ id: TreeNodeId; text: string; icon?: typeof import("carbon-icons-svelte").CarbonIcon; disabled?: boolean; expanded?: boolean; }} TreeNode
* @typedef {{ id: TreeNodeId; text: string; icon?: typeof import("svelte").SvelteComponent; disabled?: boolean; expanded?: boolean; }} TreeNode
* @event {TreeNode & { expanded: boolean; leaf: boolean; }} select
* @event {TreeNode & { expanded: boolean; leaf: boolean; }} toggle
* @event {TreeNode & { expanded: boolean; leaf: boolean; }} focus

View file

@ -45,7 +45,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -16,7 +16,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -49,14 +49,14 @@
/**
* Specify the icon from `carbon-icons-svelte` to render for the closed state
* Defaults to `Menu20`
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let iconMenu = Menu20;
/**
* Specify the icon from `carbon-icons-svelte` to render for the opened state
* Defaults to `Close20`
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let iconClose = Close20;

View file

@ -8,13 +8,13 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = AppSwitcher20;
/**
* Specify the close icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let closeIcon = Close20;

View file

@ -10,7 +10,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -4,7 +4,7 @@
/**
* Specify the icon to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -11,14 +11,14 @@
/**
* Specify the icon from `carbon-icons-svelte` to render for the closed state
* Defaults to `Menu20`
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let iconMenu = Menu20;
/**
* Specify the icon from `carbon-icons-svelte` to render for the opened state
* Defaults to `Close20`
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let iconClose = Close20;

View file

@ -16,7 +16,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;

View file

@ -10,7 +10,7 @@
/**
* Specify the icon from `carbon-icons-svelte` to render
* @type {typeof import("carbon-icons-svelte").CarbonIcon}
* @type {typeof import("svelte").SvelteComponent}
*/
export let icon = undefined;