@cdx-ui/components 0.0.1-alpha.4 → 0.0.1-alpha.41

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 (437) hide show
  1. package/README.md +54 -3
  2. package/lib/commonjs/components/AlertDialog/index.js +117 -0
  3. package/lib/commonjs/components/AlertDialog/index.js.map +1 -0
  4. package/lib/commonjs/components/Avatar/index.js +156 -0
  5. package/lib/commonjs/components/Avatar/index.js.map +1 -0
  6. package/lib/commonjs/components/Avatar/styles.js +80 -0
  7. package/lib/commonjs/components/Avatar/styles.js.map +1 -0
  8. package/lib/commonjs/components/BottomSheet/index.js +248 -0
  9. package/lib/commonjs/components/BottomSheet/index.js.map +1 -0
  10. package/lib/commonjs/components/BottomSheet/styles.js +61 -0
  11. package/lib/commonjs/components/BottomSheet/styles.js.map +1 -0
  12. package/lib/commonjs/components/Box/Box.js +1 -0
  13. package/lib/commonjs/components/Box/Box.js.map +1 -1
  14. package/lib/commonjs/components/Button/index.js +20 -9
  15. package/lib/commonjs/components/Button/index.js.map +1 -1
  16. package/lib/commonjs/components/Button/styles.js +181 -162
  17. package/lib/commonjs/components/Button/styles.js.map +1 -1
  18. package/lib/commonjs/components/Card/index.js +104 -0
  19. package/lib/commonjs/components/Card/index.js.map +1 -0
  20. package/lib/commonjs/components/Card/styles.js +28 -0
  21. package/lib/commonjs/components/Card/styles.js.map +1 -0
  22. package/lib/commonjs/components/Checkbox/index.js +180 -0
  23. package/lib/commonjs/components/Checkbox/index.js.map +1 -0
  24. package/lib/commonjs/components/Checkbox/styles.js +68 -0
  25. package/lib/commonjs/components/Checkbox/styles.js.map +1 -0
  26. package/lib/commonjs/components/Chip/index.js +103 -0
  27. package/lib/commonjs/components/Chip/index.js.map +1 -0
  28. package/lib/commonjs/components/Chip/styles.js +52 -0
  29. package/lib/commonjs/components/Chip/styles.js.map +1 -0
  30. package/lib/commonjs/components/Dialog/index.js +275 -0
  31. package/lib/commonjs/components/Dialog/index.js.map +1 -0
  32. package/lib/commonjs/components/Dialog/styles.js +63 -0
  33. package/lib/commonjs/components/Dialog/styles.js.map +1 -0
  34. package/lib/commonjs/components/Field/FieldLabel.js +33 -0
  35. package/lib/commonjs/components/Field/FieldLabel.js.map +1 -0
  36. package/lib/commonjs/components/Field/FieldLabel.web.js +22 -0
  37. package/lib/commonjs/components/Field/FieldLabel.web.js.map +1 -0
  38. package/lib/commonjs/components/Field/index.js +158 -0
  39. package/lib/commonjs/components/Field/index.js.map +1 -0
  40. package/lib/commonjs/components/Field/styles.js +16 -0
  41. package/lib/commonjs/components/Field/styles.js.map +1 -0
  42. package/lib/commonjs/components/Form/FormRoot.js +25 -0
  43. package/lib/commonjs/components/Form/FormRoot.js.map +1 -0
  44. package/lib/commonjs/components/Form/FormRoot.web.js +17 -0
  45. package/lib/commonjs/components/Form/FormRoot.web.js.map +1 -0
  46. package/lib/commonjs/components/Form/index.js +48 -0
  47. package/lib/commonjs/components/Form/index.js.map +1 -0
  48. package/lib/commonjs/components/Form/styles.js +9 -0
  49. package/lib/commonjs/components/Form/styles.js.map +1 -0
  50. package/lib/commonjs/components/Heading/index.js +35 -0
  51. package/lib/commonjs/components/Heading/index.js.map +1 -0
  52. package/lib/commonjs/components/Heading/styles.js +23 -0
  53. package/lib/commonjs/components/Heading/styles.js.map +1 -0
  54. package/lib/commonjs/components/Icon/index.js +61 -0
  55. package/lib/commonjs/components/Icon/index.js.map +1 -0
  56. package/lib/commonjs/components/IconButton/index.js +75 -0
  57. package/lib/commonjs/components/IconButton/index.js.map +1 -0
  58. package/lib/commonjs/components/IconButton/styles.js +44 -0
  59. package/lib/commonjs/components/IconButton/styles.js.map +1 -0
  60. package/lib/commonjs/components/Image/Image.js +69 -0
  61. package/lib/commonjs/components/Image/Image.js.map +1 -0
  62. package/lib/commonjs/components/Image/index.js +13 -0
  63. package/lib/commonjs/components/Image/index.js.map +1 -0
  64. package/lib/commonjs/components/Input/BaseInput.android.js +20 -0
  65. package/lib/commonjs/components/Input/BaseInput.android.js.map +1 -0
  66. package/lib/commonjs/components/Input/index.js +10 -16
  67. package/lib/commonjs/components/Input/index.js.map +1 -1
  68. package/lib/commonjs/components/Input/styles.js +17 -30
  69. package/lib/commonjs/components/Input/styles.js.map +1 -1
  70. package/lib/commonjs/components/Link/index.js +94 -0
  71. package/lib/commonjs/components/Link/index.js.map +1 -0
  72. package/lib/commonjs/components/Link/styles.js +14 -0
  73. package/lib/commonjs/components/Link/styles.js.map +1 -0
  74. package/lib/commonjs/components/OtpInput/index.js +83 -0
  75. package/lib/commonjs/components/OtpInput/index.js.map +1 -0
  76. package/lib/commonjs/components/OtpInput/styles.js +48 -0
  77. package/lib/commonjs/components/OtpInput/styles.js.map +1 -0
  78. package/lib/commonjs/components/ProgressBar/index.js +45 -0
  79. package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
  80. package/lib/commonjs/components/ProgressBar/styles.js +10 -0
  81. package/lib/commonjs/components/ProgressBar/styles.js.map +1 -0
  82. package/lib/commonjs/components/ProgressSegmented/index.js +62 -0
  83. package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -0
  84. package/lib/commonjs/components/ProgressSegmented/styles.js +21 -0
  85. package/lib/commonjs/components/ProgressSegmented/styles.js.map +1 -0
  86. package/lib/commonjs/components/Select/SelectTriggerHost.js +10 -0
  87. package/lib/commonjs/components/Select/SelectTriggerHost.js.map +1 -0
  88. package/lib/commonjs/components/Select/SelectTriggerHost.web.js +98 -0
  89. package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +1 -0
  90. package/lib/commonjs/components/Select/index.js +13 -13
  91. package/lib/commonjs/components/Select/index.js.map +1 -1
  92. package/lib/commonjs/components/Select/styles.js +29 -53
  93. package/lib/commonjs/components/Select/styles.js.map +1 -1
  94. package/lib/commonjs/components/Stack/HStack.js +8 -21
  95. package/lib/commonjs/components/Stack/HStack.js.map +1 -1
  96. package/lib/commonjs/components/Stack/VStack.js +8 -21
  97. package/lib/commonjs/components/Stack/VStack.js.map +1 -1
  98. package/lib/commonjs/components/Stack/styles.js +44 -0
  99. package/lib/commonjs/components/Stack/styles.js.map +1 -0
  100. package/lib/commonjs/components/Switch/BaseSwitch.js +46 -0
  101. package/lib/commonjs/components/Switch/BaseSwitch.js.map +1 -0
  102. package/lib/commonjs/components/Switch/BaseSwitch.web.js +56 -0
  103. package/lib/commonjs/components/Switch/BaseSwitch.web.js.map +1 -0
  104. package/lib/commonjs/components/Switch/index.js +13 -0
  105. package/lib/commonjs/components/Switch/index.js.map +1 -0
  106. package/lib/commonjs/components/Switch/styles.js +128 -0
  107. package/lib/commonjs/components/Switch/styles.js.map +1 -0
  108. package/lib/commonjs/components/Text/index.js +18 -9
  109. package/lib/commonjs/components/Text/index.js.map +1 -1
  110. package/lib/commonjs/components/Text/styles.js +23 -0
  111. package/lib/commonjs/components/Text/styles.js.map +1 -0
  112. package/lib/commonjs/components/VirtualizedList/index.js +19 -0
  113. package/lib/commonjs/components/VirtualizedList/index.js.map +1 -0
  114. package/lib/commonjs/components/index.js +228 -0
  115. package/lib/commonjs/components/index.js.map +1 -1
  116. package/lib/commonjs/index.js +40 -0
  117. package/lib/commonjs/index.js.map +1 -1
  118. package/lib/commonjs/metro/withCdxMetroConfig.js +24 -0
  119. package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -0
  120. package/lib/commonjs/styles/index.js +17 -0
  121. package/lib/commonjs/styles/index.js.map +1 -0
  122. package/lib/commonjs/styles/primitives.js +123 -0
  123. package/lib/commonjs/styles/primitives.js.map +1 -0
  124. package/lib/module/components/AlertDialog/index.js +112 -0
  125. package/lib/module/components/AlertDialog/index.js.map +1 -0
  126. package/lib/module/components/Avatar/index.js +152 -0
  127. package/lib/module/components/Avatar/index.js.map +1 -0
  128. package/lib/module/components/Avatar/styles.js +77 -0
  129. package/lib/module/components/Avatar/styles.js.map +1 -0
  130. package/lib/module/components/BottomSheet/index.js +242 -0
  131. package/lib/module/components/BottomSheet/index.js.map +1 -0
  132. package/lib/module/components/BottomSheet/styles.js +58 -0
  133. package/lib/module/components/BottomSheet/styles.js.map +1 -0
  134. package/lib/module/components/Box/Box.js +1 -0
  135. package/lib/module/components/Box/Box.js.map +1 -1
  136. package/lib/module/components/Button/index.js +21 -10
  137. package/lib/module/components/Button/index.js.map +1 -1
  138. package/lib/module/components/Button/styles.js +180 -161
  139. package/lib/module/components/Button/styles.js.map +1 -1
  140. package/lib/module/components/Card/index.js +100 -0
  141. package/lib/module/components/Card/index.js.map +1 -0
  142. package/lib/module/components/Card/styles.js +25 -0
  143. package/lib/module/components/Card/styles.js.map +1 -0
  144. package/lib/module/components/Checkbox/index.js +176 -0
  145. package/lib/module/components/Checkbox/index.js.map +1 -0
  146. package/lib/module/components/Checkbox/styles.js +64 -0
  147. package/lib/module/components/Checkbox/styles.js.map +1 -0
  148. package/lib/module/components/Chip/index.js +99 -0
  149. package/lib/module/components/Chip/index.js.map +1 -0
  150. package/lib/module/components/Chip/styles.js +48 -0
  151. package/lib/module/components/Chip/styles.js.map +1 -0
  152. package/lib/module/components/Dialog/index.js +267 -0
  153. package/lib/module/components/Dialog/index.js.map +1 -0
  154. package/lib/module/components/Dialog/styles.js +60 -0
  155. package/lib/module/components/Dialog/styles.js.map +1 -0
  156. package/lib/module/components/Field/FieldLabel.js +29 -0
  157. package/lib/module/components/Field/FieldLabel.js.map +1 -0
  158. package/lib/module/components/Field/FieldLabel.web.js +17 -0
  159. package/lib/module/components/Field/FieldLabel.web.js.map +1 -0
  160. package/lib/module/components/Field/index.js +155 -0
  161. package/lib/module/components/Field/index.js.map +1 -0
  162. package/lib/module/components/Field/styles.js +12 -0
  163. package/lib/module/components/Field/styles.js.map +1 -0
  164. package/lib/module/components/Form/FormRoot.js +21 -0
  165. package/lib/module/components/Form/FormRoot.js.map +1 -0
  166. package/lib/module/components/Form/FormRoot.web.js +12 -0
  167. package/lib/module/components/Form/FormRoot.web.js.map +1 -0
  168. package/lib/module/components/Form/index.js +44 -0
  169. package/lib/module/components/Form/index.js.map +1 -0
  170. package/lib/module/components/Form/styles.js +5 -0
  171. package/lib/module/components/Form/styles.js.map +1 -0
  172. package/lib/module/components/Heading/index.js +31 -0
  173. package/lib/module/components/Heading/index.js.map +1 -0
  174. package/lib/module/components/Heading/styles.js +19 -0
  175. package/lib/module/components/Heading/styles.js.map +1 -0
  176. package/lib/module/components/Icon/index.js +57 -0
  177. package/lib/module/components/Icon/index.js.map +1 -0
  178. package/lib/module/components/IconButton/index.js +71 -0
  179. package/lib/module/components/IconButton/index.js.map +1 -0
  180. package/lib/module/components/IconButton/styles.js +40 -0
  181. package/lib/module/components/IconButton/styles.js.map +1 -0
  182. package/lib/module/components/Image/Image.js +67 -0
  183. package/lib/module/components/Image/Image.js.map +1 -0
  184. package/lib/module/components/Image/index.js +4 -0
  185. package/lib/module/components/Image/index.js.map +1 -0
  186. package/lib/module/components/Input/BaseInput.android.js +16 -0
  187. package/lib/module/components/Input/BaseInput.android.js.map +1 -0
  188. package/lib/module/components/Input/index.js +10 -16
  189. package/lib/module/components/Input/index.js.map +1 -1
  190. package/lib/module/components/Input/styles.js +17 -30
  191. package/lib/module/components/Input/styles.js.map +1 -1
  192. package/lib/module/components/Link/index.js +85 -0
  193. package/lib/module/components/Link/index.js.map +1 -0
  194. package/lib/module/components/Link/styles.js +11 -0
  195. package/lib/module/components/Link/styles.js.map +1 -0
  196. package/lib/module/components/OtpInput/index.js +79 -0
  197. package/lib/module/components/OtpInput/index.js.map +1 -0
  198. package/lib/module/components/OtpInput/styles.js +44 -0
  199. package/lib/module/components/OtpInput/styles.js.map +1 -0
  200. package/lib/module/components/ProgressBar/index.js +41 -0
  201. package/lib/module/components/ProgressBar/index.js.map +1 -0
  202. package/lib/module/components/ProgressBar/styles.js +6 -0
  203. package/lib/module/components/ProgressBar/styles.js.map +1 -0
  204. package/lib/module/components/ProgressSegmented/index.js +58 -0
  205. package/lib/module/components/ProgressSegmented/index.js.map +1 -0
  206. package/lib/module/components/ProgressSegmented/styles.js +17 -0
  207. package/lib/module/components/ProgressSegmented/styles.js.map +1 -0
  208. package/lib/module/components/Select/SelectTriggerHost.js +7 -0
  209. package/lib/module/components/Select/SelectTriggerHost.js.map +1 -0
  210. package/lib/module/components/Select/SelectTriggerHost.web.js +93 -0
  211. package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -0
  212. package/lib/module/components/Select/index.js +14 -14
  213. package/lib/module/components/Select/index.js.map +1 -1
  214. package/lib/module/components/Select/styles.js +29 -53
  215. package/lib/module/components/Select/styles.js.map +1 -1
  216. package/lib/module/components/Stack/HStack.js +8 -21
  217. package/lib/module/components/Stack/HStack.js.map +1 -1
  218. package/lib/module/components/Stack/VStack.js +8 -21
  219. package/lib/module/components/Stack/VStack.js.map +1 -1
  220. package/lib/module/components/Stack/styles.js +40 -0
  221. package/lib/module/components/Stack/styles.js.map +1 -0
  222. package/lib/module/components/Switch/BaseSwitch.js +42 -0
  223. package/lib/module/components/Switch/BaseSwitch.js.map +1 -0
  224. package/lib/module/components/Switch/BaseSwitch.web.js +52 -0
  225. package/lib/module/components/Switch/BaseSwitch.web.js.map +1 -0
  226. package/lib/module/components/Switch/index.js +9 -0
  227. package/lib/module/components/Switch/index.js.map +1 -0
  228. package/lib/module/components/Switch/styles.js +125 -0
  229. package/lib/module/components/Switch/styles.js.map +1 -0
  230. package/lib/module/components/Text/index.js +19 -1
  231. package/lib/module/components/Text/index.js.map +1 -1
  232. package/lib/module/components/Text/styles.js +19 -0
  233. package/lib/module/components/Text/styles.js.map +1 -0
  234. package/lib/module/components/VirtualizedList/index.js +15 -0
  235. package/lib/module/components/VirtualizedList/index.js.map +1 -0
  236. package/lib/module/components/index.js +19 -0
  237. package/lib/module/components/index.js.map +1 -1
  238. package/lib/module/index.js +3 -0
  239. package/lib/module/index.js.map +1 -1
  240. package/lib/module/metro/withCdxMetroConfig.js +20 -0
  241. package/lib/module/metro/withCdxMetroConfig.js.map +1 -0
  242. package/lib/module/styles/index.js +4 -0
  243. package/lib/module/styles/index.js.map +1 -0
  244. package/lib/module/styles/primitives.js +119 -0
  245. package/lib/module/styles/primitives.js.map +1 -0
  246. package/lib/typescript/components/AlertDialog/index.d.ts +30 -0
  247. package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -0
  248. package/lib/typescript/components/Avatar/index.d.ts +40 -0
  249. package/lib/typescript/components/Avatar/index.d.ts.map +1 -0
  250. package/lib/typescript/components/Avatar/styles.d.ts +16 -0
  251. package/lib/typescript/components/Avatar/styles.d.ts.map +1 -0
  252. package/lib/typescript/components/BottomSheet/index.d.ts +61 -0
  253. package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -0
  254. package/lib/typescript/components/BottomSheet/styles.d.ts +16 -0
  255. package/lib/typescript/components/BottomSheet/styles.d.ts.map +1 -0
  256. package/lib/typescript/components/Box/Box.d.ts +1 -0
  257. package/lib/typescript/components/Box/Box.d.ts.map +1 -1
  258. package/lib/typescript/components/Button/index.d.ts +6 -3
  259. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  260. package/lib/typescript/components/Button/styles.d.ts +11 -8
  261. package/lib/typescript/components/Button/styles.d.ts.map +1 -1
  262. package/lib/typescript/components/Card/index.d.ts +30 -0
  263. package/lib/typescript/components/Card/index.d.ts.map +1 -0
  264. package/lib/typescript/components/Card/styles.d.ts +6 -0
  265. package/lib/typescript/components/Card/styles.d.ts.map +1 -0
  266. package/lib/typescript/components/Checkbox/index.d.ts +46 -0
  267. package/lib/typescript/components/Checkbox/index.d.ts.map +1 -0
  268. package/lib/typescript/components/Checkbox/styles.d.ts +18 -0
  269. package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -0
  270. package/lib/typescript/components/Chip/index.d.ts +27 -0
  271. package/lib/typescript/components/Chip/index.d.ts.map +1 -0
  272. package/lib/typescript/components/Chip/styles.d.ts +12 -0
  273. package/lib/typescript/components/Chip/styles.d.ts.map +1 -0
  274. package/lib/typescript/components/Dialog/index.d.ts +61 -0
  275. package/lib/typescript/components/Dialog/index.d.ts.map +1 -0
  276. package/lib/typescript/components/Dialog/styles.d.ts +14 -0
  277. package/lib/typescript/components/Dialog/styles.d.ts.map +1 -0
  278. package/lib/typescript/components/Field/FieldLabel.d.ts +18 -0
  279. package/lib/typescript/components/Field/FieldLabel.d.ts.map +1 -0
  280. package/lib/typescript/components/Field/FieldLabel.web.d.ts +16 -0
  281. package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -0
  282. package/lib/typescript/components/Field/index.d.ts +26 -0
  283. package/lib/typescript/components/Field/index.d.ts.map +1 -0
  284. package/lib/typescript/components/Field/styles.d.ts +16 -0
  285. package/lib/typescript/components/Field/styles.d.ts.map +1 -0
  286. package/lib/typescript/components/Form/FormRoot.d.ts +14 -0
  287. package/lib/typescript/components/Form/FormRoot.d.ts.map +1 -0
  288. package/lib/typescript/components/Form/FormRoot.web.d.ts +10 -0
  289. package/lib/typescript/components/Form/FormRoot.web.d.ts.map +1 -0
  290. package/lib/typescript/components/Form/index.d.ts +7 -0
  291. package/lib/typescript/components/Form/index.d.ts.map +1 -0
  292. package/lib/typescript/components/Form/styles.d.ts +2 -0
  293. package/lib/typescript/components/Form/styles.d.ts.map +1 -0
  294. package/lib/typescript/components/Heading/index.d.ts +10 -0
  295. package/lib/typescript/components/Heading/index.d.ts.map +1 -0
  296. package/lib/typescript/components/Heading/styles.d.ts +6 -0
  297. package/lib/typescript/components/Heading/styles.d.ts.map +1 -0
  298. package/lib/typescript/components/Icon/index.d.ts +27 -0
  299. package/lib/typescript/components/Icon/index.d.ts.map +1 -0
  300. package/lib/typescript/components/IconButton/index.d.ts +15 -0
  301. package/lib/typescript/components/IconButton/index.d.ts.map +1 -0
  302. package/lib/typescript/components/IconButton/styles.d.ts +11 -0
  303. package/lib/typescript/components/IconButton/styles.d.ts.map +1 -0
  304. package/lib/typescript/components/Image/Image.d.ts +47 -0
  305. package/lib/typescript/components/Image/Image.d.ts.map +1 -0
  306. package/lib/typescript/components/Image/index.d.ts +2 -0
  307. package/lib/typescript/components/Image/index.d.ts.map +1 -0
  308. package/lib/typescript/components/Input/BaseInput.android.d.ts +3 -0
  309. package/lib/typescript/components/Input/BaseInput.android.d.ts.map +1 -0
  310. package/lib/typescript/components/Input/index.d.ts +7 -5
  311. package/lib/typescript/components/Input/index.d.ts.map +1 -1
  312. package/lib/typescript/components/Input/styles.d.ts +5 -7
  313. package/lib/typescript/components/Input/styles.d.ts.map +1 -1
  314. package/lib/typescript/components/Link/index.d.ts +26 -0
  315. package/lib/typescript/components/Link/index.d.ts.map +1 -0
  316. package/lib/typescript/components/Link/styles.d.ts +6 -0
  317. package/lib/typescript/components/Link/styles.d.ts.map +1 -0
  318. package/lib/typescript/components/OtpInput/index.d.ts +11 -0
  319. package/lib/typescript/components/OtpInput/index.d.ts.map +1 -0
  320. package/lib/typescript/components/OtpInput/styles.d.ts +14 -0
  321. package/lib/typescript/components/OtpInput/styles.d.ts.map +1 -0
  322. package/lib/typescript/components/ProgressBar/index.d.ts +17 -0
  323. package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -0
  324. package/lib/typescript/components/ProgressBar/styles.d.ts +5 -0
  325. package/lib/typescript/components/ProgressBar/styles.d.ts.map +1 -0
  326. package/lib/typescript/components/ProgressSegmented/index.d.ts +15 -0
  327. package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -0
  328. package/lib/typescript/components/ProgressSegmented/styles.d.ts +8 -0
  329. package/lib/typescript/components/ProgressSegmented/styles.d.ts.map +1 -0
  330. package/lib/typescript/components/Select/SelectTriggerHost.d.ts +3 -0
  331. package/lib/typescript/components/Select/SelectTriggerHost.d.ts.map +1 -0
  332. package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +13 -0
  333. package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -0
  334. package/lib/typescript/components/Select/index.d.ts +7 -4
  335. package/lib/typescript/components/Select/index.d.ts.map +1 -1
  336. package/lib/typescript/components/Select/styles.d.ts +6 -8
  337. package/lib/typescript/components/Select/styles.d.ts.map +1 -1
  338. package/lib/typescript/components/Stack/HStack.d.ts +1 -12
  339. package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
  340. package/lib/typescript/components/Stack/VStack.d.ts +1 -12
  341. package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
  342. package/lib/typescript/components/Stack/styles.d.ts +23 -0
  343. package/lib/typescript/components/Stack/styles.d.ts.map +1 -0
  344. package/lib/typescript/components/Switch/BaseSwitch.d.ts +9 -0
  345. package/lib/typescript/components/Switch/BaseSwitch.d.ts.map +1 -0
  346. package/lib/typescript/components/Switch/BaseSwitch.web.d.ts +15 -0
  347. package/lib/typescript/components/Switch/BaseSwitch.web.d.ts.map +1 -0
  348. package/lib/typescript/components/Switch/index.d.ts +7 -0
  349. package/lib/typescript/components/Switch/index.d.ts.map +1 -0
  350. package/lib/typescript/components/Switch/styles.d.ts +26 -0
  351. package/lib/typescript/components/Switch/styles.d.ts.map +1 -0
  352. package/lib/typescript/components/Text/index.d.ts +9 -1
  353. package/lib/typescript/components/Text/index.d.ts.map +1 -1
  354. package/lib/typescript/components/Text/styles.d.ts +6 -0
  355. package/lib/typescript/components/Text/styles.d.ts.map +1 -0
  356. package/lib/typescript/components/VirtualizedList/index.d.ts +8 -0
  357. package/lib/typescript/components/VirtualizedList/index.d.ts.map +1 -0
  358. package/lib/typescript/components/index.d.ts +19 -0
  359. package/lib/typescript/components/index.d.ts.map +1 -1
  360. package/lib/typescript/index.d.ts +3 -0
  361. package/lib/typescript/index.d.ts.map +1 -1
  362. package/lib/typescript/metro/withCdxMetroConfig.d.ts +19 -0
  363. package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -0
  364. package/lib/typescript/styles/index.d.ts +2 -0
  365. package/lib/typescript/styles/index.d.ts.map +1 -0
  366. package/lib/typescript/styles/primitives.d.ts +85 -0
  367. package/lib/typescript/styles/primitives.d.ts.map +1 -0
  368. package/package.json +21 -10
  369. package/src/components/AlertDialog/index.tsx +124 -0
  370. package/src/components/Avatar/index.tsx +172 -0
  371. package/src/components/Avatar/styles.ts +83 -0
  372. package/src/components/BottomSheet/index.tsx +316 -0
  373. package/src/components/BottomSheet/styles.ts +79 -0
  374. package/src/components/Box/Box.tsx +1 -0
  375. package/src/components/Button/index.tsx +14 -9
  376. package/src/components/Button/styles.ts +159 -204
  377. package/src/components/Card/index.tsx +115 -0
  378. package/src/components/Card/styles.ts +41 -0
  379. package/src/components/Checkbox/index.tsx +207 -0
  380. package/src/components/Checkbox/styles.ts +103 -0
  381. package/src/components/Chip/index.tsx +91 -0
  382. package/src/components/Chip/styles.ts +52 -0
  383. package/src/components/Dialog/index.tsx +304 -0
  384. package/src/components/Dialog/styles.ts +88 -0
  385. package/src/components/Field/FieldLabel.tsx +33 -0
  386. package/src/components/Field/FieldLabel.web.tsx +25 -0
  387. package/src/components/Field/index.tsx +171 -0
  388. package/src/components/Field/styles.ts +32 -0
  389. package/src/components/Form/FormRoot.tsx +20 -0
  390. package/src/components/Form/FormRoot.web.tsx +12 -0
  391. package/src/components/Form/index.tsx +38 -0
  392. package/src/components/Form/styles.ts +3 -0
  393. package/src/components/Heading/index.tsx +36 -0
  394. package/src/components/Heading/styles.tsx +25 -0
  395. package/src/components/Icon/index.tsx +54 -0
  396. package/src/components/IconButton/index.tsx +92 -0
  397. package/src/components/IconButton/styles.ts +59 -0
  398. package/src/components/Image/Image.tsx +77 -0
  399. package/src/components/Image/index.ts +1 -0
  400. package/src/components/Input/BaseInput.android.tsx +13 -0
  401. package/src/components/Input/index.tsx +9 -22
  402. package/src/components/Input/styles.ts +36 -40
  403. package/src/components/Link/index.tsx +83 -0
  404. package/src/components/Link/styles.ts +21 -0
  405. package/src/components/OtpInput/index.tsx +79 -0
  406. package/src/components/OtpInput/styles.ts +45 -0
  407. package/src/components/ProgressBar/index.tsx +53 -0
  408. package/src/components/ProgressBar/styles.ts +9 -0
  409. package/src/components/ProgressSegmented/index.tsx +81 -0
  410. package/src/components/ProgressSegmented/styles.ts +20 -0
  411. package/src/components/Select/SelectTriggerHost.tsx +4 -0
  412. package/src/components/Select/SelectTriggerHost.web.tsx +136 -0
  413. package/src/components/Select/index.tsx +14 -14
  414. package/src/components/Select/styles.ts +68 -75
  415. package/src/components/Stack/HStack.tsx +8 -19
  416. package/src/components/Stack/VStack.tsx +8 -23
  417. package/src/components/Stack/styles.ts +42 -0
  418. package/src/components/Switch/BaseSwitch.tsx +38 -0
  419. package/src/components/Switch/BaseSwitch.web.tsx +69 -0
  420. package/src/components/Switch/index.tsx +11 -0
  421. package/src/components/Switch/styles.ts +120 -0
  422. package/src/components/Text/index.tsx +16 -0
  423. package/src/components/Text/styles.tsx +25 -0
  424. package/src/components/VirtualizedList/index.tsx +19 -0
  425. package/src/components/index.ts +19 -0
  426. package/src/index.ts +3 -0
  427. package/src/metro/withCdxMetroConfig.ts +29 -0
  428. package/src/styles/index.ts +1 -0
  429. package/src/styles/primitives.ts +107 -0
  430. package/lib/commonjs/components/Text/Text.js +0 -30
  431. package/lib/commonjs/components/Text/Text.js.map +0 -1
  432. package/lib/module/components/Text/Text.js +0 -26
  433. package/lib/module/components/Text/Text.js.map +0 -1
  434. package/lib/typescript/components/Text/Text.d.ts +0 -11
  435. package/lib/typescript/components/Text/Text.d.ts.map +0 -1
  436. package/src/components/Text/Text.tsx +0 -58
  437. package/src/components/Text/index.ts +0 -1
@@ -0,0 +1,38 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { View } from 'react-native';
3
+ import { createForm } from '@cdx-ui/primitives';
4
+ import { cn } from '@cdx-ui/utils';
5
+ import { BaseFormRoot, type BaseFormRootProps } from './FormRoot';
6
+ import { formRootVariants } from './styles';
7
+
8
+ // =============================================================================
9
+ // PRIMITIVE
10
+ // =============================================================================
11
+
12
+ const FormPrimitive = createForm({ Root: BaseFormRoot });
13
+
14
+ FormPrimitive.displayName = 'FormPrimitive';
15
+
16
+ // =============================================================================
17
+ // FORM ROOT (container — <form> on web, <View> on RN)
18
+ // =============================================================================
19
+
20
+ export interface FormProps extends BaseFormRootProps {}
21
+
22
+ const FormRoot = forwardRef<View, FormProps>(({ className, children, style, ...props }, ref) => {
23
+ const computedClassName = cn(formRootVariants(), className);
24
+
25
+ return (
26
+ <FormPrimitive ref={ref} className={computedClassName} style={style} {...props}>
27
+ {children}
28
+ </FormPrimitive>
29
+ );
30
+ });
31
+
32
+ FormRoot.displayName = 'Form';
33
+
34
+ // =============================================================================
35
+ // EXPORT
36
+ // =============================================================================
37
+
38
+ export const Form = FormRoot;
@@ -0,0 +1,3 @@
1
+ import { cva } from 'class-variance-authority';
2
+
3
+ export const formRootVariants = cva(['flex-col gap-4']);
@@ -0,0 +1,36 @@
1
+ import { forwardRef, memo, type ComponentRef, type ComponentPropsWithoutRef } from 'react';
2
+ import { Text } from 'react-native';
3
+ import { cn } from '@cdx-ui/utils';
4
+ import { headingStyle, type HeadingVariantProps } from './styles';
5
+
6
+ const sizeToLevel = {
7
+ xl: 1,
8
+ lg: 2,
9
+ md: 3,
10
+ sm: 4,
11
+ xs: 5,
12
+ } as const;
13
+
14
+ export type HeadingProps = HeadingVariantProps &
15
+ ComponentPropsWithoutRef<typeof Text> & {
16
+ className?: string;
17
+ };
18
+
19
+ export const Heading = memo(
20
+ forwardRef<ComponentRef<typeof Text>, HeadingProps>(function Heading(
21
+ { className, size = 'lg', ...props },
22
+ ref,
23
+ ) {
24
+ return (
25
+ <Text
26
+ role="heading"
27
+ aria-level={sizeToLevel[size ?? 'lg']}
28
+ className={cn(headingStyle({ size }), className)}
29
+ {...props}
30
+ ref={ref}
31
+ />
32
+ );
33
+ }),
34
+ );
35
+
36
+ Heading.displayName = 'Heading';
@@ -0,0 +1,25 @@
1
+ import { Platform } from 'react-native';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
+
4
+ export const headingStyle = cva(
5
+ [
6
+ `text-content-primary my-0`,
7
+ Platform.select({
8
+ web: 'bg-transparent display-inline no-underline',
9
+ default: '',
10
+ }),
11
+ ],
12
+ {
13
+ variants: {
14
+ size: {
15
+ xl: 'heading-xl',
16
+ lg: 'heading-lg',
17
+ md: 'heading-md',
18
+ sm: 'heading-sm',
19
+ xs: 'heading-xs',
20
+ },
21
+ },
22
+ },
23
+ );
24
+
25
+ export type HeadingVariantProps = VariantProps<typeof headingStyle>;
@@ -0,0 +1,54 @@
1
+ import { withUniwind } from 'uniwind';
2
+ import { cn } from '@cdx-ui/utils';
3
+ import type { CdxIcon, CdxIconProps } from '@cdx-ui/icons';
4
+ import { COLOR_TEXT_PRIMARY } from '../../styles/primitives';
5
+
6
+ export type IconProps = CdxIconProps & {
7
+ className?: string; // TODO: Why does this need to specified manually?
8
+ as: CdxIcon;
9
+ };
10
+
11
+ function IconImpl({ as: IconComponent, ...props }: IconProps) {
12
+ return <IconComponent {...props} />;
13
+ }
14
+
15
+ const StyledIcon = withUniwind(IconImpl, {
16
+ size: {
17
+ fromClassName: 'className',
18
+ styleProperty: 'width',
19
+ },
20
+ color: {
21
+ fromClassName: 'className',
22
+ styleProperty: 'color',
23
+ },
24
+ });
25
+
26
+ /**
27
+ * A wrapper component for CDX icons with Uniwind `className` support via `withUniwind`.
28
+ *
29
+ * This component allows you to render any CDX icon while applying utility classes
30
+ * using `uniwind`. It avoids the need to wrap or configure each icon individually.
31
+ *
32
+ * @component
33
+ * @example
34
+ * ```tsx
35
+ * import { Icon } from '@cdx-ui/components';
36
+ * import { ArrowRight } from '@cdx-ui/icons';
37
+ *
38
+ * <Icon as={ArrowRight} className="text-red-500 size-4" />
39
+ * ```
40
+ *
41
+ * @param {CdxIcon} as - The CDX icon component to render.
42
+ * @param {string} className - Utility classes to style the icon using Uniwind.
43
+ * @param {number} size - Icon size (overrides the size class).
44
+ * @param {...CdxIconProps} ...props - Additional icon props passed to the "as" icon.
45
+ */
46
+ export function Icon({ as: IconComponent, className, ...props }: IconProps) {
47
+ return (
48
+ <StyledIcon
49
+ as={IconComponent}
50
+ className={cn(COLOR_TEXT_PRIMARY, 'size-5', className)}
51
+ {...props}
52
+ />
53
+ );
54
+ }
@@ -0,0 +1,92 @@
1
+ import { forwardRef } from 'react';
2
+ import { ActivityIndicator, Pressable, Text, View, type PressableProps } from 'react-native';
3
+ import {
4
+ createButton,
5
+ dataAttributes,
6
+ type IButtonProps,
7
+ useButtonContext,
8
+ } from '@cdx-ui/primitives';
9
+ import type { CdxIcon } from '@cdx-ui/icons';
10
+ import { cn } from '@cdx-ui/utils';
11
+ import { Icon, type IconProps } from '../Icon';
12
+ import {
13
+ type IconButtonVariantProps,
14
+ iconButtonGlyphVariants,
15
+ iconButtonIconColorVariants,
16
+ iconButtonRootVariants,
17
+ } from './styles';
18
+
19
+ const IconButtonPrimitive = createButton({
20
+ Root: Pressable,
21
+ Text,
22
+ Group: View,
23
+ Spinner: ActivityIndicator,
24
+ Icon: View,
25
+ });
26
+
27
+ function IconButtonGlyph({ as: IconComponent, className }: { as: CdxIcon; className: string }) {
28
+ const { hover, focus, active, disabled, focusVisible } = useButtonContext();
29
+ return (
30
+ <Icon
31
+ as={IconComponent}
32
+ className={className}
33
+ {...dataAttributes({
34
+ hover,
35
+ focus,
36
+ active,
37
+ disabled,
38
+ focusVisible,
39
+ })}
40
+ />
41
+ );
42
+ }
43
+
44
+ export interface IconButtonProps extends PressableProps, IButtonProps, IconButtonVariantProps {
45
+ className?: string;
46
+ /** CDX icon component to render (icon-only control). */
47
+ as: CdxIcon;
48
+ /** Passed through to the underlying `Icon`. */
49
+ iconClassName?: IconProps['className'];
50
+ }
51
+
52
+ const IconButtonRoot = forwardRef<View, IconButtonProps>(
53
+ (
54
+ {
55
+ variant = 'solid',
56
+ size = 'default',
57
+ className,
58
+ style,
59
+ as: IconComponent,
60
+ iconClassName,
61
+ accessibilityRole = 'button',
62
+ ...props
63
+ },
64
+ ref,
65
+ ) => {
66
+ const rootClassName = cn(iconButtonRootVariants({ variant, size }), className);
67
+
68
+ const glyphClassName = cn(
69
+ iconButtonGlyphVariants({ size }),
70
+ iconButtonIconColorVariants(),
71
+ iconClassName,
72
+ );
73
+
74
+ return (
75
+ <IconButtonPrimitive
76
+ ref={ref}
77
+ accessibilityRole={accessibilityRole}
78
+ className={rootClassName}
79
+ style={style}
80
+ {...props}
81
+ >
82
+ <IconButtonGlyph as={IconComponent} className={glyphClassName} />
83
+ </IconButtonPrimitive>
84
+ );
85
+ },
86
+ );
87
+
88
+ IconButtonRoot.displayName = 'IconButton';
89
+
90
+ export const IconButton = IconButtonRoot;
91
+
92
+ export type { IconButtonVariantProps };
@@ -0,0 +1,59 @@
1
+ import { Platform } from 'react-native';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
+ import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
4
+
5
+ export const iconButtonRootVariants = cva(
6
+ [
7
+ 'flex items-center justify-center',
8
+ 'rounded-[var(--border-radius-round)]',
9
+ 'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
10
+ TRANSITION_COLORS,
11
+ 'data-[disabled=true]:opacity-[--opacity-disabled]',
12
+ DISABLED_CURSOR,
13
+ 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[--color-stroke-ring] web:data-[focus-visible=true]:ring-offset-2',
14
+ ],
15
+ {
16
+ variants: {
17
+ variant: {
18
+ solid: [
19
+ 'bg-surface-primary border border-stroke-secondary',
20
+ Platform.select({
21
+ default: 'data-[active=true]:bg-surface-primary-active',
22
+ web: 'data-[hover=true]:bg-surface-primary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active',
23
+ }),
24
+ ],
25
+ ghost: [
26
+ 'bg-transparent',
27
+ Platform.select({
28
+ default: 'data-[active=true]:bg-surface-primary-active',
29
+ web: 'data-[hover=true]:bg-surface-primary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active',
30
+ }),
31
+ ],
32
+ },
33
+ size: {
34
+ default: 'h-11 w-11 min-w-11 shrink-0 p-2.5',
35
+ small: 'h-8 w-8 min-w-8 shrink-0 p-1.5',
36
+ },
37
+ },
38
+ defaultVariants: {
39
+ variant: 'solid',
40
+ size: 'default',
41
+ },
42
+ },
43
+ );
44
+
45
+ export const iconButtonGlyphVariants = cva([], {
46
+ variants: {
47
+ size: {
48
+ default: 'size-6',
49
+ small: 'size-5',
50
+ },
51
+ },
52
+ defaultVariants: {
53
+ size: 'default',
54
+ },
55
+ });
56
+
57
+ export const iconButtonIconColorVariants = cva(['text-content-primary']);
58
+
59
+ export type IconButtonVariantProps = VariantProps<typeof iconButtonRootVariants>;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Thin wrapper around React Native's `Image`.
3
+ *
4
+ * Design-system layout (sizes, radii, loading/error UI) is intentionally
5
+ * NOT baked in here — use purpose-built components like `Avatar` instead.
6
+ *
7
+ * What this wrapper adds over a raw RN `Image`:
8
+ * - Accepts a plain URI **string** as `source` (auto-normalized to `{ uri }`).
9
+ * - Extends the prop surface with **web-only** HTML attributes (`sizes`,
10
+ * `loading`, `decoding`, etc.) for better `react-native-web` support.
11
+ * Props already covered by RN 0.81+ (`alt`, `srcSet`, `crossOrigin`,
12
+ * `referrerPolicy`) are inherited from the native typings.
13
+ * - All other props and `ref` are forwarded to the underlying `Image`.
14
+ *
15
+ * Inspired by Expo's html-elements Image primitive:
16
+ * @see https://github.com/expo/expo/blob/main/packages/html-elements/src/primitives/Image.tsx
17
+ */
18
+
19
+ import { forwardRef, type ComponentPropsWithoutRef, type ComponentRef } from 'react';
20
+ import { Image as RNImage, type ImageSourcePropType } from 'react-native';
21
+
22
+ /** Coerces a plain URI string into the `{ uri }` shape RN expects. */
23
+ function normalizeSource(source: string | ImageSourcePropType): ImageSourcePropType {
24
+ if (typeof source === 'string') {
25
+ return { uri: source };
26
+ }
27
+ return source;
28
+ }
29
+
30
+ // ---------------------------------------------------------------------------
31
+ // Web-oriented props not yet covered by react-native's Image typings.
32
+ // Props already present in RN 0.81+ (alt, srcSet, crossOrigin,
33
+ // referrerPolicy) are inherited from the native Image props.
34
+ // ---------------------------------------------------------------------------
35
+
36
+ /**
37
+ * HTML-ish attributes not in RN’s core typings. Forwarded to `Image` with `...props`;
38
+ * **react-native-web** maps supported ones to the DOM `<img>`. On iOS/Android they are
39
+ * typically ignored (no visual effect).
40
+ */
41
+ export interface WebImageProps {
42
+ /** DOM `sizes` for responsive selection with `srcSet` — web only. */
43
+ sizes?: string;
44
+ /** DOM lazy-loading hint — web only. */
45
+ loading?: 'lazy' | 'eager';
46
+ /** DOM decode hint — web only. */
47
+ decoding?: 'async' | 'auto' | 'sync';
48
+ /** DOM drag behavior — web only. */
49
+ draggable?: boolean;
50
+ /** DOM focus order — web only. */
51
+ tabIndex?: number;
52
+ }
53
+
54
+ // ---------------------------------------------------------------------------
55
+ // ImageProps = native Image props (minus `source`) + WebImageProps + our overrides.
56
+ // `source` is re-declared to also accept a plain string.
57
+ // ---------------------------------------------------------------------------
58
+
59
+ export type ImageProps = WebImageProps &
60
+ Omit<ComponentPropsWithoutRef<typeof RNImage>, 'source'> & {
61
+ /** URI string (normalized to `{ uri }`) or standard `ImageSourcePropType`. */
62
+ source: string | ImageSourcePropType;
63
+ className?: string;
64
+ };
65
+
66
+ // ---------------------------------------------------------------------------
67
+ // Component
68
+ // ---------------------------------------------------------------------------
69
+
70
+ export const Image = forwardRef<ComponentRef<typeof RNImage>, ImageProps>(function Image(
71
+ { source, ...props },
72
+ ref,
73
+ ) {
74
+ return <RNImage source={normalizeSource(source)} {...props} ref={ref} />;
75
+ });
76
+
77
+ Image.displayName = 'Image';
@@ -0,0 +1 @@
1
+ export { Image, type ImageProps, type WebImageProps } from './Image';
@@ -0,0 +1,13 @@
1
+ import { forwardRef } from 'react';
2
+ import { TextInput, type TextInputProps } from 'react-native';
3
+
4
+ const androidDefaults = {
5
+ includeFontPadding: false,
6
+ textAlignVertical: 'center' as const,
7
+ };
8
+
9
+ export const BaseInput = forwardRef<TextInput, TextInputProps>((props, ref) => (
10
+ <TextInput ref={ref} {...props} style={[androidDefaults, props.style]} />
11
+ ));
12
+
13
+ BaseInput.displayName = 'BaseInput';
@@ -7,6 +7,7 @@ import {
7
7
  type IInputSlotProps,
8
8
  } from '@cdx-ui/primitives';
9
9
  import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
10
+ import { Icon, IconProps } from '../Icon';
10
11
  import { BaseInput } from './BaseInput';
11
12
  import {
12
13
  type InputVariantProps,
@@ -25,7 +26,6 @@ const useInputStyleContext = () => useStyleContext(SCOPE) as InputVariantProps;
25
26
 
26
27
  const InputPrimitive = createInput({
27
28
  Root,
28
- Icon: View,
29
29
  Slot: View,
30
30
  Field: BaseInput,
31
31
  });
@@ -40,7 +40,7 @@ export interface InputProps extends ViewProps, IInputFieldProps, InputVariantPro
40
40
  }
41
41
 
42
42
  const InputRoot = forwardRef<View, InputProps>(
43
- ({ variant = 'outline', size = 'md', className, children, style, ...props }, ref) => {
43
+ ({ variant = 'outline', size = 'default', className, children, style, ...props }, ref) => {
44
44
  const computedClassName = cn(inputRootVariants({ variant, size }), className);
45
45
 
46
46
  return (
@@ -103,9 +103,7 @@ export interface InputSlotProps extends ViewProps, IInputSlotProps {
103
103
 
104
104
  const InputSlot = forwardRef<View, InputSlotProps>(
105
105
  ({ className, children, style, ...props }, ref) => {
106
- const { size } = useInputStyleContext();
107
-
108
- const computedClassName = cn(inputSlotVariants({ size }), className);
106
+ const computedClassName = cn(inputSlotVariants(), className);
109
107
 
110
108
  return (
111
109
  <InputPrimitive.Slot ref={ref} className={computedClassName} style={style} {...props}>
@@ -121,24 +119,15 @@ InputSlot.displayName = 'Input.Slot';
121
119
  // INPUT ICON
122
120
  // =============================================================================
123
121
 
124
- export interface InputIconProps extends ViewProps {
125
- className?: string;
126
- children?: ReactNode;
127
- }
122
+ export interface InputIconProps extends Omit<IconProps, 'children'> {}
128
123
 
129
- const InputIcon = forwardRef<View, InputIconProps>(
130
- ({ className, children, style, ...props }, ref) => {
131
- const { size } = useInputStyleContext();
124
+ const InputIcon = ({ className, style, as, ...props }: InputIconProps) => {
125
+ const { size } = useInputStyleContext();
132
126
 
133
- const computedClassName = cn(inputIconVariants({ size }), className);
127
+ const computedClassName = cn(inputIconVariants({ size }), className);
134
128
 
135
- return (
136
- <InputPrimitive.Icon ref={ref} className={computedClassName} style={style} {...props}>
137
- {children}
138
- </InputPrimitive.Icon>
139
- );
140
- },
141
- );
129
+ return <Icon as={as} className={computedClassName} style={style} {...props} />;
130
+ };
142
131
 
143
132
  InputIcon.displayName = 'Input.Icon';
144
133
 
@@ -157,5 +146,3 @@ export const Input = Object.assign(InputRoot, {
157
146
  Slot: InputSlot,
158
147
  Icon: InputIcon,
159
148
  }) as InputCompoundComponent;
160
-
161
- export type { InputVariantProps };
@@ -1,83 +1,79 @@
1
1
  import { cva, type VariantProps } from 'class-variance-authority';
2
+ import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
2
3
 
3
4
  export const inputRootVariants = cva(
4
5
  [
5
- 'w-full flex-row items-center',
6
- 'border border-neutral-border-strong bg-neutral-surface shadow-sm',
7
- 'data-[disabled=true]:opacity-60 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-interactive-disabled-background data-[disabled=true]:border-interactive-disabled',
8
- 'data-[focus=true]:border-interactive-focus',
9
- 'data-[invalid=true]:border-red-500',
6
+ 'w-full flex-row items-stretch overflow-hidden',
7
+ 'bg-surface-primary',
8
+ 'border-solid border-[length:var(--border-width-default)] border-stroke-primary',
9
+ 'rounded-[var(--border-radius-default)]',
10
+ TRANSITION_COLORS,
11
+ 'data-[disabled=true]:bg-surface-secondary',
12
+ 'data-[disabled=true]:opacity-[--opacity-disabled]',
13
+ DISABLED_CURSOR,
14
+ 'data-[readonly=true]:cursor-default',
15
+ 'data-[readonly=true]:bg-surface-secondary',
16
+ 'web:data-[hover=true]:data-[focus=false]:data-[invalid=false]:border-stroke-hover',
17
+ 'data-[focus=true]:border-[length:var(--border-width-focused)]',
18
+ 'data-[focus=true]:border-stroke-action',
19
+ 'data-[invalid=true]:border-stroke-danger',
10
20
  ],
11
21
  {
12
22
  variants: {
13
23
  variant: {
14
- outline: [
15
- 'rounded-md px-3',
16
- 'web:focus-within:border-interactive-focus web:focus-within:ring-3 web:focus-within:ring-blue-300/50',
17
- 'web:data-[invalid=true]:focus-within:border-red-500 web:data-[invalid=true]:focus-within:ring-red-300/50',
18
- ],
19
- underlined:
20
- 'rounded-none border-t-0 border-l-0 border-r-0 border-b-neutral-border data-[focus=true]:border-b-interactive-focus shadow-none',
24
+ outline: [],
21
25
  },
22
26
  size: {
23
- sm: 'h-9 py-1',
24
- md: 'h-11 py-1.5',
25
- lg: 'h-12 py-2',
27
+ // TODO: Find a cleaner approach to preventing layout shift when focus border is applied.
28
+ default: ['h-10 px-4 py-2 gap-2', 'data-[focus=true]:px-[15px] data-[focus=true]:py-[7px]'],
29
+ small: [
30
+ 'h-8 px-3 py-1.5 gap-1.5',
31
+ 'data-[focus=true]:px-[11px] data-[focus=true]:py-[5px]',
32
+ ],
26
33
  },
27
34
  },
28
35
  defaultVariants: {
29
36
  variant: 'outline',
30
- size: 'md',
37
+ size: 'default',
31
38
  },
32
39
  },
33
40
  );
34
41
 
35
42
  export const inputFieldVariants = cva(
36
43
  [
37
- 'flex-1 bg-transparent text-neutral-text-primary',
38
- 'placeholder:text-neutral-placeholder',
44
+ 'flex-1 justify-center bg-transparent p-0',
45
+ 'font-body text-content-primary',
46
+ 'placeholder:text-content-tertiary',
39
47
  'web:outline-none',
48
+ 'tracking-normal',
40
49
  ],
41
50
  {
42
51
  variants: {
43
52
  size: {
44
- sm: 'text-sm leading-none',
45
- md: 'text-base leading-none',
46
- lg: 'text-lg leading-none',
53
+ default: 'text-[0.875rem]',
54
+ small: 'text-[0.75rem]',
47
55
  },
48
56
  },
49
57
  defaultVariants: {
50
- size: 'sm',
58
+ size: 'default',
51
59
  },
52
60
  },
53
61
  );
54
62
 
55
- export const inputSlotVariants = cva(['items-center justify-center'], {
56
- variants: {
57
- size: {
58
- sm: 'h-4 w-4',
59
- md: 'h-5 w-5',
60
- lg: 'h-6 w-6',
61
- },
62
- },
63
- defaultVariants: {
64
- size: 'sm',
65
- },
66
- });
63
+ export const inputSlotVariants = cva(['items-center justify-center self-center']);
67
64
 
68
- export const inputIconVariants = cva(['text-neutral-text-tertiary'], {
65
+ export const inputIconVariants = cva(['text-content-tertiary'], {
69
66
  variants: {
70
67
  size: {
71
- sm: 'h-4 w-4',
72
- md: 'h-5 w-5',
73
- lg: 'h-5 w-5',
68
+ default: 'size-5',
69
+ small: 'size-4',
74
70
  },
75
71
  },
76
72
  defaultVariants: {
77
- size: 'sm',
73
+ size: 'default',
78
74
  },
79
75
  });
80
76
 
81
- export const inputFieldPlaceholderVariants = cva(['accent-neutral-placeholder']);
77
+ export const inputFieldPlaceholderVariants = cva(['accent-content-tertiary']);
82
78
 
83
79
  export type InputVariantProps = VariantProps<typeof inputRootVariants>;
@@ -0,0 +1,83 @@
1
+ import { forwardRef, type ReactNode } from 'react';
2
+ import { Pressable, Text as RNText, type TextProps, type View } from 'react-native';
3
+ import { createLink, type ILinkProps } from '@cdx-ui/primitives';
4
+ import { cn } from '@cdx-ui/utils';
5
+ import { Icon, type IconProps } from '../Icon';
6
+ import { linkRootVariants, linkLabelVariants, linkIconVariants } from './styles';
7
+
8
+ export { LinkProvider, type LinkConfig, type LinkAction } from '@cdx-ui/primitives';
9
+
10
+ const LinkPrimitive = createLink({
11
+ Root: Pressable,
12
+ });
13
+
14
+ // =============================================================================
15
+ // STYLED ROOT COMPONENT
16
+ // =============================================================================
17
+
18
+ export interface LinkProps extends ILinkProps {
19
+ className?: string;
20
+ }
21
+
22
+ const LinkRoot = forwardRef<View, LinkProps>(({ className, children, style, ...props }, ref) => {
23
+ const rootClassName = cn(linkRootVariants(), className);
24
+
25
+ return (
26
+ <LinkPrimitive ref={ref} className={rootClassName} style={style} {...props}>
27
+ {children}
28
+ </LinkPrimitive>
29
+ );
30
+ });
31
+
32
+ LinkRoot.displayName = 'Link';
33
+
34
+ // =============================================================================
35
+ // STYLED LABEL COMPONENT
36
+ // =============================================================================
37
+
38
+ export interface LinkLabelProps extends TextProps {
39
+ className?: string;
40
+ children?: ReactNode;
41
+ }
42
+
43
+ const LinkLabel = forwardRef<RNText, LinkLabelProps>(
44
+ ({ className, children, style, ...props }, ref) => {
45
+ const computedClassName = cn(linkLabelVariants(), className);
46
+
47
+ return (
48
+ <RNText ref={ref} className={computedClassName} style={style} {...props}>
49
+ {children}
50
+ </RNText>
51
+ );
52
+ },
53
+ );
54
+
55
+ LinkLabel.displayName = 'Link.Label';
56
+
57
+ // =============================================================================
58
+ // STYLED ICON COMPONENT
59
+ // =============================================================================
60
+
61
+ export interface LinkIconProps extends Omit<IconProps, 'children'> {}
62
+
63
+ const LinkIcon = ({ className, style, as, ...props }: LinkIconProps) => {
64
+ const computedClassName = cn(linkIconVariants(), className);
65
+
66
+ return <Icon as={as} className={computedClassName} style={style} {...props} />;
67
+ };
68
+
69
+ LinkIcon.displayName = 'Link.Icon';
70
+
71
+ // =============================================================================
72
+ // COMPOUND COMPONENT EXPORT
73
+ // =============================================================================
74
+
75
+ type LinkCompoundComponent = typeof LinkRoot & {
76
+ Label: typeof LinkLabel;
77
+ Icon: typeof LinkIcon;
78
+ };
79
+
80
+ export const Link = Object.assign(LinkRoot, {
81
+ Label: LinkLabel,
82
+ Icon: LinkIcon,
83
+ }) as LinkCompoundComponent;