react-native-mantine 0.3.0 → 0.5.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/README.md +10 -0
- package/lib/commonjs/components/Button/Button.styles.js +2 -43
- package/lib/commonjs/components/Button/Button.styles.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +7 -26
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Input/Input.styles.js +2 -204
- package/lib/commonjs/components/Input/Input.styles.js.map +1 -1
- package/lib/commonjs/components/Input/index.js +1 -1
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.js +1 -4
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/commonjs/hooks/useCachedResources.js +1 -4
- package/lib/commonjs/hooks/useCachedResources.js.map +1 -1
- package/lib/commonjs/theme/theme-provider.js +6 -8
- package/lib/commonjs/theme/theme-provider.js.map +1 -1
- package/lib/module/components/Button/Button.styles.js +2 -43
- package/lib/module/components/Button/Button.styles.js.map +1 -1
- package/lib/module/components/Button/index.js +7 -26
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Input/Input.styles.js +1 -203
- package/lib/module/components/Input/Input.styles.js.map +1 -1
- package/lib/module/components/Input/index.js +1 -1
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/UnstyledButton/UnstyledButton.js +1 -4
- package/lib/module/components/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/module/hooks/useCachedResources.js +1 -4
- package/lib/module/hooks/useCachedResources.js.map +1 -1
- package/lib/module/theme/theme-provider.js +6 -8
- package/lib/module/theme/theme-provider.js.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/Button.styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Input/Input.styles.d.ts +7 -0
- package/lib/typescript/commonjs/src/components/Input/Input.styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Input/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useCachedResources.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/Button.styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Input/Input.styles.d.ts +7 -0
- package/lib/typescript/module/src/components/Input/Input.styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Input/index.d.ts +1 -1
- package/lib/typescript/module/src/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useCachedResources.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Button/Button.styles.ts +2 -45
- package/src/components/Button/index.tsx +9 -24
- package/src/components/Input/Input.styles.ts +1 -202
- package/src/components/Input/index.ts +1 -1
- package/src/components/UnstyledButton/UnstyledButton.tsx +1 -2
- package/src/hooks/useCachedResources.ts +1 -4
- package/src/theme/theme-provider.tsx +6 -6
- package/src/theme/types/MantineStyleSystem.ts +0 -53
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { INPUT_SIZES } from './Input.styles';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnstyledButton.d.ts","sourceRoot":"","sources":["../../../../../../src/components/UnstyledButton/UnstyledButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UnstyledButton.d.ts","sourceRoot":"","sources":["../../../../../../src/components/UnstyledButton/UnstyledButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,cAAc;YAEO,GAAG;6BAkBnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCachedResources.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useCachedResources.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"useCachedResources.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useCachedResources.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,OAAO,CAuBpD"}
|
package/package.json
CHANGED
|
@@ -56,15 +56,10 @@ interface GetSizeStyles {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function getSizeStyles({
|
|
59
|
-
// compact,
|
|
60
59
|
size,
|
|
61
60
|
withLeftIcon,
|
|
62
61
|
withRightIcon,
|
|
63
62
|
}: GetSizeStyles): any {
|
|
64
|
-
// if (compact) {
|
|
65
|
-
// return sizes[`compact-${size}`];
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
63
|
const _sizes: (typeof sizes)[keyof typeof sizes] = sizes[size];
|
|
69
64
|
|
|
70
65
|
if (!_sizes) {
|
|
@@ -87,42 +82,6 @@ const getWidthStyles = (fullWidth: boolean) => ({
|
|
|
87
82
|
width: fullWidth ? '100%' : 'auto',
|
|
88
83
|
});
|
|
89
84
|
|
|
90
|
-
// interface GetVariantStyles {
|
|
91
|
-
// theme: MantineTheme;
|
|
92
|
-
// color: MantineColor;
|
|
93
|
-
// variant: string;
|
|
94
|
-
// gradient: MantineGradient;
|
|
95
|
-
// }
|
|
96
|
-
|
|
97
|
-
// function getVariantStyles({
|
|
98
|
-
// variant,
|
|
99
|
-
// theme,
|
|
100
|
-
// color,
|
|
101
|
-
// gradient,
|
|
102
|
-
// }: GetVariantStyles) {
|
|
103
|
-
// if (!BUTTON_VARIANTS.includes(variant)) {
|
|
104
|
-
// return null;
|
|
105
|
-
// }
|
|
106
|
-
|
|
107
|
-
// const colors = theme.fn.variant({ color, variant, gradient });
|
|
108
|
-
|
|
109
|
-
// if (variant === 'gradient') {
|
|
110
|
-
// return {
|
|
111
|
-
// border: 0,
|
|
112
|
-
// backgroundImage: colors.background,
|
|
113
|
-
// color: colors.color,
|
|
114
|
-
// ...theme.fn.hover({ backgroundSize: '200%' }),
|
|
115
|
-
// };
|
|
116
|
-
// }
|
|
117
|
-
|
|
118
|
-
// return {
|
|
119
|
-
// border: `${rem(1)} solid ${colors.border}`,
|
|
120
|
-
// backgroundColor: colors.background,
|
|
121
|
-
// color: colors.color,
|
|
122
|
-
// ...theme.fn.hover({ backgroundColor: colors.hover }),
|
|
123
|
-
// };
|
|
124
|
-
// }
|
|
125
|
-
|
|
126
85
|
interface GetVariantStylesInput {
|
|
127
86
|
variant: string;
|
|
128
87
|
color: MantineColor;
|
|
@@ -163,10 +122,7 @@ const useStyles = createStyles(
|
|
|
163
122
|
color,
|
|
164
123
|
gradient,
|
|
165
124
|
}: ButtonStylesParams,
|
|
166
|
-
{
|
|
167
|
-
variant,
|
|
168
|
-
size,
|
|
169
|
-
}
|
|
125
|
+
{ variant, size }
|
|
170
126
|
) => {
|
|
171
127
|
return {
|
|
172
128
|
root: {
|
|
@@ -245,6 +201,7 @@ const useStyles = createStyles(
|
|
|
245
201
|
overflow: 'hidden',
|
|
246
202
|
display: 'flex',
|
|
247
203
|
alignItems: 'center',
|
|
204
|
+
justifyContent: 'center',
|
|
248
205
|
},
|
|
249
206
|
};
|
|
250
207
|
}
|
|
@@ -9,10 +9,11 @@ import type {
|
|
|
9
9
|
} from '../../theme/types';
|
|
10
10
|
import type { MantineGradient } from '../../theme/theme';
|
|
11
11
|
import type { LoaderProps } from '../Loader';
|
|
12
|
-
import { ActivityIndicator } from 'react-native';
|
|
12
|
+
import { ActivityIndicator, View } from 'react-native';
|
|
13
13
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
14
14
|
import useStyles from './Button.styles';
|
|
15
15
|
import { BoxView } from '../BoxView';
|
|
16
|
+
import { Text } from '../Text';
|
|
16
17
|
|
|
17
18
|
export type ButtonStylesNames = any;
|
|
18
19
|
|
|
@@ -77,10 +78,9 @@ const defaultProps: Partial<ButtonProps> = {
|
|
|
77
78
|
loaderPosition: 'left',
|
|
78
79
|
};
|
|
79
80
|
|
|
80
|
-
export const _Button = forwardRef<
|
|
81
|
+
export const _Button = forwardRef<View, ButtonProps>(
|
|
81
82
|
(props, ref) => {
|
|
82
83
|
const {
|
|
83
|
-
// className,
|
|
84
84
|
size,
|
|
85
85
|
color,
|
|
86
86
|
type,
|
|
@@ -97,9 +97,6 @@ export const _Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
97
97
|
loaderPosition,
|
|
98
98
|
loaderProps,
|
|
99
99
|
gradient,
|
|
100
|
-
// classNames,
|
|
101
|
-
// styles,
|
|
102
|
-
// unstyled,
|
|
103
100
|
style,
|
|
104
101
|
...others
|
|
105
102
|
} = useComponentDefaultProps('Button', defaultProps, props);
|
|
@@ -116,33 +113,20 @@ export const _Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
116
113
|
},
|
|
117
114
|
{
|
|
118
115
|
name: 'Button',
|
|
119
|
-
// unstyled, classNames, styles,
|
|
120
116
|
variant,
|
|
121
117
|
size,
|
|
122
118
|
}
|
|
123
119
|
);
|
|
124
120
|
|
|
125
|
-
// const colors = theme.fn.variant({ color, variant });
|
|
126
|
-
|
|
127
|
-
// const loader = (
|
|
128
|
-
// <Loader
|
|
129
|
-
// color={colors.color}
|
|
130
|
-
// size={`calc(${(getSize({ size, sizes }) as any).height} / 2)`}
|
|
131
|
-
// {...loaderProps}
|
|
132
|
-
// />
|
|
133
|
-
// );
|
|
134
121
|
const loader = <ActivityIndicator />;
|
|
135
122
|
|
|
136
123
|
return (
|
|
137
124
|
<UnstyledButton
|
|
138
125
|
style={sx(styles.root, style)}
|
|
139
|
-
// type={type}
|
|
140
|
-
// disabled={disabled}
|
|
141
126
|
data-button
|
|
142
127
|
data-disabled={disabled || undefined}
|
|
143
128
|
data-loading={loading || undefined}
|
|
144
129
|
ref={ref}
|
|
145
|
-
// unstyled={unstyled}
|
|
146
130
|
{...others}
|
|
147
131
|
>
|
|
148
132
|
<BoxView style={styles.inner}>
|
|
@@ -156,11 +140,12 @@ export const _Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
156
140
|
<BoxView style={styles.centerLoader}>{loader}</BoxView>
|
|
157
141
|
)}
|
|
158
142
|
|
|
159
|
-
<BoxView
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
143
|
+
<BoxView style={styles.label}>
|
|
144
|
+
{typeof children === 'string' || typeof children === 'number' ? (
|
|
145
|
+
<Text>{children}</Text>
|
|
146
|
+
) : (
|
|
147
|
+
children
|
|
148
|
+
)}
|
|
164
149
|
</BoxView>
|
|
165
150
|
|
|
166
151
|
{(rightIcon || (loading && loaderPosition === 'right')) && (
|
|
@@ -21,205 +21,4 @@ export const sizes = {
|
|
|
21
21
|
xl: rem(60),
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// interface GetVariantStylesInput {
|
|
27
|
-
// theme: MantineTheme;
|
|
28
|
-
// variant: string;
|
|
29
|
-
// }
|
|
30
|
-
|
|
31
|
-
// function getVariantStyles({ theme, variant }: GetVariantStylesInput) {
|
|
32
|
-
// if (!INPUT_VARIANTS.includes(variant)) {
|
|
33
|
-
// return null;
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
// if (variant === 'default') {
|
|
37
|
-
// return {
|
|
38
|
-
// 'border': `${rem(1)} solid ${
|
|
39
|
-
// theme.colorScheme === 'dark'
|
|
40
|
-
// ? theme.colors.dark[4]
|
|
41
|
-
// : theme.colors.gray[4]
|
|
42
|
-
// }`,
|
|
43
|
-
// 'backgroundColor':
|
|
44
|
-
// theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.white,
|
|
45
|
-
// 'transition': 'border-color 100ms ease',
|
|
46
|
-
// '&:focus, &:focus-within': theme.focusRingStyles.inputStyles(theme),
|
|
47
|
-
// };
|
|
48
|
-
// }
|
|
49
|
-
|
|
50
|
-
// if (variant === 'filled') {
|
|
51
|
-
// return {
|
|
52
|
-
// 'border': `${rem(1)} solid transparent`,
|
|
53
|
-
// 'backgroundColor':
|
|
54
|
-
// theme.colorScheme === 'dark'
|
|
55
|
-
// ? theme.colors.dark[5]
|
|
56
|
-
// : theme.colors.gray[1],
|
|
57
|
-
// '&:focus, &:focus-within': theme.focusRingStyles.inputStyles(theme),
|
|
58
|
-
// };
|
|
59
|
-
// }
|
|
60
|
-
|
|
61
|
-
// return {
|
|
62
|
-
// 'borderWidth': 0,
|
|
63
|
-
// 'color': theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
|
|
64
|
-
// 'backgroundColor': 'transparent',
|
|
65
|
-
// 'minHeight': rem(28),
|
|
66
|
-
// 'outline': 0,
|
|
67
|
-
|
|
68
|
-
// '&:focus, &:focus-within': {
|
|
69
|
-
// outline: 'none',
|
|
70
|
-
// borderColor: 'transparent',
|
|
71
|
-
// },
|
|
72
|
-
|
|
73
|
-
// '&:disabled': {
|
|
74
|
-
// 'backgroundColor': 'transparent',
|
|
75
|
-
|
|
76
|
-
// '&:focus, &:focus-within': {
|
|
77
|
-
// outline: 'none',
|
|
78
|
-
// borderColor: 'transparent',
|
|
79
|
-
// },
|
|
80
|
-
// },
|
|
81
|
-
// };
|
|
82
|
-
// }
|
|
83
|
-
|
|
84
|
-
// export default createStyles(
|
|
85
|
-
// (
|
|
86
|
-
// theme,
|
|
87
|
-
// {
|
|
88
|
-
// multiline,
|
|
89
|
-
// radius,
|
|
90
|
-
// invalid,
|
|
91
|
-
// rightSectionWidth,
|
|
92
|
-
// withRightSection,
|
|
93
|
-
// iconWidth,
|
|
94
|
-
// offsetBottom,
|
|
95
|
-
// offsetTop,
|
|
96
|
-
// pointer,
|
|
97
|
-
// }: InputStylesParams,
|
|
98
|
-
// { variant, size }
|
|
99
|
-
// ) => {
|
|
100
|
-
// const invalidColor = theme.fn.variant({
|
|
101
|
-
// variant: 'filled',
|
|
102
|
-
// color: 'red',
|
|
103
|
-
// }).background;
|
|
104
|
-
// const sizeStyles =
|
|
105
|
-
// variant === 'default' || variant === 'filled'
|
|
106
|
-
// ? {
|
|
107
|
-
// minHeight: getSize({ size, sizes }),
|
|
108
|
-
// paddingLeft: `calc(${getSize({ size, sizes })} / 3)`,
|
|
109
|
-
// paddingRight: withRightSection
|
|
110
|
-
// ? rightSectionWidth || getSize({ size, sizes })
|
|
111
|
-
// : `calc(${getSize({ size, sizes })} / 3)`,
|
|
112
|
-
// borderRadius: theme.fn.radius(radius),
|
|
113
|
-
// }
|
|
114
|
-
// : null;
|
|
115
|
-
|
|
116
|
-
// return {
|
|
117
|
-
// wrapper: {
|
|
118
|
-
// position: 'relative',
|
|
119
|
-
// marginTop: offsetTop ? `calc(${theme.spacing.xs} / 2)` : undefined,
|
|
120
|
-
// marginBottom: offsetBottom
|
|
121
|
-
// ? `calc(${theme.spacing.xs} / 2)`
|
|
122
|
-
// : undefined,
|
|
123
|
-
// },
|
|
124
|
-
|
|
125
|
-
// input: {
|
|
126
|
-
// ...theme.fn.fontStyles(),
|
|
127
|
-
// 'height': multiline
|
|
128
|
-
// ? variant === 'unstyled'
|
|
129
|
-
// ? undefined
|
|
130
|
-
// : 'auto'
|
|
131
|
-
// : getSize({ size, sizes }),
|
|
132
|
-
// 'WebkitTapHighlightColor': 'transparent',
|
|
133
|
-
// 'lineHeight': multiline
|
|
134
|
-
// ? theme.lineHeight
|
|
135
|
-
// : `calc(${getSize({ size, sizes })} - ${rem(2)})`,
|
|
136
|
-
// 'appearance': 'none',
|
|
137
|
-
// 'resize': 'none',
|
|
138
|
-
// 'boxSizing': 'border-box',
|
|
139
|
-
// 'fontSize': getSize({ size, sizes: theme.fontSizes }),
|
|
140
|
-
// 'width': '100%',
|
|
141
|
-
// 'color':
|
|
142
|
-
// theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
|
|
143
|
-
// 'display': 'block',
|
|
144
|
-
// 'textAlign': 'left',
|
|
145
|
-
// 'cursor': pointer ? 'pointer' : undefined,
|
|
146
|
-
// ...getVariantStyles({ theme, variant }),
|
|
147
|
-
// ...sizeStyles,
|
|
148
|
-
|
|
149
|
-
// '&:disabled, &[data-disabled]': {
|
|
150
|
-
// 'backgroundColor':
|
|
151
|
-
// theme.colorScheme === 'dark'
|
|
152
|
-
// ? theme.colors.dark[6]
|
|
153
|
-
// : theme.colors.gray[1],
|
|
154
|
-
// 'color': theme.colors.dark[2],
|
|
155
|
-
// 'opacity': 0.6,
|
|
156
|
-
// 'cursor': 'not-allowed',
|
|
157
|
-
|
|
158
|
-
// '&::placeholder': {
|
|
159
|
-
// color: theme.colors.dark[2],
|
|
160
|
-
// },
|
|
161
|
-
// },
|
|
162
|
-
|
|
163
|
-
// '&[data-invalid]': {
|
|
164
|
-
// 'color': invalidColor,
|
|
165
|
-
// 'borderColor': invalidColor,
|
|
166
|
-
|
|
167
|
-
// '&::placeholder': {
|
|
168
|
-
// opacity: 1,
|
|
169
|
-
// color: invalidColor,
|
|
170
|
-
// },
|
|
171
|
-
// },
|
|
172
|
-
|
|
173
|
-
// '&[data-with-icon]': {
|
|
174
|
-
// paddingLeft:
|
|
175
|
-
// typeof iconWidth === 'number'
|
|
176
|
-
// ? rem(iconWidth)
|
|
177
|
-
// : getSize({ size, sizes }),
|
|
178
|
-
// },
|
|
179
|
-
|
|
180
|
-
// '&::placeholder': {
|
|
181
|
-
// ...theme.fn.placeholderStyles(),
|
|
182
|
-
// opacity: 1,
|
|
183
|
-
// },
|
|
184
|
-
|
|
185
|
-
// '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration':
|
|
186
|
-
// {
|
|
187
|
-
// appearance: 'none',
|
|
188
|
-
// },
|
|
189
|
-
|
|
190
|
-
// '&[type=number]': {
|
|
191
|
-
// MozAppearance: 'textfield',
|
|
192
|
-
// },
|
|
193
|
-
// },
|
|
194
|
-
|
|
195
|
-
// icon: {
|
|
196
|
-
// pointerEvents: 'none',
|
|
197
|
-
// position: 'absolute',
|
|
198
|
-
// zIndex: 1,
|
|
199
|
-
// left: 0,
|
|
200
|
-
// top: 0,
|
|
201
|
-
// bottom: 0,
|
|
202
|
-
// display: 'flex',
|
|
203
|
-
// alignItems: 'center',
|
|
204
|
-
// justifyContent: 'center',
|
|
205
|
-
// width: iconWidth ? rem(iconWidth) : getSize({ size, sizes }),
|
|
206
|
-
// color: invalid
|
|
207
|
-
// ? theme.colors.red[theme.colorScheme === 'dark' ? 6 : 7]
|
|
208
|
-
// : theme.colorScheme === 'dark'
|
|
209
|
-
// ? theme.colors.dark[2]
|
|
210
|
-
// : theme.colors.gray[5],
|
|
211
|
-
// },
|
|
212
|
-
|
|
213
|
-
// rightSection: {
|
|
214
|
-
// position: 'absolute',
|
|
215
|
-
// top: 0,
|
|
216
|
-
// bottom: 0,
|
|
217
|
-
// right: 0,
|
|
218
|
-
// display: 'flex',
|
|
219
|
-
// alignItems: 'center',
|
|
220
|
-
// justifyContent: 'center',
|
|
221
|
-
// width: rightSectionWidth || getSize({ size, sizes }),
|
|
222
|
-
// },
|
|
223
|
-
// };
|
|
224
|
-
// }
|
|
225
|
-
// );
|
|
24
|
+
export const INPUT_SIZES = sizes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { INPUT_SIZES } from './Input.styles';
|
|
@@ -3,7 +3,6 @@ import { BoxView } from '../BoxView';
|
|
|
3
3
|
import useStyles from './UnstyledButton.styles';
|
|
4
4
|
import { TouchableOpacity } from 'react-native';
|
|
5
5
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
6
|
-
import { Text } from '../Text';
|
|
7
6
|
|
|
8
7
|
export interface UnstyledButtonProps {
|
|
9
8
|
variant?: string;
|
|
@@ -27,7 +26,7 @@ export const UnstyledButton = forwardRef<
|
|
|
27
26
|
onPress={typeof onPress === 'function' ? onPress : () => {}}
|
|
28
27
|
>
|
|
29
28
|
<BoxView ref={ref} style={[styles.root, style]} {...others}>
|
|
30
|
-
|
|
29
|
+
{children}
|
|
31
30
|
</BoxView>
|
|
32
31
|
</TouchableOpacity>
|
|
33
32
|
);
|
|
@@ -8,16 +8,13 @@ export default function useCachedResources(): boolean {
|
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
async function loadResourcesAndDataAsync(): Promise<void> {
|
|
10
10
|
try {
|
|
11
|
-
// SplashScreen.preventAutoHideAsync()
|
|
12
|
-
// Load fonts
|
|
13
11
|
await Font.loadAsync({
|
|
14
12
|
Nunito: require('../fonts/Nunito-Regular.ttf'),
|
|
15
13
|
'Nunito Bold': require('../fonts/Nunito-Bold.ttf'),
|
|
16
14
|
'Nunito SemiBold': require('../fonts/Nunito-SemiBold.ttf'),
|
|
17
15
|
})
|
|
18
16
|
} catch (e) {
|
|
19
|
-
//
|
|
20
|
-
// console.warn(e)
|
|
17
|
+
// Error silently ignored - consider adding error reporting in production
|
|
21
18
|
} finally {
|
|
22
19
|
setLoadingComplete(true)
|
|
23
20
|
}
|
|
@@ -6,7 +6,7 @@ import React, {
|
|
|
6
6
|
useMemo,
|
|
7
7
|
useState,
|
|
8
8
|
} from 'react';
|
|
9
|
-
import { Appearance, Platform } from 'react-native';
|
|
9
|
+
import { ActivityIndicator, Appearance, Platform } from 'react-native';
|
|
10
10
|
|
|
11
11
|
import type { ColorSchemeName } from 'react-native';
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ import type { MantineTheme } from './default-theme';
|
|
|
17
17
|
import { createTheme } from './create-theme';
|
|
18
18
|
|
|
19
19
|
import { filterProps } from './filter-props';
|
|
20
|
-
|
|
20
|
+
import useCachedResources from '../hooks/useCachedResources';
|
|
21
21
|
|
|
22
22
|
type ThemeProps = {
|
|
23
23
|
children: ReactNode;
|
|
@@ -94,15 +94,15 @@ export const Theme = ({
|
|
|
94
94
|
theme: themeOverwrite,
|
|
95
95
|
forceMode,
|
|
96
96
|
}: ThemeProps): React.ReactElement => {
|
|
97
|
-
|
|
97
|
+
const loaded = useCachedResources();
|
|
98
98
|
|
|
99
99
|
const theme = useMemo(() => {
|
|
100
100
|
return createTheme(themeOverwrite);
|
|
101
101
|
}, [themeOverwrite]);
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
if (!loaded) {
|
|
104
|
+
return <ActivityIndicator />;
|
|
105
|
+
}
|
|
106
106
|
return (
|
|
107
107
|
<ThemeProvider theme={theme} forceMode={forceMode}>
|
|
108
108
|
{children}
|
|
@@ -7,56 +7,3 @@ export type SystemProp<Value> =
|
|
|
7
7
|
export type SpacingValue = MantineNumberSize | (string & {});
|
|
8
8
|
|
|
9
9
|
export type MantineStyleSystemProps = any;
|
|
10
|
-
|
|
11
|
-
// export interface MantineStyleSystemProps {
|
|
12
|
-
// m?: SystemProp<SpacingValue>;
|
|
13
|
-
// my?: SystemProp<SpacingValue>;
|
|
14
|
-
// mx?: SystemProp<SpacingValue>;
|
|
15
|
-
// mt?: SystemProp<SpacingValue>;
|
|
16
|
-
// mb?: SystemProp<SpacingValue>;
|
|
17
|
-
// ml?: SystemProp<SpacingValue>;
|
|
18
|
-
// mr?: SystemProp<SpacingValue>;
|
|
19
|
-
|
|
20
|
-
// p?: SystemProp<SpacingValue>;
|
|
21
|
-
// py?: SystemProp<SpacingValue>;
|
|
22
|
-
// px?: SystemProp<SpacingValue>;
|
|
23
|
-
// pt?: SystemProp<SpacingValue>;
|
|
24
|
-
// pb?: SystemProp<SpacingValue>;
|
|
25
|
-
// pl?: SystemProp<SpacingValue>;
|
|
26
|
-
// pr?: SystemProp<SpacingValue>;
|
|
27
|
-
|
|
28
|
-
// bg?: SystemProp<MantineColor>;
|
|
29
|
-
// c?: SystemProp<MantineColor>;
|
|
30
|
-
// opacity?: SystemProp<CSSProperties['opacity']>;
|
|
31
|
-
|
|
32
|
-
// ff?: SystemProp<CSSProperties['fontFamily']>;
|
|
33
|
-
// fz?: SystemProp<SpacingValue>;
|
|
34
|
-
// fw?: SystemProp<CSSProperties['fontWeight']>;
|
|
35
|
-
// lts?: SystemProp<CSSProperties['letterSpacing']>;
|
|
36
|
-
// ta?: SystemProp<CSSProperties['textAlign']>;
|
|
37
|
-
// lh?: SystemProp<CSSProperties['lineHeight']>;
|
|
38
|
-
// fs?: SystemProp<CSSProperties['fontStyle']>;
|
|
39
|
-
// tt?: SystemProp<CSSProperties['textTransform']>;
|
|
40
|
-
// td?: SystemProp<CSSProperties['textDecoration']>;
|
|
41
|
-
|
|
42
|
-
// w?: SystemProp<CSSProperties['width']>;
|
|
43
|
-
// miw?: SystemProp<CSSProperties['minWidth']>;
|
|
44
|
-
// maw?: SystemProp<CSSProperties['maxWidth']>;
|
|
45
|
-
// h?: SystemProp<CSSProperties['height']>;
|
|
46
|
-
// mih?: SystemProp<CSSProperties['minHeight']>;
|
|
47
|
-
// mah?: SystemProp<CSSProperties['maxHeight']>;
|
|
48
|
-
|
|
49
|
-
// bgsz?: SystemProp<CSSProperties['backgroundSize']>;
|
|
50
|
-
// bgp?: SystemProp<CSSProperties['backgroundPosition']>;
|
|
51
|
-
// bgr?: SystemProp<CSSProperties['backgroundRepeat']>;
|
|
52
|
-
// bga?: SystemProp<CSSProperties['backgroundAttachment']>;
|
|
53
|
-
|
|
54
|
-
// pos?: SystemProp<CSSProperties['position']>;
|
|
55
|
-
// top?: SystemProp<CSSProperties['top']>;
|
|
56
|
-
// left?: SystemProp<CSSProperties['left']>;
|
|
57
|
-
// bottom?: SystemProp<CSSProperties['bottom']>;
|
|
58
|
-
// right?: SystemProp<CSSProperties['right']>;
|
|
59
|
-
// inset?: SystemProp<CSSProperties['inset']>;
|
|
60
|
-
|
|
61
|
-
// display?: SystemProp<CSSProperties['display']>;
|
|
62
|
-
// }
|