@hero-design/rn 7.12.1 → 7.14.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 (185) hide show
  1. package/.eslintrc.json +3 -1
  2. package/.turbo/turbo-build.log +3 -2
  3. package/assets/fonts/hero-icons.ttf +0 -0
  4. package/babel.config.js +16 -0
  5. package/es/index.js +35840 -16325
  6. package/lib/assets/fonts/hero-icons.ttf +0 -0
  7. package/lib/index.js +35847 -16327
  8. package/package.json +9 -4
  9. package/rollup.config.js +1 -0
  10. package/src/components/Accordion/AccordionItem.tsx +50 -0
  11. package/src/components/Accordion/StyledAccordion.tsx +29 -0
  12. package/src/components/Accordion/__tests__/AccordionItem.spec.tsx +56 -0
  13. package/src/components/Accordion/__tests__/StyledAccordion.spec.tsx +17 -0
  14. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +529 -0
  15. package/src/components/Accordion/__tests__/__snapshots__/StyledAccordion.spec.tsx.snap +33 -0
  16. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +822 -0
  17. package/src/components/Accordion/__tests__/index.spec.tsx +54 -0
  18. package/src/components/Accordion/index.tsx +82 -0
  19. package/src/components/Accordion/utils.tsx +11 -0
  20. package/src/components/Button/Button.tsx +64 -60
  21. package/src/components/Button/IconButton.tsx +1 -1
  22. package/src/components/Button/StyledButton.tsx +4 -6
  23. package/src/components/Button/__tests__/StyledButton.spec.tsx +11 -4
  24. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +312 -78
  25. package/src/components/Calendar/CalendarRowItem.tsx +54 -0
  26. package/src/components/Calendar/StyledCalendar.tsx +76 -0
  27. package/src/components/Calendar/__tests__/CalendarRowItem.spec.tsx +76 -0
  28. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +411 -0
  29. package/src/components/Calendar/__tests__/helper.spec.ts +50 -0
  30. package/src/components/Calendar/__tests__/index.spec.tsx +99 -0
  31. package/src/components/Calendar/helpers.ts +29 -0
  32. package/src/components/Calendar/index.tsx +217 -0
  33. package/src/components/Collapse/index.tsx +13 -15
  34. package/src/components/ContentNavigator/index.tsx +6 -0
  35. package/src/components/DatePicker/DatePickerAndroid.tsx +59 -0
  36. package/src/components/DatePicker/DatePickerIOS.tsx +87 -0
  37. package/src/components/DatePicker/StyledDatePicker.tsx +8 -0
  38. package/src/components/DatePicker/__tests__/DatePicker.spec.tsx +34 -0
  39. package/src/components/DatePicker/__tests__/DatePickerAndroid.spec.tsx +39 -0
  40. package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +46 -0
  41. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +199 -0
  42. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +513 -0
  43. package/src/components/DatePicker/index.tsx +15 -0
  44. package/src/components/DatePicker/types.ts +49 -0
  45. package/src/components/Empty/StyledEmpty.tsx +47 -0
  46. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +66 -0
  47. package/src/components/Empty/__tests__/index.spec.tsx +17 -0
  48. package/src/components/Empty/index.tsx +53 -0
  49. package/src/components/FAB/ActionGroup/ActionItem.tsx +6 -2
  50. package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -0
  51. package/src/components/FAB/ActionGroup/StyledActionItem.tsx +7 -1
  52. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +84 -22
  53. package/src/components/FAB/ActionGroup/index.tsx +8 -1
  54. package/src/components/Icon/HeroIcon/selection.json +1 -1
  55. package/src/components/Icon/IconList.ts +13 -0
  56. package/src/components/List/BasicListItem.tsx +44 -34
  57. package/src/components/List/ListItem.tsx +67 -58
  58. package/src/components/List/StyledBasicListItem.tsx +2 -3
  59. package/src/components/List/StyledListItem.tsx +2 -2
  60. package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +5 -2
  61. package/src/components/List/__tests__/StyledListItem.spec.tsx +4 -1
  62. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +15 -10
  63. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +52 -32
  64. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +128 -48
  65. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +132 -52
  66. package/src/components/RichTextEditor/EditorEvent.ts +7 -0
  67. package/src/components/RichTextEditor/EditorToolbar.tsx +220 -0
  68. package/src/components/RichTextEditor/MentionList.tsx +69 -0
  69. package/src/components/RichTextEditor/RichTextEditor.tsx +396 -0
  70. package/src/components/RichTextEditor/StyledRichTextEditor.ts +20 -0
  71. package/src/components/RichTextEditor/StyledToolbar.ts +32 -0
  72. package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +130 -0
  73. package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +109 -0
  74. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +245 -0
  75. package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +324 -0
  76. package/src/components/RichTextEditor/__tests__/__snapshots__/MentionList.spec.tsx.snap +45 -0
  77. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +526 -0
  78. package/src/components/RichTextEditor/constants.ts +20 -0
  79. package/src/components/RichTextEditor/hero-editor.d.ts +8 -0
  80. package/src/components/RichTextEditor/index.tsx +8 -0
  81. package/src/components/RichTextEditor/utils/events.ts +31 -0
  82. package/src/components/RichTextEditor/utils/rnWebView.ts +19 -0
  83. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +77 -0
  84. package/src/components/SectionHeading/__tests__/index.spec.tsx +14 -0
  85. package/src/components/SectionHeading/index.tsx +16 -9
  86. package/src/components/Tag/StyledTag.tsx +12 -2
  87. package/src/components/Tag/__tests__/Tag.spec.tsx +35 -8
  88. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +118 -4
  89. package/src/components/Tag/index.tsx +9 -2
  90. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +1 -0
  91. package/src/components/TimePicker/TimePickerIOS.tsx +1 -1
  92. package/src/components/TimePicker/types.ts +1 -1
  93. package/src/components/Typography/Text/StyledText.tsx +2 -1
  94. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
  95. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
  96. package/src/components/Typography/Text/index.tsx +2 -1
  97. package/src/index.ts +10 -0
  98. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +119 -4
  99. package/src/theme/components/accordion.ts +19 -0
  100. package/src/theme/components/button.ts +12 -0
  101. package/src/theme/components/calendar.ts +34 -0
  102. package/src/theme/components/card.ts +1 -1
  103. package/src/theme/components/datePicker.ts +11 -0
  104. package/src/theme/components/empty.ts +38 -0
  105. package/src/theme/components/fab.ts +4 -3
  106. package/src/theme/components/list.ts +1 -0
  107. package/src/theme/components/pinInput.ts +1 -1
  108. package/src/theme/components/richTextEditor.ts +34 -0
  109. package/src/theme/components/tag.ts +8 -2
  110. package/src/theme/components/typography.ts +1 -0
  111. package/src/theme/global/borders.ts +6 -6
  112. package/src/theme/global/colors.ts +5 -1
  113. package/src/theme/index.ts +15 -0
  114. package/testUtils/setup.tsx +17 -0
  115. package/types/components/Accordion/AccordionItem.d.ts +14 -0
  116. package/types/components/Accordion/StyledAccordion.d.ts +32 -0
  117. package/types/components/Accordion/__tests__/AccordionItem.spec.d.ts +1 -0
  118. package/types/components/Accordion/__tests__/StyledAccordion.spec.d.ts +1 -0
  119. package/types/components/Accordion/__tests__/index.spec.d.ts +1 -0
  120. package/types/components/Accordion/index.d.ts +38 -0
  121. package/types/components/Accordion/utils.d.ts +1 -0
  122. package/types/components/Button/IconButton.d.ts +1 -1
  123. package/types/components/Button/StyledButton.d.ts +3 -3
  124. package/types/components/Calendar/CalendarRowItem.d.ts +10 -0
  125. package/types/components/Calendar/StyledCalendar.d.ts +54 -0
  126. package/types/components/Calendar/__tests__/CalendarRowItem.spec.d.ts +1 -0
  127. package/types/components/Calendar/__tests__/helper.spec.d.ts +1 -0
  128. package/types/components/Calendar/__tests__/index.spec.d.ts +1 -0
  129. package/types/components/Calendar/helpers.d.ts +3 -0
  130. package/types/components/Calendar/index.d.ts +40 -0
  131. package/types/components/Collapse/index.d.ts +1 -1
  132. package/types/components/ContentNavigator/index.d.ts +5 -1
  133. package/types/components/DatePicker/DatePickerAndroid.d.ts +3 -0
  134. package/types/components/DatePicker/DatePickerIOS.d.ts +3 -0
  135. package/types/components/DatePicker/StyledDatePicker.d.ts +8 -0
  136. package/types/components/DatePicker/__tests__/DatePicker.spec.d.ts +1 -0
  137. package/types/components/DatePicker/__tests__/DatePickerAndroid.spec.d.ts +1 -0
  138. package/types/components/DatePicker/__tests__/DatePickerIOS.spec.d.ts +1 -0
  139. package/types/components/DatePicker/index.d.ts +3 -0
  140. package/types/components/DatePicker/types.d.ts +48 -0
  141. package/types/components/Empty/StyledEmpty.d.ts +31 -0
  142. package/types/components/Empty/__tests__/index.spec.d.ts +1 -0
  143. package/types/components/Empty/index.d.ts +26 -0
  144. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +6 -1
  145. package/types/components/FAB/ActionGroup/index.d.ts +6 -1
  146. package/types/components/FAB/index.d.ts +1 -1
  147. package/types/components/Icon/IconList.d.ts +1 -1
  148. package/types/components/Icon/utils.d.ts +1 -1
  149. package/types/components/List/StyledBasicListItem.d.ts +3 -3
  150. package/types/components/List/StyledListItem.d.ts +3 -3
  151. package/types/components/RichTextEditor/EditorEvent.d.ts +3 -0
  152. package/types/components/RichTextEditor/EditorToolbar.d.ts +17 -0
  153. package/types/components/RichTextEditor/MentionList.d.ts +12 -0
  154. package/types/components/RichTextEditor/RichTextEditor.d.ts +65 -0
  155. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +16 -0
  156. package/types/components/RichTextEditor/StyledToolbar.d.ts +21 -0
  157. package/types/components/RichTextEditor/__tests__/EditorToolbar.spec.d.ts +1 -0
  158. package/types/components/RichTextEditor/__tests__/MentionList.spec.d.ts +1 -0
  159. package/types/components/RichTextEditor/__tests__/RichTextEditor.spec.d.ts +1 -0
  160. package/types/components/RichTextEditor/constants.d.ts +19 -0
  161. package/types/components/RichTextEditor/index.d.ts +5 -0
  162. package/types/components/RichTextEditor/utils/events.d.ts +8 -0
  163. package/types/components/RichTextEditor/utils/rnWebView.d.ts +7 -0
  164. package/types/components/SectionHeading/index.d.ts +2 -2
  165. package/types/components/Select/MultiSelect/OptionList.d.ts +1 -1
  166. package/types/components/Select/SingleSelect/OptionList.d.ts +1 -1
  167. package/types/components/Tag/StyledTag.d.ts +1 -1
  168. package/types/components/Tag/index.d.ts +1 -1
  169. package/types/components/TimePicker/types.d.ts +1 -1
  170. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  171. package/types/components/Typography/Text/index.d.ts +1 -1
  172. package/types/index.d.ts +6 -1
  173. package/types/theme/components/accordion.d.ts +13 -0
  174. package/types/theme/components/button.d.ts +12 -0
  175. package/types/theme/components/calendar.d.ts +26 -0
  176. package/types/theme/components/datePicker.d.ts +6 -0
  177. package/types/theme/components/empty.d.ts +28 -0
  178. package/types/theme/components/fab.d.ts +1 -0
  179. package/types/theme/components/list.d.ts +1 -0
  180. package/types/theme/components/richTextEditor.d.ts +26 -0
  181. package/types/theme/components/tag.d.ts +8 -2
  182. package/types/theme/components/typography.d.ts +1 -0
  183. package/types/theme/global/colors.d.ts +5 -1
  184. package/types/theme/global/index.d.ts +5 -1
  185. package/types/theme/index.d.ts +10 -0
@@ -0,0 +1,513 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`DatePickerIOS renders correctly 1`] = `
4
+ <View
5
+ accessible={true}
6
+ focusable={true}
7
+ onClick={[Function]}
8
+ onResponderGrant={[Function]}
9
+ onResponderMove={[Function]}
10
+ onResponderRelease={[Function]}
11
+ onResponderTerminate={[Function]}
12
+ onResponderTerminationRequest={[Function]}
13
+ onStartShouldSetResponder={[Function]}
14
+ style={
15
+ Object {
16
+ "opacity": 1,
17
+ }
18
+ }
19
+ >
20
+ <View
21
+ pointerEvents="none"
22
+ testID="datePickerInputIOS"
23
+ >
24
+ <View
25
+ pointerEvents="auto"
26
+ style={
27
+ Array [
28
+ Object {
29
+ "marginVertical": 8,
30
+ "width": "100%",
31
+ },
32
+ undefined,
33
+ ]
34
+ }
35
+ >
36
+ <View
37
+ style={
38
+ Array [
39
+ Object {
40
+ "alignItems": "center",
41
+ "flexDirection": "row",
42
+ "padding": 16,
43
+ },
44
+ undefined,
45
+ ]
46
+ }
47
+ >
48
+ <View
49
+ style={
50
+ Array [
51
+ Object {
52
+ "borderColor": "#292a2b",
53
+ "borderRadius": 8,
54
+ "borderWidth": 1,
55
+ "bottom": 0,
56
+ "left": 0,
57
+ "position": "absolute",
58
+ "right": 0,
59
+ "top": 0,
60
+ },
61
+ undefined,
62
+ ]
63
+ }
64
+ themeVariant="filled"
65
+ />
66
+ <View
67
+ pointerEvents="none"
68
+ style={
69
+ Array [
70
+ Object {
71
+ "backgroundColor": "#ffffff",
72
+ "flexDirection": "row",
73
+ "left": 16,
74
+ "paddingHorizontal": 4,
75
+ "position": "absolute",
76
+ "top": -10,
77
+ "zIndex": 1,
78
+ },
79
+ undefined,
80
+ ]
81
+ }
82
+ >
83
+ <Text
84
+ style={
85
+ Array [
86
+ Object {
87
+ "color": "#292a2b",
88
+ "fontFamily": "BeVietnamPro-Regular",
89
+ "fontSize": 12,
90
+ "letterSpacing": 0.36,
91
+ "lineHeight": 20,
92
+ },
93
+ Array [
94
+ Object {
95
+ "color": "#292a2b",
96
+ },
97
+ undefined,
98
+ ],
99
+ ]
100
+ }
101
+ testID="input-label"
102
+ themeFontSize="small"
103
+ themeFontWeight="regular"
104
+ themeIntent="body"
105
+ themeVariant="filled"
106
+ >
107
+ Start date
108
+ </Text>
109
+ </View>
110
+ <View
111
+ style={
112
+ Array [
113
+ Object {
114
+ "alignItems": "center",
115
+ "alignSelf": "stretch",
116
+ "flexDirection": "row",
117
+ "flexGrow": 2,
118
+ },
119
+ undefined,
120
+ ]
121
+ }
122
+ >
123
+ <TextInput
124
+ accessibilityState={
125
+ Object {
126
+ "disabled": false,
127
+ }
128
+ }
129
+ editable={true}
130
+ onBlur={[Function]}
131
+ onChangeText={[Function]}
132
+ onFocus={[Function]}
133
+ style={
134
+ Array [
135
+ Object {
136
+ "alignSelf": "stretch",
137
+ "flexGrow": 2,
138
+ "fontSize": 14,
139
+ "marginHorizontal": 8,
140
+ "textAlignVertical": "center",
141
+ },
142
+ Object {
143
+ "color": "#292a2b",
144
+ },
145
+ ]
146
+ }
147
+ testID="text-input"
148
+ value="21/12/1995"
149
+ />
150
+ </View>
151
+ <HeroIcon
152
+ name="calendar-dates-outlined"
153
+ style={
154
+ Array [
155
+ Object {
156
+ "color": "#292a2b",
157
+ "fontSize": 16,
158
+ },
159
+ undefined,
160
+ ]
161
+ }
162
+ testID="input-suffix"
163
+ themeIntent="text"
164
+ themeSize="xsmall"
165
+ />
166
+ </View>
167
+ <View
168
+ style={
169
+ Array [
170
+ Object {
171
+ "paddingLeft": 16,
172
+ },
173
+ undefined,
174
+ ]
175
+ }
176
+ >
177
+ <View
178
+ style={
179
+ Array [
180
+ Object {
181
+ "flexDirection": "row",
182
+ "justifyContent": "space-between",
183
+ },
184
+ undefined,
185
+ ]
186
+ }
187
+ />
188
+ </View>
189
+ </View>
190
+ </View>
191
+ <RCTModalHostView
192
+ animationType="none"
193
+ hardwareAccelerated={false}
194
+ identifier={0}
195
+ onRequestClose={[Function]}
196
+ onStartShouldSetResponder={[Function]}
197
+ presentationStyle="overFullScreen"
198
+ style={
199
+ Object {
200
+ "position": "absolute",
201
+ }
202
+ }
203
+ transparent={true}
204
+ >
205
+ <View
206
+ collapsable={false}
207
+ style={
208
+ Array [
209
+ Object {
210
+ "flex": 1,
211
+ "left": 0,
212
+ "top": 0,
213
+ },
214
+ Object {
215
+ "backgroundColor": "transparent",
216
+ },
217
+ ]
218
+ }
219
+ >
220
+ <View
221
+ pointerEvents="box-none"
222
+ style={
223
+ Object {
224
+ "flex": 1,
225
+ }
226
+ }
227
+ >
228
+ <View
229
+ collapsable={true}
230
+ pointerEvents="box-none"
231
+ style={
232
+ Object {
233
+ "flex": 1,
234
+ }
235
+ }
236
+ >
237
+ <View
238
+ pointerEvents="box-none"
239
+ style={
240
+ Array [
241
+ Object {
242
+ "bottom": 0,
243
+ "flexDirection": "column-reverse",
244
+ "left": 0,
245
+ "position": "absolute",
246
+ "right": 0,
247
+ "top": 0,
248
+ },
249
+ undefined,
250
+ ]
251
+ }
252
+ >
253
+ <View
254
+ accessible={true}
255
+ collapsable={false}
256
+ focusable={true}
257
+ nativeID="animatedComponent"
258
+ onBlur={[Function]}
259
+ onClick={[Function]}
260
+ onFocus={[Function]}
261
+ onResponderGrant={[Function]}
262
+ onResponderMove={[Function]}
263
+ onResponderRelease={[Function]}
264
+ onResponderTerminate={[Function]}
265
+ onResponderTerminationRequest={[Function]}
266
+ onStartShouldSetResponder={[Function]}
267
+ style={
268
+ Object {
269
+ "backgroundColor": "#292a2b",
270
+ "bottom": 0,
271
+ "left": 0,
272
+ "opacity": 0.48,
273
+ "position": "absolute",
274
+ "right": 0,
275
+ "top": 0,
276
+ }
277
+ }
278
+ />
279
+ <View
280
+ collapsable={false}
281
+ nativeID="animatedComponent"
282
+ onLayout={[Function]}
283
+ style={
284
+ Object {
285
+ "backgroundColor": "#ffffff",
286
+ "borderTopLeftRadius": 16,
287
+ "borderTopRightRadius": 16,
288
+ "elevation": 10,
289
+ "maxHeight": "94%",
290
+ "shadowColor": "#292a2b",
291
+ "shadowOffset": Object {
292
+ "height": 3,
293
+ "width": 0,
294
+ },
295
+ "shadowOpacity": 0.27,
296
+ "shadowRadius": 4.65,
297
+ "transform": Array [
298
+ Object {
299
+ "scaleY": 0,
300
+ },
301
+ Object {
302
+ "translateY": 0,
303
+ },
304
+ ],
305
+ "width": "100%",
306
+ }
307
+ }
308
+ >
309
+ <View
310
+ style={
311
+ Array [
312
+ Object {
313
+ "flexDirection": "row",
314
+ "minHeight": 64,
315
+ },
316
+ undefined,
317
+ ]
318
+ }
319
+ >
320
+ <View
321
+ adjacentIcon={true}
322
+ style={
323
+ Array [
324
+ Object {
325
+ "flex": 1,
326
+ "justifyContent": "center",
327
+ "paddingLeft": 24,
328
+ "paddingRight": 0,
329
+ "paddingVertical": 8,
330
+ },
331
+ undefined,
332
+ ]
333
+ }
334
+ >
335
+ <Text
336
+ style={
337
+ Array [
338
+ Object {
339
+ "color": "#292a2b",
340
+ "fontFamily": "BeVietnamPro-SemiBold",
341
+ "fontSize": 16,
342
+ "letterSpacing": 0.48,
343
+ "lineHeight": 24,
344
+ },
345
+ undefined,
346
+ ]
347
+ }
348
+ themeFontSize="large"
349
+ themeFontWeight="semi-bold"
350
+ themeIntent="body"
351
+ >
352
+ Start date
353
+ </Text>
354
+ </View>
355
+ <View
356
+ style={
357
+ Array [
358
+ Object {
359
+ "alignItems": "center",
360
+ "justifyContent": "center",
361
+ "width": 72,
362
+ },
363
+ undefined,
364
+ ]
365
+ }
366
+ >
367
+ <View
368
+ accessible={true}
369
+ collapsable={false}
370
+ focusable={true}
371
+ nativeID="animatedComponent"
372
+ onClick={[Function]}
373
+ onResponderGrant={[Function]}
374
+ onResponderMove={[Function]}
375
+ onResponderRelease={[Function]}
376
+ onResponderTerminate={[Function]}
377
+ onResponderTerminationRequest={[Function]}
378
+ onStartShouldSetResponder={[Function]}
379
+ style={
380
+ Object {
381
+ "opacity": 1,
382
+ }
383
+ }
384
+ testID="bottom-sheet-close-icon"
385
+ >
386
+ <HeroIcon
387
+ name="cancel"
388
+ style={
389
+ Array [
390
+ Object {
391
+ "color": "#292a2b",
392
+ "fontSize": 24,
393
+ },
394
+ undefined,
395
+ ]
396
+ }
397
+ themeIntent="text"
398
+ themeSize="medium"
399
+ />
400
+ </View>
401
+ </View>
402
+ </View>
403
+ <View
404
+ style={
405
+ Array [
406
+ Object {
407
+ "borderBottomColor": "#dadbde",
408
+ "borderBottomWidth": 1,
409
+ "maxWidth": "100%",
410
+ },
411
+ undefined,
412
+ ]
413
+ }
414
+ />
415
+ <View
416
+ style={
417
+ Array [
418
+ Object {
419
+ "height": 176,
420
+ },
421
+ undefined,
422
+ ]
423
+ }
424
+ >
425
+ <Picker
426
+ display="spinner"
427
+ mode="date"
428
+ onChange={[Function]}
429
+ style={
430
+ Object {
431
+ "flex": 1,
432
+ }
433
+ }
434
+ testID="datePickerIOS"
435
+ value={1995-12-21T00:00:00.000Z}
436
+ />
437
+ </View>
438
+ <View>
439
+ <View
440
+ style={
441
+ Array [
442
+ Object {
443
+ "borderBottomColor": "#dadbde",
444
+ "borderBottomWidth": 1,
445
+ "maxWidth": "100%",
446
+ },
447
+ undefined,
448
+ ]
449
+ }
450
+ />
451
+ <View
452
+ style={
453
+ Array [
454
+ Object {
455
+ "alignItems": "center",
456
+ "flexDirection": "row",
457
+ "justifyContent": "flex-end",
458
+ "minHeight": 64,
459
+ "paddingHorizontal": 24,
460
+ "paddingVertical": 8,
461
+ },
462
+ undefined,
463
+ ]
464
+ }
465
+ >
466
+ <View
467
+ accessible={true}
468
+ collapsable={false}
469
+ focusable={true}
470
+ nativeID="animatedComponent"
471
+ onClick={[Function]}
472
+ onResponderGrant={[Function]}
473
+ onResponderMove={[Function]}
474
+ onResponderRelease={[Function]}
475
+ onResponderTerminate={[Function]}
476
+ onResponderTerminationRequest={[Function]}
477
+ onStartShouldSetResponder={[Function]}
478
+ style={
479
+ Object {
480
+ "opacity": 1,
481
+ }
482
+ }
483
+ >
484
+ <Text
485
+ style={
486
+ Array [
487
+ Object {
488
+ "color": "#7622d7",
489
+ "fontFamily": "BeVietnamPro-SemiBold",
490
+ "fontSize": 16,
491
+ "letterSpacing": 0.48,
492
+ "lineHeight": 24,
493
+ },
494
+ undefined,
495
+ ]
496
+ }
497
+ themeFontSize="large"
498
+ themeFontWeight="semi-bold"
499
+ themeIntent="primary"
500
+ >
501
+ Confirm
502
+ </Text>
503
+ </View>
504
+ </View>
505
+ </View>
506
+ </View>
507
+ </View>
508
+ </View>
509
+ </View>
510
+ </View>
511
+ </RCTModalHostView>
512
+ </View>
513
+ `;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Platform } from 'react-native';
3
+ import DatePickerAndroid from './DatePickerAndroid';
4
+ import DatePickerIOS from './DatePickerIOS';
5
+ import { DatePickerProps } from './types';
6
+
7
+ const DatePicker = (props: DatePickerProps) => {
8
+ if (Platform.OS === 'ios') {
9
+ return <DatePickerIOS {...props} />;
10
+ }
11
+
12
+ return <DatePickerAndroid {...props} />;
13
+ };
14
+
15
+ export default DatePicker;
@@ -0,0 +1,49 @@
1
+ import { StyleProp, ViewStyle } from 'react-native';
2
+
3
+ export interface DatePickerProps {
4
+ /**
5
+ * Date picker input label.
6
+ */
7
+ label: string;
8
+ /**
9
+ * Current date value. Must be in correct default format or format provided via format prop.
10
+ */
11
+ value?: Date;
12
+ /**
13
+ * Input placeholder. Date format will be used as placeholder if not specified.
14
+ */
15
+ placeholder?: string;
16
+ /**
17
+ * Callback that is called when new value is selected.
18
+ */
19
+ onChange: (value: Date) => void;
20
+ /**
21
+ * Confirm label text. iOS only.
22
+ */
23
+ confirmLabel: string;
24
+ /**
25
+ * Date format. Default format is dd/MM/yyyy.
26
+ * Following date-fns's format (https://date-fns.org/v2.16.1/docs/format).
27
+ */
28
+ displayFormat?: string;
29
+ /**
30
+ * Whether the Date picker is disabled.
31
+ */
32
+ disabled?: boolean;
33
+ /**
34
+ * Error message to display.
35
+ */
36
+ error?: string;
37
+ /**
38
+ * Whether the value is required, if true, an asterisk will be appended to the label.
39
+ */
40
+ required?: boolean;
41
+ /**
42
+ * Addtional style.
43
+ */
44
+ style?: StyleProp<ViewStyle>;
45
+ /**
46
+ * Testing id of the component..
47
+ */
48
+ testID?: string;
49
+ }
@@ -0,0 +1,47 @@
1
+ import { View, Text } from 'react-native';
2
+ import styled from '@emotion/native';
3
+
4
+ type ThemeVariant = 'light' | 'dark';
5
+
6
+ const StyledWrapper = styled(View)(() => ({
7
+ display: 'flex',
8
+ flex: 1,
9
+ flexDirection: 'column',
10
+ alignItems: 'center',
11
+ justifyContent: 'center',
12
+ }));
13
+
14
+ const StyledIllustration = styled(View)(({ theme }) => ({
15
+ height: theme.__hd__.empty.sizes.illustration,
16
+ width: theme.__hd__.empty.sizes.illustration,
17
+ borderRadius: theme.__hd__.empty.radii.illustration,
18
+ backgroundColor: theme.__hd__.empty.colors.illustrationBackground,
19
+ marginBottom: theme.__hd__.empty.space.large,
20
+ }));
21
+
22
+ const StyledTitle = styled(Text)<{ themeVariant: ThemeVariant }>(
23
+ ({ theme, themeVariant }) => ({
24
+ fontFamily: theme.__hd__.empty.fonts.title,
25
+ fontSize: theme.__hd__.empty.fontSizes.title,
26
+ textAlign: 'center',
27
+ marginBottom: theme.__hd__.empty.space.medium,
28
+ color:
29
+ themeVariant === 'dark'
30
+ ? theme.__hd__.empty.colors.invertedText
31
+ : theme.__hd__.empty.colors.text,
32
+ })
33
+ );
34
+
35
+ const StyledDescription = styled(Text)<{ themeVariant: ThemeVariant }>(
36
+ ({ theme, themeVariant }) => ({
37
+ fontFamily: theme.__hd__.empty.fonts.description,
38
+ fontSize: theme.__hd__.empty.fontSizes.description,
39
+ textAlign: 'center',
40
+ color:
41
+ themeVariant === 'dark'
42
+ ? theme.__hd__.empty.colors.invertedText
43
+ : theme.__hd__.empty.colors.subduedText,
44
+ })
45
+ );
46
+
47
+ export { StyledWrapper, StyledIllustration, StyledTitle, StyledDescription };
@@ -0,0 +1,66 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Empty renders empty state content correctly 1`] = `
4
+ <View
5
+ style={
6
+ Array [
7
+ Object {
8
+ "alignItems": "center",
9
+ "display": "flex",
10
+ "flex": 1,
11
+ "flexDirection": "column",
12
+ "justifyContent": "center",
13
+ },
14
+ undefined,
15
+ ]
16
+ }
17
+ >
18
+ <View
19
+ style={
20
+ Array [
21
+ Object {
22
+ "backgroundColor": "#dadbde",
23
+ "borderRadius": 999,
24
+ "height": 168,
25
+ "marginBottom": 24,
26
+ "width": 168,
27
+ },
28
+ undefined,
29
+ ]
30
+ }
31
+ />
32
+ <Text
33
+ style={
34
+ Array [
35
+ Object {
36
+ "color": "#292a2b",
37
+ "fontFamily": "BeVietnamPro-SemiBold",
38
+ "fontSize": 28,
39
+ "marginBottom": 16,
40
+ "textAlign": "center",
41
+ },
42
+ undefined,
43
+ ]
44
+ }
45
+ themeVariant="light"
46
+ >
47
+ You have no notification at this time
48
+ </Text>
49
+ <Text
50
+ style={
51
+ Array [
52
+ Object {
53
+ "color": "#727478",
54
+ "fontFamily": "BeVietnamPro-Light",
55
+ "fontSize": 16,
56
+ "textAlign": "center",
57
+ },
58
+ undefined,
59
+ ]
60
+ }
61
+ themeVariant="light"
62
+ >
63
+ We'll notify you later.
64
+ </Text>
65
+ </View>
66
+ `;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
4
+ import Empty from '..';
5
+
6
+ describe('Empty', () => {
7
+ it('renders empty state content correctly', () => {
8
+ const { toJSON } = renderWithTheme(
9
+ <Empty
10
+ title="You have no notification at this time"
11
+ description="We'll notify you later."
12
+ />
13
+ );
14
+
15
+ expect(toJSON()).toMatchSnapshot();
16
+ });
17
+ });