@unif/react-native-ui 0.1.0 → 0.2.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 (367) hide show
  1. package/lib/commonjs/README.md +99 -0
  2. package/lib/commonjs/action-sheet/index.js +71 -0
  3. package/lib/commonjs/action-sheet/index.js.map +1 -0
  4. package/lib/commonjs/action-sheet/index.md +69 -0
  5. package/lib/commonjs/action-sheet/style/index.js +42 -0
  6. package/lib/commonjs/action-sheet/style/index.js.map +1 -0
  7. package/lib/commonjs/avatar/index.js +50 -0
  8. package/lib/commonjs/avatar/index.js.map +1 -0
  9. package/lib/commonjs/avatar/index.md +51 -0
  10. package/lib/commonjs/avatar/style/index.js +21 -0
  11. package/lib/commonjs/avatar/style/index.js.map +1 -0
  12. package/lib/commonjs/button/index.js +60 -0
  13. package/lib/commonjs/button/index.js.map +1 -0
  14. package/lib/commonjs/button/index.md +90 -0
  15. package/lib/commonjs/button/style/index.js +98 -0
  16. package/lib/commonjs/button/style/index.js.map +1 -0
  17. package/lib/commonjs/center/index.js +26 -0
  18. package/lib/commonjs/center/index.js.map +1 -0
  19. package/lib/commonjs/center/index.md +28 -0
  20. package/lib/commonjs/center/style/index.js +14 -0
  21. package/lib/commonjs/center/style/index.js.map +1 -0
  22. package/lib/commonjs/chip/index.js +69 -0
  23. package/lib/commonjs/chip/index.js.map +1 -0
  24. package/lib/commonjs/chip/index.md +60 -0
  25. package/lib/commonjs/chip/style/index.js +46 -0
  26. package/lib/commonjs/chip/style/index.js.map +1 -0
  27. package/lib/commonjs/column/index.js +35 -0
  28. package/lib/commonjs/column/index.js.map +1 -0
  29. package/lib/commonjs/column/index.md +34 -0
  30. package/lib/commonjs/column/style/index.js +13 -0
  31. package/lib/commonjs/column/style/index.js.map +1 -0
  32. package/lib/commonjs/divider/index.js +32 -0
  33. package/lib/commonjs/divider/index.js.map +1 -0
  34. package/lib/commonjs/divider/index.md +44 -0
  35. package/lib/commonjs/divider/style/index.js +22 -0
  36. package/lib/commonjs/divider/style/index.js.map +1 -0
  37. package/lib/commonjs/hooks/index.js +13 -0
  38. package/lib/commonjs/hooks/index.js.map +1 -0
  39. package/lib/commonjs/hooks/index.md +71 -0
  40. package/lib/commonjs/hooks/useMergeStyles.js +31 -0
  41. package/lib/commonjs/hooks/useMergeStyles.js.map +1 -0
  42. package/lib/commonjs/index.js +146 -0
  43. package/lib/commonjs/index.js.map +1 -0
  44. package/lib/commonjs/input/index.js +76 -0
  45. package/lib/commonjs/input/index.js.map +1 -0
  46. package/lib/commonjs/input/index.md +73 -0
  47. package/lib/commonjs/input/style/index.js +31 -0
  48. package/lib/commonjs/input/style/index.js.map +1 -0
  49. package/lib/commonjs/list-item/index.js +76 -0
  50. package/lib/commonjs/list-item/index.js.map +1 -0
  51. package/lib/commonjs/list-item/index.md +101 -0
  52. package/lib/commonjs/list-item/style/index.js +43 -0
  53. package/lib/commonjs/list-item/style/index.js.map +1 -0
  54. package/lib/commonjs/menu/index.js +68 -0
  55. package/lib/commonjs/menu/index.js.map +1 -0
  56. package/lib/commonjs/menu/style/index.js +32 -0
  57. package/lib/commonjs/menu/style/index.js.map +1 -0
  58. package/lib/commonjs/package.json +1 -0
  59. package/lib/commonjs/popover/index.js +68 -0
  60. package/lib/commonjs/popover/index.js.map +1 -0
  61. package/lib/commonjs/popover/index.md +57 -0
  62. package/lib/commonjs/popover/style/index.js +26 -0
  63. package/lib/commonjs/popover/style/index.js.map +1 -0
  64. package/lib/commonjs/row/index.js +36 -0
  65. package/lib/commonjs/row/index.js.map +1 -0
  66. package/lib/commonjs/row/index.md +46 -0
  67. package/lib/commonjs/row/style/index.js +19 -0
  68. package/lib/commonjs/row/style/index.js.map +1 -0
  69. package/lib/commonjs/space/index.js +25 -0
  70. package/lib/commonjs/space/index.js.map +1 -0
  71. package/lib/commonjs/space/index.md +31 -0
  72. package/lib/commonjs/space/style/index.js +15 -0
  73. package/lib/commonjs/space/style/index.js.map +1 -0
  74. package/lib/commonjs/text/index.js +40 -0
  75. package/lib/commonjs/text/index.js.map +1 -0
  76. package/lib/commonjs/text/index.md +63 -0
  77. package/lib/commonjs/text/style/index.js +56 -0
  78. package/lib/commonjs/text/style/index.js.map +1 -0
  79. package/lib/commonjs/theme/context.js +40 -0
  80. package/lib/commonjs/theme/context.js.map +1 -0
  81. package/lib/commonjs/theme/tokens.js +68 -0
  82. package/lib/commonjs/theme/tokens.js.map +1 -0
  83. package/lib/commonjs/touchable/index.js +40 -0
  84. package/lib/commonjs/touchable/index.js.map +1 -0
  85. package/lib/commonjs/touchable/index.md +42 -0
  86. package/lib/commonjs/touchable/style/index.js +13 -0
  87. package/lib/commonjs/touchable/style/index.js.map +1 -0
  88. package/lib/commonjs/wave-animation/index.js +72 -0
  89. package/lib/commonjs/wave-animation/index.js.map +1 -0
  90. package/lib/commonjs/wave-animation/index.md +50 -0
  91. package/lib/module/action-sheet/index.js +5 -2
  92. package/lib/module/action-sheet/index.js.map +1 -1
  93. package/lib/module/action-sheet/style/index.js +7 -8
  94. package/lib/module/action-sheet/style/index.js.map +1 -1
  95. package/lib/module/avatar/index.js +5 -2
  96. package/lib/module/avatar/index.js.map +1 -1
  97. package/lib/module/avatar/style/index.js +4 -5
  98. package/lib/module/avatar/style/index.js.map +1 -1
  99. package/lib/module/button/index.js +5 -2
  100. package/lib/module/button/index.js.map +1 -1
  101. package/lib/module/button/style/index.js +8 -9
  102. package/lib/module/button/style/index.js.map +1 -1
  103. package/lib/module/chip/index.js +7 -2
  104. package/lib/module/chip/index.js.map +1 -1
  105. package/lib/module/chip/style/index.js +12 -13
  106. package/lib/module/chip/style/index.js.map +1 -1
  107. package/lib/module/divider/index.js +13 -7
  108. package/lib/module/divider/index.js.map +1 -1
  109. package/lib/module/divider/style/index.js +4 -5
  110. package/lib/module/divider/style/index.js.map +1 -1
  111. package/lib/module/index.js +4 -4
  112. package/lib/module/index.js.map +1 -1
  113. package/lib/module/input/index.js +5 -3
  114. package/lib/module/input/index.js.map +1 -1
  115. package/lib/module/input/style/index.js +8 -9
  116. package/lib/module/input/style/index.js.map +1 -1
  117. package/lib/module/list-item/index.js +9 -7
  118. package/lib/module/list-item/index.js.map +1 -1
  119. package/lib/module/list-item/style/index.js +5 -6
  120. package/lib/module/list-item/style/index.js.map +1 -1
  121. package/lib/module/menu/index.js +62 -0
  122. package/lib/module/menu/index.js.map +1 -0
  123. package/lib/module/menu/style/index.js +27 -0
  124. package/lib/module/menu/style/index.js.map +1 -0
  125. package/lib/module/popover/index.js +5 -2
  126. package/lib/module/popover/index.js.map +1 -1
  127. package/lib/module/popover/style/index.js +3 -4
  128. package/lib/module/popover/style/index.js.map +1 -1
  129. package/lib/module/text/index.js +8 -3
  130. package/lib/module/text/index.js.map +1 -1
  131. package/lib/module/text/style/index.js +12 -14
  132. package/lib/module/text/style/index.js.map +1 -1
  133. package/lib/module/theme/context.js +33 -0
  134. package/lib/module/theme/context.js.map +1 -0
  135. package/lib/module/theme/tokens.js +3 -6
  136. package/lib/module/theme/tokens.js.map +1 -1
  137. package/lib/typescript/{jest.setup.d.ts.map → commonjs/jest.setup.d.ts.map} +1 -1
  138. package/lib/typescript/commonjs/package.json +1 -0
  139. package/lib/typescript/commonjs/src/action-sheet/index.d.ts.map +1 -0
  140. package/lib/typescript/{src → commonjs/src}/action-sheet/style/index.d.ts +2 -1
  141. package/lib/typescript/commonjs/src/action-sheet/style/index.d.ts.map +1 -0
  142. package/lib/typescript/commonjs/src/avatar/index.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/src/avatar/style/index.d.ts +8 -0
  144. package/lib/typescript/commonjs/src/avatar/style/index.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/src/button/index.d.ts.map +1 -0
  146. package/lib/typescript/{src → commonjs/src}/button/style/index.d.ts +2 -1
  147. package/lib/typescript/commonjs/src/button/style/index.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/src/center/index.d.ts.map +1 -0
  149. package/lib/typescript/commonjs/src/center/style/index.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/src/chip/index.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/src/chip/style/index.d.ts +11 -0
  152. package/lib/typescript/commonjs/src/chip/style/index.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/src/column/index.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/src/column/style/index.d.ts.map +1 -0
  155. package/lib/typescript/commonjs/src/divider/index.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/src/divider/style/index.d.ts +10 -0
  157. package/lib/typescript/commonjs/src/divider/style/index.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/src/hooks/index.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/src/hooks/useMergeStyles.d.ts.map +1 -0
  160. package/lib/typescript/{src → commonjs/src}/index.d.ts +6 -3
  161. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/src/input/index.d.ts.map +1 -0
  163. package/lib/typescript/{src → commonjs/src}/input/style/index.d.ts +2 -1
  164. package/lib/typescript/commonjs/src/input/style/index.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/src/list-item/index.d.ts.map +1 -0
  166. package/lib/typescript/{src → commonjs/src}/list-item/style/index.d.ts +2 -1
  167. package/lib/typescript/commonjs/src/list-item/style/index.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/src/menu/index.d.ts +36 -0
  169. package/lib/typescript/commonjs/src/menu/index.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/src/menu/style/index.d.ts +32 -0
  171. package/lib/typescript/commonjs/src/menu/style/index.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/src/popover/index.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/src/popover/style/index.d.ts +8 -0
  174. package/lib/typescript/commonjs/src/popover/style/index.d.ts.map +1 -0
  175. package/lib/typescript/{src/column → commonjs/src/row}/index.d.ts.map +1 -1
  176. package/lib/typescript/commonjs/src/row/style/index.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/src/space/index.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/src/space/style/index.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/src/text/index.d.ts.map +1 -0
  180. package/lib/typescript/{src → commonjs/src}/text/style/index.d.ts +5 -4
  181. package/lib/typescript/commonjs/src/text/style/index.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/src/theme/context.d.ts +17 -0
  183. package/lib/typescript/commonjs/src/theme/context.d.ts.map +1 -0
  184. package/lib/typescript/{src → commonjs/src}/theme/tokens.d.ts +4 -3
  185. package/lib/typescript/commonjs/src/theme/tokens.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/src/touchable/index.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/src/touchable/style/index.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/src/wave-animation/index.d.ts.map +1 -0
  189. package/lib/typescript/module/jest.setup.d.ts +1 -0
  190. package/lib/typescript/module/jest.setup.d.ts.map +1 -0
  191. package/lib/typescript/module/src/action-sheet/index.d.ts +22 -0
  192. package/lib/typescript/module/src/action-sheet/index.d.ts.map +1 -0
  193. package/lib/typescript/module/src/action-sheet/style/index.d.ts +17 -0
  194. package/lib/typescript/module/src/action-sheet/style/index.d.ts.map +1 -0
  195. package/lib/typescript/module/src/avatar/index.d.ts +19 -0
  196. package/lib/typescript/module/src/avatar/index.d.ts.map +1 -0
  197. package/lib/typescript/module/src/avatar/style/index.d.ts +8 -0
  198. package/lib/typescript/module/src/avatar/style/index.d.ts.map +1 -0
  199. package/lib/typescript/module/src/button/index.d.ts +24 -0
  200. package/lib/typescript/module/src/button/index.d.ts.map +1 -0
  201. package/lib/typescript/module/src/button/style/index.d.ts +17 -0
  202. package/lib/typescript/module/src/button/style/index.d.ts.map +1 -0
  203. package/lib/typescript/module/src/center/index.d.ts +11 -0
  204. package/lib/typescript/module/src/center/index.d.ts.map +1 -0
  205. package/lib/typescript/module/src/center/style/index.d.ts +5 -0
  206. package/lib/typescript/module/src/center/style/index.d.ts.map +1 -0
  207. package/lib/typescript/module/src/chip/index.d.ts +22 -0
  208. package/lib/typescript/module/src/chip/index.d.ts.map +1 -0
  209. package/lib/typescript/module/src/chip/style/index.d.ts +11 -0
  210. package/lib/typescript/module/src/chip/style/index.d.ts.map +1 -0
  211. package/lib/typescript/module/src/column/index.d.ts +20 -0
  212. package/lib/typescript/module/src/column/index.d.ts.map +1 -0
  213. package/lib/typescript/module/src/column/style/index.d.ts +4 -0
  214. package/lib/typescript/module/src/column/style/index.d.ts.map +1 -0
  215. package/lib/typescript/module/src/divider/index.d.ts +13 -0
  216. package/lib/typescript/module/src/divider/index.d.ts.map +1 -0
  217. package/lib/typescript/module/src/divider/style/index.d.ts +10 -0
  218. package/lib/typescript/module/src/divider/style/index.d.ts.map +1 -0
  219. package/lib/typescript/module/src/hooks/index.d.ts +2 -0
  220. package/lib/typescript/module/src/hooks/index.d.ts.map +1 -0
  221. package/lib/typescript/module/src/hooks/useMergeStyles.d.ts +13 -0
  222. package/lib/typescript/module/src/hooks/useMergeStyles.d.ts.map +1 -0
  223. package/lib/typescript/module/src/index.d.ts +42 -0
  224. package/lib/typescript/module/src/index.d.ts.map +1 -0
  225. package/lib/typescript/module/src/input/index.d.ts +29 -0
  226. package/lib/typescript/module/src/input/index.d.ts.map +1 -0
  227. package/lib/typescript/module/src/input/style/index.d.ts +9 -0
  228. package/lib/typescript/module/src/input/style/index.d.ts.map +1 -0
  229. package/lib/typescript/module/src/list-item/index.d.ts +25 -0
  230. package/lib/typescript/module/src/list-item/index.d.ts.map +1 -0
  231. package/lib/typescript/module/src/list-item/style/index.d.ts +18 -0
  232. package/lib/typescript/module/src/list-item/style/index.d.ts.map +1 -0
  233. package/lib/typescript/module/src/menu/index.d.ts +36 -0
  234. package/lib/typescript/module/src/menu/index.d.ts.map +1 -0
  235. package/lib/typescript/module/src/menu/style/index.d.ts +32 -0
  236. package/lib/typescript/module/src/menu/style/index.d.ts.map +1 -0
  237. package/lib/typescript/module/src/popover/index.d.ts +27 -0
  238. package/lib/typescript/module/src/popover/index.d.ts.map +1 -0
  239. package/lib/typescript/module/src/popover/style/index.d.ts +8 -0
  240. package/lib/typescript/module/src/popover/style/index.d.ts.map +1 -0
  241. package/lib/typescript/module/src/row/index.d.ts +22 -0
  242. package/lib/typescript/module/src/row/index.d.ts.map +1 -0
  243. package/lib/typescript/module/src/row/style/index.d.ts +8 -0
  244. package/lib/typescript/module/src/row/style/index.d.ts.map +1 -0
  245. package/lib/typescript/module/src/space/index.d.ts +15 -0
  246. package/lib/typescript/module/src/space/index.d.ts.map +1 -0
  247. package/lib/typescript/module/src/space/style/index.d.ts +7 -0
  248. package/lib/typescript/module/src/space/style/index.d.ts.map +1 -0
  249. package/lib/typescript/module/src/text/index.d.ts +18 -0
  250. package/lib/typescript/module/src/text/index.d.ts.map +1 -0
  251. package/lib/typescript/module/src/text/style/index.d.ts +36 -0
  252. package/lib/typescript/module/src/text/style/index.d.ts.map +1 -0
  253. package/lib/typescript/module/src/theme/context.d.ts +17 -0
  254. package/lib/typescript/module/src/theme/context.d.ts.map +1 -0
  255. package/lib/typescript/module/src/theme/tokens.d.ts +62 -0
  256. package/lib/typescript/module/src/theme/tokens.d.ts.map +1 -0
  257. package/lib/typescript/module/src/touchable/index.d.ts +19 -0
  258. package/lib/typescript/module/src/touchable/index.d.ts.map +1 -0
  259. package/lib/typescript/module/src/touchable/style/index.d.ts +4 -0
  260. package/lib/typescript/module/src/touchable/style/index.d.ts.map +1 -0
  261. package/lib/typescript/module/src/wave-animation/index.d.ts +20 -0
  262. package/lib/typescript/module/src/wave-animation/index.d.ts.map +1 -0
  263. package/package.json +16 -5
  264. package/src/action-sheet/index.tsx +7 -3
  265. package/src/action-sheet/style/index.tsx +10 -8
  266. package/src/avatar/index.tsx +7 -3
  267. package/src/avatar/style/index.tsx +5 -5
  268. package/src/button/index.tsx +7 -3
  269. package/src/button/style/index.tsx +11 -9
  270. package/src/chip/index.tsx +16 -5
  271. package/src/chip/style/index.tsx +15 -13
  272. package/src/divider/index.tsx +18 -11
  273. package/src/divider/style/index.tsx +12 -10
  274. package/src/index.tsx +7 -4
  275. package/src/input/index.tsx +6 -4
  276. package/src/input/style/index.tsx +9 -9
  277. package/src/list-item/index.tsx +11 -6
  278. package/src/list-item/style/index.tsx +6 -6
  279. package/src/menu/index.tsx +99 -0
  280. package/src/menu/style/index.tsx +34 -0
  281. package/src/popover/index.tsx +7 -3
  282. package/src/popover/style/index.tsx +4 -4
  283. package/src/text/index.tsx +9 -3
  284. package/src/text/style/index.tsx +16 -12
  285. package/src/theme/context.tsx +38 -0
  286. package/src/theme/tokens.ts +5 -7
  287. package/lib/module/theme/config.js +0 -27
  288. package/lib/module/theme/config.js.map +0 -1
  289. package/lib/typescript/src/action-sheet/index.d.ts.map +0 -1
  290. package/lib/typescript/src/action-sheet/style/index.d.ts.map +0 -1
  291. package/lib/typescript/src/avatar/index.d.ts.map +0 -1
  292. package/lib/typescript/src/avatar/style/index.d.ts +0 -7
  293. package/lib/typescript/src/avatar/style/index.d.ts.map +0 -1
  294. package/lib/typescript/src/button/index.d.ts.map +0 -1
  295. package/lib/typescript/src/button/style/index.d.ts.map +0 -1
  296. package/lib/typescript/src/center/index.d.ts.map +0 -1
  297. package/lib/typescript/src/center/style/index.d.ts.map +0 -1
  298. package/lib/typescript/src/chip/index.d.ts.map +0 -1
  299. package/lib/typescript/src/chip/style/index.d.ts +0 -10
  300. package/lib/typescript/src/chip/style/index.d.ts.map +0 -1
  301. package/lib/typescript/src/column/style/index.d.ts.map +0 -1
  302. package/lib/typescript/src/divider/index.d.ts.map +0 -1
  303. package/lib/typescript/src/divider/style/index.d.ts +0 -9
  304. package/lib/typescript/src/divider/style/index.d.ts.map +0 -1
  305. package/lib/typescript/src/hooks/index.d.ts.map +0 -1
  306. package/lib/typescript/src/hooks/useMergeStyles.d.ts.map +0 -1
  307. package/lib/typescript/src/index.d.ts.map +0 -1
  308. package/lib/typescript/src/input/index.d.ts.map +0 -1
  309. package/lib/typescript/src/input/style/index.d.ts.map +0 -1
  310. package/lib/typescript/src/list-item/index.d.ts.map +0 -1
  311. package/lib/typescript/src/list-item/style/index.d.ts.map +0 -1
  312. package/lib/typescript/src/popover/index.d.ts.map +0 -1
  313. package/lib/typescript/src/popover/style/index.d.ts +0 -7
  314. package/lib/typescript/src/popover/style/index.d.ts.map +0 -1
  315. package/lib/typescript/src/row/index.d.ts.map +0 -1
  316. package/lib/typescript/src/row/style/index.d.ts.map +0 -1
  317. package/lib/typescript/src/space/index.d.ts.map +0 -1
  318. package/lib/typescript/src/space/style/index.d.ts.map +0 -1
  319. package/lib/typescript/src/text/index.d.ts.map +0 -1
  320. package/lib/typescript/src/text/style/index.d.ts.map +0 -1
  321. package/lib/typescript/src/theme/config.d.ts +0 -18
  322. package/lib/typescript/src/theme/config.d.ts.map +0 -1
  323. package/lib/typescript/src/theme/tokens.d.ts.map +0 -1
  324. package/lib/typescript/src/touchable/index.d.ts.map +0 -1
  325. package/lib/typescript/src/touchable/style/index.d.ts.map +0 -1
  326. package/lib/typescript/src/wave-animation/index.d.ts.map +0 -1
  327. package/lib/typescript/tests/component/component.coverage.test.d.ts +0 -2
  328. package/lib/typescript/tests/component/component.coverage.test.d.ts.map +0 -1
  329. package/lib/typescript/tests/component/component.interaction.test.d.ts +0 -2
  330. package/lib/typescript/tests/component/component.interaction.test.d.ts.map +0 -1
  331. package/lib/typescript/tests/component/component.snapshot.test.d.ts +0 -2
  332. package/lib/typescript/tests/component/component.snapshot.test.d.ts.map +0 -1
  333. package/lib/typescript/tests/e2e/app.e2e.test.d.ts +0 -2
  334. package/lib/typescript/tests/e2e/app.e2e.test.d.ts.map +0 -1
  335. package/lib/typescript/tests/integration/ui.integration.test.d.ts +0 -2
  336. package/lib/typescript/tests/integration/ui.integration.test.d.ts.map +0 -1
  337. package/lib/typescript/tests/unit/mergeStyles.unit.test.d.ts +0 -2
  338. package/lib/typescript/tests/unit/mergeStyles.unit.test.d.ts.map +0 -1
  339. package/lib/typescript/tests/unit/public-api.unit.test.d.ts +0 -2
  340. package/lib/typescript/tests/unit/public-api.unit.test.d.ts.map +0 -1
  341. package/lib/typescript/tests/unit/theme-config.unit.test.d.ts +0 -2
  342. package/lib/typescript/tests/unit/theme-config.unit.test.d.ts.map +0 -1
  343. package/src/theme/config.ts +0 -26
  344. /package/lib/typescript/{jest.setup.d.ts → commonjs/jest.setup.d.ts} +0 -0
  345. /package/lib/typescript/{src → commonjs/src}/action-sheet/index.d.ts +0 -0
  346. /package/lib/typescript/{src → commonjs/src}/avatar/index.d.ts +0 -0
  347. /package/lib/typescript/{src → commonjs/src}/button/index.d.ts +0 -0
  348. /package/lib/typescript/{src → commonjs/src}/center/index.d.ts +0 -0
  349. /package/lib/typescript/{src → commonjs/src}/center/style/index.d.ts +0 -0
  350. /package/lib/typescript/{src → commonjs/src}/chip/index.d.ts +0 -0
  351. /package/lib/typescript/{src → commonjs/src}/column/index.d.ts +0 -0
  352. /package/lib/typescript/{src → commonjs/src}/column/style/index.d.ts +0 -0
  353. /package/lib/typescript/{src → commonjs/src}/divider/index.d.ts +0 -0
  354. /package/lib/typescript/{src → commonjs/src}/hooks/index.d.ts +0 -0
  355. /package/lib/typescript/{src → commonjs/src}/hooks/useMergeStyles.d.ts +0 -0
  356. /package/lib/typescript/{src → commonjs/src}/input/index.d.ts +0 -0
  357. /package/lib/typescript/{src → commonjs/src}/list-item/index.d.ts +0 -0
  358. /package/lib/typescript/{src → commonjs/src}/popover/index.d.ts +0 -0
  359. /package/lib/typescript/{src → commonjs/src}/row/index.d.ts +0 -0
  360. /package/lib/typescript/{src → commonjs/src}/row/style/index.d.ts +0 -0
  361. /package/lib/typescript/{src → commonjs/src}/space/index.d.ts +0 -0
  362. /package/lib/typescript/{src → commonjs/src}/space/style/index.d.ts +0 -0
  363. /package/lib/typescript/{src → commonjs/src}/text/index.d.ts +0 -0
  364. /package/lib/typescript/{src → commonjs/src}/touchable/index.d.ts +0 -0
  365. /package/lib/typescript/{src → commonjs/src}/touchable/style/index.d.ts +0 -0
  366. /package/lib/typescript/{src → commonjs/src}/wave-animation/index.d.ts +0 -0
  367. /package/lib/typescript/{package.json → module/package.json} +0 -0
@@ -0,0 +1,8 @@
1
+ import type { ViewStyle } from 'react-native';
2
+ import type { Tokens } from '../../theme/tokens';
3
+ export type PopoverSemanticStyles = {
4
+ overlay?: ViewStyle;
5
+ content?: ViewStyle;
6
+ };
7
+ export declare const createDefaultStyles: (t: Tokens) => PopoverSemanticStyles;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/popover/style/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,GAAG,MAAM,KAAG,qBAc9C,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 水平布局容器
3
+ *
4
+ * 默认 flexDirection: 'row' + alignItems: 'center'。
5
+ */
6
+ import React from 'react';
7
+ import type { ViewProps, ViewStyle } from 'react-native';
8
+ type AlignItems = ViewStyle['alignItems'];
9
+ type JustifyContent = ViewStyle['justifyContent'];
10
+ export interface RowProps extends ViewProps {
11
+ /** alignItems,默认 'center' */
12
+ align?: AlignItems;
13
+ /** justifyContent */
14
+ justify?: JustifyContent;
15
+ /** 子元素间距 */
16
+ gap?: number;
17
+ /** 是否换行 */
18
+ wrap?: boolean;
19
+ }
20
+ declare const Row: React.FC<RowProps>;
21
+ export default Row;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/row/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,KAAK,UAAU,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAC1C,KAAK,cAAc,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAElD,MAAM,WAAW,QAAS,SAAQ,SAAS;IACzC,6BAA6B;IAC7B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,YAAY;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,QAAA,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAmB3B,CAAC;AAEF,eAAe,GAAG,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const baseStyle: {
2
+ flexDirection: "row";
3
+ alignItems: "center";
4
+ };
5
+ export declare const wrapStyle: {
6
+ flexWrap: "wrap";
7
+ };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/row/style/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;CAKhB,CAAC;AAEP,eAAO,MAAM,SAAS;;CAIf,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 间距占位组件
3
+ *
4
+ * 在两个元素之间插入固定间距。
5
+ */
6
+ import React from 'react';
7
+ export interface SpaceProps {
8
+ /** 间距大小,默认 12 */
9
+ size?: number;
10
+ /** 方向,默认 'vertical' */
11
+ direction?: 'horizontal' | 'vertical';
12
+ }
13
+ declare const Space: React.FC<SpaceProps>;
14
+ export default Space;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/space/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,UAAU;IACzB,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACvC;AAED,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAQ/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const verticalStyle: (size: number) => {
2
+ height: number;
3
+ };
4
+ export declare const horizontalStyle: (size: number) => {
5
+ width: number;
6
+ };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/space/style/index.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM;;CAAuB,CAAC;AAElE,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM;;CAAsB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * 语义化文字组件
3
+ *
4
+ * variant 驱动样式,支持嵌套 Text。
5
+ */
6
+ import React from 'react';
7
+ import type { TextProps as RNTextProps } from 'react-native';
8
+ import type { FontWeight } from './style';
9
+ export interface TextProps extends RNTextProps {
10
+ variant?: 'title' | 'heading' | 'body' | 'caption' | 'micro';
11
+ secondary?: boolean;
12
+ primary?: boolean;
13
+ color?: string;
14
+ weight?: FontWeight;
15
+ }
16
+ declare const Text: React.FC<TextProps>;
17
+ export default Text;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/text/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA2B7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { TextStyle } from 'react-native';
2
+ import type { Tokens } from '../../theme/tokens';
3
+ export type FontWeight = 'medium' | 'semibold' | 'bold';
4
+ export declare const createVariantMap: (t: Tokens) => {
5
+ title: {
6
+ fontSize: number;
7
+ lineHeight: number;
8
+ fontWeight: "600";
9
+ color: string;
10
+ };
11
+ heading: {
12
+ fontSize: number;
13
+ lineHeight: number;
14
+ fontWeight: "600";
15
+ color: string;
16
+ };
17
+ body: {
18
+ fontSize: number;
19
+ lineHeight: number;
20
+ color: string;
21
+ };
22
+ caption: {
23
+ fontSize: number;
24
+ lineHeight: number;
25
+ color: string;
26
+ };
27
+ micro: {
28
+ fontSize: number;
29
+ lineHeight: number;
30
+ color: string;
31
+ };
32
+ };
33
+ export declare const WEIGHT_MAP: Record<FontWeight, TextStyle>;
34
+ export declare const createSecondaryStyle: (t: Tokens) => TextStyle;
35
+ export declare const createPrimaryStyle: (t: Tokens) => TextStyle;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/text/style/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAExD,eAAO,MAAM,gBAAgB,GAAI,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBxC,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,SAAS,CAIpD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,GAAG,MAAM,KAAG,SAE/C,CAAC;AAEH,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,KAAG,SAE7C,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * ConfigProvider — 声明式主题系统
3
+ *
4
+ * 通过 React Context 注入 token,支持嵌套覆盖。
5
+ */
6
+ import React from 'react';
7
+ import type { Tokens } from './tokens';
8
+ export type TokenOverrides = Partial<Tokens>;
9
+ export interface ConfigProviderProps {
10
+ theme?: {
11
+ token?: TokenOverrides;
12
+ };
13
+ children: React.ReactNode;
14
+ }
15
+ export declare const ConfigProvider: React.FC<ConfigProviderProps>;
16
+ export declare function useTokens(): Tokens;
17
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/theme/context.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAI7C,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,cAAc,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAcxD,CAAC;AAEF,wBAAgB,SAAS,IAAI,MAAM,CAElC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Design Tokens — 静态默认值
3
+ */
4
+ export declare const defaultTokens: {
5
+ colorPrimary: string;
6
+ colorSuccess: string;
7
+ colorWarning: string;
8
+ colorError: string;
9
+ colorBgPage: string;
10
+ colorBgElevated: string;
11
+ colorBgUserMsg: string;
12
+ colorText: string;
13
+ colorTextSecondary: string;
14
+ colorTextPlaceholder: string;
15
+ colorBorder: string;
16
+ colorLink: string;
17
+ colorBgHeader: string;
18
+ colorHeaderText: string;
19
+ colorHeaderIcon: string;
20
+ fontSizeXs: number;
21
+ fontSizeSm: number;
22
+ fontSize: number;
23
+ fontSizeMd: number;
24
+ fontSizeLg: number;
25
+ fontSizeXl: number;
26
+ lineHeight: number;
27
+ lineHeightLg: number;
28
+ spaceXs: number;
29
+ spaceSm: number;
30
+ space: number;
31
+ spaceMd: number;
32
+ spaceLg: number;
33
+ spaceXl: number;
34
+ spaceXxl: number;
35
+ radiusSm: number;
36
+ radius: number;
37
+ radiusLg: number;
38
+ radiusXl: number;
39
+ radiusFull: number;
40
+ shadowSm: {
41
+ shadowColor: string;
42
+ shadowOffset: {
43
+ width: number;
44
+ height: number;
45
+ };
46
+ shadowOpacity: number;
47
+ shadowRadius: number;
48
+ elevation: number;
49
+ };
50
+ shadow: {
51
+ shadowColor: string;
52
+ shadowOffset: {
53
+ width: number;
54
+ height: number;
55
+ };
56
+ shadowOpacity: number;
57
+ shadowRadius: number;
58
+ elevation: number;
59
+ };
60
+ };
61
+ export type Tokens = typeof defaultTokens;
62
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../../src/theme/tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDzB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,aAAa,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 统一触摸反馈组件
3
+ *
4
+ * 基于 Pressable,替代 TouchableOpacity。
5
+ * 按下时透明度降低,支持 activeOpacity 自定义。
6
+ */
7
+ import React from 'react';
8
+ import type { ViewProps } from 'react-native';
9
+ export interface TouchableProps extends ViewProps {
10
+ onPress?: () => void;
11
+ onLongPress?: () => void;
12
+ disabled?: boolean;
13
+ /** 按下态透明度,默认 0.7 */
14
+ activeOpacity?: number;
15
+ testID?: string;
16
+ }
17
+ declare const Touchable: React.FC<TouchableProps>;
18
+ export default Touchable;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/touchable/index.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAGzD,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAqBvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const disabledStyle: {
2
+ opacity: number;
3
+ };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/touchable/style/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;CAEtB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * WaveAnimation 原子组件
3
+ *
4
+ * 柱状声波动画,可配置柱数、尺寸和颜色。
5
+ */
6
+ import React from 'react';
7
+ import type { ViewStyle } from 'react-native';
8
+ export interface WaveAnimationProps {
9
+ active: boolean;
10
+ color?: string;
11
+ barCount?: number;
12
+ barWidth?: number;
13
+ minHeight?: number;
14
+ maxHeight?: number;
15
+ style?: ViewStyle;
16
+ testID?: string;
17
+ }
18
+ declare const _default: React.NamedExoticComponent<WaveAnimationProps>;
19
+ export default _default;
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/wave-animation/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;AAyED,wBAAyC"}
package/package.json CHANGED
@@ -1,14 +1,24 @@
1
1
  {
2
2
  "name": "@unif/react-native-ui",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "UNIF React Native UI Components",
5
- "main": "./src/index.tsx",
6
- "types": "./src/index.tsx",
5
+ "main": "./lib/commonjs/index.js",
6
+ "module": "./lib/module/index.js",
7
+ "types": "./lib/typescript/commonjs/src/index.d.ts",
8
+ "react-native": "./src/index.tsx",
9
+ "source": "./src/index.tsx",
7
10
  "exports": {
8
11
  ".": {
9
12
  "source": "./src/index.tsx",
10
- "types": "./src/index.tsx",
11
- "default": "./src/index.tsx"
13
+ "react-native": "./src/index.tsx",
14
+ "import": {
15
+ "types": "./lib/typescript/module/src/index.d.ts",
16
+ "default": "./lib/module/index.js"
17
+ },
18
+ "require": {
19
+ "types": "./lib/typescript/commonjs/src/index.d.ts",
20
+ "default": "./lib/commonjs/index.js"
21
+ }
12
22
  },
13
23
  "./package.json": "./package.json"
14
24
  },
@@ -102,6 +112,7 @@
102
112
  "source": "src",
103
113
  "output": "lib",
104
114
  "targets": [
115
+ "commonjs",
105
116
  [
106
117
  "module",
107
118
  {
@@ -14,8 +14,9 @@ import {
14
14
  } from 'react-native';
15
15
  import type { ViewStyle } from 'react-native';
16
16
  import { mergeStyles } from '../hooks';
17
+ import { useTokens } from '../theme/context';
17
18
  import type { ActionSheetSemanticStyles, ActionSheetOption } from './style';
18
- import { DEFAULT_STYLES } from './style';
19
+ import { createDefaultStyles } from './style';
19
20
 
20
21
  export interface ActionSheetProps {
21
22
  visible: boolean;
@@ -39,9 +40,12 @@ const ActionSheet: React.FC<ActionSheetProps> = ({
39
40
  styles: semanticStyles,
40
41
  testID,
41
42
  }) => {
43
+ const tokens = useTokens();
44
+ const defaultStyles = useMemo(() => createDefaultStyles(tokens), [tokens]);
45
+
42
46
  const s = useMemo(
43
- () => mergeStyles<ActionSheetSemanticStyles>(DEFAULT_STYLES, semanticStyles),
44
- [semanticStyles],
47
+ () => mergeStyles<ActionSheetSemanticStyles>(defaultStyles, semanticStyles),
48
+ [defaultStyles, semanticStyles],
45
49
  );
46
50
 
47
51
  if (!visible) {
@@ -1,5 +1,5 @@
1
1
  import type { ViewStyle, TextStyle } from 'react-native';
2
- import { tokens } from '../../theme/tokens';
2
+ import type { Tokens } from '../../theme/tokens';
3
3
 
4
4
  export type ActionSheetSemanticStyles = {
5
5
  overlay?: ViewStyle;
@@ -16,18 +16,20 @@ export interface ActionSheetOption {
16
16
  icon?: React.ReactNode;
17
17
  }
18
18
 
19
- export const DEFAULT_STYLES: ActionSheetSemanticStyles = {
19
+ export const createDefaultStyles = (
20
+ t: Tokens,
21
+ ): ActionSheetSemanticStyles => ({
20
22
  overlay: {
21
23
  flex: 1,
22
24
  backgroundColor: 'rgba(0,0,0,0.3)',
23
25
  },
24
26
  panel: {
25
- backgroundColor: tokens.colorBgElevated,
27
+ backgroundColor: t.colorBgElevated,
26
28
  borderTopLeftRadius: 12,
27
29
  borderTopRightRadius: 12,
28
30
  paddingTop: 20,
29
31
  paddingBottom: 24,
30
- paddingHorizontal: tokens.spaceMd,
32
+ paddingHorizontal: t.spaceMd,
31
33
  },
32
34
  grid: {
33
35
  flexDirection: 'row',
@@ -40,13 +42,13 @@ export const DEFAULT_STYLES: ActionSheetSemanticStyles = {
40
42
  width: 56,
41
43
  height: 56,
42
44
  borderRadius: 12,
43
- backgroundColor: tokens.colorBgPage,
45
+ backgroundColor: t.colorBgPage,
44
46
  justifyContent: 'center',
45
47
  alignItems: 'center',
46
- marginBottom: tokens.spaceSm,
48
+ marginBottom: t.spaceSm,
47
49
  },
48
50
  optionLabel: {
49
51
  fontSize: 12,
50
- color: tokens.colorTextSecondary,
52
+ color: t.colorTextSecondary,
51
53
  },
52
- };
54
+ });
@@ -8,8 +8,9 @@ import React, { useMemo } from 'react';
8
8
  import { View, Image } from 'react-native';
9
9
  import type { ViewStyle, ImageSourcePropType } from 'react-native';
10
10
  import { mergeStyles } from '../hooks';
11
+ import { useTokens } from '../theme/context';
11
12
  import type { AvatarSemanticStyles } from './style';
12
- import { DEFAULT_STYLES } from './style';
13
+ import { createDefaultStyles } from './style';
13
14
 
14
15
  export interface AvatarProps {
15
16
  size?: number;
@@ -28,9 +29,12 @@ const Avatar: React.FC<AvatarProps> = ({
28
29
  styles: semanticStyles,
29
30
  testID,
30
31
  }) => {
32
+ const tokens = useTokens();
33
+ const defaultStyles = useMemo(() => createDefaultStyles(tokens), [tokens]);
34
+
31
35
  const s = useMemo(
32
- () => mergeStyles<AvatarSemanticStyles>(DEFAULT_STYLES, semanticStyles),
33
- [semanticStyles],
36
+ () => mergeStyles<AvatarSemanticStyles>(defaultStyles, semanticStyles),
37
+ [defaultStyles, semanticStyles],
34
38
  );
35
39
 
36
40
  const sizeStyle: ViewStyle = {
@@ -1,21 +1,21 @@
1
1
  import type { ViewStyle, ImageStyle } from 'react-native';
2
- import { tokens } from '../../theme/tokens';
2
+ import type { Tokens } from '../../theme/tokens';
3
3
 
4
4
  export type AvatarSemanticStyles = {
5
5
  root?: ViewStyle;
6
6
  image?: ImageStyle;
7
7
  };
8
8
 
9
- export const DEFAULT_STYLES: AvatarSemanticStyles = {
9
+ export const createDefaultStyles = (t: Tokens): AvatarSemanticStyles => ({
10
10
  root: {
11
11
  justifyContent: 'center',
12
12
  alignItems: 'center',
13
- backgroundColor: tokens.colorBgElevated,
13
+ backgroundColor: t.colorBgElevated,
14
14
  overflow: 'hidden',
15
- ...tokens.shadowSm,
15
+ ...t.shadowSm,
16
16
  },
17
17
  image: {
18
18
  width: '100%' as any,
19
19
  height: '100%' as any,
20
20
  },
21
- };
21
+ });
@@ -8,11 +8,12 @@ import React, { useMemo } from 'react';
8
8
  import { Pressable, Text, View, ActivityIndicator } from 'react-native';
9
9
  import type { ViewStyle } from 'react-native';
10
10
  import { mergeStyles } from '../hooks';
11
+ import { useTokens } from '../theme/context';
11
12
  import type { ButtonSemanticStyles } from './style';
12
13
  import {
13
14
  DEFAULT_STYLES,
14
15
  SIZE_STYLES,
15
- TYPE_STYLES,
16
+ createTypeStyles,
16
17
  DISABLED_STYLES,
17
18
  BLOCK_STYLES,
18
19
  PRESSED_STYLE,
@@ -46,17 +47,20 @@ const Button: React.FC<ButtonProps> = ({
46
47
  testID,
47
48
  children,
48
49
  }: ButtonProps) => {
50
+ const tokens = useTokens();
51
+ const typeStyles = useMemo(() => createTypeStyles(tokens), [tokens]);
52
+
49
53
  const s = useMemo(
50
54
  () =>
51
55
  mergeStyles<ButtonSemanticStyles>(
52
56
  DEFAULT_STYLES,
53
57
  SIZE_STYLES[size],
54
- TYPE_STYLES[type],
58
+ typeStyles[type],
55
59
  disabled ? DISABLED_STYLES : undefined,
56
60
  block ? BLOCK_STYLES : undefined,
57
61
  semanticStyles,
58
62
  ),
59
- [type, size, disabled, block, semanticStyles],
63
+ [type, size, disabled, block, semanticStyles, typeStyles],
60
64
  );
61
65
 
62
66
  return (
@@ -1,6 +1,6 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
  import type { ViewStyle, TextStyle } from 'react-native';
3
- import { tokens } from '../../theme/tokens';
3
+ import type { Tokens } from '../../theme/tokens';
4
4
 
5
5
  export type ButtonSemanticStyles = {
6
6
  root?: ViewStyle;
@@ -33,24 +33,26 @@ export const SIZE_STYLES: Record<string, Partial<ButtonSemanticStyles>> = {
33
33
  },
34
34
  };
35
35
 
36
- export const TYPE_STYLES: Record<string, Partial<ButtonSemanticStyles>> = {
36
+ export const createTypeStyles = (
37
+ t: Tokens,
38
+ ): Record<string, Partial<ButtonSemanticStyles>> => ({
37
39
  primary: {
38
- root: { backgroundColor: tokens.colorPrimary },
40
+ root: { backgroundColor: t.colorPrimary },
39
41
  content: { color: '#FFF', fontWeight: '600' },
40
42
  },
41
43
  outline: {
42
- root: { borderWidth: 1, borderColor: tokens.colorBorder },
43
- content: { color: tokens.colorTextSecondary },
44
+ root: { borderWidth: 1, borderColor: t.colorBorder },
45
+ content: { color: t.colorTextSecondary },
44
46
  },
45
47
  ghost: {
46
- root: { borderWidth: 1, borderColor: tokens.colorPrimary },
47
- content: { color: tokens.colorPrimary },
48
+ root: { borderWidth: 1, borderColor: t.colorPrimary },
49
+ content: { color: t.colorPrimary },
48
50
  },
49
51
  danger: {
50
- root: { backgroundColor: tokens.colorError },
52
+ root: { backgroundColor: t.colorError },
51
53
  content: { color: '#FFF', fontWeight: '600' },
52
54
  },
53
- };
55
+ });
54
56
 
55
57
  export const DISABLED_STYLES: Partial<ButtonSemanticStyles> = {
56
58
  root: { opacity: 0.5 },
@@ -8,8 +8,14 @@ import React, { useMemo } from 'react';
8
8
  import { View, Text, Pressable } from 'react-native';
9
9
  import type { ViewStyle } from 'react-native';
10
10
  import { mergeStyles } from '../hooks';
11
+ import { useTokens } from '../theme/context';
11
12
  import type { ChipSemanticStyles } from './style';
12
- import { DEFAULT_STYLES, SELECTED_STYLES, DISABLED_STYLES, SMALL_STYLES } from './style';
13
+ import {
14
+ createDefaultStyles,
15
+ createSelectedStyles,
16
+ DISABLED_STYLES,
17
+ createSmallStyles,
18
+ } from './style';
13
19
 
14
20
  export interface ChipProps {
15
21
  children: React.ReactNode;
@@ -36,16 +42,21 @@ const Chip: React.FC<ChipProps> = ({
36
42
  styles: semanticStyles,
37
43
  testID,
38
44
  }) => {
45
+ const tokens = useTokens();
46
+ const defaultStyles = useMemo(() => createDefaultStyles(tokens), [tokens]);
47
+ const selectedStyles = useMemo(() => createSelectedStyles(tokens), [tokens]);
48
+ const smallStyles = useMemo(() => createSmallStyles(tokens), [tokens]);
49
+
39
50
  const s = useMemo(
40
51
  () =>
41
52
  mergeStyles<ChipSemanticStyles>(
42
- DEFAULT_STYLES,
43
- size === 'small' ? SMALL_STYLES : undefined,
44
- selected ? SELECTED_STYLES : undefined,
53
+ defaultStyles,
54
+ size === 'small' ? smallStyles : undefined,
55
+ selected ? selectedStyles : undefined,
45
56
  disabled ? DISABLED_STYLES : undefined,
46
57
  semanticStyles,
47
58
  ),
48
- [size, selected, disabled, semanticStyles],
59
+ [size, selected, disabled, semanticStyles, defaultStyles, selectedStyles, smallStyles],
49
60
  );
50
61
 
51
62
  const content = (
@@ -1,34 +1,36 @@
1
1
  import type { ViewStyle, TextStyle } from 'react-native';
2
- import { tokens } from '../../theme/tokens';
2
+ import type { Tokens } from '../../theme/tokens';
3
3
 
4
4
  export type ChipSemanticStyles = {
5
5
  root?: ViewStyle;
6
6
  content?: TextStyle;
7
7
  };
8
8
 
9
- export const DEFAULT_STYLES: ChipSemanticStyles = {
9
+ export const createDefaultStyles = (t: Tokens): ChipSemanticStyles => ({
10
10
  root: {
11
11
  backgroundColor: '#F0F0F5',
12
- borderRadius: tokens.radiusFull,
12
+ borderRadius: t.radiusFull,
13
13
  paddingHorizontal: 14,
14
14
  paddingVertical: 7,
15
15
  },
16
16
  content: {
17
- fontSize: tokens.fontSizeSm,
18
- color: tokens.colorText,
17
+ fontSize: t.fontSizeSm,
18
+ color: t.colorText,
19
19
  },
20
- };
20
+ });
21
21
 
22
- export const SELECTED_STYLES: Partial<ChipSemanticStyles> = {
22
+ export const createSelectedStyles = (
23
+ t: Tokens,
24
+ ): Partial<ChipSemanticStyles> => ({
23
25
  root: {
24
26
  borderWidth: 1,
25
- borderColor: tokens.colorPrimary,
27
+ borderColor: t.colorPrimary,
26
28
  backgroundColor: '#FFF5EB',
27
29
  },
28
30
  content: {
29
- color: tokens.colorPrimary,
31
+ color: t.colorPrimary,
30
32
  },
31
- };
33
+ });
32
34
 
33
35
  export const DISABLED_STYLES: Partial<ChipSemanticStyles> = {
34
36
  root: {
@@ -36,12 +38,12 @@ export const DISABLED_STYLES: Partial<ChipSemanticStyles> = {
36
38
  },
37
39
  };
38
40
 
39
- export const SMALL_STYLES: Partial<ChipSemanticStyles> = {
41
+ export const createSmallStyles = (t: Tokens): Partial<ChipSemanticStyles> => ({
40
42
  root: {
41
43
  paddingHorizontal: 10,
42
44
  paddingVertical: 4,
43
45
  },
44
46
  content: {
45
- fontSize: tokens.fontSizeXs,
47
+ fontSize: t.fontSizeXs,
46
48
  },
47
- };
49
+ });