File tree Expand file tree Collapse file tree 7 files changed +31
-9
lines changed Expand file tree Collapse file tree 7 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @devtron-labs/devtron-fe-common-lib" ,
3
- "version" : " 0.3.3 " ,
3
+ "version" : " 0.3.4 " ,
4
4
"description" : " Supporting common component library" ,
5
5
"type" : " module" ,
6
6
"main" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const ButtonElement = ({
28
28
| 'dataTestId'
29
29
| 'isLoading'
30
30
| 'ariaLabel'
31
+ | 'showAriaLabelInTippy'
31
32
> & {
32
33
className : string
33
34
'data-testid' : ButtonProps [ 'dataTestId' ]
@@ -135,6 +136,7 @@ const Button = ({
135
136
tooltipProps = { } ,
136
137
icon = null ,
137
138
ariaLabel = null ,
139
+ showAriaLabelInTippy = true ,
138
140
...props
139
141
} : ButtonProps ) => {
140
142
const isDisabled = disabled || isLoading
@@ -144,7 +146,8 @@ const Button = ({
144
146
} ) } `
145
147
146
148
const getTooltipProps = ( ) : TooltipProps => {
147
- if ( ! showTooltip && icon && ariaLabel ) {
149
+ // Show the aria label as tippy only if the action based tippy is not to be shown
150
+ if ( ! showTooltip && showAriaLabelInTippy && icon && ariaLabel ) {
148
151
return {
149
152
alwaysShowTippyOnHover : true ,
150
153
content : ariaLabel ,
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ export type ButtonProps = (
105
105
| {
106
106
icon ?: never
107
107
ariaLabel ?: never
108
+ showAriaLabelInTippy ?: never
108
109
/**
109
110
* Text to be displayed in the button
110
111
*/
@@ -123,6 +124,12 @@ export type ButtonProps = (
123
124
* If provided, icon button is rendered
124
125
*/
125
126
icon : ReactElement
127
+ /**
128
+ * If false, the ariaLabel is not shown in tippy
129
+ *
130
+ * @default true
131
+ */
132
+ showAriaLabelInTippy ?: boolean
126
133
/**
127
134
* Label for the icon button for accessibility.
128
135
* Shown on hover in tooltip if tippy is not provided explicitly
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export const ToastContent = ({
9
9
} : Pick < ToastProps , 'title' | 'description' | 'buttonProps' > ) => (
10
10
< div className = "flexbox-col dc__gap-8 custom-toast__content" >
11
11
< div className = "flexbox-col dc__gap-4" >
12
- < h3 className = "m-0 fs-13 fw-6 lh-20 cn-0 dc__truncate " > { title } </ h3 >
12
+ < h3 className = "m-0 fs-13 fw-6 lh-20 cn-0 dc__ellipsis-right__2nd-line " > { title } </ h3 >
13
13
< p className = "fs-12 fw-4 lh-18 m-0 dc__truncate--clamp-6" > { description } </ p >
14
14
</ div >
15
15
{ buttonProps && (
Original file line number Diff line number Diff line change @@ -27,8 +27,9 @@ export const TOAST_BASE_CONFIG: ToastContainerProps = {
27
27
dataTestId = "close-toast"
28
28
ariaLabel = "Close toast"
29
29
size = { ComponentSizeType . xs }
30
- variant = { ButtonVariantType . text }
30
+ variant = { ButtonVariantType . borderLess }
31
31
style = { ButtonStyleType . neutral }
32
+ showAriaLabelInTippy = { false }
32
33
/>
33
34
</ div >
34
35
) ,
Original file line number Diff line number Diff line change 1
1
@import ' react-toastify/dist/ReactToastify.css' ;
2
2
3
3
.Toastify {
4
+ & __toast {
5
+ gap : 8px ;
6
+ }
7
+
4
8
& __toast-container {
5
9
padding : 0 ;
6
10
width : 280px ;
63
67
64
68
// Custom styling for close btn
65
69
& __close-btn {
66
- svg {
67
- use {
68
- fill : var (--N0 ) !important ;
70
+ button {
71
+ svg {
72
+ use {
73
+ fill : var (--N0 ) !important ;
74
+ }
75
+ }
76
+
77
+ & :hover ,
78
+ & :active {
79
+ background : #fff3 !important ;
69
80
}
70
81
}
71
82
}
You can’t perform that action at this time.
0 commit comments