@tamagui/react-native-svg 2.4.6 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  $ tamagui-build
2
- built @tamagui/react-native-svg in 558 ms
2
+ built @tamagui/react-native-svg in 251 ms
@@ -51,104 +51,43 @@ __export(index_exports, {
51
51
  });
52
52
  module.exports = __toCommonJS(index_exports);
53
53
  var import_react = require("react");
54
- const Circle = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("circle", {
55
- ...p,
56
- ref
57
- }));
58
- const ClipPath = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("clipPath", {
59
- ...p,
60
- ref
61
- }));
62
- const Defs = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("defs", {
63
- ...p,
64
- ref
65
- }));
66
- const Ellipse = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("ellipse", {
67
- ...p,
68
- ref
69
- }));
70
- const ForeignObject = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("foreignObject", {
71
- ...p,
72
- ref
73
- }));
74
- const G = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("g", {
75
- ...p,
76
- ref
77
- }));
78
- const Image = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("image", {
79
- ...p,
80
- ref
81
- }));
82
- const Line = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("line", {
83
- ...p,
84
- ref
85
- }));
86
- const LinearGradient = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("linearGradient", {
87
- ...p,
88
- ref
89
- }));
90
- const Marker = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("marker", {
91
- ...p,
92
- ref
93
- }));
94
- const Mask = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("mask", {
95
- ...p,
96
- ref
97
- }));
98
- const Path = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("path", {
99
- ...p,
100
- ref
101
- }));
102
- const Pattern = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("pattern", {
103
- ...p,
104
- ref
105
- }));
106
- const Polygon = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("polygon", {
107
- ...p,
108
- ref
109
- }));
110
- const Polyline = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("polyline", {
111
- ...p,
112
- ref
113
- }));
114
- const RadialGradient = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("radialGradient", {
115
- ...p,
116
- ref
117
- }));
118
- const Rect = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("rect", {
119
- ...p,
120
- ref
121
- }));
122
- const Shape = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("shape", {
123
- ...p,
124
- ref
125
- }));
126
- const Stop = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("stop", {
127
- ...p,
128
- ref
129
- }));
130
- const Svg = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("svg", {
131
- ...p,
132
- ref
133
- }));
134
- const Symbol2 = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("symbol", {
135
- ...p,
136
- ref
137
- }));
138
- const Text = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("text", {
139
- ...p,
140
- ref
141
- }));
142
- const TextPath = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("clipPath", {
143
- ...p,
144
- ref
145
- }));
146
- const TSpan = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("tSpan", {
147
- ...p,
148
- ref
149
- }));
150
- const Use = (0, import_react.forwardRef)((p, ref) => (0, import_react.createElement)("use", {
151
- ...p,
152
- ref
153
- }));
54
+ const toDOMProps = props => {
55
+ const {
56
+ testID,
57
+ accessibilityLabel,
58
+ ...rest
59
+ } = props;
60
+ if (testID !== void 0) rest["data-testid"] = testID;
61
+ if (accessibilityLabel !== void 0) rest["aria-label"] = accessibilityLabel;
62
+ return rest;
63
+ };
64
+ const svgElement = tag => (0, import_react.forwardRef)((props, ref) => (0, import_react.createElement)(tag, {
65
+ ...toDOMProps(props),
66
+ ref
67
+ }));
68
+ const Circle = svgElement("circle");
69
+ const ClipPath = svgElement("clipPath");
70
+ const Defs = svgElement("defs");
71
+ const Ellipse = svgElement("ellipse");
72
+ const ForeignObject = svgElement("foreignObject");
73
+ const G = svgElement("g");
74
+ const Image = svgElement("image");
75
+ const Line = svgElement("line");
76
+ const LinearGradient = svgElement("linearGradient");
77
+ const Marker = svgElement("marker");
78
+ const Mask = svgElement("mask");
79
+ const Path = svgElement("path");
80
+ const Pattern = svgElement("pattern");
81
+ const Polygon = svgElement("polygon");
82
+ const Polyline = svgElement("polyline");
83
+ const RadialGradient = svgElement("radialGradient");
84
+ const Rect = svgElement("rect");
85
+ const Shape = svgElement("shape");
86
+ const Stop = svgElement("stop");
87
+ const Svg = svgElement("svg");
88
+ const Symbol2 = svgElement("symbol");
89
+ const Text = svgElement("text");
90
+ const TextPath = svgElement("clipPath");
91
+ const TSpan = svgElement("tSpan");
92
+ const Use = svgElement("use");
154
93
  var index_default = Svg;
package/dist/esm/index.js CHANGED
@@ -1,104 +1,43 @@
1
1
  import { createElement, forwardRef } from "react";
2
- const Circle = forwardRef((p, ref) => createElement("circle", {
3
- ...p,
4
- ref
5
- }));
6
- const ClipPath = forwardRef((p, ref) => createElement("clipPath", {
7
- ...p,
8
- ref
9
- }));
10
- const Defs = forwardRef((p, ref) => createElement("defs", {
11
- ...p,
12
- ref
13
- }));
14
- const Ellipse = forwardRef((p, ref) => createElement("ellipse", {
15
- ...p,
16
- ref
17
- }));
18
- const ForeignObject = forwardRef((p, ref) => createElement("foreignObject", {
19
- ...p,
20
- ref
21
- }));
22
- const G = forwardRef((p, ref) => createElement("g", {
23
- ...p,
24
- ref
25
- }));
26
- const Image = forwardRef((p, ref) => createElement("image", {
27
- ...p,
28
- ref
29
- }));
30
- const Line = forwardRef((p, ref) => createElement("line", {
31
- ...p,
32
- ref
33
- }));
34
- const LinearGradient = forwardRef((p, ref) => createElement("linearGradient", {
35
- ...p,
36
- ref
37
- }));
38
- const Marker = forwardRef((p, ref) => createElement("marker", {
39
- ...p,
40
- ref
41
- }));
42
- const Mask = forwardRef((p, ref) => createElement("mask", {
43
- ...p,
44
- ref
45
- }));
46
- const Path = forwardRef((p, ref) => createElement("path", {
47
- ...p,
48
- ref
49
- }));
50
- const Pattern = forwardRef((p, ref) => createElement("pattern", {
51
- ...p,
52
- ref
53
- }));
54
- const Polygon = forwardRef((p, ref) => createElement("polygon", {
55
- ...p,
56
- ref
57
- }));
58
- const Polyline = forwardRef((p, ref) => createElement("polyline", {
59
- ...p,
60
- ref
61
- }));
62
- const RadialGradient = forwardRef((p, ref) => createElement("radialGradient", {
63
- ...p,
64
- ref
65
- }));
66
- const Rect = forwardRef((p, ref) => createElement("rect", {
67
- ...p,
68
- ref
69
- }));
70
- const Shape = forwardRef((p, ref) => createElement("shape", {
71
- ...p,
72
- ref
73
- }));
74
- const Stop = forwardRef((p, ref) => createElement("stop", {
75
- ...p,
76
- ref
77
- }));
78
- const Svg = forwardRef((p, ref) => createElement("svg", {
79
- ...p,
80
- ref
81
- }));
82
- const Symbol = forwardRef((p, ref) => createElement("symbol", {
83
- ...p,
84
- ref
85
- }));
86
- const Text = forwardRef((p, ref) => createElement("text", {
87
- ...p,
88
- ref
89
- }));
90
- const TextPath = forwardRef((p, ref) => createElement("clipPath", {
91
- ...p,
92
- ref
93
- }));
94
- const TSpan = forwardRef((p, ref) => createElement("tSpan", {
95
- ...p,
96
- ref
97
- }));
98
- const Use = forwardRef((p, ref) => createElement("use", {
99
- ...p,
100
- ref
101
- }));
2
+ const toDOMProps = props => {
3
+ const {
4
+ testID,
5
+ accessibilityLabel,
6
+ ...rest
7
+ } = props;
8
+ if (testID !== void 0) rest["data-testid"] = testID;
9
+ if (accessibilityLabel !== void 0) rest["aria-label"] = accessibilityLabel;
10
+ return rest;
11
+ };
12
+ const svgElement = tag => forwardRef((props, ref) => createElement(tag, {
13
+ ...toDOMProps(props),
14
+ ref
15
+ }));
16
+ const Circle = svgElement("circle");
17
+ const ClipPath = svgElement("clipPath");
18
+ const Defs = svgElement("defs");
19
+ const Ellipse = svgElement("ellipse");
20
+ const ForeignObject = svgElement("foreignObject");
21
+ const G = svgElement("g");
22
+ const Image = svgElement("image");
23
+ const Line = svgElement("line");
24
+ const LinearGradient = svgElement("linearGradient");
25
+ const Marker = svgElement("marker");
26
+ const Mask = svgElement("mask");
27
+ const Path = svgElement("path");
28
+ const Pattern = svgElement("pattern");
29
+ const Polygon = svgElement("polygon");
30
+ const Polyline = svgElement("polyline");
31
+ const RadialGradient = svgElement("radialGradient");
32
+ const Rect = svgElement("rect");
33
+ const Shape = svgElement("shape");
34
+ const Stop = svgElement("stop");
35
+ const Svg = svgElement("svg");
36
+ const Symbol = svgElement("symbol");
37
+ const Text = svgElement("text");
38
+ const TextPath = svgElement("clipPath");
39
+ const TSpan = svgElement("tSpan");
40
+ const Use = svgElement("use");
102
41
  var index_default = Svg;
103
42
  export { Circle, ClipPath, Defs, Ellipse, ForeignObject, G, Image, Line, LinearGradient, Marker, Mask, Path, Pattern, Polygon, Polyline, RadialGradient, Rect, Shape, Stop, Svg, Symbol, TSpan, Text, TextPath, Use, index_default as default };
104
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createElement","forwardRef","Circle","p","ref","ClipPath","Defs","Ellipse","ForeignObject","G","Image","Line","LinearGradient","Marker","Mask","Path","Pattern","Polygon","Polyline","RadialGradient","Rect","Shape","Stop","Svg","Symbol","Text","TextPath","TSpan","Use","index_default"],"sources":["../../src/index.js"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,EAAeC,UAAA,QAAkB;AAEnC,MAAMC,MAAA,GAASD,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,UAAU;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAC5E,MAAMC,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mB,GAAA,GAAMtB,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,OAAO;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AACtE,MAAMoB,MAAA,GAASvB,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,UAAU;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAC5E,MAAMqB,IAAA,GAAOxB,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,QAAQ;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AACxE,MAAMsB,QAAA,GAAWzB,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,YAAY;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAChF,MAAMuB,KAAA,GAAQ1B,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,SAAS;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAC1E,MAAMwB,GAAA,GAAM3B,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,OAAO;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAE7E,IAAOyB,aAAA,GAAQN,GAAA","ignoreList":[]}
1
+ {"version":3,"names":["createElement","forwardRef","toDOMProps","props","testID","accessibilityLabel","rest","svgElement","tag","ref","Circle","ClipPath","Defs","Ellipse","ForeignObject","G","Image","Line","LinearGradient","Marker","Mask","Path","Pattern","Polygon","Polyline","RadialGradient","Rect","Shape","Stop","Svg","Symbol","Text","TextPath","TSpan","Use","index_default"],"sources":["../../src/index.js"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,EAAeC,UAAA,QAAkB;AAM1C,MAAMC,UAAA,GAAcC,KAAA,IAAU;EAC5B,MAAM;IAAEC,MAAA;IAAQC,kBAAA;I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AM;AAC9B,MAAMsB,GAAA,GAAMtB,UAAA,CAAW,KAAK;AAC5B,MAAMuB,MAAA,GAASvB,UAAA,CAAW,QAAQ;AAClC,MAAMwB,IAAA,GAAOxB,UAAA,CAAW,MAAM;AAC9B,MAAMyB,QAAA,GAAWzB,UAAA,CAAW,UAAU;AACtC,MAAM0B,KAAA,GAAQ1B,UAAA,CAAW,OAAO;AAChC,MAAM2B,GAAA,GAAM3B,UAAA,CAAW,KAAK;AAEnC,IAAO4B,aAAA,GAAQN,GAAA","ignoreList":[]}
@@ -1,104 +1,43 @@
1
1
  import { createElement, forwardRef } from "react";
2
- const Circle = forwardRef((p, ref) => createElement("circle", {
3
- ...p,
4
- ref
5
- }));
6
- const ClipPath = forwardRef((p, ref) => createElement("clipPath", {
7
- ...p,
8
- ref
9
- }));
10
- const Defs = forwardRef((p, ref) => createElement("defs", {
11
- ...p,
12
- ref
13
- }));
14
- const Ellipse = forwardRef((p, ref) => createElement("ellipse", {
15
- ...p,
16
- ref
17
- }));
18
- const ForeignObject = forwardRef((p, ref) => createElement("foreignObject", {
19
- ...p,
20
- ref
21
- }));
22
- const G = forwardRef((p, ref) => createElement("g", {
23
- ...p,
24
- ref
25
- }));
26
- const Image = forwardRef((p, ref) => createElement("image", {
27
- ...p,
28
- ref
29
- }));
30
- const Line = forwardRef((p, ref) => createElement("line", {
31
- ...p,
32
- ref
33
- }));
34
- const LinearGradient = forwardRef((p, ref) => createElement("linearGradient", {
35
- ...p,
36
- ref
37
- }));
38
- const Marker = forwardRef((p, ref) => createElement("marker", {
39
- ...p,
40
- ref
41
- }));
42
- const Mask = forwardRef((p, ref) => createElement("mask", {
43
- ...p,
44
- ref
45
- }));
46
- const Path = forwardRef((p, ref) => createElement("path", {
47
- ...p,
48
- ref
49
- }));
50
- const Pattern = forwardRef((p, ref) => createElement("pattern", {
51
- ...p,
52
- ref
53
- }));
54
- const Polygon = forwardRef((p, ref) => createElement("polygon", {
55
- ...p,
56
- ref
57
- }));
58
- const Polyline = forwardRef((p, ref) => createElement("polyline", {
59
- ...p,
60
- ref
61
- }));
62
- const RadialGradient = forwardRef((p, ref) => createElement("radialGradient", {
63
- ...p,
64
- ref
65
- }));
66
- const Rect = forwardRef((p, ref) => createElement("rect", {
67
- ...p,
68
- ref
69
- }));
70
- const Shape = forwardRef((p, ref) => createElement("shape", {
71
- ...p,
72
- ref
73
- }));
74
- const Stop = forwardRef((p, ref) => createElement("stop", {
75
- ...p,
76
- ref
77
- }));
78
- const Svg = forwardRef((p, ref) => createElement("svg", {
79
- ...p,
80
- ref
81
- }));
82
- const Symbol = forwardRef((p, ref) => createElement("symbol", {
83
- ...p,
84
- ref
85
- }));
86
- const Text = forwardRef((p, ref) => createElement("text", {
87
- ...p,
88
- ref
89
- }));
90
- const TextPath = forwardRef((p, ref) => createElement("clipPath", {
91
- ...p,
92
- ref
93
- }));
94
- const TSpan = forwardRef((p, ref) => createElement("tSpan", {
95
- ...p,
96
- ref
97
- }));
98
- const Use = forwardRef((p, ref) => createElement("use", {
99
- ...p,
100
- ref
101
- }));
2
+ const toDOMProps = props => {
3
+ const {
4
+ testID,
5
+ accessibilityLabel,
6
+ ...rest
7
+ } = props;
8
+ if (testID !== void 0) rest["data-testid"] = testID;
9
+ if (accessibilityLabel !== void 0) rest["aria-label"] = accessibilityLabel;
10
+ return rest;
11
+ };
12
+ const svgElement = tag => forwardRef((props, ref) => createElement(tag, {
13
+ ...toDOMProps(props),
14
+ ref
15
+ }));
16
+ const Circle = svgElement("circle");
17
+ const ClipPath = svgElement("clipPath");
18
+ const Defs = svgElement("defs");
19
+ const Ellipse = svgElement("ellipse");
20
+ const ForeignObject = svgElement("foreignObject");
21
+ const G = svgElement("g");
22
+ const Image = svgElement("image");
23
+ const Line = svgElement("line");
24
+ const LinearGradient = svgElement("linearGradient");
25
+ const Marker = svgElement("marker");
26
+ const Mask = svgElement("mask");
27
+ const Path = svgElement("path");
28
+ const Pattern = svgElement("pattern");
29
+ const Polygon = svgElement("polygon");
30
+ const Polyline = svgElement("polyline");
31
+ const RadialGradient = svgElement("radialGradient");
32
+ const Rect = svgElement("rect");
33
+ const Shape = svgElement("shape");
34
+ const Stop = svgElement("stop");
35
+ const Svg = svgElement("svg");
36
+ const Symbol = svgElement("symbol");
37
+ const Text = svgElement("text");
38
+ const TextPath = svgElement("clipPath");
39
+ const TSpan = svgElement("tSpan");
40
+ const Use = svgElement("use");
102
41
  var index_default = Svg;
103
42
  export { Circle, ClipPath, Defs, Ellipse, ForeignObject, G, Image, Line, LinearGradient, Marker, Mask, Path, Pattern, Polygon, Polyline, RadialGradient, Rect, Shape, Stop, Svg, Symbol, TSpan, Text, TextPath, Use, index_default as default };
104
43
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["createElement","forwardRef","Circle","p","ref","ClipPath","Defs","Ellipse","ForeignObject","G","Image","Line","LinearGradient","Marker","Mask","Path","Pattern","Polygon","Polyline","RadialGradient","Rect","Shape","Stop","Svg","Symbol","Text","TextPath","TSpan","Use","index_default"],"sources":["../../src/index.js"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,EAAeC,UAAA,QAAkB;AAEnC,MAAMC,MAAA,GAASD,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,UAAU;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAC5E,MAAMC,QAAA,GAAWJ,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,YAAY;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAChF,MAAME,IAAA,GAAOL,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,QAAQ;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AACxE,MAAMG,OAAA,GAAUN,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,WAAW;EAAE,GAAGG,CAAA;E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G,CAAA;EAAGC;AAAI,CAAC,CAAC;AACxE,MAAMsB,QAAA,GAAWzB,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,YAAY;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAChF,MAAMuB,KAAA,GAAQ1B,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,SAAS;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAC1E,MAAMwB,GAAA,GAAM3B,UAAA,CAAW,CAACE,CAAA,EAAGC,GAAA,KAAQJ,aAAA,CAAc,OAAO;EAAE,GAAGG,CAAA;EAAGC;AAAI,CAAC,CAAC;AAE7E,IAAOyB,aAAA,GAAQN,GAAA","ignoreList":[]}
1
+ {"version":3,"names":["createElement","forwardRef","toDOMProps","props","testID","accessibilityLabel","rest","svgElement","tag","ref","Circle","ClipPath","Defs","Ellipse","ForeignObject","G","Image","Line","LinearGradient","Marker","Mask","Path","Pattern","Polygon","Polyline","RadialGradient","Rect","Shape","Stop","Svg","Symbol","Text","TextPath","TSpan","Use","index_default"],"sources":["../../src/index.js"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,EAAeC,UAAA,QAAkB;AAM1C,MAAMC,UAAA,GAAcC,KAAA,IAAU;EAC5B,MAAM;IAAEC,MAAA;IAAQC,kBAAA;IAAoB,GAAGC;EAAK,IAAIH,KAAA;EAChD,IAAIC,MAAA,KAAW,QAAWE,IAAA,CAAK,aAAa,IAAIF,MAAA;EAChD,IAAIC,kBAAA,KAAuB,QAAWC,IAAA,CAAK,YAAY,IAAID,kBAAA;EAC3D,OAAOC,IAAA;AACT;AAEA,MAAMC,UAAA,GAAcC,GAAA,IAClBP,UAAA,CAAW,CAACE,KAAA,EAAOM,GAAA,KAAQT,aAAA,CAAcQ,GAAA,EAAK;EAAE,GAAGN,UAAA,CAAWC,KAAK;EAAGM;AAAI,CAAC,CAAC;AAEvE,MAAM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
1
1
  {
2
2
  "name": "@tamagui/react-native-svg",
3
- "version": "2.4.6",
3
+ "version": "2.5.1",
4
4
  "type": "module",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm/index.js",
@@ -25,7 +25,12 @@
25
25
  "clean:build": "tamagui-build clean:build"
26
26
  },
27
27
  "devDependencies": {
28
- "@tamagui/build": "2.4.6",
28
+ "@tamagui/build": "2.5.1",
29
29
  "react-native-svg": "15.15.3"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/tamagui/tamagui.git",
34
+ "directory": "code/packages/react-native-svg"
30
35
  }
31
36
  }
package/src/index.js CHANGED
@@ -1,35 +1,43 @@
1
1
  import { createElement, forwardRef } from 'react'
2
2
 
3
- export const Circle = forwardRef((p, ref) => createElement('circle', { ...p, ref }))
4
- export const ClipPath = forwardRef((p, ref) => createElement('clipPath', { ...p, ref }))
5
- export const Defs = forwardRef((p, ref) => createElement('defs', { ...p, ref }))
6
- export const Ellipse = forwardRef((p, ref) => createElement('ellipse', { ...p, ref }))
7
- export const ForeignObject = forwardRef((p, ref) =>
8
- createElement('foreignObject', { ...p, ref })
9
- )
10
- export const G = forwardRef((p, ref) => createElement('g', { ...p, ref }))
11
- export const Image = forwardRef((p, ref) => createElement('image', { ...p, ref }))
12
- export const Line = forwardRef((p, ref) => createElement('line', { ...p, ref }))
13
- export const LinearGradient = forwardRef((p, ref) =>
14
- createElement('linearGradient', { ...p, ref })
15
- )
16
- export const Marker = forwardRef((p, ref) => createElement('marker', { ...p, ref }))
17
- export const Mask = forwardRef((p, ref) => createElement('mask', { ...p, ref }))
18
- export const Path = forwardRef((p, ref) => createElement('path', { ...p, ref }))
19
- export const Pattern = forwardRef((p, ref) => createElement('pattern', { ...p, ref }))
20
- export const Polygon = forwardRef((p, ref) => createElement('polygon', { ...p, ref }))
21
- export const Polyline = forwardRef((p, ref) => createElement('polyline', { ...p, ref }))
22
- export const RadialGradient = forwardRef((p, ref) =>
23
- createElement('radialGradient', { ...p, ref })
24
- )
25
- export const Rect = forwardRef((p, ref) => createElement('rect', { ...p, ref }))
26
- export const Shape = forwardRef((p, ref) => createElement('shape', { ...p, ref }))
27
- export const Stop = forwardRef((p, ref) => createElement('stop', { ...p, ref }))
28
- export const Svg = forwardRef((p, ref) => createElement('svg', { ...p, ref }))
29
- export const Symbol = forwardRef((p, ref) => createElement('symbol', { ...p, ref }))
30
- export const Text = forwardRef((p, ref) => createElement('text', { ...p, ref }))
31
- export const TextPath = forwardRef((p, ref) => createElement('clipPath', { ...p, ref }))
32
- export const TSpan = forwardRef((p, ref) => createElement('tSpan', { ...p, ref }))
33
- export const Use = forwardRef((p, ref) => createElement('use', { ...p, ref }))
3
+ // react-native props that have no DOM spelling. react-native-svg's own web
4
+ // build runs props through react-native-web's createDOMProps, which performs
5
+ // this translation; without it these land on the svg element verbatim and
6
+ // React warns ("React does not recognize the testID prop on a DOM element").
7
+ const toDOMProps = (props) => {
8
+ const { testID, accessibilityLabel, ...rest } = props
9
+ if (testID !== undefined) rest['data-testid'] = testID
10
+ if (accessibilityLabel !== undefined) rest['aria-label'] = accessibilityLabel
11
+ return rest
12
+ }
13
+
14
+ const svgElement = (tag) =>
15
+ forwardRef((props, ref) => createElement(tag, { ...toDOMProps(props), ref }))
16
+
17
+ export const Circle = svgElement('circle')
18
+ export const ClipPath = svgElement('clipPath')
19
+ export const Defs = svgElement('defs')
20
+ export const Ellipse = svgElement('ellipse')
21
+ export const ForeignObject = svgElement('foreignObject')
22
+ export const G = svgElement('g')
23
+ export const Image = svgElement('image')
24
+ export const Line = svgElement('line')
25
+ export const LinearGradient = svgElement('linearGradient')
26
+ export const Marker = svgElement('marker')
27
+ export const Mask = svgElement('mask')
28
+ export const Path = svgElement('path')
29
+ export const Pattern = svgElement('pattern')
30
+ export const Polygon = svgElement('polygon')
31
+ export const Polyline = svgElement('polyline')
32
+ export const RadialGradient = svgElement('radialGradient')
33
+ export const Rect = svgElement('rect')
34
+ export const Shape = svgElement('shape')
35
+ export const Stop = svgElement('stop')
36
+ export const Svg = svgElement('svg')
37
+ export const Symbol = svgElement('symbol')
38
+ export const Text = svgElement('text')
39
+ export const TextPath = svgElement('clipPath')
40
+ export const TSpan = svgElement('tSpan')
41
+ export const Use = svgElement('use')
34
42
 
35
43
  export default Svg