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

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 (401) 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 +16 -1
  8. package/lib/commonjs/components/Button/index.js.map +1 -1
  9. package/lib/commonjs/components/Button/styles.js +85 -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/hooks/index.js +19 -0
  105. package/lib/commonjs/hooks/index.js.map +1 -0
  106. package/lib/commonjs/hooks/useForgeBottomTabScreenOptions.js +246 -0
  107. package/lib/commonjs/hooks/useForgeBottomTabScreenOptions.js.map +1 -0
  108. package/lib/commonjs/index.js +24 -0
  109. package/lib/commonjs/index.js.map +1 -1
  110. package/lib/commonjs/metro/withCdxMetroConfig.js +7 -18
  111. package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -1
  112. package/lib/commonjs/metro/withForgeMetroConfig.js +24 -0
  113. package/lib/commonjs/metro/withForgeMetroConfig.js.map +1 -0
  114. package/lib/commonjs/navigation/forgeTabIcon.js +43 -0
  115. package/lib/commonjs/navigation/forgeTabIcon.js.map +1 -0
  116. package/lib/commonjs/navigation/forgeTabIcon.native.js +35 -0
  117. package/lib/commonjs/navigation/forgeTabIcon.native.js.map +1 -0
  118. package/lib/commonjs/navigation/index.js +13 -0
  119. package/lib/commonjs/navigation/index.js.map +1 -0
  120. package/lib/commonjs/navigation/types.js +40 -0
  121. package/lib/commonjs/navigation/types.js.map +1 -0
  122. package/lib/commonjs/styles/primitives.js +43 -6
  123. package/lib/commonjs/styles/primitives.js.map +1 -1
  124. package/lib/module/components/AlertDialog/index.js +1 -1
  125. package/lib/module/components/AlertDialog/index.js.map +1 -1
  126. package/lib/module/components/Avatar/index.js +1 -1
  127. package/lib/module/components/Avatar/styles.js +36 -29
  128. package/lib/module/components/Avatar/styles.js.map +1 -1
  129. package/lib/module/components/Button/index.js +17 -2
  130. package/lib/module/components/Button/index.js.map +1 -1
  131. package/lib/module/components/Button/styles.js +85 -26
  132. package/lib/module/components/Button/styles.js.map +1 -1
  133. package/lib/module/components/CLAUDE.md +90 -0
  134. package/lib/module/components/Card/index.js +23 -4
  135. package/lib/module/components/Card/index.js.map +1 -1
  136. package/lib/module/components/Card/styles.js +27 -4
  137. package/lib/module/components/Card/styles.js.map +1 -1
  138. package/lib/module/components/Checkbox/index.js +6 -30
  139. package/lib/module/components/Checkbox/index.js.map +1 -1
  140. package/lib/module/components/Checkbox/styles.js +40 -48
  141. package/lib/module/components/Checkbox/styles.js.map +1 -1
  142. package/lib/module/components/Chip/index.js +82 -13
  143. package/lib/module/components/Chip/index.js.map +1 -1
  144. package/lib/module/components/Chip/styles.js +206 -20
  145. package/lib/module/components/Chip/styles.js.map +1 -1
  146. package/lib/module/components/Field/index.js +9 -3
  147. package/lib/module/components/Field/index.js.map +1 -1
  148. package/lib/module/components/Field/styles.js +4 -4
  149. package/lib/module/components/Field/styles.js.map +1 -1
  150. package/lib/module/components/Heading/styles.js +1 -1
  151. package/lib/module/components/Heading/styles.js.map +1 -1
  152. package/lib/module/components/Icon/index.js +3 -4
  153. package/lib/module/components/Icon/index.js.map +1 -1
  154. package/lib/module/components/IconButton/index.js +6 -1
  155. package/lib/module/components/IconButton/index.js.map +1 -1
  156. package/lib/module/components/IconButton/styles.js +135 -10
  157. package/lib/module/components/IconButton/styles.js.map +1 -1
  158. package/lib/module/components/Input/styles.js +7 -6
  159. package/lib/module/components/Input/styles.js.map +1 -1
  160. package/lib/module/components/Link/index.js +25 -6
  161. package/lib/module/components/Link/index.js.map +1 -1
  162. package/lib/module/components/Link/styles.js +55 -6
  163. package/lib/module/components/Link/styles.js.map +1 -1
  164. package/lib/module/components/ListItem/styles.js +10 -10
  165. package/lib/module/components/ListItem/styles.js.map +1 -1
  166. package/lib/module/components/ProgressSegmented/index.js +25 -11
  167. package/lib/module/components/ProgressSegmented/index.js.map +1 -1
  168. package/lib/module/components/Radio/index.js +164 -0
  169. package/lib/module/components/Radio/index.js.map +1 -0
  170. package/lib/module/components/Radio/styles.js +27 -0
  171. package/lib/module/components/Radio/styles.js.map +1 -0
  172. package/lib/module/components/ScopedTheme/index.js +19 -0
  173. package/lib/module/components/ScopedTheme/index.js.map +1 -0
  174. package/lib/module/components/Select/SelectTriggerHost.web.js +4 -0
  175. package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -1
  176. package/lib/module/components/Select/index.js +10 -4
  177. package/lib/module/components/Select/index.js.map +1 -1
  178. package/lib/module/components/Select/styles.js +18 -21
  179. package/lib/module/components/Select/styles.js.map +1 -1
  180. package/lib/module/components/Text/styles.js +2 -2
  181. package/lib/module/components/Text/styles.js.map +1 -1
  182. package/lib/module/components/Tile/index.js +243 -0
  183. package/lib/module/components/Tile/index.js.map +1 -0
  184. package/lib/module/components/Tile/styles.js +48 -0
  185. package/lib/module/components/Tile/styles.js.map +1 -0
  186. package/lib/module/components/index.js +3 -0
  187. package/lib/module/components/index.js.map +1 -1
  188. package/lib/module/figma/Avatar.figma.js +48 -0
  189. package/lib/module/figma/Avatar.figma.js.map +1 -0
  190. package/lib/module/figma/Button.figma.js +28 -15
  191. package/lib/module/figma/Button.figma.js.map +1 -1
  192. package/lib/module/figma/CLAUDE.md +30 -0
  193. package/lib/module/figma/Card.Header.figma.js +22 -0
  194. package/lib/module/figma/Card.Header.figma.js.map +1 -0
  195. package/lib/module/figma/Card.figma.js +36 -0
  196. package/lib/module/figma/Card.figma.js.map +1 -0
  197. package/lib/module/figma/Checkbox.figma.js +49 -0
  198. package/lib/module/figma/Checkbox.figma.js.map +1 -0
  199. package/lib/module/figma/Chip.figma.js +62 -0
  200. package/lib/module/figma/Chip.figma.js.map +1 -0
  201. package/lib/module/figma/Field.Input.figma.js +51 -0
  202. package/lib/module/figma/Field.Input.figma.js.map +1 -0
  203. package/lib/module/figma/Field.Select.figma.js +51 -0
  204. package/lib/module/figma/Field.Select.figma.js.map +1 -0
  205. package/lib/module/figma/Heading.figma.js +24 -0
  206. package/lib/module/figma/Heading.figma.js.map +1 -0
  207. package/lib/module/figma/Icon.figma.js +14 -0
  208. package/lib/module/figma/Icon.figma.js.map +1 -0
  209. package/lib/module/figma/IconButton.figma.js +41 -0
  210. package/lib/module/figma/IconButton.figma.js.map +1 -0
  211. package/lib/module/figma/Input.figma.js +46 -0
  212. package/lib/module/figma/Input.figma.js.map +1 -0
  213. package/lib/module/figma/Link.figma.js +24 -0
  214. package/lib/module/figma/Link.figma.js.map +1 -0
  215. package/lib/module/figma/ProgressSegmented.figma.js +33 -0
  216. package/lib/module/figma/ProgressSegmented.figma.js.map +1 -0
  217. package/lib/module/figma/Radio.figma.js +34 -0
  218. package/lib/module/figma/Radio.figma.js.map +1 -0
  219. package/lib/module/figma/Select.figma.js +47 -0
  220. package/lib/module/figma/Select.figma.js.map +1 -0
  221. package/lib/module/figma/Text.figma.js +23 -0
  222. package/lib/module/figma/Text.figma.js.map +1 -0
  223. package/lib/module/figma/icons.figma.batch.js +22 -0
  224. package/lib/module/figma/icons.figma.batch.js.map +1 -0
  225. package/lib/module/figma/icons.figma.batch.json +17705 -0
  226. package/lib/module/hooks/index.js +4 -0
  227. package/lib/module/hooks/index.js.map +1 -0
  228. package/lib/module/hooks/useForgeBottomTabScreenOptions.js +242 -0
  229. package/lib/module/hooks/useForgeBottomTabScreenOptions.js.map +1 -0
  230. package/lib/module/index.js +2 -0
  231. package/lib/module/index.js.map +1 -1
  232. package/lib/module/metro/withCdxMetroConfig.js +3 -17
  233. package/lib/module/metro/withCdxMetroConfig.js.map +1 -1
  234. package/lib/module/metro/withForgeMetroConfig.js +20 -0
  235. package/lib/module/metro/withForgeMetroConfig.js.map +1 -0
  236. package/lib/module/navigation/forgeTabIcon.js +39 -0
  237. package/lib/module/navigation/forgeTabIcon.js.map +1 -0
  238. package/lib/module/navigation/forgeTabIcon.native.js +31 -0
  239. package/lib/module/navigation/forgeTabIcon.native.js.map +1 -0
  240. package/lib/module/navigation/index.js +4 -0
  241. package/lib/module/navigation/index.js.map +1 -0
  242. package/lib/module/navigation/types.js +38 -0
  243. package/lib/module/navigation/types.js.map +1 -0
  244. package/lib/module/styles/primitives.js +43 -6
  245. package/lib/module/styles/primitives.js.map +1 -1
  246. package/lib/typescript/components/Avatar/styles.d.ts +4 -4
  247. package/lib/typescript/components/Avatar/styles.d.ts.map +1 -1
  248. package/lib/typescript/components/Button/index.d.ts +13 -1
  249. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  250. package/lib/typescript/components/Button/styles.d.ts +5 -3
  251. package/lib/typescript/components/Button/styles.d.ts.map +1 -1
  252. package/lib/typescript/components/Card/index.d.ts +4 -3
  253. package/lib/typescript/components/Card/index.d.ts.map +1 -1
  254. package/lib/typescript/components/Card/styles.d.ts +13 -3
  255. package/lib/typescript/components/Card/styles.d.ts.map +1 -1
  256. package/lib/typescript/components/Checkbox/index.d.ts +1 -2
  257. package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
  258. package/lib/typescript/components/Checkbox/styles.d.ts +4 -14
  259. package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
  260. package/lib/typescript/components/Chip/index.d.ts +19 -6
  261. package/lib/typescript/components/Chip/index.d.ts.map +1 -1
  262. package/lib/typescript/components/Chip/styles.d.ts +13 -4
  263. package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
  264. package/lib/typescript/components/Field/FieldLabel.web.d.ts +2 -2
  265. package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -1
  266. package/lib/typescript/components/Field/index.d.ts.map +1 -1
  267. package/lib/typescript/components/Field/styles.d.ts.map +1 -1
  268. package/lib/typescript/components/Heading/styles.d.ts +1 -1
  269. package/lib/typescript/components/Icon/index.d.ts +5 -5
  270. package/lib/typescript/components/Icon/index.d.ts.map +1 -1
  271. package/lib/typescript/components/IconButton/index.d.ts +3 -3
  272. package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
  273. package/lib/typescript/components/IconButton/styles.d.ts +6 -2
  274. package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
  275. package/lib/typescript/components/Input/styles.d.ts.map +1 -1
  276. package/lib/typescript/components/Link/index.d.ts +2 -2
  277. package/lib/typescript/components/Link/index.d.ts.map +1 -1
  278. package/lib/typescript/components/Link/styles.d.ts +9 -2
  279. package/lib/typescript/components/Link/styles.d.ts.map +1 -1
  280. package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
  281. package/lib/typescript/components/ProgressSegmented/index.d.ts +14 -3
  282. package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -1
  283. package/lib/typescript/components/Radio/index.d.ts +40 -0
  284. package/lib/typescript/components/Radio/index.d.ts.map +1 -0
  285. package/lib/typescript/components/Radio/styles.d.ts +8 -0
  286. package/lib/typescript/components/Radio/styles.d.ts.map +1 -0
  287. package/lib/typescript/components/ScopedTheme/index.d.ts +16 -0
  288. package/lib/typescript/components/ScopedTheme/index.d.ts.map +1 -0
  289. package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +3 -0
  290. package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -1
  291. package/lib/typescript/components/Select/index.d.ts +1 -1
  292. package/lib/typescript/components/Select/index.d.ts.map +1 -1
  293. package/lib/typescript/components/Select/styles.d.ts.map +1 -1
  294. package/lib/typescript/components/Stack/styles.d.ts +2 -2
  295. package/lib/typescript/components/Text/styles.d.ts +1 -1
  296. package/lib/typescript/components/Tile/index.d.ts +70 -0
  297. package/lib/typescript/components/Tile/index.d.ts.map +1 -0
  298. package/lib/typescript/components/Tile/styles.d.ts +18 -0
  299. package/lib/typescript/components/Tile/styles.d.ts.map +1 -0
  300. package/lib/typescript/components/index.d.ts +3 -0
  301. package/lib/typescript/components/index.d.ts.map +1 -1
  302. package/lib/typescript/figma/Avatar.figma.d.ts +8 -0
  303. package/lib/typescript/figma/Avatar.figma.d.ts.map +1 -0
  304. package/lib/typescript/figma/Button.figma.d.ts.map +1 -1
  305. package/lib/typescript/figma/Card.Header.figma.d.ts +8 -0
  306. package/lib/typescript/figma/Card.Header.figma.d.ts.map +1 -0
  307. package/lib/typescript/figma/Card.figma.d.ts +8 -0
  308. package/lib/typescript/figma/Card.figma.d.ts.map +1 -0
  309. package/lib/typescript/figma/Checkbox.figma.d.ts +8 -0
  310. package/lib/typescript/figma/Checkbox.figma.d.ts.map +1 -0
  311. package/lib/typescript/figma/Chip.figma.d.ts +8 -0
  312. package/lib/typescript/figma/Chip.figma.d.ts.map +1 -0
  313. package/lib/typescript/figma/Field.Input.figma.d.ts +8 -0
  314. package/lib/typescript/figma/Field.Input.figma.d.ts.map +1 -0
  315. package/lib/typescript/figma/Field.Select.figma.d.ts +8 -0
  316. package/lib/typescript/figma/Field.Select.figma.d.ts.map +1 -0
  317. package/lib/typescript/figma/Heading.figma.d.ts +8 -0
  318. package/lib/typescript/figma/Heading.figma.d.ts.map +1 -0
  319. package/lib/typescript/figma/Icon.figma.d.ts +8 -0
  320. package/lib/typescript/figma/Icon.figma.d.ts.map +1 -0
  321. package/lib/typescript/figma/IconButton.figma.d.ts +8 -0
  322. package/lib/typescript/figma/IconButton.figma.d.ts.map +1 -0
  323. package/lib/typescript/figma/Input.figma.d.ts +8 -0
  324. package/lib/typescript/figma/Input.figma.d.ts.map +1 -0
  325. package/lib/typescript/figma/Link.figma.d.ts +8 -0
  326. package/lib/typescript/figma/Link.figma.d.ts.map +1 -0
  327. package/lib/typescript/figma/ProgressSegmented.figma.d.ts +8 -0
  328. package/lib/typescript/figma/ProgressSegmented.figma.d.ts.map +1 -0
  329. package/lib/typescript/figma/Radio.figma.d.ts +8 -0
  330. package/lib/typescript/figma/Radio.figma.d.ts.map +1 -0
  331. package/lib/typescript/figma/Select.figma.d.ts +8 -0
  332. package/lib/typescript/figma/Select.figma.d.ts.map +1 -0
  333. package/lib/typescript/figma/Text.figma.d.ts +8 -0
  334. package/lib/typescript/figma/Text.figma.d.ts.map +1 -0
  335. package/lib/typescript/figma/icons.figma.batch.d.ts +14 -0
  336. package/lib/typescript/figma/icons.figma.batch.d.ts.map +1 -0
  337. package/lib/typescript/hooks/index.d.ts +2 -0
  338. package/lib/typescript/hooks/index.d.ts.map +1 -0
  339. package/lib/typescript/hooks/useForgeBottomTabScreenOptions.d.ts +137 -0
  340. package/lib/typescript/hooks/useForgeBottomTabScreenOptions.d.ts.map +1 -0
  341. package/lib/typescript/index.d.ts +2 -0
  342. package/lib/typescript/index.d.ts.map +1 -1
  343. package/lib/typescript/metro/withCdxMetroConfig.d.ts +4 -18
  344. package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -1
  345. package/lib/typescript/metro/withForgeMetroConfig.d.ts +19 -0
  346. package/lib/typescript/metro/withForgeMetroConfig.d.ts.map +1 -0
  347. package/lib/typescript/navigation/forgeTabIcon.d.ts +27 -0
  348. package/lib/typescript/navigation/forgeTabIcon.d.ts.map +1 -0
  349. package/lib/typescript/navigation/forgeTabIcon.native.d.ts +15 -0
  350. package/lib/typescript/navigation/forgeTabIcon.native.d.ts.map +1 -0
  351. package/lib/typescript/navigation/index.d.ts +4 -0
  352. package/lib/typescript/navigation/index.d.ts.map +1 -0
  353. package/lib/typescript/navigation/types.d.ts +37 -0
  354. package/lib/typescript/navigation/types.d.ts.map +1 -0
  355. package/lib/typescript/styles/primitives.d.ts +38 -0
  356. package/lib/typescript/styles/primitives.d.ts.map +1 -1
  357. package/package.json +10 -8
  358. package/src/components/AlertDialog/index.tsx +1 -1
  359. package/src/components/Avatar/index.tsx +1 -1
  360. package/src/components/Avatar/styles.ts +49 -34
  361. package/src/components/Button/index.tsx +39 -5
  362. package/src/components/Button/styles.ts +56 -27
  363. package/src/components/CLAUDE.md +90 -0
  364. package/src/components/Card/index.tsx +41 -16
  365. package/src/components/Card/styles.ts +42 -15
  366. package/src/components/Checkbox/index.tsx +8 -19
  367. package/src/components/Checkbox/styles.ts +82 -86
  368. package/src/components/Chip/index.tsx +104 -27
  369. package/src/components/Chip/styles.ts +232 -18
  370. package/src/components/Field/FieldLabel.web.tsx +1 -1
  371. package/src/components/Field/index.tsx +10 -3
  372. package/src/components/Field/styles.ts +5 -4
  373. package/src/components/Heading/styles.ts +1 -1
  374. package/src/components/Icon/index.tsx +6 -7
  375. package/src/components/IconButton/index.tsx +7 -6
  376. package/src/components/IconButton/styles.ts +136 -10
  377. package/src/components/Input/styles.ts +15 -9
  378. package/src/components/Link/index.tsx +22 -9
  379. package/src/components/Link/styles.ts +49 -9
  380. package/src/components/ListItem/styles.ts +12 -19
  381. package/src/components/ProgressSegmented/index.tsx +50 -14
  382. package/src/components/Radio/index.tsx +192 -0
  383. package/src/components/Radio/styles.ts +59 -0
  384. package/src/components/ScopedTheme/index.tsx +17 -0
  385. package/src/components/Select/SelectTriggerHost.web.tsx +8 -1
  386. package/src/components/Select/index.tsx +9 -4
  387. package/src/components/Select/styles.ts +49 -51
  388. package/src/components/Text/styles.ts +2 -2
  389. package/src/components/Tile/index.tsx +296 -0
  390. package/src/components/Tile/styles.ts +82 -0
  391. package/src/components/index.ts +3 -0
  392. package/src/hooks/index.ts +5 -0
  393. package/src/hooks/useForgeBottomTabScreenOptions.ts +245 -0
  394. package/src/index.ts +2 -0
  395. package/src/metro/withCdxMetroConfig.ts +4 -29
  396. package/src/metro/withForgeMetroConfig.ts +29 -0
  397. package/src/navigation/forgeTabIcon.native.ts +36 -0
  398. package/src/navigation/forgeTabIcon.ts +33 -0
  399. package/src/navigation/index.ts +3 -0
  400. package/src/navigation/types.ts +55 -0
  401. package/src/styles/primitives.ts +43 -6
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+
3
+ import { forwardRef } from 'react';
4
+ import { Pressable, Text, View } from 'react-native';
5
+ import { createTile, useTileContext } from '@cdx-ui/primitives';
6
+ import { Check } from '@cdx-ui/icons';
7
+ import { dataAttributes } from '@cdx-ui/primitives';
8
+ import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
9
+ import { checkboxIndicatorVariants, checkboxIconVariants } from '../Checkbox/styles';
10
+ import { Icon } from '../Icon';
11
+ import { radioIndicatorVariants, radioInnerDotVariants } from '../Radio/styles';
12
+ import { tileContentVariants, tileDescriptionVariants, tileGroupVariants, tileIndicatorVariants, tileLeadingSlotVariants, tileRootVariants, tileTitleVariants, tileTrailingSlotVariants } from './styles';
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ const TILE_SCOPE = 'TILE';
15
+ const TILE_GROUP_SCOPE = 'TILE_GROUP';
16
+ const RootPressable = withStyleContext(Pressable, TILE_SCOPE);
17
+ const GroupView = withStyleContext(View, TILE_GROUP_SCOPE);
18
+ const useTileGroupStyleContext = () => {
19
+ // `useStyleContext` types the result as a `Record`, but at runtime the value is
20
+ // `undefined` when no provider is in scope (e.g. standalone Tile). Cast through
21
+ // `unknown` to acknowledge that.
22
+ const ctx = useStyleContext(TILE_GROUP_SCOPE);
23
+ return ctx ?? {};
24
+ };
25
+ const TilePrimitive = createTile({
26
+ Pressable: RootPressable,
27
+ Group: GroupView,
28
+ LeadingSlot: View,
29
+ Content: View,
30
+ Title: Text,
31
+ Description: Text,
32
+ Indicator: View,
33
+ TrailingSlot: View
34
+ });
35
+
36
+ // =============================================================================
37
+ // TILE GROUP
38
+ // =============================================================================
39
+
40
+ /**
41
+ * Discriminated union mirroring `ITileGroupProps`, with `className` and layout variants added at
42
+ * the styled layer. Distributing the intersection across each branch keeps `interface … extends`
43
+ * ergonomics and avoids tripping `@typescript-eslint` on `(union) & { ... }`.
44
+ *
45
+ * `direction` and `spacing` constrain the group layout to the three supported patterns:
46
+ * - `direction="column"` + `spacing="default"` — vertical stack with gaps (default).
47
+ * - `direction="column"` + `spacing="none"` — tight vertical stack (rows touch).
48
+ * - `direction="row"` + `spacing="default"` — side-by-side horizontal layout.
49
+ *
50
+ * `shape` (when set) is propagated to child `Tile`s via `withStyleContext`, matching the
51
+ * Avatar size-propagation pattern. A per-tile `shape` prop overrides the inherited value.
52
+ */
53
+
54
+ const TileGroup = /*#__PURE__*/forwardRef(({
55
+ className,
56
+ style,
57
+ children,
58
+ direction,
59
+ spacing,
60
+ shape,
61
+ ...props
62
+ }, ref) => /*#__PURE__*/_jsx(TilePrimitive.Group, {
63
+ ref: ref,
64
+ className: cn(tileGroupVariants({
65
+ direction,
66
+ spacing
67
+ }), className),
68
+ style: style,
69
+ context: {
70
+ shape
71
+ },
72
+ ...props,
73
+ children: children
74
+ }));
75
+ TileGroup.displayName = 'Tile.Group';
76
+
77
+ // =============================================================================
78
+ // TILE ROOT
79
+ // =============================================================================
80
+
81
+ const TileRoot = /*#__PURE__*/forwardRef(({
82
+ shape: shapeProp,
83
+ showSeparator,
84
+ className,
85
+ style,
86
+ context,
87
+ ...props
88
+ }, ref) => {
89
+ const {
90
+ shape: inheritedShape
91
+ } = useTileGroupStyleContext();
92
+ const shape = shapeProp ?? inheritedShape ?? 'card';
93
+ const computedClassName = cn(tileRootVariants({
94
+ shape,
95
+ showSeparator
96
+ }), className);
97
+ return /*#__PURE__*/_jsx(TilePrimitive, {
98
+ ref: ref,
99
+ className: computedClassName,
100
+ context: {
101
+ ...context,
102
+ shape
103
+ },
104
+ style: style,
105
+ ...props
106
+ });
107
+ });
108
+ TileRoot.displayName = 'Tile';
109
+
110
+ // =============================================================================
111
+ // SLOTS
112
+ // =============================================================================
113
+
114
+ const TileLeadingSlot = /*#__PURE__*/forwardRef(({
115
+ className,
116
+ style,
117
+ ...props
118
+ }, ref) => /*#__PURE__*/_jsx(TilePrimitive.LeadingSlot, {
119
+ ref: ref,
120
+ className: cn(tileLeadingSlotVariants(), className),
121
+ style: style,
122
+ ...props
123
+ }));
124
+ TileLeadingSlot.displayName = 'Tile.LeadingSlot';
125
+ const TileContent = /*#__PURE__*/forwardRef(({
126
+ className,
127
+ style,
128
+ ...props
129
+ }, ref) => /*#__PURE__*/_jsx(TilePrimitive.Content, {
130
+ ref: ref,
131
+ className: cn(tileContentVariants(), className),
132
+ style: style,
133
+ ...props
134
+ }));
135
+ TileContent.displayName = 'Tile.Content';
136
+ const TileTitle = /*#__PURE__*/forwardRef(({
137
+ className,
138
+ style,
139
+ numberOfLines = 1,
140
+ ...props
141
+ }, ref) => /*#__PURE__*/_jsx(TilePrimitive.Title, {
142
+ ref: ref,
143
+ className: cn(tileTitleVariants(), className),
144
+ style: style,
145
+ numberOfLines: numberOfLines,
146
+ ...props
147
+ }));
148
+ TileTitle.displayName = 'Tile.Title';
149
+ const TileDescription = /*#__PURE__*/forwardRef(({
150
+ className,
151
+ style,
152
+ ...props
153
+ }, ref) => /*#__PURE__*/_jsx(TilePrimitive.Description, {
154
+ ref: ref,
155
+ className: cn(tileDescriptionVariants(), className),
156
+ style: style,
157
+ ...props
158
+ }));
159
+ TileDescription.displayName = 'Tile.Description';
160
+
161
+ /**
162
+ * Decorative selection affordance. Renders pure CVA-styled Views — no interactive hooks,
163
+ * no nested Pressable, zero runtime overhead. The Tile root owns the press target and
164
+ * ARIA role; this subtree is `aria-hidden` via `createTileIndicator`.
165
+ *
166
+ * The visual is inferred from the tile context: `single` (radio semantics) → radio ring,
167
+ * `multiple` (checkbox semantics) → checkbox square. An explicit `indicatorType` prop
168
+ * overrides — primarily for standalone tiles that want a radio-style visual.
169
+ */
170
+ function TileIndicatorVisual({
171
+ indicatorType
172
+ }) {
173
+ const {
174
+ isSelected,
175
+ isDisabled,
176
+ selectionType
177
+ } = useTileContext();
178
+ const effectiveType = indicatorType ?? (selectionType === 'single' ? 'radio' : 'checkbox');
179
+ const stateAttrs = dataAttributes({
180
+ checked: isSelected,
181
+ disabled: isDisabled
182
+ });
183
+ if (effectiveType === 'radio') {
184
+ return /*#__PURE__*/_jsx(View, {
185
+ className: radioIndicatorVariants(),
186
+ ...stateAttrs,
187
+ children: /*#__PURE__*/_jsx(View, {
188
+ className: radioInnerDotVariants(),
189
+ ...dataAttributes({
190
+ checked: isSelected,
191
+ invalid: false
192
+ })
193
+ })
194
+ });
195
+ }
196
+ return /*#__PURE__*/_jsx(View, {
197
+ className: cn(checkboxIndicatorVariants()),
198
+ ...stateAttrs,
199
+ children: isSelected && /*#__PURE__*/_jsx(Icon, {
200
+ as: Check,
201
+ className: checkboxIconVariants()
202
+ })
203
+ });
204
+ }
205
+ const TileIndicator = /*#__PURE__*/forwardRef(({
206
+ className,
207
+ children,
208
+ style,
209
+ indicatorType,
210
+ ...props
211
+ }, ref) => /*#__PURE__*/_jsx(TilePrimitive.Indicator, {
212
+ ref: ref,
213
+ className: cn(tileIndicatorVariants(), className),
214
+ style: style,
215
+ indicatorType: indicatorType,
216
+ ...props,
217
+ children: children ?? /*#__PURE__*/_jsx(TileIndicatorVisual, {
218
+ indicatorType: indicatorType
219
+ })
220
+ }));
221
+ TileIndicator.displayName = 'Tile.Indicator';
222
+ const TileTrailingSlot = /*#__PURE__*/forwardRef(({
223
+ className,
224
+ style,
225
+ ...props
226
+ }, ref) => /*#__PURE__*/_jsx(TilePrimitive.TrailingSlot, {
227
+ ref: ref,
228
+ className: cn(tileTrailingSlotVariants(), className),
229
+ style: style,
230
+ ...props
231
+ }));
232
+ TileTrailingSlot.displayName = 'Tile.TrailingSlot';
233
+ export const Tile = Object.assign(TileRoot, {
234
+ Group: TileGroup,
235
+ LeadingSlot: TileLeadingSlot,
236
+ Content: TileContent,
237
+ Title: TileTitle,
238
+ Description: TileDescription,
239
+ Indicator: TileIndicator,
240
+ TrailingSlot: TileTrailingSlot
241
+ });
242
+ export { useTileContext };
243
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","Pressable","Text","View","createTile","useTileContext","Check","dataAttributes","cn","useStyleContext","withStyleContext","checkboxIndicatorVariants","checkboxIconVariants","Icon","radioIndicatorVariants","radioInnerDotVariants","tileContentVariants","tileDescriptionVariants","tileGroupVariants","tileIndicatorVariants","tileLeadingSlotVariants","tileRootVariants","tileTitleVariants","tileTrailingSlotVariants","jsx","_jsx","TILE_SCOPE","TILE_GROUP_SCOPE","RootPressable","GroupView","useTileGroupStyleContext","ctx","TilePrimitive","Group","LeadingSlot","Content","Title","Description","Indicator","TrailingSlot","TileGroup","className","style","children","direction","spacing","shape","props","ref","context","displayName","TileRoot","shapeProp","showSeparator","inheritedShape","computedClassName","TileLeadingSlot","TileContent","TileTitle","numberOfLines","TileDescription","TileIndicatorVisual","indicatorType","isSelected","isDisabled","selectionType","effectiveType","stateAttrs","checked","disabled","invalid","as","TileIndicator","TileTrailingSlot","Tile","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Tile/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,SAAS,EAAEC,IAAI,EAAEC,IAAI,QAAwC,cAAc;AACpF,SACEC,UAAU,EAOVC,cAAc,QACT,oBAAoB;AAC3B,SAASC,KAAK,QAAQ,eAAe;AACrC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,EAAE,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,eAAe;AACrE,SAASC,yBAAyB,EAAEC,oBAAoB,QAAQ,oBAAoB;AACpF,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,sBAAsB,EAAEC,qBAAqB,QAAQ,iBAAiB;AAC/E,SACEC,mBAAmB,EACnBC,uBAAuB,EACvBC,iBAAiB,EACjBC,qBAAqB,EACrBC,uBAAuB,EACvBC,gBAAgB,EAChBC,iBAAiB,EACjBC,wBAAwB,QAGnB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElB,MAAMC,UAAU,GAAG,MAAM;AACzB,MAAMC,gBAAgB,GAAG,YAAY;AAErC,MAAMC,aAAa,GAAGlB,gBAAgB,CAACT,SAAS,EAAEyB,UAAU,CAAC;AAC7D,MAAMG,SAAS,GAAGnB,gBAAgB,CAACP,IAAI,EAAEwB,gBAAgB,CAAC;AAM1D,MAAMG,wBAAwB,GAAGA,CAAA,KAA6B;EAC5D;EACA;EACA;EACA,MAAMC,GAAG,GAAGtB,eAAe,CAACkB,gBAAgB,CAAiD;EAC7F,OAAOI,GAAG,IAAI,CAAC,CAAC;AAClB,CAAC;AAED,MAAMC,aAAa,GAAG5B,UAAU,CAAC;EAC/BH,SAAS,EAAE2B,aAAa;EACxBK,K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zB,QAAQ,EAAE;EAC1ClB,KAAK,EAAEO,SAAS;EAChBN,WAAW,EAAEsB,eAAe;EAC5BrB,OAAO,EAAEsB,WAAW;EACpBrB,KAAK,EAAEsB,SAAS;EAChBrB,WAAW,EAAEuB,eAAe;EAC5BtB,SAAS,EAAEkC,aAAa;EACxBjC,YAAY,EAAEkC;AAChB,CAAC,CAAiB;AAElB,SAASpE,cAAc","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ import { Platform } from 'react-native';
4
+ import { cva } from 'class-variance-authority';
5
+ import { TRANSITION_COLORS } from '../../styles/primitives';
6
+ export const tileGroupVariants = cva(['flex w-full'], {
7
+ variants: {
8
+ direction: {
9
+ column: 'flex-col',
10
+ row: 'flex-row'
11
+ },
12
+ spacing: {
13
+ default: 'gap-2',
14
+ none: 'gap-0'
15
+ }
16
+ },
17
+ defaultVariants: {
18
+ direction: 'column',
19
+ spacing: 'default'
20
+ }
21
+ });
22
+ export const tileRootVariants = cva(['flex-row self-stretch gap-3 px-4 py-3', 'data-[disabled=true]:opacity-50', TRANSITION_COLORS, Platform.select({
23
+ web: ['outline-none', 'data-[hover=true]:data-[disabled=false]:bg-surface-action-tint-hover', 'data-[active=true]:data-[disabled=false]:data-[hover=true]:bg-surface-action-tint-active', 'data-[hover=true]:data-[disabled=false]:data-[state=unselected]:border-stroke-action', 'focus-visible:data-[disabled=false]:ring-2 focus-visible:data-[disabled=false]:ring-stroke-focus focus-visible:data-[disabled=false]:ring-offset-2'].join(' '),
24
+ default: ['data-[active=true]:bg-surface-action-tint-hover', 'data-[active=true]:border-stroke-action'].join(' ')
25
+ })], {
26
+ variants: {
27
+ shape: {
28
+ flat: 'rounded-none border-0 bg-transparent',
29
+ card: ['rounded-[var(--border-radius-default)] border-1 border-solid', 'border-stroke-secondary', 'bg-surface-primary', 'data-[state=selected]:border-stroke-action', 'data-[state=selected]:border-1.5', 'data-[state=selected]:bg-surface-action-tint'].join(' ')
30
+ },
31
+ showSeparator: {
32
+ true: ['border-b border-solid border-stroke-secondary! native:data-[active=true]:border-stroke-secondary' // Override border-stroke-action on hover
33
+ ],
34
+ false: ''
35
+ }
36
+ },
37
+ defaultVariants: {
38
+ shape: 'card',
39
+ showSeparator: false
40
+ }
41
+ });
42
+ export const tileLeadingSlotVariants = cva(['flex shrink-0 items-center justify-center']);
43
+ export const tileTrailingSlotVariants = cva(['flex shrink-0 items-center justify-center']);
44
+ export const tileContentVariants = cva(['min-w-0 flex-1 flex-col gap-0.5 no-underline']);
45
+ export const tileTitleVariants = cva(['text-base font-medium text-content-primary no-underline']);
46
+ export const tileDescriptionVariants = cva(['text-sm text-content-secondary no-underline']);
47
+ export const tileIndicatorVariants = cva(['flex shrink-0 items-center justify-center']);
48
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","cva","TRANSITION_COLORS","tileGroupVariants","variants","direction","column","row","spacing","default","none","defaultVariants","tileRootVariants","select","web","join","shape","flat","card","showSeparator","true","false","tileLeadingSlotVariants","tileTrailingSlotVariants","tileContentVariants","tileTitleVariants","tileDescriptionVariants","tileIndicatorVariants"],"sourceRoot":"../../../../src","sources":["components/Tile/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AACjE,SAASC,iBAAiB,QAAQ,yBAAyB;AAE3D,OAAO,MAAMC,iBAAiB,GAAGF,GAAG,CAAC,CAAC,aAAa,CAAC,EAAE;EACpDG,QAAQ,EAAE;IACRC,SAAS,EAAE;MACTC,MAAM,EAAE,UAAU;MAClBC,GAAG,EAAE;IACP,CAAC;IACDC,OAAO,EAAE;MACPC,OAAO,EAAE,OAAO;MAChBC,IAAI,EAAE;IACR;EACF,CAAC;EACDC,eAAe,EAAE;IACfN,SAAS,EAAE,QAAQ;IACnBG,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAIF,OAAO,MAAMI,gBAAgB,GAAGX,GAAG,CACjC,C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ProgressBar';
20
20
  export * from './ProgressSegmented';
21
+ export * from './Radio';
22
+ export * from './ScopedTheme';
21
23
  export * from './Select';
22
24
  export * from './VirtualizedList';
23
25
  export * from './Switch';
26
+ export * from './Tile';
24
27
  export { HStack, VStack } from './Stack';
25
28
  export * from './Heading';
26
29
  export * from './Text';
@@ -1 +1 @@
1
- {"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,UAAU;AACxB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,cAAc","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ // url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=449-377
4
+ // source=packages/components/src/components/Avatar/index.tsx
5
+ // component=Avatar
6
+ import figma from 'figma';
7
+ const instance = figma.selectedInstance;
8
+
9
+ // size: 1:1 mapping between Figma and code values
10
+ const size = instance.getEnum('size', {
11
+ '2xs': '2xs',
12
+ xs: 'xs',
13
+ sm: 'sm',
14
+ md: 'md',
15
+ lg: 'lg',
16
+ xl: 'xl',
17
+ '2xl': '2xl'
18
+ });
19
+
20
+ // type: VARIANT — determines which Avatar sub-component to render.
21
+ // Not a code prop; used only to choose Avatar.Image, Avatar.Text, or Avatar.Icon.
22
+ const type = instance.getEnum('type', {
23
+ image: 'image',
24
+ text: 'text',
25
+ icon: 'icon'
26
+ });
27
+
28
+ // icon: INSTANCE_SWAP → Avatar.Icon `as` prop (ForgeIcon identifier).
29
+ // Prefer metadata.props.componentName exposed by icon Code Connect templates.
30
+ // Falls back to executeTemplate().example (placeholder pill) when the icon lacks Code Connect.
31
+ const iconResult = instance.getInstanceSwap('icon')?.executeTemplate();
32
+ const iconName = iconResult?.metadata?.props?.componentName;
33
+ const iconSnippet = iconName ?? iconResult?.example;
34
+ const iconImports = iconName ? [`import { ${iconName} } from '@cdx-ui/icons'`] : [];
35
+
36
+ // text: TEXT property — the initials or label rendered inside Avatar.Text
37
+ const textContent = instance.getString('text');
38
+ export default {
39
+ id: 'avatar',
40
+ imports: ["import { Avatar } from '@cdx-ui/components'", ...iconImports],
41
+ example: figma.code`
42
+ <Avatar size="${size}">
43
+ ${type === 'image' ? figma.code`<Avatar.Image src="..." />` : null}
44
+ ${type === 'text' ? figma.code`<Avatar.Text>${textContent}</Avatar.Text>` : null}
45
+ ${type === 'icon' ? figma.code`<Avatar.Icon as={${iconSnippet}} />` : null}
46
+ </Avatar>`
47
+ };
48
+ //# sourceMappingURL=Avatar.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["figma","instance","selectedInstance","size","getEnum","xs","sm","md","lg","xl","type","image","text","icon","iconResult","getInstanceSwap","executeTemplate","iconName","metadata","props","componentName","iconSnippet","example","iconImports","textContent","getString","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Avatar.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA,MAAMC,IAAI,GAAGF,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE;EACpC,KAAK,EAAE,KAAK;EACZC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACR,KAAK,EAAE;AACT,CAAC,CAAC;;AAEF;AACA;AACA,MAAMC,IAAI,GAAGT,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE;EACpCO,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE;AACR,CAAC,CAAC;;AAEF;AACA;AACA;AACA,MAAMC,UAAU,GAAGb,QAAQ,CAACc,eAAe,CAAC,MAAM,CAAC,EAAEC,eAAe,CAAC,CAAC;AACtE,MAAMC,QAAQ,GAAGH,UAAU,EAAEI,QAAQ,EAAEC,KAAK,EAAEC,aAAmC;AACjF,MAAMC,WAAW,GAAGJ,QAAQ,IAAIH,UAAU,EAAEQ,OAAO;AAEnD,MAAMC,WAAW,GAAGN,QAAQ,GAAG,CAAC,YAAYA,QAAQ,yBAAyB,CAAC,GAAG,EAAE;;AAEnF;AACA,MAAMO,WAAW,GAAGvB,QAAQ,CAACwB,SAAS,CAAC,MAAM,CAAC;AAE9C,eAAe;EACbC,EAAE,EAAE,QAAQ;EACZC,OAAO,EAAE,CAAC,6CAA6C,EAAE,GAAGJ,WAAW,CAAC;EACxED,OAAO,EAAEtB,KAAK,CAAC4B,IAAI;AACrB,gBAAgBzB,IAAI;AACpB,IAAIO,IAAI,KAAK,OAAO,GAAGV,KAAK,CAAC4B,IAAI,4BAA4B,GAAG,IAAI;AACpE,IAAIlB,IAAI,KAAK,MAAM,GAAGV,KAAK,CAAC4B,IAAI,gBAAgBJ,WAAW,gBAAgB,GAAG,IAAI;AAClF,IAAId,IAAI,KAAK,MAAM,GAAGV,KAAK,CAAC4B,IAAI,oBAAoBP,WAAW,MAAM,GAAG,IAAI;AAC5E;AACA,CAAC","ignoreList":[]}
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
- // url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/branch/LkwnLe2gHRg0vLdfg9Frjs/%E2%AD%90-CDS-V2--React-Native?node-id=119-72
3
+ // url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=119-72
4
4
  // source=packages/components/src/components/Button/index.tsx
5
5
  // component=Button
6
6
  import figma from 'figma';
7
7
  const instance = figma.selectedInstance;
8
-
9
- // Variant rename: Figma uses "solid" but code uses "strong" for the filled/primary style.
10
- // This divergence exists because "strong" better communicates visual weight in the code API
11
- // while "solid" is the conventional Figma naming. Use getEnum to map between them.
12
8
  const variant = instance.getEnum('variant', {
13
- solid: 'strong',
9
+ solid: 'solid',
14
10
  outline: 'outline',
15
11
  ghost: 'ghost'
16
12
  });
@@ -22,26 +18,43 @@ const size = instance.getEnum('size', {
22
18
  default: 'default',
23
19
  small: 'small'
24
20
  });
25
- // Enum-as-boolean pattern: isDisabled is a VARIANT property in Figma (string values
26
- // "true"/"false") rather than a true BOOLEAN property. We use getEnum and map "false"
27
- // to undefined so the prop is omitted entirely from the generated snippet when not disabled.
21
+ // Enum-as-boolean: isDisabled is a VARIANT property in Figma (string values "true"/"false")
22
+ // rather than a true BOOLEAN. Map "false" to undefined so the prop is omitted when not disabled.
28
23
  const isDisabled = instance.getEnum('isDisabled', {
29
24
  true: true,
30
25
  false: undefined
31
26
  });
27
+ const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
32
28
  const showLeadingIcon = instance.getBoolean('Show Leading Icon?');
33
29
  const showTrailingIcon = instance.getBoolean('Show Trailing Icon?');
34
- const leadingIcon = instance.findInstance('Button.Icon (Leading)');
35
- const trailingIcon = instance.findInstance('Button.Icon (Trailing)');
30
+
31
+ // Icon slots: Prefer metadata.props.componentName exposed by icon Code Connect templates,
32
+ // which yields a clean identifier (e.g. "Check"). Fall back to executeTemplate().example
33
+ // (renders a placeholder pill when the icon lacks Code Connect).
34
+ const leadingIconResult = instance.getInstanceSwap('Leading Icon')?.executeTemplate();
35
+ const trailingIconResult = instance.getInstanceSwap('Trailing Icon')?.executeTemplate();
36
+ const leadingIconName = leadingIconResult?.metadata?.props?.componentName;
37
+ const trailingIconName = trailingIconResult?.metadata?.props?.componentName;
38
+ const leadingIconSnippet = leadingIconName ?? leadingIconResult?.example;
39
+ const trailingIconSnippet = trailingIconName ?? trailingIconResult?.example;
36
40
  const label = instance.findText('Button.Label').textContent;
41
+
42
+ // Include icon imports when resolved via metadata.props (propagated from icon Code Connect)
43
+ const iconImports = [];
44
+ if (showLeadingIcon && leadingIconName) {
45
+ iconImports.push(`import { ${leadingIconName} } from '@cdx-ui/icons'`);
46
+ }
47
+ if (showTrailingIcon && trailingIconName) {
48
+ iconImports.push(`import { ${trailingIconName} } from '@cdx-ui/icons'`);
49
+ }
37
50
  export default {
38
51
  id: 'button',
39
- imports: ["import { Button } from '@cdx-ui/components'"],
52
+ imports: ["import { Button } from '@cdx-ui/components'", ...iconImports],
40
53
  example: figma.code`
41
- <Button variant="${variant}" color="${color}" size="${size}" isDisabled={${isDisabled}}>
42
- ${showLeadingIcon ? leadingIcon.executeTemplate().example : null}
54
+ <Button variant="${variant}" color="${color}" size="${size}"${isDisabledProp}>
55
+ ${showLeadingIcon ? figma.code`<Button.Icon as={${leadingIconSnippet}} />` : null}
43
56
  <Button.Label>${label}</Button.Label>
44
- ${showTrailingIcon ? trailingIcon.executeTemplate().example : null}
57
+ ${showTrailingIcon ? figma.code`<Button.Icon as={${trailingIconSnippet}} />` : null}
45
58
  </Button>`
46
59
  };
47
60
  //# sourceMappingURL=Button.figma.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["figma","instance","selectedInstance","variant","getEnum","solid","outline","ghost","color","action","danger","size","default","small","isDisabled","true","false","undefined","showLeadingIcon","getBoolean","showTrailingIcon","leadingIcon","findInstance","trailingIcon","label","findText","textContent","id","imports","example","code","executeTemplate"],"sourceRoot":"../../../src","sources":["figma/Button.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA;AACA,MAAMC,OAAO,GAAGF,QAAQ,CAACG,OAAO,CAAC,SAAS,EAAE;EAC1CC,KAAK,EAAE,QAAQ;EACfC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAAMC,KAAK,GAAGP,QAAQ,CAACG,OAAO,CAAC,OAAO,EAAE;EACtCK,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACV,CAAC,CAAC;AACF,MAAMC,IAAI,GAAGV,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE;EACpCQ,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE;AACT,CAAC,CAAC;AACF;AACA;AACA;AACA,MAAMC,UAAU,GAAGb,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDW,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAMC,eAAe,GAAGjB,QAAQ,CAACkB,UAAU,CAAC,oBAAoB,CAAC;AACjE,MAAMC,gBAAgB,GAAGnB,QAAQ,CAACkB,UAAU,CAAC,qBAAqB,CAAC;AACnE,MAAME,WAAW,GAAGpB,QAAQ,CAACqB,YAAY,CAAC,uBAAuB,CAAC;AAClE,MAAMC,YAAY,GAAGtB,QAAQ,CAACqB,YAAY,CAAC,wBAAwB,CAAC;AACpE,MAAME,KAAK,GAAIvB,QAAQ,CAACwB,QAAQ,CAAC,cAAc,CAAC,CAAgCC,WAAW;AAE3F,eAAe;EACbC,EAAE,EAAE,QAAQ;EACZC,OAAO,EAAE,CAAC,6CAA6C,CAAC;EACxDC,OAAO,EAAE7B,KAAK,CAAC8B,IAAI;AACrB,mBAAmB3B,OAAO,YAAYK,KAAK,WAAWG,IAAI,iBAAiBG,UAAU;AACrF,IAAII,eAAe,GAAGG,WAAW,CAACU,eAAe,CAAC,CAAC,CAACF,OAAO,GAAG,IAAI;AAClE,kBAAkBL,KAAK;AACvB,IAAIJ,gBAAgB,GAAGG,YAAY,CAACQ,eAAe,CAAC,CAAC,CAACF,OAAO,GAAG,IAAI;AACpE;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["figma","instance","selectedInstance","variant","getEnum","solid","outline","ghost","color","action","danger","size","default","small","isDisabled","true","false","undefined","isDisabledProp","helpers","react","renderProp","showLeadingIcon","getBoolean","showTrailingIcon","leadingIconResult","getInstanceSwap","executeTemplate","trailingIconResult","leadingIconName","metadata","props","componentName","trailingIconName","leadingIconSnippet","example","trailingIconSnippet","label","findText","textContent","iconImports","push","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Button.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,OAAO,GAA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,EAAEO,OAAO;AAE3E,MAAME,KAAK,GAAIpC,QAAQ,CAACqC,QAAQ,CAAC,cAAc,CAAC,CAAgCC,WAAW;;AAE3F;AACA,MAAMC,WAAqB,GAAG,EAAE;AAChC,IAAIlB,eAAe,IAAIO,eAAe,EAAE;EACtCW,WAAW,CAACC,IAAI,CAAC,YAAYZ,eAAe,yBAAyB,CAAC;AACxE;AACA,IAAIL,gBAAgB,IAAIS,gBAAgB,EAAE;EACxCO,WAAW,CAACC,IAAI,CAAC,YAAYR,gBAAgB,yBAAyB,CAAC;AACzE;AAEA,eAAe;EACbS,EAAE,EAAE,QAAQ;EACZC,OAAO,EAAE,CAAC,6CAA6C,EAAE,GAAGH,WAAW,CAAC;EACxEL,OAAO,EAAEnC,KAAK,CAAC4C,IAAI;AACrB,mBAAmBzC,OAAO,YAAYK,KAAK,WAAWG,IAAI,IAAIO,cAAc;AAC5E,IAAII,eAAe,GAAGtB,KAAK,CAAC4C,IAAI,oBAAoBV,kBAAkB,MAAM,GAAG,IAAI;AACnF,kBAAkBG,KAAK;AACvB,IAAIb,gBAAgB,GAAGxB,KAAK,CAAC4C,IAAI,oBAAoBR,mBAAmB,MAAM,GAAG,IAAI;AACrF;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ # Code Connect
2
+
3
+ Auto-loaded when working in `packages/components/src/figma/**` (`*.figma.ts`, `*.figma.batch.ts`, `*.figma.batch.json`).
4
+
5
+ Template files connect Forge UI components to Figma Dev Mode snippets. Read the full guide before making changes:
6
+
7
+ - `docs/internal/practices/code-connect.md` — complete workflow, mapping patterns, publishing, troubleshooting
8
+
9
+ ## Pattern summary
10
+
11
+ Each `.figma.ts` file follows this structure (see `Button.figma.ts` as the canonical example):
12
+
13
+ 1. **Metadata comments** — `// url=`, `// source=`, `// component=` at the top (required)
14
+ 2. **`figma` import** — `import figma from 'figma'` (template API, not a runtime import)
15
+ 3. **Instance handle** — `const instance = figma.selectedInstance`
16
+ 4. **Property mappings** — `getEnum`, `getBoolean`, `getInstanceSwap`, `findText`, `findInstance`
17
+ 5. **Default export** — `{ id, imports, example }` with optional `metadata`
18
+
19
+ ## Key rules
20
+
21
+ - **Enum renaming** — pass a mapping object to `getEnum` when Figma and code names differ; list all values explicitly
22
+ - **Boolean-as-variant** — Figma VARIANT properties with `"true"`/`"false"` string values use `getEnum`, not `getBoolean`; map `"false"` to `undefined`; **always** render via `figma.helpers.react.renderProp` — never `isDisabled={${isDisabled}}` (produces `isDisabled={}` when undefined)
23
+ - **Instance swap** — use `getInstanceSwap` (not `findInstance`) for designer-swappable slots; call `.executeTemplate()` before interpolating; prefer `metadata.props.componentName` over raw `.example` for icon slots
24
+ - **Runtime states excluded** — `isHovered`, `isFocused`, `isPressed`, `isLoading` are runtime-managed; never map them
25
+ - **Falsy → `undefined`** — default or falsy values map to `undefined` so they don't clutter the snippet
26
+ - **Compound dot notation** — render sub-components as `Button.Label`, `Button.Icon`, not bare `Label`/`Icon`
27
+ - **`imports` array** — use `@cdx-ui/components` import path; Figma deduplicates identical strings
28
+ - **Nestable metadata** — leaf components (icons, badges) set `metadata: { nestable: true, props: { componentName } }`
29
+ - **Batch pattern** — for large sets with identical code shapes (icons), use `.figma.batch.ts` + `.figma.batch.json` with `figma.batch.name`/`figma.batch.id`
30
+ - **Publish** — `pnpm figma:publish` locally; CI publishes on merge to `main`
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ // url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=455-178
4
+ // source=packages/components/src/components/Card/index.tsx
5
+ // component=Card.Header
6
+ import figma from 'figma';
7
+ const instance = figma.selectedInstance;
8
+ const showActions = instance.getBoolean('Show Actions?');
9
+ const actionsSlot = instance.getSlot('Actions');
10
+ const title = instance.findText('{Title}').textContent;
11
+ const actions = showActions && actionsSlot ? figma.helpers.react.renderChildren(actionsSlot) : null;
12
+ export default {
13
+ id: 'card-header',
14
+ // Must match Card.figma.ts when the card nests this template (identical strings → deduped imports).
15
+ imports: ["import { Card, Heading } from '@cdx-ui/components'"],
16
+ example: figma.code`
17
+ <Card.Header>
18
+ <Heading size="sm">${title}</Heading>
19
+ ${actions}
20
+ </Card.Header>`
21
+ };
22
+ //# sourceMappingURL=Card.Header.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["figma","instance","selectedInstance","showActions","getBoolean","actionsSlot","getSlot","title","findText","textContent","actions","helpers","react","renderChildren","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Card.Header.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,WAAW,GAAGF,QAAQ,CAACG,UAAU,CAAC,eAAe,CAAC;AACxD,MAAMC,WAAW,GAAGJ,QAAQ,CAACK,OAAO,CAAC,SAAS,CAAC;AAC/C,MAAMC,KAAK,GAAIN,QAAQ,CAACO,QAAQ,CAAC,SAAS,CAAC,CAAgCC,WAAW;AAEtF,MAAMC,OAAO,GAAGP,WAAW,IAAIE,WAAW,GAAGL,KAAK,CAACW,OAAO,CAACC,KAAK,CAACC,cAAc,CAACR,WAAW,CAAC,GAAG,IAAI;AAEnG,eAAe;EACbS,EAAE,EAAE,aAAa;EACjB;EACAC,OAAO,EAAE,CAAC,oDAAoD,CAAC;EAC/DC,OAAO,EAAEhB,KAAK,CAACiB,IAAI;AACrB;AACA,uBAAuBV,KAAK;AAC5B,IAAIG,OAAO;AACX;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ // url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=456-14
4
+ // source=packages/components/src/components/Card/index.tsx
5
+ // component=Card
6
+ import figma from 'figma';
7
+ const instance = figma.selectedInstance;
8
+
9
+ // VARIANT property uses "true" / "false" strings — omit prop when not full bleed.
10
+ const fullBleed = instance.getEnum('fullBleed', {
11
+ true: true,
12
+ false: undefined
13
+ });
14
+ const showHeader = instance.getBoolean('Show Header?');
15
+ const showFooter = instance.getBoolean('Show Footer?');
16
+ const headerLayer = instance.findInstance('Card.Header');
17
+ const headerSnippet = showHeader && headerLayer?.type === 'INSTANCE' ? headerLayer.executeTemplate().example : null;
18
+ const contentSlot = instance.getSlot('Card.Content');
19
+ const footerSlot = instance.getSlot('Card.Footer');
20
+ const contentChildren = contentSlot ? figma.helpers.react.renderChildren(contentSlot) : null;
21
+ const footerChildren = footerSlot ? figma.helpers.react.renderChildren(footerSlot) : null;
22
+
23
+ // When the header shows: use the exact same import string as Card.Header.figma.ts (Code Connect
24
+ // allows only `import … from 'figma'` in template files; duplicate literals are required for dedupe).
25
+ const componentImport = showHeader ? "import { Card, Heading } from '@cdx-ui/components'" : `import { Card } from '@cdx-ui/components'`;
26
+ export default {
27
+ id: 'card',
28
+ imports: [componentImport],
29
+ example: figma.code`
30
+ <Card fullBleed={${fullBleed}}>
31
+ ${headerSnippet}
32
+ <Card.Content>${contentChildren}</Card.Content>
33
+ ${showFooter ? figma.code`<Card.Footer>${footerChildren}</Card.Footer>` : null}
34
+ </Card>`
35
+ };
36
+ //# sourceMappingURL=Card.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["figma","instance","selectedInstance","fullBleed","getEnum","true","false","undefined","showHeader","getBoolean","showFooter","headerLayer","findInstance","headerSnippet","type","executeTemplate","example","contentSlot","getSlot","footerSlot","contentChildren","helpers","react","renderChildren","footerChildren","componentImport","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Card.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA,MAAMC,SAAS,GAAGF,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAMC,UAAU,GAAGP,QAAQ,CAACQ,UAAU,CAAC,cAAc,CAAC;AACtD,MAAMC,UAAU,GAAGT,QAAQ,CAACQ,UAAU,CAAC,cAAc,CAAC;AAEtD,MAAME,WAAW,GAAGV,QAAQ,CAACW,YAAY,CAAC,aAAa,CAAC;AACxD,MAAMC,aAAa,GACjBL,UAAU,IAAIG,WAAW,EAAEG,IAAI,KAAK,UAAU,GAAGH,WAAW,CAACI,eAAe,CAAC,CAAC,CAACC,OAAO,GAAG,IAAI;AAE/F,MAAMC,WAAW,GAAGhB,QAAQ,CAACiB,OAAO,CAAC,cAAc,CAAC;AACpD,MAAMC,UAAU,GAAGlB,QAAQ,CAACiB,OAAO,CAAC,aAAa,CAAC;AAElD,MAAME,eAAe,GAAGH,WAAW,GAAGjB,KAAK,CAACqB,OAAO,CAACC,KAAK,CAACC,cAAc,CAACN,WAAW,CAAC,GAAG,IAAI;AAE5F,MAAMO,cAAc,GAAGL,UAAU,GAAGnB,KAAK,CAACqB,OAAO,CAACC,KAAK,CAACC,cAAc,CAACJ,UAAU,CAAC,GAAG,IAAI;;AAEzF;AACA;AACA,MAAMM,eAAe,GAAGjB,UAAU,GAC9B,oDAAoD,GACpD,2CAA2C;AAE/C,eAAe;EACbkB,EAAE,EAAE,MAAM;EACVC,OAAO,EAAE,CAACF,eAAe,CAAC;EAC1BT,OAAO,EAAEhB,KAAK,CAAC4B,IAAI;AACrB,mBAAmBzB,SAAS;AAC5B,IAAIU,aAAa;AACjB,kBAAkBO,eAAe;AACjC,IAAIV,UAAU,GAAGV,KAAK,CAAC4B,IAAI,gBAAgBJ,cAAc,gBAAgB,GAAG,IAAI;AAChF;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ // url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=366-383
4
+ // source=packages/components/src/components/Checkbox/index.tsx
5
+ // component=Checkbox
6
+ import figma from 'figma';
7
+ const instance = figma.selectedInstance;
8
+
9
+ /**
10
+ * Enum-as-boolean VARIANT props use string values "true"/"false" in Figma.
11
+ * Props are emitted via `figma.helpers.react.renderProp` so JSX formatting matches Code Connect conventions.
12
+ *
13
+ * `isHovered` and `isFocused` are interaction-only variants (fixed "false") and are intentionally omitted.
14
+ */
15
+ const isChecked = instance.getEnum('isChecked', {
16
+ true: true,
17
+ false: false
18
+ });
19
+ const isIndeterminate = instance.getEnum('isIndeterminate', {
20
+ true: true,
21
+ false: false
22
+ });
23
+ const isInvalid = instance.getEnum('isInvalid', {
24
+ true: true,
25
+ false: false
26
+ });
27
+ const isDisabled = instance.getEnum('isDisabled', {
28
+ true: true,
29
+ false: false
30
+ });
31
+ const valueProp = figma.helpers.react.renderProp('value', 'terms');
32
+ const isCheckedProp = figma.helpers.react.renderProp('isChecked', isChecked);
33
+ const isIndeterminateProp = figma.helpers.react.renderProp('isIndeterminate', isIndeterminate);
34
+ const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
35
+ const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
36
+ const showLabel = instance.getEnum('Show Label?', {
37
+ true: true,
38
+ false: false
39
+ });
40
+ const labelText = instance.findText('Label').textContent;
41
+ export default {
42
+ id: 'checkbox',
43
+ imports: ["import { Checkbox } from '@cdx-ui/components'"],
44
+ example: figma.code`
45
+ <Checkbox${valueProp}${isCheckedProp}${isIndeterminateProp}${isInvalidProp}${isDisabledProp}>
46
+ ${showLabel ? figma.code`<Checkbox.Label>${labelText}</Checkbox.Label>` : null}
47
+ </Checkbox>`
48
+ };
49
+ //# sourceMappingURL=Checkbox.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["figma","instance","selectedInstance","isChecked","getEnum","true","false","isIndeterminate","isInvalid","isDisabled","valueProp","helpers","react","renderProp","isCheckedProp","isIndeterminateProp","isInvalidProp","isDisabledProp","showLabel","labelText","findText","textContent","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Checkbox.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,SAAS,GAAGF,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAAMC,eAAe,GAAGN,QAAQ,CAACG,OAAO,CAAC,iBAAiB,EAAE;EAC1DC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAAME,SAAS,GAAGP,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAAMG,UAAU,GAAGR,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AAEF,MAAMI,SAAS,GAAGV,KAAK,CAACW,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC;AAClE,MAAMC,aAAa,GAAGd,KAAK,CAACW,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAEV,SAAS,CAAC;AAC5E,MAAMY,mBAAmB,GAAGf,KAAK,CAACW,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,iBAAiB,EAAEN,eAAe,CAAC;AAC9F,MAAMS,aAAa,GAAGhB,KAAK,CAACW,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAEL,SAAS,CAAC;AAC5E,MAAMS,cAAc,GAAGjB,KAAK,CAACW,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAEJ,UAAU,CAAC;AAE/E,MAAMS,S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