@hero-design/rn 7.22.2 → 7.23.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 (249) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/es/index.js +2395 -1880
  3. package/lib/index.js +2395 -1878
  4. package/package.json +6 -6
  5. package/src/components/Accordion/AccordionItem.tsx +1 -1
  6. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +8 -8
  7. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  8. package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
  9. package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  10. package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  11. package/src/components/Box/StyledBox.tsx +1 -2
  12. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +2 -2
  13. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  14. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +24 -24
  15. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +6 -6
  16. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +3 -3
  17. package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  18. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
  19. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  20. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +2 -2
  21. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +5 -5
  22. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  23. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +18 -4
  24. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +19 -5
  25. package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  26. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +10 -10
  27. package/src/components/Icon/HeroIcon/index.tsx +2 -0
  28. package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  29. package/src/components/Icon/index.tsx +1 -0
  30. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +2 -2
  31. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +12 -12
  32. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +2 -2
  33. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +4 -4
  34. package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +6 -6
  35. package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +21 -21
  36. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +5 -5
  37. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +1 -1
  38. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +1 -1
  39. package/src/components/RefreshControl/__tests__/__snapshots__/index.spec.tsx.snap +69 -0
  40. package/src/components/RefreshControl/__tests__/index.spec.tsx +55 -0
  41. package/src/components/RefreshControl/index.tsx +23 -0
  42. package/src/components/RichTextEditor/MentionList.tsx +25 -4
  43. package/src/components/RichTextEditor/RichTextEditor.tsx +3 -1
  44. package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +1 -1
  45. package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +6 -6
  46. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +38 -10
  47. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  48. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -1
  49. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +13 -9
  50. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +108 -38
  51. package/src/components/Select/MultiSelect/index.tsx +1 -1
  52. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -1
  53. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +12 -8
  54. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +99 -29
  55. package/src/components/Select/SingleSelect/index.tsx +1 -1
  56. package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +1 -1
  57. package/src/components/Select/types.ts +1 -3
  58. package/src/components/Slider/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  59. package/src/components/Spinner/StyledSpinner.tsx +8 -4
  60. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +8 -4
  61. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +32 -16
  62. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +8 -4
  63. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +3 -3
  64. package/src/components/Tabs/ScrollableTabs.tsx +2 -5
  65. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1 -1
  66. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +1 -1
  67. package/src/components/TextInput/StyledTextInput.tsx +16 -11
  68. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +3 -3
  69. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +46 -28
  70. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +246 -64
  71. package/src/components/TextInput/index.tsx +21 -4
  72. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +18 -4
  73. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +19 -5
  74. package/src/components/Toast/ToastProvider.tsx +2 -4
  75. package/src/components/Toast/__tests__/index.spec.tsx +138 -0
  76. package/src/components/Toolbar/ToolbarItem.tsx +1 -1
  77. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
  78. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -6
  79. package/src/components/Typography/Text/StyledText.tsx +1 -0
  80. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +3 -3
  81. package/src/components/Typography/Text/index.tsx +1 -0
  82. package/src/index.ts +4 -0
  83. package/src/theme/ThemeSwitcher.tsx +9 -2
  84. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +101 -88
  85. package/src/theme/components/accordion.ts +1 -1
  86. package/src/theme/components/alert.ts +4 -4
  87. package/src/theme/components/avatar.ts +2 -2
  88. package/src/theme/components/badge.ts +6 -6
  89. package/src/theme/components/bottomNavigation.ts +2 -2
  90. package/src/theme/components/bottomSheet.ts +3 -3
  91. package/src/theme/components/button.ts +20 -20
  92. package/src/theme/components/calendar.ts +4 -4
  93. package/src/theme/components/card.ts +5 -5
  94. package/src/theme/components/checkbox.ts +1 -1
  95. package/src/theme/components/divider.ts +1 -1
  96. package/src/theme/components/drawer.ts +4 -4
  97. package/src/theme/components/empty.ts +3 -4
  98. package/src/theme/components/fab.ts +7 -7
  99. package/src/theme/components/icon.ts +4 -3
  100. package/src/theme/components/list.ts +6 -7
  101. package/src/theme/components/pinInput.ts +4 -4
  102. package/src/theme/components/progress.ts +3 -3
  103. package/src/theme/components/refreshControl.ts +11 -0
  104. package/src/theme/components/richTextEditor.ts +9 -8
  105. package/src/theme/components/sectionHeading.ts +1 -1
  106. package/src/theme/components/select.ts +1 -1
  107. package/src/theme/components/slider.ts +3 -3
  108. package/src/theme/components/spinner.ts +1 -4
  109. package/src/theme/components/switch.ts +7 -7
  110. package/src/theme/components/tabs.ts +5 -5
  111. package/src/theme/components/tag.ts +12 -12
  112. package/src/theme/components/textInput.ts +38 -38
  113. package/src/theme/components/toast.ts +6 -6
  114. package/src/theme/components/toolbar.ts +3 -2
  115. package/src/theme/components/typography.ts +4 -3
  116. package/src/theme/getTheme.ts +3 -0
  117. package/src/theme/global/colors/global.ts +32 -0
  118. package/src/theme/global/colors/jobs.ts +18 -0
  119. package/src/theme/global/colors/legacySystemPalette.ts +53 -0
  120. package/src/theme/global/colors/swag.ts +21 -35
  121. package/src/theme/global/colors/types.ts +46 -27
  122. package/src/theme/global/colors/work.ts +10 -9
  123. package/src/theme/global/index.ts +8 -1
  124. package/src/theme/index.ts +6 -1
  125. package/src/utils/__tests__/helpers.spec.ts +27 -0
  126. package/src/utils/helpers.ts +21 -0
  127. package/tsconfig.prod.json +4 -0
  128. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  129. package/types/components/Icon/index.d.ts +1 -1
  130. package/types/components/RefreshControl/index.d.ts +5 -0
  131. package/types/components/RichTextEditor/MentionList.d.ts +7 -3
  132. package/types/components/RichTextEditor/index.d.ts +1 -1
  133. package/types/components/Select/types.d.ts +1 -3
  134. package/types/components/TextInput/StyledTextInput.d.ts +9 -3
  135. package/types/components/Toolbar/ToolbarItem.d.ts +1 -1
  136. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  137. package/types/components/Typography/Text/index.d.ts +1 -1
  138. package/types/index.d.ts +3 -2
  139. package/types/theme/ThemeSwitcher.d.ts +1 -1
  140. package/types/theme/components/empty.d.ts +0 -1
  141. package/types/theme/components/icon.d.ts +1 -0
  142. package/types/theme/components/refreshControl.d.ts +7 -0
  143. package/types/theme/components/richTextEditor.d.ts +4 -3
  144. package/types/theme/components/spinner.d.ts +1 -4
  145. package/types/theme/components/toolbar.d.ts +1 -0
  146. package/types/theme/components/typography.d.ts +1 -0
  147. package/types/theme/getTheme.d.ts +2 -0
  148. package/types/theme/global/colors/global.d.ts +3 -0
  149. package/types/theme/global/colors/jobs.d.ts +3 -0
  150. package/types/theme/global/colors/legacySystemPalette.d.ts +3 -0
  151. package/types/theme/global/colors/types.d.ts +41 -21
  152. package/types/theme/global/index.d.ts +30 -21
  153. package/types/theme/index.d.ts +2 -2
  154. package/types/utils/helpers.d.ts +2 -0
  155. package/src/components/Box/__tests__/helpers.spec.ts +0 -14
  156. package/src/components/Box/helpers.ts +0 -10
  157. package/types/components/Accordion/__tests__/AccordionItem.spec.d.ts +0 -1
  158. package/types/components/Accordion/__tests__/StyledAccordion.spec.d.ts +0 -1
  159. package/types/components/Accordion/__tests__/index.spec.d.ts +0 -1
  160. package/types/components/Alert/__tests__/index.spec.d.ts +0 -1
  161. package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -1
  162. package/types/components/Avatar/__tests__/index.spec.d.ts +0 -1
  163. package/types/components/Badge/__tests__/Badge.spec.d.ts +0 -1
  164. package/types/components/Badge/__tests__/Status.spec.d.ts +0 -1
  165. package/types/components/BottomNavigation/__tests__/index.spec.d.ts +0 -1
  166. package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -1
  167. package/types/components/Box/__tests__/helpers.spec.d.ts +0 -1
  168. package/types/components/Box/__tests__/index.spec.d.ts +0 -1
  169. package/types/components/Box/helpers.d.ts +0 -1
  170. package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -1
  171. package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -1
  172. package/types/components/Button/UtilityButton/__tests__/index.spec.d.ts +0 -1
  173. package/types/components/Button/__tests__/Button.spec.d.ts +0 -1
  174. package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -1
  175. package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -1
  176. package/types/components/Calendar/__tests__/CalendarRowItem.spec.d.ts +0 -1
  177. package/types/components/Calendar/__tests__/helper.spec.d.ts +0 -1
  178. package/types/components/Calendar/__tests__/index.spec.d.ts +0 -1
  179. package/types/components/Card/DataCard/__tests__/StyledDataCard.spec.d.ts +0 -1
  180. package/types/components/Card/DataCard/__tests__/index.spec.d.ts +0 -1
  181. package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -1
  182. package/types/components/Card/__tests__/index.spec.d.ts +0 -1
  183. package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +0 -1
  184. package/types/components/Checkbox/__tests__/index.spec.d.ts +0 -1
  185. package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -1
  186. package/types/components/Collapse/__tests__/index.spec.d.ts +0 -1
  187. package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +0 -1
  188. package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -1
  189. package/types/components/DatePicker/__tests__/DatePicker.spec.d.ts +0 -1
  190. package/types/components/DatePicker/__tests__/DatePickerAndroid.spec.d.ts +0 -1
  191. package/types/components/DatePicker/__tests__/DatePickerIOS.spec.d.ts +0 -1
  192. package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -1
  193. package/types/components/Drawer/DragableDrawer/__tests__/helpers.spec.d.ts +0 -1
  194. package/types/components/Drawer/DragableDrawer/__tests__/index.spec.d.ts +0 -1
  195. package/types/components/Drawer/__tests__/index.spec.d.ts +0 -1
  196. package/types/components/Empty/__tests__/index.spec.d.ts +0 -1
  197. package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -1
  198. package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -1
  199. package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -1
  200. package/types/components/FAB/__tests__/index.spec.d.ts +0 -1
  201. package/types/components/Icon/__tests__/index.spec.d.ts +0 -1
  202. package/types/components/Image/__tests__/index.spec.d.ts +0 -1
  203. package/types/components/List/__tests__/BasicListItem.spec.d.ts +0 -1
  204. package/types/components/List/__tests__/ListItem.spec.d.ts +0 -1
  205. package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +0 -1
  206. package/types/components/List/__tests__/StyledListItem.spec.d.ts +0 -1
  207. package/types/components/PinInput/__tests__/PinCell.spec.d.ts +0 -1
  208. package/types/components/PinInput/__tests__/StyledPinInput.spec.d.ts +0 -1
  209. package/types/components/PinInput/__tests__/index.spec.d.ts +0 -1
  210. package/types/components/Radio/__tests__/Radio.spec.d.ts +0 -1
  211. package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -1
  212. package/types/components/RichTextEditor/__tests__/EditorToolbar.spec.d.ts +0 -1
  213. package/types/components/RichTextEditor/__tests__/MentionList.spec.d.ts +0 -1
  214. package/types/components/RichTextEditor/__tests__/RichTextEditor.spec.d.ts +0 -1
  215. package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +0 -1
  216. package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -1
  217. package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +0 -1
  218. package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +0 -1
  219. package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +0 -1
  220. package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +0 -1
  221. package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +0 -1
  222. package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +0 -1
  223. package/types/components/Select/__tests__/StyledSelect.spec.d.ts +0 -1
  224. package/types/components/Select/__tests__/helpers.spec.d.ts +0 -1
  225. package/types/components/Slider/__tests__/index.spec.d.ts +0 -1
  226. package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +0 -1
  227. package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -1
  228. package/types/components/Spinner/__tests__/index.spec.d.ts +0 -1
  229. package/types/components/Switch/SelectorSwitch/__tests__/Option.spec.d.ts +0 -1
  230. package/types/components/Switch/SelectorSwitch/__tests__/index.spec.d.ts +0 -1
  231. package/types/components/Switch/__tests__/StyledSwitch.spec.d.ts +0 -1
  232. package/types/components/Switch/__tests__/index.spec.d.ts +0 -1
  233. package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -1
  234. package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +0 -1
  235. package/types/components/Tabs/__tests__/index.spec.d.ts +0 -1
  236. package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -1
  237. package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -1
  238. package/types/components/TextInput/__tests__/index.spec.d.ts +0 -1
  239. package/types/components/TimePicker/__tests__/TimePicker.spec.d.ts +0 -1
  240. package/types/components/TimePicker/__tests__/TimePickerAndroid.spec.d.ts +0 -1
  241. package/types/components/TimePicker/__tests__/TimePickerIOS.spec.d.ts +0 -1
  242. package/types/components/Toast/__tests__/Toast.spec.d.ts +0 -1
  243. package/types/components/Toast/__tests__/ToastContainer.spec.d.ts +0 -1
  244. package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +0 -1
  245. package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +0 -1
  246. package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -1
  247. package/types/components/Typography/Text/__tests__/index.spec.d.ts +0 -1
  248. package/types/theme/__tests__/index.spec.d.ts +0 -1
  249. package/types/utils/__tests__/scale.spec.d.ts +0 -1
@@ -6,16 +6,12 @@ exports[`TextInput defaultValue TextInput is idle renders correctly 1`] = `
6
6
  style={
7
7
  Array [
8
8
  Object {
9
- "borderColor": "#001f23",
10
- "borderRadius": 8,
11
- "borderWidth": 1,
12
9
  "marginVertical": 8,
13
10
  "width": "100%",
14
11
  },
15
12
  undefined,
16
13
  ]
17
14
  }
18
- themeVariant="filled"
19
15
  >
20
16
  <View
21
17
  style={
@@ -29,6 +25,24 @@ exports[`TextInput defaultValue TextInput is idle renders correctly 1`] = `
29
25
  ]
30
26
  }
31
27
  >
28
+ <View
29
+ style={
30
+ Array [
31
+ Object {
32
+ "borderColor": "#001f23",
33
+ "borderRadius": 8,
34
+ "borderWidth": 1,
35
+ "bottom": 0,
36
+ "left": 0,
37
+ "position": "absolute",
38
+ "right": 0,
39
+ "top": 0,
40
+ },
41
+ undefined,
42
+ ]
43
+ }
44
+ themeVariant="filled"
45
+ />
32
46
  <View
33
47
  pointerEvents="none"
34
48
  style={
@@ -58,7 +72,7 @@ exports[`TextInput defaultValue TextInput is idle renders correctly 1`] = `
58
72
  },
59
73
  Array [
60
74
  Object {
61
- "color": "#de350b",
75
+ "color": "#f46363",
62
76
  },
63
77
  undefined,
64
78
  ],
@@ -246,16 +260,12 @@ exports[`TextInput defaultValue default Value and Value renders correctly with 2
246
260
  style={
247
261
  Array [
248
262
  Object {
249
- "borderColor": "#001f23",
250
- "borderRadius": 8,
251
- "borderWidth": 1,
252
263
  "marginVertical": 8,
253
264
  "width": "100%",
254
265
  },
255
266
  undefined,
256
267
  ]
257
268
  }
258
- themeVariant="filled"
259
269
  >
260
270
  <View
261
271
  style={
@@ -269,6 +279,24 @@ exports[`TextInput defaultValue default Value and Value renders correctly with 2
269
279
  ]
270
280
  }
271
281
  >
282
+ <View
283
+ style={
284
+ Array [
285
+ Object {
286
+ "borderColor": "#001f23",
287
+ "borderRadius": 8,
288
+ "borderWidth": 1,
289
+ "bottom": 0,
290
+ "left": 0,
291
+ "position": "absolute",
292
+ "right": 0,
293
+ "top": 0,
294
+ },
295
+ undefined,
296
+ ]
297
+ }
298
+ themeVariant="filled"
299
+ />
272
300
  <View
273
301
  pointerEvents="none"
274
302
  style={
@@ -298,7 +326,7 @@ exports[`TextInput defaultValue default Value and Value renders correctly with 2
298
326
  },
299
327
  Array [
300
328
  Object {
301
- "color": "#de350b",
329
+ "color": "#f46363",
302
330
  },
303
331
  undefined,
304
332
  ],
@@ -487,9 +515,6 @@ exports[`TextInput disabled renders correctly 1`] = `
487
515
  style={
488
516
  Array [
489
517
  Object {
490
- "borderColor": "#bfc1c5",
491
- "borderRadius": 8,
492
- "borderWidth": 1,
493
518
  "marginVertical": 8,
494
519
  "width": "100%",
495
520
  },
@@ -497,7 +522,6 @@ exports[`TextInput disabled renders correctly 1`] = `
497
522
  ]
498
523
  }
499
524
  testID="disabled-text-input"
500
- themeVariant="disabled"
501
525
  >
502
526
  <View
503
527
  style={
@@ -511,6 +535,24 @@ exports[`TextInput disabled renders correctly 1`] = `
511
535
  ]
512
536
  }
513
537
  >
538
+ <View
539
+ style={
540
+ Array [
541
+ Object {
542
+ "borderColor": "#bfc1c5",
543
+ "borderRadius": 8,
544
+ "borderWidth": 1,
545
+ "bottom": 0,
546
+ "left": 0,
547
+ "position": "absolute",
548
+ "right": 0,
549
+ "top": 0,
550
+ },
551
+ undefined,
552
+ ]
553
+ }
554
+ themeVariant="disabled"
555
+ />
514
556
  <View
515
557
  pointerEvents="none"
516
558
  style={
@@ -654,16 +696,12 @@ exports[`TextInput error renders correctly 1`] = `
654
696
  style={
655
697
  Array [
656
698
  Object {
657
- "borderColor": "#de350b",
658
- "borderRadius": 8,
659
- "borderWidth": 1,
660
699
  "marginVertical": 8,
661
700
  "width": "100%",
662
701
  },
663
702
  undefined,
664
703
  ]
665
704
  }
666
- themeVariant="error"
667
705
  >
668
706
  <View
669
707
  style={
@@ -677,6 +715,24 @@ exports[`TextInput error renders correctly 1`] = `
677
715
  ]
678
716
  }
679
717
  >
718
+ <View
719
+ style={
720
+ Array [
721
+ Object {
722
+ "borderColor": "#f46363",
723
+ "borderRadius": 8,
724
+ "borderWidth": 1,
725
+ "bottom": 0,
726
+ "left": 0,
727
+ "position": "absolute",
728
+ "right": 0,
729
+ "top": 0,
730
+ },
731
+ undefined,
732
+ ]
733
+ }
734
+ themeVariant="error"
735
+ />
680
736
  <HeroIcon
681
737
  name="dollar-sign"
682
738
  style={
@@ -736,7 +792,7 @@ exports[`TextInput error renders correctly 1`] = `
736
792
  },
737
793
  Array [
738
794
  Object {
739
- "color": "#de350b",
795
+ "color": "#f46363",
740
796
  "fontSize": 14,
741
797
  },
742
798
  undefined,
@@ -871,7 +927,7 @@ exports[`TextInput error renders correctly 1`] = `
871
927
  },
872
928
  Array [
873
929
  Object {
874
- "color": "#de350b",
930
+ "color": "#f46363",
875
931
  "fontSize": 12,
876
932
  "marginLeft": 4,
877
933
  },
@@ -898,16 +954,12 @@ exports[`TextInput filled renders correctly 1`] = `
898
954
  style={
899
955
  Array [
900
956
  Object {
901
- "borderColor": "#001f23",
902
- "borderRadius": 8,
903
- "borderWidth": 1,
904
957
  "marginVertical": 8,
905
958
  "width": "100%",
906
959
  },
907
960
  undefined,
908
961
  ]
909
962
  }
910
- themeVariant="filled"
911
963
  >
912
964
  <View
913
965
  style={
@@ -921,6 +973,24 @@ exports[`TextInput filled renders correctly 1`] = `
921
973
  ]
922
974
  }
923
975
  >
976
+ <View
977
+ style={
978
+ Array [
979
+ Object {
980
+ "borderColor": "#001f23",
981
+ "borderRadius": 8,
982
+ "borderWidth": 1,
983
+ "bottom": 0,
984
+ "left": 0,
985
+ "position": "absolute",
986
+ "right": 0,
987
+ "top": 0,
988
+ },
989
+ undefined,
990
+ ]
991
+ }
992
+ themeVariant="filled"
993
+ />
924
994
  <View
925
995
  pointerEvents="none"
926
996
  style={
@@ -1069,16 +1139,12 @@ exports[`TextInput helper text renders correctly 1`] = `
1069
1139
  style={
1070
1140
  Array [
1071
1141
  Object {
1072
- "borderColor": "#001f23",
1073
- "borderRadius": 8,
1074
- "borderWidth": 1,
1075
1142
  "marginVertical": 8,
1076
1143
  "width": "100%",
1077
1144
  },
1078
1145
  undefined,
1079
1146
  ]
1080
1147
  }
1081
- themeVariant="default"
1082
1148
  >
1083
1149
  <View
1084
1150
  style={
@@ -1092,6 +1158,24 @@ exports[`TextInput helper text renders correctly 1`] = `
1092
1158
  ]
1093
1159
  }
1094
1160
  >
1161
+ <View
1162
+ style={
1163
+ Array [
1164
+ Object {
1165
+ "borderColor": "#001f23",
1166
+ "borderRadius": 8,
1167
+ "borderWidth": 1,
1168
+ "bottom": 0,
1169
+ "left": 0,
1170
+ "position": "absolute",
1171
+ "right": 0,
1172
+ "top": 0,
1173
+ },
1174
+ undefined,
1175
+ ]
1176
+ }
1177
+ themeVariant="default"
1178
+ />
1095
1179
  <HeroIcon
1096
1180
  name="dollar-sign"
1097
1181
  style={
@@ -1151,7 +1235,7 @@ exports[`TextInput helper text renders correctly 1`] = `
1151
1235
  },
1152
1236
  Array [
1153
1237
  Object {
1154
- "color": "#de350b",
1238
+ "color": "#f46363",
1155
1239
  "fontSize": 14,
1156
1240
  },
1157
1241
  undefined,
@@ -1279,9 +1363,6 @@ exports[`TextInput idle renders correctly 1`] = `
1279
1363
  style={
1280
1364
  Array [
1281
1365
  Object {
1282
- "borderColor": "#001f23",
1283
- "borderRadius": 8,
1284
- "borderWidth": 1,
1285
1366
  "marginVertical": 8,
1286
1367
  "width": "100%",
1287
1368
  },
@@ -1291,7 +1372,6 @@ exports[`TextInput idle renders correctly 1`] = `
1291
1372
  ]
1292
1373
  }
1293
1374
  testID="idle-text-input"
1294
- themeVariant="default"
1295
1375
  >
1296
1376
  <View
1297
1377
  style={
@@ -1305,6 +1385,24 @@ exports[`TextInput idle renders correctly 1`] = `
1305
1385
  ]
1306
1386
  }
1307
1387
  >
1388
+ <View
1389
+ style={
1390
+ Array [
1391
+ Object {
1392
+ "borderColor": "#001f23",
1393
+ "borderRadius": 8,
1394
+ "borderWidth": 1,
1395
+ "bottom": 0,
1396
+ "left": 0,
1397
+ "position": "absolute",
1398
+ "right": 0,
1399
+ "top": 0,
1400
+ },
1401
+ undefined,
1402
+ ]
1403
+ }
1404
+ themeVariant="default"
1405
+ />
1308
1406
  <HeroIcon
1309
1407
  name="dollar-sign"
1310
1408
  style={
@@ -1457,16 +1555,12 @@ exports[`TextInput idle with suffix and prefix are React Element renders correct
1457
1555
  style={
1458
1556
  Array [
1459
1557
  Object {
1460
- "borderColor": "#001f23",
1461
- "borderRadius": 8,
1462
- "borderWidth": 1,
1463
1558
  "marginVertical": 8,
1464
1559
  "width": "100%",
1465
1560
  },
1466
1561
  undefined,
1467
1562
  ]
1468
1563
  }
1469
- themeVariant="default"
1470
1564
  >
1471
1565
  <View
1472
1566
  style={
@@ -1480,6 +1574,24 @@ exports[`TextInput idle with suffix and prefix are React Element renders correct
1480
1574
  ]
1481
1575
  }
1482
1576
  >
1577
+ <View
1578
+ style={
1579
+ Array [
1580
+ Object {
1581
+ "borderColor": "#001f23",
1582
+ "borderRadius": 8,
1583
+ "borderWidth": 1,
1584
+ "bottom": 0,
1585
+ "left": 0,
1586
+ "position": "absolute",
1587
+ "right": 0,
1588
+ "top": 0,
1589
+ },
1590
+ undefined,
1591
+ ]
1592
+ }
1593
+ themeVariant="default"
1594
+ />
1483
1595
  <HeroIcon
1484
1596
  name="eye-circle"
1485
1597
  style={
@@ -1539,7 +1651,7 @@ exports[`TextInput idle with suffix and prefix are React Element renders correct
1539
1651
  },
1540
1652
  Array [
1541
1653
  Object {
1542
- "color": "#de350b",
1654
+ "color": "#f46363",
1543
1655
  "fontSize": 14,
1544
1656
  },
1545
1657
  undefined,
@@ -1658,16 +1770,12 @@ exports[`TextInput loading renders correctly 1`] = `
1658
1770
  style={
1659
1771
  Array [
1660
1772
  Object {
1661
- "borderColor": "#808f91",
1662
- "borderRadius": 8,
1663
- "borderWidth": 1,
1664
1773
  "marginVertical": 8,
1665
1774
  "width": "100%",
1666
1775
  },
1667
1776
  undefined,
1668
1777
  ]
1669
1778
  }
1670
- themeVariant="readonly"
1671
1779
  >
1672
1780
  <View
1673
1781
  style={
@@ -1681,6 +1789,24 @@ exports[`TextInput loading renders correctly 1`] = `
1681
1789
  ]
1682
1790
  }
1683
1791
  >
1792
+ <View
1793
+ style={
1794
+ Array [
1795
+ Object {
1796
+ "borderColor": "#808f91",
1797
+ "borderRadius": 8,
1798
+ "borderWidth": 1,
1799
+ "bottom": 0,
1800
+ "left": 0,
1801
+ "position": "absolute",
1802
+ "right": 0,
1803
+ "top": 0,
1804
+ },
1805
+ undefined,
1806
+ ]
1807
+ }
1808
+ themeVariant="readonly"
1809
+ />
1684
1810
  <View
1685
1811
  style={
1686
1812
  Array [
@@ -1801,16 +1927,12 @@ exports[`TextInput max length renders correctly 1`] = `
1801
1927
  style={
1802
1928
  Array [
1803
1929
  Object {
1804
- "borderColor": "#de350b",
1805
- "borderRadius": 8,
1806
- "borderWidth": 1,
1807
1930
  "marginVertical": 8,
1808
1931
  "width": "100%",
1809
1932
  },
1810
1933
  undefined,
1811
1934
  ]
1812
1935
  }
1813
- themeVariant="error"
1814
1936
  >
1815
1937
  <View
1816
1938
  style={
@@ -1824,6 +1946,24 @@ exports[`TextInput max length renders correctly 1`] = `
1824
1946
  ]
1825
1947
  }
1826
1948
  >
1949
+ <View
1950
+ style={
1951
+ Array [
1952
+ Object {
1953
+ "borderColor": "#f46363",
1954
+ "borderRadius": 8,
1955
+ "borderWidth": 1,
1956
+ "bottom": 0,
1957
+ "left": 0,
1958
+ "position": "absolute",
1959
+ "right": 0,
1960
+ "top": 0,
1961
+ },
1962
+ undefined,
1963
+ ]
1964
+ }
1965
+ themeVariant="error"
1966
+ />
1827
1967
  <View
1828
1968
  pointerEvents="none"
1829
1969
  style={
@@ -1853,7 +1993,7 @@ exports[`TextInput max length renders correctly 1`] = `
1853
1993
  },
1854
1994
  Array [
1855
1995
  Object {
1856
- "color": "#de350b",
1996
+ "color": "#f46363",
1857
1997
  },
1858
1998
  undefined,
1859
1999
  ],
@@ -2000,7 +2140,7 @@ exports[`TextInput max length renders correctly 1`] = `
2000
2140
  },
2001
2141
  Array [
2002
2142
  Object {
2003
- "color": "#de350b",
2143
+ "color": "#f46363",
2004
2144
  "fontSize": 12,
2005
2145
  "marginLeft": 4,
2006
2146
  },
@@ -2029,7 +2169,7 @@ exports[`TextInput max length renders correctly 1`] = `
2029
2169
  Array [
2030
2170
  Object {
2031
2171
  "alignSelf": "flex-end",
2032
- "color": "#de350b",
2172
+ "color": "#f46363",
2033
2173
  "flex": 1,
2034
2174
  "flexGrow": 1,
2035
2175
  "fontSize": 12,
@@ -2060,16 +2200,12 @@ exports[`TextInput placeholder TextInput is idle renders correctly 1`] = `
2060
2200
  style={
2061
2201
  Array [
2062
2202
  Object {
2063
- "borderColor": "#001f23",
2064
- "borderRadius": 8,
2065
- "borderWidth": 1,
2066
2203
  "marginVertical": 8,
2067
2204
  "width": "100%",
2068
2205
  },
2069
2206
  undefined,
2070
2207
  ]
2071
2208
  }
2072
- themeVariant="default"
2073
2209
  >
2074
2210
  <View
2075
2211
  style={
@@ -2083,6 +2219,24 @@ exports[`TextInput placeholder TextInput is idle renders correctly 1`] = `
2083
2219
  ]
2084
2220
  }
2085
2221
  >
2222
+ <View
2223
+ style={
2224
+ Array [
2225
+ Object {
2226
+ "borderColor": "#001f23",
2227
+ "borderRadius": 8,
2228
+ "borderWidth": 1,
2229
+ "bottom": 0,
2230
+ "left": 0,
2231
+ "position": "absolute",
2232
+ "right": 0,
2233
+ "top": 0,
2234
+ },
2235
+ undefined,
2236
+ ]
2237
+ }
2238
+ themeVariant="default"
2239
+ />
2086
2240
  <HeroIcon
2087
2241
  name="dollar-sign"
2088
2242
  style={
@@ -2142,7 +2296,7 @@ exports[`TextInput placeholder TextInput is idle renders correctly 1`] = `
2142
2296
  },
2143
2297
  Array [
2144
2298
  Object {
2145
- "color": "#de350b",
2299
+ "color": "#f46363",
2146
2300
  "fontSize": 14,
2147
2301
  },
2148
2302
  undefined,
@@ -2270,16 +2424,12 @@ exports[`TextInput readonly renders correctly 1`] = `
2270
2424
  style={
2271
2425
  Array [
2272
2426
  Object {
2273
- "borderColor": "#808f91",
2274
- "borderRadius": 8,
2275
- "borderWidth": 1,
2276
2427
  "marginVertical": 8,
2277
2428
  "width": "100%",
2278
2429
  },
2279
2430
  undefined,
2280
2431
  ]
2281
2432
  }
2282
- themeVariant="readonly"
2283
2433
  >
2284
2434
  <View
2285
2435
  style={
@@ -2293,6 +2443,24 @@ exports[`TextInput readonly renders correctly 1`] = `
2293
2443
  ]
2294
2444
  }
2295
2445
  >
2446
+ <View
2447
+ style={
2448
+ Array [
2449
+ Object {
2450
+ "borderColor": "#808f91",
2451
+ "borderRadius": 8,
2452
+ "borderWidth": 1,
2453
+ "bottom": 0,
2454
+ "left": 0,
2455
+ "position": "absolute",
2456
+ "right": 0,
2457
+ "top": 0,
2458
+ },
2459
+ undefined,
2460
+ ]
2461
+ }
2462
+ themeVariant="readonly"
2463
+ />
2296
2464
  <View
2297
2465
  pointerEvents="none"
2298
2466
  style={
@@ -2347,7 +2515,7 @@ exports[`TextInput readonly renders correctly 1`] = `
2347
2515
  },
2348
2516
  Array [
2349
2517
  Object {
2350
- "color": "#808f91",
2518
+ "color": "#bfc1c5",
2351
2519
  },
2352
2520
  undefined,
2353
2521
  ],
@@ -2466,16 +2634,12 @@ exports[`TextInput required renders correctly 1`] = `
2466
2634
  style={
2467
2635
  Array [
2468
2636
  Object {
2469
- "borderColor": "#001f23",
2470
- "borderRadius": 8,
2471
- "borderWidth": 1,
2472
2637
  "marginVertical": 8,
2473
2638
  "width": "100%",
2474
2639
  },
2475
2640
  undefined,
2476
2641
  ]
2477
2642
  }
2478
- themeVariant="default"
2479
2643
  >
2480
2644
  <View
2481
2645
  style={
@@ -2489,6 +2653,24 @@ exports[`TextInput required renders correctly 1`] = `
2489
2653
  ]
2490
2654
  }
2491
2655
  >
2656
+ <View
2657
+ style={
2658
+ Array [
2659
+ Object {
2660
+ "borderColor": "#001f23",
2661
+ "borderRadius": 8,
2662
+ "borderWidth": 1,
2663
+ "bottom": 0,
2664
+ "left": 0,
2665
+ "position": "absolute",
2666
+ "right": 0,
2667
+ "top": 0,
2668
+ },
2669
+ undefined,
2670
+ ]
2671
+ }
2672
+ themeVariant="default"
2673
+ />
2492
2674
  <HeroIcon
2493
2675
  name="dollar-sign"
2494
2676
  style={
@@ -2548,7 +2730,7 @@ exports[`TextInput required renders correctly 1`] = `
2548
2730
  },
2549
2731
  Array [
2550
2732
  Object {
2551
- "color": "#de350b",
2733
+ "color": "#f46363",
2552
2734
  "fontSize": 14,
2553
2735
  },
2554
2736
  undefined,
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
2
  import { StyleSheet } from 'react-native';
3
3
  import type {
4
4
  TextInputProps as NativeTextInputProps,
@@ -22,12 +22,14 @@ import {
22
22
  StyledTextInputAndLabelContainer,
23
23
  StyledLabelContainerInsideTextInput,
24
24
  StyledErrorAndHelpTextContainer,
25
+ StyledBorderBackDrop,
25
26
  StyledErrorAndMaxLengthContainer,
26
27
  } from './StyledTextInput';
27
28
  import Icon from '../Icon';
28
29
  import { useTheme } from '../../theme';
29
30
  import type { Variant } from './StyledTextInput';
30
31
  import type { IconName } from '../Icon';
32
+ import { omit, pick } from '../../utils/helpers';
31
33
 
32
34
  export interface TextInputProps extends NativeTextInputProps {
33
35
  /**
@@ -169,10 +171,25 @@ const TextInput = ({
169
171
 
170
172
  const theme = useTheme();
171
173
 
174
+ const { borderStyle, textStyleWithoutBorderStyle } = useMemo(() => {
175
+ if (!textStyle) {
176
+ return {};
177
+ }
178
+
179
+ const flattenTextStyle = StyleSheet.flatten(textStyle);
180
+ const borderKeys = Object.keys(flattenTextStyle).filter((key) => {
181
+ return key.startsWith('border');
182
+ });
183
+ return {
184
+ borderStyle: pick(borderKeys, flattenTextStyle),
185
+ textStyleWithoutBorderStyle: omit(borderKeys, flattenTextStyle),
186
+ };
187
+ }, [textStyle]);
188
+
172
189
  const nativeInputProps: NativeTextInputProps = {
173
190
  style: StyleSheet.flatten([
174
191
  { color: theme.__hd__.textInput.colors.text },
175
- textStyle,
192
+ textStyleWithoutBorderStyle,
176
193
  ]),
177
194
  testID: 'text-input',
178
195
  accessibilityState: {
@@ -201,14 +218,14 @@ const TextInput = ({
201
218
 
202
219
  return (
203
220
  <StyledContainer
221
+ style={style}
204
222
  pointerEvents={
205
223
  variant === 'disabled' || variant === 'readonly' ? 'none' : 'auto'
206
224
  }
207
225
  testID={testID}
208
- style={style}
209
- themeVariant={variant}
210
226
  >
211
227
  <StyledTextInputContainer>
228
+ <StyledBorderBackDrop themeVariant={variant} style={borderStyle} />
212
229
  {(isFocused || (label && !isEmptyValue)) && (
213
230
  <StyledLabelContainer pointerEvents="none">
214
231
  {required && (