mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
refactor(components): remove exported "props"
Closes #17 - Forward events - Adds style prop, removes exported props
This commit is contained in:
parent
94a11920bd
commit
1286b9901d
31 changed files with 120 additions and 105 deletions
|
@ -3,14 +3,13 @@
|
|||
export { className as class };
|
||||
export let href = undefined;
|
||||
export let isCurrentPage = false;
|
||||
export let props = {};
|
||||
export let style = undefined;
|
||||
|
||||
import { cx } from '../../lib';
|
||||
import Link from '../Link';
|
||||
|
||||
const ariaCurrent = $$props['aria-current'];
|
||||
|
||||
$: _class = cx(
|
||||
const _class = cx(
|
||||
'--breadcrumb-item',
|
||||
isCurrentPage && ariaCurrent !== 'page' && '--breadcrumb-item--current',
|
||||
className
|
||||
|
@ -18,13 +17,13 @@
|
|||
</script>
|
||||
|
||||
{#if href}
|
||||
<li class={_class} {...props}>
|
||||
<li on:click on:mouseover on:mouseenter on:mouseleave class={_class} {style}>
|
||||
<Link {href} aria-current={ariaCurrent}>
|
||||
<slot />
|
||||
</Link>
|
||||
</li>
|
||||
{:else}
|
||||
<li class={_class} {...props}>
|
||||
<li on:click on:mouseover on:mouseenter on:mouseleave class={_class} {style}>
|
||||
<slot props={{ 'aria-current': ariaCurrent, class: cx('--link') }} />
|
||||
</li>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue