@hero-design/rn 7.3.0 → 7.4.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/assets/fonts/hero-icons.ttf +0 -0
- package/es/index.js +1997 -1123
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +2001 -1121
- package/package.json +11 -9
- package/playground/.detoxrc.json +49 -0
- package/playground/.prettierrc.json +8 -0
- package/playground/app.json +9 -0
- package/playground/babel.config.js +63 -0
- package/playground/e2e/config.json +9 -0
- package/playground/e2e/environment.js +23 -0
- package/playground/e2e/firstTest.e2e.js +16 -0
- package/{expoEntry.js → playground/expoEntry.js} +1 -1
- 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 +7 -0
- package/playground/ios/MobileHeroDesignPlayground/AppDelegate.h +9 -0
- package/playground/ios/MobileHeroDesignPlayground/AppDelegate.m +75 -0
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/Contents.json +6 -0
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/Contents.json +21 -0
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
- package/playground/ios/MobileHeroDesignPlayground/Info.plist +85 -0
- package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground-Bridging-Header.h +3 -0
- package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground.entitlements +8 -0
- package/playground/ios/MobileHeroDesignPlayground/SplashScreen.storyboard +40 -0
- package/playground/ios/MobileHeroDesignPlayground/Supporting/Expo.plist +16 -0
- package/playground/ios/MobileHeroDesignPlayground/main.m +10 -0
- package/playground/ios/MobileHeroDesignPlayground/noop-file.swift +4 -0
- package/playground/ios/MobileHeroDesignPlayground.xcodeproj/project.pbxproj +515 -0
- package/playground/ios/MobileHeroDesignPlayground.xcodeproj/xcshareddata/xcschemes/MobileHeroDesignPlayground.xcscheme +88 -0
- package/playground/ios/MobileHeroDesignPlayground.xcworkspace/contents.xcworkspacedata +10 -0
- package/playground/ios/MobileHeroDesignPlayground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/playground/ios/Podfile +49 -0
- package/playground/ios/Podfile.lock +478 -0
- package/playground/ios/Podfile.properties.json +3 -0
- package/{metro.config.js → playground/metro.config.js} +10 -2
- package/playground/package.json +63 -0
- package/playground/{index.tsx → src/App.tsx} +57 -29
- package/playground/{components → src}/Avatar.tsx +1 -1
- package/playground/{components → src}/Badge.tsx +1 -1
- package/playground/{components → src}/BottomNavigation.tsx +1 -1
- package/playground/src/BottomSheet.tsx +43 -0
- package/playground/src/Button.tsx +170 -0
- package/playground/{components/Button.tsx → src/Button.tsx~origin_master} +0 -0
- package/playground/{components → src}/Card.tsx +1 -1
- package/playground/{components → src}/Collapse.tsx +1 -1
- package/playground/src/ContentNavigator.tsx +65 -0
- package/playground/{components → src}/Divider.tsx +1 -1
- package/playground/{components → src}/Drawer.tsx +1 -1
- package/playground/{components → src}/FAB.tsx +1 -1
- package/playground/{components → src}/Icon.tsx +7 -3
- package/playground/{components → src}/IconButton.tsx +12 -1
- package/playground/{components → src}/Progress.tsx +1 -1
- package/playground/src/Radio.tsx +25 -0
- package/playground/src/SectionHeading.tsx +68 -0
- package/playground/src/Spinner.tsx +19 -0
- package/playground/{components → src}/Tabs.tsx +1 -1
- package/playground/{components → src}/Tag.tsx +1 -1
- package/playground/src/TextInput.tsx +14 -0
- package/playground/{components → src}/Typography.tsx +1 -1
- package/playground/src/emotion.d.ts +7 -0
- package/playground/tsconfig.json +21 -0
- package/src/components/BottomSheet/Footer.tsx +19 -0
- package/src/components/BottomSheet/Header.tsx +49 -0
- package/src/components/BottomSheet/StyledBottomSheet.tsx +75 -0
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +531 -0
- package/src/components/BottomSheet/__tests__/index.spec.tsx +107 -0
- package/src/components/BottomSheet/index.tsx +171 -0
- package/src/components/Button/IconButton.tsx +11 -1
- package/src/components/Card/index.tsx +1 -1
- package/src/components/Collapse/StyledCollapse.tsx +11 -2
- package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +36 -31
- package/src/components/Collapse/__tests__/index.spec.tsx +1 -13
- package/src/components/Collapse/index.tsx +20 -50
- package/src/components/ContentNavigator/StyledContentNavigator.tsx +15 -0
- package/src/components/ContentNavigator/__tests__/StyledContentNavigator.spec.tsx +19 -0
- package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap +43 -0
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +217 -0
- package/src/components/ContentNavigator/__tests__/index.spec.tsx +74 -0
- package/src/components/ContentNavigator/index.tsx +65 -0
- package/src/components/Icon/HeroIcon/index.tsx +13 -2
- package/src/components/Icon/HeroIcon/selection.json +1 -1
- package/src/components/Icon/IconList.ts +6 -0
- package/src/components/Icon/index.tsx +8 -1
- package/src/components/Radio/Radio.tsx +51 -0
- package/src/components/Radio/RadioGroup.tsx +50 -0
- package/src/components/Radio/StyledRadio.tsx +42 -0
- package/src/components/Radio/__tests__/Radio.spec.tsx +38 -0
- package/src/components/Radio/__tests__/RadioGroup.spec.tsx +36 -0
- package/src/components/Radio/__tests__/StyledRadio.spec.tsx +43 -0
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +160 -0
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +248 -0
- package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +124 -0
- package/src/components/Radio/index.tsx +5 -0
- package/src/components/SectionHeading/StyledHeading.tsx +24 -0
- package/src/components/SectionHeading/__tests__/StyledHeading.tsx +28 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.tsx.snap +48 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +208 -0
- package/src/components/SectionHeading/__tests__/index.spec.tsx +39 -0
- package/src/components/SectionHeading/index.tsx +93 -0
- package/src/components/Spinner/AnimatedSpinner.tsx +55 -0
- package/src/components/Spinner/StyledSpinner.tsx +59 -0
- package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +11 -0
- package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +56 -0
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +118 -0
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +235 -0
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +141 -0
- package/src/components/Spinner/__tests__/index.spec.tsx +12 -0
- package/src/components/Spinner/index.tsx +22 -0
- package/src/components/TextInput/StyledTextInput.tsx +34 -0
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +33 -0
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +88 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +16 -0
- package/src/components/TextInput/index.tsx +61 -0
- package/src/index.ts +12 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +95 -0
- package/src/theme/components/bottomSheet.ts +34 -0
- package/src/theme/components/contentNavigator.ts +11 -0
- package/src/theme/components/icon.ts +1 -0
- package/src/theme/components/radio.ts +34 -0
- package/src/theme/components/spinner.ts +21 -0
- package/src/theme/components/textInput.ts +32 -0
- package/src/theme/global/borders.ts +6 -0
- package/src/theme/global/colors.ts +1 -0
- package/src/theme/index.ts +22 -7
- package/tsconfig.json +11 -3
- package/types/components/Avatar/StyledAvatar.d.ts +45 -0
- package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +1 -0
- package/types/components/Avatar/__tests__/index.spec.d.ts +1 -0
- package/types/components/Avatar/index.d.ts +25 -0
- package/types/components/Badge/Status.d.ts +24 -0
- package/types/components/Badge/StyledBadge.d.ts +27 -0
- package/types/components/Badge/__tests__/Badge.spec.d.ts +1 -0
- package/types/components/Badge/__tests__/Status.spec.d.ts +1 -0
- package/types/components/Badge/index.d.ts +32 -0
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +51 -0
- package/types/components/BottomNavigation/__tests__/index.spec.d.ts +1 -0
- package/types/components/BottomNavigation/index.d.ts +45 -0
- package/types/components/BottomSheet/Footer.d.ts +6 -0
- package/types/components/BottomSheet/Header.d.ts +8 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +46 -0
- package/types/components/BottomSheet/__tests__/index.spec.d.ts +1 -0
- package/types/components/BottomSheet/index.d.ts +51 -0
- package/types/components/Button/Button.d.ts +57 -0
- package/types/components/Button/IconButton.d.ts +38 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +19 -0
- package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +1 -0
- package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +1 -0
- package/types/components/Button/LoadingIndicator/index.d.ts +26 -0
- package/types/components/Button/StyledButton.d.ts +39 -0
- package/types/components/Button/__tests__/Button.spec.d.ts +1 -0
- package/types/components/Button/__tests__/IconButton.spec.d.ts +1 -0
- package/types/components/Button/__tests__/StyledButton.spec.d.ts +1 -0
- package/types/components/Button/index.d.ts +8 -0
- package/types/components/Card/StyledCard.d.ts +16 -0
- package/types/components/Card/__tests__/StyledCard.spec.d.ts +1 -0
- package/types/components/Card/__tests__/index.spec.d.ts +1 -0
- package/types/components/Card/index.d.ts +22 -0
- package/types/components/Collapse/StyledCollapse.d.ts +25 -0
- package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +1 -0
- package/types/components/Collapse/__tests__/index.spec.d.ts +1 -0
- package/types/components/Collapse/index.d.ts +19 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +12 -0
- package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +1 -0
- package/types/components/ContentNavigator/__tests__/index.spec.d.ts +1 -0
- package/types/components/ContentNavigator/index.d.ts +33 -0
- package/types/components/Divider/StyledDivider.d.ts +12 -0
- package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +1 -0
- package/types/components/Divider/index.d.ts +21 -0
- package/types/components/Drawer/StyledDrawer.d.ts +24 -0
- package/types/components/Drawer/__tests__/index.spec.d.ts +1 -0
- package/types/components/Drawer/index.d.ts +25 -0
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +12 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +29 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +12 -0
- package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +1 -0
- package/types/components/FAB/ActionGroup/index.d.ts +34 -0
- package/types/components/FAB/AnimatedFABIcon.d.ts +6 -0
- package/types/components/FAB/FAB.d.ts +34 -0
- package/types/components/FAB/StyledFAB.d.ts +19 -0
- package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +1 -0
- package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +1 -0
- package/types/components/FAB/__tests__/index.spec.d.ts +1 -0
- package/types/components/FAB/index.d.ts +4 -0
- package/types/components/Icon/HeroIcon/index.d.ts +12 -0
- package/types/components/Icon/IconList.d.ts +2 -0
- package/types/components/Icon/__tests__/index.spec.d.ts +1 -0
- package/types/components/Icon/index.d.ts +27 -0
- package/types/components/Icon/utils.d.ts +2 -0
- package/types/components/Progress/ProgressBar.d.ts +18 -0
- package/types/components/Progress/ProgressCircle.d.ts +18 -0
- package/types/components/Progress/StyledProgressBar.d.ts +17 -0
- package/types/components/Progress/StyledProgressCircle.d.ts +37 -0
- package/types/components/Progress/__tests__/index.spec.d.ts +1 -0
- package/types/components/Progress/index.d.ts +5 -0
- package/types/components/Progress/types.d.ts +1 -0
- package/types/components/Radio/Radio.d.ts +26 -0
- package/types/components/Radio/RadioGroup.d.ts +29 -0
- package/types/components/Radio/StyledRadio.d.ts +30 -0
- package/types/components/Radio/__tests__/Radio.spec.d.ts +1 -0
- package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +1 -0
- package/types/components/Radio/__tests__/StyledRadio.spec.d.ts +1 -0
- package/types/components/Radio/index.d.ts +4 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +20 -0
- package/types/components/SectionHeading/__tests__/StyledHeading.d.ts +1 -0
- package/types/components/SectionHeading/__tests__/index.spec.d.ts +1 -0
- package/types/components/SectionHeading/index.d.ts +39 -0
- package/types/components/Spinner/AnimatedSpinner.d.ts +2 -0
- package/types/components/Spinner/StyledSpinner.d.ts +30 -0
- package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +1 -0
- package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +1 -0
- package/types/components/Spinner/__tests__/index.spec.d.ts +1 -0
- package/types/components/Spinner/index.d.ts +10 -0
- package/types/components/Tabs/ActiveTabIndicator.d.ts +8 -0
- package/types/components/Tabs/ScrollableTabs.d.ts +3 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +60 -0
- package/types/components/Tabs/StyledTabs.d.ts +54 -0
- package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
- package/types/components/Tabs/__tests__/index.spec.d.ts +1 -0
- package/types/components/Tabs/index.d.ts +54 -0
- package/types/components/Tabs/utils.d.ts +2 -0
- package/types/components/Tag/StyledTag.d.ts +19 -0
- package/types/components/Tag/__tests__/Tag.spec.d.ts +1 -0
- package/types/components/Tag/index.d.ts +21 -0
- package/types/components/TextInput/StyledTextInput.d.ts +22 -0
- package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +1 -0
- package/types/components/TextInput/__tests__/index.spec.d.ts +1 -0
- package/types/components/TextInput/index.d.ts +26 -0
- package/types/components/Typography/Text/StyledText.d.ts +12 -0
- package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +1 -0
- package/types/components/Typography/Text/__tests__/index.spec.d.ts +1 -0
- package/types/components/Typography/Text/index.d.ts +30 -0
- package/types/components/Typography/index.d.ts +6 -0
- package/types/index.d.ts +25 -0
- package/types/playground/components/Avatar.d.ts +0 -0
- package/types/playground/components/Collapse.d.ts +0 -0
- package/types/playground/components/Drawer.d.ts +0 -0
- package/types/playground/components/IconButton.d.ts +0 -0
- package/types/playground/components/Progress.d.ts +0 -0
- package/types/playground/components/Tag.d.ts +0 -0
- package/types/src/components/Avatar/StyledAvatar.d.ts +0 -0
- package/types/src/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
- package/types/src/components/Avatar/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Avatar/index.d.ts +0 -0
- package/types/src/components/Badge/Status.d.ts +0 -0
- package/types/src/components/Badge/__tests__/Status.spec.d.ts +0 -0
- package/types/src/components/Button/Button.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/src/components/Button/StyledButton.d.ts +0 -0
- package/types/src/components/Button/__tests__/Button.spec.d.ts +0 -0
- package/types/src/components/Button/__tests__/IconButton.spec.d.ts +0 -0
- package/types/src/components/Button/__tests__/StyledButton.spec.d.ts +0 -0
- package/types/src/components/Collapse/StyledCollapse.d.ts +0 -0
- package/types/src/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
- package/types/src/components/Collapse/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Collapse/index.d.ts +0 -0
- package/types/src/components/Drawer/StyledDrawer.d.ts +0 -0
- package/types/src/components/Drawer/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Drawer/index.d.ts +0 -0
- package/types/src/components/Progress/ProgressBar.d.ts +0 -0
- package/types/src/components/Progress/ProgressCircle.d.ts +0 -0
- package/types/src/components/Progress/StyledProgressBar.d.ts +0 -0
- package/types/src/components/Progress/StyledProgressCircle.d.ts +0 -0
- package/types/src/components/Progress/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Progress/index.d.ts +0 -0
- package/types/src/components/Progress/types.d.ts +0 -0
- package/types/src/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/src/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/src/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/types/src/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -0
- package/types/src/components/Tabs/utils.d.ts +0 -0
- package/types/src/components/Tag/StyledTag.d.ts +0 -0
- package/types/src/components/Tag/__tests__/Tag.spec.d.ts +0 -0
- package/types/src/components/Tag/index.d.ts +0 -0
- package/types/src/theme/components/avatar.d.ts +0 -0
- package/types/src/theme/components/button.d.ts +0 -0
- package/types/src/theme/components/drawer.d.ts +0 -0
- package/types/src/theme/components/progress.d.ts +0 -0
- package/types/src/theme/components/tag.d.ts +0 -0
- package/types/src/utils/hooks.d.ts +0 -0
- package/types/testHelpers/renderWithTheme.d.ts +3 -0
- package/types/theme/__tests__/index.spec.d.ts +1 -0
- package/types/theme/components/avatar.d.ts +32 -0
- package/types/theme/components/badge.d.ts +29 -0
- package/types/theme/components/bottomNavigation.d.ts +23 -0
- package/types/theme/components/bottomSheet.d.ts +29 -0
- package/types/theme/components/button.d.ts +37 -0
- package/types/theme/components/card.d.ts +10 -0
- package/types/theme/components/contentNavigator.d.ts +7 -0
- package/types/theme/components/divider.d.ts +17 -0
- package/types/theme/components/drawer.d.ts +21 -0
- package/types/theme/components/fab.d.ts +51 -0
- package/types/theme/components/icon.d.ts +20 -0
- package/types/theme/components/progress.d.ts +21 -0
- package/types/theme/components/radio.d.ts +25 -0
- package/types/theme/components/spinner.d.ts +15 -0
- package/types/theme/components/tabs.d.ts +27 -0
- package/types/theme/components/tag.d.ts +30 -0
- package/types/theme/components/textInput.d.ts +24 -0
- package/types/theme/components/typography.d.ts +26 -0
- package/types/theme/global/borders.d.ts +14 -0
- package/types/theme/global/colors.d.ts +32 -0
- package/types/theme/global/index.d.ts +42 -0
- package/types/theme/global/scale.d.ts +9 -0
- package/types/theme/global/space.d.ts +13 -0
- package/types/theme/global/typography.d.ts +21 -0
- package/types/theme/index.d.ts +45 -0
- package/types/types.d.ts +5 -0
- package/types/utils/__tests__/scale.spec.d.ts +1 -0
- package/types/utils/helpers.d.ts +2 -0
- package/types/utils/hooks.d.ts +1 -0
- package/types/utils/scale.d.ts +3 -0
- package/app.json +0 -8
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
createNativeStackNavigator,
|
|
6
6
|
NativeStackScreenProps,
|
|
7
7
|
} from '@react-navigation/native-stack';
|
|
8
|
-
import {
|
|
8
|
+
import { loadAsync } from 'expo-font';
|
|
9
9
|
import { SafeAreaView, FlatList, View, TouchableOpacity } from 'react-native';
|
|
10
10
|
import {
|
|
11
11
|
ThemeProvider,
|
|
@@ -14,35 +14,44 @@ import {
|
|
|
14
14
|
Typography,
|
|
15
15
|
Icon,
|
|
16
16
|
Divider,
|
|
17
|
-
} from '
|
|
18
|
-
import AvatarPlayground from './components/Avatar';
|
|
19
|
-
import BadgePlayground from './components/Badge';
|
|
20
|
-
import BottomNavigation from './components/BottomNavigation';
|
|
21
|
-
import Button from './components/Button';
|
|
22
|
-
import CardPlayground from './components/Card';
|
|
23
|
-
import CollapsePlayground from './components/Collapse';
|
|
24
|
-
import DividerPlayground from './components/Divider';
|
|
25
|
-
import DrawerPlayground from './components/Drawer';
|
|
26
|
-
import FABPlayground from './components/FAB';
|
|
27
|
-
import IconPlayground from './components/Icon';
|
|
28
|
-
import IconButtonPlayground from './components/IconButton';
|
|
29
|
-
import ProgressPlayground from './components/Progress';
|
|
30
|
-
import TabsPlayground from './components/Tabs';
|
|
31
|
-
import TagPlayground from './components/Tag';
|
|
32
|
-
import TypographyPlayground from './components/Typography';
|
|
17
|
+
} from '@hero-design/rn';
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
import AvatarPlayground from './Avatar';
|
|
20
|
+
import BadgePlayground from './Badge';
|
|
21
|
+
import BottomNavigation from './BottomNavigation';
|
|
22
|
+
import BottomSheet from './BottomSheet';
|
|
23
|
+
import Button from './Button';
|
|
24
|
+
import CardPlayground from './Card';
|
|
25
|
+
import CollapsePlayground from './Collapse';
|
|
26
|
+
import ContentNavigatorPlayground from './ContentNavigator';
|
|
27
|
+
import DividerPlayground from './Divider';
|
|
28
|
+
import DrawerPlayground from './Drawer';
|
|
29
|
+
import FABPlayground from './FAB';
|
|
30
|
+
import IconPlayground from './Icon';
|
|
31
|
+
import IconButtonPlayground from './IconButton';
|
|
32
|
+
import ProgressPlayground from './Progress';
|
|
33
|
+
import SpinnerPlayground from './Spinner';
|
|
34
|
+
import SectionHeadingPlayground from './SectionHeading';
|
|
35
|
+
import RadioPlayground from './Radio';
|
|
36
|
+
import TabsPlayground from './Tabs';
|
|
37
|
+
import TagPlayground from './Tag';
|
|
38
|
+
import TextInputPlayground from './TextInput';
|
|
39
|
+
import TypographyPlayground from './Typography';
|
|
40
|
+
|
|
41
|
+
const heroIconFontPath = require('@hero-design/rn/assets/fonts/hero-icons.ttf');
|
|
42
|
+
const beVietnamProLightFont = require('@hero-design/rn/assets/fonts/be-vietnam-pro-light.ttf');
|
|
43
|
+
const beVietnamProRegularFont = require('@hero-design/rn/assets/fonts/be-vietnam-pro-regular.ttf');
|
|
44
|
+
const beVietnamProSemiBoldFont = require('@hero-design/rn/assets/fonts/be-vietnam-pro-semibold.ttf');
|
|
38
45
|
|
|
39
46
|
type RootStackParamList = {
|
|
40
47
|
Avatar: undefined;
|
|
41
48
|
Badge: undefined;
|
|
42
49
|
BottomNavigation: undefined;
|
|
50
|
+
BottomSheet: undefined;
|
|
43
51
|
Button: undefined;
|
|
44
52
|
Card: undefined;
|
|
45
53
|
Collapse: undefined;
|
|
54
|
+
ContentNavigator: undefined;
|
|
46
55
|
Divider: undefined;
|
|
47
56
|
Drawer: undefined;
|
|
48
57
|
FAB: undefined;
|
|
@@ -50,8 +59,12 @@ type RootStackParamList = {
|
|
|
50
59
|
Icon: undefined;
|
|
51
60
|
IconButton: undefined;
|
|
52
61
|
Progress: undefined;
|
|
62
|
+
Spinner: undefined;
|
|
63
|
+
Radio: undefined;
|
|
64
|
+
SectionHeading: undefined;
|
|
53
65
|
Tabs: undefined;
|
|
54
66
|
Tag: undefined;
|
|
67
|
+
TextInput: undefined;
|
|
55
68
|
Typography: undefined;
|
|
56
69
|
};
|
|
57
70
|
|
|
@@ -63,22 +76,29 @@ const components = [
|
|
|
63
76
|
{ name: 'Avatar', component: AvatarPlayground },
|
|
64
77
|
{ name: 'Badge', component: BadgePlayground },
|
|
65
78
|
{ name: 'BottomNavigation', component: BottomNavigation },
|
|
79
|
+
{ name: 'BottomSheet', component: BottomSheet },
|
|
66
80
|
{ name: 'Button', component: Button },
|
|
67
81
|
{ name: 'Card', component: CardPlayground },
|
|
68
82
|
{ name: 'Collapse', component: CollapsePlayground },
|
|
83
|
+
{ name: 'ContentNavigator', component: ContentNavigatorPlayground },
|
|
69
84
|
{ name: 'Divider', component: DividerPlayground },
|
|
70
85
|
{ name: 'Drawer', component: DrawerPlayground },
|
|
71
86
|
{ name: 'FAB', component: FABPlayground },
|
|
72
87
|
{ name: 'Icon', component: IconPlayground },
|
|
73
88
|
{ name: 'IconButton', component: IconButtonPlayground },
|
|
74
89
|
{ name: 'Progress', component: ProgressPlayground },
|
|
90
|
+
{ name: 'Spinner', component: SpinnerPlayground },
|
|
91
|
+
{ name: 'Radio', component: RadioPlayground },
|
|
92
|
+
{ name: 'SectionHeading', component: SectionHeadingPlayground },
|
|
75
93
|
{ name: 'Tabs', component: TabsPlayground },
|
|
76
94
|
{ name: 'Tag', component: TagPlayground },
|
|
95
|
+
{ name: 'TextInput', component: TextInputPlayground },
|
|
77
96
|
{ name: 'Typography', component: TypographyPlayground },
|
|
78
97
|
] as const;
|
|
79
98
|
|
|
80
|
-
const ComponentItem = ({ name }: { name: string }) => {
|
|
99
|
+
const ComponentItem = ({ name }: { name: string }): JSX.Element => {
|
|
81
100
|
const hdTheme = useTheme();
|
|
101
|
+
|
|
82
102
|
return (
|
|
83
103
|
<View
|
|
84
104
|
style={{
|
|
@@ -125,18 +145,26 @@ const App = () => {
|
|
|
125
145
|
background: theme.colors.platformBackground,
|
|
126
146
|
},
|
|
127
147
|
};
|
|
148
|
+
const [fontsLoaded, setFontsLoaded] = React.useState(false);
|
|
149
|
+
|
|
150
|
+
React.useEffect(() => {
|
|
151
|
+
async function loadFonts() {
|
|
152
|
+
await loadAsync({
|
|
153
|
+
'hero-icons': heroIconFontPath,
|
|
154
|
+
'BeVietnamPro-Light': beVietnamProLightFont,
|
|
155
|
+
'BeVietnamPro-Regular': beVietnamProRegularFont,
|
|
156
|
+
'BeVietnamPro-SemiBold': beVietnamProSemiBoldFont,
|
|
157
|
+
}).catch(console.error);
|
|
128
158
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
});
|
|
159
|
+
setFontsLoaded(true);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
loadFonts();
|
|
163
|
+
}, []);
|
|
135
164
|
|
|
136
165
|
if (!fontsLoaded) {
|
|
137
166
|
return null;
|
|
138
167
|
}
|
|
139
|
-
|
|
140
168
|
return (
|
|
141
169
|
<ThemeProvider theme={theme}>
|
|
142
170
|
<NavigationContainer theme={CustomNavigationTheme}>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Alert, View } from 'react-native';
|
|
3
|
-
import { Avatar, Typography, useTheme } from '
|
|
3
|
+
import { Avatar, Typography, useTheme } from '@hero-design/rn';
|
|
4
4
|
|
|
5
5
|
const AvatarPlayground = () => {
|
|
6
6
|
const theme = useTheme();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button, View } from 'react-native';
|
|
3
|
-
import { Badge, Icon, Typography, useTheme } from '
|
|
3
|
+
import { Badge, Icon, Typography, useTheme } from '@hero-design/rn';
|
|
4
4
|
|
|
5
5
|
const BadgePlayground = () => {
|
|
6
6
|
const theme = useTheme();
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, Button } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { BottomSheet, Typography, useTheme } from '@hero-design/rn';
|
|
5
|
+
|
|
6
|
+
const Content = () => {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<View style={{ padding: theme.space.medium }}>
|
|
11
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
12
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
13
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
14
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
15
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
16
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
17
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
18
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
19
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
20
|
+
<Typography.Text>Sheet Content</Typography.Text>
|
|
21
|
+
</View>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const BottomSheetPlayground = (): JSX.Element => {
|
|
26
|
+
const [visible, setVisiblity] = useState(false);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<View style={{ flex: 1, alignItems: 'center' }}>
|
|
30
|
+
<Button title="Toggle Bottom Sheet" onPress={() => setVisiblity(true)} />
|
|
31
|
+
<BottomSheet
|
|
32
|
+
open={visible}
|
|
33
|
+
header="Title"
|
|
34
|
+
footer={<Button title="Close" onPress={() => setVisiblity(false)} />}
|
|
35
|
+
onRequestClose={() => setVisiblity(false)}
|
|
36
|
+
>
|
|
37
|
+
<Content />
|
|
38
|
+
</BottomSheet>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default BottomSheetPlayground;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScrollView, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Button, Typography, useTheme } from '@hero-design/rn';
|
|
5
|
+
|
|
6
|
+
const ButtonPlayground = (): JSX.Element => {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
return (
|
|
9
|
+
<ScrollView style={{ padding: theme.space.small }}>
|
|
10
|
+
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
11
|
+
Variants
|
|
12
|
+
</Typography.Text>
|
|
13
|
+
<View
|
|
14
|
+
style={{
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
marginBottom: theme.space.large,
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
<View
|
|
20
|
+
style={{
|
|
21
|
+
backgroundColor: theme.colors.primary,
|
|
22
|
+
paddingVertical: theme.space.large,
|
|
23
|
+
marginBottom: theme.space.medium,
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<Button
|
|
27
|
+
text="Basic Transparent"
|
|
28
|
+
variant="basic-transparent"
|
|
29
|
+
onPress={() => {}}
|
|
30
|
+
/>
|
|
31
|
+
</View>
|
|
32
|
+
<Button
|
|
33
|
+
text="Primary (Filled)"
|
|
34
|
+
variant="filled"
|
|
35
|
+
intent="primary"
|
|
36
|
+
onPress={() => {}}
|
|
37
|
+
style={{ marginBottom: theme.space.medium }}
|
|
38
|
+
/>
|
|
39
|
+
<Button
|
|
40
|
+
text="Secondary (Filled)"
|
|
41
|
+
variant="filled"
|
|
42
|
+
intent="secondary"
|
|
43
|
+
onPress={() => {}}
|
|
44
|
+
style={{ marginBottom: theme.space.medium }}
|
|
45
|
+
/>
|
|
46
|
+
<Button
|
|
47
|
+
text="Primary (Outlined)"
|
|
48
|
+
variant="outlined"
|
|
49
|
+
intent="primary"
|
|
50
|
+
onPress={() => {}}
|
|
51
|
+
style={{ marginBottom: theme.space.medium }}
|
|
52
|
+
/>
|
|
53
|
+
<Button
|
|
54
|
+
text="Secondary (Outlined)"
|
|
55
|
+
variant="outlined"
|
|
56
|
+
intent="secondary"
|
|
57
|
+
onPress={() => {}}
|
|
58
|
+
style={{ marginBottom: theme.space.medium }}
|
|
59
|
+
/>
|
|
60
|
+
</View>
|
|
61
|
+
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
62
|
+
With Icon
|
|
63
|
+
</Typography.Text>
|
|
64
|
+
<View
|
|
65
|
+
style={{
|
|
66
|
+
flexDirection: 'column',
|
|
67
|
+
marginBottom: theme.space.large,
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
<Button
|
|
71
|
+
text="Add Item"
|
|
72
|
+
variant="filled"
|
|
73
|
+
intent="primary"
|
|
74
|
+
icon="add"
|
|
75
|
+
onPress={() => {}}
|
|
76
|
+
style={{ marginBottom: theme.space.medium }}
|
|
77
|
+
/>
|
|
78
|
+
<Button
|
|
79
|
+
text="Delete"
|
|
80
|
+
variant="filled"
|
|
81
|
+
intent="primary"
|
|
82
|
+
icon="trash-bin-outlined"
|
|
83
|
+
onPress={() => {}}
|
|
84
|
+
style={{ marginBottom: theme.space.medium }}
|
|
85
|
+
/>
|
|
86
|
+
<Button
|
|
87
|
+
text="More"
|
|
88
|
+
variant="outlined"
|
|
89
|
+
intent="secondary"
|
|
90
|
+
rightIcon="arrow-down"
|
|
91
|
+
onPress={() => {}}
|
|
92
|
+
style={{ marginBottom: theme.space.medium }}
|
|
93
|
+
/>
|
|
94
|
+
</View>
|
|
95
|
+
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
96
|
+
Loading
|
|
97
|
+
</Typography.Text>
|
|
98
|
+
<View
|
|
99
|
+
style={{
|
|
100
|
+
flexDirection: 'column',
|
|
101
|
+
marginBottom: theme.space.large,
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<View
|
|
105
|
+
style={{
|
|
106
|
+
backgroundColor: theme.colors.primary,
|
|
107
|
+
paddingVertical: theme.space.large,
|
|
108
|
+
marginBottom: theme.space.medium,
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
<Button
|
|
112
|
+
text="Basic Transparent (Loading)"
|
|
113
|
+
variant="basic-transparent"
|
|
114
|
+
onPress={() => {}}
|
|
115
|
+
loading
|
|
116
|
+
/>
|
|
117
|
+
</View>
|
|
118
|
+
<Button
|
|
119
|
+
text="Filled (Loading)"
|
|
120
|
+
variant="filled"
|
|
121
|
+
intent="primary"
|
|
122
|
+
onPress={() => {}}
|
|
123
|
+
style={{ marginBottom: theme.space.medium }}
|
|
124
|
+
loading
|
|
125
|
+
/>
|
|
126
|
+
<Button
|
|
127
|
+
text="Outlined (Loading)"
|
|
128
|
+
variant="outlined"
|
|
129
|
+
intent="primary"
|
|
130
|
+
onPress={() => {}}
|
|
131
|
+
style={{ marginBottom: theme.space.medium }}
|
|
132
|
+
loading
|
|
133
|
+
/>
|
|
134
|
+
</View>
|
|
135
|
+
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
136
|
+
Disabled
|
|
137
|
+
</Typography.Text>
|
|
138
|
+
<View
|
|
139
|
+
style={{
|
|
140
|
+
flexDirection: 'column',
|
|
141
|
+
marginBottom: theme.space.large,
|
|
142
|
+
}}
|
|
143
|
+
>
|
|
144
|
+
<Button
|
|
145
|
+
text="Basic Transparent (Disabled)"
|
|
146
|
+
variant="basic-transparent"
|
|
147
|
+
onPress={() => {}}
|
|
148
|
+
style={{ marginBottom: theme.space.medium }}
|
|
149
|
+
disabled
|
|
150
|
+
/>
|
|
151
|
+
<Button
|
|
152
|
+
text="Filled (Disabled)"
|
|
153
|
+
variant="filled"
|
|
154
|
+
onPress={() => {}}
|
|
155
|
+
style={{ marginBottom: theme.space.medium }}
|
|
156
|
+
disabled
|
|
157
|
+
/>
|
|
158
|
+
<Button
|
|
159
|
+
text="Outlined (Disabled)"
|
|
160
|
+
variant="outlined"
|
|
161
|
+
onPress={() => {}}
|
|
162
|
+
style={{ marginBottom: theme.space.medium }}
|
|
163
|
+
disabled
|
|
164
|
+
/>
|
|
165
|
+
</View>
|
|
166
|
+
</ScrollView>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export default ButtonPlayground;
|
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
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 {
|
|
28
|
+
space: { medium },
|
|
29
|
+
} = useTheme();
|
|
30
|
+
const [age, setAge] = useState(20);
|
|
31
|
+
const [date, setDate] = useState(new Date());
|
|
32
|
+
const { monday, sunday } = getMondayAndSunday(date);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<View
|
|
36
|
+
style={{
|
|
37
|
+
marginVertical: medium,
|
|
38
|
+
marginHorizontal: medium,
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<View style={{ flexDirection: 'row' }}>
|
|
42
|
+
<Typography.Text style={{ paddingRight: medium }}>
|
|
43
|
+
Age (18 to 25):
|
|
44
|
+
</Typography.Text>
|
|
45
|
+
<ContentNavigator
|
|
46
|
+
value={age}
|
|
47
|
+
onPreviousPress={() => setAge(age - 1)}
|
|
48
|
+
onNextPress={() => setAge(age + 1)}
|
|
49
|
+
previousDisabled={age <= 18}
|
|
50
|
+
nextDisabled={age >= 25}
|
|
51
|
+
/>
|
|
52
|
+
</View>
|
|
53
|
+
<Typography.Text>Week calendar:</Typography.Text>
|
|
54
|
+
<View style={{ flexDirection: 'row' }}>
|
|
55
|
+
<ContentNavigator
|
|
56
|
+
value={`${formatDate(monday)} - ${formatDate(sunday)}`}
|
|
57
|
+
onPreviousPress={() => setDate(addDays(date, -7))}
|
|
58
|
+
onNextPress={() => setDate(addDays(date, 7))}
|
|
59
|
+
/>
|
|
60
|
+
</View>
|
|
61
|
+
</View>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default ContentNavigatorPlayground;
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { TouchableHighlight } from 'react-native';
|
|
3
3
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
4
4
|
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
|
|
5
|
-
import { FAB, Typography, useTheme } from '
|
|
5
|
+
import { FAB, Typography, useTheme } from '@hero-design/rn';
|
|
6
6
|
|
|
7
7
|
const FABPlayground = (): JSX.Element => {
|
|
8
8
|
const [active, setActive] = useState(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ScrollView, View } from 'react-native';
|
|
3
|
-
import { Typography, Icon, useTheme } from '
|
|
3
|
+
import { Typography, Icon, useTheme } from '@hero-design/rn';
|
|
4
4
|
|
|
5
5
|
const IconPlayground = () => {
|
|
6
6
|
const theme = useTheme();
|
|
@@ -94,9 +94,13 @@ const IconPlayground = () => {
|
|
|
94
94
|
intent="success"
|
|
95
95
|
style={{ marginEnd: theme.space.medium }}
|
|
96
96
|
/>
|
|
97
|
-
<Icon
|
|
97
|
+
<Icon
|
|
98
|
+
icon="speaker"
|
|
99
|
+
intent="warning"
|
|
100
|
+
style={{ marginEnd: theme.space.medium }}
|
|
101
|
+
/>
|
|
102
|
+
<Icon icon="arrow-right" intent="disabled-text" />
|
|
98
103
|
</View>
|
|
99
|
-
|
|
100
104
|
<Typography.Text style={{ marginBottom: theme.space.xsmall }}>
|
|
101
105
|
Icon with different sizes
|
|
102
106
|
</Typography.Text>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { Button, Typography, useTheme } from '
|
|
4
|
+
import { Button, Typography, useTheme } from '@hero-design/rn';
|
|
5
5
|
|
|
6
6
|
const IconButtonPlayground = (): JSX.Element => {
|
|
7
7
|
const theme = useTheme();
|
|
@@ -59,7 +59,18 @@ const IconButtonPlayground = (): JSX.Element => {
|
|
|
59
59
|
onPress={() => {}}
|
|
60
60
|
style={{ marginEnd: theme.space.medium }}
|
|
61
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
|
+
/>
|
|
62
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={() => {}} />
|
|
63
74
|
</View>
|
|
64
75
|
);
|
|
65
76
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { View, Button } from 'react-native';
|
|
3
|
-
import { Progress, Typography, useTheme } from '
|
|
3
|
+
import { Progress, Typography, useTheme } from '@hero-design/rn';
|
|
4
4
|
|
|
5
5
|
const ProgressPlayground = () => {
|
|
6
6
|
const [progress, setProgress] = useState(0);
|
|
@@ -0,0 +1,25 @@
|
|
|
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;
|
|
@@ -0,0 +1,68 @@
|
|
|
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;
|