diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 3374e17b..6a739ac1 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1613,6 +1613,7 @@ export interface HeaderActionSlideTransition { | ref | let | Yes | null | HTMLButtonElement | null | Obtain a reference to the button HTML element | | isOpen | let | Yes | boolean | false | Set to `true` to open the panel | | icon | let | No | typeof import("carbon-icons-svelte").CarbonIcon | -- | Specify the icon from `carbon-icons-svelte` to render | +| closeIcon | let | No | typeof import("carbon-icons-svelte").CarbonIcon | -- | Specify the close icon from `carbon-icons-svelte` to render | | text | let | No | string | -- | Specify the text
Alternatively, use the named slot "text" (e.g., <div slot="text">...</div>) | | transition | let | No | false | HeaderActionSlideTransition | { duration: 200 } | Customize the panel transition (i.e., `transition:slide`)
Set to `false` to disable the transition | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 0d746ed7..f203cd5e 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -4379,6 +4379,16 @@ "constant": false, "reactive": false }, + { + "name": "closeIcon", + "kind": "let", + "description": "Specify the close icon from `carbon-icons-svelte` to render", + "type": "typeof import(\"carbon-icons-svelte\").CarbonIcon", + "isFunction": false, + "isFunctionDeclaration": false, + "constant": false, + "reactive": false + }, { "name": "text", "kind": "let", diff --git a/docs/src/pages/framed/UIShell/HeaderUtilities.svelte b/docs/src/pages/framed/UIShell/HeaderUtilities.svelte index a0fb3300..9e1019bc 100644 --- a/docs/src/pages/framed/UIShell/HeaderUtilities.svelte +++ b/docs/src/pages/framed/UIShell/HeaderUtilities.svelte @@ -19,9 +19,11 @@ Column, } from "carbon-components-svelte"; import SettingsAdjust20 from "carbon-icons-svelte/lib/SettingsAdjust20"; + import UserAvatarFilledAlt20 from "carbon-icons-svelte/lib/UserAvatarFilledAlt20"; let isSideNavOpen = false; - let isOpen = false; + let isOpen1 = false; + let isOpen2 = false;
@@ -30,7 +32,25 @@ - + + + Switcher subject 1 + Switcher item 1 + Switcher item 2 + Switcher item 3 + Switcher item 4 + Switcher subject 2 + Switcher item 1 + Switcher item 2 + Switcher subject 3 + Switcher item 1 + + + Switcher subject 1 Switcher item 1 diff --git a/src/UIShell/GlobalHeader/HeaderAction.svelte b/src/UIShell/GlobalHeader/HeaderAction.svelte index 4989ce9c..6f101503 100644 --- a/src/UIShell/GlobalHeader/HeaderAction.svelte +++ b/src/UIShell/GlobalHeader/HeaderAction.svelte @@ -10,7 +10,13 @@ * Specify the icon from `carbon-icons-svelte` to render * @type {typeof import("carbon-icons-svelte").CarbonIcon} */ - export let icon = undefined; + export let icon = AppSwitcher20; + + /** + * Specify the close icon from `carbon-icons-svelte` to render + * @type {typeof import("carbon-icons-svelte").CarbonIcon} + */ + export let closeIcon = Close20; /** * Specify the text @@ -58,12 +64,13 @@ class:action-text="{text}" {...$$restProps} on:click - on:click|stopPropagation="{() => { + on:click="{() => { isOpen = !isOpen; dispatch(isOpen ? 'open' : 'close'); }}" > - + + {#if text}{text}{/if} diff --git a/types/UIShell/GlobalHeader/HeaderAction.d.ts b/types/UIShell/GlobalHeader/HeaderAction.d.ts index cf1f7321..ed97e571 100644 --- a/types/UIShell/GlobalHeader/HeaderAction.d.ts +++ b/types/UIShell/GlobalHeader/HeaderAction.d.ts @@ -20,6 +20,11 @@ export interface HeaderActionProps */ icon?: typeof import("carbon-icons-svelte").CarbonIcon; + /** + * Specify the close icon from `carbon-icons-svelte` to render + */ + closeIcon?: typeof import("carbon-icons-svelte").CarbonIcon; + /** * Specify the text * Alternatively, use the named slot "text" (e.g.,
...
)