@hero-design/rn 7.2.1 → 7.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.expo/packager-info.json +1 -1
- package/.expo/prebuild/cached-packages.json +4 -0
- package/.expo/xcodebuild-error.log +2 -0
- package/.expo/xcodebuild.log +11199 -0
- package/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-build:types.log +2 -0
- package/.turbo/turbo-test.log +131 -0
- package/.turbo/turbo-type-check.log +7 -0
- package/es/index.js +2393 -457
- package/jest.config.js +1 -1
- package/lib/index.js +2407 -466
- package/package.json +4 -2
- package/playground/components/Avatar.tsx +102 -0
- package/playground/components/Badge.tsx +146 -9
- package/playground/components/Button.tsx +138 -35
- package/playground/components/Card.tsx +39 -13
- package/playground/components/Collapse.tsx +99 -0
- package/playground/components/Drawer.tsx +32 -0
- package/playground/components/FAB.tsx +15 -0
- package/playground/components/IconButton.tsx +67 -0
- package/playground/components/Progress.tsx +95 -0
- package/playground/components/Tabs.tsx +106 -14
- package/playground/components/Tag.tsx +45 -0
- package/playground/index.tsx +18 -0
- package/src/components/Avatar/StyledAvatar.tsx +61 -0
- package/src/components/Avatar/__tests__/StyledAvatar.spec.tsx +48 -0
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +87 -0
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +88 -0
- package/src/components/Avatar/__tests__/index.spec.tsx +26 -0
- package/src/components/Avatar/index.tsx +71 -0
- package/src/components/Badge/Status.tsx +77 -0
- package/src/components/Badge/StyledBadge.tsx +38 -26
- package/src/components/Badge/__tests__/Badge.spec.tsx +16 -0
- package/src/components/Badge/__tests__/Status.spec.tsx +27 -0
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +133 -52
- package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +89 -0
- package/src/components/Badge/index.tsx +77 -19
- package/src/components/Button/Button.tsx +163 -0
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +58 -0
- package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +20 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +101 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +606 -0
- package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +24 -0
- package/src/components/Button/LoadingIndicator/index.tsx +140 -0
- package/src/components/Button/StyledButton.tsx +254 -0
- package/src/components/Button/__tests__/Button.spec.tsx +86 -0
- package/src/components/Button/__tests__/{index.spec.tsx → IconButton.spec.tsx} +0 -0
- package/src/components/Button/__tests__/StyledButton.spec.tsx +154 -0
- package/src/components/Button/__tests__/__snapshots__/{index.spec.tsx.snap → IconButton.spec.tsx.snap} +0 -0
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +895 -0
- package/src/components/Button/index.tsx +10 -2
- package/src/components/Card/StyledCard.tsx +27 -5
- package/src/components/Card/__tests__/StyledCard.spec.tsx +15 -3
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +34 -2
- package/src/components/Card/__tests__/index.spec.tsx +16 -21
- package/src/components/Card/index.tsx +15 -2
- package/src/components/Collapse/StyledCollapse.tsx +15 -0
- package/src/components/Collapse/__tests__/StyledCollapse.spec.tsx +26 -0
- package/src/components/Collapse/__tests__/__snapshots__/StyledCollapse.spec.tsx.snap +37 -0
- package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +84 -0
- package/src/components/Collapse/__tests__/index.spec.tsx +42 -0
- package/src/components/Collapse/index.tsx +109 -0
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/Drawer/StyledDrawer.tsx +39 -0
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +244 -0
- package/src/components/Drawer/__tests__/index.spec.tsx +37 -0
- package/src/components/Drawer/index.tsx +93 -0
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +78 -62
- package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +2 -0
- package/src/components/FAB/ActionGroup/index.tsx +13 -0
- package/src/components/FAB/FAB.tsx +63 -13
- package/src/components/FAB/StyledFAB.tsx +25 -6
- package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +6 -2
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +7 -3
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +88 -6
- package/src/components/FAB/__tests__/index.spec.tsx +16 -0
- package/src/components/Progress/ProgressBar.tsx +73 -0
- package/src/components/Progress/ProgressCircle.tsx +165 -0
- package/src/components/Progress/StyledProgressBar.tsx +21 -0
- package/src/components/Progress/StyledProgressCircle.tsx +66 -0
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +641 -0
- package/src/components/Progress/__tests__/index.spec.js +46 -0
- package/src/components/Progress/index.tsx +6 -0
- package/src/components/Progress/types.ts +1 -0
- package/src/components/Tabs/ActiveTabIndicator.tsx +37 -0
- package/src/components/Tabs/ScrollableTabs.tsx +216 -0
- package/src/components/Tabs/StyledScrollableTabs.tsx +60 -0
- package/src/components/Tabs/StyledTabs.tsx +30 -44
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +84 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +591 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +317 -224
- package/src/components/Tabs/__tests__/index.spec.tsx +22 -21
- package/src/components/Tabs/index.tsx +155 -114
- package/src/components/Tabs/utils.ts +13 -0
- package/src/components/Tag/StyledTag.tsx +35 -0
- package/src/components/Tag/__tests__/Tag.spec.tsx +41 -0
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +153 -0
- package/src/components/Tag/index.tsx +41 -0
- package/src/components/Typography/Text/index.tsx +1 -1
- package/src/index.ts +10 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +181 -22
- package/src/theme/components/avatar.ts +40 -0
- package/src/theme/components/badge.ts +14 -16
- package/src/theme/components/button.ts +57 -0
- package/src/theme/components/card.ts +5 -5
- package/src/theme/components/drawer.ts +24 -0
- package/src/theme/components/fab.ts +9 -2
- package/src/theme/components/progress.ts +27 -0
- package/src/theme/components/tabs.ts +22 -7
- package/src/theme/components/tag.ts +39 -0
- package/src/theme/global/borders.ts +13 -1
- package/src/theme/global/colors.ts +6 -1
- package/src/theme/global/index.ts +3 -1
- package/src/theme/global/scale.ts +3 -0
- package/src/theme/index.ts +15 -0
- package/src/utils/hooks.ts +10 -0
- package/testUtils/setup.tsx +43 -0
- package/types/playground/components/Avatar.d.ts +2 -0
- package/types/playground/components/Collapse.d.ts +2 -0
- package/types/playground/components/Drawer.d.ts +2 -0
- package/types/playground/components/IconButton.d.ts +2 -0
- package/types/playground/components/Progress.d.ts +2 -0
- package/types/playground/components/Tag.d.ts +2 -0
- package/types/src/components/Avatar/StyledAvatar.d.ts +46 -0
- package/types/src/components/Avatar/__tests__/StyledAvatar.spec.d.ts +1 -0
- package/types/src/components/Avatar/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Avatar/index.d.ts +25 -0
- package/types/src/components/Badge/Status.d.ts +24 -0
- package/types/src/components/Badge/StyledBadge.d.ts +17 -9
- package/types/src/components/Badge/__tests__/Status.spec.d.ts +1 -0
- package/types/src/components/Badge/index.d.ts +17 -7
- package/types/src/components/Button/Button.d.ts +57 -0
- package/types/src/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +20 -0
- package/types/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +1 -0
- package/types/src/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Button/LoadingIndicator/index.d.ts +26 -0
- package/types/src/components/Button/StyledButton.d.ts +40 -0
- package/types/src/components/Button/__tests__/Button.spec.d.ts +1 -0
- package/types/src/components/Button/__tests__/IconButton.spec.d.ts +1 -0
- package/types/src/components/Button/__tests__/StyledButton.spec.d.ts +1 -0
- package/types/src/components/Button/index.d.ts +8 -4
- package/types/src/components/Card/StyledCard.d.ts +9 -1
- package/types/src/components/Card/index.d.ts +5 -1
- package/types/src/components/Collapse/StyledCollapse.d.ts +15 -0
- package/types/src/components/Collapse/__tests__/StyledCollapse.spec.d.ts +1 -0
- package/types/src/components/Collapse/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Collapse/index.d.ts +23 -0
- package/types/src/components/Drawer/StyledDrawer.d.ts +25 -0
- package/types/src/components/Drawer/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Drawer/index.d.ts +25 -0
- package/types/src/components/FAB/ActionGroup/index.d.ts +5 -1
- package/types/src/components/FAB/FAB.d.ts +5 -1
- package/types/src/components/FAB/StyledFAB.d.ts +8 -2
- package/types/src/components/FAB/index.d.ts +2 -2
- package/types/src/components/Icon/utils.d.ts +1 -1
- package/types/src/components/Progress/ProgressBar.d.ts +18 -0
- package/types/src/components/Progress/ProgressCircle.d.ts +18 -0
- package/types/src/components/Progress/StyledProgressBar.d.ts +18 -0
- package/types/src/components/Progress/StyledProgressCircle.d.ts +38 -0
- package/types/src/components/Progress/__tests__/index.spec.d.ts +1 -0
- package/types/src/components/Progress/index.d.ts +5 -0
- package/types/src/components/Progress/types.d.ts +1 -0
- package/types/src/components/Tabs/ActiveTabIndicator.d.ts +8 -0
- package/types/src/components/Tabs/ScrollableTabs.d.ts +3 -0
- package/types/src/components/Tabs/StyledScrollableTabs.d.ts +61 -0
- package/types/src/components/Tabs/StyledTabs.d.ts +22 -22
- package/types/src/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
- package/types/src/components/Tabs/index.d.ts +28 -19
- package/types/src/components/Tabs/utils.d.ts +2 -0
- package/types/src/components/Tag/StyledTag.d.ts +20 -0
- package/types/src/components/Tag/__tests__/Tag.spec.d.ts +1 -0
- package/types/src/components/Tag/index.d.ts +21 -0
- package/types/src/index.d.ts +6 -1
- package/types/src/theme/components/avatar.d.ts +32 -0
- package/types/src/theme/components/badge.d.ts +12 -13
- package/types/src/theme/components/button.d.ts +37 -0
- package/types/src/theme/components/card.d.ts +3 -3
- package/types/src/theme/components/drawer.d.ts +21 -0
- package/types/src/theme/components/fab.d.ts +8 -1
- package/types/src/theme/components/progress.d.ts +21 -0
- package/types/src/theme/components/tabs.d.ts +14 -2
- package/types/src/theme/components/tag.d.ts +30 -0
- package/types/src/theme/global/borders.d.ts +7 -1
- package/types/src/theme/global/colors.d.ts +6 -1
- package/types/src/theme/global/index.d.ts +7 -1
- package/types/src/theme/global/scale.d.ts +1 -0
- package/types/src/theme/index.d.ts +10 -0
- package/types/src/utils/hooks.d.ts +1 -0
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +0 -34
- package/testUtils/setup.ts +0 -18
|
@@ -3,12 +3,15 @@ import palette from '@hero-design/colors';
|
|
|
3
3
|
const systemPalette = {
|
|
4
4
|
primary: palette.violet,
|
|
5
5
|
primaryLight: palette.violetLight60,
|
|
6
|
+
primaryDark: palette.purpleDark15,
|
|
7
|
+
primaryBackground: palette.violetLight90,
|
|
8
|
+
secondary: palette.dodgerBlue,
|
|
9
|
+
secondaryLight: palette.dodgerBlueLight75,
|
|
6
10
|
info: palette.dodgerBlue,
|
|
7
11
|
infoLight: palette.dodgerBlueLight75,
|
|
8
12
|
infoBackground: palette.dodgerBlueLight90,
|
|
9
13
|
success: palette.green,
|
|
10
14
|
successDark: palette.greenDark30,
|
|
11
|
-
successLight: palette.greenDark75,
|
|
12
15
|
successBackground: palette.grotesqueGreenLight90,
|
|
13
16
|
danger: palette.red,
|
|
14
17
|
dangerLight: palette.redLight60,
|
|
@@ -21,8 +24,10 @@ const systemPalette = {
|
|
|
21
24
|
backgroundDark: palette.greyDark75,
|
|
22
25
|
text: palette.greyDark75,
|
|
23
26
|
disabledText: palette.greyDark15,
|
|
27
|
+
disabledLightText: palette.greyLight45,
|
|
24
28
|
invertedText: palette.white,
|
|
25
29
|
outline: palette.greyLight60,
|
|
30
|
+
archived: palette.greyLight45,
|
|
26
31
|
};
|
|
27
32
|
|
|
28
33
|
type SystemPalette = typeof systemPalette;
|
|
@@ -2,7 +2,7 @@ import { scale as defaultScale, Scale } from './scale';
|
|
|
2
2
|
import { systemPalette as defaultSystemPalette, SystemPalette } from './colors';
|
|
3
3
|
import { getFonts, getFontSizes, getLineHeights } from './typography';
|
|
4
4
|
import { getSpace } from './space';
|
|
5
|
-
import { getBorderWidths } from './borders';
|
|
5
|
+
import { getBorderWidths, getRadii } from './borders';
|
|
6
6
|
|
|
7
7
|
const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
8
8
|
const fonts = getFonts(scale.font);
|
|
@@ -10,6 +10,7 @@ const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
10
10
|
const lineHeights = getLineHeights(fontSizes);
|
|
11
11
|
const borderWidths = getBorderWidths(scale.borderWidth);
|
|
12
12
|
const space = getSpace(scale.space);
|
|
13
|
+
const radii = getRadii(scale.radius);
|
|
13
14
|
|
|
14
15
|
return {
|
|
15
16
|
colors: {
|
|
@@ -20,6 +21,7 @@ const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
20
21
|
lineHeights,
|
|
21
22
|
borderWidths,
|
|
22
23
|
space,
|
|
24
|
+
radii,
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
|
|
@@ -6,11 +6,14 @@ const BASE_FONT = 'BeVietnamPro';
|
|
|
6
6
|
|
|
7
7
|
const BASE_FONT_SIZE = 10;
|
|
8
8
|
|
|
9
|
+
const BASE_RADIUS = 4;
|
|
10
|
+
|
|
9
11
|
const scale = {
|
|
10
12
|
borderWidth: BASE_BORDER_WIDTH,
|
|
11
13
|
space: BASE_SPACE,
|
|
12
14
|
font: BASE_FONT,
|
|
13
15
|
fontSize: BASE_FONT_SIZE,
|
|
16
|
+
radius: BASE_RADIUS,
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
type Scale = typeof scale;
|
package/src/theme/index.ts
CHANGED
|
@@ -9,21 +9,31 @@ import {
|
|
|
9
9
|
|
|
10
10
|
import getBadgeTheme from './components/badge';
|
|
11
11
|
import getBottomNavigationTheme from './components/bottomNavigation';
|
|
12
|
+
import getButtonTheme from './components/button';
|
|
12
13
|
import getCardTheme from './components/card';
|
|
13
14
|
import getDividerTheme from './components/divider';
|
|
15
|
+
import getDrawerTheme from './components/drawer';
|
|
14
16
|
import getTabsTheme from './components/tabs';
|
|
17
|
+
import getTagTheme from './components/tag';
|
|
15
18
|
import getIconTheme from './components/icon';
|
|
19
|
+
import getProgressTheme from './components/progress';
|
|
16
20
|
import getTypographyTheme from './components/typography';
|
|
17
21
|
import getFABTheme from './components/fab';
|
|
22
|
+
import getAvatarTheme from './components/avatar';
|
|
18
23
|
|
|
19
24
|
type Theme = GlobalTheme & {
|
|
20
25
|
__hd__: {
|
|
26
|
+
avatar: ReturnType<typeof getAvatarTheme>;
|
|
21
27
|
badge: ReturnType<typeof getBadgeTheme>;
|
|
22
28
|
bottomNavigation: ReturnType<typeof getBottomNavigationTheme>;
|
|
29
|
+
button: ReturnType<typeof getButtonTheme>;
|
|
23
30
|
card: ReturnType<typeof getCardTheme>;
|
|
24
31
|
divider: ReturnType<typeof getDividerTheme>;
|
|
32
|
+
drawer: ReturnType<typeof getDrawerTheme>;
|
|
25
33
|
icon: ReturnType<typeof getIconTheme>;
|
|
34
|
+
progress: ReturnType<typeof getProgressTheme>;
|
|
26
35
|
tabs: ReturnType<typeof getTabsTheme>;
|
|
36
|
+
tag: ReturnType<typeof getTagTheme>;
|
|
27
37
|
typography: ReturnType<typeof getTypographyTheme>;
|
|
28
38
|
fab: ReturnType<typeof getFABTheme>;
|
|
29
39
|
};
|
|
@@ -37,12 +47,17 @@ const getTheme = (
|
|
|
37
47
|
return {
|
|
38
48
|
...globalTheme,
|
|
39
49
|
__hd__: {
|
|
50
|
+
avatar: getAvatarTheme(globalTheme),
|
|
40
51
|
badge: getBadgeTheme(globalTheme),
|
|
41
52
|
bottomNavigation: getBottomNavigationTheme(globalTheme),
|
|
53
|
+
button: getButtonTheme(globalTheme),
|
|
42
54
|
card: getCardTheme(globalTheme),
|
|
43
55
|
divider: getDividerTheme(globalTheme),
|
|
56
|
+
drawer: getDrawerTheme(globalTheme),
|
|
57
|
+
progress: getProgressTheme(globalTheme),
|
|
44
58
|
icon: getIconTheme(globalTheme),
|
|
45
59
|
tabs: getTabsTheme(globalTheme),
|
|
60
|
+
tag: getTagTheme(globalTheme),
|
|
46
61
|
typography: getTypographyTheme(globalTheme),
|
|
47
62
|
fab: getFABTheme(globalTheme),
|
|
48
63
|
},
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
jest.mock('react-native-vector-icons', () => ({
|
|
2
|
+
createIconSetFromIcoMoon: jest.fn(() => 'HeroIcon'),
|
|
3
|
+
}));
|
|
4
|
+
|
|
5
|
+
jest.mock('react-native', () => {
|
|
6
|
+
const RN = jest.requireActual('react-native');
|
|
7
|
+
|
|
8
|
+
RN.Animated.timing = () => ({
|
|
9
|
+
start: () => jest.fn(),
|
|
10
|
+
stop: () => jest.fn(),
|
|
11
|
+
_isUsingNativeDriver: () => jest.fn(),
|
|
12
|
+
_startNativeLoop: () => jest.fn(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return RN;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
jest.mock('../src/utils/scale', () => ({
|
|
19
|
+
scale: jest.fn(size => size),
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
|
|
23
|
+
jest.mock('react-native-pager-view', () => {
|
|
24
|
+
const RealComponent = jest.requireActual('react-native-pager-view').default;
|
|
25
|
+
const React = jest.requireActual('react');
|
|
26
|
+
|
|
27
|
+
return class ViewPager extends React.Component<{
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
}> {
|
|
30
|
+
index = 0;
|
|
31
|
+
|
|
32
|
+
setPage = (page: number) => {
|
|
33
|
+
const { children } = this.props;
|
|
34
|
+
|
|
35
|
+
this.index = Math.max(0, Math.min(page, React.Children.count(children)));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
render() {
|
|
39
|
+
const { children } = this.props;
|
|
40
|
+
return <RealComponent>{children}</RealComponent>;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { View, Image, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
declare type ThemeSize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
|
+
declare type ThemeIntent = 'primary' | 'info' | 'danger' | 'success' | 'warning';
|
|
5
|
+
declare const StyledPressable: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
|
|
6
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
7
|
+
as?: import("react").ElementType<any> | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
themeSize: ThemeSize;
|
|
10
|
+
themeIntent: ThemeIntent;
|
|
11
|
+
}, {}, {
|
|
12
|
+
ref?: import("react").Ref<TouchableOpacity> | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
declare const StyledView: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any> | undefined;
|
|
17
|
+
} & {
|
|
18
|
+
themeSize: ThemeSize;
|
|
19
|
+
themeIntent: ThemeIntent;
|
|
20
|
+
}, {}, {
|
|
21
|
+
ref?: import("react").Ref<View> | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
declare const StyledTextWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
24
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
25
|
+
as?: import("react").ElementType<any> | undefined;
|
|
26
|
+
}, {}, {
|
|
27
|
+
ref?: import("react").Ref<View> | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
declare const StyledText: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
|
|
30
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
31
|
+
as?: import("react").ElementType<any> | undefined;
|
|
32
|
+
} & {
|
|
33
|
+
themeSize: ThemeSize;
|
|
34
|
+
themeIntent: ThemeIntent;
|
|
35
|
+
}, {}, {
|
|
36
|
+
ref?: import("react").Ref<Text> | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
declare const StyledImage: import("@emotion/native").StyledComponent<import("react-native").ImageProps & {
|
|
39
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
40
|
+
as?: import("react").ElementType<any> | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
themeSize: ThemeSize;
|
|
43
|
+
}, {}, {
|
|
44
|
+
ref?: import("react").Ref<Image> | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
export { StyledPressable, StyledView, StyledImage, StyledTextWrapper, StyledText, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ImageSourcePropType, StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
+
interface AvatarProps extends ViewProps {
|
|
3
|
+
/** Callback function when pressing component. */
|
|
4
|
+
onPress?: () => void;
|
|
5
|
+
/** Image source to be displayed on avatar. */
|
|
6
|
+
source?: ImageSourcePropType;
|
|
7
|
+
/** Renders title in the placeholder. */
|
|
8
|
+
title?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Intent of the Icon.
|
|
11
|
+
*/
|
|
12
|
+
intent?: 'primary' | 'info' | 'danger' | 'success' | 'warning';
|
|
13
|
+
/** Size of the avatar. */
|
|
14
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
15
|
+
/**
|
|
16
|
+
* Addditional style.
|
|
17
|
+
*/
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
/**
|
|
20
|
+
* Testing id of the component.
|
|
21
|
+
*/
|
|
22
|
+
testID?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Avatar: ({ onPress, source, testID, style, title, size, intent, }: AvatarProps) => JSX.Element | null;
|
|
25
|
+
export default Avatar;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface StatusProps extends ViewProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the Status Badge is visible.
|
|
7
|
+
*/
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
/**
|
|
11
|
+
* Visual intent color to apply to Status Badge.
|
|
12
|
+
*/
|
|
13
|
+
intent?: 'success' | 'warning' | 'danger' | 'info' | 'archived';
|
|
14
|
+
/**
|
|
15
|
+
* Additional style.
|
|
16
|
+
*/
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
/**
|
|
19
|
+
* Testing id of the component.
|
|
20
|
+
*/
|
|
21
|
+
testID?: string;
|
|
22
|
+
}
|
|
23
|
+
declare const Status: ({ children, visible, intent, style, testID, ...nativeProps }: StatusProps) => JSX.Element;
|
|
24
|
+
export default Status;
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
declare type ThemeIntent = 'success' | 'warning' | 'danger' | 'info';
|
|
4
|
-
declare
|
|
2
|
+
import { Animated, Text } from 'react-native';
|
|
3
|
+
declare type ThemeIntent = 'success' | 'warning' | 'danger' | 'info' | 'archived';
|
|
4
|
+
declare type ThemePadding = 'narrowContent' | 'wideContent';
|
|
5
|
+
declare const StyledView: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>> & {
|
|
6
|
+
children?: import("react").ReactNode;
|
|
7
|
+
} & {
|
|
5
8
|
theme?: import("@emotion/react").Theme | undefined;
|
|
6
9
|
as?: import("react").ElementType<any> | undefined;
|
|
7
10
|
} & {
|
|
8
11
|
themeIntent: ThemeIntent;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}>;
|
|
12
|
+
themePadding: ThemePadding;
|
|
13
|
+
}, {}, {}>;
|
|
12
14
|
declare const StyledText: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
|
|
13
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
14
16
|
as?: import("react").ElementType<any> | undefined;
|
|
15
|
-
} & {
|
|
16
|
-
themeIntent: ThemeIntent;
|
|
17
17
|
}, {}, {
|
|
18
18
|
ref?: import("react").Ref<Text> | undefined;
|
|
19
19
|
}>;
|
|
20
|
-
|
|
20
|
+
declare const StyledStatus: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>> & {
|
|
21
|
+
children?: import("react").ReactNode;
|
|
22
|
+
} & {
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any> | undefined;
|
|
25
|
+
} & {
|
|
26
|
+
themeIntent: ThemeIntent;
|
|
27
|
+
}, {}, {}>;
|
|
28
|
+
export { StyledView, StyledText, StyledStatus };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle
|
|
2
|
-
import
|
|
3
|
-
interface BadgeProps extends
|
|
1
|
+
import { Animated, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface BadgeProps extends React.ComponentProps<typeof Animated.View> {
|
|
4
4
|
/**
|
|
5
5
|
* Content of the Badge.
|
|
6
6
|
*/
|
|
7
|
-
content: string;
|
|
7
|
+
content: string | number;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the Badge is visible.
|
|
10
|
+
*/
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The maximum number displayed on the badge. If number exceeds this value, `${max}+` are displayed instead. (Only applied when content is number.)
|
|
14
|
+
*/
|
|
15
|
+
max?: number;
|
|
8
16
|
/**
|
|
9
17
|
* Visual intent color to apply to Badge.
|
|
10
18
|
*/
|
|
11
|
-
intent?: 'success' | 'warning' | 'danger' | 'info';
|
|
19
|
+
intent?: 'success' | 'warning' | 'danger' | 'info' | 'archived';
|
|
12
20
|
/**
|
|
13
21
|
* Additional style.
|
|
14
22
|
*/
|
|
@@ -18,5 +26,7 @@ interface BadgeProps extends ViewProps {
|
|
|
18
26
|
*/
|
|
19
27
|
testID?: string;
|
|
20
28
|
}
|
|
21
|
-
declare const
|
|
22
|
-
|
|
29
|
+
declare const _default: (({ content: originalContent, visible, max, intent, style, testID, ...nativeProps }: BadgeProps) => JSX.Element) & {
|
|
30
|
+
Status: ({ children, visible, intent, style, testID, ...nativeProps }: import("./Status").StatusProps) => JSX.Element;
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ReactChild } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { IconName } from '../Icon';
|
|
4
|
+
import { Intent, ThemeVariant } from './StyledButton';
|
|
5
|
+
export interface ButtonProps {
|
|
6
|
+
/**
|
|
7
|
+
* Helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.
|
|
8
|
+
*/
|
|
9
|
+
accessibilityHint?: string;
|
|
10
|
+
/**
|
|
11
|
+
* A succinct label in a localized string that identifies the accessibility element
|
|
12
|
+
*/
|
|
13
|
+
accessibilityLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Disable state of button.
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Places an icon within the button, before the button's text
|
|
20
|
+
*/
|
|
21
|
+
icon?: IconName;
|
|
22
|
+
/**
|
|
23
|
+
* Visual intent color to apply to button. It is required for `filled`, `outlined` and `text` variants.
|
|
24
|
+
*/
|
|
25
|
+
intent?: 'primary' | 'secondary';
|
|
26
|
+
/**
|
|
27
|
+
* Loading state of button.
|
|
28
|
+
*/
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Set the handler to handle press event.
|
|
32
|
+
*/
|
|
33
|
+
onPress: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Places an icon within the button, after the button's text
|
|
36
|
+
*/
|
|
37
|
+
rightIcon?: IconName;
|
|
38
|
+
/**
|
|
39
|
+
* Addditional style.
|
|
40
|
+
*/
|
|
41
|
+
style?: StyleProp<ViewStyle>;
|
|
42
|
+
/**
|
|
43
|
+
* Testing id of the component.
|
|
44
|
+
*/
|
|
45
|
+
testID?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Button label.
|
|
48
|
+
*/
|
|
49
|
+
text: ReactChild;
|
|
50
|
+
/**
|
|
51
|
+
* Button type.
|
|
52
|
+
*/
|
|
53
|
+
variant?: 'basic-transparent' | 'filled' | 'outlined';
|
|
54
|
+
}
|
|
55
|
+
export declare const getThemeVariant: (variant: 'basic-transparent' | 'filled' | 'outlined', intent: Intent) => ThemeVariant;
|
|
56
|
+
declare const Button: ({ accessibilityHint, accessibilityLabel, disabled, icon, intent, loading, onPress, rightIcon, style, testID, text, variant, }: ButtonProps) => JSX.Element;
|
|
57
|
+
export default Button;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { View, ViewProps } from 'react-native';
|
|
3
|
+
import { Theme } from '@emotion/react';
|
|
4
|
+
declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'outlined-primary' | 'outlined-secondary';
|
|
5
|
+
declare const StyledLoadingIndicatorWrapper: import("@emotion/native").StyledComponent<ViewProps & {
|
|
6
|
+
theme?: Theme | undefined;
|
|
7
|
+
as?: import("react").ElementType<any> | undefined;
|
|
8
|
+
}, {}, {
|
|
9
|
+
ref?: import("react").Ref<View> | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
declare const StyledLoadingDot: import("@emotion/native").StyledComponent<ViewProps & {
|
|
12
|
+
theme?: Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
size?: number | undefined;
|
|
16
|
+
themeVariant: ThemeVariant;
|
|
17
|
+
}, {}, {
|
|
18
|
+
ref?: import("react").Ref<View> | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export { StyledLoadingIndicatorWrapper, StyledLoadingDot };
|
package/types/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
2
|
+
declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'outlined-primary' | 'outlined-secondary';
|
|
3
|
+
interface LoadingIndicatorProps extends ViewProps {
|
|
4
|
+
/**
|
|
5
|
+
* Size of the loading dot.
|
|
6
|
+
*/
|
|
7
|
+
count?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Size of the loading dot.
|
|
10
|
+
*/
|
|
11
|
+
size?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Additional style.
|
|
14
|
+
*/
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
/**
|
|
17
|
+
* Testing id of the component.
|
|
18
|
+
*/
|
|
19
|
+
testID?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Testing id of the component.
|
|
22
|
+
*/
|
|
23
|
+
themeVariant: ThemeVariant;
|
|
24
|
+
}
|
|
25
|
+
declare const LoadingIndicator: ({ count, size, testID, themeVariant, ...nativeProps }: LoadingIndicatorProps) => JSX.Element;
|
|
26
|
+
export default LoadingIndicator;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { Theme } from '@emotion/react';
|
|
4
|
+
declare type Intent = 'primary' | 'secondary';
|
|
5
|
+
declare type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'outlined-primary' | 'outlined-secondary';
|
|
6
|
+
declare const StyledButtonContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
7
|
+
theme?: Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
pressed?: boolean | undefined;
|
|
12
|
+
themeVariant: ThemeVariant;
|
|
13
|
+
}, {}, {
|
|
14
|
+
ref?: import("react").Ref<View> | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
declare const StyledButtonText: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
|
|
17
|
+
theme?: Theme | undefined;
|
|
18
|
+
as?: import("react").ElementType<any> | undefined;
|
|
19
|
+
} & {
|
|
20
|
+
disabled?: boolean | undefined;
|
|
21
|
+
pressed?: boolean | undefined;
|
|
22
|
+
themeVariant: ThemeVariant;
|
|
23
|
+
}, {}, {}>;
|
|
24
|
+
declare const StyledButtonIconWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
25
|
+
theme?: Theme | undefined;
|
|
26
|
+
as?: import("react").ElementType<any> | undefined;
|
|
27
|
+
} & {
|
|
28
|
+
themePosition: 'left' | 'right';
|
|
29
|
+
}, {}, {
|
|
30
|
+
ref?: import("react").Ref<View> | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
declare const StyledButtonIcon: import("@emotion/native").StyledComponent<import("../Icon").IconProps & {
|
|
33
|
+
theme?: Theme | undefined;
|
|
34
|
+
as?: import("react").ElementType<any> | undefined;
|
|
35
|
+
} & {
|
|
36
|
+
disabled?: boolean | undefined;
|
|
37
|
+
pressed?: boolean | undefined;
|
|
38
|
+
themeVariant: ThemeVariant;
|
|
39
|
+
}, {}, {}>;
|
|
40
|
+
export { StyledButtonContainer, StyledButtonText, StyledButtonIconWrapper, StyledButtonIcon, Intent, ThemeVariant, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { ButtonProps } from './Button';
|
|
3
|
+
import IconButton from './IconButton';
|
|
4
|
+
interface CompoundButtonProps extends FunctionComponent<ButtonProps> {
|
|
5
|
+
Icon: typeof IconButton;
|
|
6
|
+
}
|
|
7
|
+
declare const CompoundButton: CompoundButtonProps;
|
|
8
|
+
export default CompoundButton;
|
|
@@ -3,7 +3,15 @@ import { View } from 'react-native';
|
|
|
3
3
|
declare const StyledCard: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: import("react").ElementType<any> | undefined;
|
|
6
|
+
} & {
|
|
7
|
+
themeVariant: 'basic' | 'data';
|
|
6
8
|
}, {}, {
|
|
7
9
|
ref?: import("react").Ref<View> | undefined;
|
|
8
10
|
}>;
|
|
9
|
-
|
|
11
|
+
declare const LeftDataCard: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
}, {}, {
|
|
15
|
+
ref?: import("react").Ref<View> | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
export { StyledCard, LeftDataCard };
|
|
@@ -5,6 +5,10 @@ interface CardProps extends ViewProps {
|
|
|
5
5
|
* Card's content.
|
|
6
6
|
*/
|
|
7
7
|
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Card type.
|
|
10
|
+
*/
|
|
11
|
+
variant?: 'basic' | 'data';
|
|
8
12
|
/**
|
|
9
13
|
* Addditional style.
|
|
10
14
|
*/
|
|
@@ -14,5 +18,5 @@ interface CardProps extends ViewProps {
|
|
|
14
18
|
*/
|
|
15
19
|
testID?: string;
|
|
16
20
|
}
|
|
17
|
-
declare const Card: (
|
|
21
|
+
declare const Card: ({ variant, children, ...nativeProps }: CardProps) => JSX.Element;
|
|
18
22
|
export default Card;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Animated, View } from 'react-native';
|
|
3
|
+
declare const StyledWrapper: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<View>> & {
|
|
4
|
+
children?: import("react").ReactNode;
|
|
5
|
+
} & {
|
|
6
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
7
|
+
as?: import("react").ElementType<any> | undefined;
|
|
8
|
+
}, {}, {}>;
|
|
9
|
+
declare const StyledChildWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
as?: import("react").ElementType<any> | undefined;
|
|
12
|
+
}, {}, {
|
|
13
|
+
ref?: import("react").Ref<View> | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export { StyledWrapper, StyledChildWrapper };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface CollapseProps extends ViewProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the child components will remain mounted when the Collapse is closed.
|
|
7
|
+
*/
|
|
8
|
+
keepChildrenMounted?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the component is open or closed.
|
|
11
|
+
*/
|
|
12
|
+
open?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Addditional style.
|
|
15
|
+
*/
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
/**
|
|
18
|
+
* Testing id of the component.
|
|
19
|
+
*/
|
|
20
|
+
testID?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const Collapse: ({ open, keepChildrenMounted, children, testID, style, }: CollapseProps) => JSX.Element;
|
|
23
|
+
export default Collapse;
|