react-native-mantine 0.9.0 → 0.10.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/lib/commonjs/components/Button/index.js +52 -17
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Code/index.js +3 -1
- package/lib/commonjs/components/Code/index.js.map +1 -1
- package/lib/commonjs/components/Gradient/Gradient.js +70 -0
- package/lib/commonjs/components/Gradient/Gradient.js.map +1 -0
- package/lib/commonjs/components/Gradient/index.js +19 -0
- package/lib/commonjs/components/Gradient/index.js.map +1 -0
- package/lib/commonjs/components/Modal/index.js +33 -3
- package/lib/commonjs/components/Modal/index.js.map +1 -1
- package/lib/commonjs/components/Paper/index.js +1 -76
- package/lib/commonjs/components/Paper/index.js.map +1 -1
- package/lib/commonjs/components/Text/index.js +27 -8
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/ThemeIcon/index.js +6 -4
- package/lib/commonjs/components/ThemeIcon/index.js.map +1 -1
- package/lib/commonjs/components/Title/index.js +7 -3
- package/lib/commonjs/components/Title/index.js.map +1 -1
- package/lib/commonjs/components/index.js +33 -22
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/theme/create-theme.js +3 -5
- package/lib/commonjs/theme/create-theme.js.map +1 -1
- package/lib/commonjs/theme/default-theme.js +168 -21
- package/lib/commonjs/theme/default-theme.js.map +1 -1
- package/lib/commonjs/theme/functions/attach-functions.js +7 -1
- package/lib/commonjs/theme/functions/attach-functions.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/breakpoints.js +69 -0
- package/lib/commonjs/theme/functions/fns/breakpoints.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/darken.js +25 -0
- package/lib/commonjs/theme/functions/fns/darken.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/dimmed.js +19 -0
- package/lib/commonjs/theme/functions/fns/dimmed.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/gradient/gradient.js +78 -0
- package/lib/commonjs/theme/functions/fns/gradient/gradient.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/helpers.js +1 -2
- package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/index.js +15 -0
- package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/lighten.js +24 -0
- package/lib/commonjs/theme/functions/fns/lighten.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/primary-shade.js +18 -0
- package/lib/commonjs/theme/functions/fns/primary-shade.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/shadow.js +107 -0
- package/lib/commonjs/theme/functions/fns/shadow.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js +3 -2
- package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/variant.js +7 -6
- package/lib/commonjs/theme/functions/fns/variant.js.map +1 -1
- package/lib/commonjs/theme/index.js +14 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/theme/theme-provider.js +10 -3
- package/lib/commonjs/theme/theme-provider.js.map +1 -1
- package/lib/commonjs/theme/utils/to-rgba.js +57 -0
- package/lib/commonjs/theme/utils/to-rgba.js.map +1 -0
- package/lib/module/components/Button/index.js +53 -18
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Code/index.js +3 -1
- package/lib/module/components/Code/index.js.map +1 -1
- package/lib/module/components/Gradient/Gradient.js +64 -0
- package/lib/module/components/Gradient/Gradient.js.map +1 -0
- package/lib/module/components/Gradient/index.js +4 -0
- package/lib/module/components/Gradient/index.js.map +1 -0
- package/lib/module/components/Modal/index.js +35 -5
- package/lib/module/components/Modal/index.js.map +1 -1
- package/lib/module/components/Paper/index.js +1 -76
- package/lib/module/components/Paper/index.js.map +1 -1
- package/lib/module/components/Text/index.js +27 -8
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/ThemeIcon/index.js +6 -4
- package/lib/module/components/ThemeIcon/index.js.map +1 -1
- package/lib/module/components/Title/index.js +7 -3
- package/lib/module/components/Title/index.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/theme/create-theme.js +3 -5
- package/lib/module/theme/create-theme.js.map +1 -1
- package/lib/module/theme/default-theme.js +168 -21
- package/lib/module/theme/default-theme.js.map +1 -1
- package/lib/module/theme/functions/attach-functions.js +7 -1
- package/lib/module/theme/functions/attach-functions.js.map +1 -1
- package/lib/module/theme/functions/fns/breakpoints.js +64 -0
- package/lib/module/theme/functions/fns/breakpoints.js.map +1 -0
- package/lib/module/theme/functions/fns/darken.js +22 -0
- package/lib/module/theme/functions/fns/darken.js.map +1 -0
- package/lib/module/theme/functions/fns/dimmed.js +15 -0
- package/lib/module/theme/functions/fns/dimmed.js.map +1 -0
- package/lib/module/theme/functions/fns/gradient/gradient.js +74 -0
- package/lib/module/theme/functions/fns/gradient/gradient.js.map +1 -0
- package/lib/module/theme/functions/fns/helpers.js +1 -2
- package/lib/module/theme/functions/fns/helpers.js.map +1 -1
- package/lib/module/theme/functions/fns/index.js +15 -0
- package/lib/module/theme/functions/fns/index.js.map +1 -1
- package/lib/module/theme/functions/fns/lighten.js +21 -0
- package/lib/module/theme/functions/fns/lighten.js.map +1 -0
- package/lib/module/theme/functions/fns/primary-shade.js +14 -0
- package/lib/module/theme/functions/fns/primary-shade.js.map +1 -0
- package/lib/module/theme/functions/fns/shadow.js +103 -0
- package/lib/module/theme/functions/fns/shadow.js.map +1 -0
- package/lib/module/theme/functions/fns/theme-color/theme-color.js +3 -2
- package/lib/module/theme/functions/fns/theme-color/theme-color.js.map +1 -1
- package/lib/module/theme/functions/fns/variant.js +7 -6
- package/lib/module/theme/functions/fns/variant.js.map +1 -1
- package/lib/module/theme/index.js +2 -0
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/theme-provider.js +10 -3
- package/lib/module/theme/theme-provider.js.map +1 -1
- package/lib/module/theme/utils/to-rgba.js +53 -0
- package/lib/module/theme/utils/to-rgba.js.map +1 -0
- package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Code/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Gradient/Gradient.d.ts +32 -0
- package/lib/typescript/commonjs/src/components/Gradient/Gradient.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Gradient/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/Gradient/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Modal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Paper/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/ThemeIcon/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Title/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/create-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/default-theme.d.ts +34 -3
- package/lib/typescript/commonjs/src/theme/default-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts +15 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/darken.d.ts +8 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/darken.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts +9 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts +13 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +1 -2
- package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +16 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/lighten.d.ts +8 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/lighten.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts +7 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts +24 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/theme-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/utils/to-rgba.d.ts +9 -0
- package/lib/typescript/commonjs/src/theme/utils/to-rgba.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Code/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Gradient/Gradient.d.ts +32 -0
- package/lib/typescript/module/src/components/Gradient/Gradient.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Gradient/index.d.ts +3 -0
- package/lib/typescript/module/src/components/Gradient/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Modal/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Paper/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/ThemeIcon/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Title/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/index.d.ts +1 -0
- package/lib/typescript/module/src/components/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/create-theme.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/default-theme.d.ts +34 -3
- package/lib/typescript/module/src/theme/default-theme.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts +15 -0
- package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/darken.d.ts +8 -0
- package/lib/typescript/module/src/theme/functions/fns/darken.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts +9 -0
- package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts +13 -0
- package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +1 -2
- package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/index.d.ts +16 -1
- package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/lighten.d.ts +8 -0
- package/lib/typescript/module/src/theme/functions/fns/lighten.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts +7 -0
- package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts +24 -0
- package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/variant.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/index.d.ts +4 -0
- package/lib/typescript/module/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/theme-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/utils/to-rgba.d.ts +9 -0
- package/lib/typescript/module/src/theme/utils/to-rgba.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Button/index.tsx +61 -21
- package/src/components/Code/index.tsx +3 -1
- package/src/components/Gradient/Gradient.tsx +71 -0
- package/src/components/Gradient/index.tsx +2 -0
- package/src/components/Modal/index.tsx +33 -3
- package/src/components/Paper/index.tsx +1 -63
- package/src/components/Text/index.tsx +28 -16
- package/src/components/ThemeIcon/index.tsx +6 -4
- package/src/components/Title/index.tsx +7 -3
- package/src/components/index.tsx +1 -0
- package/src/theme/create-theme.ts +3 -5
- package/src/theme/default-theme.ts +179 -91
- package/src/theme/functions/attach-functions.ts +6 -0
- package/src/theme/functions/fns/breakpoints.ts +62 -0
- package/src/theme/functions/fns/darken.ts +16 -0
- package/src/theme/functions/fns/dimmed.ts +16 -0
- package/src/theme/functions/fns/gradient/gradient.ts +63 -0
- package/src/theme/functions/fns/helpers.ts +1 -2
- package/src/theme/functions/fns/index.ts +15 -0
- package/src/theme/functions/fns/lighten.ts +15 -0
- package/src/theme/functions/fns/primary-shade.ts +17 -0
- package/src/theme/functions/fns/shadow.ts +100 -0
- package/src/theme/functions/fns/theme-color/theme-color.ts +3 -2
- package/src/theme/functions/fns/variant.ts +6 -5
- package/src/theme/index.tsx +4 -0
- package/src/theme/theme-provider.tsx +8 -3
- package/src/theme/theme.d.ts +11 -1
- package/src/theme/utils/to-rgba.ts +69 -0
|
@@ -3,4 +3,8 @@ export { createStyles } from './create-styles';
|
|
|
3
3
|
export { filterProps } from './filter-props';
|
|
4
4
|
export { getSize } from './get-size';
|
|
5
5
|
export { createTheme } from './create-theme';
|
|
6
|
+
export { shadow } from './functions/fns/shadow';
|
|
7
|
+
export type { ShadowStyles, MantineShadow } from './functions/fns/shadow';
|
|
8
|
+
export { gradient } from './functions/fns/gradient/gradient';
|
|
9
|
+
export type { MantineGradient, GradientConfig } from './theme.d';
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../../../../src/theme/theme-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../../../../src/theme/theme-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAOpD,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,YAAY,oBAA2B,CAAC;AAErD,eAAO,MAAM,aAAa,GAAI,iCAI3B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,YAsDT,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,YAAwC,CAAC;AAErE,eAAO,MAAM,KAAK,GAAI,iDAInB,UAAU,KAAG,KAAK,CAAC,YAerB,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,EAEzB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,CAAC,EACf,KAAK,EAAE,CAAC,GACP,CAAC,GAAG;KACJ,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACnE,CASA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-rgba.d.ts","sourceRoot":"","sources":["../../../../../../src/theme/utils/to-rgba.ts"],"names":[],"mappings":"AAEA,UAAU,IAAI;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AA8CD,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAe1C"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
2
3
|
import { UnstyledButton } from '../UnstyledButton';
|
|
3
4
|
import type {
|
|
4
5
|
DefaultProps,
|
|
@@ -9,7 +10,7 @@ import type {
|
|
|
9
10
|
} from '../../theme/types';
|
|
10
11
|
import type { MantineGradient } from '../../theme/theme';
|
|
11
12
|
import type { LoaderProps } from '../Loader';
|
|
12
|
-
import { ActivityIndicator, View } from 'react-native';
|
|
13
|
+
import { ActivityIndicator, View, StyleSheet } from 'react-native';
|
|
13
14
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
14
15
|
import useStyles from './Button.styles';
|
|
15
16
|
import { BoxView } from '../BoxView';
|
|
@@ -102,7 +103,7 @@ export const _Button = forwardRef<View, ButtonProps>((props, ref) => {
|
|
|
102
103
|
...others
|
|
103
104
|
} = useComponentDefaultProps('Button', defaultProps, props);
|
|
104
105
|
|
|
105
|
-
const { styles, sx } = useStyles(
|
|
106
|
+
const { styles, sx, theme } = useStyles(
|
|
106
107
|
{
|
|
107
108
|
radius,
|
|
108
109
|
color,
|
|
@@ -121,6 +122,55 @@ export const _Button = forwardRef<View, ButtonProps>((props, ref) => {
|
|
|
121
122
|
|
|
122
123
|
const loader = <ActivityIndicator />;
|
|
123
124
|
|
|
125
|
+
const buttonContent = (
|
|
126
|
+
<BoxView style={styles.inner}>
|
|
127
|
+
<BoxView style={styles.label}>
|
|
128
|
+
{(leftIcon || (loading && loaderPosition === 'left')) && (
|
|
129
|
+
<BoxView style={sx(styles.icon, styles.leftIcon)}>
|
|
130
|
+
{loading && loaderPosition === 'left' ? loader : leftIcon}
|
|
131
|
+
</BoxView>
|
|
132
|
+
)}
|
|
133
|
+
|
|
134
|
+
{loading && loaderPosition === 'center' && (
|
|
135
|
+
<BoxView style={styles.centerLoader}>{loader}</BoxView>
|
|
136
|
+
)}
|
|
137
|
+
{withTextWrapper(children, shouldWrapInText)}
|
|
138
|
+
{(rightIcon || (loading && loaderPosition === 'right')) && (
|
|
139
|
+
<BoxView style={sx(styles.icon, styles.rightIcon)}>
|
|
140
|
+
{loading && loaderPosition === 'right' ? loader : rightIcon}
|
|
141
|
+
</BoxView>
|
|
142
|
+
)}
|
|
143
|
+
</BoxView>
|
|
144
|
+
</BoxView>
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
// For gradient variant, wrap content in LinearGradient
|
|
148
|
+
if (variant === 'gradient') {
|
|
149
|
+
const gradientConfig = theme.fn.gradient(gradient);
|
|
150
|
+
const gradientStyle = StyleSheet.flatten([styles.root, style]);
|
|
151
|
+
const { backgroundColor, ...restStyle } = gradientStyle;
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<UnstyledButton
|
|
155
|
+
style={restStyle}
|
|
156
|
+
data-button
|
|
157
|
+
data-disabled={disabled || undefined}
|
|
158
|
+
data-loading={loading || undefined}
|
|
159
|
+
ref={ref}
|
|
160
|
+
{...others}
|
|
161
|
+
>
|
|
162
|
+
<LinearGradient
|
|
163
|
+
colors={gradientConfig.colors}
|
|
164
|
+
start={gradientConfig.start}
|
|
165
|
+
end={gradientConfig.end}
|
|
166
|
+
style={gradientStyles.gradient}
|
|
167
|
+
>
|
|
168
|
+
{buttonContent}
|
|
169
|
+
</LinearGradient>
|
|
170
|
+
</UnstyledButton>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
124
174
|
return (
|
|
125
175
|
<UnstyledButton
|
|
126
176
|
style={sx(styles.root, style)}
|
|
@@ -130,27 +180,17 @@ export const _Button = forwardRef<View, ButtonProps>((props, ref) => {
|
|
|
130
180
|
ref={ref}
|
|
131
181
|
{...others}
|
|
132
182
|
>
|
|
133
|
-
|
|
134
|
-
<BoxView style={styles.label}>
|
|
135
|
-
{(leftIcon || (loading && loaderPosition === 'left')) && (
|
|
136
|
-
<BoxView style={sx(styles.icon, styles.leftIcon)}>
|
|
137
|
-
{loading && loaderPosition === 'left' ? loader : leftIcon}
|
|
138
|
-
</BoxView>
|
|
139
|
-
)}
|
|
140
|
-
|
|
141
|
-
{loading && loaderPosition === 'center' && (
|
|
142
|
-
<BoxView style={styles.centerLoader}>{loader}</BoxView>
|
|
143
|
-
)}
|
|
144
|
-
{withTextWrapper(children, shouldWrapInText)}
|
|
145
|
-
{(rightIcon || (loading && loaderPosition === 'right')) && (
|
|
146
|
-
<BoxView style={sx(styles.icon, styles.rightIcon)}>
|
|
147
|
-
{loading && loaderPosition === 'right' ? loader : rightIcon}
|
|
148
|
-
</BoxView>
|
|
149
|
-
)}
|
|
150
|
-
</BoxView>
|
|
151
|
-
</BoxView>
|
|
183
|
+
{buttonContent}
|
|
152
184
|
</UnstyledButton>
|
|
153
185
|
);
|
|
154
186
|
}) as any;
|
|
155
187
|
|
|
188
|
+
const gradientStyles = StyleSheet.create({
|
|
189
|
+
gradient: {
|
|
190
|
+
flex: 1,
|
|
191
|
+
justifyContent: 'center',
|
|
192
|
+
alignItems: 'center',
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
|
|
156
196
|
export const Button = _Button;
|
|
@@ -2,6 +2,7 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
import { Text } from '../Text';
|
|
3
3
|
import type { TextProps } from '../Text';
|
|
4
4
|
import { useTheme } from '../../theme/theme-provider';
|
|
5
|
+
import { getPrimaryShade } from '../../theme/functions/fns/primary-shade';
|
|
5
6
|
import { BoxView } from '../BoxView';
|
|
6
7
|
import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
7
8
|
|
|
@@ -23,11 +24,12 @@ export const Code = forwardRef<any, CodeProps>((props, ref) => {
|
|
|
23
24
|
const { children, color, block = false, style, withTextWrapper: shouldWrapInText = true, ...others} = props;
|
|
24
25
|
|
|
25
26
|
const theme = useTheme();
|
|
27
|
+
const primaryShade = getPrimaryShade(theme);
|
|
26
28
|
|
|
27
29
|
// Get background and text colors
|
|
28
30
|
const backgroundColor = theme.colors.gray?.[0] || '#F6F6F6';
|
|
29
31
|
const textColor = color
|
|
30
|
-
? theme.colors[color]?.[
|
|
32
|
+
? theme.colors[color]?.[primaryShade] || color
|
|
31
33
|
: theme.light.text;
|
|
32
34
|
|
|
33
35
|
// Monospace font - in React Native, we can use 'Courier' or 'Courier New'
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleSheet, type ViewStyle } from 'react-native';
|
|
3
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
|
+
import type { MantineGradient, GradientConfig } from '../../theme/theme.d';
|
|
5
|
+
import { useTheme } from '../../theme/theme-provider';
|
|
6
|
+
|
|
7
|
+
export interface GradientProps {
|
|
8
|
+
/** Gradient configuration with from/to colors and optional degrees */
|
|
9
|
+
gradient?: MantineGradient;
|
|
10
|
+
/** Children to render inside gradient */
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/** Additional styles */
|
|
13
|
+
style?: ViewStyle;
|
|
14
|
+
/** Whether to render as full width/height */
|
|
15
|
+
fill?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Gradient component wrapper for expo-linear-gradient
|
|
20
|
+
* Provides seamless integration with Mantine theme system
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <Gradient gradient={{ from: 'blue', to: 'cyan', deg: 45 }}>
|
|
24
|
+
* <Text>Gradient Background</Text>
|
|
25
|
+
* </Gradient>
|
|
26
|
+
*/
|
|
27
|
+
export function Gradient({ gradient, children, style, fill = true }: GradientProps) {
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
|
|
30
|
+
// Get gradient configuration from theme
|
|
31
|
+
const config: GradientConfig = theme.fn.gradient(gradient);
|
|
32
|
+
|
|
33
|
+
const containerStyle: ViewStyle = {
|
|
34
|
+
...(fill && styles.fill),
|
|
35
|
+
...style,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<LinearGradient
|
|
40
|
+
colors={config.colors}
|
|
41
|
+
start={config.start}
|
|
42
|
+
end={config.end}
|
|
43
|
+
style={containerStyle}
|
|
44
|
+
>
|
|
45
|
+
{children}
|
|
46
|
+
</LinearGradient>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Fallback component when expo-linear-gradient is not available
|
|
52
|
+
* Renders a solid background using the 'from' color
|
|
53
|
+
*/
|
|
54
|
+
export function GradientFallback({ gradient, children, style }: GradientProps) {
|
|
55
|
+
const theme = useTheme();
|
|
56
|
+
const config: GradientConfig = theme.fn.gradient(gradient);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<View style={[{ backgroundColor: config.colors[0] }, style]}>
|
|
60
|
+
{children}
|
|
61
|
+
</View>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const styles = StyleSheet.create({
|
|
66
|
+
fill: {
|
|
67
|
+
flex: 1,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
Gradient.displayName = 'Gradient';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, useEffect, useRef } from 'react';
|
|
1
|
+
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Modal as RNModal,
|
|
4
4
|
TouchableOpacity,
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
KeyboardAvoidingView,
|
|
7
7
|
Platform,
|
|
8
8
|
ScrollView,
|
|
9
|
+
Dimensions,
|
|
10
|
+
type LayoutChangeEvent,
|
|
9
11
|
} from 'react-native';
|
|
10
12
|
import { BoxView } from '../BoxView';
|
|
11
13
|
import { Text } from '../Text';
|
|
@@ -159,6 +161,9 @@ const useStyles = createStyles(
|
|
|
159
161
|
body: {
|
|
160
162
|
padding: getPadding(),
|
|
161
163
|
},
|
|
164
|
+
scrollView: {
|
|
165
|
+
flexGrow: 0,
|
|
166
|
+
},
|
|
162
167
|
};
|
|
163
168
|
}
|
|
164
169
|
) as any;
|
|
@@ -208,6 +213,22 @@ export const Modal = forwardRef<any, ModalProps>((props, ref) => {
|
|
|
208
213
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
209
214
|
const scaleAnim = useRef(new Animated.Value(0.9)).current;
|
|
210
215
|
|
|
216
|
+
// State for managing scroll behavior
|
|
217
|
+
const [contentHeight, setContentHeight] = useState(0);
|
|
218
|
+
|
|
219
|
+
// Calculate max height: min(300px, 50% of screen height)
|
|
220
|
+
const screenHeight = Dimensions.get('window').height;
|
|
221
|
+
const maxHeight = Math.min(300, screenHeight * 0.5);
|
|
222
|
+
|
|
223
|
+
// Only enable scrolling when content exceeds max height
|
|
224
|
+
const shouldEnableScroll = contentHeight > maxHeight;
|
|
225
|
+
|
|
226
|
+
// Handle content layout changes
|
|
227
|
+
const handleContentLayout = (event: LayoutChangeEvent) => {
|
|
228
|
+
const { height } = event.nativeEvent.layout;
|
|
229
|
+
setContentHeight(height);
|
|
230
|
+
};
|
|
231
|
+
|
|
211
232
|
useEffect(() => {
|
|
212
233
|
if (opened) {
|
|
213
234
|
Animated.parallel([
|
|
@@ -299,8 +320,17 @@ export const Modal = forwardRef<any, ModalProps>((props, ref) => {
|
|
|
299
320
|
</BoxView>
|
|
300
321
|
)}
|
|
301
322
|
|
|
302
|
-
<ScrollView
|
|
303
|
-
{
|
|
323
|
+
<ScrollView
|
|
324
|
+
style={[
|
|
325
|
+
styles.body,
|
|
326
|
+
styles.scrollView,
|
|
327
|
+
!fullScreen && { maxHeight },
|
|
328
|
+
]}
|
|
329
|
+
contentContainerStyle={{ flexGrow: 0 }}
|
|
330
|
+
showsVerticalScrollIndicator={shouldEnableScroll}
|
|
331
|
+
scrollEnabled={shouldEnableScroll || fullScreen}
|
|
332
|
+
>
|
|
333
|
+
<BoxView onLayout={handleContentLayout}>{children}</BoxView>
|
|
304
334
|
</ScrollView>
|
|
305
335
|
</Animated.View>
|
|
306
336
|
</TouchableOpacity>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
2
|
import { BoxView } from '../BoxView';
|
|
4
3
|
import type {
|
|
5
4
|
DefaultProps,
|
|
@@ -30,64 +29,6 @@ export interface PaperProps extends DefaultProps {
|
|
|
30
29
|
style?: any;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
const shadows = {
|
|
34
|
-
xs: {
|
|
35
|
-
ios: {
|
|
36
|
-
shadowColor: '#000',
|
|
37
|
-
shadowOffset: { width: 0, height: 1 },
|
|
38
|
-
shadowOpacity: 0.05,
|
|
39
|
-
shadowRadius: 1,
|
|
40
|
-
},
|
|
41
|
-
android: {
|
|
42
|
-
elevation: 1,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
sm: {
|
|
46
|
-
ios: {
|
|
47
|
-
shadowColor: '#000',
|
|
48
|
-
shadowOffset: { width: 0, height: 1 },
|
|
49
|
-
shadowOpacity: 0.1,
|
|
50
|
-
shadowRadius: 2,
|
|
51
|
-
},
|
|
52
|
-
android: {
|
|
53
|
-
elevation: 2,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
md: {
|
|
57
|
-
ios: {
|
|
58
|
-
shadowColor: '#000',
|
|
59
|
-
shadowOffset: { width: 0, height: 2 },
|
|
60
|
-
shadowOpacity: 0.15,
|
|
61
|
-
shadowRadius: 4,
|
|
62
|
-
},
|
|
63
|
-
android: {
|
|
64
|
-
elevation: 4,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
lg: {
|
|
68
|
-
ios: {
|
|
69
|
-
shadowColor: '#000',
|
|
70
|
-
shadowOffset: { width: 0, height: 4 },
|
|
71
|
-
shadowOpacity: 0.2,
|
|
72
|
-
shadowRadius: 8,
|
|
73
|
-
},
|
|
74
|
-
android: {
|
|
75
|
-
elevation: 8,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
xl: {
|
|
79
|
-
ios: {
|
|
80
|
-
shadowColor: '#000',
|
|
81
|
-
shadowOffset: { width: 0, height: 8 },
|
|
82
|
-
shadowOpacity: 0.25,
|
|
83
|
-
shadowRadius: 16,
|
|
84
|
-
},
|
|
85
|
-
android: {
|
|
86
|
-
elevation: 12,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
|
|
91
32
|
const useStyles = createStyles(
|
|
92
33
|
(
|
|
93
34
|
theme,
|
|
@@ -105,10 +46,7 @@ const useStyles = createStyles(
|
|
|
105
46
|
) => {
|
|
106
47
|
const getShadowStyles = () => {
|
|
107
48
|
if (!shadow) return {};
|
|
108
|
-
|
|
109
|
-
if (!shadowConfig) return {};
|
|
110
|
-
|
|
111
|
-
return Platform.OS === 'ios' ? shadowConfig.ios : shadowConfig.android;
|
|
49
|
+
return theme.fn.shadow(shadow);
|
|
112
50
|
};
|
|
113
51
|
|
|
114
52
|
const getPadding = () => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useTheme } from '../../theme/theme-provider';
|
|
2
|
-
import
|
|
2
|
+
import { getPrimaryShade } from '../../theme/functions/fns/primary-shade';
|
|
3
3
|
import { get } from 'lodash-es';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { Text as DefaultText } from 'react-native';
|
|
6
|
+
import type { MantineTheme } from '../../theme/default-theme';
|
|
6
7
|
|
|
7
8
|
export type TextProps = DefaultText['props'] & {
|
|
8
9
|
size?: string;
|
|
@@ -18,11 +19,11 @@ export type TextProps = DefaultText['props'] & {
|
|
|
18
19
|
|
|
19
20
|
const propToColor = (
|
|
20
21
|
color: string,
|
|
21
|
-
|
|
22
|
-
primaryShade: number
|
|
22
|
+
theme: MantineTheme
|
|
23
23
|
): string => {
|
|
24
|
+
const primaryShade = getPrimaryShade(theme);
|
|
24
25
|
const colorExistOnPalette = get(
|
|
25
|
-
colors,
|
|
26
|
+
theme.colors,
|
|
26
27
|
`${color}.${primaryShade}`,
|
|
27
28
|
''
|
|
28
29
|
) as string;
|
|
@@ -47,34 +48,45 @@ export const Text = forwardRef((props: TextProps, ref: any) => {
|
|
|
47
48
|
...otherProps
|
|
48
49
|
} = props;
|
|
49
50
|
|
|
51
|
+
const theme = useTheme();
|
|
50
52
|
const {
|
|
51
53
|
fontFamily,
|
|
52
54
|
fontFamilyBold,
|
|
53
55
|
fontFamilySemiBold,
|
|
54
|
-
|
|
55
|
-
primaryShade,
|
|
56
|
+
fontWeights,
|
|
56
57
|
fontSizes,
|
|
57
58
|
light,
|
|
58
|
-
} =
|
|
59
|
+
} = theme;
|
|
60
|
+
|
|
61
|
+
// Determine font family based on weight/style
|
|
62
|
+
// On iOS/Android, some fonts need explicit family names for different weights
|
|
63
|
+
const getFontFamily = () => {
|
|
64
|
+
if (questrial) return 'Questrial';
|
|
65
|
+
if (bold) return fontFamilyBold;
|
|
66
|
+
if (semiBold) return fontFamilySemiBold;
|
|
67
|
+
return fontFamily;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Still use fontWeight for platforms that support it well (like iOS with System font)
|
|
71
|
+
const getFontWeight = () => {
|
|
72
|
+
if (weight) return weight;
|
|
73
|
+
if (semiBold) return fontWeights.semibold;
|
|
74
|
+
if (bold) return fontWeights.bold;
|
|
75
|
+
return fontWeights.normal;
|
|
76
|
+
};
|
|
59
77
|
|
|
60
78
|
return (
|
|
61
79
|
<DefaultText
|
|
62
80
|
ref={ref}
|
|
63
81
|
style={[
|
|
64
82
|
{
|
|
65
|
-
fontFamily:
|
|
66
|
-
|
|
67
|
-
: bold
|
|
68
|
-
? fontFamilyBold
|
|
69
|
-
: questrial
|
|
70
|
-
? 'Questrial'
|
|
71
|
-
: fontFamily,
|
|
72
|
-
fontWeight: weight || (bold ? '900' : '300'),
|
|
83
|
+
fontFamily: getFontFamily(),
|
|
84
|
+
fontWeight: getFontWeight() as any,
|
|
73
85
|
fontSize: fontSize ? fontSize : get(fontSizes, size, 16),
|
|
74
86
|
color: white
|
|
75
87
|
? 'white'
|
|
76
88
|
: color
|
|
77
|
-
? propToColor(color,
|
|
89
|
+
? propToColor(color, theme)
|
|
78
90
|
: light.text,
|
|
79
91
|
...(align ? { textAlign: align } : {}),
|
|
80
92
|
},
|
|
@@ -12,6 +12,7 @@ import type { MantineGradient } from '../../theme/theme';
|
|
|
12
12
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
13
13
|
import { createStyles } from '../../theme';
|
|
14
14
|
import { getSize } from '../../theme';
|
|
15
|
+
import { getPrimaryShade } from '../../theme/functions/fns/primary-shade';
|
|
15
16
|
|
|
16
17
|
export interface ThemeIconProps extends DefaultProps {
|
|
17
18
|
/** Icon */
|
|
@@ -61,7 +62,7 @@ const useStyles = createStyles(
|
|
|
61
62
|
) => {
|
|
62
63
|
const iconSize = typeof size === 'number' ? size : getSize({ size, sizes }) as number;
|
|
63
64
|
const themeColor = theme?.colors && color in theme.colors ? color : theme.primaryColor;
|
|
64
|
-
const shade = theme
|
|
65
|
+
const shade = getPrimaryShade(theme);
|
|
65
66
|
|
|
66
67
|
const getVariantStyles = () => {
|
|
67
68
|
switch (variant) {
|
|
@@ -72,7 +73,7 @@ const useStyles = createStyles(
|
|
|
72
73
|
case 'light':
|
|
73
74
|
return {
|
|
74
75
|
backgroundColor:
|
|
75
|
-
theme.
|
|
76
|
+
theme.currentMode === 'dark'
|
|
76
77
|
? theme.colors[themeColor]?.[9]
|
|
77
78
|
: theme.colors[themeColor]?.[0],
|
|
78
79
|
};
|
|
@@ -131,13 +132,14 @@ export const ThemeIcon = forwardRef<any, ThemeIconProps>((props, ref) => {
|
|
|
131
132
|
) as any;
|
|
132
133
|
|
|
133
134
|
const getGradientColors = (): [string, string] => {
|
|
135
|
+
const shade = getPrimaryShade(theme);
|
|
134
136
|
const fromColor =
|
|
135
137
|
gradient?.from && theme?.colors && gradient.from in theme.colors
|
|
136
|
-
? theme.colors[gradient.from][
|
|
138
|
+
? theme.colors[gradient.from][shade]
|
|
137
139
|
: gradient?.from || theme.colors.blue?.[6] || '#228be6';
|
|
138
140
|
const toColor =
|
|
139
141
|
gradient?.to && theme?.colors && gradient.to in theme.colors
|
|
140
|
-
? theme.colors[gradient.to][
|
|
142
|
+
? theme.colors[gradient.to][shade]
|
|
141
143
|
: gradient?.to || theme.colors.cyan?.[6] || '#22b8cf';
|
|
142
144
|
return [fromColor, toColor];
|
|
143
145
|
};
|
|
@@ -24,11 +24,15 @@ export const Title = forwardRef<any, TitleProps>((props, ref) => {
|
|
|
24
24
|
const headingKey = `h${order}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
25
25
|
const headingStyles = theme.headings.sizes[headingKey];
|
|
26
26
|
|
|
27
|
-
// Determine fontWeight - use specific value or default to
|
|
27
|
+
// Determine fontWeight - use specific value or default to bold
|
|
28
28
|
const fontWeight =
|
|
29
29
|
headingStyles.fontWeight ??
|
|
30
30
|
theme.headings.fontWeight ??
|
|
31
|
-
|
|
31
|
+
theme.fontWeights.bold;
|
|
32
|
+
|
|
33
|
+
// Use fontFamilyBold for headings to ensure proper rendering on iOS/Android
|
|
34
|
+
// Headings are typically bold, so we use the bold font family
|
|
35
|
+
const fontFamily = theme.headings.fontFamily || theme.fontFamilyBold;
|
|
32
36
|
|
|
33
37
|
if (!shouldWrapInText) {
|
|
34
38
|
return children;
|
|
@@ -44,7 +48,7 @@ export const Title = forwardRef<any, TitleProps>((props, ref) => {
|
|
|
44
48
|
? headingStyles.fontSize * headingStyles.lineHeight
|
|
45
49
|
: headingStyles.fontSize * 1.3,
|
|
46
50
|
fontWeight: fontWeight as any,
|
|
47
|
-
fontFamily:
|
|
51
|
+
fontFamily: fontFamily,
|
|
48
52
|
},
|
|
49
53
|
style,
|
|
50
54
|
]}
|
package/src/components/index.tsx
CHANGED
|
@@ -2,16 +2,14 @@ import { DEFAULT_COLORS, DEFAULT_THEME } from './default-theme';
|
|
|
2
2
|
import type { MantineTheme } from './default-theme';
|
|
3
3
|
|
|
4
4
|
export const createTheme = (theme?: Partial<MantineTheme>): MantineTheme => {
|
|
5
|
-
const { primaryShade
|
|
5
|
+
const { primaryShade, other = {}, components = {} } = theme || {};
|
|
6
6
|
return {
|
|
7
7
|
...DEFAULT_THEME,
|
|
8
|
-
primaryShade
|
|
8
|
+
// Use provided primaryShade or fall back to DEFAULT_THEME's value
|
|
9
|
+
primaryShade: primaryShade !== undefined ? primaryShade : DEFAULT_THEME.primaryShade,
|
|
9
10
|
other: other,
|
|
10
11
|
components: components,
|
|
11
12
|
fontFamily: 'Nunito',
|
|
12
|
-
fontFamilyBold: 'Nunito Bold',
|
|
13
|
-
fontFamilySemiBold: 'Nunito SemiBold',
|
|
14
|
-
fontFamilyInput: 'Nunito',
|
|
15
13
|
primaryColor: 'blue',
|
|
16
14
|
secondaryColor: 'cyan',
|
|
17
15
|
headings: {
|