From f3e1bd8c47d11442b73967de00cde25ead0750d8 Mon Sep 17 00:00:00 2001 From: lukicenturi Date: Thu, 14 Dec 2023 19:13:56 +0700 Subject: [PATCH] fix(Chip): rename prop 'label' to 'tile' --- example/src/views/ChipView.vue | 24 ++++++++++++------------ src/components/chips/Chip.stories.ts | 6 +++--- src/components/chips/Chip.vue | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/example/src/views/ChipView.vue b/example/src/views/ChipView.vue index da7ee5a..599da9b 100644 --- a/example/src/views/ChipView.vue +++ b/example/src/views/ChipView.vue @@ -119,42 +119,42 @@ const chips = ref([ color: 'primary', variant: 'filled', closeable: false, - label: true, + tile: true, }, { disabled: false, color: 'secondary', variant: 'filled', closeable: false, - label: true, + tile: true, }, { disabled: false, color: 'error', variant: 'filled', closeable: false, - label: true, + tile: true, }, { disabled: false, color: 'warning', variant: 'filled', closeable: false, - label: true, + tile: true, }, { disabled: false, color: 'info', variant: 'filled', closeable: false, - label: true, + tile: true, }, { disabled: false, color: 'success', variant: 'filled', closeable: false, - label: true, + tile: true, }, { @@ -162,7 +162,7 @@ const chips = ref([ color: 'primary', variant: 'filled', closeable: false, - label: true, + tile: true, clickable: true, }, { @@ -170,7 +170,7 @@ const chips = ref([ color: 'secondary', variant: 'filled', closeable: false, - label: true, + tile: true, clickable: true, }, { @@ -178,7 +178,7 @@ const chips = ref([ color: 'error', variant: 'filled', closeable: false, - label: true, + tile: true, clickable: true, }, { @@ -186,7 +186,7 @@ const chips = ref([ color: 'warning', variant: 'filled', closeable: false, - label: true, + tile: true, clickable: true, }, { @@ -194,7 +194,7 @@ const chips = ref([ color: 'info', variant: 'filled', closeable: false, - label: true, + tile: true, clickable: true, }, { @@ -202,7 +202,7 @@ const chips = ref([ color: 'success', variant: 'filled', closeable: false, - label: true, + tile: true, clickable: true, }, { diff --git a/src/components/chips/Chip.stories.ts b/src/components/chips/Chip.stories.ts index a83de55..e6b08b3 100644 --- a/src/components/chips/Chip.stories.ts +++ b/src/components/chips/Chip.stories.ts @@ -31,7 +31,7 @@ const meta: Meta = { tags: ['autodocs'], render, argTypes: { - label: { control: 'boolean' }, + tile: { control: 'boolean' }, children: { control: 'string' }, prepend: { control: 'text' }, clickable: { control: 'boolean' }, @@ -72,10 +72,10 @@ export const Default: Story = { }, }; -export const Label: Story = { +export const Tile: Story = { args: { children: 'Chip', - label: true, + tile: true, variant: 'filled', closeable: false, disabled: false, diff --git a/src/components/chips/Chip.vue b/src/components/chips/Chip.vue index c8aa983..00606cd 100644 --- a/src/components/chips/Chip.vue +++ b/src/components/chips/Chip.vue @@ -6,7 +6,7 @@ import Icon from '@/components/icons/Icon.vue'; import { type RuiIcons } from '~/src'; export interface Props { - label?: boolean; + tile?: boolean; clickable?: boolean; closeable?: boolean; disabled?: boolean; @@ -23,7 +23,7 @@ defineOptions({ }); const props = withDefaults(defineProps(), { - label: false, + tile: false, size: 'md', color: 'grey', clickable: false, @@ -76,7 +76,7 @@ const style: ComputedRef> = computed(() => { css[variant ?? ''], { [css.disabled]: disabled, - [css.label]: label, + [css.tile]: tile, [css.readonly]: !clickable, }, ]" @@ -119,7 +119,7 @@ const style: ComputedRef> = computed(() => { @apply inline-flex items-center justify-between rounded-full px-1.5 py-[0.25rem] transition-all cursor-default; @apply max-w-full truncate; - &.label { + &.tile { @apply rounded-sm; }