Skip to content

Commit 4c11d28

Browse files
committed
Merge branch 'develop' into feat/replace-select-picker
2 parents f790a8b + 0291406 commit 4c11d28

File tree

6 files changed

+29
-7
lines changed

6 files changed

+29
-7
lines changed

src/Shared/Components/Button/Button.component.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const ButtonElement = ({
2828
| 'dataTestId'
2929
| 'isLoading'
3030
| 'ariaLabel'
31+
| 'showAriaLabelInTippy'
3132
> & {
3233
className: string
3334
'data-testid': ButtonProps['dataTestId']
@@ -135,6 +136,7 @@ const Button = ({
135136
tooltipProps = {},
136137
icon = null,
137138
ariaLabel = null,
139+
showAriaLabelInTippy = true,
138140
...props
139141
}: ButtonProps) => {
140142
const isDisabled = disabled || isLoading
@@ -144,7 +146,8 @@ const Button = ({
144146
})}`
145147

146148
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) {
148151
return {
149152
alwaysShowTippyOnHover: true,
150153
content: ariaLabel,

src/Shared/Components/Button/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const BUTTON_SIZE_TO_CLASS_NAME_MAP: Record<ButtonProps['size'], string>
66
[ComponentSizeType.xs]: 'px-9 py-1 fs-12 lh-20 fw-6 dc__gap-6 mw-48',
77
[ComponentSizeType.small]: 'px-9 py-3 fs-12 lh-20 fw-6 dc__gap-8 mw-48',
88
[ComponentSizeType.medium]: 'px-11 py-5 fs-13 lh-20 fw-6 dc__gap-8 mw-48',
9-
[ComponentSizeType.large]: 'px-13 py-7 fs-13 lh-20 fw-6 dc__gap-10 mw-64',
9+
[ComponentSizeType.large]: 'px-13 py-7 fs-13 lh-20 fw-6 dc__gap-8 mw-64',
1010
[ComponentSizeType.xl]: 'px-15 py-9 fs-14 lh-20 fw-6 dc__gap-12 mw-64',
1111
} as const
1212

src/Shared/Components/Button/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export type ButtonProps = (
105105
| {
106106
icon?: never
107107
ariaLabel?: never
108+
showAriaLabelInTippy?: never
108109
/**
109110
* Text to be displayed in the button
110111
*/
@@ -123,6 +124,12 @@ export type ButtonProps = (
123124
* If provided, icon button is rendered
124125
*/
125126
icon: ReactElement
127+
/**
128+
* If false, the ariaLabel is not shown in tippy
129+
*
130+
* @default true
131+
*/
132+
showAriaLabelInTippy?: boolean
126133
/**
127134
* Label for the icon button for accessibility.
128135
* Shown on hover in tooltip if tippy is not provided explicitly

src/Shared/Services/ToastManager/ToastContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const ToastContent = ({
99
}: Pick<ToastProps, 'title' | 'description' | 'buttonProps'>) => (
1010
<div className="flexbox-col dc__gap-8 custom-toast__content">
1111
<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>
1313
<p className="fs-12 fw-4 lh-18 m-0 dc__truncate--clamp-6">{description}</p>
1414
</div>
1515
{buttonProps && (

src/Shared/Services/ToastManager/constants.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ export const TOAST_BASE_CONFIG: ToastContainerProps = {
2727
dataTestId="close-toast"
2828
ariaLabel="Close toast"
2929
size={ComponentSizeType.xs}
30-
variant={ButtonVariantType.text}
30+
variant={ButtonVariantType.borderLess}
3131
style={ButtonStyleType.neutral}
32+
showAriaLabelInTippy={false}
3233
/>
3334
</div>
3435
),

src/Shared/Services/ToastManager/toastManager.scss

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
@import 'react-toastify/dist/ReactToastify.css';
22

33
.Toastify {
4+
&__toast {
5+
gap: 8px;
6+
}
7+
48
&__toast-container {
59
padding: 0;
610
width: 280px;
@@ -63,9 +67,16 @@
6367

6468
// Custom styling for close btn
6569
&__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;
6980
}
7081
}
7182
}

0 commit comments

Comments
 (0)