Skip to content

Commit a42a176

Browse files
committed
feat: update Copyable component tooltip for improved accessibility and styling
1 parent 3d81d8d commit a42a176

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

src/components/copyable/__test__/__snapshots__/Copyable.test.tsx.snap

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@ exports[`Copyable Component > should match snapshot 1`] = `
1414
Text to copy
1515
</p>
1616
<div
17-
class="relative w-max ml-6"
18-
style="line-height: 0;"
17+
class="relative flex w-max items-center ml-6"
18+
data-testid="tooltip-container"
1919
>
2020
<div
21-
class="pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 flex items-center flex-col-reverse drop-shadow-tooltip transition-all duration-150 scale-50 opacity-0"
21+
aria-hidden="true"
22+
class="absolute pointer-events-none top-full left-1/2 -translate-x-1/2 mt-1.5 flex items-center flex-col-reverse drop-shadow-tooltip transition-all duration-150 scale-50 opacity-0"
23+
id=":r0:"
24+
role="tooltip"
2225
>
2326
<div
24-
class="w-max rounded-lg bg-gray-90 px-4 py-1.5 text-center dark:bg-gray-5"
27+
class="w-max rounded-lg bg-gray-90 px-4 py-1.5 text-center dark:bg-gray-10"
2528
>
26-
<p
29+
<span
2730
class="text-base text-white"
2831
>
2932
Copy to clipboard
30-
</p>
33+
</span>
3134
</div>
3235
<div
33-
class="bg-gray-90 dark:bg-gray-5 h-1.5 w-4"
36+
class="bg-gray-90 dark:bg-gray-10 h-1.5 w-4"
3437
data-testid="tooltip-arrow"
3538
style="clip-path: polygon(50% 0%, 0% 100%, 100% 100%);"
3639
/>
@@ -63,23 +66,26 @@ exports[`Copyable Component > should match snapshot 1`] = `
6366
Text to copy
6467
</p>
6568
<div
66-
class="relative w-max ml-6"
67-
style="line-height: 0;"
69+
class="relative flex w-max items-center ml-6"
70+
data-testid="tooltip-container"
6871
>
6972
<div
70-
class="pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 flex items-center flex-col-reverse drop-shadow-tooltip transition-all duration-150 scale-50 opacity-0"
73+
aria-hidden="true"
74+
class="absolute pointer-events-none top-full left-1/2 -translate-x-1/2 mt-1.5 flex items-center flex-col-reverse drop-shadow-tooltip transition-all duration-150 scale-50 opacity-0"
75+
id=":r0:"
76+
role="tooltip"
7177
>
7278
<div
73-
class="w-max rounded-lg bg-gray-90 px-4 py-1.5 text-center dark:bg-gray-5"
79+
class="w-max rounded-lg bg-gray-90 px-4 py-1.5 text-center dark:bg-gray-10"
7480
>
75-
<p
81+
<span
7682
class="text-base text-white"
7783
>
7884
Copy to clipboard
79-
</p>
85+
</span>
8086
</div>
8187
<div
82-
class="bg-gray-90 dark:bg-gray-5 h-1.5 w-4"
88+
class="bg-gray-90 dark:bg-gray-10 h-1.5 w-4"
8389
data-testid="tooltip-arrow"
8490
style="clip-path: polygon(50% 0%, 0% 100%, 100% 100%);"
8591
/>

0 commit comments

Comments
 (0)