mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
Add types test for HeaderAction
This commit is contained in:
parent
84c30098fb
commit
53a106bc41
4 changed files with 20 additions and 18 deletions
|
@ -1615,17 +1615,17 @@ None.
|
|||
|
||||
### Props
|
||||
|
||||
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
||||
| :------------------------- | :------- | :--------------- | :------- | ----------------------------------------------------------------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
|
||||
| ref | No | <code>let</code> | Yes | <code>null | HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the button HTML element |
|
||||
| isOpen | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the panel |
|
||||
| icon | No | <code>let</code> | No | <code>any</code> | <code>undefined</code> | Specify the icon to render when the action panel is closed.<br />Defaults to `<Switcher size={20} />` |
|
||||
| closeIcon | No | <code>let</code> | No | <code>any</code> | <code>undefined</code> | Specify the icon to render when the action panel is open.<br />Defaults to `<Close size={20} />` |
|
||||
| text | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify the text.<br />Alternatively, use the named slot "text" (e.g., `<div slot="text">...</div>`) |
|
||||
| iconDescription | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify an icon tooltip.<br />This only works if `text` or a named slot "text" is not provided. |
|
||||
| tooltipAlignment | No | <code>let</code> | No | <code>"start" | "center" | "end"</code> | <code>"center"</code> | Set the alignment of the tooltip relative to the icon.<br />This only works if `iconDescription` is provided. |
|
||||
| transition | No | <code>let</code> | No | <code>false | import("svelte/transition").SlideParams</code> | <code>{ duration: 200 }</code> | Customize the panel transition (i.e., `transition:slide`).<br />Set to `false` to disable the transition |
|
||||
| preventCloseOnClickOutside | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to prevent the panel from closing when clicking outside |
|
||||
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
||||
| :------------------------- | :------- | :--------------- | :------- | ----------------------------------------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ref | No | <code>let</code> | Yes | <code>null | HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the button HTML element |
|
||||
| isOpen | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the panel |
|
||||
| icon | No | <code>let</code> | No | <code>any</code> | <code>undefined</code> | Specify the icon to render when the action panel is closed.<br />Defaults to `<Switcher size={20} />` |
|
||||
| closeIcon | No | <code>let</code> | No | <code>any</code> | <code>undefined</code> | Specify the icon to render when the action panel is open.<br />Defaults to `<Close size={20} />` |
|
||||
| text | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify the text displayed next to the icon.<br />Alternatively, use the named slot "text" (e.g., `<div slot="text">...</div>`) |
|
||||
| iconDescription | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify an icon tooltip. The tooltip will not be displayed<br />if either the `text` prop or a named slot="text" is used |
|
||||
| tooltipAlignment | No | <code>let</code> | No | <code>"start" | "center" | "end"</code> | <code>"center"</code> | Set the alignment of the tooltip relative to the icon.<br />Only applies when `iconDescription` is provided |
|
||||
| transition | No | <code>let</code> | No | <code>false | import("svelte/transition").SlideParams</code> | <code>{ duration: 200 }</code> | Customize the panel transition (i.e., `transition:slide`).<br />Set to `false` to disable the transition |
|
||||
| preventCloseOnClickOutside | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to prevent the panel from closing when clicking outside |
|
||||
|
||||
### Slots
|
||||
|
||||
|
|
|
@ -5870,7 +5870,7 @@
|
|||
{
|
||||
"name": "text",
|
||||
"kind": "let",
|
||||
"description": "Specify the text.\nAlternatively, use the named slot \"text\" (e.g., `<div slot=\"text\">...</div>`)",
|
||||
"description": "Specify the text displayed next to the icon.\nAlternatively, use the named slot \"text\" (e.g., `<div slot=\"text\">...</div>`)",
|
||||
"type": "string",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
|
@ -5881,7 +5881,7 @@
|
|||
{
|
||||
"name": "iconDescription",
|
||||
"kind": "let",
|
||||
"description": "Specify an icon tooltip.\nThis only works if `text` or a named slot \"text\" is not provided.",
|
||||
"description": "Specify an icon tooltip. The tooltip will not be displayed\nif either the `text` prop or a named slot=\"text\" is used",
|
||||
"type": "string",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
|
@ -5892,7 +5892,7 @@
|
|||
{
|
||||
"name": "tooltipAlignment",
|
||||
"kind": "let",
|
||||
"description": "Set the alignment of the tooltip relative to the icon.\nThis only works if `iconDescription` is provided.",
|
||||
"description": "Set the alignment of the tooltip relative to the icon.\nOnly applies when `iconDescription` is provided",
|
||||
"type": "\"start\" | \"center\" | \"end\"",
|
||||
"value": "\"center\"",
|
||||
"isFunction": false,
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
bind:isOpen
|
||||
on:open
|
||||
on:close
|
||||
iconDescription="Switcher"
|
||||
tooltipAlignment="start"
|
||||
transition={{ duration: 400, easing: quintOut }}
|
||||
>
|
||||
<HeaderPanelLinks>
|
||||
|
|
8
types/UIShell/HeaderAction.svelte.d.ts
vendored
8
types/UIShell/HeaderAction.svelte.d.ts
vendored
|
@ -25,22 +25,22 @@ type $Props = {
|
|||
closeIcon?: any;
|
||||
|
||||
/**
|
||||
* Specify the text.
|
||||
* Specify the text displayed next to the icon.
|
||||
* Alternatively, use the named slot "text" (e.g., `<div slot="text">...</div>`)
|
||||
* @default undefined
|
||||
*/
|
||||
text?: string;
|
||||
|
||||
/**
|
||||
* Specify an icon tooltip.
|
||||
* This only works if `text` or a named slot "text" is not provided.
|
||||
* Specify an icon tooltip. The tooltip will not be displayed
|
||||
* if either the `text` prop or a named slot="text" is used
|
||||
* @default undefined
|
||||
*/
|
||||
iconDescription?: string;
|
||||
|
||||
/**
|
||||
* Set the alignment of the tooltip relative to the icon.
|
||||
* This only works if `iconDescription` is provided.
|
||||
* Only applies when `iconDescription` is provided
|
||||
* @default "center"
|
||||
*/
|
||||
tooltipAlignment?: "start" | "center" | "end";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue