@hero-design/rn 8.12.1 → 8.12.3
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 +9 -9
- package/es/index.js +102 -46
- package/lib/index.js +101 -45
- package/package.json +5 -5
- package/src/components/Button/Button.tsx +42 -2
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +1 -1
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +1 -1
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Button/StyledButton.tsx +21 -14
- package/src/components/Button/__tests__/Button.spec.tsx +46 -1
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +1564 -0
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +126 -110
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +24 -22
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +12 -9
- package/src/components/FAB/ActionGroup/ActionItem.tsx +17 -6
- package/src/components/FAB/ActionGroup/StyledActionItem.tsx +15 -17
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +170 -160
- package/src/components/FAB/FAB.tsx +3 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +36 -27
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Tabs/__tests__/index.spec.tsx +5 -5
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +12 -9
- package/src/components/Typography/Text/StyledText.tsx +1 -0
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +23 -0
- package/src/components/Typography/Text/index.tsx +1 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +19 -0
- package/src/theme/components/button.ts +16 -2
- package/src/theme/components/fab.ts +2 -0
- package/src/theme/components/typography.ts +2 -0
- package/src/theme/global/borders.ts +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/eBens.spec.ts.snap +4 -4
- package/types/components/Button/Button.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +4 -3
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +3 -3
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/theme/components/button.d.ts +14 -0
- package/types/theme/components/fab.d.ts +2 -0
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/global/borders.d.ts +1 -0
|
@@ -716,7 +716,6 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
718
|
accessible={true}
|
|
719
|
-
collapsable={false}
|
|
720
719
|
focusable={true}
|
|
721
720
|
onClick={[Function]}
|
|
722
721
|
onResponderGrant={[Function]}
|
|
@@ -726,14 +725,18 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
726
725
|
onResponderTerminationRequest={[Function]}
|
|
727
726
|
onStartShouldSetResponder={[Function]}
|
|
728
727
|
style={
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
728
|
+
Array [
|
|
729
|
+
Object {
|
|
730
|
+
"alignItems": "center",
|
|
731
|
+
"backgroundColor": "transparent",
|
|
732
|
+
"borderRadius": 4,
|
|
733
|
+
"borderWidth": 0,
|
|
734
|
+
"flexDirection": "row",
|
|
735
|
+
"justifyContent": "center",
|
|
736
|
+
"padding": 12,
|
|
737
|
+
},
|
|
738
|
+
undefined,
|
|
739
|
+
]
|
|
737
740
|
}
|
|
738
741
|
>
|
|
739
742
|
<Text
|
|
@@ -391,6 +391,29 @@ exports[`StyledText has xlarge fontSize style 1`] = `
|
|
|
391
391
|
</Text>
|
|
392
392
|
`;
|
|
393
393
|
|
|
394
|
+
exports[`StyledText has xsmall fontSize style 1`] = `
|
|
395
|
+
<Text
|
|
396
|
+
style={
|
|
397
|
+
Array [
|
|
398
|
+
Object {
|
|
399
|
+
"color": "#001f23",
|
|
400
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
401
|
+
"fontSize": 10,
|
|
402
|
+
"letterSpacing": 0.3,
|
|
403
|
+
"lineHeight": 18,
|
|
404
|
+
},
|
|
405
|
+
undefined,
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
themeFontSize="xsmall"
|
|
409
|
+
themeFontWeight="regular"
|
|
410
|
+
themeIntent="body"
|
|
411
|
+
themeTypeface="neutral"
|
|
412
|
+
>
|
|
413
|
+
This is a test
|
|
414
|
+
</Text>
|
|
415
|
+
`;
|
|
416
|
+
|
|
394
417
|
exports[`StyledText has xxxlarge fontSize style 1`] = `
|
|
395
418
|
<Text
|
|
396
419
|
style={
|
|
@@ -183,8 +183,20 @@ Object {
|
|
|
183
183
|
"disabledBorder": "#bfc1c5",
|
|
184
184
|
"disabledText": "#bfc1c5",
|
|
185
185
|
"invertedText": "#ffffff",
|
|
186
|
+
"pressedBackground": Object {
|
|
187
|
+
"filledDanger": "#fcebe7",
|
|
188
|
+
"filledPrimary": "#664780",
|
|
189
|
+
"filledSecondary": "#664780",
|
|
190
|
+
"outlineDanger": "#fcebe7",
|
|
191
|
+
"outlinedPrimary": "#ece8ef",
|
|
192
|
+
"outlinedSecondary": "#ece8ef",
|
|
193
|
+
"textDanger": "#fcebe7",
|
|
194
|
+
"textPrimary": "#ece8ef",
|
|
195
|
+
"textSecondary": "#ece8ef",
|
|
196
|
+
},
|
|
186
197
|
"primary": "#401960",
|
|
187
198
|
"secondary": "#795e90",
|
|
199
|
+
"textLoadingBackground": "#ece8ef",
|
|
188
200
|
"utilityBackground": "#f6f6f7",
|
|
189
201
|
},
|
|
190
202
|
"fontSize": Object {
|
|
@@ -201,6 +213,7 @@ Object {
|
|
|
201
213
|
},
|
|
202
214
|
"radii": Object {
|
|
203
215
|
"default": 32,
|
|
216
|
+
"text": 4,
|
|
204
217
|
"utilityRadii": 8,
|
|
205
218
|
},
|
|
206
219
|
"sizes": Object {
|
|
@@ -209,6 +222,7 @@ Object {
|
|
|
209
222
|
"space": Object {
|
|
210
223
|
"buttonPadding": 16,
|
|
211
224
|
"iconPadding": 12,
|
|
225
|
+
"textButtonPadding": 12,
|
|
212
226
|
"utilityPadding": 8,
|
|
213
227
|
},
|
|
214
228
|
},
|
|
@@ -396,9 +410,11 @@ Object {
|
|
|
396
410
|
"fab": Object {
|
|
397
411
|
"colors": Object {
|
|
398
412
|
"actionItemBackground": "#401960",
|
|
413
|
+
"actionItemPressedBackground": "#664780",
|
|
399
414
|
"actionItemText": "#ffffff",
|
|
400
415
|
"backdropBackground": "#000000",
|
|
401
416
|
"buttonBackground": "#401960",
|
|
417
|
+
"buttonPressedBackground": "#664780",
|
|
402
418
|
"headerText": "#001f23",
|
|
403
419
|
"icon": "#ffffff",
|
|
404
420
|
"titleText": "#ffffff",
|
|
@@ -966,6 +982,7 @@ Object {
|
|
|
966
982
|
"medium": 14,
|
|
967
983
|
"small": 12,
|
|
968
984
|
"xlarge": 18,
|
|
985
|
+
"xsmall": 10,
|
|
969
986
|
"xxxlarge": 24,
|
|
970
987
|
"xxxxlarge": 28,
|
|
971
988
|
"xxxxxlarge": 32,
|
|
@@ -989,6 +1006,7 @@ Object {
|
|
|
989
1006
|
"medium": 22,
|
|
990
1007
|
"small": 20,
|
|
991
1008
|
"xlarge": 26,
|
|
1009
|
+
"xsmall": 18,
|
|
992
1010
|
"xxxlarge": 32,
|
|
993
1011
|
"xxxxlarge": 36,
|
|
994
1012
|
"xxxxxlarge": 40,
|
|
@@ -1082,6 +1100,7 @@ Object {
|
|
|
1082
1100
|
"xxxxxlarge": 40,
|
|
1083
1101
|
},
|
|
1084
1102
|
"radii": Object {
|
|
1103
|
+
"5xlarge": 32,
|
|
1085
1104
|
"base": 4,
|
|
1086
1105
|
"large": 12,
|
|
1087
1106
|
"medium": 8,
|
|
@@ -22,6 +22,7 @@ const getButtonTheme = (theme: GlobalTheme) => {
|
|
|
22
22
|
|
|
23
23
|
const space = {
|
|
24
24
|
buttonPadding: theme.space.medium,
|
|
25
|
+
textButtonPadding: theme.space.smallMedium,
|
|
25
26
|
iconPadding: theme.space.smallMedium,
|
|
26
27
|
utilityPadding: theme.space.small,
|
|
27
28
|
};
|
|
@@ -31,8 +32,9 @@ const getButtonTheme = (theme: GlobalTheme) => {
|
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
const radii = {
|
|
34
|
-
default: theme.
|
|
35
|
-
utilityRadii: theme.
|
|
35
|
+
default: theme.radii['5xlarge'],
|
|
36
|
+
utilityRadii: theme.radii.medium,
|
|
37
|
+
text: theme.radii.base,
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
const colors = {
|
|
@@ -45,6 +47,18 @@ const getButtonTheme = (theme: GlobalTheme) => {
|
|
|
45
47
|
disabledBackground: theme.colors.disabledOnDefaultGlobalSurface,
|
|
46
48
|
invertedText: theme.colors.onDarkGlobalSurface,
|
|
47
49
|
utilityBackground: theme.colors.neutralGlobalSurface,
|
|
50
|
+
textLoadingBackground: theme.colors.highlightedSurface,
|
|
51
|
+
pressedBackground: {
|
|
52
|
+
filledPrimary: theme.colors.pressedSurface,
|
|
53
|
+
filledSecondary: theme.colors.pressedSurface,
|
|
54
|
+
filledDanger: theme.colors.errorSurface,
|
|
55
|
+
outlinedPrimary: theme.colors.highlightedSurface,
|
|
56
|
+
outlinedSecondary: theme.colors.highlightedSurface,
|
|
57
|
+
outlineDanger: theme.colors.errorSurface,
|
|
58
|
+
textPrimary: theme.colors.highlightedSurface,
|
|
59
|
+
textSecondary: theme.colors.highlightedSurface,
|
|
60
|
+
textDanger: theme.colors.errorSurface,
|
|
61
|
+
},
|
|
48
62
|
};
|
|
49
63
|
|
|
50
64
|
return {
|
|
@@ -3,9 +3,11 @@ import type { GlobalTheme } from '../global';
|
|
|
3
3
|
const getFABTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const colors = {
|
|
5
5
|
buttonBackground: theme.colors.primary,
|
|
6
|
+
buttonPressedBackground: theme.colors.pressedSurface,
|
|
6
7
|
icon: theme.colors.onPrimary,
|
|
7
8
|
headerText: theme.colors.onDefaultGlobalSurface,
|
|
8
9
|
actionItemBackground: theme.colors.primary,
|
|
10
|
+
actionItemPressedBackground: theme.colors.pressedSurface,
|
|
9
11
|
backdropBackground: theme.colors.overlayGlobalSurface,
|
|
10
12
|
titleText: theme.colors.onPrimary,
|
|
11
13
|
actionItemText: theme.colors.onPrimary,
|
|
@@ -15,6 +15,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const fontSizes = {
|
|
18
|
+
xsmall: theme.fontSizes.xsmall,
|
|
18
19
|
small: theme.fontSizes.small,
|
|
19
20
|
medium: theme.fontSizes.medium,
|
|
20
21
|
large: theme.fontSizes.large,
|
|
@@ -27,6 +28,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
const lineHeights = {
|
|
31
|
+
xsmall: theme.lineHeights.xsmall,
|
|
30
32
|
small: theme.lineHeights.small,
|
|
31
33
|
medium: theme.lineHeights.medium,
|
|
32
34
|
large: theme.lineHeights.large,
|
|
@@ -11,6 +11,7 @@ interface Radii {
|
|
|
11
11
|
xlarge: number;
|
|
12
12
|
xxlarge: number;
|
|
13
13
|
xxxlarge: number;
|
|
14
|
+
'5xlarge': number;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const getBorderWidths = (baseBorderWidth: number): BorderWidths => ({
|
|
@@ -26,6 +27,7 @@ const getRadii = (baseRadius: number): Radii => ({
|
|
|
26
27
|
xlarge: baseRadius * 4, // 16
|
|
27
28
|
xxlarge: baseRadius * 5, // 20
|
|
28
29
|
xxxlarge: baseRadius * 6, // 24
|
|
30
|
+
'5xlarge': baseRadius * 8, // 32
|
|
29
31
|
});
|
|
30
32
|
|
|
31
33
|
export { getBorderWidths, getRadii };
|
|
@@ -13,7 +13,7 @@ Object {
|
|
|
13
13
|
"disabledOutline": "#bfc1c5",
|
|
14
14
|
"error": "#f46363",
|
|
15
15
|
"errorSurface": "#fcebe7",
|
|
16
|
-
"highlightedSurface": "#
|
|
16
|
+
"highlightedSurface": "#f3e6f6",
|
|
17
17
|
"inactiveOnDefaultGlobalSurface": "#808f91",
|
|
18
18
|
"inactiveOutline": "#808f91",
|
|
19
19
|
"info": "#b5c3fd",
|
|
@@ -35,10 +35,10 @@ Object {
|
|
|
35
35
|
"onSuccessSurface": "#017d6d",
|
|
36
36
|
"onWarningSurface": "#ffa234",
|
|
37
37
|
"overlayGlobalSurface": "#000000",
|
|
38
|
-
"pressedSurface": "#
|
|
39
|
-
"primary": "#
|
|
38
|
+
"pressedSurface": "#9d37b5",
|
|
39
|
+
"primary": "#8505a2",
|
|
40
40
|
"primaryOutline": "#001f23",
|
|
41
|
-
"secondary": "#
|
|
41
|
+
"secondary": "#aa50be",
|
|
42
42
|
"secondaryOutline": "#e8e9ea",
|
|
43
43
|
"success": "#5ace7d",
|
|
44
44
|
"successSurface": "#f0fef4",
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableHighlight, View } from 'react-native';
|
|
3
3
|
import type { Theme } from '@emotion/react';
|
|
4
4
|
declare type Intent = 'primary' | 'secondary' | 'danger';
|
|
5
5
|
declare type ThemeVariant = 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger' | 'text-primary' | 'text-secondary' | 'text-danger';
|
|
6
|
-
declare const StyledButtonContainer: import("@emotion/native").StyledComponent<import("react-native").
|
|
6
|
+
declare const StyledButtonContainer: import("@emotion/native").StyledComponent<import("react-native").TouchableHighlightProps & {
|
|
7
7
|
theme?: Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any> | undefined;
|
|
9
9
|
} & {
|
|
10
10
|
disabled?: boolean | undefined;
|
|
11
11
|
themeVariant: ThemeVariant;
|
|
12
|
+
loading?: boolean | undefined;
|
|
12
13
|
}, {}, {
|
|
13
|
-
ref?: import("react").Ref<
|
|
14
|
+
ref?: import("react").Ref<TouchableHighlight> | undefined;
|
|
14
15
|
}>;
|
|
15
16
|
declare const StyledButtonText: import("@emotion/native").StyledComponent<import("../..").TextProps & {
|
|
16
17
|
theme?: Theme | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableHighlight } from 'react-native';
|
|
3
3
|
import type { TouchableOpacityProps } from 'react-native';
|
|
4
4
|
import type { IconProps } from '../../Icon';
|
|
5
|
-
declare const StyledActionItem: import("@emotion/native").StyledComponent<
|
|
5
|
+
declare const StyledActionItem: import("@emotion/native").StyledComponent<import("react-native").TouchableHighlightProps & {
|
|
6
6
|
theme?: import("@emotion/react").Theme | undefined;
|
|
7
7
|
as?: import("react").ElementType<any> | undefined;
|
|
8
8
|
}, {}, {
|
|
9
|
-
ref?: import("react").Ref<
|
|
9
|
+
ref?: import("react").Ref<TouchableHighlight> | undefined;
|
|
10
10
|
}>;
|
|
11
11
|
declare const StyledActionItemText: import("@emotion/native").StyledComponent<import("../../..").TextProps & {
|
|
12
12
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -4,7 +4,7 @@ declare const StyledText: import("@emotion/native").StyledComponent<import("reac
|
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: import("react").ElementType<any> | undefined;
|
|
6
6
|
} & {
|
|
7
|
-
themeFontSize: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxlarge' | 'xxxxxlarge' | '6xlarge' | '7xlarge';
|
|
7
|
+
themeFontSize: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxlarge' | 'xxxxxlarge' | '6xlarge' | '7xlarge';
|
|
8
8
|
themeFontWeight: 'light' | 'regular' | 'semi-bold';
|
|
9
9
|
themeIntent: 'body' | 'subdued' | 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'inverted' | 'archived';
|
|
10
10
|
themeTypeface: 'neutral' | 'playful';
|
|
@@ -8,7 +8,7 @@ export interface TextProps extends NativeTextProps {
|
|
|
8
8
|
/**
|
|
9
9
|
* Size of the text.
|
|
10
10
|
*/
|
|
11
|
-
fontSize?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxlarge' | 'xxxxxlarge' | '6xlarge' | '7xlarge';
|
|
11
|
+
fontSize?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxlarge' | 'xxxxxlarge' | '6xlarge' | '7xlarge';
|
|
12
12
|
/**
|
|
13
13
|
* Font weight of the text.
|
|
14
14
|
*/
|
|
@@ -18,6 +18,7 @@ declare const getButtonTheme: (theme: GlobalTheme) => {
|
|
|
18
18
|
radii: {
|
|
19
19
|
default: number;
|
|
20
20
|
utilityRadii: number;
|
|
21
|
+
text: number;
|
|
21
22
|
};
|
|
22
23
|
colors: {
|
|
23
24
|
primary: string;
|
|
@@ -29,12 +30,25 @@ declare const getButtonTheme: (theme: GlobalTheme) => {
|
|
|
29
30
|
disabledBackground: string;
|
|
30
31
|
invertedText: string;
|
|
31
32
|
utilityBackground: string;
|
|
33
|
+
textLoadingBackground: string;
|
|
34
|
+
pressedBackground: {
|
|
35
|
+
filledPrimary: string;
|
|
36
|
+
filledSecondary: string;
|
|
37
|
+
filledDanger: string;
|
|
38
|
+
outlinedPrimary: string;
|
|
39
|
+
outlinedSecondary: string;
|
|
40
|
+
outlineDanger: string;
|
|
41
|
+
textPrimary: string;
|
|
42
|
+
textSecondary: string;
|
|
43
|
+
textDanger: string;
|
|
44
|
+
};
|
|
32
45
|
};
|
|
33
46
|
lineHeight: {
|
|
34
47
|
default: number;
|
|
35
48
|
};
|
|
36
49
|
space: {
|
|
37
50
|
buttonPadding: number;
|
|
51
|
+
textButtonPadding: number;
|
|
38
52
|
iconPadding: number;
|
|
39
53
|
utilityPadding: number;
|
|
40
54
|
};
|
|
@@ -15,9 +15,11 @@ declare const getFABTheme: (theme: GlobalTheme) => {
|
|
|
15
15
|
};
|
|
16
16
|
colors: {
|
|
17
17
|
buttonBackground: string;
|
|
18
|
+
buttonPressedBackground: string;
|
|
18
19
|
icon: string;
|
|
19
20
|
headerText: string;
|
|
20
21
|
actionItemBackground: string;
|
|
22
|
+
actionItemPressedBackground: string;
|
|
21
23
|
backdropBackground: string;
|
|
22
24
|
titleText: string;
|
|
23
25
|
actionItemText: string;
|
|
@@ -14,6 +14,7 @@ declare const getTypographyTheme: (theme: GlobalTheme) => {
|
|
|
14
14
|
};
|
|
15
15
|
fonts: import("../global/typography").Fonts;
|
|
16
16
|
fontSizes: {
|
|
17
|
+
xsmall: number;
|
|
17
18
|
small: number;
|
|
18
19
|
medium: number;
|
|
19
20
|
large: number;
|
|
@@ -25,6 +26,7 @@ declare const getTypographyTheme: (theme: GlobalTheme) => {
|
|
|
25
26
|
'7xlarge': number;
|
|
26
27
|
};
|
|
27
28
|
lineHeights: {
|
|
29
|
+
xsmall: number;
|
|
28
30
|
small: number;
|
|
29
31
|
medium: number;
|
|
30
32
|
large: number;
|