mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(accordion): add skeleton state
This commit is contained in:
parent
fd7164a312
commit
8416b8b14d
1 changed files with 20 additions and 3 deletions
|
@ -3,9 +3,26 @@
|
||||||
export { className as class };
|
export { className as class };
|
||||||
export let style = undefined;
|
export let style = undefined;
|
||||||
|
|
||||||
|
export let skeleton = false;
|
||||||
|
export let count = 4;
|
||||||
|
export let open = true;
|
||||||
|
|
||||||
import { cx } from '../../lib';
|
import { cx } from '../../lib';
|
||||||
|
import AccordionSkeleton from './Accordion.Skeleton.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul on:click on:mouseover on:mouseenter on:mouseleave class={cx('--accordion', className)} {style}>
|
{#if skeleton}
|
||||||
|
<AccordionSkeleton {count} {open} class={className} {style} />
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#if !skeleton}
|
||||||
|
<ul
|
||||||
|
on:click
|
||||||
|
on:mouseover
|
||||||
|
on:mouseenter
|
||||||
|
on:mouseleave
|
||||||
|
class={cx('--accordion', className)}
|
||||||
|
{style}>
|
||||||
<slot />
|
<slot />
|
||||||
</ul>
|
</ul>
|
||||||
|
{/if}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue