react-native-mantine 0.14.0 → 0.15.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 +138 -0
- package/lib/commonjs/components/ActionIcon/ActionIcon.js +1 -1
- package/lib/commonjs/components/ActionIcon/ActionIcon.js.map +1 -1
- package/lib/commonjs/components/Anchor/index.js +3 -4
- package/lib/commonjs/components/Anchor/index.js.map +1 -1
- package/lib/commonjs/components/Avatar/index.js +1 -2
- package/lib/commonjs/components/Avatar/index.js.map +1 -1
- package/lib/commonjs/components/Badge/index.js +54 -24
- package/lib/commonjs/components/Badge/index.js.map +1 -1
- package/lib/commonjs/components/Blockquote/index.js +4 -5
- package/lib/commonjs/components/Blockquote/index.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +7 -1
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Center/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js +4 -5
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +40 -21
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/Code/index.js +6 -4
- package/lib/commonjs/components/Code/index.js.map +1 -1
- package/lib/commonjs/components/Grid/index.js +18 -13
- package/lib/commonjs/components/Grid/index.js.map +1 -1
- package/lib/commonjs/components/Highlight/index.js +1 -1
- package/lib/commonjs/components/Highlight/index.js.map +1 -1
- package/lib/commonjs/components/Indicator/index.js +2 -3
- package/lib/commonjs/components/Indicator/index.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js +4 -5
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/MultiSelect/index.js +8 -9
- package/lib/commonjs/components/MultiSelect/index.js.map +1 -1
- package/lib/commonjs/components/NativeSelect/index.js +14 -14
- package/lib/commonjs/components/NativeSelect/index.js.map +1 -1
- package/lib/commonjs/components/NavLink/index.js +43 -20
- package/lib/commonjs/components/NavLink/index.js.map +1 -1
- package/lib/commonjs/components/Notification/index.js +5 -6
- package/lib/commonjs/components/Notification/index.js.map +1 -1
- package/lib/commonjs/components/Pagination/index.js +5 -6
- package/lib/commonjs/components/Pagination/index.js.map +1 -1
- package/lib/commonjs/components/PinInput/index.js +3 -3
- package/lib/commonjs/components/PinInput/index.js.map +1 -1
- package/lib/commonjs/components/Progress/index.js +3 -5
- package/lib/commonjs/components/Progress/index.js.map +1 -1
- package/lib/commonjs/components/Radio/index.js +4 -5
- package/lib/commonjs/components/Radio/index.js.map +1 -1
- package/lib/commonjs/components/Rating/index.js +2 -4
- package/lib/commonjs/components/Rating/index.js.map +1 -1
- package/lib/commonjs/components/RingProgress/index.js +3 -4
- package/lib/commonjs/components/RingProgress/index.js.map +1 -1
- package/lib/commonjs/components/Select/index.js +7 -8
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/SimpleGrid/index.js +4 -2
- package/lib/commonjs/components/SimpleGrid/index.js.map +1 -1
- package/lib/commonjs/components/Spoiler/index.js +1 -1
- package/lib/commonjs/components/Spoiler/index.js.map +1 -1
- package/lib/commonjs/components/Stepper/index.js +8 -6
- package/lib/commonjs/components/Stepper/index.js.map +1 -1
- package/lib/commonjs/components/Switch/index.js +4 -5
- package/lib/commonjs/components/Switch/index.js.map +1 -1
- package/lib/commonjs/components/Text/index.js +78 -17
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/ThemeIcon/index.js +40 -19
- package/lib/commonjs/components/ThemeIcon/index.js.map +1 -1
- package/lib/commonjs/components/Timeline/index.js +6 -5
- package/lib/commonjs/components/Timeline/index.js.map +1 -1
- package/lib/commonjs/components/Title/index.js +5 -17
- package/lib/commonjs/components/Title/index.js.map +1 -1
- package/lib/commonjs/components/Tooltip/index.js +1 -2
- package/lib/commonjs/components/Tooltip/index.js.map +1 -1
- package/lib/commonjs/components/TransferList/index.js +9 -10
- package/lib/commonjs/components/TransferList/index.js.map +1 -1
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.styles.js +2 -2
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.styles.js.map +1 -1
- package/lib/commonjs/index.js +34 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theme/create-theme.js +114 -25
- package/lib/commonjs/theme/create-theme.js.map +1 -1
- package/lib/commonjs/theme/default-colors.js +103 -0
- package/lib/commonjs/theme/default-colors.js.map +1 -0
- package/lib/commonjs/theme/default-theme.js +144 -128
- package/lib/commonjs/theme/default-theme.js.map +1 -1
- package/lib/commonjs/theme/functions/attach-functions.js +46 -14
- package/lib/commonjs/theme/functions/attach-functions.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/breakpoints.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/color-scheme-value.js +190 -0
- package/lib/commonjs/theme/functions/fns/color-scheme-value.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/dimmed.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/gradient/gradient.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/helpers.js +51 -3
- package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/index.js +151 -6
- package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/primary-shade.js +81 -2
- package/lib/commonjs/theme/functions/fns/primary-shade.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/shadow.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/size.js +2 -1
- package/lib/commonjs/theme/functions/fns/size.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/theme-color/color-utils.js +196 -0
- package/lib/commonjs/theme/functions/fns/theme-color/color-utils.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js +92 -9
- package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/variant.js +112 -17
- package/lib/commonjs/theme/functions/fns/variant.js.map +1 -1
- package/lib/commonjs/theme/functions/index.js +172 -0
- package/lib/commonjs/theme/functions/index.js.map +1 -0
- package/lib/commonjs/theme/index.js +116 -14
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/theme/theme-provider.js +1 -22
- package/lib/commonjs/theme/theme-provider.js.map +1 -1
- package/lib/commonjs/theme/types.js +6 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/theme/utils/withTextWrapper.js +1 -2
- package/lib/commonjs/theme/utils/withTextWrapper.js.map +1 -1
- package/lib/module/components/ActionIcon/ActionIcon.js +1 -1
- package/lib/module/components/ActionIcon/ActionIcon.js.map +1 -1
- package/lib/module/components/Anchor/index.js +3 -4
- package/lib/module/components/Anchor/index.js.map +1 -1
- package/lib/module/components/Avatar/index.js +1 -2
- package/lib/module/components/Avatar/index.js.map +1 -1
- package/lib/module/components/Badge/index.js +54 -24
- package/lib/module/components/Badge/index.js.map +1 -1
- package/lib/module/components/Blockquote/index.js +4 -5
- package/lib/module/components/Blockquote/index.js.map +1 -1
- package/lib/module/components/Button/index.js +7 -1
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Center/index.js.map +1 -1
- package/lib/module/components/Checkbox/index.js +4 -5
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Chip/index.js +40 -21
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/Code/index.js +6 -4
- package/lib/module/components/Code/index.js.map +1 -1
- package/lib/module/components/Grid/index.js +18 -13
- package/lib/module/components/Grid/index.js.map +1 -1
- package/lib/module/components/Highlight/index.js +1 -1
- package/lib/module/components/Highlight/index.js.map +1 -1
- package/lib/module/components/Indicator/index.js +2 -3
- package/lib/module/components/Indicator/index.js.map +1 -1
- package/lib/module/components/Menu/index.js +4 -5
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/MultiSelect/index.js +8 -9
- package/lib/module/components/MultiSelect/index.js.map +1 -1
- package/lib/module/components/NativeSelect/index.js +14 -14
- package/lib/module/components/NativeSelect/index.js.map +1 -1
- package/lib/module/components/NavLink/index.js +43 -20
- package/lib/module/components/NavLink/index.js.map +1 -1
- package/lib/module/components/Notification/index.js +5 -6
- package/lib/module/components/Notification/index.js.map +1 -1
- package/lib/module/components/Pagination/index.js +5 -6
- package/lib/module/components/Pagination/index.js.map +1 -1
- package/lib/module/components/PinInput/index.js +3 -3
- package/lib/module/components/PinInput/index.js.map +1 -1
- package/lib/module/components/Progress/index.js +3 -5
- package/lib/module/components/Progress/index.js.map +1 -1
- package/lib/module/components/Radio/index.js +4 -5
- package/lib/module/components/Radio/index.js.map +1 -1
- package/lib/module/components/Rating/index.js +2 -4
- package/lib/module/components/Rating/index.js.map +1 -1
- package/lib/module/components/RingProgress/index.js +3 -4
- package/lib/module/components/RingProgress/index.js.map +1 -1
- package/lib/module/components/Select/index.js +7 -8
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/SimpleGrid/index.js +4 -2
- package/lib/module/components/SimpleGrid/index.js.map +1 -1
- package/lib/module/components/Spoiler/index.js +1 -1
- package/lib/module/components/Spoiler/index.js.map +1 -1
- package/lib/module/components/Stepper/index.js +8 -6
- package/lib/module/components/Stepper/index.js.map +1 -1
- package/lib/module/components/Switch/index.js +4 -5
- package/lib/module/components/Switch/index.js.map +1 -1
- package/lib/module/components/Text/index.js +78 -17
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/ThemeIcon/index.js +40 -19
- package/lib/module/components/ThemeIcon/index.js.map +1 -1
- package/lib/module/components/Timeline/index.js +6 -5
- package/lib/module/components/Timeline/index.js.map +1 -1
- package/lib/module/components/Title/index.js +5 -17
- package/lib/module/components/Title/index.js.map +1 -1
- package/lib/module/components/Tooltip/index.js +1 -2
- package/lib/module/components/Tooltip/index.js.map +1 -1
- package/lib/module/components/TransferList/index.js +9 -10
- package/lib/module/components/TransferList/index.js.map +1 -1
- package/lib/module/components/UnstyledButton/UnstyledButton.styles.js +2 -2
- package/lib/module/components/UnstyledButton/UnstyledButton.styles.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/theme/create-theme.js +114 -24
- package/lib/module/theme/create-theme.js.map +1 -1
- package/lib/module/theme/default-colors.js +99 -0
- package/lib/module/theme/default-colors.js.map +1 -0
- package/lib/module/theme/default-theme.js +143 -127
- package/lib/module/theme/default-theme.js.map +1 -1
- package/lib/module/theme/functions/attach-functions.js +47 -14
- package/lib/module/theme/functions/attach-functions.js.map +1 -1
- package/lib/module/theme/functions/fns/breakpoints.js.map +1 -1
- package/lib/module/theme/functions/fns/color-scheme-value.js +180 -0
- package/lib/module/theme/functions/fns/color-scheme-value.js.map +1 -0
- package/lib/module/theme/functions/fns/dimmed.js.map +1 -1
- package/lib/module/theme/functions/fns/gradient/gradient.js.map +1 -1
- package/lib/module/theme/functions/fns/helpers.js +48 -2
- package/lib/module/theme/functions/fns/helpers.js.map +1 -1
- package/lib/module/theme/functions/fns/index.js +35 -7
- package/lib/module/theme/functions/fns/index.js.map +1 -1
- package/lib/module/theme/functions/fns/primary-shade.js +78 -2
- package/lib/module/theme/functions/fns/primary-shade.js.map +1 -1
- package/lib/module/theme/functions/fns/shadow.js.map +1 -1
- package/lib/module/theme/functions/fns/size.js +2 -1
- package/lib/module/theme/functions/fns/size.js.map +1 -1
- package/lib/module/theme/functions/fns/theme-color/color-utils.js +189 -0
- package/lib/module/theme/functions/fns/theme-color/color-utils.js.map +1 -0
- package/lib/module/theme/functions/fns/theme-color/theme-color.js +91 -9
- package/lib/module/theme/functions/fns/theme-color/theme-color.js.map +1 -1
- package/lib/module/theme/functions/fns/variant.js +112 -17
- package/lib/module/theme/functions/fns/variant.js.map +1 -1
- package/lib/module/theme/functions/index.js +22 -0
- package/lib/module/theme/functions/index.js.map +1 -0
- package/lib/module/theme/index.js +16 -4
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/theme-provider.js +1 -22
- package/lib/module/theme/theme-provider.js.map +1 -1
- package/lib/module/theme/types.js +4 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/utils/withTextWrapper.js +1 -2
- package/lib/module/theme/utils/withTextWrapper.js.map +1 -1
- package/lib/typescript/commonjs/src/components/Anchor/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Badge/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Blockquote/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/Button.styles.d.ts +8 -8
- package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Center/index.d.ts +1 -2
- package/lib/typescript/commonjs/src/components/Center/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Chip/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/Container/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Container/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Flex/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Flex/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Grid/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Highlight/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Indicator/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/MultiSelect/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/NativeSelect/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/NavLink/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Notification/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Pagination/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/PinInput/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Progress/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Radio/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Rating/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RingProgress/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SimpleGrid/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Switch/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Text/index.d.ts +54 -7
- 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/Timeline/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Title/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/components/Title/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Tooltip/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/TransferList/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/create-styles.d.ts +1 -1
- package/lib/typescript/commonjs/src/theme/create-styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/create-theme.d.ts +68 -2
- package/lib/typescript/commonjs/src/theme/create-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/default-colors.d.ts +12 -0
- package/lib/typescript/commonjs/src/theme/default-colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/default-theme.d.ts +15 -108
- package/lib/typescript/commonjs/src/theme/default-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts +20 -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 +3 -3
- package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/color-scheme-value.d.ts +100 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/color-scheme-value.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts +2 -2
- package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts +2 -3
- package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +36 -8
- 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 +40 -14
- package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts +53 -3
- package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts +2 -2
- package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/color-utils.d.ts +50 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/color-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts +51 -5
- 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 +52 -19
- package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/index.d.ts +19 -0
- package/lib/typescript/commonjs/src/theme/functions/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/index.d.ts +9 -6
- package/lib/typescript/commonjs/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/theme-provider.d.ts +1 -1
- package/lib/typescript/commonjs/src/theme/theme-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/types.d.ts +494 -0
- package/lib/typescript/commonjs/src/theme/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts +1 -1
- package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Anchor/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Badge/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Blockquote/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/Button.styles.d.ts +8 -8
- package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Center/index.d.ts +1 -2
- package/lib/typescript/module/src/components/Center/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Chip/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/Container/index.d.ts +2 -2
- package/lib/typescript/module/src/components/Container/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Flex/index.d.ts +2 -2
- package/lib/typescript/module/src/components/Flex/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Grid/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Highlight/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Indicator/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/MultiSelect/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/NativeSelect/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/NavLink/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Notification/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Pagination/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/PinInput/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Progress/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Radio/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Rating/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RingProgress/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SimpleGrid/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Switch/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Text/index.d.ts +54 -7
- 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/Timeline/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Title/index.d.ts +1 -0
- package/lib/typescript/module/src/components/Title/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Tooltip/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/TransferList/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts +2 -2
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/create-styles.d.ts +1 -1
- package/lib/typescript/module/src/theme/create-styles.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/create-theme.d.ts +68 -2
- package/lib/typescript/module/src/theme/create-theme.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/default-colors.d.ts +12 -0
- package/lib/typescript/module/src/theme/default-colors.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/default-theme.d.ts +15 -108
- package/lib/typescript/module/src/theme/default-theme.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/attach-functions.d.ts +20 -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 +3 -3
- package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/color-scheme-value.d.ts +100 -0
- package/lib/typescript/module/src/theme/functions/fns/color-scheme-value.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts +2 -2
- package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts +2 -3
- package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +36 -8
- 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 +40 -14
- package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts +53 -3
- package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts +1 -1
- package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/size.d.ts +2 -2
- package/lib/typescript/module/src/theme/functions/fns/size.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/theme-color/color-utils.d.ts +50 -0
- package/lib/typescript/module/src/theme/functions/fns/theme-color/color-utils.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts +51 -5
- 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 +52 -19
- package/lib/typescript/module/src/theme/functions/fns/variant.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/index.d.ts +19 -0
- package/lib/typescript/module/src/theme/functions/index.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/index.d.ts +9 -6
- package/lib/typescript/module/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/theme-provider.d.ts +1 -1
- package/lib/typescript/module/src/theme/theme-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/types.d.ts +494 -0
- package/lib/typescript/module/src/theme/types.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts +1 -1
- package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionIcon/ActionIcon.tsx +3 -3
- package/src/components/Anchor/index.tsx +3 -4
- package/src/components/Avatar/index.tsx +1 -2
- package/src/components/Badge/index.tsx +36 -19
- package/src/components/Blockquote/index.tsx +4 -6
- package/src/components/Button/index.tsx +5 -1
- package/src/components/Center/index.tsx +1 -2
- package/src/components/Checkbox/index.tsx +4 -5
- package/src/components/Chip/index.tsx +25 -18
- package/src/components/Code/index.tsx +7 -5
- package/src/components/Container/index.tsx +2 -2
- package/src/components/Flex/index.tsx +2 -2
- package/src/components/Grid/index.tsx +16 -10
- package/src/components/Highlight/index.tsx +1 -2
- package/src/components/Indicator/index.tsx +3 -4
- package/src/components/Menu/index.tsx +8 -10
- package/src/components/MultiSelect/index.tsx +13 -15
- package/src/components/NativeSelect/index.tsx +34 -21
- package/src/components/NavLink/index.tsx +27 -23
- package/src/components/Notification/index.tsx +5 -6
- package/src/components/Pagination/index.tsx +5 -6
- package/src/components/PinInput/index.tsx +5 -6
- package/src/components/Progress/index.tsx +5 -6
- package/src/components/Radio/index.tsx +4 -5
- package/src/components/Rating/index.tsx +2 -4
- package/src/components/RingProgress/index.tsx +3 -5
- package/src/components/Select/index.tsx +11 -13
- package/src/components/SimpleGrid/index.tsx +5 -2
- package/src/components/Spoiler/index.tsx +1 -1
- package/src/components/Stepper/index.tsx +17 -17
- package/src/components/Switch/index.tsx +5 -6
- package/src/components/Text/index.tsx +125 -28
- package/src/components/ThemeIcon/index.tsx +23 -23
- package/src/components/Timeline/index.tsx +12 -15
- package/src/components/Title/index.tsx +5 -22
- package/src/components/Tooltip/index.tsx +1 -3
- package/src/components/TransferList/index.tsx +16 -18
- package/src/components/UnstyledButton/UnstyledButton.styles.ts +4 -2
- package/src/index.tsx +1 -1
- package/src/theme/create-styles.ts +1 -1
- package/src/theme/create-theme.ts +134 -23
- package/src/theme/default-colors.ts +252 -0
- package/src/theme/default-theme.ts +178 -392
- package/src/theme/functions/attach-functions.ts +57 -10
- package/src/theme/functions/fns/breakpoints.ts +4 -4
- package/src/theme/functions/fns/color-scheme-value.ts +200 -0
- package/src/theme/functions/fns/dimmed.ts +2 -2
- package/src/theme/functions/fns/gradient/gradient.ts +2 -3
- package/src/theme/functions/fns/helpers.ts +50 -9
- package/src/theme/functions/fns/index.ts +63 -3
- package/src/theme/functions/fns/primary-shade.ts +84 -8
- package/src/theme/functions/fns/shadow.ts +1 -1
- package/src/theme/functions/fns/size.ts +4 -3
- package/src/theme/functions/fns/theme-color/color-utils.ts +193 -0
- package/src/theme/functions/fns/theme-color/theme-color.ts +85 -17
- package/src/theme/functions/fns/variant.ts +106 -44
- package/src/theme/functions/index.ts +19 -0
- package/src/theme/index.ts +91 -0
- package/src/theme/theme-provider.tsx +2 -17
- package/src/theme/types.ts +625 -0
- package/src/theme/utils/withTextWrapper.tsx +2 -3
- package/src/theme/index.tsx +0 -9
|
@@ -1,29 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attach helper functions to theme object
|
|
3
|
+
* Creates theme.fn object with all utility functions
|
|
4
|
+
* Aligned with Mantine web's theme function attachment pattern
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MantineTheme, MantineThemeBase } from '../types';
|
|
1
8
|
import { fns } from './fns';
|
|
9
|
+
import {
|
|
10
|
+
createPrimaryShadeFunction,
|
|
11
|
+
createPrimaryColorFunction,
|
|
12
|
+
} from './fns/primary-shade';
|
|
13
|
+
import { createThemeColorFunction } from './fns/theme-color/theme-color';
|
|
2
14
|
|
|
3
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Attach helper functions to theme base object
|
|
17
|
+
* Converts MantineThemeBase to full MantineTheme with fn object
|
|
18
|
+
*
|
|
19
|
+
* @param themeBase - Base theme configuration without functions
|
|
20
|
+
* @returns Complete theme with attached helper functions
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const theme = attachFunctions(baseTheme);
|
|
24
|
+
* theme.fn.themeColor('blue', 5); // '#339af0'
|
|
25
|
+
* theme.fn.primaryShade(); // 6
|
|
26
|
+
* theme.fn.variant({ variant: 'filled', color: 'blue' });
|
|
27
|
+
*/
|
|
28
|
+
export function attachFunctions(themeBase: MantineThemeBase): MantineTheme {
|
|
4
29
|
return {
|
|
5
30
|
...themeBase,
|
|
6
31
|
fn: {
|
|
7
|
-
|
|
32
|
+
// Color functions
|
|
33
|
+
themeColor: createThemeColorFunction(themeBase),
|
|
34
|
+
primaryShade: createPrimaryShadeFunction(themeBase),
|
|
35
|
+
primaryColor: createPrimaryColorFunction(themeBase),
|
|
36
|
+
|
|
37
|
+
// Variant function
|
|
38
|
+
variant: fns.variant(themeBase),
|
|
39
|
+
|
|
40
|
+
// Color manipulation
|
|
8
41
|
rgba: fns.rgba(themeBase),
|
|
42
|
+
lighten: fns.lighten,
|
|
43
|
+
darken: fns.darken,
|
|
44
|
+
dimmed: fns.dimmed(themeBase),
|
|
45
|
+
|
|
46
|
+
// Size and spacing functions
|
|
47
|
+
radius: fns.radius(themeBase),
|
|
9
48
|
size: fns.size(themeBase),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fns.themeColor({ theme: themeBase, color, shade }),
|
|
49
|
+
|
|
50
|
+
// Visual effects
|
|
13
51
|
shadow: fns.shadow,
|
|
14
52
|
gradient: fns.gradient(themeBase),
|
|
53
|
+
|
|
54
|
+
// Typography functions
|
|
15
55
|
fontStyles: fns.fontStyles(themeBase),
|
|
16
56
|
inputFontStyles: fns.inputFontStyles(themeBase),
|
|
17
|
-
focusStyles: fns.focusStyles(themeBase),
|
|
18
57
|
placeholderStyles: fns.placeholderStyles(themeBase),
|
|
58
|
+
fontSize: fns.fontSize(themeBase),
|
|
59
|
+
lineHeight: fns.lineHeight(themeBase),
|
|
60
|
+
headingStyles: fns.headingStyles(themeBase),
|
|
61
|
+
|
|
62
|
+
// Layout functions
|
|
19
63
|
cover: fns.cover(themeBase),
|
|
64
|
+
focusStyles: fns.focusStyles(themeBase),
|
|
20
65
|
hover: fns.hover(themeBase),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
dimmed: fns.dimmed(themeBase),
|
|
66
|
+
|
|
67
|
+
// Responsive functions
|
|
24
68
|
largerThan: fns.largerThan(themeBase),
|
|
25
69
|
smallerThan: fns.smallerThan(themeBase),
|
|
70
|
+
|
|
71
|
+
// Color scheme helpers
|
|
72
|
+
colorSchemeValue: fns.colorSchemeValue(themeBase),
|
|
73
|
+
colorSchemeConstants: fns.colorSchemeConstants(themeBase),
|
|
26
74
|
},
|
|
27
|
-
activeStyles: fns.activeStyles(themeBase),
|
|
28
75
|
};
|
|
29
76
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dimensions } from 'react-native';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MantineThemeBase } from '../../types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Default breakpoint values in pixels
|
|
@@ -20,7 +20,7 @@ export type MantineNumberSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
|
20
20
|
*/
|
|
21
21
|
function getBreakpointValue(
|
|
22
22
|
breakpoint: MantineNumberSize,
|
|
23
|
-
theme:
|
|
23
|
+
theme: MantineThemeBase
|
|
24
24
|
): number {
|
|
25
25
|
if (typeof breakpoint === 'number') {
|
|
26
26
|
return breakpoint;
|
|
@@ -40,7 +40,7 @@ function getBreakpointValue(
|
|
|
40
40
|
* @param theme - The Mantine theme
|
|
41
41
|
* @returns A function that takes a breakpoint and returns a boolean
|
|
42
42
|
*/
|
|
43
|
-
export function largerThan(theme:
|
|
43
|
+
export function largerThan(theme: MantineThemeBase) {
|
|
44
44
|
return (breakpoint: MantineNumberSize): boolean => {
|
|
45
45
|
const { width } = Dimensions.get('window');
|
|
46
46
|
const breakpointValue = getBreakpointValue(breakpoint, theme);
|
|
@@ -53,7 +53,7 @@ export function largerThan(theme: MantineTheme) {
|
|
|
53
53
|
* @param theme - The Mantine theme
|
|
54
54
|
* @returns A function that takes a breakpoint and returns a boolean
|
|
55
55
|
*/
|
|
56
|
-
export function smallerThan(theme:
|
|
56
|
+
export function smallerThan(theme: MantineThemeBase) {
|
|
57
57
|
return (breakpoint: MantineNumberSize): boolean => {
|
|
58
58
|
const { width } = Dimensions.get('window');
|
|
59
59
|
const breakpointValue = getBreakpointValue(breakpoint, theme);
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color scheme value helper
|
|
3
|
+
* Returns different values based on the current color scheme (light or dark mode)
|
|
4
|
+
* Useful for theme-aware constants like colors, spacing, etc.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MantineThemeBase, ColorScheme } from '../../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Color scheme value type
|
|
11
|
+
* Represents a value that has different values for light and dark modes
|
|
12
|
+
*/
|
|
13
|
+
export interface ColorSchemeValue<T = any> {
|
|
14
|
+
light: T;
|
|
15
|
+
dark: T;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Type helper to resolve ColorSchemeValue types to their base types
|
|
20
|
+
* Recursively transforms ColorSchemeValue<T> to T in object structures
|
|
21
|
+
*/
|
|
22
|
+
export type ResolveColorSchemeValue<T> = T extends ColorSchemeValue<infer U>
|
|
23
|
+
? U
|
|
24
|
+
: T extends Record<string, any>
|
|
25
|
+
? { [K in keyof T]: ResolveColorSchemeValue<T[K]> }
|
|
26
|
+
: T;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Check if a value is a color scheme value object
|
|
30
|
+
* @param value - Value to check
|
|
31
|
+
* @returns True if value is a ColorSchemeValue object
|
|
32
|
+
*/
|
|
33
|
+
export function isColorSchemeValue<T = any>(value: any): value is ColorSchemeValue<T> {
|
|
34
|
+
return (
|
|
35
|
+
value !== null &&
|
|
36
|
+
typeof value === 'object' &&
|
|
37
|
+
'light' in value &&
|
|
38
|
+
'dark' in value &&
|
|
39
|
+
Object.keys(value).length === 2
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Create a color scheme-aware value
|
|
45
|
+
* Returns an object with light and dark values
|
|
46
|
+
*
|
|
47
|
+
* @param light - Value for light mode
|
|
48
|
+
* @param dark - Value for dark mode
|
|
49
|
+
* @returns ColorSchemeValue object
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* const backgroundColor = colorSchemeValue('#FCFCFC', '#272727');
|
|
53
|
+
* // { light: '#FCFCFC', dark: '#272727' }
|
|
54
|
+
*/
|
|
55
|
+
export function colorSchemeValue<T = any>(light: T, dark: T): ColorSchemeValue<T> {
|
|
56
|
+
return { light, dark };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get the appropriate value based on color scheme
|
|
61
|
+
* If the value is a ColorSchemeValue object, returns the appropriate value
|
|
62
|
+
* Otherwise, returns the value as-is
|
|
63
|
+
*
|
|
64
|
+
* @param value - Value or ColorSchemeValue object
|
|
65
|
+
* @param colorScheme - Current color scheme
|
|
66
|
+
* @returns Resolved value for the current color scheme
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* const bgColor = resolveColorSchemeValue({ light: '#fff', dark: '#000' }, 'dark');
|
|
70
|
+
* // '#000'
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const fixedColor = resolveColorSchemeValue('#blue', 'dark');
|
|
74
|
+
* // '#blue'
|
|
75
|
+
*/
|
|
76
|
+
export function resolveColorSchemeValue<T = any>(
|
|
77
|
+
value: T | ColorSchemeValue<T>,
|
|
78
|
+
colorScheme: ColorScheme
|
|
79
|
+
): T {
|
|
80
|
+
if (isColorSchemeValue(value)) {
|
|
81
|
+
return value[colorScheme];
|
|
82
|
+
}
|
|
83
|
+
return value as T;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Create a theme function that resolves color scheme values
|
|
88
|
+
* This is attached to theme.fn.colorSchemeValue
|
|
89
|
+
*
|
|
90
|
+
* @param theme - Mantine theme base
|
|
91
|
+
* @returns Function that resolves color scheme values based on current theme
|
|
92
|
+
*/
|
|
93
|
+
export const createColorSchemeValueFunction = (theme: MantineThemeBase) => {
|
|
94
|
+
/**
|
|
95
|
+
* Get value based on current color scheme
|
|
96
|
+
* Returns the appropriate value for light or dark mode
|
|
97
|
+
*
|
|
98
|
+
* @param value - Value or ColorSchemeValue object
|
|
99
|
+
* @returns Resolved value for current color scheme
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* // In a component using theme
|
|
103
|
+
* const theme = useTheme();
|
|
104
|
+
* const bgColor = theme.fn.colorSchemeValue({ light: '#fff', dark: '#000' });
|
|
105
|
+
* // Returns '#fff' in light mode, '#000' in dark mode
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* // With fixed value
|
|
109
|
+
* const color = theme.fn.colorSchemeValue('#blue');
|
|
110
|
+
* // Returns '#blue' regardless of color scheme
|
|
111
|
+
*/
|
|
112
|
+
return <T = any>(value: T | ColorSchemeValue<T>): T => {
|
|
113
|
+
return resolveColorSchemeValue(value, theme.colorScheme);
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Helper to create a set of color scheme-aware constants
|
|
119
|
+
* Converts an object with ColorSchemeValue properties into resolved values
|
|
120
|
+
*
|
|
121
|
+
* @param constants - Object with ColorSchemeValue properties
|
|
122
|
+
* @param colorScheme - Current color scheme
|
|
123
|
+
* @returns Object with resolved values
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* const constants = {
|
|
127
|
+
* text: { light: '#000', dark: '#fff' },
|
|
128
|
+
* background: { light: '#FCFCFC', dark: '#272727' },
|
|
129
|
+
* primaryButtonBackground: { light: '#00203E', dark: '#2581C4' },
|
|
130
|
+
* fixedColor: '#blue', // Non-scheme values pass through
|
|
131
|
+
* };
|
|
132
|
+
*
|
|
133
|
+
* const resolved = resolveColorSchemeConstants(constants, 'dark');
|
|
134
|
+
* // {
|
|
135
|
+
* // text: '#fff',
|
|
136
|
+
* // background: '#272727',
|
|
137
|
+
* // primaryButtonBackground: '#2581C4',
|
|
138
|
+
* // fixedColor: '#blue'
|
|
139
|
+
* // }
|
|
140
|
+
*/
|
|
141
|
+
export function resolveColorSchemeConstants<T extends Record<string, any>>(
|
|
142
|
+
constants: T,
|
|
143
|
+
colorScheme: ColorScheme
|
|
144
|
+
): ResolveColorSchemeValue<T> {
|
|
145
|
+
const resolved = {} as T;
|
|
146
|
+
|
|
147
|
+
for (const key in constants) {
|
|
148
|
+
if (Object.prototype.hasOwnProperty.call(constants, key)) {
|
|
149
|
+
const value = constants[key];
|
|
150
|
+
|
|
151
|
+
if (isColorSchemeValue(value)) {
|
|
152
|
+
resolved[key] = value[colorScheme] as any;
|
|
153
|
+
} else if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
154
|
+
// Recursively resolve nested objects
|
|
155
|
+
resolved[key] = resolveColorSchemeConstants(value, colorScheme);
|
|
156
|
+
} else {
|
|
157
|
+
// Pass through non-scheme values
|
|
158
|
+
resolved[key] = value;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return resolved as ResolveColorSchemeValue<T>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Create a theme function that resolves color scheme constants
|
|
168
|
+
* This is attached to theme.fn.colorSchemeConstants
|
|
169
|
+
*
|
|
170
|
+
* @param theme - Mantine theme base
|
|
171
|
+
* @returns Function that resolves all constants in an object based on current theme
|
|
172
|
+
*/
|
|
173
|
+
export const createColorSchemeConstantsFunction = (theme: MantineThemeBase) => {
|
|
174
|
+
/**
|
|
175
|
+
* Resolve all color scheme values in an object
|
|
176
|
+
* Useful for resolving a set of constants stored in theme.other
|
|
177
|
+
*
|
|
178
|
+
* @param constants - Object containing ColorSchemeValue properties
|
|
179
|
+
* @returns Object with all values resolved for current color scheme
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* // Define constants in theme
|
|
183
|
+
* const theme = createTheme({
|
|
184
|
+
* other: {
|
|
185
|
+
* colors: {
|
|
186
|
+
* text: { light: '#000', dark: '#fff' },
|
|
187
|
+
* background: { light: '#FCFCFC', dark: '#272727' },
|
|
188
|
+
* }
|
|
189
|
+
* }
|
|
190
|
+
* });
|
|
191
|
+
*
|
|
192
|
+
* // In component
|
|
193
|
+
* const colors = theme.fn.colorSchemeConstants(theme.other.colors);
|
|
194
|
+
* // { text: '#000', background: '#FCFCFC' } in light mode
|
|
195
|
+
* // { text: '#fff', background: '#272727' } in dark mode
|
|
196
|
+
*/
|
|
197
|
+
return <T extends Record<string, any>>(constants: T): ResolveColorSchemeValue<T> => {
|
|
198
|
+
return resolveColorSchemeConstants(constants, theme.colorScheme);
|
|
199
|
+
};
|
|
200
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MantineThemeBase } from '../../types';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns a dimmed text color based on the current color scheme
|
|
@@ -6,7 +6,7 @@ import type { MantineTheme } from '../../default-theme';
|
|
|
6
6
|
* @param theme - The Mantine theme
|
|
7
7
|
* @returns A function that returns the dimmed color
|
|
8
8
|
*/
|
|
9
|
-
export function dimmed(theme:
|
|
9
|
+
export function dimmed(theme: MantineThemeBase) {
|
|
10
10
|
return () => {
|
|
11
11
|
const colorScheme = theme.currentMode || 'light';
|
|
12
12
|
return colorScheme === 'dark'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { MantineGradient, GradientConfig } from '../../../theme.d';
|
|
1
|
+
import type { MantineThemeBase, MantineGradient, GradientConfig } from '../../../types';
|
|
3
2
|
import { themeColor } from '../theme-color/theme-color';
|
|
4
3
|
import { getPrimaryShade } from '../primary-shade';
|
|
5
4
|
|
|
@@ -32,7 +31,7 @@ function degToCoordinates(deg: number): { start: { x: number; y: number }; end:
|
|
|
32
31
|
* Creates a gradient configuration for use with expo-linear-gradient
|
|
33
32
|
* Returns gradient colors and coordinates based on theme gradient settings
|
|
34
33
|
*/
|
|
35
|
-
export function gradient(theme:
|
|
34
|
+
export function gradient(theme: MantineThemeBase) {
|
|
36
35
|
return (payload?: MantineGradient): GradientConfig => {
|
|
37
36
|
const merged = {
|
|
38
37
|
from: payload?.from || theme.defaultGradient?.from || theme.primaryColor,
|
|
@@ -1,31 +1,72 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MantineThemeBase, MantineNumberSize } from '../../types';
|
|
2
|
+
import type { TextStyle } from 'react-native';
|
|
3
|
+
import { getSize } from '../../get-size';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Returns base font styles from theme
|
|
7
|
+
* Includes fontFamily and lineHeight
|
|
8
|
+
*/
|
|
9
|
+
export const fontStyles = (theme: MantineThemeBase) => () => ({
|
|
4
10
|
fontFamily: theme.fontFamily,
|
|
11
|
+
lineHeight: theme.lineHeight,
|
|
5
12
|
});
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
15
|
* Returns font styles specifically for input components
|
|
9
16
|
*/
|
|
10
|
-
export const inputFontStyles = (theme:
|
|
17
|
+
export const inputFontStyles = (theme: MantineThemeBase) => () => {
|
|
18
|
+
return {
|
|
19
|
+
fontFamily: theme.fontFamilyInput,
|
|
20
|
+
fontSize: theme.fontSizes.md,
|
|
21
|
+
lineHeight: theme.lineHeights.md,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get font size from theme
|
|
27
|
+
* @param size - Size key or number
|
|
28
|
+
*/
|
|
29
|
+
export const fontSize = (theme: MantineThemeBase) => (size: MantineNumberSize) => {
|
|
30
|
+
return getSize({ size, sizes: theme.fontSizes });
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get line height from theme
|
|
35
|
+
* @param size - Size key or number (unitless multiplier)
|
|
36
|
+
*/
|
|
37
|
+
export const lineHeight = (theme: MantineThemeBase) => (size: MantineNumberSize) => {
|
|
38
|
+
return getSize({ size, sizes: theme.lineHeights });
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get heading styles by order
|
|
43
|
+
* @param order - Heading level (1-6)
|
|
44
|
+
*/
|
|
45
|
+
export const headingStyles = (theme: MantineThemeBase) => (order: 1 | 2 | 3 | 4 | 5 | 6) => {
|
|
46
|
+
const headingKey = `h${order}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
47
|
+
const heading = theme.headings.sizes[headingKey];
|
|
48
|
+
|
|
11
49
|
return {
|
|
12
|
-
|
|
50
|
+
fontSize: heading.fontSize,
|
|
51
|
+
lineHeight: heading.lineHeight * heading.fontSize,
|
|
52
|
+
fontWeight: (heading.fontWeight ?? theme.headings.fontWeight ?? theme.fontWeights.bold) as TextStyle['fontWeight'],
|
|
53
|
+
fontFamily: heading.fontFamily ?? theme.headings.fontFamily ?? theme.fontFamilyBold,
|
|
13
54
|
};
|
|
14
55
|
};
|
|
15
56
|
|
|
16
|
-
export const focusStyles = (_theme:
|
|
57
|
+
export const focusStyles = (_theme: MantineThemeBase) => () => ({
|
|
17
58
|
// Focus styles for accessibility
|
|
18
59
|
// In React Native, we typically don't use outline
|
|
19
60
|
// but can add other focus indicators if needed
|
|
20
61
|
});
|
|
21
62
|
|
|
22
|
-
export const placeholderStyles = (_theme:
|
|
63
|
+
export const placeholderStyles = (_theme: MantineThemeBase) => () => ({
|
|
23
64
|
// Placeholder styles for inputs
|
|
24
65
|
opacity: 0.6,
|
|
25
66
|
});
|
|
26
67
|
|
|
27
68
|
export const cover =
|
|
28
|
-
(_theme:
|
|
69
|
+
(_theme: MantineThemeBase) =>
|
|
29
70
|
(offset: number = 0) => ({
|
|
30
71
|
position: 'absolute' as const,
|
|
31
72
|
top: offset,
|
|
@@ -34,13 +75,13 @@ export const cover =
|
|
|
34
75
|
left: offset,
|
|
35
76
|
});
|
|
36
77
|
|
|
37
|
-
export const hover = (_theme:
|
|
78
|
+
export const hover = (_theme: MantineThemeBase) => (styles: any) => ({
|
|
38
79
|
// Hover styles (primarily for web, limited support in React Native)
|
|
39
80
|
// Can be applied via TouchableOpacity/Pressable activeOpacity instead
|
|
40
81
|
...styles,
|
|
41
82
|
});
|
|
42
83
|
|
|
43
|
-
export const activeStyles = (_theme:
|
|
84
|
+
export const activeStyles = (_theme: MantineThemeBase) => ({
|
|
44
85
|
// Active/pressed state styles
|
|
45
86
|
opacity: 0.8,
|
|
46
87
|
transform: [{ scale: 0.98 }],
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme helper functions
|
|
3
|
+
* Exports all utility functions for theme manipulation
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import { radius } from './radius';
|
|
2
7
|
import { rgba } from './rgba';
|
|
3
8
|
import { size } from './size';
|
|
4
9
|
import { themeColor } from './theme-color/theme-color';
|
|
5
10
|
import { variant } from './variant';
|
|
6
|
-
import { getPrimaryShade } from './primary-shade';
|
|
11
|
+
import { getPrimaryShade, getPrimaryColor } from './primary-shade';
|
|
7
12
|
import { shadow } from './shadow';
|
|
8
13
|
import { gradient } from './gradient/gradient';
|
|
9
14
|
import { lighten } from './lighten';
|
|
@@ -11,14 +16,59 @@ import { darken } from './darken';
|
|
|
11
16
|
import { dimmed } from './dimmed';
|
|
12
17
|
import { largerThan, smallerThan } from './breakpoints';
|
|
13
18
|
import * as helpers from './helpers';
|
|
19
|
+
import {
|
|
20
|
+
createColorSchemeValueFunction,
|
|
21
|
+
createColorSchemeConstantsFunction,
|
|
22
|
+
} from './color-scheme-value';
|
|
14
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Collection of all theme helper functions
|
|
26
|
+
* Used by attach-functions to create theme.fn object
|
|
27
|
+
*/
|
|
15
28
|
export const fns = {
|
|
29
|
+
// Color functions
|
|
30
|
+
themeColor,
|
|
31
|
+
getPrimaryShade,
|
|
32
|
+
getPrimaryColor,
|
|
33
|
+
|
|
34
|
+
// Variant function
|
|
35
|
+
variant,
|
|
36
|
+
|
|
37
|
+
// Color manipulation
|
|
38
|
+
rgba,
|
|
39
|
+
lighten,
|
|
40
|
+
darken,
|
|
41
|
+
dimmed,
|
|
42
|
+
|
|
43
|
+
// Size and spacing
|
|
44
|
+
radius,
|
|
45
|
+
size,
|
|
46
|
+
|
|
47
|
+
// Visual effects
|
|
48
|
+
shadow,
|
|
49
|
+
gradient,
|
|
50
|
+
|
|
51
|
+
// Responsive
|
|
52
|
+
largerThan,
|
|
53
|
+
smallerThan,
|
|
54
|
+
|
|
55
|
+
// Color scheme helpers
|
|
56
|
+
colorSchemeValue: createColorSchemeValueFunction,
|
|
57
|
+
colorSchemeConstants: createColorSchemeConstantsFunction,
|
|
58
|
+
|
|
59
|
+
// Helper functions from helpers module
|
|
60
|
+
...helpers,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Re-export individual functions for direct imports
|
|
64
|
+
export {
|
|
16
65
|
radius,
|
|
17
66
|
rgba,
|
|
18
67
|
size,
|
|
19
|
-
variant,
|
|
20
68
|
themeColor,
|
|
69
|
+
variant,
|
|
21
70
|
getPrimaryShade,
|
|
71
|
+
getPrimaryColor,
|
|
22
72
|
shadow,
|
|
23
73
|
gradient,
|
|
24
74
|
lighten,
|
|
@@ -26,5 +76,15 @@ export const fns = {
|
|
|
26
76
|
dimmed,
|
|
27
77
|
largerThan,
|
|
28
78
|
smallerThan,
|
|
29
|
-
...helpers,
|
|
30
79
|
};
|
|
80
|
+
|
|
81
|
+
// Re-export color scheme helpers
|
|
82
|
+
export {
|
|
83
|
+
colorSchemeValue,
|
|
84
|
+
resolveColorSchemeValue,
|
|
85
|
+
resolveColorSchemeConstants,
|
|
86
|
+
isColorSchemeValue,
|
|
87
|
+
createColorSchemeValueFunction,
|
|
88
|
+
createColorSchemeConstantsFunction,
|
|
89
|
+
} from './color-scheme-value';
|
|
90
|
+
export type { ColorSchemeValue, ResolveColorSchemeValue } from './color-scheme-value';
|
|
@@ -1,17 +1,93 @@
|
|
|
1
|
-
import type { MantineTheme } from '../../default-theme';
|
|
2
|
-
|
|
3
1
|
/**
|
|
2
|
+
* Primary shade helper function
|
|
4
3
|
* Returns the appropriate primary shade based on the current color scheme
|
|
5
|
-
*
|
|
4
|
+
* Aligned with Mantine web's primaryShade implementation
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { MantineThemeBase, ColorScheme, Shade } from '../../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Get the primary shade for the current color scheme
|
|
11
|
+
*
|
|
12
|
+
* If theme.primaryShade is a number, returns that number.
|
|
13
|
+
* If theme.primaryShade is an object with light/dark values, returns the
|
|
14
|
+
* appropriate value based on the color scheme.
|
|
15
|
+
*
|
|
16
|
+
* @param theme - Mantine theme object
|
|
17
|
+
* @param colorScheme - Optional color scheme override (light or dark)
|
|
18
|
+
* @returns Shade value (0-9)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // With theme.primaryShade = { light: 6, dark: 8 }
|
|
22
|
+
* // and theme.colorScheme = 'light'
|
|
23
|
+
* getPrimaryShade(theme) // returns 6
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // With explicit colorScheme override
|
|
27
|
+
* getPrimaryShade(theme, 'dark') // returns 8
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // With theme.primaryShade = 7 (single number)
|
|
31
|
+
* getPrimaryShade(theme) // returns 7
|
|
6
32
|
*/
|
|
7
|
-
export function getPrimaryShade(
|
|
8
|
-
|
|
9
|
-
colorScheme?: 'light' | 'dark'
|
|
10
|
-
): number {
|
|
33
|
+
export function getPrimaryShade(theme: MantineThemeBase, colorScheme?: ColorScheme): Shade {
|
|
34
|
+
// If primaryShade is a single number, return it directly
|
|
11
35
|
if (typeof theme.primaryShade === 'number') {
|
|
12
36
|
return theme.primaryShade;
|
|
13
37
|
}
|
|
14
38
|
|
|
15
|
-
|
|
39
|
+
// Determine which color scheme to use
|
|
40
|
+
// Priority: 1. parameter override, 2. theme.colorScheme, 3. default to 'light'
|
|
41
|
+
const scheme = colorScheme || theme.colorScheme || 'light';
|
|
42
|
+
|
|
43
|
+
// Return the appropriate shade for the color scheme
|
|
16
44
|
return theme.primaryShade[scheme];
|
|
17
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Curried version of getPrimaryShade for use with theme.fn
|
|
49
|
+
* Matches Mantine web's theme.fn.primaryShade signature
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export function createPrimaryShadeFunction(theme: MantineThemeBase) {
|
|
54
|
+
return (colorScheme?: ColorScheme): Shade => {
|
|
55
|
+
return getPrimaryShade(theme, colorScheme);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get the primary color at the primary shade
|
|
61
|
+
*
|
|
62
|
+
* @param theme - Mantine theme object
|
|
63
|
+
* @param colorScheme - Optional color scheme override
|
|
64
|
+
* @returns Color string value
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Get primary color at primary shade
|
|
68
|
+
* getPrimaryColor(theme) // returns '#228be6' (blue[6])
|
|
69
|
+
*/
|
|
70
|
+
export function getPrimaryColor(theme: MantineThemeBase, colorScheme?: ColorScheme): string {
|
|
71
|
+
const shade = getPrimaryShade(theme, colorScheme);
|
|
72
|
+
const primaryPalette = theme.colors[theme.primaryColor];
|
|
73
|
+
|
|
74
|
+
if (!primaryPalette) {
|
|
75
|
+
console.warn(
|
|
76
|
+
`Primary color "${theme.primaryColor}" not found in theme.colors. Falling back to 'blue'.`
|
|
77
|
+
);
|
|
78
|
+
return theme.colors.blue?.[shade] || '#228be6';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return primaryPalette[shade] || primaryPalette[0] || '#228be6';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Curried version of getPrimaryColor for use with theme.fn
|
|
86
|
+
*
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
export function createPrimaryColorFunction(theme: MantineThemeBase) {
|
|
90
|
+
return (colorScheme?: ColorScheme): string => {
|
|
91
|
+
return getPrimaryColor(theme, colorScheme);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -84,7 +84,7 @@ const SHADOW_CONFIG: Record<MantineShadow, { ios: ShadowStyles; android: ShadowS
|
|
|
84
84
|
* // Android will get: { elevation: 4 }
|
|
85
85
|
* const shadowStyles = shadow('md');
|
|
86
86
|
*/
|
|
87
|
-
export function shadow(size?:
|
|
87
|
+
export function shadow(size?: MantineSize): ShadowStyles {
|
|
88
88
|
if (!size) {
|
|
89
89
|
return {};
|
|
90
90
|
}
|
|
@@ -6,9 +6,10 @@ export function size(_theme: any) {
|
|
|
6
6
|
size,
|
|
7
7
|
sizes,
|
|
8
8
|
}: {
|
|
9
|
-
size
|
|
9
|
+
size?: MantineNumberSize | (string & {});
|
|
10
10
|
sizes: Sizes;
|
|
11
|
-
}): number => {
|
|
12
|
-
|
|
11
|
+
}): number | string => {
|
|
12
|
+
if (!size) return 0;
|
|
13
|
+
return getSize({ size: size as MantineNumberSize, sizes }) as number | string;
|
|
13
14
|
};
|
|
14
15
|
}
|