@cdx-ui/components 0.0.1-beta.5 → 0.0.1-beta.50

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 (351) hide show
  1. package/README.md +28 -18
  2. package/lib/commonjs/components/AlertDialog/index.js +1 -1
  3. package/lib/commonjs/components/AlertDialog/index.js.map +1 -1
  4. package/lib/commonjs/components/Avatar/index.js +1 -1
  5. package/lib/commonjs/components/Avatar/styles.js +36 -29
  6. package/lib/commonjs/components/Avatar/styles.js.map +1 -1
  7. package/lib/commonjs/components/Button/index.js +12 -1
  8. package/lib/commonjs/components/Button/index.js.map +1 -1
  9. package/lib/commonjs/components/Button/styles.js +26 -26
  10. package/lib/commonjs/components/Button/styles.js.map +1 -1
  11. package/lib/commonjs/components/CLAUDE.md +90 -0
  12. package/lib/commonjs/components/Card/index.js +22 -4
  13. package/lib/commonjs/components/Card/index.js.map +1 -1
  14. package/lib/commonjs/components/Card/styles.js +27 -4
  15. package/lib/commonjs/components/Card/styles.js.map +1 -1
  16. package/lib/commonjs/components/Checkbox/index.js +5 -29
  17. package/lib/commonjs/components/Checkbox/index.js.map +1 -1
  18. package/lib/commonjs/components/Checkbox/styles.js +39 -47
  19. package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
  20. package/lib/commonjs/components/Chip/index.js +78 -9
  21. package/lib/commonjs/components/Chip/index.js.map +1 -1
  22. package/lib/commonjs/components/Chip/styles.js +207 -21
  23. package/lib/commonjs/components/Chip/styles.js.map +1 -1
  24. package/lib/commonjs/components/Field/index.js +8 -2
  25. package/lib/commonjs/components/Field/index.js.map +1 -1
  26. package/lib/commonjs/components/Field/styles.js +4 -4
  27. package/lib/commonjs/components/Field/styles.js.map +1 -1
  28. package/lib/commonjs/components/Heading/styles.js +1 -1
  29. package/lib/commonjs/components/Heading/styles.js.map +1 -1
  30. package/lib/commonjs/components/Icon/index.js +3 -4
  31. package/lib/commonjs/components/Icon/index.js.map +1 -1
  32. package/lib/commonjs/components/IconButton/index.js +6 -1
  33. package/lib/commonjs/components/IconButton/index.js.map +1 -1
  34. package/lib/commonjs/components/IconButton/styles.js +135 -10
  35. package/lib/commonjs/components/IconButton/styles.js.map +1 -1
  36. package/lib/commonjs/components/Input/styles.js +7 -6
  37. package/lib/commonjs/components/Input/styles.js.map +1 -1
  38. package/lib/commonjs/components/Link/index.js +22 -3
  39. package/lib/commonjs/components/Link/index.js.map +1 -1
  40. package/lib/commonjs/components/Link/styles.js +56 -6
  41. package/lib/commonjs/components/Link/styles.js.map +1 -1
  42. package/lib/commonjs/components/ListItem/styles.js +9 -9
  43. package/lib/commonjs/components/ListItem/styles.js.map +1 -1
  44. package/lib/commonjs/components/ProgressSegmented/index.js +24 -10
  45. package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -1
  46. package/lib/commonjs/components/Radio/index.js +167 -0
  47. package/lib/commonjs/components/Radio/index.js.map +1 -0
  48. package/lib/commonjs/components/Radio/styles.js +31 -0
  49. package/lib/commonjs/components/Radio/styles.js.map +1 -0
  50. package/lib/commonjs/components/ScopedTheme/index.js +24 -0
  51. package/lib/commonjs/components/ScopedTheme/index.js.map +1 -0
  52. package/lib/commonjs/components/Select/SelectTriggerHost.web.js +4 -0
  53. package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +1 -1
  54. package/lib/commonjs/components/Select/index.js +9 -3
  55. package/lib/commonjs/components/Select/index.js.map +1 -1
  56. package/lib/commonjs/components/Select/styles.js +17 -20
  57. package/lib/commonjs/components/Select/styles.js.map +1 -1
  58. package/lib/commonjs/components/Text/styles.js +2 -2
  59. package/lib/commonjs/components/Text/styles.js.map +1 -1
  60. package/lib/commonjs/components/Tile/index.js +251 -0
  61. package/lib/commonjs/components/Tile/index.js.map +1 -0
  62. package/lib/commonjs/components/Tile/styles.js +52 -0
  63. package/lib/commonjs/components/Tile/styles.js.map +1 -0
  64. package/lib/commonjs/components/index.js +36 -0
  65. package/lib/commonjs/components/index.js.map +1 -1
  66. package/lib/commonjs/figma/Avatar.figma.js +54 -0
  67. package/lib/commonjs/figma/Avatar.figma.js.map +1 -0
  68. package/lib/commonjs/figma/Button.figma.js +28 -15
  69. package/lib/commonjs/figma/Button.figma.js.map +1 -1
  70. package/lib/commonjs/figma/CLAUDE.md +30 -0
  71. package/lib/commonjs/figma/Card.Header.figma.js +28 -0
  72. package/lib/commonjs/figma/Card.Header.figma.js.map +1 -0
  73. package/lib/commonjs/figma/Card.figma.js +42 -0
  74. package/lib/commonjs/figma/Card.figma.js.map +1 -0
  75. package/lib/commonjs/figma/Checkbox.figma.js +55 -0
  76. package/lib/commonjs/figma/Checkbox.figma.js.map +1 -0
  77. package/lib/commonjs/figma/Chip.figma.js +68 -0
  78. package/lib/commonjs/figma/Chip.figma.js.map +1 -0
  79. package/lib/commonjs/figma/Field.Input.figma.js +57 -0
  80. package/lib/commonjs/figma/Field.Input.figma.js.map +1 -0
  81. package/lib/commonjs/figma/Field.Select.figma.js +57 -0
  82. package/lib/commonjs/figma/Field.Select.figma.js.map +1 -0
  83. package/lib/commonjs/figma/Heading.figma.js +30 -0
  84. package/lib/commonjs/figma/Heading.figma.js.map +1 -0
  85. package/lib/commonjs/figma/Icon.figma.js +20 -0
  86. package/lib/commonjs/figma/Icon.figma.js.map +1 -0
  87. package/lib/commonjs/figma/IconButton.figma.js +47 -0
  88. package/lib/commonjs/figma/IconButton.figma.js.map +1 -0
  89. package/lib/commonjs/figma/Input.figma.js +52 -0
  90. package/lib/commonjs/figma/Input.figma.js.map +1 -0
  91. package/lib/commonjs/figma/Link.figma.js +30 -0
  92. package/lib/commonjs/figma/Link.figma.js.map +1 -0
  93. package/lib/commonjs/figma/ProgressSegmented.figma.js +39 -0
  94. package/lib/commonjs/figma/ProgressSegmented.figma.js.map +1 -0
  95. package/lib/commonjs/figma/Radio.figma.js +40 -0
  96. package/lib/commonjs/figma/Radio.figma.js.map +1 -0
  97. package/lib/commonjs/figma/Select.figma.js +53 -0
  98. package/lib/commonjs/figma/Select.figma.js.map +1 -0
  99. package/lib/commonjs/figma/Text.figma.js +29 -0
  100. package/lib/commonjs/figma/Text.figma.js.map +1 -0
  101. package/lib/commonjs/figma/icons.figma.batch.js +27 -0
  102. package/lib/commonjs/figma/icons.figma.batch.js.map +1 -0
  103. package/lib/commonjs/figma/icons.figma.batch.json +17705 -0
  104. package/lib/commonjs/metro/withCdxMetroConfig.js +7 -18
  105. package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -1
  106. package/lib/commonjs/metro/withForgeMetroConfig.js +24 -0
  107. package/lib/commonjs/metro/withForgeMetroConfig.js.map +1 -0
  108. package/lib/commonjs/styles/primitives.js +43 -6
  109. package/lib/commonjs/styles/primitives.js.map +1 -1
  110. package/lib/module/components/AlertDialog/index.js +1 -1
  111. package/lib/module/components/AlertDialog/index.js.map +1 -1
  112. package/lib/module/components/Avatar/index.js +1 -1
  113. package/lib/module/components/Avatar/styles.js +36 -29
  114. package/lib/module/components/Avatar/styles.js.map +1 -1
  115. package/lib/module/components/Button/index.js +13 -2
  116. package/lib/module/components/Button/index.js.map +1 -1
  117. package/lib/module/components/Button/styles.js +26 -26
  118. package/lib/module/components/Button/styles.js.map +1 -1
  119. package/lib/module/components/CLAUDE.md +90 -0
  120. package/lib/module/components/Card/index.js +23 -4
  121. package/lib/module/components/Card/index.js.map +1 -1
  122. package/lib/module/components/Card/styles.js +27 -4
  123. package/lib/module/components/Card/styles.js.map +1 -1
  124. package/lib/module/components/Checkbox/index.js +6 -30
  125. package/lib/module/components/Checkbox/index.js.map +1 -1
  126. package/lib/module/components/Checkbox/styles.js +40 -48
  127. package/lib/module/components/Checkbox/styles.js.map +1 -1
  128. package/lib/module/components/Chip/index.js +82 -13
  129. package/lib/module/components/Chip/index.js.map +1 -1
  130. package/lib/module/components/Chip/styles.js +206 -20
  131. package/lib/module/components/Chip/styles.js.map +1 -1
  132. package/lib/module/components/Field/index.js +9 -3
  133. package/lib/module/components/Field/index.js.map +1 -1
  134. package/lib/module/components/Field/styles.js +4 -4
  135. package/lib/module/components/Field/styles.js.map +1 -1
  136. package/lib/module/components/Heading/styles.js +1 -1
  137. package/lib/module/components/Heading/styles.js.map +1 -1
  138. package/lib/module/components/Icon/index.js +3 -4
  139. package/lib/module/components/Icon/index.js.map +1 -1
  140. package/lib/module/components/IconButton/index.js +6 -1
  141. package/lib/module/components/IconButton/index.js.map +1 -1
  142. package/lib/module/components/IconButton/styles.js +135 -10
  143. package/lib/module/components/IconButton/styles.js.map +1 -1
  144. package/lib/module/components/Input/styles.js +7 -6
  145. package/lib/module/components/Input/styles.js.map +1 -1
  146. package/lib/module/components/Link/index.js +25 -6
  147. package/lib/module/components/Link/index.js.map +1 -1
  148. package/lib/module/components/Link/styles.js +55 -6
  149. package/lib/module/components/Link/styles.js.map +1 -1
  150. package/lib/module/components/ListItem/styles.js +10 -10
  151. package/lib/module/components/ListItem/styles.js.map +1 -1
  152. package/lib/module/components/ProgressSegmented/index.js +25 -11
  153. package/lib/module/components/ProgressSegmented/index.js.map +1 -1
  154. package/lib/module/components/Radio/index.js +164 -0
  155. package/lib/module/components/Radio/index.js.map +1 -0
  156. package/lib/module/components/Radio/styles.js +27 -0
  157. package/lib/module/components/Radio/styles.js.map +1 -0
  158. package/lib/module/components/ScopedTheme/index.js +19 -0
  159. package/lib/module/components/ScopedTheme/index.js.map +1 -0
  160. package/lib/module/components/Select/SelectTriggerHost.web.js +4 -0
  161. package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -1
  162. package/lib/module/components/Select/index.js +10 -4
  163. package/lib/module/components/Select/index.js.map +1 -1
  164. package/lib/module/components/Select/styles.js +18 -21
  165. package/lib/module/components/Select/styles.js.map +1 -1
  166. package/lib/module/components/Text/styles.js +2 -2
  167. package/lib/module/components/Text/styles.js.map +1 -1
  168. package/lib/module/components/Tile/index.js +243 -0
  169. package/lib/module/components/Tile/index.js.map +1 -0
  170. package/lib/module/components/Tile/styles.js +48 -0
  171. package/lib/module/components/Tile/styles.js.map +1 -0
  172. package/lib/module/components/index.js +3 -0
  173. package/lib/module/components/index.js.map +1 -1
  174. package/lib/module/figma/Avatar.figma.js +48 -0
  175. package/lib/module/figma/Avatar.figma.js.map +1 -0
  176. package/lib/module/figma/Button.figma.js +28 -15
  177. package/lib/module/figma/Button.figma.js.map +1 -1
  178. package/lib/module/figma/CLAUDE.md +30 -0
  179. package/lib/module/figma/Card.Header.figma.js +22 -0
  180. package/lib/module/figma/Card.Header.figma.js.map +1 -0
  181. package/lib/module/figma/Card.figma.js +36 -0
  182. package/lib/module/figma/Card.figma.js.map +1 -0
  183. package/lib/module/figma/Checkbox.figma.js +49 -0
  184. package/lib/module/figma/Checkbox.figma.js.map +1 -0
  185. package/lib/module/figma/Chip.figma.js +62 -0
  186. package/lib/module/figma/Chip.figma.js.map +1 -0
  187. package/lib/module/figma/Field.Input.figma.js +51 -0
  188. package/lib/module/figma/Field.Input.figma.js.map +1 -0
  189. package/lib/module/figma/Field.Select.figma.js +51 -0
  190. package/lib/module/figma/Field.Select.figma.js.map +1 -0
  191. package/lib/module/figma/Heading.figma.js +24 -0
  192. package/lib/module/figma/Heading.figma.js.map +1 -0
  193. package/lib/module/figma/Icon.figma.js +14 -0
  194. package/lib/module/figma/Icon.figma.js.map +1 -0
  195. package/lib/module/figma/IconButton.figma.js +41 -0
  196. package/lib/module/figma/IconButton.figma.js.map +1 -0
  197. package/lib/module/figma/Input.figma.js +46 -0
  198. package/lib/module/figma/Input.figma.js.map +1 -0
  199. package/lib/module/figma/Link.figma.js +24 -0
  200. package/lib/module/figma/Link.figma.js.map +1 -0
  201. package/lib/module/figma/ProgressSegmented.figma.js +33 -0
  202. package/lib/module/figma/ProgressSegmented.figma.js.map +1 -0
  203. package/lib/module/figma/Radio.figma.js +34 -0
  204. package/lib/module/figma/Radio.figma.js.map +1 -0
  205. package/lib/module/figma/Select.figma.js +47 -0
  206. package/lib/module/figma/Select.figma.js.map +1 -0
  207. package/lib/module/figma/Text.figma.js +23 -0
  208. package/lib/module/figma/Text.figma.js.map +1 -0
  209. package/lib/module/figma/icons.figma.batch.js +22 -0
  210. package/lib/module/figma/icons.figma.batch.js.map +1 -0
  211. package/lib/module/figma/icons.figma.batch.json +17705 -0
  212. package/lib/module/metro/withCdxMetroConfig.js +3 -17
  213. package/lib/module/metro/withCdxMetroConfig.js.map +1 -1
  214. package/lib/module/metro/withForgeMetroConfig.js +20 -0
  215. package/lib/module/metro/withForgeMetroConfig.js.map +1 -0
  216. package/lib/module/styles/primitives.js +43 -6
  217. package/lib/module/styles/primitives.js.map +1 -1
  218. package/lib/typescript/components/Avatar/styles.d.ts +4 -4
  219. package/lib/typescript/components/Avatar/styles.d.ts.map +1 -1
  220. package/lib/typescript/components/Button/index.d.ts +13 -1
  221. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  222. package/lib/typescript/components/Button/styles.d.ts +3 -3
  223. package/lib/typescript/components/Card/index.d.ts +4 -3
  224. package/lib/typescript/components/Card/index.d.ts.map +1 -1
  225. package/lib/typescript/components/Card/styles.d.ts +13 -3
  226. package/lib/typescript/components/Card/styles.d.ts.map +1 -1
  227. package/lib/typescript/components/Checkbox/index.d.ts +1 -2
  228. package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
  229. package/lib/typescript/components/Checkbox/styles.d.ts +4 -14
  230. package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
  231. package/lib/typescript/components/Chip/index.d.ts +19 -6
  232. package/lib/typescript/components/Chip/index.d.ts.map +1 -1
  233. package/lib/typescript/components/Chip/styles.d.ts +13 -4
  234. package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
  235. package/lib/typescript/components/Field/FieldLabel.web.d.ts +2 -2
  236. package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -1
  237. package/lib/typescript/components/Field/index.d.ts.map +1 -1
  238. package/lib/typescript/components/Field/styles.d.ts.map +1 -1
  239. package/lib/typescript/components/Heading/styles.d.ts +1 -1
  240. package/lib/typescript/components/Icon/index.d.ts +5 -5
  241. package/lib/typescript/components/Icon/index.d.ts.map +1 -1
  242. package/lib/typescript/components/IconButton/index.d.ts +3 -3
  243. package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
  244. package/lib/typescript/components/IconButton/styles.d.ts +6 -2
  245. package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
  246. package/lib/typescript/components/Input/styles.d.ts.map +1 -1
  247. package/lib/typescript/components/Link/index.d.ts +2 -2
  248. package/lib/typescript/components/Link/index.d.ts.map +1 -1
  249. package/lib/typescript/components/Link/styles.d.ts +9 -2
  250. package/lib/typescript/components/Link/styles.d.ts.map +1 -1
  251. package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
  252. package/lib/typescript/components/ProgressSegmented/index.d.ts +14 -3
  253. package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -1
  254. package/lib/typescript/components/Radio/index.d.ts +40 -0
  255. package/lib/typescript/components/Radio/index.d.ts.map +1 -0
  256. package/lib/typescript/components/Radio/styles.d.ts +8 -0
  257. package/lib/typescript/components/Radio/styles.d.ts.map +1 -0
  258. package/lib/typescript/components/ScopedTheme/index.d.ts +16 -0
  259. package/lib/typescript/components/ScopedTheme/index.d.ts.map +1 -0
  260. package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +3 -0
  261. package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -1
  262. package/lib/typescript/components/Select/index.d.ts +1 -1
  263. package/lib/typescript/components/Select/index.d.ts.map +1 -1
  264. package/lib/typescript/components/Select/styles.d.ts.map +1 -1
  265. package/lib/typescript/components/Stack/styles.d.ts +2 -2
  266. package/lib/typescript/components/Text/styles.d.ts +1 -1
  267. package/lib/typescript/components/Tile/index.d.ts +70 -0
  268. package/lib/typescript/components/Tile/index.d.ts.map +1 -0
  269. package/lib/typescript/components/Tile/styles.d.ts +18 -0
  270. package/lib/typescript/components/Tile/styles.d.ts.map +1 -0
  271. package/lib/typescript/components/index.d.ts +3 -0
  272. package/lib/typescript/components/index.d.ts.map +1 -1
  273. package/lib/typescript/figma/Avatar.figma.d.ts +8 -0
  274. package/lib/typescript/figma/Avatar.figma.d.ts.map +1 -0
  275. package/lib/typescript/figma/Button.figma.d.ts.map +1 -1
  276. package/lib/typescript/figma/Card.Header.figma.d.ts +8 -0
  277. package/lib/typescript/figma/Card.Header.figma.d.ts.map +1 -0
  278. package/lib/typescript/figma/Card.figma.d.ts +8 -0
  279. package/lib/typescript/figma/Card.figma.d.ts.map +1 -0
  280. package/lib/typescript/figma/Checkbox.figma.d.ts +8 -0
  281. package/lib/typescript/figma/Checkbox.figma.d.ts.map +1 -0
  282. package/lib/typescript/figma/Chip.figma.d.ts +8 -0
  283. package/lib/typescript/figma/Chip.figma.d.ts.map +1 -0
  284. package/lib/typescript/figma/Field.Input.figma.d.ts +8 -0
  285. package/lib/typescript/figma/Field.Input.figma.d.ts.map +1 -0
  286. package/lib/typescript/figma/Field.Select.figma.d.ts +8 -0
  287. package/lib/typescript/figma/Field.Select.figma.d.ts.map +1 -0
  288. package/lib/typescript/figma/Heading.figma.d.ts +8 -0
  289. package/lib/typescript/figma/Heading.figma.d.ts.map +1 -0
  290. package/lib/typescript/figma/Icon.figma.d.ts +8 -0
  291. package/lib/typescript/figma/Icon.figma.d.ts.map +1 -0
  292. package/lib/typescript/figma/IconButton.figma.d.ts +8 -0
  293. package/lib/typescript/figma/IconButton.figma.d.ts.map +1 -0
  294. package/lib/typescript/figma/Input.figma.d.ts +8 -0
  295. package/lib/typescript/figma/Input.figma.d.ts.map +1 -0
  296. package/lib/typescript/figma/Link.figma.d.ts +8 -0
  297. package/lib/typescript/figma/Link.figma.d.ts.map +1 -0
  298. package/lib/typescript/figma/ProgressSegmented.figma.d.ts +8 -0
  299. package/lib/typescript/figma/ProgressSegmented.figma.d.ts.map +1 -0
  300. package/lib/typescript/figma/Radio.figma.d.ts +8 -0
  301. package/lib/typescript/figma/Radio.figma.d.ts.map +1 -0
  302. package/lib/typescript/figma/Select.figma.d.ts +8 -0
  303. package/lib/typescript/figma/Select.figma.d.ts.map +1 -0
  304. package/lib/typescript/figma/Text.figma.d.ts +8 -0
  305. package/lib/typescript/figma/Text.figma.d.ts.map +1 -0
  306. package/lib/typescript/figma/icons.figma.batch.d.ts +14 -0
  307. package/lib/typescript/figma/icons.figma.batch.d.ts.map +1 -0
  308. package/lib/typescript/metro/withCdxMetroConfig.d.ts +4 -18
  309. package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -1
  310. package/lib/typescript/metro/withForgeMetroConfig.d.ts +19 -0
  311. package/lib/typescript/metro/withForgeMetroConfig.d.ts.map +1 -0
  312. package/lib/typescript/styles/primitives.d.ts +38 -0
  313. package/lib/typescript/styles/primitives.d.ts.map +1 -1
  314. package/package.json +8 -8
  315. package/src/components/AlertDialog/index.tsx +1 -1
  316. package/src/components/Avatar/index.tsx +1 -1
  317. package/src/components/Avatar/styles.ts +49 -34
  318. package/src/components/Button/index.tsx +37 -3
  319. package/src/components/Button/styles.ts +27 -27
  320. package/src/components/CLAUDE.md +90 -0
  321. package/src/components/Card/index.tsx +41 -16
  322. package/src/components/Card/styles.ts +42 -15
  323. package/src/components/Checkbox/index.tsx +8 -19
  324. package/src/components/Checkbox/styles.ts +82 -86
  325. package/src/components/Chip/index.tsx +104 -27
  326. package/src/components/Chip/styles.ts +232 -18
  327. package/src/components/Field/FieldLabel.web.tsx +1 -1
  328. package/src/components/Field/index.tsx +10 -3
  329. package/src/components/Field/styles.ts +5 -4
  330. package/src/components/Heading/styles.ts +1 -1
  331. package/src/components/Icon/index.tsx +6 -7
  332. package/src/components/IconButton/index.tsx +7 -6
  333. package/src/components/IconButton/styles.ts +136 -10
  334. package/src/components/Input/styles.ts +15 -9
  335. package/src/components/Link/index.tsx +22 -9
  336. package/src/components/Link/styles.ts +49 -9
  337. package/src/components/ListItem/styles.ts +12 -19
  338. package/src/components/ProgressSegmented/index.tsx +50 -14
  339. package/src/components/Radio/index.tsx +192 -0
  340. package/src/components/Radio/styles.ts +59 -0
  341. package/src/components/ScopedTheme/index.tsx +17 -0
  342. package/src/components/Select/SelectTriggerHost.web.tsx +8 -1
  343. package/src/components/Select/index.tsx +9 -4
  344. package/src/components/Select/styles.ts +49 -51
  345. package/src/components/Text/styles.ts +2 -2
  346. package/src/components/Tile/index.tsx +296 -0
  347. package/src/components/Tile/styles.ts +82 -0
  348. package/src/components/index.ts +3 -0
  349. package/src/metro/withCdxMetroConfig.ts +4 -29
  350. package/src/metro/withForgeMetroConfig.ts +29 -0
  351. package/src/styles/primitives.ts +43 -6
@@ -8,35 +8,133 @@ export const iconButtonRootVariants = cva(
8
8
  'rounded-[var(--border-radius-round)]',
9
9
  'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
10
10
  TRANSITION_COLORS,
11
- 'data-[disabled=true]:opacity-[--opacity-disabled]',
11
+ 'data-[disabled=true]:opacity-[var(--opacity-disabled)]',
12
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',
13
+ 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[var(--color-stroke-ring)] web:data-[focus-visible=true]:ring-offset-2',
14
14
  ],
15
15
  {
16
16
  variants: {
17
17
  variant: {
18
- solid: [
18
+ solid: [],
19
+ tint: [],
20
+ ghost: ['bg-transparent'],
21
+ },
22
+ color: {
23
+ neutral: [],
24
+ action: [],
25
+ danger: [],
26
+ },
27
+ size: {
28
+ default: 'h-11 w-11 min-w-11 shrink-0 p-2.5',
29
+ small: 'h-8 w-8 min-w-8 shrink-0 p-1.5',
30
+ },
31
+ },
32
+ compoundVariants: [
33
+ // ── solid × color ───────────────────────────────────────────────────
34
+ {
35
+ variant: 'solid',
36
+ color: 'neutral',
37
+ className: [
19
38
  'bg-surface-primary border border-stroke-secondary',
20
39
  Platform.select({
21
40
  default: 'data-[active=true]:bg-surface-primary-active',
22
41
  web: 'data-[hover=true]:bg-surface-primary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active',
23
42
  }),
24
43
  ],
25
- ghost: [
26
- 'bg-transparent',
44
+ },
45
+ {
46
+ variant: 'solid',
47
+ color: 'action',
48
+ className: [
49
+ 'bg-surface-action-strong',
50
+ Platform.select({
51
+ default: 'data-[active=true]:bg-surface-action-strong-active',
52
+ web: 'data-[hover=true]:bg-surface-action-strong-hover data-[active=true]:data-[hover=true]:bg-surface-action-strong-active',
53
+ }),
54
+ ],
55
+ },
56
+ {
57
+ variant: 'solid',
58
+ color: 'danger',
59
+ className: [
60
+ 'bg-surface-danger-strong',
61
+ Platform.select({
62
+ default: 'data-[active=true]:bg-surface-danger-strong-active',
63
+ web: 'data-[hover=true]:bg-surface-danger-strong-hover data-[active=true]:data-[hover=true]:bg-surface-danger-strong-active',
64
+ }),
65
+ ],
66
+ },
67
+
68
+ // ── tint × color ─────────────────────────────────────────────────
69
+ {
70
+ variant: 'tint',
71
+ color: 'neutral',
72
+ className: [
73
+ 'bg-surface-neutral-tint',
74
+ Platform.select({
75
+ default: 'data-[active=true]:bg-surface-neutral-tint-active',
76
+ web: 'data-[hover=true]:bg-surface-neutral-tint-hover data-[active=true]:data-[hover=true]:bg-surface-neutral-tint-active',
77
+ }),
78
+ ],
79
+ },
80
+ {
81
+ variant: 'tint',
82
+ color: 'action',
83
+ className: [
84
+ 'bg-surface-action-tint',
85
+ Platform.select({
86
+ default: 'data-[active=true]:bg-surface-action-tint-active',
87
+ web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active',
88
+ }),
89
+ ],
90
+ },
91
+ {
92
+ variant: 'tint',
93
+ color: 'danger',
94
+ className: [
95
+ 'bg-surface-danger-tint',
96
+ Platform.select({
97
+ default: 'data-[active=true]:bg-surface-danger-tint-active',
98
+ web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-tint-active',
99
+ }),
100
+ ],
101
+ },
102
+
103
+ // ── ghost × color ──────────────────────────────────────────────────
104
+ {
105
+ variant: 'ghost',
106
+ color: 'neutral',
107
+ className: [
27
108
  Platform.select({
28
109
  default: 'data-[active=true]:bg-surface-primary-active',
29
110
  web: 'data-[hover=true]:bg-surface-primary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active',
30
111
  }),
31
112
  ],
32
113
  },
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',
114
+ {
115
+ variant: 'ghost',
116
+ color: 'action',
117
+ className: [
118
+ Platform.select({
119
+ default: 'data-[active=true]:bg-surface-action-tint-active',
120
+ web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active',
121
+ }),
122
+ ],
36
123
  },
37
- },
124
+ {
125
+ variant: 'ghost',
126
+ color: 'danger',
127
+ className: [
128
+ Platform.select({
129
+ default: 'data-[active=true]:bg-surface-danger-tint-active',
130
+ web: 'data-[hover=true]:bg-surface-danger-tint-hover data-[active=true]:data-[hover=true]:bg-surface-danger-tint-active',
131
+ }),
132
+ ],
133
+ },
134
+ ],
38
135
  defaultVariants: {
39
136
  variant: 'solid',
137
+ color: 'neutral',
40
138
  size: 'default',
41
139
  },
42
140
  },
@@ -54,6 +152,34 @@ export const iconButtonGlyphVariants = cva([], {
54
152
  },
55
153
  });
56
154
 
57
- export const iconButtonIconColorVariants = cva(['text-content-primary']);
155
+ export const iconButtonIconColorVariants = cva([], {
156
+ variants: {
157
+ variant: {
158
+ solid: [],
159
+ tint: [],
160
+ ghost: [],
161
+ },
162
+ color: {
163
+ neutral: [],
164
+ action: [],
165
+ danger: [],
166
+ },
167
+ },
168
+ compoundVariants: [
169
+ { variant: 'solid', color: 'neutral', className: 'text-content-primary' },
170
+ { variant: 'solid', color: 'action', className: 'text-content-action-on-strong' },
171
+ { variant: 'solid', color: 'danger', className: 'text-content-danger-on-strong' },
172
+ { variant: 'tint', color: 'neutral', className: 'text-content-primary' },
173
+ { variant: 'tint', color: 'action', className: 'text-content-action-on-subtle' },
174
+ { variant: 'tint', color: 'danger', className: 'text-content-danger-on-subtle' },
175
+ { variant: 'ghost', color: 'neutral', className: 'text-content-primary' },
176
+ { variant: 'ghost', color: 'action', className: 'text-content-action' },
177
+ { variant: 'ghost', color: 'danger', className: 'text-content-danger' },
178
+ ],
179
+ defaultVariants: {
180
+ variant: 'solid',
181
+ color: 'neutral',
182
+ },
183
+ });
58
184
 
59
185
  export type IconButtonVariantProps = VariantProps<typeof iconButtonRootVariants>;
@@ -3,13 +3,14 @@ import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
3
3
 
4
4
  export const inputRootVariants = cva(
5
5
  [
6
- 'w-full flex-row items-stretch overflow-hidden',
6
+ 'w-full flex-row items-center overflow-hidden',
7
7
  'bg-surface-primary',
8
- 'border-solid border-[length:var(--border-width-default)] border-stroke-primary',
8
+ 'border-solid border-stroke-primary',
9
+ 'web:border-default native:border-[length:var(--border-width-default)]',
9
10
  'rounded-[var(--border-radius-default)]',
10
11
  TRANSITION_COLORS,
11
12
  'data-[disabled=true]:bg-surface-secondary',
12
- 'data-[disabled=true]:opacity-[--opacity-disabled]',
13
+ 'data-[disabled=true]:opacity-[var(--opacity-disabled)]',
13
14
  DISABLED_CURSOR,
14
15
  'data-[readonly=true]:cursor-default',
15
16
  'data-[readonly=true]:bg-surface-secondary',
@@ -24,11 +25,16 @@ export const inputRootVariants = cva(
24
25
  outline: [],
25
26
  },
26
27
  size: {
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]'],
28
+ default: [
29
+ 'h-11 min-h-11 px-4 py-3 gap-4',
30
+ // Subtract one hairline from padding when focused so the wider focus border doesn’t shift layout.
31
+ 'data-[focus=true]:px-[calc(var(--spacing-4)-var(--spacing-px))]',
32
+ 'data-[focus=true]:py-[calc(var(--spacing-3)-var(--spacing-px))]',
33
+ ],
29
34
  small: [
30
- 'h-8 px-3 py-1.5 gap-1.5',
31
- 'data-[focus=true]:px-[11px] data-[focus=true]:py-[5px]',
35
+ 'h-8 min-h-8 px-3 py-2 gap-1.5',
36
+ 'data-[focus=true]:px-[calc(var(--spacing-3)-var(--spacing-px))]',
37
+ 'data-[focus=true]:py-[calc(var(--spacing-2)-var(--spacing-px))]',
32
38
  ],
33
39
  },
34
40
  },
@@ -42,7 +48,7 @@ export const inputRootVariants = cva(
42
48
  export const inputFieldVariants = cva(
43
49
  [
44
50
  'flex-1 justify-center bg-transparent p-0',
45
- 'font-body text-content-primary',
51
+ 'text-content-primary',
46
52
  'placeholder:text-content-tertiary',
47
53
  'web:outline-none',
48
54
  'tracking-normal',
@@ -60,7 +66,7 @@ export const inputFieldVariants = cva(
60
66
  },
61
67
  );
62
68
 
63
- export const inputSlotVariants = cva(['items-center justify-center self-center']);
69
+ export const inputSlotVariants = cva(['items-center justify-center self-center shrink-0']);
64
70
 
65
71
  export const inputIconVariants = cva(['text-content-tertiary'], {
66
72
  variants: {
@@ -1,9 +1,14 @@
1
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';
2
+ import { Platform, Pressable, Text, View, type TextProps } from 'react-native';
3
+ import { createLink, useLinkInteractionContext, type ILinkProps } from '@cdx-ui/primitives';
4
4
  import { cn } from '@cdx-ui/utils';
5
5
  import { Icon, type IconProps } from '../Icon';
6
- import { linkRootVariants, linkLabelVariants, linkIconVariants } from './styles';
6
+ import {
7
+ linkIconVariants,
8
+ linkLabelVariants,
9
+ linkNativeUnderlineVariants,
10
+ linkRootVariants,
11
+ } from './styles';
7
12
 
8
13
  export { LinkProvider, type LinkConfig, type LinkAction } from '@cdx-ui/primitives';
9
14
 
@@ -40,15 +45,22 @@ export interface LinkLabelProps extends TextProps {
40
45
  children?: ReactNode;
41
46
  }
42
47
 
43
- const LinkLabel = forwardRef<RNText, LinkLabelProps>(
48
+ const LinkLabel = forwardRef<Text, LinkLabelProps>(
44
49
  ({ className, children, style, ...props }, ref) => {
45
- const computedClassName = cn(linkLabelVariants(), className);
50
+ const { visited } = useLinkInteractionContext();
51
+ const computedClassName = cn(linkLabelVariants({ visited }), className);
46
52
 
47
- return (
48
- <RNText ref={ref} className={computedClassName} style={style} {...props}>
53
+ const textElement = (
54
+ <Text ref={ref} className={computedClassName} style={style} {...props}>
49
55
  {children}
50
- </RNText>
56
+ </Text>
51
57
  );
58
+
59
+ if (Platform.OS === 'web') {
60
+ return textElement;
61
+ }
62
+
63
+ return <View className={cn(linkNativeUnderlineVariants({ visited }))}>{textElement}</View>;
52
64
  },
53
65
  );
54
66
 
@@ -61,7 +73,8 @@ LinkLabel.displayName = 'Link.Label';
61
73
  export interface LinkIconProps extends Omit<IconProps, 'children'> {}
62
74
 
63
75
  const LinkIcon = ({ className, style, as, ...props }: LinkIconProps) => {
64
- const computedClassName = cn(linkIconVariants(), className);
76
+ const { visited } = useLinkInteractionContext();
77
+ const computedClassName = cn(linkIconVariants({ visited }), className);
65
78
 
66
79
  return <Icon as={as} className={computedClassName} style={style} {...props} />;
67
80
  };
@@ -1,21 +1,61 @@
1
+ import { Platform } from 'react-native';
1
2
  import { cva, type VariantProps } from 'class-variance-authority';
2
3
  import { TRANSITION_COLORS } from '../../styles/primitives';
3
4
 
4
- // TODO: Handle visited state
5
-
6
5
  export const linkRootVariants = cva([
7
6
  'flex-row items-center gap-1',
8
- 'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
7
+ Platform.select({ web: 'web:inline-flex web:self-start', default: '' }),
9
8
  TRANSITION_COLORS,
9
+ 'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
10
+ 'web:data-[focus-visible=true]:rounded-[2px]',
10
11
  'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2',
12
+ // Web: set color on the anchor so Label/Icon can text-inherit (incl. browser :visited).
13
+ 'web:text-content-link',
14
+ 'web:visited:text-content-link-visited',
15
+ 'web:hover:text-content-primary',
16
+ 'web:visited:hover:text-content-primary',
17
+ 'data-[visited=true]:text-content-link-visited',
18
+ 'web:data-[hover=true]:text-content-primary',
11
19
  ]);
12
20
 
13
- export const linkLabelVariants = cva([
14
- 'text-content-link',
15
- 'body-md',
16
- 'underline underline-offset-4',
17
- ]);
21
+ export const linkLabelVariants = cva(
22
+ [
23
+ 'body-md',
24
+ Platform.select({ web: 'underline underline-offset-4', default: '' }),
25
+ Platform.select({ web: 'text-inherit', default: 'text-content-link' }),
26
+ ],
27
+ {
28
+ variants: {
29
+ visited: {
30
+ true: Platform.select({ web: '', default: 'text-content-link-visited' }),
31
+ false: '',
32
+ },
33
+ },
34
+ defaultVariants: { visited: false },
35
+ },
36
+ );
37
+
38
+ export const linkNativeUnderlineVariants = cva(['border-b border-content-link pb-0.5'], {
39
+ variants: {
40
+ visited: {
41
+ true: 'border-content-link-visited',
42
+ false: '',
43
+ },
44
+ },
45
+ defaultVariants: { visited: false },
46
+ });
18
47
 
19
- export const linkIconVariants = cva(['text-content-link', 'size-4']);
48
+ export const linkIconVariants = cva(
49
+ ['size-4', Platform.select({ web: 'text-inherit', default: 'text-content-link' })],
50
+ {
51
+ variants: {
52
+ visited: {
53
+ true: Platform.select({ web: '', default: 'text-content-link-visited' }),
54
+ false: '',
55
+ },
56
+ },
57
+ defaultVariants: { visited: false },
58
+ },
59
+ );
20
60
 
21
61
  export type LinkVariantProps = VariantProps<typeof linkLabelVariants>;
@@ -1,12 +1,6 @@
1
1
  import { Platform } from 'react-native';
2
2
  import { cva, type VariantProps } from 'class-variance-authority';
3
- import {
4
- COLOR_BORDER_DEFAULT,
5
- COLOR_TEXT_MUTED,
6
- COLOR_TEXT_PRIMARY,
7
- COLOR_TEXT_SECONDARY,
8
- TRANSITION_COLORS,
9
- } from '../../styles/primitives';
3
+ import { TRANSITION_COLORS } from '../../styles/primitives';
10
4
 
11
5
  // ── Root (row): density, surface, separator, interactive feedback ──────────
12
6
 
@@ -19,7 +13,7 @@ export const listItemRootVariants = cva(
19
13
  Platform.select({
20
14
  web: [
21
15
  'outline-none',
22
- 'web:data-[hovered=true]:bg-slate-50',
16
+ 'web:data-[hover=true]:bg-slate-50',
23
17
  'web:focus-visible:data-[disabled=false]:bg-slate-50',
24
18
  'web:focus-visible:data-[disabled=false]:ring-2 web:focus-visible:data-[disabled=false]:ring-slate-400/40 web:focus-visible:data-[disabled=false]:ring-offset-2',
25
19
  ].join(' '),
@@ -37,7 +31,7 @@ export const listItemRootVariants = cva(
37
31
  negative: 'bg-red-50',
38
32
  },
39
33
  showSeparator: {
40
- true: ['border-b border-solid', COLOR_BORDER_DEFAULT],
34
+ true: 'border-b border-solid border-stroke-secondary',
41
35
  false: 'border-b-0',
42
36
  },
43
37
  crossAlign: {
@@ -49,7 +43,7 @@ export const listItemRootVariants = cva(
49
43
  {
50
44
  surface: 'negative',
51
45
  className: Platform.select({
52
- web: 'web:data-[hovered=true]:bg-red-100/90',
46
+ web: 'web:data-[hover=true]:bg-red-100/90',
53
47
  default: '',
54
48
  }),
55
49
  },
@@ -81,7 +75,7 @@ export const listItemTrailingSlotVariants = cva(['flex shrink-0 flex-row justify
81
75
 
82
76
  // ── Content stack (title / description / meta) ───────────────────────────────
83
77
 
84
- export const listItemContentVariants = cva(['flex min-w-0 flex-1 flex-col gap-1'], {
78
+ export const listItemContentVariants = cva('flex min-w-0 flex-1 flex-col gap-1', {
85
79
  variants: {
86
80
  crossAlign: {
87
81
  center: 'justify-center',
@@ -95,7 +89,7 @@ export const listItemContentVariants = cva(['flex min-w-0 flex-1 flex-col gap-1'
95
89
 
96
90
  // ── Typography ───────────────────────────────────────────────────────────────
97
91
 
98
- export const listItemTitleVariants = cva([COLOR_TEXT_PRIMARY, 'font-medium'], {
92
+ export const listItemTitleVariants = cva('text-content-primary font-medium', {
99
93
  variants: {
100
94
  size: {
101
95
  default: 'text-base leading-snug',
@@ -107,7 +101,7 @@ export const listItemTitleVariants = cva([COLOR_TEXT_PRIMARY, 'font-medium'], {
107
101
  },
108
102
  });
109
103
 
110
- export const listItemDescriptionVariants = cva([COLOR_TEXT_SECONDARY], {
104
+ export const listItemDescriptionVariants = cva('text-content-secondary', {
111
105
  variants: {
112
106
  size: {
113
107
  default: 'text-sm leading-normal',
@@ -119,7 +113,7 @@ export const listItemDescriptionVariants = cva([COLOR_TEXT_SECONDARY], {
119
113
  },
120
114
  });
121
115
 
122
- export const listItemMetaVariants = cva([COLOR_TEXT_MUTED], {
116
+ export const listItemMetaVariants = cva('text-content-tertiary', {
123
117
  variants: {
124
118
  size: {
125
119
  default: 'text-xs leading-normal',
@@ -136,7 +130,7 @@ export const listItemMetaVariants = cva([COLOR_TEXT_MUTED], {
136
130
  export const listItemSectionHeaderVariants = cva(
137
131
  [
138
132
  'flex-row items-center justify-between gap-2 border-b border-solid px-4 py-3',
139
- COLOR_BORDER_DEFAULT,
133
+ 'border-stroke-secondary',
140
134
  ],
141
135
  {
142
136
  variants: {
@@ -152,9 +146,8 @@ export const listItemSectionHeaderVariants = cva(
152
146
  );
153
147
 
154
148
  /** Default section-title typography; applied by `ListItem.SectionHeader` for string/number children. Exported for rare custom composition. */
155
- export const listItemSectionHeaderLabelVariants = cva([
156
- 'text-xs font-semibold uppercase tracking-wide',
157
- COLOR_TEXT_SECONDARY,
158
- ]);
149
+ export const listItemSectionHeaderLabelVariants = cva(
150
+ 'text-xs font-semibold uppercase tracking-wide text-content-secondary',
151
+ );
159
152
 
160
153
  export type ListItemVariantProps = VariantProps<typeof listItemRootVariants>;
@@ -1,4 +1,4 @@
1
- import { forwardRef, useMemo } from 'react';
1
+ import { forwardRef, useEffect, useMemo } from 'react';
2
2
  import { View, type ViewProps } from 'react-native';
3
3
  import { cn } from '@cdx-ui/utils';
4
4
  import {
@@ -7,15 +7,32 @@ import {
7
7
  type ProgressSegmentedVariants,
8
8
  } from './styles';
9
9
 
10
+ /* `ProgressSegmentedProps.total` remains in the public API until the next major release. */
11
+ /* eslint-disable @typescript-eslint/no-deprecated */
10
12
  export interface ProgressSegmentedProps extends ViewProps, ProgressSegmentedVariants {
11
13
  /** Current step (1-based index into the segment count) */
12
14
  readonly step: number;
13
- /** Total number of segments */
15
+ /**
16
+ * Number of segments in the bar. Matches the Figma `segments` variant (2–6 in the design
17
+ * system file); the prop accepts any positive integer for backward compatibility.
18
+ */
19
+ readonly segments?: number;
20
+ /**
21
+ * @deprecated Use {@link ProgressSegmentedProps.segments} instead. This alias will be removed
22
+ * in a future major release.
23
+ */
14
24
  readonly total?: number;
15
25
  /** When true, the current step segment is marked as complete rather than in-progress */
16
26
  readonly isStepComplete?: boolean;
17
- /** Returns the accessibility value text announced by screen readers. Receives the clamped step, total, and whether the step is complete. */
18
- readonly getAccessibilityText?: (step: number, total: number, isStepComplete: boolean) => string;
27
+ /**
28
+ * Returns the accessibility value text announced by screen readers. Receives the clamped
29
+ * step, segment count, and whether the step is complete.
30
+ */
31
+ readonly getAccessibilityText?: (
32
+ step: number,
33
+ segmentCount: number,
34
+ isStepComplete: boolean,
35
+ ) => string;
19
36
  readonly className?: string;
20
37
  }
21
38
 
@@ -23,7 +40,8 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
23
40
  (
24
41
  {
25
42
  step,
26
- total = 5,
43
+ segments,
44
+ total,
27
45
  isStepComplete = false,
28
46
  getAccessibilityText,
29
47
  className,
@@ -32,10 +50,26 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
32
50
  },
33
51
  ref,
34
52
  ) => {
35
- const clampedStep = Math.max(0, Math.min(step, total));
53
+ const segmentCount = segments ?? total ?? 5;
36
54
 
37
- const segments = useMemo(() => {
38
- return Array.from({ length: total }, (_, index) => {
55
+ // TODO: Remove this once the `total` prop is removed.
56
+ useEffect(() => {
57
+ if (
58
+ typeof process !== 'undefined' &&
59
+ process.env.NODE_ENV !== 'production' &&
60
+ total !== undefined &&
61
+ segments === undefined
62
+ ) {
63
+ console.warn(
64
+ '[ProgressSegmented] The `total` prop is deprecated and will be removed in a future major release. Use `segments` instead.',
65
+ );
66
+ }
67
+ }, [total, segments]);
68
+
69
+ const clampedStep = Math.max(0, Math.min(step, segmentCount));
70
+
71
+ const segmentStates = useMemo(() => {
72
+ return Array.from({ length: segmentCount }, (_, index) => {
39
73
  const segmentIndex = index + 1;
40
74
  let state: 'complete' | 'incomplete' | 'inprogress' = 'incomplete';
41
75
 
@@ -47,13 +81,13 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
47
81
 
48
82
  return state;
49
83
  });
50
- }, [total, clampedStep, isStepComplete]);
84
+ }, [segmentCount, clampedStep, isStepComplete]);
51
85
 
52
- let accessibilityText = `Step ${String(clampedStep)} of ${String(total)}`;
86
+ let accessibilityText = `Step ${String(clampedStep)} of ${String(segmentCount)}`;
53
87
  if (getAccessibilityText) {
54
- accessibilityText = getAccessibilityText(clampedStep, total, isStepComplete);
88
+ accessibilityText = getAccessibilityText(clampedStep, segmentCount, isStepComplete);
55
89
  } else if (isStepComplete) {
56
- accessibilityText = `Step ${String(clampedStep)} of ${String(total)}, completed`;
90
+ accessibilityText = `Step ${String(clampedStep)} of ${String(segmentCount)}, completed`;
57
91
  }
58
92
 
59
93
  return (
@@ -63,14 +97,14 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
63
97
  accessibilityLabel={accessibilityLabel}
64
98
  accessibilityValue={{
65
99
  min: 0,
66
- max: total,
100
+ max: segmentCount,
67
101
  now: clampedStep,
68
102
  text: accessibilityText,
69
103
  }}
70
104
  className={cn(progressSegmentedVariants(), className)}
71
105
  {...props}
72
106
  >
73
- {segments.map((state, index) => (
107
+ {segmentStates.map((state, index) => (
74
108
  <View key={index} className={cn(segmentVariants({ state }))} />
75
109
  ))}
76
110
  </View>
@@ -79,3 +113,5 @@ export const ProgressSegmented = forwardRef<View, ProgressSegmentedProps>(
79
113
  );
80
114
 
81
115
  ProgressSegmented.displayName = 'ProgressSegmented';
116
+
117
+ /* eslint-enable @typescript-eslint/no-deprecated */