react-native-mantine 0.1.11
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/LICENSE +20 -0
- package/README.md +28 -0
- package/lib/commonjs/components/ActionIcon/ActionIcon.js +71 -0
- package/lib/commonjs/components/ActionIcon/ActionIcon.js.map +1 -0
- package/lib/commonjs/components/ActionIcon/index.js +13 -0
- package/lib/commonjs/components/ActionIcon/index.js.map +1 -0
- package/lib/commonjs/components/BoxView/index.js +30 -0
- package/lib/commonjs/components/BoxView/index.js.map +1 -0
- package/lib/commonjs/components/Group/index.js +33 -0
- package/lib/commonjs/components/Group/index.js.map +1 -0
- package/lib/commonjs/components/Loader/Loader.js +42 -0
- package/lib/commonjs/components/Loader/Loader.js.map +1 -0
- package/lib/commonjs/components/Loader/index.js +13 -0
- package/lib/commonjs/components/Loader/index.js.map +1 -0
- package/lib/commonjs/components/Stack/index.js +30 -0
- package/lib/commonjs/components/Stack/index.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +51 -0
- package/lib/commonjs/components/Text/index.js.map +1 -0
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.js +42 -0
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.js.map +1 -0
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.styles.js +24 -0
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.styles.js.map +1 -0
- package/lib/commonjs/components/UnstyledButton/index.js +13 -0
- package/lib/commonjs/components/UnstyledButton/index.js.map +1 -0
- package/lib/commonjs/components/index.js +72 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/fonts/Nunito-Bold.ttf +0 -0
- package/lib/commonjs/fonts/Nunito-Regular.ttf +0 -0
- package/lib/commonjs/fonts/Nunito-SemiBold.ttf +0 -0
- package/lib/commonjs/hooks/useCachedResources.js +36 -0
- package/lib/commonjs/hooks/useCachedResources.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/theme/constants.js +25 -0
- package/lib/commonjs/theme/constants.js.map +1 -0
- package/lib/commonjs/theme/create-styles.js +25 -0
- package/lib/commonjs/theme/create-styles.js.map +1 -0
- package/lib/commonjs/theme/default-theme.js +132 -0
- package/lib/commonjs/theme/default-theme.js.map +1 -0
- package/lib/commonjs/theme/filter-props.js +15 -0
- package/lib/commonjs/theme/filter-props.js.map +1 -0
- package/lib/commonjs/theme/functions/attach-functions.js +18 -0
- package/lib/commonjs/theme/functions/attach-functions.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/index.js +15 -0
- package/lib/commonjs/theme/functions/fns/index.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/radius.js +16 -0
- package/lib/commonjs/theme/functions/fns/radius.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js +12 -0
- package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/variant.js +11 -0
- package/lib/commonjs/theme/functions/fns/variant.js.map +1 -0
- package/lib/commonjs/theme/generate-theme.js +30 -0
- package/lib/commonjs/theme/generate-theme.js.map +1 -0
- package/lib/commonjs/theme/get-size/index.js +16 -0
- package/lib/commonjs/theme/get-size/index.js.map +1 -0
- package/lib/commonjs/theme/index.js +46 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/theme-provider.js +106 -0
- package/lib/commonjs/theme/theme-provider.js.map +1 -0
- package/lib/commonjs/theme/theme.d.js +2 -0
- package/lib/commonjs/theme/theme.d.js.map +1 -0
- package/lib/commonjs/theme/types/ColorScheme.js +2 -0
- package/lib/commonjs/theme/types/ColorScheme.js.map +1 -0
- package/lib/commonjs/theme/types/DefaultProps.js +2 -0
- package/lib/commonjs/theme/types/DefaultProps.js.map +1 -0
- package/lib/commonjs/theme/types/MantineColor.js +6 -0
- package/lib/commonjs/theme/types/MantineColor.js.map +1 -0
- package/lib/commonjs/theme/types/MantineSize.js +2 -0
- package/lib/commonjs/theme/types/MantineSize.js.map +1 -0
- package/lib/commonjs/theme/types/MantineStyleSystem.js +6 -0
- package/lib/commonjs/theme/types/MantineStyleSystem.js.map +1 -0
- package/lib/commonjs/theme/types/Tuple.js +2 -0
- package/lib/commonjs/theme/types/Tuple.js.map +1 -0
- package/lib/commonjs/theme/types/Variants.js +2 -0
- package/lib/commonjs/theme/types/Variants.js.map +1 -0
- package/lib/commonjs/theme/types/index.js +2 -0
- package/lib/commonjs/theme/types/index.js.map +1 -0
- package/lib/module/components/ActionIcon/ActionIcon.js +66 -0
- package/lib/module/components/ActionIcon/ActionIcon.js.map +1 -0
- package/lib/module/components/ActionIcon/index.js +4 -0
- package/lib/module/components/ActionIcon/index.js.map +1 -0
- package/lib/module/components/BoxView/index.js +26 -0
- package/lib/module/components/BoxView/index.js.map +1 -0
- package/lib/module/components/Group/index.js +28 -0
- package/lib/module/components/Group/index.js.map +1 -0
- package/lib/module/components/Loader/Loader.js +38 -0
- package/lib/module/components/Loader/Loader.js.map +1 -0
- package/lib/module/components/Loader/index.js +4 -0
- package/lib/module/components/Loader/index.js.map +1 -0
- package/lib/module/components/Stack/index.js +25 -0
- package/lib/module/components/Stack/index.js.map +1 -0
- package/lib/module/components/Text/index.js +47 -0
- package/lib/module/components/Text/index.js.map +1 -0
- package/lib/module/components/UnstyledButton/UnstyledButton.js +35 -0
- package/lib/module/components/UnstyledButton/UnstyledButton.js.map +1 -0
- package/lib/module/components/UnstyledButton/UnstyledButton.styles.js +20 -0
- package/lib/module/components/UnstyledButton/UnstyledButton.styles.js.map +1 -0
- package/lib/module/components/UnstyledButton/index.js +4 -0
- package/lib/module/components/UnstyledButton/index.js.map +1 -0
- package/lib/module/components/index.js +9 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/fonts/Nunito-Bold.ttf +0 -0
- package/lib/module/fonts/Nunito-Regular.ttf +0 -0
- package/lib/module/fonts/Nunito-SemiBold.ttf +0 -0
- package/lib/module/hooks/useCachedResources.js +30 -0
- package/lib/module/hooks/useCachedResources.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/theme/constants.js +21 -0
- package/lib/module/theme/constants.js.map +1 -0
- package/lib/module/theme/create-styles.js +21 -0
- package/lib/module/theme/create-styles.js.map +1 -0
- package/lib/module/theme/default-theme.js +128 -0
- package/lib/module/theme/default-theme.js.map +1 -0
- package/lib/module/theme/filter-props.js +11 -0
- package/lib/module/theme/filter-props.js.map +1 -0
- package/lib/module/theme/functions/attach-functions.js +14 -0
- package/lib/module/theme/functions/attach-functions.js.map +1 -0
- package/lib/module/theme/functions/fns/index.js +11 -0
- package/lib/module/theme/functions/fns/index.js.map +1 -0
- package/lib/module/theme/functions/fns/radius.js +12 -0
- package/lib/module/theme/functions/fns/radius.js.map +1 -0
- package/lib/module/theme/functions/fns/theme-color/theme-color.js +8 -0
- package/lib/module/theme/functions/fns/theme-color/theme-color.js.map +1 -0
- package/lib/module/theme/functions/fns/variant.js +6 -0
- package/lib/module/theme/functions/fns/variant.js.map +1 -0
- package/lib/module/theme/generate-theme.js +25 -0
- package/lib/module/theme/generate-theme.js.map +1 -0
- package/lib/module/theme/get-size/index.js +12 -0
- package/lib/module/theme/get-size/index.js.map +1 -0
- package/lib/module/theme/index.js +7 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/theme-provider.js +94 -0
- package/lib/module/theme/theme-provider.js.map +1 -0
- package/lib/module/theme/theme.d.js +2 -0
- package/lib/module/theme/theme.d.js.map +1 -0
- package/lib/module/theme/types/ColorScheme.js +2 -0
- package/lib/module/theme/types/ColorScheme.js.map +1 -0
- package/lib/module/theme/types/DefaultProps.js +2 -0
- package/lib/module/theme/types/DefaultProps.js.map +1 -0
- package/lib/module/theme/types/MantineColor.js +4 -0
- package/lib/module/theme/types/MantineColor.js.map +1 -0
- package/lib/module/theme/types/MantineSize.js +2 -0
- package/lib/module/theme/types/MantineSize.js.map +1 -0
- package/lib/module/theme/types/MantineStyleSystem.js +4 -0
- package/lib/module/theme/types/MantineStyleSystem.js.map +1 -0
- package/lib/module/theme/types/Tuple.js +2 -0
- package/lib/module/theme/types/Tuple.js.map +1 -0
- package/lib/module/theme/types/Variants.js +2 -0
- package/lib/module/theme/types/Variants.js.map +1 -0
- package/lib/module/theme/types/index.js +2 -0
- package/lib/module/theme/types/index.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/components/ActionIcon/ActionIcon.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/ActionIcon/ActionIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/ActionIcon/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/ActionIcon/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/BoxView/index.d.ts +17 -0
- package/lib/typescript/commonjs/src/components/BoxView/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Group/index.d.ts +9 -0
- package/lib/typescript/commonjs/src/components/Group/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Loader/Loader.d.ts +14 -0
- package/lib/typescript/commonjs/src/components/Loader/Loader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Loader/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/Loader/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Stack/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/Stack/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Text/index.d.ts +20 -0
- package/lib/typescript/commonjs/src/components/Text/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts +10 -0
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts +9 -0
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/UnstyledButton/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/UnstyledButton/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/index.d.ts +7 -0
- package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useCachedResources.d.ts +2 -0
- package/lib/typescript/commonjs/src/hooks/useCachedResources.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/constants.d.ts +13 -0
- package/lib/typescript/commonjs/src/theme/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/create-styles.d.ts +12 -0
- package/lib/typescript/commonjs/src/theme/create-styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/default-theme.d.ts +58 -0
- package/lib/typescript/commonjs/src/theme/default-theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/filter-props.d.ts +6 -0
- package/lib/typescript/commonjs/src/theme/filter-props.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts +2 -0
- package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/radius.d.ts +3 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/radius.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts +2 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts +2 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/generate-theme.d.ts +3 -0
- package/lib/typescript/commonjs/src/theme/generate-theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/get-size/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/theme/get-size/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/theme-provider.d.ts +21 -0
- package/lib/typescript/commonjs/src/theme/theme-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/types/ColorScheme.d.ts +2 -0
- package/lib/typescript/commonjs/src/theme/types/ColorScheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/types/DefaultProps.d.ts +8 -0
- package/lib/typescript/commonjs/src/theme/types/DefaultProps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/types/MantineColor.d.ts +8 -0
- package/lib/typescript/commonjs/src/theme/types/MantineColor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/types/MantineSize.d.ts +4 -0
- package/lib/typescript/commonjs/src/theme/types/MantineSize.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/types/MantineStyleSystem.d.ts +5 -0
- package/lib/typescript/commonjs/src/theme/types/MantineStyleSystem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/types/Tuple.d.ts +4 -0
- package/lib/typescript/commonjs/src/theme/types/Tuple.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/types/Variants.d.ts +2 -0
- package/lib/typescript/commonjs/src/theme/types/Variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/types/index.d.ts +8 -0
- package/lib/typescript/commonjs/src/theme/types/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/components/ActionIcon/ActionIcon.d.ts +17 -0
- package/lib/typescript/module/src/components/ActionIcon/ActionIcon.d.ts.map +1 -0
- package/lib/typescript/module/src/components/ActionIcon/index.d.ts +3 -0
- package/lib/typescript/module/src/components/ActionIcon/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/BoxView/index.d.ts +17 -0
- package/lib/typescript/module/src/components/BoxView/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Group/index.d.ts +9 -0
- package/lib/typescript/module/src/components/Group/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Loader/Loader.d.ts +14 -0
- package/lib/typescript/module/src/components/Loader/Loader.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Loader/index.d.ts +3 -0
- package/lib/typescript/module/src/components/Loader/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Stack/index.d.ts +6 -0
- package/lib/typescript/module/src/components/Stack/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Text/index.d.ts +20 -0
- package/lib/typescript/module/src/components/Text/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts +10 -0
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -0
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts +9 -0
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -0
- package/lib/typescript/module/src/components/UnstyledButton/index.d.ts +3 -0
- package/lib/typescript/module/src/components/UnstyledButton/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/index.d.ts +7 -0
- package/lib/typescript/module/src/components/index.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useCachedResources.d.ts +2 -0
- package/lib/typescript/module/src/hooks/useCachedResources.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +5 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/constants.d.ts +13 -0
- package/lib/typescript/module/src/theme/constants.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/create-styles.d.ts +12 -0
- package/lib/typescript/module/src/theme/create-styles.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/default-theme.d.ts +58 -0
- package/lib/typescript/module/src/theme/default-theme.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/filter-props.d.ts +6 -0
- package/lib/typescript/module/src/theme/filter-props.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/attach-functions.d.ts +2 -0
- package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/index.d.ts +8 -0
- package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/radius.d.ts +3 -0
- package/lib/typescript/module/src/theme/functions/fns/radius.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts +2 -0
- package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/variant.d.ts +2 -0
- package/lib/typescript/module/src/theme/functions/fns/variant.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/generate-theme.d.ts +3 -0
- package/lib/typescript/module/src/theme/generate-theme.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/get-size/index.d.ts +6 -0
- package/lib/typescript/module/src/theme/get-size/index.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/index.d.ts +5 -0
- package/lib/typescript/module/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/theme-provider.d.ts +21 -0
- package/lib/typescript/module/src/theme/theme-provider.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/types/ColorScheme.d.ts +2 -0
- package/lib/typescript/module/src/theme/types/ColorScheme.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/types/DefaultProps.d.ts +8 -0
- package/lib/typescript/module/src/theme/types/DefaultProps.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/types/MantineColor.d.ts +8 -0
- package/lib/typescript/module/src/theme/types/MantineColor.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/types/MantineSize.d.ts +4 -0
- package/lib/typescript/module/src/theme/types/MantineSize.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/types/MantineStyleSystem.d.ts +5 -0
- package/lib/typescript/module/src/theme/types/MantineStyleSystem.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/types/Tuple.d.ts +4 -0
- package/lib/typescript/module/src/theme/types/Tuple.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/types/Variants.d.ts +2 -0
- package/lib/typescript/module/src/theme/types/Variants.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/types/index.d.ts +8 -0
- package/lib/typescript/module/src/theme/types/index.d.ts.map +1 -0
- package/package.json +194 -0
- package/src/components/ActionIcon/ActionIcon.tsx +64 -0
- package/src/components/ActionIcon/index.ts +3 -0
- package/src/components/BoxView/index.tsx +30 -0
- package/src/components/Group/index.tsx +48 -0
- package/src/components/Loader/Loader.tsx +50 -0
- package/src/components/Loader/index.ts +2 -0
- package/src/components/Stack/index.tsx +29 -0
- package/src/components/Text/index.tsx +81 -0
- package/src/components/UnstyledButton/UnstyledButton.styles.ts +16 -0
- package/src/components/UnstyledButton/UnstyledButton.tsx +34 -0
- package/src/components/UnstyledButton/index.ts +2 -0
- package/src/components/index.tsx +6 -0
- package/src/fonts/Nunito-Bold.ttf +0 -0
- package/src/fonts/Nunito-Regular.ttf +0 -0
- package/src/fonts/Nunito-SemiBold.ttf +0 -0
- package/src/hooks/useCachedResources.ts +30 -0
- package/src/index.tsx +4 -0
- package/src/theme/constants.ts +20 -0
- package/src/theme/create-styles.ts +31 -0
- package/src/theme/default-theme.ts +359 -0
- package/src/theme/filter-props.ts +12 -0
- package/src/theme/functions/attach-functions.ts +12 -0
- package/src/theme/functions/fns/index.ts +9 -0
- package/src/theme/functions/fns/radius.ts +16 -0
- package/src/theme/functions/fns/theme-color/theme-color.ts +6 -0
- package/src/theme/functions/fns/variant.ts +3 -0
- package/src/theme/generate-theme.ts +20 -0
- package/src/theme/get-size/index.ts +18 -0
- package/src/theme/index.tsx +4 -0
- package/src/theme/theme-provider.tsx +131 -0
- package/src/theme/theme.d.ts +13 -0
- package/src/theme/types/ColorScheme.ts +1 -0
- package/src/theme/types/DefaultProps.ts +13 -0
- package/src/theme/types/MantineColor.ts +28 -0
- package/src/theme/types/MantineSize.ts +3 -0
- package/src/theme/types/MantineStyleSystem.ts +62 -0
- package/src/theme/types/Tuple.ts +9 -0
- package/src/theme/types/Variants.ts +1 -0
- package/src/theme/types/index.ts +12 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useTheme } from '../../theme/theme-provider';
|
|
2
|
+
import type { Palette } from '../../theme/theme';
|
|
3
|
+
import { get } from 'lodash-es';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { Text as DefaultText } from 'react-native';
|
|
6
|
+
|
|
7
|
+
export type TextProps = DefaultText['props'] & {
|
|
8
|
+
size?: string;
|
|
9
|
+
bold?: boolean;
|
|
10
|
+
questrial?: boolean;
|
|
11
|
+
semiBold?: boolean;
|
|
12
|
+
fontSize?: number;
|
|
13
|
+
color?: string;
|
|
14
|
+
white?: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const propToColor = (
|
|
18
|
+
color: string,
|
|
19
|
+
colors: { [key: string]: Palette },
|
|
20
|
+
primaryShade: number
|
|
21
|
+
): string => {
|
|
22
|
+
const colorExistOnPalette = get(
|
|
23
|
+
colors,
|
|
24
|
+
`${color}.${primaryShade}`,
|
|
25
|
+
''
|
|
26
|
+
) as string;
|
|
27
|
+
if (colorExistOnPalette) {
|
|
28
|
+
return colorExistOnPalette;
|
|
29
|
+
}
|
|
30
|
+
return color;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Text = forwardRef((props: TextProps, ref: any) => {
|
|
34
|
+
const {
|
|
35
|
+
style,
|
|
36
|
+
color,
|
|
37
|
+
white,
|
|
38
|
+
size = 'md',
|
|
39
|
+
bold = false,
|
|
40
|
+
questrial = false,
|
|
41
|
+
semiBold = false,
|
|
42
|
+
fontSize,
|
|
43
|
+
...otherProps
|
|
44
|
+
} = props;
|
|
45
|
+
|
|
46
|
+
const {
|
|
47
|
+
fontFamily,
|
|
48
|
+
fontFamilyBold,
|
|
49
|
+
fontFamilySemiBold,
|
|
50
|
+
colors,
|
|
51
|
+
primaryShade,
|
|
52
|
+
fontSizes,
|
|
53
|
+
light,
|
|
54
|
+
} = useTheme();
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<DefaultText
|
|
58
|
+
ref={ref}
|
|
59
|
+
style={[
|
|
60
|
+
{
|
|
61
|
+
fontFamily: semiBold
|
|
62
|
+
? fontFamilySemiBold
|
|
63
|
+
: bold
|
|
64
|
+
? fontFamilyBold
|
|
65
|
+
: questrial
|
|
66
|
+
? 'Questrial'
|
|
67
|
+
: fontFamily,
|
|
68
|
+
fontWeight: bold ? '900' : '300',
|
|
69
|
+
fontSize: fontSize ? fontSize : get(fontSizes, size, 16),
|
|
70
|
+
color: white
|
|
71
|
+
? 'white'
|
|
72
|
+
: color
|
|
73
|
+
? propToColor(color, colors, primaryShade)
|
|
74
|
+
: light.text,
|
|
75
|
+
},
|
|
76
|
+
style,
|
|
77
|
+
]}
|
|
78
|
+
{...otherProps}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createStyles } from "../../theme";
|
|
2
|
+
|
|
3
|
+
export default createStyles((theme, {variant} ) => ({
|
|
4
|
+
root: {
|
|
5
|
+
cursor: 'pointer',
|
|
6
|
+
border: 0,
|
|
7
|
+
padding: 0,
|
|
8
|
+
appearance: 'none',
|
|
9
|
+
fontSize: theme.fontSizes.md,
|
|
10
|
+
textAlign: 'left',
|
|
11
|
+
color: theme.light.text,
|
|
12
|
+
textDecoration: 'none',
|
|
13
|
+
boxSizing: 'border-box',
|
|
14
|
+
backgroundColor: variant === 'transparent' ? 'transparent' : theme.light.background,
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { BoxView } from '../BoxView';
|
|
3
|
+
import useStyles from './UnstyledButton.styles';
|
|
4
|
+
import { TouchableOpacity } from 'react-native';
|
|
5
|
+
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
6
|
+
import { Text } from '../Text';
|
|
7
|
+
|
|
8
|
+
export interface UnstyledButtonProps {
|
|
9
|
+
variant?: string;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
onPress?: (payload: any) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const UnstyledButton = forwardRef<
|
|
15
|
+
any,
|
|
16
|
+
UnstyledButtonProps & { style?: any }
|
|
17
|
+
>((props, ref) => {
|
|
18
|
+
const { variant, style, children, onPress, ...others } =
|
|
19
|
+
useComponentDefaultProps('UnstyledButton', {}, props);
|
|
20
|
+
|
|
21
|
+
const { styles } = useStyles({
|
|
22
|
+
variant,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<TouchableOpacity
|
|
27
|
+
onPress={typeof onPress === 'function' ? onPress : () => {}}
|
|
28
|
+
>
|
|
29
|
+
<BoxView ref={ref} style={[styles.root, style]} {...others}>
|
|
30
|
+
<Text>{children}</Text>
|
|
31
|
+
</BoxView>
|
|
32
|
+
</TouchableOpacity>
|
|
33
|
+
);
|
|
34
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as Font from 'expo-font'
|
|
2
|
+
import { useEffect, useState } from 'react'
|
|
3
|
+
|
|
4
|
+
export default function useCachedResources(): boolean {
|
|
5
|
+
const [isLoadingComplete, setLoadingComplete] = useState(false)
|
|
6
|
+
|
|
7
|
+
// Load any resources or data that we need prior to rendering the app
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
async function loadResourcesAndDataAsync(): Promise<void> {
|
|
10
|
+
try {
|
|
11
|
+
// SplashScreen.preventAutoHideAsync()
|
|
12
|
+
// Load fonts
|
|
13
|
+
await Font.loadAsync({
|
|
14
|
+
Nunito: require('../fonts/Nunito-Regular.ttf'),
|
|
15
|
+
'Nunito Bold': require('../fonts/Nunito-Bold.ttf'),
|
|
16
|
+
'Nunito SemiBold': require('../fonts/Nunito-SemiBold.ttf'),
|
|
17
|
+
})
|
|
18
|
+
} catch (e) {
|
|
19
|
+
// We might want to provide this error information to an error reporting service
|
|
20
|
+
// console.warn(e)
|
|
21
|
+
} finally {
|
|
22
|
+
setLoadingComplete(true)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
loadResourcesAndDataAsync()
|
|
27
|
+
}, [])
|
|
28
|
+
|
|
29
|
+
return isLoadingComplete
|
|
30
|
+
}
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Dimensions } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const width = Dimensions.get('window').width;
|
|
4
|
+
const height = Dimensions.get('window').height;
|
|
5
|
+
const deviceWidth = Dimensions.get('screen').width;
|
|
6
|
+
const deviceHeight = Dimensions.get('screen').height;
|
|
7
|
+
const bottomNavBarHeight = deviceHeight - height;
|
|
8
|
+
|
|
9
|
+
export const Layout = {
|
|
10
|
+
window: {
|
|
11
|
+
width,
|
|
12
|
+
height,
|
|
13
|
+
},
|
|
14
|
+
screen: {
|
|
15
|
+
width: deviceWidth,
|
|
16
|
+
height: deviceHeight,
|
|
17
|
+
},
|
|
18
|
+
bottomNavBarHeight: bottomNavBarHeight ? bottomNavBarHeight : 0,
|
|
19
|
+
isSmallDevice: width <= 375,
|
|
20
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { useTheme } from './theme-provider';
|
|
6
|
+
|
|
7
|
+
import type { TTheme } from './default-theme';
|
|
8
|
+
|
|
9
|
+
type NamedStyles<T> = {
|
|
10
|
+
[P in keyof T]: ViewStyle | TextStyle | ImageStyle;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function createStyles<T = any>(
|
|
14
|
+
input: (theme: TTheme, params: any) => NamedStyles<T>
|
|
15
|
+
) {
|
|
16
|
+
const getStyleObject = typeof input === 'function' ? input : () => input;
|
|
17
|
+
function useStyles(params?: any) {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const styleObject = getStyleObject(theme, params);
|
|
20
|
+
const sx = (...args: any) => {
|
|
21
|
+
return args;
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
styles: StyleSheet.create(styleObject),
|
|
25
|
+
theme,
|
|
26
|
+
sx,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return useStyles;
|
|
31
|
+
}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { attachFunctions } from './functions/attach-functions';
|
|
2
|
+
import type { Palette } from './theme';
|
|
3
|
+
|
|
4
|
+
export const DEFAULT_COLORS: {
|
|
5
|
+
[key: string]: Palette;
|
|
6
|
+
} = {
|
|
7
|
+
dark: [
|
|
8
|
+
'#2E2E2E',
|
|
9
|
+
'#2A2A2A',
|
|
10
|
+
'#262626',
|
|
11
|
+
'#232323',
|
|
12
|
+
'#1F1F1F',
|
|
13
|
+
'#1D1D1D',
|
|
14
|
+
'#1A1A1A',
|
|
15
|
+
'#171717',
|
|
16
|
+
'#151515',
|
|
17
|
+
'#131313',
|
|
18
|
+
],
|
|
19
|
+
|
|
20
|
+
gray: [
|
|
21
|
+
'#F6F6F6',
|
|
22
|
+
'#E0E0E0',
|
|
23
|
+
'#CCCCCC',
|
|
24
|
+
'#B9B9B9',
|
|
25
|
+
'#A8A8A8',
|
|
26
|
+
'#999999',
|
|
27
|
+
'#8A8A8A',
|
|
28
|
+
'#7C7C7C',
|
|
29
|
+
'#707070',
|
|
30
|
+
'#646464',
|
|
31
|
+
],
|
|
32
|
+
gray2: [
|
|
33
|
+
'#A3A3A3',
|
|
34
|
+
'#949494',
|
|
35
|
+
'#878787',
|
|
36
|
+
'#7A7A7A',
|
|
37
|
+
'#6F6F6F',
|
|
38
|
+
'#656565',
|
|
39
|
+
'#5C5C5C',
|
|
40
|
+
'#535353',
|
|
41
|
+
'#4B4B4B',
|
|
42
|
+
'#434343',
|
|
43
|
+
],
|
|
44
|
+
|
|
45
|
+
red: [
|
|
46
|
+
'#ffeaea',
|
|
47
|
+
'#fcd4d4',
|
|
48
|
+
'#f3a8a8',
|
|
49
|
+
'#eb7877',
|
|
50
|
+
'#e4504f',
|
|
51
|
+
'#e13735',
|
|
52
|
+
'#e02928',
|
|
53
|
+
'#c71c1c',
|
|
54
|
+
'#b21518',
|
|
55
|
+
'#9c0711',
|
|
56
|
+
],
|
|
57
|
+
|
|
58
|
+
pink: [
|
|
59
|
+
'#fff0f6',
|
|
60
|
+
'#ffdeeb',
|
|
61
|
+
'#fcc2d7',
|
|
62
|
+
'#faa2c1',
|
|
63
|
+
'#f783ac',
|
|
64
|
+
'#f06595',
|
|
65
|
+
'#e64980',
|
|
66
|
+
'#d6336c',
|
|
67
|
+
'#c2255c',
|
|
68
|
+
'#a61e4d',
|
|
69
|
+
],
|
|
70
|
+
|
|
71
|
+
grape: [
|
|
72
|
+
'#f8f0fc',
|
|
73
|
+
'#f3d9fa',
|
|
74
|
+
'#eebefa',
|
|
75
|
+
'#e599f7',
|
|
76
|
+
'#da77f2',
|
|
77
|
+
'#cc5de8',
|
|
78
|
+
'#be4bdb',
|
|
79
|
+
'#ae3ec9',
|
|
80
|
+
'#9c36b5',
|
|
81
|
+
'#862e9c',
|
|
82
|
+
],
|
|
83
|
+
|
|
84
|
+
violet: [
|
|
85
|
+
'#f3f0ff',
|
|
86
|
+
'#e5dbff',
|
|
87
|
+
'#d0bfff',
|
|
88
|
+
'#b197fc',
|
|
89
|
+
'#9775fa',
|
|
90
|
+
'#845ef7',
|
|
91
|
+
'#7950f2',
|
|
92
|
+
'#7048e8',
|
|
93
|
+
'#6741d9',
|
|
94
|
+
'#5f3dc4',
|
|
95
|
+
],
|
|
96
|
+
|
|
97
|
+
indigo: [
|
|
98
|
+
'#edf2ff',
|
|
99
|
+
'#dbe4ff',
|
|
100
|
+
'#bac8ff',
|
|
101
|
+
'#91a7ff',
|
|
102
|
+
'#748ffc',
|
|
103
|
+
'#5c7cfa',
|
|
104
|
+
'#4c6ef5',
|
|
105
|
+
'#4263eb',
|
|
106
|
+
'#3b5bdb',
|
|
107
|
+
'#364fc7',
|
|
108
|
+
],
|
|
109
|
+
|
|
110
|
+
blue: [
|
|
111
|
+
'#e7f5ff',
|
|
112
|
+
'#d0ebff',
|
|
113
|
+
'#a5d8ff',
|
|
114
|
+
'#74c0fc',
|
|
115
|
+
'#4dabf7',
|
|
116
|
+
'#339af0',
|
|
117
|
+
'#228be6',
|
|
118
|
+
'#1c7ed6',
|
|
119
|
+
'#1971c2',
|
|
120
|
+
'#1864ab',
|
|
121
|
+
],
|
|
122
|
+
|
|
123
|
+
cyan: [
|
|
124
|
+
'#e3fafc',
|
|
125
|
+
'#c5f6fa',
|
|
126
|
+
'#99e9f2',
|
|
127
|
+
'#66d9e8',
|
|
128
|
+
'#3bc9db',
|
|
129
|
+
'#22b8cf',
|
|
130
|
+
'#15aabf',
|
|
131
|
+
'#1098ad',
|
|
132
|
+
'#0c8599',
|
|
133
|
+
'#0b7285',
|
|
134
|
+
],
|
|
135
|
+
|
|
136
|
+
teal: [
|
|
137
|
+
'#e6fcf5',
|
|
138
|
+
'#c3fae8',
|
|
139
|
+
'#96f2d7',
|
|
140
|
+
'#63e6be',
|
|
141
|
+
'#38d9a9',
|
|
142
|
+
'#20c997',
|
|
143
|
+
'#12b886',
|
|
144
|
+
'#0ca678',
|
|
145
|
+
'#099268',
|
|
146
|
+
'#087f5b',
|
|
147
|
+
],
|
|
148
|
+
|
|
149
|
+
green: [
|
|
150
|
+
'#f4ffeb',
|
|
151
|
+
'#e7fdd5',
|
|
152
|
+
'#cbfca5',
|
|
153
|
+
'#aefb71',
|
|
154
|
+
'#95f948',
|
|
155
|
+
'#86f933',
|
|
156
|
+
'#7ef928',
|
|
157
|
+
'#6bdd1e',
|
|
158
|
+
'#5dc416',
|
|
159
|
+
'#4daa04',
|
|
160
|
+
],
|
|
161
|
+
|
|
162
|
+
lime: [
|
|
163
|
+
'#f4fce3',
|
|
164
|
+
'#e9fac8',
|
|
165
|
+
'#d8f5a2',
|
|
166
|
+
'#c0eb75',
|
|
167
|
+
'#a9e34b',
|
|
168
|
+
'#94d82d',
|
|
169
|
+
'#82c91e',
|
|
170
|
+
'#74b816',
|
|
171
|
+
'#66a80f',
|
|
172
|
+
'#5c940d',
|
|
173
|
+
],
|
|
174
|
+
|
|
175
|
+
yellow: [
|
|
176
|
+
'#fff9db',
|
|
177
|
+
'#fff3bf',
|
|
178
|
+
'#ffec99',
|
|
179
|
+
'#ffe066',
|
|
180
|
+
'#ffd43b',
|
|
181
|
+
'#fcc419',
|
|
182
|
+
'#fab005',
|
|
183
|
+
'#f59f00',
|
|
184
|
+
'#f08c00',
|
|
185
|
+
'#e67700',
|
|
186
|
+
],
|
|
187
|
+
|
|
188
|
+
orange: [
|
|
189
|
+
'#fff6e2',
|
|
190
|
+
'#feecce',
|
|
191
|
+
'#fbd8a0',
|
|
192
|
+
'#f7c26d',
|
|
193
|
+
'#f4b042',
|
|
194
|
+
'#f3a426',
|
|
195
|
+
'#f29f16',
|
|
196
|
+
'#d78a07',
|
|
197
|
+
'#c07900',
|
|
198
|
+
'#a76800',
|
|
199
|
+
],
|
|
200
|
+
secondary: [
|
|
201
|
+
'#f4f4f5',
|
|
202
|
+
'#e7e7e7',
|
|
203
|
+
'#cccccc',
|
|
204
|
+
'#afafaf',
|
|
205
|
+
'#989898',
|
|
206
|
+
'#898989',
|
|
207
|
+
'#818181',
|
|
208
|
+
'#6f6f6f',
|
|
209
|
+
'#616164',
|
|
210
|
+
'#545459',
|
|
211
|
+
],
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const tintColorLight = '#2f95dc';
|
|
215
|
+
const tintColorDark = '#fff';
|
|
216
|
+
|
|
217
|
+
export const _DEFAULT_THEME: TTheme = {
|
|
218
|
+
fontFamily: 'System font',
|
|
219
|
+
fontFamilyBold: 'System font',
|
|
220
|
+
fontFamilySemiBold: 'System font',
|
|
221
|
+
fontFamilyInput: 'System font',
|
|
222
|
+
localColor: '#1F2863',
|
|
223
|
+
primaryShade: 6,
|
|
224
|
+
colors: DEFAULT_COLORS,
|
|
225
|
+
primaryColor: 'blue',
|
|
226
|
+
secondaryColor: 'black',
|
|
227
|
+
secondaryBgColor: 'white',
|
|
228
|
+
light: {
|
|
229
|
+
text: '#000',
|
|
230
|
+
background: '#fdfdfd',
|
|
231
|
+
backgroundSecondary: '#fff',
|
|
232
|
+
backgroundThird: '#EFEFEF',
|
|
233
|
+
tint: tintColorLight,
|
|
234
|
+
tabIconDefault: '#ccc',
|
|
235
|
+
tabIconSelected: tintColorLight,
|
|
236
|
+
},
|
|
237
|
+
dark: {
|
|
238
|
+
text: '#fff',
|
|
239
|
+
background: '#272727',
|
|
240
|
+
backgroundSecondary: '#464F61',
|
|
241
|
+
backgroundThird: '#272727',
|
|
242
|
+
tint: tintColorDark,
|
|
243
|
+
tabIconDefault: '#ccc',
|
|
244
|
+
tabIconSelected: tintColorDark,
|
|
245
|
+
},
|
|
246
|
+
components: {},
|
|
247
|
+
other: {},
|
|
248
|
+
shadows: {
|
|
249
|
+
xs: '0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)',
|
|
250
|
+
sm: '0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px',
|
|
251
|
+
md: '0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px',
|
|
252
|
+
lg: '0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px',
|
|
253
|
+
xl: '0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px',
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
fontSizes: {
|
|
257
|
+
xs: 12,
|
|
258
|
+
sm: 14,
|
|
259
|
+
md: 16,
|
|
260
|
+
lg: 18,
|
|
261
|
+
xl: 20,
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
defaultRadius:8,
|
|
265
|
+
radius: {
|
|
266
|
+
xs: 2,
|
|
267
|
+
sm: 4,
|
|
268
|
+
md: 8,
|
|
269
|
+
lg: 16,
|
|
270
|
+
xl: 32,
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
spacing: {
|
|
274
|
+
xs: 10,
|
|
275
|
+
sm: 12,
|
|
276
|
+
md: 16,
|
|
277
|
+
lg: 20,
|
|
278
|
+
xl: 24,
|
|
279
|
+
},
|
|
280
|
+
headings: {
|
|
281
|
+
fontFamily: 'System font',
|
|
282
|
+
fontWeight: 700,
|
|
283
|
+
sizes: {
|
|
284
|
+
h1: { fontSize: 34, lineHeight: 1.3, fontWeight: undefined },
|
|
285
|
+
h2: { fontSize: 26, lineHeight: 1.35, fontWeight: undefined },
|
|
286
|
+
h3: { fontSize: 22, lineHeight: 1.4, fontWeight: undefined },
|
|
287
|
+
h4: { fontSize: 18, lineHeight: 1.45, fontWeight: undefined },
|
|
288
|
+
h5: { fontSize: 16, lineHeight: 1.5, fontWeight: undefined },
|
|
289
|
+
h6: { fontSize: 14, lineHeight: 1.5, fontWeight: undefined },
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
window: {
|
|
293
|
+
width: 375,
|
|
294
|
+
height: 800,
|
|
295
|
+
},
|
|
296
|
+
primaryBgColor: 'white',
|
|
297
|
+
primaryTextColor: 'black',
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
export const DEFAULT_THEME = attachFunctions(_DEFAULT_THEME);
|
|
301
|
+
|
|
302
|
+
type ColorScheme = {
|
|
303
|
+
text: string;
|
|
304
|
+
background: string;
|
|
305
|
+
backgroundSecondary?: string;
|
|
306
|
+
backgroundThird?: string;
|
|
307
|
+
tint: string;
|
|
308
|
+
tabIconDefault: string;
|
|
309
|
+
tabIconSelected: string;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export type ThemeSize = {
|
|
313
|
+
xs: number;
|
|
314
|
+
sm: number;
|
|
315
|
+
md: number;
|
|
316
|
+
lg: number;
|
|
317
|
+
xl: number;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
export type themeMode = 'dark' | 'light';
|
|
321
|
+
|
|
322
|
+
export type TTheme = {
|
|
323
|
+
fontFamily: string;
|
|
324
|
+
fontFamilyBold: string;
|
|
325
|
+
|
|
326
|
+
localColor: string;
|
|
327
|
+
|
|
328
|
+
currentMode?: themeMode;
|
|
329
|
+
toggleMode?: () => void;
|
|
330
|
+
primaryShade: number;
|
|
331
|
+
colors: { [key: string]: Palette };
|
|
332
|
+
primaryColor: string;
|
|
333
|
+
secondaryColor: string;
|
|
334
|
+
secondaryBgColor: string;
|
|
335
|
+
|
|
336
|
+
light: ColorScheme;
|
|
337
|
+
dark: ColorScheme;
|
|
338
|
+
|
|
339
|
+
other: {
|
|
340
|
+
[key: string]: any;
|
|
341
|
+
};
|
|
342
|
+
shadows: {
|
|
343
|
+
[key: string]: string;
|
|
344
|
+
};
|
|
345
|
+
radius: ThemeSize;
|
|
346
|
+
fontSizes: ThemeSize;
|
|
347
|
+
window: {
|
|
348
|
+
width: number;
|
|
349
|
+
height: number;
|
|
350
|
+
};
|
|
351
|
+
primaryBgColor: string;
|
|
352
|
+
primaryTextColor: string;
|
|
353
|
+
|
|
354
|
+
isIOS?: boolean;
|
|
355
|
+
|
|
356
|
+
OSVersion?: any;
|
|
357
|
+
|
|
358
|
+
[key: string]: any;
|
|
359
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type FilterPropsRes<T extends Record<string, any>> = {
|
|
2
|
+
[Key in keyof T]-?: T[Key] extends undefined ? never : T[Key];
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export function filterProps<T extends Record<string, any>>(props: T) {
|
|
6
|
+
return Object.keys(props).reduce<FilterPropsRes<T>>((acc, key: keyof T) => {
|
|
7
|
+
if (props[key] !== undefined) {
|
|
8
|
+
acc[key] = props[key];
|
|
9
|
+
}
|
|
10
|
+
return acc;
|
|
11
|
+
}, {} as FilterPropsRes<T>);
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MantineNumberSize } from '../../types';
|
|
2
|
+
|
|
3
|
+
export function radius(theme: any) {
|
|
4
|
+
return (size?: MantineNumberSize): string | number => {
|
|
5
|
+
if (!size) {
|
|
6
|
+
return theme.defaultRadius;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const defaultRadius =
|
|
10
|
+
typeof theme.defaultRadius === 'number'
|
|
11
|
+
? theme.defaultRadius
|
|
12
|
+
: theme.radius[theme.defaultRadius] || theme.defaultRadius;
|
|
13
|
+
|
|
14
|
+
return theme.radius[size] || size || defaultRadius;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DEFAULT_COLORS, DEFAULT_THEME } from './default-theme';
|
|
2
|
+
import type { TTheme } from './default-theme';
|
|
3
|
+
export const generateTheme = (theme?: Partial<TTheme>): TTheme => {
|
|
4
|
+
const { primaryShade = 7, other = {} } = theme || {};
|
|
5
|
+
return {
|
|
6
|
+
...DEFAULT_THEME,
|
|
7
|
+
primaryShade: primaryShade,
|
|
8
|
+
other: other,
|
|
9
|
+
fontFamily: 'Nunito',
|
|
10
|
+
fontFamilyBold: 'Nunito Bold',
|
|
11
|
+
fontFamilySemiBold: 'Nunito SemiBold',
|
|
12
|
+
fontFamilyInput: 'Nunito',
|
|
13
|
+
primaryColor: 'blue',
|
|
14
|
+
secondaryColor: 'cyan',
|
|
15
|
+
headings: {
|
|
16
|
+
fontFamily: 'Nunito',
|
|
17
|
+
},
|
|
18
|
+
colors: DEFAULT_COLORS,
|
|
19
|
+
};
|
|
20
|
+
};
|