Skip to content

Commit ac55b51

Browse files
chore(Spinner): update isSVG prop default value
1 parent b44f6c3 commit ac55b51

File tree

4 files changed

+82
-62
lines changed

4 files changed

+82
-62
lines changed

packages/react-core/src/components/Button/__tests__/__snapshots__/Button.test.tsx.snap

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -180,22 +180,21 @@ exports[`Button isLoading 1`] = `
180180
<span
181181
class="pf-c-button__progress"
182182
>
183-
<span
183+
<svg
184184
aria-label="Contents"
185185
aria-valuetext="Loading"
186186
class="pf-c-spinner pf-m-md"
187187
role="progressbar"
188+
viewBox="0 0 100 100"
188189
>
189-
<span
190-
class="pf-c-spinner__clipper"
191-
/>
192-
<span
193-
class="pf-c-spinner__lead-ball"
190+
<circle
191+
class="pf-c-spinner__path"
192+
cx="50"
193+
cy="50"
194+
fill="none"
195+
r="45"
194196
/>
195-
<span
196-
class="pf-c-spinner__tail-ball"
197-
/>
198-
</span>
197+
</svg>
199198
</span>
200199
Loading Button
201200
</button>
@@ -216,22 +215,21 @@ exports[`Button isLoading icon only 1`] = `
216215
<span
217216
class="pf-c-button__progress"
218217
>
219-
<span
218+
<svg
220219
aria-label="Contents"
221220
aria-valuetext="Loading"
222221
class="pf-c-spinner pf-m-md"
223222
role="progressbar"
223+
viewBox="0 0 100 100"
224224
>
225-
<span
226-
class="pf-c-spinner__clipper"
227-
/>
228-
<span
229-
class="pf-c-spinner__lead-ball"
225+
<circle
226+
class="pf-c-spinner__path"
227+
cx="50"
228+
cy="50"
229+
fill="none"
230+
r="45"
230231
/>
231-
<span
232-
class="pf-c-spinner__tail-ball"
233-
/>
234-
</span>
232+
</svg>
235233
</span>
236234
<div>
237235
ICON

packages/react-core/src/components/Spinner/Spinner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const Spinner: React.FunctionComponent<SpinnerProps> = ({
3131
className = '',
3232
size = 'xl',
3333
'aria-valuetext': ariaValueText = 'Loading...',
34-
isSVG = false,
34+
isSVG = true,
3535
diameter,
3636
'aria-label': ariaLabel,
3737
'aria-labelledBy': ariaLabelledBy,

packages/react-core/src/components/Spinner/__tests__/Spinner.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ test('extra large spinner', () => {
2626
const { asFragment } = render(<Spinner size="xl" />);
2727
expect(asFragment()).toMatchSnapshot();
2828
});
29+
30+
test('non-SVG spinner', () => {
31+
const { asFragment } = render(<Spinner isSVG={false} />)
32+
33+
expect(asFragment()).toMatchSnapshot();
34+
})

packages/react-core/src/components/Spinner/__tests__/__snapshots__/Spinner.test.tsx.snap

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,65 @@
22

33
exports[`extra large spinner 1`] = `
44
<DocumentFragment>
5-
<span
5+
<svg
66
aria-label="Contents"
77
aria-valuetext="Loading..."
88
class="pf-c-spinner pf-m-xl"
99
role="progressbar"
10+
viewBox="0 0 100 100"
1011
>
11-
<span
12-
class="pf-c-spinner__clipper"
12+
<circle
13+
class="pf-c-spinner__path"
14+
cx="50"
15+
cy="50"
16+
fill="none"
17+
r="45"
1318
/>
14-
<span
15-
class="pf-c-spinner__lead-ball"
16-
/>
17-
<span
18-
class="pf-c-spinner__tail-ball"
19-
/>
20-
</span>
19+
</svg>
2120
</DocumentFragment>
2221
`;
2322

2423
exports[`large spinner 1`] = `
2524
<DocumentFragment>
26-
<span
25+
<svg
2726
aria-label="Contents"
2827
aria-valuetext="Loading..."
2928
class="pf-c-spinner pf-m-lg"
3029
role="progressbar"
30+
viewBox="0 0 100 100"
3131
>
32-
<span
33-
class="pf-c-spinner__clipper"
32+
<circle
33+
class="pf-c-spinner__path"
34+
cx="50"
35+
cy="50"
36+
fill="none"
37+
r="45"
3438
/>
35-
<span
36-
class="pf-c-spinner__lead-ball"
37-
/>
38-
<span
39-
class="pf-c-spinner__tail-ball"
40-
/>
41-
</span>
39+
</svg>
4240
</DocumentFragment>
4341
`;
4442

4543
exports[`medium spinner 1`] = `
4644
<DocumentFragment>
47-
<span
45+
<svg
4846
aria-label="Contents"
4947
aria-valuetext="Loading..."
5048
class="pf-c-spinner pf-m-md"
5149
role="progressbar"
50+
viewBox="0 0 100 100"
5251
>
53-
<span
54-
class="pf-c-spinner__clipper"
55-
/>
56-
<span
57-
class="pf-c-spinner__lead-ball"
52+
<circle
53+
class="pf-c-spinner__path"
54+
cx="50"
55+
cy="50"
56+
fill="none"
57+
r="45"
5858
/>
59-
<span
60-
class="pf-c-spinner__tail-ball"
61-
/>
62-
</span>
59+
</svg>
6360
</DocumentFragment>
6461
`;
6562

66-
exports[`simple spinner 1`] = `
63+
exports[`non-SVG spinner 1`] = `
6764
<DocumentFragment>
6865
<span
6966
aria-label="Contents"
@@ -84,23 +81,42 @@ exports[`simple spinner 1`] = `
8481
</DocumentFragment>
8582
`;
8683

84+
exports[`simple spinner 1`] = `
85+
<DocumentFragment>
86+
<svg
87+
aria-label="Contents"
88+
aria-valuetext="Loading..."
89+
class="pf-c-spinner pf-m-xl"
90+
role="progressbar"
91+
viewBox="0 0 100 100"
92+
>
93+
<circle
94+
class="pf-c-spinner__path"
95+
cx="50"
96+
cy="50"
97+
fill="none"
98+
r="45"
99+
/>
100+
</svg>
101+
</DocumentFragment>
102+
`;
103+
87104
exports[`small spinner 1`] = `
88105
<DocumentFragment>
89-
<span
106+
<svg
90107
aria-label="Contents"
91108
aria-valuetext="Loading..."
92109
class="pf-c-spinner pf-m-sm"
93110
role="progressbar"
111+
viewBox="0 0 100 100"
94112
>
95-
<span
96-
class="pf-c-spinner__clipper"
113+
<circle
114+
class="pf-c-spinner__path"
115+
cx="50"
116+
cy="50"
117+
fill="none"
118+
r="45"
97119
/>
98-
<span
99-
class="pf-c-spinner__lead-ball"
100-
/>
101-
<span
102-
class="pf-c-spinner__tail-ball"
103-
/>
104-
</span>
120+
</svg>
105121
</DocumentFragment>
106122
`;

0 commit comments

Comments
 (0)