@hero-design/rn 7.6.1-alpha → 7.7.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/.expo/README.md +15 -0
- package/.expo/packager-info.json +10 -0
- package/.expo/prebuild/cached-packages.json +4 -0
- package/.expo/settings.json +10 -0
- package/.expo/xcodebuild-error.log +2 -0
- package/.expo/xcodebuild.log +11199 -0
- package/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-publish:npm.log +0 -0
- package/es/index.js +2953 -295
- package/lib/index.js +3119 -459
- package/package.json +3 -2
- package/playground/.turbo/turbo-type-check.log +7 -0
- package/playground/package.json +3 -3
- package/playground/src/App.tsx +8 -0
- package/playground/src/Checkbox.tsx +55 -0
- package/playground/src/Toast.tsx +114 -0
- package/rollup.config.js +1 -7
- package/src/components/Checkbox/StyledCheckbox.tsx +18 -0
- package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +10 -0
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +31 -0
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +63 -0
- package/src/components/Checkbox/__tests__/index.spec.tsx +24 -0
- package/src/components/Checkbox/index.tsx +58 -0
- package/src/components/Toast/StyledToast.tsx +65 -0
- package/src/components/Toast/Toast.tsx +123 -0
- package/src/components/Toast/ToastContainer.tsx +88 -0
- package/src/components/Toast/ToastContext.ts +25 -0
- package/src/components/Toast/ToastProvider.tsx +53 -0
- package/src/components/Toast/__tests__/Toast.spec.tsx +125 -0
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +107 -0
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +655 -0
- package/src/components/Toast/__tests__/__snapshots__/ToastContainer.spec.tsx.snap +93 -0
- package/src/components/Toast/index.tsx +11 -0
- package/src/components/Toast/types.ts +70 -0
- package/src/index.ts +4 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +41 -0
- package/src/theme/components/checkbox.ts +37 -0
- package/src/theme/components/toast.ts +33 -0
- package/src/theme/index.ts +6 -0
- package/types/components/Avatar/StyledAvatar.d.ts +0 -0
- package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
- package/types/components/Avatar/__tests__/index.spec.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/__tests__/Badge.spec.d.ts +0 -0
- package/types/components/Badge/__tests__/Status.spec.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/__tests__/index.spec.d.ts +0 -0
- package/types/components/BottomNavigation/index.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/StyledBottomSheet.d.ts +0 -0
- package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -0
- package/types/components/BottomSheet/index.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/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/__tests__/index.spec.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/__tests__/Button.spec.d.ts +0 -0
- package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -0
- package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -0
- package/types/components/Button/index.d.ts +0 -0
- package/types/components/Card/StyledCard.d.ts +0 -0
- package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
- package/types/components/Card/__tests__/index.spec.d.ts +0 -0
- package/types/components/Card/index.d.ts +0 -0
- package/types/components/Collapse/StyledCollapse.d.ts +0 -0
- package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
- package/types/components/Collapse/__tests__/index.spec.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/__tests__/StyledContentNavigator.spec.d.ts +0 -0
- package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -0
- package/types/components/ContentNavigator/index.d.ts +0 -0
- package/types/components/Divider/StyledDivider.d.ts +0 -0
- package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
- package/types/components/Divider/index.d.ts +0 -0
- package/types/components/Drawer/StyledDrawer.d.ts +0 -0
- package/types/components/Drawer/__tests__/index.spec.d.ts +0 -0
- package/types/components/Drawer/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/__tests__/index.spec.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/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
- package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
- package/types/components/FAB/__tests__/index.spec.d.ts +0 -0
- package/types/components/FAB/index.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/__tests__/index.spec.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/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/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/__tests__/Radio.spec.d.ts +0 -0
- package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -0
- package/types/components/Radio/__tests__/StyledRadio.spec.d.ts +0 -0
- package/types/components/Radio/index.d.ts +0 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -0
- package/types/components/SectionHeading/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/__tests__/AnimatedSpinner.spec.d.ts +0 -0
- package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -0
- package/types/components/Spinner/__tests__/index.spec.d.ts +0 -0
- package/types/components/Spinner/index.d.ts +0 -0
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledTabs.d.ts +0 -0
- package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -0
- package/types/components/Tabs/__tests__/index.spec.d.ts +0 -0
- package/types/components/Tabs/index.d.ts +0 -0
- package/types/components/Tabs/utils.d.ts +0 -0
- package/types/components/Tag/StyledTag.d.ts +0 -0
- package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -0
- package/types/components/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +0 -0
- package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -0
- package/types/components/TextInput/__tests__/index.spec.d.ts +0 -0
- package/types/components/TextInput/index.d.ts +0 -0
- package/types/components/Toast/StyledToast.d.ts +45 -0
- package/types/components/Toast/Toast.d.ts +3 -0
- package/types/components/Toast/ToastContainer.d.ts +5 -0
- package/types/components/Toast/ToastContext.d.ts +11 -0
- package/types/components/Toast/ToastProvider.d.ts +10 -0
- package/{es/components/Avatar/__tests__/StyledAvatar.spec.d.ts → types/components/Toast/__tests__/Toast.spec.d.ts} +0 -0
- package/{es/components/Avatar/__tests__/index.spec.d.ts → types/components/Toast/__tests__/ToastContainer.spec.d.ts} +0 -0
- package/types/components/Toast/index.d.ts +8 -0
- package/types/components/Toast/types.d.ts +67 -0
- package/types/components/Typography/Text/StyledText.d.ts +0 -0
- package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
- package/types/components/Typography/Text/__tests__/index.spec.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 +3 -1
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/__tests__/index.spec.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/card.d.ts +0 -0
- package/types/theme/components/contentNavigator.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/fab.d.ts +0 -0
- package/types/theme/components/icon.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/spinner.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 +0 -0
- package/types/theme/components/toast.d.ts +24 -0
- package/types/theme/components/typography.d.ts +0 -0
- package/types/theme/global/borders.d.ts +0 -0
- package/types/theme/global/colors.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/space.d.ts +0 -0
- package/types/theme/global/typography.d.ts +0 -0
- package/types/theme/index.d.ts +4 -0
- package/types/types.d.ts +0 -0
- package/types/utils/__tests__/scale.spec.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/.turbo/turbo-build:types.log +0 -2
- package/.turbo/turbo-build:watch.log +0 -1
- package/.turbo/turbo-lint.log +0 -2
- package/.turbo/turbo-type-check.log +0 -2
- package/es/components/Avatar/StyledAvatar.d.ts +0 -46
- package/es/components/Avatar/index.d.ts +0 -25
- package/es/components/Badge/Status.d.ts +0 -24
- package/es/components/Badge/StyledBadge.d.ts +0 -28
- package/es/components/Badge/__tests__/Badge.spec.d.ts +0 -1
- package/es/components/Badge/__tests__/Status.spec.d.ts +0 -1
- package/es/components/Badge/index.d.ts +0 -32
- package/es/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -52
- package/es/components/BottomNavigation/__tests__/index.spec.d.ts +0 -1
- package/es/components/BottomNavigation/index.d.ts +0 -45
- package/es/components/Button/IconButton.d.ts +0 -34
- package/es/components/Button/__tests__/index.spec.d.ts +0 -1
- package/es/components/Button/index.d.ts +0 -4
- package/es/components/Card/StyledCard.d.ts +0 -17
- package/es/components/Card/__tests__/StyledCard.spec.d.ts +0 -1
- package/es/components/Card/__tests__/index.spec.d.ts +0 -1
- package/es/components/Card/index.d.ts +0 -22
- package/es/components/Collapse/StyledCollapse.d.ts +0 -15
- package/es/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -1
- package/es/components/Collapse/__tests__/index.spec.d.ts +0 -1
- package/es/components/Collapse/index.d.ts +0 -23
- package/es/components/Divider/StyledDivider.d.ts +0 -13
- package/es/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -1
- package/es/components/Divider/index.d.ts +0 -21
- package/es/components/Drawer/StyledDrawer.d.ts +0 -25
- package/es/components/Drawer/__tests__/index.spec.d.ts +0 -1
- package/es/components/Drawer/index.d.ts +0 -25
- package/es/components/FAB/ActionGroup/ActionItem.d.ts +0 -12
- package/es/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -30
- package/es/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -13
- package/es/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -1
- package/es/components/FAB/ActionGroup/index.d.ts +0 -34
- package/es/components/FAB/AnimatedFABIcon.d.ts +0 -6
- package/es/components/FAB/FAB.d.ts +0 -34
- package/es/components/FAB/StyledFAB.d.ts +0 -20
- package/es/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -1
- package/es/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -1
- package/es/components/FAB/__tests__/index.spec.d.ts +0 -1
- package/es/components/FAB/index.d.ts +0 -4
- package/es/components/Icon/HeroIcon/index.d.ts +0 -13
- package/es/components/Icon/IconList.d.ts +0 -2
- package/es/components/Icon/__tests__/index.spec.d.ts +0 -1
- package/es/components/Icon/index.d.ts +0 -27
- package/es/components/Icon/utils.d.ts +0 -2
- package/es/components/Progress/ProgressBar.d.ts +0 -18
- package/es/components/Progress/ProgressCircle.d.ts +0 -18
- package/es/components/Progress/StyledProgressBar.d.ts +0 -18
- package/es/components/Progress/StyledProgressCircle.d.ts +0 -38
- package/es/components/Progress/index.d.ts +0 -5
- package/es/components/Progress/types.d.ts +0 -1
- package/es/components/Tabs/ActiveTabIndicator.d.ts +0 -8
- package/es/components/Tabs/ScrollableTabs.d.ts +0 -3
- package/es/components/Tabs/StyledScrollableTabs.d.ts +0 -61
- package/es/components/Tabs/StyledTabs.d.ts +0 -55
- package/es/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -1
- package/es/components/Tabs/__tests__/index.spec.d.ts +0 -1
- package/es/components/Tabs/index.d.ts +0 -54
- package/es/components/Tabs/utils.d.ts +0 -2
- package/es/components/Tag/StyledTag.d.ts +0 -20
- package/es/components/Tag/__tests__/Tag.spec.d.ts +0 -1
- package/es/components/Tag/index.d.ts +0 -21
- package/es/components/Typography/Text/StyledText.d.ts +0 -13
- package/es/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -1
- package/es/components/Typography/Text/__tests__/index.spec.d.ts +0 -1
- package/es/components/Typography/Text/index.d.ts +0 -30
- package/es/components/Typography/index.d.ts +0 -6
- package/es/index.d.ts +0 -19
- package/es/theme/__tests__/index.spec.d.ts +0 -1
- package/es/theme/components/avatar.d.ts +0 -32
- package/es/theme/components/badge.d.ts +0 -29
- package/es/theme/components/bottomNavigation.d.ts +0 -23
- package/es/theme/components/card.d.ts +0 -10
- package/es/theme/components/divider.d.ts +0 -17
- package/es/theme/components/drawer.d.ts +0 -21
- package/es/theme/components/fab.d.ts +0 -51
- package/es/theme/components/icon.d.ts +0 -19
- package/es/theme/components/progress.d.ts +0 -21
- package/es/theme/components/tabs.d.ts +0 -27
- package/es/theme/components/tag.d.ts +0 -30
- package/es/theme/components/typography.d.ts +0 -26
- package/es/theme/global/borders.d.ts +0 -11
- package/es/theme/global/colors.d.ts +0 -29
- package/es/theme/global/index.d.ts +0 -39
- package/es/theme/global/scale.d.ts +0 -9
- package/es/theme/global/space.d.ts +0 -13
- package/es/theme/global/typography.d.ts +0 -21
- package/es/theme/index.d.ts +0 -33
- package/es/types.d.ts +0 -5
- package/es/utils/__tests__/scale.spec.d.ts +0 -1
- package/es/utils/helpers.d.ts +0 -2
- package/es/utils/hooks.d.ts +0 -1
- package/es/utils/scale.d.ts +0 -3
- package/lib/components/Avatar/StyledAvatar.d.ts +0 -46
- package/lib/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -1
- package/lib/components/Avatar/__tests__/index.spec.d.ts +0 -1
- package/lib/components/Avatar/index.d.ts +0 -25
- package/lib/components/Badge/Status.d.ts +0 -24
- package/lib/components/Badge/StyledBadge.d.ts +0 -28
- package/lib/components/Badge/__tests__/Badge.spec.d.ts +0 -1
- package/lib/components/Badge/__tests__/Status.spec.d.ts +0 -1
- package/lib/components/Badge/index.d.ts +0 -32
- package/lib/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -52
- package/lib/components/BottomNavigation/__tests__/index.spec.d.ts +0 -1
- package/lib/components/BottomNavigation/index.d.ts +0 -45
- package/lib/components/Button/IconButton.d.ts +0 -34
- package/lib/components/Button/__tests__/index.spec.d.ts +0 -1
- package/lib/components/Button/index.d.ts +0 -4
- package/lib/components/Card/StyledCard.d.ts +0 -17
- package/lib/components/Card/__tests__/StyledCard.spec.d.ts +0 -1
- package/lib/components/Card/__tests__/index.spec.d.ts +0 -1
- package/lib/components/Card/index.d.ts +0 -22
- package/lib/components/Collapse/StyledCollapse.d.ts +0 -15
- package/lib/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -1
- package/lib/components/Collapse/__tests__/index.spec.d.ts +0 -1
- package/lib/components/Collapse/index.d.ts +0 -23
- package/lib/components/Divider/StyledDivider.d.ts +0 -13
- package/lib/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -1
- package/lib/components/Divider/index.d.ts +0 -21
- package/lib/components/Drawer/StyledDrawer.d.ts +0 -25
- package/lib/components/Drawer/__tests__/index.spec.d.ts +0 -1
- package/lib/components/Drawer/index.d.ts +0 -25
- package/lib/components/FAB/ActionGroup/ActionItem.d.ts +0 -12
- package/lib/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -30
- package/lib/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -13
- package/lib/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -1
- package/lib/components/FAB/ActionGroup/index.d.ts +0 -34
- package/lib/components/FAB/AnimatedFABIcon.d.ts +0 -6
- package/lib/components/FAB/FAB.d.ts +0 -34
- package/lib/components/FAB/StyledFAB.d.ts +0 -20
- package/lib/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -1
- package/lib/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -1
- package/lib/components/FAB/__tests__/index.spec.d.ts +0 -1
- package/lib/components/FAB/index.d.ts +0 -4
- package/lib/components/Icon/HeroIcon/index.d.ts +0 -13
- package/lib/components/Icon/IconList.d.ts +0 -2
- package/lib/components/Icon/__tests__/index.spec.d.ts +0 -1
- package/lib/components/Icon/index.d.ts +0 -27
- package/lib/components/Icon/utils.d.ts +0 -2
- package/lib/components/Progress/ProgressBar.d.ts +0 -18
- package/lib/components/Progress/ProgressCircle.d.ts +0 -18
- package/lib/components/Progress/StyledProgressBar.d.ts +0 -18
- package/lib/components/Progress/StyledProgressCircle.d.ts +0 -38
- package/lib/components/Progress/index.d.ts +0 -5
- package/lib/components/Progress/types.d.ts +0 -1
- package/lib/components/Tabs/ActiveTabIndicator.d.ts +0 -8
- package/lib/components/Tabs/ScrollableTabs.d.ts +0 -3
- package/lib/components/Tabs/StyledScrollableTabs.d.ts +0 -61
- package/lib/components/Tabs/StyledTabs.d.ts +0 -55
- package/lib/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -1
- package/lib/components/Tabs/__tests__/index.spec.d.ts +0 -1
- package/lib/components/Tabs/index.d.ts +0 -54
- package/lib/components/Tabs/utils.d.ts +0 -2
- package/lib/components/Tag/StyledTag.d.ts +0 -20
- package/lib/components/Tag/__tests__/Tag.spec.d.ts +0 -1
- package/lib/components/Tag/index.d.ts +0 -21
- package/lib/components/Typography/Text/StyledText.d.ts +0 -13
- package/lib/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -1
- package/lib/components/Typography/Text/__tests__/index.spec.d.ts +0 -1
- package/lib/components/Typography/Text/index.d.ts +0 -30
- package/lib/components/Typography/index.d.ts +0 -6
- package/lib/index.d.ts +0 -19
- package/lib/theme/__tests__/index.spec.d.ts +0 -1
- package/lib/theme/components/avatar.d.ts +0 -32
- package/lib/theme/components/badge.d.ts +0 -29
- package/lib/theme/components/bottomNavigation.d.ts +0 -23
- package/lib/theme/components/card.d.ts +0 -10
- package/lib/theme/components/divider.d.ts +0 -17
- package/lib/theme/components/drawer.d.ts +0 -21
- package/lib/theme/components/fab.d.ts +0 -51
- package/lib/theme/components/icon.d.ts +0 -19
- package/lib/theme/components/progress.d.ts +0 -21
- package/lib/theme/components/tabs.d.ts +0 -27
- package/lib/theme/components/tag.d.ts +0 -30
- package/lib/theme/components/typography.d.ts +0 -26
- package/lib/theme/global/borders.d.ts +0 -11
- package/lib/theme/global/colors.d.ts +0 -29
- package/lib/theme/global/index.d.ts +0 -39
- package/lib/theme/global/scale.d.ts +0 -9
- package/lib/theme/global/space.d.ts +0 -13
- package/lib/theme/global/typography.d.ts +0 -21
- package/lib/theme/index.d.ts +0 -33
- package/lib/types.d.ts +0 -5
- package/lib/utils/__tests__/scale.spec.d.ts +0 -1
- package/lib/utils/helpers.d.ts +0 -2
- package/lib/utils/hooks.d.ts +0 -1
- package/lib/utils/scale.d.ts +0 -3
- package/types/components/SectionHeading/__tests__/StyledHeading.d.ts +0 -1
package/es/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Dimensions, StyleSheet as StyleSheet$1, Text as Text$1, View, TouchableOpacity, Image, Animated, Platform, TouchableWithoutFeedback, Pressable, Easing, Modal, TouchableHighlight, TextInput as TextInput$1, FlatList } from 'react-native';
|
|
3
|
-
import React, { createContext, useContext, createElement, forwardRef, useRef, useEffect, useState, useCallback } from 'react';
|
|
4
|
-
import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
|
|
1
|
+
import * as ReactNative from 'react-native';
|
|
2
|
+
import ReactNative__default, { Dimensions, StyleSheet as StyleSheet$1, Text as Text$1, View, TouchableOpacity, Image, Animated, Platform, TouchableWithoutFeedback, Pressable, Easing, Modal, TouchableHighlight, TextInput as TextInput$1, requireNativeComponent, UIManager, I18nManager, Keyboard, FlatList, LayoutAnimation } from 'react-native';
|
|
3
|
+
import React, { createContext, useContext, createElement, forwardRef, useRef, useEffect, useState, useCallback, Children, useLayoutEffect, useImperativeHandle, useMemo } from 'react';
|
|
5
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
-
import PagerView from 'react-native-pager-view';
|
|
7
5
|
|
|
8
6
|
function ownKeys(object, enumerableOnly) {
|
|
9
7
|
var keys = Object.keys(object);
|
|
@@ -22,7 +20,7 @@ function _objectSpread2(target) {
|
|
|
22
20
|
for (var i = 1; i < arguments.length; i++) {
|
|
23
21
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
24
22
|
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
25
|
-
_defineProperty(target, key, source[key]);
|
|
23
|
+
_defineProperty$2(target, key, source[key]);
|
|
26
24
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
27
25
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
28
26
|
});
|
|
@@ -31,17 +29,42 @@ function _objectSpread2(target) {
|
|
|
31
29
|
return target;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
function _typeof(obj) {
|
|
32
|
+
function _typeof$2(obj) {
|
|
35
33
|
"@babel/helpers - typeof";
|
|
36
34
|
|
|
37
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
35
|
+
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
38
36
|
return typeof obj;
|
|
39
37
|
} : function (obj) {
|
|
40
38
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
41
|
-
}, _typeof(obj);
|
|
39
|
+
}, _typeof$2(obj);
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
function
|
|
42
|
+
function _classCallCheck$1(instance, Constructor) {
|
|
43
|
+
if (!(instance instanceof Constructor)) {
|
|
44
|
+
throw new TypeError("Cannot call a class as a function");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _defineProperties$1(target, props) {
|
|
49
|
+
for (var i = 0; i < props.length; i++) {
|
|
50
|
+
var descriptor = props[i];
|
|
51
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
52
|
+
descriptor.configurable = true;
|
|
53
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
54
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
59
|
+
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
60
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
61
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
62
|
+
writable: false
|
|
63
|
+
});
|
|
64
|
+
return Constructor;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _defineProperty$2(obj, key, value) {
|
|
45
68
|
if (key in obj) {
|
|
46
69
|
Object.defineProperty(obj, key, {
|
|
47
70
|
value: value,
|
|
@@ -56,8 +79,8 @@ function _defineProperty(obj, key, value) {
|
|
|
56
79
|
return obj;
|
|
57
80
|
}
|
|
58
81
|
|
|
59
|
-
function _extends$
|
|
60
|
-
_extends$
|
|
82
|
+
function _extends$3() {
|
|
83
|
+
_extends$3 = Object.assign || function (target) {
|
|
61
84
|
for (var i = 1; i < arguments.length; i++) {
|
|
62
85
|
var source = arguments[i];
|
|
63
86
|
|
|
@@ -71,10 +94,57 @@ function _extends$1() {
|
|
|
71
94
|
return target;
|
|
72
95
|
};
|
|
73
96
|
|
|
74
|
-
return _extends$
|
|
97
|
+
return _extends$3.apply(this, arguments);
|
|
75
98
|
}
|
|
76
99
|
|
|
77
|
-
function
|
|
100
|
+
function _inherits$1(subClass, superClass) {
|
|
101
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
102
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
106
|
+
constructor: {
|
|
107
|
+
value: subClass,
|
|
108
|
+
writable: true,
|
|
109
|
+
configurable: true
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(subClass, "prototype", {
|
|
113
|
+
writable: false
|
|
114
|
+
});
|
|
115
|
+
if (superClass) _setPrototypeOf$1(subClass, superClass);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function _getPrototypeOf$1(o) {
|
|
119
|
+
_getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
120
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
121
|
+
};
|
|
122
|
+
return _getPrototypeOf$1(o);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function _setPrototypeOf$1(o, p) {
|
|
126
|
+
_setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
127
|
+
o.__proto__ = p;
|
|
128
|
+
return o;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return _setPrototypeOf$1(o, p);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function _isNativeReflectConstruct() {
|
|
135
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
136
|
+
if (Reflect.construct.sham) return false;
|
|
137
|
+
if (typeof Proxy === "function") return true;
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
141
|
+
return true;
|
|
142
|
+
} catch (e) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
78
148
|
if (source == null) return {};
|
|
79
149
|
var target = {};
|
|
80
150
|
var sourceKeys = Object.keys(source);
|
|
@@ -89,10 +159,10 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
89
159
|
return target;
|
|
90
160
|
}
|
|
91
161
|
|
|
92
|
-
function _objectWithoutProperties(source, excluded) {
|
|
162
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
93
163
|
if (source == null) return {};
|
|
94
164
|
|
|
95
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
165
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
96
166
|
|
|
97
167
|
var key, i;
|
|
98
168
|
|
|
@@ -110,15 +180,52 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
110
180
|
return target;
|
|
111
181
|
}
|
|
112
182
|
|
|
183
|
+
function _assertThisInitialized$1(self) {
|
|
184
|
+
if (self === void 0) {
|
|
185
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return self;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function _possibleConstructorReturn$1(self, call) {
|
|
192
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
193
|
+
return call;
|
|
194
|
+
} else if (call !== void 0) {
|
|
195
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return _assertThisInitialized$1(self);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function _createSuper(Derived) {
|
|
202
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
203
|
+
|
|
204
|
+
return function _createSuperInternal() {
|
|
205
|
+
var Super = _getPrototypeOf$1(Derived),
|
|
206
|
+
result;
|
|
207
|
+
|
|
208
|
+
if (hasNativeReflectConstruct) {
|
|
209
|
+
var NewTarget = _getPrototypeOf$1(this).constructor;
|
|
210
|
+
|
|
211
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
212
|
+
} else {
|
|
213
|
+
result = Super.apply(this, arguments);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return _possibleConstructorReturn$1(this, result);
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
113
220
|
function _slicedToArray(arr, i) {
|
|
114
221
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
115
222
|
}
|
|
116
223
|
|
|
117
|
-
function _toConsumableArray(arr) {
|
|
118
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
224
|
+
function _toConsumableArray$1(arr) {
|
|
225
|
+
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread$1();
|
|
119
226
|
}
|
|
120
227
|
|
|
121
|
-
function _arrayWithoutHoles(arr) {
|
|
228
|
+
function _arrayWithoutHoles$1(arr) {
|
|
122
229
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
123
230
|
}
|
|
124
231
|
|
|
@@ -126,7 +233,7 @@ function _arrayWithHoles(arr) {
|
|
|
126
233
|
if (Array.isArray(arr)) return arr;
|
|
127
234
|
}
|
|
128
235
|
|
|
129
|
-
function _iterableToArray(iter) {
|
|
236
|
+
function _iterableToArray$1(iter) {
|
|
130
237
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
131
238
|
}
|
|
132
239
|
|
|
@@ -177,7 +284,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
177
284
|
return arr2;
|
|
178
285
|
}
|
|
179
286
|
|
|
180
|
-
function _nonIterableSpread() {
|
|
287
|
+
function _nonIterableSpread$1() {
|
|
181
288
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
182
289
|
}
|
|
183
290
|
|
|
@@ -1424,8 +1531,8 @@ var createCache = function createCache(options) {
|
|
|
1424
1531
|
return cache;
|
|
1425
1532
|
};
|
|
1426
1533
|
|
|
1427
|
-
function _extends() {
|
|
1428
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1534
|
+
function _extends$2() {
|
|
1535
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1429
1536
|
for (var i = 1; i < arguments.length; i++) {
|
|
1430
1537
|
var source = arguments[i];
|
|
1431
1538
|
|
|
@@ -1438,7 +1545,7 @@ function _extends() {
|
|
|
1438
1545
|
|
|
1439
1546
|
return target;
|
|
1440
1547
|
};
|
|
1441
|
-
return _extends.apply(this, arguments);
|
|
1548
|
+
return _extends$2.apply(this, arguments);
|
|
1442
1549
|
}
|
|
1443
1550
|
|
|
1444
1551
|
var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
@@ -1466,7 +1573,7 @@ var getTheme$1 = function getTheme(outerTheme, theme) {
|
|
|
1466
1573
|
return mergedTheme;
|
|
1467
1574
|
}
|
|
1468
1575
|
|
|
1469
|
-
return _extends({}, outerTheme, theme);
|
|
1576
|
+
return _extends$2({}, outerTheme, theme);
|
|
1470
1577
|
};
|
|
1471
1578
|
|
|
1472
1579
|
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
|
|
@@ -1962,6 +2069,35 @@ var getCardTheme = function getCardTheme(theme) {
|
|
|
1962
2069
|
};
|
|
1963
2070
|
};
|
|
1964
2071
|
|
|
2072
|
+
var getCheckboxTheme = function getCheckboxTheme(theme) {
|
|
2073
|
+
var colors = {
|
|
2074
|
+
borderColor: theme.colors.primary,
|
|
2075
|
+
text: theme.colors.invertedText,
|
|
2076
|
+
disabled: theme.colors.inactiveBackground
|
|
2077
|
+
};
|
|
2078
|
+
var space = {
|
|
2079
|
+
// to remove the empty space above the check icon
|
|
2080
|
+
// and also to center the check mark
|
|
2081
|
+
iconTop: -theme.space.xsmall
|
|
2082
|
+
};
|
|
2083
|
+
var sizes = {
|
|
2084
|
+
base: theme.space.large
|
|
2085
|
+
};
|
|
2086
|
+
var radii = {
|
|
2087
|
+
base: theme.radii.base
|
|
2088
|
+
};
|
|
2089
|
+
var borderWidths = {
|
|
2090
|
+
"default": theme.borderWidths.medium
|
|
2091
|
+
};
|
|
2092
|
+
return {
|
|
2093
|
+
colors: colors,
|
|
2094
|
+
space: space,
|
|
2095
|
+
sizes: sizes,
|
|
2096
|
+
radii: radii,
|
|
2097
|
+
borderWidths: borderWidths
|
|
2098
|
+
};
|
|
2099
|
+
};
|
|
2100
|
+
|
|
1965
2101
|
var getContentNavigatorTheme = function getContentNavigatorTheme(theme) {
|
|
1966
2102
|
var space = {
|
|
1967
2103
|
valueHorizontalPadding: theme.space.small
|
|
@@ -2192,235 +2328,2230 @@ var getSelectTheme = function getSelectTheme(theme) {
|
|
|
2192
2328
|
};
|
|
2193
2329
|
};
|
|
2194
2330
|
|
|
2195
|
-
var getSpinnerTheme = function getSpinnerTheme(theme) {
|
|
2196
|
-
var color = {
|
|
2197
|
-
"default": theme.colors.primary
|
|
2198
|
-
};
|
|
2199
|
-
var space = {
|
|
2200
|
-
spinnerDot: theme.space.medium,
|
|
2201
|
-
spinnerDotPadding: theme.space.small,
|
|
2202
|
-
spinnerTextPaddingTop: theme.space.small
|
|
2203
|
-
};
|
|
2204
|
-
var radii = {
|
|
2205
|
-
"default": theme.radii.medium
|
|
2206
|
-
};
|
|
2207
|
-
return {
|
|
2208
|
-
color: color,
|
|
2209
|
-
space: space,
|
|
2210
|
-
radii: radii
|
|
2211
|
-
};
|
|
2212
|
-
};
|
|
2331
|
+
var getSpinnerTheme = function getSpinnerTheme(theme) {
|
|
2332
|
+
var color = {
|
|
2333
|
+
"default": theme.colors.primary
|
|
2334
|
+
};
|
|
2335
|
+
var space = {
|
|
2336
|
+
spinnerDot: theme.space.medium,
|
|
2337
|
+
spinnerDotPadding: theme.space.small,
|
|
2338
|
+
spinnerTextPaddingTop: theme.space.small
|
|
2339
|
+
};
|
|
2340
|
+
var radii = {
|
|
2341
|
+
"default": theme.radii.medium
|
|
2342
|
+
};
|
|
2343
|
+
return {
|
|
2344
|
+
color: color,
|
|
2345
|
+
space: space,
|
|
2346
|
+
radii: radii
|
|
2347
|
+
};
|
|
2348
|
+
};
|
|
2349
|
+
|
|
2350
|
+
var getSwitchTheme = function getSwitchTheme(theme) {
|
|
2351
|
+
var colors = {
|
|
2352
|
+
thumb: theme.colors.platformBackground,
|
|
2353
|
+
active: theme.colors.primary,
|
|
2354
|
+
inactive: theme.colors.inactiveBackground
|
|
2355
|
+
};
|
|
2356
|
+
var thumbSizes = {
|
|
2357
|
+
small: theme.space.medium,
|
|
2358
|
+
medium: theme.space.medium * 1.3
|
|
2359
|
+
};
|
|
2360
|
+
var widths = {
|
|
2361
|
+
small: theme.space.xxxlarge,
|
|
2362
|
+
medium: theme.space.xxxxlarge
|
|
2363
|
+
};
|
|
2364
|
+
var heights = {
|
|
2365
|
+
small: theme.space.large,
|
|
2366
|
+
medium: theme.space.large * 1.2
|
|
2367
|
+
};
|
|
2368
|
+
var spaces = {
|
|
2369
|
+
small: theme.space.xsmall,
|
|
2370
|
+
medium: theme.space.xsmall,
|
|
2371
|
+
inactive: 0
|
|
2372
|
+
};
|
|
2373
|
+
var radii = {
|
|
2374
|
+
rounded: theme.radii.rounded
|
|
2375
|
+
};
|
|
2376
|
+
var borderWidths = {
|
|
2377
|
+
"default": theme.borderWidths.base
|
|
2378
|
+
};
|
|
2379
|
+
return {
|
|
2380
|
+
colors: colors,
|
|
2381
|
+
thumbSizes: thumbSizes,
|
|
2382
|
+
widths: widths,
|
|
2383
|
+
heights: heights,
|
|
2384
|
+
spaces: spaces,
|
|
2385
|
+
radii: radii,
|
|
2386
|
+
borderWidths: borderWidths
|
|
2387
|
+
};
|
|
2388
|
+
};
|
|
2389
|
+
|
|
2390
|
+
var getTabsTheme = function getTabsTheme(theme) {
|
|
2391
|
+
var colors = {
|
|
2392
|
+
active: theme.colors.primary,
|
|
2393
|
+
inactive: theme.colors.text,
|
|
2394
|
+
activeBackground: theme.colors.primaryBackground,
|
|
2395
|
+
headerBottom: theme.colors.outline,
|
|
2396
|
+
text: theme.colors.text
|
|
2397
|
+
};
|
|
2398
|
+
var space = {
|
|
2399
|
+
flatListHorizontalPadding: theme.space.small,
|
|
2400
|
+
itemHorizontalPadding: theme.space.small,
|
|
2401
|
+
itemVerticalPadding: theme.space.small,
|
|
2402
|
+
outlineHorizontalPadding: theme.space.small,
|
|
2403
|
+
outlineVerticalPadding: theme.space.xsmall
|
|
2404
|
+
};
|
|
2405
|
+
var radii = {
|
|
2406
|
+
outline: theme.radii.medium
|
|
2407
|
+
};
|
|
2408
|
+
var borderWidths = {
|
|
2409
|
+
headerBottom: theme.borderWidths.base
|
|
2410
|
+
};
|
|
2411
|
+
var sizes = {
|
|
2412
|
+
indicator: theme.space.xxsmall
|
|
2413
|
+
};
|
|
2414
|
+
return {
|
|
2415
|
+
borderWidths: borderWidths,
|
|
2416
|
+
colors: colors,
|
|
2417
|
+
space: space,
|
|
2418
|
+
radii: radii,
|
|
2419
|
+
sizes: sizes
|
|
2420
|
+
};
|
|
2421
|
+
};
|
|
2422
|
+
|
|
2423
|
+
var getTagTheme = function getTagTheme(theme) {
|
|
2424
|
+
var borderWidths = {
|
|
2425
|
+
"default": theme.borderWidths.base
|
|
2426
|
+
};
|
|
2427
|
+
var colors = {
|
|
2428
|
+
danger: theme.colors.danger,
|
|
2429
|
+
dangerBackground: theme.colors.dangerBackground,
|
|
2430
|
+
info: theme.colors.info,
|
|
2431
|
+
infoBackground: theme.colors.infoBackground,
|
|
2432
|
+
success: theme.colors.successDark,
|
|
2433
|
+
successBackground: theme.colors.successBackground,
|
|
2434
|
+
warning: theme.colors.warningDark,
|
|
2435
|
+
warningBackground: theme.colors.warningBackground
|
|
2436
|
+
};
|
|
2437
|
+
var fonts = {
|
|
2438
|
+
"default": theme.fonts.semiBold
|
|
2439
|
+
};
|
|
2440
|
+
var fontSizes = {
|
|
2441
|
+
"default": theme.fontSizes.small
|
|
2442
|
+
};
|
|
2443
|
+
var space = {
|
|
2444
|
+
horizontalPadding: theme.space.small,
|
|
2445
|
+
verticalPadding: theme.space.xxsmall
|
|
2446
|
+
};
|
|
2447
|
+
var radii = {
|
|
2448
|
+
"default": theme.radii.base
|
|
2449
|
+
};
|
|
2450
|
+
return {
|
|
2451
|
+
borderWidths: borderWidths,
|
|
2452
|
+
colors: colors,
|
|
2453
|
+
fonts: fonts,
|
|
2454
|
+
fontSizes: fontSizes,
|
|
2455
|
+
space: space,
|
|
2456
|
+
radii: radii
|
|
2457
|
+
};
|
|
2458
|
+
};
|
|
2459
|
+
|
|
2460
|
+
var getTextInputTheme = function getTextInputTheme(theme) {
|
|
2461
|
+
var colors = {
|
|
2462
|
+
labelBackground: theme.colors.platformBackground,
|
|
2463
|
+
border: theme.colors.text
|
|
2464
|
+
};
|
|
2465
|
+
var space = {
|
|
2466
|
+
containerPadding: theme.space.medium,
|
|
2467
|
+
labelLeft: theme.space.medium,
|
|
2468
|
+
labelTop: theme.lineHeights.small / -2,
|
|
2469
|
+
labelHorizontalPadding: theme.space.xsmall,
|
|
2470
|
+
inputHorizontalMargin: theme.space.small
|
|
2471
|
+
};
|
|
2472
|
+
var fontSizes = {
|
|
2473
|
+
text: theme.fontSizes.large
|
|
2474
|
+
};
|
|
2475
|
+
var borderWidths = {
|
|
2476
|
+
container: theme.borderWidths.base
|
|
2477
|
+
};
|
|
2478
|
+
var radii = {
|
|
2479
|
+
container: theme.radii.medium
|
|
2480
|
+
};
|
|
2481
|
+
return {
|
|
2482
|
+
colors: colors,
|
|
2483
|
+
space: space,
|
|
2484
|
+
fontSizes: fontSizes,
|
|
2485
|
+
borderWidths: borderWidths,
|
|
2486
|
+
radii: radii
|
|
2487
|
+
};
|
|
2488
|
+
};
|
|
2489
|
+
|
|
2490
|
+
var getToastTheme = function getToastTheme(theme) {
|
|
2491
|
+
var colors = {
|
|
2492
|
+
success: theme.colors.success,
|
|
2493
|
+
warning: theme.colors.warning,
|
|
2494
|
+
error: theme.colors.danger,
|
|
2495
|
+
info: theme.colors.infoMediumLight,
|
|
2496
|
+
divider: theme.colors.backgroundLight
|
|
2497
|
+
};
|
|
2498
|
+
var sizes = {
|
|
2499
|
+
height: scale(48)
|
|
2500
|
+
};
|
|
2501
|
+
var space = {
|
|
2502
|
+
mediumPadding: theme.space.medium,
|
|
2503
|
+
largePadding: theme.space.large
|
|
2504
|
+
};
|
|
2505
|
+
var radii = {
|
|
2506
|
+
"default": theme.radii.xlarge
|
|
2507
|
+
};
|
|
2508
|
+
var borderWidths = {
|
|
2509
|
+
base: theme.borderWidths.base
|
|
2510
|
+
};
|
|
2511
|
+
return {
|
|
2512
|
+
colors: colors,
|
|
2513
|
+
radii: radii,
|
|
2514
|
+
sizes: sizes,
|
|
2515
|
+
space: space,
|
|
2516
|
+
borderWidths: borderWidths
|
|
2517
|
+
};
|
|
2518
|
+
};
|
|
2519
|
+
|
|
2520
|
+
var getTypographyTheme = function getTypographyTheme(theme) {
|
|
2521
|
+
var colors = {
|
|
2522
|
+
body: theme.colors.text,
|
|
2523
|
+
subdued: theme.colors.disabledText,
|
|
2524
|
+
primary: theme.colors.primary
|
|
2525
|
+
};
|
|
2526
|
+
var fonts = {
|
|
2527
|
+
light: theme.fonts.light,
|
|
2528
|
+
regular: theme.fonts.regular,
|
|
2529
|
+
semiBold: theme.fonts.semiBold
|
|
2530
|
+
};
|
|
2531
|
+
var fontSizes = {
|
|
2532
|
+
small: theme.fontSizes.small,
|
|
2533
|
+
medium: theme.fontSizes.medium,
|
|
2534
|
+
large: theme.fontSizes.large,
|
|
2535
|
+
xlarge: theme.fontSizes.xlarge
|
|
2536
|
+
};
|
|
2537
|
+
var lineHeights = {
|
|
2538
|
+
small: theme.lineHeights.small,
|
|
2539
|
+
medium: theme.lineHeights.medium,
|
|
2540
|
+
large: theme.lineHeights.large,
|
|
2541
|
+
xlarge: theme.lineHeights.xlarge
|
|
2542
|
+
};
|
|
2543
|
+
return {
|
|
2544
|
+
colors: colors,
|
|
2545
|
+
fonts: fonts,
|
|
2546
|
+
fontSizes: fontSizes,
|
|
2547
|
+
lineHeights: lineHeights
|
|
2548
|
+
};
|
|
2549
|
+
};
|
|
2550
|
+
|
|
2551
|
+
var getTheme = function getTheme() {
|
|
2552
|
+
var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
|
|
2553
|
+
var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : systemPalette;
|
|
2554
|
+
var globalTheme = getGlobalTheme(scale, systemPallete);
|
|
2555
|
+
return _objectSpread2(_objectSpread2({}, globalTheme), {}, {
|
|
2556
|
+
__hd__: {
|
|
2557
|
+
avatar: getAvatarTheme(globalTheme),
|
|
2558
|
+
alert: getAlertTheme(globalTheme),
|
|
2559
|
+
badge: getBadgeTheme(globalTheme),
|
|
2560
|
+
bottomNavigation: getBottomNavigationTheme(globalTheme),
|
|
2561
|
+
bottomSheet: getBottomSheetTheme(globalTheme),
|
|
2562
|
+
button: getButtonTheme(globalTheme),
|
|
2563
|
+
card: getCardTheme(globalTheme),
|
|
2564
|
+
checkbox: getCheckboxTheme(globalTheme),
|
|
2565
|
+
contentNavigator: getContentNavigatorTheme(globalTheme),
|
|
2566
|
+
divider: getDividerTheme(globalTheme),
|
|
2567
|
+
drawer: getDrawerTheme(globalTheme),
|
|
2568
|
+
fab: getFABTheme(globalTheme),
|
|
2569
|
+
icon: getIconTheme(globalTheme),
|
|
2570
|
+
progress: getProgressTheme(globalTheme),
|
|
2571
|
+
radio: getRadioTheme(globalTheme),
|
|
2572
|
+
sectionHeading: getSectionHeadingTheme(globalTheme),
|
|
2573
|
+
select: getSelectTheme(globalTheme),
|
|
2574
|
+
spinner: getSpinnerTheme(globalTheme),
|
|
2575
|
+
"switch": getSwitchTheme(globalTheme),
|
|
2576
|
+
tabs: getTabsTheme(globalTheme),
|
|
2577
|
+
tag: getTagTheme(globalTheme),
|
|
2578
|
+
textInput: getTextInputTheme(globalTheme),
|
|
2579
|
+
toast: getToastTheme(globalTheme),
|
|
2580
|
+
typography: getTypographyTheme(globalTheme)
|
|
2581
|
+
}
|
|
2582
|
+
});
|
|
2583
|
+
};
|
|
2584
|
+
|
|
2585
|
+
var theme = getTheme();
|
|
2586
|
+
var ThemeProvider = ThemeProvider$1;
|
|
2587
|
+
var useTheme = useTheme$1;
|
|
2588
|
+
|
|
2589
|
+
function getDefaultExportFromCjs (x) {
|
|
2590
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
var dist = {};
|
|
2594
|
+
|
|
2595
|
+
function _interopRequireDefault$5(obj) {
|
|
2596
|
+
return obj && obj.__esModule ? obj : {
|
|
2597
|
+
"default": obj
|
|
2598
|
+
};
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
var interopRequireDefault = _interopRequireDefault$5;
|
|
2602
|
+
|
|
2603
|
+
var createIconSet$1 = {};
|
|
2604
|
+
|
|
2605
|
+
function _arrayWithoutHoles(arr) {
|
|
2606
|
+
if (Array.isArray(arr)) {
|
|
2607
|
+
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
|
2608
|
+
arr2[i] = arr[i];
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
return arr2;
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
var arrayWithoutHoles$1 = _arrayWithoutHoles;
|
|
2616
|
+
|
|
2617
|
+
function _iterableToArray(iter) {
|
|
2618
|
+
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
var iterableToArray$1 = _iterableToArray;
|
|
2622
|
+
|
|
2623
|
+
function _nonIterableSpread() {
|
|
2624
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
var nonIterableSpread$1 = _nonIterableSpread;
|
|
2628
|
+
|
|
2629
|
+
var arrayWithoutHoles = arrayWithoutHoles$1;
|
|
2630
|
+
var iterableToArray = iterableToArray$1;
|
|
2631
|
+
var nonIterableSpread = nonIterableSpread$1;
|
|
2632
|
+
|
|
2633
|
+
function _toConsumableArray(arr) {
|
|
2634
|
+
return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
var toConsumableArray = _toConsumableArray;
|
|
2638
|
+
|
|
2639
|
+
var runtime = {exports: {}};
|
|
2640
|
+
|
|
2641
|
+
(function (module) {
|
|
2642
|
+
var runtime = function (exports) {
|
|
2643
|
+
|
|
2644
|
+
var Op = Object.prototype;
|
|
2645
|
+
var hasOwn = Op.hasOwnProperty;
|
|
2646
|
+
var undefined$1; // More compressible than void 0.
|
|
2647
|
+
|
|
2648
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
2649
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
2650
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
2651
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
2652
|
+
|
|
2653
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
2654
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
2655
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
2656
|
+
var generator = Object.create(protoGenerator.prototype);
|
|
2657
|
+
var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
|
|
2658
|
+
// .throw, and .return methods.
|
|
2659
|
+
|
|
2660
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
2661
|
+
return generator;
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
|
|
2665
|
+
// record like context.tryEntries[i].completion. This interface could
|
|
2666
|
+
// have been (and was previously) designed to take a closure to be
|
|
2667
|
+
// invoked without arguments, but in all the cases we care about we
|
|
2668
|
+
// already have an existing method we want to call, so there's no need
|
|
2669
|
+
// to create a new function object. We can even get away with assuming
|
|
2670
|
+
// the method takes exactly one argument, since that happens to be true
|
|
2671
|
+
// in every case, so we don't have to touch the arguments object. The
|
|
2672
|
+
// only additional allocation required is the completion record, which
|
|
2673
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
|
2674
|
+
|
|
2675
|
+
function tryCatch(fn, obj, arg) {
|
|
2676
|
+
try {
|
|
2677
|
+
return {
|
|
2678
|
+
type: "normal",
|
|
2679
|
+
arg: fn.call(obj, arg)
|
|
2680
|
+
};
|
|
2681
|
+
} catch (err) {
|
|
2682
|
+
return {
|
|
2683
|
+
type: "throw",
|
|
2684
|
+
arg: err
|
|
2685
|
+
};
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
var GenStateSuspendedStart = "suspendedStart";
|
|
2690
|
+
var GenStateSuspendedYield = "suspendedYield";
|
|
2691
|
+
var GenStateExecuting = "executing";
|
|
2692
|
+
var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
|
|
2693
|
+
// breaking out of the dispatch switch statement.
|
|
2694
|
+
|
|
2695
|
+
var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
|
|
2696
|
+
// .constructor.prototype properties for functions that return Generator
|
|
2697
|
+
// objects. For full spec compliance, you may wish to configure your
|
|
2698
|
+
// minifier not to mangle the names of these two functions.
|
|
2699
|
+
|
|
2700
|
+
function Generator() {}
|
|
2701
|
+
|
|
2702
|
+
function GeneratorFunction() {}
|
|
2703
|
+
|
|
2704
|
+
function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
|
|
2705
|
+
// don't natively support it.
|
|
2706
|
+
|
|
2707
|
+
|
|
2708
|
+
var IteratorPrototype = {};
|
|
2709
|
+
|
|
2710
|
+
IteratorPrototype[iteratorSymbol] = function () {
|
|
2711
|
+
return this;
|
|
2712
|
+
};
|
|
2713
|
+
|
|
2714
|
+
var getProto = Object.getPrototypeOf;
|
|
2715
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
2716
|
+
|
|
2717
|
+
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
2718
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
|
2719
|
+
// of the polyfill.
|
|
2720
|
+
IteratorPrototype = NativeIteratorPrototype;
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
2724
|
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
2725
|
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
2726
|
+
GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the
|
|
2727
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
2728
|
+
|
|
2729
|
+
function defineIteratorMethods(prototype) {
|
|
2730
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
2731
|
+
prototype[method] = function (arg) {
|
|
2732
|
+
return this._invoke(method, arg);
|
|
2733
|
+
};
|
|
2734
|
+
});
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
exports.isGeneratorFunction = function (genFun) {
|
|
2738
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
2739
|
+
return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
|
|
2740
|
+
// do is to check its .name property.
|
|
2741
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
|
|
2742
|
+
};
|
|
2743
|
+
|
|
2744
|
+
exports.mark = function (genFun) {
|
|
2745
|
+
if (Object.setPrototypeOf) {
|
|
2746
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
2747
|
+
} else {
|
|
2748
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
2749
|
+
|
|
2750
|
+
if (!(toStringTagSymbol in genFun)) {
|
|
2751
|
+
genFun[toStringTagSymbol] = "GeneratorFunction";
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
genFun.prototype = Object.create(Gp);
|
|
2756
|
+
return genFun;
|
|
2757
|
+
}; // Within the body of any async function, `await x` is transformed to
|
|
2758
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
2759
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
2760
|
+
// meant to be awaited.
|
|
2761
|
+
|
|
2762
|
+
|
|
2763
|
+
exports.awrap = function (arg) {
|
|
2764
|
+
return {
|
|
2765
|
+
__await: arg
|
|
2766
|
+
};
|
|
2767
|
+
};
|
|
2768
|
+
|
|
2769
|
+
function AsyncIterator(generator) {
|
|
2770
|
+
function invoke(method, arg, resolve, reject) {
|
|
2771
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
2772
|
+
|
|
2773
|
+
if (record.type === "throw") {
|
|
2774
|
+
reject(record.arg);
|
|
2775
|
+
} else {
|
|
2776
|
+
var result = record.arg;
|
|
2777
|
+
var value = result.value;
|
|
2778
|
+
|
|
2779
|
+
if (value && _typeof$2(value) === "object" && hasOwn.call(value, "__await")) {
|
|
2780
|
+
return Promise.resolve(value.__await).then(function (value) {
|
|
2781
|
+
invoke("next", value, resolve, reject);
|
|
2782
|
+
}, function (err) {
|
|
2783
|
+
invoke("throw", err, resolve, reject);
|
|
2784
|
+
});
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
return Promise.resolve(value).then(function (unwrapped) {
|
|
2788
|
+
// When a yielded Promise is resolved, its final value becomes
|
|
2789
|
+
// the .value of the Promise<{value,done}> result for the
|
|
2790
|
+
// current iteration.
|
|
2791
|
+
result.value = unwrapped;
|
|
2792
|
+
resolve(result);
|
|
2793
|
+
}, function (error) {
|
|
2794
|
+
// If a rejected Promise was yielded, throw the rejection back
|
|
2795
|
+
// into the async generator function so it can be handled there.
|
|
2796
|
+
return invoke("throw", error, resolve, reject);
|
|
2797
|
+
});
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
var previousPromise;
|
|
2802
|
+
|
|
2803
|
+
function enqueue(method, arg) {
|
|
2804
|
+
function callInvokeWithMethodAndArg() {
|
|
2805
|
+
return new Promise(function (resolve, reject) {
|
|
2806
|
+
invoke(method, arg, resolve, reject);
|
|
2807
|
+
});
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
return previousPromise = // If enqueue has been called before, then we want to wait until
|
|
2811
|
+
// all previous Promises have been resolved before calling invoke,
|
|
2812
|
+
// so that results are always delivered in the correct order. If
|
|
2813
|
+
// enqueue has not been called before, then it is important to
|
|
2814
|
+
// call invoke immediately, without waiting on a callback to fire,
|
|
2815
|
+
// so that the async generator function has the opportunity to do
|
|
2816
|
+
// any necessary setup in a predictable way. This predictability
|
|
2817
|
+
// is why the Promise constructor synchronously invokes its
|
|
2818
|
+
// executor callback, and why async functions synchronously
|
|
2819
|
+
// execute code before the first await. Since we implement simple
|
|
2820
|
+
// async functions in terms of async generators, it is especially
|
|
2821
|
+
// important to get this right, even though it requires care.
|
|
2822
|
+
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
|
|
2823
|
+
// invocations of the iterator.
|
|
2824
|
+
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
2825
|
+
} // Define the unified helper method that is used to implement .next,
|
|
2826
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
2827
|
+
|
|
2828
|
+
|
|
2829
|
+
this._invoke = enqueue;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
|
2833
|
+
|
|
2834
|
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
2835
|
+
return this;
|
|
2836
|
+
};
|
|
2837
|
+
|
|
2838
|
+
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
|
|
2839
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
|
2840
|
+
// the final result produced by the iterator.
|
|
2841
|
+
|
|
2842
|
+
exports.async = function (innerFn, outerFn, self, tryLocsList) {
|
|
2843
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList));
|
|
2844
|
+
return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
|
|
2845
|
+
: iter.next().then(function (result) {
|
|
2846
|
+
return result.done ? result.value : iter.next();
|
|
2847
|
+
});
|
|
2848
|
+
};
|
|
2849
|
+
|
|
2850
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
2851
|
+
var state = GenStateSuspendedStart;
|
|
2852
|
+
return function invoke(method, arg) {
|
|
2853
|
+
if (state === GenStateExecuting) {
|
|
2854
|
+
throw new Error("Generator is already running");
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2857
|
+
if (state === GenStateCompleted) {
|
|
2858
|
+
if (method === "throw") {
|
|
2859
|
+
throw arg;
|
|
2860
|
+
} // Be forgiving, per 25.3.3.3.3 of the spec:
|
|
2861
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
2862
|
+
|
|
2863
|
+
|
|
2864
|
+
return doneResult();
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
context.method = method;
|
|
2868
|
+
context.arg = arg;
|
|
2869
|
+
|
|
2870
|
+
while (true) {
|
|
2871
|
+
var delegate = context.delegate;
|
|
2872
|
+
|
|
2873
|
+
if (delegate) {
|
|
2874
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
2875
|
+
|
|
2876
|
+
if (delegateResult) {
|
|
2877
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
2878
|
+
return delegateResult;
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
if (context.method === "next") {
|
|
2883
|
+
// Setting context._sent for legacy support of Babel's
|
|
2884
|
+
// function.sent implementation.
|
|
2885
|
+
context.sent = context._sent = context.arg;
|
|
2886
|
+
} else if (context.method === "throw") {
|
|
2887
|
+
if (state === GenStateSuspendedStart) {
|
|
2888
|
+
state = GenStateCompleted;
|
|
2889
|
+
throw context.arg;
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
context.dispatchException(context.arg);
|
|
2893
|
+
} else if (context.method === "return") {
|
|
2894
|
+
context.abrupt("return", context.arg);
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
state = GenStateExecuting;
|
|
2898
|
+
var record = tryCatch(innerFn, self, context);
|
|
2899
|
+
|
|
2900
|
+
if (record.type === "normal") {
|
|
2901
|
+
// If an exception is thrown from innerFn, we leave state ===
|
|
2902
|
+
// GenStateExecuting and loop back for another invocation.
|
|
2903
|
+
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
|
|
2904
|
+
|
|
2905
|
+
if (record.arg === ContinueSentinel) {
|
|
2906
|
+
continue;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
return {
|
|
2910
|
+
value: record.arg,
|
|
2911
|
+
done: context.done
|
|
2912
|
+
};
|
|
2913
|
+
} else if (record.type === "throw") {
|
|
2914
|
+
state = GenStateCompleted; // Dispatch the exception by looping back around to the
|
|
2915
|
+
// context.dispatchException(context.arg) call above.
|
|
2916
|
+
|
|
2917
|
+
context.method = "throw";
|
|
2918
|
+
context.arg = record.arg;
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
};
|
|
2922
|
+
} // Call delegate.iterator[context.method](context.arg) and handle the
|
|
2923
|
+
// result, either by returning a { value, done } result from the
|
|
2924
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
|
2925
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
2926
|
+
|
|
2927
|
+
|
|
2928
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
2929
|
+
var method = delegate.iterator[context.method];
|
|
2930
|
+
|
|
2931
|
+
if (method === undefined$1) {
|
|
2932
|
+
// A .throw or .return when the delegate iterator has no .throw
|
|
2933
|
+
// method always terminates the yield* loop.
|
|
2934
|
+
context.delegate = null;
|
|
2935
|
+
|
|
2936
|
+
if (context.method === "throw") {
|
|
2937
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
2938
|
+
if (delegate.iterator["return"]) {
|
|
2939
|
+
// If the delegate iterator has a return method, give it a
|
|
2940
|
+
// chance to clean up.
|
|
2941
|
+
context.method = "return";
|
|
2942
|
+
context.arg = undefined$1;
|
|
2943
|
+
maybeInvokeDelegate(delegate, context);
|
|
2944
|
+
|
|
2945
|
+
if (context.method === "throw") {
|
|
2946
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
|
2947
|
+
// "return" to "throw", let that override the TypeError below.
|
|
2948
|
+
return ContinueSentinel;
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
context.method = "throw";
|
|
2953
|
+
context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
return ContinueSentinel;
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
2960
|
+
|
|
2961
|
+
if (record.type === "throw") {
|
|
2962
|
+
context.method = "throw";
|
|
2963
|
+
context.arg = record.arg;
|
|
2964
|
+
context.delegate = null;
|
|
2965
|
+
return ContinueSentinel;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
var info = record.arg;
|
|
2969
|
+
|
|
2970
|
+
if (!info) {
|
|
2971
|
+
context.method = "throw";
|
|
2972
|
+
context.arg = new TypeError("iterator result is not an object");
|
|
2973
|
+
context.delegate = null;
|
|
2974
|
+
return ContinueSentinel;
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2977
|
+
if (info.done) {
|
|
2978
|
+
// Assign the result of the finished delegate to the temporary
|
|
2979
|
+
// variable specified by delegate.resultName (see delegateYield).
|
|
2980
|
+
context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
|
|
2981
|
+
|
|
2982
|
+
context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
|
|
2983
|
+
// exception, let the outer generator proceed normally. If
|
|
2984
|
+
// context.method was "next", forget context.arg since it has been
|
|
2985
|
+
// "consumed" by the delegate iterator. If context.method was
|
|
2986
|
+
// "return", allow the original .return call to continue in the
|
|
2987
|
+
// outer generator.
|
|
2988
|
+
|
|
2989
|
+
if (context.method !== "return") {
|
|
2990
|
+
context.method = "next";
|
|
2991
|
+
context.arg = undefined$1;
|
|
2992
|
+
}
|
|
2993
|
+
} else {
|
|
2994
|
+
// Re-yield the result returned by the delegate method.
|
|
2995
|
+
return info;
|
|
2996
|
+
} // The delegate iterator is finished, so forget it and continue with
|
|
2997
|
+
// the outer generator.
|
|
2998
|
+
|
|
2999
|
+
|
|
3000
|
+
context.delegate = null;
|
|
3001
|
+
return ContinueSentinel;
|
|
3002
|
+
} // Define Generator.prototype.{next,throw,return} in terms of the
|
|
3003
|
+
// unified ._invoke helper method.
|
|
3004
|
+
|
|
3005
|
+
|
|
3006
|
+
defineIteratorMethods(Gp);
|
|
3007
|
+
Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the
|
|
3008
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
|
3009
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
3010
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
|
3011
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
3012
|
+
|
|
3013
|
+
Gp[iteratorSymbol] = function () {
|
|
3014
|
+
return this;
|
|
3015
|
+
};
|
|
3016
|
+
|
|
3017
|
+
Gp.toString = function () {
|
|
3018
|
+
return "[object Generator]";
|
|
3019
|
+
};
|
|
3020
|
+
|
|
3021
|
+
function pushTryEntry(locs) {
|
|
3022
|
+
var entry = {
|
|
3023
|
+
tryLoc: locs[0]
|
|
3024
|
+
};
|
|
3025
|
+
|
|
3026
|
+
if (1 in locs) {
|
|
3027
|
+
entry.catchLoc = locs[1];
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
if (2 in locs) {
|
|
3031
|
+
entry.finallyLoc = locs[2];
|
|
3032
|
+
entry.afterLoc = locs[3];
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
this.tryEntries.push(entry);
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
function resetTryEntry(entry) {
|
|
3039
|
+
var record = entry.completion || {};
|
|
3040
|
+
record.type = "normal";
|
|
3041
|
+
delete record.arg;
|
|
3042
|
+
entry.completion = record;
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
function Context(tryLocsList) {
|
|
3046
|
+
// The root entry object (effectively a try statement without a catch
|
|
3047
|
+
// or a finally block) gives us a place to store values thrown from
|
|
3048
|
+
// locations where there is no enclosing try statement.
|
|
3049
|
+
this.tryEntries = [{
|
|
3050
|
+
tryLoc: "root"
|
|
3051
|
+
}];
|
|
3052
|
+
tryLocsList.forEach(pushTryEntry, this);
|
|
3053
|
+
this.reset(true);
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
exports.keys = function (object) {
|
|
3057
|
+
var keys = [];
|
|
3058
|
+
|
|
3059
|
+
for (var key in object) {
|
|
3060
|
+
keys.push(key);
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
keys.reverse(); // Rather than returning an object with a next method, we keep
|
|
3064
|
+
// things simple and return the next function itself.
|
|
3065
|
+
|
|
3066
|
+
return function next() {
|
|
3067
|
+
while (keys.length) {
|
|
3068
|
+
var key = keys.pop();
|
|
3069
|
+
|
|
3070
|
+
if (key in object) {
|
|
3071
|
+
next.value = key;
|
|
3072
|
+
next.done = false;
|
|
3073
|
+
return next;
|
|
3074
|
+
}
|
|
3075
|
+
} // To avoid creating an additional object, we just hang the .value
|
|
3076
|
+
// and .done properties off the next function object itself. This
|
|
3077
|
+
// also ensures that the minifier will not anonymize the function.
|
|
3078
|
+
|
|
3079
|
+
|
|
3080
|
+
next.done = true;
|
|
3081
|
+
return next;
|
|
3082
|
+
};
|
|
3083
|
+
};
|
|
3084
|
+
|
|
3085
|
+
function values(iterable) {
|
|
3086
|
+
if (iterable) {
|
|
3087
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
3088
|
+
|
|
3089
|
+
if (iteratorMethod) {
|
|
3090
|
+
return iteratorMethod.call(iterable);
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
if (typeof iterable.next === "function") {
|
|
3094
|
+
return iterable;
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
if (!isNaN(iterable.length)) {
|
|
3098
|
+
var i = -1,
|
|
3099
|
+
next = function next() {
|
|
3100
|
+
while (++i < iterable.length) {
|
|
3101
|
+
if (hasOwn.call(iterable, i)) {
|
|
3102
|
+
next.value = iterable[i];
|
|
3103
|
+
next.done = false;
|
|
3104
|
+
return next;
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
|
|
3108
|
+
next.value = undefined$1;
|
|
3109
|
+
next.done = true;
|
|
3110
|
+
return next;
|
|
3111
|
+
};
|
|
3112
|
+
|
|
3113
|
+
return next.next = next;
|
|
3114
|
+
}
|
|
3115
|
+
} // Return an iterator with no values.
|
|
3116
|
+
|
|
3117
|
+
|
|
3118
|
+
return {
|
|
3119
|
+
next: doneResult
|
|
3120
|
+
};
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
exports.values = values;
|
|
3124
|
+
|
|
3125
|
+
function doneResult() {
|
|
3126
|
+
return {
|
|
3127
|
+
value: undefined$1,
|
|
3128
|
+
done: true
|
|
3129
|
+
};
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
Context.prototype = {
|
|
3133
|
+
constructor: Context,
|
|
3134
|
+
reset: function reset(skipTempReset) {
|
|
3135
|
+
this.prev = 0;
|
|
3136
|
+
this.next = 0; // Resetting context._sent for legacy support of Babel's
|
|
3137
|
+
// function.sent implementation.
|
|
3138
|
+
|
|
3139
|
+
this.sent = this._sent = undefined$1;
|
|
3140
|
+
this.done = false;
|
|
3141
|
+
this.delegate = null;
|
|
3142
|
+
this.method = "next";
|
|
3143
|
+
this.arg = undefined$1;
|
|
3144
|
+
this.tryEntries.forEach(resetTryEntry);
|
|
3145
|
+
|
|
3146
|
+
if (!skipTempReset) {
|
|
3147
|
+
for (var name in this) {
|
|
3148
|
+
// Not sure about the optimal order of these conditions:
|
|
3149
|
+
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
|
|
3150
|
+
this[name] = undefined$1;
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
}
|
|
3154
|
+
},
|
|
3155
|
+
stop: function stop() {
|
|
3156
|
+
this.done = true;
|
|
3157
|
+
var rootEntry = this.tryEntries[0];
|
|
3158
|
+
var rootRecord = rootEntry.completion;
|
|
3159
|
+
|
|
3160
|
+
if (rootRecord.type === "throw") {
|
|
3161
|
+
throw rootRecord.arg;
|
|
3162
|
+
}
|
|
3163
|
+
|
|
3164
|
+
return this.rval;
|
|
3165
|
+
},
|
|
3166
|
+
dispatchException: function dispatchException(exception) {
|
|
3167
|
+
if (this.done) {
|
|
3168
|
+
throw exception;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
var context = this;
|
|
3172
|
+
|
|
3173
|
+
function handle(loc, caught) {
|
|
3174
|
+
record.type = "throw";
|
|
3175
|
+
record.arg = exception;
|
|
3176
|
+
context.next = loc;
|
|
3177
|
+
|
|
3178
|
+
if (caught) {
|
|
3179
|
+
// If the dispatched exception was caught by a catch block,
|
|
3180
|
+
// then let that catch block handle the exception normally.
|
|
3181
|
+
context.method = "next";
|
|
3182
|
+
context.arg = undefined$1;
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
return !!caught;
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3188
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3189
|
+
var entry = this.tryEntries[i];
|
|
3190
|
+
var record = entry.completion;
|
|
3191
|
+
|
|
3192
|
+
if (entry.tryLoc === "root") {
|
|
3193
|
+
// Exception thrown outside of any try block that could handle
|
|
3194
|
+
// it, so set the completion value of the entire function to
|
|
3195
|
+
// throw the exception.
|
|
3196
|
+
return handle("end");
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
if (entry.tryLoc <= this.prev) {
|
|
3200
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
3201
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
3202
|
+
|
|
3203
|
+
if (hasCatch && hasFinally) {
|
|
3204
|
+
if (this.prev < entry.catchLoc) {
|
|
3205
|
+
return handle(entry.catchLoc, true);
|
|
3206
|
+
} else if (this.prev < entry.finallyLoc) {
|
|
3207
|
+
return handle(entry.finallyLoc);
|
|
3208
|
+
}
|
|
3209
|
+
} else if (hasCatch) {
|
|
3210
|
+
if (this.prev < entry.catchLoc) {
|
|
3211
|
+
return handle(entry.catchLoc, true);
|
|
3212
|
+
}
|
|
3213
|
+
} else if (hasFinally) {
|
|
3214
|
+
if (this.prev < entry.finallyLoc) {
|
|
3215
|
+
return handle(entry.finallyLoc);
|
|
3216
|
+
}
|
|
3217
|
+
} else {
|
|
3218
|
+
throw new Error("try statement without catch or finally");
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
},
|
|
3223
|
+
abrupt: function abrupt(type, arg) {
|
|
3224
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3225
|
+
var entry = this.tryEntries[i];
|
|
3226
|
+
|
|
3227
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
3228
|
+
var finallyEntry = entry;
|
|
3229
|
+
break;
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
|
|
3234
|
+
// Ignore the finally entry if control is not jumping to a
|
|
3235
|
+
// location outside the try/catch block.
|
|
3236
|
+
finallyEntry = null;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
3240
|
+
record.type = type;
|
|
3241
|
+
record.arg = arg;
|
|
3242
|
+
|
|
3243
|
+
if (finallyEntry) {
|
|
3244
|
+
this.method = "next";
|
|
3245
|
+
this.next = finallyEntry.finallyLoc;
|
|
3246
|
+
return ContinueSentinel;
|
|
3247
|
+
}
|
|
3248
|
+
|
|
3249
|
+
return this.complete(record);
|
|
3250
|
+
},
|
|
3251
|
+
complete: function complete(record, afterLoc) {
|
|
3252
|
+
if (record.type === "throw") {
|
|
3253
|
+
throw record.arg;
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3256
|
+
if (record.type === "break" || record.type === "continue") {
|
|
3257
|
+
this.next = record.arg;
|
|
3258
|
+
} else if (record.type === "return") {
|
|
3259
|
+
this.rval = this.arg = record.arg;
|
|
3260
|
+
this.method = "return";
|
|
3261
|
+
this.next = "end";
|
|
3262
|
+
} else if (record.type === "normal" && afterLoc) {
|
|
3263
|
+
this.next = afterLoc;
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
return ContinueSentinel;
|
|
3267
|
+
},
|
|
3268
|
+
finish: function finish(finallyLoc) {
|
|
3269
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3270
|
+
var entry = this.tryEntries[i];
|
|
3271
|
+
|
|
3272
|
+
if (entry.finallyLoc === finallyLoc) {
|
|
3273
|
+
this.complete(entry.completion, entry.afterLoc);
|
|
3274
|
+
resetTryEntry(entry);
|
|
3275
|
+
return ContinueSentinel;
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
},
|
|
3279
|
+
"catch": function _catch(tryLoc) {
|
|
3280
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
3281
|
+
var entry = this.tryEntries[i];
|
|
3282
|
+
|
|
3283
|
+
if (entry.tryLoc === tryLoc) {
|
|
3284
|
+
var record = entry.completion;
|
|
3285
|
+
|
|
3286
|
+
if (record.type === "throw") {
|
|
3287
|
+
var thrown = record.arg;
|
|
3288
|
+
resetTryEntry(entry);
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
return thrown;
|
|
3292
|
+
}
|
|
3293
|
+
} // The context.catch method must only be called with a location
|
|
3294
|
+
// argument that corresponds to a known catch block.
|
|
3295
|
+
|
|
3296
|
+
|
|
3297
|
+
throw new Error("illegal catch attempt");
|
|
3298
|
+
},
|
|
3299
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
3300
|
+
this.delegate = {
|
|
3301
|
+
iterator: values(iterable),
|
|
3302
|
+
resultName: resultName,
|
|
3303
|
+
nextLoc: nextLoc
|
|
3304
|
+
};
|
|
3305
|
+
|
|
3306
|
+
if (this.method === "next") {
|
|
3307
|
+
// Deliberately forget the last sent value so that we don't
|
|
3308
|
+
// accidentally pass it on to the delegate.
|
|
3309
|
+
this.arg = undefined$1;
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
return ContinueSentinel;
|
|
3313
|
+
}
|
|
3314
|
+
}; // Regardless of whether this script is executing as a CommonJS module
|
|
3315
|
+
// or not, return the runtime object so that we can declare the variable
|
|
3316
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
3317
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
3318
|
+
|
|
3319
|
+
return exports;
|
|
3320
|
+
}( // If this script is executing as a CommonJS module, use module.exports
|
|
3321
|
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
3322
|
+
// object. Either way, the resulting object will be used to initialize
|
|
3323
|
+
// the regeneratorRuntime variable at the top of this file.
|
|
3324
|
+
module.exports );
|
|
3325
|
+
|
|
3326
|
+
try {
|
|
3327
|
+
regeneratorRuntime = runtime;
|
|
3328
|
+
} catch (accidentalStrictMode) {
|
|
3329
|
+
// This module should not be running in strict mode, so the above
|
|
3330
|
+
// assignment should always work unless something is misconfigured. Just
|
|
3331
|
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
|
3332
|
+
// strict mode using a global Function call. This could conceivably fail
|
|
3333
|
+
// if a Content Security Policy forbids using Function, but in that case
|
|
3334
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
|
3335
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
|
3336
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
|
3337
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
|
3338
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
3339
|
+
}
|
|
3340
|
+
})(runtime);
|
|
3341
|
+
|
|
3342
|
+
var regenerator = runtime.exports;
|
|
3343
|
+
|
|
3344
|
+
function _extends$1() {
|
|
3345
|
+
_extends_1 = _extends$1 = Object.assign || function (target) {
|
|
3346
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3347
|
+
var source = arguments[i];
|
|
3348
|
+
|
|
3349
|
+
for (var key in source) {
|
|
3350
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3351
|
+
target[key] = source[key];
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
return target;
|
|
3357
|
+
};
|
|
3358
|
+
|
|
3359
|
+
return _extends$1.apply(this, arguments);
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
var _extends_1 = _extends$1;
|
|
3363
|
+
|
|
3364
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3365
|
+
if (source == null) return {};
|
|
3366
|
+
var target = {};
|
|
3367
|
+
var sourceKeys = Object.keys(source);
|
|
3368
|
+
var key, i;
|
|
3369
|
+
|
|
3370
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
3371
|
+
key = sourceKeys[i];
|
|
3372
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3373
|
+
target[key] = source[key];
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
return target;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
var objectWithoutPropertiesLoose$1 = _objectWithoutPropertiesLoose;
|
|
3380
|
+
|
|
3381
|
+
var objectWithoutPropertiesLoose = objectWithoutPropertiesLoose$1;
|
|
3382
|
+
|
|
3383
|
+
function _objectWithoutProperties(source, excluded) {
|
|
3384
|
+
if (source == null) return {};
|
|
3385
|
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
3386
|
+
var key, i;
|
|
3387
|
+
|
|
3388
|
+
if (Object.getOwnPropertySymbols) {
|
|
3389
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
3390
|
+
|
|
3391
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
3392
|
+
key = sourceSymbolKeys[i];
|
|
3393
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3394
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
3395
|
+
target[key] = source[key];
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
return target;
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
var objectWithoutProperties = _objectWithoutProperties;
|
|
3403
|
+
|
|
3404
|
+
function _classCallCheck(instance, Constructor) {
|
|
3405
|
+
if (!(instance instanceof Constructor)) {
|
|
3406
|
+
throw new TypeError("Cannot call a class as a function");
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
var classCallCheck = _classCallCheck;
|
|
3411
|
+
|
|
3412
|
+
function _defineProperties(target, props) {
|
|
3413
|
+
for (var i = 0; i < props.length; i++) {
|
|
3414
|
+
var descriptor = props[i];
|
|
3415
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
3416
|
+
descriptor.configurable = true;
|
|
3417
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
3418
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
3423
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
3424
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
3425
|
+
return Constructor;
|
|
3426
|
+
}
|
|
3427
|
+
|
|
3428
|
+
var createClass = _createClass;
|
|
3429
|
+
|
|
3430
|
+
function _typeof2(obj) {
|
|
3431
|
+
if (typeof Symbol === "function" && _typeof$2(Symbol.iterator) === "symbol") {
|
|
3432
|
+
_typeof2 = function _typeof2(obj) {
|
|
3433
|
+
return _typeof$2(obj);
|
|
3434
|
+
};
|
|
3435
|
+
} else {
|
|
3436
|
+
_typeof2 = function _typeof2(obj) {
|
|
3437
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof$2(obj);
|
|
3438
|
+
};
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3441
|
+
return _typeof2(obj);
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3444
|
+
function _typeof$1(obj) {
|
|
3445
|
+
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
|
|
3446
|
+
_typeof_1 = _typeof$1 = function _typeof(obj) {
|
|
3447
|
+
return _typeof2(obj);
|
|
3448
|
+
};
|
|
3449
|
+
} else {
|
|
3450
|
+
_typeof_1 = _typeof$1 = function _typeof(obj) {
|
|
3451
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
|
|
3452
|
+
};
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
return _typeof$1(obj);
|
|
3456
|
+
}
|
|
3457
|
+
|
|
3458
|
+
var _typeof_1 = _typeof$1;
|
|
3459
|
+
|
|
3460
|
+
function _assertThisInitialized(self) {
|
|
3461
|
+
if (self === void 0) {
|
|
3462
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3465
|
+
return self;
|
|
3466
|
+
}
|
|
3467
|
+
|
|
3468
|
+
var assertThisInitialized$1 = _assertThisInitialized;
|
|
3469
|
+
|
|
3470
|
+
var _typeof = _typeof_1;
|
|
3471
|
+
var assertThisInitialized = assertThisInitialized$1;
|
|
3472
|
+
|
|
3473
|
+
function _possibleConstructorReturn(self, call) {
|
|
3474
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
3475
|
+
return call;
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
return assertThisInitialized(self);
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
var possibleConstructorReturn = _possibleConstructorReturn;
|
|
3482
|
+
|
|
3483
|
+
function _getPrototypeOf(o) {
|
|
3484
|
+
getPrototypeOf = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
3485
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
3486
|
+
};
|
|
3487
|
+
return _getPrototypeOf(o);
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3490
|
+
var getPrototypeOf = _getPrototypeOf;
|
|
3491
|
+
|
|
3492
|
+
function _setPrototypeOf(o, p) {
|
|
3493
|
+
setPrototypeOf$1 = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
3494
|
+
o.__proto__ = p;
|
|
3495
|
+
return o;
|
|
3496
|
+
};
|
|
3497
|
+
|
|
3498
|
+
return _setPrototypeOf(o, p);
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
var setPrototypeOf$1 = _setPrototypeOf;
|
|
3502
|
+
|
|
3503
|
+
var setPrototypeOf = setPrototypeOf$1;
|
|
3504
|
+
|
|
3505
|
+
function _inherits(subClass, superClass) {
|
|
3506
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
3507
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
3511
|
+
constructor: {
|
|
3512
|
+
value: subClass,
|
|
3513
|
+
writable: true,
|
|
3514
|
+
configurable: true
|
|
3515
|
+
}
|
|
3516
|
+
});
|
|
3517
|
+
if (superClass) setPrototypeOf(subClass, superClass);
|
|
3518
|
+
}
|
|
3519
|
+
|
|
3520
|
+
var inherits = _inherits;
|
|
3521
|
+
|
|
3522
|
+
var propTypes = {exports: {}};
|
|
3523
|
+
|
|
3524
|
+
/**
|
|
3525
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3526
|
+
*
|
|
3527
|
+
* This source code is licensed under the MIT license found in the
|
|
3528
|
+
* LICENSE file in the root directory of this source tree.
|
|
3529
|
+
*/
|
|
3530
|
+
|
|
3531
|
+
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
3532
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
3533
|
+
|
|
3534
|
+
/**
|
|
3535
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3536
|
+
*
|
|
3537
|
+
* This source code is licensed under the MIT license found in the
|
|
3538
|
+
* LICENSE file in the root directory of this source tree.
|
|
3539
|
+
*/
|
|
3540
|
+
|
|
3541
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
3542
|
+
|
|
3543
|
+
function emptyFunction() {}
|
|
3544
|
+
|
|
3545
|
+
function emptyFunctionWithReset() {}
|
|
3546
|
+
|
|
3547
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3548
|
+
|
|
3549
|
+
var factoryWithThrowingShims = function factoryWithThrowingShims() {
|
|
3550
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
3551
|
+
if (secret === ReactPropTypesSecret) {
|
|
3552
|
+
// It is still safe when called from React.
|
|
3553
|
+
return;
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
3557
|
+
err.name = 'Invariant Violation';
|
|
3558
|
+
throw err;
|
|
3559
|
+
}
|
|
3560
|
+
shim.isRequired = shim;
|
|
3561
|
+
|
|
3562
|
+
function getShim() {
|
|
3563
|
+
return shim;
|
|
3564
|
+
}
|
|
3565
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
3566
|
+
|
|
3567
|
+
var ReactPropTypes = {
|
|
3568
|
+
array: shim,
|
|
3569
|
+
bool: shim,
|
|
3570
|
+
func: shim,
|
|
3571
|
+
number: shim,
|
|
3572
|
+
object: shim,
|
|
3573
|
+
string: shim,
|
|
3574
|
+
symbol: shim,
|
|
3575
|
+
any: shim,
|
|
3576
|
+
arrayOf: getShim,
|
|
3577
|
+
element: shim,
|
|
3578
|
+
elementType: shim,
|
|
3579
|
+
instanceOf: getShim,
|
|
3580
|
+
node: shim,
|
|
3581
|
+
objectOf: getShim,
|
|
3582
|
+
oneOf: getShim,
|
|
3583
|
+
oneOfType: getShim,
|
|
3584
|
+
shape: getShim,
|
|
3585
|
+
exact: getShim,
|
|
3586
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
3587
|
+
resetWarningCache: emptyFunction
|
|
3588
|
+
};
|
|
3589
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3590
|
+
return ReactPropTypes;
|
|
3591
|
+
};
|
|
3592
|
+
|
|
3593
|
+
/**
|
|
3594
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3595
|
+
*
|
|
3596
|
+
* This source code is licensed under the MIT license found in the
|
|
3597
|
+
* LICENSE file in the root directory of this source tree.
|
|
3598
|
+
*/
|
|
3599
|
+
|
|
3600
|
+
{
|
|
3601
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
3602
|
+
// http://fb.me/prop-types-in-prod
|
|
3603
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
var ensureNativeModuleAvailable$1 = {};
|
|
3607
|
+
|
|
3608
|
+
Object.defineProperty(ensureNativeModuleAvailable$1, "__esModule", {
|
|
3609
|
+
value: true
|
|
3610
|
+
});
|
|
3611
|
+
|
|
3612
|
+
ensureNativeModuleAvailable$1["default"] = ensureNativeModuleAvailable;
|
|
3613
|
+
|
|
3614
|
+
var _reactNative$2 = ReactNative__default;
|
|
3615
|
+
var NativeIconAPI$1 = _reactNative$2.NativeModules.RNVectorIconsManager || _reactNative$2.NativeModules.RNVectorIconsModule;
|
|
3616
|
+
|
|
3617
|
+
function ensureNativeModuleAvailable() {
|
|
3618
|
+
if (!NativeIconAPI$1) {
|
|
3619
|
+
if (_reactNative$2.Platform.OS === 'android') {
|
|
3620
|
+
throw new Error('RNVectorIconsModule not available, did you properly integrate the module? Try running `react-native link react-native-vector-icons` and recompiling.');
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
throw new Error('RNVectorIconsManager not available, did you add the library to your project and link with libRNVectorIcons.a? Try running `react-native link react-native-vector-icons` and recompiling.');
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3627
|
+
var createIconSourceCache$1 = {};
|
|
3628
|
+
|
|
3629
|
+
Object.defineProperty(createIconSourceCache$1, "__esModule", {
|
|
3630
|
+
value: true
|
|
3631
|
+
});
|
|
3632
|
+
|
|
3633
|
+
createIconSourceCache$1["default"] = createIconSourceCache;
|
|
3634
|
+
|
|
3635
|
+
var TYPE_VALUE = 'value';
|
|
3636
|
+
var TYPE_ERROR = 'error';
|
|
3637
|
+
|
|
3638
|
+
function createIconSourceCache() {
|
|
3639
|
+
var cache = new Map();
|
|
3640
|
+
|
|
3641
|
+
var setValue = function setValue(key, value) {
|
|
3642
|
+
return cache.set(key, {
|
|
3643
|
+
type: TYPE_VALUE,
|
|
3644
|
+
data: value
|
|
3645
|
+
});
|
|
3646
|
+
};
|
|
3647
|
+
|
|
3648
|
+
var setError = function setError(key, error) {
|
|
3649
|
+
return cache.set(key, {
|
|
3650
|
+
type: TYPE_ERROR,
|
|
3651
|
+
data: error
|
|
3652
|
+
});
|
|
3653
|
+
};
|
|
3654
|
+
|
|
3655
|
+
var has = function has(key) {
|
|
3656
|
+
return cache.has(key);
|
|
3657
|
+
};
|
|
3658
|
+
|
|
3659
|
+
var get = function get(key) {
|
|
3660
|
+
if (!cache.has(key)) {
|
|
3661
|
+
return undefined;
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
var _cache$get = cache.get(key),
|
|
3665
|
+
type = _cache$get.type,
|
|
3666
|
+
data = _cache$get.data;
|
|
3667
|
+
|
|
3668
|
+
if (type === TYPE_ERROR) {
|
|
3669
|
+
throw data;
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3672
|
+
return data;
|
|
3673
|
+
};
|
|
3674
|
+
|
|
3675
|
+
return {
|
|
3676
|
+
setValue: setValue,
|
|
3677
|
+
setError: setError,
|
|
3678
|
+
has: has,
|
|
3679
|
+
get: get
|
|
3680
|
+
};
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
var iconButton = {};
|
|
3684
|
+
|
|
3685
|
+
var pick = function pick(obj) {
|
|
3686
|
+
for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
3687
|
+
keys[_key - 1] = arguments[_key];
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
return keys.flat().filter(function (key) {
|
|
3691
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
3692
|
+
}).reduce(function (acc, key) {
|
|
3693
|
+
acc[key] = obj[key];
|
|
3694
|
+
return acc;
|
|
3695
|
+
}, {});
|
|
3696
|
+
};
|
|
3697
|
+
|
|
3698
|
+
var omit = function omit(obj) {
|
|
3699
|
+
for (var _len2 = arguments.length, keysToOmit = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
3700
|
+
keysToOmit[_key2 - 1] = arguments[_key2];
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
var keysToOmitSet = new Set(keysToOmit.flat());
|
|
3704
|
+
return Object.getOwnPropertyNames(obj).filter(function (key) {
|
|
3705
|
+
return !keysToOmitSet.has(key);
|
|
3706
|
+
}).reduce(function (acc, key) {
|
|
3707
|
+
acc[key] = obj[key];
|
|
3708
|
+
return acc;
|
|
3709
|
+
}, {});
|
|
3710
|
+
};
|
|
3711
|
+
|
|
3712
|
+
var objectUtils = {
|
|
3713
|
+
pick: pick,
|
|
3714
|
+
omit: omit
|
|
3715
|
+
};
|
|
3716
|
+
|
|
3717
|
+
var _interopRequireDefault$4 = interopRequireDefault;
|
|
3718
|
+
Object.defineProperty(iconButton, "__esModule", {
|
|
3719
|
+
value: true
|
|
3720
|
+
});
|
|
3721
|
+
|
|
3722
|
+
iconButton["default"] = createIconButtonComponent;
|
|
3723
|
+
|
|
3724
|
+
var _extends2$2 = _interopRequireDefault$4(_extends_1);
|
|
3725
|
+
|
|
3726
|
+
var _objectWithoutProperties2$1 = _interopRequireDefault$4(objectWithoutProperties);
|
|
3727
|
+
|
|
3728
|
+
var _classCallCheck2$2 = _interopRequireDefault$4(classCallCheck);
|
|
3729
|
+
|
|
3730
|
+
var _createClass2$2 = _interopRequireDefault$4(createClass);
|
|
3731
|
+
|
|
3732
|
+
var _possibleConstructorReturn2$2 = _interopRequireDefault$4(possibleConstructorReturn);
|
|
3733
|
+
|
|
3734
|
+
var _getPrototypeOf2$1 = _interopRequireDefault$4(getPrototypeOf);
|
|
3735
|
+
|
|
3736
|
+
var _inherits2$2 = _interopRequireDefault$4(inherits);
|
|
3737
|
+
|
|
3738
|
+
var _react$2 = _interopRequireWildcard$2(React);
|
|
3739
|
+
|
|
3740
|
+
var _propTypes$2 = _interopRequireDefault$4(propTypes.exports);
|
|
3741
|
+
|
|
3742
|
+
var _reactNative$1 = ReactNative__default;
|
|
3743
|
+
var _objectUtils = objectUtils;
|
|
3744
|
+
var _jsxFileName$2 = "/home/runner/work/react-native-vector-icons/react-native-vector-icons/lib/icon-button.js";
|
|
3745
|
+
|
|
3746
|
+
function _getRequireWildcardCache$2(nodeInterop) {
|
|
3747
|
+
if (typeof WeakMap !== "function") return null;
|
|
3748
|
+
var cacheBabelInterop = new WeakMap();
|
|
3749
|
+
var cacheNodeInterop = new WeakMap();
|
|
3750
|
+
return (_getRequireWildcardCache$2 = function _getRequireWildcardCache(nodeInterop) {
|
|
3751
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
3752
|
+
})(nodeInterop);
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
function _interopRequireWildcard$2(obj, nodeInterop) {
|
|
3756
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
3757
|
+
return obj;
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
if (obj === null || _typeof$2(obj) !== "object" && typeof obj !== "function") {
|
|
3761
|
+
return {
|
|
3762
|
+
"default": obj
|
|
3763
|
+
};
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
var cache = _getRequireWildcardCache$2(nodeInterop);
|
|
3767
|
+
|
|
3768
|
+
if (cache && cache.has(obj)) {
|
|
3769
|
+
return cache.get(obj);
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
var newObj = {};
|
|
3773
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
3774
|
+
|
|
3775
|
+
for (var key in obj) {
|
|
3776
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
3777
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
3778
|
+
|
|
3779
|
+
if (desc && (desc.get || desc.set)) {
|
|
3780
|
+
Object.defineProperty(newObj, key, desc);
|
|
3781
|
+
} else {
|
|
3782
|
+
newObj[key] = obj[key];
|
|
3783
|
+
}
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
newObj["default"] = obj;
|
|
3788
|
+
|
|
3789
|
+
if (cache) {
|
|
3790
|
+
cache.set(obj, newObj);
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3793
|
+
return newObj;
|
|
3794
|
+
}
|
|
3795
|
+
|
|
3796
|
+
var styles$1 = _reactNative$1.StyleSheet.create({
|
|
3797
|
+
container: {
|
|
3798
|
+
flexDirection: 'row',
|
|
3799
|
+
justifyContent: 'flex-start',
|
|
3800
|
+
alignItems: 'center',
|
|
3801
|
+
padding: 8
|
|
3802
|
+
},
|
|
3803
|
+
touchable: {
|
|
3804
|
+
overflow: 'hidden'
|
|
3805
|
+
},
|
|
3806
|
+
icon: {
|
|
3807
|
+
marginRight: 10
|
|
3808
|
+
},
|
|
3809
|
+
text: {
|
|
3810
|
+
fontWeight: '600',
|
|
3811
|
+
backgroundColor: 'transparent'
|
|
3812
|
+
}
|
|
3813
|
+
});
|
|
3814
|
+
|
|
3815
|
+
var IOS7_BLUE = '#007AFF';
|
|
3816
|
+
var TEXT_PROP_NAMES = ['ellipsizeMode', 'numberOfLines', 'textBreakStrategy', 'selectable', 'suppressHighlighting', 'allowFontScaling', 'adjustsFontSizeToFit', 'minimumFontScale'];
|
|
3817
|
+
var TOUCHABLE_PROP_NAMES = ['accessible', 'accessibilityLabel', 'accessibilityHint', 'accessibilityComponentType', 'accessibilityRole', 'accessibilityStates', 'accessibilityTraits', 'onFocus', 'onBlur', 'disabled', 'onPress', 'onPressIn', 'onPressOut', 'onLayout', 'onLongPress', 'nativeID', 'testID', 'delayPressIn', 'delayPressOut', 'delayLongPress', 'activeOpacity', 'underlayColor', 'selectionColor', 'onShowUnderlay', 'onHideUnderlay', 'hasTVPreferredFocus', 'tvParallaxProperties'];
|
|
3818
|
+
|
|
3819
|
+
function createIconButtonComponent(Icon) {
|
|
3820
|
+
var _class, _temp;
|
|
3821
|
+
|
|
3822
|
+
return _temp = _class = function (_PureComponent) {
|
|
3823
|
+
(0, _inherits2$2["default"])(IconButton, _PureComponent);
|
|
3824
|
+
|
|
3825
|
+
function IconButton() {
|
|
3826
|
+
(0, _classCallCheck2$2["default"])(this, IconButton);
|
|
3827
|
+
return (0, _possibleConstructorReturn2$2["default"])(this, (0, _getPrototypeOf2$1["default"])(IconButton).apply(this, arguments));
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
(0, _createClass2$2["default"])(IconButton, [{
|
|
3831
|
+
key: "render",
|
|
3832
|
+
value: function render() {
|
|
3833
|
+
var _this$props = this.props,
|
|
3834
|
+
style = _this$props.style,
|
|
3835
|
+
iconStyle = _this$props.iconStyle,
|
|
3836
|
+
children = _this$props.children,
|
|
3837
|
+
restProps = (0, _objectWithoutProperties2$1["default"])(_this$props, ["style", "iconStyle", "children"]);
|
|
3838
|
+
var iconProps = (0, _objectUtils.pick)(restProps, TEXT_PROP_NAMES, 'style', 'name', 'size', 'color');
|
|
3839
|
+
var touchableProps = (0, _objectUtils.pick)(restProps, TOUCHABLE_PROP_NAMES);
|
|
3840
|
+
var props = (0, _objectUtils.omit)(restProps, Object.keys(iconProps), Object.keys(touchableProps), 'iconStyle', 'borderRadius', 'backgroundColor');
|
|
3841
|
+
iconProps.style = iconStyle ? [styles$1.icon, iconStyle] : styles$1.icon;
|
|
3842
|
+
var colorStyle = (0, _objectUtils.pick)(this.props, 'color');
|
|
3843
|
+
var blockStyle = (0, _objectUtils.pick)(this.props, 'backgroundColor', 'borderRadius');
|
|
3844
|
+
return _react$2["default"].createElement(_reactNative$1.TouchableHighlight, (0, _extends2$2["default"])({
|
|
3845
|
+
style: [styles$1.touchable, blockStyle]
|
|
3846
|
+
}, touchableProps, {
|
|
3847
|
+
__self: this,
|
|
3848
|
+
__source: {
|
|
3849
|
+
fileName: _jsxFileName$2,
|
|
3850
|
+
lineNumber: 116
|
|
3851
|
+
}
|
|
3852
|
+
}), _react$2["default"].createElement(_reactNative$1.View, (0, _extends2$2["default"])({
|
|
3853
|
+
style: [styles$1.container, blockStyle, style]
|
|
3854
|
+
}, props, {
|
|
3855
|
+
__self: this,
|
|
3856
|
+
__source: {
|
|
3857
|
+
fileName: _jsxFileName$2,
|
|
3858
|
+
lineNumber: 120
|
|
3859
|
+
}
|
|
3860
|
+
}), _react$2["default"].createElement(Icon, (0, _extends2$2["default"])({}, iconProps, {
|
|
3861
|
+
__self: this,
|
|
3862
|
+
__source: {
|
|
3863
|
+
fileName: _jsxFileName$2,
|
|
3864
|
+
lineNumber: 121
|
|
3865
|
+
}
|
|
3866
|
+
})), typeof children === 'string' ? _react$2["default"].createElement(_reactNative$1.Text, {
|
|
3867
|
+
style: [styles$1.text, colorStyle],
|
|
3868
|
+
selectable: false,
|
|
3869
|
+
__self: this,
|
|
3870
|
+
__source: {
|
|
3871
|
+
fileName: _jsxFileName$2,
|
|
3872
|
+
lineNumber: 123
|
|
3873
|
+
}
|
|
3874
|
+
}, children) : children));
|
|
3875
|
+
}
|
|
3876
|
+
}]);
|
|
3877
|
+
return IconButton;
|
|
3878
|
+
}(_react$2.PureComponent), _class.propTypes = {
|
|
3879
|
+
backgroundColor: _propTypes$2["default"].oneOfType([_propTypes$2["default"].string, _propTypes$2["default"].number]),
|
|
3880
|
+
borderRadius: _propTypes$2["default"].number,
|
|
3881
|
+
color: _propTypes$2["default"].any,
|
|
3882
|
+
size: _propTypes$2["default"].number,
|
|
3883
|
+
iconStyle: _propTypes$2["default"].any,
|
|
3884
|
+
style: _propTypes$2["default"].any,
|
|
3885
|
+
children: _propTypes$2["default"].node
|
|
3886
|
+
}, _class.defaultProps = {
|
|
3887
|
+
backgroundColor: IOS7_BLUE,
|
|
3888
|
+
borderRadius: 5,
|
|
3889
|
+
color: 'white',
|
|
3890
|
+
size: 20
|
|
3891
|
+
}, _temp;
|
|
3892
|
+
}
|
|
3893
|
+
|
|
3894
|
+
var _interopRequireDefault$3 = interopRequireDefault;
|
|
3895
|
+
Object.defineProperty(createIconSet$1, "__esModule", {
|
|
3896
|
+
value: true
|
|
3897
|
+
});
|
|
3898
|
+
createIconSet$1.NativeIconAPI = createIconSet$1.DEFAULT_ICON_SIZE = createIconSet$1.DEFAULT_ICON_COLOR = void 0;
|
|
3899
|
+
|
|
3900
|
+
createIconSet$1["default"] = createIconSet;
|
|
3901
|
+
|
|
3902
|
+
var _toConsumableArray2 = _interopRequireDefault$3(toConsumableArray);
|
|
3903
|
+
|
|
3904
|
+
var _regenerator = _interopRequireDefault$3(regenerator);
|
|
3905
|
+
|
|
3906
|
+
var _extends2$1 = _interopRequireDefault$3(_extends_1);
|
|
3907
|
+
|
|
3908
|
+
var _objectWithoutProperties2 = _interopRequireDefault$3(objectWithoutProperties);
|
|
3909
|
+
|
|
3910
|
+
var _classCallCheck2$1 = _interopRequireDefault$3(classCallCheck);
|
|
3911
|
+
|
|
3912
|
+
var _createClass2$1 = _interopRequireDefault$3(createClass);
|
|
3913
|
+
|
|
3914
|
+
var _possibleConstructorReturn2$1 = _interopRequireDefault$3(possibleConstructorReturn);
|
|
3915
|
+
|
|
3916
|
+
var _getPrototypeOf3 = _interopRequireDefault$3(getPrototypeOf);
|
|
3917
|
+
|
|
3918
|
+
var _inherits2$1 = _interopRequireDefault$3(inherits);
|
|
3919
|
+
|
|
3920
|
+
var _react$1 = _interopRequireWildcard$1(React);
|
|
3921
|
+
|
|
3922
|
+
var _propTypes$1 = _interopRequireDefault$3(propTypes.exports);
|
|
3923
|
+
|
|
3924
|
+
var _reactNative = ReactNative__default;
|
|
3925
|
+
|
|
3926
|
+
var _ensureNativeModuleAvailable = _interopRequireDefault$3(ensureNativeModuleAvailable$1);
|
|
3927
|
+
|
|
3928
|
+
var _createIconSourceCache = _interopRequireDefault$3(createIconSourceCache$1);
|
|
3929
|
+
|
|
3930
|
+
var _iconButton = _interopRequireDefault$3(iconButton);
|
|
3931
|
+
|
|
3932
|
+
var _jsxFileName$1 = "/home/runner/work/react-native-vector-icons/react-native-vector-icons/lib/create-icon-set.js";
|
|
3933
|
+
|
|
3934
|
+
function _getRequireWildcardCache$1(nodeInterop) {
|
|
3935
|
+
if (typeof WeakMap !== "function") return null;
|
|
3936
|
+
var cacheBabelInterop = new WeakMap();
|
|
3937
|
+
var cacheNodeInterop = new WeakMap();
|
|
3938
|
+
return (_getRequireWildcardCache$1 = function _getRequireWildcardCache(nodeInterop) {
|
|
3939
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
3940
|
+
})(nodeInterop);
|
|
3941
|
+
}
|
|
3942
|
+
|
|
3943
|
+
function _interopRequireWildcard$1(obj, nodeInterop) {
|
|
3944
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
3945
|
+
return obj;
|
|
3946
|
+
}
|
|
3947
|
+
|
|
3948
|
+
if (obj === null || _typeof$2(obj) !== "object" && typeof obj !== "function") {
|
|
3949
|
+
return {
|
|
3950
|
+
"default": obj
|
|
3951
|
+
};
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3954
|
+
var cache = _getRequireWildcardCache$1(nodeInterop);
|
|
3955
|
+
|
|
3956
|
+
if (cache && cache.has(obj)) {
|
|
3957
|
+
return cache.get(obj);
|
|
3958
|
+
}
|
|
3959
|
+
|
|
3960
|
+
var newObj = {};
|
|
3961
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
3962
|
+
|
|
3963
|
+
for (var key in obj) {
|
|
3964
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
3965
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
3966
|
+
|
|
3967
|
+
if (desc && (desc.get || desc.set)) {
|
|
3968
|
+
Object.defineProperty(newObj, key, desc);
|
|
3969
|
+
} else {
|
|
3970
|
+
newObj[key] = obj[key];
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
newObj["default"] = obj;
|
|
3976
|
+
|
|
3977
|
+
if (cache) {
|
|
3978
|
+
cache.set(obj, newObj);
|
|
3979
|
+
}
|
|
3980
|
+
|
|
3981
|
+
return newObj;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
var NativeIconAPI = _reactNative.NativeModules.RNVectorIconsManager || _reactNative.NativeModules.RNVectorIconsModule;
|
|
3985
|
+
createIconSet$1.NativeIconAPI = NativeIconAPI;
|
|
3986
|
+
var DEFAULT_ICON_SIZE = 12;
|
|
3987
|
+
createIconSet$1.DEFAULT_ICON_SIZE = DEFAULT_ICON_SIZE;
|
|
3988
|
+
var DEFAULT_ICON_COLOR = 'black';
|
|
3989
|
+
createIconSet$1.DEFAULT_ICON_COLOR = DEFAULT_ICON_COLOR;
|
|
3990
|
+
|
|
3991
|
+
function createIconSet(glyphMap, fontFamily, fontFile, fontStyle) {
|
|
3992
|
+
var fontBasename = fontFile ? fontFile.replace(/\.(otf|ttf)$/, '') : fontFamily;
|
|
3993
|
+
|
|
3994
|
+
var fontReference = _reactNative.Platform.select({
|
|
3995
|
+
windows: "/Assets/" + fontFile + "#" + fontFamily,
|
|
3996
|
+
android: fontBasename,
|
|
3997
|
+
web: fontBasename,
|
|
3998
|
+
"default": fontFamily
|
|
3999
|
+
});
|
|
4000
|
+
|
|
4001
|
+
var IconNamePropType = _propTypes$1["default"].oneOf(Object.keys(glyphMap));
|
|
4002
|
+
|
|
4003
|
+
var Icon = function (_PureComponent) {
|
|
4004
|
+
(0, _inherits2$1["default"])(Icon, _PureComponent);
|
|
4005
|
+
|
|
4006
|
+
function Icon() {
|
|
4007
|
+
var _getPrototypeOf2;
|
|
4008
|
+
|
|
4009
|
+
var _this;
|
|
4010
|
+
|
|
4011
|
+
(0, _classCallCheck2$1["default"])(this, Icon);
|
|
4012
|
+
|
|
4013
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4014
|
+
args[_key] = arguments[_key];
|
|
4015
|
+
}
|
|
4016
|
+
|
|
4017
|
+
_this = (0, _possibleConstructorReturn2$1["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(Icon)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
4018
|
+
_this.root = null;
|
|
4019
|
+
|
|
4020
|
+
_this.handleRef = function (ref) {
|
|
4021
|
+
_this.root = ref;
|
|
4022
|
+
};
|
|
4023
|
+
|
|
4024
|
+
return _this;
|
|
4025
|
+
}
|
|
4026
|
+
|
|
4027
|
+
(0, _createClass2$1["default"])(Icon, [{
|
|
4028
|
+
key: "setNativeProps",
|
|
4029
|
+
value: function setNativeProps(nativeProps) {
|
|
4030
|
+
if (this.root) {
|
|
4031
|
+
this.root.setNativeProps(nativeProps);
|
|
4032
|
+
}
|
|
4033
|
+
}
|
|
4034
|
+
}, {
|
|
4035
|
+
key: "render",
|
|
4036
|
+
value: function render() {
|
|
4037
|
+
var _this$props = this.props,
|
|
4038
|
+
name = _this$props.name,
|
|
4039
|
+
size = _this$props.size,
|
|
4040
|
+
color = _this$props.color,
|
|
4041
|
+
style = _this$props.style,
|
|
4042
|
+
children = _this$props.children,
|
|
4043
|
+
props = (0, _objectWithoutProperties2["default"])(_this$props, ["name", "size", "color", "style", "children"]);
|
|
4044
|
+
var glyph = name ? glyphMap[name] || '?' : '';
|
|
4045
|
+
|
|
4046
|
+
if (typeof glyph === 'number') {
|
|
4047
|
+
glyph = String.fromCodePoint(glyph);
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
var styleDefaults = {
|
|
4051
|
+
fontSize: size,
|
|
4052
|
+
color: color
|
|
4053
|
+
};
|
|
4054
|
+
var styleOverrides = {
|
|
4055
|
+
fontFamily: fontReference,
|
|
4056
|
+
fontWeight: 'normal',
|
|
4057
|
+
fontStyle: 'normal'
|
|
4058
|
+
};
|
|
4059
|
+
props.style = [styleDefaults, style, styleOverrides, fontStyle || {}];
|
|
4060
|
+
props.ref = this.handleRef;
|
|
4061
|
+
return _react$1["default"].createElement(_reactNative.Text, (0, _extends2$1["default"])({
|
|
4062
|
+
selectable: false
|
|
4063
|
+
}, props, {
|
|
4064
|
+
__self: this,
|
|
4065
|
+
__source: {
|
|
4066
|
+
fileName: _jsxFileName$1,
|
|
4067
|
+
lineNumber: 91
|
|
4068
|
+
}
|
|
4069
|
+
}), glyph, children);
|
|
4070
|
+
}
|
|
4071
|
+
}]);
|
|
4072
|
+
return Icon;
|
|
4073
|
+
}(_react$1.PureComponent);
|
|
4074
|
+
|
|
4075
|
+
Icon.propTypes = {
|
|
4076
|
+
allowFontScaling: _propTypes$1["default"].bool,
|
|
4077
|
+
name: IconNamePropType,
|
|
4078
|
+
size: _propTypes$1["default"].number,
|
|
4079
|
+
color: _propTypes$1["default"].any,
|
|
4080
|
+
children: _propTypes$1["default"].node,
|
|
4081
|
+
style: _propTypes$1["default"].any
|
|
4082
|
+
};
|
|
4083
|
+
Icon.defaultProps = {
|
|
4084
|
+
size: DEFAULT_ICON_SIZE,
|
|
4085
|
+
allowFontScaling: false
|
|
4086
|
+
};
|
|
4087
|
+
var imageSourceCache = (0, _createIconSourceCache["default"])();
|
|
4088
|
+
|
|
4089
|
+
function resolveGlyph(name) {
|
|
4090
|
+
var glyph = glyphMap[name] || '?';
|
|
4091
|
+
|
|
4092
|
+
if (typeof glyph === 'number') {
|
|
4093
|
+
return String.fromCodePoint(glyph);
|
|
4094
|
+
}
|
|
4095
|
+
|
|
4096
|
+
return glyph;
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
function getImageSourceSync(name) {
|
|
4100
|
+
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_ICON_SIZE;
|
|
4101
|
+
var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_ICON_COLOR;
|
|
4102
|
+
(0, _ensureNativeModuleAvailable["default"])();
|
|
4103
|
+
var glyph = resolveGlyph(name);
|
|
4104
|
+
var processedColor = (0, _reactNative.processColor)(color);
|
|
4105
|
+
var cacheKey = glyph + ":" + size + ":" + processedColor;
|
|
4106
|
+
|
|
4107
|
+
if (imageSourceCache.has(cacheKey)) {
|
|
4108
|
+
return imageSourceCache.get(cacheKey);
|
|
4109
|
+
}
|
|
4110
|
+
|
|
4111
|
+
try {
|
|
4112
|
+
var imagePath = NativeIconAPI.getImageForFontSync(fontReference, glyph, size, processedColor);
|
|
4113
|
+
var value = {
|
|
4114
|
+
uri: imagePath,
|
|
4115
|
+
scale: _reactNative.PixelRatio.get()
|
|
4116
|
+
};
|
|
4117
|
+
imageSourceCache.setValue(cacheKey, value);
|
|
4118
|
+
return value;
|
|
4119
|
+
} catch (error) {
|
|
4120
|
+
imageSourceCache.setError(cacheKey, error);
|
|
4121
|
+
throw error;
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
|
|
4125
|
+
function getImageSource(name) {
|
|
4126
|
+
var size,
|
|
4127
|
+
color,
|
|
4128
|
+
glyph,
|
|
4129
|
+
processedColor,
|
|
4130
|
+
cacheKey,
|
|
4131
|
+
imagePath,
|
|
4132
|
+
value,
|
|
4133
|
+
_args = arguments;
|
|
4134
|
+
return _regenerator["default"].async(function getImageSource$(_context) {
|
|
4135
|
+
while (1) {
|
|
4136
|
+
switch (_context.prev = _context.next) {
|
|
4137
|
+
case 0:
|
|
4138
|
+
size = _args.length > 1 && _args[1] !== undefined ? _args[1] : DEFAULT_ICON_SIZE;
|
|
4139
|
+
color = _args.length > 2 && _args[2] !== undefined ? _args[2] : DEFAULT_ICON_COLOR;
|
|
4140
|
+
(0, _ensureNativeModuleAvailable["default"])();
|
|
4141
|
+
glyph = resolveGlyph(name);
|
|
4142
|
+
processedColor = (0, _reactNative.processColor)(color);
|
|
4143
|
+
cacheKey = glyph + ":" + size + ":" + processedColor;
|
|
4144
|
+
|
|
4145
|
+
if (!imageSourceCache.has(cacheKey)) {
|
|
4146
|
+
_context.next = 8;
|
|
4147
|
+
break;
|
|
4148
|
+
}
|
|
4149
|
+
|
|
4150
|
+
return _context.abrupt("return", imageSourceCache.get(cacheKey));
|
|
4151
|
+
|
|
4152
|
+
case 8:
|
|
4153
|
+
_context.prev = 8;
|
|
4154
|
+
_context.next = 11;
|
|
4155
|
+
return _regenerator["default"].awrap(NativeIconAPI.getImageForFont(fontReference, glyph, size, processedColor));
|
|
4156
|
+
|
|
4157
|
+
case 11:
|
|
4158
|
+
imagePath = _context.sent;
|
|
4159
|
+
value = {
|
|
4160
|
+
uri: imagePath,
|
|
4161
|
+
scale: _reactNative.PixelRatio.get()
|
|
4162
|
+
};
|
|
4163
|
+
imageSourceCache.setValue(cacheKey, value);
|
|
4164
|
+
return _context.abrupt("return", value);
|
|
4165
|
+
|
|
4166
|
+
case 17:
|
|
4167
|
+
_context.prev = 17;
|
|
4168
|
+
_context.t0 = _context["catch"](8);
|
|
4169
|
+
imageSourceCache.setError(cacheKey, _context.t0);
|
|
4170
|
+
throw _context.t0;
|
|
4171
|
+
|
|
4172
|
+
case 21:
|
|
4173
|
+
case "end":
|
|
4174
|
+
return _context.stop();
|
|
4175
|
+
}
|
|
4176
|
+
}
|
|
4177
|
+
}, null, null, [[8, 17]]);
|
|
4178
|
+
}
|
|
4179
|
+
|
|
4180
|
+
function loadFont() {
|
|
4181
|
+
var file,
|
|
4182
|
+
_args2 = arguments;
|
|
4183
|
+
return _regenerator["default"].async(function loadFont$(_context2) {
|
|
4184
|
+
while (1) {
|
|
4185
|
+
switch (_context2.prev = _context2.next) {
|
|
4186
|
+
case 0:
|
|
4187
|
+
file = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : fontFile;
|
|
4188
|
+
|
|
4189
|
+
if (!(_reactNative.Platform.OS === 'ios')) {
|
|
4190
|
+
_context2.next = 7;
|
|
4191
|
+
break;
|
|
4192
|
+
}
|
|
4193
|
+
|
|
4194
|
+
(0, _ensureNativeModuleAvailable["default"])();
|
|
4195
|
+
|
|
4196
|
+
if (file) {
|
|
4197
|
+
_context2.next = 5;
|
|
4198
|
+
break;
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4201
|
+
throw new Error('Unable to load font, because no file was specified. ');
|
|
4202
|
+
|
|
4203
|
+
case 5:
|
|
4204
|
+
_context2.next = 7;
|
|
4205
|
+
return _regenerator["default"].awrap(NativeIconAPI.loadFontWithFileName.apply(NativeIconAPI, (0, _toConsumableArray2["default"])(file.split('.'))));
|
|
4206
|
+
|
|
4207
|
+
case 7:
|
|
4208
|
+
case "end":
|
|
4209
|
+
return _context2.stop();
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
});
|
|
4213
|
+
}
|
|
4214
|
+
|
|
4215
|
+
function hasIcon(name) {
|
|
4216
|
+
return Object.prototype.hasOwnProperty.call(glyphMap, name);
|
|
4217
|
+
}
|
|
4218
|
+
|
|
4219
|
+
function getRawGlyphMap() {
|
|
4220
|
+
return glyphMap;
|
|
4221
|
+
}
|
|
4222
|
+
|
|
4223
|
+
function getFontFamily() {
|
|
4224
|
+
return fontReference;
|
|
4225
|
+
}
|
|
4226
|
+
|
|
4227
|
+
Icon.Button = (0, _iconButton["default"])(Icon);
|
|
4228
|
+
Icon.getImageSource = getImageSource;
|
|
4229
|
+
Icon.getImageSourceSync = getImageSourceSync;
|
|
4230
|
+
Icon.loadFont = loadFont;
|
|
4231
|
+
Icon.hasIcon = hasIcon;
|
|
4232
|
+
Icon.getRawGlyphMap = getRawGlyphMap;
|
|
4233
|
+
Icon.getFontFamily = getFontFamily;
|
|
4234
|
+
return Icon;
|
|
4235
|
+
}
|
|
4236
|
+
|
|
4237
|
+
var createMultiStyleIconSet$1 = {};
|
|
4238
|
+
|
|
4239
|
+
function _defineProperty$1(obj, key, value) {
|
|
4240
|
+
if (key in obj) {
|
|
4241
|
+
Object.defineProperty(obj, key, {
|
|
4242
|
+
value: value,
|
|
4243
|
+
enumerable: true,
|
|
4244
|
+
configurable: true,
|
|
4245
|
+
writable: true
|
|
4246
|
+
});
|
|
4247
|
+
} else {
|
|
4248
|
+
obj[key] = value;
|
|
4249
|
+
}
|
|
4250
|
+
|
|
4251
|
+
return obj;
|
|
4252
|
+
}
|
|
4253
|
+
|
|
4254
|
+
var defineProperty = _defineProperty$1;
|
|
4255
|
+
|
|
4256
|
+
var _interopRequireDefault$2 = interopRequireDefault;
|
|
4257
|
+
Object.defineProperty(createMultiStyleIconSet$1, "__esModule", {
|
|
4258
|
+
value: true
|
|
4259
|
+
});
|
|
4260
|
+
|
|
4261
|
+
createMultiStyleIconSet$1["default"] = createMultiStyleIconSet;
|
|
4262
|
+
|
|
4263
|
+
var _classCallCheck2 = _interopRequireDefault$2(classCallCheck);
|
|
4264
|
+
|
|
4265
|
+
var _createClass2 = _interopRequireDefault$2(createClass);
|
|
4266
|
+
|
|
4267
|
+
var _possibleConstructorReturn2 = _interopRequireDefault$2(possibleConstructorReturn);
|
|
4268
|
+
|
|
4269
|
+
var _getPrototypeOf2 = _interopRequireDefault$2(getPrototypeOf);
|
|
4270
|
+
|
|
4271
|
+
var _inherits2 = _interopRequireDefault$2(inherits);
|
|
4272
|
+
|
|
4273
|
+
var _defineProperty2 = _interopRequireDefault$2(defineProperty);
|
|
4274
|
+
|
|
4275
|
+
var _extends2 = _interopRequireDefault$2(_extends_1);
|
|
4276
|
+
|
|
4277
|
+
var _react = _interopRequireWildcard(React);
|
|
4278
|
+
|
|
4279
|
+
var _propTypes = _interopRequireDefault$2(propTypes.exports);
|
|
4280
|
+
|
|
4281
|
+
var _createIconSet$2 = _interopRequireWildcard(createIconSet$1);
|
|
4282
|
+
|
|
4283
|
+
var _jsxFileName = "/home/runner/work/react-native-vector-icons/react-native-vector-icons/lib/create-multi-style-icon-set.js";
|
|
4284
|
+
|
|
4285
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
4286
|
+
if (typeof WeakMap !== "function") return null;
|
|
4287
|
+
var cacheBabelInterop = new WeakMap();
|
|
4288
|
+
var cacheNodeInterop = new WeakMap();
|
|
4289
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
|
|
4290
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
4291
|
+
})(nodeInterop);
|
|
4292
|
+
}
|
|
4293
|
+
|
|
4294
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
4295
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
4296
|
+
return obj;
|
|
4297
|
+
}
|
|
4298
|
+
|
|
4299
|
+
if (obj === null || _typeof$2(obj) !== "object" && typeof obj !== "function") {
|
|
4300
|
+
return {
|
|
4301
|
+
"default": obj
|
|
4302
|
+
};
|
|
4303
|
+
}
|
|
4304
|
+
|
|
4305
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
4306
|
+
|
|
4307
|
+
if (cache && cache.has(obj)) {
|
|
4308
|
+
return cache.get(obj);
|
|
4309
|
+
}
|
|
4310
|
+
|
|
4311
|
+
var newObj = {};
|
|
4312
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
4313
|
+
|
|
4314
|
+
for (var key in obj) {
|
|
4315
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
4316
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
4317
|
+
|
|
4318
|
+
if (desc && (desc.get || desc.set)) {
|
|
4319
|
+
Object.defineProperty(newObj, key, desc);
|
|
4320
|
+
} else {
|
|
4321
|
+
newObj[key] = obj[key];
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
}
|
|
4325
|
+
|
|
4326
|
+
newObj["default"] = obj;
|
|
4327
|
+
|
|
4328
|
+
if (cache) {
|
|
4329
|
+
cache.set(obj, newObj);
|
|
4330
|
+
}
|
|
4331
|
+
|
|
4332
|
+
return newObj;
|
|
4333
|
+
}
|
|
4334
|
+
|
|
4335
|
+
function createMultiStyleIconSet(styles) {
|
|
4336
|
+
var optionsInput = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
4337
|
+
var styleNames = Object.keys(styles);
|
|
4338
|
+
|
|
4339
|
+
if (styleNames.length === 0) {
|
|
4340
|
+
throw new Error('You need to add at least one style');
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
var options = (0, _extends2["default"])({
|
|
4344
|
+
defaultStyle: styleNames[0],
|
|
4345
|
+
fallbackFamily: function fallbackFamily() {
|
|
4346
|
+
return styleNames[0];
|
|
4347
|
+
},
|
|
4348
|
+
glyphValidator: function glyphValidator() {
|
|
4349
|
+
return true;
|
|
4350
|
+
}
|
|
4351
|
+
}, optionsInput);
|
|
4352
|
+
var iconSets = styleNames.reduce(function (acc, name) {
|
|
4353
|
+
var style = styles[name];
|
|
4354
|
+
acc[name] = (0, _createIconSet$2["default"])(style.glyphMap || {}, style.fontFamily || '', style.fontFile || '', style.fontStyle || {});
|
|
4355
|
+
return acc;
|
|
4356
|
+
}, {});
|
|
4357
|
+
|
|
4358
|
+
function styleFromProps(props) {
|
|
4359
|
+
return Object.keys(props).reduce(function (result, propName) {
|
|
4360
|
+
return styleNames.indexOf(propName) !== -1 && props[propName] === true ? propName : result;
|
|
4361
|
+
}, options.defaultStyle);
|
|
4362
|
+
}
|
|
4363
|
+
|
|
4364
|
+
function getIconSetForProps(props) {
|
|
4365
|
+
var name = props.name;
|
|
4366
|
+
var style = styleFromProps(props);
|
|
4367
|
+
if (options.glyphValidator(name, style)) return iconSets[style];
|
|
4368
|
+
var family = options.fallbackFamily(name);
|
|
4369
|
+
|
|
4370
|
+
if (styleNames.indexOf(family) === -1) {
|
|
4371
|
+
return options.defaultStyle;
|
|
4372
|
+
}
|
|
4373
|
+
|
|
4374
|
+
return iconSets[family];
|
|
4375
|
+
}
|
|
4376
|
+
|
|
4377
|
+
function selectIconClass(iconSet, iconClass) {
|
|
4378
|
+
return iconClass.length > 0 ? iconSet[iconClass] : iconSet;
|
|
4379
|
+
}
|
|
4380
|
+
|
|
4381
|
+
function reduceProps(props) {
|
|
4382
|
+
return Object.keys(props).reduce(function (acc, prop) {
|
|
4383
|
+
if (styleNames.indexOf(prop) === -1) {
|
|
4384
|
+
acc[prop] = props[prop];
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4387
|
+
return acc;
|
|
4388
|
+
}, {});
|
|
4389
|
+
}
|
|
4390
|
+
|
|
4391
|
+
function getStyledIconSet(style) {
|
|
4392
|
+
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
4393
|
+
|
|
4394
|
+
if (styleNames.indexOf(style) === -1) {
|
|
4395
|
+
return iconSets[options.defaultStyle];
|
|
4396
|
+
}
|
|
4397
|
+
|
|
4398
|
+
return !name ? iconSets[styleFromProps((0, _defineProperty2["default"])({}, style, true))] : getIconSetForProps((0, _defineProperty2["default"])({
|
|
4399
|
+
name: name
|
|
4400
|
+
}, style, true));
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4403
|
+
function getImageSource(name) {
|
|
4404
|
+
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _createIconSet$2.DEFAULT_ICON_SIZE;
|
|
4405
|
+
var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _createIconSet$2.DEFAULT_ICON_COLOR;
|
|
4406
|
+
var style = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : options.defaultStyle;
|
|
4407
|
+
return getStyledIconSet(style, name).getImageSource(name, size, color);
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
function getFontFamily() {
|
|
4411
|
+
var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : options.defaultStyle;
|
|
4412
|
+
return getStyledIconSet(style).getFontFamily();
|
|
4413
|
+
}
|
|
4414
|
+
|
|
4415
|
+
function getRawGlyphMap() {
|
|
4416
|
+
var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : options.defaultStyle;
|
|
4417
|
+
return getStyledIconSet(style).getRawGlyphMap();
|
|
4418
|
+
}
|
|
4419
|
+
|
|
4420
|
+
function hasIcon(name) {
|
|
4421
|
+
var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : options.defaultStyle;
|
|
4422
|
+
return options.glyphValidator(name, style);
|
|
4423
|
+
}
|
|
4424
|
+
|
|
4425
|
+
function createStyledIconClass() {
|
|
4426
|
+
var selectClass = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
4427
|
+
|
|
4428
|
+
var IconClass = function (_PureComponent) {
|
|
4429
|
+
(0, _inherits2["default"])(IconClass, _PureComponent);
|
|
4430
|
+
|
|
4431
|
+
function IconClass() {
|
|
4432
|
+
(0, _classCallCheck2["default"])(this, IconClass);
|
|
4433
|
+
return (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(IconClass).apply(this, arguments));
|
|
4434
|
+
}
|
|
4435
|
+
|
|
4436
|
+
(0, _createClass2["default"])(IconClass, [{
|
|
4437
|
+
key: "render",
|
|
4438
|
+
value: function render() {
|
|
4439
|
+
var selectedIconSet = getIconSetForProps(this.props);
|
|
4440
|
+
var SelectedIconClass = selectIconClass(selectedIconSet, selectClass);
|
|
4441
|
+
var props = reduceProps(this.props);
|
|
4442
|
+
return _react["default"].createElement(SelectedIconClass, (0, _extends2["default"])({}, props, {
|
|
4443
|
+
__self: this,
|
|
4444
|
+
__source: {
|
|
4445
|
+
fileName: _jsxFileName,
|
|
4446
|
+
lineNumber: 123
|
|
4447
|
+
}
|
|
4448
|
+
}));
|
|
4449
|
+
}
|
|
4450
|
+
}]);
|
|
4451
|
+
return IconClass;
|
|
4452
|
+
}(_react.PureComponent);
|
|
4453
|
+
|
|
4454
|
+
IconClass.propTypes = styleNames.reduce(function (acc, name) {
|
|
4455
|
+
acc[name] = _propTypes["default"].bool;
|
|
4456
|
+
return acc;
|
|
4457
|
+
}, {});
|
|
4458
|
+
IconClass.defaultProps = styleNames.reduce(function (acc, name) {
|
|
4459
|
+
acc[name] = false;
|
|
4460
|
+
return acc;
|
|
4461
|
+
}, {});
|
|
4462
|
+
return IconClass;
|
|
4463
|
+
}
|
|
4464
|
+
|
|
4465
|
+
var Icon = createStyledIconClass();
|
|
4466
|
+
Icon.Button = createStyledIconClass('Button');
|
|
4467
|
+
Icon.getStyledIconSet = getStyledIconSet;
|
|
4468
|
+
Icon.getImageSource = getImageSource;
|
|
4469
|
+
Icon.getFontFamily = getFontFamily;
|
|
4470
|
+
Icon.getRawGlyphMap = getRawGlyphMap;
|
|
4471
|
+
Icon.hasIcon = hasIcon;
|
|
4472
|
+
return Icon;
|
|
4473
|
+
}
|
|
2213
4474
|
|
|
2214
|
-
var
|
|
2215
|
-
var colors = {
|
|
2216
|
-
thumb: theme.colors.platformBackground,
|
|
2217
|
-
active: theme.colors.primary,
|
|
2218
|
-
inactive: theme.colors.inactiveBackground
|
|
2219
|
-
};
|
|
2220
|
-
var thumbSizes = {
|
|
2221
|
-
small: theme.space.medium,
|
|
2222
|
-
medium: theme.space.medium * 1.3
|
|
2223
|
-
};
|
|
2224
|
-
var widths = {
|
|
2225
|
-
small: theme.space.xxxlarge,
|
|
2226
|
-
medium: theme.space.xxxxlarge
|
|
2227
|
-
};
|
|
2228
|
-
var heights = {
|
|
2229
|
-
small: theme.space.large,
|
|
2230
|
-
medium: theme.space.large * 1.2
|
|
2231
|
-
};
|
|
2232
|
-
var spaces = {
|
|
2233
|
-
small: theme.space.xsmall,
|
|
2234
|
-
medium: theme.space.xsmall,
|
|
2235
|
-
inactive: 0
|
|
2236
|
-
};
|
|
2237
|
-
var radii = {
|
|
2238
|
-
rounded: theme.radii.rounded
|
|
2239
|
-
};
|
|
2240
|
-
var borderWidths = {
|
|
2241
|
-
"default": theme.borderWidths.base
|
|
2242
|
-
};
|
|
2243
|
-
return {
|
|
2244
|
-
colors: colors,
|
|
2245
|
-
thumbSizes: thumbSizes,
|
|
2246
|
-
widths: widths,
|
|
2247
|
-
heights: heights,
|
|
2248
|
-
spaces: spaces,
|
|
2249
|
-
radii: radii,
|
|
2250
|
-
borderWidths: borderWidths
|
|
2251
|
-
};
|
|
2252
|
-
};
|
|
4475
|
+
var createIconSetFromFontello$1 = {};
|
|
2253
4476
|
|
|
2254
|
-
var
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
activeBackground: theme.colors.primaryBackground,
|
|
2259
|
-
headerBottom: theme.colors.outline,
|
|
2260
|
-
text: theme.colors.text
|
|
2261
|
-
};
|
|
2262
|
-
var space = {
|
|
2263
|
-
flatListHorizontalPadding: theme.space.small,
|
|
2264
|
-
itemHorizontalPadding: theme.space.small,
|
|
2265
|
-
itemVerticalPadding: theme.space.small,
|
|
2266
|
-
outlineHorizontalPadding: theme.space.small,
|
|
2267
|
-
outlineVerticalPadding: theme.space.xsmall
|
|
2268
|
-
};
|
|
2269
|
-
var radii = {
|
|
2270
|
-
outline: theme.radii.medium
|
|
2271
|
-
};
|
|
2272
|
-
var borderWidths = {
|
|
2273
|
-
headerBottom: theme.borderWidths.base
|
|
2274
|
-
};
|
|
2275
|
-
var sizes = {
|
|
2276
|
-
indicator: theme.space.xxsmall
|
|
2277
|
-
};
|
|
2278
|
-
return {
|
|
2279
|
-
borderWidths: borderWidths,
|
|
2280
|
-
colors: colors,
|
|
2281
|
-
space: space,
|
|
2282
|
-
radii: radii,
|
|
2283
|
-
sizes: sizes
|
|
2284
|
-
};
|
|
2285
|
-
};
|
|
4477
|
+
var _interopRequireDefault$1 = interopRequireDefault;
|
|
4478
|
+
Object.defineProperty(createIconSetFromFontello$1, "__esModule", {
|
|
4479
|
+
value: true
|
|
4480
|
+
});
|
|
2286
4481
|
|
|
2287
|
-
|
|
2288
|
-
var borderWidths = {
|
|
2289
|
-
"default": theme.borderWidths.base
|
|
2290
|
-
};
|
|
2291
|
-
var colors = {
|
|
2292
|
-
danger: theme.colors.danger,
|
|
2293
|
-
dangerBackground: theme.colors.dangerBackground,
|
|
2294
|
-
info: theme.colors.info,
|
|
2295
|
-
infoBackground: theme.colors.infoBackground,
|
|
2296
|
-
success: theme.colors.successDark,
|
|
2297
|
-
successBackground: theme.colors.successBackground,
|
|
2298
|
-
warning: theme.colors.warningDark,
|
|
2299
|
-
warningBackground: theme.colors.warningBackground
|
|
2300
|
-
};
|
|
2301
|
-
var fonts = {
|
|
2302
|
-
"default": theme.fonts.semiBold
|
|
2303
|
-
};
|
|
2304
|
-
var fontSizes = {
|
|
2305
|
-
"default": theme.fontSizes.small
|
|
2306
|
-
};
|
|
2307
|
-
var space = {
|
|
2308
|
-
horizontalPadding: theme.space.small,
|
|
2309
|
-
verticalPadding: theme.space.xxsmall
|
|
2310
|
-
};
|
|
2311
|
-
var radii = {
|
|
2312
|
-
"default": theme.radii.base
|
|
2313
|
-
};
|
|
2314
|
-
return {
|
|
2315
|
-
borderWidths: borderWidths,
|
|
2316
|
-
colors: colors,
|
|
2317
|
-
fonts: fonts,
|
|
2318
|
-
fontSizes: fontSizes,
|
|
2319
|
-
space: space,
|
|
2320
|
-
radii: radii
|
|
2321
|
-
};
|
|
2322
|
-
};
|
|
4482
|
+
createIconSetFromFontello$1["default"] = createIconSetFromFontello;
|
|
2323
4483
|
|
|
2324
|
-
var
|
|
2325
|
-
var colors = {
|
|
2326
|
-
labelBackground: theme.colors.platformBackground,
|
|
2327
|
-
border: theme.colors.text
|
|
2328
|
-
};
|
|
2329
|
-
var space = {
|
|
2330
|
-
containerPadding: theme.space.medium,
|
|
2331
|
-
labelLeft: theme.space.medium,
|
|
2332
|
-
labelTop: theme.lineHeights.small / -2,
|
|
2333
|
-
labelHorizontalPadding: theme.space.xsmall,
|
|
2334
|
-
inputHorizontalMargin: theme.space.small
|
|
2335
|
-
};
|
|
2336
|
-
var fontSizes = {
|
|
2337
|
-
text: theme.fontSizes.large
|
|
2338
|
-
};
|
|
2339
|
-
var borderWidths = {
|
|
2340
|
-
container: theme.borderWidths.base
|
|
2341
|
-
};
|
|
2342
|
-
var radii = {
|
|
2343
|
-
container: theme.radii.medium
|
|
2344
|
-
};
|
|
2345
|
-
return {
|
|
2346
|
-
colors: colors,
|
|
2347
|
-
space: space,
|
|
2348
|
-
fontSizes: fontSizes,
|
|
2349
|
-
borderWidths: borderWidths,
|
|
2350
|
-
radii: radii
|
|
2351
|
-
};
|
|
2352
|
-
};
|
|
4484
|
+
var _createIconSet$1 = _interopRequireDefault$1(createIconSet$1);
|
|
2353
4485
|
|
|
2354
|
-
|
|
2355
|
-
var
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
regular: theme.fonts.regular,
|
|
2363
|
-
semiBold: theme.fonts.semiBold
|
|
2364
|
-
};
|
|
2365
|
-
var fontSizes = {
|
|
2366
|
-
small: theme.fontSizes.small,
|
|
2367
|
-
medium: theme.fontSizes.medium,
|
|
2368
|
-
large: theme.fontSizes.large,
|
|
2369
|
-
xlarge: theme.fontSizes.xlarge
|
|
2370
|
-
};
|
|
2371
|
-
var lineHeights = {
|
|
2372
|
-
small: theme.lineHeights.small,
|
|
2373
|
-
medium: theme.lineHeights.medium,
|
|
2374
|
-
large: theme.lineHeights.large,
|
|
2375
|
-
xlarge: theme.lineHeights.xlarge
|
|
2376
|
-
};
|
|
2377
|
-
return {
|
|
2378
|
-
colors: colors,
|
|
2379
|
-
fonts: fonts,
|
|
2380
|
-
fontSizes: fontSizes,
|
|
2381
|
-
lineHeights: lineHeights
|
|
2382
|
-
};
|
|
2383
|
-
};
|
|
4486
|
+
function createIconSetFromFontello(config, fontFamilyArg, fontFile) {
|
|
4487
|
+
var glyphMap = {};
|
|
4488
|
+
config.glyphs.forEach(function (glyph) {
|
|
4489
|
+
glyphMap[glyph.css] = glyph.code;
|
|
4490
|
+
});
|
|
4491
|
+
var fontFamily = fontFamilyArg || config.name || 'fontello';
|
|
4492
|
+
return (0, _createIconSet$1["default"])(glyphMap, fontFamily, fontFile || fontFamily + ".ttf");
|
|
4493
|
+
}
|
|
2384
4494
|
|
|
2385
|
-
var
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
4495
|
+
var createIconSetFromIcomoon = {};
|
|
4496
|
+
|
|
4497
|
+
var _interopRequireDefault = interopRequireDefault;
|
|
4498
|
+
Object.defineProperty(createIconSetFromIcomoon, "__esModule", {
|
|
4499
|
+
value: true
|
|
4500
|
+
});
|
|
4501
|
+
|
|
4502
|
+
createIconSetFromIcomoon["default"] = createIconSetFromIcoMoon;
|
|
4503
|
+
|
|
4504
|
+
var _createIconSet = _interopRequireDefault(createIconSet$1);
|
|
4505
|
+
|
|
4506
|
+
function createIconSetFromIcoMoon(config, fontFamilyArg, fontFile) {
|
|
4507
|
+
var glyphMap = {};
|
|
4508
|
+
config.icons.forEach(function (icon) {
|
|
4509
|
+
icon.properties.name.split(/\s*,\s*/g).forEach(function (name) {
|
|
4510
|
+
glyphMap[name] = icon.properties.code;
|
|
4511
|
+
});
|
|
4512
|
+
});
|
|
4513
|
+
var fontFamily = fontFamilyArg || config.preferences.fontPref.metadata.fontFamily;
|
|
4514
|
+
return (0, _createIconSet["default"])(glyphMap, fontFamily, fontFile || fontFamily + ".ttf");
|
|
4515
|
+
}
|
|
4516
|
+
|
|
4517
|
+
(function (exports) {
|
|
4518
|
+
var _interopRequireDefault = interopRequireDefault;
|
|
4519
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4520
|
+
value: true
|
|
4521
|
+
});
|
|
4522
|
+
Object.defineProperty(exports, "createIconSet", {
|
|
4523
|
+
enumerable: true,
|
|
4524
|
+
get: function get() {
|
|
4525
|
+
return _createIconSet["default"];
|
|
4526
|
+
}
|
|
4527
|
+
});
|
|
4528
|
+
Object.defineProperty(exports, "createIconSetFromFontello", {
|
|
4529
|
+
enumerable: true,
|
|
4530
|
+
get: function get() {
|
|
4531
|
+
return _createIconSetFromFontello["default"];
|
|
4532
|
+
}
|
|
4533
|
+
});
|
|
4534
|
+
Object.defineProperty(exports, "createIconSetFromIcoMoon", {
|
|
4535
|
+
enumerable: true,
|
|
4536
|
+
get: function get() {
|
|
4537
|
+
return _createIconSetFromIcomoon["default"];
|
|
4538
|
+
}
|
|
4539
|
+
});
|
|
4540
|
+
Object.defineProperty(exports, "createMultiStyleIconSet", {
|
|
4541
|
+
enumerable: true,
|
|
4542
|
+
get: function get() {
|
|
4543
|
+
return _createMultiStyleIconSet["default"];
|
|
2413
4544
|
}
|
|
2414
4545
|
});
|
|
2415
|
-
};
|
|
2416
4546
|
|
|
2417
|
-
var
|
|
2418
|
-
var ThemeProvider = ThemeProvider$1;
|
|
2419
|
-
var useTheme = useTheme$1;
|
|
4547
|
+
var _createIconSet = _interopRequireDefault(createIconSet$1);
|
|
2420
4548
|
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
4549
|
+
var _createMultiStyleIconSet = _interopRequireDefault(createMultiStyleIconSet$1);
|
|
4550
|
+
|
|
4551
|
+
var _createIconSetFromFontello = _interopRequireDefault(createIconSetFromFontello$1);
|
|
4552
|
+
|
|
4553
|
+
var _createIconSetFromIcomoon = _interopRequireDefault(createIconSetFromIcomoon);
|
|
4554
|
+
})(dist);
|
|
2424
4555
|
|
|
2425
4556
|
var cssToReactNative = {};
|
|
2426
4557
|
|
|
@@ -2901,7 +5032,7 @@ var camelize = function camelize(obj) {
|
|
|
2901
5032
|
};
|
|
2902
5033
|
|
|
2903
5034
|
function walk(obj) {
|
|
2904
|
-
if (!obj || _typeof(obj) !== 'object') return obj;
|
|
5035
|
+
if (!obj || _typeof$2(obj) !== 'object') return obj;
|
|
2905
5036
|
if (isDate(obj) || isRegex(obj)) return obj;
|
|
2906
5037
|
if (isArray(obj)) return map(obj, walk);
|
|
2907
5038
|
return reduce(objectKeys(obj), function (acc, key) {
|
|
@@ -3266,7 +5397,7 @@ var cssColorKeywords = require$$0;
|
|
|
3266
5397
|
});
|
|
3267
5398
|
|
|
3268
5399
|
function _interopDefault(ex) {
|
|
3269
|
-
return ex && _typeof(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
|
|
5400
|
+
return ex && _typeof$2(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
|
|
3270
5401
|
}
|
|
3271
5402
|
|
|
3272
5403
|
var parse = lib;
|
|
@@ -4121,7 +6252,7 @@ var buffer = '';
|
|
|
4121
6252
|
var lastType;
|
|
4122
6253
|
|
|
4123
6254
|
function handleInterpolation(interpolation, i, arr) {
|
|
4124
|
-
var type = _typeof(interpolation);
|
|
6255
|
+
var type = _typeof$2(interpolation);
|
|
4125
6256
|
|
|
4126
6257
|
if (type === 'string') {
|
|
4127
6258
|
// strip comments
|
|
@@ -4343,7 +6474,7 @@ var index$2 = components.reduce(function (acc, comp) {
|
|
|
4343
6474
|
enumerable: true,
|
|
4344
6475
|
configurable: false,
|
|
4345
6476
|
get: function get() {
|
|
4346
|
-
return styled(
|
|
6477
|
+
return styled(ReactNative[comp]);
|
|
4347
6478
|
}
|
|
4348
6479
|
});
|
|
4349
6480
|
}, styled);
|
|
@@ -12267,7 +14398,7 @@ var heroIconConfig = {
|
|
|
12267
14398
|
preferences: preferences
|
|
12268
14399
|
};
|
|
12269
14400
|
|
|
12270
|
-
var HeroIcon = createIconSetFromIcoMoon(heroIconConfig, 'hero-icons', 'hero-icons.ttf');
|
|
14401
|
+
var HeroIcon = dist.createIconSetFromIcoMoon(heroIconConfig, 'hero-icons', 'hero-icons.ttf');
|
|
12271
14402
|
var COLOR_INTENTS = {
|
|
12272
14403
|
text: 'text',
|
|
12273
14404
|
primary: 'primary',
|
|
@@ -12335,9 +14466,9 @@ var Text = function Text(_ref) {
|
|
|
12335
14466
|
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
12336
14467
|
_ref$intent = _ref.intent,
|
|
12337
14468
|
intent = _ref$intent === void 0 ? 'body' : _ref$intent,
|
|
12338
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$c);
|
|
14469
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$c);
|
|
12339
14470
|
|
|
12340
|
-
return /*#__PURE__*/React.createElement(StyledText$3, _extends$
|
|
14471
|
+
return /*#__PURE__*/React.createElement(StyledText$3, _extends$3({}, nativeProps, {
|
|
12341
14472
|
themeFontSize: fontSize,
|
|
12342
14473
|
themeFontWeight: fontWeight,
|
|
12343
14474
|
themeIntent: intent
|
|
@@ -12348,7 +14479,7 @@ var Typography = {
|
|
|
12348
14479
|
Text: Text
|
|
12349
14480
|
};
|
|
12350
14481
|
|
|
12351
|
-
var Container$
|
|
14482
|
+
var Container$2 = index$2(View)(function (_ref) {
|
|
12352
14483
|
var theme = _ref.theme,
|
|
12353
14484
|
_ref$themeVariant = _ref.themeVariant,
|
|
12354
14485
|
themeVariant = _ref$themeVariant === void 0 ? 'default' : _ref$themeVariant,
|
|
@@ -12360,21 +14491,21 @@ var Container$1 = index$2(View)(function (_ref) {
|
|
|
12360
14491
|
flexDirection: 'row'
|
|
12361
14492
|
};
|
|
12362
14493
|
});
|
|
12363
|
-
var IconContainer = index$2(View)(function (_ref2) {
|
|
14494
|
+
var IconContainer$1 = index$2(View)(function (_ref2) {
|
|
12364
14495
|
var theme = _ref2.theme;
|
|
12365
14496
|
return {
|
|
12366
14497
|
alignItems: 'center',
|
|
12367
14498
|
paddingLeft: theme.__hd__.alert.space.padding
|
|
12368
14499
|
};
|
|
12369
14500
|
});
|
|
12370
|
-
var TextContainer = index$2(View)(function (_ref3) {
|
|
14501
|
+
var TextContainer$1 = index$2(View)(function (_ref3) {
|
|
12371
14502
|
var theme = _ref3.theme;
|
|
12372
14503
|
return {
|
|
12373
14504
|
paddingHorizontal: theme.__hd__.alert.space.padding,
|
|
12374
14505
|
flex: 1
|
|
12375
14506
|
};
|
|
12376
14507
|
});
|
|
12377
|
-
var ContentContainer = index$2(View)(function (_ref4) {
|
|
14508
|
+
var ContentContainer$1 = index$2(View)(function (_ref4) {
|
|
12378
14509
|
var theme = _ref4.theme,
|
|
12379
14510
|
showDivider = _ref4.showDivider;
|
|
12380
14511
|
return {
|
|
@@ -12385,7 +14516,7 @@ var ContentContainer = index$2(View)(function (_ref4) {
|
|
|
12385
14516
|
flexDirection: 'row'
|
|
12386
14517
|
};
|
|
12387
14518
|
});
|
|
12388
|
-
var CTAWrapper = index$2(TouchableOpacity)(function (_ref5) {
|
|
14519
|
+
var CTAWrapper$1 = index$2(TouchableOpacity)(function (_ref5) {
|
|
12389
14520
|
var theme = _ref5.theme;
|
|
12390
14521
|
return {
|
|
12391
14522
|
paddingHorizontal: theme.__hd__.alert.space.padding,
|
|
@@ -12393,7 +14524,7 @@ var CTAWrapper = index$2(TouchableOpacity)(function (_ref5) {
|
|
|
12393
14524
|
};
|
|
12394
14525
|
});
|
|
12395
14526
|
|
|
12396
|
-
var getIntentIcon = function getIntentIcon(intent) {
|
|
14527
|
+
var getIntentIcon$1 = function getIntentIcon(intent) {
|
|
12397
14528
|
switch (intent) {
|
|
12398
14529
|
case 'success':
|
|
12399
14530
|
return 'circle-ok';
|
|
@@ -12420,21 +14551,21 @@ var Alert = function Alert(_ref) {
|
|
|
12420
14551
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
12421
14552
|
style = _ref.style,
|
|
12422
14553
|
testID = _ref.testID;
|
|
12423
|
-
return /*#__PURE__*/React.createElement(Container$
|
|
14554
|
+
return /*#__PURE__*/React.createElement(Container$2, {
|
|
12424
14555
|
themeVariant: variant,
|
|
12425
14556
|
themeIntent: intent,
|
|
12426
14557
|
style: style,
|
|
12427
14558
|
testID: testID
|
|
12428
|
-
}, /*#__PURE__*/React.createElement(ContentContainer, {
|
|
14559
|
+
}, /*#__PURE__*/React.createElement(ContentContainer$1, {
|
|
12429
14560
|
showDivider: !!onClose
|
|
12430
|
-
}, icon !== null ? /*#__PURE__*/React.createElement(IconContainer, {
|
|
14561
|
+
}, icon !== null ? /*#__PURE__*/React.createElement(IconContainer$1, {
|
|
12431
14562
|
testID: "alert-left-icon"
|
|
12432
14563
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
12433
|
-
icon: icon || getIntentIcon(intent),
|
|
14564
|
+
icon: icon || getIntentIcon$1(intent),
|
|
12434
14565
|
size: "small"
|
|
12435
|
-
})) : null, /*#__PURE__*/React.createElement(TextContainer, null, typeof title === 'string' ? /*#__PURE__*/React.createElement(Typography.Text, {
|
|
14566
|
+
})) : null, /*#__PURE__*/React.createElement(TextContainer$1, null, typeof title === 'string' ? /*#__PURE__*/React.createElement(Typography.Text, {
|
|
12436
14567
|
fontWeight: "semi-bold"
|
|
12437
|
-
}, title) : title, typeof content === 'string' ? /*#__PURE__*/React.createElement(Typography.Text, null, content) : content)), onClose ? /*#__PURE__*/React.createElement(CTAWrapper, {
|
|
14568
|
+
}, title) : title, typeof content === 'string' ? /*#__PURE__*/React.createElement(Typography.Text, null, content) : content)), onClose ? /*#__PURE__*/React.createElement(CTAWrapper$1, {
|
|
12438
14569
|
onPress: onClose,
|
|
12439
14570
|
testID: "alert-close-icon"
|
|
12440
14571
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -12573,7 +14704,7 @@ var Status = function Status(_ref) {
|
|
|
12573
14704
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
12574
14705
|
style = _ref.style,
|
|
12575
14706
|
testID = _ref.testID,
|
|
12576
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$b);
|
|
14707
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$b);
|
|
12577
14708
|
|
|
12578
14709
|
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
12579
14710
|
opacity = _React$useRef.current;
|
|
@@ -12592,7 +14723,7 @@ var Status = function Status(_ref) {
|
|
|
12592
14723
|
useNativeDriver: true
|
|
12593
14724
|
}).start();
|
|
12594
14725
|
}, [visible, opacity]);
|
|
12595
|
-
return /*#__PURE__*/React.createElement(View, _extends$
|
|
14726
|
+
return /*#__PURE__*/React.createElement(View, _extends$3({}, nativeProps, {
|
|
12596
14727
|
style: style,
|
|
12597
14728
|
testID: testID
|
|
12598
14729
|
}), children, /*#__PURE__*/React.createElement(StyledStatus, {
|
|
@@ -12626,7 +14757,7 @@ var Badge = function Badge(_ref) {
|
|
|
12626
14757
|
intent = _ref$intent === void 0 ? 'danger' : _ref$intent,
|
|
12627
14758
|
style = _ref.style,
|
|
12628
14759
|
testID = _ref.testID,
|
|
12629
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$a);
|
|
14760
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
12630
14761
|
|
|
12631
14762
|
var _React$useRef = React.useRef(new Animated.Value(visible ? 1 : 0)),
|
|
12632
14763
|
opacity = _React$useRef.current;
|
|
@@ -12646,7 +14777,7 @@ var Badge = function Badge(_ref) {
|
|
|
12646
14777
|
}).start();
|
|
12647
14778
|
}, [visible, opacity]);
|
|
12648
14779
|
var content = typeof originalContent === 'number' && originalContent > max ? "".concat(max, "+") : String(originalContent);
|
|
12649
|
-
return /*#__PURE__*/React.createElement(StyledView$2, _extends$
|
|
14780
|
+
return /*#__PURE__*/React.createElement(StyledView$2, _extends$3({}, nativeProps, {
|
|
12650
14781
|
themeIntent: intent,
|
|
12651
14782
|
themePadding: getPaddingState(content),
|
|
12652
14783
|
style: [{
|
|
@@ -12735,7 +14866,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
12735
14866
|
renderActiveTabOnly = _ref$renderActiveTabO === void 0 ? false : _ref$renderActiveTabO,
|
|
12736
14867
|
selectedTabKey = _ref.selectedTabKey,
|
|
12737
14868
|
tabs = _ref.tabs,
|
|
12738
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$9);
|
|
14869
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$9);
|
|
12739
14870
|
|
|
12740
14871
|
var insets = useSafeAreaInsets();
|
|
12741
14872
|
/**
|
|
@@ -12750,7 +14881,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
|
|
|
12750
14881
|
if (!loaded.includes(selectedTabKey)) {
|
|
12751
14882
|
// Set the current tab to be loaded if it was not loaded before
|
|
12752
14883
|
setLoaded(function (loadedState) {
|
|
12753
|
-
return [].concat(_toConsumableArray(loadedState), [selectedTabKey]);
|
|
14884
|
+
return [].concat(_toConsumableArray$1(loadedState), [selectedTabKey]);
|
|
12754
14885
|
});
|
|
12755
14886
|
}
|
|
12756
14887
|
|
|
@@ -12833,9 +14964,9 @@ var Divider = function Divider(_ref) {
|
|
|
12833
14964
|
marginVertical = _ref.marginVertical,
|
|
12834
14965
|
style = _ref.style,
|
|
12835
14966
|
testID = _ref.testID,
|
|
12836
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$8);
|
|
14967
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$8);
|
|
12837
14968
|
|
|
12838
|
-
return /*#__PURE__*/React.createElement(StyledDivider, _extends$
|
|
14969
|
+
return /*#__PURE__*/React.createElement(StyledDivider, _extends$3({}, nativeProps, {
|
|
12839
14970
|
themeMarginHorizontal: marginHorizontal,
|
|
12840
14971
|
themeMarginVertical: marginVertical,
|
|
12841
14972
|
style: style,
|
|
@@ -12844,7 +14975,7 @@ var Divider = function Divider(_ref) {
|
|
|
12844
14975
|
};
|
|
12845
14976
|
|
|
12846
14977
|
var AnimatedPressable$1 = Animated.createAnimatedComponent(Pressable);
|
|
12847
|
-
var StyledWrapper$
|
|
14978
|
+
var StyledWrapper$5 = index$2(View)(_objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
12848
14979
|
flexDirection: 'column-reverse'
|
|
12849
14980
|
}));
|
|
12850
14981
|
var StyledBottomSheet = index$2(Animated.View)(function (_ref) {
|
|
@@ -12995,7 +15126,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
|
12995
15126
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
12996
15127
|
testID = _ref2.testID,
|
|
12997
15128
|
themeVariant = _ref2.themeVariant,
|
|
12998
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$7);
|
|
15129
|
+
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$7);
|
|
12999
15130
|
|
|
13000
15131
|
var progressAnimation = useRef(new Animated.Value(0));
|
|
13001
15132
|
useEffect(function () {
|
|
@@ -13025,7 +15156,7 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
|
|
|
13025
15156
|
return null;
|
|
13026
15157
|
};
|
|
13027
15158
|
|
|
13028
|
-
return /*#__PURE__*/React.createElement(AnimatedLoadingIndicatorWrapper, _extends$
|
|
15159
|
+
return /*#__PURE__*/React.createElement(AnimatedLoadingIndicatorWrapper, _extends$3({
|
|
13029
15160
|
testID: testID
|
|
13030
15161
|
}, nativeProps), Array.from(new Array(count), renderLoadingDot, themeVariant));
|
|
13031
15162
|
};
|
|
@@ -13461,7 +15592,7 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
13461
15592
|
transparent: true,
|
|
13462
15593
|
testID: testID,
|
|
13463
15594
|
onShow: onOpen
|
|
13464
|
-
}, /*#__PURE__*/React.createElement(StyledWrapper$
|
|
15595
|
+
}, /*#__PURE__*/React.createElement(StyledWrapper$5, {
|
|
13465
15596
|
pointerEvents: "box-none"
|
|
13466
15597
|
}, /*#__PURE__*/React.createElement(StyledBackdrop$2, {
|
|
13467
15598
|
style: {
|
|
@@ -13525,16 +15656,16 @@ var Card = function Card(_ref) {
|
|
|
13525
15656
|
var _ref$variant = _ref.variant,
|
|
13526
15657
|
variant = _ref$variant === void 0 ? 'basic' : _ref$variant,
|
|
13527
15658
|
children = _ref.children,
|
|
13528
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$6);
|
|
15659
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$6);
|
|
13529
15660
|
|
|
13530
|
-
return /*#__PURE__*/React.createElement(StyledCard, _extends$
|
|
15661
|
+
return /*#__PURE__*/React.createElement(StyledCard, _extends$3({}, nativeProps, {
|
|
13531
15662
|
themeVariant: variant
|
|
13532
15663
|
}), variant === 'data' && /*#__PURE__*/React.createElement(LeftDataCard, {
|
|
13533
15664
|
testID: "data-card-indicator"
|
|
13534
15665
|
}), children);
|
|
13535
15666
|
};
|
|
13536
15667
|
|
|
13537
|
-
var StyledWrapper$
|
|
15668
|
+
var StyledWrapper$4 = index$2(Animated.View)(function () {
|
|
13538
15669
|
return {
|
|
13539
15670
|
margin: 0,
|
|
13540
15671
|
padding: 0,
|
|
@@ -13594,7 +15725,7 @@ var Collapse = function Collapse(_ref) {
|
|
|
13594
15725
|
var height = _ref2.height;
|
|
13595
15726
|
setContentHeight(height);
|
|
13596
15727
|
}, [contentHeight]);
|
|
13597
|
-
return /*#__PURE__*/React.createElement(StyledWrapper$
|
|
15728
|
+
return /*#__PURE__*/React.createElement(StyledWrapper$4, {
|
|
13598
15729
|
style: [style, {
|
|
13599
15730
|
height: collapseAnim
|
|
13600
15731
|
}],
|
|
@@ -13606,6 +15737,46 @@ var Collapse = function Collapse(_ref) {
|
|
|
13606
15737
|
}, children)));
|
|
13607
15738
|
};
|
|
13608
15739
|
|
|
15740
|
+
var StyledWrapper$3 = index$2(TouchableOpacity)(function (_ref) {
|
|
15741
|
+
var theme = _ref.theme,
|
|
15742
|
+
disabled = _ref.disabled;
|
|
15743
|
+
return {
|
|
15744
|
+
display: 'flex',
|
|
15745
|
+
flexDirection: 'row',
|
|
15746
|
+
justifyContent: 'center',
|
|
15747
|
+
height: theme.__hd__.checkbox.sizes.base,
|
|
15748
|
+
width: theme.__hd__.checkbox.sizes.base,
|
|
15749
|
+
borderRadius: theme.__hd__.checkbox.radii.base,
|
|
15750
|
+
borderWidth: theme.__hd__.checkbox.borderWidths["default"],
|
|
15751
|
+
borderColor: disabled ? theme.__hd__.checkbox.colors.disabled : theme.__hd__.checkbox.colors.borderColor,
|
|
15752
|
+
overflow: 'hidden'
|
|
15753
|
+
};
|
|
15754
|
+
});
|
|
15755
|
+
|
|
15756
|
+
var CheckBox = function CheckBox(_ref) {
|
|
15757
|
+
var checked = _ref.checked,
|
|
15758
|
+
disabled = _ref.disabled,
|
|
15759
|
+
onPress = _ref.onPress,
|
|
15760
|
+
style = _ref.style,
|
|
15761
|
+
testID = _ref.testID;
|
|
15762
|
+
return /*#__PURE__*/React.createElement(StyledWrapper$3, {
|
|
15763
|
+
onPress: onPress,
|
|
15764
|
+
disabled: disabled,
|
|
15765
|
+
style: style,
|
|
15766
|
+
testID: testID
|
|
15767
|
+
}, checked && /*#__PURE__*/React.createElement(Icon, {
|
|
15768
|
+
icon: "circle-ok",
|
|
15769
|
+
intent: "primary",
|
|
15770
|
+
size: "large",
|
|
15771
|
+
style: _objectSpread2({
|
|
15772
|
+
position: 'absolute',
|
|
15773
|
+
top: theme.__hd__.checkbox.space.iconTop
|
|
15774
|
+
}, disabled ? {
|
|
15775
|
+
color: theme.__hd__.checkbox.colors.disabled
|
|
15776
|
+
} : {})
|
|
15777
|
+
}));
|
|
15778
|
+
};
|
|
15779
|
+
|
|
13609
15780
|
var Wrapper$1 = index$2(View)(function () {
|
|
13610
15781
|
return {
|
|
13611
15782
|
flex: 1,
|
|
@@ -13779,7 +15950,7 @@ var AnimatedIcons = Animated.createAnimatedComponent(StyledFABIcon);
|
|
|
13779
15950
|
|
|
13780
15951
|
var AnimatedFABIcon = function AnimatedFABIcon(_ref) {
|
|
13781
15952
|
var active = _ref.active,
|
|
13782
|
-
iconProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
15953
|
+
iconProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
13783
15954
|
|
|
13784
15955
|
var rotateAnimation = useRef(new Animated.Value(active ? 1 : 0));
|
|
13785
15956
|
useEffect(function () {
|
|
@@ -13951,7 +16122,7 @@ var ActionItemsListComponent = function ActionItemsListComponent(_ref) {
|
|
|
13951
16122
|
return /*#__PURE__*/React.createElement(View, {
|
|
13952
16123
|
style: style
|
|
13953
16124
|
}, items === null || items === void 0 ? void 0 : items.map(function (itemProp) {
|
|
13954
|
-
return /*#__PURE__*/React.createElement(ActionItem, _extends$
|
|
16125
|
+
return /*#__PURE__*/React.createElement(ActionItem, _extends$3({
|
|
13955
16126
|
key: itemProp.icon
|
|
13956
16127
|
}, itemProp));
|
|
13957
16128
|
}));
|
|
@@ -14090,7 +16261,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
|
|
|
14090
16261
|
intent = _ref2$intent === void 0 ? 'primary' : _ref2$intent,
|
|
14091
16262
|
style = _ref2.style,
|
|
14092
16263
|
testID = _ref2.testID,
|
|
14093
|
-
nativeProps = _objectWithoutProperties(_ref2, _excluded$4);
|
|
16264
|
+
nativeProps = _objectWithoutProperties$1(_ref2, _excluded$4);
|
|
14094
16265
|
|
|
14095
16266
|
var theme = useTheme$1();
|
|
14096
16267
|
var radius = theme.__hd__.progress.sizes.radius;
|
|
@@ -14128,7 +16299,7 @@ var ProgressCircle = function ProgressCircle(_ref2) {
|
|
|
14128
16299
|
outputRange: ['0deg', '360deg'],
|
|
14129
16300
|
extrapolate: 'clamp'
|
|
14130
16301
|
});
|
|
14131
|
-
return /*#__PURE__*/React.createElement(View, _extends$
|
|
16302
|
+
return /*#__PURE__*/React.createElement(View, _extends$3({}, nativeProps, {
|
|
14132
16303
|
testID: testID,
|
|
14133
16304
|
style: style
|
|
14134
16305
|
}), /*#__PURE__*/React.createElement(View, {
|
|
@@ -14216,7 +16387,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
14216
16387
|
intent = _ref$intent === void 0 ? 'primary' : _ref$intent,
|
|
14217
16388
|
style = _ref.style,
|
|
14218
16389
|
testID = _ref.testID,
|
|
14219
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
16390
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
14220
16391
|
|
|
14221
16392
|
var _useState = useState(0),
|
|
14222
16393
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -14244,7 +16415,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
14244
16415
|
outputRange: [999, 0],
|
|
14245
16416
|
extrapolate: 'clamp'
|
|
14246
16417
|
});
|
|
14247
|
-
return /*#__PURE__*/React.createElement(StyledWrapper$2, _extends$
|
|
16418
|
+
return /*#__PURE__*/React.createElement(StyledWrapper$2, _extends$3({}, nativeProps, {
|
|
14248
16419
|
testID: testID,
|
|
14249
16420
|
style: style
|
|
14250
16421
|
}), /*#__PURE__*/React.createElement(StyledInner, {
|
|
@@ -14366,7 +16537,7 @@ var _excluded$2 = ["testID"];
|
|
|
14366
16537
|
|
|
14367
16538
|
var Spinner = function Spinner(_ref) {
|
|
14368
16539
|
var testID = _ref.testID,
|
|
14369
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
16540
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
14370
16541
|
|
|
14371
16542
|
return /*#__PURE__*/React.createElement(StyledView$1, nativeProps, /*#__PURE__*/React.createElement(StyledSpinnerContainer, {
|
|
14372
16543
|
testID: testID
|
|
@@ -14544,7 +16715,7 @@ var SectionHeading = function SectionHeading(_ref) {
|
|
|
14544
16715
|
}, text)), rightChildren);
|
|
14545
16716
|
};
|
|
14546
16717
|
|
|
14547
|
-
var Container = index$2(View)(function (_ref) {
|
|
16718
|
+
var Container$1 = index$2(View)(function (_ref) {
|
|
14548
16719
|
var theme = _ref.theme;
|
|
14549
16720
|
return {
|
|
14550
16721
|
position: 'relative',
|
|
@@ -14586,9 +16757,9 @@ var TextInput = function TextInput(_ref) {
|
|
|
14586
16757
|
textStyle = _ref.textStyle,
|
|
14587
16758
|
testID = _ref.testID,
|
|
14588
16759
|
accessibilityLabelledBy = _ref.accessibilityLabelledBy,
|
|
14589
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
16760
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
14590
16761
|
|
|
14591
|
-
return /*#__PURE__*/React.createElement(Container, {
|
|
16762
|
+
return /*#__PURE__*/React.createElement(Container$1, {
|
|
14592
16763
|
style: style,
|
|
14593
16764
|
testID: testID
|
|
14594
16765
|
}, label && /*#__PURE__*/React.createElement(Label, {
|
|
@@ -14599,7 +16770,7 @@ var TextInput = function TextInput(_ref) {
|
|
|
14599
16770
|
testID: "input-prefix",
|
|
14600
16771
|
icon: prefix,
|
|
14601
16772
|
size: "xsmall"
|
|
14602
|
-
}), /*#__PURE__*/React.createElement(StyledTextInput, _extends$
|
|
16773
|
+
}), /*#__PURE__*/React.createElement(StyledTextInput, _extends$3({
|
|
14603
16774
|
style: textStyle,
|
|
14604
16775
|
testID: "text-input" // @ts-ignore
|
|
14605
16776
|
,
|
|
@@ -14703,7 +16874,7 @@ function OptionList(_ref2) {
|
|
|
14703
16874
|
return val !== opt.value;
|
|
14704
16875
|
}));
|
|
14705
16876
|
} else {
|
|
14706
|
-
_onPress([].concat(_toConsumableArray(value), [opt.value]));
|
|
16877
|
+
_onPress([].concat(_toConsumableArray$1(value), [opt.value]));
|
|
14707
16878
|
}
|
|
14708
16879
|
}
|
|
14709
16880
|
}));
|
|
@@ -14875,6 +17046,206 @@ var Switch = function Switch(_ref) {
|
|
|
14875
17046
|
}))));
|
|
14876
17047
|
};
|
|
14877
17048
|
|
|
17049
|
+
var childrenWithOverriddenStyle = function childrenWithOverriddenStyle(children) {
|
|
17050
|
+
return Children.map(children, function (child) {
|
|
17051
|
+
var element = child;
|
|
17052
|
+
return (
|
|
17053
|
+
/*#__PURE__*/
|
|
17054
|
+
// Add a wrapper to ensure layout is calculated correctly
|
|
17055
|
+
React.createElement(View, {
|
|
17056
|
+
style: StyleSheet$1.absoluteFill,
|
|
17057
|
+
collapsable: false
|
|
17058
|
+
}, /*#__PURE__*/React.cloneElement(element, _objectSpread2(_objectSpread2({}, element.props), {}, {
|
|
17059
|
+
// Override styles so that each page will fill the parent.
|
|
17060
|
+
style: [element.props.style, StyleSheet$1.absoluteFill]
|
|
17061
|
+
})))
|
|
17062
|
+
);
|
|
17063
|
+
});
|
|
17064
|
+
};
|
|
17065
|
+
|
|
17066
|
+
var VIEW_MANAGER_NAME = 'RNCViewPager';
|
|
17067
|
+
var PagerViewViewManager = requireNativeComponent(VIEW_MANAGER_NAME);
|
|
17068
|
+
function getViewManagerConfig() {
|
|
17069
|
+
var viewManagerName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : VIEW_MANAGER_NAME;
|
|
17070
|
+
return UIManager.getViewManagerConfig(viewManagerName);
|
|
17071
|
+
}
|
|
17072
|
+
|
|
17073
|
+
function _extends() {
|
|
17074
|
+
_extends = Object.assign || function (target) {
|
|
17075
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
17076
|
+
var source = arguments[i];
|
|
17077
|
+
|
|
17078
|
+
for (var key in source) {
|
|
17079
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
17080
|
+
target[key] = source[key];
|
|
17081
|
+
}
|
|
17082
|
+
}
|
|
17083
|
+
}
|
|
17084
|
+
|
|
17085
|
+
return target;
|
|
17086
|
+
};
|
|
17087
|
+
|
|
17088
|
+
return _extends.apply(this, arguments);
|
|
17089
|
+
}
|
|
17090
|
+
|
|
17091
|
+
function _defineProperty(obj, key, value) {
|
|
17092
|
+
if (key in obj) {
|
|
17093
|
+
Object.defineProperty(obj, key, {
|
|
17094
|
+
value: value,
|
|
17095
|
+
enumerable: true,
|
|
17096
|
+
configurable: true,
|
|
17097
|
+
writable: true
|
|
17098
|
+
});
|
|
17099
|
+
} else {
|
|
17100
|
+
obj[key] = value;
|
|
17101
|
+
}
|
|
17102
|
+
|
|
17103
|
+
return obj;
|
|
17104
|
+
}
|
|
17105
|
+
/**
|
|
17106
|
+
* Container that allows to flip left and right between child views. Each
|
|
17107
|
+
* child view of the `PagerView` will be treated as a separate page
|
|
17108
|
+
* and will be stretched to fill the `PagerView`.
|
|
17109
|
+
*
|
|
17110
|
+
* It is important all children are `<View>`s and not composite components.
|
|
17111
|
+
* You can set style properties like `padding` or `backgroundColor` for each
|
|
17112
|
+
* child. It is also important that each child have a `key` prop.
|
|
17113
|
+
*
|
|
17114
|
+
* Example:
|
|
17115
|
+
*
|
|
17116
|
+
* ```
|
|
17117
|
+
* render: function() {
|
|
17118
|
+
* return (
|
|
17119
|
+
* <PagerView
|
|
17120
|
+
* style={styles.PagerView}
|
|
17121
|
+
* initialPage={0}>
|
|
17122
|
+
* <View style={styles.pageStyle} key="1">
|
|
17123
|
+
* <Text>First page</Text>
|
|
17124
|
+
* </View>
|
|
17125
|
+
* <View style={styles.pageStyle} key="2">
|
|
17126
|
+
* <Text>Second page</Text>
|
|
17127
|
+
* </View>
|
|
17128
|
+
* </PagerView>
|
|
17129
|
+
* );
|
|
17130
|
+
* }
|
|
17131
|
+
*
|
|
17132
|
+
* ...
|
|
17133
|
+
*
|
|
17134
|
+
* var styles = {
|
|
17135
|
+
* ...
|
|
17136
|
+
* PagerView: {
|
|
17137
|
+
* flex: 1
|
|
17138
|
+
* },
|
|
17139
|
+
* pageStyle: {
|
|
17140
|
+
* alignItems: 'center',
|
|
17141
|
+
* padding: 20,
|
|
17142
|
+
* }
|
|
17143
|
+
* }
|
|
17144
|
+
* ```
|
|
17145
|
+
*/
|
|
17146
|
+
|
|
17147
|
+
var PagerView = /*#__PURE__*/function (_React$Component) {
|
|
17148
|
+
_inherits$1(PagerView, _React$Component);
|
|
17149
|
+
|
|
17150
|
+
var _super = _createSuper(PagerView);
|
|
17151
|
+
|
|
17152
|
+
function PagerView() {
|
|
17153
|
+
var _this;
|
|
17154
|
+
|
|
17155
|
+
_classCallCheck$1(this, PagerView);
|
|
17156
|
+
|
|
17157
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17158
|
+
args[_key] = arguments[_key];
|
|
17159
|
+
}
|
|
17160
|
+
|
|
17161
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
17162
|
+
|
|
17163
|
+
_defineProperty(_assertThisInitialized$1(_this), "isScrolling", false);
|
|
17164
|
+
|
|
17165
|
+
_defineProperty(_assertThisInitialized$1(_this), "PagerView", /*#__PURE__*/React.createRef());
|
|
17166
|
+
|
|
17167
|
+
_defineProperty(_assertThisInitialized$1(_this), "getInnerViewNode", function () {
|
|
17168
|
+
return _this.PagerView.current.getInnerViewNode();
|
|
17169
|
+
});
|
|
17170
|
+
|
|
17171
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScroll", function (e) {
|
|
17172
|
+
if (_this.props.onPageScroll) {
|
|
17173
|
+
_this.props.onPageScroll(e);
|
|
17174
|
+
} // Not implemented on iOS yet
|
|
17175
|
+
|
|
17176
|
+
|
|
17177
|
+
if (Platform.OS === 'android') {
|
|
17178
|
+
if (_this.props.keyboardDismissMode === 'on-drag') {
|
|
17179
|
+
Keyboard.dismiss();
|
|
17180
|
+
}
|
|
17181
|
+
}
|
|
17182
|
+
});
|
|
17183
|
+
|
|
17184
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageScrollStateChanged", function (e) {
|
|
17185
|
+
if (_this.props.onPageScrollStateChanged) {
|
|
17186
|
+
_this.props.onPageScrollStateChanged(e);
|
|
17187
|
+
}
|
|
17188
|
+
|
|
17189
|
+
_this.isScrolling = e.nativeEvent.pageScrollState === 'dragging';
|
|
17190
|
+
});
|
|
17191
|
+
|
|
17192
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onPageSelected", function (e) {
|
|
17193
|
+
if (_this.props.onPageSelected) {
|
|
17194
|
+
_this.props.onPageSelected(e);
|
|
17195
|
+
}
|
|
17196
|
+
});
|
|
17197
|
+
|
|
17198
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPage", function (selectedPage) {
|
|
17199
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPage, [selectedPage]);
|
|
17200
|
+
});
|
|
17201
|
+
|
|
17202
|
+
_defineProperty(_assertThisInitialized$1(_this), "setPageWithoutAnimation", function (selectedPage) {
|
|
17203
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setPageWithoutAnimation, [selectedPage]);
|
|
17204
|
+
});
|
|
17205
|
+
|
|
17206
|
+
_defineProperty(_assertThisInitialized$1(_this), "setScrollEnabled", function (scrollEnabled) {
|
|
17207
|
+
UIManager.dispatchViewManagerCommand(ReactNative__default.findNodeHandle(_assertThisInitialized$1(_this)), getViewManagerConfig().Commands.setScrollEnabled, [scrollEnabled]);
|
|
17208
|
+
});
|
|
17209
|
+
|
|
17210
|
+
_defineProperty(_assertThisInitialized$1(_this), "_onMoveShouldSetResponderCapture", function () {
|
|
17211
|
+
return _this.isScrolling;
|
|
17212
|
+
});
|
|
17213
|
+
|
|
17214
|
+
return _this;
|
|
17215
|
+
}
|
|
17216
|
+
|
|
17217
|
+
_createClass$1(PagerView, [{
|
|
17218
|
+
key: "deducedLayoutDirection",
|
|
17219
|
+
get: function get() {
|
|
17220
|
+
var shouldUseDeviceRtlSetup = !this.props.layoutDirection || this.props.layoutDirection === 'locale';
|
|
17221
|
+
|
|
17222
|
+
if (shouldUseDeviceRtlSetup) {
|
|
17223
|
+
return I18nManager.isRTL ? 'rtl' : 'ltr';
|
|
17224
|
+
} else {
|
|
17225
|
+
return this.props.layoutDirection;
|
|
17226
|
+
}
|
|
17227
|
+
}
|
|
17228
|
+
}, {
|
|
17229
|
+
key: "render",
|
|
17230
|
+
value: function render() {
|
|
17231
|
+
return /*#__PURE__*/React.createElement(PagerViewViewManager, _extends({}, this.props, {
|
|
17232
|
+
ref: this.PagerView
|
|
17233
|
+
/** TODO: Fix ref type */
|
|
17234
|
+
,
|
|
17235
|
+
style: this.props.style,
|
|
17236
|
+
layoutDirection: this.deducedLayoutDirection,
|
|
17237
|
+
onPageScroll: this._onPageScroll,
|
|
17238
|
+
onPageScrollStateChanged: this._onPageScrollStateChanged,
|
|
17239
|
+
onPageSelected: this._onPageSelected,
|
|
17240
|
+
onMoveShouldSetResponderCapture: this._onMoveShouldSetResponderCapture,
|
|
17241
|
+
children: childrenWithOverriddenStyle(this.props.children)
|
|
17242
|
+
}));
|
|
17243
|
+
}
|
|
17244
|
+
}]);
|
|
17245
|
+
|
|
17246
|
+
return PagerView;
|
|
17247
|
+
}(React.Component);
|
|
17248
|
+
|
|
14878
17249
|
var AnimatedPagerView = Animated.createAnimatedComponent(PagerView);
|
|
14879
17250
|
var TabContainer$1 = index$2(View)({
|
|
14880
17251
|
flex: 1,
|
|
@@ -15058,7 +17429,7 @@ var ScrollableTab = function ScrollableTab(_ref2) {
|
|
|
15058
17429
|
});
|
|
15059
17430
|
}
|
|
15060
17431
|
|
|
15061
|
-
var animation = Animated.parallel(_toConsumableArray(tabs.map(function (_, i) {
|
|
17432
|
+
var animation = Animated.parallel(_toConsumableArray$1(tabs.map(function (_, i) {
|
|
15062
17433
|
return Animated.timing(tabsAnims[i], {
|
|
15063
17434
|
toValue: i === selectedTabIndex ? 1 : 0,
|
|
15064
17435
|
duration: 150,
|
|
@@ -15334,9 +17705,9 @@ var Tag = function Tag(_ref) {
|
|
|
15334
17705
|
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
15335
17706
|
style = _ref.style,
|
|
15336
17707
|
testID = _ref.testID,
|
|
15337
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded);
|
|
17708
|
+
nativeProps = _objectWithoutProperties$1(_ref, _excluded);
|
|
15338
17709
|
|
|
15339
|
-
return /*#__PURE__*/React.createElement(StyledView, _extends$
|
|
17710
|
+
return /*#__PURE__*/React.createElement(StyledView, _extends$3({}, nativeProps, {
|
|
15340
17711
|
themeIntent: intent,
|
|
15341
17712
|
style: style,
|
|
15342
17713
|
testID: testID
|
|
@@ -15345,4 +17716,291 @@ var Tag = function Tag(_ref) {
|
|
|
15345
17716
|
}, content));
|
|
15346
17717
|
};
|
|
15347
17718
|
|
|
15348
|
-
|
|
17719
|
+
var ToastContainerWrapper = index$2(View)(function (_ref) {
|
|
17720
|
+
var theme = _ref.theme,
|
|
17721
|
+
position = _ref.position;
|
|
17722
|
+
return _objectSpread2(_objectSpread2({}, StyleSheet$1.absoluteFillObject), {}, {
|
|
17723
|
+
paddingHorizontal: theme.__hd__.toast.space.largePadding,
|
|
17724
|
+
paddingVertical: theme.__hd__.toast.space.mediumPadding,
|
|
17725
|
+
flexDirection: position === 'bottom' ? 'column-reverse' : 'column',
|
|
17726
|
+
elevation: 9999
|
|
17727
|
+
});
|
|
17728
|
+
});
|
|
17729
|
+
var Container = index$2(Animated.View)(function (_ref2) {
|
|
17730
|
+
var theme = _ref2.theme,
|
|
17731
|
+
themeVariant = _ref2.themeVariant,
|
|
17732
|
+
themeIntent = _ref2.themeIntent;
|
|
17733
|
+
return {
|
|
17734
|
+
borderRadius: themeVariant === 'round' ? theme.__hd__.toast.radii["default"] : 0,
|
|
17735
|
+
backgroundColor: theme.__hd__.toast.colors[themeIntent],
|
|
17736
|
+
minHeight: theme.__hd__.toast.sizes.height,
|
|
17737
|
+
flexDirection: 'row'
|
|
17738
|
+
};
|
|
17739
|
+
});
|
|
17740
|
+
var IconContainer = index$2(View)(function (_ref3) {
|
|
17741
|
+
var theme = _ref3.theme;
|
|
17742
|
+
return {
|
|
17743
|
+
alignItems: 'center',
|
|
17744
|
+
paddingLeft: theme.__hd__.toast.space.mediumPadding
|
|
17745
|
+
};
|
|
17746
|
+
});
|
|
17747
|
+
var TextContainer = index$2(View)(function (_ref4) {
|
|
17748
|
+
var theme = _ref4.theme;
|
|
17749
|
+
return {
|
|
17750
|
+
paddingHorizontal: theme.__hd__.toast.space.mediumPadding,
|
|
17751
|
+
flex: 1
|
|
17752
|
+
};
|
|
17753
|
+
});
|
|
17754
|
+
var ContentContainer = index$2(View)(function (_ref5) {
|
|
17755
|
+
var theme = _ref5.theme,
|
|
17756
|
+
showDivider = _ref5.showDivider;
|
|
17757
|
+
return {
|
|
17758
|
+
paddingVertical: theme.__hd__.toast.space.mediumPadding,
|
|
17759
|
+
flex: 1,
|
|
17760
|
+
borderRightWidth: showDivider ? theme.__hd__.toast.borderWidths.base : 0,
|
|
17761
|
+
borderColor: theme.__hd__.toast.colors.divider,
|
|
17762
|
+
flexDirection: 'row'
|
|
17763
|
+
};
|
|
17764
|
+
});
|
|
17765
|
+
var CTAWrapper = index$2(TouchableOpacity)(function (_ref6) {
|
|
17766
|
+
var theme = _ref6.theme;
|
|
17767
|
+
return {
|
|
17768
|
+
paddingHorizontal: theme.__hd__.alert.space.padding,
|
|
17769
|
+
justifyContent: 'center'
|
|
17770
|
+
};
|
|
17771
|
+
});
|
|
17772
|
+
|
|
17773
|
+
var ToastContext = /*#__PURE__*/createContext({});
|
|
17774
|
+
var ToastConfigContext = /*#__PURE__*/createContext({});
|
|
17775
|
+
var useToastConfig = function useToastConfig() {
|
|
17776
|
+
return useContext(ToastConfigContext);
|
|
17777
|
+
};
|
|
17778
|
+
var useToast = function useToast() {
|
|
17779
|
+
return useContext(ToastContext);
|
|
17780
|
+
};
|
|
17781
|
+
|
|
17782
|
+
var getIntentIcon = function getIntentIcon(intent) {
|
|
17783
|
+
switch (intent) {
|
|
17784
|
+
case 'success':
|
|
17785
|
+
return 'circle-ok';
|
|
17786
|
+
|
|
17787
|
+
case 'warning':
|
|
17788
|
+
return 'warning';
|
|
17789
|
+
|
|
17790
|
+
case 'info':
|
|
17791
|
+
return 'circle-info';
|
|
17792
|
+
|
|
17793
|
+
case 'error':
|
|
17794
|
+
return 'circle-warning';
|
|
17795
|
+
}
|
|
17796
|
+
};
|
|
17797
|
+
|
|
17798
|
+
var Toast$1 = function Toast(_ref) {
|
|
17799
|
+
var content = _ref.content,
|
|
17800
|
+
icon = _ref.icon,
|
|
17801
|
+
_ref$variant = _ref.variant,
|
|
17802
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
17803
|
+
_ref$intent = _ref.intent,
|
|
17804
|
+
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
17805
|
+
style = _ref.style,
|
|
17806
|
+
_ref$duration = _ref.duration,
|
|
17807
|
+
duration = _ref$duration === void 0 ? 2000 : _ref$duration,
|
|
17808
|
+
_ref$autoDismiss = _ref.autoDismiss,
|
|
17809
|
+
autoDismiss = _ref$autoDismiss === void 0 ? true : _ref$autoDismiss,
|
|
17810
|
+
onAction = _ref.onAction,
|
|
17811
|
+
actionLabel = _ref.actionLabel,
|
|
17812
|
+
onDismiss = _ref.onDismiss;
|
|
17813
|
+
var animatedValue = useRef(new Animated.Value(0)).current;
|
|
17814
|
+
var toastConfig = useToastConfig();
|
|
17815
|
+
useEffect(function () {
|
|
17816
|
+
if (autoDismiss && duration >= 0) {
|
|
17817
|
+
var id = setTimeout(function () {
|
|
17818
|
+
return onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
17819
|
+
}, duration);
|
|
17820
|
+
return function () {
|
|
17821
|
+
return clearTimeout(id);
|
|
17822
|
+
};
|
|
17823
|
+
} // Consistent return
|
|
17824
|
+
|
|
17825
|
+
|
|
17826
|
+
return function () {};
|
|
17827
|
+
}, []);
|
|
17828
|
+
useEffect(function () {
|
|
17829
|
+
var animation = Animated.timing(animatedValue, {
|
|
17830
|
+
toValue: 1,
|
|
17831
|
+
useNativeDriver: true
|
|
17832
|
+
});
|
|
17833
|
+
animation.start();
|
|
17834
|
+
return function () {
|
|
17835
|
+
return animation.stop();
|
|
17836
|
+
};
|
|
17837
|
+
}, []);
|
|
17838
|
+
useLayoutEffect(function () {
|
|
17839
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
17840
|
+
});
|
|
17841
|
+
var interpolateY = animatedValue.interpolate({
|
|
17842
|
+
inputRange: [0, 1],
|
|
17843
|
+
outputRange: [toastConfig.position === 'top' ? -20 : 20, 0]
|
|
17844
|
+
});
|
|
17845
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
17846
|
+
themeVariant: variant,
|
|
17847
|
+
themeIntent: intent,
|
|
17848
|
+
style: [style, {
|
|
17849
|
+
opacity: animatedValue,
|
|
17850
|
+
transform: [{
|
|
17851
|
+
translateY: interpolateY
|
|
17852
|
+
}]
|
|
17853
|
+
}]
|
|
17854
|
+
}, /*#__PURE__*/React.createElement(ContentContainer, {
|
|
17855
|
+
showDivider: !!actionLabel
|
|
17856
|
+
}, icon !== null ? /*#__PURE__*/React.createElement(IconContainer, {
|
|
17857
|
+
testID: "toast-left-icon"
|
|
17858
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
17859
|
+
icon: icon || getIntentIcon(intent),
|
|
17860
|
+
size: "small"
|
|
17861
|
+
})) : null, /*#__PURE__*/React.createElement(TextContainer, null, typeof content === 'string' ? /*#__PURE__*/React.createElement(Typography.Text, null, content) : content)), actionLabel ? /*#__PURE__*/React.createElement(CTAWrapper, {
|
|
17862
|
+
testID: "toast-action-button",
|
|
17863
|
+
onPress: function onPress() {
|
|
17864
|
+
onAction === null || onAction === void 0 ? void 0 : onAction();
|
|
17865
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
17866
|
+
}
|
|
17867
|
+
}, typeof actionLabel === 'string' ? /*#__PURE__*/React.createElement(Typography.Text, {
|
|
17868
|
+
fontWeight: "semi-bold"
|
|
17869
|
+
}, actionLabel) : actionLabel) : null);
|
|
17870
|
+
};
|
|
17871
|
+
|
|
17872
|
+
var generateID = function generateID() {
|
|
17873
|
+
return (performance.now().toString(36) + Math.random().toString(36)).replace(/\./g, '');
|
|
17874
|
+
};
|
|
17875
|
+
|
|
17876
|
+
var SingleToastDisplay = function SingleToastDisplay(_ref) {
|
|
17877
|
+
var toastList = _ref.toastList,
|
|
17878
|
+
setToastList = _ref.setToastList;
|
|
17879
|
+
var theme = useTheme$1();
|
|
17880
|
+
var toast = toastList[toastList.length - 1];
|
|
17881
|
+
return toast ? /*#__PURE__*/React.createElement(Toast$1, _extends$3({}, toast.props, {
|
|
17882
|
+
key: toast.id,
|
|
17883
|
+
style: {
|
|
17884
|
+
marginBottom: theme.space.small
|
|
17885
|
+
},
|
|
17886
|
+
onDismiss: function onDismiss() {
|
|
17887
|
+
var _toast$props$onDismis, _toast$props;
|
|
17888
|
+
|
|
17889
|
+
setToastList(function (state) {
|
|
17890
|
+
return state.filter(function (item) {
|
|
17891
|
+
return item.id !== toast.id;
|
|
17892
|
+
});
|
|
17893
|
+
});
|
|
17894
|
+
(_toast$props$onDismis = (_toast$props = toast.props).onDismiss) === null || _toast$props$onDismis === void 0 ? void 0 : _toast$props$onDismis.call(_toast$props);
|
|
17895
|
+
}
|
|
17896
|
+
})) : null;
|
|
17897
|
+
};
|
|
17898
|
+
|
|
17899
|
+
var ToastContainer = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
17900
|
+
var _ref2$displayType = _ref2.displayType,
|
|
17901
|
+
displayType = _ref2$displayType === void 0 ? 'single' : _ref2$displayType,
|
|
17902
|
+
_ref2$position = _ref2.position,
|
|
17903
|
+
position = _ref2$position === void 0 ? 'top' : _ref2$position,
|
|
17904
|
+
style = _ref2.style;
|
|
17905
|
+
var theme = useTheme$1();
|
|
17906
|
+
|
|
17907
|
+
var _useState = useState([]),
|
|
17908
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17909
|
+
toastList = _useState2[0],
|
|
17910
|
+
setToastList = _useState2[1];
|
|
17911
|
+
|
|
17912
|
+
useImperativeHandle(ref, function () {
|
|
17913
|
+
return {
|
|
17914
|
+
show: function show(props) {
|
|
17915
|
+
var item = {
|
|
17916
|
+
id: generateID(),
|
|
17917
|
+
props: props
|
|
17918
|
+
};
|
|
17919
|
+
setToastList(function (state) {
|
|
17920
|
+
return [item].concat(_toConsumableArray$1(state));
|
|
17921
|
+
});
|
|
17922
|
+
return item.id;
|
|
17923
|
+
},
|
|
17924
|
+
hide: function hide(id) {
|
|
17925
|
+
setToastList(function (state) {
|
|
17926
|
+
return state.filter(function (item) {
|
|
17927
|
+
return item.id !== id;
|
|
17928
|
+
});
|
|
17929
|
+
});
|
|
17930
|
+
},
|
|
17931
|
+
clearAll: function clearAll() {
|
|
17932
|
+
setToastList([]);
|
|
17933
|
+
}
|
|
17934
|
+
};
|
|
17935
|
+
});
|
|
17936
|
+
return /*#__PURE__*/React.createElement(ToastContainerWrapper, {
|
|
17937
|
+
pointerEvents: "box-none",
|
|
17938
|
+
position: position,
|
|
17939
|
+
style: style
|
|
17940
|
+
}, displayType === 'single' ? /*#__PURE__*/React.createElement(SingleToastDisplay, {
|
|
17941
|
+
toastList: toastList,
|
|
17942
|
+
setToastList: setToastList
|
|
17943
|
+
}) : toastList.map(function (_ref3) {
|
|
17944
|
+
var id = _ref3.id,
|
|
17945
|
+
props = _ref3.props;
|
|
17946
|
+
return /*#__PURE__*/React.createElement(Toast$1, _extends$3({}, props, {
|
|
17947
|
+
key: id,
|
|
17948
|
+
style: {
|
|
17949
|
+
marginBottom: theme.space.small
|
|
17950
|
+
},
|
|
17951
|
+
onDismiss: function onDismiss() {
|
|
17952
|
+
var _props$onDismiss;
|
|
17953
|
+
|
|
17954
|
+
setToastList(function (state) {
|
|
17955
|
+
return state.filter(function (item) {
|
|
17956
|
+
return item.id !== id;
|
|
17957
|
+
});
|
|
17958
|
+
});
|
|
17959
|
+
(_props$onDismiss = props.onDismiss) === null || _props$onDismiss === void 0 ? void 0 : _props$onDismiss.call(props);
|
|
17960
|
+
}
|
|
17961
|
+
}));
|
|
17962
|
+
}));
|
|
17963
|
+
});
|
|
17964
|
+
|
|
17965
|
+
var ToastProvider = function ToastProvider(_ref) {
|
|
17966
|
+
var children = _ref.children,
|
|
17967
|
+
_ref$displayType = _ref.displayType,
|
|
17968
|
+
displayType = _ref$displayType === void 0 ? 'single' : _ref$displayType,
|
|
17969
|
+
_ref$position = _ref.position,
|
|
17970
|
+
position = _ref$position === void 0 ? 'top' : _ref$position;
|
|
17971
|
+
var toastRef = useRef(null);
|
|
17972
|
+
|
|
17973
|
+
var _useState = useState({}),
|
|
17974
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17975
|
+
refState = _useState2[0],
|
|
17976
|
+
setRefState = _useState2[1];
|
|
17977
|
+
|
|
17978
|
+
useEffect(function () {
|
|
17979
|
+
if (toastRef.current) {
|
|
17980
|
+
setRefState(toastRef.current);
|
|
17981
|
+
}
|
|
17982
|
+
}, []);
|
|
17983
|
+
var config = useMemo(function () {
|
|
17984
|
+
return {
|
|
17985
|
+
displayType: displayType,
|
|
17986
|
+
position: position
|
|
17987
|
+
};
|
|
17988
|
+
}, [displayType, position]);
|
|
17989
|
+
return /*#__PURE__*/React.createElement(ToastContext.Provider, {
|
|
17990
|
+
value: refState
|
|
17991
|
+
}, children, /*#__PURE__*/React.createElement(ToastConfigContext.Provider, {
|
|
17992
|
+
value: config
|
|
17993
|
+
}, /*#__PURE__*/React.createElement(ToastContainer, {
|
|
17994
|
+
ref: toastRef,
|
|
17995
|
+
displayType: displayType,
|
|
17996
|
+
position: position
|
|
17997
|
+
})));
|
|
17998
|
+
};
|
|
17999
|
+
|
|
18000
|
+
var Toast = {
|
|
18001
|
+
Provider: ToastProvider,
|
|
18002
|
+
Container: ToastContainer,
|
|
18003
|
+
useToast: useToast
|
|
18004
|
+
};
|
|
18005
|
+
|
|
18006
|
+
export { Alert, Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet, CompoundButton as Button, Card, CheckBox as Checkbox, Collapse, ContentNavigator, Divider, Drawer, index$1 as FAB, Icon, Progress, CompoundRadio as Radio, SectionHeading, CompoundSelect as Select, Spinner, Switch, index as Tabs, Tag, TextInput, ThemeProvider, Toast, Typography, getTheme, scale, theme, useTheme };
|