11<template >
2- <button
3- type =" button"
4- :class =" buttonTV({ size: props.size, variant: props.variant, class: props.class })"
5- @click =" (e) => $emit('click', e)"
6- >
7- <LeftArrowIcon v-if =" $props.quickIcon == 'left-arrow'" />
8- <CircleFilledIcon v-if =" $props.quickIcon == 'center'" />
9- <RightArrowIcon v-if =" $props.quickIcon == 'right-arrow'" />
2+ <button type =" button" :class =" button({ class: $props.class })" @click =" (e) => $emit('click', e)" >
3+ <Icon name =" ep:arrow-left-bold" v-if =" $props.quickIcon == 'left-arrow'" :class =" icon()" />
4+ <Icon name =" ph:circle-fill" v-if =" $props.quickIcon == 'center'" :class =" icon()" />
5+ <Icon name =" ep:arrow-right-bold" v-if =" $props.quickIcon == 'right-arrow'" :class =" icon()" />
106 <slot />
117 </button >
128</template >
1511import { tv , type VariantProps } from ' tailwind-variants'
1612
1713const buttonTV = tv ({
18- base: ' inline-flex flex-row items-center justify-center whitespace-nowrap rounded-lg text-sm text-primary-900 transition-colors' ,
14+ slots: {
15+ button:
16+ ' inline-flex flex-row items-center justify-center whitespace-nowrap rounded-lg text-sm text-primary-900 transition-colors' ,
17+ icon: ' h-full w-full'
18+ },
1919 variants: {
2020 variant: {
21- solid: ' bg-transparent hover:bg-primary-600 active:bg-primary-700' ,
22- hidden: ' pointer-events-none bg-transparent hover:bg-transparent'
21+ solid: {
22+ button: ' bg-transparent hover:bg-primary-600 active:bg-primary-700'
23+ },
24+ hidden: {
25+ button: ' pointer-events-none bg-transparent hover:bg-transparent'
26+ }
2327 },
2428 size: {
25- sm: ' ' ,
26- md: ' h-7 w-7 p-1' ,
27- lg: ' '
29+ sm: {
30+ button: ' '
31+ },
32+ md: {
33+ button: ' h-7 w-7 p-1'
34+ },
35+ lg: {
36+ button: ' '
37+ }
2838 }
2939 },
3040 defaultVariants: {
@@ -45,4 +55,6 @@ type Props = {
4555
4656defineEmits ([' click' ])
4757const props = defineProps <Props >()
58+
59+ const { button, icon } = buttonTV ({ size: props .size , variant: props .variant })
4860 </script >
0 commit comments