react-native-mantine 0.14.0 → 0.16.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 (489) hide show
  1. package/README.md +70 -232
  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/Menu/index.js +4 -5
  28. package/lib/commonjs/components/Menu/index.js.map +1 -1
  29. package/lib/commonjs/components/MultiSelect/index.js +8 -9
  30. package/lib/commonjs/components/MultiSelect/index.js.map +1 -1
  31. package/lib/commonjs/components/NativeSelect/index.js +14 -14
  32. package/lib/commonjs/components/NativeSelect/index.js.map +1 -1
  33. package/lib/commonjs/components/NavLink/index.js +43 -20
  34. package/lib/commonjs/components/NavLink/index.js.map +1 -1
  35. package/lib/commonjs/components/Notification/index.js +5 -6
  36. package/lib/commonjs/components/Notification/index.js.map +1 -1
  37. package/lib/commonjs/components/Pagination/index.js +5 -6
  38. package/lib/commonjs/components/Pagination/index.js.map +1 -1
  39. package/lib/commonjs/components/PinInput/index.js +3 -3
  40. package/lib/commonjs/components/PinInput/index.js.map +1 -1
  41. package/lib/commonjs/components/Progress/index.js +3 -5
  42. package/lib/commonjs/components/Progress/index.js.map +1 -1
  43. package/lib/commonjs/components/Radio/index.js +4 -5
  44. package/lib/commonjs/components/Radio/index.js.map +1 -1
  45. package/lib/commonjs/components/Rating/index.js +2 -4
  46. package/lib/commonjs/components/Rating/index.js.map +1 -1
  47. package/lib/commonjs/components/RingProgress/index.js +79 -57
  48. package/lib/commonjs/components/RingProgress/index.js.map +1 -1
  49. package/lib/commonjs/components/Select/index.js +7 -8
  50. package/lib/commonjs/components/Select/index.js.map +1 -1
  51. package/lib/commonjs/components/SimpleGrid/index.js +4 -2
  52. package/lib/commonjs/components/SimpleGrid/index.js.map +1 -1
  53. package/lib/commonjs/components/Spoiler/index.js +1 -1
  54. package/lib/commonjs/components/Spoiler/index.js.map +1 -1
  55. package/lib/commonjs/components/Stepper/index.js +8 -6
  56. package/lib/commonjs/components/Stepper/index.js.map +1 -1
  57. package/lib/commonjs/components/Switch/index.js +4 -5
  58. package/lib/commonjs/components/Switch/index.js.map +1 -1
  59. package/lib/commonjs/components/Table/index.js +257 -273
  60. package/lib/commonjs/components/Table/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 +29 -29
  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.map +1 -1
  92. package/lib/commonjs/theme/functions/fns/helpers.js +51 -3
  93. package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
  94. package/lib/commonjs/theme/functions/fns/index.js +151 -6
  95. package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
  96. package/lib/commonjs/theme/functions/fns/primary-shade.js +81 -2
  97. package/lib/commonjs/theme/functions/fns/primary-shade.js.map +1 -1
  98. package/lib/commonjs/theme/functions/fns/shadow.js.map +1 -1
  99. package/lib/commonjs/theme/functions/fns/size.js +2 -1
  100. package/lib/commonjs/theme/functions/fns/size.js.map +1 -1
  101. package/lib/commonjs/theme/functions/fns/theme-color/color-utils.js +196 -0
  102. package/lib/commonjs/theme/functions/fns/theme-color/color-utils.js.map +1 -0
  103. package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js +92 -9
  104. package/lib/commonjs/theme/functions/fns/theme-color/theme-color.js.map +1 -1
  105. package/lib/commonjs/theme/functions/fns/variant.js +112 -17
  106. package/lib/commonjs/theme/functions/fns/variant.js.map +1 -1
  107. package/lib/commonjs/theme/functions/index.js +172 -0
  108. package/lib/commonjs/theme/functions/index.js.map +1 -0
  109. package/lib/commonjs/theme/index.js +116 -14
  110. package/lib/commonjs/theme/index.js.map +1 -1
  111. package/lib/commonjs/theme/theme-provider.js +1 -22
  112. package/lib/commonjs/theme/theme-provider.js.map +1 -1
  113. package/lib/commonjs/theme/types.js +6 -0
  114. package/lib/commonjs/theme/types.js.map +1 -0
  115. package/lib/commonjs/theme/utils/withTextWrapper.js +1 -2
  116. package/lib/commonjs/theme/utils/withTextWrapper.js.map +1 -1
  117. package/lib/module/components/ActionIcon/ActionIcon.js +1 -1
  118. package/lib/module/components/ActionIcon/ActionIcon.js.map +1 -1
  119. package/lib/module/components/Anchor/index.js +3 -4
  120. package/lib/module/components/Anchor/index.js.map +1 -1
  121. package/lib/module/components/Avatar/index.js +1 -2
  122. package/lib/module/components/Avatar/index.js.map +1 -1
  123. package/lib/module/components/Badge/index.js +54 -24
  124. package/lib/module/components/Badge/index.js.map +1 -1
  125. package/lib/module/components/Blockquote/index.js +4 -5
  126. package/lib/module/components/Blockquote/index.js.map +1 -1
  127. package/lib/module/components/Button/index.js +7 -1
  128. package/lib/module/components/Button/index.js.map +1 -1
  129. package/lib/module/components/Center/index.js.map +1 -1
  130. package/lib/module/components/Checkbox/index.js +4 -5
  131. package/lib/module/components/Checkbox/index.js.map +1 -1
  132. package/lib/module/components/Chip/index.js +40 -21
  133. package/lib/module/components/Chip/index.js.map +1 -1
  134. package/lib/module/components/Code/index.js +6 -4
  135. package/lib/module/components/Code/index.js.map +1 -1
  136. package/lib/module/components/Grid/index.js +18 -13
  137. package/lib/module/components/Grid/index.js.map +1 -1
  138. package/lib/module/components/Highlight/index.js +1 -1
  139. package/lib/module/components/Highlight/index.js.map +1 -1
  140. package/lib/module/components/Indicator/index.js +2 -3
  141. package/lib/module/components/Indicator/index.js.map +1 -1
  142. package/lib/module/components/Menu/index.js +4 -5
  143. package/lib/module/components/Menu/index.js.map +1 -1
  144. package/lib/module/components/MultiSelect/index.js +8 -9
  145. package/lib/module/components/MultiSelect/index.js.map +1 -1
  146. package/lib/module/components/NativeSelect/index.js +14 -14
  147. package/lib/module/components/NativeSelect/index.js.map +1 -1
  148. package/lib/module/components/NavLink/index.js +43 -20
  149. package/lib/module/components/NavLink/index.js.map +1 -1
  150. package/lib/module/components/Notification/index.js +5 -6
  151. package/lib/module/components/Notification/index.js.map +1 -1
  152. package/lib/module/components/Pagination/index.js +5 -6
  153. package/lib/module/components/Pagination/index.js.map +1 -1
  154. package/lib/module/components/PinInput/index.js +3 -3
  155. package/lib/module/components/PinInput/index.js.map +1 -1
  156. package/lib/module/components/Progress/index.js +3 -5
  157. package/lib/module/components/Progress/index.js.map +1 -1
  158. package/lib/module/components/Radio/index.js +4 -5
  159. package/lib/module/components/Radio/index.js.map +1 -1
  160. package/lib/module/components/Rating/index.js +2 -4
  161. package/lib/module/components/Rating/index.js.map +1 -1
  162. package/lib/module/components/RingProgress/index.js +80 -58
  163. package/lib/module/components/RingProgress/index.js.map +1 -1
  164. package/lib/module/components/Select/index.js +7 -8
  165. package/lib/module/components/Select/index.js.map +1 -1
  166. package/lib/module/components/SimpleGrid/index.js +4 -2
  167. package/lib/module/components/SimpleGrid/index.js.map +1 -1
  168. package/lib/module/components/Spoiler/index.js +1 -1
  169. package/lib/module/components/Spoiler/index.js.map +1 -1
  170. package/lib/module/components/Stepper/index.js +8 -6
  171. package/lib/module/components/Stepper/index.js.map +1 -1
  172. package/lib/module/components/Switch/index.js +4 -5
  173. package/lib/module/components/Switch/index.js.map +1 -1
  174. package/lib/module/components/Table/index.js +257 -274
  175. package/lib/module/components/Table/index.js.map +1 -1
  176. package/lib/module/components/Text/index.js +78 -17
  177. package/lib/module/components/Text/index.js.map +1 -1
  178. package/lib/module/components/ThemeIcon/index.js +40 -19
  179. package/lib/module/components/ThemeIcon/index.js.map +1 -1
  180. package/lib/module/components/Timeline/index.js +6 -5
  181. package/lib/module/components/Timeline/index.js.map +1 -1
  182. package/lib/module/components/Title/index.js +5 -17
  183. package/lib/module/components/Title/index.js.map +1 -1
  184. package/lib/module/components/Tooltip/index.js +1 -2
  185. package/lib/module/components/Tooltip/index.js.map +1 -1
  186. package/lib/module/components/TransferList/index.js +9 -10
  187. package/lib/module/components/TransferList/index.js.map +1 -1
  188. package/lib/module/components/UnstyledButton/UnstyledButton.styles.js +2 -2
  189. package/lib/module/components/UnstyledButton/UnstyledButton.styles.js.map +1 -1
  190. package/lib/module/components/index.js +3 -1
  191. package/lib/module/components/index.js.map +1 -1
  192. package/lib/module/index.js +1 -0
  193. package/lib/module/index.js.map +1 -1
  194. package/lib/module/theme/create-theme.js +114 -24
  195. package/lib/module/theme/create-theme.js.map +1 -1
  196. package/lib/module/theme/default-colors.js +99 -0
  197. package/lib/module/theme/default-colors.js.map +1 -0
  198. package/lib/module/theme/default-theme.js +143 -127
  199. package/lib/module/theme/default-theme.js.map +1 -1
  200. package/lib/module/theme/functions/attach-functions.js +47 -14
  201. package/lib/module/theme/functions/attach-functions.js.map +1 -1
  202. package/lib/module/theme/functions/fns/breakpoints.js.map +1 -1
  203. package/lib/module/theme/functions/fns/color-scheme-value.js +180 -0
  204. package/lib/module/theme/functions/fns/color-scheme-value.js.map +1 -0
  205. package/lib/module/theme/functions/fns/dimmed.js.map +1 -1
  206. package/lib/module/theme/functions/fns/gradient/gradient.js.map +1 -1
  207. package/lib/module/theme/functions/fns/helpers.js +48 -2
  208. package/lib/module/theme/functions/fns/helpers.js.map +1 -1
  209. package/lib/module/theme/functions/fns/index.js +35 -7
  210. package/lib/module/theme/functions/fns/index.js.map +1 -1
  211. package/lib/module/theme/functions/fns/primary-shade.js +78 -2
  212. package/lib/module/theme/functions/fns/primary-shade.js.map +1 -1
  213. package/lib/module/theme/functions/fns/shadow.js.map +1 -1
  214. package/lib/module/theme/functions/fns/size.js +2 -1
  215. package/lib/module/theme/functions/fns/size.js.map +1 -1
  216. package/lib/module/theme/functions/fns/theme-color/color-utils.js +189 -0
  217. package/lib/module/theme/functions/fns/theme-color/color-utils.js.map +1 -0
  218. package/lib/module/theme/functions/fns/theme-color/theme-color.js +91 -9
  219. package/lib/module/theme/functions/fns/theme-color/theme-color.js.map +1 -1
  220. package/lib/module/theme/functions/fns/variant.js +112 -17
  221. package/lib/module/theme/functions/fns/variant.js.map +1 -1
  222. package/lib/module/theme/functions/index.js +22 -0
  223. package/lib/module/theme/functions/index.js.map +1 -0
  224. package/lib/module/theme/index.js +16 -4
  225. package/lib/module/theme/index.js.map +1 -1
  226. package/lib/module/theme/theme-provider.js +1 -22
  227. package/lib/module/theme/theme-provider.js.map +1 -1
  228. package/lib/module/theme/types.js +4 -0
  229. package/lib/module/theme/types.js.map +1 -0
  230. package/lib/module/theme/utils/withTextWrapper.js +1 -2
  231. package/lib/module/theme/utils/withTextWrapper.js.map +1 -1
  232. package/lib/typescript/commonjs/src/components/Anchor/index.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/src/components/Avatar/index.d.ts.map +1 -1
  234. package/lib/typescript/commonjs/src/components/Badge/index.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/src/components/Blockquote/index.d.ts.map +1 -1
  236. package/lib/typescript/commonjs/src/components/Button/Button.styles.d.ts +8 -8
  237. package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
  238. package/lib/typescript/commonjs/src/components/Center/index.d.ts +1 -2
  239. package/lib/typescript/commonjs/src/components/Center/index.d.ts.map +1 -1
  240. package/lib/typescript/commonjs/src/components/Checkbox/index.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/src/components/Chip/index.d.ts.map +1 -1
  242. package/lib/typescript/commonjs/src/components/Code/index.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/src/components/Container/index.d.ts +2 -2
  244. package/lib/typescript/commonjs/src/components/Container/index.d.ts.map +1 -1
  245. package/lib/typescript/commonjs/src/components/Flex/index.d.ts +2 -2
  246. package/lib/typescript/commonjs/src/components/Flex/index.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/src/components/Grid/index.d.ts.map +1 -1
  248. package/lib/typescript/commonjs/src/components/Highlight/index.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/src/components/Indicator/index.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/src/components/Menu/index.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/src/components/MultiSelect/index.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/src/components/NativeSelect/index.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/src/components/NavLink/index.d.ts.map +1 -1
  254. package/lib/typescript/commonjs/src/components/Notification/index.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/src/components/Pagination/index.d.ts.map +1 -1
  256. package/lib/typescript/commonjs/src/components/PinInput/index.d.ts.map +1 -1
  257. package/lib/typescript/commonjs/src/components/Progress/index.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/src/components/Radio/index.d.ts.map +1 -1
  259. package/lib/typescript/commonjs/src/components/Rating/index.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/src/components/RingProgress/index.d.ts.map +1 -1
  261. package/lib/typescript/commonjs/src/components/Select/index.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/src/components/SimpleGrid/index.d.ts.map +1 -1
  263. package/lib/typescript/commonjs/src/components/Switch/index.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/src/components/Table/index.d.ts +17 -83
  265. package/lib/typescript/commonjs/src/components/Table/index.d.ts.map +1 -1
  266. package/lib/typescript/commonjs/src/components/Text/index.d.ts +54 -7
  267. package/lib/typescript/commonjs/src/components/Text/index.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/src/components/ThemeIcon/index.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/src/components/Timeline/index.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/src/components/Title/index.d.ts +1 -0
  271. package/lib/typescript/commonjs/src/components/Title/index.d.ts.map +1 -1
  272. package/lib/typescript/commonjs/src/components/Tooltip/index.d.ts.map +1 -1
  273. package/lib/typescript/commonjs/src/components/TransferList/index.d.ts.map +1 -1
  274. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts +2 -2
  275. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -1
  276. package/lib/typescript/commonjs/src/components/index.d.ts +1 -1
  277. package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
  278. package/lib/typescript/commonjs/src/index.d.ts +1 -1
  279. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  280. package/lib/typescript/commonjs/src/theme/create-styles.d.ts +1 -1
  281. package/lib/typescript/commonjs/src/theme/create-styles.d.ts.map +1 -1
  282. package/lib/typescript/commonjs/src/theme/create-theme.d.ts +68 -2
  283. package/lib/typescript/commonjs/src/theme/create-theme.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/src/theme/default-colors.d.ts +12 -0
  285. package/lib/typescript/commonjs/src/theme/default-colors.d.ts.map +1 -0
  286. package/lib/typescript/commonjs/src/theme/default-theme.d.ts +15 -108
  287. package/lib/typescript/commonjs/src/theme/default-theme.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts +20 -1
  289. package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -1
  290. package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts +3 -3
  291. package/lib/typescript/commonjs/src/theme/functions/fns/breakpoints.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/src/theme/functions/fns/color-scheme-value.d.ts +100 -0
  293. package/lib/typescript/commonjs/src/theme/functions/fns/color-scheme-value.d.ts.map +1 -0
  294. package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts +2 -2
  295. package/lib/typescript/commonjs/src/theme/functions/fns/dimmed.d.ts.map +1 -1
  296. package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts +2 -3
  297. package/lib/typescript/commonjs/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -1
  298. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +36 -8
  299. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts.map +1 -1
  300. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +40 -14
  301. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
  302. package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts +53 -3
  303. package/lib/typescript/commonjs/src/theme/functions/fns/primary-shade.d.ts.map +1 -1
  304. package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts +1 -1
  305. package/lib/typescript/commonjs/src/theme/functions/fns/shadow.d.ts.map +1 -1
  306. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts +2 -2
  307. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/color-utils.d.ts +50 -0
  309. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/color-utils.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts +51 -5
  311. package/lib/typescript/commonjs/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -1
  312. package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts +52 -19
  313. package/lib/typescript/commonjs/src/theme/functions/fns/variant.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/src/theme/functions/index.d.ts +19 -0
  315. package/lib/typescript/commonjs/src/theme/functions/index.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/src/theme/index.d.ts +9 -6
  317. package/lib/typescript/commonjs/src/theme/index.d.ts.map +1 -1
  318. package/lib/typescript/commonjs/src/theme/theme-provider.d.ts +1 -1
  319. package/lib/typescript/commonjs/src/theme/theme-provider.d.ts.map +1 -1
  320. package/lib/typescript/commonjs/src/theme/types.d.ts +494 -0
  321. package/lib/typescript/commonjs/src/theme/types.d.ts.map +1 -0
  322. package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts +1 -1
  323. package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts.map +1 -1
  324. package/lib/typescript/module/src/components/Anchor/index.d.ts.map +1 -1
  325. package/lib/typescript/module/src/components/Avatar/index.d.ts.map +1 -1
  326. package/lib/typescript/module/src/components/Badge/index.d.ts.map +1 -1
  327. package/lib/typescript/module/src/components/Blockquote/index.d.ts.map +1 -1
  328. package/lib/typescript/module/src/components/Button/Button.styles.d.ts +8 -8
  329. package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
  330. package/lib/typescript/module/src/components/Center/index.d.ts +1 -2
  331. package/lib/typescript/module/src/components/Center/index.d.ts.map +1 -1
  332. package/lib/typescript/module/src/components/Checkbox/index.d.ts.map +1 -1
  333. package/lib/typescript/module/src/components/Chip/index.d.ts.map +1 -1
  334. package/lib/typescript/module/src/components/Code/index.d.ts.map +1 -1
  335. package/lib/typescript/module/src/components/Container/index.d.ts +2 -2
  336. package/lib/typescript/module/src/components/Container/index.d.ts.map +1 -1
  337. package/lib/typescript/module/src/components/Flex/index.d.ts +2 -2
  338. package/lib/typescript/module/src/components/Flex/index.d.ts.map +1 -1
  339. package/lib/typescript/module/src/components/Grid/index.d.ts.map +1 -1
  340. package/lib/typescript/module/src/components/Highlight/index.d.ts.map +1 -1
  341. package/lib/typescript/module/src/components/Indicator/index.d.ts.map +1 -1
  342. package/lib/typescript/module/src/components/Menu/index.d.ts.map +1 -1
  343. package/lib/typescript/module/src/components/MultiSelect/index.d.ts.map +1 -1
  344. package/lib/typescript/module/src/components/NativeSelect/index.d.ts.map +1 -1
  345. package/lib/typescript/module/src/components/NavLink/index.d.ts.map +1 -1
  346. package/lib/typescript/module/src/components/Notification/index.d.ts.map +1 -1
  347. package/lib/typescript/module/src/components/Pagination/index.d.ts.map +1 -1
  348. package/lib/typescript/module/src/components/PinInput/index.d.ts.map +1 -1
  349. package/lib/typescript/module/src/components/Progress/index.d.ts.map +1 -1
  350. package/lib/typescript/module/src/components/Radio/index.d.ts.map +1 -1
  351. package/lib/typescript/module/src/components/Rating/index.d.ts.map +1 -1
  352. package/lib/typescript/module/src/components/RingProgress/index.d.ts.map +1 -1
  353. package/lib/typescript/module/src/components/Select/index.d.ts.map +1 -1
  354. package/lib/typescript/module/src/components/SimpleGrid/index.d.ts.map +1 -1
  355. package/lib/typescript/module/src/components/Switch/index.d.ts.map +1 -1
  356. package/lib/typescript/module/src/components/Table/index.d.ts +17 -83
  357. package/lib/typescript/module/src/components/Table/index.d.ts.map +1 -1
  358. package/lib/typescript/module/src/components/Text/index.d.ts +54 -7
  359. package/lib/typescript/module/src/components/Text/index.d.ts.map +1 -1
  360. package/lib/typescript/module/src/components/ThemeIcon/index.d.ts.map +1 -1
  361. package/lib/typescript/module/src/components/Timeline/index.d.ts.map +1 -1
  362. package/lib/typescript/module/src/components/Title/index.d.ts +1 -0
  363. package/lib/typescript/module/src/components/Title/index.d.ts.map +1 -1
  364. package/lib/typescript/module/src/components/Tooltip/index.d.ts.map +1 -1
  365. package/lib/typescript/module/src/components/TransferList/index.d.ts.map +1 -1
  366. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts +2 -2
  367. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.styles.d.ts.map +1 -1
  368. package/lib/typescript/module/src/components/index.d.ts +1 -1
  369. package/lib/typescript/module/src/components/index.d.ts.map +1 -1
  370. package/lib/typescript/module/src/index.d.ts +1 -1
  371. package/lib/typescript/module/src/index.d.ts.map +1 -1
  372. package/lib/typescript/module/src/theme/create-styles.d.ts +1 -1
  373. package/lib/typescript/module/src/theme/create-styles.d.ts.map +1 -1
  374. package/lib/typescript/module/src/theme/create-theme.d.ts +68 -2
  375. package/lib/typescript/module/src/theme/create-theme.d.ts.map +1 -1
  376. package/lib/typescript/module/src/theme/default-colors.d.ts +12 -0
  377. package/lib/typescript/module/src/theme/default-colors.d.ts.map +1 -0
  378. package/lib/typescript/module/src/theme/default-theme.d.ts +15 -108
  379. package/lib/typescript/module/src/theme/default-theme.d.ts.map +1 -1
  380. package/lib/typescript/module/src/theme/functions/attach-functions.d.ts +20 -1
  381. package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -1
  382. package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts +3 -3
  383. package/lib/typescript/module/src/theme/functions/fns/breakpoints.d.ts.map +1 -1
  384. package/lib/typescript/module/src/theme/functions/fns/color-scheme-value.d.ts +100 -0
  385. package/lib/typescript/module/src/theme/functions/fns/color-scheme-value.d.ts.map +1 -0
  386. package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts +2 -2
  387. package/lib/typescript/module/src/theme/functions/fns/dimmed.d.ts.map +1 -1
  388. package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts +2 -3
  389. package/lib/typescript/module/src/theme/functions/fns/gradient/gradient.d.ts.map +1 -1
  390. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +36 -8
  391. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts.map +1 -1
  392. package/lib/typescript/module/src/theme/functions/fns/index.d.ts +40 -14
  393. package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
  394. package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts +53 -3
  395. package/lib/typescript/module/src/theme/functions/fns/primary-shade.d.ts.map +1 -1
  396. package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts +1 -1
  397. package/lib/typescript/module/src/theme/functions/fns/shadow.d.ts.map +1 -1
  398. package/lib/typescript/module/src/theme/functions/fns/size.d.ts +2 -2
  399. package/lib/typescript/module/src/theme/functions/fns/size.d.ts.map +1 -1
  400. package/lib/typescript/module/src/theme/functions/fns/theme-color/color-utils.d.ts +50 -0
  401. package/lib/typescript/module/src/theme/functions/fns/theme-color/color-utils.d.ts.map +1 -0
  402. package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts +51 -5
  403. package/lib/typescript/module/src/theme/functions/fns/theme-color/theme-color.d.ts.map +1 -1
  404. package/lib/typescript/module/src/theme/functions/fns/variant.d.ts +52 -19
  405. package/lib/typescript/module/src/theme/functions/fns/variant.d.ts.map +1 -1
  406. package/lib/typescript/module/src/theme/functions/index.d.ts +19 -0
  407. package/lib/typescript/module/src/theme/functions/index.d.ts.map +1 -0
  408. package/lib/typescript/module/src/theme/index.d.ts +9 -6
  409. package/lib/typescript/module/src/theme/index.d.ts.map +1 -1
  410. package/lib/typescript/module/src/theme/theme-provider.d.ts +1 -1
  411. package/lib/typescript/module/src/theme/theme-provider.d.ts.map +1 -1
  412. package/lib/typescript/module/src/theme/types.d.ts +494 -0
  413. package/lib/typescript/module/src/theme/types.d.ts.map +1 -0
  414. package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts +1 -1
  415. package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts.map +1 -1
  416. package/package.json +1 -1
  417. package/src/components/ActionIcon/ActionIcon.tsx +3 -3
  418. package/src/components/Anchor/index.tsx +3 -4
  419. package/src/components/Avatar/index.tsx +1 -2
  420. package/src/components/Badge/index.tsx +36 -19
  421. package/src/components/Blockquote/index.tsx +4 -6
  422. package/src/components/Button/index.tsx +5 -1
  423. package/src/components/Center/index.tsx +1 -2
  424. package/src/components/Checkbox/index.tsx +4 -5
  425. package/src/components/Chip/index.tsx +25 -18
  426. package/src/components/Code/index.tsx +7 -5
  427. package/src/components/Container/index.tsx +2 -2
  428. package/src/components/Flex/index.tsx +2 -2
  429. package/src/components/Grid/index.tsx +16 -10
  430. package/src/components/Highlight/index.tsx +1 -2
  431. package/src/components/Indicator/index.tsx +3 -4
  432. package/src/components/Menu/index.tsx +8 -10
  433. package/src/components/MultiSelect/index.tsx +13 -15
  434. package/src/components/NativeSelect/index.tsx +34 -21
  435. package/src/components/NavLink/index.tsx +27 -23
  436. package/src/components/Notification/index.tsx +5 -6
  437. package/src/components/Pagination/index.tsx +5 -6
  438. package/src/components/PinInput/index.tsx +5 -6
  439. package/src/components/Progress/index.tsx +5 -6
  440. package/src/components/Radio/index.tsx +4 -5
  441. package/src/components/Rating/index.tsx +2 -4
  442. package/src/components/RingProgress/index.tsx +93 -62
  443. package/src/components/Select/index.tsx +11 -13
  444. package/src/components/SimpleGrid/index.tsx +5 -2
  445. package/src/components/Spoiler/index.tsx +1 -1
  446. package/src/components/Stepper/index.tsx +17 -17
  447. package/src/components/Switch/index.tsx +5 -6
  448. package/src/components/Table/index.tsx +333 -413
  449. package/src/components/Text/index.tsx +125 -28
  450. package/src/components/ThemeIcon/index.tsx +23 -23
  451. package/src/components/Timeline/index.tsx +12 -15
  452. package/src/components/Title/index.tsx +5 -22
  453. package/src/components/Tooltip/index.tsx +1 -3
  454. package/src/components/TransferList/index.tsx +16 -18
  455. package/src/components/UnstyledButton/UnstyledButton.styles.ts +4 -2
  456. package/src/components/index.tsx +3 -1
  457. package/src/index.tsx +1 -1
  458. package/src/theme/create-styles.ts +1 -1
  459. package/src/theme/create-theme.ts +134 -23
  460. package/src/theme/default-colors.ts +252 -0
  461. package/src/theme/default-theme.ts +178 -392
  462. package/src/theme/functions/attach-functions.ts +57 -10
  463. package/src/theme/functions/fns/breakpoints.ts +4 -4
  464. package/src/theme/functions/fns/color-scheme-value.ts +200 -0
  465. package/src/theme/functions/fns/dimmed.ts +2 -2
  466. package/src/theme/functions/fns/gradient/gradient.ts +2 -3
  467. package/src/theme/functions/fns/helpers.ts +50 -9
  468. package/src/theme/functions/fns/index.ts +63 -3
  469. package/src/theme/functions/fns/primary-shade.ts +84 -8
  470. package/src/theme/functions/fns/shadow.ts +1 -1
  471. package/src/theme/functions/fns/size.ts +4 -3
  472. package/src/theme/functions/fns/theme-color/color-utils.ts +193 -0
  473. package/src/theme/functions/fns/theme-color/theme-color.ts +85 -17
  474. package/src/theme/functions/fns/variant.ts +106 -44
  475. package/src/theme/functions/index.ts +19 -0
  476. package/src/theme/index.ts +91 -0
  477. package/src/theme/theme-provider.tsx +2 -17
  478. package/src/theme/types.ts +625 -0
  479. package/src/theme/utils/withTextWrapper.tsx +2 -3
  480. package/lib/commonjs/components/Table/Table.example.js +0 -323
  481. package/lib/commonjs/components/Table/Table.example.js.map +0 -1
  482. package/lib/module/components/Table/Table.example.js +0 -318
  483. package/lib/module/components/Table/Table.example.js.map +0 -1
  484. package/lib/typescript/commonjs/src/components/Table/Table.example.d.ts +0 -13
  485. package/lib/typescript/commonjs/src/components/Table/Table.example.d.ts.map +0 -1
  486. package/lib/typescript/module/src/components/Table/Table.example.d.ts +0 -13
  487. package/lib/typescript/module/src/components/Table/Table.example.d.ts.map +0 -1
  488. package/src/components/Table/Table.example.tsx +0 -215
  489. package/src/theme/index.tsx +0 -9
@@ -1 +1 @@
1
- {"version":3,"names":["dimmed","theme","colorScheme","currentMode","colors","dark","gray"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/dimmed.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,MAAMA,CAACC,KAAmB,EAAE;EAC1C,OAAO,MAAM;IACX,MAAMC,WAAW,GAAGD,KAAK,CAACE,WAAW,IAAI,OAAO;IAChD,OAAOD,WAAW,KAAK,MAAM,GACzBD,KAAK,CAACG,MAAM,CAACC,IAAI,GAAG,CAAC,CAAC,IAAI,SAAS,GACnCJ,KAAK,CAACG,MAAM,CAACE,IAAI,GAAG,CAAC,CAAC,IAAI,SAAS;EACzC,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["dimmed","theme","colorScheme","currentMode","colors","dark","gray"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/dimmed.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,MAAMA,CAACC,KAAuB,EAAE;EAC9C,OAAO,MAAM;IACX,MAAMC,WAAW,GAAGD,KAAK,CAACE,WAAW,IAAI,OAAO;IAChD,OAAOD,WAAW,KAAK,MAAM,GACzBD,KAAK,CAACG,MAAM,CAACC,IAAI,GAAG,CAAC,CAAC,IAAI,SAAS,GACnCJ,KAAK,CAACG,MAAM,CAACE,IAAI,GAAG,CAAC,CAAC,IAAI,SAAS;EACzC,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["themeColor","getPrimaryShade","degToCoordinates","deg","angle","radians","Math","PI","endX","cos","endY","sin","start","x","y","end","gradient","theme","payload","merged","from","defaultGradient","primaryColor","to","primaryShade","fromColor","color","shade","toColor","colors","linearGradientString","join"],"sourceRoot":"../../../../../../src","sources":["theme/functions/fns/gradient/gradient.ts"],"mappings":";;AAEA,SAASA,UAAU,QAAQ,+BAA4B;AACvD,SAASC,eAAe,QAAQ,qBAAkB;;AAElD;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAACC,GAAW,EAAsE;EACzG,MAAMC,KAAK,GAAG,CAAED,GAAG,GAAG,GAAG,GAAI,GAAG,IAAI,GAAG,CAAC,CAAC;EACzC,MAAME,OAAO,GAAID,KAAK,GAAGE,IAAI,CAACC,EAAE,GAAI,GAAG;;EAEvC;EACA,MAAMC,IAAI,GAAGF,IAAI,CAACG,GAAG,CAACJ,OAAO,GAAGC,IAAI,CAACC,EAAE,GAAG,CAAC,CAAC;EAC5C,MAAMG,IAAI,GAAGJ,IAAI,CAACK,GAAG,CAACN,OAAO,GAAGC,IAAI,CAACC,EAAE,GAAG,CAAC,CAAC;;EAE5C;EACA,MAAMK,KAAK,GAAG;IACZC,CAAC,EAAE,C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AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASe,oBAAoBA,CAAC3B,GAAW,EAAE,GAAG0B,MAAgB,EAAE;EACrE,OAAO,mBAAmB1B,GAAG,QAAQ0B,MAAM,CAACE,IAAI,CAAC,IAAI,CAAC,GAAG;AAC3D","ignoreList":[]}
1
+ {"version":3,"names":["themeColor","getPrimaryShade","degToCoordinates","deg","angle","radians","Math","PI","endX","cos","endY","sin","start","x","y","end","gradient","theme","payload","merged","from","defaultGradient","primaryColor","to","primaryShade","fromColor","color","shade","toColor","colors","linearGradientString","join"],"sourceRoot":"../../../../../../src","sources":["theme/functions/fns/gradient/gradient.ts"],"mappings":";;AACA,SAASA,UAAU,QAAQ,+BAA4B;AACvD,SAASC,eAAe,QAAQ,qBAAkB;;AAElD;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAACC,GAAW,EAAsE;EACzG,MAAMC,KAAK,GAAG,CAAED,GAAG,GAAG,GAAG,GAAI,GAAG,IAAI,GAAG,CAAC,CAAC;EACzC,MAAME,OAAO,GAAID,KAAK,GAAGE,IAAI,CAACC,EAAE,GAAI,GAAG;;EAEvC;EACA,MAAMC,IAAI,GAAGF,IAAI,CAACG,GAAG,CAACJ,OAAO,GAAGC,IAAI,CAACC,EAAE,GAAG,CAAC,CAAC;EAC5C,MAAMG,IAAI,GAAGJ,IAAI,CAACK,GAAG,CAACN,OAAO,GAAGC,IAAI,CAACC,EAAE,GAAG,CAAC,CAAC;;EAE5C;EACA,MAAMK,KAAK,GAAG;IACZC,CAAC,EAAE,CAAC,CAAC,GAAGL,IAAI,IAAI,CAAC;IACjBM,CAAC,EAAE,CAAC,CAAC,GAAGJ,IAAI,IAAI;EAClB,CAAC;EACD,MAAMK,GAAG,GAAG;IACVF,CAAC,EAAE,CAAC,CAAC,GAAGL,IAAI,IAAI,CAAC;IACjBM,CAAC,EAAE,CAAC,CAAC,GAAGJ,IAAI,IAAI;EAClB,CAAC;EAED,OAAO;IAAEE,KAAK;IAAEG;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6
+ * Returns base font styles from theme
7
+ * Includes fontFamily and lineHeight
8
+ */
3
9
  export const fontStyles = theme => () => ({
4
- fontFamily: theme.fontFamily
10
+ fontFamily: theme.fontFamily,
11
+ lineHeight: theme.lineHeight
5
12
  });
6
13
 
7
14
  /**
@@ -9,7 +16,46 @@ export const fontStyles = theme => () => ({
9
16
  */
10
17
  export const inputFontStyles = theme => () => {
11
18
  return {
12
- fontFamily: theme.fontFamily
19
+ fontFamily: theme.fontFamilyInput,
20
+ fontSize: theme.fontSizes.md,
21
+ lineHeight: theme.lineHeights.md
22
+ };
23
+ };
24
+
25
+ /**
26
+ * Get font size from theme
27
+ * @param size - Size key or number
28
+ */
29
+ export const fontSize = theme => size => {
30
+ return getSize({
31
+ size,
32
+ sizes: theme.fontSizes
33
+ });
34
+ };
35
+
36
+ /**
37
+ * Get line height from theme
38
+ * @param size - Size key or number (unitless multiplier)
39
+ */
40
+ export const lineHeight = theme => size => {
41
+ return getSize({
42
+ size,
43
+ sizes: theme.lineHeights
44
+ });
45
+ };
46
+
47
+ /**
48
+ * Get heading styles by order
49
+ * @param order - Heading level (1-6)
50
+ */
51
+ export const headingStyles = theme => order => {
52
+ const headingKey = `h${order}`;
53
+ const heading = theme.headings.sizes[headingKey];
54
+ return {
55
+ fontSize: heading.fontSize,
56
+ lineHeight: heading.lineHeight * heading.fontSize,
57
+ fontWeight: heading.fontWeight ?? theme.headings.fontWeight ?? theme.fontWeights.bold,
58
+ fontFamily: heading.fontFamily ?? theme.headings.fontFamily ?? theme.fontFamilyBold
13
59
  };
14
60
  };
15
61
  export const focusStyles = _theme => () => ({
@@ -1 +1 @@
1
- {"version":3,"names":["fontStyles","theme","fontFamily","inputFontStyles","focusStyles","_theme","placeholderStyles","opacity","cover","offset","position","top","right","bottom","left","hover","styles","activeStyles","transform","scale"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/helpers.ts"],"mappings":";;AAEA,OAAO,MAAMA,UAAU,GAAIC,KAAmB,IAAK,OAAO;EACxDC,UAAU,EAAED,KAAK,CAACC;AACpB,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAIF,KAAmB,IAAK,MAAM;EAC5D,OAAO;IACLC,UAAU,EAAED,KAAK,CAACC;EACpB,CAAC;AACH,CAAC;AAED,OAAO,MAAME,WAAW,GAAIC,MAAoB,IAAK,OAAO;EAC1D;EACA;EACA;AAAA,CACD,CAAC;AAEF,OAAO,MAAMC,iBAAiB,GAAID,MAAoB,IAAK,OAAO;EAChE;EACAE,OAAO,EAAE;AACX,CAAC,CAAC;AAEF,OAAO,MAAMC,KAAK,GACfH,MAAoB,IACrB,CAACI,MAAc,GAAG,CAAC,MAAM;EACvBC,QAAQ,EAAE,UAAmB;EAC7BC,GAAG,EAAEF,MAAM;EACXG,KAAK,EAAEH,MAAM;EACbI,MAAM,EAAEJ,MAAM;EACdK,IAAI,EAAEL;AACR,CAAC,CAAC;AAEJ,OAAO,MAAMM,KAAK,GAAIV,MAAoB,IAAMW,MAAW,KAAM;EAC/D;EACA;EACA,GAAGA;AACL,CAAC,CAAC;AAEF,OAAO,MAAMC,YAAY,GAAIZ,MAAoB,KAAM;EACrD;EACAE,OAAO,EAAE,GAAG;EACZW,SAAS,EAAE,CAAC;IAAEC,KAAK,EAAE;EAAK,CAAC;AAC7B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getSize","fontStyles","theme","fontFamily","lineHeight","inputFontStyles","fontFamilyInput","fontSize","fontSizes","md","lineHeights","size","sizes","headingStyles","order","headingKey","heading","headings","fontWeight","fontWeights","bold","fontFamilyBold","focusStyles","_theme","placeholderStyles","opacity","cover","offset","position","top","right","bottom","left","hover","styles","activeStyles","transform","scale"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/helpers.ts"],"mappings":";;AAEA,SAASA,OAAO,QAAQ,yBAAgB;;AAExC;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAIC,KAAuB,IAAK,OAAO;EAC5DC,UAAU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AC;AAED,OAAO,MAAMC,WAAW,GAAIC,MAAwB,IAAK,OAAO;EAC9D;EACA;EACA;AAAA,CACD,CAAC;AAEF,OAAO,MAAMC,iBAAiB,GAAID,MAAwB,IAAK,OAAO;EACpE;EACAE,OAAO,EAAE;AACX,CAAC,CAAC;AAEF,OAAO,MAAMC,KAAK,GACfH,MAAwB,IACzB,CAACI,MAAc,GAAG,CAAC,MAAM;EACvBC,QAAQ,EAAE,UAAmB;EAC7BC,GAAG,EAAEF,MAAM;EACXG,KAAK,EAAEH,MAAM;EACbI,MAAM,EAAEJ,MAAM;EACdK,IAAI,EAAEL;AACR,CAAC,CAAC;AAEJ,OAAO,MAAMM,KAAK,GAAIV,MAAwB,IAAMW,MAAW,KAAM;EACnE;EACA;EACA,GAAGA;AACL,CAAC,CAAC;AAEF,OAAO,MAAMC,YAAY,GAAIZ,MAAwB,KAAM;EACzD;EACAE,OAAO,EAAE,GAAG;EACZW,SAAS,EAAE,CAAC;IAAEC,KAAK,EAAE;EAAK,CAAC;AAC7B,CAAC,CAAC","ignoreList":[]}
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
2
 
3
+ /**
4
+ * Theme helper functions
5
+ * Exports all utility functions for theme manipulation
6
+ */
7
+
3
8
  import { radius } from "./radius.js";
4
9
  import { rgba } from "./rgba.js";
5
10
  import { size } from "./size.js";
6
11
  import { themeColor } from "./theme-color/theme-color.js";
7
12
  import { variant } from "./variant.js";
8
- import { getPrimaryShade } from "./primary-shade.js";
13
+ import { getPrimaryShade, getPrimaryColor } from "./primary-shade.js";
9
14
  import { shadow } from "./shadow.js";
10
15
  import { gradient } from "./gradient/gradient.js";
11
16
  import { lighten } from "./lighten.js";
@@ -13,20 +18,43 @@ import { darken } from "./darken.js";
13
18
  import { dimmed } from "./dimmed.js";
14
19
  import { largerThan, smallerThan } from "./breakpoints.js";
15
20
  import * as helpers from "./helpers.js";
21
+ import { createColorSchemeValueFunction, createColorSchemeConstantsFunction } from "./color-scheme-value.js";
22
+
23
+ /**
24
+ * Collection of all theme helper functions
25
+ * Used by attach-functions to create theme.fn object
26
+ */
16
27
  export const fns = {
17
- radius,
18
- rgba,
19
- size,
20
- variant,
28
+ // Color functions
21
29
  themeColor,
22
30
  getPrimaryShade,
23
- shadow,
24
- gradient,
31
+ getPrimaryColor,
32
+ // Variant function
33
+ variant,
34
+ // Color manipulation
35
+ rgba,
25
36
  lighten,
26
37
  darken,
27
38
  dimmed,
39
+ // Size and spacing
40
+ radius,
41
+ size,
42
+ // Visual effects
43
+ shadow,
44
+ gradient,
45
+ // Responsive
28
46
  largerThan,
29
47
  smallerThan,
48
+ // Color scheme helpers
49
+ colorSchemeValue: createColorSchemeValueFunction,
50
+ colorSchemeConstants: createColorSchemeConstantsFunction,
51
+ // Helper functions from helpers module
30
52
  ...helpers
31
53
  };
54
+
55
+ // Re-export individual functions for direct imports
56
+ export { radius, rgba, size, themeColor, variant, getPrimaryShade, getPrimaryColor, shadow, gradient, lighten, darken, dimmed, largerThan, smallerThan };
57
+
58
+ // Re-export color scheme helpers
59
+ export { colorSchemeValue, resolveColorSchemeValue, resolveColorSchemeConstants, isColorSchemeValue, createColorSchemeValueFunction, createColorSchemeConstantsFunction } from "./color-scheme-value.js";
32
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["radius","rgba","size","themeColor","variant","getPrimaryShade","shadow","gradient","lighten","darken","dimmed","largerThan","smallerThan","helpers","fns"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,aAAU;AACjC,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,eAAe,QAAQ,oBAAiB;AACjD,SAASC,MAAM,QAAQ,aAAU;AACjC,SAASC,QAAQ,QAAQ,wBAAqB;AAC9C,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,MAAM,QAAQ,aAAU;AACjC,SAASC,MAAM,QAAQ,aAAU;AACjC,SAASC,UAAU,EAAEC,WAAW,QAAQ,kBAAe;AACvD,OAAO,KAAKC,OAAO,MAAM,cAAW;AAEpC,OAAO,MAAMC,GAAG,GAAG;EACjBd,MAAM;EACNC,IAAI;EACJC,IAAI;EACJE,OAAO;EACPD,UAAU;EACVE,eAAe;EACfC,MAAM;EACNC,QAAQ;EACRC,OAAO;EACPC,MAAM;EACNC,MAAM;EACNC,UAAU;EACVC,WAAW;EACX,GAAGC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["radius","rgba","size","themeColor","variant","getPrimaryShade","getPrimaryColor","shadow","gradient","lighten","darken","dimmed","largerThan","smallerThan","helpers","createColorSchemeValueFunction","createColorSchemeConstantsFunction","fns","colorSchemeValue","colorSchemeConstants","resolveColorSchemeValue","resolveColorSchemeConstants","isColorSchemeValue"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,aAAU;AACjC,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,eAAe,EAAEC,eAAe,QAAQ,oBAAiB;AAClE,SAASC,MAAM,QAAQ,aAAU;AACjC,SAASC,QAAQ,QAAQ,wBAAqB;AAC9C,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,MAAM,QAAQ,aAAU;AACjC,SAASC,MAAM,QAAQ,aAAU;AACjC,SAASC,UAAU,EAAEC,WAAW,QAAQ,kBAAe;AACvD,OAAO,KAAKC,OAAO,MAAM,cAAW;AACpC,SACEC,8BAA8B,EAC9BC,kCAAkC,QAC7B,yBAAsB;;AAE7B;AACA;AACA;AACA;AACA,OAAO,MAAMC,GAAG,GAAG;EACjB;EACAd,UAAU;EACVE,eAAe;EACfC,eAAe;EAEf;EACAF,OAAO;EAEP;EACAH,IAAI;EACJQ,OAAO;EACPC,MAAM;EACNC,MAAM;EAEN;EACAX,MAAM;EACNE,IAAI;EAEJ;EACAK,MAAM;EACNC,QAAQ;EAER;EACAI,UAAU;EACVC,WAAW;EAEX;EACAK,gBAAgB,EAAEH,8BAA8B;EAChDI,oBAAoB,EAAEH,kCAAkC;EAExD;EACA,GAAGF;AACL,CAAC;;AAED;AACA,SACEd,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,OAAO,EACPC,eAAe,EACfC,eAAe,EACfC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,MAAM,EACNC,UAAU,EACVC,WAAW;;AAGb;AACA,SACEK,gBAAgB,EAChBE,uBAAuB,EACvBC,2BAA2B,EAC3BC,kBAAkB,EAClBP,8BAA8B,EAC9BC,kCAAkC,QAC7B,yBAAsB","ignoreList":[]}
@@ -1,14 +1,90 @@
1
1
  "use strict";
2
2
 
3
3
  /**
4
+ * Primary shade helper function
4
5
  * Returns the appropriate primary shade based on the current color scheme
5
- * Matches Mantine web implementation
6
+ * Aligned with Mantine web's primaryShade implementation
7
+ */
8
+
9
+ /**
10
+ * Get the primary shade for the current color scheme
11
+ *
12
+ * If theme.primaryShade is a number, returns that number.
13
+ * If theme.primaryShade is an object with light/dark values, returns the
14
+ * appropriate value based on the color scheme.
15
+ *
16
+ * @param theme - Mantine theme object
17
+ * @param colorScheme - Optional color scheme override (light or dark)
18
+ * @returns Shade value (0-9)
19
+ *
20
+ * @example
21
+ * // With theme.primaryShade = { light: 6, dark: 8 }
22
+ * // and theme.colorScheme = 'light'
23
+ * getPrimaryShade(theme) // returns 6
24
+ *
25
+ * @example
26
+ * // With explicit colorScheme override
27
+ * getPrimaryShade(theme, 'dark') // returns 8
28
+ *
29
+ * @example
30
+ * // With theme.primaryShade = 7 (single number)
31
+ * getPrimaryShade(theme) // returns 7
6
32
  */
7
33
  export function getPrimaryShade(theme, colorScheme) {
34
+ // If primaryShade is a single number, return it directly
8
35
  if (typeof theme.primaryShade === 'number') {
9
36
  return theme.primaryShade;
10
37
  }
11
- const scheme = colorScheme || theme.currentMode || 'light';
38
+
39
+ // Determine which color scheme to use
40
+ // Priority: 1. parameter override, 2. theme.colorScheme, 3. default to 'light'
41
+ const scheme = colorScheme || theme.colorScheme || 'light';
42
+
43
+ // Return the appropriate shade for the color scheme
12
44
  return theme.primaryShade[scheme];
13
45
  }
46
+
47
+ /**
48
+ * Curried version of getPrimaryShade for use with theme.fn
49
+ * Matches Mantine web's theme.fn.primaryShade signature
50
+ *
51
+ * @internal
52
+ */
53
+ export function createPrimaryShadeFunction(theme) {
54
+ return colorScheme => {
55
+ return getPrimaryShade(theme, colorScheme);
56
+ };
57
+ }
58
+
59
+ /**
60
+ * Get the primary color at the primary shade
61
+ *
62
+ * @param theme - Mantine theme object
63
+ * @param colorScheme - Optional color scheme override
64
+ * @returns Color string value
65
+ *
66
+ * @example
67
+ * // Get primary color at primary shade
68
+ * getPrimaryColor(theme) // returns '#228be6' (blue[6])
69
+ */
70
+ export function getPrimaryColor(theme, colorScheme) {
71
+ const shade = getPrimaryShade(theme, colorScheme);
72
+ const primaryPalette = theme.colors[theme.primaryColor];
73
+ if (!primaryPalette) {
74
+ console.warn(`Primary color "${theme.primaryColor}" not found in theme.colors. Falling back to 'blue'.`);
75
+ return theme.colors.blue?.[shade] || '#228be6';
76
+ }
77
+ return primaryPalette[shade] || primaryPalette[0] || '#228be6';
78
+ }
79
+
80
+ /**
81
+ * Curried version of getPrimaryColor for use with theme.fn
82
+ *
83
+ * @internal
84
+ */
85
+ export function createPrimaryColorFunction(theme) {
86
+ return colorScheme => {
87
+ return getPrimaryColor(theme, colorScheme);
88
+ };
89
+ }
14
90
  //# sourceMappingURL=primary-shade.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getPrimaryShade","theme","colorScheme","primaryShade","scheme","currentMode"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/primary-shade.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAC7BC,KAAmB,EACnBC,WAA8B,EACtB;EACR,IAAI,OAAOD,KAAK,CAACE,YAAY,KAAK,QAAQ,EAAE;IAC1C,OAAOF,KAAK,CAACE,YAAY;EAC3B;EAEA,MAAMC,MAAM,GAAGF,WAAW,IAAID,KAAK,CAACI,WAAW,IAAI,OAAO;EAC1D,OAAOJ,KAAK,CAACE,YAAY,CAACC,MAAM,CAAC;AACnC","ignoreList":[]}
1
+ {"version":3,"names":["getPrimaryShade","theme","colorScheme","primaryShade","scheme","createPrimaryShadeFunction","getPrimaryColor","shade","primaryPalette","colors","primaryColor","console","warn","blue","createPrimaryColorFunction"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/primary-shade.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAIA;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,SAASA,eAAeA,CAACC,KAAuB,EAAEC,WAAyB,EAAS;EACzF;EACA,IAAI,OAAOD,KAAK,CAACE,YAAY,KAAK,QAAQ,EAAE;IAC1C,OAAOF,KAAK,CAACE,YAAY;EAC3B;;EAEA;EACA;EACA,MAAMC,MAAM,GAAGF,WAAW,IAAID,KAAK,CAACC,WAAW,IAAI,OAAO;;EAE1D;EACA,OAAOD,KAAK,CAACE,YAAY,CAACC,MAAM,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CAACJ,KAAuB,EAAE;EAClE,OAAQC,WAAyB,IAAY;IAC3C,OAAOF,eAAe,CAACC,KAAK,EAAEC,WAAW,CAAC;EAC5C,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,eAAeA,CAACL,KAAuB,EAAEC,WAAyB,EAAU;EAC1F,MAAMK,KAAK,GAAGP,eAAe,CAACC,KAAK,EAAEC,WAAW,CAAC;EACjD,MAAMM,cAAc,GAAGP,KAAK,CAACQ,MAAM,CAACR,KAAK,CAACS,YAAY,CAAC;EAEvD,IAAI,CAACF,cAAc,EAAE;IACnBG,OAAO,CAACC,IAAI,CACV,kBAAkBX,KAAK,CAACS,YAAY,sDACtC,CAAC;IACD,OAAOT,KAAK,CAACQ,MAAM,CAACI,IAAI,GAAGN,KAAK,CAAC,IAAI,SAAS;EAChD;EAEA,OAAOC,cAAc,CAACD,KAAK,CAAC,IAAIC,cAAc,CAAC,CAAC,CAAC,IAAI,SAAS;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,0BAA0BA,CAACb,KAAuB,EAAE;EAClE,OAAQC,WAAyB,IAAa;IAC5C,OAAOI,eAAe,CAACL,KAAK,EAAEC,WAAW,CAAC;EAC5C,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","SHADOW_CONFIG","xs","ios","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","android","elevation","sm","md","lg","xl","shadow","size","shadowSize","shadowConfig","OS"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/shadow.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAavC;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAkF,GAAG;EACzFC,EAAE,EAAE;IACFC,GAAG,EAAE;MACHC,WAAW,EAAE,MAAM;MACnBC,YAAY,EAAE;QAAEC,KAAK,EAAE,CAAC;QAAEC,MAAM,EAAE;MAAE,CAAC;MACrCC,aAAa,EAAE,IAAI;MACnBC,YAAY,EAAE;IAChB,CAAC;IACDC,OAAO,EAAE;MACPC,SAAS,EAAE;IACb;EACF,CAAC;EACDC,EAAE,EAAE;IACFT,GAAG,EAAE;MACHC,WAAW,EAAE,MAAM;MACnBC,YAAY,EAAE;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AE,KAAK,KAAK,GAAGD,YAAY,CAAChB,GAAG,GAAGgB,YAAY,CAACT,OAAO;AACxE","ignoreList":[]}
1
+ {"version":3,"names":["Platform","SHADOW_CONFIG","xs","ios","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","android","elevation","sm","md","lg","xl","shadow","size","shadowSize","shadowConfig","OS"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/shadow.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAavC;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAkF,GAAG;EACzFC,EAAE,EAAE;IACFC,GAAG,EAAE;MACHC,WAAW,EAAE,MAAM;MACnBC,YAAY,EAAE;QAAEC,KAAK,EAAE,CAAC;QAAEC,MAAM,EAAE;MAAE,CAAC;MACrCC,aAAa,EAAE,IAAI;MACnBC,YAAY,EAAE;IAChB,CAAC;IACDC,OAAO,EAAE;MACPC,SAAS,EAAE;IACb;EACF,CAAC;EACDC,EAAE,EAAE;IACFT,GAAG,EAAE;MACHC,WAAW,EAAE,MAAM;MACnBC,YAAY,EAAE;QAAEC,KAAK,EAAE,CAAC;QAAEC,MAAM,EAAE;MAAE,CAAC;MACrCC,aAAa,EAAE,GAAG;MAClBC,YAAY,EAAE;IAChB,CAAC;IACDC,OAAO,EAAE;MACPC,SAAS,EAAE;IACb;EACF,CAAC;EACDE,EAAE,EAAE;IACFV,GAAG,EAAE;MACHC,WAAW,EAAE,MAAM;MACnBC,YAAY,EAAE;QAAEC,KAAK,EAAE,CAAC;QAAEC,MAAM,EAAE;MAAE,CAAC;MACrCC,aAAa,EAAE,IAAI;MACnBC,YAAY,EAAE;IAChB,CAAC;IACDC,OAAO,EAAE;MACPC,SAAS,EAAE;IACb;EACF,CAAC;EACDG,EAAE,EAAE;IACFX,GAAG,EAAE;MACHC,WAAW,EAAE,MAAM;MACnBC,YAAY,EAAE;QAAEC,KAAK,EAAE,CAAC;QAAEC,MAAM,EAAE;MAAE,CAAC;MACrCC,aAAa,EAAE,GAAG;MAClBC,YAAY,EAAE;IAChB,CAAC;IACDC,OAAO,EAAE;MACPC,SAAS,EAAE;IACb;EACF,CAAC;EACDI,EAAE,EAAE;IACFZ,GAAG,EAAE;MACHC,WAAW,EAAE,MAAM;MACnBC,YAAY,EAAE;QAAEC,KAAK,EAAE,CAAC;QAAEC,MAAM,EAAE;MAAE,CAAC;MACrCC,aAAa,EAAE,IAAI;MACnBC,YAAY,EAAE;IAChB,CAAC;IACDC,OAAO,EAAE;MACPC,SAAS,EAAE;IACb;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,MAAMA,CAACC,IAAkB,EAAgB;EACvD,IAAI,CAACA,IAAI,EAAE;IACT,OAAO,CAAC,CAAC;EACX;EAEA,MAAMC,UAAU,GAAGD,IAAqB;EACxC,MAAME,YAAY,GAAGlB,aAAa,CAACiB,UAAU,CAAC;EAE9C,IAAI,CAACC,YAAY,EAAE;IACjB,OAAO,CAAC,CAAC;EACX;EAEA,OAAOnB,QAAQ,CAACoB,EAAE,KAAK,KAAK,GAAGD,YAAY,CAAChB,GAAG,GAAGgB,YAAY,CAACT,OAAO;AACxE","ignoreList":[]}
@@ -6,8 +6,9 @@ export function size(_theme) {
6
6
  size,
7
7
  sizes
8
8
  }) => {
9
+ if (!size) return 0;
9
10
  return getSize({
10
- size,
11
+ size: size,
11
12
  sizes
12
13
  });
13
14
  };
@@ -1 +1 @@
1
- {"version":3,"names":["getSize","size","_theme","sizes"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/size.ts"],"mappings":";;AACA,SAASA,OAAO,QAAQ,yBAAgB;AAExC,OAAO,SAASC,IAAIA,CAACC,MAAW,EAAE;EAChC,OAAO,CAAiC;IACtCD,IAAI;IACJE;EAIF,CAAC,KAAa;IACZ,OAAOH,OAAO,CAAC;MAAEC,IAAI;MAAEE;IAAM,CAAC,CAAC;EACjC,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["getSize","size","_theme","sizes"],"sourceRoot":"../../../../../src","sources":["theme/functions/fns/size.ts"],"mappings":";;AACA,SAASA,OAAO,QAAQ,yBAAgB;AAExC,OAAO,SAASC,IAAIA,CAACC,MAAW,EAAE;EAChC,OAAO,CAAiC;IACtCD,IAAI;IACJE;EAIF,CAAC,KAAsB;IACrB,IAAI,CAACF,IAAI,EAAE,OAAO,CAAC;IACnB,OAAOD,OAAO,CAAC;MAAEC,IAAI,EAAEA,IAAyB;MAAEE;IAAM,CAAC,CAAC;EAC5D,CAAC;AACH","ignoreList":[]}
@@ -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;AACA,OAAO,SAASE,oBAAoBA,CAACF,KAAa,EAAEG,UAAkB,EAAU;EAC9E;EACA;EACA,MAAMC,aAAa,GAAG,CAAC,CAAC,GAAGD,UAAU,IAAI,IAAI,CAAC,CAAC;;EAE/C;EACA,MAAME,IAAI,GAAGC,gBAAgB,CAACN,KAAK,CAAC;EACp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AE,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 color name like 'red', 'blue', etc.)
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,YA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