mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
feat(button-skeleton): add size prop consistent with Button
This commit is contained in:
parent
6d12d7e6e2
commit
6d48ff38cb
5 changed files with 33 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
{#if skeleton}
|
||||
<ButtonSkeleton
|
||||
href="{href}"
|
||||
small="{size === 'small'}"
|
||||
size="{size}"
|
||||
{...$$restProps}
|
||||
style="{hasIconOnly && 'width: 3rem;'}"
|
||||
on:click
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue