chore: update TreeView, HeaderAction icon types

This commit is contained in:
metonym 2021-10-15 16:34:01 -07:00
commit d080576c8a
6 changed files with 9 additions and 16 deletions

View file

@ -1608,19 +1608,12 @@ export interface HeaderActionSlideTransition {
### Props ### Props
| Prop name | Kind | Reactive | Type | Default value | Description |
| :--------- | :--------------- | :------- | :----------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| ref | <code>let</code> | Yes | <code>null &#124; HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the button HTML element |
| isOpen | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the panel |
| icon | <code>let</code> | No | <code>typeof import("carbon-icons-svelte").CarbonIcon</code> | -- | Specify the icon from `carbon-icons-svelte` to render |
| closeIcon | <code>let</code> | No | <code>typeof import("carbon-icons-svelte").CarbonIcon</code> | -- | Specify the close icon from `carbon-icons-svelte` to render |
| text | <code>let</code> | No | <code>string</code> | -- | Specify the text<br />Alternatively, use the named slot "text" (e.g., &lt;div slot="text"&gt;...&lt;/div&gt;) |
| transition | <code>let</code> | No | <code>false &#124; HeaderActionSlideTransition</code> | <code>{ duration: 200 }</code> | Customize the panel transition (i.e., `transition:slide`)<br />Set to `false` to disable the transition |
| Prop name | Kind | Reactive | Type | Default value | Description | | Prop name | Kind | Reactive | Type | Default value | Description |
| :--------- | :--------------- | :------- | :---------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------- | | :--------- | :--------------- | :------- | :---------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| ref | <code>let</code> | Yes | <code>null &#124; HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the button HTML element | | ref | <code>let</code> | Yes | <code>null &#124; HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the button HTML element |
| isOpen | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the panel | | isOpen | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the panel |
| icon | <code>let</code> | No | <code>typeof import("svelte").SvelteComponent</code> | -- | Specify the icon from `carbon-icons-svelte` to render | | icon | <code>let</code> | No | <code>typeof import("svelte").SvelteComponent</code> | -- | Specify the icon from `carbon-icons-svelte` to render |
| closeIcon | <code>let</code> | No | <code>typeof import("svelte").SvelteComponent</code> | -- | Specify the close icon from `carbon-icons-svelte` to render |
| text | <code>let</code> | No | <code>string</code> | -- | Specify the text<br />Alternatively, use the named slot "text" (e.g., &lt;div slot="text"&gt;...&lt;/div&gt;) | | text | <code>let</code> | No | <code>string</code> | -- | Specify the text<br />Alternatively, use the named slot "text" (e.g., &lt;div slot="text"&gt;...&lt;/div&gt;) |
| transition | <code>let</code> | No | <code>false &#124; HeaderActionSlideTransition</code> | <code>{ duration: 200 }</code> | Customize the panel transition (i.e., `transition:slide`)<br />Set to `false` to disable the transition | | transition | <code>let</code> | No | <code>false &#124; HeaderActionSlideTransition</code> | <code>{ duration: 200 }</code> | Customize the panel transition (i.e., `transition:slide`)<br />Set to `false` to disable the transition |
@ -4753,7 +4746,7 @@ export type TreeNodeId = string | number;
export interface TreeNode { export interface TreeNode {
id: TreeNodeId; id: TreeNodeId;
text: string; text: string;
icon?: typeof import("carbon-icons-svelte").CarbonIcon; icon?: typeof import("svelte").SvelteComponent;
disabled?: boolean; disabled?: boolean;
expanded?: boolean; expanded?: boolean;
} }

View file

@ -4383,7 +4383,7 @@
"name": "closeIcon", "name": "closeIcon",
"kind": "let", "kind": "let",
"description": "Specify the close icon from `carbon-icons-svelte` to render", "description": "Specify the close icon from `carbon-icons-svelte` to render",
"type": "typeof import(\"carbon-icons-svelte\").CarbonIcon", "type": "typeof import(\"svelte\").SvelteComponent",
"isFunction": false, "isFunction": false,
"isFunctionDeclaration": false, "isFunctionDeclaration": false,
"constant": false, "constant": false,
@ -13252,9 +13252,9 @@
"ts": "type TreeNodeId = string | number" "ts": "type TreeNodeId = string | number"
}, },
{ {
"type": "{ id: TreeNodeId; text: string; icon?: typeof import(\"carbon-icons-svelte\").CarbonIcon; disabled?: boolean; expanded?: boolean; }", "type": "{ id: TreeNodeId; text: string; icon?: typeof import(\"svelte\").SvelteComponent; disabled?: boolean; expanded?: boolean; }",
"name": "TreeNode", "name": "TreeNode",
"ts": "interface TreeNode { id: TreeNodeId; text: string; icon?: typeof import(\"carbon-icons-svelte\").CarbonIcon; disabled?: boolean; expanded?: boolean; }" "ts": "interface TreeNode { id: TreeNodeId; text: string; icon?: typeof import(\"svelte\").SvelteComponent; disabled?: boolean; expanded?: boolean; }"
} }
], ],
"rest_props": { "type": "Element", "name": "ul" } "rest_props": { "type": "Element", "name": "ul" }

View file

@ -1,7 +1,7 @@
<script> <script>
/** /**
* @typedef {string | number} TreeNodeId * @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; }} select
* @event {TreeNode & { expanded: boolean; leaf: boolean; }} toggle * @event {TreeNode & { expanded: boolean; leaf: boolean; }} toggle
* @event {TreeNode & { expanded: boolean; leaf: boolean; }} focus * @event {TreeNode & { expanded: boolean; leaf: boolean; }} focus

View file

@ -14,7 +14,7 @@
/** /**
* Specify the close icon from `carbon-icons-svelte` to render * 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; export let closeIcon = Close20;

View file

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

View file

@ -23,7 +23,7 @@ export interface HeaderActionProps
/** /**
* Specify the close icon from `carbon-icons-svelte` to render * 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 * Specify the text