mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 11:11:25 +00:00
refactor: update/fix JSDoc props
This commit is contained in:
parent
3c04f122b0
commit
d38e6d8be6
204 changed files with 992 additions and 2359 deletions
60
src/Accordion/AccordionSkeleton.svelte
Normal file
60
src/Accordion/AccordionSkeleton.svelte
Normal file
|
@ -0,0 +1,60 @@
|
|||
<script>
|
||||
/** Specify the number of accordion items to render */
|
||||
export let count = 4;
|
||||
|
||||
/**
|
||||
* Specify alignment of accordion item chevron icon
|
||||
* @type {"start" | "end"}
|
||||
*/
|
||||
export let align = "end";
|
||||
|
||||
/**
|
||||
* Specify the size of the accordion
|
||||
* @type {"sm" | "xl"}
|
||||
*/
|
||||
export let size = undefined;
|
||||
|
||||
/** Set to `false` to close the first accordion item */
|
||||
export let open = true;
|
||||
|
||||
import ChevronRight16 from "carbon-icons-svelte/lib/ChevronRight16";
|
||||
import { SkeletonText } from "../SkeletonText";
|
||||
</script>
|
||||
|
||||
<ul
|
||||
class:bx--accordion="{true}"
|
||||
class:bx--skeleton="{true}"
|
||||
{...$$restProps}
|
||||
class="bx--accordion--{align}
|
||||
{size && `bx--accordion--${size}`}
|
||||
{$$restProps.class}"
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
{#if open}
|
||||
<li
|
||||
class:bx--accordion__item="{true}"
|
||||
class:bx--accordion__item--active="{true}"
|
||||
>
|
||||
<span class:bx--accordion__heading="{true}">
|
||||
<ChevronRight16 class="bx--accordion__arrow" />
|
||||
<SkeletonText class="bx--accordion__title" />
|
||||
</span>
|
||||
<div class="bx--accordion__content">
|
||||
<SkeletonText width="90%" />
|
||||
<SkeletonText width="80%" />
|
||||
<SkeletonText width="95%" />
|
||||
</div>
|
||||
</li>
|
||||
{/if}
|
||||
{#each Array.from({ length: open ? count - 1 : count }, (_, i) => i) as item, i (item)}
|
||||
<li class="bx--accordion__item">
|
||||
<span class="bx--accordion__heading">
|
||||
<ChevronRight16 class="bx--accordion__arrow" />
|
||||
<SkeletonText class="bx--accordion__title" />
|
||||
</span>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
Loading…
Add table
Add a link
Reference in a new issue