mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
rebase upstream
This commit is contained in:
parent
00bb031bf4
commit
da470313c4
11 changed files with 2087 additions and 574 deletions
29
src/components/UIShell/UIShellSideNav/HamburgerMenu.svelte
Normal file
29
src/components/UIShell/UIShellSideNav/HamburgerMenu.svelte
Normal file
|
@ -0,0 +1,29 @@
|
|||
<script>
|
||||
export let ariaLabel = undefined;
|
||||
|
||||
import { cx } from '../../../lib';
|
||||
import Menu20 from 'carbon-icons-svelte/lib/Menu20';
|
||||
import Icon from '../../Icon/Icon.svelte';
|
||||
import { closeIcon } from '../constants';
|
||||
|
||||
let isOpen = false;
|
||||
|
||||
$: iconProps = !isOpen ? {
|
||||
class: undefined,
|
||||
skeleton: false,
|
||||
render: Menu20,
|
||||
title: 'Open Menu',
|
||||
tabIndex: 0,
|
||||
focusable: false,
|
||||
style: undefined
|
||||
} : closeIcon;
|
||||
</script>
|
||||
|
||||
<button
|
||||
aria-label={ariaLabel}
|
||||
class={cx('--header__action', '--header__menu-trigger', '--header__menu-toggle')}
|
||||
title="Open menu"
|
||||
type="button"
|
||||
on:click={() => isOpen = !isOpen}>
|
||||
<Icon {...iconProps} />
|
||||
</button>
|
Loading…
Add table
Add a link
Reference in a new issue