@@ -6,31 +6,35 @@ interface Props {
66
77defineProps <Props >()
88
9- const wrapperClasses : Record <Props [' variant' ], string > = {
9+ const WRAPPER_CLASSES : Record <Props [' variant' ], string > = {
1010 warning: ' border-amber-400/20 bg-amber-500/8' ,
1111 error: ' border-red-400/20 bg-red-500/8' ,
1212}
1313
14- const titleClasses : Record <Props [' variant' ], string > = {
14+ const TITLE_CLASSES : Record <Props [' variant' ], string > = {
1515 warning: ' text-amber-800 dark:text-amber-300' ,
1616 error: ' text-red-800 dark:text-red-300' ,
1717}
1818
19- const bodyClasses : Record <Props [' variant' ], string > = {
19+ const BODY_CLASSES : Record <Props [' variant' ], string > = {
2020 warning: ' text-amber-700 dark:text-amber-400' ,
2121 error: ' text-red-700 dark:text-red-400' ,
2222}
2323
24- const role : Record <Props [' variant' ], ' status' | ' alert' > = {
24+ const ROLES : Record <Props [' variant' ], ' status' | ' alert' > = {
2525 warning: ' status' ,
2626 error: ' alert' ,
2727}
2828 </script >
2929
3030<template >
31- <div :role =" role[variant]" class =" border rounded-md px-3 py-2.5" :class =" wrapperClasses[variant]" >
32- <p v-if =" title" class =" font-semibold mb-1" :class =" titleClasses[variant]" >{{ title }}</p >
33- <div class =" text-xs" :class =" bodyClasses[variant]" >
31+ <div
32+ :role =" ROLES[variant]"
33+ class =" border rounded-md px-3 py-2.5"
34+ :class =" WRAPPER_CLASSES[variant]"
35+ >
36+ <p v-if =" title" class =" font-semibold mb-1" :class =" TITLE_CLASSES[variant]" >{{ title }}</p >
37+ <div class =" text-xs" :class =" BODY_CLASSES[variant]" >
3438 <slot />
3539 </div >
3640 </div >
0 commit comments