feat(button-skeleton): add size prop consistent with Button

This commit is contained in:
Eric Liu 2020-10-15 05:31:22 -07:00
commit 6d48ff38cb
5 changed files with 33 additions and 9 deletions

View file

@ -5,6 +5,12 @@
*/
export let href = undefined;
/**
* Specify the size of button skeleton
* @type {"default" | "field" | "small"} [size="default"]
*/
export let size = "default";
/**
* Set to `true` to use the small variant
* @type {boolean} [small=false]
@ -19,7 +25,8 @@
role="button"
class:bx--skeleton="{true}"
class:bx--btn="{true}"
class:bx--btn--sm="{small}"
class:bx--btn--field="{size === 'field'}"
class:bx--btn--sm="{size === 'small' || small}"
{...$$restProps}
on:click
on:mouseover
@ -32,7 +39,8 @@
<div
class:bx--skeleton="{true}"
class:bx--btn="{true}"
class:bx--btn--sm="{small}"
class:bx--btn--field="{size === 'field'}"
class:bx--btn--sm="{size === 'small' || small}"
{...$$restProps}
on:click
on:mouseover

View file

@ -123,7 +123,7 @@
{#if skeleton}
<ButtonSkeleton
href="{href}"
small="{size === 'small'}"
size="{size}"
{...$$restProps}
style="{hasIconOnly && 'width: 3rem;'}"
on:click