@hero-design/rn 7.7.0 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/es/index.js +1772 -334
- package/lib/index.js +1777 -337
- package/package.json +4 -8
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Button/Button.tsx +4 -2
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +7 -2
- package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +2 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +40 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +242 -0
- package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +2 -0
- package/src/components/Button/LoadingIndicator/index.tsx +3 -1
- package/src/components/Button/StyledButton.tsx +15 -2
- package/src/components/Button/__tests__/Button.spec.tsx +2 -0
- package/src/components/Button/__tests__/StyledButton.spec.tsx +12 -0
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +314 -0
- package/src/components/Card/DataCard/StyledDataCard.tsx +20 -0
- package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +24 -0
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +97 -0
- package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +156 -0
- package/src/components/Card/DataCard/__tests__/index.spec.tsx +30 -0
- package/src/components/Card/DataCard/index.tsx +35 -0
- package/src/components/Card/index.tsx +7 -2
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Collapse/index.tsx +1 -1
- package/src/components/Icon/index.tsx +1 -1
- package/src/components/List/BasicListItem.tsx +98 -0
- package/src/components/List/ListItem.tsx +142 -0
- package/src/components/List/StyledBasicListItem.tsx +34 -0
- package/src/components/List/StyledListItem.tsx +82 -0
- package/src/components/List/__tests__/BasicListItem.spec.tsx +37 -0
- package/src/components/List/__tests__/ListItem.spec.tsx +110 -0
- package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +24 -0
- package/src/components/List/__tests__/StyledListItem.spec.tsx +48 -0
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +103 -0
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +760 -0
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +105 -0
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +200 -0
- package/src/components/List/index.tsx +14 -0
- package/src/components/SectionHeading/index.tsx +1 -1
- package/src/components/Select/Footer.tsx +13 -0
- package/src/components/Select/MultiSelect/Option.tsx +25 -0
- package/src/components/Select/MultiSelect/OptionList.tsx +30 -63
- package/src/components/Select/MultiSelect/__tests__/Option.spec.tsx +16 -0
- package/src/components/Select/MultiSelect/__tests__/OptionList.spec.tsx +42 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +70 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +627 -0
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +6 -6
- package/src/components/Select/MultiSelect/index.tsx +8 -7
- package/src/components/Select/SingleSelect/Option.tsx +23 -0
- package/src/components/Select/SingleSelect/OptionList.tsx +43 -0
- package/src/components/Select/SingleSelect/__tests__/Option.spec.tsx +16 -0
- package/src/components/Select/SingleSelect/__tests__/OptionList.spec.tsx +42 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +56 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +571 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +1430 -0
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +89 -0
- package/src/components/Select/SingleSelect/index.tsx +89 -0
- package/src/components/Select/{MultiSelect/StyledMultiSelect.tsx → StyledSelect.tsx} +1 -1
- package/src/components/Select/{MultiSelect/__tests__/StyledMultiSelect.spec.tsx → __tests__/StyledSelect.spec.tsx} +2 -2
- package/src/components/Select/{MultiSelect/__tests__/__snapshots__/StyledMultiSelect.spec.tsx.snap → __tests__/__snapshots__/StyledSelect.spec.tsx.snap} +0 -0
- package/src/components/Select/helpers.tsx +18 -0
- package/src/components/Select/index.tsx +4 -3
- package/src/components/Select/{MultiSelect/types.ts → types.ts} +0 -0
- package/src/components/Switch/index.tsx +1 -1
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +2 -2
- package/src/components/Toolbar/StyledToolbar.tsx +42 -0
- package/src/components/Toolbar/ToolbarGroup.tsx +31 -0
- package/src/components/Toolbar/ToolbarItem.tsx +57 -0
- package/src/components/Toolbar/__tests__/ToolbarGroup.spec.tsx +32 -0
- package/src/components/Toolbar/__tests__/ToolbarItem.spec.tsx +57 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +391 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +355 -0
- package/src/components/Toolbar/index.tsx +18 -0
- package/src/components/Typography/Text/StyledText.tsx +8 -1
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +5 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +110 -0
- package/src/components/Typography/Text/index.tsx +9 -2
- package/src/index.ts +4 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +79 -3
- package/src/theme/components/button.ts +2 -0
- package/src/theme/components/card.ts +8 -1
- package/src/theme/components/list.ts +46 -0
- package/src/theme/components/toolbar.ts +27 -0
- package/src/theme/components/typography.ts +4 -0
- package/src/theme/global/colors.ts +9 -2
- package/src/theme/global/space.ts +2 -0
- package/src/theme/index.ts +6 -0
- package/tsconfig.json +1 -2
- package/types/components/Alert/StyledAlert.d.ts +0 -0
- package/types/components/Alert/__tests__/index.spec.d.ts +0 -0
- package/types/components/Alert/index.d.ts +0 -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 +1 -1
- 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 +2 -2
- package/types/components/Button/IconButton.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
- 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 +1 -1
- package/types/components/Button/StyledButton.d.ts +2 -2
- 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/DataCard/StyledDataCard.d.ts +16 -0
- package/types/components/Card/DataCard/__tests__/StyledDataCard.spec.d.ts +1 -0
- package/types/components/Card/DataCard/__tests__/index.spec.d.ts +1 -0
- package/types/components/Card/DataCard/index.d.ts +22 -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 +7 -3
- package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
- package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +0 -0
- package/types/components/Checkbox/__tests__/index.spec.d.ts +0 -0
- package/types/components/Checkbox/index.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- package/types/components/Icon/utils.d.ts +0 -0
- package/types/components/List/BasicListItem.d.ts +43 -0
- package/types/components/List/ListItem.d.ts +51 -0
- package/types/components/List/StyledBasicListItem.d.ts +29 -0
- package/types/components/List/StyledListItem.d.ts +51 -0
- package/types/components/List/__tests__/BasicListItem.spec.d.ts +1 -0
- package/types/components/List/__tests__/ListItem.spec.d.ts +1 -0
- package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +1 -0
- package/types/components/List/__tests__/StyledListItem.spec.d.ts +1 -0
- package/types/components/List/index.d.ts +8 -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/Radio/types.d.ts +0 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +0 -0
- package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -0
- package/types/components/SectionHeading/index.d.ts +1 -1
- package/types/components/Select/Footer.d.ts +5 -0
- package/types/components/Select/MultiSelect/Footer.d.ts +0 -0
- package/types/components/Select/MultiSelect/Option.d.ts +6 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +7 -1
- package/types/components/Select/MultiSelect/StyledMultiSelect.d.ts +0 -0
- package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +1 -0
- package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +1 -0
- package/types/components/Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts +0 -0
- package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +0 -0
- package/types/components/Select/MultiSelect/index.d.ts +4 -4
- package/types/components/Select/MultiSelect/types.d.ts +0 -0
- package/types/components/Select/SingleSelect/Option.d.ts +6 -0
- package/types/components/Select/SingleSelect/OptionList.d.ts +9 -0
- package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +1 -0
- package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +1 -0
- package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +1 -0
- package/types/components/Select/SingleSelect/index.d.ts +35 -0
- package/types/components/Select/StyledSelect.d.ts +26 -0
- package/types/components/Select/__tests__/StyledSelect.spec.d.ts +1 -0
- package/types/components/Select/helpers.d.ts +2 -0
- package/types/components/Select/index.d.ts +3 -3
- package/types/components/Select/types.d.ts +5 -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/Switch/StyledSwitch.d.ts +0 -0
- package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +0 -0
- package/types/components/Switch/__tests__/index.spec.d.ts +0 -0
- package/types/components/Switch/index.d.ts +1 -1
- 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 +0 -0
- package/types/components/Toast/Toast.d.ts +0 -0
- package/types/components/Toast/ToastContainer.d.ts +0 -0
- package/types/components/Toast/ToastContext.d.ts +0 -0
- package/types/components/Toast/ToastProvider.d.ts +0 -0
- package/types/components/Toast/__tests__/Toast.spec.d.ts +0 -0
- package/types/components/Toast/__tests__/ToastContainer.spec.d.ts +0 -0
- package/types/components/Toast/index.d.ts +0 -0
- package/types/components/Toast/types.d.ts +0 -0
- package/types/components/Toolbar/StyledToolbar.d.ts +22 -0
- package/types/components/Toolbar/ToolbarGroup.d.ts +13 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +25 -0
- package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +1 -0
- package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +1 -0
- package/types/components/Toolbar/index.d.ts +11 -0
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- 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 +2 -2
- 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/alert.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 +2 -0
- package/types/theme/components/card.d.ts +7 -0
- package/types/theme/components/checkbox.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/list.d.ts +40 -0
- package/types/theme/components/progress.d.ts +0 -0
- package/types/theme/components/radio.d.ts +0 -0
- package/types/theme/components/sectionHeading.d.ts +0 -0
- package/types/theme/components/select.d.ts +0 -0
- package/types/theme/components/spinner.d.ts +0 -0
- package/types/theme/components/switch.d.ts +0 -0
- package/types/theme/components/tabs.d.ts +0 -0
- package/types/theme/components/tag.d.ts +0 -0
- package/types/theme/components/textInput.d.ts +0 -0
- package/types/theme/components/toast.d.ts +0 -0
- package/types/theme/components/toolbar.d.ts +21 -0
- package/types/theme/components/typography.d.ts +4 -0
- package/types/theme/global/borders.d.ts +0 -0
- package/types/theme/global/colors.d.ts +5 -0
- package/types/theme/global/index.d.ts +5 -0
- package/types/theme/global/scale.d.ts +0 -0
- package/types/theme/global/space.d.ts +1 -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/playground/.detoxrc.json +0 -49
- package/playground/.prettierrc.json +0 -8
- package/playground/.turbo/turbo-type-check.log +0 -7
- package/playground/app.json +0 -9
- package/playground/babel.config.js +0 -63
- package/playground/e2e/config.json +0 -9
- package/playground/e2e/environment.js +0 -23
- package/playground/e2e/firstTest.e2e.js +0 -16
- package/playground/expoEntry.js +0 -5
- package/playground/fonts/be-vietnam-pro-light.ttf +0 -0
- package/playground/fonts/be-vietnam-pro-regular.ttf +0 -0
- package/playground/fonts/be-vietnam-pro-semibold.ttf +0 -0
- package/playground/fonts/hero-icons.ttf +0 -0
- package/playground/index.js +0 -7
- package/playground/ios/MobileHeroDesignPlayground/AppDelegate.h +0 -9
- package/playground/ios/MobileHeroDesignPlayground/AppDelegate.m +0 -75
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/Contents.json +0 -6
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/Contents.json +0 -21
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
- package/playground/ios/MobileHeroDesignPlayground/Info.plist +0 -85
- package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground-Bridging-Header.h +0 -3
- package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground.entitlements +0 -8
- package/playground/ios/MobileHeroDesignPlayground/SplashScreen.storyboard +0 -40
- package/playground/ios/MobileHeroDesignPlayground/Supporting/Expo.plist +0 -16
- package/playground/ios/MobileHeroDesignPlayground/main.m +0 -10
- package/playground/ios/MobileHeroDesignPlayground/noop-file.swift +0 -4
- package/playground/ios/MobileHeroDesignPlayground.xcodeproj/project.pbxproj +0 -515
- package/playground/ios/MobileHeroDesignPlayground.xcodeproj/xcshareddata/xcschemes/MobileHeroDesignPlayground.xcscheme +0 -88
- package/playground/ios/MobileHeroDesignPlayground.xcworkspace/contents.xcworkspacedata +0 -10
- package/playground/ios/MobileHeroDesignPlayground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/playground/ios/Podfile +0 -49
- package/playground/ios/Podfile.lock +0 -478
- package/playground/ios/Podfile.properties.json +0 -3
- package/playground/metro.config.js +0 -24
- package/playground/package.json +0 -63
- package/playground/src/Alert.tsx +0 -80
- package/playground/src/App.tsx +0 -210
- package/playground/src/Avatar.tsx +0 -102
- package/playground/src/Badge.tsx +0 -187
- package/playground/src/BottomNavigation.tsx +0 -72
- package/playground/src/BottomSheet.tsx +0 -43
- package/playground/src/Button.tsx +0 -170
- package/playground/src/Card.tsx +0 -342
- package/playground/src/Checkbox.tsx +0 -55
- package/playground/src/Collapse.tsx +0 -99
- package/playground/src/ContentNavigator.tsx +0 -58
- package/playground/src/Divider.tsx +0 -13
- package/playground/src/Drawer.tsx +0 -32
- package/playground/src/FAB.tsx +0 -66
- package/playground/src/Icon.tsx +0 -144
- package/playground/src/IconButton.tsx +0 -78
- package/playground/src/MultipleThemes.tsx +0 -34
- package/playground/src/Progress.tsx +0 -95
- package/playground/src/Radio.tsx +0 -25
- package/playground/src/SectionHeading.tsx +0 -68
- package/playground/src/Select.tsx +0 -32
- package/playground/src/Spinner.tsx +0 -19
- package/playground/src/Switch.tsx +0 -80
- package/playground/src/Tabs.tsx +0 -136
- package/playground/src/Tag.tsx +0 -45
- package/playground/src/TextInput.tsx +0 -14
- package/playground/src/Toast.tsx +0 -114
- package/playground/src/Typography.tsx +0 -23
- package/playground/tsconfig.json +0 -21
- package/src/components/Select/MultiSelect/Footer.tsx +0 -15
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { ContentNavigator, Typography, useTheme } from '@hero-design/rn';
|
|
4
|
-
|
|
5
|
-
function addDays(date: Date, numDays: number) {
|
|
6
|
-
const milliseconds = numDays * 24 * 60 * 60 * 1000;
|
|
7
|
-
return new Date(date.valueOf() + milliseconds);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function getMondayAndSunday(date: Date) {
|
|
11
|
-
const daysFromMonday = (date.getDay() || 7) - 1;
|
|
12
|
-
const monday = addDays(date, -daysFromMonday);
|
|
13
|
-
const sunday = addDays(monday, 6);
|
|
14
|
-
|
|
15
|
-
return { monday, sunday };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function formatDate(date: Date) {
|
|
19
|
-
return date.toLocaleDateString('en-US', {
|
|
20
|
-
year: 'numeric',
|
|
21
|
-
month: 'short',
|
|
22
|
-
day: 'numeric',
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const ContentNavigatorPlayground = (): JSX.Element => {
|
|
27
|
-
const theme = useTheme();
|
|
28
|
-
const [age, setAge] = useState(20);
|
|
29
|
-
const [date, setDate] = useState(new Date());
|
|
30
|
-
const { monday, sunday } = getMondayAndSunday(date);
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<View style={{ margin: theme.space.medium }}>
|
|
34
|
-
<View style={{ flexDirection: 'row' }}>
|
|
35
|
-
<Typography.Text style={{ paddingRight: theme.space.medium }}>
|
|
36
|
-
Age (18 to 25):
|
|
37
|
-
</Typography.Text>
|
|
38
|
-
<ContentNavigator
|
|
39
|
-
value={age}
|
|
40
|
-
onPreviousPress={() => setAge(age - 1)}
|
|
41
|
-
onNextPress={() => setAge(age + 1)}
|
|
42
|
-
previousDisabled={age <= 18}
|
|
43
|
-
nextDisabled={age >= 25}
|
|
44
|
-
/>
|
|
45
|
-
</View>
|
|
46
|
-
<Typography.Text>Week calendar:</Typography.Text>
|
|
47
|
-
<View style={{ flexDirection: 'row' }}>
|
|
48
|
-
<ContentNavigator
|
|
49
|
-
value={`${formatDate(monday)} - ${formatDate(sunday)}`}
|
|
50
|
-
onPreviousPress={() => setDate(addDays(date, -7))}
|
|
51
|
-
onNextPress={() => setDate(addDays(date, 7))}
|
|
52
|
-
/>
|
|
53
|
-
</View>
|
|
54
|
-
</View>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default ContentNavigatorPlayground;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { Divider } from '@hero-design/rn';
|
|
4
|
-
|
|
5
|
-
const DividerPlayground = () => (
|
|
6
|
-
<View>
|
|
7
|
-
<Divider marginHorizontal="xlarge" marginVertical="medium" />
|
|
8
|
-
<Divider marginHorizontal="large" marginVertical="large" />
|
|
9
|
-
<Divider marginHorizontal="medium" marginVertical="xlarge" />
|
|
10
|
-
</View>
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
export default DividerPlayground;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Button, SafeAreaView, Text, View } from 'react-native';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
|
|
4
|
-
import { Drawer } from '@hero-design/rn';
|
|
5
|
-
|
|
6
|
-
const DrawerContent = () => (
|
|
7
|
-
<View style={{ padding: 30 }}>
|
|
8
|
-
<Text>Drawer Content</Text>
|
|
9
|
-
<Text>Drawer Content</Text>
|
|
10
|
-
<Text>Drawer Content</Text>
|
|
11
|
-
<Text>Drawer Content</Text>
|
|
12
|
-
<Text>Drawer Content</Text>
|
|
13
|
-
<Text>Drawer Content</Text>
|
|
14
|
-
</View>
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const DrawerPlayground = () => {
|
|
18
|
-
const [visible, setVisibility] = useState(false);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<SafeAreaView
|
|
22
|
-
style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}
|
|
23
|
-
>
|
|
24
|
-
<Drawer visible={visible} onDismiss={() => setVisibility(false)}>
|
|
25
|
-
<DrawerContent />
|
|
26
|
-
</Drawer>
|
|
27
|
-
<Button title="Toggle Drawer" onPress={() => setVisibility(!visible)} />
|
|
28
|
-
</SafeAreaView>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default DrawerPlayground;
|
package/playground/src/FAB.tsx
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { TouchableHighlight } from 'react-native';
|
|
3
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
4
|
-
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
|
|
5
|
-
import { FAB, Typography, useTheme } from '@hero-design/rn';
|
|
6
|
-
|
|
7
|
-
const FABPlayground = (): JSX.Element => {
|
|
8
|
-
const [active, setActive] = useState(false);
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
return (
|
|
11
|
-
<SafeAreaProvider>
|
|
12
|
-
<SafeAreaView style={{ flex: 1 }}>
|
|
13
|
-
<TouchableHighlight
|
|
14
|
-
onPress={() => {
|
|
15
|
-
alert('touched');
|
|
16
|
-
}}
|
|
17
|
-
>
|
|
18
|
-
<Typography.Text
|
|
19
|
-
style={{
|
|
20
|
-
backgroundColor: theme.colors.dangerBackground,
|
|
21
|
-
margin: theme.space.xxxlarge,
|
|
22
|
-
}}
|
|
23
|
-
fontSize="xlarge"
|
|
24
|
-
fontWeight="semi-bold"
|
|
25
|
-
>
|
|
26
|
-
Content View should be blured when menu list is shown
|
|
27
|
-
</Typography.Text>
|
|
28
|
-
</TouchableHighlight>
|
|
29
|
-
<FAB.ActionGroup
|
|
30
|
-
style={{
|
|
31
|
-
marginBottom: theme.space.large,
|
|
32
|
-
}}
|
|
33
|
-
items={[
|
|
34
|
-
{ icon: 'speaker', title: 'Give shout out' },
|
|
35
|
-
{ icon: 'target', title: 'Goal' },
|
|
36
|
-
{ icon: 'plane', title: 'Leave request' },
|
|
37
|
-
{ icon: 'health-bag', title: 'Safety incident' },
|
|
38
|
-
{ icon: 'clock', title: 'Timesheets' },
|
|
39
|
-
]}
|
|
40
|
-
headerTitle="What would you like to create?"
|
|
41
|
-
onPress={() => {
|
|
42
|
-
setActive(!active);
|
|
43
|
-
}}
|
|
44
|
-
active={active}
|
|
45
|
-
/>
|
|
46
|
-
|
|
47
|
-
<FAB
|
|
48
|
-
style={{
|
|
49
|
-
position: 'absolute',
|
|
50
|
-
bottom: 0,
|
|
51
|
-
marginLeft: theme.space.large,
|
|
52
|
-
marginBottom: theme.space.large,
|
|
53
|
-
}}
|
|
54
|
-
onPress={() => {
|
|
55
|
-
alert('pressed shout out');
|
|
56
|
-
}}
|
|
57
|
-
title="Shout out"
|
|
58
|
-
icon="pencil"
|
|
59
|
-
animated
|
|
60
|
-
/>
|
|
61
|
-
</SafeAreaView>
|
|
62
|
-
</SafeAreaProvider>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export default FABPlayground;
|
package/playground/src/Icon.tsx
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ScrollView, View } from 'react-native';
|
|
3
|
-
import { Typography, Icon, useTheme } from '@hero-design/rn';
|
|
4
|
-
|
|
5
|
-
const IconPlayground = () => {
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<ScrollView
|
|
10
|
-
contentContainerStyle={{
|
|
11
|
-
padding: theme.space.medium,
|
|
12
|
-
}}
|
|
13
|
-
>
|
|
14
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
15
|
-
Bottom nav - active
|
|
16
|
-
</Typography.Text>
|
|
17
|
-
<View style={{ flexDirection: 'row', marginBottom: theme.space.large }}>
|
|
18
|
-
<Icon icon="home" style={{ marginEnd: theme.space.medium }} />
|
|
19
|
-
<Icon icon="speaker" style={{ marginEnd: theme.space.medium }} />
|
|
20
|
-
<Icon icon="bell" style={{ marginEnd: theme.space.medium }} />
|
|
21
|
-
<Icon icon="user" />
|
|
22
|
-
</View>
|
|
23
|
-
|
|
24
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
25
|
-
Bottom nav - inactive
|
|
26
|
-
</Typography.Text>
|
|
27
|
-
<View style={{ flexDirection: 'row', marginBottom: theme.space.large }}>
|
|
28
|
-
<Icon icon="home-outlined" style={{ marginEnd: theme.space.medium }} />
|
|
29
|
-
<Icon
|
|
30
|
-
icon="speaker-outlined"
|
|
31
|
-
style={{ marginEnd: theme.space.medium }}
|
|
32
|
-
/>
|
|
33
|
-
<Icon icon="bell-outlined" style={{ marginEnd: theme.space.medium }} />
|
|
34
|
-
<Icon icon="user-outlined" />
|
|
35
|
-
</View>
|
|
36
|
-
|
|
37
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
38
|
-
Dashboard - widgets
|
|
39
|
-
</Typography.Text>
|
|
40
|
-
<View style={{ flexDirection: 'row', marginBottom: theme.space.large }}>
|
|
41
|
-
<Icon icon="coin" style={{ marginEnd: theme.space.medium }} />
|
|
42
|
-
<Icon icon="calendar-clock" style={{ marginEnd: theme.space.medium }} />
|
|
43
|
-
<Icon icon="file-certified" style={{ marginEnd: theme.space.medium }} />
|
|
44
|
-
<Icon icon="file-secured" style={{ marginEnd: theme.space.medium }} />
|
|
45
|
-
<Icon icon="file-verified" />
|
|
46
|
-
</View>
|
|
47
|
-
|
|
48
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
49
|
-
Top nav
|
|
50
|
-
</Typography.Text>
|
|
51
|
-
<View style={{ flexDirection: 'row', marginBottom: theme.space.large }}>
|
|
52
|
-
<Icon icon="suitcase" style={{ marginEnd: theme.space.medium }} />
|
|
53
|
-
<Icon icon="credit-card" />
|
|
54
|
-
</View>
|
|
55
|
-
|
|
56
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
57
|
-
FAB icons
|
|
58
|
-
</Typography.Text>
|
|
59
|
-
<View style={{ flexDirection: 'row', marginBottom: theme.space.large }}>
|
|
60
|
-
<Icon icon="plane" style={{ marginEnd: theme.space.medium }} />
|
|
61
|
-
<Icon icon="reply" style={{ marginEnd: theme.space.medium }} />
|
|
62
|
-
<Icon icon="health-bag" style={{ marginEnd: theme.space.medium }} />
|
|
63
|
-
<Icon icon="clock" style={{ marginEnd: theme.space.medium }} />
|
|
64
|
-
<Icon icon="target" style={{ marginEnd: theme.space.medium }} />
|
|
65
|
-
<Icon icon="speaker" />
|
|
66
|
-
</View>
|
|
67
|
-
|
|
68
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
69
|
-
Icon with colors
|
|
70
|
-
</Typography.Text>
|
|
71
|
-
<View style={{ flexDirection: 'row', marginBottom: theme.space.large }}>
|
|
72
|
-
<Icon
|
|
73
|
-
icon="plane"
|
|
74
|
-
intent="text"
|
|
75
|
-
style={{ marginEnd: theme.space.medium }}
|
|
76
|
-
/>
|
|
77
|
-
<Icon
|
|
78
|
-
icon="reply"
|
|
79
|
-
intent="primary"
|
|
80
|
-
style={{ marginEnd: theme.space.medium }}
|
|
81
|
-
/>
|
|
82
|
-
<Icon
|
|
83
|
-
icon="health-bag"
|
|
84
|
-
intent="info"
|
|
85
|
-
style={{ marginEnd: theme.space.medium }}
|
|
86
|
-
/>
|
|
87
|
-
<Icon
|
|
88
|
-
icon="clock"
|
|
89
|
-
intent="danger"
|
|
90
|
-
style={{ marginEnd: theme.space.medium }}
|
|
91
|
-
/>
|
|
92
|
-
<Icon
|
|
93
|
-
icon="target"
|
|
94
|
-
intent="success"
|
|
95
|
-
style={{ marginEnd: theme.space.medium }}
|
|
96
|
-
/>
|
|
97
|
-
<Icon
|
|
98
|
-
icon="speaker"
|
|
99
|
-
intent="warning"
|
|
100
|
-
style={{ marginEnd: theme.space.medium }}
|
|
101
|
-
/>
|
|
102
|
-
<Icon icon="arrow-right" intent="disabled-text" />
|
|
103
|
-
</View>
|
|
104
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
105
|
-
Icon with different sizes
|
|
106
|
-
</Typography.Text>
|
|
107
|
-
<View
|
|
108
|
-
style={{
|
|
109
|
-
flexDirection: 'row',
|
|
110
|
-
marginBottom: theme.space.large,
|
|
111
|
-
alignItems: 'flex-end',
|
|
112
|
-
}}
|
|
113
|
-
>
|
|
114
|
-
<Icon
|
|
115
|
-
icon="activate"
|
|
116
|
-
intent="text"
|
|
117
|
-
size="xsmall"
|
|
118
|
-
style={{ marginEnd: theme.space.medium }}
|
|
119
|
-
/>
|
|
120
|
-
<Icon
|
|
121
|
-
icon="add-person"
|
|
122
|
-
intent="primary"
|
|
123
|
-
size="small"
|
|
124
|
-
style={{ marginEnd: theme.space.medium }}
|
|
125
|
-
/>
|
|
126
|
-
<Icon
|
|
127
|
-
icon="adjustment"
|
|
128
|
-
intent="info"
|
|
129
|
-
size="medium"
|
|
130
|
-
style={{ marginEnd: theme.space.medium }}
|
|
131
|
-
/>
|
|
132
|
-
<Icon
|
|
133
|
-
icon="alignment"
|
|
134
|
-
intent="danger"
|
|
135
|
-
size="large"
|
|
136
|
-
style={{ marginEnd: theme.space.medium }}
|
|
137
|
-
/>
|
|
138
|
-
<Icon icon="bank" intent="success" size="xlarge" />
|
|
139
|
-
</View>
|
|
140
|
-
</ScrollView>
|
|
141
|
-
);
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export default IconPlayground;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
import { Button, Typography, useTheme } from '@hero-design/rn';
|
|
5
|
-
|
|
6
|
-
const IconButtonPlayground = (): JSX.Element => {
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
return (
|
|
9
|
-
<View style={{ padding: theme.space.small }}>
|
|
10
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
11
|
-
Different Intents and Sizes from Icon
|
|
12
|
-
</Typography.Text>
|
|
13
|
-
<View
|
|
14
|
-
style={{
|
|
15
|
-
flexDirection: 'row',
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
marginBottom: theme.space.large,
|
|
18
|
-
}}
|
|
19
|
-
>
|
|
20
|
-
<Button.Icon
|
|
21
|
-
icon="circle-add-outlined"
|
|
22
|
-
intent="text"
|
|
23
|
-
size="xsmall"
|
|
24
|
-
onPress={() => {}}
|
|
25
|
-
style={{ marginEnd: theme.space.medium }}
|
|
26
|
-
/>
|
|
27
|
-
<Button.Icon
|
|
28
|
-
icon="circle-add-outlined"
|
|
29
|
-
intent="primary"
|
|
30
|
-
size="xsmall"
|
|
31
|
-
onPress={() => {}}
|
|
32
|
-
style={{ marginEnd: theme.space.medium }}
|
|
33
|
-
/>
|
|
34
|
-
<Button.Icon
|
|
35
|
-
icon="circle-add-outlined"
|
|
36
|
-
intent="success"
|
|
37
|
-
size="small"
|
|
38
|
-
onPress={() => {}}
|
|
39
|
-
style={{ marginEnd: theme.space.medium }}
|
|
40
|
-
/>
|
|
41
|
-
<Button.Icon
|
|
42
|
-
icon="circle-add-outlined"
|
|
43
|
-
intent="info"
|
|
44
|
-
size="medium"
|
|
45
|
-
onPress={() => {}}
|
|
46
|
-
style={{ marginEnd: theme.space.medium }}
|
|
47
|
-
/>
|
|
48
|
-
<Button.Icon
|
|
49
|
-
icon="circle-add-outlined"
|
|
50
|
-
intent="warning"
|
|
51
|
-
size="large"
|
|
52
|
-
onPress={() => {}}
|
|
53
|
-
style={{ marginEnd: theme.space.medium }}
|
|
54
|
-
/>
|
|
55
|
-
<Button.Icon
|
|
56
|
-
icon="circle-add-outlined"
|
|
57
|
-
intent="danger"
|
|
58
|
-
size="xlarge"
|
|
59
|
-
onPress={() => {}}
|
|
60
|
-
style={{ marginEnd: theme.space.medium }}
|
|
61
|
-
/>
|
|
62
|
-
<Button.Icon
|
|
63
|
-
icon="circle-add-outlined"
|
|
64
|
-
intent="disabled-text"
|
|
65
|
-
size="xlarge"
|
|
66
|
-
onPress={() => {}}
|
|
67
|
-
style={{ marginEnd: theme.space.medium }}
|
|
68
|
-
/>
|
|
69
|
-
</View>
|
|
70
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
71
|
-
Disabled state
|
|
72
|
-
</Typography.Text>
|
|
73
|
-
<Button.Icon icon="circle-add-outlined" disabled onPress={() => {}} />
|
|
74
|
-
</View>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export default IconButtonPlayground;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider, theme, Button } from '@hero-design/rn';
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Alert } from 'react-native';
|
|
5
|
-
|
|
6
|
-
const CustomizedTheme = {
|
|
7
|
-
...theme,
|
|
8
|
-
__hd__: {
|
|
9
|
-
...theme.__hd__,
|
|
10
|
-
button: {
|
|
11
|
-
...theme.__hd__.button,
|
|
12
|
-
colors: {
|
|
13
|
-
...theme.__hd__.button.colors,
|
|
14
|
-
primary: '#000000',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
const MutipleThemesPlayground = () => (
|
|
20
|
-
<>
|
|
21
|
-
<Button
|
|
22
|
-
text="Button with Origin theme"
|
|
23
|
-
onPress={() => Alert.alert('Button')}
|
|
24
|
-
/>
|
|
25
|
-
<ThemeProvider theme={CustomizedTheme}>
|
|
26
|
-
<Button
|
|
27
|
-
text="Button with Customized theme"
|
|
28
|
-
onPress={() => Alert.alert('Button')}
|
|
29
|
-
/>
|
|
30
|
-
</ThemeProvider>
|
|
31
|
-
</>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
export default MutipleThemesPlayground;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { View, Button } from 'react-native';
|
|
3
|
-
import { Progress, Typography, useTheme } from '@hero-design/rn';
|
|
4
|
-
|
|
5
|
-
const ProgressPlayground = () => {
|
|
6
|
-
const [progress, setProgress] = useState(0);
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<View style={{ flex: 1 }}>
|
|
11
|
-
<View
|
|
12
|
-
style={{ alignItems: 'center', paddingVertical: theme.space.xlarge }}
|
|
13
|
-
>
|
|
14
|
-
<Typography.Text
|
|
15
|
-
fontSize="large"
|
|
16
|
-
style={{ marginBottom: theme.space.small }}
|
|
17
|
-
>
|
|
18
|
-
Progress Circle
|
|
19
|
-
</Typography.Text>
|
|
20
|
-
<View
|
|
21
|
-
style={{
|
|
22
|
-
flexDirection: 'row',
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
}}
|
|
25
|
-
>
|
|
26
|
-
<Progress.Circle value={progress} />
|
|
27
|
-
<Progress.Circle value={progress} intent="success" />
|
|
28
|
-
<Progress.Circle value={progress} intent="warning" />
|
|
29
|
-
</View>
|
|
30
|
-
|
|
31
|
-
<View
|
|
32
|
-
style={{
|
|
33
|
-
flexDirection: 'row',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
<Progress.Circle value={progress} intent="danger" />
|
|
38
|
-
<Progress.Circle value={progress} intent="info" />
|
|
39
|
-
</View>
|
|
40
|
-
</View>
|
|
41
|
-
<View
|
|
42
|
-
style={{ alignItems: 'center', paddingVertical: theme.space.small }}
|
|
43
|
-
>
|
|
44
|
-
<Typography.Text
|
|
45
|
-
fontSize="large"
|
|
46
|
-
style={{ marginBottom: theme.space.small }}
|
|
47
|
-
>
|
|
48
|
-
Progress Bar
|
|
49
|
-
</Typography.Text>
|
|
50
|
-
<Progress.Bar
|
|
51
|
-
value={progress}
|
|
52
|
-
style={{ marginBottom: theme.space.small }}
|
|
53
|
-
/>
|
|
54
|
-
<Progress.Bar
|
|
55
|
-
value={progress}
|
|
56
|
-
intent="success"
|
|
57
|
-
style={{ marginBottom: theme.space.small }}
|
|
58
|
-
/>
|
|
59
|
-
<Progress.Bar
|
|
60
|
-
value={progress}
|
|
61
|
-
intent="warning"
|
|
62
|
-
style={{ marginBottom: theme.space.small }}
|
|
63
|
-
/>
|
|
64
|
-
<Progress.Bar
|
|
65
|
-
value={progress}
|
|
66
|
-
intent="danger"
|
|
67
|
-
style={{ marginBottom: theme.space.small }}
|
|
68
|
-
/>
|
|
69
|
-
<Progress.Bar
|
|
70
|
-
value={progress}
|
|
71
|
-
intent="info"
|
|
72
|
-
style={{ marginBottom: theme.space.small }}
|
|
73
|
-
/>
|
|
74
|
-
</View>
|
|
75
|
-
<View style={{ alignItems: 'center', padding: theme.space.xlarge }}>
|
|
76
|
-
<View
|
|
77
|
-
style={{
|
|
78
|
-
flexDirection: 'row',
|
|
79
|
-
width: '80%',
|
|
80
|
-
justifyContent: 'space-around',
|
|
81
|
-
}}
|
|
82
|
-
>
|
|
83
|
-
<Button
|
|
84
|
-
title="Random Value"
|
|
85
|
-
onPress={() => setProgress(Math.floor(Math.random() * 100))}
|
|
86
|
-
/>
|
|
87
|
-
<Button title="Min" onPress={() => setProgress(0)} />
|
|
88
|
-
<Button title="Max" onPress={() => setProgress(100)} />
|
|
89
|
-
</View>
|
|
90
|
-
</View>
|
|
91
|
-
</View>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
export default ProgressPlayground;
|
package/playground/src/Radio.tsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { Radio, Typography, useTheme } from '@hero-design/rn';
|
|
4
|
-
|
|
5
|
-
const RadioPlayground = () => {
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
const [value, setValue] = useState('everything');
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<View style={{ padding: theme.space.medium }}>
|
|
11
|
-
<Typography.Text fontSize="xlarge">Radio.Group</Typography.Text>
|
|
12
|
-
<Radio.Group
|
|
13
|
-
options={[
|
|
14
|
-
{ text: 'Everything', value: 'everything' },
|
|
15
|
-
{ text: 'Direct mentions only', value: 'direct_mentions' },
|
|
16
|
-
{ text: 'Nothing', value: 'nothing' },
|
|
17
|
-
]}
|
|
18
|
-
value={value}
|
|
19
|
-
onPress={setValue}
|
|
20
|
-
/>
|
|
21
|
-
</View>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default RadioPlayground;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SectionList, Text, TouchableOpacity, View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
import { SectionHeading, Typography, useTheme } from '@hero-design/rn';
|
|
5
|
-
|
|
6
|
-
const SectionHeadingPlayground = () => {
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
|
|
9
|
-
const sampleSections = [
|
|
10
|
-
{
|
|
11
|
-
title: 'Main dishes',
|
|
12
|
-
data: ['Pizza', 'Burger', 'Risotto'],
|
|
13
|
-
cta: () => {},
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
title: 'Sides',
|
|
17
|
-
data: ['French Fries', 'Onion Rings', 'Fried Shrimps'],
|
|
18
|
-
haveIcon: true,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<View
|
|
24
|
-
style={{
|
|
25
|
-
margin: theme.space.medium,
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
29
|
-
Default section heading
|
|
30
|
-
</Typography.Text>
|
|
31
|
-
<SectionList
|
|
32
|
-
sections={sampleSections}
|
|
33
|
-
keyExtractor={(item, index) => item + index}
|
|
34
|
-
renderItem={({ item }) => (
|
|
35
|
-
<View
|
|
36
|
-
style={{
|
|
37
|
-
borderRadius: theme.radii.base,
|
|
38
|
-
borderWidth: theme.borderWidths.base,
|
|
39
|
-
borderColor: theme.colors.outline,
|
|
40
|
-
paddingVertical: theme.space.small,
|
|
41
|
-
paddingHorizontal: theme.space.medium,
|
|
42
|
-
marginBottom: theme.space.medium,
|
|
43
|
-
}}
|
|
44
|
-
>
|
|
45
|
-
<Text>{item}</Text>
|
|
46
|
-
</View>
|
|
47
|
-
)}
|
|
48
|
-
renderSectionHeader={({ section: { title, cta, haveIcon } }) => (
|
|
49
|
-
<SectionHeading
|
|
50
|
-
text={title}
|
|
51
|
-
icon={haveIcon ? 'document' : undefined}
|
|
52
|
-
rightChildren={
|
|
53
|
-
cta && (
|
|
54
|
-
<TouchableOpacity onPress={cta}>
|
|
55
|
-
<Typography.Text intent="primary" fontWeight="semi-bold">
|
|
56
|
-
Edit
|
|
57
|
-
</Typography.Text>
|
|
58
|
-
</TouchableOpacity>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
/>
|
|
62
|
-
)}
|
|
63
|
-
/>
|
|
64
|
-
</View>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export default SectionHeadingPlayground;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { Select, useTheme } from '@hero-design/rn';
|
|
4
|
-
|
|
5
|
-
const SelectPlayground = (): JSX.Element => {
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
const options = [
|
|
8
|
-
{ text: 'Monday', value: 'mon' },
|
|
9
|
-
{ text: 'Tuesday', value: 'tue' },
|
|
10
|
-
{ text: 'Wednesday', value: 'wed' },
|
|
11
|
-
{ text: 'Thursday', value: 'thu' },
|
|
12
|
-
{ text: 'Friday', value: 'fri' },
|
|
13
|
-
{ text: 'Saturday', value: 'sat' },
|
|
14
|
-
{ text: 'Sunday', value: 'sun' },
|
|
15
|
-
];
|
|
16
|
-
const [value, setValue] = useState(['mon', 'tue']);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<View style={{ margin: theme.space.medium }}>
|
|
20
|
-
<Select.Multi
|
|
21
|
-
label="Allow notifications"
|
|
22
|
-
footerLabel="Confirm"
|
|
23
|
-
options={options}
|
|
24
|
-
value={value}
|
|
25
|
-
onPress={setValue}
|
|
26
|
-
keyExtractor={opt => opt.value}
|
|
27
|
-
/>
|
|
28
|
-
</View>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default SelectPlayground;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { Spinner, useTheme } from '@hero-design/rn';
|
|
4
|
-
|
|
5
|
-
const SpinnerPlayground = (): JSX.Element => {
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
return (
|
|
8
|
-
<View
|
|
9
|
-
style={{
|
|
10
|
-
marginVertical: theme.space.medium,
|
|
11
|
-
marginHorizontal: theme.space.medium,
|
|
12
|
-
}}
|
|
13
|
-
>
|
|
14
|
-
<Spinner />
|
|
15
|
-
</View>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default SpinnerPlayground;
|