@unif/react-native-ui 0.1.0 → 0.2.2

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 +66 -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 +60 -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 +6 -7
  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 +96 -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 +7 -7
  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
@@ -2,10 +2,11 @@
2
2
  * 分割线组件
3
3
  */
4
4
 
5
- import React from 'react';
5
+ import React, { useMemo } from 'react';
6
6
  import { View } from 'react-native';
7
7
  import type { ViewStyle } from 'react-native';
8
- import { hairlineStyle, standardStyle } from './style';
8
+ import { useTokens } from '../theme/context';
9
+ import { createHairlineStyle, createStandardStyle } from './style';
9
10
 
10
11
  interface DividerProps {
11
12
  hairline?: boolean;
@@ -17,14 +18,20 @@ const Divider: React.FC<DividerProps> = ({
17
18
  hairline = true,
18
19
  marginHorizontal,
19
20
  style,
20
- }: DividerProps) => (
21
- <View
22
- style={[
23
- hairline ? hairlineStyle : standardStyle,
24
- marginHorizontal != null && { marginHorizontal },
25
- style,
26
- ]}
27
- />
28
- );
21
+ }: DividerProps) => {
22
+ const tokens = useTokens();
23
+ const hairlineStyle = useMemo(() => createHairlineStyle(tokens), [tokens]);
24
+ const standardStyle = useMemo(() => createStandardStyle(tokens), [tokens]);
25
+
26
+ return (
27
+ <View
28
+ style={[
29
+ hairline ? hairlineStyle : standardStyle,
30
+ marginHorizontal != null && { marginHorizontal },
31
+ style,
32
+ ]}
33
+ />
34
+ );
35
+ };
29
36
 
30
37
  export default Divider;
@@ -1,13 +1,15 @@
1
1
  import { StyleSheet } from 'react-native';
2
- import { tokens } from '../../theme/tokens';
2
+ import type { Tokens } from '../../theme/tokens';
3
3
 
4
- export const hairlineStyle = StyleSheet.create({
5
- line: {
6
- height: StyleSheet.hairlineWidth,
7
- backgroundColor: tokens.colorBorder,
8
- },
9
- }).line;
4
+ export const createHairlineStyle = (t: Tokens) =>
5
+ StyleSheet.create({
6
+ line: {
7
+ height: StyleSheet.hairlineWidth,
8
+ backgroundColor: t.colorBorder,
9
+ },
10
+ }).line;
10
11
 
11
- export const standardStyle = StyleSheet.create({
12
- line: { height: 1, backgroundColor: tokens.colorBorder },
13
- }).line;
12
+ export const createStandardStyle = (t: Tokens) =>
13
+ StyleSheet.create({
14
+ line: { height: 1, backgroundColor: t.colorBorder },
15
+ }).line;
package/src/index.tsx CHANGED
@@ -1,7 +1,8 @@
1
1
  // Theme
2
- export { configure } from './theme/config';
3
- export type { ThemeConfig } from './theme/config';
4
- export { tokens } from './theme/tokens';
2
+ export { ConfigProvider, useTokens } from './theme/context';
3
+ export type { ConfigProviderProps, TokenOverrides } from './theme/context';
4
+ export { defaultTokens } from './theme/tokens';
5
+ export type { Tokens } from './theme/tokens';
5
6
 
6
7
  // Hooks
7
8
  export { mergeStyles } from './hooks';
@@ -34,7 +35,7 @@ export type { AvatarSemanticStyles } from './avatar/style';
34
35
  export { default as WaveAnimation } from './wave-animation';
35
36
  export type { WaveAnimationProps } from './wave-animation';
36
37
 
37
- // Base (new)
38
+ // Base
38
39
  export { default as Input } from './input';
39
40
  export type { InputProps } from './input';
40
41
  export type { InputSemanticStyles } from './input/style';
@@ -47,3 +48,5 @@ export type { ActionSheetOption, ActionSheetSemanticStyles } from './action-shee
47
48
  export { default as Popover } from './popover';
48
49
  export type { PopoverProps } from './popover';
49
50
  export type { PopoverSemanticStyles } from './popover/style';
51
+ export { default as Menu } from './menu';
52
+ export type { MenuProps, Action, MenuSemanticStyles } from './menu';
@@ -8,9 +8,9 @@ import React, { useRef, useEffect, useMemo, forwardRef } from 'react';
8
8
  import { View, TextInput } from 'react-native';
9
9
  import type { ViewStyle, ReturnKeyTypeOptions } from 'react-native';
10
10
  import { mergeStyles } from '../hooks';
11
- import { tokens } from '../theme/tokens';
11
+ import { useTokens } from '../theme/context';
12
12
  import type { InputSemanticStyles } from './style';
13
- import { DEFAULT_STYLES } from './style';
13
+ import { createDefaultStyles } from './style';
14
14
 
15
15
  export interface InputProps {
16
16
  value?: string;
@@ -52,12 +52,14 @@ const Input = forwardRef<InputRef, InputProps>(({
52
52
  testID,
53
53
  }, ref) => {
54
54
  const inputRef = useRef<InputRef>(null);
55
+ const tokens = useTokens();
56
+ const defaultStyles = useMemo(() => createDefaultStyles(tokens), [tokens]);
55
57
 
56
58
  React.useImperativeHandle(ref, () => inputRef.current as InputRef);
57
59
 
58
60
  const s = useMemo(
59
- () => mergeStyles<InputSemanticStyles>(DEFAULT_STYLES, semanticStyles),
60
- [semanticStyles],
61
+ () => mergeStyles<InputSemanticStyles>(defaultStyles, semanticStyles),
62
+ [defaultStyles, semanticStyles],
61
63
  );
62
64
 
63
65
  useEffect(() => {
@@ -1,6 +1,6 @@
1
1
  import { Platform } 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 InputSemanticStyles = {
6
6
  root?: ViewStyle;
@@ -8,19 +8,19 @@ export type InputSemanticStyles = {
8
8
  toolbar?: ViewStyle;
9
9
  };
10
10
 
11
- export const DEFAULT_STYLES: InputSemanticStyles = {
11
+ export const createDefaultStyles = (t: Tokens): InputSemanticStyles => ({
12
12
  root: {
13
- backgroundColor: tokens.colorBgElevated,
14
- borderRadius: tokens.radiusXl,
13
+ backgroundColor: t.colorBgElevated,
14
+ borderRadius: t.radiusXl,
15
15
  paddingHorizontal: 12,
16
16
  paddingTop: 8,
17
17
  paddingBottom: 6,
18
- ...tokens.shadow,
18
+ ...t.shadow,
19
19
  },
20
20
  input: {
21
- fontSize: tokens.fontSize,
22
- color: tokens.colorText,
23
- lineHeight: tokens.lineHeight,
21
+ fontSize: t.fontSize,
22
+ color: t.colorText,
23
+ lineHeight: t.lineHeight,
24
24
  paddingVertical: Platform.OS === 'ios' ? 4 : 2,
25
25
  paddingHorizontal: 4,
26
26
  },
@@ -29,4 +29,4 @@ export const DEFAULT_STYLES: InputSemanticStyles = {
29
29
  alignItems: 'center',
30
30
  paddingTop: 4,
31
31
  },
32
- };
32
+ });
@@ -8,9 +8,9 @@ import React, { useMemo } from 'react';
8
8
  import { View, Text, Pressable } from 'react-native';
9
9
  import type { ViewStyle, TextStyle } from 'react-native';
10
10
  import { mergeStyles } from '../hooks';
11
- import { tokens } from '../theme/tokens';
11
+ import { useTokens } from '../theme/context';
12
12
  import type { ListItemSemanticStyles } from './style';
13
- import { DEFAULT_SEMANTIC, lineStyle, contentWrapStyle } from './style';
13
+ import { createDefaultStyles, lineStyle, contentWrapStyle } from './style';
14
14
 
15
15
  interface ListItemProps {
16
16
  thumb?: React.ReactNode;
@@ -27,8 +27,6 @@ interface ListItemProps {
27
27
  testID?: string;
28
28
  }
29
29
 
30
- const defaultArrowStyle = { fontSize: 18, color: tokens.colorTextSecondary };
31
-
32
30
  const ListItem: React.FC<ListItemProps> = ({
33
31
  thumb,
34
32
  title,
@@ -40,9 +38,16 @@ const ListItem: React.FC<ListItemProps> = ({
40
38
  styles: semanticStyles,
41
39
  ...props
42
40
  }: ListItemProps) => {
41
+ const tokens = useTokens();
42
+ const defaultStyles = useMemo(() => createDefaultStyles(tokens), [tokens]);
43
+ const defaultArrowStyle = useMemo(
44
+ () => ({ fontSize: 18, color: tokens.colorTextSecondary }),
45
+ [tokens],
46
+ );
47
+
43
48
  const s = useMemo(
44
- () => mergeStyles(DEFAULT_SEMANTIC, semanticStyles),
45
- [semanticStyles],
49
+ () => mergeStyles(defaultStyles, semanticStyles),
50
+ [defaultStyles, semanticStyles],
46
51
  );
47
52
 
48
53
  const content = (
@@ -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 ListItemSemanticStyles = {
6
6
  root?: ViewStyle;
@@ -9,7 +9,7 @@ export type ListItemSemanticStyles = {
9
9
  extra?: ViewStyle & TextStyle;
10
10
  };
11
11
 
12
- export const DEFAULT_SEMANTIC: ListItemSemanticStyles = {
12
+ export const createDefaultStyles = (t: Tokens): ListItemSemanticStyles => ({
13
13
  root: {
14
14
  flexDirection: 'row',
15
15
  alignItems: 'center',
@@ -18,19 +18,19 @@ export const DEFAULT_SEMANTIC: ListItemSemanticStyles = {
18
18
  },
19
19
  content: {
20
20
  fontSize: 15,
21
- color: tokens.colorText,
21
+ color: t.colorText,
22
22
  flex: 1,
23
23
  },
24
24
  description: {
25
25
  fontSize: 12,
26
- color: tokens.colorTextSecondary,
26
+ color: t.colorTextSecondary,
27
27
  marginTop: 2,
28
28
  },
29
29
  extra: {
30
- color: tokens.colorTextSecondary,
30
+ color: t.colorTextSecondary,
31
31
  fontSize: 14,
32
32
  },
33
- };
33
+ });
34
34
 
35
35
  export const lineStyle = StyleSheet.create({
36
36
  s: { flex: 1, flexDirection: 'row', alignItems: 'center' },
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Menu 独立组件
3
+ *
4
+ * 基于 Popover 实现的菜单列表,支持 danger、icon、disabled。
5
+ */
6
+
7
+ import React, { useMemo } from 'react';
8
+ import { View, Text, Pressable } from 'react-native';
9
+ import type { ViewStyle } from 'react-native';
10
+ import Popover from '../popover';
11
+ import { useTokens } from '../theme/context';
12
+ import type { MenuSemanticStyles } from './style';
13
+ import { createDefaultStyles } from './style';
14
+
15
+ export type { MenuSemanticStyles } from './style';
16
+
17
+ export type Action = {
18
+ key: string;
19
+ text: string;
20
+ icon?: React.ReactNode;
21
+ disabled?: boolean;
22
+ danger?: boolean;
23
+ };
24
+
25
+ export interface MenuProps {
26
+ visible: boolean;
27
+ onClose: () => void;
28
+ anchorLayout: { x: number; y: number; width: number; height: number };
29
+ actions: Action[];
30
+ onAction?: (item: Action) => void;
31
+ placement?: 'bottom' | 'top';
32
+ width?: number;
33
+ style?: ViewStyle;
34
+ styles?: Partial<MenuSemanticStyles>;
35
+ testID?: string;
36
+ }
37
+
38
+ const Menu: React.FC<MenuProps> = ({
39
+ visible,
40
+ onClose,
41
+ anchorLayout,
42
+ actions,
43
+ onAction,
44
+ placement = 'bottom',
45
+ width = 160,
46
+ style,
47
+ styles: semanticStyles,
48
+ testID,
49
+ }) => {
50
+ const tokens = useTokens();
51
+ const ds = useMemo(() => createDefaultStyles(tokens), [tokens]);
52
+
53
+ return (
54
+ <Popover
55
+ visible={visible}
56
+ onClose={onClose}
57
+ anchorLayout={anchorLayout}
58
+ placement={placement}
59
+ width={width}
60
+ style={style}
61
+ testID={testID}
62
+ >
63
+ {actions.map((action) => (
64
+ <React.Fragment key={action.key}>
65
+ <Pressable
66
+ style={[ds.item, semanticStyles?.item]}
67
+ onPress={() => {
68
+ if (!action.disabled) {
69
+ onAction?.(action);
70
+ onClose();
71
+ }
72
+ }}
73
+ disabled={action.disabled}
74
+ testID={testID ? `${testID}-${action.key}` : undefined}
75
+ >
76
+ {action.icon && (
77
+ <View style={[ds.itemIcon, semanticStyles?.itemIcon]}>
78
+ {action.icon}
79
+ </View>
80
+ )}
81
+ <Text
82
+ style={[
83
+ action.danger ? ds.itemLabelDanger : ds.itemLabel,
84
+ semanticStyles?.itemLabel,
85
+ ]}
86
+ >
87
+ {action.text}
88
+ </Text>
89
+ </Pressable>
90
+ </React.Fragment>
91
+ ))}
92
+ </Popover>
93
+ );
94
+ };
95
+
96
+ export default Menu;
@@ -0,0 +1,34 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import type { ViewStyle, TextStyle } from 'react-native';
3
+ import type { Tokens } from '../../theme/tokens';
4
+
5
+ export type MenuSemanticStyles = {
6
+ item?: ViewStyle;
7
+ itemLabel?: TextStyle;
8
+ itemIcon?: ViewStyle;
9
+ divider?: ViewStyle;
10
+ };
11
+
12
+ export const createDefaultStyles = (t: Tokens) => ({
13
+ item: {
14
+ flexDirection: 'row' as const,
15
+ alignItems: 'center' as const,
16
+ paddingVertical: 12,
17
+ paddingHorizontal: 16,
18
+ },
19
+ itemLabel: {
20
+ fontSize: 14,
21
+ color: t.colorText,
22
+ },
23
+ itemLabelDanger: {
24
+ fontSize: 14,
25
+ color: t.colorError,
26
+ },
27
+ itemIcon: {
28
+ marginRight: 8,
29
+ },
30
+ divider: {
31
+ height: StyleSheet.hairlineWidth,
32
+ backgroundColor: t.colorBorder,
33
+ },
34
+ });
@@ -12,8 +12,9 @@ import {
12
12
  } from 'react-native';
13
13
  import type { ViewStyle } from 'react-native';
14
14
  import { mergeStyles } from '../hooks';
15
+ import { useTokens } from '../theme/context';
15
16
  import type { PopoverSemanticStyles } from './style';
16
- import { DEFAULT_STYLES } from './style';
17
+ import { createDefaultStyles } from './style';
17
18
 
18
19
  export interface PopoverProps {
19
20
  visible: boolean;
@@ -40,9 +41,12 @@ const Popover: React.FC<PopoverProps> = ({
40
41
  styles: semanticStyles,
41
42
  testID,
42
43
  }) => {
44
+ const tokens = useTokens();
45
+ const defaultStyles = useMemo(() => createDefaultStyles(tokens), [tokens]);
46
+
43
47
  const s = useMemo(
44
- () => mergeStyles<PopoverSemanticStyles>(DEFAULT_STYLES, semanticStyles),
45
- [semanticStyles],
48
+ () => mergeStyles<PopoverSemanticStyles>(defaultStyles, semanticStyles),
49
+ [defaultStyles, semanticStyles],
46
50
  );
47
51
 
48
52
  if (!visible) {
@@ -1,23 +1,23 @@
1
1
  import type { ViewStyle } from 'react-native';
2
- import { tokens } from '../../theme/tokens';
2
+ import type { Tokens } from '../../theme/tokens';
3
3
 
4
4
  export type PopoverSemanticStyles = {
5
5
  overlay?: ViewStyle;
6
6
  content?: ViewStyle;
7
7
  };
8
8
 
9
- export const DEFAULT_STYLES: PopoverSemanticStyles = {
9
+ export const createDefaultStyles = (t: Tokens): PopoverSemanticStyles => ({
10
10
  overlay: {
11
11
  flex: 1,
12
12
  },
13
13
  content: {
14
14
  position: 'absolute',
15
- backgroundColor: tokens.colorBgElevated,
15
+ backgroundColor: t.colorBgElevated,
16
16
  borderRadius: 12,
17
17
  shadowColor: '#000',
18
18
  shadowOffset: { width: 0, height: 4 },
19
- shadowOpacity: 0.12,
20
- shadowRadius: 12,
21
- elevation: 8,
19
+ shadowOpacity: 0.08,
20
+ shadowRadius: 8,
21
+ elevation: 4,
22
22
  },
23
- };
23
+ });
@@ -4,11 +4,12 @@
4
4
  * variant 驱动样式,支持嵌套 Text。
5
5
  */
6
6
 
7
- import React from 'react';
7
+ import React, { useMemo } from 'react';
8
8
  import { Text as RNText } from 'react-native';
9
9
  import type { TextProps as RNTextProps } from 'react-native';
10
+ import { useTokens } from '../theme/context';
10
11
  import type { FontWeight } from './style';
11
- import { VARIANT_MAP, WEIGHT_MAP, secondaryStyle, primaryStyle } from './style';
12
+ import { createVariantMap, WEIGHT_MAP, createSecondaryStyle, createPrimaryStyle } from './style';
12
13
 
13
14
  export interface TextProps extends RNTextProps {
14
15
  variant?: 'title' | 'heading' | 'body' | 'caption' | 'micro';
@@ -27,10 +28,15 @@ const Text: React.FC<TextProps> = ({
27
28
  style,
28
29
  ...rest
29
30
  }: TextProps) => {
31
+ const tokens = useTokens();
32
+ const variantMap = useMemo(() => createVariantMap(tokens), [tokens]);
33
+ const secondaryStyle = useMemo(() => createSecondaryStyle(tokens), [tokens]);
34
+ const primaryStyle = useMemo(() => createPrimaryStyle(tokens), [tokens]);
35
+
30
36
  return (
31
37
  <RNText
32
38
  style={[
33
- VARIANT_MAP[variant],
39
+ variantMap[variant],
34
40
  secondary && secondaryStyle,
35
41
  primary && primaryStyle,
36
42
  color != null && { color },
@@ -1,25 +1,24 @@
1
- import { StyleSheet } from 'react-native';
2
1
  import type { TextStyle } from 'react-native';
3
- import { tokens } from '../../theme/tokens';
2
+ import type { Tokens } from '../../theme/tokens';
4
3
 
5
4
  export type FontWeight = 'medium' | 'semibold' | 'bold';
6
5
 
7
- export const VARIANT_MAP = StyleSheet.create({
6
+ export const createVariantMap = (t: Tokens) => ({
8
7
  title: {
9
8
  fontSize: 20,
10
9
  lineHeight: 26,
11
- fontWeight: '600',
12
- color: tokens.colorText,
10
+ fontWeight: '600' as const,
11
+ color: t.colorText,
13
12
  },
14
13
  heading: {
15
14
  fontSize: 16,
16
15
  lineHeight: 22,
17
- fontWeight: '600',
18
- color: tokens.colorText,
16
+ fontWeight: '600' as const,
17
+ color: t.colorText,
19
18
  },
20
- body: { fontSize: 15, lineHeight: 22, color: tokens.colorText },
21
- caption: { fontSize: 13, lineHeight: 18, color: tokens.colorText },
22
- micro: { fontSize: 12, lineHeight: 18, color: tokens.colorText },
19
+ body: { fontSize: 15, lineHeight: 22, color: t.colorText },
20
+ caption: { fontSize: 13, lineHeight: 18, color: t.colorText },
21
+ micro: { fontSize: 12, lineHeight: 18, color: t.colorText },
23
22
  });
24
23
 
25
24
  export const WEIGHT_MAP: Record<FontWeight, TextStyle> = {
@@ -28,5 +27,10 @@ export const WEIGHT_MAP: Record<FontWeight, TextStyle> = {
28
27
  bold: { fontWeight: '700' },
29
28
  };
30
29
 
31
- export const secondaryStyle: TextStyle = { color: tokens.colorTextSecondary };
32
- export const primaryStyle: TextStyle = { color: tokens.colorPrimary };
30
+ export const createSecondaryStyle = (t: Tokens): TextStyle => ({
31
+ color: t.colorTextSecondary,
32
+ });
33
+
34
+ export const createPrimaryStyle = (t: Tokens): TextStyle => ({
35
+ color: t.colorPrimary,
36
+ });
@@ -0,0 +1,38 @@
1
+ /**
2
+ * ConfigProvider — 声明式主题系统
3
+ *
4
+ * 通过 React Context 注入 token,支持嵌套覆盖。
5
+ */
6
+
7
+ import React, { createContext, useContext, useMemo } from 'react';
8
+ import { defaultTokens } from './tokens';
9
+ import type { Tokens } from './tokens';
10
+
11
+ export type TokenOverrides = Partial<Tokens>;
12
+
13
+ const ThemeContext = createContext<Tokens>(defaultTokens);
14
+
15
+ export interface ConfigProviderProps {
16
+ theme?: { token?: TokenOverrides };
17
+ children: React.ReactNode;
18
+ }
19
+
20
+ export const ConfigProvider: React.FC<ConfigProviderProps> = ({
21
+ theme,
22
+ children,
23
+ }) => {
24
+ const parent = useContext(ThemeContext);
25
+
26
+ const merged = useMemo<Tokens>(() => {
27
+ if (!theme?.token) return parent;
28
+ return { ...parent, ...theme.token } as Tokens;
29
+ }, [parent, theme?.token]);
30
+
31
+ return (
32
+ <ThemeContext.Provider value={merged}>{children}</ThemeContext.Provider>
33
+ );
34
+ };
35
+
36
+ export function useTokens(): Tokens {
37
+ return useContext(ThemeContext);
38
+ }
@@ -1,13 +1,9 @@
1
1
  /**
2
- * Design Tokens
2
+ * Design Tokens — 静态默认值
3
3
  */
4
4
 
5
- import { getPrimaryColor } from './config';
6
-
7
- export const tokens = {
8
- get colorPrimary() {
9
- return getPrimaryColor();
10
- },
5
+ export const defaultTokens = {
6
+ colorPrimary: '#EB6E00',
11
7
  colorSuccess: '#34C759',
12
8
  colorWarning: '#FF9500',
13
9
  colorError: '#FF3B30',
@@ -64,3 +60,5 @@ export const tokens = {
64
60
  elevation: 2,
65
61
  },
66
62
  };
63
+
64
+ export type Tokens = typeof defaultTokens;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * 主题配置
5
- *
6
- * 消费方通过 configure() 注入主题色,实现包与业务解耦。
7
- */
8
-
9
- let _config = {};
10
-
11
- /**
12
- * 配置主题
13
- *
14
- * @example
15
- * import { configure } from '@unif/react-native-ui';
16
- * configure({ primaryColor: getAppThemeColor() });
17
- */
18
- export function configure(options) {
19
- _config = {
20
- ..._config,
21
- ...options
22
- };
23
- }
24
- export function getPrimaryColor() {
25
- return _config.primaryColor || '#EB6E00';
26
- }
27
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_config","configure","options","getPrimaryColor","primaryColor"],"sourceRoot":"../../../src","sources":["theme/config.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAMA,IAAIA,OAAoB,GAAG,CAAC,CAAC;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,OAAoB,EAAQ;EACpDF,OAAO,GAAG;IAAE,GAAGA,OAAO;IAAE,GAAGE;EAAQ,CAAC;AACtC;AAEA,OAAO,SAASC,eAAeA,CAAA,EAAW;EACxC,OAAOH,OAAO,CAACI,YAAY,IAAI,SAAS;AAC1C","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/action-sheet/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAmD3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/action-sheet/style/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,yBAiC5B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/avatar/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+BjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { ViewStyle, ImageStyle } from 'react-native';
2
- export type AvatarSemanticStyles = {
3
- root?: ViewStyle;
4
- image?: ImageStyle;
5
- };
6
- export declare const DEFAULT_STYLES: AvatarSemanticStyles;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/avatar/style/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1D,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,oBAY5B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/button/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAWpD,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClD,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgDjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/button/style/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,oBAY5B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CASrE,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAiBrE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,oBAAoB,CAEzD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,oBAAoB,CAEtD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAA4B,CAAC;AAEzD,eAAO,MAAM,YAAY;;CAErB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/center/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAEpC,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAEjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/center/style/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;CAKb,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/chip/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAkD7B,CAAC;AAEF,eAAe,IAAI,CAAC"}