mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
feat(uishell): make component based
This commit is contained in:
parent
ab6634a692
commit
e24de4e797
24 changed files with 172 additions and 1261 deletions
24
src/components/UIShell/SideNav/SideNavLink.svelte
Normal file
24
src/components/UIShell/SideNav/SideNavLink.svelte
Normal file
|
@ -0,0 +1,24 @@
|
|||
<script>
|
||||
export let href = undefined;
|
||||
export let text = undefined;
|
||||
export let icon = undefined;
|
||||
export let isSelected = false;
|
||||
|
||||
import { cx } from '../../../lib';
|
||||
import Icon from '../../Icon/Icon.svelte';
|
||||
</script>
|
||||
|
||||
<li class={cx('--side-nav__item')}>
|
||||
<a
|
||||
{href}
|
||||
class={cx('--side-nav__link', isSelected && '--side-nav__link--current')}
|
||||
aria-current={isSelected ? 'page' : ''}
|
||||
on:click>
|
||||
<div class={cx('--side-nav__icon', '--side-nav__icon--small')}>
|
||||
{#if icon}
|
||||
<Icon {...icon} />
|
||||
{/if}
|
||||
</div>
|
||||
<span class={cx('--side-nav__link-text')}>{text}</span>
|
||||
</a>
|
||||
</li>
|
Loading…
Add table
Add a link
Reference in a new issue