@hero-design/rn 8.12.1 → 8.12.2
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 +79 -25
- package/lib/index.js +78 -24
- 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/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +12 -9
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +17 -0
- package/src/theme/components/button.ts +16 -2
- package/src/theme/components/fab.ts +2 -0
- package/src/theme/global/borders.ts +2 -0
- 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/theme/components/button.d.ts +14 -0
- package/types/theme/components/fab.d.ts +2 -0
- package/types/theme/global/borders.d.ts +1 -0
|
@@ -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",
|
|
@@ -1082,6 +1098,7 @@ Object {
|
|
|
1082
1098
|
"xxxxxlarge": 40,
|
|
1083
1099
|
},
|
|
1084
1100
|
"radii": Object {
|
|
1101
|
+
"5xlarge": 32,
|
|
1085
1102
|
"base": 4,
|
|
1086
1103
|
"large": 12,
|
|
1087
1104
|
"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,
|
|
@@ -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 };
|
|
@@ -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;
|
|
@@ -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;
|