@hero-design/rn 7.22.3 → 7.24.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 (197) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/assets/fonts/hero-icons.ttf +0 -0
  3. package/es/index.js +2974 -10456
  4. package/lib/assets/fonts/hero-icons.ttf +0 -0
  5. package/lib/index.js +2977 -10455
  6. package/package.json +8 -6
  7. package/rollup.config.js +1 -0
  8. package/src/components/Box/StyledBox.tsx +1 -2
  9. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +19 -4
  10. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +19 -4
  11. package/src/components/Empty/index.tsx +1 -2
  12. package/src/components/Icon/HeroIcon/fonts/hero-icons.ttf +0 -0
  13. package/src/components/Icon/HeroIcon/glyphMap.json +1 -0
  14. package/src/components/Icon/HeroIcon/index.tsx +3 -7
  15. package/src/components/Icon/IconList.ts +8 -5
  16. package/src/components/Icon/index.tsx +1 -0
  17. package/src/components/RefreshControl/__tests__/__snapshots__/index.spec.tsx.snap +69 -0
  18. package/src/components/RefreshControl/__tests__/index.spec.tsx +55 -0
  19. package/src/components/RefreshControl/index.tsx +23 -0
  20. package/src/components/RichTextEditor/MentionList.tsx +25 -4
  21. package/src/components/RichTextEditor/RichTextEditor.tsx +3 -4
  22. package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +6 -6
  23. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +38 -8
  24. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +8 -4
  25. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +95 -20
  26. package/src/components/Select/MultiSelect/index.tsx +1 -1
  27. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +8 -4
  28. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +95 -20
  29. package/src/components/Select/SingleSelect/index.tsx +1 -1
  30. package/src/components/Select/types.ts +1 -3
  31. package/src/components/Spinner/AnimatedSpinner.tsx +22 -7
  32. package/src/components/Spinner/StyledSpinner.tsx +16 -11
  33. package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +3 -1
  34. package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +42 -31
  35. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +8 -4
  36. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +532 -72
  37. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +8 -4
  38. package/src/components/Spinner/index.tsx +6 -1
  39. package/src/components/Swipeable/StyledSwipeable.tsx +11 -0
  40. package/src/components/Swipeable/SwipeableAction.tsx +45 -0
  41. package/src/components/Swipeable/__tests__/SwipeableAction.spec.tsx +37 -0
  42. package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +130 -0
  43. package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +33 -0
  44. package/src/components/Swipeable/__tests__/index.spec.tsx +34 -0
  45. package/src/components/Swipeable/index.tsx +148 -0
  46. package/src/components/TextInput/StyledTextInput.tsx +18 -19
  47. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +14 -8
  48. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +52 -150
  49. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +247 -52
  50. package/src/components/TextInput/__tests__/index.spec.tsx +114 -124
  51. package/src/components/TextInput/index.tsx +27 -9
  52. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +19 -4
  53. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +19 -4
  54. package/src/index.ts +8 -0
  55. package/src/theme/ThemeSwitcher.tsx +9 -2
  56. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +20 -9
  57. package/src/theme/components/refreshControl.ts +11 -0
  58. package/src/theme/components/richTextEditor.ts +6 -5
  59. package/src/theme/components/spinner.ts +4 -1
  60. package/src/theme/components/swipeable.ts +13 -0
  61. package/src/theme/components/textInput.ts +0 -5
  62. package/src/theme/getTheme.ts +6 -0
  63. package/src/theme/global/colors/jobs.ts +17 -0
  64. package/src/theme/global/colors/work.ts +0 -2
  65. package/src/theme/global/index.ts +8 -1
  66. package/src/theme/index.ts +6 -1
  67. package/src/types.ts +2 -0
  68. package/src/utils/__tests__/helpers.spec.ts +27 -0
  69. package/src/utils/helpers.ts +21 -0
  70. package/testUtils/setup.tsx +13 -0
  71. package/tsconfig.prod.json +4 -0
  72. package/types/components/Empty/index.d.ts +1 -2
  73. package/types/components/Icon/IconList.d.ts +1 -1
  74. package/types/components/Icon/index.d.ts +4 -1
  75. package/types/components/Icon/utils.d.ts +1 -1
  76. package/types/components/RefreshControl/index.d.ts +5 -0
  77. package/types/components/RichTextEditor/MentionList.d.ts +7 -3
  78. package/types/components/RichTextEditor/index.d.ts +1 -1
  79. package/types/components/Select/types.d.ts +1 -3
  80. package/types/components/Spinner/AnimatedSpinner.d.ts +2 -1
  81. package/types/components/Spinner/StyledSpinner.d.ts +1 -0
  82. package/types/components/Spinner/index.d.ts +5 -1
  83. package/types/components/Swipeable/StyledSwipeable.d.ts +10 -0
  84. package/types/components/Swipeable/SwipeableAction.d.ts +27 -0
  85. package/types/components/Swipeable/index.d.ts +41 -0
  86. package/types/components/TextInput/StyledTextInput.d.ts +11 -4
  87. package/types/components/TextInput/index.d.ts +1 -1
  88. package/types/index.d.ts +4 -2
  89. package/types/theme/ThemeSwitcher.d.ts +1 -1
  90. package/types/theme/components/refreshControl.d.ts +7 -0
  91. package/types/theme/components/richTextEditor.d.ts +4 -3
  92. package/types/theme/components/spinner.d.ts +4 -1
  93. package/types/theme/components/swipeable.d.ts +9 -0
  94. package/types/theme/components/textInput.d.ts +0 -5
  95. package/types/theme/getTheme.d.ts +4 -0
  96. package/types/theme/global/colors/jobs.d.ts +3 -0
  97. package/types/theme/global/index.d.ts +2 -1
  98. package/types/theme/index.d.ts +2 -2
  99. package/types/types.d.ts +2 -1
  100. package/types/utils/helpers.d.ts +2 -0
  101. package/src/components/Box/__tests__/helpers.spec.ts +0 -14
  102. package/src/components/Box/helpers.ts +0 -10
  103. package/src/components/Icon/HeroIcon/selection.json +0 -7029
  104. package/types/components/Accordion/__tests__/AccordionItem.spec.d.ts +0 -1
  105. package/types/components/Accordion/__tests__/StyledAccordion.spec.d.ts +0 -1
  106. package/types/components/Accordion/__tests__/index.spec.d.ts +0 -1
  107. package/types/components/Alert/__tests__/index.spec.d.ts +0 -1
  108. package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -1
  109. package/types/components/Avatar/__tests__/index.spec.d.ts +0 -1
  110. package/types/components/Badge/__tests__/Badge.spec.d.ts +0 -1
  111. package/types/components/Badge/__tests__/Status.spec.d.ts +0 -1
  112. package/types/components/BottomNavigation/__tests__/index.spec.d.ts +0 -1
  113. package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -1
  114. package/types/components/Box/__tests__/helpers.spec.d.ts +0 -1
  115. package/types/components/Box/__tests__/index.spec.d.ts +0 -1
  116. package/types/components/Box/helpers.d.ts +0 -1
  117. package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -1
  118. package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -1
  119. package/types/components/Button/UtilityButton/__tests__/index.spec.d.ts +0 -1
  120. package/types/components/Button/__tests__/Button.spec.d.ts +0 -1
  121. package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -1
  122. package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -1
  123. package/types/components/Calendar/__tests__/CalendarRowItem.spec.d.ts +0 -1
  124. package/types/components/Calendar/__tests__/helper.spec.d.ts +0 -1
  125. package/types/components/Calendar/__tests__/index.spec.d.ts +0 -1
  126. package/types/components/Card/DataCard/__tests__/StyledDataCard.spec.d.ts +0 -1
  127. package/types/components/Card/DataCard/__tests__/index.spec.d.ts +0 -1
  128. package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -1
  129. package/types/components/Card/__tests__/index.spec.d.ts +0 -1
  130. package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +0 -1
  131. package/types/components/Checkbox/__tests__/index.spec.d.ts +0 -1
  132. package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -1
  133. package/types/components/Collapse/__tests__/index.spec.d.ts +0 -1
  134. package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +0 -1
  135. package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -1
  136. package/types/components/DatePicker/__tests__/DatePicker.spec.d.ts +0 -1
  137. package/types/components/DatePicker/__tests__/DatePickerAndroid.spec.d.ts +0 -1
  138. package/types/components/DatePicker/__tests__/DatePickerIOS.spec.d.ts +0 -1
  139. package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -1
  140. package/types/components/Drawer/DragableDrawer/__tests__/helpers.spec.d.ts +0 -1
  141. package/types/components/Drawer/DragableDrawer/__tests__/index.spec.d.ts +0 -1
  142. package/types/components/Drawer/__tests__/index.spec.d.ts +0 -1
  143. package/types/components/Empty/__tests__/index.spec.d.ts +0 -1
  144. package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -1
  145. package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -1
  146. package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -1
  147. package/types/components/FAB/__tests__/index.spec.d.ts +0 -1
  148. package/types/components/Icon/__tests__/index.spec.d.ts +0 -1
  149. package/types/components/Image/__tests__/index.spec.d.ts +0 -1
  150. package/types/components/List/__tests__/BasicListItem.spec.d.ts +0 -1
  151. package/types/components/List/__tests__/ListItem.spec.d.ts +0 -1
  152. package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +0 -1
  153. package/types/components/List/__tests__/StyledListItem.spec.d.ts +0 -1
  154. package/types/components/PinInput/__tests__/PinCell.spec.d.ts +0 -1
  155. package/types/components/PinInput/__tests__/StyledPinInput.spec.d.ts +0 -1
  156. package/types/components/PinInput/__tests__/index.spec.d.ts +0 -1
  157. package/types/components/Radio/__tests__/Radio.spec.d.ts +0 -1
  158. package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -1
  159. package/types/components/RichTextEditor/__tests__/EditorToolbar.spec.d.ts +0 -1
  160. package/types/components/RichTextEditor/__tests__/MentionList.spec.d.ts +0 -1
  161. package/types/components/RichTextEditor/__tests__/RichTextEditor.spec.d.ts +0 -1
  162. package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +0 -1
  163. package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -1
  164. package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +0 -1
  165. package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +0 -1
  166. package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +0 -1
  167. package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +0 -1
  168. package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +0 -1
  169. package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +0 -1
  170. package/types/components/Select/__tests__/StyledSelect.spec.d.ts +0 -1
  171. package/types/components/Select/__tests__/helpers.spec.d.ts +0 -1
  172. package/types/components/Slider/__tests__/index.spec.d.ts +0 -1
  173. package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +0 -1
  174. package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -1
  175. package/types/components/Spinner/__tests__/index.spec.d.ts +0 -1
  176. package/types/components/Switch/SelectorSwitch/__tests__/Option.spec.d.ts +0 -1
  177. package/types/components/Switch/SelectorSwitch/__tests__/index.spec.d.ts +0 -1
  178. package/types/components/Switch/__tests__/StyledSwitch.spec.d.ts +0 -1
  179. package/types/components/Switch/__tests__/index.spec.d.ts +0 -1
  180. package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -1
  181. package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +0 -1
  182. package/types/components/Tabs/__tests__/index.spec.d.ts +0 -1
  183. package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -1
  184. package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -1
  185. package/types/components/TextInput/__tests__/index.spec.d.ts +0 -1
  186. package/types/components/TimePicker/__tests__/TimePicker.spec.d.ts +0 -1
  187. package/types/components/TimePicker/__tests__/TimePickerAndroid.spec.d.ts +0 -1
  188. package/types/components/TimePicker/__tests__/TimePickerIOS.spec.d.ts +0 -1
  189. package/types/components/Toast/__tests__/Toast.spec.d.ts +0 -1
  190. package/types/components/Toast/__tests__/ToastContainer.spec.d.ts +0 -1
  191. package/types/components/Toast/__tests__/index.spec.d.ts +0 -1
  192. package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +0 -1
  193. package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +0 -1
  194. package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -1
  195. package/types/components/Typography/Text/__tests__/index.spec.d.ts +0 -1
  196. package/types/theme/__tests__/index.spec.d.ts +0 -1
  197. package/types/utils/__tests__/scale.spec.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.22.3",
3
+ "version": "7.24.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -12,7 +12,7 @@
12
12
  "test:watch": "jest --runInBand --watch",
13
13
  "test:ci": "jest --runInBand --logHeapUsage",
14
14
  "build:js": "rollup -c",
15
- "build:types": "tsc --noEmit false --emitDeclarationOnly",
15
+ "build:types": "tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json",
16
16
  "build": "yarn build:js && yarn build:types",
17
17
  "build:watch": "yarn build:js -w & yarn build:types -w",
18
18
  "publish:npm": "yarn publish --access public"
@@ -20,16 +20,17 @@
20
20
  "dependencies": {
21
21
  "@emotion/native": "^11.9.3",
22
22
  "@emotion/react": "^11.9.3",
23
- "@hero-design/colors": "7.22.3",
23
+ "@hero-design/colors": "7.24.0",
24
24
  "date-fns": "^2.16.1",
25
25
  "events": "^3.2.0",
26
- "hero-editor": "^1.9.9"
26
+ "hero-editor": "^1.9.12"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@react-native-community/datetimepicker": "^3.5.2",
30
30
  "@react-native-community/slider": "4.1.12",
31
31
  "react": "17.0.2",
32
32
  "react-native": "0.65.1",
33
+ "react-native-gesture-handler": "~2.1.0",
33
34
  "react-native-pager-view": "^5.4.25",
34
35
  "react-native-safe-area-context": "^4.2.5",
35
36
  "react-native-vector-icons": "^9.1.0",
@@ -57,10 +58,11 @@
57
58
  "@types/react-native": "^0.67.7",
58
59
  "@types/react-native-vector-icons": "^6.4.10",
59
60
  "babel-plugin-inline-import": "^3.0.0",
60
- "eslint-config-hd": "7.22.3",
61
+ "eslint-config-hd": "7.24.0",
61
62
  "jest": "^27.3.1",
62
63
  "react": "17.0.2",
63
64
  "react-native": "0.65.1",
65
+ "react-native-gesture-handler": "~2.1.0",
64
66
  "react-native-pager-view": "^5.4.25",
65
67
  "react-native-safe-area-context": "^4.2.5",
66
68
  "react-native-vector-icons": "^9.1.0",
@@ -70,7 +72,7 @@
70
72
  "rollup-plugin-copy": "^3.4.0",
71
73
  "rollup-plugin-flow": "^1.1.1",
72
74
  "ts-jest": "^27.0.7",
73
- "prettier-config-hd": "7.22.3"
75
+ "prettier-config-hd": "7.24.0"
74
76
  },
75
77
  "prettier": "prettier-config-hd"
76
78
  }
package/rollup.config.js CHANGED
@@ -29,6 +29,7 @@ export default {
29
29
  'react-native-safe-area-context',
30
30
  '@react-native-community/datetimepicker',
31
31
  '@react-native-community/slider',
32
+ 'react-native-gesture-handler',
32
33
  'react-native-webview',
33
34
  'react-native-pager-view',
34
35
  'react-native-vector-icons',
@@ -2,9 +2,8 @@ import styled from '@emotion/native';
2
2
  import { Theme } from '@emotion/react';
3
3
  import { View } from 'react-native';
4
4
  import { StyleProps, ThemeScale } from './types';
5
-
5
+ import { pick } from '../../utils/helpers';
6
6
  import config, { ConfigType, flexPropsKey } from './config';
7
- import { pick } from './helpers';
8
7
 
9
8
  export const getThemeValue = (
10
9
  theme: Theme,
@@ -26,16 +26,12 @@ exports[`DatePickerAndroid renders correctly 1`] = `
26
26
  style={
27
27
  Array [
28
28
  Object {
29
- "borderColor": "#001f23",
30
- "borderRadius": 8,
31
- "borderWidth": 1,
32
29
  "marginVertical": 8,
33
30
  "width": "100%",
34
31
  },
35
32
  undefined,
36
33
  ]
37
34
  }
38
- themeVariant="filled"
39
35
  >
40
36
  <View
41
37
  style={
@@ -49,6 +45,25 @@ exports[`DatePickerAndroid renders correctly 1`] = `
49
45
  ]
50
46
  }
51
47
  >
48
+ <View
49
+ style={
50
+ Array [
51
+ Object {
52
+ "borderColor": "#001f23",
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
+ themeFocused={false}
65
+ themeVariant="filled"
66
+ />
52
67
  <View
53
68
  pointerEvents="none"
54
69
  style={
@@ -26,16 +26,12 @@ exports[`DatePickerIOS renders correctly 1`] = `
26
26
  style={
27
27
  Array [
28
28
  Object {
29
- "borderColor": "#001f23",
30
- "borderRadius": 8,
31
- "borderWidth": 1,
32
29
  "marginVertical": 8,
33
30
  "width": "100%",
34
31
  },
35
32
  undefined,
36
33
  ]
37
34
  }
38
- themeVariant="filled"
39
35
  >
40
36
  <View
41
37
  style={
@@ -49,6 +45,25 @@ exports[`DatePickerIOS renders correctly 1`] = `
49
45
  ]
50
46
  }
51
47
  >
48
+ <View
49
+ style={
50
+ Array [
51
+ Object {
52
+ "borderColor": "#001f23",
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
+ themeFocused={false}
65
+ themeVariant="filled"
66
+ />
52
67
  <View
53
68
  pointerEvents="none"
54
69
  style={
@@ -24,8 +24,7 @@ interface EmptyProps {
24
24
  */
25
25
  description?: string;
26
26
  /**
27
- * Empty's variant
28
- * 'dark' if rendered on a dark background and 'light' otherwise
27
+ * Empty's variant.
29
28
  */
30
29
  variant?: 'light' | 'dark';
31
30
  /**
@@ -0,0 +1 @@
1
+ {"activate":50000,"add-emoji":50001,"add-person":50002,"adjustment":50003,"alignment":50004,"archive":50005,"bank":50006,"bell":50007,"billing":50008,"bookmark":50009,"box-check":50010,"box":50011,"buildings":50012,"cake":50013,"calendar-clock":50014,"calendar":50015,"candy-box-menu":50016,"carat-down-small":50017,"carat-down":50018,"carat-left":50019,"carat-right":50020,"carat-up":50021,"circle-add":50022,"circle-cancel":50023,"circle-check":50024,"circle-down":50025,"circle-info":50026,"circle-left":50027,"circle-ok":50028,"circle-pencil":50029,"circle-question":50030,"circle-remove":50031,"circle-right":50032,"circle-up":50033,"circle-warning":50034,"clock-3":50035,"clock":50036,"cloud-download":50037,"cloud-upload":50038,"cog":50039,"coin":50040,"contacts":50041,"credit-card":50042,"diamond":50043,"direction-arrows":50044,"directory":50045,"document":50046,"dollar-coin-shine":50047,"double-buildings":50048,"edit-template":50049,"envelope":50050,"expense":50051,"eye-circle":50052,"eye-invisible":50053,"eye":50054,"face-meh":50055,"face-sad":50056,"face-smiley":50057,"feed":50058,"feedbacks":50059,"file-certified":50060,"file-clone":50061,"file-copy":50062,"file-csv":50063,"file-dispose":50064,"file-doc":50065,"file-excel":50066,"file-export":50067,"file-lock":50068,"file-pdf":50069,"file-powerpoint":50070,"file-search":50071,"file-secured":50072,"file-sheets":50073,"file-slide":50074,"file-verified":50075,"file-word":50076,"file":50077,"folder-user":50078,"folder":50079,"format-bold":50080,"format-heading1":50081,"format-heading2":50082,"format-italic":50083,"format-list-bulleted":50084,"format-list-numbered":50085,"format-underlined":50086,"funnel-filter":50087,"global-dollar":50088,"globe":50089,"graduation-cap":50090,"graph":50091,"happy-sun":50092,"health-bag":50093,"heart":50094,"home":50095,"image":50096,"import":50097,"incident-siren":50098,"instapay":50099,"list":50100,"loading-2":50101,"loading":50102,"location":50103,"lock":50104,"looks-one":50105,"looks-two":50106,"mandatory":50107,"media-content":50108,"menu":50109,"moneybag":50110,"moon":50111,"multiple-stars":50112,"multiple-users":50113,"node":50114,"open-folder":50115,"paperclip":50116,"payment-summary":50117,"pencil":50118,"phone":50119,"piggy-bank":50120,"plane":50121,"play-circle":50122,"print":50123,"raising-hands":50124,"rectangle-mandatory":50125,"reply-arrow":50126,"reply":50127,"reschedule":50128,"rostering":50129,"save":50130,"schedule-send":50131,"schedule":50132,"search-person":50133,"send":50134,"speaker":50135,"star-award":50136,"star-badge":50137,"star-medal":50138,"star":50139,"steps-circle":50140,"stopwatch":50141,"suitcase":50142,"survey":50143,"swag":50144,"switch":50145,"tag":50146,"target":50147,"teams":50148,"timesheet":50149,"touch-id":50150,"trash-bin":50151,"unlock":50152,"user":50153,"video-1":50154,"video-2":50155,"warning":50156,"activate-outlined":50157,"add-person-outlined":50158,"add-section-outlined":50159,"add-time-outlined":50160,"add":50161,"adjustment-outlined":50162,"alignment-2-outlined":50163,"alignment-outlined":50164,"all-caps":50165,"arrow-down":50166,"arrow-left":50167,"arrow-right":50168,"arrow-up":50169,"at-sign":50170,"bell-outlined":50171,"billing-outlined":50172,"body-outlined":50173,"bold":50174,"bookmark-outlined":50175,"box-check-outlined":50176,"box-outlined":50177,"bullet-points":50178,"cake-outlined":50179,"calendar-dates-outlined":50180,"calendar-star-outlined":50181,"camera-outlined":50182,"cancel":50183,"checkmark":50184,"circle-add-outlined":50185,"circle-cancel-outlined":50186,"circle-down-outlined":50187,"circle-info-outlined":50188,"circle-left-outlined":50189,"circle-ok-outlined":50190,"circle-question-outlined":50191,"circle-remove-outlined":50192,"circle-right-outlined":50193,"circle-up-outlined":50194,"circle-warning-outlined":50195,"clock-2-outlined":50196,"clock-outlined":50197,"cog-outlined":50198,"coin-outlined":50199,"comment-outlined":50200,"contacts-outlined":50201,"credit-card-outlined":50202,"direction-arrows-outlined":50203,"directory-outlined":50204,"document-outlined":50205,"dollar-coin-shine-outlined":50206,"dollar-sign":50207,"double-buildings-outlined":50208,"double-left-arrows":50209,"double-right-arrows":50210,"download-outlined":50211,"edit-template-outlined":50212,"email-outlined":50213,"enter-arrow":50214,"envelope-outlined":50215,"expense-outlined":50216,"external-link":50217,"eye-invisible-outlined":50218,"eye-outlined":50219,"face-id":50220,"face-meh-outlined":50221,"face-open-smiley-outlined":50222,"face-sad-outlined":50223,"face-smiley-outlined":50224,"feed-outlined":50225,"file-certified-outlined":50226,"file-clone-outlined":50227,"file-copy-outlined":50228,"file-dispose-outlined":50229,"file-download-outlined":50230,"file-export-outlined":50231,"file-lock-outlined":50232,"file-outlined":50233,"file-search-outlined":50234,"file-secured-outlined":50235,"file-verified-outlined":50236,"filter-outlined":50237,"folder-outlined":50238,"folder-user-outlined":50239,"funnel-filter-outline":50240,"graph-outlined":50241,"happy-sun-outlined":50242,"health-bag-outlined":50243,"heart-outlined":50244,"home-outlined":50245,"image-outlined":50246,"import-outlined":50247,"instapay-outlined":50248,"italic":50249,"link-1":50250,"link-2":50251,"list-outlined":50252,"location-outlined":50253,"lock-outlined":50254,"locked-file-outlined":50255,"log-out":50256,"media-content-outlined":50257,"menu-close":50258,"menu-expand":50259,"menu-fold-outlined":50260,"menu-unfold-outlined":50261,"moneybag-outlined":50262,"moon-outlined":50263,"more-horizontal":50264,"more-vertical":50265,"multiple-folders-outlined":50266,"multiple-users-outlined":50267,"node-outlined":50268,"number-points":50269,"number":50270,"payment-summary-outlined":50271,"payslip-outlined":50272,"pencil-outlined":50273,"percentage":50274,"phone-outlined":50275,"piggy-bank-outlined":50276,"plane-outlined":50277,"play-circle-outlined":50278,"print-outlined":50279,"qr-code-outlined":50280,"re-assign":50281,"redeem":50282,"refresh":50283,"remove":50284,"reply-outlined":50285,"restart":50286,"return-arrow":50287,"rostering-outlined":50288,"save-outlined":50289,"schedule-outlined":50290,"search-outlined":50291,"send-outlined":50292,"share-1":50293,"share-2":50294,"single-down-arrow":50295,"single-left-arrow":50296,"single-right-arrow":50297,"single-up-arrow":50298,"speaker-outlined":50299,"star-outlined":50300,"stopwatch-outlined":50301,"strikethrough":50302,"suitcase-outlined":50303,"survey-outlined":50304,"switch-outlined":50305,"sync":50306,"target-outlined":50307,"timesheet-outlined":50308,"transfer":50309,"trash-bin-outlined":50310,"trash-outlined":50311,"unavailable":50312,"underline":50313,"unlock-outlined":50314,"upload-outlined":50315,"user-circle-outlined":50316,"user-outlined":50317,"user-rectangle-outlined":50318,"video-1-outlined":50319,"video-2-outlined":50320,"wallet-outlined":50321}
@@ -1,6 +1,6 @@
1
- import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
1
+ import { createIconSet } from 'react-native-vector-icons';
2
2
  import styled from '@emotion/native';
3
- import heroIconConfig from './selection.json';
3
+ import glyphMap from './glyphMap.json';
4
4
 
5
5
  type ThemeSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
6
6
  type ThemeIntent =
@@ -14,11 +14,7 @@ type ThemeIntent =
14
14
  | 'disabled-text'
15
15
  | 'text-inverted';
16
16
 
17
- const HeroIcon = createIconSetFromIcoMoon(
18
- heroIconConfig,
19
- 'hero-icons',
20
- 'hero-icons.ttf'
21
- );
17
+ const HeroIcon = createIconSet(glyphMap, 'hero-icons', 'hero-icons.ttf');
22
18
 
23
19
  const COLOR_INTENTS = {
24
20
  text: 'text',
@@ -1,3 +1,4 @@
1
+ // 🔴 DO NOT EDIT — This file is generated automatically.
1
2
  const IconList = [
2
3
  'activate',
3
4
  'add-emoji',
@@ -34,8 +35,8 @@ const IconList = [
34
35
  'circle-right',
35
36
  'circle-up',
36
37
  'circle-warning',
37
- 'clock',
38
38
  'clock-3',
39
+ 'clock',
39
40
  'cloud-download',
40
41
  'cloud-upload',
41
42
  'cog',
@@ -77,7 +78,6 @@ const IconList = [
77
78
  'file-verified',
78
79
  'file-word',
79
80
  'file',
80
- 'filter-outlined',
81
81
  'folder-user',
82
82
  'folder',
83
83
  'format-bold',
@@ -101,8 +101,8 @@ const IconList = [
101
101
  'incident-siren',
102
102
  'instapay',
103
103
  'list',
104
- 'loading',
105
104
  'loading-2',
105
+ 'loading',
106
106
  'location',
107
107
  'lock',
108
108
  'looks-one',
@@ -125,8 +125,9 @@ const IconList = [
125
125
  'play-circle',
126
126
  'print',
127
127
  'raising-hands',
128
- 'reply',
128
+ 'rectangle-mandatory',
129
129
  'reply-arrow',
130
+ 'reply',
130
131
  'reschedule',
131
132
  'rostering',
132
133
  'save',
@@ -155,6 +156,7 @@ const IconList = [
155
156
  'user',
156
157
  'video-1',
157
158
  'video-2',
159
+ 'warning',
158
160
  'activate-outlined',
159
161
  'add-person-outlined',
160
162
  'add-section-outlined',
@@ -235,6 +237,7 @@ const IconList = [
235
237
  'file-search-outlined',
236
238
  'file-secured-outlined',
237
239
  'file-verified-outlined',
240
+ 'filter-outlined',
238
241
  'folder-outlined',
239
242
  'folder-user-outlined',
240
243
  'funnel-filter-outline',
@@ -308,6 +311,7 @@ const IconList = [
308
311
  'timesheet-outlined',
309
312
  'transfer',
310
313
  'trash-bin-outlined',
314
+ 'trash-outlined',
311
315
  'unavailable',
312
316
  'underline',
313
317
  'unlock-outlined',
@@ -318,7 +322,6 @@ const IconList = [
318
322
  'video-1-outlined',
319
323
  'video-2-outlined',
320
324
  'wallet-outlined',
321
- 'warning',
322
325
  ] as const;
323
326
 
324
327
  export default IconList;
@@ -68,4 +68,5 @@ const Icon = ({
68
68
  />
69
69
  );
70
70
 
71
+ Icon.List = IconList;
71
72
  export default Icon;
@@ -0,0 +1,69 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`RefreshControl render correctly with props 1`] = `
4
+ <RCTScrollView
5
+ contentContainerStyle={
6
+ Object {
7
+ "flex": 1,
8
+ }
9
+ }
10
+ refreshControl={
11
+ <RefreshControl
12
+ onRefresh={[MockFunction]}
13
+ progressViewOffset={100}
14
+ refreshing={true}
15
+ />
16
+ }
17
+ >
18
+ <RCTRefreshControl />
19
+ <View>
20
+ <Text>
21
+ Pull down to see RefreshControl indicator
22
+ </Text>
23
+ </View>
24
+ </RCTScrollView>
25
+ `;
26
+
27
+ exports[`RefreshControl renders correctly when refreshing is false 1`] = `
28
+ <RCTScrollView
29
+ contentContainerStyle={
30
+ Object {
31
+ "flex": 1,
32
+ }
33
+ }
34
+ refreshControl={
35
+ <RefreshControl
36
+ refreshing={false}
37
+ />
38
+ }
39
+ >
40
+ <RCTRefreshControl />
41
+ <View>
42
+ <Text>
43
+ Pull down to see RefreshControl indicator
44
+ </Text>
45
+ </View>
46
+ </RCTScrollView>
47
+ `;
48
+
49
+ exports[`RefreshControl renders correctly when refreshing is true 1`] = `
50
+ <RCTScrollView
51
+ contentContainerStyle={
52
+ Object {
53
+ "flex": 1,
54
+ }
55
+ }
56
+ refreshControl={
57
+ <RefreshControl
58
+ refreshing={true}
59
+ />
60
+ }
61
+ >
62
+ <RCTRefreshControl />
63
+ <View>
64
+ <Text>
65
+ Pull down to see RefreshControl indicator
66
+ </Text>
67
+ </View>
68
+ </RCTScrollView>
69
+ `;
@@ -0,0 +1,55 @@
1
+ import React, { ReactElement } from 'react';
2
+ import { ScrollView, Text } from 'react-native';
3
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
4
+ import RefreshControl from '..';
5
+
6
+ const ExampleList = ({
7
+ refreshControl,
8
+ }: {
9
+ refreshControl: ReactElement;
10
+ }): ReactElement => {
11
+ return (
12
+ <ScrollView
13
+ contentContainerStyle={{
14
+ flex: 1,
15
+ }}
16
+ refreshControl={refreshControl}
17
+ >
18
+ <Text>
19
+ Pull down to see RefreshControl indicator
20
+ </Text>
21
+ </ScrollView>
22
+ );
23
+ };
24
+
25
+ describe('RefreshControl', () => {
26
+ it.each`
27
+ refreshing
28
+ ${true}
29
+ ${false}
30
+ `('renders correctly when refreshing is $refreshing', ({ refreshing }) => {
31
+ const { toJSON } = renderWithTheme(
32
+ <ExampleList
33
+ refreshControl={<RefreshControl refreshing={refreshing} />}
34
+ />
35
+ );
36
+
37
+ expect(toJSON()).toMatchSnapshot();
38
+ });
39
+
40
+ it('render correctly with props', () => {
41
+ const { toJSON } = renderWithTheme(
42
+ <ExampleList
43
+ refreshControl={
44
+ <RefreshControl
45
+ refreshing
46
+ progressViewOffset={100}
47
+ onRefresh={jest.fn()}
48
+ />
49
+ }
50
+ />
51
+ );
52
+
53
+ expect(toJSON()).toMatchSnapshot();
54
+ });
55
+ });
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import {
3
+ RefreshControl as NativeRefreshControl,
4
+ RefreshControlProps as NativeRefreshControlProps,
5
+ } from 'react-native';
6
+ import { useTheme } from '../../theme';
7
+
8
+ export interface RefreshControlProps
9
+ extends Omit<NativeRefreshControlProps, 'colors' | 'tintColor'> {}
10
+
11
+ const RefreshControl = ({ ...props }: RefreshControlProps) => {
12
+ const theme = useTheme();
13
+
14
+ return (
15
+ <NativeRefreshControl
16
+ {...props}
17
+ colors={[theme.__hd__.refreshControl.colors.indicator]}
18
+ tintColor={theme.__hd__.refreshControl.colors.indicator}
19
+ />
20
+ );
21
+ };
22
+
23
+ export default RefreshControl;
@@ -1,3 +1,4 @@
1
+ import { useTheme } from '@emotion/react';
1
2
  import React, { useCallback, useEffect, useState } from 'react';
2
3
  import { View } from 'react-native';
3
4
  import { emitter } from './EditorEvent';
@@ -5,7 +6,12 @@ import * as Events from './utils/events';
5
6
 
6
7
  const isEmptyString = (s: string | null): boolean => !s || s.length === 0;
7
8
 
8
- export interface MentionListProps {
9
+ interface OnSelectOptionsType<TMetaData> {
10
+ highlighted: boolean;
11
+ meta?: TMetaData;
12
+ }
13
+
14
+ export interface MentionListProps<TMetaData = unknown> {
9
15
  /**
10
16
  * Unique name used to communicate with webview, should be the same with the RichTextEditor component it used with
11
17
  */
@@ -15,17 +21,19 @@ export interface MentionListProps {
15
21
  */
16
22
  render: (
17
23
  searchText: string,
18
- onSelect: (id: string, name: string) => void
24
+ onSelect: (id: string, name: string, options?: OnSelectOptionsType<TMetaData>) => void
19
25
  ) => JSX.Element;
20
26
  }
21
27
 
22
- const MentionList = ({ name: eventPrefix, render }: MentionListProps) => {
28
+ const MentionList = <TMetaData, >({ name: eventPrefix, render }: MentionListProps<TMetaData>) => {
29
+ const theme = useTheme();
23
30
  const [search, setSearch] = useState<string>('');
24
31
  const [target, setTarget] = useState<string | null>(null);
25
32
  const normalizeEventName = useCallback(
26
33
  (event: string) => `${eventPrefix}/${event}`,
27
34
  [eventPrefix]
28
35
  );
36
+
29
37
  useEffect(() => {
30
38
  const removeMentionSearchListener = Events.on(
31
39
  emitter,
@@ -53,11 +61,24 @@ const MentionList = ({ name: eventPrefix, render }: MentionListProps) => {
53
61
 
54
62
  return (
55
63
  <View>
56
- {render(search, (id, name) => {
64
+ {render(search, (id, name, options = { highlighted: false }) => {
65
+ const { highlighted, meta } = options;
66
+
67
+ const highlightStyle = {
68
+ color: theme.colors.secondary,
69
+ borderRadius: theme.__hd__.richTextEditor.radii.mention,
70
+ padding: highlighted ? theme.__hd__.richTextEditor.space.mention : 0,
71
+ background: highlighted ? theme.colors.lightHighlightedSurface : 'transparent',
72
+ marginTop: theme.space.xxsmall,
73
+ marginBottom: theme.space.xxsmall,
74
+ display: 'inline-flex',
75
+ };
57
76
  const data = {
58
77
  id,
59
78
  name,
60
79
  target,
80
+ meta,
81
+ style: highlightStyle,
61
82
  };
62
83
 
63
84
  Events.emit(emitter, normalizeEventName('mention-apply'), data);
@@ -20,6 +20,7 @@ import Icon from '../Icon';
20
20
  import {
21
21
  StyledAsteriskLabel,
22
22
  StyledAsteriskLabelInsideTextInput,
23
+ StyledBorderBackDrop,
23
24
  StyledContainer,
24
25
  StyledError,
25
26
  StyledErrorAndHelpTextContainer,
@@ -138,9 +139,6 @@ const RichTextEditor: ComponentType<RichTextEditorProps> = ({
138
139
  if (error) {
139
140
  return 'error';
140
141
  }
141
- if (isFocused) {
142
- return 'focused';
143
- }
144
142
  if (isEmptyValue) {
145
143
  return 'filled';
146
144
  }
@@ -309,8 +307,9 @@ const RichTextEditor: ComponentType<RichTextEditorProps> = ({
309
307
  );
310
308
 
311
309
  return (
312
- <StyledContainer testID={testID} themeVariant={variant}>
310
+ <StyledContainer testID={testID}>
313
311
  <StyledTextInputContainer>
312
+ <StyledBorderBackDrop themeVariant={variant} themeFocused={isFocused} />
314
313
  {(isFocused || (label && !isEmptyValue)) && (
315
314
  <StyledLabelContainer pointerEvents="none">
316
315
  {required && (
@@ -1,10 +1,10 @@
1
- import { FlatList, Text } from 'react-native';
2
- import React from 'react';
3
-
4
- import { act, fireEvent, render } from '@testing-library/react-native';
5
1
  import type { RenderAPI } from '@testing-library/react-native';
6
- import MentionList from '../MentionList';
2
+ import { act, fireEvent, render } from '@testing-library/react-native';
3
+ import React from 'react';
4
+ import { FlatList, Text } from 'react-native';
5
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
7
6
  import { emitter as editorEventEmitter } from '../EditorEvent';
7
+ import MentionList from '../MentionList';
8
8
  import * as Events from '../utils/events';
9
9
 
10
10
  const SuggestionListData: Array<{ id: string; name: string }> = [
@@ -56,7 +56,7 @@ describe('MentionList', () => {
56
56
  let wrapper: RenderAPI;
57
57
 
58
58
  beforeEach(() => {
59
- wrapper = render(
59
+ wrapper = renderWithTheme(
60
60
  <MentionList
61
61
  name="give-shout-out"
62
62
  render={(
@@ -5,16 +5,12 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
5
5
  style={
6
6
  Array [
7
7
  Object {
8
- "borderColor": "#f46363",
9
- "borderRadius": 8,
10
- "borderWidth": 1,
11
8
  "marginVertical": 8,
12
9
  "width": "100%",
13
10
  },
14
11
  undefined,
15
12
  ]
16
13
  }
17
- themeVariant="error"
18
14
  >
19
15
  <View
20
16
  style={
@@ -28,6 +24,25 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
28
24
  ]
29
25
  }
30
26
  >
27
+ <View
28
+ style={
29
+ Array [
30
+ Object {
31
+ "borderColor": "#f46363",
32
+ "borderRadius": 8,
33
+ "borderWidth": 1,
34
+ "bottom": 0,
35
+ "left": 0,
36
+ "position": "absolute",
37
+ "right": 0,
38
+ "top": 0,
39
+ },
40
+ undefined,
41
+ ]
42
+ }
43
+ themeFocused={false}
44
+ themeVariant="error"
45
+ />
31
46
  <View
32
47
  style={
33
48
  Array [
@@ -251,16 +266,12 @@ exports[`RichTextEditor should render correctly 1`] = `
251
266
  style={
252
267
  Array [
253
268
  Object {
254
- "borderColor": "#f46363",
255
- "borderRadius": 8,
256
- "borderWidth": 1,
257
269
  "marginVertical": 8,
258
270
  "width": "100%",
259
271
  },
260
272
  undefined,
261
273
  ]
262
274
  }
263
- themeVariant="error"
264
275
  >
265
276
  <View
266
277
  style={
@@ -274,6 +285,25 @@ exports[`RichTextEditor should render correctly 1`] = `
274
285
  ]
275
286
  }
276
287
  >
288
+ <View
289
+ style={
290
+ Array [
291
+ Object {
292
+ "borderColor": "#f46363",
293
+ "borderRadius": 8,
294
+ "borderWidth": 1,
295
+ "bottom": 0,
296
+ "left": 0,
297
+ "position": "absolute",
298
+ "right": 0,
299
+ "top": 0,
300
+ },
301
+ undefined,
302
+ ]
303
+ }
304
+ themeFocused={false}
305
+ themeVariant="error"
306
+ />
277
307
  <View
278
308
  style={
279
309
  Array [