Skip to content

Commit

Permalink
fix: renaming tag to chip
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgoud committed Oct 4, 2023
1 parent 0a33c06 commit 5a9eb32
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 148 deletions.
8 changes: 8 additions & 0 deletions packages/components/chip/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { withInstall } from '@puik/utils'

import Chip from './src/chip.vue'

export const PuikChip = withInstall(Chip)
export default PuikChip

export * from './src/chip'
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { buildProps } from '@puik/utils'
import type { PuikTooltipPosition } from '@puik/components'
import type { ExtractPropTypes, PropType } from 'vue'
import type Tag from './tag.vue'
import type Chip from './chip.vue'

export const tagColorsVariants = [
export const chipColorsVariants = [
'neutral',
'blue',
'yellow',
'green',
'purple',
] as const

export const tagSizeVariants = ['default', 'small'] as const
export const chipSizeVariants = ['default', 'small'] as const

export type PuikTagColorVariant = (typeof tagColorsVariants)[number]
export type PuikTagSizeVariant = (typeof tagSizeVariants)[number]
export type PuikChipColorVariant = (typeof chipColorsVariants)[number]
export type PuikChipSizeVariant = (typeof chipSizeVariants)[number]

export const tagProps = buildProps({
export const chipProps = buildProps({
id: {
type: String,
required: true,
Expand Down Expand Up @@ -59,6 +59,6 @@ export const tagProps = buildProps({
},
} as const)

export type TagProps = ExtractPropTypes<typeof tagProps>
export type ChipProps = ExtractPropTypes<typeof chipProps>

export type TagInstance = InstanceType<typeof Tag>
export type ChipInstance = InstanceType<typeof Chip>
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<div
:id="id"
:class="[
`puik-tag puik-tag--${variant as PuikTagColorVariant} puik-tag--${size as PuikTagSizeVariant}`,
{ 'puik-tag--disabled': disabled },
`puik-chip puik-chip--${variant as PuikChipColorVariant} puik-chip--${size as PuikChipSizeVariant}`,
{ 'puik-chip--disabled': disabled },
]"
>
<PuikIcon v-if="icon && icon != ''" :icon="icon" class="puik-tag__icon" />
<div class="puik-tag__content">
<PuikIcon v-if="icon && icon != ''" :icon="icon" class="puik-chip__icon" />
<div class="puik-chip__content">
<puik-tooltip
v-if="content?.length >= 30"
:position="(tooltipPosition as PuikTooltipPosition)"
Expand All @@ -21,7 +21,7 @@
<PuikIcon
v-if="closeable"
icon="close"
class="puik-tag__close"
class="puik-chip__close"
@click="disabled ? '' : handleCloseEvent()"
/>
</div>
Expand All @@ -31,16 +31,16 @@
import { PuikIcon } from '@puik/components/icon'
import { PuikTooltip } from '@puik/components/tooltip'
import {
tagProps,
type PuikTagSizeVariant,
type PuikTagColorVariant,
} from './tag'
chipProps,
type PuikChipSizeVariant,
type PuikChipColorVariant,
} from './chip'
import type { PuikTooltipPosition } from '@puik/components/tooltip'
defineOptions({
name: 'PuikTag',
name: 'PuikChip',
})
const props = defineProps(tagProps)
const props = defineProps(chipProps)
const emit = defineEmits(['close'])
const handleCloseEvent = () => {
Expand Down
Loading

0 comments on commit 5a9eb32

Please sign in to comment.