@hero-design/rn 8.124.2 → 8.126.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/CHANGELOG.md +25 -0
- package/assets/fonts/BeVietnamPro-Medium.ttf +0 -0
- package/assets/fonts/BeVietnamPro-MediumItalic.ttf +0 -0
- package/es/index.js +207 -140
- package/lib/index.js +207 -140
- package/package.json +2 -2
- package/src/components/Badge/Status.tsx +8 -1
- package/src/components/Badge/StyledBadge.tsx +2 -1
- package/src/components/Badge/types.ts +8 -1
- package/src/components/RichTextEditor/RichTextEditor.tsx +88 -74
- package/src/components/Search/StyledSearch.tsx +1 -1
- package/src/components/TextInput/StyledTextInput.tsx +74 -24
- package/src/components/TextInput/index.tsx +126 -103
- package/src/components/Typography/Body/StyledBody.tsx +16 -8
- package/src/components/Typography/Body/index.tsx +12 -3
- package/src/components/Typography/Caption/StyledCaption.tsx +10 -2
- package/src/components/Typography/Caption/index.tsx +1 -1
- package/src/components/Typography/Label/StyledLabel.tsx +4 -5
- package/src/components/Typography/Label/index.tsx +7 -0
- package/src/components/Typography/types.ts +1 -0
- package/src/theme/components/badge.ts +5 -2
- package/src/theme/components/textInput.ts +32 -19
- package/src/theme/components/typography.ts +2 -0
- package/src/theme/global/typography.ts +6 -0
- package/types/components/Badge/Status.d.ts +1 -1
- package/types/components/Badge/StyledBadge.d.ts +1 -1
- package/types/components/Badge/types.d.ts +1 -1
- package/types/components/TextInput/StyledTextInput.d.ts +29 -15
- package/types/components/Typography/Body/StyledBody.d.ts +1 -1
- package/types/components/Typography/Body/index.d.ts +6 -3
- package/types/components/Typography/Caption/StyledCaption.d.ts +1 -1
- package/types/components/Typography/Caption/index.d.ts +1 -1
- package/types/components/Typography/Label/StyledLabel.d.ts +1 -0
- package/types/components/Typography/Label/index.d.ts +6 -1
- package/types/components/Typography/types.d.ts +1 -0
- package/types/theme/components/badge.d.ts +3 -0
- package/types/theme/components/textInput.d.ts +17 -5
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/global/typography.d.ts +2 -0
|
@@ -3,9 +3,11 @@ import { scale } from '../../utils/scale';
|
|
|
3
3
|
interface FontWeights {
|
|
4
4
|
light: string;
|
|
5
5
|
regular: string;
|
|
6
|
+
medium: string;
|
|
6
7
|
semiBold: string;
|
|
7
8
|
lightItalic: string;
|
|
8
9
|
regularItalic: string;
|
|
10
|
+
mediumItalic: string;
|
|
9
11
|
semiBoldItalic: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
@@ -47,6 +49,8 @@ const getFonts = ({
|
|
|
47
49
|
lightItalic: `${neutral}-LightItalic`,
|
|
48
50
|
regular: `${neutral}-Regular`,
|
|
49
51
|
regularItalic: `${neutral}-RegularItalic`,
|
|
52
|
+
medium: `${neutral}-Medium`,
|
|
53
|
+
mediumItalic: `${neutral}-MediumItalic`,
|
|
50
54
|
semiBold: `${neutral}-SemiBold`,
|
|
51
55
|
semiBoldItalic: `${neutral}-SemiBoldItalic`,
|
|
52
56
|
},
|
|
@@ -55,6 +59,8 @@ const getFonts = ({
|
|
|
55
59
|
lightItalic: `${playful}-LightItalic`,
|
|
56
60
|
regular: `${playful}-Regular`,
|
|
57
61
|
regularItalic: `${playful}-RegularItalic`,
|
|
62
|
+
medium: `${playful}-Regular`,
|
|
63
|
+
mediumItalic: `${playful}-RegularItalic`,
|
|
58
64
|
semiBold: `${playful}-Medium`,
|
|
59
65
|
semiBoldItalic: `${playful}-MediumItalic`,
|
|
60
66
|
},
|
|
@@ -9,7 +9,7 @@ export interface StatusProps extends ViewProps {
|
|
|
9
9
|
/**
|
|
10
10
|
* Visual intent color to apply to Status Badge.
|
|
11
11
|
*/
|
|
12
|
-
intent?: 'success' | 'warning' | 'danger' | 'info' | 'archived' | 'primary';
|
|
12
|
+
intent?: 'success' | 'warning' | 'danger' | 'info' | 'archived' | 'primary' | 'neutral';
|
|
13
13
|
/**
|
|
14
14
|
* Additional style.
|
|
15
15
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Animated, View } from 'react-native';
|
|
2
|
-
type ThemeIntent = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived';
|
|
2
|
+
type ThemeIntent = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived' | 'neutral';
|
|
3
3
|
type ThemePadding = 'narrowContent' | 'wideContent';
|
|
4
4
|
type ThemeSize = 'medium' | 'small';
|
|
5
5
|
type ThemeVariant = 'filled' | 'outlined';
|
|
@@ -12,7 +12,7 @@ interface BaseBadgeProps extends React.ComponentProps<typeof Animated.View> {
|
|
|
12
12
|
/**
|
|
13
13
|
* Visual intent color to apply to Badge.
|
|
14
14
|
*/
|
|
15
|
-
intent?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived';
|
|
15
|
+
intent?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived' | 'neutral';
|
|
16
16
|
/**
|
|
17
17
|
* Additional style.
|
|
18
18
|
*/
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { TextInput, View, Animated } from 'react-native';
|
|
2
|
+
import type { Theme } from '@emotion/react';
|
|
2
3
|
export type State = 'default' | 'filled' | 'disabled' | 'readonly' | 'error';
|
|
3
4
|
type Variant = 'text' | 'textarea';
|
|
4
5
|
declare const StyledContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
5
|
-
theme?:
|
|
6
|
+
theme?: Theme;
|
|
6
7
|
as?: React.ElementType;
|
|
7
8
|
}, {}, {
|
|
8
9
|
ref?: import("react").Ref<View> | undefined;
|
|
9
10
|
}>;
|
|
10
11
|
declare const StyledLabelContainerInsideTextInput: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<View>> & {
|
|
11
|
-
theme?:
|
|
12
|
+
theme?: Theme;
|
|
12
13
|
as?: React.ElementType;
|
|
13
14
|
} & {
|
|
14
15
|
themeVariant: Variant;
|
|
15
|
-
themeHasPrefix: boolean;
|
|
16
16
|
}, {}, {}>;
|
|
17
17
|
declare const StyledLabelInsideTextInput: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
18
|
-
theme?:
|
|
18
|
+
theme?: Theme;
|
|
19
19
|
as?: React.ElementType;
|
|
20
20
|
} & {
|
|
21
21
|
themeState: State;
|
|
@@ -23,30 +23,30 @@ declare const StyledLabelInsideTextInput: import("@emotion/native").StyledCompon
|
|
|
23
23
|
ref?: import("react").Ref<View> | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
declare const StyledAsteriskLabelInsideTextInput: import("@emotion/native").StyledComponent<import("../..").BodyProps & {
|
|
26
|
-
theme?:
|
|
26
|
+
theme?: Theme;
|
|
27
27
|
as?: React.ElementType;
|
|
28
28
|
} & {
|
|
29
29
|
themeState: State;
|
|
30
30
|
}, {}, {}>;
|
|
31
31
|
declare const StyledErrorContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
32
|
-
theme?:
|
|
32
|
+
theme?: Theme;
|
|
33
33
|
as?: React.ElementType;
|
|
34
34
|
}, {}, {
|
|
35
35
|
ref?: import("react").Ref<View> | undefined;
|
|
36
36
|
}>;
|
|
37
37
|
declare const StyledError: import("@emotion/native").StyledComponent<import("../..").CaptionProps & {
|
|
38
|
-
theme?:
|
|
38
|
+
theme?: Theme;
|
|
39
39
|
as?: React.ElementType;
|
|
40
40
|
}, {}, {}>;
|
|
41
41
|
declare const StyledMaxLengthMessage: import("@emotion/native").StyledComponent<import("../..").CaptionProps & {
|
|
42
|
-
theme?:
|
|
42
|
+
theme?: Theme;
|
|
43
43
|
as?: React.ElementType;
|
|
44
44
|
} & {
|
|
45
45
|
themeState: State;
|
|
46
46
|
}, {}, {}>;
|
|
47
47
|
declare const StyledHelperText: ({ children, fontWeight, intent, allowFontScaling, fontStyle, style, testID, ...nativeProps }: import("../..").CaptionProps) => import("react").JSX.Element;
|
|
48
48
|
declare const StyledTextInput: import("@emotion/native").StyledComponent<import("react-native").TextInputProps & {
|
|
49
|
-
theme?:
|
|
49
|
+
theme?: Theme;
|
|
50
50
|
as?: React.ElementType;
|
|
51
51
|
} & {
|
|
52
52
|
themeVariant: Variant;
|
|
@@ -54,36 +54,50 @@ declare const StyledTextInput: import("@emotion/native").StyledComponent<import(
|
|
|
54
54
|
ref?: import("react").Ref<TextInput> | undefined;
|
|
55
55
|
}>;
|
|
56
56
|
declare const StyledBorderBackDrop: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
57
|
-
theme?:
|
|
57
|
+
theme?: Theme;
|
|
58
58
|
as?: React.ElementType;
|
|
59
59
|
} & {
|
|
60
60
|
themeState: State;
|
|
61
61
|
themeFocused: boolean;
|
|
62
|
+
themeFilled: boolean;
|
|
62
63
|
}, {}, {
|
|
63
64
|
ref?: import("react").Ref<View> | undefined;
|
|
64
65
|
}>;
|
|
65
66
|
declare const StyledTextInputContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
66
|
-
theme?:
|
|
67
|
+
theme?: Theme;
|
|
67
68
|
as?: React.ElementType;
|
|
69
|
+
} & {
|
|
70
|
+
themeVariant: Variant;
|
|
71
|
+
themeState: State;
|
|
72
|
+
}, {}, {
|
|
73
|
+
ref?: import("react").Ref<View> | undefined;
|
|
74
|
+
}>;
|
|
75
|
+
declare const StyledInputContentContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
76
|
+
theme?: Theme;
|
|
77
|
+
as?: React.ElementType;
|
|
78
|
+
} & {
|
|
79
|
+
themeHasLabel: boolean;
|
|
68
80
|
}, {}, {
|
|
69
81
|
ref?: import("react").Ref<View> | undefined;
|
|
70
82
|
}>;
|
|
71
83
|
declare const StyledTextInputAndLabelContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
72
|
-
theme?:
|
|
84
|
+
theme?: Theme;
|
|
73
85
|
as?: React.ElementType;
|
|
86
|
+
} & {
|
|
87
|
+
themeHasLabel: boolean;
|
|
74
88
|
}, {}, {
|
|
75
89
|
ref?: import("react").Ref<View> | undefined;
|
|
76
90
|
}>;
|
|
77
91
|
declare const StyledErrorAndHelpTextContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
78
|
-
theme?:
|
|
92
|
+
theme?: Theme;
|
|
79
93
|
as?: React.ElementType;
|
|
80
94
|
}, {}, {
|
|
81
95
|
ref?: import("react").Ref<View> | undefined;
|
|
82
96
|
}>;
|
|
83
97
|
declare const StyledErrorAndMaxLengthContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
84
|
-
theme?:
|
|
98
|
+
theme?: Theme;
|
|
85
99
|
as?: React.ElementType;
|
|
86
100
|
}, {}, {
|
|
87
101
|
ref?: import("react").Ref<View> | undefined;
|
|
88
102
|
}>;
|
|
89
|
-
export { StyledTextInputContainer, StyledAsteriskLabelInsideTextInput, StyledTextInput, StyledError, StyledMaxLengthMessage, StyledLabelInsideTextInput, StyledContainer, StyledErrorContainer, StyledHelperText, StyledTextInputAndLabelContainer, StyledLabelContainerInsideTextInput, StyledErrorAndHelpTextContainer, StyledBorderBackDrop, StyledErrorAndMaxLengthContainer, };
|
|
103
|
+
export { StyledTextInputContainer, StyledAsteriskLabelInsideTextInput, StyledTextInput, StyledError, StyledMaxLengthMessage, StyledLabelInsideTextInput, StyledContainer, StyledErrorContainer, StyledHelperText, StyledInputContentContainer, StyledTextInputAndLabelContainer, StyledLabelContainerInsideTextInput, StyledErrorAndHelpTextContainer, StyledBorderBackDrop, StyledErrorAndMaxLengthContainer, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Text } from 'react-native';
|
|
2
2
|
import type { TypographyColorIntent } from '../types';
|
|
3
|
-
type ThemeVariant = 'small' | 'small-bold' | 'regular' | 'regular-bold';
|
|
3
|
+
type ThemeVariant = 'small' | 'small-bold' | 'small-medium' | 'regular' | 'regular-bold' | 'regular-medium';
|
|
4
4
|
declare const StyledBody: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
|
|
5
5
|
theme?: import("@emotion/react").Theme;
|
|
6
6
|
as?: React.ElementType;
|
|
@@ -23,12 +23,15 @@ export interface BodyProps extends NativeTextProps {
|
|
|
23
23
|
* The typeface to render the text in:
|
|
24
24
|
* - `neutral`: The default typeface for the platform.
|
|
25
25
|
* - `playful`: To visualise a playful content.
|
|
26
|
+
*
|
|
27
|
+
* Note: `regular-medium` and `small-medium` variants are only available with the `neutral` typeface.
|
|
26
28
|
*/
|
|
27
29
|
typeface?: 'neutral' | 'playful';
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
|
|
31
|
+
* Size and weight variant of the text.
|
|
32
|
+
* Medium variants (`regular-medium`, `small-medium`) are available with the `neutral` typeface only.
|
|
33
|
+
*/
|
|
34
|
+
variant?: 'regular' | 'regular-medium' | 'regular-bold' | 'small' | 'small-medium' | 'small-bold';
|
|
32
35
|
/**
|
|
33
36
|
* Font style to apply to the text.
|
|
34
37
|
*/
|
|
@@ -4,7 +4,7 @@ declare const StyledCaption: import("@emotion/native").StyledComponent<import("r
|
|
|
4
4
|
theme?: import("@emotion/react").Theme;
|
|
5
5
|
as?: React.ElementType;
|
|
6
6
|
} & {
|
|
7
|
-
themeFontWeight: "regular" | "semi-bold";
|
|
7
|
+
themeFontWeight: "regular" | "medium" | "semi-bold";
|
|
8
8
|
themeIntent: TypographyColorIntent;
|
|
9
9
|
themeIsItalic?: boolean;
|
|
10
10
|
}, {}, {
|
|
@@ -23,6 +23,11 @@ export interface LabelProps extends NativeTextProps {
|
|
|
23
23
|
* Font style to apply to the text.
|
|
24
24
|
*/
|
|
25
25
|
fontStyle?: 'normal' | 'italic';
|
|
26
|
+
/**
|
|
27
|
+
* Font weight. Only `'medium'` (500) is available in addition to the default `'regular'` (400).
|
|
28
|
+
* Medium weight is supported for the neutral typeface only.
|
|
29
|
+
*/
|
|
30
|
+
fontWeight?: 'regular' | 'medium';
|
|
26
31
|
}
|
|
27
|
-
declare const Label: ({ children, intent, allowFontScaling, fontStyle, style, testID, ...nativeProps }: LabelProps) => React.JSX.Element;
|
|
32
|
+
declare const Label: ({ children, intent, allowFontScaling, fontStyle, fontWeight, style, testID, ...nativeProps }: LabelProps) => React.JSX.Element;
|
|
28
33
|
export default Label;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const FONTWEIGHT_MAP: {
|
|
2
2
|
readonly light: "light";
|
|
3
3
|
readonly regular: "regular";
|
|
4
|
+
readonly medium: "medium";
|
|
4
5
|
readonly 'semi-bold': "semiBold";
|
|
5
6
|
};
|
|
6
7
|
export type TypographyColorIntent = 'body' | 'subdued' | 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'inverted' | 'archived' | 'disabled' | 'muted' | 'inactive';
|
|
@@ -7,6 +7,7 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
|
|
|
7
7
|
success: string;
|
|
8
8
|
warning: string;
|
|
9
9
|
archived: string;
|
|
10
|
+
neutral: string;
|
|
10
11
|
text: string;
|
|
11
12
|
border: string;
|
|
12
13
|
countText: string;
|
|
@@ -17,6 +18,7 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
|
|
|
17
18
|
success: string;
|
|
18
19
|
warning: string;
|
|
19
20
|
archived: string;
|
|
21
|
+
neutral: string;
|
|
20
22
|
};
|
|
21
23
|
stringText: {
|
|
22
24
|
primary: string;
|
|
@@ -25,6 +27,7 @@ declare const getBadgeTheme: (theme: GlobalTheme) => {
|
|
|
25
27
|
success: string;
|
|
26
28
|
warning: string;
|
|
27
29
|
archived: string;
|
|
30
|
+
neutral: string;
|
|
28
31
|
};
|
|
29
32
|
};
|
|
30
33
|
fonts: {
|
|
@@ -11,13 +11,20 @@ declare const getTextInputTheme: (theme: GlobalTheme) => {
|
|
|
11
11
|
filled: string;
|
|
12
12
|
};
|
|
13
13
|
error: string;
|
|
14
|
-
text:
|
|
14
|
+
text: {
|
|
15
|
+
default: string;
|
|
16
|
+
filled: string;
|
|
17
|
+
error: string;
|
|
18
|
+
readonly: string;
|
|
19
|
+
disabled: string;
|
|
20
|
+
};
|
|
15
21
|
borders: {
|
|
16
22
|
default: string;
|
|
17
23
|
error: string;
|
|
18
24
|
disabled: string;
|
|
19
25
|
readonly: string;
|
|
20
26
|
filled: string;
|
|
27
|
+
focused: string;
|
|
21
28
|
};
|
|
22
29
|
labels: {
|
|
23
30
|
default: string;
|
|
@@ -33,6 +40,7 @@ declare const getTextInputTheme: (theme: GlobalTheme) => {
|
|
|
33
40
|
readonly: string;
|
|
34
41
|
filled: string;
|
|
35
42
|
};
|
|
43
|
+
readonlyBackground: string;
|
|
36
44
|
maxLengthLabels: {
|
|
37
45
|
default: string;
|
|
38
46
|
error: string;
|
|
@@ -49,7 +57,8 @@ declare const getTextInputTheme: (theme: GlobalTheme) => {
|
|
|
49
57
|
};
|
|
50
58
|
};
|
|
51
59
|
space: {
|
|
52
|
-
|
|
60
|
+
containerHorizontalPadding: number;
|
|
61
|
+
containerVerticalPadding: number;
|
|
53
62
|
labelLeft: number;
|
|
54
63
|
labelTop: number;
|
|
55
64
|
labelPaddingBottom: number;
|
|
@@ -57,11 +66,12 @@ declare const getTextInputTheme: (theme: GlobalTheme) => {
|
|
|
57
66
|
inputHorizontalMargin: number;
|
|
58
67
|
errorContainerMarginRight: number;
|
|
59
68
|
errorAndHelpTextContainerMarginTop: number;
|
|
60
|
-
errorMarginLeft: number;
|
|
61
|
-
errorAndHelpTextContainerHorizontalPadding: number;
|
|
62
69
|
containerMarginTop: number;
|
|
63
70
|
labelInsideTextInputMarginTop: number;
|
|
64
71
|
errorAndHelpTextContainerPaddingTop: number;
|
|
72
|
+
inputAndLabelContainerPaddingTop: number;
|
|
73
|
+
labelFocusedTranslateY: number;
|
|
74
|
+
textareaLabelIdleTranslateY: number;
|
|
65
75
|
};
|
|
66
76
|
fonts: {
|
|
67
77
|
text: string;
|
|
@@ -84,12 +94,14 @@ declare const getTextInputTheme: (theme: GlobalTheme) => {
|
|
|
84
94
|
container: number;
|
|
85
95
|
};
|
|
86
96
|
sizes: {
|
|
87
|
-
|
|
97
|
+
errorAndHelpTextContainerMinHeight: number;
|
|
98
|
+
containerMinHeight: number;
|
|
88
99
|
textareaHeight: number;
|
|
89
100
|
textInputMaxHeight: number;
|
|
90
101
|
};
|
|
91
102
|
lineHeights: {
|
|
92
103
|
topLabel: number;
|
|
104
|
+
label: number;
|
|
93
105
|
};
|
|
94
106
|
};
|
|
95
107
|
export default getTextInputTheme;
|
|
@@ -122,11 +122,13 @@ declare const getTypographyTheme: (theme: GlobalTheme) => {
|
|
|
122
122
|
body: {
|
|
123
123
|
neutral: {
|
|
124
124
|
semiBold: number;
|
|
125
|
+
medium: number;
|
|
125
126
|
regular: number;
|
|
126
127
|
small: number;
|
|
127
128
|
};
|
|
128
129
|
playful: {
|
|
129
130
|
semiBold: number;
|
|
131
|
+
medium: number;
|
|
130
132
|
regular: number;
|
|
131
133
|
small: number;
|
|
132
134
|
};
|