react-native-mantine 0.13.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.
Files changed (511) hide show
  1. package/README.md +138 -0
  2. package/lib/commonjs/components/ActionIcon/ActionIcon.js +1 -1
  3. package/lib/commonjs/components/ActionIcon/ActionIcon.js.map +1 -1
  4. package/lib/commonjs/components/Anchor/index.js +3 -4
  5. package/lib/commonjs/components/Anchor/index.js.map +1 -1
  6. package/lib/commonjs/components/Avatar/index.js +1 -2
  7. package/lib/commonjs/components/Avatar/index.js.map +1 -1
  8. package/lib/commonjs/components/Badge/index.js +54 -24
  9. package/lib/commonjs/components/Badge/index.js.map +1 -1
  10. package/lib/commonjs/components/Blockquote/index.js +4 -5
  11. package/lib/commonjs/components/Blockquote/index.js.map +1 -1
  12. package/lib/commonjs/components/Button/index.js +7 -1
  13. package/lib/commonjs/components/Button/index.js.map +1 -1
  14. package/lib/commonjs/components/Center/index.js.map +1 -1
  15. package/lib/commonjs/components/Checkbox/index.js +4 -5
  16. package/lib/commonjs/components/Checkbox/index.js.map +1 -1
  17. package/lib/commonjs/components/Chip/index.js +40 -21
  18. package/lib/commonjs/components/Chip/index.js.map +1 -1
  19. package/lib/commonjs/components/Code/index.js +6 -4
  20. package/lib/commonjs/components/Code/index.js.map +1 -1
  21. package/lib/commonjs/components/Grid/index.js +18 -13
  22. package/lib/commonjs/components/Grid/index.js.map +1 -1
  23. package/lib/commonjs/components/Highlight/index.js +1 -1
  24. package/lib/commonjs/components/Highlight/index.js.map +1 -1
  25. package/lib/commonjs/components/Indicator/index.js +2 -3
  26. package/lib/commonjs/components/Indicator/index.js.map +1 -1
  27. package/lib/commonjs/components/LinearGradient/PlatformLinearGradient.js +9 -9
  28. package/lib/commonjs/components/LinearGradient/PlatformLinearGradient.js.map +1 -1
  29. package/lib/commonjs/components/Menu/index.js +4 -5
  30. package/lib/commonjs/components/Menu/index.js.map +1 -1
  31. package/lib/commonjs/components/MultiSelect/index.js +8 -9
  32. package/lib/commonjs/components/MultiSelect/index.js.map +1 -1
  33. package/lib/commonjs/components/NativeSelect/index.js +14 -14
  34. package/lib/commonjs/components/NativeSelect/index.js.map +1 -1
  35. package/lib/commonjs/components/NavLink/index.js +43 -20
  36. package/lib/commonjs/components/NavLink/index.js.map +1 -1
  37. package/lib/commonjs/components/Notification/index.js +5 -6
  38. package/lib/commonjs/components/Notification/index.js.map +1 -1
  39. package/lib/commonjs/components/Pagination/index.js +5 -6
  40. package/lib/commonjs/components/Pagination/index.js.map +1 -1
  41. package/lib/commonjs/components/PinInput/index.js +3 -3
  42. package/lib/commonjs/components/PinInput/index.js.map +1 -1
  43. package/lib/commonjs/components/Progress/index.js +3 -5
  44. package/lib/commonjs/components/Progress/index.js.map +1 -1
  45. package/lib/commonjs/components/Radio/index.js +4 -5
  46. package/lib/commonjs/components/Radio/index.js.map +1 -1
  47. package/lib/commonjs/components/Rating/index.js +2 -4
  48. package/lib/commonjs/components/Rating/index.js.map +1 -1
  49. package/lib/commonjs/components/RingProgress/index.js +3 -4
  50. package/lib/commonjs/components/RingProgress/index.js.map +1 -1
  51. package/lib/commonjs/components/Select/index.js +7 -8
  52. package/lib/commonjs/components/Select/index.js.map +1 -1
  53. package/lib/commonjs/components/SimpleGrid/index.js +4 -2
  54. package/lib/commonjs/components/SimpleGrid/index.js.map +1 -1
  55. package/lib/commonjs/components/Spoiler/index.js +1 -1
  56. package/lib/commonjs/components/Spoiler/index.js.map +1 -1
  57. package/lib/commonjs/components/Stepper/index.js +8 -6
  58. package/lib/commonjs/components/Stepper/index.js.map +1 -1
  59. package/lib/commonjs/components/Switch/index.js +4 -5
  60. package/lib/commonjs/components/Switch/index.js.map +1 -1
  61. package/lib/commonjs/components/Text/index.js +78 -17
  62. package/lib/commonjs/components/Text/index.js.map +1 -1
  63. package/lib/commonjs/components/ThemeIcon/index.js +40 -19
  64. package/lib/commonjs/components/ThemeIcon/index.js.map +1 -1
  65. package/lib/commonjs/components/Timeline/index.js +6 -5
  66. package/lib/commonjs/components/Timeline/index.js.map +1 -1
  67. package/lib/commonjs/components/Title/index.js +5 -17
  68. package/lib/commonjs/components/Title/index.js.map +1 -1
  69. package/lib/commonjs/components/Tooltip/index.js +1 -2
  70. package/lib/commonjs/components/Tooltip/index.js.map +1 -1
  71. package/lib/commonjs/components/TransferList/index.js +9 -10
  72. package/lib/commonjs/components/TransferList/index.js.map +1 -1
  73. package/lib/commonjs/components/UnstyledButton/UnstyledButton.styles.js +2 -2
  74. package/lib/commonjs/components/UnstyledButton/UnstyledButton.styles.js.map +1 -1
  75. package/lib/commonjs/components/index.js +35 -46
  76. package/lib/commonjs/components/index.js.map +1 -1
  77. package/lib/commonjs/index.js +34 -0
  78. package/lib/commonjs/index.js.map +1 -1
  79. package/lib/commonjs/theme/create-theme.js +114 -25
  80. package/lib/commonjs/theme/create-theme.js.map +1 -1
  81. package/lib/commonjs/theme/default-colors.js +103 -0
  82. package/lib/commonjs/theme/default-colors.js.map +1 -0
  83. package/lib/commonjs/theme/default-theme.js +144 -128
  84. package/lib/commonjs/theme/default-theme.js.map +1 -1
  85. package/lib/commonjs/theme/functions/attach-functions.js +46 -14
  86. package/lib/commonjs/theme/functions/attach-functions.js.map +1 -1
  87. package/lib/commonjs/theme/functions/fns/breakpoints.js.map +1 -1
  88. package/lib/commonjs/theme/functions/fns/color-scheme-value.js +190 -0
  89. package/lib/commonjs/theme/functions/fns/color-scheme-value.js.map +1 -0
  90. package/lib/commonjs/theme/functions/fns/dimmed.js.map +1 -1
  91. package/lib/commonjs/theme/functions/fns/gradient/gradient.js +3 -3
  92. package/lib/commonjs/theme/functions/fns/gradient/gradient.js.map +1 -1
  93. package/lib/commonjs/theme/functions/fns/helpers.js +51 -3
  94. package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
  95. package/lib/commonjs/theme/functions/fns/index.js +151 -6
  96. package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
  97. package/lib/commonjs/theme/functions/fns/primary-shade.js +81 -2
  98. package/lib/commonjs/theme/functions/fns/primary-shade.js.map +1 -1
  99. package/lib/commonjs/theme/functions/fns/shadow.js.map +1 -1
  100. package/lib/commonjs/theme/functions/fns/size.js +2 -1
  101. package/lib/commonjs/theme/functions/fns/size.js.map +1 -1
  102. package/lib/commonjs/theme/functions/fns/theme-color/color-utils.js +196 -0
  103. package/lib/commonjs/theme/functions/fns/theme-color/color-utils.js.map +1 -0
  104. package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js +92 -9
  105. package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js.map +1 -1
  106. package/lib/commonjs/theme/functions/fns/variant.js +112 -17
  107. package/lib/commonjs/theme/functions/fns/variant.js.map +1 -1
  108. package/lib/commonjs/theme/functions/index.js +172 -0
  109. package/lib/commonjs/theme/functions/index.js.map +1 -0
  110. package/lib/commonjs/theme/index.js +116 -14
  111. package/lib/commonjs/theme/index.js.map +1 -1
  112. package/lib/commonjs/theme/theme-provider.js +1 -22
  113. package/lib/commonjs/theme/theme-provider.js.map +1 -1
  114. package/lib/commonjs/theme/types.js +6 -0
  115. package/lib/commonjs/theme/types.js.map +1 -0
  116. package/lib/commonjs/theme/utils/withTextWrapper.js +1 -2
  117. package/lib/commonjs/theme/utils/withTextWrapper.js.map +1 -1
  118. package/lib/module/components/ActionIcon/ActionIcon.js +1 -1
  119. package/lib/module/components/ActionIcon/ActionIcon.js.map +1 -1
  120. package/lib/module/components/Anchor/index.js +3 -4
  121. package/lib/module/components/Anchor/index.js.map +1 -1
  122. package/lib/module/components/Avatar/index.js +1 -2
  123. package/lib/module/components/Avatar/index.js.map +1 -1
  124. package/lib/module/components/Badge/index.js +54 -24
  125. package/lib/module/components/Badge/index.js.map +1 -1
  126. package/lib/module/components/Blockquote/index.js +4 -5
  127. package/lib/module/components/Blockquote/index.js.map +1 -1
  128. package/lib/module/components/Button/index.js +7 -1
  129. package/lib/module/components/Button/index.js.map +1 -1
  130. package/lib/module/components/Center/index.js.map +1 -1
  131. package/lib/module/components/Checkbox/index.js +4 -5
  132. package/lib/module/components/Checkbox/index.js.map +1 -1
  133. package/lib/module/components/Chip/index.js +40 -21
  134. package/lib/module/components/Chip/index.js.map +1 -1
  135. package/lib/module/components/Code/index.js +6 -4
  136. package/lib/module/components/Code/index.js.map +1 -1
  137. package/lib/module/components/Grid/index.js +18 -13
  138. package/lib/module/components/Grid/index.js.map +1 -1
  139. package/lib/module/components/Highlight/index.js +1 -1
  140. package/lib/module/components/Highlight/index.js.map +1 -1
  141. package/lib/module/components/Indicator/index.js +2 -3
  142. package/lib/module/components/Indicator/index.js.map +1 -1
  143. package/lib/module/components/LinearGradient/PlatformLinearGradient.js +9 -9
  144. package/lib/module/components/LinearGradient/PlatformLinearGradient.js.map +1 -1
  145. package/lib/module/components/Menu/index.js +4 -5
  146. package/lib/module/components/Menu/index.js.map +1 -1
  147. package/lib/module/components/MultiSelect/index.js +8 -9
  148. package/lib/module/components/MultiSelect/index.js.map +1 -1
  149. package/lib/module/components/NativeSelect/index.js +14 -14
  150. package/lib/module/components/NativeSelect/index.js.map +1 -1
  151. package/lib/module/components/NavLink/index.js +43 -20
  152. package/lib/module/components/NavLink/index.js.map +1 -1
  153. package/lib/module/components/Notification/index.js +5 -6
  154. package/lib/module/components/Notification/index.js.map +1 -1
  155. package/lib/module/components/Pagination/index.js +5 -6
  156. package/lib/module/components/Pagination/index.js.map +1 -1
  157. package/lib/module/components/PinInput/index.js +3 -3
  158. package/lib/module/components/PinInput/index.js.map +1 -1
  159. package/lib/module/components/Progress/index.js +3 -5
  160. package/lib/module/components/Progress/index.js.map +1 -1
  161. package/lib/module/components/Radio/index.js +4 -5
  162. package/lib/module/components/Radio/index.js.map +1 -1
  163. package/lib/module/components/Rating/index.js +2 -4
  164. package/lib/module/components/Rating/index.js.map +1 -1
  165. package/lib/module/components/RingProgress/index.js +3 -4
  166. package/lib/module/components/RingProgress/index.js.map +1 -1
  167. package/lib/module/components/Select/index.js +7 -8
  168. package/lib/module/components/Select/index.js.map +1 -1
  169. package/lib/module/components/SimpleGrid/index.js +4 -2
  170. package/lib/module/components/SimpleGrid/index.js.map +1 -1
  171. package/lib/module/components/Spoiler/index.js +1 -1
  172. package/lib/module/components/Spoiler/index.js.map +1 -1
  173. package/lib/module/components/Stepper/index.js +8 -6
  174. package/lib/module/components/Stepper/index.js.map +1 -1
  175. package/lib/module/components/Switch/index.js +4 -5
  176. package/lib/module/components/Switch/index.js.map +1 -1
  177. package/lib/module/components/Text/index.js +78 -17
  178. package/lib/module/components/Text/index.js.map +1 -1
  179. package/lib/module/components/ThemeIcon/index.js +40 -19
  180. package/lib/module/components/ThemeIcon/index.js.map +1 -1
  181. package/lib/module/components/Timeline/index.js +6 -5
  182. package/lib/module/components/Timeline/index.js.map +1 -1
  183. package/lib/module/components/Title/index.js +5 -17
  184. package/lib/module/components/Title/index.js.map +1 -1
  185. package/lib/module/components/Tooltip/index.js +1 -2
  186. package/lib/module/components/Tooltip/index.js.map +1 -1
  187. package/lib/module/components/TransferList/index.js +9 -10
  188. package/lib/module/components/TransferList/index.js.map +1 -1
  189. package/lib/module/components/UnstyledButton/UnstyledButton.styles.js +2 -2
  190. package/lib/module/components/UnstyledButton/UnstyledButton.styles.js.map +1 -1
  191. package/lib/module/components/index.js +0 -1
  192. package/lib/module/components/index.js.map +1 -1
  193. package/lib/module/index.js +1 -0
  194. package/lib/module/index.js.map +1 -1
  195. package/lib/module/theme/create-theme.js +114 -24
  196. package/lib/module/theme/create-theme.js.map +1 -1
  197. package/lib/module/theme/default-colors.js +99 -0
  198. package/lib/module/theme/default-colors.js.map +1 -0
  199. package/lib/module/theme/default-theme.js +143 -127
  200. package/lib/module/theme/default-theme.js.map +1 -1
  201. package/lib/module/theme/functions/attach-functions.js +47 -14
  202. package/lib/module/theme/functions/attach-functions.js.map +1 -1
  203. package/lib/module/theme/functions/fns/breakpoints.js.map +1 -1
  204. package/lib/module/theme/functions/fns/color-scheme-value.js +180 -0
  205. package/lib/module/theme/functions/fns/color-scheme-value.js.map +1 -0
  206. package/lib/module/theme/functions/fns/dimmed.js.map +1 -1
  207. package/lib/module/theme/functions/fns/gradient/gradient.js +2 -2
  208. package/lib/module/theme/functions/fns/gradient/gradient.js.map +1 -1
  209. package/lib/module/theme/functions/fns/helpers.js +48 -2
  210. package/lib/module/theme/functions/fns/helpers.js.map +1 -1
  211. package/lib/module/theme/functions/fns/index.js +35 -7
  212. package/lib/module/theme/functions/fns/index.js.map +1 -1
  213. package/lib/module/theme/functions/fns/primary-shade.js +78 -2
  214. package/lib/module/theme/functions/fns/primary-shade.js.map +1 -1
  215. package/lib/module/theme/functions/fns/shadow.js.map +1 -1
  216. package/lib/module/theme/functions/fns/size.js +2 -1
  217. package/lib/module/theme/functions/fns/size.js.map +1 -1
  218. package/lib/module/theme/functions/fns/theme-color/color-utils.js +189 -0
  219. package/lib/module/theme/functions/fns/theme-color/color-utils.js.map +1 -0
  220. package/lib/module/theme/functions/fns/theme-color/theme-color.js +91 -9
  221. package/lib/module/theme/functions/fns/theme-color/theme-color.js.map +1 -1
  222. package/lib/module/theme/functions/fns/variant.js +112 -17
  223. package/lib/module/theme/functions/fns/variant.js.map +1 -1
  224. package/lib/module/theme/functions/index.js +22 -0
  225. package/lib/module/theme/functions/index.js.map +1 -0
  226. package/lib/module/theme/index.js +16 -4
  227. package/lib/module/theme/index.js.map +1 -1
  228. package/lib/module/theme/theme-provider.js +1 -22
  229. package/lib/module/theme/theme-provider.js.map +1 -1
  230. package/lib/module/theme/types.js +4 -0
  231. package/lib/module/theme/types.js.map +1 -0
  232. package/lib/module/theme/utils/withTextWrapper.js +1 -2
  233. package/lib/module/theme/utils/withTextWrapper.js.map +1 -1
  234. package/lib/typescript/commonjs/src/components/Anchor/index.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/src/components/Avatar/index.d.ts.map +1 -1
  236. package/lib/typescript/commonjs/src/components/Badge/index.d.ts.map +1 -1
  237. package/lib/typescript/commonjs/src/components/Blockquote/index.d.ts.map +1 -1
  238. package/lib/typescript/commonjs/src/components/Button/Button.styles.d.ts +8 -8
  239. package/lib/typescript/commonjs/src/components/Button/index.d.ts +1 -1
  240. package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/src/components/Center/index.d.ts +1 -2
  242. package/lib/typescript/commonjs/src/components/Center/index.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/src/components/Checkbox/index.d.ts.map +1 -1
  244. package/lib/typescript/commonjs/src/components/Chip/index.d.ts.map +1 -1
  245. package/lib/typescript/commonjs/src/components/Code/index.d.ts.map +1 -1
  246. package/lib/typescript/commonjs/src/components/ColorSwatch/index.d.ts +1 -1
  247. package/lib/typescript/commonjs/src/components/ColorSwatch/index.d.ts.map +1 -1
  248. package/lib/typescript/commonjs/src/components/Container/index.d.ts +2 -2
  249. package/lib/typescript/commonjs/src/components/Container/index.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/src/components/Flex/index.d.ts +2 -2
  251. package/lib/typescript/commonjs/src/components/Flex/index.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/src/components/Grid/index.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/src/components/Highlight/index.d.ts.map +1 -1
  254. package/lib/typescript/commonjs/src/components/Indicator/index.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/src/components/LinearGradient/PlatformLinearGradient.d.ts +1 -1
  256. package/lib/typescript/commonjs/src/components/Mark/index.d.ts +1 -1
  257. package/lib/typescript/commonjs/src/components/Mark/index.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/src/components/Menu/index.d.ts.map +1 -1
  259. package/lib/typescript/commonjs/src/components/MultiSelect/index.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/src/components/NativeSelect/index.d.ts.map +1 -1
  261. package/lib/typescript/commonjs/src/components/NavLink/index.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/src/components/Notification/index.d.ts.map +1 -1
  263. package/lib/typescript/commonjs/src/components/Pagination/index.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/src/components/PinInput/index.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/src/components/Progress/index.d.ts.map +1 -1
  266. package/lib/typescript/commonjs/src/components/Radio/index.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/src/components/Rating/index.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/src/components/RingProgress/index.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/src/components/Select/index.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/src/components/SimpleGrid/index.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/src/components/Space/index.d.ts +2 -2
  272. package/lib/typescript/commonjs/src/components/Space/index.d.ts.map +1 -1
  273. package/lib/typescript/commonjs/src/components/Switch/index.d.ts.map +1 -1
  274. package/lib/typescript/commonjs/src/components/Text/index.d.ts +54 -7
  275. package/lib/typescript/commonjs/src/components/Text/index.d.ts.map +1 -1
  276. package/lib/typescript/commonjs/src/components/ThemeIcon/index.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/src/components/Timeline/index.d.ts.map +1 -1
  278. package/lib/typescript/commonjs/src/components/Title/index.d.ts +1 -0
  279. package/lib/typescript/commonjs/src/components/Title/index.d.ts.map +1 -1
  280. package/lib/typescript/commonjs/src/components/Tooltip/index.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/src/components/TransferList/index.d.ts.map +1 -1
  282. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts +2 -2
  283. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/src/components/index.d.ts +0 -1
  285. package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
  286. package/lib/typescript/commonjs/src/index.d.ts +1 -1
  287. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/src/theme/create-styles.d.ts +1 -1
  289. package/lib/typescript/commonjs/src/theme/create-styles.d.ts.map +1 -1
  290. package/lib/typescript/commonjs/src/theme/create-theme.d.ts +68 -2
  291. package/lib/typescript/commonjs/src/theme/create-theme.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/src/theme/default-colors.d.ts +12 -0
  293. package/lib/typescript/commonjs/src/theme/default-colors.d.ts.map +1 -0
  294. package/lib/typescript/commonjs/src/theme/default-theme.d.ts +15 -108
  295. package/lib/typescript/commonjs/src/theme/default-theme.d.ts.map +1 -1
  296. package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts +20 -1
  297. package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -1
  298. package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts +3 -3
  299. package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts.map +1 -1
  300. package/lib/typescript/commonjs/src/theme/functions/fns/color-scheme-value.d.ts +100 -0
  301. package/lib/typescript/commonjs/src/theme/functions/fns/color-scheme-value.d.ts.map +1 -0
  302. package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts +2 -2
  303. package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts.map +1 -1
  304. package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts +4 -5
  305. package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -1
  306. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +36 -8
  307. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +40 -14
  309. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
  310. package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts +53 -3
  311. package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts.map +1 -1
  312. package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts +1 -1
  313. package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts +2 -2
  315. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/color-utils.d.ts +50 -0
  317. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/color-utils.d.ts.map +1 -0
  318. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts +51 -5
  319. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -1
  320. package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts +52 -19
  321. package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts.map +1 -1
  322. package/lib/typescript/commonjs/src/theme/functions/index.d.ts +19 -0
  323. package/lib/typescript/commonjs/src/theme/functions/index.d.ts.map +1 -0
  324. package/lib/typescript/commonjs/src/theme/index.d.ts +9 -6
  325. package/lib/typescript/commonjs/src/theme/index.d.ts.map +1 -1
  326. package/lib/typescript/commonjs/src/theme/theme-provider.d.ts +1 -1
  327. package/lib/typescript/commonjs/src/theme/theme-provider.d.ts.map +1 -1
  328. package/lib/typescript/commonjs/src/theme/types/DefaultProps.d.ts +2 -2
  329. package/lib/typescript/commonjs/src/theme/types/DefaultProps.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/src/theme/types.d.ts +494 -0
  331. package/lib/typescript/commonjs/src/theme/types.d.ts.map +1 -0
  332. package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts +1 -1
  333. package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts.map +1 -1
  334. package/lib/typescript/module/src/components/Anchor/index.d.ts.map +1 -1
  335. package/lib/typescript/module/src/components/Avatar/index.d.ts.map +1 -1
  336. package/lib/typescript/module/src/components/Badge/index.d.ts.map +1 -1
  337. package/lib/typescript/module/src/components/Blockquote/index.d.ts.map +1 -1
  338. package/lib/typescript/module/src/components/Button/Button.styles.d.ts +8 -8
  339. package/lib/typescript/module/src/components/Button/index.d.ts +1 -1
  340. package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
  341. package/lib/typescript/module/src/components/Center/index.d.ts +1 -2
  342. package/lib/typescript/module/src/components/Center/index.d.ts.map +1 -1
  343. package/lib/typescript/module/src/components/Checkbox/index.d.ts.map +1 -1
  344. package/lib/typescript/module/src/components/Chip/index.d.ts.map +1 -1
  345. package/lib/typescript/module/src/components/Code/index.d.ts.map +1 -1
  346. package/lib/typescript/module/src/components/ColorSwatch/index.d.ts +1 -1
  347. package/lib/typescript/module/src/components/ColorSwatch/index.d.ts.map +1 -1
  348. package/lib/typescript/module/src/components/Container/index.d.ts +2 -2
  349. package/lib/typescript/module/src/components/Container/index.d.ts.map +1 -1
  350. package/lib/typescript/module/src/components/Flex/index.d.ts +2 -2
  351. package/lib/typescript/module/src/components/Flex/index.d.ts.map +1 -1
  352. package/lib/typescript/module/src/components/Grid/index.d.ts.map +1 -1
  353. package/lib/typescript/module/src/components/Highlight/index.d.ts.map +1 -1
  354. package/lib/typescript/module/src/components/Indicator/index.d.ts.map +1 -1
  355. package/lib/typescript/module/src/components/LinearGradient/PlatformLinearGradient.d.ts +1 -1
  356. package/lib/typescript/module/src/components/Mark/index.d.ts +1 -1
  357. package/lib/typescript/module/src/components/Mark/index.d.ts.map +1 -1
  358. package/lib/typescript/module/src/components/Menu/index.d.ts.map +1 -1
  359. package/lib/typescript/module/src/components/MultiSelect/index.d.ts.map +1 -1
  360. package/lib/typescript/module/src/components/NativeSelect/index.d.ts.map +1 -1
  361. package/lib/typescript/module/src/components/NavLink/index.d.ts.map +1 -1
  362. package/lib/typescript/module/src/components/Notification/index.d.ts.map +1 -1
  363. package/lib/typescript/module/src/components/Pagination/index.d.ts.map +1 -1
  364. package/lib/typescript/module/src/components/PinInput/index.d.ts.map +1 -1
  365. package/lib/typescript/module/src/components/Progress/index.d.ts.map +1 -1
  366. package/lib/typescript/module/src/components/Radio/index.d.ts.map +1 -1
  367. package/lib/typescript/module/src/components/Rating/index.d.ts.map +1 -1
  368. package/lib/typescript/module/src/components/RingProgress/index.d.ts.map +1 -1
  369. package/lib/typescript/module/src/components/Select/index.d.ts.map +1 -1
  370. package/lib/typescript/module/src/components/SimpleGrid/index.d.ts.map +1 -1
  371. package/lib/typescript/module/src/components/Space/index.d.ts +2 -2
  372. package/lib/typescript/module/src/components/Space/index.d.ts.map +1 -1
  373. package/lib/typescript/module/src/components/Switch/index.d.ts.map +1 -1
  374. package/lib/typescript/module/src/components/Text/index.d.ts +54 -7
  375. package/lib/typescript/module/src/components/Text/index.d.ts.map +1 -1
  376. package/lib/typescript/module/src/components/ThemeIcon/index.d.ts.map +1 -1
  377. package/lib/typescript/module/src/components/Timeline/index.d.ts.map +1 -1
  378. package/lib/typescript/module/src/components/Title/index.d.ts +1 -0
  379. package/lib/typescript/module/src/components/Title/index.d.ts.map +1 -1
  380. package/lib/typescript/module/src/components/Tooltip/index.d.ts.map +1 -1
  381. package/lib/typescript/module/src/components/TransferList/index.d.ts.map +1 -1
  382. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts +2 -2
  383. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -1
  384. package/lib/typescript/module/src/components/index.d.ts +0 -1
  385. package/lib/typescript/module/src/components/index.d.ts.map +1 -1
  386. package/lib/typescript/module/src/index.d.ts +1 -1
  387. package/lib/typescript/module/src/index.d.ts.map +1 -1
  388. package/lib/typescript/module/src/theme/create-styles.d.ts +1 -1
  389. package/lib/typescript/module/src/theme/create-styles.d.ts.map +1 -1
  390. package/lib/typescript/module/src/theme/create-theme.d.ts +68 -2
  391. package/lib/typescript/module/src/theme/create-theme.d.ts.map +1 -1
  392. package/lib/typescript/module/src/theme/default-colors.d.ts +12 -0
  393. package/lib/typescript/module/src/theme/default-colors.d.ts.map +1 -0
  394. package/lib/typescript/module/src/theme/default-theme.d.ts +15 -108
  395. package/lib/typescript/module/src/theme/default-theme.d.ts.map +1 -1
  396. package/lib/typescript/module/src/theme/functions/attach-functions.d.ts +20 -1
  397. package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -1
  398. package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts +3 -3
  399. package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts.map +1 -1
  400. package/lib/typescript/module/src/theme/functions/fns/color-scheme-value.d.ts +100 -0
  401. package/lib/typescript/module/src/theme/functions/fns/color-scheme-value.d.ts.map +1 -0
  402. package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts +2 -2
  403. package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts.map +1 -1
  404. package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts +4 -5
  405. package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -1
  406. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +36 -8
  407. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts.map +1 -1
  408. package/lib/typescript/module/src/theme/functions/fns/index.d.ts +40 -14
  409. package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
  410. package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts +53 -3
  411. package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts.map +1 -1
  412. package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts +1 -1
  413. package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts.map +1 -1
  414. package/lib/typescript/module/src/theme/functions/fns/size.d.ts +2 -2
  415. package/lib/typescript/module/src/theme/functions/fns/size.d.ts.map +1 -1
  416. package/lib/typescript/module/src/theme/functions/fns/theme-color/color-utils.d.ts +50 -0
  417. package/lib/typescript/module/src/theme/functions/fns/theme-color/color-utils.d.ts.map +1 -0
  418. package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts +51 -5
  419. package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -1
  420. package/lib/typescript/module/src/theme/functions/fns/variant.d.ts +52 -19
  421. package/lib/typescript/module/src/theme/functions/fns/variant.d.ts.map +1 -1
  422. package/lib/typescript/module/src/theme/functions/index.d.ts +19 -0
  423. package/lib/typescript/module/src/theme/functions/index.d.ts.map +1 -0
  424. package/lib/typescript/module/src/theme/index.d.ts +9 -6
  425. package/lib/typescript/module/src/theme/index.d.ts.map +1 -1
  426. package/lib/typescript/module/src/theme/theme-provider.d.ts +1 -1
  427. package/lib/typescript/module/src/theme/theme-provider.d.ts.map +1 -1
  428. package/lib/typescript/module/src/theme/types/DefaultProps.d.ts +2 -2
  429. package/lib/typescript/module/src/theme/types/DefaultProps.d.ts.map +1 -1
  430. package/lib/typescript/module/src/theme/types.d.ts +494 -0
  431. package/lib/typescript/module/src/theme/types.d.ts.map +1 -0
  432. package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts +1 -1
  433. package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts.map +1 -1
  434. package/package.json +2 -4
  435. package/src/components/ActionIcon/ActionIcon.tsx +3 -3
  436. package/src/components/Anchor/index.tsx +3 -4
  437. package/src/components/Avatar/index.tsx +1 -2
  438. package/src/components/Badge/index.tsx +36 -19
  439. package/src/components/Blockquote/index.tsx +4 -6
  440. package/src/components/Button/index.tsx +6 -2
  441. package/src/components/Center/index.tsx +1 -2
  442. package/src/components/Checkbox/index.tsx +4 -5
  443. package/src/components/Chip/index.tsx +25 -18
  444. package/src/components/Code/index.tsx +7 -5
  445. package/src/components/ColorSwatch/index.tsx +1 -1
  446. package/src/components/Container/index.tsx +2 -2
  447. package/src/components/Flex/index.tsx +2 -2
  448. package/src/components/Grid/index.tsx +16 -10
  449. package/src/components/Highlight/index.tsx +1 -2
  450. package/src/components/Indicator/index.tsx +3 -4
  451. package/src/components/LinearGradient/PlatformLinearGradient.tsx +9 -9
  452. package/src/components/Mark/index.tsx +1 -1
  453. package/src/components/Menu/index.tsx +8 -10
  454. package/src/components/MultiSelect/index.tsx +13 -15
  455. package/src/components/NativeSelect/index.tsx +34 -21
  456. package/src/components/NavLink/index.tsx +27 -23
  457. package/src/components/Notification/index.tsx +5 -6
  458. package/src/components/Pagination/index.tsx +5 -6
  459. package/src/components/PinInput/index.tsx +5 -6
  460. package/src/components/Progress/index.tsx +5 -6
  461. package/src/components/Radio/index.tsx +4 -5
  462. package/src/components/Rating/index.tsx +2 -4
  463. package/src/components/RingProgress/index.tsx +3 -5
  464. package/src/components/Select/index.tsx +11 -13
  465. package/src/components/SimpleGrid/index.tsx +5 -2
  466. package/src/components/Space/index.tsx +2 -2
  467. package/src/components/Spoiler/index.tsx +1 -1
  468. package/src/components/Stepper/index.tsx +17 -17
  469. package/src/components/Switch/index.tsx +5 -6
  470. package/src/components/Text/index.tsx +125 -28
  471. package/src/components/ThemeIcon/index.tsx +23 -23
  472. package/src/components/Timeline/index.tsx +12 -15
  473. package/src/components/Title/index.tsx +5 -22
  474. package/src/components/Tooltip/index.tsx +1 -3
  475. package/src/components/TransferList/index.tsx +16 -18
  476. package/src/components/UnstyledButton/UnstyledButton.styles.ts +4 -2
  477. package/src/components/index.tsx +0 -1
  478. package/src/index.tsx +1 -1
  479. package/src/theme/create-styles.ts +1 -1
  480. package/src/theme/create-theme.ts +134 -23
  481. package/src/theme/default-colors.ts +252 -0
  482. package/src/theme/default-theme.ts +178 -392
  483. package/src/theme/functions/attach-functions.ts +57 -10
  484. package/src/theme/functions/fns/breakpoints.ts +4 -4
  485. package/src/theme/functions/fns/color-scheme-value.ts +200 -0
  486. package/src/theme/functions/fns/dimmed.ts +2 -2
  487. package/src/theme/functions/fns/gradient/gradient.ts +4 -5
  488. package/src/theme/functions/fns/helpers.ts +50 -9
  489. package/src/theme/functions/fns/index.ts +63 -3
  490. package/src/theme/functions/fns/primary-shade.ts +84 -8
  491. package/src/theme/functions/fns/shadow.ts +1 -1
  492. package/src/theme/functions/fns/size.ts +4 -3
  493. package/src/theme/functions/fns/theme-color/color-utils.ts +193 -0
  494. package/src/theme/functions/fns/theme-color/theme-color.ts +85 -17
  495. package/src/theme/functions/fns/variant.ts +106 -44
  496. package/src/theme/functions/index.ts +19 -0
  497. package/src/theme/index.ts +91 -0
  498. package/src/theme/theme-provider.tsx +2 -17
  499. package/src/theme/types/DefaultProps.ts +3 -3
  500. package/src/theme/types.ts +625 -0
  501. package/src/theme/utils/withTextWrapper.tsx +2 -3
  502. package/lib/commonjs/components/Slider/index.js +0 -300
  503. package/lib/commonjs/components/Slider/index.js.map +0 -1
  504. package/lib/module/components/Slider/index.js +0 -295
  505. package/lib/module/components/Slider/index.js.map +0 -1
  506. package/lib/typescript/commonjs/src/components/Slider/index.d.ts +0 -43
  507. package/lib/typescript/commonjs/src/components/Slider/index.d.ts.map +0 -1
  508. package/lib/typescript/module/src/components/Slider/index.d.ts +0 -43
  509. package/lib/typescript/module/src/components/Slider/index.d.ts.map +0 -1
  510. package/src/components/Slider/index.tsx +0 -349
  511. package/src/theme/index.tsx +0 -9
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Color utility functions for custom color support
5
+ * Handles detection and manipulation of custom hex/rgb/rgba colors
6
+ */
7
+
8
+ /**
9
+ * Check if a color string is a custom color value (not a palette key)
10
+ *
11
+ * Custom colors include:
12
+ * - Hex colors: #fff, #ffffff
13
+ * - RGB colors: rgb(255, 255, 255)
14
+ * - RGBA colors: rgba(255, 255, 255, 0.5)
15
+ * - HSL colors: hsl(0, 100%, 50%)
16
+ * - HSLA colors: hsla(0, 100%, 50%, 0.5)
17
+ * - CSS named colors like 'transparent', 'currentColor'
18
+ *
19
+ * @param color - Color string to check
20
+ * @returns true if color is a custom value, false if it might be a palette key
21
+ */
22
+ export function isCustomColor(color) {
23
+ if (!color || typeof color !== 'string') {
24
+ return false;
25
+ }
26
+
27
+ // Check for hex colors
28
+ if (color.startsWith('#')) {
29
+ return true;
30
+ }
31
+
32
+ // Check for rgb/rgba colors
33
+ if (color.startsWith('rgb')) {
34
+ return true;
35
+ }
36
+
37
+ // Check for hsl/hsla colors
38
+ if (color.startsWith('hsl')) {
39
+ return true;
40
+ }
41
+
42
+ // Check for CSS keywords
43
+ if (color === 'transparent' || color === 'currentColor') {
44
+ return true;
45
+ }
46
+
47
+ // Otherwise, assume it's a palette key or CSS named color
48
+ return false;
49
+ }
50
+
51
+ /**
52
+ * Generate a lighter shade of a custom color
53
+ * Used when shade 0-5 is requested for custom colors
54
+ *
55
+ * @param color - Base color (hex or rgb) - treated as shade 6
56
+ * @param shadeIndex - Shade index (0-5)
57
+ * @returns Lighter color string
58
+ */
59
+ export function generateLighterShade(color, shadeIndex) {
60
+ // For shades 0-5, lighten the color (base is shade 6)
61
+ // shade 0 = lightest (90% lighter), shade 5 = slightly lighter (15% lighter)
62
+ const lightenAmount = (6 - shadeIndex) * 0.15; // 0.9 to 0.15
63
+
64
+ // Use the lighten algorithm from lighten.ts
65
+ const rgba = parseColorToRgba(color);
66
+ if (!rgba) return color;
67
+ const {
68
+ r,
69
+ g,
70
+ b,
71
+ a
72
+ } = rgba;
73
+ const light = input => Math.round(input + (255 - input) * lightenAmount);
74
+ return `rgba(${light(r)}, ${light(g)}, ${light(b)}, ${a})`;
75
+ }
76
+
77
+ /**
78
+ * Generate a darker shade of a custom color
79
+ * Used when shade 7-9 is requested for custom colors
80
+ *
81
+ * @param color - Base color (hex or rgb) - treated as shade 6
82
+ * @param shadeIndex - Shade index (7-9)
83
+ * @returns Darker color string
84
+ */
85
+ export function generateDarkerShade(color, shadeIndex) {
86
+ // For shades 7-9, darken the color (base is shade 6)
87
+ // shade 7 = slightly darker (10% darker), shade 9 = darkest (30% darker)
88
+ const darkenAmount = (shadeIndex - 6) * 0.1; // 0.1 to 0.3
89
+
90
+ // Use the darken algorithm from darken.ts
91
+ const rgba = parseColorToRgba(color);
92
+ if (!rgba) return color;
93
+ const {
94
+ r,
95
+ g,
96
+ b,
97
+ a
98
+ } = rgba;
99
+ const f = 1 - darkenAmount;
100
+ const dark = input => Math.round(input * f);
101
+ return `rgba(${dark(r)}, ${dark(g)}, ${dark(b)}, ${a})`;
102
+ }
103
+
104
+ /**
105
+ * Get a shade variation of a custom color
106
+ *
107
+ * For custom colors, we treat shade 6 as the base color (no modification).
108
+ * This aligns with the default primaryShade for light mode.
109
+ * Shades 0-5 are lighter, shades 7-9 are darker.
110
+ *
111
+ * @param color - Base color (hex or rgb)
112
+ * @param shade - Shade index (0-9), where 6 is the base color
113
+ * @returns Color at the requested shade
114
+ */
115
+ export function getCustomColorShade(color, shade) {
116
+ // Shade 6 is treated as the base color (most common primaryShade for light mode)
117
+ if (shade === 6) {
118
+ return color;
119
+ }
120
+
121
+ // Lighter shades (0-5)
122
+ if (shade < 6) {
123
+ return generateLighterShade(color, shade);
124
+ }
125
+
126
+ // Darker shades (7-9)
127
+ return generateDarkerShade(color, shade);
128
+ }
129
+
130
+ /**
131
+ * Parse color string to RGBA object
132
+ * Supports hex and rgb/rgba formats
133
+ */
134
+
135
+ function parseColorToRgba(color) {
136
+ // Handle hex colors
137
+ if (color.startsWith('#')) {
138
+ return hexToRgba(color);
139
+ }
140
+
141
+ // Handle rgb/rgba colors
142
+ if (color.startsWith('rgb')) {
143
+ return rgbStringToRgba(color);
144
+ }
145
+ return null;
146
+ }
147
+ function isHexColor(hex) {
148
+ const HEX_REGEXP = /^#?([0-9A-F]{3}){1,2}$/i;
149
+ return HEX_REGEXP.test(hex);
150
+ }
151
+ function hexToRgba(color) {
152
+ if (!isHexColor(color)) {
153
+ return null;
154
+ }
155
+ let hexString = color.replace('#', '');
156
+
157
+ // Handle shorthand hex (#fff -> #ffffff)
158
+ if (hexString.length === 3) {
159
+ const shorthandHex = hexString.split('');
160
+ hexString = [shorthandHex[0], shorthandHex[0], shorthandHex[1], shorthandHex[1], shorthandHex[2], shorthandHex[2]].join('');
161
+ }
162
+ const parsed = parseInt(hexString, 16);
163
+ const r = parsed >> 16 & 255;
164
+ const g = parsed >> 8 & 255;
165
+ const b = parsed & 255;
166
+ return {
167
+ r,
168
+ g,
169
+ b,
170
+ a: 1
171
+ };
172
+ }
173
+ function rgbStringToRgba(color) {
174
+ const parts = color.replace(/[^0-9,.]/g, '').split(',').map(Number);
175
+ if (parts.length < 3) {
176
+ return null;
177
+ }
178
+ const r = parts[0] || 0;
179
+ const g = parts[1] || 0;
180
+ const b = parts[2] || 0;
181
+ const a = parts[3] !== undefined ? parts[3] : 1;
182
+ return {
183
+ r,
184
+ g,
185
+ b,
186
+ a
187
+ };
188
+ }
189
+ //# sourceMappingURL=color-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isCustomColor","color","startsWith","generateLighterShade","shadeIndex","lightenAmount","rgba","parseColorToRgba","r","g","b","a","light","input","Math","round","generateDarkerShade","darkenAmount","f","dark","getCustomColorShade","shade","hexToRgba","rgbStringToRgba","isHexColor","hex","HEX_REGEXP","test","hexString","replace","length","shorthandHex","split","join","parsed","parseInt","parts","map","Number","undefined"],"sourceRoot":"../../../../../../src","sources":["theme/functions/fns/theme-color/color-utils.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAACC,KAAa,EAAW;EACpD,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACvC,OAAO,KAAK;EACd;;EAEA;EACA,IAAIA,KAAK,CAACC,UAAU,CAAC,GAAG,CAAC,EAAE;IACzB,OAAO,IAAI;EACb;;EAEA;EACA,IAAID,KAAK,CAACC,UAAU,CAAC,KAAK,CAAC,EAAE;IAC3B,OAAO,IAAI;EACb;;EAEA;EACA,IAAID,KAAK,CAACC,UAAU,CAAC,KAAK,CAAC,EAAE;IAC3B,OAAO,IAAI;EACb;;EAEA;EACA,IAAID,KAAK,KAAK,aAAa,IAAIA,KAAK,KAAK,cAAc,EAAE;IACvD,OAAO,IAAI;EACb;;EAEA;EACA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,YAAY,CAAC,CAAC,CAAC,EACfA,YAAY,CAAC,CAAC,CAAC,CAChB,CAACE,IAAI,CAAC,EAAE,CAAC;EACZ;EAEA,MAAMC,MAAM,GAAGC,QAAQ,CAACP,SAAS,EAAE,EAAE,CAAC;EACtC,MAAMpB,CAAC,GAAI0B,MAAM,IAAI,EAAE,GAAI,GAAG;EAC9B,MAAMzB,CAAC,GAAIyB,MAAM,IAAI,CAAC,GAAI,GAAG;EAC7B,MAAMxB,CAAC,GAAGwB,MAAM,GAAG,GAAG;EAEtB,OAAO;IAAE1B,CAAC;IAAEC,CAAC;IAAEC,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC;AAC1B;AAEA,SAASY,eAAeA,CAACtB,KAAa,EAAe;EACnD,MAAMmC,KAAK,GAAGnC,KAAK,CAAC4B,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAACG,KAAK,CAAC,GAAG,CAAC,CAACK,GAAG,CAACC,MAAM,CAAC;EAEnE,IAAIF,KAAK,CAACN,MAAM,GAAG,CAAC,EAAE;IACpB,OAAO,IAAI;EACb;EAEA,MAAMtB,CAAC,GAAG4B,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;EACvB,MAAM3B,CAAC,GAAG2B,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;EACvB,MAAM1B,CAAC,GAAG0B,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;EACvB,MAAMzB,CAAC,GAAGyB,KAAK,CAAC,CAAC,CAAC,KAAKG,SAAS,GAAGH,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;EAE/C,OAAO;IAAE5B,CAAC;IAAEC,CAAC;IAAEC,CAAC;IAAEC;EAAE,CAAC;AACvB","ignoreList":[]}
@@ -1,31 +1,113 @@
1
1
  "use strict";
2
2
 
3
+ /**
4
+ * Theme color helper function
5
+ * Retrieves colors from theme palette with proper shade handling
6
+ * Aligned with Mantine web's themeColor implementation
7
+ *
8
+ * Now supports custom color values (hex, rgb, rgba) that are not in the theme palette.
9
+ * Custom colors can be shaded on the fly using color manipulation algorithms.
10
+ */
11
+
3
12
  import { getPrimaryShade } from "../primary-shade.js";
13
+ import { isCustomColor, getCustomColorShade } from "./color-utils.js";
14
+ /**
15
+ * Get a color value from the theme
16
+ *
17
+ * @param theme - Mantine theme object
18
+ * @param color - Color name or CSS color value (now supports hex/rgb/rgba)
19
+ * @param shade - Optional shade (0-9). If not provided, uses primaryShade
20
+ * @param primaryFallback - If true and color not found, falls back to primary color
21
+ * @returns Color string value
22
+ *
23
+ * @example
24
+ * // Get blue at primary shade (6 for light mode, 8 for dark mode)
25
+ * themeColor({ theme, color: 'blue' })
26
+ *
27
+ * @example
28
+ * // Get blue at specific shade
29
+ * themeColor({ theme, color: 'blue', shade: 5 })
30
+ *
31
+ * @example
32
+ * // Pass through CSS color values
33
+ * themeColor({ theme, color: '#ff0000' }) // returns '#ff0000'
34
+ *
35
+ * @example
36
+ * // Use custom hex color with shade
37
+ * themeColor({ theme, color: '#FF5733', shade: 7 }) // returns darker version
38
+ *
39
+ * @example
40
+ * // Use custom rgb color with shade
41
+ * themeColor({ theme, color: 'rgb(255, 87, 51)', shade: 3 }) // returns lighter version
42
+ *
43
+ * @example
44
+ * // Use primary color fallback
45
+ * themeColor({ theme, color: 'unknown', primaryFallback: true })
46
+ */
4
47
  export function themeColor({
5
48
  theme,
6
49
  color,
7
- shade
50
+ shade,
51
+ primaryFallback = false
8
52
  }) {
53
+ // Handle undefined/null color
9
54
  if (!color) {
10
- return '';
55
+ return primaryFallback ? themeColor({
56
+ theme,
57
+ color: theme.primaryColor,
58
+ shade
59
+ }) : '';
11
60
  }
12
61
 
13
- // If it's a hex/rgb color, return as is
14
- if (color.startsWith('#') || color.startsWith('rgb') || color.startsWith('hsl')) {
62
+ // Check if this is a custom color value (hex, rgb, rgba, etc.)
63
+ if (isCustomColor(color)) {
64
+ // If shade is specified, generate a shade variation
65
+ if (shade !== undefined) {
66
+ return getCustomColorShade(color, shade);
67
+ }
68
+ // Otherwise return the color as-is
15
69
  return color;
16
70
  }
17
71
 
18
- // Get from theme colors
72
+ // Get color palette from theme
19
73
  const colorPalette = theme.colors[color];
74
+
75
+ // If color not in palette
20
76
  if (!colorPalette) {
21
- // If color not in palette, return as is (might be a CSS color name)
77
+ // Try primary fallback if enabled
78
+ if (primaryFallback && color !== theme.primaryColor) {
79
+ return themeColor({
80
+ theme,
81
+ color: theme.primaryColor,
82
+ shade
83
+ });
84
+ }
85
+ // Otherwise return the color string as-is (might be a named CSS color)
22
86
  return color;
23
87
  }
24
88
 
25
- // Use provided shade or get from theme based on color scheme
89
+ // Determine which shade to use
26
90
  const colorShade = shade !== undefined ? shade : getPrimaryShade(theme);
27
91
 
28
- // Return the color at the specified shade
29
- return colorPalette[colorShade] || colorPalette[0] || color;
92
+ // Get the color at the specified shade
93
+ const resolvedColor = colorPalette[colorShade];
94
+
95
+ // Return the color or fall back to first shade
96
+ return resolvedColor || colorPalette[0] || color;
97
+ }
98
+
99
+ /**
100
+ * Curried version of themeColor for use with theme.fn
101
+ * @internal
102
+ */
103
+ export function createThemeColorFunction(theme) {
104
+ return (color, shade, primaryFallback) => {
105
+ return themeColor({
106
+ theme,
107
+ color,
108
+ shade,
109
+ primaryFallback
110
+ });
111
+ };
30
112
  }
31
113
  //# sourceMappingURL=theme-color.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getPrimaryShade","themeColor","theme","color","shade","startsWith","colorPalette","colors","colorShade","undefined"],"sourceRoot":"../../../../../../src","sources":["theme/functions/fns/theme-color/theme-color.ts"],"mappings":";;AAEA,SAASA,eAAe,QAAQ,qBAAkB;AAQlD,OAAO,SAASC,UAAUA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAU;EAC3E,IAAI,CAACD,KAAK,EAAE;IACV,OAAO,EAAE;EACX;;EAEA;EACA,IACEA,KAAK,CAACE,UAAU,CAAC,GAAG,CAAC,IACrBF,KAAK,CAACE,UAAU,CAAC,KAAK,CAAC,IACvBF,KAAK,CAACE,UAAU,CAAC,KAAK,CAAC,EACvB;IACA,OAAOF,KAAK;EACd;;EAEA;EACA,MAAMG,YAAY,GAAGJ,KAAK,CAACK,MAAM,CAACJ,KAAK,CAAC;EAExC,IAAI,CAACG,YAAY,EAAE;IACjB;IACA,OAAOH,KAAK;EACd;;EAEA;EACA,MAAMK,UAAU,GAAGJ,KAAK,KAAKK,SAAS,GAAGL,KAAK,GAAGJ,eAAe,CAACE,KAAK,CAAC;;EAEvE;EACA,OAAOI,YAAY,CAACE,UAAU,CAAC,IAAIF,YAAY,CAAC,CAAC,CAAC,IAAIH,KAAK;AAC7D","ignoreList":[]}
1
+ {"version":3,"names":["getPrimaryShade","isCustomColor","getCustomColorShade","themeColor","theme","color","shade","primaryFallback","primaryColor","undefined","colorPalette","colors","colorShade","resolvedColor","createThemeColorFunction"],"sourceRoot":"../../../../../../src","sources":["theme/functions/fns/theme-color/theme-color.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,qBAAkB;AAClD,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,kBAAe;AASlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAC;EACzBC,KAAK;EACLC,KAAK;EACLC,KAAK;EACLC,eAAe,GAAG;AACH,CAAC,EAAU;EAC1B;EACA,IAAI,CAACF,KAAK,EAAE;IACV,OAAOE,eAAe,GAAGJ,UAAU,CAAC;MAAEC,KAAK;MAAEC,KAAK,EAAED,KAAK,CAACI,YAAY;MAAEF;IAAM,CAAC,CAAC,GAAG,EAAE;EACvF;;EAEA;EACA,IAAIL,aAAa,CAACI,KAAK,CAAC,EAAE;IACxB;IACA,IAAIC,KAAK,KAAKG,SAAS,EAAE;MACvB,OAAOP,mBAAmB,CAACG,KAAK,EAAEC,KAAK,CAAC;IAC1C;IACA;IACA,OAAOD,KAAK;EACd;;EAEA;EACA,MAAMK,YAAY,GAAGN,KAAK,CAACO,MAAM,CAACN,KAAK,CAAC;;EAExC;EACA,IAAI,CAACK,YAAY,EAAE;IACjB;IACA,IAAIH,eAAe,IAAIF,KAAK,KAAKD,KAAK,CAACI,YAAY,EAAE;MACnD,OAAOL,UAAU,CAAC;QAAEC,KAAK;QAAEC,KAAK,EAAED,KAAK,CAACI,YAAY;QAAEF;MAAM,CAAC,CAAC;IAChE;IACA;IACA,OAAOD,KAAK;EACd;;EAEA;EACA,MAAMO,UAAU,GAAGN,KAAK,KAAKG,SAAS,GAAGH,KAAK,GAAGN,eAAe,CAACI,KAAK,CAAC;;EAEvE;EACA,MAAMS,aAAa,GAAGH,YAAY,CAACE,UAAU,CAAC;;EAE9C;EACA,OAAOC,aAAa,IAAIH,YAAY,CAAC,CAAC,CAAC,IAAIL,KAAK;AAClD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASS,wBAAwBA,CAACV,KAAuB,EAAE;EAChE,OAAO,CAACC,KAAmB,EAAEC,KAAa,EAAEC,eAAyB,KAAa;IAChF,OAAOJ,UAAU,CAAC;MAAEC,KAAK;MAAEC,KAAK;MAAEC,KAAK;MAAEC;IAAgB,CAAC,CAAC;EAC7D,CAAC;AACH","ignoreList":[]}
@@ -1,38 +1,97 @@
1
1
  "use strict";
2
2
 
3
+ /**
4
+ * Variant styles generator
5
+ * Creates component variant styles for React Native
6
+ * Aligned with Mantine web's variant system
7
+ *
8
+ * Now supports custom color values (hex, rgb, rgba) in addition to theme palette colors.
9
+ * Custom colors are automatically shaded using color manipulation algorithms.
10
+ */
11
+
3
12
  import { themeColor } from "./theme-color/theme-color.js";
4
13
  import { getPrimaryShade } from "./primary-shade.js";
14
+
15
+ /**
16
+ * Generate variant styles for components
17
+ *
18
+ * Supports the following variants:
19
+ * - filled: Filled background with primary color
20
+ * - light: Light background with colored text
21
+ * - outline: Transparent background with colored border
22
+ * - subtle: Transparent background with colored text
23
+ * - white: White background (useful for dark mode)
24
+ * - default: Default gray background
25
+ * - gradient: Transparent background for gradient overlays
26
+ * - transparent: Fully transparent
27
+ *
28
+ * @param theme - Mantine theme object
29
+ * @param input - Variant configuration
30
+ * @returns Style object with background, color, border, and optional hover
31
+ *
32
+ * @example
33
+ * // Filled variant with blue color
34
+ * variant(theme)({ variant: 'filled', color: 'blue' })
35
+ * // Returns: { background: '#228be6', color: '#fff', border: '#228be6' }
36
+ *
37
+ * @example
38
+ * // Light variant with red color
39
+ * variant(theme)({ variant: 'light', color: 'red' })
40
+ * // Returns: { background: '#fff5f5', color: '#f03e3e', border: 'transparent' }
41
+ *
42
+ * @example
43
+ * // Filled variant with custom hex color
44
+ * variant(theme)({ variant: 'filled', color: '#FF5733' })
45
+ * // Returns: { background: '#FF5733', color: '#fff', border: '#FF5733', hover: darker('#FF5733') }
46
+ *
47
+ * @example
48
+ * // Light variant with custom rgb color
49
+ * variant(theme)({ variant: 'light', color: 'rgb(255, 87, 51)' })
50
+ * // Returns: { background: lighter('rgb(...)'), color: darker('rgb(...)'), border: 'transparent' }
51
+ */
5
52
  export const variant = theme => input => {
6
53
  const {
7
54
  variant,
8
- color = theme.primaryColor
55
+ color = theme.primaryColor,
56
+ primaryFallback = false
9
57
  } = input;
10
58
  const primaryShade = getPrimaryShade(theme);
59
+
60
+ /**
61
+ * Helper to get color at specific shade
62
+ */
11
63
  const getColor = (c, shade) => themeColor({
12
64
  theme,
13
65
  color: c,
14
- shade
66
+ shade,
67
+ primaryFallback
15
68
  });
16
69
  switch (variant) {
70
+ // Filled variant - solid background with white text
17
71
  case 'filled':
18
72
  {
19
73
  const filledColor = getColor(color, primaryShade);
20
74
  return {
21
75
  background: filledColor,
22
- color: '#fff',
76
+ color: theme.white,
23
77
  border: filledColor,
24
- hover: getColor(color, primaryShade > 0 ? primaryShade + 1 : primaryShade)
78
+ hover: getColor(color, Math.min(primaryShade + 1, 9))
25
79
  };
26
80
  }
81
+
82
+ // Light variant - light background with colored text
27
83
  case 'light':
28
84
  {
85
+ const textShade = primaryShade > 6 ? primaryShade : 7;
29
86
  return {
30
87
  background: getColor(color, 0),
31
- color: getColor(color, primaryShade > 6 ? primaryShade : 7),
88
+ color: getColor(color, textShade),
32
89
  border: 'transparent',
33
90
  hover: getColor(color, 1)
34
91
  };
35
92
  }
93
+
94
+ // Outline variant - transparent with colored border and text
36
95
  case 'outline':
37
96
  {
38
97
  const outlineColor = getColor(color, primaryShade);
@@ -43,6 +102,8 @@ export const variant = theme => input => {
43
102
  hover: getColor(color, 0)
44
103
  };
45
104
  }
105
+
106
+ // Subtle variant - transparent with colored text
46
107
  case 'subtle':
47
108
  {
48
109
  return {
@@ -52,43 +113,77 @@ export const variant = theme => input => {
52
113
  hover: getColor(color, 0)
53
114
  };
54
115
  }
116
+
117
+ // White variant - white background with colored text
55
118
  case 'white':
56
119
  {
57
120
  return {
58
- background: '#fff',
121
+ background: theme.white,
59
122
  color: getColor(color, primaryShade),
60
- border: '#fff',
61
- hover: '#f8f9fa'
123
+ border: theme.white,
124
+ hover: theme.colors.gray?.[0] || '#f8f9fa'
62
125
  };
63
126
  }
127
+
128
+ // Default variant - gray background
64
129
  case 'default':
65
130
  {
131
+ const isDark = theme.colorScheme === 'dark';
132
+ if (isDark) {
133
+ return {
134
+ background: theme.colors.dark?.[6] || '#25262b',
135
+ color: theme.white,
136
+ border: theme.colors.dark?.[4] || '#373A40',
137
+ hover: theme.colors.dark?.[5] || '#2C2E33'
138
+ };
139
+ }
66
140
  return {
67
- background: theme.light.background,
68
- color: theme.light.text,
141
+ background: theme.white,
142
+ color: theme.black,
69
143
  border: theme.colors.gray?.[4] || '#ced4da',
70
144
  hover: theme.colors.gray?.[0] || '#f8f9fa'
71
145
  };
72
146
  }
147
+
148
+ // Gradient variant - transparent background for gradient overlays
149
+ // The actual gradient rendering is handled by LinearGradient component
73
150
  case 'gradient':
74
151
  {
75
- // For gradient variant, return transparent background
76
- // The actual gradient rendering is handled by LinearGradient component
77
- // We just need to provide the text color and border
78
152
  return {
79
153
  background: 'transparent',
80
- color: '#fff',
154
+ color: theme.white,
155
+ border: 'transparent'
156
+ };
157
+ }
158
+
159
+ // Transparent variant - fully transparent
160
+ case 'transparent':
161
+ {
162
+ return {
163
+ background: 'transparent',
164
+ color: getColor(color, primaryShade),
81
165
  border: 'transparent'
82
166
  };
83
167
  }
168
+
169
+ // Default fallback - same as filled variant
84
170
  default:
85
171
  {
172
+ const filledColor = getColor(color, primaryShade);
86
173
  return {
87
- background: getColor(color, primaryShade),
88
- color: '#fff',
89
- border: getColor(color, primaryShade)
174
+ background: filledColor,
175
+ color: theme.white,
176
+ border: filledColor
90
177
  };
91
178
  }
92
179
  }
93
180
  };
181
+
182
+ /**
183
+ * Curried version of variant for use with theme.fn
184
+ * @internal
185
+ */
186
+ export function createVariantFunction(theme) {
187
+ return variant(theme);
188
+ }
94
189
  //# sourceMappingURL=variant.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["themeColor","getPrimaryShade","variant","theme","input","color","primaryColor","primaryShade","getColor","c","shade","filledColor","background","border","hover","outlineColor","light","text","colors","gray"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/variant.ts"],"mappings":";;AAEA,SAASA,UAAU,QAAQ,8BAA2B;AACtD,SAASC,eAAe,QAAQ,oBAAiB;AAuBjD,OAAO,MAAMC,OAAO,GAAIC,KAAmB,IAAMC,KAAmB,IAAoB;EACtF,MAAM;IACJF,OAAO;IACPG,KAAK,GAAGF,KAAK,CAACG;EAChB,CAAC,GAAGF,KAAK;EAET,MAAMG,YAAY,GAAGN,eAAe,CAACE,KAAK,CAAC;EAC3C,MAAMK,QAAQ,GAAGA,CAACC,CAAS,EAAEC,KAAa,KAAKV,UAAU,CAAC;IAAEG,KAAK;IAAEE,KAAK,EAAEI,CAAC;IAAEC;EAAM,CAAC,CAAC;EAErF,QAAQR,OAAO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AAK,SAAS;MAAE;QACd,OAAO;UACLF,UAAU,EAAET,KAAK,CAACa,KAAK,CAACJ,UAAU;UAClCP,KAAK,EAAEF,KAAK,CAACa,KAAK,CAACC,IAAI;UACvBJ,MAAM,EAAEV,KAAK,CAACe,MAAM,CAACC,IAAI,GAAG,CAAC,CAAC,IAAI,SAAS;UAC3CL,KAAK,EAAEX,KAAK,CAACe,MAAM,CAACC,IAAI,GAAG,CAAC,CAAC,IAAI;QACnC,CAAC;MACH;IAEA,KAAK,UAAU;MAAE;QACf;QACA;QACA;QACA,OAAO;UACLP,UAAU,EAAE,aAAa;UACzBP,KAAK,EAAE,MAAM;UACbQ,MAAM,EAAE;QACV,CAAC;MACH;IAEA;MAAS;QACP,OAAO;UACLD,UAAU,EAAEJ,QAAQ,CAACH,KAAK,EAAEE,YAAY,CAAC;UACzCF,KAAK,EAAE,MAAM;UACbQ,MAAM,EAAEL,QAAQ,CAACH,KAAK,EAAEE,YAAY;QACtC,CAAC;MACH;EACF;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["themeColor","getPrimaryShade","variant","theme","input","color","primaryColor","primaryFallback","primaryShade","getColor","c","shade","filledColor","background","white","border","hover","Math","min","textShade","outlineColor","colors","gray","isDark","colorScheme","dark","black","createVariantFunction"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/variant.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,UAAU,QAAQ,8BAA2B;AACtD,SAASC,eAAe,QAAQ,oBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAO,GAAIC,KAAuB,IAAMC,KAAmB,IAAoB;EAC1F,MAAM;IAAEF,OAAO;IAAEG,KAAK,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EAAE,aAAa;UACzBR,KAAK,EAAEF,KAAK,CAACW,KAAK;UAClBC,MAAM,EAAE;QACV,CAAC;MACH;;IAEA;IACA,KAAK,aAAa;MAAE;QAClB,OAAO;UACLF,UAAU,EAAE,aAAa;UACzBR,KAAK,EAAEI,QAAQ,CAACJ,KAAK,EAAEG,YAAY,CAAC;UACpCO,MAAM,EAAE;QACV,CAAC;MACH;;IAEA;IACA;MAAS;QACP,MAAMH,WAAW,GAAGH,QAAQ,CAACJ,KAAK,EAAEG,YAAY,CAAC;QACjD,OAAO;UACLK,UAAU,EAAED,WAAW;UACvBP,KAAK,EAAEF,KAAK,CAACW,KAAK;UAClBC,MAAM,EAAEH;QACV,CAAC;MACH;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,SAASe,qBAAqBA,CAACxB,KAAuB,EAAE;EAC7D,OAAOD,OAAO,CAACC,KAAK,CAAC;AACvB","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Theme functions module
5
+ * Exports all theme-related utilities and functions
6
+ */
7
+
8
+ export { attachFunctions } from "./attach-functions.js";
9
+ export * from "./fns/index.js";
10
+ export * from "./fns/primary-shade.js";
11
+ export * from "./fns/theme-color/theme-color.js";
12
+ export * from "./fns/variant.js";
13
+ export * from "./fns/rgba.js";
14
+ export * from "./fns/radius.js";
15
+ export * from "./fns/size.js";
16
+ export * from "./fns/shadow.js";
17
+ export * from "./fns/gradient/gradient.js";
18
+ export * from "./fns/lighten.js";
19
+ export * from "./fns/darken.js";
20
+ export * from "./fns/dimmed.js";
21
+ export * from "./fns/breakpoints.js";
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["attachFunctions"],"sourceRoot":"../../../../src","sources":["theme/functions/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,uBAAoB;AACpD,cAAc,gBAAO;AACrB,cAAc,wBAAqB;AACnC,cAAc,kCAA+B;AAC7C,cAAc,kBAAe;AAC7B,cAAc,eAAY;AAC1B,cAAc,iBAAc;AAC5B,cAAc,eAAY;AAC1B,cAAc,iBAAc;AAC5B,cAAc,4BAAyB;AACvC,cAAc,kBAAe;AAC7B,cAAc,iBAAc;AAC5B,cAAc,iBAAc;AAC5B,cAAc,sBAAmB","ignoreList":[]}
@@ -1,10 +1,22 @@
1
1
  "use strict";
2
2
 
3
- export { ThemeProvider, useTheme, Theme } from "./theme-provider.js";
3
+ /**
4
+ * Mantine React Native Theme System
5
+ * Main export file for theme-related types and utilities
6
+ */
7
+
8
+ // Type exports
9
+
10
+ // Theme exports
11
+ export { DEFAULT_COLORS } from "./default-colors.js";
12
+ export { DEFAULT_THEME, _DEFAULT_THEME } from "./default-theme.js";
13
+ export { createTheme } from "./create-theme.js";
14
+
15
+ // Function exports
16
+ export { attachFunctions, getPrimaryShade, getPrimaryColor, themeColor, variant, rgba, radius, size, shadow, gradient, lighten, darken, dimmed, largerThan, smallerThan, colorSchemeValue, resolveColorSchemeValue, resolveColorSchemeConstants, isColorSchemeValue } from "./functions/index.js";
17
+
18
+ // Utility exports
4
19
  export { createStyles } from "./create-styles.js";
5
20
  export { filterProps } from "./filter-props.js";
6
21
  export { getSize } from "./get-size/index.js";
7
- export { createTheme } from "./create-theme.js";
8
- export { shadow } from "./functions/fns/shadow.js";
9
- export { gradient } from "./functions/fns/gradient/gradient.js";
10
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ThemeProvider","useTheme","Theme","createStyles","filterProps","getSize","createTheme","shadow","gradient"],"sourceRoot":"../../../src","sources":["theme/index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,qBAAkB;AACjE,SAASC,YAAY,QAAQ,oBAAiB;AAC9C,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,OAAO,QAAQ,qBAAY;AACpC,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,MAAM,QAAQ,2BAAwB;AAE/C,SAASC,QAAQ,QAAQ,sCAAmC","ignoreList":[]}
1
+ {"version":3,"names":["DEFAULT_COLORS","DEFAULT_THEME","_DEFAULT_THEME","createTheme","attachFunctions","getPrimaryShade","getPrimaryColor","themeColor","variant","rgba","radius","size","shadow","gradient","lighten","darken","dimmed","largerThan","smallerThan","colorSchemeValue","resolveColorSchemeValue","resolveColorSchemeConstants","isColorSchemeValue","createStyles","filterProps","getSize"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA;;AAsDA;AACA,SAASA,cAAc,QAAQ,qBAAkB;AACjD,SAASC,aAAa,EAAEC,cAAc,QAAQ,oBAAiB;AAC/D,SAASC,WAAW,QAAQ,mBAAgB;;AAE5C;AACA,SACEC,eAAe,EACfC,eAAe,EACfC,eAAe,EACfC,UAAU,EACVC,OAAO,EACPC,IAAI,EACJC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,MAAM,EACNC,UAAU,EACVC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB,EACvBC,2BAA2B,EAC3BC,kBAAkB,QACb,sBAAa;;AAEpB;AACA,SAASC,YAAY,QAAQ,oBAAiB;AAC9C,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,OAAO,QAAQ,qBAAY","ignoreList":[]}
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- import { get } from 'lodash-es';
4
3
  import React, { createContext, useContext, useEffect, useMemo, useState } from 'react';
5
4
  import { ActivityIndicator, Appearance, Platform } from 'react-native';
6
5
  import { Layout } from "./constants.js";
7
6
  import { createTheme } from "./create-theme.js";
8
- import { getPrimaryShade } from "./functions/fns/primary-shade.js";
9
7
  import { filterProps } from "./filter-props.js";
10
8
  import useCachedResources from "../hooks/useCachedResources.js";
11
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -15,11 +13,6 @@ export const ThemeProvider = ({
15
13
  theme,
16
14
  forceMode
17
15
  }) => {
18
- const {
19
- colors,
20
- primaryColor,
21
- secondaryColor
22
- } = theme;
23
16
  const systemDarkMode = Appearance.getColorScheme();
24
17
  const [currentMode, setCurrentMode] = useState(forceMode || systemDarkMode || 'light');
25
18
  const toggleMode = () => {
@@ -36,23 +29,9 @@ export const ThemeProvider = ({
36
29
  forceModeDevice(currentMode);
37
30
  }, [currentMode]);
38
31
  const memoValue = useMemo(() => {
39
- const darkTheme = {
40
- light: theme.dark,
41
- dark: theme.light
42
- };
43
-
44
- // Get the primary shade for the current mode
45
- const themeWithMode = {
46
- ...theme,
47
- currentMode
48
- };
49
- const shade = getPrimaryShade(themeWithMode);
50
32
  return {
51
33
  ...theme,
52
- primaryTextColor: get(colors, `${primaryColor}.${shade}`, 'black'),
53
- primaryBgColor: get(colors, `${primaryColor}.${shade}`),
54
- secondaryBgColor: get(colors, `${secondaryColor}.0`),
55
- ...(currentMode === 'dark' ? darkTheme : {}),
34
+ colorScheme: currentMode,
56
35
  window: Layout.window,
57
36
  isSmallDevice: Layout.isSmallDevice,
58
37
  screen: Layout.screen,