@hero-design/rn 8.23.0 → 8.24.0-alpha.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.
- package/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-build:types.log +2 -0
- package/.turbo/turbo-lint.log +146 -0
- package/.turbo/turbo-publish:npm.log +9 -0
- package/.turbo/turbo-test.log +451 -0
- package/.turbo/turbo-type-check.log +1 -0
- package/es/index.js +293 -101
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +293 -101
- package/package.json +1 -1
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +21 -9
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +7 -3
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +7 -3
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +7 -3
- package/src/components/RichTextEditor/RichTextEditor.tsx +10 -7
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +10 -8
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +37 -16
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +37 -16
- package/src/components/Tabs/ScrollableTabs.tsx +10 -149
- package/src/components/Tabs/ScrollableTabsHeader.tsx +214 -0
- package/src/components/Tabs/ScrollableTabsV2/SceneView.tsx +61 -0
- package/src/components/Tabs/ScrollableTabsV2/ScrollableTabsV2.tsx +120 -0
- package/src/components/Tabs/ScrollableTabsV2/__tests__/SceneView.spec.tsx +76 -0
- package/src/components/Tabs/ScrollableTabsV2/__tests__/ScrollableTabsV2.spec.tsx +166 -0
- package/src/components/Tabs/ScrollableTabsV2/__tests__/__snapshots__/SceneView.spec.tsx.snap +161 -0
- package/src/components/Tabs/ScrollableTabsV2/__tests__/__snapshots__/ScrollableTabsV2.spec.tsx.snap +2497 -0
- package/src/components/Tabs/ScrollableTabsV2/index.tsx +5 -0
- package/src/components/Tabs/__tests__/ScrollableTabsHeader.spec.tsx +80 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +587 -0
- package/src/components/Tabs/index.tsx +2 -0
- package/src/components/TextInput/StyledTextInput.tsx +40 -29
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +48 -57
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +84 -58
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +326 -74
- package/src/components/TextInput/__tests__/index.spec.tsx +16 -4
- package/src/components/TextInput/index.tsx +25 -15
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +14 -6
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +14 -6
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +8 -3
- package/src/theme/components/textInput.ts +10 -4
- package/testUtils/setup.tsx +6 -0
- package/types/components/Accordion/AccordionItem.d.ts +0 -0
- package/types/components/Accordion/StyledAccordion.d.ts +0 -0
- package/types/components/Accordion/index.d.ts +0 -0
- package/types/components/Alert/StyledAlert.d.ts +0 -0
- package/types/components/Alert/index.d.ts +0 -0
- package/types/components/Attachment/StyledAttachment.d.ts +0 -0
- package/types/components/Attachment/index.d.ts +0 -0
- package/types/components/Avatar/Avatar.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
- package/types/components/Avatar/StyledAvatar.d.ts +0 -0
- package/types/components/Avatar/index.d.ts +0 -0
- package/types/components/Badge/Status.d.ts +0 -0
- package/types/components/Badge/StyledBadge.d.ts +0 -0
- package/types/components/Badge/index.d.ts +0 -0
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/types/components/BottomNavigation/index.d.ts +0 -0
- package/types/components/BottomSheet/BottomSheetContext.d.ts +0 -0
- package/types/components/BottomSheet/Footer.d.ts +0 -0
- package/types/components/BottomSheet/Header.d.ts +0 -0
- package/types/components/BottomSheet/ScrollView.d.ts +0 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
- package/types/components/BottomSheet/index.d.ts +0 -0
- package/types/components/Box/StyledBox.d.ts +0 -0
- package/types/components/Box/config.d.ts +0 -0
- package/types/components/Box/index.d.ts +0 -0
- package/types/components/Box/types.d.ts +0 -0
- package/types/components/Button/Button.d.ts +0 -0
- package/types/components/Button/IconButton.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/components/Button/StyledButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/index.d.ts +0 -0
- package/types/components/Button/index.d.ts +0 -0
- package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
- package/types/components/Calendar/StyledCalendar.d.ts +0 -0
- package/types/components/Calendar/helpers.d.ts +0 -0
- package/types/components/Calendar/index.d.ts +0 -0
- package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
- package/types/components/Card/DataCard/index.d.ts +0 -0
- package/types/components/Card/StyledCard.d.ts +0 -0
- package/types/components/Card/index.d.ts +0 -0
- package/types/components/Carousel/CardCarousel.d.ts +0 -0
- package/types/components/Carousel/CarouselItem.d.ts +0 -0
- package/types/components/Carousel/StyledCardCarousel.d.ts +0 -0
- package/types/components/Carousel/StyledCarousel.d.ts +0 -0
- package/types/components/Carousel/contants.d.ts +0 -0
- package/types/components/Carousel/index.d.ts +0 -0
- package/types/components/Carousel/types.d.ts +0 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
- package/types/components/Checkbox/index.d.ts +0 -0
- package/types/components/Collapse/StyledCollapse.d.ts +0 -0
- package/types/components/Collapse/index.d.ts +0 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
- package/types/components/ContentNavigator/index.d.ts +0 -0
- package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -0
- package/types/components/DatePicker/DatePickerCalendar.d.ts +0 -0
- package/types/components/DatePicker/DatePickerIOS.d.ts +0 -0
- package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
- package/types/components/DatePicker/index.d.ts +0 -0
- package/types/components/DatePicker/types.d.ts +0 -0
- package/types/components/Divider/StyledDivider.d.ts +0 -0
- package/types/components/Divider/index.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
- package/types/components/Drawer/StyledDrawer.d.ts +0 -0
- package/types/components/Drawer/index.d.ts +0 -0
- package/types/components/Empty/StyledEmpty.d.ts +0 -0
- package/types/components/Empty/index.d.ts +0 -0
- package/types/components/Error/StyledError.d.ts +0 -0
- package/types/components/Error/index.d.ts +0 -0
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/index.d.ts +0 -0
- package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/components/FAB/FAB.d.ts +0 -0
- package/types/components/FAB/StyledFAB.d.ts +0 -0
- package/types/components/FAB/index.d.ts +0 -0
- package/types/components/Icon/AnimatedIcon.d.ts +0 -0
- package/types/components/Icon/HeroIcon/index.d.ts +0 -0
- package/types/components/Icon/IconList.d.ts +0 -0
- package/types/components/Icon/index.d.ts +0 -0
- package/types/components/Icon/utils.d.ts +0 -0
- package/types/components/Image/index.d.ts +0 -0
- package/types/components/List/BasicListItem.d.ts +0 -0
- package/types/components/List/ListItem.d.ts +0 -0
- package/types/components/List/StyledBasicListItem.d.ts +0 -0
- package/types/components/List/StyledListItem.d.ts +0 -0
- package/types/components/List/index.d.ts +0 -0
- package/types/components/PageControl/StyledPageControl.d.ts +0 -0
- package/types/components/PageControl/index.d.ts +0 -0
- package/types/components/PinInput/PinCell.d.ts +0 -0
- package/types/components/PinInput/StyledPinInput.d.ts +0 -0
- package/types/components/PinInput/index.d.ts +0 -0
- package/types/components/Progress/ProgressBar.d.ts +0 -0
- package/types/components/Progress/ProgressCircle.d.ts +0 -0
- package/types/components/Progress/StyledProgressBar.d.ts +0 -0
- package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
- package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
- package/types/components/Progress/constants.d.ts +0 -0
- package/types/components/Progress/index.d.ts +0 -0
- package/types/components/Progress/types.d.ts +0 -0
- package/types/components/Radio/Radio.d.ts +0 -0
- package/types/components/Radio/RadioGroup.d.ts +0 -0
- package/types/components/Radio/StyledRadio.d.ts +0 -0
- package/types/components/Radio/index.d.ts +0 -0
- package/types/components/Radio/types.d.ts +0 -0
- package/types/components/RefreshControl/index.d.ts +0 -0
- package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
- package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
- package/types/components/RichTextEditor/MentionList.d.ts +0 -0
- package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
- package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
- package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
- package/types/components/RichTextEditor/constants.d.ts +0 -0
- package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
- package/types/components/RichTextEditor/index.d.ts +0 -0
- package/types/components/RichTextEditor/types.d.ts +0 -0
- package/types/components/RichTextEditor/utils/events.d.ts +0 -0
- package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/index.d.ts +0 -0
- package/types/components/Select/BaseOptionList.d.ts +0 -0
- package/types/components/Select/Footer.d.ts +0 -0
- package/types/components/Select/MultiSelect/Option.d.ts +0 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
- package/types/components/Select/MultiSelect/index.d.ts +0 -0
- package/types/components/Select/SingleSelect/Option.d.ts +0 -0
- package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -0
- package/types/components/Select/SingleSelect/index.d.ts +0 -0
- package/types/components/Select/StyledSelect.d.ts +0 -0
- package/types/components/Select/helpers.d.ts +0 -0
- package/types/components/Select/index.d.ts +0 -0
- package/types/components/Select/types.d.ts +0 -0
- package/types/components/Skeleton/StyledSkeleton.d.ts +0 -0
- package/types/components/Skeleton/index.d.ts +0 -0
- package/types/components/Slider/index.d.ts +0 -0
- package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
- package/types/components/Spinner/StyledSpinner.d.ts +0 -0
- package/types/components/Spinner/index.d.ts +0 -0
- package/types/components/Success/StyledSuccess.d.ts +0 -0
- package/types/components/Success/index.d.ts +0 -0
- package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
- package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
- package/types/components/Swipeable/index.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
- package/types/components/Switch/StyledSwitch.d.ts +0 -0
- package/types/components/Switch/index.d.ts +0 -0
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/SceneView.d.ts +9 -0
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabsHeader.d.ts +35 -0
- package/types/components/Tabs/ScrollableTabsV2/SceneView.d.ts +10 -0
- package/types/components/Tabs/ScrollableTabsV2/ScrollableTabsV2.d.ts +9 -0
- package/types/components/Tabs/ScrollableTabsV2/index.d.ts +4 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledTabs.d.ts +0 -0
- package/types/components/Tabs/TabWithBadge.d.ts +0 -0
- package/types/components/Tabs/index.d.ts +3 -0
- package/types/components/Tabs/utils.d.ts +0 -0
- package/types/components/Tag/StyledTag.d.ts +0 -0
- package/types/components/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +12 -7
- package/types/components/TextInput/index.d.ts +8 -4
- package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
- package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
- package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
- package/types/components/TimePicker/index.d.ts +0 -0
- package/types/components/TimePicker/types.d.ts +0 -0
- package/types/components/Toast/StyledToast.d.ts +0 -0
- package/types/components/Toast/Toast.d.ts +0 -0
- package/types/components/Toast/ToastContainer.d.ts +0 -0
- package/types/components/Toast/ToastContext.d.ts +0 -0
- package/types/components/Toast/ToastProvider.d.ts +0 -0
- package/types/components/Toast/index.d.ts +0 -0
- package/types/components/Toast/types.d.ts +0 -0
- package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
- package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
- package/types/components/Toolbar/index.d.ts +0 -0
- package/types/components/Typography/Text/StyledText.d.ts +0 -0
- package/types/components/Typography/Text/index.d.ts +0 -0
- package/types/components/Typography/index.d.ts +0 -0
- package/types/index.d.ts +0 -0
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/ThemeProvider.d.ts +0 -0
- package/types/theme/ThemeSwitcher.d.ts +0 -0
- package/types/theme/components/accordion.d.ts +0 -0
- package/types/theme/components/alert.d.ts +0 -0
- package/types/theme/components/attachment.d.ts +0 -0
- package/types/theme/components/avatar.d.ts +0 -0
- package/types/theme/components/badge.d.ts +0 -0
- package/types/theme/components/bottomNavigation.d.ts +0 -0
- package/types/theme/components/bottomSheet.d.ts +0 -0
- package/types/theme/components/button.d.ts +0 -0
- package/types/theme/components/calendar.d.ts +0 -0
- package/types/theme/components/card.d.ts +0 -0
- package/types/theme/components/cardCarousel.d.ts +0 -0
- package/types/theme/components/carousel.d.ts +0 -0
- package/types/theme/components/checkbox.d.ts +0 -0
- package/types/theme/components/contentNavigator.d.ts +0 -0
- package/types/theme/components/datePicker.d.ts +0 -0
- package/types/theme/components/divider.d.ts +0 -0
- package/types/theme/components/drawer.d.ts +0 -0
- package/types/theme/components/empty.d.ts +0 -0
- package/types/theme/components/error.d.ts +0 -0
- package/types/theme/components/fab.d.ts +0 -0
- package/types/theme/components/icon.d.ts +0 -0
- package/types/theme/components/image.d.ts +0 -0
- package/types/theme/components/list.d.ts +0 -0
- package/types/theme/components/pageControl.d.ts +0 -0
- package/types/theme/components/pinInput.d.ts +0 -0
- package/types/theme/components/progress.d.ts +0 -0
- package/types/theme/components/radio.d.ts +0 -0
- package/types/theme/components/refreshControl.d.ts +0 -0
- package/types/theme/components/richTextEditor.d.ts +0 -0
- package/types/theme/components/sectionHeading.d.ts +0 -0
- package/types/theme/components/select.d.ts +0 -0
- package/types/theme/components/skeleton.d.ts +0 -0
- package/types/theme/components/slider.d.ts +0 -0
- package/types/theme/components/spinner.d.ts +0 -0
- package/types/theme/components/success.d.ts +0 -0
- package/types/theme/components/swipeable.d.ts +0 -0
- package/types/theme/components/switch.d.ts +0 -0
- package/types/theme/components/tabs.d.ts +0 -0
- package/types/theme/components/tag.d.ts +0 -0
- package/types/theme/components/textInput.d.ts +5 -0
- package/types/theme/components/timePicker.d.ts +0 -0
- package/types/theme/components/toast.d.ts +0 -0
- package/types/theme/components/toolbar.d.ts +0 -0
- package/types/theme/components/typography.d.ts +0 -0
- package/types/theme/getTheme.d.ts +0 -0
- package/types/theme/global/borders.d.ts +0 -0
- package/types/theme/global/colors/eBens.d.ts +0 -0
- package/types/theme/global/colors/global.d.ts +0 -0
- package/types/theme/global/colors/globalDark.d.ts +0 -0
- package/types/theme/global/colors/jobs.d.ts +0 -0
- package/types/theme/global/colors/swag.d.ts +0 -0
- package/types/theme/global/colors/swagDark.d.ts +0 -0
- package/types/theme/global/colors/types.d.ts +0 -0
- package/types/theme/global/colors/wallet.d.ts +0 -0
- package/types/theme/global/colors/work.d.ts +0 -0
- package/types/theme/global/index.d.ts +0 -0
- package/types/theme/global/scale.d.ts +0 -0
- package/types/theme/global/sizes.d.ts +0 -0
- package/types/theme/global/space.d.ts +0 -0
- package/types/theme/global/typography.d.ts +0 -0
- package/types/theme/index.d.ts +0 -0
- package/types/types.d.ts +0 -0
- package/types/utils/functions.d.ts +0 -0
- package/types/utils/helpers.d.ts +0 -0
- package/types/utils/hooks.d.ts +0 -0
- package/types/utils/scale.d.ts +0 -0
package/es/index.js
CHANGED
|
@@ -2918,12 +2918,15 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2918
2918
|
containerMarginTop: theme.space.small,
|
|
2919
2919
|
labelInsideTextInputMarginTop: -theme.space.xxsmall
|
|
2920
2920
|
};
|
|
2921
|
+
var fonts = {
|
|
2922
|
+
text: theme.fonts.neutral.regular
|
|
2923
|
+
};
|
|
2921
2924
|
var fontSizes = {
|
|
2922
|
-
text: theme.fontSizes.
|
|
2923
|
-
labelInsideTextInput: theme.fontSizes.
|
|
2925
|
+
text: theme.fontSizes.large,
|
|
2926
|
+
labelInsideTextInput: theme.fontSizes.large,
|
|
2924
2927
|
error: theme.fontSizes.small,
|
|
2925
2928
|
maxLength: theme.fontSizes.small,
|
|
2926
|
-
asteriskLabel: theme.fontSizes.
|
|
2929
|
+
asteriskLabel: theme.fontSizes.large
|
|
2927
2930
|
};
|
|
2928
2931
|
var borderWidths = {
|
|
2929
2932
|
container: {
|
|
@@ -2935,11 +2938,14 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
2935
2938
|
container: theme.radii.medium
|
|
2936
2939
|
};
|
|
2937
2940
|
var sizes = {
|
|
2938
|
-
errorAndHelpTextContainerHeight: theme.sizes.medium
|
|
2941
|
+
errorAndHelpTextContainerHeight: theme.sizes.medium,
|
|
2942
|
+
textareaHeight: theme.sizes['15xlarge'],
|
|
2943
|
+
textInputMaxHeight: theme.sizes['15xlarge']
|
|
2939
2944
|
};
|
|
2940
2945
|
return {
|
|
2941
2946
|
colors: colors,
|
|
2942
2947
|
space: space,
|
|
2948
|
+
fonts: fonts,
|
|
2943
2949
|
fontSizes: fontSizes,
|
|
2944
2950
|
borderWidths: borderWidths,
|
|
2945
2951
|
radii: radii,
|
|
@@ -11615,47 +11621,48 @@ var StyledLabelContainer = index$a(View)(function (_ref2) {
|
|
|
11615
11621
|
});
|
|
11616
11622
|
var StyledLabel = index$a(Typography.Text)(function (_ref3) {
|
|
11617
11623
|
var theme = _ref3.theme,
|
|
11618
|
-
|
|
11624
|
+
themeState = _ref3.themeState;
|
|
11619
11625
|
return {
|
|
11620
|
-
color: theme.__hd__.textInput.colors.labels[
|
|
11626
|
+
color: theme.__hd__.textInput.colors.labels[themeState]
|
|
11621
11627
|
};
|
|
11622
11628
|
});
|
|
11623
11629
|
var StyledAsteriskLabel = index$a(Typography.Text)(function (_ref4) {
|
|
11624
11630
|
var theme = _ref4.theme,
|
|
11625
|
-
|
|
11631
|
+
themeState = _ref4.themeState;
|
|
11626
11632
|
return {
|
|
11627
|
-
color: theme.__hd__.textInput.colors.asterisks[
|
|
11633
|
+
color: theme.__hd__.textInput.colors.asterisks[themeState]
|
|
11628
11634
|
};
|
|
11629
11635
|
});
|
|
11630
|
-
var StyledLabelContainerInsideTextInput = index$a(View)(function () {
|
|
11636
|
+
var StyledLabelContainerInsideTextInput = index$a(View)(function (_ref5) {
|
|
11637
|
+
var themeVariant = _ref5.themeVariant;
|
|
11631
11638
|
return _objectSpread2({
|
|
11632
11639
|
flexDirection: 'row',
|
|
11633
11640
|
zIndex: 9999,
|
|
11634
|
-
alignItems: 'center'
|
|
11641
|
+
alignItems: themeVariant === 'text' ? 'center' : 'flex-start'
|
|
11635
11642
|
}, StyleSheet$1.absoluteFillObject);
|
|
11636
11643
|
});
|
|
11637
|
-
var StyledLabelInsideTextInput = index$a(Typography.Text)(function (
|
|
11638
|
-
var theme =
|
|
11639
|
-
|
|
11644
|
+
var StyledLabelInsideTextInput = index$a(Typography.Text)(function (_ref6) {
|
|
11645
|
+
var theme = _ref6.theme,
|
|
11646
|
+
themeState = _ref6.themeState;
|
|
11640
11647
|
return {
|
|
11641
11648
|
textAlignVertical: 'center',
|
|
11642
11649
|
alignContent: 'center',
|
|
11643
11650
|
fontSize: theme.__hd__.textInput.fontSizes.labelInsideTextInput,
|
|
11644
11651
|
alignItems: 'center',
|
|
11645
|
-
color: theme.__hd__.textInput.colors.labelsInsideTextInput[
|
|
11652
|
+
color: theme.__hd__.textInput.colors.labelsInsideTextInput[themeState],
|
|
11646
11653
|
marginTop: theme.__hd__.textInput.space.labelInsideTextInputMarginTop
|
|
11647
11654
|
};
|
|
11648
11655
|
});
|
|
11649
|
-
var StyledAsteriskLabelInsideTextInput = index$a(Typography.Text)(function (
|
|
11650
|
-
var theme =
|
|
11651
|
-
|
|
11656
|
+
var StyledAsteriskLabelInsideTextInput = index$a(Typography.Text)(function (_ref7) {
|
|
11657
|
+
var theme = _ref7.theme,
|
|
11658
|
+
themeState = _ref7.themeState;
|
|
11652
11659
|
return {
|
|
11653
|
-
color: theme.__hd__.textInput.colors.asterisks[
|
|
11660
|
+
color: theme.__hd__.textInput.colors.asterisks[themeState],
|
|
11654
11661
|
fontSize: theme.__hd__.textInput.fontSizes.asteriskLabel
|
|
11655
11662
|
};
|
|
11656
11663
|
});
|
|
11657
|
-
var StyledErrorContainer$2 = index$a(View)(function (
|
|
11658
|
-
var theme =
|
|
11664
|
+
var StyledErrorContainer$2 = index$a(View)(function (_ref8) {
|
|
11665
|
+
var theme = _ref8.theme;
|
|
11659
11666
|
return {
|
|
11660
11667
|
marginRight: theme.__hd__.textInput.space.errorContainerMarginRight,
|
|
11661
11668
|
flexDirection: 'row',
|
|
@@ -11664,19 +11671,19 @@ var StyledErrorContainer$2 = index$a(View)(function (_ref7) {
|
|
|
11664
11671
|
flexGrow: 4
|
|
11665
11672
|
};
|
|
11666
11673
|
});
|
|
11667
|
-
var StyledError = index$a(Typography.Text)(function (
|
|
11668
|
-
var theme =
|
|
11674
|
+
var StyledError = index$a(Typography.Text)(function (_ref9) {
|
|
11675
|
+
var theme = _ref9.theme;
|
|
11669
11676
|
return {
|
|
11670
11677
|
color: theme.__hd__.textInput.colors.error,
|
|
11671
11678
|
fontSize: theme.__hd__.textInput.fontSizes.error,
|
|
11672
11679
|
marginLeft: theme.__hd__.textInput.space.errorMarginLeft
|
|
11673
11680
|
};
|
|
11674
11681
|
});
|
|
11675
|
-
var StyledMaxLengthMessage = index$a(Typography.Text)(function (
|
|
11676
|
-
var theme =
|
|
11677
|
-
|
|
11682
|
+
var StyledMaxLengthMessage = index$a(Typography.Text)(function (_ref10) {
|
|
11683
|
+
var theme = _ref10.theme,
|
|
11684
|
+
themeState = _ref10.themeState;
|
|
11678
11685
|
return {
|
|
11679
|
-
color: theme.__hd__.textInput.colors.maxLengthLabels[
|
|
11686
|
+
color: theme.__hd__.textInput.colors.maxLengthLabels[themeState],
|
|
11680
11687
|
fontSize: theme.__hd__.textInput.fontSizes.maxLength,
|
|
11681
11688
|
marginRight: theme.__hd__.textInput.space.maxLengthLabelMarginLeft,
|
|
11682
11689
|
alignSelf: 'flex-end',
|
|
@@ -11685,36 +11692,40 @@ var StyledMaxLengthMessage = index$a(Typography.Text)(function (_ref9) {
|
|
|
11685
11692
|
textAlign: 'right'
|
|
11686
11693
|
};
|
|
11687
11694
|
});
|
|
11688
|
-
var StyledHelperText = index$a(Typography.Text)(function (
|
|
11689
|
-
var theme =
|
|
11695
|
+
var StyledHelperText = index$a(Typography.Text)(function (_ref11) {
|
|
11696
|
+
var theme = _ref11.theme;
|
|
11690
11697
|
return {
|
|
11691
11698
|
fontSize: theme.__hd__.textInput.fontSizes.error
|
|
11692
11699
|
};
|
|
11693
11700
|
});
|
|
11694
|
-
var StyledTextInput = index$a(TextInput$1)(function (
|
|
11695
|
-
var theme =
|
|
11701
|
+
var StyledTextInput = index$a(TextInput$1)(function (_ref12) {
|
|
11702
|
+
var theme = _ref12.theme,
|
|
11703
|
+
themeVariant = _ref12.themeVariant;
|
|
11696
11704
|
return {
|
|
11697
|
-
textAlignVertical: 'center',
|
|
11705
|
+
textAlignVertical: themeVariant === 'text' ? 'center' : 'top',
|
|
11698
11706
|
fontSize: theme.__hd__.textInput.fontSizes.text,
|
|
11699
11707
|
alignSelf: 'stretch',
|
|
11700
11708
|
flexGrow: 2,
|
|
11701
11709
|
marginHorizontal: theme.__hd__.textInput.space.inputHorizontalMargin,
|
|
11702
|
-
paddingVertical: 0
|
|
11710
|
+
paddingVertical: 0,
|
|
11711
|
+
maxHeight: theme.__hd__.textInput.sizes.textInputMaxHeight,
|
|
11712
|
+
height: themeVariant === 'text' ? undefined : theme.__hd__.textInput.sizes.textareaHeight,
|
|
11713
|
+
fontFamily: theme.__hd__.textInput.fonts.text
|
|
11703
11714
|
};
|
|
11704
11715
|
});
|
|
11705
|
-
var StyledBorderBackDrop = index$a(View)(function (
|
|
11716
|
+
var StyledBorderBackDrop = index$a(View)(function (_ref13) {
|
|
11706
11717
|
var _theme$__hd__$textInp;
|
|
11707
|
-
var theme =
|
|
11708
|
-
themeFocused =
|
|
11709
|
-
|
|
11718
|
+
var theme = _ref13.theme,
|
|
11719
|
+
themeFocused = _ref13.themeFocused,
|
|
11720
|
+
themeState = _ref13.themeState;
|
|
11710
11721
|
return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
11711
11722
|
borderWidth: themeFocused ? theme.__hd__.textInput.borderWidths.container.focused : theme.__hd__.textInput.borderWidths.container.normal,
|
|
11712
11723
|
borderRadius: theme.__hd__.textInput.radii.container,
|
|
11713
|
-
borderColor: (_theme$__hd__$textInp = theme.__hd__.textInput.colors.borders[
|
|
11724
|
+
borderColor: (_theme$__hd__$textInp = theme.__hd__.textInput.colors.borders[themeState]) !== null && _theme$__hd__$textInp !== void 0 ? _theme$__hd__$textInp : theme.__hd__.textInput.colors.borders["default"]
|
|
11714
11725
|
});
|
|
11715
11726
|
});
|
|
11716
|
-
var StyledTextInputContainer = index$a(View)(function (
|
|
11717
|
-
var theme =
|
|
11727
|
+
var StyledTextInputContainer = index$a(View)(function (_ref14) {
|
|
11728
|
+
var theme = _ref14.theme;
|
|
11718
11729
|
return {
|
|
11719
11730
|
flexDirection: 'row',
|
|
11720
11731
|
alignItems: 'center',
|
|
@@ -11732,8 +11743,8 @@ var StyledTextInputAndLabelContainer = index$a(View)(function () {
|
|
|
11732
11743
|
flexShrink: 1
|
|
11733
11744
|
};
|
|
11734
11745
|
});
|
|
11735
|
-
var StyledErrorAndHelpTextContainer = index$a(View)(function (
|
|
11736
|
-
var theme =
|
|
11746
|
+
var StyledErrorAndHelpTextContainer = index$a(View)(function (_ref15) {
|
|
11747
|
+
var theme = _ref15.theme;
|
|
11737
11748
|
return {
|
|
11738
11749
|
paddingLeft: theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingLeft,
|
|
11739
11750
|
minHeight: theme.__hd__.textInput.sizes.errorAndHelpTextContainerHeight
|
|
@@ -11746,8 +11757,8 @@ var StyledErrorAndMaxLengthContainer = index$a(View)(function () {
|
|
|
11746
11757
|
};
|
|
11747
11758
|
});
|
|
11748
11759
|
|
|
11749
|
-
var _excluded$e = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling"];
|
|
11750
|
-
var
|
|
11760
|
+
var _excluded$e = ["label", "prefix", "suffix", "style", "textStyle", "testID", "accessibilityLabelledBy", "error", "required", "editable", "disabled", "loading", "maxLength", "hideCharacterCount", "helpText", "value", "defaultValue", "renderInputValue", "allowFontScaling", "variant"];
|
|
11761
|
+
var getState$1 = function getState(_ref) {
|
|
11751
11762
|
var disabled = _ref.disabled,
|
|
11752
11763
|
error = _ref.error,
|
|
11753
11764
|
editable = _ref.editable,
|
|
@@ -11796,6 +11807,8 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11796
11807
|
renderInputValue = _ref2.renderInputValue,
|
|
11797
11808
|
_ref2$allowFontScalin = _ref2.allowFontScaling,
|
|
11798
11809
|
allowFontScaling = _ref2$allowFontScalin === void 0 ? false : _ref2$allowFontScalin,
|
|
11810
|
+
_ref2$variant = _ref2.variant,
|
|
11811
|
+
variant = _ref2$variant === void 0 ? 'text' : _ref2$variant,
|
|
11799
11812
|
nativeProps = _objectWithoutProperties(_ref2, _excluded$e);
|
|
11800
11813
|
var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
11801
11814
|
var isEmptyValue = displayText.length === 0;
|
|
@@ -11804,7 +11817,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11804
11817
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
11805
11818
|
isFocused = _React$useState2[0],
|
|
11806
11819
|
setIsFocused = _React$useState2[1];
|
|
11807
|
-
var
|
|
11820
|
+
var state = getState$1({
|
|
11808
11821
|
disabled: disabled,
|
|
11809
11822
|
error: error,
|
|
11810
11823
|
editable: editable,
|
|
@@ -11880,7 +11893,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11880
11893
|
}, textStyleWithoutBorderStyle]),
|
|
11881
11894
|
testID: 'text-input',
|
|
11882
11895
|
accessibilityState: {
|
|
11883
|
-
disabled:
|
|
11896
|
+
disabled: state === 'disabled' || state === 'readonly'
|
|
11884
11897
|
},
|
|
11885
11898
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
11886
11899
|
// @ts-ignore
|
|
@@ -11909,11 +11922,11 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11909
11922
|
});
|
|
11910
11923
|
return /*#__PURE__*/React.createElement(StyledContainer$4, {
|
|
11911
11924
|
style: styleWithoutBackgroundColor,
|
|
11912
|
-
pointerEvents:
|
|
11925
|
+
pointerEvents: state === 'disabled' || state === 'readonly' ? 'none' : 'auto',
|
|
11913
11926
|
testID: testID
|
|
11914
11927
|
}, /*#__PURE__*/React.createElement(StyledTextInputContainer, null, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {
|
|
11915
11928
|
themeFocused: isFocused,
|
|
11916
|
-
|
|
11929
|
+
themeState: state,
|
|
11917
11930
|
testID: "text-input-border",
|
|
11918
11931
|
style: [{
|
|
11919
11932
|
backgroundColor: backgroundColor
|
|
@@ -11925,36 +11938,39 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11925
11938
|
backgroundColor: backgroundColor
|
|
11926
11939
|
}
|
|
11927
11940
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabel, {
|
|
11928
|
-
|
|
11941
|
+
themeState: state,
|
|
11929
11942
|
fontSize: "small"
|
|
11930
11943
|
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabel, {
|
|
11931
11944
|
nativeID: accessibilityLabelledBy,
|
|
11932
11945
|
testID: "input-label",
|
|
11933
11946
|
fontSize: "small",
|
|
11934
|
-
|
|
11947
|
+
themeState: state,
|
|
11935
11948
|
style: {
|
|
11936
11949
|
backgroundColor: backgroundColor
|
|
11937
11950
|
}
|
|
11938
11951
|
}, label)), typeof prefix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
11939
|
-
intent:
|
|
11952
|
+
intent: state === 'disabled' ? 'disabled-text' : 'text',
|
|
11940
11953
|
testID: "input-prefix",
|
|
11941
11954
|
icon: prefix,
|
|
11942
11955
|
size: "xsmall"
|
|
11943
11956
|
}) : prefix, /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, !isFocused && isEmptyValue && /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
|
|
11957
|
+
themeVariant: variant,
|
|
11944
11958
|
pointerEvents: "none"
|
|
11945
11959
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabelInsideTextInput, {
|
|
11946
|
-
|
|
11960
|
+
themeState: state
|
|
11947
11961
|
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabelInsideTextInput, {
|
|
11948
11962
|
nativeID: accessibilityLabelledBy,
|
|
11949
11963
|
testID: "input-label",
|
|
11950
11964
|
fontSize: "medium",
|
|
11951
|
-
|
|
11965
|
+
themeState: state
|
|
11952
11966
|
}, label)), renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
|
|
11967
|
+
themeVariant: variant,
|
|
11968
|
+
multiline: variant === 'textarea' || nativeProps.multiline,
|
|
11953
11969
|
ref: function ref(reference) {
|
|
11954
11970
|
innerTextInput.current = reference;
|
|
11955
11971
|
}
|
|
11956
11972
|
}))), typeof actualSuffix === 'string' ? /*#__PURE__*/React.createElement(Icon, {
|
|
11957
|
-
intent:
|
|
11973
|
+
intent: state === 'disabled' ? 'disabled-text' : 'text',
|
|
11958
11974
|
testID: "input-suffix",
|
|
11959
11975
|
icon: actualSuffix,
|
|
11960
11976
|
spin: actualSuffix === 'loading',
|
|
@@ -11967,7 +11983,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
11967
11983
|
}), /*#__PURE__*/React.createElement(StyledError, {
|
|
11968
11984
|
testID: "input-error-message"
|
|
11969
11985
|
}, error)) : !!helpText && /*#__PURE__*/React.createElement(StyledHelperText, null, helpText), shouldShowMaxLength && /*#__PURE__*/React.createElement(StyledMaxLengthMessage, {
|
|
11970
|
-
|
|
11986
|
+
themeState: state,
|
|
11971
11987
|
fontSize: "small"
|
|
11972
11988
|
}, displayText.length, "/", maxLength))));
|
|
11973
11989
|
});
|
|
@@ -15319,48 +15335,35 @@ var getTabItem$1 = function getTabItem(_ref) {
|
|
|
15319
15335
|
color: color
|
|
15320
15336
|
});
|
|
15321
15337
|
};
|
|
15322
|
-
var
|
|
15338
|
+
var ScrollableTabHeader = function ScrollableTabHeader(_ref2) {
|
|
15323
15339
|
var onTabPress = _ref2.onTabPress,
|
|
15324
|
-
|
|
15340
|
+
selectedIndex = _ref2.selectedIndex,
|
|
15325
15341
|
tabs = _ref2.tabs,
|
|
15326
|
-
containerStyle = _ref2.containerStyle,
|
|
15327
15342
|
barStyle = _ref2.barStyle,
|
|
15328
|
-
|
|
15329
|
-
|
|
15330
|
-
_ref2$
|
|
15331
|
-
|
|
15332
|
-
|
|
15333
|
-
|
|
15334
|
-
|
|
15343
|
+
testID = _ref2.testID,
|
|
15344
|
+
_ref2$insets = _ref2.insets,
|
|
15345
|
+
insets = _ref2$insets === void 0 ? {
|
|
15346
|
+
top: 0,
|
|
15347
|
+
bottom: 0,
|
|
15348
|
+
right: 0,
|
|
15349
|
+
left: 0
|
|
15350
|
+
} : _ref2$insets;
|
|
15335
15351
|
var flatListRef = React.useRef(null);
|
|
15336
|
-
var pagerViewRef = React.useRef(null);
|
|
15337
|
-
var insets = useSafeAreaInsets();
|
|
15338
15352
|
var theme = useTheme$1();
|
|
15339
|
-
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15340
|
-
return item.key === selectedTabKey;
|
|
15341
|
-
});
|
|
15342
15353
|
var tabsAnims = useAnimatedValueArray(tabs.map(function (_, i) {
|
|
15343
|
-
return i ===
|
|
15354
|
+
return i === selectedIndex ? 1 : 0;
|
|
15344
15355
|
}));
|
|
15345
15356
|
React.useEffect(function () {
|
|
15346
|
-
|
|
15347
|
-
if (selectedTabIndex !== -1) {
|
|
15357
|
+
if (selectedIndex !== undefined && selectedIndex !== -1) {
|
|
15348
15358
|
var _flatListRef$current;
|
|
15349
15359
|
(_flatListRef$current = flatListRef.current) === null || _flatListRef$current === void 0 ? void 0 : _flatListRef$current.scrollToIndex({
|
|
15350
|
-
index:
|
|
15360
|
+
index: selectedIndex,
|
|
15351
15361
|
viewPosition: 0.5
|
|
15352
15362
|
});
|
|
15353
|
-
// If the selected tab is changed too quickly, the setPage is crashed and not work anymore
|
|
15354
|
-
// We apply throttle to prevent this issue https://github.com/Thinkei/hero-design/issues/1715
|
|
15355
|
-
timeoutHandle = setTimeout(function () {
|
|
15356
|
-
var _pagerViewRef$current;
|
|
15357
|
-
// use no animation to prevent unexpected behavior if users select tab too quickly
|
|
15358
|
-
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPageWithoutAnimation(selectedTabIndex);
|
|
15359
|
-
}, 200);
|
|
15360
15363
|
}
|
|
15361
15364
|
var animation = Animated.parallel(_toConsumableArray(tabs.map(function (_, i) {
|
|
15362
15365
|
return Animated.timing(tabsAnims[i], {
|
|
15363
|
-
toValue: i ===
|
|
15366
|
+
toValue: i === selectedIndex ? 1 : 0,
|
|
15364
15367
|
duration: 150,
|
|
15365
15368
|
useNativeDriver: true
|
|
15366
15369
|
});
|
|
@@ -15368,19 +15371,13 @@ var ScrollableTab = function ScrollableTab(_ref2) {
|
|
|
15368
15371
|
animation.start();
|
|
15369
15372
|
return function () {
|
|
15370
15373
|
animation.stop();
|
|
15371
|
-
if (timeoutHandle) {
|
|
15372
|
-
clearTimeout(timeoutHandle);
|
|
15373
|
-
}
|
|
15374
15374
|
};
|
|
15375
|
-
}, [
|
|
15376
|
-
return /*#__PURE__*/React.createElement(
|
|
15377
|
-
style: containerStyle,
|
|
15378
|
-
testID: componentTestID
|
|
15379
|
-
}, /*#__PURE__*/React.createElement(HeaderTabWrapper, {
|
|
15375
|
+
}, [selectedIndex]);
|
|
15376
|
+
return /*#__PURE__*/React.createElement(HeaderTabWrapper, {
|
|
15380
15377
|
themeInsets: insets,
|
|
15381
15378
|
style: barStyle
|
|
15382
15379
|
}, /*#__PURE__*/React.createElement(FlatList, {
|
|
15383
|
-
testID:
|
|
15380
|
+
testID: testID,
|
|
15384
15381
|
ref: flatListRef,
|
|
15385
15382
|
horizontal: true,
|
|
15386
15383
|
data: tabs,
|
|
@@ -15405,11 +15402,11 @@ var ScrollableTab = function ScrollableTab(_ref2) {
|
|
|
15405
15402
|
var tab = _ref4.item,
|
|
15406
15403
|
index = _ref4.index;
|
|
15407
15404
|
var key = tab.key,
|
|
15408
|
-
|
|
15405
|
+
tabItemTestID = tab.testID,
|
|
15409
15406
|
activeItem = tab.activeItem,
|
|
15410
15407
|
originalInactiveItem = tab.inactiveItem,
|
|
15411
15408
|
badge = tab.badge;
|
|
15412
|
-
var active =
|
|
15409
|
+
var active = selectedIndex === index;
|
|
15413
15410
|
var activeAnimated = tabsAnims[index];
|
|
15414
15411
|
var outlineScale = active ? activeAnimated.interpolate({
|
|
15415
15412
|
inputRange: [0, 1],
|
|
@@ -15426,7 +15423,7 @@ var ScrollableTab = function ScrollableTab(_ref2) {
|
|
|
15426
15423
|
onPress: function onPress() {
|
|
15427
15424
|
onTabPress(key);
|
|
15428
15425
|
},
|
|
15429
|
-
testID:
|
|
15426
|
+
testID: tabItemTestID
|
|
15430
15427
|
}, /*#__PURE__*/React.createElement(HeaderTabItem, {
|
|
15431
15428
|
isFirstItem: index === 0
|
|
15432
15429
|
}, /*#__PURE__*/React.createElement(HeaderTabItemOutlineWrapper, null, /*#__PURE__*/React.createElement(HeaderTabItemOutline, {
|
|
@@ -15442,7 +15439,55 @@ var ScrollableTab = function ScrollableTab(_ref2) {
|
|
|
15442
15439
|
tabItem: tabItem
|
|
15443
15440
|
}))));
|
|
15444
15441
|
}
|
|
15445
|
-
}))
|
|
15442
|
+
}));
|
|
15443
|
+
};
|
|
15444
|
+
|
|
15445
|
+
var ScrollableTab$1 = function ScrollableTab(_ref) {
|
|
15446
|
+
var onTabPress = _ref.onTabPress,
|
|
15447
|
+
selectedTabKey = _ref.selectedTabKey,
|
|
15448
|
+
tabs = _ref.tabs,
|
|
15449
|
+
containerStyle = _ref.containerStyle,
|
|
15450
|
+
barStyle = _ref.barStyle,
|
|
15451
|
+
_ref$lazy = _ref.lazy,
|
|
15452
|
+
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15453
|
+
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15454
|
+
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15455
|
+
_ref$swipeEnabled = _ref.swipeEnabled,
|
|
15456
|
+
swipeEnabled = _ref$swipeEnabled === void 0 ? true : _ref$swipeEnabled,
|
|
15457
|
+
componentTestID = _ref.testID;
|
|
15458
|
+
var pagerViewRef = React.useRef(null);
|
|
15459
|
+
var insets = useSafeAreaInsets();
|
|
15460
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15461
|
+
return item.key === selectedTabKey;
|
|
15462
|
+
});
|
|
15463
|
+
React.useEffect(function () {
|
|
15464
|
+
var timeoutHandle = null;
|
|
15465
|
+
if (selectedTabIndex !== -1) {
|
|
15466
|
+
// If the selected tab is changed too quickly, the setPage is crashed and not work anymore
|
|
15467
|
+
// We apply throttle to prevent this issue https://github.com/Thinkei/hero-design/issues/1715
|
|
15468
|
+
timeoutHandle = setTimeout(function () {
|
|
15469
|
+
var _pagerViewRef$current;
|
|
15470
|
+
// use no animation to prevent unexpected behavior if users select tab too quickly
|
|
15471
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPageWithoutAnimation(selectedTabIndex);
|
|
15472
|
+
}, 200);
|
|
15473
|
+
}
|
|
15474
|
+
return function () {
|
|
15475
|
+
if (timeoutHandle) {
|
|
15476
|
+
clearTimeout(timeoutHandle);
|
|
15477
|
+
}
|
|
15478
|
+
};
|
|
15479
|
+
}, [selectedTabIndex, pagerViewRef]);
|
|
15480
|
+
return /*#__PURE__*/React.createElement(TabContainer, {
|
|
15481
|
+
style: containerStyle,
|
|
15482
|
+
testID: componentTestID
|
|
15483
|
+
}, /*#__PURE__*/React.createElement(ScrollableTabHeader, {
|
|
15484
|
+
tabs: tabs,
|
|
15485
|
+
selectedIndex: selectedTabIndex,
|
|
15486
|
+
onTabPress: onTabPress,
|
|
15487
|
+
barStyle: barStyle,
|
|
15488
|
+
insets: insets,
|
|
15489
|
+
testID: componentTestID ? "".concat(componentTestID, "-tab-bar") : undefined
|
|
15490
|
+
}), /*#__PURE__*/React.createElement(ContentWrapper, {
|
|
15446
15491
|
initialPage: selectedTabIndex,
|
|
15447
15492
|
ref: pagerViewRef,
|
|
15448
15493
|
onPageSelected: function onPageSelected(e) {
|
|
@@ -15470,6 +15515,151 @@ var ScrollableTab = function ScrollableTab(_ref2) {
|
|
|
15470
15515
|
})));
|
|
15471
15516
|
};
|
|
15472
15517
|
|
|
15518
|
+
var SceneView = function SceneView(_ref) {
|
|
15519
|
+
var _ref$lazy = _ref.lazy,
|
|
15520
|
+
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15521
|
+
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15522
|
+
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15523
|
+
children = _ref.children,
|
|
15524
|
+
index = _ref.index,
|
|
15525
|
+
selectedIndex = _ref.selectedIndex,
|
|
15526
|
+
focused = _ref.focused,
|
|
15527
|
+
testID = _ref.testID;
|
|
15528
|
+
var _React$useState = React.useState(Math.abs(selectedIndex - index) > lazyPreloadDistance),
|
|
15529
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
15530
|
+
isLoading = _React$useState2[0],
|
|
15531
|
+
setIsLoading = _React$useState2[1];
|
|
15532
|
+
if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
|
|
15533
|
+
// Always render the route when it becomes focused
|
|
15534
|
+
setIsLoading(false);
|
|
15535
|
+
}
|
|
15536
|
+
if (lazy && isLoading) {
|
|
15537
|
+
console.error('Lazy loading is not supported in this version of Tabs');
|
|
15538
|
+
}
|
|
15539
|
+
React.useEffect(function () {
|
|
15540
|
+
var timer;
|
|
15541
|
+
if (!lazy && isLoading) {
|
|
15542
|
+
// If lazy mode is not enabled, render the scene with a delay if not loaded already
|
|
15543
|
+
// This improves the initial startup time as the scene is no longer blocking
|
|
15544
|
+
timer = setTimeout(function () {
|
|
15545
|
+
return setIsLoading(false);
|
|
15546
|
+
}, 0);
|
|
15547
|
+
}
|
|
15548
|
+
return function () {
|
|
15549
|
+
clearTimeout(timer);
|
|
15550
|
+
};
|
|
15551
|
+
}, [index, isLoading, lazy, focused]);
|
|
15552
|
+
return /*#__PURE__*/React.createElement(TabScreen, {
|
|
15553
|
+
accessibilityElementsHidden: !focused,
|
|
15554
|
+
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
|
|
15555
|
+
style: [{
|
|
15556
|
+
flex: 1,
|
|
15557
|
+
overflow: 'hidden'
|
|
15558
|
+
}, focused ? StyleSheet$1.absoluteFill : null],
|
|
15559
|
+
testID: testID
|
|
15560
|
+
}, focused || !isLoading ? children : null);
|
|
15561
|
+
};
|
|
15562
|
+
|
|
15563
|
+
var TabContext = /*#__PURE__*/React.createContext(null);
|
|
15564
|
+
var ScreenContext = /*#__PURE__*/React.createContext(null);
|
|
15565
|
+
var useIsFocused = function useIsFocused() {
|
|
15566
|
+
var context = React.useContext(TabContext);
|
|
15567
|
+
var key = React.useContext(ScreenContext);
|
|
15568
|
+
if (!context || !key) {
|
|
15569
|
+
return;
|
|
15570
|
+
}
|
|
15571
|
+
var isFocused = context.selectedTabKey === key;
|
|
15572
|
+
return isFocused;
|
|
15573
|
+
};
|
|
15574
|
+
var ScrollableTab = function ScrollableTab(_ref) {
|
|
15575
|
+
var onTabPress = _ref.onTabPress,
|
|
15576
|
+
selectedTabKey = _ref.selectedTabKey,
|
|
15577
|
+
tabs = _ref.tabs,
|
|
15578
|
+
containerStyle = _ref.containerStyle,
|
|
15579
|
+
barStyle = _ref.barStyle,
|
|
15580
|
+
_ref$lazy = _ref.lazy,
|
|
15581
|
+
lazy = _ref$lazy === void 0 ? false : _ref$lazy,
|
|
15582
|
+
_ref$lazyPreloadDista = _ref.lazyPreloadDistance,
|
|
15583
|
+
lazyPreloadDistance = _ref$lazyPreloadDista === void 0 ? 1 : _ref$lazyPreloadDista,
|
|
15584
|
+
_ref$swipeEnabled = _ref.swipeEnabled,
|
|
15585
|
+
swipeEnabled = _ref$swipeEnabled === void 0 ? true : _ref$swipeEnabled,
|
|
15586
|
+
componentTestID = _ref.testID;
|
|
15587
|
+
var pagerViewRef = React.useRef(null);
|
|
15588
|
+
var insets = useSafeAreaInsets();
|
|
15589
|
+
var selectedTabIndex = tabs.findIndex(function (item) {
|
|
15590
|
+
return item.key === selectedTabKey;
|
|
15591
|
+
});
|
|
15592
|
+
React.useEffect(function () {
|
|
15593
|
+
var timeoutHandle = null;
|
|
15594
|
+
if (selectedTabIndex !== -1) {
|
|
15595
|
+
// If the selected tab is changed too quickly, the setPage is crashed and not work anymore
|
|
15596
|
+
// We apply throttle to prevent this issue https://github.com/Thinkei/hero-design/issues/1715
|
|
15597
|
+
timeoutHandle = setTimeout(function () {
|
|
15598
|
+
var _pagerViewRef$current;
|
|
15599
|
+
// use no animation to prevent unexpected behavior if users select tab too quickly
|
|
15600
|
+
(_pagerViewRef$current = pagerViewRef.current) === null || _pagerViewRef$current === void 0 ? void 0 : _pagerViewRef$current.setPageWithoutAnimation(selectedTabIndex);
|
|
15601
|
+
}, 200);
|
|
15602
|
+
}
|
|
15603
|
+
return function () {
|
|
15604
|
+
if (timeoutHandle) {
|
|
15605
|
+
clearTimeout(timeoutHandle);
|
|
15606
|
+
}
|
|
15607
|
+
};
|
|
15608
|
+
}, [selectedTabIndex, pagerViewRef]);
|
|
15609
|
+
var indexRef = React.useRef(selectedTabIndex);
|
|
15610
|
+
var tabContextProviderValue = React.useMemo(function () {
|
|
15611
|
+
return {
|
|
15612
|
+
selectedTabKey: selectedTabKey
|
|
15613
|
+
};
|
|
15614
|
+
}, [selectedTabKey]);
|
|
15615
|
+
return /*#__PURE__*/React.createElement(TabContext.Provider, {
|
|
15616
|
+
value: tabContextProviderValue
|
|
15617
|
+
}, /*#__PURE__*/React.createElement(TabContainer, {
|
|
15618
|
+
style: containerStyle,
|
|
15619
|
+
testID: componentTestID
|
|
15620
|
+
}, /*#__PURE__*/React.createElement(ScrollableTabHeader, {
|
|
15621
|
+
tabs: tabs,
|
|
15622
|
+
selectedIndex: selectedTabIndex,
|
|
15623
|
+
onTabPress: onTabPress,
|
|
15624
|
+
barStyle: barStyle,
|
|
15625
|
+
insets: insets,
|
|
15626
|
+
testID: componentTestID ? "".concat(componentTestID, "-tab-bar") : undefined
|
|
15627
|
+
}), /*#__PURE__*/React.createElement(ContentWrapper, {
|
|
15628
|
+
initialPage: selectedTabIndex,
|
|
15629
|
+
ref: pagerViewRef,
|
|
15630
|
+
onPageSelected: function onPageSelected(e) {
|
|
15631
|
+
var index = e.nativeEvent.position;
|
|
15632
|
+
var selectedItem = tabs[index];
|
|
15633
|
+
if (selectedItem) {
|
|
15634
|
+
setTimeout(function () {
|
|
15635
|
+
onTabPress(selectedItem.key);
|
|
15636
|
+
});
|
|
15637
|
+
}
|
|
15638
|
+
indexRef.current = index;
|
|
15639
|
+
},
|
|
15640
|
+
scrollEnabled: swipeEnabled
|
|
15641
|
+
}, tabs.map(function (tab, index) {
|
|
15642
|
+
var key = tab.key,
|
|
15643
|
+
component = tab.component,
|
|
15644
|
+
testID = tab.testID;
|
|
15645
|
+
return /*#__PURE__*/React.createElement(ScreenContext.Provider, {
|
|
15646
|
+
value: key
|
|
15647
|
+
}, /*#__PURE__*/React.createElement(SceneView, {
|
|
15648
|
+
testID: testID,
|
|
15649
|
+
key: key,
|
|
15650
|
+
index: index,
|
|
15651
|
+
selectedIndex: indexRef.current,
|
|
15652
|
+
lazy: lazy,
|
|
15653
|
+
lazyPreloadDistance: lazyPreloadDistance,
|
|
15654
|
+
focused: selectedTabKey === key
|
|
15655
|
+
}, component));
|
|
15656
|
+
}))));
|
|
15657
|
+
};
|
|
15658
|
+
|
|
15659
|
+
var ScrollableTabsV2 = Object.assign(ScrollableTab, {
|
|
15660
|
+
useIsFocused: useIsFocused
|
|
15661
|
+
});
|
|
15662
|
+
|
|
15473
15663
|
var getTabItem = function getTabItem(_ref) {
|
|
15474
15664
|
var item = _ref.item,
|
|
15475
15665
|
color = _ref.color,
|
|
@@ -15596,7 +15786,8 @@ var Tabs = function Tabs(_ref2) {
|
|
|
15596
15786
|
})));
|
|
15597
15787
|
};
|
|
15598
15788
|
var index$2 = Object.assign(Tabs, {
|
|
15599
|
-
Scroll: ScrollableTab
|
|
15789
|
+
Scroll: ScrollableTab$1,
|
|
15790
|
+
ScrollV2: ScrollableTabsV2
|
|
15600
15791
|
});
|
|
15601
15792
|
|
|
15602
15793
|
var getFilledStyles = function getFilledStyles(themeIntent, theme) {
|
|
@@ -32451,7 +32642,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
32451
32642
|
var isEmptyValue = useMemo(function () {
|
|
32452
32643
|
return lib.exports.isEmptyContent(value);
|
|
32453
32644
|
}, [value]);
|
|
32454
|
-
var
|
|
32645
|
+
var state = useMemo(function () {
|
|
32455
32646
|
if (error) {
|
|
32456
32647
|
return 'error';
|
|
32457
32648
|
}
|
|
@@ -32559,25 +32750,26 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
32559
32750
|
return /*#__PURE__*/React.createElement(StyledContainer$4, {
|
|
32560
32751
|
testID: testID
|
|
32561
32752
|
}, /*#__PURE__*/React.createElement(StyledTextInputContainer, null, /*#__PURE__*/React.createElement(StyledBorderBackDrop, {
|
|
32562
|
-
|
|
32753
|
+
themeState: state,
|
|
32563
32754
|
themeFocused: isFocused
|
|
32564
32755
|
}), (isFocused || label && !isEmptyValue) && /*#__PURE__*/React.createElement(StyledLabelContainer, {
|
|
32565
32756
|
pointerEvents: "none"
|
|
32566
32757
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabel, {
|
|
32567
|
-
|
|
32758
|
+
themeState: state,
|
|
32568
32759
|
fontSize: "small"
|
|
32569
32760
|
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabel, {
|
|
32570
32761
|
testID: "input-label",
|
|
32571
32762
|
fontSize: "small",
|
|
32572
|
-
|
|
32763
|
+
themeState: state
|
|
32573
32764
|
}, label)), /*#__PURE__*/React.createElement(StyledTextInputAndLabelContainer, null, !isFocused && isEmptyValue && /*#__PURE__*/React.createElement(StyledLabelContainerInsideTextInput, {
|
|
32765
|
+
themeVariant: "text",
|
|
32574
32766
|
pointerEvents: "none"
|
|
32575
32767
|
}, required && /*#__PURE__*/React.createElement(StyledAsteriskLabelInsideTextInput, {
|
|
32576
|
-
|
|
32768
|
+
themeState: state
|
|
32577
32769
|
}, "*"), !!label && /*#__PURE__*/React.createElement(StyledLabelInsideTextInput, {
|
|
32578
32770
|
testID: "input-label",
|
|
32579
32771
|
fontSize: "medium",
|
|
32580
|
-
|
|
32772
|
+
themeState: state
|
|
32581
32773
|
}, label)), /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
32582
32774
|
onPress: function onPress(e) {
|
|
32583
32775
|
return e.stopPropagation();
|
|
File without changes
|