11<template >
22 <button
33 style =" width : fit-content "
4- class =" flex items-center border rounded-sm gap-8px focus:border-indigo-600 focus:outline-transparent "
4+ class =" flex items-center border rounded gap-8px hocus-default "
55 :class =" classes"
66 >
77 <span
88 v-if =" prefixIcon || $slots.prefix"
9- :class =" iconClasses"
10- class =" justify-self-start"
9+ class =" justify-self-start flex items-center"
1110 >
1211 <slot name =" prefix" >
1312 <Icon
2120 </span >
2221 <span
2322 v-if =" suffixIcon || $slots.suffix"
24- :class =" iconClasses"
25- class =" justify-self-end"
23+ class =" justify-self-start flex items-center"
2624 >
2725 <slot name =" suffix" >
2826 <Icon
@@ -52,29 +50,23 @@ import { computed, useAttrs } from 'vue'
5250import type { ButtonHTMLAttributes , FunctionalComponent , SVGAttributes } from ' vue'
5351
5452const VariantClassesTable = {
55- primary: ' border-indigo-600 bg-indigo-600 text-white' ,
56- outline: ' border-gray-200 text-indigo-600 bg-white ' ,
53+ primary: ' border-indigo-500 bg-indigo-600 text-white' ,
54+ outline: ' border-gray-100 text-indigo-600' ,
5755 link: ' border-transparent text-indigo-600' ,
5856 text: ' border-0' ,
5957}
6058
6159const SizeClassesTable = {
62- sm: ' px-1 py-1 text-xs' ,
63- md: ' px-2 py-1 text-sm' ,
64- lg: ' px-4 py-2 text-sm' ,
65- xl: ' px-6 py-3 text-lg' ,
66- }
67-
68- const IconClassesTable = {
69- md: ' min-h-1.25em min-w-1.25em max-h-1.25em max-w-1.25em' ,
70- lg: ' min-h-2em min-w-2em max-h-2em max-w-2em' ,
71- xl: ' min-h-2.5em min-w-2.5em max-w-2.5em max-h-2.5em ' ,
60+ sm: ' px-6px py-2px text-14px' ,
61+ md: ' px-12px py-6px text-14px' ,
62+ lg: ' px-16px py-8px' ,
63+ ' lg-wide' : ' px-32px py-8px' ,
7264}
7365
7466const props = defineProps <{
7567 prefixIcon? : FunctionalComponent <SVGAttributes >
7668 suffixIcon? : FunctionalComponent <SVGAttributes >
77- size? : ' xs ' | ' sm' | ' md' | ' lg' | ' xl '
69+ size? : ' sm' | ' md' | ' lg' | ' lg-wide '
7870 variant? : ' primary' | ' outline' | ' link' | ' text'
7971 prefixIconClass? : string
8072 suffixIconClass? : string
@@ -85,8 +77,6 @@ const attrs = useAttrs() as ButtonHTMLAttributes
8577const variantClasses = VariantClassesTable [props .variant || ' primary' ]
8678const sizeClasses = SizeClassesTable [props .size || ' md' ]
8779
88- const iconClasses = [' flex' , ' items-center' , IconClassesTable [props .size || ' md' ]]
89-
9080const classes = computed (() => {
9181 return [
9282 variantClasses ,
0 commit comments