mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
feat(ui-shell): add expandedByDefault prop to Header
This commit is contained in:
parent
9632ae592b
commit
76ac0505e3
1 changed files with 8 additions and 3 deletions
|
@ -1,4 +1,10 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `false` to hide the side nav by default
|
||||
* @type {boolean} [expandedByDefault=true]
|
||||
*/
|
||||
export let expandedByDefault = true;
|
||||
|
||||
/**
|
||||
* Set to `true` to open the side nav
|
||||
* @type {boolean} [isSideNavOpen=false]
|
||||
|
@ -34,7 +40,7 @@
|
|||
|
||||
let winWidth = undefined;
|
||||
|
||||
$: isSideNavOpen = winWidth >= 1056;
|
||||
$: isSideNavOpen = expandedByDefault && winWidth >= 1056;
|
||||
$: ariaLabel = company
|
||||
? `${company} `
|
||||
: "" + (uiShellAriaLabel || $$props["aria-label"] || platformName);
|
||||
|
@ -49,8 +55,7 @@
|
|||
{/if}
|
||||
<a {href} class:bx--header__name={true} {...$$restProps} on:click>
|
||||
{#if company}
|
||||
<span class:bx--header__name--prefix={true}>{company}</span>
|
||||
|
||||
<span class:bx--header__name--prefix={true}>{company} </span>
|
||||
{/if}
|
||||
<slot name="platform">{platformName}</slot>
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue