mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 03:49:34 +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
47
src/Button/ButtonSkeleton.svelte
Normal file
47
src/Button/ButtonSkeleton.svelte
Normal file
|
@ -0,0 +1,47 @@
|
|||
<script>
|
||||
/**
|
||||
* Set the `href` to use an anchor link
|
||||
* @type {string}
|
||||
*/
|
||||
export let href = undefined;
|
||||
|
||||
/**
|
||||
* Specify the size of button skeleton
|
||||
* @type {"default" | "field" | "small"}
|
||||
*/
|
||||
export let size = "default";
|
||||
|
||||
/** Set to `true` to use the small variant */
|
||||
export let small = false;
|
||||
</script>
|
||||
|
||||
{#if href}
|
||||
<a
|
||||
href="{href}"
|
||||
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
|
||||
role="button"
|
||||
class:bx--skeleton="{true}"
|
||||
class:bx--btn="{true}"
|
||||
class:bx--btn--field="{size === 'field'}"
|
||||
class:bx--btn--sm="{size === 'small' || small}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
{''}
|
||||
</a>
|
||||
{:else}
|
||||
<div
|
||||
class:bx--skeleton="{true}"
|
||||
class:bx--btn="{true}"
|
||||
class:bx--btn--field="{size === 'field'}"
|
||||
class:bx--btn--sm="{size === 'small' || small}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
></div>
|
||||
{/if}
|
Loading…
Add table
Add a link
Reference in a new issue