@cdx-ui/primitives 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 (259) hide show
  1. package/README.md +51 -25
  2. package/lib/commonjs/CLAUDE.md +32 -0
  3. package/lib/commonjs/avatar/createAvatarText.js +9 -1
  4. package/lib/commonjs/avatar/createAvatarText.js.map +1 -1
  5. package/lib/commonjs/button/createButtonText.js +1 -0
  6. package/lib/commonjs/button/createButtonText.js.map +1 -1
  7. package/lib/commonjs/checkbox/createCheckboxRoot.web.js +8 -3
  8. package/lib/commonjs/checkbox/createCheckboxRoot.web.js.map +1 -1
  9. package/lib/commonjs/chip/createChipRoot.js +132 -0
  10. package/lib/commonjs/chip/createChipRoot.js.map +1 -0
  11. package/lib/commonjs/chip/index.js +16 -0
  12. package/lib/commonjs/chip/index.js.map +1 -0
  13. package/lib/commonjs/chip/types.js +6 -0
  14. package/lib/commonjs/chip/types.js.map +1 -0
  15. package/lib/commonjs/field/createFieldLabel.js.map +1 -1
  16. package/lib/commonjs/index.js +45 -1
  17. package/lib/commonjs/index.js.map +1 -1
  18. package/lib/commonjs/input/createInputField.js +5 -0
  19. package/lib/commonjs/input/createInputField.js.map +1 -1
  20. package/lib/commonjs/link/context.js +11 -0
  21. package/lib/commonjs/link/context.js.map +1 -0
  22. package/lib/commonjs/link/createLink.js +28 -14
  23. package/lib/commonjs/link/createLink.js.map +1 -1
  24. package/lib/commonjs/link/index.js +13 -0
  25. package/lib/commonjs/link/index.js.map +1 -1
  26. package/lib/commonjs/list-item/createListItemRoot.js +36 -21
  27. package/lib/commonjs/list-item/createListItemRoot.js.map +1 -1
  28. package/lib/commonjs/radio/context.js +14 -0
  29. package/lib/commonjs/radio/context.js.map +1 -0
  30. package/lib/commonjs/radio/createRadioGroup.js +66 -0
  31. package/lib/commonjs/radio/createRadioGroup.js.map +1 -0
  32. package/lib/commonjs/radio/createRadioIndicator.js +43 -0
  33. package/lib/commonjs/radio/createRadioIndicator.js.map +1 -0
  34. package/lib/commonjs/radio/createRadioLabel.js +38 -0
  35. package/lib/commonjs/radio/createRadioLabel.js.map +1 -0
  36. package/lib/commonjs/radio/createRadioRoot.js +95 -0
  37. package/lib/commonjs/radio/createRadioRoot.js.map +1 -0
  38. package/lib/commonjs/radio/createRadioRoot.web.js +87 -0
  39. package/lib/commonjs/radio/createRadioRoot.web.js.map +1 -0
  40. package/lib/commonjs/radio/index.js +26 -0
  41. package/lib/commonjs/radio/index.js.map +1 -0
  42. package/lib/commonjs/radio/types.js +6 -0
  43. package/lib/commonjs/radio/types.js.map +1 -0
  44. package/lib/commonjs/radio/useRadioRoot.js +64 -0
  45. package/lib/commonjs/radio/useRadioRoot.js.map +1 -0
  46. package/lib/commonjs/select/createSelectIcon.js +3 -1
  47. package/lib/commonjs/select/createSelectIcon.js.map +1 -1
  48. package/lib/commonjs/select/createSelectTrigger.js +17 -4
  49. package/lib/commonjs/select/createSelectTrigger.js.map +1 -1
  50. package/lib/commonjs/tile/context.js +30 -0
  51. package/lib/commonjs/tile/context.js.map +1 -0
  52. package/lib/commonjs/tile/createTileContent.js +30 -0
  53. package/lib/commonjs/tile/createTileContent.js.map +1 -0
  54. package/lib/commonjs/tile/createTileDescription.js +28 -0
  55. package/lib/commonjs/tile/createTileDescription.js.map +1 -0
  56. package/lib/commonjs/tile/createTileGroup.js +112 -0
  57. package/lib/commonjs/tile/createTileGroup.js.map +1 -0
  58. package/lib/commonjs/tile/createTileIndicator.js +46 -0
  59. package/lib/commonjs/tile/createTileIndicator.js.map +1 -0
  60. package/lib/commonjs/tile/createTileLeadingSlot.js +34 -0
  61. package/lib/commonjs/tile/createTileLeadingSlot.js.map +1 -0
  62. package/lib/commonjs/tile/createTileRoot.js +133 -0
  63. package/lib/commonjs/tile/createTileRoot.js.map +1 -0
  64. package/lib/commonjs/tile/createTileTitle.js +28 -0
  65. package/lib/commonjs/tile/createTileTitle.js.map +1 -0
  66. package/lib/commonjs/tile/createTileTrailingSlot.js +35 -0
  67. package/lib/commonjs/tile/createTileTrailingSlot.js.map +1 -0
  68. package/lib/commonjs/tile/index.js +55 -0
  69. package/lib/commonjs/tile/index.js.map +1 -0
  70. package/lib/commonjs/tile/types.js +6 -0
  71. package/lib/commonjs/tile/types.js.map +1 -0
  72. package/lib/commonjs/utils/dataAttributes.js +6 -25
  73. package/lib/commonjs/utils/dataAttributes.js.map +1 -1
  74. package/lib/commonjs/utils/domDataAttributes.js +34 -0
  75. package/lib/commonjs/utils/domDataAttributes.js.map +1 -0
  76. package/lib/module/CLAUDE.md +32 -0
  77. package/lib/module/avatar/createAvatarText.js +9 -1
  78. package/lib/module/avatar/createAvatarText.js.map +1 -1
  79. package/lib/module/button/createButtonText.js +1 -0
  80. package/lib/module/button/createButtonText.js.map +1 -1
  81. package/lib/module/checkbox/createCheckboxRoot.web.js +8 -2
  82. package/lib/module/checkbox/createCheckboxRoot.web.js.map +1 -1
  83. package/lib/module/chip/createChipRoot.js +126 -0
  84. package/lib/module/chip/createChipRoot.js.map +1 -0
  85. package/lib/module/chip/index.js +12 -0
  86. package/lib/module/chip/index.js.map +1 -0
  87. package/lib/module/chip/types.js +4 -0
  88. package/lib/module/chip/types.js.map +1 -0
  89. package/lib/module/field/createFieldLabel.js.map +1 -1
  90. package/lib/module/index.js +4 -0
  91. package/lib/module/index.js.map +1 -1
  92. package/lib/module/input/createInputField.js +5 -0
  93. package/lib/module/input/createInputField.js.map +1 -1
  94. package/lib/module/link/context.js +5 -0
  95. package/lib/module/link/context.js.map +1 -0
  96. package/lib/module/link/createLink.js +29 -15
  97. package/lib/module/link/createLink.js.map +1 -1
  98. package/lib/module/link/index.js +1 -0
  99. package/lib/module/link/index.js.map +1 -1
  100. package/lib/module/list-item/createListItemRoot.js +36 -21
  101. package/lib/module/list-item/createListItemRoot.js.map +1 -1
  102. package/lib/module/radio/context.js +7 -0
  103. package/lib/module/radio/context.js.map +1 -0
  104. package/lib/module/radio/createRadioGroup.js +61 -0
  105. package/lib/module/radio/createRadioGroup.js.map +1 -0
  106. package/lib/module/radio/createRadioIndicator.js +38 -0
  107. package/lib/module/radio/createRadioIndicator.js.map +1 -0
  108. package/lib/module/radio/createRadioLabel.js +33 -0
  109. package/lib/module/radio/createRadioLabel.js.map +1 -0
  110. package/lib/module/radio/createRadioRoot.js +90 -0
  111. package/lib/module/radio/createRadioRoot.js.map +1 -0
  112. package/lib/module/radio/createRadioRoot.web.js +82 -0
  113. package/lib/module/radio/createRadioRoot.web.js.map +1 -0
  114. package/lib/module/radio/index.js +22 -0
  115. package/lib/module/radio/index.js.map +1 -0
  116. package/lib/module/radio/types.js +4 -0
  117. package/lib/module/radio/types.js.map +1 -0
  118. package/lib/module/radio/useRadioRoot.js +60 -0
  119. package/lib/module/radio/useRadioRoot.js.map +1 -0
  120. package/lib/module/select/createSelectIcon.js +3 -1
  121. package/lib/module/select/createSelectIcon.js.map +1 -1
  122. package/lib/module/select/createSelectTrigger.js +19 -6
  123. package/lib/module/select/createSelectTrigger.js.map +1 -1
  124. package/lib/module/tile/context.js +21 -0
  125. package/lib/module/tile/context.js.map +1 -0
  126. package/lib/module/tile/createTileContent.js +24 -0
  127. package/lib/module/tile/createTileContent.js.map +1 -0
  128. package/lib/module/tile/createTileDescription.js +22 -0
  129. package/lib/module/tile/createTileDescription.js.map +1 -0
  130. package/lib/module/tile/createTileGroup.js +106 -0
  131. package/lib/module/tile/createTileGroup.js.map +1 -0
  132. package/lib/module/tile/createTileIndicator.js +40 -0
  133. package/lib/module/tile/createTileIndicator.js.map +1 -0
  134. package/lib/module/tile/createTileLeadingSlot.js +28 -0
  135. package/lib/module/tile/createTileLeadingSlot.js.map +1 -0
  136. package/lib/module/tile/createTileRoot.js +127 -0
  137. package/lib/module/tile/createTileRoot.js.map +1 -0
  138. package/lib/module/tile/createTileTitle.js +22 -0
  139. package/lib/module/tile/createTileTitle.js.map +1 -0
  140. package/lib/module/tile/createTileTrailingSlot.js +29 -0
  141. package/lib/module/tile/createTileTrailingSlot.js.map +1 -0
  142. package/lib/module/tile/index.js +39 -0
  143. package/lib/module/tile/index.js.map +1 -0
  144. package/lib/module/tile/types.js +4 -0
  145. package/lib/module/tile/types.js.map +1 -0
  146. package/lib/module/utils/dataAttributes.js +4 -22
  147. package/lib/module/utils/dataAttributes.js.map +1 -1
  148. package/lib/module/utils/domDataAttributes.js +30 -0
  149. package/lib/module/utils/domDataAttributes.js.map +1 -0
  150. package/lib/typescript/avatar/createAvatarText.d.ts.map +1 -1
  151. package/lib/typescript/button/createButtonText.d.ts.map +1 -1
  152. package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts +4 -0
  153. package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts.map +1 -1
  154. package/lib/typescript/checkbox/useCheckboxRoot.d.ts +2 -0
  155. package/lib/typescript/checkbox/useCheckboxRoot.d.ts.map +1 -1
  156. package/lib/typescript/chip/createChipRoot.d.ts +4 -0
  157. package/lib/typescript/chip/createChipRoot.d.ts.map +1 -0
  158. package/lib/typescript/chip/index.d.ts +9 -0
  159. package/lib/typescript/chip/index.d.ts.map +1 -0
  160. package/lib/typescript/chip/types.d.ts +17 -0
  161. package/lib/typescript/chip/types.d.ts.map +1 -0
  162. package/lib/typescript/field/createFieldLabel.d.ts.map +1 -1
  163. package/lib/typescript/index.d.ts +4 -0
  164. package/lib/typescript/index.d.ts.map +1 -1
  165. package/lib/typescript/input/createInputField.d.ts.map +1 -1
  166. package/lib/typescript/link/context.d.ts +10 -0
  167. package/lib/typescript/link/context.d.ts.map +1 -0
  168. package/lib/typescript/link/createLink.d.ts.map +1 -1
  169. package/lib/typescript/link/index.d.ts +2 -0
  170. package/lib/typescript/link/index.d.ts.map +1 -1
  171. package/lib/typescript/link/types.d.ts +1 -0
  172. package/lib/typescript/link/types.d.ts.map +1 -1
  173. package/lib/typescript/list-item/createListItemRoot.d.ts.map +1 -1
  174. package/lib/typescript/radio/context.d.ts +21 -0
  175. package/lib/typescript/radio/context.d.ts.map +1 -0
  176. package/lib/typescript/radio/createRadioGroup.d.ts +3 -0
  177. package/lib/typescript/radio/createRadioGroup.d.ts.map +1 -0
  178. package/lib/typescript/radio/createRadioIndicator.d.ts +5 -0
  179. package/lib/typescript/radio/createRadioIndicator.d.ts.map +1 -0
  180. package/lib/typescript/radio/createRadioLabel.d.ts +5 -0
  181. package/lib/typescript/radio/createRadioLabel.d.ts.map +1 -0
  182. package/lib/typescript/radio/createRadioRoot.d.ts +3 -0
  183. package/lib/typescript/radio/createRadioRoot.d.ts.map +1 -0
  184. package/lib/typescript/radio/createRadioRoot.web.d.ts +3 -0
  185. package/lib/typescript/radio/createRadioRoot.web.d.ts.map +1 -0
  186. package/lib/typescript/radio/index.d.ts +10 -0
  187. package/lib/typescript/radio/index.d.ts.map +1 -0
  188. package/lib/typescript/radio/types.d.ts +54 -0
  189. package/lib/typescript/radio/types.d.ts.map +1 -0
  190. package/lib/typescript/radio/useRadioRoot.d.ts +151 -0
  191. package/lib/typescript/radio/useRadioRoot.d.ts.map +1 -0
  192. package/lib/typescript/select/createSelectIcon.d.ts.map +1 -1
  193. package/lib/typescript/select/createSelectTrigger.d.ts.map +1 -1
  194. package/lib/typescript/tile/context.d.ts +9 -0
  195. package/lib/typescript/tile/context.d.ts.map +1 -0
  196. package/lib/typescript/tile/createTileContent.d.ts +3 -0
  197. package/lib/typescript/tile/createTileContent.d.ts.map +1 -0
  198. package/lib/typescript/tile/createTileDescription.d.ts +3 -0
  199. package/lib/typescript/tile/createTileDescription.d.ts.map +1 -0
  200. package/lib/typescript/tile/createTileGroup.d.ts +4 -0
  201. package/lib/typescript/tile/createTileGroup.d.ts.map +1 -0
  202. package/lib/typescript/tile/createTileIndicator.d.ts +4 -0
  203. package/lib/typescript/tile/createTileIndicator.d.ts.map +1 -0
  204. package/lib/typescript/tile/createTileLeadingSlot.d.ts +4 -0
  205. package/lib/typescript/tile/createTileLeadingSlot.d.ts.map +1 -0
  206. package/lib/typescript/tile/createTileRoot.d.ts +4 -0
  207. package/lib/typescript/tile/createTileRoot.d.ts.map +1 -0
  208. package/lib/typescript/tile/createTileTitle.d.ts +3 -0
  209. package/lib/typescript/tile/createTileTitle.d.ts.map +1 -0
  210. package/lib/typescript/tile/createTileTrailingSlot.d.ts +9 -0
  211. package/lib/typescript/tile/createTileTrailingSlot.d.ts.map +1 -0
  212. package/lib/typescript/tile/index.d.ts +15 -0
  213. package/lib/typescript/tile/index.d.ts.map +1 -0
  214. package/lib/typescript/tile/types.d.ts +119 -0
  215. package/lib/typescript/tile/types.d.ts.map +1 -0
  216. package/lib/typescript/utils/dataAttributes.d.ts +4 -10
  217. package/lib/typescript/utils/dataAttributes.d.ts.map +1 -1
  218. package/lib/typescript/utils/domDataAttributes.d.ts +15 -0
  219. package/lib/typescript/utils/domDataAttributes.d.ts.map +1 -0
  220. package/package.json +5 -2
  221. package/src/CLAUDE.md +32 -0
  222. package/src/avatar/createAvatarText.tsx +10 -1
  223. package/src/button/createButtonText.tsx +1 -0
  224. package/src/checkbox/createCheckboxRoot.web.tsx +6 -2
  225. package/src/chip/createChipRoot.tsx +144 -0
  226. package/src/chip/index.ts +18 -0
  227. package/src/chip/types.ts +23 -0
  228. package/src/field/createFieldLabel.tsx +4 -1
  229. package/src/index.ts +4 -0
  230. package/src/input/createInputField.tsx +6 -0
  231. package/src/link/context.tsx +10 -0
  232. package/src/link/createLink.tsx +41 -23
  233. package/src/link/index.tsx +2 -0
  234. package/src/link/types.ts +1 -0
  235. package/src/list-item/createListItemRoot.tsx +37 -22
  236. package/src/radio/context.tsx +21 -0
  237. package/src/radio/createRadioGroup.tsx +67 -0
  238. package/src/radio/createRadioIndicator.tsx +32 -0
  239. package/src/radio/createRadioLabel.tsx +28 -0
  240. package/src/radio/createRadioRoot.tsx +100 -0
  241. package/src/radio/createRadioRoot.web.tsx +81 -0
  242. package/src/radio/index.ts +37 -0
  243. package/src/radio/types.ts +67 -0
  244. package/src/radio/useRadioRoot.ts +69 -0
  245. package/src/select/createSelectIcon.tsx +2 -1
  246. package/src/select/createSelectTrigger.tsx +26 -3
  247. package/src/tile/context.tsx +23 -0
  248. package/src/tile/createTileContent.tsx +23 -0
  249. package/src/tile/createTileDescription.tsx +19 -0
  250. package/src/tile/createTileGroup.tsx +134 -0
  251. package/src/tile/createTileIndicator.tsx +38 -0
  252. package/src/tile/createTileLeadingSlot.tsx +30 -0
  253. package/src/tile/createTileRoot.tsx +124 -0
  254. package/src/tile/createTileTitle.tsx +19 -0
  255. package/src/tile/createTileTrailingSlot.tsx +25 -0
  256. package/src/tile/index.ts +88 -0
  257. package/src/tile/types.ts +153 -0
  258. package/src/utils/dataAttributes.ts +4 -25
  259. package/src/utils/domDataAttributes.ts +32 -0
@@ -0,0 +1,54 @@
1
+ import type { PressableProps } from 'react-native';
2
+ export interface IRadioProps extends PressableProps {
3
+ /** Required — identifies this item's value within a Radio.Group. */
4
+ value: string;
5
+ isDisabled?: boolean;
6
+ isInvalid?: boolean;
7
+ isReadOnly?: boolean;
8
+ isHovered?: boolean;
9
+ isFocused?: boolean;
10
+ isPressed?: boolean;
11
+ isFocusVisible?: boolean;
12
+ children?: React.ReactNode;
13
+ }
14
+ export interface IRadioGroupProps {
15
+ /** Controlled selected value. */
16
+ value?: string;
17
+ /** Default selected value for uncontrolled usage. */
18
+ defaultValue?: string;
19
+ /** Called when the selected value changes. */
20
+ onChange?: (value: string) => void;
21
+ /** Layout direction of the radio items. */
22
+ direction?: 'column' | 'row';
23
+ /** Form field name for web form integration. */
24
+ name?: string;
25
+ isDisabled?: boolean;
26
+ isInvalid?: boolean;
27
+ isRequired?: boolean;
28
+ isReadOnly?: boolean;
29
+ 'aria-label'?: string;
30
+ 'aria-labelledby'?: string;
31
+ children?: React.ReactNode;
32
+ }
33
+ export interface IRadioIndicatorProps {
34
+ children?: React.ReactNode;
35
+ }
36
+ export interface IRadioLabelProps {
37
+ children?: React.ReactNode;
38
+ }
39
+ export type IRadioComponentType<Root, Indicator, Label, Group> = React.ForwardRefExoticComponent<React.RefAttributes<Root> & React.PropsWithoutRef<Root> & IRadioProps> & {
40
+ Indicator: React.ForwardRefExoticComponent<React.RefAttributes<Indicator> & React.PropsWithoutRef<Indicator> & IRadioIndicatorProps>;
41
+ Label: React.ForwardRefExoticComponent<React.RefAttributes<Label> & React.PropsWithoutRef<Label> & IRadioLabelProps>;
42
+ Group: React.ForwardRefExoticComponent<React.RefAttributes<Group> & React.PropsWithoutRef<Group> & IRadioGroupProps>;
43
+ };
44
+ export interface IRadioContextValue {
45
+ isChecked?: boolean;
46
+ isDisabled?: boolean;
47
+ isInvalid?: boolean;
48
+ isReadOnly?: boolean;
49
+ isFocused?: boolean;
50
+ isFocusVisible?: boolean;
51
+ isHovered?: boolean;
52
+ isPressed?: boolean;
53
+ }
54
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/radio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC7B,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,MAAM,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC,yBAAyB,CAC9F,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,WAAW,CACtE,GAAG;IACF,SAAS,EAAE,KAAK,CAAC,yBAAyB,CACxC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,oBAAoB,CACzF,CAAC;IACF,KAAK,EAAE,KAAK,CAAC,yBAAyB,CACpC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAC7E,CAAC;IACF,KAAK,EAAE,KAAK,CAAC,yBAAyB,CACpC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAC7E,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,151 @@
1
+ import type { IRadioProps } from './types';
2
+ interface UseRadioRootOptions {
3
+ useInputRefForAria?: boolean;
4
+ }
5
+ export declare function useRadioRoot(props: IRadioProps, ref?: React.Ref<unknown>, { useInputRefForAria }?: UseRadioRootOptions): {
6
+ combinedProps: {
7
+ value: string;
8
+ isDisabled?: boolean | undefined;
9
+ isHovered?: boolean;
10
+ isFocused?: boolean;
11
+ isPressed?: boolean;
12
+ isFocusVisible?: boolean;
13
+ children?: React.ReactNode;
14
+ onHoverIn?: null | ((event: import("react-native").MouseEvent) => void) | undefined;
15
+ onHoverOut?: null | ((event: import("react-native").MouseEvent) => void) | undefined;
16
+ onPress?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
17
+ onPressIn?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
18
+ onPressOut?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
19
+ onLongPress?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
20
+ onBlur?: null | ((event: import("react-native").NativeSyntheticEvent<import("react-native").TargetedEvent>) => void) | undefined;
21
+ onFocus?: null | ((event: import("react-native").NativeSyntheticEvent<import("react-native").TargetedEvent>) => void) | undefined;
22
+ cancelable?: null | boolean | undefined;
23
+ delayHoverIn?: number | null | undefined;
24
+ delayHoverOut?: number | null | undefined;
25
+ delayLongPress?: null | number | undefined;
26
+ disabled?: null | boolean | undefined;
27
+ hitSlop?: null | import("react-native").Insets | number | undefined;
28
+ pressRetentionOffset?: null | import("react-native").Insets | number | undefined;
29
+ android_disableSound?: null | boolean | undefined;
30
+ android_ripple?: null | import("react-native").PressableAndroidRippleConfig | undefined;
31
+ testOnly_pressed?: null | boolean | undefined;
32
+ style?: import("react-native").StyleProp<import("react-native").ViewStyle> | ((state: import("react-native").PressableStateCallbackType) => import("react-native").StyleProp<import("react-native").ViewStyle>) | undefined;
33
+ unstable_pressDelay?: number | undefined;
34
+ accessible?: boolean | undefined;
35
+ accessibilityActions?: ReadonlyArray<import("react-native").AccessibilityActionInfo> | undefined;
36
+ accessibilityLabel?: string | undefined;
37
+ 'aria-label'?: string | undefined;
38
+ accessibilityRole?: import("react-native").AccessibilityRole | undefined;
39
+ accessibilityState?: import("react-native").AccessibilityState | undefined;
40
+ 'aria-busy'?: boolean | undefined;
41
+ 'aria-checked'?: boolean | "mixed" | undefined;
42
+ 'aria-disabled'?: boolean | undefined;
43
+ 'aria-expanded'?: boolean | undefined;
44
+ 'aria-selected'?: boolean | undefined;
45
+ accessibilityHint?: string | undefined;
46
+ accessibilityValue?: import("react-native").AccessibilityValue | undefined;
47
+ 'aria-valuemax'?: import("react-native").AccessibilityValue["max"] | undefined;
48
+ 'aria-valuemin'?: import("react-native").AccessibilityValue["min"] | undefined;
49
+ 'aria-valuenow'?: import("react-native").AccessibilityValue["now"] | undefined;
50
+ 'aria-valuetext'?: import("react-native").AccessibilityValue["text"] | undefined;
51
+ onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined;
52
+ importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined;
53
+ 'aria-hidden'?: boolean | undefined;
54
+ 'aria-modal'?: boolean | undefined;
55
+ role?: import("react-native").Role | undefined;
56
+ accessibilityLabelledBy?: string | string[] | undefined;
57
+ 'aria-labelledby'?: string | undefined;
58
+ accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
59
+ 'aria-live'?: ("polite" | "assertive" | "off") | undefined;
60
+ screenReaderFocusable?: boolean | undefined;
61
+ accessibilityElementsHidden?: boolean | undefined;
62
+ accessibilityViewIsModal?: boolean | undefined;
63
+ onAccessibilityEscape?: (() => void) | undefined;
64
+ onAccessibilityTap?: (() => void) | undefined;
65
+ onMagicTap?: (() => void) | undefined;
66
+ accessibilityIgnoresInvertColors?: boolean | undefined;
67
+ accessibilityLanguage?: string | undefined;
68
+ accessibilityShowsLargeContentViewer?: boolean | undefined;
69
+ accessibilityLargeContentTitle?: string | undefined;
70
+ accessibilityRespondsToUserInteraction?: boolean | undefined;
71
+ id?: string | undefined;
72
+ onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined | undefined;
73
+ testID?: string | undefined | undefined;
74
+ nativeID?: string | undefined | undefined;
75
+ needsOffscreenAlphaCompositing?: boolean | undefined | undefined;
76
+ pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined | undefined;
77
+ removeClippedSubviews?: boolean | undefined | undefined;
78
+ collapsable?: boolean | undefined | undefined;
79
+ collapsableChildren?: boolean | undefined | undefined;
80
+ renderToHardwareTextureAndroid?: boolean | undefined | undefined;
81
+ focusable?: boolean | undefined | undefined;
82
+ tabIndex?: 0 | -1 | undefined | undefined;
83
+ shouldRasterizeIOS?: boolean | undefined | undefined;
84
+ isTVSelectable?: boolean | undefined | undefined;
85
+ hasTVPreferredFocus?: boolean | undefined | undefined;
86
+ tvParallaxShiftDistanceX?: number | undefined | undefined;
87
+ tvParallaxShiftDistanceY?: number | undefined | undefined;
88
+ tvParallaxTiltAngle?: number | undefined | undefined;
89
+ tvParallaxMagnification?: number | undefined | undefined;
90
+ onStartShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
91
+ onMoveShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
92
+ onResponderEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
93
+ onResponderGrant?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
94
+ onResponderReject?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
95
+ onResponderMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
96
+ onResponderRelease?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
97
+ onResponderStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
98
+ onResponderTerminationRequest?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
99
+ onResponderTerminate?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
100
+ onStartShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
101
+ onMoveShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
102
+ onTouchStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
103
+ onTouchMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
104
+ onTouchEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
105
+ onTouchCancel?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
106
+ onTouchEndCapture?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
107
+ onPointerEnter?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
108
+ onPointerEnterCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
109
+ onPointerLeave?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
110
+ onPointerLeaveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
111
+ onPointerMove?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
112
+ onPointerMoveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
113
+ onPointerCancel?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
114
+ onPointerCancelCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
115
+ onPointerDown?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
116
+ onPointerDownCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
117
+ onPointerUp?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
118
+ onPointerUpCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
119
+ hasFeedbackText?: boolean | undefined;
120
+ hasHelpText?: boolean | undefined;
121
+ setHasFeedbackText?: import("react").Dispatch<import("react").SetStateAction<boolean>> | undefined;
122
+ setHasHelpText?: import("react").Dispatch<import("react").SetStateAction<boolean>> | undefined;
123
+ name?: string | undefined;
124
+ labelId?: string | undefined;
125
+ feedbackId?: string | undefined;
126
+ helpTextId?: string | undefined;
127
+ htmlProps?: {
128
+ [x: string]: unknown;
129
+ } | undefined;
130
+ inputRef?: React.RefObject<import("react-native").TextInput | null> | undefined;
131
+ focusInput?: (() => void) | undefined;
132
+ isLabelFocused?: boolean | undefined;
133
+ setIsLabelFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
134
+ isRequired?: boolean | undefined;
135
+ };
136
+ isInvalid: boolean;
137
+ isReadOnly: boolean;
138
+ inputProps: any;
139
+ labelProps: Record<string, unknown>;
140
+ isChecked: any;
141
+ isDisabled: any;
142
+ isHovered: boolean;
143
+ hoverProps: {
144
+ onHoverIn: () => void;
145
+ onHoverOut: () => void;
146
+ };
147
+ mergedRef: import("react").RefCallback<unknown>;
148
+ inputRef: import("react").RefObject<HTMLInputElement | null>;
149
+ };
150
+ export {};
151
+ //# sourceMappingURL=useRadioRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRadioRoot.d.ts","sourceRoot":"","sources":["../../../src/radio/useRadioRoot.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,UAAU,mBAAmB;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,WAAW,EAClB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EACxB,EAAE,kBAA0B,EAAE,GAAE,mBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createSelectIcon.d.ts","sourceRoot":"","sources":["../../../src/select/createSelectIcon.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAG,UAAU,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,yGAsBjE,CAAC"}
1
+ {"version":3,"file":"createSelectIcon.d.ts","sourceRoot":"","sources":["../../../src/select/createSelectIcon.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAG,UAAU,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,yGAuBjE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createSelectTrigger.d.ts","sourceRoot":"","sources":["../../../src/select/createSelectTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAG,aAAa,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;eAaxD,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS;iCAiMhF,CAAC"}
1
+ {"version":3,"file":"createSelectTrigger.d.ts","sourceRoot":"","sources":["../../../src/select/createSelectTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAG,aAAa,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;eAaxD,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS;iCAmNhF,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ITileContextValue, ITileGroupContextValue } from './types';
2
+ export declare const TileProvider: import("react").FunctionComponent<{
3
+ children: import("react").ReactNode;
4
+ value: ITileContextValue;
5
+ }>, useTileContext: () => ITileContextValue;
6
+ export declare const TileGroupContextProvider: import("react").Provider<ITileGroupContextValue | null>;
7
+ export declare function useTileGroupContext(): ITileGroupContextValue;
8
+ export declare function useOptionalTileGroupContext(): ITileGroupContextValue | null;
9
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/tile/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGzE,eAAO,MAAO,YAAY;;;IAAE,cAAc,yBAAmD,CAAC;AAK9F,eAAO,MAAM,wBAAwB,yDAA4B,CAAC;AAElE,wBAAgB,mBAAmB,IAAI,sBAAsB,CAM5D;AAED,wBAAgB,2BAA2B,IAAI,sBAAsB,GAAG,IAAI,CAE3E"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const createTileContent: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<import("react-native").ViewProps & React.RefAttributes<unknown>>;
3
+ //# sourceMappingURL=createTileContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTileContent.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,qGAY9D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const createTileDescription: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<import("react-native").TextProps & React.RefAttributes<unknown>>;
3
+ //# sourceMappingURL=createTileDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTileDescription.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileDescription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,qGAYlE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { ITileGroupProps } from './types';
3
+ export declare const createTileGroup: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<ITileGroupProps & React.RefAttributes<T>>;
4
+ //# sourceMappingURL=createTileGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTileGroup.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAK1E,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAgB9D,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,8EAgH5D,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { ITileIndicatorProps } from './types';
3
+ export declare const createTileIndicator: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<ITileIndicatorProps & React.RefAttributes<unknown>>;
4
+ //# sourceMappingURL=createTileIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTileIndicator.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,wFA8BjE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { ITileLeadingSlotProps } from './types';
3
+ export declare const createTileLeadingSlot: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<ITileLeadingSlotProps & React.RefAttributes<unknown>>;
4
+ //# sourceMappingURL=createTileLeadingSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTileLeadingSlot.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileLeadingSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIrD,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,0FAuBnE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { ITileProps } from './types';
3
+ export declare const createTileRoot: <T>(BasePressable: React.ComponentType<T>) => React.ForwardRefExoticComponent<ITileProps & React.RefAttributes<unknown>>;
4
+ //# sourceMappingURL=createTileRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTileRoot.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,OAAO,KAAK,EAAE,UAAU,EAA6B,MAAM,SAAS,CAAC;AAQrE,eAAO,MAAM,cAAc,GAAI,CAAC,EAAG,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,+EA6GpE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const createTileTitle: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<import("react-native").TextProps & React.RefAttributes<unknown>>;
3
+ //# sourceMappingURL=createTileTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTileTitle.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,qGAY5D,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ /**
3
+ * Generic trailing content (chevron, amount, chip, status). Distinct from `Tile.Indicator`,
4
+ * which is purpose-built for the radio/checkbox selection affordance.
5
+ *
6
+ * Trailing content is meaningful by default (`aria-hidden` falsy), unlike the indicator.
7
+ */
8
+ export declare const createTileTrailingSlot: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<import("react-native").ViewProps & React.RefAttributes<unknown>>;
9
+ //# sourceMappingURL=createTileTrailingSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTileTrailingSlot.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileTrailingSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,qGAYnE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type React from 'react';
2
+ import type { ITileComponentType } from './types';
3
+ export type { ITileComponentType, ITileContentProps, ITileContextValue, ITileDescriptionProps, ITileGroupMultipleProps, ITileGroupProps, ITileGroupSingleProps, ITileGroupContextValue, ITileIndicatorProps, ITileLeadingSlotProps, ITilePressablePassthrough, ITileProps, ITileTitleProps, ITileTrailingSlotProps, TileGroupType, TileGroupValue, } from './types';
4
+ export { TileProvider, useTileContext } from './context';
5
+ export declare function createTile<Pressable, Leading, Content, Title, Description, Indicator, TrailingSlot, Group>(BaseComponents: {
6
+ Pressable: React.ComponentType<Pressable>;
7
+ LeadingSlot: React.ComponentType<Leading>;
8
+ Content: React.ComponentType<Content>;
9
+ Title: React.ComponentType<Title>;
10
+ Description: React.ComponentType<Description>;
11
+ Indicator: React.ComponentType<Indicator>;
12
+ TrailingSlot: React.ComponentType<TrailingSlot>;
13
+ Group: React.ComponentType<Group>;
14
+ }): ITileComponentType<Pressable, Leading, Content, Title, Description, Indicator, TrailingSlot, Group>;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzD,wBAAgB,UAAU,CACxB,SAAS,EACT,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,KAAK,EACL,cAAc,EAAE;IAChB,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC1C,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAC9C,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC1C,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAChD,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CACnC,GA2BO,kBAAkB,CACtB,SAAS,EACT,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,KAAK,CACN,CACF"}
@@ -0,0 +1,119 @@
1
+ import type { ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
2
+ import type { PressableProps, TextProps, ViewProps } from 'react-native';
3
+ import type { WithStyleContextProps } from '@cdx-ui/utils';
4
+ export type TileGroupType = 'single' | 'multiple';
5
+ export type TileGroupValue = string | string[] | undefined;
6
+ interface ITileGroupBaseProps extends ViewProps, WithStyleContextProps {
7
+ /** Disables the whole group. */
8
+ isDisabled?: boolean;
9
+ /** Accessible name for the group (radiogroup / group). */
10
+ 'aria-label'?: string;
11
+ }
12
+ export interface ITileGroupSingleProps extends ITileGroupBaseProps {
13
+ /** Single-select (radio semantics). One value at a time. */
14
+ type: 'single';
15
+ /** Controlled selected value. */
16
+ value?: string;
17
+ /** Uncontrolled initial value. */
18
+ defaultValue?: string;
19
+ /** Called when selection changes. */
20
+ onValueChange?: (value: string) => void;
21
+ }
22
+ export interface ITileGroupMultipleProps extends ITileGroupBaseProps {
23
+ /** Multi-select (checkbox semantics). Zero to `max` values at a time. */
24
+ type: 'multiple';
25
+ /** Controlled selected values. */
26
+ value?: string[];
27
+ /** Uncontrolled initial values. */
28
+ defaultValue?: string[];
29
+ /** Called when selection changes. */
30
+ onValueChange?: (value: string[]) => void;
31
+ /** Maximum selections allowed. @default Infinity */
32
+ max?: number;
33
+ }
34
+ /**
35
+ * Discriminated union: `type` narrows `value` / `defaultValue` / `onValueChange`,
36
+ * and `max` is only valid on `type="multiple"`.
37
+ */
38
+ export type ITileGroupProps = ITileGroupSingleProps | ITileGroupMultipleProps;
39
+ export interface ITileGroupContextValue {
40
+ type: TileGroupType;
41
+ /** Current selection (string for single, array for multiple). */
42
+ value: string | string[] | undefined;
43
+ toggleValue: (tileValue: string) => void;
44
+ isSelected: (tileValue: string) => boolean;
45
+ /** Group-level disabled or multi-select at max (unselected tiles). */
46
+ isTileDisabledByGroup: (tileValue: string) => boolean;
47
+ isGroupDisabled: boolean;
48
+ max: number;
49
+ }
50
+ export interface ITileContextValue {
51
+ /** This tile's `value`. */
52
+ value: string;
53
+ isSelected: boolean;
54
+ /** Effective disabled (group rules + tile `disabled`). */
55
+ isDisabled: boolean;
56
+ selectionType: TileGroupType;
57
+ }
58
+ export type ITilePressablePassthrough = Partial<Pick<PressableProps, 'onPressIn' | 'onPressOut' | 'onHoverIn' | 'onHoverOut'>>;
59
+ export interface ITileProps extends PressableProps, ITilePressablePassthrough, WithStyleContextProps {
60
+ /**
61
+ * Identifies this tile within `Tile.Group`. Must be unique within the group.
62
+ * Standalone tiles still require a value (useful for form submission, analytics, etc.).
63
+ */
64
+ value: string;
65
+ /**
66
+ * Disables this tile (in addition to group rules such as multi-select max).
67
+ */
68
+ disabled?: boolean;
69
+ /**
70
+ * Controlled selected state for **standalone** usage (no parent `Tile.Group`).
71
+ * Ignored when the tile is rendered inside a `Tile.Group` — selection is owned by the group.
72
+ */
73
+ isSelected?: boolean;
74
+ /**
75
+ * Initial selected state for **standalone**, uncontrolled usage.
76
+ */
77
+ defaultSelected?: boolean;
78
+ /**
79
+ * Called when standalone selection state changes. Group context overrides this — when inside
80
+ * a `Tile.Group`, use the group's `onValueChange` instead.
81
+ */
82
+ onSelectedChange?: (isSelected: boolean) => void;
83
+ }
84
+ export interface ITileLeadingSlotProps extends ViewProps {
85
+ /**
86
+ * Leading content is decorative by default for screen readers.
87
+ * @default true
88
+ */
89
+ 'aria-hidden'?: boolean;
90
+ }
91
+ export type ITileContentProps = ViewProps;
92
+ export type ITileTitleProps = TextProps;
93
+ export type ITileDescriptionProps = TextProps;
94
+ export interface ITileIndicatorProps extends ViewProps {
95
+ /**
96
+ * Explicit indicator visual. When inside a `Tile.Group`, auto-infers from `type`
97
+ * (`single` → radio, `multiple` → checkbox). For standalone tiles, defaults to `'checkbox'`
98
+ * to match the standalone `checkbox` ARIA role; override with `indicatorType="radio"` if
99
+ * a radio-style visual is needed.
100
+ */
101
+ indicatorType?: 'radio' | 'checkbox';
102
+ children?: ReactNode;
103
+ }
104
+ /**
105
+ * Generic trailing content slot. Use for chevrons, amounts, chips, status text — anything that
106
+ * is **not** the radio/checkbox selection affordance. For that, use `Tile.Indicator`.
107
+ */
108
+ export type ITileTrailingSlotProps = ViewProps;
109
+ export type ITileComponentType<RootRef, LeadingSlot, Content, Title, Description, Indicator, TrailingSlot, Group> = ForwardRefExoticComponent<RefAttributes<RootRef> & ITileProps> & {
110
+ Group: ForwardRefExoticComponent<RefAttributes<Group> & PropsWithoutRef<Group> & ITileGroupProps>;
111
+ LeadingSlot: ForwardRefExoticComponent<RefAttributes<LeadingSlot> & PropsWithoutRef<LeadingSlot> & ITileLeadingSlotProps>;
112
+ Content: ForwardRefExoticComponent<RefAttributes<Content> & PropsWithoutRef<Content> & ITileContentProps>;
113
+ Title: ForwardRefExoticComponent<RefAttributes<Title> & PropsWithoutRef<Title> & ITileTitleProps>;
114
+ Description: ForwardRefExoticComponent<RefAttributes<Description> & PropsWithoutRef<Description> & ITileDescriptionProps>;
115
+ Indicator: ForwardRefExoticComponent<RefAttributes<Indicator> & PropsWithoutRef<Indicator> & ITileIndicatorProps>;
116
+ TrailingSlot: ForwardRefExoticComponent<RefAttributes<TrailingSlot> & PropsWithoutRef<TrailingSlot> & ITileTrailingSlotProps>;
117
+ };
118
+ export {};
119
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;AAE3D,UAAU,mBAAoB,SAAQ,SAAS,EAAE,qBAAqB;IACpE,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE,4DAA4D;IAC5D,IAAI,EAAE,QAAQ,CAAC;IACf,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,yEAAyE;IACzE,IAAI,EAAE,UAAU,CAAC;IACjB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,qCAAqC;IACrC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AAE9E,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB,iEAAiE;IACjE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACrC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,sEAAsE;IACtE,qBAAqB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IACtD,eAAe,EAAE,OAAO,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC,CAC9E,CAAC;AAEF,MAAM,WAAW,UACf,SAAQ,cAAc,EAAE,yBAAyB,EAAE,qBAAqB;IACxE;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAC1C,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AACxC,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAC9C,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,kBAAkB,CAC5B,OAAO,EACP,WAAW,EACX,OAAO,EACP,KAAK,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,KAAK,IACH,yBAAyB,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,GAAG;IACnE,KAAK,EAAE,yBAAyB,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,CAAC;IAClG,WAAW,EAAE,yBAAyB,CACpC,aAAa,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,qBAAqB,CAClF,CAAC;IACF,OAAO,EAAE,yBAAyB,CAChC,aAAa,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,iBAAiB,CACtE,CAAC;IACF,KAAK,EAAE,yBAAyB,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,CAAC;IAClG,WAAW,EAAE,yBAAyB,CACpC,aAAa,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,qBAAqB,CAClF,CAAC;IACF,SAAS,EAAE,yBAAyB,CAClC,aAAa,CAAC,SAAS,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG,mBAAmB,CAC5E,CAAC;IACF,YAAY,EAAE,yBAAyB,CACrC,aAAa,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,GAAG,sBAAsB,CACrF,CAAC;CACH,CAAC"}
@@ -1,14 +1,8 @@
1
1
  /**
2
- * Produces platform-specific props for data attributes.
2
+ * Produces `data-*` props for native platforms (consumed by Uniwind).
3
+ * Web (.web.ts): returns a `dataSet` object consumed by React Native Web instead.
3
4
  *
4
- * Native: individual `data-*` props consumed by Uniwind.
5
- * Web (.web.ts): a `dataSet` object consumed by React Native Web.
6
- *
7
- * Boolean values serialize to `"true"` / `"false"` strings.
8
- * String values pass through as-is.
9
- * Undefined values are omitted.
5
+ * Delegates to `domDataAttributes` so the conversion logic has a single source of truth.
10
6
  */
11
- type DataAttributeValue = boolean | string | undefined;
12
- export declare function dataAttributes(attrs: Record<string, DataAttributeValue>): Record<string, string>;
13
- export {};
7
+ export { domDataAttributes as dataAttributes } from './domDataAttributes';
14
8
  //# sourceMappingURL=dataAttributes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataAttributes.d.ts","sourceRoot":"","sources":["../../../src/utils/dataAttributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,KAAK,kBAAkB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAMvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUhG"}
1
+ {"version":3,"file":"dataAttributes.d.ts","sourceRoot":"","sources":["../../../src/utils/dataAttributes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,iBAAiB,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Produces `data-*` DOM attribute props for use on raw HTML elements (e.g. `<button>`).
3
+ *
4
+ * Unlike `dataAttributes`, which has a platform-specific `.web.ts` sibling that returns a
5
+ * `dataSet` object for React Native Web components, this file has no platform variant.
6
+ * The bundler therefore always resolves to this single implementation, making it safe to
7
+ * import from `.web.tsx` host components that render native DOM elements directly.
8
+ *
9
+ * Boolean values serialize to `"true"` / `"false"` strings.
10
+ * String values pass through as-is.
11
+ * Undefined values are omitted.
12
+ */
13
+ export type DomDataAttributeValue = boolean | string | undefined;
14
+ export declare function domDataAttributes(attrs: Record<string, DomDataAttributeValue>): Record<string, string>;
15
+ //# sourceMappingURL=domDataAttributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domDataAttributes.d.ts","sourceRoot":"","sources":["../../../src/utils/domDataAttributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAMjE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAC3C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdx-ui/primitives",
3
- "version": "0.0.1-beta.5",
3
+ "version": "0.0.1-beta.51",
4
4
  "main": "lib/commonjs/index.js",
5
5
  "module": "lib/module/index.js",
6
6
  "react-native": "src/index.ts",
@@ -51,13 +51,16 @@
51
51
  }
52
52
  },
53
53
  "dependencies": {
54
+ "@react-aria/utils": "^3.33.0",
54
55
  "@react-aria/visually-hidden": "3.8.30",
55
56
  "@react-native-aria/checkbox": "0.2.10",
56
57
  "@react-native-aria/focus": "^0.2.9",
57
58
  "@react-native-aria/interactions": "^0.2.16",
59
+ "@react-native-aria/radio": "0.2.13",
58
60
  "@react-stately/checkbox": "3.7.4",
61
+ "@react-stately/radio": "3.12.0",
59
62
  "@react-stately/toggle": "3.9.4",
60
- "@cdx-ui/utils": "0.0.1-beta.5"
63
+ "@cdx-ui/utils": "0.0.1-beta.51"
61
64
  },
62
65
  "devDependencies": {
63
66
  "@types/react": "*",
package/src/CLAUDE.md ADDED
@@ -0,0 +1,32 @@
1
+ # Primitive Authoring
2
+
3
+ Auto-loaded when working in `packages/primitives/src/**`.
4
+
5
+ Primitives in `@cdx-ui/primitives` are unstyled behavioral components that handle accessibility and interactions. Read the full guides before making changes:
6
+
7
+ - `docs/internal/practices/composition.md` — compound component structure
8
+ - `docs/internal/practices/types.md` — `I*Props` convention, extending RN base types
9
+ - `docs/internal/practices/accessibility.md` — ARIA roles, keyboard nav, screen reader support
10
+ - `docs/internal/practices/as-child.md` — `asChild` prop pattern
11
+
12
+ ## Pattern summary
13
+
14
+ Each primitive follows the factory function pattern (see `createButtonRoot.tsx` as the canonical example):
15
+
16
+ 1. **Factory function** — `export const createComponentPart = <T,>(BaseComponent: ComponentType<T>) => forwardRef(...)` — accepts a host element type, returns a wrapped component with behavior
17
+ 2. **Interaction hooks** — `useFocus`, `useFocusRing`, `useHover`, `usePress` from `@react-native-aria/*`
18
+ 3. **Data attributes** — `dataAttributes({ hover, focus, active, disabled, focusVisible })` emitted on the rendered element for Uniwind `data-[state]` selectors
19
+ 4. **Context provider** — interaction state exposed via context so child primitives can react to parent state
20
+ 5. **Barrel export** — `index.tsx` re-exports the factory, context, and types
21
+
22
+ ## Key rules
23
+
24
+ - **Unstyled** — no visual styling (no `className`, no color/spacing classes). Only behavioral and a11y concerns.
25
+ - **`I*Props` convention** — public prop types are aliased with `I` prefix (e.g., `IButtonProps`, `ICheckboxProps`), exported from `types.ts`
26
+ - **`Interface*Props` pattern** — the full interface (e.g., `InterfaceButtonProps`, `InterfaceCheckbox`) extends the appropriate RN base type (`PressableProps`, `ViewProps`, etc.) with interaction state booleans (`isHovered`, `isActive`, `isFocused`, `isFocusVisible`, `isDisabled`); re-exported as `I*Props` (e.g., `export type IButtonProps = InterfaceButtonProps`)
27
+ - **`dataAttributes()` helper** — always use the helper from `../utils/dataAttributes` to emit `data-*` props; it handles platform differences (native vs web)
28
+ - **`composeEventHandlers`** from `@cdx-ui/utils` — merge consumer handlers with internal handlers; never silently override
29
+ - **`forwardRef`** on every component — refs forwarded to the underlying host element
30
+ - **ARIA roles** — set `role` with a sensible default (e.g., `role={props?.role || 'button'}`)
31
+ - **Render children as function** — support `children` as `(state: InteractionState) => ReactNode` for state-driven rendering
32
+ - **Consumable independently** of `@cdx-ui/components` — no imports from the styled layer
@@ -4,7 +4,16 @@ import { useAvatarContext } from './context';
4
4
  import type { IAvatarTextProps } from './types';
5
5
 
6
6
  function getInitials(name: string): string {
7
- const words = name.trim().split(/\s+/);
7
+ const trimmed = name.trim();
8
+ const words = trimmed.split(/\s+/);
9
+
10
+ // Pre-composed initials (e.g. "JD", "AB") — single token, at most 2 chars.
11
+ // Figma Code Connect surfaces the raw text property which is already initials;
12
+ // passing them through a derivation step would truncate to the first letter.
13
+ if (words.length === 1 && trimmed.length <= 2) {
14
+ return trimmed.toUpperCase();
15
+ }
16
+
8
17
  let result = '';
9
18
  for (const word of words) {
10
19
  if (word.length > 0) {
@@ -5,6 +5,7 @@ import { useButtonContext } from './context';
5
5
  import type { IButtonTextProps } from './types';
6
6
 
7
7
  // TODO: Rename to ButtonLabel
8
+ // TODO: Can we remove the dataAttributes here?
8
9
 
9
10
  export const createButtonText = <T,>(BaseButtonText: React.ComponentType<T>) =>
10
11
  forwardRef<unknown, IButtonTextProps>(({ children, ...props }, ref) => {