@hero-design/rn 7.24.0 → 7.25.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 (248) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/assets/fonts/hero-icons.ttf +0 -0
  3. package/es/index.js +845 -752
  4. package/lib/assets/fonts/hero-icons.ttf +0 -0
  5. package/lib/index.js +846 -750
  6. package/package.json +6 -5
  7. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +4 -4
  8. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  9. package/src/components/Attachment/StyledAttachment.tsx +44 -0
  10. package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +158 -0
  11. package/src/components/Attachment/__tests__/index.spec.tsx +59 -0
  12. package/src/components/Attachment/index.tsx +77 -0
  13. package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
  14. package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  15. package/src/components/Badge/Status.tsx +1 -1
  16. package/src/components/Badge/StyledBadge.tsx +8 -1
  17. package/src/components/Badge/__tests__/Badge.spec.tsx +9 -0
  18. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +44 -0
  19. package/src/components/Badge/index.tsx +1 -1
  20. package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  21. package/src/components/BottomSheet/Header.tsx +2 -1
  22. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +52 -52
  23. package/src/components/BottomSheet/index.tsx +4 -4
  24. package/src/components/Button/Button.tsx +0 -11
  25. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +4 -4
  26. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  27. package/src/components/Button/LoadingIndicator/index.tsx +1 -1
  28. package/src/components/Button/StyledButton.tsx +24 -63
  29. package/src/components/Button/UtilityButton/__tests__/index.spec.tsx +2 -2
  30. package/src/components/Button/__tests__/Button.spec.tsx +10 -5
  31. package/src/components/Button/__tests__/StyledButton.spec.tsx +0 -70
  32. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +301 -1206
  33. package/src/components/Calendar/CalendarRowItem.tsx +1 -4
  34. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +5 -5
  35. package/src/components/Calendar/index.tsx +4 -3
  36. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +1 -1
  37. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
  38. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  39. package/src/components/Checkbox/StyledCheckbox.tsx +7 -5
  40. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +4 -12
  41. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +95 -42
  42. package/src/components/Checkbox/index.tsx +4 -2
  43. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  44. package/src/components/ContentNavigator/index.tsx +14 -9
  45. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +1 -0
  46. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +28 -27
  47. package/src/components/Drawer/DragableDrawer/index.tsx +0 -2
  48. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  49. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  50. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +1 -1
  51. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  52. package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
  53. package/src/components/Icon/IconList.ts +30 -3
  54. package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  55. package/src/components/List/BasicListItem.tsx +13 -8
  56. package/src/components/List/ListItem.tsx +8 -6
  57. package/src/components/List/StyledBasicListItem.tsx +2 -2
  58. package/src/components/List/StyledListItem.tsx +2 -2
  59. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +24 -36
  60. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +39 -59
  61. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +40 -44
  62. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +50 -50
  63. package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +6 -6
  64. package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +21 -21
  65. package/src/components/Progress/ProgressBar.tsx +1 -1
  66. package/src/components/Progress/ProgressCircle.tsx +1 -1
  67. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +10 -10
  68. package/src/components/Progress/types.ts +7 -1
  69. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +20 -32
  70. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +30 -48
  71. package/src/components/RefreshControl/__tests__/index.spec.tsx +1 -3
  72. package/src/components/RefreshControl/index.tsx +4 -2
  73. package/src/components/RichTextEditor/MentionList.tsx +12 -3
  74. package/src/components/RichTextEditor/RichTextEditor.tsx +3 -4
  75. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +4 -4
  76. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  77. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +13 -20
  78. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +146 -234
  79. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +430 -650
  80. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +11 -18
  81. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +136 -224
  82. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +409 -629
  83. package/src/components/Select/StyledOptionList.tsx +0 -1
  84. package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +1 -1
  85. package/src/components/Spinner/StyledSpinner.tsx +1 -2
  86. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +4 -4
  87. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +16 -16
  88. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  89. package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +1 -1
  90. package/src/components/Swipeable/index.tsx +14 -2
  91. package/src/components/Switch/SelectorSwitch/Option.tsx +1 -5
  92. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +3 -3
  93. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  94. package/src/components/Switch/SelectorSwitch/__tests__/index.spec.tsx +1 -0
  95. package/src/components/Switch/SelectorSwitch/index.tsx +4 -1
  96. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +1 -1
  97. package/src/components/Tabs/StyledTabs.tsx +1 -1
  98. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1 -1
  99. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  100. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +2 -2
  101. package/src/components/TextInput/StyledTextInput.tsx +1 -0
  102. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +11 -10
  103. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +27 -14
  104. package/src/components/TextInput/index.tsx +1 -0
  105. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +1 -0
  106. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +28 -27
  107. package/src/components/Toast/Toast.tsx +0 -3
  108. package/src/components/Toast/ToastProvider.tsx +1 -0
  109. package/src/components/Toast/__tests__/index.spec.tsx +1 -1
  110. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
  111. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -6
  112. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +4 -4
  113. package/src/emotion.d.ts +1 -0
  114. package/src/index.ts +6 -0
  115. package/src/theme/ThemeSwitcher.tsx +7 -1
  116. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +87 -74
  117. package/src/theme/__tests__/ensureCompatibleWithV7.spec.tsx +13 -0
  118. package/src/theme/components/alert.ts +1 -1
  119. package/src/theme/components/attachment.ts +28 -0
  120. package/src/theme/components/avatar.ts +1 -1
  121. package/src/theme/components/badge.ts +2 -1
  122. package/src/theme/components/bottomNavigation.ts +1 -1
  123. package/src/theme/components/bottomSheet.ts +2 -2
  124. package/src/theme/components/button.ts +4 -20
  125. package/src/theme/components/calendar.ts +3 -3
  126. package/src/theme/components/card.ts +1 -1
  127. package/src/theme/components/checkbox.ts +2 -2
  128. package/src/theme/components/divider.ts +1 -1
  129. package/src/theme/components/drawer.ts +2 -2
  130. package/src/theme/components/empty.ts +3 -3
  131. package/src/theme/components/fab.ts +7 -7
  132. package/src/theme/components/icon.ts +4 -4
  133. package/src/theme/components/list.ts +0 -2
  134. package/src/theme/components/pinInput.ts +4 -4
  135. package/src/theme/components/progress.ts +6 -5
  136. package/src/theme/components/radio.ts +1 -1
  137. package/src/theme/components/richTextEditor.ts +2 -2
  138. package/src/theme/components/slider.ts +2 -2
  139. package/src/theme/components/switch.ts +4 -4
  140. package/src/theme/components/tabs.ts +6 -5
  141. package/src/theme/components/tag.ts +2 -2
  142. package/src/theme/components/textInput.ts +23 -28
  143. package/src/theme/components/toast.ts +3 -3
  144. package/src/theme/components/toolbar.ts +3 -3
  145. package/src/theme/components/typography.ts +7 -7
  146. package/src/theme/getTheme.ts +4 -1
  147. package/src/theme/global/colors/eBens.ts +23 -0
  148. package/src/theme/global/colors/global.ts +15 -6
  149. package/src/theme/global/colors/jobs.ts +15 -9
  150. package/src/theme/global/colors/legacySystemPalette.ts +6 -6
  151. package/src/theme/global/colors/swag.ts +32 -53
  152. package/src/theme/global/colors/types.ts +35 -15
  153. package/src/theme/global/colors/wallet.ts +23 -0
  154. package/src/theme/global/colors/work.ts +15 -9
  155. package/src/theme/global/index.ts +4 -0
  156. package/src/theme/index.ts +4 -0
  157. package/src/utils/functions.ts +2 -0
  158. package/src/utils/scale.ts +1 -1
  159. package/tsconfig.json +8 -2
  160. package/types/components/Accordion/StyledAccordion.d.ts +14 -14
  161. package/types/components/Alert/StyledAlert.d.ts +15 -15
  162. package/types/components/Attachment/StyledAttachment.d.ts +28 -0
  163. package/types/components/Attachment/index.d.ts +37 -0
  164. package/types/components/Avatar/StyledAvatar.d.ts +15 -15
  165. package/types/components/Avatar/index.d.ts +1 -1
  166. package/types/components/Badge/Status.d.ts +1 -1
  167. package/types/components/Badge/StyledBadge.d.ts +8 -8
  168. package/types/components/Badge/index.d.ts +1 -1
  169. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
  170. package/types/components/BottomSheet/Header.d.ts +1 -1
  171. package/types/components/BottomSheet/StyledBottomSheet.d.ts +22 -22
  172. package/types/components/Box/StyledBox.d.ts +4 -4
  173. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
  174. package/types/components/Button/StyledButton.d.ts +15 -18
  175. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
  176. package/types/components/Calendar/StyledCalendar.d.ts +25 -25
  177. package/types/components/Calendar/helpers.d.ts +2 -2
  178. package/types/components/Card/DataCard/StyledDataCard.d.ts +6 -6
  179. package/types/components/Card/StyledCard.d.ts +7 -7
  180. package/types/components/Checkbox/StyledCheckbox.d.ts +16 -10
  181. package/types/components/Collapse/StyledCollapse.d.ts +8 -8
  182. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
  183. package/types/components/ContentNavigator/index.d.ts +2 -1
  184. package/types/components/DatePicker/StyledDatePicker.d.ts +3 -3
  185. package/types/components/Divider/StyledDivider.d.ts +5 -5
  186. package/types/components/Drawer/StyledDrawer.d.ts +19 -19
  187. package/types/components/Empty/StyledEmpty.d.ts +9 -9
  188. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +11 -11
  189. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +7 -7
  190. package/types/components/FAB/StyledFAB.d.ts +8 -8
  191. package/types/components/Icon/HeroIcon/index.d.ts +3 -3
  192. package/types/components/Icon/IconList.d.ts +1 -1
  193. package/types/components/Icon/index.d.ts +1 -1
  194. package/types/components/Icon/utils.d.ts +1 -1
  195. package/types/components/List/StyledBasicListItem.d.ts +16 -16
  196. package/types/components/List/StyledListItem.d.ts +25 -25
  197. package/types/components/PinInput/StyledPinInput.d.ts +30 -30
  198. package/types/components/Progress/ProgressBar.d.ts +1 -1
  199. package/types/components/Progress/ProgressCircle.d.ts +1 -1
  200. package/types/components/Progress/StyledProgressBar.d.ts +5 -5
  201. package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
  202. package/types/components/Progress/types.d.ts +1 -1
  203. package/types/components/Radio/StyledRadio.d.ts +9 -9
  204. package/types/components/RefreshControl/index.d.ts +1 -2
  205. package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
  206. package/types/components/RichTextEditor/MentionList.d.ts +1 -1
  207. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
  208. package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
  209. package/types/components/RichTextEditor/index.d.ts +2 -2
  210. package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
  211. package/types/components/Select/MultiSelect/Option.d.ts +1 -1
  212. package/types/components/Select/SingleSelect/Option.d.ts +1 -1
  213. package/types/components/Select/StyledSelect.d.ts +11 -11
  214. package/types/components/Select/helpers.d.ts +1 -1
  215. package/types/components/Spinner/StyledSpinner.d.ts +12 -12
  216. package/types/components/Swipeable/StyledSwipeable.d.ts +3 -3
  217. package/types/components/Swipeable/index.d.ts +7 -3
  218. package/types/components/Switch/SelectorSwitch/Option.d.ts +3 -1
  219. package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +9 -9
  220. package/types/components/Switch/StyledSwitch.d.ts +5 -5
  221. package/types/components/Tabs/StyledScrollableTabs.d.ts +23 -23
  222. package/types/components/Tabs/StyledTabs.d.ts +22 -22
  223. package/types/components/Tag/StyledTag.d.ts +6 -6
  224. package/types/components/TextInput/StyledTextInput.d.ts +44 -44
  225. package/types/components/TextInput/index.d.ts +5 -5
  226. package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
  227. package/types/components/Toast/StyledToast.d.ts +17 -17
  228. package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
  229. package/types/components/Typography/Text/StyledText.d.ts +3 -3
  230. package/types/index.d.ts +3 -2
  231. package/types/testHelpers/renderWithTheme.d.ts +1 -1
  232. package/types/theme/ThemeSwitcher.d.ts +2 -2
  233. package/types/theme/components/attachment.d.ts +21 -0
  234. package/types/theme/components/badge.d.ts +1 -0
  235. package/types/theme/components/button.d.ts +0 -15
  236. package/types/theme/components/list.d.ts +0 -1
  237. package/types/theme/components/progress.d.ts +1 -0
  238. package/types/theme/components/tabs.d.ts +1 -0
  239. package/types/theme/components/tag.d.ts +2 -2
  240. package/types/theme/components/textInput.d.ts +0 -5
  241. package/types/theme/getTheme.d.ts +2 -0
  242. package/types/theme/global/colors/eBens.d.ts +3 -0
  243. package/types/theme/global/colors/types.d.ts +23 -16
  244. package/types/theme/global/colors/wallet.d.ts +3 -0
  245. package/types/theme/global/index.d.ts +26 -12
  246. package/types/theme/index.d.ts +2 -2
  247. package/types/utils/functions.d.ts +1 -0
  248. package/types/utils/hooks.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.24.0",
3
+ "version": "7.25.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@emotion/native": "^11.9.3",
22
22
  "@emotion/react": "^11.9.3",
23
- "@hero-design/colors": "7.24.0",
23
+ "@hero-design/colors": "7.25.0",
24
24
  "date-fns": "^2.16.1",
25
25
  "events": "^3.2.0",
26
26
  "hero-editor": "^1.9.12"
@@ -30,7 +30,7 @@
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
+ "react-native-gesture-handler": "^1.10.3 | ~2.1.0",
34
34
  "react-native-pager-view": "^5.4.25",
35
35
  "react-native-safe-area-context": "^4.2.5",
36
36
  "react-native-vector-icons": "^9.1.0",
@@ -58,7 +58,7 @@
58
58
  "@types/react-native": "^0.67.7",
59
59
  "@types/react-native-vector-icons": "^6.4.10",
60
60
  "babel-plugin-inline-import": "^3.0.0",
61
- "eslint-config-hd": "7.24.0",
61
+ "eslint-config-hd": "7.25.0",
62
62
  "jest": "^27.3.1",
63
63
  "react": "17.0.2",
64
64
  "react-native": "0.65.1",
@@ -72,7 +72,8 @@
72
72
  "rollup-plugin-copy": "^3.4.0",
73
73
  "rollup-plugin-flow": "^1.1.1",
74
74
  "ts-jest": "^27.0.7",
75
- "prettier-config-hd": "7.24.0"
75
+ "prettier-config-hd": "7.25.0",
76
+ "rn-7-23-0": "npm:@hero-design/rn@7.23.0"
76
77
  },
77
78
  "prettier": "prettier-config-hd"
78
79
  }
@@ -58,7 +58,7 @@ exports[`AccordionItem renders correctly when header is an element 1`] = `
58
58
  style={
59
59
  Array [
60
60
  Object {
61
- "color": "#401960",
61
+ "color": "#795e90",
62
62
  "fontSize": 20,
63
63
  },
64
64
  undefined,
@@ -190,7 +190,7 @@ exports[`AccordionItem renders correctly when header is string 1`] = `
190
190
  style={
191
191
  Array [
192
192
  Object {
193
- "color": "#401960",
193
+ "color": "#795e90",
194
194
  "fontSize": 20,
195
195
  },
196
196
  undefined,
@@ -322,7 +322,7 @@ exports[`AccordionItem renders correctly when open 1`] = `
322
322
  style={
323
323
  Array [
324
324
  Object {
325
- "color": "#401960",
325
+ "color": "#795e90",
326
326
  "fontSize": 20,
327
327
  },
328
328
  undefined,
@@ -454,7 +454,7 @@ exports[`AccordionItem renders correctly when variant is card 1`] = `
454
454
  style={
455
455
  Array [
456
456
  Object {
457
- "color": "#401960",
457
+ "color": "#795e90",
458
458
  "fontSize": 20,
459
459
  },
460
460
  undefined,
@@ -66,7 +66,7 @@ exports[`Accordion allows fully controlled 1`] = `
66
66
  style={
67
67
  Array [
68
68
  Object {
69
- "color": "#401960",
69
+ "color": "#795e90",
70
70
  "fontSize": 20,
71
71
  },
72
72
  undefined,
@@ -195,7 +195,7 @@ exports[`Accordion allows fully controlled 1`] = `
195
195
  style={
196
196
  Array [
197
197
  Object {
198
- "color": "#401960",
198
+ "color": "#795e90",
199
199
  "fontSize": 20,
200
200
  },
201
201
  undefined,
@@ -336,7 +336,7 @@ exports[`Accordion renders correctly 1`] = `
336
336
  style={
337
337
  Array [
338
338
  Object {
339
- "color": "#401960",
339
+ "color": "#795e90",
340
340
  "fontSize": 20,
341
341
  },
342
342
  undefined,
@@ -465,7 +465,7 @@ exports[`Accordion renders correctly 1`] = `
465
465
  style={
466
466
  Array [
467
467
  Object {
468
- "color": "#401960",
468
+ "color": "#795e90",
469
469
  "fontSize": 20,
470
470
  },
471
471
  undefined,
@@ -606,7 +606,7 @@ exports[`Accordion renders correctly when variant is card 1`] = `
606
606
  style={
607
607
  Array [
608
608
  Object {
609
- "color": "#401960",
609
+ "color": "#795e90",
610
610
  "fontSize": 20,
611
611
  },
612
612
  undefined,
@@ -746,7 +746,7 @@ exports[`Accordion renders correctly when variant is card 1`] = `
746
746
  style={
747
747
  Array [
748
748
  Object {
749
- "color": "#401960",
749
+ "color": "#795e90",
750
750
  "fontSize": 20,
751
751
  },
752
752
  undefined,
@@ -0,0 +1,44 @@
1
+ import styled from '@emotion/native';
2
+ import { TouchableOpacity, View } from 'react-native';
3
+ import type { ComponentProps } from 'react';
4
+
5
+ const StyledContainer = styled(View)({
6
+ alignItems: 'center',
7
+ flexDirection: 'row',
8
+ });
9
+
10
+ const StyledContentContainer = styled(View)<{ themeHighlighted: boolean }>(
11
+ ({ theme, themeHighlighted }) => ({
12
+ flex: 1,
13
+ flexDirection: 'row',
14
+ alignItems: 'center',
15
+ backgroundColor: themeHighlighted
16
+ ? theme.__hd__.attachment.colors.highlightedBackground
17
+ : undefined,
18
+ borderRadius: themeHighlighted
19
+ ? theme.__hd__.attachment.radii.container
20
+ : undefined,
21
+ padding: theme.__hd__.attachment.space.containerPadding,
22
+ })
23
+ );
24
+
25
+ const StyledTextContainer = styled(View)(({ theme }) => ({
26
+ paddingHorizontal: theme.__hd__.attachment.space.textHorizontalPadding,
27
+ flexDirection: 'row',
28
+ flex: 1,
29
+ flexWrap: 'wrap',
30
+ }));
31
+
32
+ const StyledCTAWrapper = styled(TouchableOpacity)<
33
+ ComponentProps<typeof TouchableOpacity>
34
+ >(({ theme }) => ({
35
+ padding: theme.__hd__.attachment.space.ctaPadding,
36
+ justifyContent: 'center',
37
+ }));
38
+
39
+ export {
40
+ StyledContainer,
41
+ StyledContentContainer,
42
+ StyledCTAWrapper,
43
+ StyledTextContainer,
44
+ };
@@ -0,0 +1,158 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Attachment renders correctly 1`] = `
4
+ <View
5
+ style={
6
+ Array [
7
+ Object {
8
+ "alignItems": "center",
9
+ "flexDirection": "row",
10
+ },
11
+ undefined,
12
+ ]
13
+ }
14
+ >
15
+ <View
16
+ style={
17
+ Array [
18
+ Object {
19
+ "alignItems": "center",
20
+ "backgroundColor": undefined,
21
+ "borderRadius": undefined,
22
+ "flex": 1,
23
+ "flexDirection": "row",
24
+ "padding": 16,
25
+ },
26
+ undefined,
27
+ ]
28
+ }
29
+ themeHighlighted={false}
30
+ >
31
+ <Image
32
+ source={
33
+ Object {
34
+ "uri": "https://i.pinimg.com/originals/e6/92/fe/e692fe2bef601bf4760425bd62118117.jpg",
35
+ }
36
+ }
37
+ style={
38
+ Array [
39
+ Object {
40
+ "borderRadius": 0,
41
+ "height": 72,
42
+ "width": 72,
43
+ },
44
+ undefined,
45
+ ]
46
+ }
47
+ testID="attachment-image"
48
+ />
49
+ <View
50
+ style={
51
+ Array [
52
+ Object {
53
+ "flex": 1,
54
+ "flexDirection": "row",
55
+ "flexWrap": "wrap",
56
+ "paddingHorizontal": 8,
57
+ },
58
+ undefined,
59
+ ]
60
+ }
61
+ testID="attachment-content"
62
+ >
63
+ <Text
64
+ numberOfLines={1}
65
+ style={
66
+ Array [
67
+ Object {
68
+ "color": "#001f23",
69
+ "fontFamily": "BeVietnamPro-Regular",
70
+ "fontSize": 14,
71
+ "letterSpacing": 0.42,
72
+ "lineHeight": 22,
73
+ },
74
+ undefined,
75
+ ]
76
+ }
77
+ themeFontSize="medium"
78
+ themeFontWeight="regular"
79
+ themeIntent="body"
80
+ >
81
+ Screenshot.png
82
+ </Text>
83
+ </View>
84
+ </View>
85
+ <View
86
+ accessible={true}
87
+ collapsable={false}
88
+ focusable={true}
89
+ nativeID="animatedComponent"
90
+ onClick={[Function]}
91
+ onResponderGrant={[Function]}
92
+ onResponderMove={[Function]}
93
+ onResponderRelease={[Function]}
94
+ onResponderTerminate={[Function]}
95
+ onResponderTerminationRequest={[Function]}
96
+ onStartShouldSetResponder={[Function]}
97
+ style={
98
+ Object {
99
+ "justifyContent": "center",
100
+ "opacity": 1,
101
+ "padding": 16,
102
+ }
103
+ }
104
+ testID="attachment-download-icon"
105
+ >
106
+ <HeroIcon
107
+ name="download-outlined"
108
+ style={
109
+ Array [
110
+ Object {
111
+ "color": "#001f23",
112
+ "fontSize": 20,
113
+ },
114
+ undefined,
115
+ ]
116
+ }
117
+ themeIntent="text"
118
+ themeSize="small"
119
+ />
120
+ </View>
121
+ <View
122
+ accessible={true}
123
+ collapsable={false}
124
+ focusable={true}
125
+ nativeID="animatedComponent"
126
+ onClick={[Function]}
127
+ onResponderGrant={[Function]}
128
+ onResponderMove={[Function]}
129
+ onResponderRelease={[Function]}
130
+ onResponderTerminate={[Function]}
131
+ onResponderTerminationRequest={[Function]}
132
+ onStartShouldSetResponder={[Function]}
133
+ style={
134
+ Object {
135
+ "justifyContent": "center",
136
+ "opacity": 1,
137
+ "padding": 16,
138
+ }
139
+ }
140
+ testID="attachment-remove-icon"
141
+ >
142
+ <HeroIcon
143
+ name="trash-bin-outlined"
144
+ style={
145
+ Array [
146
+ Object {
147
+ "color": "#de350b",
148
+ "fontSize": 20,
149
+ },
150
+ undefined,
151
+ ]
152
+ }
153
+ themeIntent="danger"
154
+ themeSize="small"
155
+ />
156
+ </View>
157
+ </View>
158
+ `;
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { fireEvent } from '@testing-library/react-native';
3
+ import Attachment from '..';
4
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
5
+ import Image from '../../Image';
6
+
7
+ describe('Attachment', () => {
8
+ it('renders correctly', () => {
9
+ const onRemove = jest.fn();
10
+ const onDownload = jest.fn();
11
+
12
+ const { toJSON, getByText, getByTestId } = renderWithTheme(
13
+ <Attachment
14
+ filename="Screenshot.png"
15
+ previewElement={
16
+ <Image
17
+ source={{
18
+ uri: 'https://i.pinimg.com/originals/e6/92/fe/e692fe2bef601bf4760425bd62118117.jpg',
19
+ }}
20
+ testID="attachment-image"
21
+ />
22
+ }
23
+ onRemove={onRemove}
24
+ onDownload={onDownload}
25
+ />
26
+ );
27
+
28
+ expect(toJSON()).toMatchSnapshot();
29
+ expect(getByTestId('attachment-download-icon')).toBeDefined();
30
+ expect(getByTestId('attachment-remove-icon')).toBeDefined();
31
+ expect(getByTestId('attachment-image')).toBeDefined();
32
+ expect(getByText('Screenshot.png')).toBeDefined();
33
+
34
+ fireEvent.press(getByTestId('attachment-download-icon'));
35
+ expect(onDownload).toBeCalled();
36
+ fireEvent.press(getByTestId('attachment-remove-icon'));
37
+ expect(onRemove).toBeCalled();
38
+ });
39
+
40
+ it('renders correctly with custom props', () => {
41
+ const { getByTestId, queryByTestId } = renderWithTheme(
42
+ <Attachment
43
+ previewElement={
44
+ <Image
45
+ source={{
46
+ uri: 'https://i.pinimg.com/originals/e6/92/fe/e692fe2bef601bf4760425bd62118117.jpg',
47
+ }}
48
+ testID="attachment-image"
49
+ />
50
+ }
51
+ />
52
+ );
53
+
54
+ expect(queryByTestId('attachment-download-icon')).toBeNull();
55
+ expect(queryByTestId('attachment-remove-icon')).toBeNull();
56
+ expect(queryByTestId('attachment-content')).toBeNull();
57
+ expect(getByTestId('attachment-image')).toBeDefined();
58
+ });
59
+ });
@@ -0,0 +1,77 @@
1
+ import React from 'react';
2
+ import type { ReactElement } from 'react';
3
+ import { StyleProp, ViewStyle } from 'react-native';
4
+ import {
5
+ StyledContainer,
6
+ StyledContentContainer,
7
+ StyledCTAWrapper,
8
+ StyledTextContainer,
9
+ } from './StyledAttachment';
10
+ import Icon, { IconProps } from '../Icon';
11
+ import Typography from '../Typography';
12
+ import { ImageProps } from '../Image';
13
+
14
+ interface AttachmentProps {
15
+ /**
16
+ * Attachment filename.
17
+ */
18
+ filename?: string;
19
+ /**
20
+ * Attachment preview element.
21
+ */
22
+ previewElement: ReactElement<ImageProps | IconProps>;
23
+ /**
24
+ * Removing callback. When onRemove is available, a trash icon will be rendered on the right side. The callback will be called when user clicks on trash icon.
25
+ */
26
+ onRemove?: () => void;
27
+ /**
28
+ * Downloading callback. When onDownload is available, a download icon will be rendered on the right side. The callback will be called when user clicks on download icon.
29
+ */
30
+ onDownload?: () => void;
31
+ /**
32
+ * The background of the attachment's content will be highlighted if backgroundHighlighted is true.
33
+ * Default value is false.
34
+ */
35
+ backgroundHighlighted?: boolean;
36
+ /**
37
+ * Addtional style.
38
+ */
39
+ style?: StyleProp<ViewStyle>;
40
+ /**
41
+ * Testing id of the component.
42
+ */
43
+ testID?: string;
44
+ }
45
+
46
+ const Attachment = ({
47
+ filename,
48
+ previewElement,
49
+ onRemove,
50
+ onDownload,
51
+ backgroundHighlighted = false,
52
+ style,
53
+ testID,
54
+ }: AttachmentProps) => (
55
+ <StyledContainer testID={testID} style={style}>
56
+ <StyledContentContainer themeHighlighted={backgroundHighlighted}>
57
+ {previewElement}
58
+ {filename ? (
59
+ <StyledTextContainer testID="attachment-content">
60
+ <Typography.Text numberOfLines={1}>{filename}</Typography.Text>
61
+ </StyledTextContainer>
62
+ ) : null}
63
+ </StyledContentContainer>
64
+ {onDownload ? (
65
+ <StyledCTAWrapper onPress={onDownload} testID="attachment-download-icon">
66
+ <Icon icon="download-outlined" size="small" />
67
+ </StyledCTAWrapper>
68
+ ) : null}
69
+ {onRemove ? (
70
+ <StyledCTAWrapper onPress={onRemove} testID="attachment-remove-icon">
71
+ <Icon icon="trash-bin-outlined" size="small" intent="danger" />
72
+ </StyledCTAWrapper>
73
+ ) : null}
74
+ </StyledContainer>
75
+ );
76
+
77
+ export default Attachment;
@@ -35,7 +35,7 @@ exports[`StyledPressable renders correct style 1`] = `
35
35
  onStartShouldSetResponder={[Function]}
36
36
  style={
37
37
  Object {
38
- "borderColor": "#001f23",
38
+ "borderColor": "#401960",
39
39
  "borderRadius": 999,
40
40
  "borderWidth": 1,
41
41
  "height": 32,
@@ -52,7 +52,7 @@ exports[`StyledText renders correct style 1`] = `
52
52
  style={
53
53
  Array [
54
54
  Object {
55
- "color": "#001f23",
55
+ "color": "#401960",
56
56
  "fontSize": 16,
57
57
  "overflow": "hidden",
58
58
  },
@@ -71,7 +71,7 @@ exports[`StyledView renders correct style 1`] = `
71
71
  style={
72
72
  Array [
73
73
  Object {
74
- "borderColor": "#001f23",
74
+ "borderColor": "#401960",
75
75
  "borderRadius": 999,
76
76
  "borderWidth": 1,
77
77
  "height": 32,
@@ -5,7 +5,7 @@ exports[`Avatar renders correctly 1`] = `
5
5
  style={
6
6
  Array [
7
7
  Object {
8
- "borderColor": "#001f23",
8
+ "borderColor": "#401960",
9
9
  "borderRadius": 999,
10
10
  "borderWidth": 1,
11
11
  "height": 32,
@@ -55,7 +55,7 @@ exports[`Avatar trigger press function correctly 1`] = `
55
55
  onStartShouldSetResponder={[Function]}
56
56
  style={
57
57
  Object {
58
- "borderColor": "#001f23",
58
+ "borderColor": "#401960",
59
59
  "borderRadius": 999,
60
60
  "borderWidth": 1,
61
61
  "height": 32,
@@ -17,7 +17,7 @@ export interface StatusProps extends ViewProps {
17
17
  /**
18
18
  * Visual intent color to apply to Status Badge.
19
19
  */
20
- intent?: 'success' | 'warning' | 'danger' | 'info' | 'archived';
20
+ intent?: 'success' | 'warning' | 'danger' | 'info' | 'archived' | 'primary';
21
21
  /**
22
22
  * Additional style.
23
23
  */
@@ -1,7 +1,14 @@
1
1
  import { Animated, Text } from 'react-native';
2
2
  import styled from '@emotion/native';
3
3
 
4
- type ThemeIntent = 'success' | 'warning' | 'danger' | 'info' | 'archived';
4
+ type ThemeIntent =
5
+ | 'primary'
6
+ | 'success'
7
+ | 'warning'
8
+ | 'danger'
9
+ | 'info'
10
+ | 'archived';
11
+
5
12
  type ThemePadding = 'narrowContent' | 'wideContent';
6
13
 
7
14
  const StyledView = styled(Animated.View)<{
@@ -39,6 +39,15 @@ describe('Badge', () => {
39
39
  expect(getByText('SUBMITTED')).toBeDefined();
40
40
  });
41
41
 
42
+ it('has info style when intent is primary', () => {
43
+ const { getByText, toJSON } = renderWithTheme(
44
+ <Badge content="PRIMARY" intent="primary" />
45
+ );
46
+
47
+ expect(toJSON()).toMatchSnapshot();
48
+ expect(getByText('PRIMARY')).toBeDefined();
49
+ });
50
+
42
51
  it('renders correctly with custom props', () => {
43
52
  const { getByText, getByTestId, toJSON } = renderWithTheme(
44
53
  <Badge
@@ -88,6 +88,50 @@ exports[`Badge has info style when intent is info 1`] = `
88
88
  </View>
89
89
  `;
90
90
 
91
+ exports[`Badge has info style when intent is primary 1`] = `
92
+ <View
93
+ collapsable={false}
94
+ nativeID="animatedComponent"
95
+ style={
96
+ Object {
97
+ "alignItems": "center",
98
+ "backgroundColor": "#401960",
99
+ "borderRadius": 999,
100
+ "height": 20,
101
+ "justifyContent": "center",
102
+ "minWidth": 20,
103
+ "opacity": 1,
104
+ "paddingHorizontal": 8,
105
+ "transform": Array [
106
+ Object {
107
+ "scale": 1,
108
+ },
109
+ ],
110
+ }
111
+ }
112
+ themeIntent="primary"
113
+ themePadding="wideContent"
114
+ >
115
+ <Text
116
+ style={
117
+ Array [
118
+ Object {
119
+ "color": "#ffffff",
120
+ "fontFamily": "BeVietnamPro-SemiBold",
121
+ "fontSize": 12,
122
+ "includeFontPadding": false,
123
+ "textAlign": "center",
124
+ "textAlignVertical": "center",
125
+ },
126
+ undefined,
127
+ ]
128
+ }
129
+ >
130
+ PRIMARY
131
+ </Text>
132
+ </View>
133
+ `;
134
+
91
135
  exports[`Badge has success style when intent is success 1`] = `
92
136
  <View
93
137
  collapsable={false}
@@ -20,7 +20,7 @@ interface BadgeProps extends React.ComponentProps<typeof Animated.View> {
20
20
  /**
21
21
  * Visual intent color to apply to Badge.
22
22
  */
23
- intent?: 'success' | 'warning' | 'danger' | 'info' | 'archived';
23
+ intent?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived';
24
24
  /**
25
25
  * Additional style.
26
26
  */
@@ -65,7 +65,7 @@ exports[`BottomNavigation renders correctly 1`] = `
65
65
  "paddingBottom": 0,
66
66
  "paddingLeft": 0,
67
67
  "paddingRight": 0,
68
- "shadowColor": "#001f23",
68
+ "shadowColor": "#401960",
69
69
  "shadowOffset": Object {
70
70
  "height": 3,
71
71
  "width": 0,
@@ -123,7 +123,7 @@ exports[`BottomNavigation renders correctly 1`] = `
123
123
  style={
124
124
  Array [
125
125
  Object {
126
- "color": "#001f23",
126
+ "color": "#401960",
127
127
  "fontSize": 24,
128
128
  },
129
129
  undefined,
@@ -138,7 +138,7 @@ exports[`BottomNavigation renders correctly 1`] = `
138
138
  style={
139
139
  Array [
140
140
  Object {
141
- "color": "#001f23",
141
+ "color": "#401960",
142
142
  "fontFamily": "BeVietnamPro-SemiBold",
143
143
  "fontSize": 12,
144
144
  "letterSpacing": 0.36,
@@ -9,11 +9,12 @@ import {
9
9
  StyledHeaderWrapper,
10
10
  StyledIconWrapper,
11
11
  } from './StyledBottomSheet';
12
+ import { noop } from '../../utils/functions';
12
13
 
13
14
  const Header = ({
14
15
  content,
15
16
  showDivider,
16
- onRequestClose = () => {},
17
+ onRequestClose = noop,
17
18
  showCloseButton,
18
19
  }: {
19
20
  content: string | ReactElement;