react-native-mantine 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/lib/commonjs/components/Button/index.js +52 -17
  2. package/lib/commonjs/components/Button/index.js.map +1 -1
  3. package/lib/commonjs/components/Code/index.js +3 -1
  4. package/lib/commonjs/components/Code/index.js.map +1 -1
  5. package/lib/commonjs/components/Gradient/Gradient.js +70 -0
  6. package/lib/commonjs/components/Gradient/Gradient.js.map +1 -0
  7. package/lib/commonjs/components/Gradient/index.js +19 -0
  8. package/lib/commonjs/components/Gradient/index.js.map +1 -0
  9. package/lib/commonjs/components/Modal/index.js +33 -3
  10. package/lib/commonjs/components/Modal/index.js.map +1 -1
  11. package/lib/commonjs/components/Paper/index.js +1 -76
  12. package/lib/commonjs/components/Paper/index.js.map +1 -1
  13. package/lib/commonjs/components/Text/index.js +27 -8
  14. package/lib/commonjs/components/Text/index.js.map +1 -1
  15. package/lib/commonjs/components/ThemeIcon/index.js +6 -4
  16. package/lib/commonjs/components/ThemeIcon/index.js.map +1 -1
  17. package/lib/commonjs/components/Title/index.js +7 -3
  18. package/lib/commonjs/components/Title/index.js.map +1 -1
  19. package/lib/commonjs/components/index.js +33 -22
  20. package/lib/commonjs/components/index.js.map +1 -1
  21. package/lib/commonjs/theme/create-theme.js +3 -5
  22. package/lib/commonjs/theme/create-theme.js.map +1 -1
  23. package/lib/commonjs/theme/default-theme.js +168 -21
  24. package/lib/commonjs/theme/default-theme.js.map +1 -1
  25. package/lib/commonjs/theme/functions/attach-functions.js +7 -1
  26. package/lib/commonjs/theme/functions/attach-functions.js.map +1 -1
  27. package/lib/commonjs/theme/functions/fns/breakpoints.js +69 -0
  28. package/lib/commonjs/theme/functions/fns/breakpoints.js.map +1 -0
  29. package/lib/commonjs/theme/functions/fns/darken.js +25 -0
  30. package/lib/commonjs/theme/functions/fns/darken.js.map +1 -0
  31. package/lib/commonjs/theme/functions/fns/dimmed.js +19 -0
  32. package/lib/commonjs/theme/functions/fns/dimmed.js.map +1 -0
  33. package/lib/commonjs/theme/functions/fns/gradient/gradient.js +78 -0
  34. package/lib/commonjs/theme/functions/fns/gradient/gradient.js.map +1 -0
  35. package/lib/commonjs/theme/functions/fns/helpers.js +1 -2
  36. package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
  37. package/lib/commonjs/theme/functions/fns/index.js +15 -0
  38. package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
  39. package/lib/commonjs/theme/functions/fns/lighten.js +24 -0
  40. package/lib/commonjs/theme/functions/fns/lighten.js.map +1 -0
  41. package/lib/commonjs/theme/functions/fns/primary-shade.js +18 -0
  42. package/lib/commonjs/theme/functions/fns/primary-shade.js.map +1 -0
  43. package/lib/commonjs/theme/functions/fns/shadow.js +107 -0
  44. package/lib/commonjs/theme/functions/fns/shadow.js.map +1 -0
  45. package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js +3 -2
  46. package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js.map +1 -1
  47. package/lib/commonjs/theme/functions/fns/variant.js +7 -6
  48. package/lib/commonjs/theme/functions/fns/variant.js.map +1 -1
  49. package/lib/commonjs/theme/index.js +14 -0
  50. package/lib/commonjs/theme/index.js.map +1 -1
  51. package/lib/commonjs/theme/theme-provider.js +10 -3
  52. package/lib/commonjs/theme/theme-provider.js.map +1 -1
  53. package/lib/commonjs/theme/utils/to-rgba.js +57 -0
  54. package/lib/commonjs/theme/utils/to-rgba.js.map +1 -0
  55. package/lib/module/components/Button/index.js +53 -18
  56. package/lib/module/components/Button/index.js.map +1 -1
  57. package/lib/module/components/Code/index.js +3 -1
  58. package/lib/module/components/Code/index.js.map +1 -1
  59. package/lib/module/components/Gradient/Gradient.js +64 -0
  60. package/lib/module/components/Gradient/Gradient.js.map +1 -0
  61. package/lib/module/components/Gradient/index.js +4 -0
  62. package/lib/module/components/Gradient/index.js.map +1 -0
  63. package/lib/module/components/Modal/index.js +35 -5
  64. package/lib/module/components/Modal/index.js.map +1 -1
  65. package/lib/module/components/Paper/index.js +1 -76
  66. package/lib/module/components/Paper/index.js.map +1 -1
  67. package/lib/module/components/Text/index.js +27 -8
  68. package/lib/module/components/Text/index.js.map +1 -1
  69. package/lib/module/components/ThemeIcon/index.js +6 -4
  70. package/lib/module/components/ThemeIcon/index.js.map +1 -1
  71. package/lib/module/components/Title/index.js +7 -3
  72. package/lib/module/components/Title/index.js.map +1 -1
  73. package/lib/module/components/index.js +1 -0
  74. package/lib/module/components/index.js.map +1 -1
  75. package/lib/module/theme/create-theme.js +3 -5
  76. package/lib/module/theme/create-theme.js.map +1 -1
  77. package/lib/module/theme/default-theme.js +168 -21
  78. package/lib/module/theme/default-theme.js.map +1 -1
  79. package/lib/module/theme/functions/attach-functions.js +7 -1
  80. package/lib/module/theme/functions/attach-functions.js.map +1 -1
  81. package/lib/module/theme/functions/fns/breakpoints.js +64 -0
  82. package/lib/module/theme/functions/fns/breakpoints.js.map +1 -0
  83. package/lib/module/theme/functions/fns/darken.js +22 -0
  84. package/lib/module/theme/functions/fns/darken.js.map +1 -0
  85. package/lib/module/theme/functions/fns/dimmed.js +15 -0
  86. package/lib/module/theme/functions/fns/dimmed.js.map +1 -0
  87. package/lib/module/theme/functions/fns/gradient/gradient.js +74 -0
  88. package/lib/module/theme/functions/fns/gradient/gradient.js.map +1 -0
  89. package/lib/module/theme/functions/fns/helpers.js +1 -2
  90. package/lib/module/theme/functions/fns/helpers.js.map +1 -1
  91. package/lib/module/theme/functions/fns/index.js +15 -0
  92. package/lib/module/theme/functions/fns/index.js.map +1 -1
  93. package/lib/module/theme/functions/fns/lighten.js +21 -0
  94. package/lib/module/theme/functions/fns/lighten.js.map +1 -0
  95. package/lib/module/theme/functions/fns/primary-shade.js +14 -0
  96. package/lib/module/theme/functions/fns/primary-shade.js.map +1 -0
  97. package/lib/module/theme/functions/fns/shadow.js +103 -0
  98. package/lib/module/theme/functions/fns/shadow.js.map +1 -0
  99. package/lib/module/theme/functions/fns/theme-color/theme-color.js +3 -2
  100. package/lib/module/theme/functions/fns/theme-color/theme-color.js.map +1 -1
  101. package/lib/module/theme/functions/fns/variant.js +7 -6
  102. package/lib/module/theme/functions/fns/variant.js.map +1 -1
  103. package/lib/module/theme/index.js +2 -0
  104. package/lib/module/theme/index.js.map +1 -1
  105. package/lib/module/theme/theme-provider.js +10 -3
  106. package/lib/module/theme/theme-provider.js.map +1 -1
  107. package/lib/module/theme/utils/to-rgba.js +53 -0
  108. package/lib/module/theme/utils/to-rgba.js.map +1 -0
  109. package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/src/components/Code/index.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/src/components/Gradient/Gradient.d.ts +32 -0
  112. package/lib/typescript/commonjs/src/components/Gradient/Gradient.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/src/components/Gradient/index.d.ts +3 -0
  114. package/lib/typescript/commonjs/src/components/Gradient/index.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/src/components/Modal/index.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/src/components/Paper/index.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/src/components/Text/index.d.ts.map +1 -1
  118. package/lib/typescript/commonjs/src/components/ThemeIcon/index.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/src/components/Title/index.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/src/components/index.d.ts +1 -0
  121. package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/src/theme/create-theme.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/src/theme/default-theme.d.ts +34 -3
  124. package/lib/typescript/commonjs/src/theme/default-theme.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts +15 -0
  127. package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts.map +1 -0
  128. package/lib/typescript/commonjs/src/theme/functions/fns/darken.d.ts +8 -0
  129. package/lib/typescript/commonjs/src/theme/functions/fns/darken.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts +9 -0
  131. package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts +13 -0
  133. package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +1 -2
  135. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +16 -1
  137. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/src/theme/functions/fns/lighten.d.ts +8 -0
  139. package/lib/typescript/commonjs/src/theme/functions/fns/lighten.d.ts.map +1 -0
  140. package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts +7 -0
  141. package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts.map +1 -0
  142. package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts +24 -0
  143. package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts.map +1 -0
  144. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/src/theme/index.d.ts +4 -0
  147. package/lib/typescript/commonjs/src/theme/index.d.ts.map +1 -1
  148. package/lib/typescript/commonjs/src/theme/theme-provider.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/src/theme/utils/to-rgba.d.ts +9 -0
  150. package/lib/typescript/commonjs/src/theme/utils/to-rgba.d.ts.map +1 -0
  151. package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
  152. package/lib/typescript/module/src/components/Code/index.d.ts.map +1 -1
  153. package/lib/typescript/module/src/components/Gradient/Gradient.d.ts +32 -0
  154. package/lib/typescript/module/src/components/Gradient/Gradient.d.ts.map +1 -0
  155. package/lib/typescript/module/src/components/Gradient/index.d.ts +3 -0
  156. package/lib/typescript/module/src/components/Gradient/index.d.ts.map +1 -0
  157. package/lib/typescript/module/src/components/Modal/index.d.ts.map +1 -1
  158. package/lib/typescript/module/src/components/Paper/index.d.ts.map +1 -1
  159. package/lib/typescript/module/src/components/Text/index.d.ts.map +1 -1
  160. package/lib/typescript/module/src/components/ThemeIcon/index.d.ts.map +1 -1
  161. package/lib/typescript/module/src/components/Title/index.d.ts.map +1 -1
  162. package/lib/typescript/module/src/components/index.d.ts +1 -0
  163. package/lib/typescript/module/src/components/index.d.ts.map +1 -1
  164. package/lib/typescript/module/src/theme/create-theme.d.ts.map +1 -1
  165. package/lib/typescript/module/src/theme/default-theme.d.ts +34 -3
  166. package/lib/typescript/module/src/theme/default-theme.d.ts.map +1 -1
  167. package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -1
  168. package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts +15 -0
  169. package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts.map +1 -0
  170. package/lib/typescript/module/src/theme/functions/fns/darken.d.ts +8 -0
  171. package/lib/typescript/module/src/theme/functions/fns/darken.d.ts.map +1 -0
  172. package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts +9 -0
  173. package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts.map +1 -0
  174. package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts +13 -0
  175. package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -0
  176. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +1 -2
  177. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts.map +1 -1
  178. package/lib/typescript/module/src/theme/functions/fns/index.d.ts +16 -1
  179. package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
  180. package/lib/typescript/module/src/theme/functions/fns/lighten.d.ts +8 -0
  181. package/lib/typescript/module/src/theme/functions/fns/lighten.d.ts.map +1 -0
  182. package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts +7 -0
  183. package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts.map +1 -0
  184. package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts +24 -0
  185. package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts.map +1 -0
  186. package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -1
  187. package/lib/typescript/module/src/theme/functions/fns/variant.d.ts.map +1 -1
  188. package/lib/typescript/module/src/theme/index.d.ts +4 -0
  189. package/lib/typescript/module/src/theme/index.d.ts.map +1 -1
  190. package/lib/typescript/module/src/theme/theme-provider.d.ts.map +1 -1
  191. package/lib/typescript/module/src/theme/utils/to-rgba.d.ts +9 -0
  192. package/lib/typescript/module/src/theme/utils/to-rgba.d.ts.map +1 -0
  193. package/package.json +1 -1
  194. package/src/components/Button/index.tsx +61 -21
  195. package/src/components/Code/index.tsx +3 -1
  196. package/src/components/Gradient/Gradient.tsx +71 -0
  197. package/src/components/Gradient/index.tsx +2 -0
  198. package/src/components/Modal/index.tsx +33 -3
  199. package/src/components/Paper/index.tsx +1 -63
  200. package/src/components/Text/index.tsx +28 -16
  201. package/src/components/ThemeIcon/index.tsx +6 -4
  202. package/src/components/Title/index.tsx +7 -3
  203. package/src/components/index.tsx +1 -0
  204. package/src/theme/create-theme.ts +3 -5
  205. package/src/theme/default-theme.ts +179 -91
  206. package/src/theme/functions/attach-functions.ts +6 -0
  207. package/src/theme/functions/fns/breakpoints.ts +62 -0
  208. package/src/theme/functions/fns/darken.ts +16 -0
  209. package/src/theme/functions/fns/dimmed.ts +16 -0
  210. package/src/theme/functions/fns/gradient/gradient.ts +63 -0
  211. package/src/theme/functions/fns/helpers.ts +1 -2
  212. package/src/theme/functions/fns/index.ts +15 -0
  213. package/src/theme/functions/fns/lighten.ts +15 -0
  214. package/src/theme/functions/fns/primary-shade.ts +17 -0
  215. package/src/theme/functions/fns/shadow.ts +100 -0
  216. package/src/theme/functions/fns/theme-color/theme-color.ts +3 -2
  217. package/src/theme/functions/fns/variant.ts +6 -5
  218. package/src/theme/index.tsx +4 -0
  219. package/src/theme/theme-provider.tsx +8 -3
  220. package/src/theme/theme.d.ts +11 -1
  221. package/src/theme/utils/to-rgba.ts +69 -0
@@ -1,3 +1,4 @@
1
+ import { Platform } from 'react-native';
1
2
  import { attachFunctions } from './functions/attach-functions';
2
3
  import type { Palette } from './theme';
3
4
 
@@ -5,54 +6,42 @@ export const DEFAULT_COLORS: {
5
6
  [key: string]: Palette;
6
7
  } = {
7
8
  dark: [
8
- '#2E2E2E',
9
- '#2A2A2A',
10
- '#262626',
11
- '#232323',
12
- '#1F1F1F',
13
- '#1D1D1D',
14
- '#1A1A1A',
15
- '#171717',
16
- '#151515',
17
- '#131313',
9
+ '#C1C2C5',
10
+ '#A6A7AB',
11
+ '#909296',
12
+ '#5c5f66',
13
+ '#373A40',
14
+ '#2C2E33',
15
+ '#25262b',
16
+ '#1A1B1E',
17
+ '#141517',
18
+ '#101113',
18
19
  ],
19
20
 
20
21
  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',
22
+ '#f8f9fa',
23
+ '#f1f3f5',
24
+ '#e9ecef',
25
+ '#dee2e6',
26
+ '#ced4da',
27
+ '#adb5bd',
28
+ '#868e96',
29
+ '#495057',
30
+ '#343a40',
31
+ '#212529',
43
32
  ],
44
33
 
45
34
  red: [
46
- '#ffeaea',
47
- '#fcd4d4',
48
- '#f3a8a8',
49
- '#eb7877',
50
- '#e4504f',
51
- '#e13735',
52
- '#e02928',
53
- '#c71c1c',
54
- '#b21518',
55
- '#9c0711',
35
+ '#fff5f5',
36
+ '#ffe3e3',
37
+ '#ffc9c9',
38
+ '#ffa8a8',
39
+ '#ff8787',
40
+ '#ff6b6b',
41
+ '#fa5252',
42
+ '#f03e3e',
43
+ '#e03131',
44
+ '#c92a2a',
56
45
  ],
57
46
 
58
47
  pink: [
@@ -147,16 +136,16 @@ export const DEFAULT_COLORS: {
147
136
  ],
148
137
 
149
138
  green: [
150
- '#f4ffeb',
151
- '#e7fdd5',
152
- '#cbfca5',
153
- '#aefb71',
154
- '#95f948',
155
- '#86f933',
156
- '#7ef928',
157
- '#6bdd1e',
158
- '#5dc416',
159
- '#4daa04',
139
+ '#ebfbee',
140
+ '#d3f9d8',
141
+ '#b2f2bb',
142
+ '#8ce99a',
143
+ '#69db7c',
144
+ '#51cf66',
145
+ '#40c057',
146
+ '#37b24d',
147
+ '#2f9e44',
148
+ '#2b8a3e',
160
149
  ],
161
150
 
162
151
  lime: [
@@ -186,28 +175,16 @@ export const DEFAULT_COLORS: {
186
175
  ],
187
176
 
188
177
  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',
178
+ '#fff4e6',
179
+ '#ffe8cc',
180
+ '#ffd8a8',
181
+ '#ffc078',
182
+ '#ffa94d',
183
+ '#ff922b',
184
+ '#fd7e14',
185
+ '#f76707',
186
+ '#e8590c',
187
+ '#d9480f',
211
188
  ],
212
189
  };
213
190
 
@@ -215,18 +192,66 @@ const tintColorLight = '#2f95dc';
215
192
  const tintColorDark = '#fff';
216
193
 
217
194
  export const _DEFAULT_THEME: MantineTheme = {
218
- fontFamily: 'System font',
219
- fontFamilyBold: 'System font',
220
- fontFamilySemiBold: 'System font',
221
- fontFamilyInput: 'System font',
195
+ // Font configuration matches Mantine web as closely as possible
196
+ // Web: '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji'
197
+ // React Native maps to platform-specific system fonts
198
+ fontFamily: Platform.select({
199
+ ios: 'System', // San Francisco (equivalent to -apple-system)
200
+ android: 'Roboto', // Android system font
201
+ default: 'System',
202
+ }),
203
+ // Bold font family - iOS/Android don't always render fontWeight properly
204
+ // so we need separate font families for different weights
205
+ fontFamilyBold: Platform.select({
206
+ ios: 'System', // iOS handles bold via fontWeight with System font
207
+ android: 'Roboto-Bold', // Android needs explicit bold font family
208
+ default: 'System',
209
+ }),
210
+ // SemiBold font family
211
+ fontFamilySemiBold: Platform.select({
212
+ ios: 'System', // iOS handles semibold via fontWeight with System font
213
+ android: 'Roboto-Medium', // Android medium is equivalent to semibold
214
+ default: 'System',
215
+ }),
216
+ // Input font family - separate for form inputs
217
+ fontFamilyInput: Platform.select({
218
+ ios: 'System',
219
+ android: 'Roboto',
220
+ default: 'System',
221
+ }),
222
+ // Web: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace'
223
+ fontFamilyMonospace: Platform.select({
224
+ ios: 'Menlo', // iOS monospace font
225
+ android: 'monospace', // Android monospace font
226
+ default: 'monospace',
227
+ }),
228
+ fontWeights: {
229
+ thin: '100',
230
+ extralight: '200',
231
+ light: '300',
232
+ normal: '400',
233
+ medium: '500',
234
+ semibold: '600',
235
+ bold: '700',
236
+ extrabold: '800',
237
+ black: '900',
238
+ },
222
239
  localColor: '#1F2863',
223
- primaryShade: 6,
240
+ primaryShade: {
241
+ light: 6,
242
+ dark: 8,
243
+ },
224
244
  colors: DEFAULT_COLORS,
225
245
  primaryColor: 'blue',
226
246
  secondaryColor: 'black',
227
247
  secondaryBgColor: 'white',
228
248
  white: '#ffffff',
229
249
  black: '#000000',
250
+ defaultGradient: {
251
+ from: 'blue',
252
+ to: 'cyan',
253
+ deg: 45,
254
+ },
230
255
  light: {
231
256
  text: '#000',
232
257
  background: '#fdfdfd',
@@ -247,13 +272,29 @@ export const _DEFAULT_THEME: MantineTheme = {
247
272
  },
248
273
  components: {},
249
274
  other: {},
250
- shadows: {
251
- xs: '0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)',
252
- 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',
253
- 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',
254
- 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',
255
- 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',
256
- },
275
+ shadows: Platform.select({
276
+ ios: {
277
+ xs: { shadowColor: '#000', shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.05, shadowRadius: 1 },
278
+ sm: { shadowColor: '#000', shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.1, shadowRadius: 2 },
279
+ md: { shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.15, shadowRadius: 4 },
280
+ lg: { shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.2, shadowRadius: 8 },
281
+ xl: { shadowColor: '#000', shadowOffset: { width: 0, height: 8 }, shadowOpacity: 0.25, shadowRadius: 16 },
282
+ },
283
+ android: {
284
+ xs: { elevation: 1 },
285
+ sm: { elevation: 2 },
286
+ md: { elevation: 4 },
287
+ lg: { elevation: 8 },
288
+ xl: { elevation: 12 },
289
+ },
290
+ default: {
291
+ xs: { elevation: 1 },
292
+ sm: { elevation: 2 },
293
+ md: { elevation: 4 },
294
+ lg: { elevation: 8 },
295
+ xl: { elevation: 12 },
296
+ },
297
+ }),
257
298
 
258
299
  fontSizes: {
259
300
  xs: 12,
@@ -279,9 +320,22 @@ export const _DEFAULT_THEME: MantineTheme = {
279
320
  lg: 20,
280
321
  xl: 24,
281
322
  },
323
+ breakpoints: {
324
+ xs: 576,
325
+ sm: 768,
326
+ md: 992,
327
+ lg: 1200,
328
+ xl: 1408,
329
+ },
282
330
  headings: {
283
- fontFamily: 'System font',
284
- fontWeight: 700,
331
+ // Headings use bold font family for proper weight rendering on iOS/Android
332
+ // On Android, using Roboto-Bold ensures proper bold rendering
333
+ fontFamily: Platform.select({
334
+ ios: 'System', // San Francisco (equivalent to -apple-system)
335
+ android: 'Roboto-Bold', // Android needs explicit bold font family
336
+ default: 'System',
337
+ }),
338
+ fontWeight: '700', // Matches Mantine web heading weight
285
339
  sizes: {
286
340
  h1: { fontSize: 34, lineHeight: 1.3, fontWeight: undefined },
287
341
  h2: { fontSize: 26, lineHeight: 1.35, fontWeight: undefined },
@@ -327,7 +381,7 @@ export type HeadingStyle = {
327
381
 
328
382
  export type MantineHeadings = {
329
383
  fontFamily?: string;
330
- fontWeight?: number;
384
+ fontWeight?: string;
331
385
  sizes: {
332
386
  h1: HeadingStyle;
333
387
  h2: HeadingStyle;
@@ -338,23 +392,51 @@ export type MantineHeadings = {
338
392
  };
339
393
  };
340
394
 
395
+ export type FontWeights = {
396
+ thin: string;
397
+ extralight: string;
398
+ light: string;
399
+ normal: string;
400
+ medium: string;
401
+ semibold: string;
402
+ bold: string;
403
+ extrabold: string;
404
+ black: string;
405
+ };
406
+
341
407
  export type themeMode = 'dark' | 'light';
342
408
 
409
+ type Shade = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
410
+
411
+ export interface MantinePrimaryShade {
412
+ light: Shade;
413
+ dark: Shade;
414
+ }
415
+
343
416
  export type MantineTheme = {
344
417
  fontFamily: string;
345
418
  fontFamilyBold: string;
419
+ fontFamilySemiBold: string;
420
+ fontFamilyInput: string;
421
+ fontFamilyMonospace: string;
422
+ fontWeights: FontWeights;
346
423
 
347
424
  localColor: string;
348
425
 
349
426
  currentMode?: themeMode;
350
427
  toggleMode?: () => void;
351
- primaryShade: number;
428
+ primaryShade: Shade | MantinePrimaryShade;
352
429
  colors: { [key: string]: Palette };
353
430
  primaryColor: string;
354
431
  secondaryColor: string;
355
432
  secondaryBgColor: string;
356
433
  white: string;
357
434
  black: string;
435
+ defaultGradient?: {
436
+ from: string;
437
+ to: string;
438
+ deg: number;
439
+ };
358
440
 
359
441
  light: ColorScheme;
360
442
  dark: ColorScheme;
@@ -363,10 +445,16 @@ export type MantineTheme = {
363
445
  [key: string]: any;
364
446
  };
365
447
  shadows: {
366
- [key: string]: string;
448
+ xs: any;
449
+ sm: any;
450
+ md: any;
451
+ lg: any;
452
+ xl: any;
453
+ [key: string]: any;
367
454
  };
368
455
  radius: ThemeSize;
369
456
  fontSizes: ThemeSize;
457
+ breakpoints: ThemeSize;
370
458
  headings: MantineHeadings;
371
459
  window: {
372
460
  width: number;
@@ -10,12 +10,18 @@ export function attachFunctions(themeBase: any): any {
10
10
  variant: fns.variant(themeBase),
11
11
  themeColor: (color: string, shade?: number) =>
12
12
  fns.themeColor({ theme: themeBase, color, shade }),
13
+ shadow: fns.shadow,
13
14
  fontStyles: fns.fontStyles(themeBase),
14
15
  inputFontStyles: fns.inputFontStyles(themeBase),
15
16
  focusStyles: fns.focusStyles(themeBase),
16
17
  placeholderStyles: fns.placeholderStyles(themeBase),
17
18
  cover: fns.cover(themeBase),
18
19
  hover: fns.hover(themeBase),
20
+ lighten: fns.lighten,
21
+ darken: fns.darken,
22
+ dimmed: fns.dimmed(themeBase),
23
+ largerThan: fns.largerThan(themeBase),
24
+ smallerThan: fns.smallerThan(themeBase),
19
25
  },
20
26
  activeStyles: fns.activeStyles(themeBase),
21
27
  };
@@ -0,0 +1,62 @@
1
+ import { Dimensions } from 'react-native';
2
+ import type { MantineTheme } from '../../default-theme';
3
+
4
+ /**
5
+ * Default breakpoint values in pixels
6
+ * These match Mantine web but converted to pixels (1em = 16px)
7
+ */
8
+ const DEFAULT_BREAKPOINTS = {
9
+ xs: 576, // 36em * 16
10
+ sm: 768, // 48em * 16
11
+ md: 992, // 62em * 16
12
+ lg: 1200, // 75em * 16
13
+ xl: 1408, // 88em * 16
14
+ };
15
+
16
+ export type MantineNumberSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
17
+
18
+ /**
19
+ * Get breakpoint value from theme or default
20
+ */
21
+ function getBreakpointValue(
22
+ breakpoint: MantineNumberSize,
23
+ theme: MantineTheme
24
+ ): number {
25
+ if (typeof breakpoint === 'number') {
26
+ return breakpoint;
27
+ }
28
+
29
+ // Check if theme has breakpoints defined
30
+ if (theme.breakpoints && theme.breakpoints[breakpoint]) {
31
+ const value = theme.breakpoints[breakpoint];
32
+ return typeof value === 'number' ? value : Number(value);
33
+ }
34
+
35
+ return DEFAULT_BREAKPOINTS[breakpoint as keyof typeof DEFAULT_BREAKPOINTS];
36
+ }
37
+
38
+ /**
39
+ * Returns true if current screen width is larger than the specified breakpoint
40
+ * @param theme - The Mantine theme
41
+ * @returns A function that takes a breakpoint and returns a boolean
42
+ */
43
+ export function largerThan(theme: MantineTheme) {
44
+ return (breakpoint: MantineNumberSize): boolean => {
45
+ const { width } = Dimensions.get('window');
46
+ const breakpointValue = getBreakpointValue(breakpoint, theme);
47
+ return width >= breakpointValue;
48
+ };
49
+ }
50
+
51
+ /**
52
+ * Returns true if current screen width is smaller than the specified breakpoint
53
+ * @param theme - The Mantine theme
54
+ * @returns A function that takes a breakpoint and returns a boolean
55
+ */
56
+ export function smallerThan(theme: MantineTheme) {
57
+ return (breakpoint: MantineNumberSize): boolean => {
58
+ const { width } = Dimensions.get('window');
59
+ const breakpointValue = getBreakpointValue(breakpoint, theme);
60
+ return width < breakpointValue;
61
+ };
62
+ }
@@ -0,0 +1,16 @@
1
+ import { toRgba } from '../../utils/to-rgba';
2
+
3
+ /**
4
+ * Darkens a color by reducing its RGB values
5
+ * @param color - The color to darken (hex or rgb/rgba string)
6
+ * @param alpha - The amount to darken (0-1, where 1 is completely black)
7
+ * @returns rgba color string
8
+ */
9
+ export function darken(color: string, alpha: number): string {
10
+ const { r, g, b, a } = toRgba(color);
11
+ const f = 1 - alpha;
12
+
13
+ const dark = (input: number) => Math.round(input * f);
14
+
15
+ return `rgba(${dark(r)}, ${dark(g)}, ${dark(b)}, ${a})`;
16
+ }
@@ -0,0 +1,16 @@
1
+ import type { MantineTheme } from '../../default-theme';
2
+
3
+ /**
4
+ * Returns a dimmed text color based on the current color scheme
5
+ * Used for secondary text and less prominent UI elements
6
+ * @param theme - The Mantine theme
7
+ * @returns A function that returns the dimmed color
8
+ */
9
+ export function dimmed(theme: MantineTheme) {
10
+ return () => {
11
+ const colorScheme = theme.currentMode || 'light';
12
+ return colorScheme === 'dark'
13
+ ? theme.colors.dark?.[2] || '#909296'
14
+ : theme.colors.gray?.[6] || '#868e96';
15
+ };
16
+ }
@@ -0,0 +1,63 @@
1
+ import type { MantineTheme } from '../../../default-theme';
2
+ import type { MantineGradient, GradientConfig } from '../../../theme.d';
3
+ import { themeColor } from '../theme-color/theme-color';
4
+ import { getPrimaryShade } from '../primary-shade';
5
+
6
+ /**
7
+ * Converts degrees to start/end coordinates for LinearGradient
8
+ * 0deg = bottom to top, 90deg = left to right, 180deg = top to bottom, 270deg = right to left
9
+ */
10
+ function degToCoordinates(deg: number): { start: { x: number; y: number }; end: { x: number; y: number } } {
11
+ const angle = ((deg % 360) + 360) % 360; // Normalize to 0-360
12
+ const radians = (angle * Math.PI) / 180;
13
+
14
+ // Calculate end point on unit circle
15
+ const endX = Math.cos(radians - Math.PI / 2);
16
+ const endY = Math.sin(radians - Math.PI / 2);
17
+
18
+ // Normalize to 0-1 range
19
+ const start = {
20
+ x: (1 - endX) / 2,
21
+ y: (1 - endY) / 2,
22
+ };
23
+ const end = {
24
+ x: (1 + endX) / 2,
25
+ y: (1 + endY) / 2,
26
+ };
27
+
28
+ return { start, end };
29
+ }
30
+
31
+ /**
32
+ * Creates a gradient configuration for use with expo-linear-gradient
33
+ * Returns gradient colors and coordinates based on theme gradient settings
34
+ */
35
+ export function gradient(theme: MantineTheme) {
36
+ return (payload?: MantineGradient): GradientConfig => {
37
+ const merged = {
38
+ from: payload?.from || theme.defaultGradient?.from || theme.primaryColor,
39
+ to: payload?.to || theme.defaultGradient?.to || theme.primaryColor,
40
+ deg: payload?.deg ?? theme.defaultGradient?.deg ?? 45,
41
+ };
42
+
43
+ const primaryShade = getPrimaryShade(theme);
44
+ const fromColor = themeColor({ theme, color: merged.from, shade: primaryShade });
45
+ const toColor = themeColor({ theme, color: merged.to, shade: primaryShade });
46
+
47
+ const { start, end } = degToCoordinates(merged.deg);
48
+
49
+ return {
50
+ colors: [fromColor, toColor],
51
+ start,
52
+ end,
53
+ };
54
+ };
55
+ }
56
+
57
+ /**
58
+ * Legacy function for web compatibility - returns CSS gradient string
59
+ * Not used in React Native but kept for API compatibility
60
+ */
61
+ export function linearGradientCSS(deg: number, ...colors: string[]) {
62
+ return `linear-gradient(${deg}deg, ${colors.join(', ')})`;
63
+ }
@@ -6,11 +6,10 @@ export const fontStyles = (theme: MantineTheme) => () => ({
6
6
 
7
7
  /**
8
8
  * Returns font styles specifically for input components
9
- * Uses fontFamilyInput if available, otherwise falls back to fontFamily
10
9
  */
11
10
  export const inputFontStyles = (theme: MantineTheme) => () => {
12
11
  return {
13
- fontFamily: theme.fontFamilyInput || theme.fontFamily,
12
+ fontFamily: theme.fontFamily,
14
13
  };
15
14
  };
16
15
 
@@ -3,6 +3,13 @@ import { rgba } from './rgba';
3
3
  import { size } from './size';
4
4
  import { themeColor } from './theme-color/theme-color';
5
5
  import { variant } from './variant';
6
+ import { getPrimaryShade } from './primary-shade';
7
+ import { shadow } from './shadow';
8
+ import { gradient } from './gradient/gradient';
9
+ import { lighten } from './lighten';
10
+ import { darken } from './darken';
11
+ import { dimmed } from './dimmed';
12
+ import { largerThan, smallerThan } from './breakpoints';
6
13
  import * as helpers from './helpers';
7
14
 
8
15
  export const fns = {
@@ -11,5 +18,13 @@ export const fns = {
11
18
  size,
12
19
  variant,
13
20
  themeColor,
21
+ getPrimaryShade,
22
+ shadow,
23
+ gradient,
24
+ lighten,
25
+ darken,
26
+ dimmed,
27
+ largerThan,
28
+ smallerThan,
14
29
  ...helpers,
15
30
  };
@@ -0,0 +1,15 @@
1
+ import { toRgba } from '../../utils/to-rgba';
2
+
3
+ /**
4
+ * Lightens a color by mixing it with white
5
+ * @param color - The color to lighten (hex or rgb/rgba string)
6
+ * @param alpha - The amount to lighten (0-1, where 1 is completely white)
7
+ * @returns rgba color string
8
+ */
9
+ export function lighten(color: string, alpha: number): string {
10
+ const { r, g, b, a } = toRgba(color);
11
+
12
+ const light = (input: number) => Math.round(input + (255 - input) * alpha);
13
+
14
+ return `rgba(${light(r)}, ${light(g)}, ${light(b)}, ${a})`;
15
+ }
@@ -0,0 +1,17 @@
1
+ import type { MantineTheme } from '../../default-theme';
2
+
3
+ /**
4
+ * Returns the appropriate primary shade based on the current color scheme
5
+ * Matches Mantine web implementation
6
+ */
7
+ export function getPrimaryShade(
8
+ theme: MantineTheme,
9
+ colorScheme?: 'light' | 'dark'
10
+ ): number {
11
+ if (typeof theme.primaryShade === 'number') {
12
+ return theme.primaryShade;
13
+ }
14
+
15
+ const scheme = colorScheme || theme.currentMode || 'light';
16
+ return theme.primaryShade[scheme];
17
+ }