@hero-design/rn 7.1.3-alpha7 → 7.2.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/.turbo/turbo-build.log +8 -0
- package/.turbo/turbo-publish:npm.log +0 -0
- package/es/index.js +148 -94
- package/lib/index.js +148 -94
- package/package.json +2 -38
- package/playground/components/BottomNavigation.tsx +1 -1
- package/playground/components/Card.tsx +1 -1
- package/playground/components/Tabs.tsx +1 -1
- package/playground/index.tsx +39 -31
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/BottomNavigation/__tests__/index.spec.tsx +2 -2
- package/src/components/BottomNavigation/index.tsx +6 -10
- package/src/components/FAB/ActionGroup/index.tsx +1 -2
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Tabs/__tests__/index.spec.tsx +2 -2
- package/src/components/Tabs/index.tsx +19 -15
- package/src/theme/global/borders.ts +8 -2
- package/src/theme/global/colors.ts +4 -2
- package/src/theme/global/index.ts +31 -17
- package/src/theme/global/scale.ts +18 -0
- package/src/theme/global/space.ts +23 -13
- package/src/theme/global/typography.ts +71 -27
- package/src/theme/index.ts +27 -14
- package/types/playground/components/Badge.d.ts +0 -0
- package/types/playground/components/BottomNavigation.d.ts +0 -0
- package/types/playground/components/Button.d.ts +0 -0
- package/types/playground/components/Card.d.ts +0 -0
- package/types/playground/components/Divider.d.ts +0 -0
- package/types/playground/components/FAB.d.ts +0 -0
- package/types/playground/components/Icon.d.ts +0 -0
- package/types/playground/components/Tabs.d.ts +0 -0
- package/types/playground/components/Typography.d.ts +0 -0
- package/types/playground/index.d.ts +0 -0
- package/types/src/components/Badge/StyledBadge.d.ts +0 -0
- package/types/src/components/Badge/__tests__/Badge.spec.d.ts +0 -0
- package/types/src/components/Badge/index.d.ts +0 -0
- package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/types/src/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/BottomNavigation/index.d.ts +3 -3
- package/types/src/components/Button/IconButton.d.ts +0 -0
- package/types/src/components/Button/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Button/index.d.ts +0 -0
- package/types/src/components/Card/StyledCard.d.ts +0 -0
- package/types/src/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
- package/types/src/components/Card/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Card/index.d.ts +0 -0
- package/types/src/components/Divider/StyledDivider.d.ts +0 -0
- package/types/src/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
- package/types/src/components/Divider/index.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/FAB/ActionGroup/index.d.ts +3 -0
- package/types/src/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/src/components/FAB/FAB.d.ts +0 -0
- package/types/src/components/FAB/StyledFAB.d.ts +0 -0
- package/types/src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
- package/types/src/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
- package/types/src/components/FAB/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/FAB/index.d.ts +0 -0
- package/types/src/components/Icon/HeroIcon/index.d.ts +0 -0
- package/types/src/components/Icon/IconList.d.ts +0 -0
- package/types/src/components/Icon/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Icon/index.d.ts +0 -0
- package/types/src/components/Icon/utils.d.ts +0 -0
- package/types/src/components/Tabs/StyledTabs.d.ts +0 -0
- package/types/src/components/Tabs/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Tabs/index.d.ts +3 -3
- package/types/src/components/Typography/Text/StyledText.d.ts +0 -0
- package/types/src/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
- package/types/src/components/Typography/Text/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Typography/Text/index.d.ts +0 -0
- package/types/src/components/Typography/index.d.ts +0 -0
- package/types/src/index.d.ts +0 -0
- package/types/src/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/src/theme/__tests__/index.spec.d.ts +0 -0
- package/types/src/theme/components/badge.d.ts +0 -0
- package/types/src/theme/components/bottomNavigation.d.ts +0 -0
- package/types/src/theme/components/card.d.ts +0 -0
- package/types/src/theme/components/divider.d.ts +0 -0
- package/types/src/theme/components/fab.d.ts +0 -0
- package/types/src/theme/components/icon.d.ts +0 -0
- package/types/src/theme/components/tabs.d.ts +0 -0
- package/types/src/theme/components/typography.d.ts +0 -0
- package/types/src/theme/global/borders.d.ts +4 -3
- package/types/src/theme/global/colors.d.ts +2 -2
- package/types/src/theme/global/index.d.ts +10 -45
- package/types/src/theme/global/scale.d.ts +8 -0
- package/types/src/theme/global/space.d.ts +8 -7
- package/types/src/theme/global/typography.d.ts +9 -16
- package/types/src/theme/index.d.ts +2 -2
- package/types/src/types.d.ts +0 -0
- package/types/src/utils/__tests__/scale.spec.d.ts +0 -0
- package/types/src/utils/helpers.d.ts +0 -0
- package/types/src/utils/scale.d.ts +0 -0
- package/yarn-error.log +0 -140
|
@@ -30,9 +30,9 @@ export type TabType = {
|
|
|
30
30
|
|
|
31
31
|
interface TabsProps extends ViewProps {
|
|
32
32
|
/**
|
|
33
|
-
* Callback which is called on tab
|
|
33
|
+
* Callback which is called on tab press, receiving key of upcoming active Tab.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
onTabPress: (key: string) => void;
|
|
36
36
|
/**
|
|
37
37
|
* Whether inactive tabs should be removed and unmounted in React.
|
|
38
38
|
* Defaults to `false`.
|
|
@@ -63,7 +63,7 @@ interface TabsProps extends ViewProps {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
const Tabs = ({
|
|
66
|
-
|
|
66
|
+
onTabPress,
|
|
67
67
|
renderActiveTabOnly = false,
|
|
68
68
|
selectedTabKey,
|
|
69
69
|
tabs,
|
|
@@ -77,6 +77,18 @@ const Tabs = ({
|
|
|
77
77
|
*/
|
|
78
78
|
const [loaded, setLoaded] = React.useState([selectedTabKey]);
|
|
79
79
|
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
const selectedTabIndex = tabs.findIndex(
|
|
82
|
+
item => item.key === selectedTabKey
|
|
83
|
+
);
|
|
84
|
+
if (selectedTabIndex !== -1) {
|
|
85
|
+
flatListRef.current?.scrollToIndex({
|
|
86
|
+
index: selectedTabIndex,
|
|
87
|
+
viewPosition: 0.5,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}, [selectedTabKey, tabs]);
|
|
91
|
+
|
|
80
92
|
if (!loaded.includes(selectedTabKey)) {
|
|
81
93
|
// Set the current tab to be loaded if it was not loaded before
|
|
82
94
|
setLoaded(loadedState => [...loadedState, selectedTabKey]);
|
|
@@ -101,22 +113,14 @@ const Tabs = ({
|
|
|
101
113
|
100
|
|
102
114
|
);
|
|
103
115
|
}}
|
|
104
|
-
renderItem={({ item: tab
|
|
116
|
+
renderItem={({ item: tab }) => {
|
|
105
117
|
const { key, icon, title, testID } = tab;
|
|
106
118
|
const active = selectedTabKey === key;
|
|
107
119
|
|
|
108
120
|
return (
|
|
109
121
|
<TouchableOpacity
|
|
110
122
|
key={key}
|
|
111
|
-
onPress={() =>
|
|
112
|
-
if (key !== selectedTabKey) {
|
|
113
|
-
onChange(key);
|
|
114
|
-
flatListRef.current?.scrollToIndex({
|
|
115
|
-
index,
|
|
116
|
-
viewPosition: 0.5,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}}
|
|
123
|
+
onPress={() => onTabPress(key)}
|
|
120
124
|
testID={testID}
|
|
121
125
|
>
|
|
122
126
|
<HeaderTabItem>
|
|
@@ -140,7 +144,7 @@ const Tabs = ({
|
|
|
140
144
|
</HeaderTabWrapper>
|
|
141
145
|
<ContentWrapper>
|
|
142
146
|
{tabs.map(tab => {
|
|
143
|
-
const { key, component } = tab;
|
|
147
|
+
const { key, component, testID } = tab;
|
|
144
148
|
const active = selectedTabKey === key;
|
|
145
149
|
|
|
146
150
|
if (renderActiveTabOnly && !active) {
|
|
@@ -155,7 +159,7 @@ const Tabs = ({
|
|
|
155
159
|
return (
|
|
156
160
|
<TabScreen
|
|
157
161
|
key={key}
|
|
158
|
-
testID={`tab-screen-${
|
|
162
|
+
testID={testID ? `tab-screen-${testID}` : undefined}
|
|
159
163
|
pointerEvents={active ? 'auto' : 'none'}
|
|
160
164
|
accessibilityElementsHidden={!active}
|
|
161
165
|
importantForAccessibility={
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import palette from '@hero-design/colors';
|
|
2
2
|
|
|
3
3
|
const systemPalette = {
|
|
4
4
|
primary: palette.violet,
|
|
@@ -25,4 +25,6 @@ const systemPalette = {
|
|
|
25
25
|
outline: palette.greyLight60,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
type SystemPalette = typeof systemPalette;
|
|
29
|
+
|
|
30
|
+
export { systemPalette, SystemPalette };
|
|
@@ -1,21 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { scale as defaultScale, Scale } from './scale';
|
|
2
|
+
import { systemPalette as defaultSystemPalette, SystemPalette } from './colors';
|
|
3
|
+
import { getFonts, getFontSizes, getLineHeights } from './typography';
|
|
4
|
+
import { getSpace } from './space';
|
|
5
|
+
import { getBorderWidths } from './borders';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fontSizes,
|
|
13
|
-
lineHeights,
|
|
14
|
-
borderWidths,
|
|
15
|
-
};
|
|
7
|
+
const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
8
|
+
const fonts = getFonts(scale.font);
|
|
9
|
+
const fontSizes = getFontSizes(scale.fontSize);
|
|
10
|
+
const lineHeights = getLineHeights(fontSizes);
|
|
11
|
+
const borderWidths = getBorderWidths(scale.borderWidth);
|
|
12
|
+
const space = getSpace(scale.space);
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
return {
|
|
15
|
+
colors: {
|
|
16
|
+
...systemPalette,
|
|
17
|
+
},
|
|
18
|
+
fonts,
|
|
19
|
+
fontSizes,
|
|
20
|
+
lineHeights,
|
|
21
|
+
borderWidths,
|
|
22
|
+
space,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
18
25
|
|
|
19
|
-
|
|
26
|
+
type GlobalTheme = ReturnType<typeof getGlobalTheme>;
|
|
20
27
|
|
|
21
|
-
export
|
|
28
|
+
export {
|
|
29
|
+
GlobalTheme,
|
|
30
|
+
Scale,
|
|
31
|
+
SystemPalette,
|
|
32
|
+
getGlobalTheme,
|
|
33
|
+
defaultScale,
|
|
34
|
+
defaultSystemPalette,
|
|
35
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const BASE_BORDER_WIDTH = 1;
|
|
2
|
+
|
|
3
|
+
const BASE_SPACE = 8;
|
|
4
|
+
|
|
5
|
+
const BASE_FONT = 'BeVietnamPro';
|
|
6
|
+
|
|
7
|
+
const BASE_FONT_SIZE = 10;
|
|
8
|
+
|
|
9
|
+
const scale = {
|
|
10
|
+
borderWidth: BASE_BORDER_WIDTH,
|
|
11
|
+
space: BASE_SPACE,
|
|
12
|
+
font: BASE_FONT,
|
|
13
|
+
fontSize: BASE_FONT_SIZE,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type Scale = typeof scale;
|
|
17
|
+
|
|
18
|
+
export { scale, Scale };
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { scale } from '../../utils/scale';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface Space {
|
|
4
|
+
large: number;
|
|
5
|
+
medium: number;
|
|
6
|
+
small: number;
|
|
7
|
+
xlarge: number;
|
|
8
|
+
xsmall: number;
|
|
9
|
+
xxlarge: number;
|
|
10
|
+
xxsmall: number;
|
|
11
|
+
xxxlarge: number;
|
|
12
|
+
xxxxlarge: number;
|
|
13
|
+
}
|
|
4
14
|
|
|
5
|
-
const
|
|
6
|
-
xxsmall: scale(
|
|
7
|
-
xsmall: scale(
|
|
8
|
-
small: scale(
|
|
9
|
-
medium: scale(
|
|
10
|
-
large: scale(
|
|
11
|
-
xlarge: scale(
|
|
12
|
-
xxlarge: scale(
|
|
13
|
-
xxxlarge: scale(
|
|
14
|
-
xxxxlarge: scale(
|
|
15
|
-
};
|
|
15
|
+
const getSpace = (baseSpace: number): Space => ({
|
|
16
|
+
xxsmall: scale(baseSpace * 0.25),
|
|
17
|
+
xsmall: scale(baseSpace * 0.5),
|
|
18
|
+
small: scale(baseSpace),
|
|
19
|
+
medium: scale(baseSpace * 2),
|
|
20
|
+
large: scale(baseSpace * 3),
|
|
21
|
+
xlarge: scale(baseSpace * 4),
|
|
22
|
+
xxlarge: scale(baseSpace * 5),
|
|
23
|
+
xxxlarge: scale(baseSpace * 6),
|
|
24
|
+
xxxxlarge: scale(baseSpace * 7),
|
|
25
|
+
});
|
|
16
26
|
|
|
17
|
-
export {
|
|
27
|
+
export { Space, getSpace };
|
|
@@ -1,35 +1,79 @@
|
|
|
1
1
|
import { scale } from '../../utils/scale';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface Fonts {
|
|
4
|
+
light: string;
|
|
5
|
+
regular: string;
|
|
6
|
+
semiBold: string;
|
|
7
|
+
}
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
interface FontSizes {
|
|
10
|
+
xxxxxlarge: number;
|
|
11
|
+
xxxxlarge: number;
|
|
12
|
+
xxxlarge: number;
|
|
13
|
+
xxlarge: number;
|
|
14
|
+
xlarge: number;
|
|
15
|
+
large: number;
|
|
16
|
+
medium: number;
|
|
17
|
+
small: number;
|
|
18
|
+
xsmall: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type LineHeights = FontSizes;
|
|
22
|
+
|
|
23
|
+
// Hero design web typo scale is following
|
|
24
|
+
// https://www.ibm.com/design/language/typography/type-specs-ui#scales
|
|
25
|
+
const genFontSize = (prev: number, at: number): number =>
|
|
26
|
+
prev + Math.floor(Math.abs((at - 2) / 4) + 1) * 2;
|
|
10
27
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
const getFonts = (baseFont: string): Fonts => ({
|
|
29
|
+
light: `${baseFont}-Light`,
|
|
30
|
+
regular: `${baseFont}-Regular`,
|
|
31
|
+
semiBold: `${baseFont}-SemiBold`,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const getFontSizes = (baseFontSize: number): FontSizes => {
|
|
35
|
+
const fontSizes = Array.from(new Array(9));
|
|
36
|
+
fontSizes.forEach((_, index) => {
|
|
37
|
+
if (index === 0) {
|
|
38
|
+
fontSizes[0] = baseFontSize;
|
|
39
|
+
} else {
|
|
40
|
+
fontSizes[index] = genFontSize(fontSizes[index - 1], index);
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
xxxxxlarge: scale(fontSizes[8]), // 32
|
|
46
|
+
xxxxlarge: scale(fontSizes[7]), // 28
|
|
47
|
+
xxxlarge: scale(fontSizes[6]), // 24
|
|
48
|
+
xxlarge: scale(fontSizes[5]), // 20
|
|
49
|
+
xlarge: scale(fontSizes[4]), // 18
|
|
50
|
+
large: scale(fontSizes[3]), // 16
|
|
51
|
+
medium: scale(fontSizes[2]), // 14
|
|
52
|
+
small: scale(fontSizes[1]), // 12
|
|
53
|
+
xsmall: scale(fontSizes[0]), // 10
|
|
54
|
+
};
|
|
21
55
|
};
|
|
22
56
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
57
|
+
const getLineHeights = (fontSizes: FontSizes): LineHeights => {
|
|
58
|
+
const additionalSpace = 8;
|
|
59
|
+
return {
|
|
60
|
+
xxxxxlarge: fontSizes.xxxxxlarge + additionalSpace,
|
|
61
|
+
xxxxlarge: fontSizes.xxxxlarge + additionalSpace,
|
|
62
|
+
xxxlarge: fontSizes.xxxlarge + additionalSpace,
|
|
63
|
+
xxlarge: fontSizes.xxlarge + additionalSpace,
|
|
64
|
+
xlarge: fontSizes.xlarge + additionalSpace,
|
|
65
|
+
large: fontSizes.large + additionalSpace,
|
|
66
|
+
medium: fontSizes.medium + additionalSpace,
|
|
67
|
+
small: fontSizes.small + additionalSpace,
|
|
68
|
+
xsmall: fontSizes.xsmall + additionalSpace,
|
|
69
|
+
};
|
|
33
70
|
};
|
|
34
71
|
|
|
35
|
-
export {
|
|
72
|
+
export {
|
|
73
|
+
Fonts,
|
|
74
|
+
FontSizes,
|
|
75
|
+
LineHeights,
|
|
76
|
+
getFonts,
|
|
77
|
+
getFontSizes,
|
|
78
|
+
getLineHeights,
|
|
79
|
+
};
|
package/src/theme/index.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
GlobalTheme,
|
|
3
|
+
Scale,
|
|
4
|
+
SystemPalette,
|
|
5
|
+
getGlobalTheme,
|
|
6
|
+
defaultScale,
|
|
7
|
+
defaultSystemPalette,
|
|
8
|
+
} from './global';
|
|
2
9
|
|
|
3
10
|
import getBadgeTheme from './components/badge';
|
|
4
11
|
import getBottomNavigationTheme from './components/bottomNavigation';
|
|
@@ -22,19 +29,25 @@ type Theme = GlobalTheme & {
|
|
|
22
29
|
};
|
|
23
30
|
};
|
|
24
31
|
|
|
25
|
-
const getTheme = (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const getTheme = (
|
|
33
|
+
scale: Scale = defaultScale,
|
|
34
|
+
systemPallete: SystemPalette = defaultSystemPalette
|
|
35
|
+
): Theme => {
|
|
36
|
+
const globalTheme = getGlobalTheme(scale, systemPallete);
|
|
37
|
+
return {
|
|
38
|
+
...globalTheme,
|
|
39
|
+
__hd__: {
|
|
40
|
+
badge: getBadgeTheme(globalTheme),
|
|
41
|
+
bottomNavigation: getBottomNavigationTheme(globalTheme),
|
|
42
|
+
card: getCardTheme(globalTheme),
|
|
43
|
+
divider: getDividerTheme(globalTheme),
|
|
44
|
+
icon: getIconTheme(globalTheme),
|
|
45
|
+
tabs: getTabsTheme(globalTheme),
|
|
46
|
+
typography: getTypographyTheme(globalTheme),
|
|
47
|
+
fab: getFABTheme(globalTheme),
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
};
|
|
38
51
|
|
|
39
52
|
const theme = getTheme();
|
|
40
53
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,9 +10,9 @@ export declare type BottomNavigationTabType = {
|
|
|
10
10
|
};
|
|
11
11
|
interface BottomNavigationProps extends ViewProps {
|
|
12
12
|
/**
|
|
13
|
-
* Callback which is called on tab
|
|
13
|
+
* Callback which is called on tab press, receiving key of upcoming active Tab.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
onTabPress: (key: string) => void;
|
|
16
16
|
/**
|
|
17
17
|
* Whether inactive tabs should be removed and unmounted in React.
|
|
18
18
|
* Defaults to `false`.
|
|
@@ -41,5 +41,5 @@ interface BottomNavigationProps extends ViewProps {
|
|
|
41
41
|
*/
|
|
42
42
|
testID?: string;
|
|
43
43
|
}
|
|
44
|
-
declare const BottomNavigation: ({
|
|
44
|
+
declare const BottomNavigation: ({ onTabPress, renderActiveTabOnly, selectedTabKey, tabs, ...nativeProps }: BottomNavigationProps) => JSX.Element;
|
|
45
45
|
export default BottomNavigation;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import { ActionItemProps } from './ActionItem';
|
|
3
3
|
export interface ActionGroupProps {
|
|
4
|
+
/**
|
|
5
|
+
* Title of the action group header.
|
|
6
|
+
*/
|
|
4
7
|
headerTitle?: string;
|
|
5
8
|
/**
|
|
6
9
|
* This function is called on pressing the FAB button.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,9 +10,9 @@ export declare type TabType = {
|
|
|
10
10
|
};
|
|
11
11
|
interface TabsProps extends ViewProps {
|
|
12
12
|
/**
|
|
13
|
-
* Callback which is called on tab
|
|
13
|
+
* Callback which is called on tab press, receiving key of upcoming active Tab.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
onTabPress: (key: string) => void;
|
|
16
16
|
/**
|
|
17
17
|
* Whether inactive tabs should be removed and unmounted in React.
|
|
18
18
|
* Defaults to `false`.
|
|
@@ -41,5 +41,5 @@ interface TabsProps extends ViewProps {
|
|
|
41
41
|
*/
|
|
42
42
|
testID?: string;
|
|
43
43
|
}
|
|
44
|
-
declare const Tabs: ({
|
|
44
|
+
declare const Tabs: ({ onTabPress, renderActiveTabOnly, selectedTabKey, tabs, ...nativeProps }: TabsProps) => JSX.Element;
|
|
45
45
|
export default Tabs;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/types/src/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { palette } from '@hero-design/colors';
|
|
2
1
|
declare const systemPalette: {
|
|
3
2
|
primary: string;
|
|
4
3
|
primaryLight: string;
|
|
@@ -23,4 +22,5 @@ declare const systemPalette: {
|
|
|
23
22
|
invertedText: string;
|
|
24
23
|
outline: string;
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
declare type SystemPalette = typeof systemPalette;
|
|
26
|
+
export { systemPalette, SystemPalette };
|