victory-core 36.4.1 → 36.5.0

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.
Files changed (227) hide show
  1. package/dist/victory-core.js +874 -879
  2. package/dist/victory-core.min.js +1 -1
  3. package/es/index.d.ts +38 -941
  4. package/es/index.js +19 -28
  5. package/es/types.d.ts +33 -0
  6. package/es/types.js +1 -0
  7. package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  8. package/es/victory-accessible-group/victory-accessible-group.js +8 -16
  9. package/es/victory-animation/util.d.ts +66 -0
  10. package/es/victory-animation/util.js +2 -1
  11. package/es/victory-animation/victory-animation.d.ts +69 -0
  12. package/es/victory-animation/victory-animation.js +59 -67
  13. package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
  14. package/es/victory-clip-container/victory-clip-container.js +15 -21
  15. package/es/victory-container/victory-container.d.ts +99 -0
  16. package/es/victory-container/victory-container.js +31 -31
  17. package/es/victory-label/victory-label.d.ts +61 -0
  18. package/es/victory-label/victory-label.js +13 -8
  19. package/es/victory-portal/portal-context.d.ts +11 -0
  20. package/es/victory-portal/portal-context.js +3 -4
  21. package/es/victory-portal/portal.d.ts +28 -0
  22. package/es/victory-portal/portal.js +25 -33
  23. package/es/victory-portal/victory-portal.d.ts +31 -0
  24. package/es/victory-portal/victory-portal.js +23 -22
  25. package/es/victory-primitives/arc.d.ts +21 -0
  26. package/es/victory-primitives/arc.js +3 -5
  27. package/es/victory-primitives/background.d.ts +22 -0
  28. package/es/victory-primitives/background.js +4 -6
  29. package/es/victory-primitives/border.d.ts +18 -0
  30. package/es/victory-primitives/border.js +3 -5
  31. package/es/victory-primitives/circle.d.ts +2 -0
  32. package/es/victory-primitives/circle.js +11 -8
  33. package/es/victory-primitives/clip-path.d.ts +14 -0
  34. package/es/victory-primitives/clip-path.js +6 -6
  35. package/es/victory-primitives/index.d.ts +14 -0
  36. package/es/victory-primitives/index.js +14 -0
  37. package/es/victory-primitives/line-segment.d.ts +19 -0
  38. package/es/victory-primitives/line-segment.js +3 -5
  39. package/es/victory-primitives/line.d.ts +2 -0
  40. package/es/victory-primitives/line.js +11 -8
  41. package/es/victory-primitives/path.d.ts +2 -0
  42. package/es/victory-primitives/path.js +9 -6
  43. package/es/victory-primitives/point.d.ts +21 -0
  44. package/es/victory-primitives/point.js +9 -19
  45. package/es/victory-primitives/rect.d.ts +2 -0
  46. package/es/victory-primitives/rect.js +11 -8
  47. package/es/victory-primitives/text.d.ts +16 -0
  48. package/es/victory-primitives/text.js +7 -6
  49. package/es/victory-primitives/tspan.d.ts +2 -0
  50. package/es/victory-primitives/tspan.js +7 -6
  51. package/es/victory-primitives/types.d.ts +7 -0
  52. package/es/victory-primitives/types.js +1 -0
  53. package/es/victory-primitives/whisker.d.ts +24 -0
  54. package/es/victory-primitives/whisker.js +3 -5
  55. package/es/victory-theme/grayscale.d.ts +2 -0
  56. package/es/victory-theme/grayscale.js +1 -1
  57. package/es/victory-theme/material.d.ts +2 -0
  58. package/es/victory-theme/material.js +1 -1
  59. package/es/victory-theme/victory-theme-definition.d.ts +244 -0
  60. package/es/victory-theme/victory-theme-definition.js +1 -0
  61. package/es/victory-theme/victory-theme.d.ts +5 -0
  62. package/es/victory-theme/victory-theme.js +6 -5
  63. package/es/victory-transition/victory-transition.d.ts +59 -0
  64. package/es/victory-transition/victory-transition.js +19 -23
  65. package/es/victory-util/add-events.js +6 -3
  66. package/es/victory-util/axis.js +0 -1
  67. package/es/victory-util/collection.js +0 -2
  68. package/es/victory-util/data.js +0 -2
  69. package/es/victory-util/default-transitions.js +0 -1
  70. package/es/victory-util/domain.js +0 -2
  71. package/es/victory-util/helpers.js +0 -2
  72. package/es/victory-util/immutable.js +0 -1
  73. package/es/victory-util/label-helpers.js +0 -2
  74. package/es/victory-util/log.js +0 -1
  75. package/es/victory-util/point-path-helpers.d.ts +9 -0
  76. package/es/victory-util/point-path-helpers.js +59 -61
  77. package/es/victory-util/selection.d.ts +23 -0
  78. package/es/victory-util/selection.js +0 -2
  79. package/es/victory-util/style.js +0 -2
  80. package/es/victory-util/textsize.d.ts +8 -0
  81. package/es/victory-util/timer-context.d.ts +11 -0
  82. package/es/victory-util/timer.d.ts +16 -0
  83. package/es/victory-util/timer.js +13 -8
  84. package/es/victory-util/types.d.ts +188 -0
  85. package/es/victory-util/types.js +1 -0
  86. package/lib/index.d.ts +38 -941
  87. package/lib/index.js +195 -193
  88. package/lib/types.d.ts +33 -0
  89. package/lib/types.js +1 -0
  90. package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  91. package/lib/victory-accessible-group/victory-accessible-group.js +9 -15
  92. package/lib/victory-animation/util.d.ts +66 -0
  93. package/lib/victory-animation/util.js +2 -1
  94. package/lib/victory-animation/victory-animation.d.ts +69 -0
  95. package/lib/victory-animation/victory-animation.js +60 -65
  96. package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
  97. package/lib/victory-clip-container/victory-clip-container.js +19 -22
  98. package/lib/victory-container/victory-container.d.ts +99 -0
  99. package/lib/victory-container/victory-container.js +34 -31
  100. package/lib/victory-label/victory-label.d.ts +61 -0
  101. package/lib/victory-label/victory-label.js +19 -13
  102. package/lib/victory-portal/portal-context.d.ts +11 -0
  103. package/lib/victory-portal/portal-context.js +3 -4
  104. package/lib/victory-portal/portal.d.ts +28 -0
  105. package/lib/victory-portal/portal.js +26 -31
  106. package/lib/victory-portal/victory-portal.d.ts +31 -0
  107. package/lib/victory-portal/victory-portal.js +24 -20
  108. package/lib/victory-primitives/arc.d.ts +21 -0
  109. package/lib/victory-primitives/arc.js +5 -6
  110. package/lib/victory-primitives/background.d.ts +22 -0
  111. package/lib/victory-primitives/background.js +7 -8
  112. package/lib/victory-primitives/border.d.ts +18 -0
  113. package/lib/victory-primitives/border.js +5 -6
  114. package/lib/victory-primitives/circle.d.ts +2 -0
  115. package/lib/victory-primitives/circle.js +11 -6
  116. package/lib/victory-primitives/clip-path.d.ts +14 -0
  117. package/lib/victory-primitives/clip-path.js +7 -5
  118. package/lib/victory-primitives/index.d.ts +14 -0
  119. package/lib/victory-primitives/index.js +187 -0
  120. package/lib/victory-primitives/line-segment.d.ts +19 -0
  121. package/lib/victory-primitives/line-segment.js +5 -6
  122. package/lib/victory-primitives/line.d.ts +2 -0
  123. package/lib/victory-primitives/line.js +11 -6
  124. package/lib/victory-primitives/path.d.ts +2 -0
  125. package/lib/victory-primitives/path.js +9 -4
  126. package/lib/victory-primitives/point.d.ts +21 -0
  127. package/lib/victory-primitives/point.js +13 -21
  128. package/lib/victory-primitives/rect.d.ts +2 -0
  129. package/lib/victory-primitives/rect.js +11 -6
  130. package/lib/victory-primitives/text.d.ts +16 -0
  131. package/lib/victory-primitives/text.js +8 -5
  132. package/lib/victory-primitives/tspan.d.ts +2 -0
  133. package/lib/victory-primitives/tspan.js +7 -4
  134. package/lib/victory-primitives/types.d.ts +7 -0
  135. package/lib/victory-primitives/types.js +1 -0
  136. package/lib/victory-primitives/whisker.d.ts +24 -0
  137. package/lib/victory-primitives/whisker.js +5 -6
  138. package/lib/victory-theme/grayscale.d.ts +2 -0
  139. package/lib/victory-theme/grayscale.js +3 -3
  140. package/lib/victory-theme/material.d.ts +2 -0
  141. package/lib/victory-theme/material.js +3 -3
  142. package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
  143. package/lib/victory-theme/victory-theme-definition.js +1 -0
  144. package/lib/victory-theme/victory-theme.d.ts +5 -0
  145. package/lib/victory-theme/victory-theme.js +22 -8
  146. package/lib/victory-transition/victory-transition.d.ts +59 -0
  147. package/lib/victory-transition/victory-transition.js +21 -23
  148. package/lib/victory-util/add-events.js +8 -4
  149. package/lib/victory-util/collection.js +0 -2
  150. package/lib/victory-util/default-transitions.js +0 -1
  151. package/lib/victory-util/helpers.js +0 -2
  152. package/lib/victory-util/immutable.js +0 -2
  153. package/lib/victory-util/label-helpers.js +0 -2
  154. package/lib/victory-util/log.js +0 -1
  155. package/lib/victory-util/point-path-helpers.d.ts +9 -0
  156. package/lib/victory-util/point-path-helpers.js +86 -73
  157. package/lib/victory-util/selection.d.ts +23 -0
  158. package/lib/victory-util/selection.js +0 -2
  159. package/lib/victory-util/style.js +0 -2
  160. package/lib/victory-util/textsize.d.ts +8 -0
  161. package/lib/victory-util/timer-context.d.ts +11 -0
  162. package/lib/victory-util/timer.d.ts +16 -0
  163. package/lib/victory-util/timer.js +13 -8
  164. package/lib/victory-util/types.d.ts +188 -0
  165. package/lib/victory-util/types.js +1 -0
  166. package/package.json +4 -4
  167. package/src/index.ts +42 -0
  168. package/src/types.ts +45 -0
  169. package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
  170. package/src/victory-animation/{util.js → util.ts} +4 -3
  171. package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +89 -12
  172. package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +29 -5
  173. package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
  174. package/src/victory-label/{victory-label.js → victory-label.tsx} +71 -14
  175. package/src/victory-portal/portal-context.ts +14 -0
  176. package/src/victory-portal/{portal.js → portal.tsx} +23 -12
  177. package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
  178. package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
  179. package/src/victory-primitives/{background.js → background.tsx} +17 -7
  180. package/src/victory-primitives/{border.js → border.tsx} +12 -5
  181. package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
  182. package/src/victory-primitives/clip-path.tsx +25 -0
  183. package/src/victory-primitives/index.ts +14 -0
  184. package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
  185. package/src/victory-primitives/{line.js → line.tsx} +4 -3
  186. package/src/victory-primitives/{path.js → path.tsx} +4 -3
  187. package/src/victory-primitives/{point.js → point.tsx} +25 -20
  188. package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
  189. package/src/victory-primitives/{text.js → text.tsx} +9 -3
  190. package/src/victory-primitives/tspan.tsx +7 -0
  191. package/src/victory-primitives/types.ts +19 -0
  192. package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
  193. package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
  194. package/src/victory-theme/{material.js → material.tsx} +2 -1
  195. package/src/victory-theme/victory-theme-definition.ts +261 -0
  196. package/src/victory-theme/victory-theme.tsx +5 -0
  197. package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
  198. package/src/victory-util/add-events.js +6 -1
  199. package/src/victory-util/axis.js +0 -1
  200. package/src/victory-util/collection.js +0 -1
  201. package/src/victory-util/data.js +0 -1
  202. package/src/victory-util/default-transitions.js +0 -1
  203. package/src/victory-util/domain.js +0 -1
  204. package/src/victory-util/events.js +1 -1
  205. package/src/victory-util/helpers.js +0 -1
  206. package/src/victory-util/immutable.js +0 -1
  207. package/src/victory-util/label-helpers.js +0 -1
  208. package/src/victory-util/log.js +0 -1
  209. package/src/victory-util/point-path-helpers.ts +119 -0
  210. package/src/victory-util/prop-types.js +0 -1
  211. package/src/victory-util/scale.js +0 -1
  212. package/src/victory-util/selection.d.ts +23 -0
  213. package/src/victory-util/selection.js +0 -1
  214. package/src/victory-util/style.js +0 -1
  215. package/src/victory-util/textsize.d.ts +8 -0
  216. package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
  217. package/src/victory-util/{timer.js → timer.ts} +19 -4
  218. package/src/victory-util/transitions.js +0 -1
  219. package/src/victory-util/types.ts +247 -0
  220. package/src/victory-util/wrapper.js +0 -1
  221. package/src/index.d.ts +0 -941
  222. package/src/index.js +0 -51
  223. package/src/victory-portal/portal-context.js +0 -10
  224. package/src/victory-primitives/clip-path.js +0 -18
  225. package/src/victory-primitives/tspan.js +0 -5
  226. package/src/victory-theme/victory-theme.js +0 -7
  227. package/src/victory-util/point-path-helpers.js +0 -121
package/lib/index.js CHANGED
@@ -3,109 +3,42 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "Arc", {
7
- enumerable: true,
8
- get: function () {
9
- return _arc.default;
10
- }
11
- });
6
+ var _exportNames = {
7
+ Box: true,
8
+ addEvents: true,
9
+ Collection: true,
10
+ Data: true,
11
+ DefaultTransitions: true,
12
+ Domain: true,
13
+ Events: true,
14
+ Helpers: true,
15
+ Immutable: true,
16
+ LabelHelpers: true,
17
+ Log: true,
18
+ PropTypes: true,
19
+ Scale: true,
20
+ Selection: true,
21
+ Style: true,
22
+ TextSize: true,
23
+ Transitions: true,
24
+ UserProps: true,
25
+ CommonProps: true,
26
+ Wrapper: true,
27
+ Axis: true,
28
+ Hooks: true,
29
+ LineHelpers: true,
30
+ Timer: true,
31
+ PointPathHelpers: true,
32
+ TimerContext: true
33
+ };
12
34
  exports.Axis = void 0;
13
- Object.defineProperty(exports, "Background", {
14
- enumerable: true,
15
- get: function () {
16
- return _background.default;
17
- }
18
- });
19
- Object.defineProperty(exports, "Border", {
20
- enumerable: true,
21
- get: function () {
22
- return _border.default;
23
- }
24
- });
25
35
  Object.defineProperty(exports, "Box", {
26
36
  enumerable: true,
27
37
  get: function () {
28
- return _border.default;
29
- }
30
- });
31
- Object.defineProperty(exports, "Circle", {
32
- enumerable: true,
33
- get: function () {
34
- return _circle.default;
38
+ return _victoryPrimitives.Border;
35
39
  }
36
40
  });
37
- Object.defineProperty(exports, "ClipPath", {
38
- enumerable: true,
39
- get: function () {
40
- return _clipPath.default;
41
- }
42
- });
43
- exports.LabelHelpers = exports.Immutable = exports.Hooks = exports.Helpers = exports.Events = exports.Domain = exports.DefaultTransitions = exports.Data = exports.CommonProps = exports.Collection = void 0;
44
- Object.defineProperty(exports, "Line", {
45
- enumerable: true,
46
- get: function () {
47
- return _line.default;
48
- }
49
- });
50
- exports.LineHelpers = void 0;
51
- Object.defineProperty(exports, "LineSegment", {
52
- enumerable: true,
53
- get: function () {
54
- return _lineSegment.default;
55
- }
56
- });
57
- exports.Log = void 0;
58
- Object.defineProperty(exports, "Path", {
59
- enumerable: true,
60
- get: function () {
61
- return _path.default;
62
- }
63
- });
64
- Object.defineProperty(exports, "Point", {
65
- enumerable: true,
66
- get: function () {
67
- return _point.default;
68
- }
69
- });
70
- Object.defineProperty(exports, "PointPathHelpers", {
71
- enumerable: true,
72
- get: function () {
73
- return _pointPathHelpers.default;
74
- }
75
- });
76
- Object.defineProperty(exports, "Portal", {
77
- enumerable: true,
78
- get: function () {
79
- return _portal.default;
80
- }
81
- });
82
- Object.defineProperty(exports, "PortalContext", {
83
- enumerable: true,
84
- get: function () {
85
- return _portalContext.default;
86
- }
87
- });
88
- exports.PropTypes = void 0;
89
- Object.defineProperty(exports, "Rect", {
90
- enumerable: true,
91
- get: function () {
92
- return _rect.default;
93
- }
94
- });
95
- exports.Style = exports.Selection = exports.Scale = void 0;
96
- Object.defineProperty(exports, "TSpan", {
97
- enumerable: true,
98
- get: function () {
99
- return _tspan.default;
100
- }
101
- });
102
- Object.defineProperty(exports, "Text", {
103
- enumerable: true,
104
- get: function () {
105
- return _text.default;
106
- }
107
- });
108
- exports.TextSize = void 0;
41
+ exports.TextSize = exports.Style = exports.Selection = exports.Scale = exports.PropTypes = exports.PointPathHelpers = exports.Log = exports.LineHelpers = exports.LabelHelpers = exports.Immutable = exports.Hooks = exports.Helpers = exports.Events = exports.Domain = exports.DefaultTransitions = exports.Data = exports.CommonProps = exports.Collection = void 0;
109
42
  Object.defineProperty(exports, "Timer", {
110
43
  enumerable: true,
111
44
  get: function () {
@@ -118,62 +51,7 @@ Object.defineProperty(exports, "TimerContext", {
118
51
  return _timerContext.default;
119
52
  }
120
53
  });
121
- exports.UserProps = exports.Transitions = void 0;
122
- Object.defineProperty(exports, "VictoryAccessibleGroup", {
123
- enumerable: true,
124
- get: function () {
125
- return _victoryAccessibleGroup.default;
126
- }
127
- });
128
- Object.defineProperty(exports, "VictoryAnimation", {
129
- enumerable: true,
130
- get: function () {
131
- return _victoryAnimation.default;
132
- }
133
- });
134
- Object.defineProperty(exports, "VictoryClipContainer", {
135
- enumerable: true,
136
- get: function () {
137
- return _victoryClipContainer.default;
138
- }
139
- });
140
- Object.defineProperty(exports, "VictoryContainer", {
141
- enumerable: true,
142
- get: function () {
143
- return _victoryContainer.default;
144
- }
145
- });
146
- Object.defineProperty(exports, "VictoryLabel", {
147
- enumerable: true,
148
- get: function () {
149
- return _victoryLabel.default;
150
- }
151
- });
152
- Object.defineProperty(exports, "VictoryPortal", {
153
- enumerable: true,
154
- get: function () {
155
- return _victoryPortal.default;
156
- }
157
- });
158
- Object.defineProperty(exports, "VictoryTheme", {
159
- enumerable: true,
160
- get: function () {
161
- return _victoryTheme.default;
162
- }
163
- });
164
- Object.defineProperty(exports, "VictoryTransition", {
165
- enumerable: true,
166
- get: function () {
167
- return _victoryTransition.default;
168
- }
169
- });
170
- Object.defineProperty(exports, "Whisker", {
171
- enumerable: true,
172
- get: function () {
173
- return _whisker.default;
174
- }
175
- });
176
- exports.Wrapper = void 0;
54
+ exports.Wrapper = exports.UserProps = exports.Transitions = void 0;
177
55
  Object.defineProperty(exports, "addEvents", {
178
56
  enumerable: true,
179
57
  get: function () {
@@ -181,49 +59,159 @@ Object.defineProperty(exports, "addEvents", {
181
59
  }
182
60
  });
183
61
 
184
- var _victoryAccessibleGroup = _interopRequireDefault(require("./victory-accessible-group/victory-accessible-group"));
185
-
186
- var _victoryAnimation = _interopRequireDefault(require("./victory-animation/victory-animation"));
187
-
188
- var _victoryContainer = _interopRequireDefault(require("./victory-container/victory-container"));
189
-
190
- var _victoryLabel = _interopRequireDefault(require("./victory-label/victory-label"));
191
-
192
- var _victoryTransition = _interopRequireDefault(require("./victory-transition/victory-transition"));
193
-
194
- var _victoryClipContainer = _interopRequireDefault(require("./victory-clip-container/victory-clip-container"));
195
-
196
- var _victoryTheme = _interopRequireDefault(require("./victory-theme/victory-theme"));
197
-
198
- var _victoryPortal = _interopRequireDefault(require("./victory-portal/victory-portal"));
199
-
200
- var _portal = _interopRequireDefault(require("./victory-portal/portal"));
201
-
202
- var _arc = _interopRequireDefault(require("./victory-primitives/arc"));
203
-
204
- var _background = _interopRequireDefault(require("./victory-primitives/background"));
205
-
206
- var _border = _interopRequireDefault(require("./victory-primitives/border"));
62
+ var _victoryAccessibleGroup = require("./victory-accessible-group/victory-accessible-group");
63
+
64
+ Object.keys(_victoryAccessibleGroup).forEach(function (key) {
65
+ if (key === "default" || key === "__esModule") return;
66
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
67
+ if (key in exports && exports[key] === _victoryAccessibleGroup[key]) return;
68
+ Object.defineProperty(exports, key, {
69
+ enumerable: true,
70
+ get: function () {
71
+ return _victoryAccessibleGroup[key];
72
+ }
73
+ });
74
+ });
207
75
 
208
- var _circle = _interopRequireDefault(require("./victory-primitives/circle"));
76
+ var _victoryAnimation = require("./victory-animation/victory-animation");
77
+
78
+ Object.keys(_victoryAnimation).forEach(function (key) {
79
+ if (key === "default" || key === "__esModule") return;
80
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
81
+ if (key in exports && exports[key] === _victoryAnimation[key]) return;
82
+ Object.defineProperty(exports, key, {
83
+ enumerable: true,
84
+ get: function () {
85
+ return _victoryAnimation[key];
86
+ }
87
+ });
88
+ });
209
89
 
210
- var _clipPath = _interopRequireDefault(require("./victory-primitives/clip-path"));
90
+ var _victoryContainer = require("./victory-container/victory-container");
91
+
92
+ Object.keys(_victoryContainer).forEach(function (key) {
93
+ if (key === "default" || key === "__esModule") return;
94
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
95
+ if (key in exports && exports[key] === _victoryContainer[key]) return;
96
+ Object.defineProperty(exports, key, {
97
+ enumerable: true,
98
+ get: function () {
99
+ return _victoryContainer[key];
100
+ }
101
+ });
102
+ });
211
103
 
212
- var _line = _interopRequireDefault(require("./victory-primitives/line"));
104
+ var _victoryLabel = require("./victory-label/victory-label");
105
+
106
+ Object.keys(_victoryLabel).forEach(function (key) {
107
+ if (key === "default" || key === "__esModule") return;
108
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
109
+ if (key in exports && exports[key] === _victoryLabel[key]) return;
110
+ Object.defineProperty(exports, key, {
111
+ enumerable: true,
112
+ get: function () {
113
+ return _victoryLabel[key];
114
+ }
115
+ });
116
+ });
213
117
 
214
- var _lineSegment = _interopRequireDefault(require("./victory-primitives/line-segment"));
118
+ var _victoryTransition = require("./victory-transition/victory-transition");
119
+
120
+ Object.keys(_victoryTransition).forEach(function (key) {
121
+ if (key === "default" || key === "__esModule") return;
122
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
123
+ if (key in exports && exports[key] === _victoryTransition[key]) return;
124
+ Object.defineProperty(exports, key, {
125
+ enumerable: true,
126
+ get: function () {
127
+ return _victoryTransition[key];
128
+ }
129
+ });
130
+ });
215
131
 
216
- var _path = _interopRequireDefault(require("./victory-primitives/path"));
132
+ var _victoryClipContainer = require("./victory-clip-container/victory-clip-container");
133
+
134
+ Object.keys(_victoryClipContainer).forEach(function (key) {
135
+ if (key === "default" || key === "__esModule") return;
136
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
137
+ if (key in exports && exports[key] === _victoryClipContainer[key]) return;
138
+ Object.defineProperty(exports, key, {
139
+ enumerable: true,
140
+ get: function () {
141
+ return _victoryClipContainer[key];
142
+ }
143
+ });
144
+ });
217
145
 
218
- var _point = _interopRequireDefault(require("./victory-primitives/point"));
146
+ var _victoryTheme = require("./victory-theme/victory-theme");
147
+
148
+ Object.keys(_victoryTheme).forEach(function (key) {
149
+ if (key === "default" || key === "__esModule") return;
150
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
151
+ if (key in exports && exports[key] === _victoryTheme[key]) return;
152
+ Object.defineProperty(exports, key, {
153
+ enumerable: true,
154
+ get: function () {
155
+ return _victoryTheme[key];
156
+ }
157
+ });
158
+ });
219
159
 
220
- var _rect = _interopRequireDefault(require("./victory-primitives/rect"));
160
+ var _portal = require("./victory-portal/portal");
161
+
162
+ Object.keys(_portal).forEach(function (key) {
163
+ if (key === "default" || key === "__esModule") return;
164
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
165
+ if (key in exports && exports[key] === _portal[key]) return;
166
+ Object.defineProperty(exports, key, {
167
+ enumerable: true,
168
+ get: function () {
169
+ return _portal[key];
170
+ }
171
+ });
172
+ });
221
173
 
222
- var _text = _interopRequireDefault(require("./victory-primitives/text"));
174
+ var _portalContext = require("./victory-portal/portal-context");
175
+
176
+ Object.keys(_portalContext).forEach(function (key) {
177
+ if (key === "default" || key === "__esModule") return;
178
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
179
+ if (key in exports && exports[key] === _portalContext[key]) return;
180
+ Object.defineProperty(exports, key, {
181
+ enumerable: true,
182
+ get: function () {
183
+ return _portalContext[key];
184
+ }
185
+ });
186
+ });
223
187
 
224
- var _tspan = _interopRequireDefault(require("./victory-primitives/tspan"));
188
+ var _victoryPortal = require("./victory-portal/victory-portal");
189
+
190
+ Object.keys(_victoryPortal).forEach(function (key) {
191
+ if (key === "default" || key === "__esModule") return;
192
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
193
+ if (key in exports && exports[key] === _victoryPortal[key]) return;
194
+ Object.defineProperty(exports, key, {
195
+ enumerable: true,
196
+ get: function () {
197
+ return _victoryPortal[key];
198
+ }
199
+ });
200
+ });
225
201
 
226
- var _whisker = _interopRequireDefault(require("./victory-primitives/whisker"));
202
+ var _victoryPrimitives = require("./victory-primitives");
203
+
204
+ Object.keys(_victoryPrimitives).forEach(function (key) {
205
+ if (key === "default" || key === "__esModule") return;
206
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
207
+ if (key in exports && exports[key] === _victoryPrimitives[key]) return;
208
+ Object.defineProperty(exports, key, {
209
+ enumerable: true,
210
+ get: function () {
211
+ return _victoryPrimitives[key];
212
+ }
213
+ });
214
+ });
227
215
 
228
216
  var _addEvents = _interopRequireDefault(require("./victory-util/add-events"));
229
217
 
@@ -283,8 +271,6 @@ var _TextSize = _interopRequireWildcard(require("./victory-util/textsize"));
283
271
 
284
272
  exports.TextSize = _TextSize;
285
273
 
286
- var _timer = _interopRequireDefault(require("./victory-util/timer"));
287
-
288
274
  var _Transitions = _interopRequireWildcard(require("./victory-util/transitions"));
289
275
 
290
276
  exports.Transitions = _Transitions;
@@ -305,10 +291,6 @@ var _Axis = _interopRequireWildcard(require("./victory-util/axis"));
305
291
 
306
292
  exports.Axis = _Axis;
307
293
 
308
- var _timerContext = _interopRequireDefault(require("./victory-util/timer-context"));
309
-
310
- var _portalContext = _interopRequireDefault(require("./victory-portal/portal-context"));
311
-
312
294
  var _Hooks = _interopRequireWildcard(require("./victory-util/hooks"));
313
295
 
314
296
  exports.Hooks = _Hooks;
@@ -317,7 +299,27 @@ var _LineHelpers = _interopRequireWildcard(require("./victory-util/line-helpers"
317
299
 
318
300
  exports.LineHelpers = _LineHelpers;
319
301
 
320
- var _pointPathHelpers = _interopRequireDefault(require("./victory-util/point-path-helpers"));
302
+ var _timer = _interopRequireDefault(require("./victory-util/timer"));
303
+
304
+ var _PointPathHelpers = _interopRequireWildcard(require("./victory-util/point-path-helpers"));
305
+
306
+ exports.PointPathHelpers = _PointPathHelpers;
307
+
308
+ var _timerContext = _interopRequireDefault(require("./victory-util/timer-context"));
309
+
310
+ var _types = require("./victory-util/types");
311
+
312
+ Object.keys(_types).forEach(function (key) {
313
+ if (key === "default" || key === "__esModule") return;
314
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
315
+ if (key in exports && exports[key] === _types[key]) return;
316
+ Object.defineProperty(exports, key, {
317
+ enumerable: true,
318
+ get: function () {
319
+ return _types[key];
320
+ }
321
+ });
322
+ });
321
323
 
322
324
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
323
325
 
package/lib/types.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ /**
2
+ * This is the first parameter of a callback when a callback is used to
3
+ * resolve the value of a property instead of a concrete value.
4
+ *
5
+ * Note that additional properties here like `scale`, `x`, `y`, etc are resolved
6
+ * values of properties from the VictoryXXXProps for each component.
7
+ */
8
+ import type { D3Scale } from "./victory-util/types";
9
+ export interface CallbackArgs {
10
+ active?: boolean;
11
+ data?: any;
12
+ datum?: any;
13
+ horizontal?: boolean;
14
+ index: number | string;
15
+ x?: number;
16
+ y?: number;
17
+ scale?: {
18
+ x?: D3Scale;
19
+ y?: D3Scale;
20
+ };
21
+ tick?: any;
22
+ ticks?: any;
23
+ text?: any;
24
+ }
25
+ export declare type VictoryStringOrNumberCallback = (args: CallbackArgs) => string | number;
26
+ export declare type VictoryStringCallback = (args: CallbackArgs) => string;
27
+ export declare type StringOrNumberOrCallback = string | number | VictoryStringOrNumberCallback;
28
+ export declare type StringOrCallback = string | VictoryStringCallback;
29
+ export declare type SliceNumberOrCallback<T, P extends string | number | symbol = never> = number | ((props: Omit<T, P>) => number);
30
+ export declare type CoordinatesPropType = {
31
+ x: number;
32
+ y: number;
33
+ };
package/lib/types.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ export interface VictoryAccessibleGroupProps {
4
+ desc?: string;
5
+ "aria-describedby"?: string;
6
+ "aria-label"?: string;
7
+ children?: React.ReactElement | React.ReactElement[];
8
+ className?: string;
9
+ tabIndex?: number;
10
+ }
11
+ export declare class VictoryAccessibleGroup extends React.Component<VictoryAccessibleGroupProps> {
12
+ static displayName: string;
13
+ static propTypes: {
14
+ "aria-describedby": PropTypes.Requireable<string>;
15
+ "aria-label": PropTypes.Requireable<string>;
16
+ children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
17
+ className: PropTypes.Requireable<string>;
18
+ desc: PropTypes.Requireable<string>;
19
+ tabIndex: PropTypes.Requireable<number>;
20
+ };
21
+ static defaultProps: {
22
+ className: string;
23
+ };
24
+ render(): JSX.Element;
25
+ }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.VictoryAccessibleGroup = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -19,7 +19,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
19
19
 
20
20
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
21
 
22
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
23
 
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
25
 
@@ -29,9 +29,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
29
29
 
30
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
31
 
32
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
-
34
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
32
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
33
 
36
34
  var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
37
35
  _inherits(VictoryAccessibleGroup, _React$Component);
@@ -72,20 +70,16 @@ var VictoryAccessibleGroup = /*#__PURE__*/function (_React$Component) {
72
70
  return VictoryAccessibleGroup;
73
71
  }(_react.default.Component);
74
72
 
75
- _defineProperty(VictoryAccessibleGroup, "displayName", "VictoryAccessibleGroup");
76
-
77
- _defineProperty(VictoryAccessibleGroup, "propTypes", {
73
+ exports.VictoryAccessibleGroup = VictoryAccessibleGroup;
74
+ VictoryAccessibleGroup.displayName = "VictoryAccessibleGroup";
75
+ VictoryAccessibleGroup.propTypes = {
78
76
  "aria-describedby": _propTypes.default.string,
79
77
  "aria-label": _propTypes.default.string,
80
78
  children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
81
79
  className: _propTypes.default.string,
82
80
  desc: _propTypes.default.string,
83
81
  tabIndex: _propTypes.default.number
84
- });
85
-
86
- _defineProperty(VictoryAccessibleGroup, "defaultProps", {
82
+ };
83
+ VictoryAccessibleGroup.defaultProps = {
87
84
  className: "VictoryAccessibleGroup"
88
- });
89
-
90
- var _default = VictoryAccessibleGroup;
91
- exports.default = _default;
85
+ };
@@ -0,0 +1,66 @@
1
+ export declare const isInterpolatable: (obj: any) => boolean;
2
+ /**
3
+ * Interpolate immediately to the end value at the given step `when`.
4
+ * Some nicer default behavior might be to jump at the halfway point or return
5
+ * `a` if `t` is 0 (instead of always returning `b`). But d3's default
6
+ * interpolator does not do these things:
7
+ *
8
+ * d3.interpolate('aaa', 'bbb')(0) === 'bbb'
9
+ *
10
+ * ...and things might get wonky if we don't replicate that behavior.
11
+ *
12
+ * @param {any} a - Start value.
13
+ * @param {any} b - End value.
14
+ * @param {Number} when - Step value (0 to 1) at which to jump to `b`.
15
+ * @returns {Function} An interpolation function.
16
+ */
17
+ export declare const interpolateImmediate: (a: any, b: any, when?: number) => (t: any) => any;
18
+ /**
19
+ * Interpolate to or from a function. The interpolated value will be a function
20
+ * that calls `a` (if it's a function) and `b` (if it's a function) and calls
21
+ * `d3.interpolate` on the resulting values. Note that our function won't
22
+ * necessarily be called (that's up to the component this eventually gets
23
+ * passed to) - but if it does get called, it will return an appropriately
24
+ * interpolated value.
25
+ *
26
+ * @param {any} a - Start value.
27
+ * @param {any} b - End value.
28
+ * @returns {Function} An interpolation function.
29
+ */
30
+ export declare const interpolateFunction: (a: any, b: any) => (t: any) => any;
31
+ /**
32
+ * Interpolate to or from an object. This method is a modification of the object interpolator in
33
+ * d3-interpolate https://github.com/d3/d3-interpolate/blob/master/src/object.js. This interpolator
34
+ * differs in that it uses our custom interpolators when interpolating the value of each property in
35
+ * an object. This allows the correct interpolation of nested objects, including styles
36
+ *
37
+ * @param {any} a - Start value.
38
+ * @param {any} b - End value.
39
+ * @returns {Function} An interpolation function.
40
+ */
41
+ export declare const interpolateObject: (a: any, b: any) => (t: any) => {};
42
+ export declare const interpolateString: (a: any, b: any) => any;
43
+ /**
44
+ * By default, the list of interpolators used by `d3.interpolate` has a few
45
+ * downsides:
46
+ *
47
+ * - `null` values get turned into 0.
48
+ * - `undefined`, `function`, and some other value types get turned into NaN.
49
+ * - Boolean types get turned into numbers, which probably will be meaningless
50
+ * to whatever is consuming them.
51
+ * - It tries to interpolate between identical start and end values, doing
52
+ * unnecessary calculations that sometimes result in floating point rounding
53
+ * errors.
54
+ *
55
+ * If only the default interpolators are used, `VictoryAnimation` will happily
56
+ * pass down NaN (and other bad) values as props to the wrapped component.
57
+ * The component will then either use the incorrect values or complain that it
58
+ * was passed props of the incorrect type. This custom interpolator is added
59
+ * using the `d3.interpolators` API, and prevents such cases from happening
60
+ * for most values.
61
+ *
62
+ * @param {any} a - Start value.
63
+ * @param {any} b - End value.
64
+ * @returns {Function|undefined} An interpolation function, if necessary.
65
+ */
66
+ export declare const victoryInterpolator: <T>(a: T, b: T) => (t: number) => T;
@@ -105,7 +105,7 @@ var interpolateFunction = function (a, b) {
105
105
  }
106
106
 
107
107
  return function () {
108
- /* eslint-disable no-invalid-this */
108
+ /* eslint-disable no-invalid-this, prefer-rest-params */
109
109
  var aval = typeof a === "function" ? a.apply(this, arguments) : a;
110
110
  var bval = typeof b === "function" ? b.apply(this, arguments) : b;
111
111
  return (0, _d3Interpolate.interpolate)(aval, bval)(t);
@@ -227,6 +227,7 @@ var victoryInterpolator = function (a, b) {
227
227
  }
228
228
 
229
229
  if ((0, _isPlainObject2.default)(a) || (0, _isPlainObject2.default)(b)) {
230
+ // @ts-expect-error These generics are tough, but they work ok?
230
231
  return interpolateObject(a, b);
231
232
  }
232
233