Skip to content

Commit 26232b3

Browse files
jonrohanjoshblackprimer[bot]
authored
chore(_VisuallyHidden): Convert internal component _VisuallyHidden to CSS module styling (#6083)
Co-authored-by: Josh Black <[email protected]> Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com>
1 parent 0cb9a5d commit 26232b3

File tree

8 files changed

+470
-853
lines changed

8 files changed

+470
-853
lines changed

.changeset/smooth-steaks-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': minor
3+
---
4+
5+
Convert `_VisuallyHidden` internal component to CSS modules

packages/react/src/Autocomplete/__snapshots__/Autocomplete.test.tsx.snap

Lines changed: 16 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,8 @@ exports[`snapshots renders a custom empty state message 1`] = `
2727
type="text"
2828
/>
2929
</span>,
30-
.c0 {
31-
position: absolute;
32-
width: 1px;
33-
height: 1px;
34-
padding: 0;
35-
margin: -1px;
36-
overflow: hidden;
37-
-webkit-clip: rect(0,0,0,0);
38-
clip: rect(0,0,0,0);
39-
white-space: nowrap;
40-
border-width: 0;
41-
}
42-
43-
<span
44-
className="c0"
30+
<span
31+
className="InternalVisuallyHidden"
4532
>
4633
<div>
4734
<div
@@ -81,21 +68,8 @@ exports[`snapshots renders a loading state 1`] = `
8168
type="text"
8269
/>
8370
</span>,
84-
.c0 {
85-
position: absolute;
86-
width: 1px;
87-
height: 1px;
88-
padding: 0;
89-
margin: -1px;
90-
overflow: hidden;
91-
-webkit-clip: rect(0,0,0,0);
92-
clip: rect(0,0,0,0);
93-
white-space: nowrap;
94-
border-width: 0;
95-
}
96-
97-
<span
98-
className="c0"
71+
<span
72+
className="InternalVisuallyHidden"
9973
>
10074
<div
10175
className="SpinnerWrapper"
@@ -168,21 +142,8 @@ exports[`snapshots renders a menu that contains an item to add to the menu 1`] =
168142
type="text"
169143
/>
170144
</span>,
171-
.c0 {
172-
position: absolute;
173-
width: 1px;
174-
height: 1px;
175-
padding: 0;
176-
margin: -1px;
177-
overflow: hidden;
178-
-webkit-clip: rect(0,0,0,0);
179-
clip: rect(0,0,0,0);
180-
white-space: nowrap;
181-
border-width: 0;
182-
}
183-
184-
<span
185-
className="c0"
145+
<span
146+
className="InternalVisuallyHidden"
186147
>
187148
<div>
188149
<ul
@@ -668,21 +629,8 @@ exports[`snapshots renders a multiselect input 1`] = `
668629
type="text"
669630
/>
670631
</span>,
671-
.c0 {
672-
position: absolute;
673-
width: 1px;
674-
height: 1px;
675-
padding: 0;
676-
margin: -1px;
677-
overflow: hidden;
678-
-webkit-clip: rect(0,0,0,0);
679-
clip: rect(0,0,0,0);
680-
white-space: nowrap;
681-
border-width: 0;
682-
}
683-
684-
<span
685-
className="c0"
632+
<span
633+
className="InternalVisuallyHidden"
686634
>
687635
<div>
688636
<ul
@@ -1106,21 +1054,8 @@ exports[`snapshots renders a multiselect input with selected menu items 1`] = `
11061054
type="text"
11071055
/>
11081056
</span>,
1109-
.c0 {
1110-
position: absolute;
1111-
width: 1px;
1112-
height: 1px;
1113-
padding: 0;
1114-
margin: -1px;
1115-
overflow: hidden;
1116-
-webkit-clip: rect(0,0,0,0);
1117-
clip: rect(0,0,0,0);
1118-
white-space: nowrap;
1119-
border-width: 0;
1120-
}
1121-
1122-
<span
1123-
className="c0"
1057+
<span
1058+
className="InternalVisuallyHidden"
11241059
>
11251060
<div>
11261061
<ul
@@ -1544,21 +1479,8 @@ exports[`snapshots renders a single select input 1`] = `
15441479
type="text"
15451480
/>
15461481
</span>,
1547-
.c0 {
1548-
position: absolute;
1549-
width: 1px;
1550-
height: 1px;
1551-
padding: 0;
1552-
margin: -1px;
1553-
overflow: hidden;
1554-
-webkit-clip: rect(0,0,0,0);
1555-
clip: rect(0,0,0,0);
1556-
white-space: nowrap;
1557-
border-width: 0;
1558-
}
1559-
1560-
<span
1561-
className="c0"
1482+
<span
1483+
className="InternalVisuallyHidden"
15621484
>
15631485
<div>
15641486
<ul
@@ -2121,21 +2043,8 @@ exports[`snapshots renders with a custom text input component 1`] = `
21212043
id="customInput"
21222044
type="text"
21232045
/>,
2124-
.c0 {
2125-
position: absolute;
2126-
width: 1px;
2127-
height: 1px;
2128-
padding: 0;
2129-
margin: -1px;
2130-
overflow: hidden;
2131-
-webkit-clip: rect(0,0,0,0);
2132-
clip: rect(0,0,0,0);
2133-
white-space: nowrap;
2134-
border-width: 0;
2135-
}
2136-
2137-
<span
2138-
className="c0"
2046+
<span
2047+
className="InternalVisuallyHidden"
21392048
>
21402049
<div>
21412050
<ul
@@ -2719,21 +2628,8 @@ exports[`snapshots renders with an input value 1`] = `
27192628
type="text"
27202629
/>
27212630
</span>,
2722-
.c0 {
2723-
position: absolute;
2724-
width: 1px;
2725-
height: 1px;
2726-
padding: 0;
2727-
margin: -1px;
2728-
overflow: hidden;
2729-
-webkit-clip: rect(0,0,0,0);
2730-
clip: rect(0,0,0,0);
2731-
white-space: nowrap;
2732-
border-width: 0;
2733-
}
2734-
2735-
<span
2736-
className="c0"
2631+
<span
2632+
className="InternalVisuallyHidden"
27372633
>
27382634
<div>
27392635
<div

packages/react/src/CircleBadge/__snapshots__/CircleBadge.test.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
exports[`CircleBadge > respects the inline prop 1`] = `
44
<div
5-
class="sc-ikkxIA jhJVVm"
5+
class="sc-gFqAkR SqWoH"
66
/>
77
`;
88

99
exports[`CircleBadge > respects the variant prop 1`] = `
1010
<div
11-
class="sc-ikkxIA eMrppW"
11+
class="sc-gFqAkR ebkeDz"
1212
/>
1313
`;
1414

1515
exports[`CircleBadge > uses the size prop to override the variant prop 1`] = `
1616
<div
17-
class="sc-ikkxIA dkwGym"
17+
class="sc-gFqAkR kqQQpr"
1818
size="20"
1919
/>
2020
`;

0 commit comments

Comments
 (0)