mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 20:09:35 +00:00
feat(tag): support small size variant
This commit is contained in:
parent
6f7acd224f
commit
ce3a34ac9c
7 changed files with 56 additions and 5 deletions
|
@ -7,6 +7,9 @@
|
|||
*/
|
||||
export let type = undefined;
|
||||
|
||||
/** @type {"sm" | "default"} */
|
||||
export let size = "default";
|
||||
|
||||
/** Set to `true` to use filterable variant */
|
||||
export let filter = false;
|
||||
|
||||
|
@ -38,6 +41,7 @@
|
|||
|
||||
{#if skeleton}
|
||||
<TagSkeleton
|
||||
size="{size}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
|
@ -52,6 +56,7 @@
|
|||
class:bx--tag="{true}"
|
||||
class:bx--tag--disabled="{disabled}"
|
||||
class:bx--tag--filter="{filter}"
|
||||
class:bx--tag--sm="{size === 'sm'}"
|
||||
class:bx--tag--red="{type === 'red'}"
|
||||
class:bx--tag--magenta="{type === 'magenta'}"
|
||||
class:bx--tag--purple="{type === 'purple'}"
|
||||
|
@ -89,6 +94,7 @@
|
|||
id="{id}"
|
||||
class:bx--tag="{true}"
|
||||
class:bx--tag--disabled="{disabled}"
|
||||
class:bx--tag--sm="{size === 'sm'}"
|
||||
class:bx--tag--red="{type === 'red'}"
|
||||
class:bx--tag--magenta="{type === 'magenta'}"
|
||||
class:bx--tag--purple="{type === 'purple'}"
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<script>
|
||||
/** @type {"sm" | "default"} */
|
||||
export let size = "default";
|
||||
</script>
|
||||
|
||||
<span
|
||||
class:bx--tag="{true}"
|
||||
class:bx--tag--sm="{size === 'sm'}"
|
||||
class:bx--skeleton="{true}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue