Skip to content

Commit 1382232

Browse files
committedOct 26, 2022
Revert "feat(a11y): add attribute role="img" to the svg element (#750)"
This reverts commit 8b9edc4.
1 parent b385279 commit 1382232

File tree

8 files changed

+60
-258
lines changed

8 files changed

+60
-258
lines changed
 

‎packages/babel-preset/src/index.test.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('preset', () => {
2828
).toMatchInlineSnapshot(`
2929
"import * as React from \\"react\\";
3030
31-
const SvgComponent = () => <svg role=\\"img\\" foo=\\"bar\\" x={y} />;
31+
const SvgComponent = () => <svg foo=\\"bar\\" x={y} />;
3232
3333
export default SvgComponent;"
3434
`)
@@ -45,7 +45,7 @@ describe('preset', () => {
4545
const SvgComponent = ({
4646
title,
4747
titleId
48-
}) => <svg role=\\"img\\" aria-labelledby={titleId}>{title ? <title id={titleId}>{title}</title> : null}</svg>;
48+
}) => <svg aria-labelledby={titleId}>{title ? <title id={titleId}>{title}</title> : null}</svg>;
4949
5050
export default SvgComponent;"
5151
`)
@@ -62,7 +62,7 @@ describe('preset', () => {
6262
const SvgComponent = ({
6363
title,
6464
titleId
65-
}) => <svg role=\\"img\\" aria-labelledby={titleId}>{title === undefined ? <title id={titleId}>Hello</title> : title ? <title id={titleId}>{title}</title> : null}</svg>;
65+
}) => <svg aria-labelledby={titleId}>{title === undefined ? <title id={titleId}>Hello</title> : title ? <title id={titleId}>{title}</title> : null}</svg>;
6666
6767
export default SvgComponent;"
6868
`)
@@ -77,7 +77,7 @@ describe('preset', () => {
7777
const SvgComponent = ({
7878
title,
7979
titleId
80-
}) => <svg role=\\"img\\" aria-labelledby={titleId}>{title === undefined ? <title id={titleId}>{\\"Hello\\"}</title> : title ? <title id={titleId}>{title}</title> : null}</svg>;
80+
}) => <svg aria-labelledby={titleId}>{title === undefined ? <title id={titleId}>{\\"Hello\\"}</title> : title ? <title id={titleId}>{title}</title> : null}</svg>;
8181
8282
export default SvgComponent;"
8383
`)
@@ -94,7 +94,7 @@ describe('preset', () => {
9494
const SvgComponent = ({
9595
desc,
9696
descId
97-
}) => <svg role=\\"img\\" aria-describedby={descId}>{desc ? <desc id={descId}>{desc}</desc> : null}</svg>;
97+
}) => <svg aria-describedby={descId}>{desc ? <desc id={descId}>{desc}</desc> : null}</svg>;
9898
9999
export default SvgComponent;"
100100
`)
@@ -111,7 +111,7 @@ describe('preset', () => {
111111
const SvgComponent = ({
112112
desc,
113113
descId
114-
}) => <svg role=\\"img\\" aria-describedby={descId}>{desc === undefined ? <desc id={descId}>Hello</desc> : desc ? <desc id={descId}>{desc}</desc> : null}</svg>;
114+
}) => <svg aria-describedby={descId}>{desc === undefined ? <desc id={descId}>Hello</desc> : desc ? <desc id={descId}>{desc}</desc> : null}</svg>;
115115
116116
export default SvgComponent;"
117117
`)
@@ -126,7 +126,7 @@ describe('preset', () => {
126126
const SvgComponent = ({
127127
desc,
128128
descId
129-
}) => <svg role=\\"img\\" aria-describedby={descId}>{desc === undefined ? <desc id={descId}>{\\"Hello\\"}</desc> : desc ? <desc id={descId}>{desc}</desc> : null}</svg>;
129+
}) => <svg aria-describedby={descId}>{desc === undefined ? <desc id={descId}>{\\"Hello\\"}</desc> : desc ? <desc id={descId}>{desc}</desc> : null}</svg>;
130130
131131
export default SvgComponent;"
132132
`)
@@ -146,7 +146,7 @@ describe('preset', () => {
146146
titleId,
147147
desc,
148148
descId
149-
}) => <svg role=\\"img\\" aria-labelledby={titleId} aria-describedby={descId}>{desc ? <desc id={descId}>{desc}</desc> : null}{title ? <title id={titleId}>{title}</title> : null}</svg>;
149+
}) => <svg aria-labelledby={titleId} aria-describedby={descId}>{desc ? <desc id={descId}>{desc}</desc> : null}{title ? <title id={titleId}>{title}</title> : null}</svg>;
150150
151151
export default SvgComponent;"
152152
`)
@@ -163,7 +163,7 @@ describe('preset', () => {
163163
).toMatchInlineSnapshot(`
164164
"import * as React from \\"react\\";
165165
166-
const SvgComponent = () => <svg a=\\"black\\" b={props.white} role=\\"img\\" />;
166+
const SvgComponent = () => <svg a=\\"black\\" b={props.white} />;
167167
168168
export default SvgComponent;"
169169
`)
@@ -179,7 +179,7 @@ describe('preset', () => {
179179
).toMatchInlineSnapshot(`
180180
"import * as React from \\"react\\";
181181
182-
const SvgComponent = props => <svg a=\\"#000\\" b=\\"#fff\\" width=\\"1em\\" height=\\"1em\\" role=\\"img\\" {...props} />;
182+
const SvgComponent = props => <svg a=\\"#000\\" b=\\"#fff\\" width=\\"1em\\" height=\\"1em\\" {...props} />;
183183
184184
export default SvgComponent;"
185185
`)
@@ -195,7 +195,7 @@ describe('preset', () => {
195195
).toMatchInlineSnapshot(`
196196
"import * as React from \\"react\\";
197197
198-
const SvgComponent = props => <svg a=\\"#000\\" b=\\"#fff\\" width={24} height={24} role=\\"img\\" {...props} />;
198+
const SvgComponent = props => <svg a=\\"#000\\" b=\\"#fff\\" width={24} height={24} {...props} />;
199199
200200
export default SvgComponent;"
201201
`)
@@ -213,7 +213,7 @@ describe('preset', () => {
213213
"import * as React from \\"react\\";
214214
import Svg from \\"react-native-svg\\";
215215
216-
const SvgComponent = props => <Svg a=\\"#000\\" b=\\"#fff\\" width={24} height={24} accessibilityRole=\\"image\\" {...props} />;
216+
const SvgComponent = props => <Svg a=\\"#000\\" b=\\"#fff\\" width={24} height={24} {...props} />;
217217
218218
export default SvgComponent;"
219219
`)

‎packages/babel-preset/src/index.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,7 @@ function replaceMapToValues(replaceMap: { [key: string]: string }): Value[] {
4949

5050
const plugin = (_: ConfigAPI, opts: Options) => {
5151
let toRemoveAttributes = ['version']
52-
let toAddAttributes: Attribute[] = [
53-
opts?.native === true
54-
? {
55-
name: 'accessibilityRole',
56-
value: 'image',
57-
}
58-
: {
59-
name: 'role',
60-
value: 'img',
61-
},
62-
]
52+
let toAddAttributes: Attribute[] = []
6353

6454
if (opts.svgProps) {
6555
toAddAttributes = [...toAddAttributes, ...propsToAttributes(opts.svgProps)]

‎packages/cli/src/__snapshots__/index.test.ts.snap

+18-114
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports[`cli should not override config with cli defaults 1`] = `
1010
"import * as React from 'react'
1111
1212
const SvgFile = () => (
13-
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\">
13+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\">
1414
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
1515
</svg>
1616
)
@@ -35,13 +35,7 @@ exports[`cli should support --prettier-config as file 1`] = `
3535
"import * as React from 'react'
3636
3737
const SvgFile = (props) => (
38-
<svg
39-
width={48}
40-
height={1}
41-
xmlns=\\"http://www.w3.org/2000/svg\\"
42-
role=\\"img\\"
43-
{...props}
44-
>
38+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
4539
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
4640
</svg>
4741
)
@@ -55,13 +49,7 @@ exports[`cli should support --prettier-config as json 1`] = `
5549
"import * as React from 'react'
5650
5751
const SvgFile = (props) => (
58-
<svg
59-
width={48}
60-
height={1}
61-
xmlns=\\"http://www.w3.org/2000/svg\\"
62-
role=\\"img\\"
63-
{...props}
64-
>
52+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
6553
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
6654
</svg>
6755
)
@@ -75,13 +63,7 @@ exports[`cli should support --svgo-config as file 1`] = `
7563
"import * as React from 'react'
7664
7765
const SvgFile = (props) => (
78-
<svg
79-
width={48}
80-
height={1}
81-
xmlns=\\"http://www.w3.org/2000/svg\\"
82-
role=\\"img\\"
83-
{...props}
84-
>
66+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
8567
<title>{'Rectangle 5'}</title>
8668
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
8769
</svg>
@@ -96,13 +78,7 @@ exports[`cli should support --svgo-config as json 1`] = `
9678
"import * as React from 'react'
9779
9880
const SvgFile = (props) => (
99-
<svg
100-
width={48}
101-
height={1}
102-
xmlns=\\"http://www.w3.org/2000/svg\\"
103-
role=\\"img\\"
104-
{...props}
105-
>
81+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
10682
<title>{'Rectangle 5'}</title>
10783
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
10884
</svg>
@@ -169,13 +145,7 @@ exports[`cli should support stdin filepath 1`] = `
169145
"import * as React from 'react'
170146
171147
const SvgFile = (props) => (
172-
<svg
173-
width={48}
174-
height={1}
175-
xmlns=\\"http://www.w3.org/2000/svg\\"
176-
role=\\"img\\"
177-
{...props}
178-
>
148+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
179149
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
180150
</svg>
181151
)
@@ -193,7 +163,6 @@ const SvgFile = ({ desc, descId, ...props }) => (
193163
width={48}
194164
height={1}
195165
xmlns=\\"http://www.w3.org/2000/svg\\"
196-
role=\\"img\\"
197166
aria-describedby={descId}
198167
{...props}
199168
>
@@ -211,7 +180,7 @@ exports[`cli should support various args: --expand-props none 1`] = `
211180
"import * as React from 'react'
212181
213182
const SvgFile = () => (
214-
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\">
183+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\">
215184
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
216185
</svg>
217186
)
@@ -225,13 +194,7 @@ exports[`cli should support various args: --expand-props start 1`] = `
225194
"import * as React from 'react'
226195
227196
const SvgFile = (props) => (
228-
<svg
229-
{...props}
230-
width={48}
231-
height={1}
232-
xmlns=\\"http://www.w3.org/2000/svg\\"
233-
role=\\"img\\"
234-
>
197+
<svg {...props} width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\">
235198
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
236199
</svg>
237200
)
@@ -250,7 +213,6 @@ const SvgFile = (props) => (
250213
height=\\"1em\\"
251214
viewBox=\\"0 0 48 1\\"
252215
xmlns=\\"http://www.w3.org/2000/svg\\"
253-
role=\\"img\\"
254216
{...props}
255217
>
256218
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
@@ -271,7 +233,6 @@ const SvgFile = (props) => (
271233
height=\\"2em\\"
272234
viewBox=\\"0 0 48 1\\"
273235
xmlns=\\"http://www.w3.org/2000/svg\\"
274-
role=\\"img\\"
275236
{...props}
276237
>
277238
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
@@ -292,7 +253,6 @@ const SvgFile = (props) => (
292253
height={24}
293254
viewBox=\\"0 0 48 1\\"
294255
xmlns=\\"http://www.w3.org/2000/svg\\"
295-
role=\\"img\\"
296256
{...props}
297257
>
298258
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
@@ -306,13 +266,7 @@ export default SvgFile
306266

307267
exports[`cli should support various args: --jsx-runtime automatic 1`] = `
308268
"const SvgFile = (props) => (
309-
<svg
310-
width={48}
311-
height={1}
312-
xmlns=\\"http://www.w3.org/2000/svg\\"
313-
role=\\"img\\"
314-
{...props}
315-
>
269+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
316270
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
317271
</svg>
318272
)
@@ -326,13 +280,7 @@ exports[`cli should support various args: --jsx-runtime classic-preact 1`] = `
326280
"import { h } from 'preact'
327281
328282
const SvgFile = (props) => (
329-
<svg
330-
width={48}
331-
height={1}
332-
xmlns=\\"http://www.w3.org/2000/svg\\"
333-
role=\\"img\\"
334-
{...props}
335-
>
283+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
336284
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
337285
</svg>
338286
)
@@ -347,7 +295,7 @@ exports[`cli should support various args: --native --expand-props none 1`] = `
347295
import Svg, { Path } from 'react-native-svg'
348296
349297
const SvgFile = () => (
350-
<Svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\">
298+
<Svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\">
351299
<Path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
352300
</Svg>
353301
)
@@ -367,7 +315,6 @@ const SvgFile = (props) => (
367315
height={24}
368316
viewBox=\\"0 0 48 1\\"
369317
xmlns=\\"http://www.w3.org/2000/svg\\"
370-
role=\\"img\\"
371318
{...props}
372319
>
373320
<Path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
@@ -389,7 +336,6 @@ const SvgFile = (props, ref) => (
389336
width={48}
390337
height={1}
391338
xmlns=\\"http://www.w3.org/2000/svg\\"
392-
role=\\"img\\"
393339
ref={ref}
394340
{...props}
395341
>
@@ -408,13 +354,7 @@ exports[`cli should support various args: --native 1`] = `
408354
import Svg, { Path } from 'react-native-svg'
409355
410356
const SvgFile = (props) => (
411-
<Svg
412-
width={48}
413-
height={1}
414-
xmlns=\\"http://www.w3.org/2000/svg\\"
415-
role=\\"img\\"
416-
{...props}
417-
>
357+
<Svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
418358
<Path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
419359
</Svg>
420360
)
@@ -428,12 +368,7 @@ exports[`cli should support various args: --no-dimensions 1`] = `
428368
"import * as React from 'react'
429369
430370
const SvgFile = (props) => (
431-
<svg
432-
viewBox=\\"0 0 48 1\\"
433-
xmlns=\\"http://www.w3.org/2000/svg\\"
434-
role=\\"img\\"
435-
{...props}
436-
>
371+
<svg viewBox=\\"0 0 48 1\\" xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
437372
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
438373
</svg>
439374
)
@@ -446,7 +381,7 @@ export default SvgFile
446381
exports[`cli should support various args: --no-prettier 1`] = `
447382
"import * as React from \\"react\\";
448383
449-
const SvgFile = props => <svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\" {...props}><path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" /></svg>;
384+
const SvgFile = props => <svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}><path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" /></svg>;
450385
451386
export default SvgFile;
452387
"
@@ -462,7 +397,6 @@ const SvgFile = (props) => (
462397
viewBox=\\"0 0 48 1\\"
463398
xmlns=\\"http://www.w3.org/2000/svg\\"
464399
xmlnsXlink=\\"http://www.w3.org/1999/xlink\\"
465-
role=\\"img\\"
466400
{...props}
467401
>
468402
<title>{'Rectangle 5'}</title>
@@ -502,7 +436,6 @@ const SvgFile = (props, ref) => (
502436
width={48}
503437
height={1}
504438
xmlns=\\"http://www.w3.org/2000/svg\\"
505-
role=\\"img\\"
506439
ref={ref}
507440
{...props}
508441
>
@@ -520,13 +453,7 @@ exports[`cli should support various args: --replace-attr-values "#063855=current
520453
"import * as React from 'react'
521454
522455
const SvgFile = (props) => (
523-
<svg
524-
width={48}
525-
height={1}
526-
xmlns=\\"http://www.w3.org/2000/svg\\"
527-
role=\\"img\\"
528-
{...props}
529-
>
456+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
530457
<path d=\\"M0 0h48v1H0z\\" fill=\\"currentColor\\" fillRule=\\"evenodd\\" />
531458
</svg>
532459
)
@@ -544,7 +471,6 @@ const SvgFile = (props) => (
544471
width={48}
545472
height={1}
546473
xmlns=\\"http://www.w3.org/2000/svg\\"
547-
role=\\"img\\"
548474
hidden={true}
549475
id=\\"hello\\"
550476
{...props}
@@ -566,7 +492,6 @@ const SvgFile = ({ title, titleId, ...props }) => (
566492
width={48}
567493
height={1}
568494
xmlns=\\"http://www.w3.org/2000/svg\\"
569-
role=\\"img\\"
570495
aria-labelledby={titleId}
571496
{...props}
572497
>
@@ -596,7 +521,6 @@ const SvgFile = (
596521
width={48}
597522
height={1}
598523
xmlns=\\"http://www.w3.org/2000/svg\\"
599-
role=\\"img\\"
600524
ref={ref}
601525
aria-describedby={descId}
602526
{...props}
@@ -628,7 +552,6 @@ const SvgFile = (
628552
width={48}
629553
height={1}
630554
xmlns=\\"http://www.w3.org/2000/svg\\"
631-
role=\\"img\\"
632555
ref={ref}
633556
aria-labelledby={titleId}
634557
{...props}
@@ -653,7 +576,6 @@ const SvgFile = (props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) => (
653576
width={48}
654577
height={1}
655578
xmlns=\\"http://www.w3.org/2000/svg\\"
656-
role=\\"img\\"
657579
ref={ref}
658580
{...props}
659581
>
@@ -672,13 +594,7 @@ exports[`cli should support various args: --typescript 1`] = `
672594
import { SVGProps } from 'react'
673595
674596
const SvgFile = (props: SVGProps<SVGSVGElement>) => (
675-
<svg
676-
width={48}
677-
height={1}
678-
xmlns=\\"http://www.w3.org/2000/svg\\"
679-
role=\\"img\\"
680-
{...props}
681-
>
597+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
682598
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
683599
</svg>
684600
)
@@ -732,13 +648,7 @@ exports[`cli should work with a simple file 1`] = `
732648
"import * as React from 'react'
733649
734650
const SvgFile = (props) => (
735-
<svg
736-
width={48}
737-
height={1}
738-
xmlns=\\"http://www.w3.org/2000/svg\\"
739-
role=\\"img\\"
740-
{...props}
741-
>
651+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
742652
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
743653
</svg>
744654
)
@@ -752,13 +662,7 @@ exports[`cli should work with stdin 1`] = `
752662
"import * as React from 'react'
753663
754664
const SvgComponent = (props) => (
755-
<svg
756-
width={48}
757-
height={1}
758-
xmlns=\\"http://www.w3.org/2000/svg\\"
759-
role=\\"img\\"
760-
{...props}
761-
>
665+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
762666
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
763667
</svg>
764668
)

‎packages/cli/src/__snapshots__/util.test.ts.snap

+1-8
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ exports[`util #convertFile should convert a file 1`] = `
44
"import * as React from 'react'
55
66
const SvgFile = (props) => (
7-
<svg
8-
width={48}
9-
height={1}
10-
xmlns=\\"http://www.w3.org/2000/svg\\"
11-
role=\\"img\\"
12-
{...props}
13-
>
7+
<svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
148
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />
159
</svg>
1610
)
@@ -28,7 +22,6 @@ const SvgFile = (props) => (
2822
height=\\"1em\\"
2923
viewBox=\\"0 0 48 1\\"
3024
xmlns=\\"http://www.w3.org/2000/svg\\"
31-
role=\\"img\\"
3225
{...props}
3326
>
3427
<path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" />

‎packages/core/src/__snapshots__/transform.test.ts.snap

+15-94
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const SvgComponent = ({ desc, descId, ...props }) => (
88
width={88}
99
height={88}
1010
xmlns=\\"http://www.w3.org/2000/svg\\"
11-
role=\\"img\\"
1211
aria-describedby={descId}
1312
{...props}
1413
>
@@ -33,12 +32,7 @@ exports[`convert config accepts options {"dimensions":false} 1`] = `
3332
"import * as React from 'react'
3433
3534
const SvgComponent = (props) => (
36-
<svg
37-
viewBox=\\"0 0 88 88\\"
38-
xmlns=\\"http://www.w3.org/2000/svg\\"
39-
role=\\"img\\"
40-
{...props}
41-
>
35+
<svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
4236
<g
4337
stroke=\\"#063855\\"
4438
strokeWidth={2}
@@ -59,13 +53,7 @@ exports[`convert config accepts options {"expandProps":"start"} 1`] = `
5953
"import * as React from 'react'
6054
6155
const SvgComponent = (props) => (
62-
<svg
63-
{...props}
64-
width={88}
65-
height={88}
66-
xmlns=\\"http://www.w3.org/2000/svg\\"
67-
role=\\"img\\"
68-
>
56+
<svg {...props} width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\">
6957
<g
7058
stroke=\\"#063855\\"
7159
strokeWidth={2}
@@ -86,7 +74,7 @@ exports[`convert config accepts options {"expandProps":false} 1`] = `
8674
"import * as React from 'react'
8775
8876
const SvgComponent = () => (
89-
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\">
77+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\">
9078
<g
9179
stroke=\\"#063855\\"
9280
strokeWidth={2}
@@ -107,13 +95,7 @@ exports[`convert config accepts options {"exportType":"named"} 1`] = `
10795
"import * as React from 'react'
10896
10997
const SvgComponent = (props) => (
110-
<svg
111-
width={88}
112-
height={88}
113-
xmlns=\\"http://www.w3.org/2000/svg\\"
114-
role=\\"img\\"
115-
{...props}
116-
>
98+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
11799
<g
118100
stroke=\\"#063855\\"
119101
strokeWidth={2}
@@ -139,7 +121,6 @@ const SvgComponent = (props) => (
139121
height=\\"2em\\"
140122
viewBox=\\"0 0 88 88\\"
141123
xmlns=\\"http://www.w3.org/2000/svg\\"
142-
role=\\"img\\"
143124
{...props}
144125
>
145126
<g
@@ -167,7 +148,6 @@ const SvgComponent = (props) => (
167148
height={24}
168149
viewBox=\\"0 0 88 88\\"
169150
xmlns=\\"http://www.w3.org/2000/svg\\"
170-
role=\\"img\\"
171151
{...props}
172152
>
173153
<g
@@ -195,7 +175,6 @@ const SvgComponent = (props) => (
195175
height=\\"1em\\"
196176
viewBox=\\"0 0 88 88\\"
197177
xmlns=\\"http://www.w3.org/2000/svg\\"
198-
role=\\"img\\"
199178
{...props}
200179
>
201180
<g
@@ -219,13 +198,7 @@ exports[`convert config accepts options {"memo":true} 1`] = `
219198
import { memo } from 'react'
220199
221200
const SvgComponent = (props) => (
222-
<svg
223-
width={88}
224-
height={88}
225-
xmlns=\\"http://www.w3.org/2000/svg\\"
226-
role=\\"img\\"
227-
{...props}
228-
>
201+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
229202
<g
230203
stroke=\\"#063855\\"
231204
strokeWidth={2}
@@ -247,13 +220,7 @@ exports[`convert config accepts options {"namedExport":"Component","state":{"cal
247220
"import * as React from 'react'
248221
249222
const SvgComponent = (props) => (
250-
<svg
251-
width={88}
252-
height={88}
253-
xmlns=\\"http://www.w3.org/2000/svg\\"
254-
role=\\"img\\"
255-
{...props}
256-
>
223+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
257224
<g
258225
stroke=\\"#063855\\"
259226
strokeWidth={2}
@@ -276,7 +243,7 @@ exports[`convert config accepts options {"native":true,"expandProps":false} 1`]
276243
import Svg, { G, Path } from 'react-native-svg'
277244
278245
const SvgComponent = () => (
279-
<Svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\">
246+
<Svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\">
280247
<G
281248
stroke=\\"#063855\\"
282249
strokeWidth={2}
@@ -303,7 +270,6 @@ const SvgComponent = (props) => (
303270
height={24}
304271
viewBox=\\"0 0 88 88\\"
305272
xmlns=\\"http://www.w3.org/2000/svg\\"
306-
role=\\"img\\"
307273
{...props}
308274
>
309275
<G
@@ -332,7 +298,6 @@ const SvgComponent = (props, ref) => (
332298
width={88}
333299
height={88}
334300
xmlns=\\"http://www.w3.org/2000/svg\\"
335-
role=\\"img\\"
336301
ref={ref}
337302
{...props}
338303
>
@@ -358,13 +323,7 @@ exports[`convert config accepts options {"native":true} 1`] = `
358323
import Svg, { G, Path } from 'react-native-svg'
359324
360325
const SvgComponent = (props) => (
361-
<Svg
362-
width={88}
363-
height={88}
364-
xmlns=\\"http://www.w3.org/2000/svg\\"
365-
role=\\"img\\"
366-
{...props}
367-
>
326+
<Svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
368327
<G
369328
stroke=\\"#063855\\"
370329
strokeWidth={2}
@@ -384,7 +343,7 @@ export default SvgComponent
384343
exports[`convert config accepts options {"prettier":false} 1`] = `
385344
"import * as React from \\"react\\";
386345
387-
const SvgComponent = props => <svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\" {...props}><g stroke=\\"#063855\\" strokeWidth={2} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><path d=\\"M51 37 37 51M51 51 37 37\\" /></g></svg>;
346+
const SvgComponent = props => <svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}><g stroke=\\"#063855\\" strokeWidth={2} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><path d=\\"M51 37 37 51M51 51 37 37\\" /></g></svg>;
388347
389348
export default SvgComponent;"
390349
`;
@@ -398,7 +357,6 @@ const SvgComponent = (props, ref) => (
398357
width={88}
399358
height={88}
400359
xmlns=\\"http://www.w3.org/2000/svg\\"
401-
role=\\"img\\"
402360
ref={ref}
403361
{...props}
404362
>
@@ -423,13 +381,7 @@ exports[`convert config accepts options {"replaceAttrValues":{"none":"{black}"}}
423381
"import * as React from 'react'
424382
425383
const SvgComponent = (props) => (
426-
<svg
427-
width={88}
428-
height={88}
429-
xmlns=\\"http://www.w3.org/2000/svg\\"
430-
role=\\"img\\"
431-
{...props}
432-
>
384+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
433385
<g
434386
stroke=\\"#063855\\"
435387
strokeWidth={2}
@@ -450,13 +402,7 @@ exports[`convert config accepts options {"replaceAttrValues":{"none":"black"}} 1
450402
"import * as React from 'react'
451403
452404
const SvgComponent = (props) => (
453-
<svg
454-
width={88}
455-
height={88}
456-
xmlns=\\"http://www.w3.org/2000/svg\\"
457-
role=\\"img\\"
458-
{...props}
459-
>
405+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
460406
<g
461407
stroke=\\"#063855\\"
462408
strokeWidth={2}
@@ -481,7 +427,6 @@ const SvgComponent = (props) => (
481427
width={88}
482428
height={88}
483429
xmlns=\\"http://www.w3.org/2000/svg\\"
484-
role=\\"img\\"
485430
a=\\"b\\"
486431
b={props.b}
487432
{...props}
@@ -512,7 +457,6 @@ const SvgComponent = (props) => (
512457
viewBox=\\"0 0 88 88\\"
513458
xmlns=\\"http://www.w3.org/2000/svg\\"
514459
xmlnsXlink=\\"http://www.w3.org/1999/xlink\\"
515-
role=\\"img\\"
516460
{...props}
517461
>
518462
<title>{'Dismiss'}</title>
@@ -546,7 +490,6 @@ const SvgComponent = ({ title, titleId, ...props }) => (
546490
width={88}
547491
height={88}
548492
xmlns=\\"http://www.w3.org/2000/svg\\"
549-
role=\\"img\\"
550493
aria-labelledby={titleId}
551494
{...props}
552495
>
@@ -584,7 +527,6 @@ const SvgComponent = ({ desc, descId, ...props }) => (
584527
style={{
585528
position: 'absolute',
586529
}}
587-
role=\\"img\\"
588530
aria-describedby={descId}
589531
{...props}
590532
>
@@ -607,7 +549,6 @@ const SvgComponent = ({ title, titleId, ...props }) => (
607549
style={{
608550
position: 'absolute',
609551
}}
610-
role=\\"img\\"
611552
aria-labelledby={titleId}
612553
{...props}
613554
>
@@ -624,13 +565,7 @@ exports[`convert should convert 1`] = `
624565
"import * as React from 'react'
625566
626567
const SvgComponent = (props) => (
627-
<svg
628-
width={88}
629-
height={88}
630-
xmlns=\\"http://www.w3.org/2000/svg\\"
631-
role=\\"img\\"
632-
{...props}
633-
>
568+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
634569
<g
635570
stroke=\\"#063855\\"
636571
strokeWidth={2}
@@ -656,7 +591,6 @@ const SvgComponent = (props) => (
656591
xmlnsXlink=\\"http://www.w3.org/1999/xlink\\"
657592
width={48}
658593
height={48}
659-
role=\\"img\\"
660594
{...props}
661595
>
662596
<g transform=\\"translate(0 -1004.362)\\">
@@ -721,7 +655,7 @@ exports[`convert should handle special SVG attributes 1`] = `
721655
"import * as React from 'react'
722656
723657
const SvgComponent = (props) => (
724-
<svg xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\" {...props}>
658+
<svg xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
725659
<path externalResourcesRequired=\\"false\\" d=\\"M10 10h100v100H10z\\" />
726660
</svg>
727661
)
@@ -734,13 +668,7 @@ exports[`convert should not remove all style tags 1`] = `
734668
"import * as React from 'react'
735669
736670
const SvgComponent = (props) => (
737-
<svg
738-
width={88}
739-
height={88}
740-
xmlns=\\"http://www.w3.org/2000/svg\\"
741-
role=\\"img\\"
742-
{...props}
743-
>
671+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
744672
<style>{'path{fill:red}'}</style>
745673
<g
746674
id=\\"prefix__Blocks\\"
@@ -774,7 +702,6 @@ const SvgComponent = (props) => (
774702
enableBackground: 'new 0 0 25 25',
775703
}}
776704
xmlSpace=\\"preserve\\"
777-
role=\\"img\\"
778705
{...props}
779706
>
780707
<path
@@ -796,13 +723,7 @@ exports[`convert should remove style tags 1`] = `
796723
"import * as React from 'react'
797724
798725
const SvgComponent = (props) => (
799-
<svg
800-
width={88}
801-
height={88}
802-
xmlns=\\"http://www.w3.org/2000/svg\\"
803-
role=\\"img\\"
804-
{...props}
805-
>
726+
<svg width={88} height={88} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}>
806727
<style />
807728
<g
808729
fill=\\"none\\"

‎packages/plugin-jsx/src/index.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('plugin', () => {
2222
expect(result).toMatchInlineSnapshot(`
2323
"import * as React from \\"react\\";
2424
25-
const SvgComponent = () => <svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlnsXlink=\\"http://www.w3.org/1999/xlink\\" role=\\"img\\"><title>{\\"Dismiss\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id=\\"Blocks\\" stroke=\\"none\\" strokeWidth={1} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><g id=\\"Dismiss\\" stroke=\\"#063855\\" strokeWidth={2}><path d=\\"M51,37 L37,51\\" id=\\"Shape\\" /><path d=\\"M51,51 L37,37\\" id=\\"Shape\\" /></g></g></svg>;
25+
const SvgComponent = () => <svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlnsXlink=\\"http://www.w3.org/1999/xlink\\"><title>{\\"Dismiss\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id=\\"Blocks\\" stroke=\\"none\\" strokeWidth={1} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><g id=\\"Dismiss\\" stroke=\\"#063855\\" strokeWidth={2}><path d=\\"M51,37 L37,51\\" id=\\"Shape\\" /><path d=\\"M51,51 L37,37\\" id=\\"Shape\\" /></g></g></svg>;
2626
2727
export default SvgComponent;"
2828
`)
@@ -35,7 +35,7 @@ describe('plugin', () => {
3535
{ componentName: 'SvgComponent' },
3636
)
3737
expect(result).toMatchInlineSnapshot(`
38-
"const SvgComponent = () => <svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlnsXlink=\\"http://www.w3.org/1999/xlink\\" role=\\"img\\"><title>{\\"Dismiss\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id=\\"Blocks\\" stroke=\\"none\\" strokeWidth={1} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><g id=\\"Dismiss\\" stroke=\\"#063855\\" strokeWidth={2}><path d=\\"M51,37 L37,51\\" id=\\"Shape\\" /><path d=\\"M51,51 L37,37\\" id=\\"Shape\\" /></g></g></svg>;
38+
"const SvgComponent = () => <svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlnsXlink=\\"http://www.w3.org/1999/xlink\\"><title>{\\"Dismiss\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id=\\"Blocks\\" stroke=\\"none\\" strokeWidth={1} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><g id=\\"Dismiss\\" stroke=\\"#063855\\" strokeWidth={2}><path d=\\"M51,37 L37,51\\" id=\\"Shape\\" /><path d=\\"M51,51 L37,37\\" id=\\"Shape\\" /></g></g></svg>;
3939
4040
export default SvgComponent;"
4141
`)
@@ -50,7 +50,7 @@ describe('plugin', () => {
5050
expect(result).toMatchInlineSnapshot(`
5151
"import { h } from \\"preact\\";
5252
53-
const SvgComponent = () => <svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlnsXlink=\\"http://www.w3.org/1999/xlink\\" role=\\"img\\"><title>{\\"Dismiss\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id=\\"Blocks\\" stroke=\\"none\\" strokeWidth={1} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><g id=\\"Dismiss\\" stroke=\\"#063855\\" strokeWidth={2}><path d=\\"M51,37 L37,51\\" id=\\"Shape\\" /><path d=\\"M51,51 L37,37\\" id=\\"Shape\\" /></g></g></svg>;
53+
const SvgComponent = () => <svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlnsXlink=\\"http://www.w3.org/1999/xlink\\"><title>{\\"Dismiss\\"}</title><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id=\\"Blocks\\" stroke=\\"none\\" strokeWidth={1} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><g id=\\"Dismiss\\" stroke=\\"#063855\\" strokeWidth={2}><path d=\\"M51,37 L37,51\\" id=\\"Shape\\" /><path d=\\"M51,51 L37,37\\" id=\\"Shape\\" /></g></g></svg>;
5454
5555
export default SvgComponent;"
5656
`)
@@ -77,7 +77,7 @@ describe('plugin', () => {
7777
expect(result).toMatchInlineSnapshot(`
7878
"import * as React from \\"react\\";
7979
80-
const SvgComponent = () => <svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlnsXlink=\\"http://www.w3.org/1999/xlink\\" role=\\"img\\"><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id=\\"Blocks\\" stroke=\\"none\\" strokeWidth={1} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><g id=\\"Dismiss\\" stroke=\\"#063855\\" strokeWidth={2}><path d=\\"M51,37 L37,51\\" id=\\"Shape\\" /><path d=\\"M51,51 L37,37\\" id=\\"Shape\\" /></g></g></svg>;
80+
const SvgComponent = () => <svg viewBox=\\"0 0 88 88\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlnsXlink=\\"http://www.w3.org/1999/xlink\\"><desc>{\\"Created with Sketch.\\"}</desc><defs /><g id=\\"Blocks\\" stroke=\\"none\\" strokeWidth={1} fill=\\"none\\" fillRule=\\"evenodd\\" strokeLinecap=\\"square\\"><g id=\\"Dismiss\\" stroke=\\"#063855\\" strokeWidth={2}><path d=\\"M51,37 L37,51\\" id=\\"Shape\\" /><path d=\\"M51,51 L37,37\\" id=\\"Shape\\" /></g></g></svg>;
8181
8282
export default SvgComponent;"
8383
`)

‎packages/rollup/src/__snapshots__/index.test.ts.snap

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ var SvgFile = function SvgFile(props) {
1111
return /*#__PURE__*/React.createElement(\\"svg\\", _extends({
1212
width: 48,
1313
height: 1,
14-
xmlns: \\"http://www.w3.org/2000/svg\\",
15-
role: \\"img\\"
14+
xmlns: \\"http://www.w3.org/2000/svg\\"
1615
}, props), _path || (_path = /*#__PURE__*/React.createElement(\\"path\\", {
1716
d: \\"M0 0h48v1H0z\\",
1817
fill: \\"#063855\\",
@@ -26,7 +25,7 @@ export default SvgFile;"
2625
exports[`rollup loader should convert file with previousExport of image plugin 1`] = `
2726
"import * as React from \\"react\\";
2827
29-
const SvgFile = props => <svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\" {...props}><path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" /></svg>;
28+
const SvgFile = props => <svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}><path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" /></svg>;
3029
3130
export { SvgFile as ReactComponent };
3231
var img = new Image();
@@ -37,7 +36,7 @@ export default img;"
3736
exports[`rollup loader should convert file with previousExport of url plugin 1`] = `
3837
"import * as React from \\"react\\";
3938
40-
const SvgFile = props => <svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\" {...props}><path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" /></svg>;
39+
const SvgFile = props => <svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}><path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" /></svg>;
4140
4241
export { SvgFile as ReactComponent };
4342
export default \\"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2248px%22%20height%3D%221px%22%20viewBox%3D%220%200%2048%201%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%20%20%20%20%3Ctitle%3ERectangle%205%3C%2Ftitle%3E%20%20%20%20%3Cdesc%3ECreated%20with%20Sketch.%3C%2Fdesc%3E%20%20%20%20%3Cdefs%3E%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Page-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%2219-Separator%22%20transform%3D%22translate%28-129.000000%2C%20-156.000000%29%22%20fill%3D%22%23063855%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Controls%2FSettings%22%20transform%3D%22translate%2880.000000%2C%200.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Content%22%20transform%3D%22translate%280.000000%2C%2064.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%2824.000000%2C%2056.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group-2%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle-5%22%20x%3D%2225%22%20y%3D%2236%22%20width%3D%2248%22%20height%3D%221%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E\\";"
@@ -46,7 +45,7 @@ export default \\"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%
4645
exports[`rollup loader should convert file without babel 1`] = `
4746
"import * as React from \\"react\\";
4847
49-
const SvgFile = props => <svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" role=\\"img\\" {...props}><path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" /></svg>;
48+
const SvgFile = props => <svg width={48} height={1} xmlns=\\"http://www.w3.org/2000/svg\\" {...props}><path d=\\"M0 0h48v1H0z\\" fill=\\"#063855\\" fillRule=\\"evenodd\\" /></svg>;
5049
5150
export default SvgFile;"
5251
`;

‎packages/webpack/src/__snapshots__/index.test.ts.snap

+5-10
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ var SvgIcon = function SvgIcon() {
99
return _svg || (_svg = /*#__PURE__*/React.createElement(\\"svg\\", {
1010
width: 88,
1111
height: 88,
12-
xmlns: \\"http://www.w3.org/2000/svg\\",
13-
role: \\"img\\"
12+
xmlns: \\"http://www.w3.org/2000/svg\\"
1413
}, /*#__PURE__*/React.createElement(\\"g\\", {
1514
stroke: \\"#063855\\",
1615
strokeWidth: 2,
@@ -32,8 +31,7 @@ exports[`webpack loader transforms file (babel: false) 1`] = `
3231
const SvgIcon = () => /*#__PURE__*/React.createElement(\\"svg\\", {
3332
width: 88,
3433
height: 88,
35-
xmlns: \\"http://www.w3.org/2000/svg\\",
36-
role: \\"img\\"
34+
xmlns: \\"http://www.w3.org/2000/svg\\"
3735
}, /*#__PURE__*/React.createElement(\\"g\\", {
3836
stroke: \\"#063855\\",
3937
strokeWidth: 2,
@@ -58,8 +56,7 @@ var SvgIcon = function SvgIcon(props) {
5856
return /*#__PURE__*/React.createElement(\\"svg\\", _extends({
5957
width: 88,
6058
height: 88,
61-
xmlns: \\"http://www.w3.org/2000/svg\\",
62-
role: \\"img\\"
59+
xmlns: \\"http://www.w3.org/2000/svg\\"
6360
}, props), _g || (_g = /*#__PURE__*/React.createElement(\\"g\\", {
6461
stroke: \\"#063855\\",
6562
strokeWidth: 2,
@@ -83,8 +80,7 @@ var SvgIcon = function SvgIcon() {
8380
return _svg || (_svg = /*#__PURE__*/React.createElement(\\"svg\\", {
8481
width: 88,
8582
height: 88,
86-
xmlns: \\"http://www.w3.org/2000/svg\\",
87-
role: \\"img\\"
83+
xmlns: \\"http://www.w3.org/2000/svg\\"
8884
}, /*#__PURE__*/React.createElement(\\"g\\", {
8985
stroke: \\"#063855\\",
9086
strokeWidth: 2,
@@ -108,8 +104,7 @@ var SvgIcon = function SvgIcon() {
108104
return _svg || (_svg = /*#__PURE__*/React.createElement(\\"svg\\", {
109105
width: 88,
110106
height: 88,
111-
xmlns: \\"http://www.w3.org/2000/svg\\",
112-
role: \\"img\\"
107+
xmlns: \\"http://www.w3.org/2000/svg\\"
113108
}, /*#__PURE__*/React.createElement(\\"g\\", {
114109
stroke: \\"#063855\\",
115110
strokeWidth: 2,

0 commit comments

Comments
 (0)
Please sign in to comment.