@@ -13,7 +13,13 @@ import {
1313 Download ,
1414} from '@/atoms/Icons'
1515
16+ type XOR < T , U > = T | U extends object
17+ ? ( T extends U ? never : T ) | ( U extends T ? never : U )
18+ : T | U
1619export interface propsTertiaryBtn {
20+ activeWhenPress ?: boolean
21+ id ?: string
22+ iconCustom ?: JSX . Element
1723 iconStatus ?:
1824 | 'answer'
1925 | 'ahead'
@@ -26,35 +32,44 @@ export interface propsTertiaryBtn {
2632 | 'record'
2733 | 'download'
2834 | 'noIcon'
29- children ?: React . ReactNode
30- rightIcon ?: boolean
31- iconCustom ?: JSX . Element
32- withoutColor ?: boolean
3335 m ?: string
34- type ?: 'button' | 'submit' | 'reset'
35- tabIndex ?: number
36- id ?: string
37- activeWhenPress ?: boolean
3836 onClick ?: ( e : React . MouseEvent < HTMLElement > ) => void
3937 onMouseEnter ?: ( e : React . MouseEvent < HTMLElement > ) => void
4038 onMouseLeave ?: ( e : React . MouseEvent < HTMLElement > ) => void
39+ rightIcon ?: boolean
40+ type ?: 'button' | 'submit' | 'reset'
41+ tabIndex ?: number
42+ withoutColor ?: boolean
43+ }
44+
45+ interface ButtonWithTextProps extends propsTertiaryBtn {
46+ children : React . ReactNode
47+ ariaLabel ?: string
4148}
4249
50+ interface ButtonWithoutTextProps extends propsTertiaryBtn {
51+ children ?: React . ReactNode
52+ ariaLabel : string
53+ }
54+
55+ type ButtonProps = XOR < ButtonWithTextProps , ButtonWithoutTextProps >
56+
4357export function BtnTertiary ( {
58+ ariaLabel,
59+ activeWhenPress = false ,
4460 children,
61+ id,
4562 iconStatus = 'multimedia' ,
4663 iconCustom,
47- rightIcon,
48- withoutColor = false ,
4964 m = '0' ,
50- type = 'button' ,
51- tabIndex,
52- id,
53- activeWhenPress = false ,
5465 onClick,
5566 onMouseEnter,
5667 onMouseLeave,
57- } : propsTertiaryBtn ) : JSX . Element {
68+ rightIcon,
69+ type = 'button' ,
70+ tabIndex,
71+ withoutColor = false ,
72+ } : ButtonProps ) : JSX . Element {
5873 const gray = vars ( 'colors-neutral-gray' )
5974 const blue = vars ( 'colors-main-deepSkyBlue' )
6075 const white = vars ( 'colors-neutral-white' )
@@ -87,30 +102,32 @@ export function BtnTertiary({
87102
88103 return (
89104 < Button
105+ aria-label = { ariaLabel }
90106 id = { id }
107+ role = "button"
91108 type = { type }
92109 tabIndex = { tabIndex }
93- height = "24px"
94110 background = "transparent"
111+ borderRadius = "12px"
112+ color = { gray }
95113 fontFamily = "Roboto"
96114 fontStyle = "normal"
97115 fontWeight = "500"
98116 fontSize = "14px"
99- lineHeight = "16px"
100- textDecorationLine = "underline"
101- borderRadius = "12px"
102117 gap = "0.5rem"
103- paddingTop = { vars ( 'space-xxs' ) }
104- paddingBottom = { vars ( 'space-xxs' ) }
105- paddingLeft = { vars ( 'space-xs' ) }
106- paddingRight = { vars ( 'space-xs' ) }
107- color = { gray }
108- rightIcon = { rIcon }
118+ height = "24px"
119+ lineHeight = "16px"
109120 leftIcon = { lIcon }
121+ rightIcon = { rIcon }
110122 m = { m }
111123 onClick = { onClick }
112124 onMouseEnter = { onMouseEnter }
113125 onMouseLeave = { onMouseLeave }
126+ paddingTop = { vars ( 'space-xxs' ) }
127+ paddingBottom = { vars ( 'space-xxs' ) }
128+ paddingLeft = { vars ( 'space-xs' ) }
129+ paddingRight = { vars ( 'space-xs' ) }
130+ textDecorationLine = "underline"
114131 _hover = { {
115132 color : `${ blue } ` ,
116133 } }
0 commit comments