@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
@@ -3,6 +3,17 @@
3
3
  exports[`theme returns correct theme object 1`] = `
4
4
  Object {
5
5
  "__hd__": Object {
6
+ "accordion": Object {
7
+ "colors": Object {
8
+ "background": "#ffffff",
9
+ },
10
+ "radii": Object {
11
+ "card": 8,
12
+ },
13
+ "space": Object {
14
+ "padding": 16,
15
+ },
16
+ },
6
17
  "alert": Object {
7
18
  "borderWidths": Object {
8
19
  "base": 1,
@@ -145,6 +156,18 @@ Object {
145
156
  "pressedSecondary": "#d1d9fe",
146
157
  "primary": "#7622d7",
147
158
  "secondary": "#4568fb",
159
+ "underlayColors": Object {
160
+ "basic-transparent": "#c8a7ef",
161
+ "filled-danger": "#f2ae9d",
162
+ "filled-primary": "#c8a7ef",
163
+ "filled-secondary": "#d1d9fe",
164
+ "outlined-danger": "#fcebe7",
165
+ "outlined-primary": "#f1e9fb",
166
+ "outlined-secondary": "#ecf0ff",
167
+ "text-danger": "#fcebe7",
168
+ "text-primary": "#f1e9fb",
169
+ "text-secondary": "#ecf0ff",
170
+ },
148
171
  "utilityBackground": "#fafbfb",
149
172
  },
150
173
  "fontSize": Object {
@@ -172,6 +195,30 @@ Object {
172
195
  "utilityPadding": 8,
173
196
  },
174
197
  },
198
+ "calendar": Object {
199
+ "colors": Object {
200
+ "background": "#fafbfb",
201
+ "border": "#292a2b",
202
+ "inverted": "#ffffff",
203
+ "primary": "#7622d7",
204
+ },
205
+ "radii": Object {
206
+ "default": 999,
207
+ },
208
+ "sizes": Object {
209
+ "cellCircleHeight": 44,
210
+ "cellCircleWidth": 44,
211
+ "cellHeight": 48,
212
+ "cellWidth": 48,
213
+ "markHeight": 4,
214
+ "markWidth": 4,
215
+ },
216
+ "space": Object {
217
+ "headerHorizontalPadding": 12,
218
+ "headerVerticalPadding": 16,
219
+ "rowVerticalPadding": 16,
220
+ },
221
+ },
175
222
  "card": Object {
176
223
  "colors": Object {
177
224
  "dataCardIndicator": "#a26fb0",
@@ -214,6 +261,11 @@ Object {
214
261
  "valueHorizontalPadding": 8,
215
262
  },
216
263
  },
264
+ "datePicker": Object {
265
+ "sizes": Object {
266
+ "height": 176,
267
+ },
268
+ },
217
269
  "divider": Object {
218
270
  "borderWidths": Object {
219
271
  "default": 1,
@@ -248,12 +300,39 @@ Object {
248
300
  "radius": 4.65,
249
301
  },
250
302
  },
303
+ "empty": Object {
304
+ "colors": Object {
305
+ "illustrationBackground": "#dadbde",
306
+ "invertedText": "#ffffff",
307
+ "subduedText": "#727478",
308
+ "text": "#292a2b",
309
+ },
310
+ "fontSizes": Object {
311
+ "description": 16,
312
+ "title": 28,
313
+ },
314
+ "fonts": Object {
315
+ "description": "BeVietnamPro-Light",
316
+ "title": "BeVietnamPro-SemiBold",
317
+ },
318
+ "radii": Object {
319
+ "illustration": 999,
320
+ },
321
+ "sizes": Object {
322
+ "illustration": 168,
323
+ },
324
+ "space": Object {
325
+ "large": 24,
326
+ "medium": 16,
327
+ },
328
+ },
251
329
  "fab": Object {
252
330
  "colors": Object {
253
- "actionItemBackground": "#d1d9fe",
254
- "backdropBackground": "#ffffff",
331
+ "actionItemBackground": "#4d6265",
332
+ "actionItemText": "#ffffff",
333
+ "backdropBackground": "#292a2b",
255
334
  "buttonBackground": "#292a2b",
256
- "headerText": "#292a2b",
335
+ "headerText": "#ffffff",
257
336
  "icon": "#ffffff",
258
337
  "titleText": "#ffffff",
259
338
  },
@@ -319,6 +398,7 @@ Object {
319
398
  "list": Object {
320
399
  "colors": Object {
321
400
  "checkedListItemContainerBackground": "#f1e9fb",
401
+ "highlightedListItemContainerBackground": "#f1e9fb",
322
402
  "leadingStatus": Object {
323
403
  "archived": "#ccced1",
324
404
  "danger": "#de350b",
@@ -429,6 +509,30 @@ Object {
429
509
  "wrapperPadding": 16,
430
510
  },
431
511
  },
512
+ "richTextEditor": Object {
513
+ "borderWidths": Object {
514
+ "webViewBorderBottomWidth": 0.8,
515
+ },
516
+ "colors": Object {
517
+ "toolbarBackgroundColor": "#fafbfb",
518
+ "toolbarBorderColor": "#dadbde",
519
+ "toolbarButtonSelectedBackground": "#dadbde",
520
+ },
521
+ "fontSizes": Object {
522
+ "editor": 14,
523
+ },
524
+ "sizes": Object {
525
+ "editorMinHeight": 21,
526
+ "toolbarButtonSize": 48,
527
+ "toolbarSeparatorHeight": 16,
528
+ "toolbarSeparatorWidth": 1,
529
+ },
530
+ "space": Object {
531
+ "editorPadding": 16,
532
+ "toolbarHorizontalPadding": 8,
533
+ "wrapperMarginBottom": 16,
534
+ },
535
+ },
432
536
  "sectionHeading": Object {
433
537
  "colors": Object {
434
538
  "background": "#dadbde",
@@ -532,10 +636,16 @@ Object {
532
636
  "default": 1,
533
637
  },
534
638
  "colors": Object {
639
+ "archived": "#737479",
640
+ "archivedBackground": "#f1f2f3",
535
641
  "danger": "#de350b",
536
642
  "dangerBackground": "#fcebe7",
643
+ "default": "#292a2b",
644
+ "defaultBackground": undefined,
537
645
  "info": "#4568fb",
538
646
  "infoBackground": "#ecf0ff",
647
+ "primary": "#7622d7",
648
+ "primaryBackground": "#f1e9fb",
539
649
  "success": "#017d6d",
540
650
  "successBackground": "#f0fef4",
541
651
  "warning": "#d98a2c",
@@ -687,6 +797,7 @@ Object {
687
797
  "body": "#292a2b",
688
798
  "danger": "#de350b",
689
799
  "info": "#4568fb",
800
+ "inverted": "#ffffff",
690
801
  "primary": "#7622d7",
691
802
  "subdued": "#8b8d92",
692
803
  "success": "#01b39c",
@@ -719,7 +830,9 @@ Object {
719
830
  },
720
831
  "colors": Object {
721
832
  "archived": "#ccced1",
722
- "archivedDark": "#bfc1c5",
833
+ "archivedBackground": "#f1f2f3",
834
+ "archivedDark": "#737479",
835
+ "archivedLight": "#bfc1c5",
723
836
  "backgroundDark": "#292a2b",
724
837
  "backgroundLight": "#fafbfb",
725
838
  "black": "#000000",
@@ -739,9 +852,11 @@ Object {
739
852
  "platformBackground": "#ffffff",
740
853
  "primary": "#7622d7",
741
854
  "primaryBackground": "#f1e9fb",
855
+ "primaryBackgroundDark": "#4d6265",
742
856
  "primaryDark": "#a26fb0",
743
857
  "primaryLight": "#c8a7ef",
744
858
  "secondary": "#4568fb",
859
+ "secondaryBackground": "#ecf0ff",
745
860
  "secondaryLight": "#d1d9fe",
746
861
  "shadow": "#dadbde",
747
862
  "subduedText": "#727478",
@@ -0,0 +1,19 @@
1
+ import { GlobalTheme } from '../global';
2
+
3
+ const getAccordionTheme = (theme: GlobalTheme) => {
4
+ const colors = {
5
+ background: theme.colors.platformBackground,
6
+ };
7
+
8
+ const space = {
9
+ padding: theme.space.medium,
10
+ };
11
+
12
+ const radii = {
13
+ card: theme.radii.medium,
14
+ };
15
+
16
+ return { colors, space, radii };
17
+ };
18
+
19
+ export default getAccordionTheme;
@@ -48,6 +48,18 @@ const getButtonTheme = (theme: GlobalTheme) => {
48
48
  disabledBackground: theme.colors.disabledLightText,
49
49
  invertedText: theme.colors.invertedText,
50
50
  utilityBackground: theme.colors.backgroundLight,
51
+ underlayColors: {
52
+ 'filled-primary': theme.colors.primaryLight,
53
+ 'filled-secondary': theme.colors.secondaryLight,
54
+ 'filled-danger': theme.colors.dangerLight,
55
+ 'outlined-primary': theme.colors.primaryBackground,
56
+ 'outlined-secondary': theme.colors.secondaryBackground,
57
+ 'outlined-danger': theme.colors.dangerBackground,
58
+ 'text-primary': theme.colors.primaryBackground,
59
+ 'text-secondary': theme.colors.secondaryBackground,
60
+ 'text-danger': theme.colors.dangerBackground,
61
+ 'basic-transparent': theme.colors.primaryLight,
62
+ },
51
63
  };
52
64
 
53
65
  return {
@@ -0,0 +1,34 @@
1
+ import { GlobalTheme } from '../global';
2
+ import { scale } from '../../utils/scale';
3
+
4
+ const getCalendarTheme = (theme: GlobalTheme) => {
5
+ const colors = {
6
+ background: theme.colors.backgroundLight,
7
+ border: theme.colors.text,
8
+ primary: theme.colors.primary,
9
+ inverted: theme.colors.invertedText,
10
+ };
11
+
12
+ const sizes = {
13
+ cellWidth: scale(48),
14
+ cellHeight: scale(48),
15
+ cellCircleWidth: scale(44),
16
+ cellCircleHeight: scale(44),
17
+ markWidth: scale(4),
18
+ markHeight: scale(4),
19
+ };
20
+
21
+ const space = {
22
+ rowVerticalPadding: theme.space.medium,
23
+ headerVerticalPadding: theme.space.medium,
24
+ headerHorizontalPadding: theme.space.smallMedium,
25
+ };
26
+
27
+ const radii = {
28
+ default: theme.radii.rounded,
29
+ };
30
+
31
+ return { radii, colors, sizes, space };
32
+ };
33
+
34
+ export default getCalendarTheme;
@@ -4,7 +4,7 @@ const getCardTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
5
  dataCardIndicator: theme.colors.primaryDark,
6
6
  indicator: {
7
- archived: theme.colors.archivedDark,
7
+ archived: theme.colors.archivedLight,
8
8
  info: theme.colors.infoMediumLight,
9
9
  success: theme.colors.successLight,
10
10
  warning: theme.colors.warningLight,
@@ -0,0 +1,11 @@
1
+ import { scale } from '../../utils/scale';
2
+
3
+ const getDatePickerTheme = () => {
4
+ const sizes = {
5
+ height: scale(176),
6
+ };
7
+
8
+ return { sizes };
9
+ };
10
+
11
+ export default getDatePickerTheme;
@@ -0,0 +1,38 @@
1
+ import { scale } from '../../utils/scale';
2
+ import { GlobalTheme } from '../global';
3
+
4
+ const getEmptyTheme = (theme: GlobalTheme) => {
5
+ const space = {
6
+ medium: theme.space.medium,
7
+ large: theme.space.large,
8
+ };
9
+
10
+ const sizes = {
11
+ illustration: scale(168),
12
+ };
13
+
14
+ const radii = {
15
+ illustration: theme.radii.rounded,
16
+ };
17
+
18
+ const colors = {
19
+ text: theme.colors.text,
20
+ invertedText: theme.colors.invertedText,
21
+ subduedText: theme.colors.subduedText,
22
+ illustrationBackground: theme.colors.shadow,
23
+ };
24
+
25
+ const fontSizes = {
26
+ title: theme.fontSizes.xxxxlarge,
27
+ description: theme.fontSizes.large,
28
+ };
29
+
30
+ const fonts = {
31
+ title: theme.fonts.semiBold,
32
+ description: theme.fonts.light,
33
+ };
34
+
35
+ return { fontSizes, colors, sizes, space, fonts, radii };
36
+ };
37
+
38
+ export default getEmptyTheme;
@@ -4,10 +4,11 @@ const getFABTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
5
  buttonBackground: theme.colors.backgroundDark,
6
6
  icon: theme.colors.invertedText,
7
- headerText: theme.colors.text,
8
- actionItemBackground: theme.colors.infoLight,
9
- backdropBackground: theme.colors.platformBackground,
7
+ headerText: theme.colors.invertedText,
8
+ actionItemBackground: theme.colors.primaryBackgroundDark,
9
+ backdropBackground: theme.colors.backgroundDark,
10
10
  titleText: theme.colors.invertedText,
11
+ actionItemText: theme.colors.invertedText,
11
12
  };
12
13
 
13
14
  const sizes = {
@@ -3,6 +3,7 @@ import { GlobalTheme } from '../global';
3
3
  const getListTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
5
  checkedListItemContainerBackground: theme.colors.primaryBackground,
6
+ highlightedListItemContainerBackground: theme.colors.primaryBackground,
6
7
  listItemContainerBackground: theme.colors.platformBackground,
7
8
  leadingStatus: {
8
9
  danger: theme.colors.danger,
@@ -10,7 +10,7 @@ const getPinInputTheme = (theme: GlobalTheme) => {
10
10
  default: theme.colors.text,
11
11
  mask: theme.colors.subduedText, // should be Maastricht Blue light 50
12
12
  error: theme.colors.danger, // using this so that the color is the same as danger Icon, should be Vermilion
13
- disabled: theme.colors.archivedDark,
13
+ disabled: theme.colors.archivedLight,
14
14
  };
15
15
 
16
16
  const fonts = {
@@ -0,0 +1,34 @@
1
+ import { GlobalTheme } from '../global';
2
+
3
+ const getRichTextEditorTheme = (theme: GlobalTheme) => {
4
+ const colors = {
5
+ toolbarBorderColor: theme.colors.outline,
6
+ toolbarBackgroundColor: theme.colors.backgroundLight,
7
+ toolbarButtonSelectedBackground: theme.colors.outline,
8
+ };
9
+
10
+ const borderWidths = {
11
+ webViewBorderBottomWidth: 0.8,
12
+ };
13
+
14
+ const sizes = {
15
+ editorMinHeight: 21,
16
+ toolbarButtonSize: theme.space.xxxlarge,
17
+ toolbarSeparatorWidth: 1,
18
+ toolbarSeparatorHeight: theme.space.medium,
19
+ };
20
+
21
+ const fontSizes = {
22
+ editor: theme.fontSizes.medium,
23
+ };
24
+
25
+ const space = {
26
+ wrapperMarginBottom: theme.space.medium,
27
+ toolbarHorizontalPadding: theme.space.small,
28
+ editorPadding: theme.space.medium,
29
+ };
30
+
31
+ return { colors, space, borderWidths, fontSizes, sizes };
32
+ };
33
+
34
+ export default getRichTextEditorTheme;
@@ -6,14 +6,20 @@ const getTagTheme = (theme: GlobalTheme) => {
6
6
  };
7
7
 
8
8
  const colors = {
9
- danger: theme.colors.danger,
10
- dangerBackground: theme.colors.dangerBackground,
9
+ default: theme.colors.text,
10
+ defaultBackground: undefined,
11
+ primary: theme.colors.primary,
12
+ primaryBackground: theme.colors.primaryBackground,
11
13
  info: theme.colors.info,
12
14
  infoBackground: theme.colors.infoBackground,
13
15
  success: theme.colors.successDark,
14
16
  successBackground: theme.colors.successBackground,
15
17
  warning: theme.colors.warningDark,
16
18
  warningBackground: theme.colors.warningBackground,
19
+ danger: theme.colors.danger,
20
+ dangerBackground: theme.colors.dangerBackground,
21
+ archived: theme.colors.archivedDark,
22
+ archivedBackground: theme.colors.archivedBackground,
17
23
  };
18
24
 
19
25
  const fonts = {
@@ -9,6 +9,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
9
9
  danger: theme.colors.danger,
10
10
  warning: theme.colors.warning,
11
11
  success: theme.colors.success,
12
+ inverted: theme.colors.invertedText,
12
13
  };
13
14
 
14
15
  const fonts = {
@@ -12,16 +12,16 @@ interface Radii {
12
12
  }
13
13
 
14
14
  const getBorderWidths = (baseBorderWidth: number): BorderWidths => ({
15
- base: baseBorderWidth,
16
- medium: baseBorderWidth * 2,
15
+ base: baseBorderWidth, // 1
16
+ medium: baseBorderWidth * 2, // 2
17
17
  });
18
18
 
19
19
  const getRadii = (baseRadius: number): Radii => ({
20
20
  rounded: 999,
21
- base: baseRadius,
22
- medium: baseRadius * 2,
23
- large: baseRadius * 3,
24
- xlarge: baseRadius * 4,
21
+ base: baseRadius, // 4
22
+ medium: baseRadius * 2, // 8
23
+ large: baseRadius * 3, // 12
24
+ xlarge: baseRadius * 4, // 16
25
25
  });
26
26
 
27
27
  export { BorderWidths, getBorderWidths, Radii, getRadii };
@@ -7,8 +7,10 @@ const systemPalette = {
7
7
  primaryLight: palette.violetLight60,
8
8
  primaryDark: palette.purpleDark15,
9
9
  primaryBackground: palette.violetLight90,
10
+ primaryBackgroundDark: mobilePalette.maasstrichtBlueLight30,
10
11
  secondary: palette.dodgerBlue,
11
12
  secondaryLight: palette.dodgerBlueLight75,
13
+ secondaryBackground: palette.dodgerBlueLight90,
12
14
  info: palette.dodgerBlue,
13
15
  infoMediumLight: mobilePalette.vodka,
14
16
  infoLight: palette.dodgerBlueLight75,
@@ -34,8 +36,10 @@ const systemPalette = {
34
36
  disabledLightText: palette.greyLight45,
35
37
  invertedText: palette.white,
36
38
  outline: palette.greyLight60,
37
- archivedDark: mobilePalette.greyLight30,
38
39
  archived: palette.greyLight45,
40
+ archivedLight: mobilePalette.greyLight30,
41
+ archivedDark: mobilePalette.sonicSilver,
42
+ archivedBackground: mobilePalette.antiFlashWhite,
39
43
  black: palette.black,
40
44
  inactiveBackground: palette.greyDark30,
41
45
  shadow: palette.greyLight60,
@@ -9,23 +9,28 @@ import {
9
9
  defaultSystemPalette,
10
10
  } from './global';
11
11
 
12
+ import getAccordionTheme from './components/accordion';
12
13
  import getAlertTheme from './components/alert';
13
14
  import getAvatarTheme from './components/avatar';
14
15
  import getBadgeTheme from './components/badge';
15
16
  import getBottomNavigationTheme from './components/bottomNavigation';
16
17
  import getBottomSheetTheme from './components/bottomSheet';
17
18
  import getButtonTheme from './components/button';
19
+ import getCalendarTheme from './components/calendar';
18
20
  import getCardTheme from './components/card';
19
21
  import getCheckboxTheme from './components/checkbox';
20
22
  import getContentNavigatorTheme from './components/contentNavigator';
23
+ import getDatePickerTheme from './components/datePicker';
21
24
  import getDividerTheme from './components/divider';
22
25
  import getDrawerTheme from './components/drawer';
26
+ import getEmptyTheme from './components/empty';
23
27
  import getFABTheme from './components/fab';
24
28
  import getIconTheme from './components/icon';
25
29
  import getListTheme from './components/list';
26
30
  import getPinInputTheme from './components/pinInput';
27
31
  import getProgressTheme from './components/progress';
28
32
  import getRadioTheme from './components/radio';
33
+ import getRichTextEditorTheme from './components/richTextEditor';
29
34
  import getSectionHeadingTheme from './components/sectionHeading';
30
35
  import getSelectTheme from './components/select';
31
36
  import getSpinnerTheme from './components/spinner';
@@ -40,23 +45,28 @@ import getTypographyTheme from './components/typography';
40
45
 
41
46
  type Theme = GlobalTheme & {
42
47
  __hd__: {
48
+ accordion: ReturnType<typeof getAccordionTheme>;
43
49
  alert: ReturnType<typeof getAlertTheme>;
44
50
  avatar: ReturnType<typeof getAvatarTheme>;
45
51
  badge: ReturnType<typeof getBadgeTheme>;
46
52
  bottomNavigation: ReturnType<typeof getBottomNavigationTheme>;
47
53
  bottomSheet: ReturnType<typeof getBottomSheetTheme>;
48
54
  button: ReturnType<typeof getButtonTheme>;
55
+ calendar: ReturnType<typeof getCalendarTheme>;
49
56
  card: ReturnType<typeof getCardTheme>;
50
57
  checkbox: ReturnType<typeof getCheckboxTheme>;
51
58
  contentNavigator: ReturnType<typeof getContentNavigatorTheme>;
59
+ datePicker: ReturnType<typeof getDatePickerTheme>;
52
60
  divider: ReturnType<typeof getDividerTheme>;
53
61
  drawer: ReturnType<typeof getDrawerTheme>;
62
+ empty: ReturnType<typeof getEmptyTheme>;
54
63
  fab: ReturnType<typeof getFABTheme>;
55
64
  icon: ReturnType<typeof getIconTheme>;
56
65
  list: ReturnType<typeof getListTheme>;
57
66
  pinInput: ReturnType<typeof getPinInputTheme>;
58
67
  progress: ReturnType<typeof getProgressTheme>;
59
68
  radio: ReturnType<typeof getRadioTheme>;
69
+ richTextEditor: ReturnType<typeof getRichTextEditorTheme>;
60
70
  sectionHeading: ReturnType<typeof getSectionHeadingTheme>;
61
71
  select: ReturnType<typeof getSelectTheme>;
62
72
  spinner: ReturnType<typeof getSpinnerTheme>;
@@ -79,23 +89,28 @@ const getTheme = (
79
89
  return {
80
90
  ...globalTheme,
81
91
  __hd__: {
92
+ accordion: getAccordionTheme(globalTheme),
82
93
  avatar: getAvatarTheme(globalTheme),
83
94
  alert: getAlertTheme(globalTheme),
84
95
  badge: getBadgeTheme(globalTheme),
85
96
  bottomNavigation: getBottomNavigationTheme(globalTheme),
86
97
  bottomSheet: getBottomSheetTheme(globalTheme),
87
98
  button: getButtonTheme(globalTheme),
99
+ calendar: getCalendarTheme(globalTheme),
88
100
  card: getCardTheme(globalTheme),
89
101
  checkbox: getCheckboxTheme(globalTheme),
90
102
  contentNavigator: getContentNavigatorTheme(globalTheme),
103
+ datePicker: getDatePickerTheme(),
91
104
  divider: getDividerTheme(globalTheme),
92
105
  drawer: getDrawerTheme(globalTheme),
106
+ empty: getEmptyTheme(globalTheme),
93
107
  fab: getFABTheme(globalTheme),
94
108
  icon: getIconTheme(globalTheme),
95
109
  list: getListTheme(globalTheme),
96
110
  pinInput: getPinInputTheme(globalTheme),
97
111
  progress: getProgressTheme(globalTheme),
98
112
  radio: getRadioTheme(globalTheme),
113
+ richTextEditor: getRichTextEditorTheme(globalTheme),
99
114
  sectionHeading: getSectionHeadingTheme(globalTheme),
100
115
  select: getSelectTheme(globalTheme),
101
116
  spinner: getSpinnerTheme(globalTheme),
@@ -51,3 +51,20 @@ jest.mock('@react-native-community/datetimepicker', () => {
51
51
  }
52
52
  };
53
53
  });
54
+
55
+ jest.mock('react-native-webview', () => {
56
+ const React = jest.requireActual('react');
57
+
58
+ class WebView extends React.Component {
59
+ render() {
60
+ return React.createElement('WebView', this.props, this.props.children);
61
+ }
62
+ }
63
+
64
+ return {
65
+ WebView,
66
+ default: WebView,
67
+ };
68
+ });
69
+
70
+ jest.mock('hero-editor/dist/app.js', () => ({ default: '' }));
@@ -0,0 +1,14 @@
1
+ import { ReactElement } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { Variant } from './StyledAccordion';
4
+ export declare type AccordionItemProps = {
5
+ header: string | ReactElement;
6
+ content: ReactElement;
7
+ open?: boolean;
8
+ onPress?: () => void;
9
+ variant?: Variant;
10
+ style?: StyleProp<ViewStyle>;
11
+ testID?: string;
12
+ };
13
+ declare const AccordionItem: ({ header, content, open, onPress, variant, style, testID, }: AccordionItemProps) => JSX.Element;
14
+ export default AccordionItem;
@@ -0,0 +1,32 @@
1
+ import { TouchableOpacity, View } from 'react-native';
2
+ export declare type Variant = 'default' | 'card';
3
+ export declare const StyledWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ }, {}, {
7
+ ref?: import("react").Ref<View> | undefined;
8
+ }>;
9
+ export declare const StyledItemWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any> | undefined;
12
+ } & {
13
+ themeVariant: Variant;
14
+ }, {}, {
15
+ ref?: import("react").Ref<View> | undefined;
16
+ }>;
17
+ export declare const StyledHeaderWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
18
+ theme?: import("@emotion/react").Theme | undefined;
19
+ as?: import("react").ElementType<any> | undefined;
20
+ }, {}, {
21
+ ref?: import("react").Ref<TouchableOpacity> | undefined;
22
+ }>;
23
+ export declare const StyledCollapse: import("@emotion/native").StyledComponent<import("../Collapse").CollapseProps & {
24
+ theme?: import("@emotion/react").Theme | undefined;
25
+ as?: import("react").ElementType<any> | undefined;
26
+ }, {}, {}>;
27
+ export declare const Spacer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
28
+ theme?: import("@emotion/react").Theme | undefined;
29
+ as?: import("react").ElementType<any> | undefined;
30
+ }, {}, {
31
+ ref?: import("react").Ref<View> | undefined;
32
+ }>;