@hero-design/rn 7.13.0 → 7.14.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 (155) hide show
  1. package/.eslintrc.json +3 -1
  2. package/.turbo/turbo-build.log +9 -8
  3. package/assets/fonts/hero-icons.ttf +0 -0
  4. package/babel.config.js +16 -0
  5. package/es/index.js +26977 -7611
  6. package/lib/assets/fonts/hero-icons.ttf +0 -0
  7. package/lib/index.js +26983 -7613
  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/IconButton.tsx +1 -1
  21. package/src/components/Calendar/CalendarRowItem.tsx +54 -0
  22. package/src/components/Calendar/StyledCalendar.tsx +76 -0
  23. package/src/components/Calendar/__tests__/CalendarRowItem.spec.tsx +76 -0
  24. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +411 -0
  25. package/src/components/Calendar/__tests__/helper.spec.ts +50 -0
  26. package/src/components/Calendar/__tests__/index.spec.tsx +99 -0
  27. package/src/components/Calendar/helpers.ts +29 -0
  28. package/src/components/Calendar/index.tsx +217 -0
  29. package/src/components/Collapse/index.tsx +13 -15
  30. package/src/components/ContentNavigator/index.tsx +6 -0
  31. package/src/components/Empty/StyledEmpty.tsx +47 -0
  32. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +66 -0
  33. package/src/components/Empty/__tests__/index.spec.tsx +17 -0
  34. package/src/components/Empty/index.tsx +53 -0
  35. package/src/components/FAB/ActionGroup/ActionItem.tsx +6 -2
  36. package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -0
  37. package/src/components/FAB/ActionGroup/StyledActionItem.tsx +7 -1
  38. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +84 -22
  39. package/src/components/FAB/ActionGroup/index.tsx +8 -1
  40. package/src/components/Icon/HeroIcon/selection.json +1 -1
  41. package/src/components/Icon/IconList.ts +14 -0
  42. package/src/components/List/BasicListItem.tsx +44 -34
  43. package/src/components/List/ListItem.tsx +67 -58
  44. package/src/components/List/StyledBasicListItem.tsx +2 -3
  45. package/src/components/List/StyledListItem.tsx +2 -2
  46. package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +5 -2
  47. package/src/components/List/__tests__/StyledListItem.spec.tsx +4 -1
  48. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +15 -10
  49. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +52 -32
  50. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +128 -48
  51. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +132 -52
  52. package/src/components/RichTextEditor/EditorEvent.ts +7 -0
  53. package/src/components/RichTextEditor/EditorToolbar.tsx +220 -0
  54. package/src/components/RichTextEditor/MentionList.tsx +69 -0
  55. package/src/components/RichTextEditor/RichTextEditor.tsx +396 -0
  56. package/src/components/RichTextEditor/StyledRichTextEditor.ts +20 -0
  57. package/src/components/RichTextEditor/StyledToolbar.ts +32 -0
  58. package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +130 -0
  59. package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +109 -0
  60. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +245 -0
  61. package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +324 -0
  62. package/src/components/RichTextEditor/__tests__/__snapshots__/MentionList.spec.tsx.snap +45 -0
  63. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +526 -0
  64. package/src/components/RichTextEditor/constants.ts +20 -0
  65. package/src/components/RichTextEditor/hero-editor.d.ts +8 -0
  66. package/src/components/RichTextEditor/index.tsx +8 -0
  67. package/src/components/RichTextEditor/utils/events.ts +31 -0
  68. package/src/components/RichTextEditor/utils/rnWebView.ts +19 -0
  69. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +77 -0
  70. package/src/components/SectionHeading/__tests__/index.spec.tsx +14 -0
  71. package/src/components/SectionHeading/index.tsx +16 -9
  72. package/src/components/Tag/StyledTag.tsx +12 -2
  73. package/src/components/Tag/__tests__/Tag.spec.tsx +35 -8
  74. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +118 -4
  75. package/src/components/Tag/index.tsx +9 -2
  76. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +1 -0
  77. package/src/components/Typography/Text/StyledText.tsx +2 -1
  78. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
  79. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
  80. package/src/components/Typography/Text/index.tsx +2 -1
  81. package/src/index.ts +8 -0
  82. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +101 -4
  83. package/src/theme/components/accordion.ts +19 -0
  84. package/src/theme/components/calendar.ts +34 -0
  85. package/src/theme/components/card.ts +1 -1
  86. package/src/theme/components/empty.ts +38 -0
  87. package/src/theme/components/fab.ts +4 -3
  88. package/src/theme/components/list.ts +1 -0
  89. package/src/theme/components/pinInput.ts +1 -1
  90. package/src/theme/components/richTextEditor.ts +34 -0
  91. package/src/theme/components/tag.ts +8 -2
  92. package/src/theme/components/typography.ts +1 -0
  93. package/src/theme/global/borders.ts +6 -6
  94. package/src/theme/global/colors.ts +4 -1
  95. package/src/theme/index.ts +12 -0
  96. package/testUtils/setup.tsx +17 -0
  97. package/types/components/Accordion/AccordionItem.d.ts +14 -0
  98. package/types/components/Accordion/StyledAccordion.d.ts +32 -0
  99. package/types/components/Accordion/__tests__/AccordionItem.spec.d.ts +1 -0
  100. package/types/components/Accordion/__tests__/StyledAccordion.spec.d.ts +1 -0
  101. package/types/components/Accordion/__tests__/index.spec.d.ts +1 -0
  102. package/types/components/Accordion/index.d.ts +38 -0
  103. package/types/components/Accordion/utils.d.ts +1 -0
  104. package/types/components/Button/IconButton.d.ts +1 -1
  105. package/types/components/Calendar/CalendarRowItem.d.ts +10 -0
  106. package/types/components/Calendar/StyledCalendar.d.ts +54 -0
  107. package/types/components/Calendar/__tests__/CalendarRowItem.spec.d.ts +1 -0
  108. package/types/components/Calendar/__tests__/helper.spec.d.ts +1 -0
  109. package/types/components/Calendar/__tests__/index.spec.d.ts +1 -0
  110. package/types/components/Calendar/helpers.d.ts +3 -0
  111. package/types/components/Calendar/index.d.ts +40 -0
  112. package/types/components/Collapse/index.d.ts +1 -1
  113. package/types/components/ContentNavigator/index.d.ts +5 -1
  114. package/types/components/Empty/StyledEmpty.d.ts +31 -0
  115. package/types/components/Empty/__tests__/index.spec.d.ts +1 -0
  116. package/types/components/Empty/index.d.ts +26 -0
  117. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +6 -1
  118. package/types/components/FAB/ActionGroup/index.d.ts +6 -1
  119. package/types/components/FAB/index.d.ts +1 -1
  120. package/types/components/Icon/IconList.d.ts +1 -1
  121. package/types/components/Icon/utils.d.ts +1 -1
  122. package/types/components/List/StyledBasicListItem.d.ts +3 -3
  123. package/types/components/List/StyledListItem.d.ts +3 -3
  124. package/types/components/RichTextEditor/EditorEvent.d.ts +3 -0
  125. package/types/components/RichTextEditor/EditorToolbar.d.ts +17 -0
  126. package/types/components/RichTextEditor/MentionList.d.ts +12 -0
  127. package/types/components/RichTextEditor/RichTextEditor.d.ts +65 -0
  128. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +16 -0
  129. package/types/components/RichTextEditor/StyledToolbar.d.ts +21 -0
  130. package/types/components/RichTextEditor/__tests__/EditorToolbar.spec.d.ts +1 -0
  131. package/types/components/RichTextEditor/__tests__/MentionList.spec.d.ts +1 -0
  132. package/types/components/RichTextEditor/__tests__/RichTextEditor.spec.d.ts +1 -0
  133. package/types/components/RichTextEditor/constants.d.ts +19 -0
  134. package/types/components/RichTextEditor/index.d.ts +5 -0
  135. package/types/components/RichTextEditor/utils/events.d.ts +8 -0
  136. package/types/components/RichTextEditor/utils/rnWebView.d.ts +7 -0
  137. package/types/components/SectionHeading/index.d.ts +2 -2
  138. package/types/components/Select/MultiSelect/OptionList.d.ts +1 -1
  139. package/types/components/Select/SingleSelect/OptionList.d.ts +1 -1
  140. package/types/components/Tag/StyledTag.d.ts +1 -1
  141. package/types/components/Tag/index.d.ts +1 -1
  142. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  143. package/types/components/Typography/Text/index.d.ts +1 -1
  144. package/types/index.d.ts +5 -1
  145. package/types/theme/components/accordion.d.ts +13 -0
  146. package/types/theme/components/calendar.d.ts +26 -0
  147. package/types/theme/components/empty.d.ts +28 -0
  148. package/types/theme/components/fab.d.ts +1 -0
  149. package/types/theme/components/list.d.ts +1 -0
  150. package/types/theme/components/richTextEditor.d.ts +26 -0
  151. package/types/theme/components/tag.d.ts +8 -2
  152. package/types/theme/components/typography.d.ts +1 -0
  153. package/types/theme/global/colors.d.ts +4 -1
  154. package/types/theme/global/index.d.ts +4 -1
  155. package/types/theme/index.d.ts +8 -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,
@@ -184,6 +195,30 @@ Object {
184
195
  "utilityPadding": 8,
185
196
  },
186
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
+ },
187
222
  "card": Object {
188
223
  "colors": Object {
189
224
  "dataCardIndicator": "#a26fb0",
@@ -265,12 +300,39 @@ Object {
265
300
  "radius": 4.65,
266
301
  },
267
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
+ },
268
329
  "fab": Object {
269
330
  "colors": Object {
270
- "actionItemBackground": "#d1d9fe",
271
- "backdropBackground": "#ffffff",
331
+ "actionItemBackground": "#4d6265",
332
+ "actionItemText": "#ffffff",
333
+ "backdropBackground": "#292a2b",
272
334
  "buttonBackground": "#292a2b",
273
- "headerText": "#292a2b",
335
+ "headerText": "#ffffff",
274
336
  "icon": "#ffffff",
275
337
  "titleText": "#ffffff",
276
338
  },
@@ -336,6 +398,7 @@ Object {
336
398
  "list": Object {
337
399
  "colors": Object {
338
400
  "checkedListItemContainerBackground": "#f1e9fb",
401
+ "highlightedListItemContainerBackground": "#f1e9fb",
339
402
  "leadingStatus": Object {
340
403
  "archived": "#ccced1",
341
404
  "danger": "#de350b",
@@ -446,6 +509,30 @@ Object {
446
509
  "wrapperPadding": 16,
447
510
  },
448
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
+ },
449
536
  "sectionHeading": Object {
450
537
  "colors": Object {
451
538
  "background": "#dadbde",
@@ -549,10 +636,16 @@ Object {
549
636
  "default": 1,
550
637
  },
551
638
  "colors": Object {
639
+ "archived": "#737479",
640
+ "archivedBackground": "#f1f2f3",
552
641
  "danger": "#de350b",
553
642
  "dangerBackground": "#fcebe7",
643
+ "default": "#292a2b",
644
+ "defaultBackground": undefined,
554
645
  "info": "#4568fb",
555
646
  "infoBackground": "#ecf0ff",
647
+ "primary": "#7622d7",
648
+ "primaryBackground": "#f1e9fb",
556
649
  "success": "#017d6d",
557
650
  "successBackground": "#f0fef4",
558
651
  "warning": "#d98a2c",
@@ -704,6 +797,7 @@ Object {
704
797
  "body": "#292a2b",
705
798
  "danger": "#de350b",
706
799
  "info": "#4568fb",
800
+ "inverted": "#ffffff",
707
801
  "primary": "#7622d7",
708
802
  "subdued": "#8b8d92",
709
803
  "success": "#01b39c",
@@ -736,7 +830,9 @@ Object {
736
830
  },
737
831
  "colors": Object {
738
832
  "archived": "#ccced1",
739
- "archivedDark": "#bfc1c5",
833
+ "archivedBackground": "#f1f2f3",
834
+ "archivedDark": "#737479",
835
+ "archivedLight": "#bfc1c5",
740
836
  "backgroundDark": "#292a2b",
741
837
  "backgroundLight": "#fafbfb",
742
838
  "black": "#000000",
@@ -756,6 +852,7 @@ Object {
756
852
  "platformBackground": "#ffffff",
757
853
  "primary": "#7622d7",
758
854
  "primaryBackground": "#f1e9fb",
855
+ "primaryBackgroundDark": "#4d6265",
759
856
  "primaryDark": "#a26fb0",
760
857
  "primaryLight": "#c8a7ef",
761
858
  "secondary": "#4568fb",
@@ -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;
@@ -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,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,6 +7,7 @@ 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,
12
13
  secondaryBackground: palette.dodgerBlueLight90,
@@ -35,8 +36,10 @@ const systemPalette = {
35
36
  disabledLightText: palette.greyLight45,
36
37
  invertedText: palette.white,
37
38
  outline: palette.greyLight60,
38
- archivedDark: mobilePalette.greyLight30,
39
39
  archived: palette.greyLight45,
40
+ archivedLight: mobilePalette.greyLight30,
41
+ archivedDark: mobilePalette.sonicSilver,
42
+ archivedBackground: mobilePalette.antiFlashWhite,
40
43
  black: palette.black,
41
44
  inactiveBackground: palette.greyDark30,
42
45
  shadow: palette.greyLight60,
@@ -9,24 +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';
21
23
  import getDatePickerTheme from './components/datePicker';
22
24
  import getDividerTheme from './components/divider';
23
25
  import getDrawerTheme from './components/drawer';
26
+ import getEmptyTheme from './components/empty';
24
27
  import getFABTheme from './components/fab';
25
28
  import getIconTheme from './components/icon';
26
29
  import getListTheme from './components/list';
27
30
  import getPinInputTheme from './components/pinInput';
28
31
  import getProgressTheme from './components/progress';
29
32
  import getRadioTheme from './components/radio';
33
+ import getRichTextEditorTheme from './components/richTextEditor';
30
34
  import getSectionHeadingTheme from './components/sectionHeading';
31
35
  import getSelectTheme from './components/select';
32
36
  import getSpinnerTheme from './components/spinner';
@@ -41,24 +45,28 @@ import getTypographyTheme from './components/typography';
41
45
 
42
46
  type Theme = GlobalTheme & {
43
47
  __hd__: {
48
+ accordion: ReturnType<typeof getAccordionTheme>;
44
49
  alert: ReturnType<typeof getAlertTheme>;
45
50
  avatar: ReturnType<typeof getAvatarTheme>;
46
51
  badge: ReturnType<typeof getBadgeTheme>;
47
52
  bottomNavigation: ReturnType<typeof getBottomNavigationTheme>;
48
53
  bottomSheet: ReturnType<typeof getBottomSheetTheme>;
49
54
  button: ReturnType<typeof getButtonTheme>;
55
+ calendar: ReturnType<typeof getCalendarTheme>;
50
56
  card: ReturnType<typeof getCardTheme>;
51
57
  checkbox: ReturnType<typeof getCheckboxTheme>;
52
58
  contentNavigator: ReturnType<typeof getContentNavigatorTheme>;
53
59
  datePicker: ReturnType<typeof getDatePickerTheme>;
54
60
  divider: ReturnType<typeof getDividerTheme>;
55
61
  drawer: ReturnType<typeof getDrawerTheme>;
62
+ empty: ReturnType<typeof getEmptyTheme>;
56
63
  fab: ReturnType<typeof getFABTheme>;
57
64
  icon: ReturnType<typeof getIconTheme>;
58
65
  list: ReturnType<typeof getListTheme>;
59
66
  pinInput: ReturnType<typeof getPinInputTheme>;
60
67
  progress: ReturnType<typeof getProgressTheme>;
61
68
  radio: ReturnType<typeof getRadioTheme>;
69
+ richTextEditor: ReturnType<typeof getRichTextEditorTheme>;
62
70
  sectionHeading: ReturnType<typeof getSectionHeadingTheme>;
63
71
  select: ReturnType<typeof getSelectTheme>;
64
72
  spinner: ReturnType<typeof getSpinnerTheme>;
@@ -81,24 +89,28 @@ const getTheme = (
81
89
  return {
82
90
  ...globalTheme,
83
91
  __hd__: {
92
+ accordion: getAccordionTheme(globalTheme),
84
93
  avatar: getAvatarTheme(globalTheme),
85
94
  alert: getAlertTheme(globalTheme),
86
95
  badge: getBadgeTheme(globalTheme),
87
96
  bottomNavigation: getBottomNavigationTheme(globalTheme),
88
97
  bottomSheet: getBottomSheetTheme(globalTheme),
89
98
  button: getButtonTheme(globalTheme),
99
+ calendar: getCalendarTheme(globalTheme),
90
100
  card: getCardTheme(globalTheme),
91
101
  checkbox: getCheckboxTheme(globalTheme),
92
102
  contentNavigator: getContentNavigatorTheme(globalTheme),
93
103
  datePicker: getDatePickerTheme(),
94
104
  divider: getDividerTheme(globalTheme),
95
105
  drawer: getDrawerTheme(globalTheme),
106
+ empty: getEmptyTheme(globalTheme),
96
107
  fab: getFABTheme(globalTheme),
97
108
  icon: getIconTheme(globalTheme),
98
109
  list: getListTheme(globalTheme),
99
110
  pinInput: getPinInputTheme(globalTheme),
100
111
  progress: getProgressTheme(globalTheme),
101
112
  radio: getRadioTheme(globalTheme),
113
+ richTextEditor: getRichTextEditorTheme(globalTheme),
102
114
  sectionHeading: getSectionHeadingTheme(globalTheme),
103
115
  select: getSelectTheme(globalTheme),
104
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
+ }>;
@@ -0,0 +1,38 @@
1
+ import React, { Key, ReactElement } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ export interface AccordionProps<K extends Key> {
4
+ /**
5
+ * List of accordion items to be rendered. Each item must have an unique key.
6
+ */
7
+ items: {
8
+ header: string | ReactElement;
9
+ content: ReactElement;
10
+ key: K;
11
+ style?: StyleProp<ViewStyle>;
12
+ testID?: string;
13
+ }[];
14
+ /**
15
+ * Key of the active item.
16
+ * When activeItemKey and onItemPress is passed, the component is fully controlled.
17
+ * Otherwise, it would be uncontrolled.
18
+ */
19
+ activeItemKey?: K;
20
+ /**
21
+ * Callback invoked when an item is pressed.
22
+ */
23
+ onItemPress?: (key: K) => void;
24
+ /**
25
+ * Item type.
26
+ */
27
+ variant?: 'default' | 'card';
28
+ /**
29
+ * Additional style.
30
+ */
31
+ style?: StyleProp<ViewStyle>;
32
+ /**
33
+ * Testing id of the component.
34
+ */
35
+ testID?: string;
36
+ }
37
+ declare const Accordion: <K extends React.Key>({ items, activeItemKey, onItemPress, variant, style, testID, }: AccordionProps<K>) => JSX.Element;
38
+ export default Accordion;
@@ -0,0 +1 @@
1
+ export declare function usePropsOrInternalState<T>(initialState: T, state: T | undefined, setState: ((val: T) => void) | undefined): [T, (val: T) => void];
@@ -20,7 +20,7 @@ export interface IconButtonProps {
20
20
  /**
21
21
  * Set the handler to handle press event.
22
22
  */
23
- onPress: () => void;
23
+ onPress?: () => void;
24
24
  /**
25
25
  * Size of the Icon.
26
26
  */
@@ -0,0 +1,10 @@
1
+ export interface CalendarRowItemProps {
2
+ date?: Date;
3
+ onPress?: () => void;
4
+ isCurrent?: boolean;
5
+ isSelected?: boolean;
6
+ textIntent?: 'body' | 'subdued';
7
+ marked?: boolean;
8
+ }
9
+ declare const CalendarRowItem: ({ date, onPress, isCurrent, isSelected, textIntent, marked, }: CalendarRowItemProps) => JSX.Element;
10
+ export default CalendarRowItem;