@hero-design/rn 8.79.2-test.0 → 8.80.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/es/index.js +25 -36
  3. package/lib/index.js +25 -36
  4. package/package.json +3 -2
  5. package/src/components/BottomSheet/index.tsx +13 -15
  6. package/src/components/Chip/StyledChip.tsx +14 -20
  7. package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +195 -1
  8. package/src/components/Chip/__tests__/index.spec.tsx +9 -7
  9. package/src/components/Chip/index.tsx +1 -1
  10. package/src/components/PinInput/__tests__/index.spec.tsx +0 -4
  11. package/src/components/PinInput/index.tsx +3 -7
  12. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +0 -2
  13. package/src/theme/components/chip.ts +0 -2
  14. package/stats/8.79.1/rn-stats.html +2 -0
  15. package/stats/8.80.0/rn-stats.html +4842 -0
  16. package/types/components/Accordion/AccordionItem.d.ts +0 -0
  17. package/types/components/Accordion/StyledAccordion.d.ts +0 -0
  18. package/types/components/Accordion/index.d.ts +0 -0
  19. package/types/components/Alert/StyledAlert.d.ts +0 -0
  20. package/types/components/Alert/index.d.ts +0 -0
  21. package/types/components/Attachment/StyledAttachment.d.ts +0 -0
  22. package/types/components/Attachment/index.d.ts +0 -0
  23. package/types/components/Avatar/Avatar.d.ts +0 -0
  24. package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
  25. package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
  26. package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
  27. package/types/components/Avatar/StyledAvatar.d.ts +0 -0
  28. package/types/components/Avatar/index.d.ts +0 -0
  29. package/types/components/Badge/Status.d.ts +0 -0
  30. package/types/components/Badge/StyledBadge.d.ts +0 -0
  31. package/types/components/Badge/index.d.ts +0 -0
  32. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  33. package/types/components/BottomNavigation/index.d.ts +0 -0
  34. package/types/components/BottomSheet/BottomSheetContext.d.ts +0 -0
  35. package/types/components/BottomSheet/Footer.d.ts +0 -0
  36. package/types/components/BottomSheet/Header.d.ts +0 -0
  37. package/types/components/BottomSheet/ScrollView.d.ts +0 -0
  38. package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
  39. package/types/components/BottomSheet/index.d.ts +0 -0
  40. package/types/components/Box/StyledBox.d.ts +0 -0
  41. package/types/components/Box/config.d.ts +0 -0
  42. package/types/components/Box/index.d.ts +0 -0
  43. package/types/components/Box/types.d.ts +0 -0
  44. package/types/components/Button/Button.d.ts +0 -0
  45. package/types/components/Button/IconButton.d.ts +0 -0
  46. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
  47. package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
  48. package/types/components/Button/StyledButton.d.ts +0 -0
  49. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
  50. package/types/components/Button/UtilityButton/index.d.ts +0 -0
  51. package/types/components/Button/index.d.ts +0 -0
  52. package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
  53. package/types/components/Calendar/StyledCalendar.d.ts +0 -0
  54. package/types/components/Calendar/helpers.d.ts +0 -0
  55. package/types/components/Calendar/index.d.ts +0 -0
  56. package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
  57. package/types/components/Card/DataCard/index.d.ts +0 -0
  58. package/types/components/Card/StyledCard.d.ts +0 -0
  59. package/types/components/Card/index.d.ts +0 -0
  60. package/types/components/Carousel/CardCarousel.d.ts +0 -0
  61. package/types/components/Carousel/CarouselItem.d.ts +0 -0
  62. package/types/components/Carousel/StyledCardCarousel.d.ts +0 -0
  63. package/types/components/Carousel/StyledCarousel.d.ts +0 -0
  64. package/types/components/Carousel/contants.d.ts +0 -0
  65. package/types/components/Carousel/index.d.ts +0 -0
  66. package/types/components/Carousel/types.d.ts +0 -0
  67. package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
  68. package/types/components/Checkbox/index.d.ts +0 -0
  69. package/types/components/Chip/StyledChip.d.ts +1 -1
  70. package/types/components/Chip/index.d.ts +1 -1
  71. package/types/components/Collapse/StyledCollapse.d.ts +0 -0
  72. package/types/components/Collapse/index.d.ts +0 -0
  73. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
  74. package/types/components/ContentNavigator/index.d.ts +0 -0
  75. package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -0
  76. package/types/components/DatePicker/DatePickerCalendar.d.ts +0 -0
  77. package/types/components/DatePicker/DatePickerIOS.d.ts +0 -0
  78. package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
  79. package/types/components/DatePicker/index.d.ts +0 -0
  80. package/types/components/DatePicker/types.d.ts +0 -0
  81. package/types/components/Divider/StyledDivider.d.ts +0 -0
  82. package/types/components/Divider/index.d.ts +0 -0
  83. package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
  84. package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
  85. package/types/components/Drawer/StyledDrawer.d.ts +0 -0
  86. package/types/components/Drawer/index.d.ts +0 -0
  87. package/types/components/Empty/StyledEmpty.d.ts +0 -0
  88. package/types/components/Empty/index.d.ts +0 -0
  89. package/types/components/Error/StyledError.d.ts +0 -0
  90. package/types/components/Error/index.d.ts +0 -0
  91. package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  92. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  93. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  94. package/types/components/FAB/ActionGroup/index.d.ts +0 -0
  95. package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
  96. package/types/components/FAB/FAB.d.ts +0 -0
  97. package/types/components/FAB/StyledFAB.d.ts +0 -0
  98. package/types/components/FAB/index.d.ts +0 -0
  99. package/types/components/FloatingIsland/SingleLine/StyledSingleLine.d.ts +15 -0
  100. package/types/components/FloatingIsland/SingleLine/index.d.ts +24 -0
  101. package/types/components/Icon/AnimatedIcon.d.ts +0 -0
  102. package/types/components/Icon/HeroIcon/index.d.ts +0 -0
  103. package/types/components/Icon/IconList.d.ts +0 -0
  104. package/types/components/Icon/index.d.ts +0 -0
  105. package/types/components/Icon/utils.d.ts +0 -0
  106. package/types/components/Image/index.d.ts +0 -0
  107. package/types/components/List/BasicListItem.d.ts +0 -0
  108. package/types/components/List/ListItem.d.ts +0 -0
  109. package/types/components/List/StyledBasicListItem.d.ts +0 -0
  110. package/types/components/List/StyledListItem.d.ts +0 -0
  111. package/types/components/List/index.d.ts +0 -0
  112. package/types/components/PageControl/StyledPageControl.d.ts +0 -0
  113. package/types/components/PageControl/index.d.ts +0 -0
  114. package/types/components/PinInput/PinCell.d.ts +0 -0
  115. package/types/components/PinInput/StyledPinInput.d.ts +0 -0
  116. package/types/components/PinInput/index.d.ts +0 -0
  117. package/types/components/Progress/ProgressBar.d.ts +0 -0
  118. package/types/components/Progress/ProgressCircle.d.ts +0 -0
  119. package/types/components/Progress/StyledProgressBar.d.ts +0 -0
  120. package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
  121. package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
  122. package/types/components/Progress/constants.d.ts +0 -0
  123. package/types/components/Progress/index.d.ts +0 -0
  124. package/types/components/Progress/types.d.ts +0 -0
  125. package/types/components/Radio/Radio.d.ts +0 -0
  126. package/types/components/Radio/RadioGroup.d.ts +0 -0
  127. package/types/components/Radio/StyledRadio.d.ts +0 -0
  128. package/types/components/Radio/index.d.ts +0 -0
  129. package/types/components/Radio/types.d.ts +0 -0
  130. package/types/components/RefreshControl/index.d.ts +0 -0
  131. package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
  132. package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
  133. package/types/components/RichTextEditor/MentionList.d.ts +0 -0
  134. package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
  135. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
  136. package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
  137. package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
  138. package/types/components/RichTextEditor/constants.d.ts +0 -0
  139. package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
  140. package/types/components/RichTextEditor/index.d.ts +0 -0
  141. package/types/components/RichTextEditor/types.d.ts +0 -0
  142. package/types/components/RichTextEditor/utils/events.d.ts +0 -0
  143. package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
  144. package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
  145. package/types/components/SectionHeading/index.d.ts +0 -0
  146. package/types/components/Select/BaseOptionList.d.ts +0 -0
  147. package/types/components/Select/Footer.d.ts +0 -0
  148. package/types/components/Select/MultiSelect/Option.d.ts +0 -0
  149. package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
  150. package/types/components/Select/MultiSelect/index.d.ts +0 -0
  151. package/types/components/Select/SingleSelect/Option.d.ts +0 -0
  152. package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
  153. package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -0
  154. package/types/components/Select/SingleSelect/index.d.ts +0 -0
  155. package/types/components/Select/StyledSelect.d.ts +0 -0
  156. package/types/components/Select/helpers.d.ts +0 -0
  157. package/types/components/Select/index.d.ts +0 -0
  158. package/types/components/Select/types.d.ts +0 -0
  159. package/types/components/Skeleton/StyledSkeleton.d.ts +0 -0
  160. package/types/components/Skeleton/index.d.ts +0 -0
  161. package/types/components/Slider/index.d.ts +0 -0
  162. package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
  163. package/types/components/Spinner/StyledSpinner.d.ts +0 -0
  164. package/types/components/Spinner/index.d.ts +0 -0
  165. package/types/components/Success/StyledSuccess.d.ts +0 -0
  166. package/types/components/Success/index.d.ts +0 -0
  167. package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
  168. package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
  169. package/types/components/Swipeable/index.d.ts +0 -0
  170. package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
  171. package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
  172. package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
  173. package/types/components/Switch/StyledSwitch.d.ts +0 -0
  174. package/types/components/Switch/index.d.ts +0 -0
  175. package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
  176. package/types/components/Tabs/SceneView.d.ts +0 -0
  177. package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
  178. package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
  179. package/types/components/Tabs/StyledTabs.d.ts +0 -0
  180. package/types/components/Tabs/TabWithBadge.d.ts +0 -0
  181. package/types/components/Tabs/index.d.ts +0 -0
  182. package/types/components/Tabs/useIsFocused.d.ts +0 -0
  183. package/types/components/Tabs/utils.d.ts +0 -0
  184. package/types/components/Tag/StyledTag.d.ts +0 -0
  185. package/types/components/Tag/index.d.ts +0 -0
  186. package/types/components/TextInput/StyledTextInput.d.ts +0 -0
  187. package/types/components/TextInput/index.d.ts +0 -0
  188. package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
  189. package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
  190. package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
  191. package/types/components/TimePicker/index.d.ts +0 -0
  192. package/types/components/TimePicker/types.d.ts +0 -0
  193. package/types/components/Toast/StyledToast.d.ts +0 -0
  194. package/types/components/Toast/Toast.d.ts +0 -0
  195. package/types/components/Toast/ToastContainer.d.ts +0 -0
  196. package/types/components/Toast/ToastContext.d.ts +0 -0
  197. package/types/components/Toast/ToastProvider.d.ts +0 -0
  198. package/types/components/Toast/index.d.ts +0 -0
  199. package/types/components/Toast/types.d.ts +0 -0
  200. package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
  201. package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
  202. package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
  203. package/types/components/Toolbar/index.d.ts +0 -0
  204. package/types/components/Typography/Text/StyledText.d.ts +0 -0
  205. package/types/components/Typography/Text/index.d.ts +0 -0
  206. package/types/components/Typography/index.d.ts +0 -0
  207. package/types/index.d.ts +0 -0
  208. package/types/testHelpers/renderWithTheme.d.ts +0 -0
  209. package/types/theme/ThemeProvider.d.ts +0 -0
  210. package/types/theme/ThemeSwitcher.d.ts +0 -0
  211. package/types/theme/components/accordion.d.ts +0 -0
  212. package/types/theme/components/alert.d.ts +0 -0
  213. package/types/theme/components/attachment.d.ts +0 -0
  214. package/types/theme/components/avatar.d.ts +0 -0
  215. package/types/theme/components/badge.d.ts +0 -0
  216. package/types/theme/components/bottomNavigation.d.ts +0 -0
  217. package/types/theme/components/bottomSheet.d.ts +0 -0
  218. package/types/theme/components/button.d.ts +0 -0
  219. package/types/theme/components/calendar.d.ts +0 -0
  220. package/types/theme/components/card.d.ts +0 -0
  221. package/types/theme/components/cardCarousel.d.ts +0 -0
  222. package/types/theme/components/carousel.d.ts +0 -0
  223. package/types/theme/components/checkbox.d.ts +0 -0
  224. package/types/theme/components/chip.d.ts +0 -2
  225. package/types/theme/components/contentNavigator.d.ts +0 -0
  226. package/types/theme/components/datePicker.d.ts +0 -0
  227. package/types/theme/components/divider.d.ts +0 -0
  228. package/types/theme/components/drawer.d.ts +0 -0
  229. package/types/theme/components/empty.d.ts +0 -0
  230. package/types/theme/components/error.d.ts +0 -0
  231. package/types/theme/components/fab.d.ts +0 -0
  232. package/types/theme/components/icon.d.ts +0 -0
  233. package/types/theme/components/image.d.ts +0 -0
  234. package/types/theme/components/list.d.ts +0 -0
  235. package/types/theme/components/pageControl.d.ts +0 -0
  236. package/types/theme/components/pinInput.d.ts +0 -0
  237. package/types/theme/components/progress.d.ts +0 -0
  238. package/types/theme/components/radio.d.ts +0 -0
  239. package/types/theme/components/refreshControl.d.ts +0 -0
  240. package/types/theme/components/richTextEditor.d.ts +0 -0
  241. package/types/theme/components/sectionHeading.d.ts +0 -0
  242. package/types/theme/components/select.d.ts +0 -0
  243. package/types/theme/components/skeleton.d.ts +0 -0
  244. package/types/theme/components/slider.d.ts +0 -0
  245. package/types/theme/components/spinner.d.ts +0 -0
  246. package/types/theme/components/success.d.ts +0 -0
  247. package/types/theme/components/swipeable.d.ts +0 -0
  248. package/types/theme/components/switch.d.ts +0 -0
  249. package/types/theme/components/tabs.d.ts +0 -0
  250. package/types/theme/components/tag.d.ts +0 -0
  251. package/types/theme/components/textInput.d.ts +0 -0
  252. package/types/theme/components/timePicker.d.ts +0 -0
  253. package/types/theme/components/toast.d.ts +0 -0
  254. package/types/theme/components/toolbar.d.ts +0 -0
  255. package/types/theme/components/typography.d.ts +0 -0
  256. package/types/theme/getTheme.d.ts +0 -0
  257. package/types/theme/global/borders.d.ts +0 -0
  258. package/types/theme/global/colors/eBens.d.ts +0 -0
  259. package/types/theme/global/colors/global.d.ts +0 -0
  260. package/types/theme/global/colors/globalDark.d.ts +0 -0
  261. package/types/theme/global/colors/jobs.d.ts +0 -0
  262. package/types/theme/global/colors/swag.d.ts +0 -0
  263. package/types/theme/global/colors/swagDark.d.ts +0 -0
  264. package/types/theme/global/colors/types.d.ts +0 -0
  265. package/types/theme/global/colors/wallet.d.ts +0 -0
  266. package/types/theme/global/colors/work.d.ts +0 -0
  267. package/types/theme/global/index.d.ts +0 -0
  268. package/types/theme/global/scale.d.ts +0 -0
  269. package/types/theme/global/sizes.d.ts +0 -0
  270. package/types/theme/global/space.d.ts +0 -0
  271. package/types/theme/global/typography.d.ts +0 -0
  272. package/types/theme/index.d.ts +0 -0
  273. package/types/types.d.ts +0 -0
  274. package/types/utils/functions.d.ts +0 -0
  275. package/types/utils/helpers.d.ts +0 -0
  276. package/types/utils/hooks.d.ts +0 -0
  277. package/types/utils/scale.d.ts +0 -0
  278. package/.turbo/turbo-build$colon$types.log +0 -0
  279. package/.turbo/turbo-build.log +0 -8
  280. package/.turbo/turbo-lint.log +0 -183
  281. package/.turbo/turbo-publish:npm.log +0 -9
  282. package/.turbo/turbo-test.log +0 -4726
  283. package/.turbo/turbo-type-check.log +0 -0
  284. package/types/components/Search/SearchBasic.d.ts +0 -31
  285. package/types/components/Search/SearchCompound.d.ts +0 -60
  286. package/types/components/Tabs/ScrollableTabsHeader.d.ts +0 -35
package/CHANGELOG.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @hero-design/rn
2
2
 
3
- ## 8.79.2-test.0
3
+ ## 8.80.0
4
4
 
5
- ### Patch Changes
5
+ ### Minor Changes
6
6
 
7
- - [`6205254b327679c8e861ba015c965e1e7776e1cb`](https://github.com/Thinkei/hero-design/commit/6205254b327679c8e861ba015c965e1e7776e1cb) Thanks [@ttkien](https://github.com/ttkien)! - [BottomSheet] fix onDismiss call twice
7
+ - [#3502](https://github.com/Thinkei/hero-design/pull/3502) [`88c11405abfaf87625b9fde266d58d7fd09e25e9`](https://github.com/Thinkei/hero-design/commit/88c11405abfaf87625b9fde266d58d7fd09e25e9) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Chip] Add compact-outlined variant
8
8
 
9
9
  ## 8.79.1
10
10
 
package/es/index.js CHANGED
@@ -2646,9 +2646,7 @@ var getChipTheme = function getChipTheme(theme) {
2646
2646
  outlinedDefaultBackground: theme.colors.defaultGlobalSurface,
2647
2647
  outlinedSelectedBackground: theme.colors.secondaryOutline,
2648
2648
  outlinedSelectedBorder: theme.colors.primaryOutline,
2649
- outlinedDefaultBorder: theme.colors.disabledOnDefaultGlobalSurface,
2650
- compactDefaultBackground: theme.colors.defaultGlobalSurface,
2651
- compactSelectedBackground: theme.colors.neutralGlobalSurface
2649
+ outlinedDefaultBorder: theme.colors.disabledOnDefaultGlobalSurface
2652
2650
  };
2653
2651
  var space = {
2654
2652
  wrapperHorizontalPadding: theme.space.smallMedium,
@@ -9720,16 +9718,24 @@ var BottomSheet = function BottomSheet(_ref) {
9720
9718
  _useState4 = _slicedToArray(_useState3, 2),
9721
9719
  internalShowDivider = _useState4[0],
9722
9720
  setInternalShowDivider = _useState4[1];
9723
- var canCallOnDismiss = useRef(false);
9724
9721
  useEffect(function () {
9725
- // Prevent calling onDismiss when the component has not yet opened
9726
- if (open && !canCallOnDismiss.current) {
9727
- canCallOnDismiss.current = true;
9728
- }
9729
9722
  // Show the modal before the open animation start
9730
9723
  if (open && !visible) {
9731
9724
  setVisibility(open);
9732
9725
  }
9726
+ // Delay closing the modal until after the closing animation end
9727
+ animatedValue.current.removeAllListeners();
9728
+ animatedValue.current.addListener(function (_ref2) {
9729
+ var value = _ref2.value;
9730
+ var endValueOfTransition = open ? 1 : 0;
9731
+ if (endValueOfTransition === 0 && value === endValueOfTransition) {
9732
+ setVisibility(false);
9733
+ onDismiss === null || onDismiss === void 0 || onDismiss();
9734
+ }
9735
+ });
9736
+ return function () {
9737
+ return animatedValue.current.removeAllListeners();
9738
+ };
9733
9739
  }, [open]);
9734
9740
  // Animation
9735
9741
  useEffect(function () {
@@ -9738,16 +9744,7 @@ var BottomSheet = function BottomSheet(_ref) {
9738
9744
  easing: Easing.inOut(Easing.cubic),
9739
9745
  useNativeDriver: true
9740
9746
  });
9741
- animation.start(function (_ref2) {
9742
- var finished = _ref2.finished;
9743
- if (finished) {
9744
- if (!open && canCallOnDismiss.current) {
9745
- setVisibility(false);
9746
- onDismiss === null || onDismiss === void 0 || onDismiss();
9747
- }
9748
- onAnimationEnd === null || onAnimationEnd === void 0 || onAnimationEnd();
9749
- }
9750
- });
9747
+ animation.start(onAnimationEnd);
9751
9748
  return function () {
9752
9749
  return animation.stop();
9753
9750
  };
@@ -13059,12 +13056,14 @@ var StyledChipWrapper = index$a(TouchableOpacity)(function (_ref) {
13059
13056
  case 'filled':
13060
13057
  return _objectSpread2({}, theme.__hd__.chip.shadows.filledWrapper);
13061
13058
  case 'outlined':
13059
+ case 'compact-outlined':
13062
13060
  return undefined;
13063
13061
  }
13064
13062
  };
13065
13063
  var getBorderStyles = function getBorderStyles() {
13066
13064
  switch (themeVariant) {
13067
13065
  case 'outlined':
13066
+ case 'compact-outlined':
13068
13067
  {
13069
13068
  return {
13070
13069
  borderColor: themeSelected ? theme.__hd__.chip.colors.outlinedSelectedBorder : theme.__hd__.chip.colors.outlinedDefaultBorder,
@@ -13084,42 +13083,34 @@ var StyledChipWrapper = index$a(TouchableOpacity)(function (_ref) {
13084
13083
  if (themeSelected) {
13085
13084
  switch (themeVariant) {
13086
13085
  case 'outlined':
13086
+ case 'compact-outlined':
13087
13087
  {
13088
13088
  return {
13089
13089
  backgroundColor: themeSelected ? theme.__hd__.chip.colors.outlinedSelectedBackground : theme.__hd__.chip.colors.outlinedDefaultBackground
13090
13090
  };
13091
13091
  }
13092
13092
  case 'filled':
13093
- {
13094
- return {
13095
- backgroundColor: theme.__hd__.chip.colors.secondaryBackground
13096
- };
13097
- }
13098
13093
  case 'compact':
13099
13094
  {
13100
13095
  return {
13101
- backgroundColor: theme.__hd__.chip.colors.compactSelectedBackground
13096
+ backgroundColor: theme.__hd__.chip.colors.secondaryBackground
13102
13097
  };
13103
13098
  }
13104
13099
  }
13105
13100
  } else {
13106
13101
  switch (themeVariant) {
13107
13102
  case 'outlined':
13103
+ case 'compact-outlined':
13108
13104
  {
13109
13105
  return {
13110
13106
  backgroundColor: theme.__hd__.chip.colors.outlinedDefaultBackground
13111
13107
  };
13112
13108
  }
13113
13109
  case 'filled':
13114
- {
13115
- return {
13116
- backgroundColor: theme.__hd__.chip.colors.filledBackground
13117
- };
13118
- }
13119
13110
  case 'compact':
13120
13111
  {
13121
13112
  return {
13122
- backgroundColor: theme.__hd__.chip.colors.compactDefaultBackground
13113
+ backgroundColor: theme.__hd__.chip.colors.filledBackground
13123
13114
  };
13124
13115
  }
13125
13116
  }
@@ -13128,6 +13119,7 @@ var StyledChipWrapper = index$a(TouchableOpacity)(function (_ref) {
13128
13119
  var getPaddingStyles = function getPaddingStyles() {
13129
13120
  switch (themeVariant) {
13130
13121
  case 'compact':
13122
+ case 'compact-outlined':
13131
13123
  {
13132
13124
  return {
13133
13125
  paddingHorizontal: theme.__hd__.chip.space.compactWrapperHorizontalPadding,
@@ -16290,15 +16282,12 @@ var PinInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
16290
16282
  // Slice the text, starting from the length position
16291
16283
  var slicedText = text.slice(length);
16292
16284
  onChangeText === null || onChangeText === void 0 || onChangeText(normalizeValue(slicedText, length));
16293
- if (slicedText.length === length) {
16294
- onFulfill === null || onFulfill === void 0 || onFulfill(slicedText);
16295
- }
16296
16285
  } else {
16297
16286
  // Prevent user from entering more than the length
16298
16287
  onChangeText === null || onChangeText === void 0 || onChangeText(trimmedPin);
16299
- if (trimmedPin.length === length) {
16300
- onFulfill === null || onFulfill === void 0 || onFulfill(trimmedPin);
16301
- }
16288
+ }
16289
+ if (trimmedPin.length === length) {
16290
+ onFulfill === null || onFulfill === void 0 || onFulfill(trimmedPin);
16302
16291
  }
16303
16292
  }, [length, onChangeText, onFulfill, trimmedValue.length]);
16304
16293
  useEffect(function () {
package/lib/index.js CHANGED
@@ -2673,9 +2673,7 @@ var getChipTheme = function getChipTheme(theme) {
2673
2673
  outlinedDefaultBackground: theme.colors.defaultGlobalSurface,
2674
2674
  outlinedSelectedBackground: theme.colors.secondaryOutline,
2675
2675
  outlinedSelectedBorder: theme.colors.primaryOutline,
2676
- outlinedDefaultBorder: theme.colors.disabledOnDefaultGlobalSurface,
2677
- compactDefaultBackground: theme.colors.defaultGlobalSurface,
2678
- compactSelectedBackground: theme.colors.neutralGlobalSurface
2676
+ outlinedDefaultBorder: theme.colors.disabledOnDefaultGlobalSurface
2679
2677
  };
2680
2678
  var space = {
2681
2679
  wrapperHorizontalPadding: theme.space.smallMedium,
@@ -9747,16 +9745,24 @@ var BottomSheet = function BottomSheet(_ref) {
9747
9745
  _useState4 = _slicedToArray(_useState3, 2),
9748
9746
  internalShowDivider = _useState4[0],
9749
9747
  setInternalShowDivider = _useState4[1];
9750
- var canCallOnDismiss = React.useRef(false);
9751
9748
  React.useEffect(function () {
9752
- // Prevent calling onDismiss when the component has not yet opened
9753
- if (open && !canCallOnDismiss.current) {
9754
- canCallOnDismiss.current = true;
9755
- }
9756
9749
  // Show the modal before the open animation start
9757
9750
  if (open && !visible) {
9758
9751
  setVisibility(open);
9759
9752
  }
9753
+ // Delay closing the modal until after the closing animation end
9754
+ animatedValue.current.removeAllListeners();
9755
+ animatedValue.current.addListener(function (_ref2) {
9756
+ var value = _ref2.value;
9757
+ var endValueOfTransition = open ? 1 : 0;
9758
+ if (endValueOfTransition === 0 && value === endValueOfTransition) {
9759
+ setVisibility(false);
9760
+ onDismiss === null || onDismiss === void 0 || onDismiss();
9761
+ }
9762
+ });
9763
+ return function () {
9764
+ return animatedValue.current.removeAllListeners();
9765
+ };
9760
9766
  }, [open]);
9761
9767
  // Animation
9762
9768
  React.useEffect(function () {
@@ -9765,16 +9771,7 @@ var BottomSheet = function BottomSheet(_ref) {
9765
9771
  easing: reactNative.Easing.inOut(reactNative.Easing.cubic),
9766
9772
  useNativeDriver: true
9767
9773
  });
9768
- animation.start(function (_ref2) {
9769
- var finished = _ref2.finished;
9770
- if (finished) {
9771
- if (!open && canCallOnDismiss.current) {
9772
- setVisibility(false);
9773
- onDismiss === null || onDismiss === void 0 || onDismiss();
9774
- }
9775
- onAnimationEnd === null || onAnimationEnd === void 0 || onAnimationEnd();
9776
- }
9777
- });
9774
+ animation.start(onAnimationEnd);
9778
9775
  return function () {
9779
9776
  return animation.stop();
9780
9777
  };
@@ -13086,12 +13083,14 @@ var StyledChipWrapper = index$a(reactNative.TouchableOpacity)(function (_ref) {
13086
13083
  case 'filled':
13087
13084
  return _objectSpread2({}, theme.__hd__.chip.shadows.filledWrapper);
13088
13085
  case 'outlined':
13086
+ case 'compact-outlined':
13089
13087
  return undefined;
13090
13088
  }
13091
13089
  };
13092
13090
  var getBorderStyles = function getBorderStyles() {
13093
13091
  switch (themeVariant) {
13094
13092
  case 'outlined':
13093
+ case 'compact-outlined':
13095
13094
  {
13096
13095
  return {
13097
13096
  borderColor: themeSelected ? theme.__hd__.chip.colors.outlinedSelectedBorder : theme.__hd__.chip.colors.outlinedDefaultBorder,
@@ -13111,42 +13110,34 @@ var StyledChipWrapper = index$a(reactNative.TouchableOpacity)(function (_ref) {
13111
13110
  if (themeSelected) {
13112
13111
  switch (themeVariant) {
13113
13112
  case 'outlined':
13113
+ case 'compact-outlined':
13114
13114
  {
13115
13115
  return {
13116
13116
  backgroundColor: themeSelected ? theme.__hd__.chip.colors.outlinedSelectedBackground : theme.__hd__.chip.colors.outlinedDefaultBackground
13117
13117
  };
13118
13118
  }
13119
13119
  case 'filled':
13120
- {
13121
- return {
13122
- backgroundColor: theme.__hd__.chip.colors.secondaryBackground
13123
- };
13124
- }
13125
13120
  case 'compact':
13126
13121
  {
13127
13122
  return {
13128
- backgroundColor: theme.__hd__.chip.colors.compactSelectedBackground
13123
+ backgroundColor: theme.__hd__.chip.colors.secondaryBackground
13129
13124
  };
13130
13125
  }
13131
13126
  }
13132
13127
  } else {
13133
13128
  switch (themeVariant) {
13134
13129
  case 'outlined':
13130
+ case 'compact-outlined':
13135
13131
  {
13136
13132
  return {
13137
13133
  backgroundColor: theme.__hd__.chip.colors.outlinedDefaultBackground
13138
13134
  };
13139
13135
  }
13140
13136
  case 'filled':
13141
- {
13142
- return {
13143
- backgroundColor: theme.__hd__.chip.colors.filledBackground
13144
- };
13145
- }
13146
13137
  case 'compact':
13147
13138
  {
13148
13139
  return {
13149
- backgroundColor: theme.__hd__.chip.colors.compactDefaultBackground
13140
+ backgroundColor: theme.__hd__.chip.colors.filledBackground
13150
13141
  };
13151
13142
  }
13152
13143
  }
@@ -13155,6 +13146,7 @@ var StyledChipWrapper = index$a(reactNative.TouchableOpacity)(function (_ref) {
13155
13146
  var getPaddingStyles = function getPaddingStyles() {
13156
13147
  switch (themeVariant) {
13157
13148
  case 'compact':
13149
+ case 'compact-outlined':
13158
13150
  {
13159
13151
  return {
13160
13152
  paddingHorizontal: theme.__hd__.chip.space.compactWrapperHorizontalPadding,
@@ -16317,15 +16309,12 @@ var PinInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
16317
16309
  // Slice the text, starting from the length position
16318
16310
  var slicedText = text.slice(length);
16319
16311
  onChangeText === null || onChangeText === void 0 || onChangeText(normalizeValue(slicedText, length));
16320
- if (slicedText.length === length) {
16321
- onFulfill === null || onFulfill === void 0 || onFulfill(slicedText);
16322
- }
16323
16312
  } else {
16324
16313
  // Prevent user from entering more than the length
16325
16314
  onChangeText === null || onChangeText === void 0 || onChangeText(trimmedPin);
16326
- if (trimmedPin.length === length) {
16327
- onFulfill === null || onFulfill === void 0 || onFulfill(trimmedPin);
16328
- }
16315
+ }
16316
+ if (trimmedPin.length === length) {
16317
+ onFulfill === null || onFulfill === void 0 || onFulfill(trimmedPin);
16329
16318
  }
16330
16319
  }, [length, onChangeText, onFulfill, trimmedValue.length]);
16331
16320
  React.useEffect(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.79.2-test.0",
3
+ "version": "8.80.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -93,5 +93,6 @@
93
93
  "ts-jest": "^29.1.1",
94
94
  "typescript": "4.8.4"
95
95
  },
96
- "prettier": "prettier-config-hd"
96
+ "prettier": "prettier-config-hd",
97
+ "react-native": "src/index.ts"
97
98
  }
@@ -115,18 +115,24 @@ const BottomSheet = ({
115
115
  const animatedValue = useRef(new Animated.Value(open ? 0 : 1));
116
116
  const [internalShowDivider, setInternalShowDivider] =
117
117
  useState<boolean>(showDivider);
118
- const canCallOnDismiss = useRef(false);
119
118
 
120
119
  useEffect(() => {
121
- // Prevent calling onDismiss when the component has not yet opened
122
- if (open && !canCallOnDismiss.current) {
123
- canCallOnDismiss.current = true;
124
- }
125
-
126
120
  // Show the modal before the open animation start
127
121
  if (open && !visible) {
128
122
  setVisibility(open);
129
123
  }
124
+
125
+ // Delay closing the modal until after the closing animation end
126
+ animatedValue.current.removeAllListeners();
127
+ animatedValue.current.addListener(({ value }) => {
128
+ const endValueOfTransition = open ? 1 : 0;
129
+ if (endValueOfTransition === 0 && value === endValueOfTransition) {
130
+ setVisibility(false);
131
+ onDismiss?.();
132
+ }
133
+ });
134
+
135
+ return () => animatedValue.current.removeAllListeners();
130
136
  }, [open]);
131
137
 
132
138
  // Animation
@@ -137,15 +143,7 @@ const BottomSheet = ({
137
143
  useNativeDriver: true,
138
144
  });
139
145
 
140
- animation.start(({ finished }) => {
141
- if (finished) {
142
- if (!open && canCallOnDismiss.current) {
143
- setVisibility(false);
144
- onDismiss?.();
145
- }
146
- onAnimationEnd?.();
147
- }
148
- });
146
+ animation.start(onAnimationEnd);
149
147
 
150
148
  return () => animation.stop();
151
149
  }, [open]);
@@ -2,7 +2,7 @@ import styled from '@emotion/native';
2
2
  import { TouchableOpacity } from 'react-native';
3
3
 
4
4
  type StyledChipWrapperProps = {
5
- themeVariant?: 'outlined' | 'filled' | 'compact';
5
+ themeVariant?: 'outlined' | 'filled' | 'compact' | 'compact-outlined';
6
6
  themeSelected?: boolean;
7
7
  };
8
8
 
@@ -16,13 +16,15 @@ const StyledChipWrapper = styled(TouchableOpacity)<StyledChipWrapperProps>(
16
16
  ...theme.__hd__.chip.shadows.filledWrapper,
17
17
  };
18
18
  case 'outlined':
19
+ case 'compact-outlined':
19
20
  return undefined;
20
21
  }
21
22
  };
22
23
 
23
24
  const getBorderStyles = () => {
24
25
  switch (themeVariant) {
25
- case 'outlined': {
26
+ case 'outlined':
27
+ case 'compact-outlined': {
26
28
  return {
27
29
  borderColor: themeSelected
28
30
  ? theme.__hd__.chip.colors.outlinedSelectedBorder
@@ -42,43 +44,34 @@ const StyledChipWrapper = styled(TouchableOpacity)<StyledChipWrapperProps>(
42
44
  const getBackgroundStyles = () => {
43
45
  if (themeSelected) {
44
46
  switch (themeVariant) {
45
- case 'outlined': {
47
+ case 'outlined':
48
+ case 'compact-outlined': {
46
49
  return {
47
50
  backgroundColor: themeSelected
48
51
  ? theme.__hd__.chip.colors.outlinedSelectedBackground
49
52
  : theme.__hd__.chip.colors.outlinedDefaultBackground,
50
53
  };
51
54
  }
52
- case 'filled': {
53
- return {
54
- backgroundColor: theme.__hd__.chip.colors.secondaryBackground,
55
- };
56
- }
57
-
55
+ case 'filled':
58
56
  case 'compact': {
59
57
  return {
60
- backgroundColor:
61
- theme.__hd__.chip.colors.compactSelectedBackground,
58
+ backgroundColor: theme.__hd__.chip.colors.secondaryBackground,
62
59
  };
63
60
  }
64
61
  }
65
62
  } else {
66
63
  switch (themeVariant) {
67
- case 'outlined': {
64
+ case 'outlined':
65
+ case 'compact-outlined': {
68
66
  return {
69
67
  backgroundColor:
70
68
  theme.__hd__.chip.colors.outlinedDefaultBackground,
71
69
  };
72
70
  }
73
- case 'filled': {
74
- return {
75
- backgroundColor: theme.__hd__.chip.colors.filledBackground,
76
- };
77
- }
71
+ case 'filled':
78
72
  case 'compact': {
79
73
  return {
80
- backgroundColor:
81
- theme.__hd__.chip.colors.compactDefaultBackground,
74
+ backgroundColor: theme.__hd__.chip.colors.filledBackground,
82
75
  };
83
76
  }
84
77
  }
@@ -87,7 +80,8 @@ const StyledChipWrapper = styled(TouchableOpacity)<StyledChipWrapperProps>(
87
80
 
88
81
  const getPaddingStyles = () => {
89
82
  switch (themeVariant) {
90
- case 'compact': {
83
+ case 'compact':
84
+ case 'compact-outlined': {
91
85
  return {
92
86
  paddingHorizontal:
93
87
  theme.__hd__.chip.space.compactWrapperHorizontalPadding,
@@ -942,7 +942,7 @@ exports[`Chip renders correctly with variant compact and selected true 1`] = `
942
942
  {
943
943
  "alignItems": "center",
944
944
  "alignSelf": "flex-start",
945
- "backgroundColor": "#f6f6f7",
945
+ "backgroundColor": "#ece8ef",
946
946
  "borderColor": "transparent",
947
947
  "borderRadius": 999,
948
948
  "elevation": 3,
@@ -1006,6 +1006,200 @@ exports[`Chip renders correctly with variant compact and selected true 1`] = `
1006
1006
  </View>
1007
1007
  `;
1008
1008
 
1009
+ exports[`Chip renders correctly with variant compact-outlined and selected false 1`] = `
1010
+ <View
1011
+ style={
1012
+ {
1013
+ "flex": 1,
1014
+ }
1015
+ }
1016
+ >
1017
+ <View
1018
+ accessibilityState={
1019
+ {
1020
+ "busy": undefined,
1021
+ "checked": undefined,
1022
+ "disabled": undefined,
1023
+ "expanded": undefined,
1024
+ "selected": undefined,
1025
+ }
1026
+ }
1027
+ accessibilityValue={
1028
+ {
1029
+ "max": undefined,
1030
+ "min": undefined,
1031
+ "now": undefined,
1032
+ "text": undefined,
1033
+ }
1034
+ }
1035
+ accessible={true}
1036
+ collapsable={false}
1037
+ focusable={false}
1038
+ onClick={[Function]}
1039
+ onResponderGrant={[Function]}
1040
+ onResponderMove={[Function]}
1041
+ onResponderRelease={[Function]}
1042
+ onResponderTerminate={[Function]}
1043
+ onResponderTerminationRequest={[Function]}
1044
+ onStartShouldSetResponder={[Function]}
1045
+ style={
1046
+ {
1047
+ "alignItems": "center",
1048
+ "alignSelf": "flex-start",
1049
+ "backgroundColor": "#ffffff",
1050
+ "borderColor": "#bfc1c5",
1051
+ "borderRadius": 999,
1052
+ "borderWidth": 1,
1053
+ "flexDirection": "row",
1054
+ "justifyContent": "center",
1055
+ "opacity": 1,
1056
+ "paddingHorizontal": 8,
1057
+ "paddingVertical": 4,
1058
+ }
1059
+ }
1060
+ testID="chip"
1061
+ >
1062
+ <Text
1063
+ allowFontScaling={false}
1064
+ style={
1065
+ [
1066
+ {
1067
+ "color": "#001f23",
1068
+ "fontFamily": "BeVietnamPro-Regular",
1069
+ "fontSize": 16,
1070
+ "letterSpacing": 0.48,
1071
+ "lineHeight": 24,
1072
+ },
1073
+ undefined,
1074
+ ]
1075
+ }
1076
+ themeIntent="body"
1077
+ themeTypeface="neutral"
1078
+ themeVariant="regular"
1079
+ >
1080
+ Cover my bills
1081
+ </Text>
1082
+ </View>
1083
+ <View
1084
+ pointerEvents="box-none"
1085
+ position="bottom"
1086
+ style={
1087
+ [
1088
+ {
1089
+ "bottom": 0,
1090
+ "elevation": 9999,
1091
+ "flexDirection": "column-reverse",
1092
+ "left": 0,
1093
+ "paddingHorizontal": 24,
1094
+ "paddingVertical": 16,
1095
+ "position": "absolute",
1096
+ "right": 0,
1097
+ "top": 0,
1098
+ },
1099
+ undefined,
1100
+ ]
1101
+ }
1102
+ />
1103
+ </View>
1104
+ `;
1105
+
1106
+ exports[`Chip renders correctly with variant compact-outlined and selected true 1`] = `
1107
+ <View
1108
+ style={
1109
+ {
1110
+ "flex": 1,
1111
+ }
1112
+ }
1113
+ >
1114
+ <View
1115
+ accessibilityState={
1116
+ {
1117
+ "busy": undefined,
1118
+ "checked": undefined,
1119
+ "disabled": undefined,
1120
+ "expanded": undefined,
1121
+ "selected": undefined,
1122
+ }
1123
+ }
1124
+ accessibilityValue={
1125
+ {
1126
+ "max": undefined,
1127
+ "min": undefined,
1128
+ "now": undefined,
1129
+ "text": undefined,
1130
+ }
1131
+ }
1132
+ accessible={true}
1133
+ collapsable={false}
1134
+ focusable={false}
1135
+ onClick={[Function]}
1136
+ onResponderGrant={[Function]}
1137
+ onResponderMove={[Function]}
1138
+ onResponderRelease={[Function]}
1139
+ onResponderTerminate={[Function]}
1140
+ onResponderTerminationRequest={[Function]}
1141
+ onStartShouldSetResponder={[Function]}
1142
+ style={
1143
+ {
1144
+ "alignItems": "center",
1145
+ "alignSelf": "flex-start",
1146
+ "backgroundColor": "#e8e9ea",
1147
+ "borderColor": "#001f23",
1148
+ "borderRadius": 999,
1149
+ "borderWidth": 1,
1150
+ "flexDirection": "row",
1151
+ "justifyContent": "center",
1152
+ "opacity": 1,
1153
+ "paddingHorizontal": 8,
1154
+ "paddingVertical": 4,
1155
+ }
1156
+ }
1157
+ testID="chip"
1158
+ >
1159
+ <Text
1160
+ allowFontScaling={false}
1161
+ style={
1162
+ [
1163
+ {
1164
+ "color": "#001f23",
1165
+ "fontFamily": "BeVietnamPro-Regular",
1166
+ "fontSize": 16,
1167
+ "letterSpacing": 0.48,
1168
+ "lineHeight": 24,
1169
+ },
1170
+ undefined,
1171
+ ]
1172
+ }
1173
+ themeIntent="body"
1174
+ themeTypeface="neutral"
1175
+ themeVariant="regular"
1176
+ >
1177
+ Cover my bills
1178
+ </Text>
1179
+ </View>
1180
+ <View
1181
+ pointerEvents="box-none"
1182
+ position="bottom"
1183
+ style={
1184
+ [
1185
+ {
1186
+ "bottom": 0,
1187
+ "elevation": 9999,
1188
+ "flexDirection": "column-reverse",
1189
+ "left": 0,
1190
+ "paddingHorizontal": 24,
1191
+ "paddingVertical": 16,
1192
+ "position": "absolute",
1193
+ "right": 0,
1194
+ "top": 0,
1195
+ },
1196
+ undefined,
1197
+ ]
1198
+ }
1199
+ />
1200
+ </View>
1201
+ `;
1202
+
1009
1203
  exports[`Chip renders correctly with variant filled and selected false 1`] = `
1010
1204
  <View
1011
1205
  style={
@@ -81,13 +81,15 @@ describe('Chip', () => {
81
81
  });
82
82
 
83
83
  it.each`
84
- variant | selected
85
- ${'filled'} | ${true}
86
- ${'filled'} | ${false}
87
- ${'outlined'} | ${true}
88
- ${'outlined'} | ${false}
89
- ${'compact'} | ${true}
90
- ${'compact'} | ${false}
84
+ variant | selected
85
+ ${'filled'} | ${true}
86
+ ${'filled'} | ${false}
87
+ ${'outlined'} | ${true}
88
+ ${'outlined'} | ${false}
89
+ ${'compact'} | ${true}
90
+ ${'compact'} | ${false}
91
+ ${'compact-outlined'} | ${true}
92
+ ${'compact-outlined'} | ${false}
91
93
  `(
92
94
  'renders correctly with variant $variant and selected $selected',
93
95
  ({ variant, selected }) => {