@hero-design/rn 7.19.0 → 7.20.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.
Files changed (183) hide show
  1. package/.eslintrc.json +6 -1
  2. package/.turbo/turbo-build.log +2 -2
  3. package/es/index.js +612 -242
  4. package/lib/index.js +612 -241
  5. package/package.json +4 -4
  6. package/src/components/Alert/StyledAlert.tsx +5 -5
  7. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +140 -19
  8. package/src/components/Alert/__tests__/index.spec.tsx +21 -0
  9. package/src/components/Alert/index.tsx +13 -6
  10. package/src/components/Avatar/StyledAvatar.tsx +2 -1
  11. package/src/components/Avatar/index.tsx +2 -1
  12. package/src/components/Box/StyledBox.tsx +54 -0
  13. package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +605 -0
  14. package/src/components/Box/__tests__/helpers.spec.ts +14 -0
  15. package/src/components/Box/__tests__/index.spec.tsx +155 -0
  16. package/src/components/Box/config.ts +201 -0
  17. package/src/components/Box/helpers.ts +10 -0
  18. package/src/components/Box/index.tsx +13 -0
  19. package/src/components/Box/types.ts +38 -0
  20. package/src/components/Calendar/__tests__/index.spec.tsx +13 -17
  21. package/src/components/Card/DataCard/StyledDataCard.tsx +8 -2
  22. package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +1 -0
  23. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +16 -0
  24. package/src/components/Card/DataCard/index.tsx +1 -1
  25. package/src/components/Card/StyledCard.tsx +12 -19
  26. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +147 -0
  27. package/src/components/Card/__tests__/index.spec.tsx +18 -0
  28. package/src/components/Card/index.tsx +6 -1
  29. package/src/components/Drawer/DragableDrawer/helpers.ts +3 -4
  30. package/src/components/FAB/ActionGroup/index.tsx +6 -8
  31. package/src/components/RichTextEditor/EditorToolbar.tsx +19 -18
  32. package/src/components/RichTextEditor/RichTextEditor.tsx +7 -2
  33. package/src/components/RichTextEditor/StyledRichTextEditor.ts +0 -2
  34. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +11 -12
  35. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +2 -10
  36. package/src/components/RichTextEditor/constants.ts +0 -11
  37. package/src/components/RichTextEditor/index.tsx +0 -3
  38. package/src/components/RichTextEditor/types.ts +9 -0
  39. package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
  40. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  41. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
  42. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  43. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
  44. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  45. package/src/components/Spinner/AnimatedSpinner.tsx +7 -7
  46. package/src/components/Spinner/StyledSpinner.tsx +24 -19
  47. package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +1 -1
  48. package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +32 -16
  49. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +14 -12
  50. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +273 -31
  51. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +14 -12
  52. package/src/components/Spinner/index.tsx +10 -2
  53. package/src/components/Tabs/ScrollableTabs.tsx +9 -4
  54. package/src/components/Tabs/StyledScrollableTabs.tsx +6 -5
  55. package/src/components/Tabs/StyledTabs.tsx +6 -0
  56. package/src/components/Tabs/TabWithBadge.tsx +68 -0
  57. package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +13 -0
  58. package/src/components/Tabs/__tests__/TabWithBadge.spec.tsx +48 -0
  59. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +205 -43
  60. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +165 -0
  61. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +135 -34
  62. package/src/components/Tabs/__tests__/index.spec.tsx +12 -0
  63. package/src/components/Tabs/index.tsx +11 -4
  64. package/src/components/Tag/StyledTag.tsx +1 -11
  65. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +4 -4
  66. package/src/components/Tag/index.tsx +2 -2
  67. package/src/components/TextInput/__tests__/index.spec.tsx +10 -14
  68. package/src/components/Toast/StyledToast.tsx +13 -7
  69. package/src/components/Toast/Toast.tsx +34 -9
  70. package/src/components/Toast/ToastProvider.tsx +15 -12
  71. package/src/components/Toast/__tests__/Toast.spec.tsx +17 -0
  72. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +299 -19
  73. package/src/components/Toast/types.ts +15 -1
  74. package/src/components/Typography/Text/StyledText.tsx +7 -1
  75. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
  76. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
  77. package/src/components/Typography/Text/index.tsx +7 -1
  78. package/src/index.ts +2 -0
  79. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +76 -23
  80. package/src/theme/components/.eslintrc.json +10 -0
  81. package/src/theme/components/alert.ts +5 -1
  82. package/src/theme/components/avatar.ts +2 -0
  83. package/src/theme/components/card.ts +6 -7
  84. package/src/theme/components/sectionHeading.ts +1 -1
  85. package/src/theme/components/spinner.ts +19 -7
  86. package/src/theme/components/tabs.ts +3 -2
  87. package/src/theme/components/tag.ts +13 -13
  88. package/src/theme/components/toast.ts +17 -3
  89. package/src/theme/components/typography.ts +2 -0
  90. package/src/theme/global/colors/swag.ts +23 -0
  91. package/src/theme/global/colors/types.ts +23 -0
  92. package/src/theme/global/colors/work.ts +5 -0
  93. package/src/types.ts +0 -2
  94. package/tsconfig.json +4 -15
  95. package/types/components/Accordion/StyledAccordion.d.ts +14 -14
  96. package/types/components/Alert/StyledAlert.d.ts +16 -16
  97. package/types/components/Alert/index.d.ts +1 -1
  98. package/types/components/Avatar/StyledAvatar.d.ts +16 -16
  99. package/types/components/Avatar/index.d.ts +2 -2
  100. package/types/components/Badge/StyledBadge.d.ts +7 -7
  101. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
  102. package/types/components/BottomSheet/Header.d.ts +1 -1
  103. package/types/components/BottomSheet/StyledBottomSheet.d.ts +19 -19
  104. package/types/components/Box/StyledBox.d.ts +15 -0
  105. package/types/components/Box/__tests__/helpers.spec.d.ts +1 -0
  106. package/types/components/Box/__tests__/index.spec.d.ts +1 -0
  107. package/types/components/Box/config.d.ts +170 -0
  108. package/types/components/Box/helpers.d.ts +1 -0
  109. package/types/components/Box/index.d.ts +5 -0
  110. package/types/components/Box/types.d.ts +31 -0
  111. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
  112. package/types/components/Button/StyledButton.d.ts +16 -16
  113. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
  114. package/types/components/Calendar/StyledCalendar.d.ts +25 -25
  115. package/types/components/Calendar/helpers.d.ts +2 -2
  116. package/types/components/Card/DataCard/StyledDataCard.d.ts +7 -7
  117. package/types/components/Card/DataCard/index.d.ts +1 -1
  118. package/types/components/Card/StyledCard.d.ts +7 -6
  119. package/types/components/Card/index.d.ts +5 -1
  120. package/types/components/Checkbox/StyledCheckbox.d.ts +10 -10
  121. package/types/components/Collapse/StyledCollapse.d.ts +8 -8
  122. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
  123. package/types/components/DatePicker/StyledDatePicker.d.ts +3 -3
  124. package/types/components/Divider/StyledDivider.d.ts +5 -5
  125. package/types/components/Drawer/StyledDrawer.d.ts +19 -19
  126. package/types/components/Empty/StyledEmpty.d.ts +12 -12
  127. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +11 -11
  128. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +7 -7
  129. package/types/components/FAB/StyledFAB.d.ts +8 -8
  130. package/types/components/Icon/HeroIcon/index.d.ts +3 -3
  131. package/types/components/List/StyledBasicListItem.d.ts +14 -14
  132. package/types/components/List/StyledListItem.d.ts +23 -23
  133. package/types/components/PinInput/StyledPinInput.d.ts +30 -30
  134. package/types/components/Progress/StyledProgressBar.d.ts +5 -5
  135. package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
  136. package/types/components/Radio/StyledRadio.d.ts +9 -9
  137. package/types/components/RichTextEditor/EditorToolbar.d.ts +2 -2
  138. package/types/components/RichTextEditor/MentionList.d.ts +1 -1
  139. package/types/components/RichTextEditor/RichTextEditor.d.ts +4 -0
  140. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
  141. package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
  142. package/types/components/RichTextEditor/constants.d.ts +0 -10
  143. package/types/components/RichTextEditor/index.d.ts +2 -4
  144. package/types/components/RichTextEditor/types.d.ts +1 -0
  145. package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
  146. package/types/components/Select/MultiSelect/Option.d.ts +1 -1
  147. package/types/components/Select/SingleSelect/Option.d.ts +1 -1
  148. package/types/components/Select/StyledSelect.d.ts +11 -11
  149. package/types/components/Select/helpers.d.ts +1 -1
  150. package/types/components/Spinner/AnimatedSpinner.d.ts +3 -1
  151. package/types/components/Spinner/StyledSpinner.d.ts +14 -12
  152. package/types/components/Spinner/index.d.ts +5 -1
  153. package/types/components/Switch/StyledSwitch.d.ts +5 -5
  154. package/types/components/Tabs/StyledScrollableTabs.d.ts +24 -22
  155. package/types/components/Tabs/StyledTabs.d.ts +26 -20
  156. package/types/components/Tabs/TabWithBadge.d.ts +17 -0
  157. package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +1 -0
  158. package/types/components/Tabs/index.d.ts +3 -1
  159. package/types/components/Tag/StyledTag.d.ts +6 -6
  160. package/types/components/Tag/index.d.ts +1 -1
  161. package/types/components/TextInput/StyledTextInput.d.ts +44 -44
  162. package/types/components/TextInput/index.d.ts +5 -5
  163. package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
  164. package/types/components/Toast/StyledToast.d.ts +19 -18
  165. package/types/components/Toast/types.d.ts +2 -1
  166. package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
  167. package/types/components/Typography/Text/StyledText.d.ts +4 -4
  168. package/types/components/Typography/Text/index.d.ts +1 -1
  169. package/types/index.d.ts +2 -1
  170. package/types/testHelpers/renderWithTheme.d.ts +1 -1
  171. package/types/theme/ThemeSwitcher.d.ts +1 -1
  172. package/types/theme/components/alert.d.ts +5 -1
  173. package/types/theme/components/avatar.d.ts +2 -0
  174. package/types/theme/components/card.d.ts +6 -7
  175. package/types/theme/components/spinner.d.ts +17 -5
  176. package/types/theme/components/tabs.d.ts +1 -0
  177. package/types/theme/components/tag.d.ts +2 -2
  178. package/types/theme/components/toast.d.ts +18 -2
  179. package/types/theme/components/typography.d.ts +2 -0
  180. package/types/theme/global/colors/types.d.ts +17 -0
  181. package/types/theme/global/index.d.ts +17 -0
  182. package/types/types.d.ts +1 -2
  183. package/types/utils/hooks.d.ts +1 -1
@@ -0,0 +1,605 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Box allows flex props 1`] = `
4
+ <View
5
+ alignContent="center"
6
+ alignItems="flex-end"
7
+ alignSelf="baseline"
8
+ display="flex"
9
+ flex={1}
10
+ flexBasis={20}
11
+ flexDirection="row"
12
+ flexGrow={3}
13
+ flexShrink={5}
14
+ flexWrap="wrap"
15
+ justifyContent="space-around"
16
+ style={
17
+ Array [
18
+ Object {
19
+ "alignContent": "center",
20
+ "alignItems": "flex-end",
21
+ "alignSelf": "baseline",
22
+ "display": "flex",
23
+ "flex": 1,
24
+ "flexBasis": 20,
25
+ "flexDirection": "row",
26
+ "flexGrow": 3,
27
+ "flexShrink": 5,
28
+ "flexWrap": "wrap",
29
+ "justifyContent": "space-around",
30
+ },
31
+ undefined,
32
+ ]
33
+ }
34
+ />
35
+ `;
36
+
37
+ exports[`Box map prop to valid property and correct color from theme 1`] = `
38
+ <View
39
+ backgroundColor="warning"
40
+ borderBottomColor="warning"
41
+ borderColor="warning"
42
+ borderEndColor="warning"
43
+ borderLeftColor="warning"
44
+ borderRightColor="warning"
45
+ borderStartColor="warning"
46
+ borderTopColor="warning"
47
+ style={
48
+ Array [
49
+ Object {
50
+ "backgroundColor": "#ffbe71",
51
+ "borderBottomColor": "#ffbe71",
52
+ "borderColor": "#ffbe71",
53
+ "borderEndColor": "#ffbe71",
54
+ "borderLeftColor": "#ffbe71",
55
+ "borderRightColor": "#ffbe71",
56
+ "borderStartColor": "#ffbe71",
57
+ "borderTopColor": "#ffbe71",
58
+ },
59
+ undefined,
60
+ ]
61
+ }
62
+ />
63
+ `;
64
+
65
+ exports[`Box map prop to valid property and correct color from theme 2`] = `
66
+ <View
67
+ backgroundColor="danger"
68
+ borderBottomColor="danger"
69
+ borderColor="danger"
70
+ borderEndColor="danger"
71
+ borderLeftColor="danger"
72
+ borderRightColor="danger"
73
+ borderStartColor="danger"
74
+ borderTopColor="danger"
75
+ style={
76
+ Array [
77
+ Object {
78
+ "backgroundColor": "#de350b",
79
+ "borderBottomColor": "#de350b",
80
+ "borderColor": "#de350b",
81
+ "borderEndColor": "#de350b",
82
+ "borderLeftColor": "#de350b",
83
+ "borderRightColor": "#de350b",
84
+ "borderStartColor": "#de350b",
85
+ "borderTopColor": "#de350b",
86
+ },
87
+ undefined,
88
+ ]
89
+ }
90
+ />
91
+ `;
92
+
93
+ exports[`Box map prop to valid property and correct color from theme 3`] = `
94
+ <View
95
+ backgroundColor="success"
96
+ borderBottomColor="success"
97
+ borderColor="success"
98
+ borderEndColor="success"
99
+ borderLeftColor="success"
100
+ borderRightColor="success"
101
+ borderStartColor="success"
102
+ borderTopColor="success"
103
+ style={
104
+ Array [
105
+ Object {
106
+ "backgroundColor": "#5ace7d",
107
+ "borderBottomColor": "#5ace7d",
108
+ "borderColor": "#5ace7d",
109
+ "borderEndColor": "#5ace7d",
110
+ "borderLeftColor": "#5ace7d",
111
+ "borderRightColor": "#5ace7d",
112
+ "borderStartColor": "#5ace7d",
113
+ "borderTopColor": "#5ace7d",
114
+ },
115
+ undefined,
116
+ ]
117
+ }
118
+ />
119
+ `;
120
+
121
+ exports[`Box map prop to valid property and correct color from theme 4`] = `
122
+ <View
123
+ backgroundColor="backgroundDark"
124
+ borderBottomColor="backgroundDark"
125
+ borderColor="backgroundDark"
126
+ borderEndColor="backgroundDark"
127
+ borderLeftColor="backgroundDark"
128
+ borderRightColor="backgroundDark"
129
+ borderStartColor="backgroundDark"
130
+ borderTopColor="backgroundDark"
131
+ style={
132
+ Array [
133
+ Object {
134
+ "backgroundColor": "#001f23",
135
+ "borderBottomColor": "#001f23",
136
+ "borderColor": "#001f23",
137
+ "borderEndColor": "#001f23",
138
+ "borderLeftColor": "#001f23",
139
+ "borderRightColor": "#001f23",
140
+ "borderStartColor": "#001f23",
141
+ "borderTopColor": "#001f23",
142
+ },
143
+ undefined,
144
+ ]
145
+ }
146
+ />
147
+ `;
148
+
149
+ exports[`Box map prop to valid property and correct radius from theme 1`] = `
150
+ <View
151
+ borderBottomEndRadius="base"
152
+ borderBottomLeftRadius="base"
153
+ borderBottomRightRadius="base"
154
+ borderBottomStartRadius="base"
155
+ borderRadius="base"
156
+ borderTopEndRadius="base"
157
+ borderTopLeftRadius="base"
158
+ borderTopRightRadius="base"
159
+ borderTopStartRadius="base"
160
+ style={
161
+ Array [
162
+ Object {
163
+ "borderBottomEndRadius": 4,
164
+ "borderBottomLeftRadius": 4,
165
+ "borderBottomRightRadius": 4,
166
+ "borderBottomStartRadius": 4,
167
+ "borderRadius": 4,
168
+ "borderTopEndRadius": 4,
169
+ "borderTopLeftRadius": 4,
170
+ "borderTopRightRadius": 4,
171
+ "borderTopStartRadius": 4,
172
+ },
173
+ undefined,
174
+ ]
175
+ }
176
+ />
177
+ `;
178
+
179
+ exports[`Box map prop to valid property and correct radius from theme 2`] = `
180
+ <View
181
+ borderBottomEndRadius="large"
182
+ borderBottomLeftRadius="large"
183
+ borderBottomRightRadius="large"
184
+ borderBottomStartRadius="large"
185
+ borderRadius="large"
186
+ borderTopEndRadius="large"
187
+ borderTopLeftRadius="large"
188
+ borderTopRightRadius="large"
189
+ borderTopStartRadius="large"
190
+ style={
191
+ Array [
192
+ Object {
193
+ "borderBottomEndRadius": 12,
194
+ "borderBottomLeftRadius": 12,
195
+ "borderBottomRightRadius": 12,
196
+ "borderBottomStartRadius": 12,
197
+ "borderRadius": 12,
198
+ "borderTopEndRadius": 12,
199
+ "borderTopLeftRadius": 12,
200
+ "borderTopRightRadius": 12,
201
+ "borderTopStartRadius": 12,
202
+ },
203
+ undefined,
204
+ ]
205
+ }
206
+ />
207
+ `;
208
+
209
+ exports[`Box map prop to valid property and correct radius from theme 3`] = `
210
+ <View
211
+ borderBottomEndRadius="medium"
212
+ borderBottomLeftRadius="medium"
213
+ borderBottomRightRadius="medium"
214
+ borderBottomStartRadius="medium"
215
+ borderRadius="medium"
216
+ borderTopEndRadius="medium"
217
+ borderTopLeftRadius="medium"
218
+ borderTopRightRadius="medium"
219
+ borderTopStartRadius="medium"
220
+ style={
221
+ Array [
222
+ Object {
223
+ "borderBottomEndRadius": 8,
224
+ "borderBottomLeftRadius": 8,
225
+ "borderBottomRightRadius": 8,
226
+ "borderBottomStartRadius": 8,
227
+ "borderRadius": 8,
228
+ "borderTopEndRadius": 8,
229
+ "borderTopLeftRadius": 8,
230
+ "borderTopRightRadius": 8,
231
+ "borderTopStartRadius": 8,
232
+ },
233
+ undefined,
234
+ ]
235
+ }
236
+ />
237
+ `;
238
+
239
+ exports[`Box map prop to valid property and correct radius from theme 4`] = `
240
+ <View
241
+ borderBottomEndRadius="xlarge"
242
+ borderBottomLeftRadius="xlarge"
243
+ borderBottomRightRadius="xlarge"
244
+ borderBottomStartRadius="xlarge"
245
+ borderRadius="xlarge"
246
+ borderTopEndRadius="xlarge"
247
+ borderTopLeftRadius="xlarge"
248
+ borderTopRightRadius="xlarge"
249
+ borderTopStartRadius="xlarge"
250
+ style={
251
+ Array [
252
+ Object {
253
+ "borderBottomEndRadius": 16,
254
+ "borderBottomLeftRadius": 16,
255
+ "borderBottomRightRadius": 16,
256
+ "borderBottomStartRadius": 16,
257
+ "borderRadius": 16,
258
+ "borderTopEndRadius": 16,
259
+ "borderTopLeftRadius": 16,
260
+ "borderTopRightRadius": 16,
261
+ "borderTopStartRadius": 16,
262
+ },
263
+ undefined,
264
+ ]
265
+ }
266
+ />
267
+ `;
268
+
269
+ exports[`Box map prop to valid property and correct radius from theme 5`] = `
270
+ <View
271
+ borderBottomEndRadius="rounded"
272
+ borderBottomLeftRadius="rounded"
273
+ borderBottomRightRadius="rounded"
274
+ borderBottomStartRadius="rounded"
275
+ borderRadius="rounded"
276
+ borderTopEndRadius="rounded"
277
+ borderTopLeftRadius="rounded"
278
+ borderTopRightRadius="rounded"
279
+ borderTopStartRadius="rounded"
280
+ style={
281
+ Array [
282
+ Object {
283
+ "borderBottomEndRadius": 999,
284
+ "borderBottomLeftRadius": 999,
285
+ "borderBottomRightRadius": 999,
286
+ "borderBottomStartRadius": 999,
287
+ "borderRadius": 999,
288
+ "borderTopEndRadius": 999,
289
+ "borderTopLeftRadius": 999,
290
+ "borderTopRightRadius": 999,
291
+ "borderTopStartRadius": 999,
292
+ },
293
+ undefined,
294
+ ]
295
+ }
296
+ />
297
+ `;
298
+
299
+ exports[`Box map prop to valid property and correct space from theme 1`] = `
300
+ <View
301
+ margin="large"
302
+ marginBottom="large"
303
+ marginEnd="large"
304
+ marginHorizontal="large"
305
+ marginLeft="large"
306
+ marginRight="large"
307
+ marginStart="large"
308
+ marginTop="large"
309
+ marginVertical="large"
310
+ padding="large"
311
+ paddingBottom="large"
312
+ paddingEnd="large"
313
+ paddingHorizontal="large"
314
+ paddingLeft="large"
315
+ paddingRight="large"
316
+ paddingStart="large"
317
+ paddingTop="large"
318
+ paddingVertical="large"
319
+ style={
320
+ Array [
321
+ Object {
322
+ "margin": 24,
323
+ "marginBottom": 24,
324
+ "marginEnd": 24,
325
+ "marginHorizontal": 24,
326
+ "marginLeft": 24,
327
+ "marginRight": 24,
328
+ "marginStart": 24,
329
+ "marginTop": 24,
330
+ "marginVertical": 24,
331
+ "padding": 24,
332
+ "paddingBottom": 24,
333
+ "paddingEnd": 24,
334
+ "paddingHorizontal": 24,
335
+ "paddingLeft": 24,
336
+ "paddingRight": 24,
337
+ "paddingStart": 24,
338
+ "paddingTop": 24,
339
+ "paddingVertical": 24,
340
+ },
341
+ undefined,
342
+ ]
343
+ }
344
+ />
345
+ `;
346
+
347
+ exports[`Box map prop to valid property and correct space from theme 2`] = `
348
+ <View
349
+ margin="medium"
350
+ marginBottom="medium"
351
+ marginEnd="medium"
352
+ marginHorizontal="medium"
353
+ marginLeft="medium"
354
+ marginRight="medium"
355
+ marginStart="medium"
356
+ marginTop="medium"
357
+ marginVertical="medium"
358
+ padding="medium"
359
+ paddingBottom="medium"
360
+ paddingEnd="medium"
361
+ paddingHorizontal="medium"
362
+ paddingLeft="medium"
363
+ paddingRight="medium"
364
+ paddingStart="medium"
365
+ paddingTop="medium"
366
+ paddingVertical="medium"
367
+ style={
368
+ Array [
369
+ Object {
370
+ "margin": 16,
371
+ "marginBottom": 16,
372
+ "marginEnd": 16,
373
+ "marginHorizontal": 16,
374
+ "marginLeft": 16,
375
+ "marginRight": 16,
376
+ "marginStart": 16,
377
+ "marginTop": 16,
378
+ "marginVertical": 16,
379
+ "padding": 16,
380
+ "paddingBottom": 16,
381
+ "paddingEnd": 16,
382
+ "paddingHorizontal": 16,
383
+ "paddingLeft": 16,
384
+ "paddingRight": 16,
385
+ "paddingStart": 16,
386
+ "paddingTop": 16,
387
+ "paddingVertical": 16,
388
+ },
389
+ undefined,
390
+ ]
391
+ }
392
+ />
393
+ `;
394
+
395
+ exports[`Box map prop to valid property and correct space from theme 3`] = `
396
+ <View
397
+ margin="small"
398
+ marginBottom="small"
399
+ marginEnd="small"
400
+ marginHorizontal="small"
401
+ marginLeft="small"
402
+ marginRight="small"
403
+ marginStart="small"
404
+ marginTop="small"
405
+ marginVertical="small"
406
+ padding="small"
407
+ paddingBottom="small"
408
+ paddingEnd="small"
409
+ paddingHorizontal="small"
410
+ paddingLeft="small"
411
+ paddingRight="small"
412
+ paddingStart="small"
413
+ paddingTop="small"
414
+ paddingVertical="small"
415
+ style={
416
+ Array [
417
+ Object {
418
+ "margin": 8,
419
+ "marginBottom": 8,
420
+ "marginEnd": 8,
421
+ "marginHorizontal": 8,
422
+ "marginLeft": 8,
423
+ "marginRight": 8,
424
+ "marginStart": 8,
425
+ "marginTop": 8,
426
+ "marginVertical": 8,
427
+ "padding": 8,
428
+ "paddingBottom": 8,
429
+ "paddingEnd": 8,
430
+ "paddingHorizontal": 8,
431
+ "paddingLeft": 8,
432
+ "paddingRight": 8,
433
+ "paddingStart": 8,
434
+ "paddingTop": 8,
435
+ "paddingVertical": 8,
436
+ },
437
+ undefined,
438
+ ]
439
+ }
440
+ />
441
+ `;
442
+
443
+ exports[`Box map prop to valid property and correct space from theme 4`] = `
444
+ <View
445
+ margin="xlarge"
446
+ marginBottom="xlarge"
447
+ marginEnd="xlarge"
448
+ marginHorizontal="xlarge"
449
+ marginLeft="xlarge"
450
+ marginRight="xlarge"
451
+ marginStart="xlarge"
452
+ marginTop="xlarge"
453
+ marginVertical="xlarge"
454
+ padding="xlarge"
455
+ paddingBottom="xlarge"
456
+ paddingEnd="xlarge"
457
+ paddingHorizontal="xlarge"
458
+ paddingLeft="xlarge"
459
+ paddingRight="xlarge"
460
+ paddingStart="xlarge"
461
+ paddingTop="xlarge"
462
+ paddingVertical="xlarge"
463
+ style={
464
+ Array [
465
+ Object {
466
+ "margin": 32,
467
+ "marginBottom": 32,
468
+ "marginEnd": 32,
469
+ "marginHorizontal": 32,
470
+ "marginLeft": 32,
471
+ "marginRight": 32,
472
+ "marginStart": 32,
473
+ "marginTop": 32,
474
+ "marginVertical": 32,
475
+ "padding": 32,
476
+ "paddingBottom": 32,
477
+ "paddingEnd": 32,
478
+ "paddingHorizontal": 32,
479
+ "paddingLeft": 32,
480
+ "paddingRight": 32,
481
+ "paddingStart": 32,
482
+ "paddingTop": 32,
483
+ "paddingVertical": 32,
484
+ },
485
+ undefined,
486
+ ]
487
+ }
488
+ />
489
+ `;
490
+
491
+ exports[`Box map prop to valid property and correctborderWidth from theme 1`] = `
492
+ <View
493
+ borderBottomWidth="base"
494
+ borderLeftWidth="base"
495
+ borderRightWidth="base"
496
+ borderTopWidth="base"
497
+ borderWidth="base"
498
+ style={
499
+ Array [
500
+ Object {
501
+ "borderBottomWidth": 1,
502
+ "borderLeftWidth": 1,
503
+ "borderRightWidth": 1,
504
+ "borderTopWidth": 1,
505
+ "borderWidth": 1,
506
+ },
507
+ undefined,
508
+ ]
509
+ }
510
+ />
511
+ `;
512
+
513
+ exports[`Box map prop to valid property and correctborderWidth from theme 2`] = `
514
+ <View
515
+ borderBottomWidth="medium"
516
+ borderLeftWidth="medium"
517
+ borderRightWidth="medium"
518
+ borderTopWidth="medium"
519
+ borderWidth="medium"
520
+ style={
521
+ Array [
522
+ Object {
523
+ "borderBottomWidth": 2,
524
+ "borderLeftWidth": 2,
525
+ "borderRightWidth": 2,
526
+ "borderTopWidth": 2,
527
+ "borderWidth": 2,
528
+ },
529
+ undefined,
530
+ ]
531
+ }
532
+ />
533
+ `;
534
+
535
+ exports[`Box map prop with shortcut name to valid property and correct color from theme 1`] = `
536
+ <View
537
+ bgColor="warning"
538
+ style={
539
+ Array [
540
+ Object {
541
+ "backgroundColor": "#ffbe71",
542
+ },
543
+ undefined,
544
+ ]
545
+ }
546
+ />
547
+ `;
548
+
549
+ exports[`Box map prop with shortcut name to valid property and correct color from theme 2`] = `
550
+ <View
551
+ bgColor="danger"
552
+ style={
553
+ Array [
554
+ Object {
555
+ "backgroundColor": "#de350b",
556
+ },
557
+ undefined,
558
+ ]
559
+ }
560
+ />
561
+ `;
562
+
563
+ exports[`Box map prop with shortcut name to valid property and correct color from theme 3`] = `
564
+ <View
565
+ bgColor="success"
566
+ style={
567
+ Array [
568
+ Object {
569
+ "backgroundColor": "#5ace7d",
570
+ },
571
+ undefined,
572
+ ]
573
+ }
574
+ />
575
+ `;
576
+
577
+ exports[`Box map prop with shortcut name to valid property and correct color from theme 4`] = `
578
+ <View
579
+ bgColor="backgroundDark"
580
+ style={
581
+ Array [
582
+ Object {
583
+ "backgroundColor": "#001f23",
584
+ },
585
+ undefined,
586
+ ]
587
+ }
588
+ />
589
+ `;
590
+
591
+ exports[`Box renders content correctly 1`] = `
592
+ <View
593
+ style={
594
+ Array [
595
+ Object {},
596
+ undefined,
597
+ ]
598
+ }
599
+ testID="box-test-id"
600
+ >
601
+ <Text>
602
+ Box Content
603
+ </Text>
604
+ </View>
605
+ `;
@@ -0,0 +1,14 @@
1
+ import { pick } from '../helpers';
2
+
3
+ describe('pick', () => {
4
+ it('works', () => {
5
+ const keys = ['a', 'b', 'f'];
6
+ const props = { a: 1, b: true, c: 'outline', d: null, f: 'whatever' };
7
+
8
+ expect(pick(keys, props)).toEqual({
9
+ a: 1,
10
+ b: true,
11
+ f: 'whatever',
12
+ });
13
+ });
14
+ });