@cdx-ui/primitives 0.0.1-beta.65 → 0.0.1-beta.67

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 (988) hide show
  1. package/README.md +35 -36
  2. package/lib/commonjs/CLAUDE.md +64 -12
  3. package/lib/commonjs/avatar/{createAvatarRoot.js → AvatarRoot.js} +10 -6
  4. package/lib/commonjs/avatar/AvatarRoot.js.map +1 -0
  5. package/lib/commonjs/avatar/index.js +14 -24
  6. package/lib/commonjs/avatar/index.js.map +1 -1
  7. package/lib/commonjs/button/{createButtonRoot.js → ButtonRoot.js} +13 -9
  8. package/lib/commonjs/button/ButtonRoot.js.map +1 -0
  9. package/lib/commonjs/button/index.js +7 -24
  10. package/lib/commonjs/button/index.js.map +1 -1
  11. package/lib/commonjs/checkbox/{createCheckboxGroup.js → CheckboxGroup.js} +20 -12
  12. package/lib/commonjs/checkbox/CheckboxGroup.js.map +1 -0
  13. package/lib/commonjs/checkbox/CheckboxRoot.js +103 -0
  14. package/lib/commonjs/checkbox/CheckboxRoot.js.map +1 -0
  15. package/lib/commonjs/checkbox/CheckboxRoot.web.js +94 -0
  16. package/lib/commonjs/checkbox/CheckboxRoot.web.js.map +1 -0
  17. package/lib/commonjs/checkbox/index.js +21 -24
  18. package/lib/commonjs/checkbox/index.js.map +1 -1
  19. package/lib/commonjs/chip/ChipRoot.js +147 -0
  20. package/lib/commonjs/chip/ChipRoot.js.map +1 -0
  21. package/lib/commonjs/chip/context.js +11 -0
  22. package/lib/commonjs/chip/context.js.map +1 -0
  23. package/lib/commonjs/chip/index.js +14 -10
  24. package/lib/commonjs/chip/index.js.map +1 -1
  25. package/lib/commonjs/dialog/DialogClose.js +32 -0
  26. package/lib/commonjs/dialog/DialogClose.js.map +1 -0
  27. package/lib/commonjs/dialog/{createDialogPopup.js → DialogPopup.js} +18 -14
  28. package/lib/commonjs/dialog/DialogPopup.js.map +1 -0
  29. package/lib/commonjs/dialog/{createDialogRoot.js → DialogRoot.js} +11 -8
  30. package/lib/commonjs/dialog/DialogRoot.js.map +1 -0
  31. package/lib/commonjs/dialog/DialogTrigger.js +32 -0
  32. package/lib/commonjs/dialog/DialogTrigger.js.map +1 -0
  33. package/lib/commonjs/dialog/index.js +28 -41
  34. package/lib/commonjs/dialog/index.js.map +1 -1
  35. package/lib/commonjs/field/FieldLabel.js +48 -0
  36. package/lib/commonjs/field/FieldLabel.js.map +1 -0
  37. package/lib/commonjs/field/FieldLabel.web.js +60 -0
  38. package/lib/commonjs/field/FieldLabel.web.js.map +1 -0
  39. package/lib/commonjs/field/FieldRoot.js +38 -0
  40. package/lib/commonjs/field/FieldRoot.js.map +1 -0
  41. package/lib/commonjs/field/index.js +14 -40
  42. package/lib/commonjs/field/index.js.map +1 -1
  43. package/lib/commonjs/form/FormRoot.js +25 -0
  44. package/lib/commonjs/form/FormRoot.js.map +1 -0
  45. package/lib/commonjs/{dialog/createDialogFooter.js → form/FormRoot.web.js} +14 -8
  46. package/lib/commonjs/form/FormRoot.web.js.map +1 -0
  47. package/lib/commonjs/form/index.js +7 -9
  48. package/lib/commonjs/form/index.js.map +1 -1
  49. package/lib/commonjs/index.js +42 -5
  50. package/lib/commonjs/index.js.map +1 -1
  51. package/lib/commonjs/input/{createInputField.js → InputField.android.js} +36 -38
  52. package/lib/commonjs/input/InputField.android.js.map +1 -0
  53. package/lib/commonjs/input/InputField.js +92 -0
  54. package/lib/commonjs/input/InputField.js.map +1 -0
  55. package/lib/commonjs/input/InputField.web.js +131 -0
  56. package/lib/commonjs/input/InputField.web.js.map +1 -0
  57. package/lib/commonjs/input/{createInputRoot.js → InputRoot.js} +29 -27
  58. package/lib/commonjs/input/InputRoot.js.map +1 -0
  59. package/lib/commonjs/input/index.js +21 -16
  60. package/lib/commonjs/input/index.js.map +1 -1
  61. package/lib/commonjs/link/{createLink.js → LinkRoot.js} +20 -20
  62. package/lib/commonjs/link/LinkRoot.js.map +1 -0
  63. package/lib/commonjs/link/index.js +3 -3
  64. package/lib/commonjs/link/index.js.map +1 -1
  65. package/lib/commonjs/list-item/{createListItemRoot.js → ListItemRoot.js} +48 -68
  66. package/lib/commonjs/list-item/ListItemRoot.js.map +1 -0
  67. package/lib/commonjs/list-item/context.js.map +1 -1
  68. package/lib/commonjs/list-item/index.js +7 -36
  69. package/lib/commonjs/list-item/index.js.map +1 -1
  70. package/lib/commonjs/otp-input/{createOtpInputField.js → OtpInputField.js} +24 -8
  71. package/lib/commonjs/otp-input/OtpInputField.js.map +1 -0
  72. package/lib/commonjs/otp-input/index.js +39 -16
  73. package/lib/commonjs/otp-input/index.js.map +1 -1
  74. package/lib/commonjs/otp-input/{createOtpInputRoot.js → useOtpInput.js} +33 -49
  75. package/lib/commonjs/otp-input/useOtpInput.js.map +1 -0
  76. package/lib/commonjs/overlay/useDismissOverlay.js +0 -2
  77. package/lib/commonjs/overlay/useDismissOverlay.js.map +1 -1
  78. package/lib/commonjs/overlay/useEscapeKey.js +0 -2
  79. package/lib/commonjs/overlay/useEscapeKey.js.map +1 -1
  80. package/lib/commonjs/{progress/createProgressIndicator.js → progress-bar/ProgressBarIndicator.js} +12 -9
  81. package/lib/commonjs/progress-bar/ProgressBarIndicator.js.map +1 -0
  82. package/lib/commonjs/{progress/createProgressRoot.js → progress-bar/ProgressBarRoot.js} +9 -5
  83. package/lib/commonjs/progress-bar/ProgressBarRoot.js.map +1 -0
  84. package/lib/commonjs/progress-bar/context.js.map +1 -0
  85. package/lib/commonjs/progress-bar/index.js +27 -0
  86. package/lib/commonjs/progress-bar/index.js.map +1 -0
  87. package/lib/commonjs/{progress → progress-bar}/types.js.map +1 -1
  88. package/lib/commonjs/radio/{createRadioGroup.js → RadioGroup.js} +18 -10
  89. package/lib/commonjs/radio/RadioGroup.js.map +1 -0
  90. package/lib/commonjs/radio/RadioRoot.js +99 -0
  91. package/lib/commonjs/radio/RadioRoot.js.map +1 -0
  92. package/lib/commonjs/radio/RadioRoot.web.js +91 -0
  93. package/lib/commonjs/radio/RadioRoot.web.js.map +1 -0
  94. package/lib/commonjs/radio/index.js +21 -20
  95. package/lib/commonjs/radio/index.js.map +1 -1
  96. package/lib/commonjs/select/{createSelectContent.js → SelectContent.js} +14 -11
  97. package/lib/commonjs/select/SelectContent.js.map +1 -0
  98. package/lib/commonjs/select/{createSelectItem.js → SelectItem.js} +18 -15
  99. package/lib/commonjs/select/SelectItem.js.map +1 -0
  100. package/lib/commonjs/select/{createSelectRoot.js → SelectRoot.js} +11 -8
  101. package/lib/commonjs/select/SelectRoot.js.map +1 -0
  102. package/lib/commonjs/select/SelectTrigger.js +72 -0
  103. package/lib/commonjs/select/SelectTrigger.js.map +1 -0
  104. package/lib/commonjs/select/SelectTrigger.web.js +175 -0
  105. package/lib/commonjs/select/SelectTrigger.web.js.map +1 -0
  106. package/lib/commonjs/select/context.js +3 -12
  107. package/lib/commonjs/select/context.js.map +1 -1
  108. package/lib/commonjs/select/index.js +41 -32
  109. package/lib/commonjs/select/index.js.map +1 -1
  110. package/lib/commonjs/select/useContentFocus.js +1 -1
  111. package/lib/commonjs/select/useSelectTrigger.js +206 -0
  112. package/lib/commonjs/select/useSelectTrigger.js.map +1 -0
  113. package/lib/commonjs/select/useSelectTrigger.web.js +192 -0
  114. package/lib/commonjs/select/useSelectTrigger.web.js.map +1 -0
  115. package/lib/commonjs/slot/index.js +19 -0
  116. package/lib/commonjs/slot/index.js.map +1 -0
  117. package/lib/commonjs/switch/index.js +7 -9
  118. package/lib/commonjs/switch/index.js.map +1 -1
  119. package/lib/commonjs/switch/useSwitch.js +81 -0
  120. package/lib/commonjs/switch/useSwitch.js.map +1 -0
  121. package/lib/commonjs/tile/{createTileGroup.js → TileGroup.js} +11 -12
  122. package/lib/commonjs/tile/TileGroup.js.map +1 -0
  123. package/lib/commonjs/tile/TileRoot.js +129 -0
  124. package/lib/commonjs/tile/TileRoot.js.map +1 -0
  125. package/lib/commonjs/tile/index.js +14 -36
  126. package/lib/commonjs/tile/index.js.map +1 -1
  127. package/lib/commonjs/utils/dataAttributes.js +6 -0
  128. package/lib/commonjs/utils/dataAttributes.js.map +1 -1
  129. package/lib/commonjs/utils/dataAttributes.web.js +25 -0
  130. package/lib/commonjs/utils/dataAttributes.web.js.map +1 -1
  131. package/lib/commonjs/utils/domDataAttributes.js +30 -0
  132. package/lib/commonjs/utils/domDataAttributes.js.map +1 -1
  133. package/lib/module/CLAUDE.md +64 -12
  134. package/lib/module/avatar/{createAvatarRoot.js → AvatarRoot.js} +9 -4
  135. package/lib/module/avatar/AvatarRoot.js.map +1 -0
  136. package/lib/module/avatar/index.js +2 -23
  137. package/lib/module/avatar/index.js.map +1 -1
  138. package/lib/module/button/{createButtonRoot.js → ButtonRoot.js} +13 -8
  139. package/lib/module/button/ButtonRoot.js.map +1 -0
  140. package/lib/module/button/index.js +1 -23
  141. package/lib/module/button/index.js.map +1 -1
  142. package/lib/module/checkbox/{createCheckboxGroup.js → CheckboxGroup.js} +20 -11
  143. package/lib/module/checkbox/CheckboxGroup.js.map +1 -0
  144. package/lib/module/checkbox/CheckboxRoot.js +99 -0
  145. package/lib/module/checkbox/CheckboxRoot.js.map +1 -0
  146. package/lib/module/checkbox/CheckboxRoot.web.js +90 -0
  147. package/lib/module/checkbox/CheckboxRoot.web.js.map +1 -0
  148. package/lib/module/checkbox/index.js +3 -23
  149. package/lib/module/checkbox/index.js.map +1 -1
  150. package/lib/module/chip/ChipRoot.js +142 -0
  151. package/lib/module/chip/ChipRoot.js.map +1 -0
  152. package/lib/module/chip/context.js +5 -0
  153. package/lib/module/chip/context.js.map +1 -0
  154. package/lib/module/chip/index.js +2 -9
  155. package/lib/module/chip/index.js.map +1 -1
  156. package/lib/module/dialog/DialogClose.js +28 -0
  157. package/lib/module/dialog/DialogClose.js.map +1 -0
  158. package/lib/module/dialog/{createDialogPopup.js → DialogPopup.js} +19 -14
  159. package/lib/module/dialog/DialogPopup.js.map +1 -0
  160. package/lib/module/dialog/{createDialogRoot.js → DialogRoot.js} +11 -7
  161. package/lib/module/dialog/DialogRoot.js.map +1 -0
  162. package/lib/module/dialog/DialogTrigger.js +28 -0
  163. package/lib/module/dialog/DialogTrigger.js.map +1 -0
  164. package/lib/module/dialog/index.js +5 -42
  165. package/lib/module/dialog/index.js.map +1 -1
  166. package/lib/module/field/FieldLabel.js +44 -0
  167. package/lib/module/field/FieldLabel.js.map +1 -0
  168. package/lib/module/field/FieldLabel.web.js +55 -0
  169. package/lib/module/field/FieldLabel.web.js.map +1 -0
  170. package/lib/module/field/FieldRoot.js +34 -0
  171. package/lib/module/field/FieldRoot.js.map +1 -0
  172. package/lib/module/field/index.js +2 -39
  173. package/lib/module/field/index.js.map +1 -1
  174. package/lib/module/form/FormRoot.js +21 -0
  175. package/lib/module/form/FormRoot.js.map +1 -0
  176. package/lib/module/form/FormRoot.web.js +22 -0
  177. package/lib/module/form/FormRoot.web.js.map +1 -0
  178. package/lib/module/form/index.js +1 -8
  179. package/lib/module/form/index.js.map +1 -1
  180. package/lib/module/index.js +5 -3
  181. package/lib/module/index.js.map +1 -1
  182. package/lib/module/input/{createInputField.js → InputField.android.js} +36 -37
  183. package/lib/module/input/InputField.android.js.map +1 -0
  184. package/lib/module/input/InputField.js +88 -0
  185. package/lib/module/input/InputField.js.map +1 -0
  186. package/lib/module/input/InputField.web.js +126 -0
  187. package/lib/module/input/InputField.web.js.map +1 -0
  188. package/lib/module/input/{createInputRoot.js → InputRoot.js} +29 -25
  189. package/lib/module/input/InputRoot.js.map +1 -0
  190. package/lib/module/input/index.js +3 -15
  191. package/lib/module/input/index.js.map +1 -1
  192. package/lib/module/link/{createLink.js → LinkRoot.js} +21 -19
  193. package/lib/module/link/LinkRoot.js.map +1 -0
  194. package/lib/module/link/index.js +1 -1
  195. package/lib/module/link/index.js.map +1 -1
  196. package/lib/module/list-item/{createListItemRoot.js → ListItemRoot.js} +49 -68
  197. package/lib/module/list-item/ListItemRoot.js.map +1 -0
  198. package/lib/module/list-item/context.js.map +1 -1
  199. package/lib/module/list-item/index.js +1 -35
  200. package/lib/module/list-item/index.js.map +1 -1
  201. package/lib/module/otp-input/{createOtpInputField.js → OtpInputField.js} +24 -7
  202. package/lib/module/otp-input/OtpInputField.js.map +1 -0
  203. package/lib/module/otp-input/index.js +3 -15
  204. package/lib/module/otp-input/index.js.map +1 -1
  205. package/lib/module/otp-input/{createOtpInputRoot.js → useOtpInput.js} +33 -48
  206. package/lib/module/otp-input/useOtpInput.js.map +1 -0
  207. package/lib/module/overlay/useDismissOverlay.js +0 -2
  208. package/lib/module/overlay/useDismissOverlay.js.map +1 -1
  209. package/lib/module/overlay/useEscapeKey.js +0 -2
  210. package/lib/module/overlay/useEscapeKey.js.map +1 -1
  211. package/lib/module/{progress/createProgressIndicator.js → progress-bar/ProgressBarIndicator.js} +11 -7
  212. package/lib/module/progress-bar/ProgressBarIndicator.js.map +1 -0
  213. package/lib/module/{progress/createProgressRoot.js → progress-bar/ProgressBarRoot.js} +8 -3
  214. package/lib/module/progress-bar/ProgressBarRoot.js.map +1 -0
  215. package/lib/module/progress-bar/context.js.map +1 -0
  216. package/lib/module/progress-bar/index.js +6 -0
  217. package/lib/module/progress-bar/index.js.map +1 -0
  218. package/lib/module/{progress → progress-bar}/types.js.map +1 -1
  219. package/lib/module/radio/{createRadioGroup.js → RadioGroup.js} +18 -9
  220. package/lib/module/radio/RadioGroup.js.map +1 -0
  221. package/lib/module/radio/RadioRoot.js +95 -0
  222. package/lib/module/radio/RadioRoot.js.map +1 -0
  223. package/lib/module/radio/RadioRoot.web.js +87 -0
  224. package/lib/module/radio/RadioRoot.web.js.map +1 -0
  225. package/lib/module/radio/index.js +3 -19
  226. package/lib/module/radio/index.js.map +1 -1
  227. package/lib/module/select/{createSelectContent.js → SelectContent.js} +14 -11
  228. package/lib/module/select/SelectContent.js.map +1 -0
  229. package/lib/module/select/{createSelectItem.js → SelectItem.js} +18 -14
  230. package/lib/module/select/SelectItem.js.map +1 -0
  231. package/lib/module/select/{createSelectRoot.js → SelectRoot.js} +11 -7
  232. package/lib/module/select/SelectRoot.js.map +1 -0
  233. package/lib/module/select/SelectTrigger.js +67 -0
  234. package/lib/module/select/SelectTrigger.js.map +1 -0
  235. package/lib/module/select/SelectTrigger.web.js +170 -0
  236. package/lib/module/select/SelectTrigger.web.js.map +1 -0
  237. package/lib/module/select/context.js +1 -8
  238. package/lib/module/select/context.js.map +1 -1
  239. package/lib/module/select/index.js +5 -31
  240. package/lib/module/select/index.js.map +1 -1
  241. package/lib/module/select/useContentFocus.js +1 -1
  242. package/lib/module/select/useSelectTrigger.js +202 -0
  243. package/lib/module/select/useSelectTrigger.js.map +1 -0
  244. package/lib/module/select/useSelectTrigger.web.js +188 -0
  245. package/lib/module/select/useSelectTrigger.web.js.map +1 -0
  246. package/lib/module/slot/index.js +4 -0
  247. package/lib/module/slot/index.js.map +1 -0
  248. package/lib/module/switch/index.js +1 -8
  249. package/lib/module/switch/index.js.map +1 -1
  250. package/lib/module/switch/useSwitch.js +77 -0
  251. package/lib/module/switch/useSwitch.js.map +1 -0
  252. package/lib/module/tile/{createTileGroup.js → TileGroup.js} +10 -9
  253. package/lib/module/tile/TileGroup.js.map +1 -0
  254. package/lib/module/tile/{createTileRoot.js → TileRoot.js} +52 -54
  255. package/lib/module/tile/TileRoot.js.map +1 -0
  256. package/lib/module/tile/index.js +2 -35
  257. package/lib/module/tile/index.js.map +1 -1
  258. package/lib/module/utils/dataAttributes.js +1 -1
  259. package/lib/module/utils/dataAttributes.js.map +1 -1
  260. package/lib/module/utils/dataAttributes.web.js +24 -0
  261. package/lib/module/utils/dataAttributes.web.js.map +1 -1
  262. package/lib/module/utils/domDataAttributes.js +29 -0
  263. package/lib/module/utils/domDataAttributes.js.map +1 -1
  264. package/lib/typescript/avatar/AvatarRoot.d.ts +8 -0
  265. package/lib/typescript/avatar/AvatarRoot.d.ts.map +1 -0
  266. package/lib/typescript/avatar/index.d.ts +3 -10
  267. package/lib/typescript/avatar/index.d.ts.map +1 -1
  268. package/lib/typescript/avatar/types.d.ts +1 -17
  269. package/lib/typescript/avatar/types.d.ts.map +1 -1
  270. package/lib/typescript/button/ButtonRoot.d.ts +9 -0
  271. package/lib/typescript/button/ButtonRoot.d.ts.map +1 -0
  272. package/lib/typescript/button/index.d.ts +2 -10
  273. package/lib/typescript/button/index.d.ts.map +1 -1
  274. package/lib/typescript/button/types.d.ts +1 -34
  275. package/lib/typescript/button/types.d.ts.map +1 -1
  276. package/lib/typescript/checkbox/CheckboxGroup.d.ts +9 -0
  277. package/lib/typescript/checkbox/CheckboxGroup.d.ts.map +1 -0
  278. package/lib/typescript/checkbox/CheckboxRoot.d.ts +6 -0
  279. package/lib/typescript/checkbox/CheckboxRoot.d.ts.map +1 -0
  280. package/lib/typescript/checkbox/CheckboxRoot.web.d.ts +6 -0
  281. package/lib/typescript/checkbox/CheckboxRoot.web.d.ts.map +1 -0
  282. package/lib/typescript/checkbox/index.d.ts +4 -10
  283. package/lib/typescript/checkbox/index.d.ts.map +1 -1
  284. package/lib/typescript/checkbox/types.d.ts +0 -17
  285. package/lib/typescript/checkbox/types.d.ts.map +1 -1
  286. package/lib/typescript/checkbox/useCheckboxRoot.d.ts +1 -1
  287. package/lib/typescript/chip/ChipRoot.d.ts +7 -0
  288. package/lib/typescript/chip/ChipRoot.d.ts.map +1 -0
  289. package/lib/typescript/chip/context.d.ts +6 -0
  290. package/lib/typescript/chip/context.d.ts.map +1 -0
  291. package/lib/typescript/chip/index.d.ts +3 -8
  292. package/lib/typescript/chip/index.d.ts.map +1 -1
  293. package/lib/typescript/chip/types.d.ts +3 -4
  294. package/lib/typescript/chip/types.d.ts.map +1 -1
  295. package/lib/typescript/dialog/DialogClose.d.ts +5 -0
  296. package/lib/typescript/dialog/DialogClose.d.ts.map +1 -0
  297. package/lib/typescript/dialog/DialogPopup.d.ts +14 -0
  298. package/lib/typescript/dialog/DialogPopup.d.ts.map +1 -0
  299. package/lib/typescript/dialog/DialogRoot.d.ts +7 -0
  300. package/lib/typescript/dialog/DialogRoot.d.ts.map +1 -0
  301. package/lib/typescript/dialog/DialogTrigger.d.ts +5 -0
  302. package/lib/typescript/dialog/DialogTrigger.d.ts.map +1 -0
  303. package/lib/typescript/dialog/index.d.ts +6 -17
  304. package/lib/typescript/dialog/index.d.ts.map +1 -1
  305. package/lib/typescript/dialog/types.d.ts +2 -24
  306. package/lib/typescript/dialog/types.d.ts.map +1 -1
  307. package/lib/typescript/field/FieldLabel.d.ts +12 -0
  308. package/lib/typescript/field/FieldLabel.d.ts.map +1 -0
  309. package/lib/typescript/field/FieldLabel.web.d.ts +24 -0
  310. package/lib/typescript/field/FieldLabel.web.d.ts.map +1 -0
  311. package/lib/typescript/field/FieldRoot.d.ts +8 -0
  312. package/lib/typescript/field/FieldRoot.d.ts.map +1 -0
  313. package/lib/typescript/field/index.d.ts +3 -12
  314. package/lib/typescript/field/index.d.ts.map +1 -1
  315. package/lib/typescript/field/types.d.ts +0 -20
  316. package/lib/typescript/field/types.d.ts.map +1 -1
  317. package/lib/typescript/form/FormRoot.d.ts +8 -0
  318. package/lib/typescript/form/FormRoot.d.ts.map +1 -0
  319. package/lib/typescript/form/FormRoot.web.d.ts +8 -0
  320. package/lib/typescript/form/FormRoot.web.d.ts.map +1 -0
  321. package/lib/typescript/form/index.d.ts +2 -5
  322. package/lib/typescript/form/index.d.ts.map +1 -1
  323. package/lib/typescript/form/types.d.ts +8 -9
  324. package/lib/typescript/form/types.d.ts.map +1 -1
  325. package/lib/typescript/index.d.ts +5 -3
  326. package/lib/typescript/index.d.ts.map +1 -1
  327. package/lib/typescript/input/InputField.android.d.ts +5 -0
  328. package/lib/typescript/input/InputField.android.d.ts.map +1 -0
  329. package/lib/typescript/input/InputField.d.ts +5 -0
  330. package/lib/typescript/input/InputField.d.ts.map +1 -0
  331. package/lib/typescript/input/InputField.web.d.ts +6 -0
  332. package/lib/typescript/input/InputField.web.d.ts.map +1 -0
  333. package/lib/typescript/input/InputRoot.d.ts +5 -0
  334. package/lib/typescript/input/InputRoot.d.ts.map +1 -0
  335. package/lib/typescript/input/index.d.ts +4 -8
  336. package/lib/typescript/input/index.d.ts.map +1 -1
  337. package/lib/typescript/input/types.d.ts +20 -39
  338. package/lib/typescript/input/types.d.ts.map +1 -1
  339. package/lib/typescript/link/LinkRoot.d.ts +9 -0
  340. package/lib/typescript/link/LinkRoot.d.ts.map +1 -0
  341. package/lib/typescript/link/index.d.ts +1 -1
  342. package/lib/typescript/link/index.d.ts.map +1 -1
  343. package/lib/typescript/list-item/ListItemRoot.d.ts +7 -0
  344. package/lib/typescript/list-item/ListItemRoot.d.ts.map +1 -0
  345. package/lib/typescript/list-item/context.d.ts +3 -3
  346. package/lib/typescript/list-item/context.d.ts.map +1 -1
  347. package/lib/typescript/list-item/index.d.ts +2 -14
  348. package/lib/typescript/list-item/index.d.ts.map +1 -1
  349. package/lib/typescript/list-item/types.d.ts +4 -52
  350. package/lib/typescript/list-item/types.d.ts.map +1 -1
  351. package/lib/typescript/otp-input/OtpInputField.d.ts +19 -0
  352. package/lib/typescript/otp-input/OtpInputField.d.ts.map +1 -0
  353. package/lib/typescript/otp-input/index.d.ts +4 -8
  354. package/lib/typescript/otp-input/index.d.ts.map +1 -1
  355. package/lib/typescript/otp-input/types.d.ts +0 -9
  356. package/lib/typescript/otp-input/types.d.ts.map +1 -1
  357. package/lib/typescript/otp-input/useOtpInput.d.ts +19 -0
  358. package/lib/typescript/otp-input/useOtpInput.d.ts.map +1 -0
  359. package/lib/typescript/overlay/useDismissOverlay.d.ts.map +1 -1
  360. package/lib/typescript/overlay/useEscapeKey.d.ts.map +1 -1
  361. package/lib/typescript/progress-bar/ProgressBarIndicator.d.ts +6 -0
  362. package/lib/typescript/progress-bar/ProgressBarIndicator.d.ts.map +1 -0
  363. package/lib/typescript/progress-bar/ProgressBarRoot.d.ts +6 -0
  364. package/lib/typescript/progress-bar/ProgressBarRoot.d.ts.map +1 -0
  365. package/lib/typescript/progress-bar/context.d.ts.map +1 -0
  366. package/lib/typescript/progress-bar/index.d.ts +6 -0
  367. package/lib/typescript/progress-bar/index.d.ts.map +1 -0
  368. package/lib/typescript/{progress → progress-bar}/types.d.ts +1 -4
  369. package/lib/typescript/progress-bar/types.d.ts.map +1 -0
  370. package/lib/typescript/radio/RadioGroup.d.ts +9 -0
  371. package/lib/typescript/radio/RadioGroup.d.ts.map +1 -0
  372. package/lib/typescript/radio/RadioRoot.d.ts +6 -0
  373. package/lib/typescript/radio/RadioRoot.d.ts.map +1 -0
  374. package/lib/typescript/radio/RadioRoot.web.d.ts +6 -0
  375. package/lib/typescript/radio/RadioRoot.web.d.ts.map +1 -0
  376. package/lib/typescript/radio/index.d.ts +4 -9
  377. package/lib/typescript/radio/index.d.ts.map +1 -1
  378. package/lib/typescript/radio/types.d.ts +0 -11
  379. package/lib/typescript/radio/types.d.ts.map +1 -1
  380. package/lib/typescript/radio/useRadioRoot.d.ts +1 -1
  381. package/lib/typescript/select/SelectContent.d.ts +9 -0
  382. package/lib/typescript/select/SelectContent.d.ts.map +1 -0
  383. package/lib/typescript/select/SelectItem.d.ts +8 -0
  384. package/lib/typescript/select/SelectItem.d.ts.map +1 -0
  385. package/lib/typescript/select/SelectRoot.d.ts +8 -0
  386. package/lib/typescript/select/SelectRoot.d.ts.map +1 -0
  387. package/lib/typescript/select/SelectTrigger.d.ts +9 -0
  388. package/lib/typescript/select/SelectTrigger.d.ts.map +1 -0
  389. package/lib/typescript/select/SelectTrigger.web.d.ts +13 -0
  390. package/lib/typescript/select/SelectTrigger.web.d.ts.map +1 -0
  391. package/lib/typescript/select/context.d.ts +1 -11
  392. package/lib/typescript/select/context.d.ts.map +1 -1
  393. package/lib/typescript/select/index.d.ts +6 -12
  394. package/lib/typescript/select/index.d.ts.map +1 -1
  395. package/lib/typescript/select/types.d.ts +1 -9
  396. package/lib/typescript/select/types.d.ts.map +1 -1
  397. package/lib/typescript/select/useContentFocus.d.ts +1 -1
  398. package/lib/typescript/select/useSelectTrigger.d.ts +77 -0
  399. package/lib/typescript/select/useSelectTrigger.d.ts.map +1 -0
  400. package/lib/typescript/select/useSelectTrigger.web.d.ts +16 -0
  401. package/lib/typescript/select/useSelectTrigger.web.d.ts.map +1 -0
  402. package/lib/typescript/slot/index.d.ts +2 -0
  403. package/lib/typescript/slot/index.d.ts.map +1 -0
  404. package/lib/typescript/switch/index.d.ts +2 -6
  405. package/lib/typescript/switch/index.d.ts.map +1 -1
  406. package/lib/typescript/switch/types.d.ts +35 -6
  407. package/lib/typescript/switch/types.d.ts.map +1 -1
  408. package/lib/typescript/switch/useSwitch.d.ts +20 -0
  409. package/lib/typescript/switch/useSwitch.d.ts.map +1 -0
  410. package/lib/typescript/tile/TileGroup.d.ts +5 -0
  411. package/lib/typescript/tile/TileGroup.d.ts.map +1 -0
  412. package/lib/typescript/tile/TileRoot.d.ts +5 -0
  413. package/lib/typescript/tile/TileRoot.d.ts.map +1 -0
  414. package/lib/typescript/tile/index.d.ts +3 -13
  415. package/lib/typescript/tile/index.d.ts.map +1 -1
  416. package/lib/typescript/tile/types.d.ts +7 -18
  417. package/lib/typescript/tile/types.d.ts.map +1 -1
  418. package/lib/typescript/utils/dataAttributes.d.ts +1 -1
  419. package/lib/typescript/utils/dataAttributes.d.ts.map +1 -1
  420. package/lib/typescript/utils/dataAttributes.web.d.ts +16 -0
  421. package/lib/typescript/utils/dataAttributes.web.d.ts.map +1 -1
  422. package/lib/typescript/utils/domDataAttributes.d.ts +13 -0
  423. package/lib/typescript/utils/domDataAttributes.d.ts.map +1 -1
  424. package/package.json +3 -2
  425. package/src/CLAUDE.md +64 -12
  426. package/src/avatar/AvatarRoot.tsx +39 -0
  427. package/src/avatar/index.ts +3 -43
  428. package/src/avatar/types.ts +1 -47
  429. package/src/button/ButtonRoot.tsx +115 -0
  430. package/src/button/index.ts +3 -0
  431. package/src/button/types.ts +1 -52
  432. package/src/checkbox/CheckboxGroup.tsx +50 -0
  433. package/src/checkbox/CheckboxRoot.tsx +102 -0
  434. package/src/checkbox/CheckboxRoot.web.tsx +92 -0
  435. package/src/checkbox/index.ts +4 -42
  436. package/src/checkbox/types.ts +1 -32
  437. package/src/chip/ChipRoot.tsx +168 -0
  438. package/src/chip/context.tsx +4 -0
  439. package/src/chip/index.ts +3 -18
  440. package/src/chip/types.ts +3 -6
  441. package/src/dialog/DialogClose.tsx +26 -0
  442. package/src/dialog/DialogPopup.tsx +162 -0
  443. package/src/dialog/DialogRoot.tsx +72 -0
  444. package/src/dialog/DialogTrigger.tsx +26 -0
  445. package/src/dialog/index.tsx +5 -86
  446. package/src/dialog/types.ts +2 -56
  447. package/src/field/FieldLabel.tsx +43 -0
  448. package/src/field/FieldLabel.web.tsx +71 -0
  449. package/src/field/FieldRoot.tsx +39 -0
  450. package/src/field/index.tsx +3 -68
  451. package/src/field/types.tsx +0 -34
  452. package/src/form/FormRoot.tsx +18 -0
  453. package/src/form/FormRoot.web.tsx +17 -0
  454. package/src/form/index.tsx +2 -12
  455. package/src/form/types.tsx +9 -11
  456. package/src/index.ts +9 -3
  457. package/src/input/InputField.android.tsx +107 -0
  458. package/src/input/InputField.tsx +100 -0
  459. package/src/input/InputField.web.tsx +141 -0
  460. package/src/input/InputRoot.tsx +104 -0
  461. package/src/input/index.tsx +4 -38
  462. package/src/input/types.ts +21 -53
  463. package/src/link/LinkRoot.tsx +108 -0
  464. package/src/link/index.tsx +1 -1
  465. package/src/list-item/ListItemRoot.tsx +183 -0
  466. package/src/list-item/context.tsx +2 -2
  467. package/src/list-item/index.ts +2 -79
  468. package/src/list-item/types.ts +4 -81
  469. package/src/otp-input/OtpInputField.tsx +122 -0
  470. package/src/otp-input/index.ts +16 -0
  471. package/src/otp-input/types.ts +0 -23
  472. package/src/otp-input/useOtpInput.ts +156 -0
  473. package/src/overlay/useDismissOverlay.ts +0 -2
  474. package/src/overlay/useEscapeKey.ts +0 -2
  475. package/src/progress-bar/ProgressBarIndicator.tsx +34 -0
  476. package/src/{progress/createProgressRoot.tsx → progress-bar/ProgressBarRoot.tsx} +17 -9
  477. package/src/progress-bar/index.ts +5 -0
  478. package/src/{progress → progress-bar}/types.ts +1 -14
  479. package/src/radio/{createRadioGroup.tsx → RadioGroup.tsx} +31 -13
  480. package/src/radio/RadioRoot.tsx +98 -0
  481. package/src/radio/RadioRoot.web.tsx +90 -0
  482. package/src/radio/index.ts +4 -36
  483. package/src/radio/types.ts +0 -22
  484. package/src/select/SelectContent.tsx +120 -0
  485. package/src/select/SelectItem.tsx +139 -0
  486. package/src/select/SelectRoot.tsx +154 -0
  487. package/src/select/SelectTrigger.tsx +82 -0
  488. package/src/select/SelectTrigger.web.tsx +238 -0
  489. package/src/select/context.tsx +1 -10
  490. package/src/select/index.ts +17 -0
  491. package/src/select/types.ts +1 -32
  492. package/src/select/useContentFocus.ts +1 -1
  493. package/src/select/useSelectTrigger.ts +345 -0
  494. package/src/select/useSelectTrigger.web.ts +267 -0
  495. package/src/slot/index.ts +1 -0
  496. package/src/switch/index.ts +7 -16
  497. package/src/switch/types.ts +35 -10
  498. package/src/switch/useSwitch.ts +75 -0
  499. package/src/tile/TileGroup.tsx +137 -0
  500. package/src/tile/{createTileRoot.tsx → TileRoot.tsx} +58 -45
  501. package/src/tile/index.ts +2 -72
  502. package/src/tile/types.ts +7 -39
  503. package/src/utils/dataAttributes.ts +4 -1
  504. package/src/utils/dataAttributes.web.ts +24 -0
  505. package/src/utils/domDataAttributes.ts +31 -0
  506. package/lib/commonjs/avatar/createAvatarBadge.js +0 -20
  507. package/lib/commonjs/avatar/createAvatarBadge.js.map +0 -1
  508. package/lib/commonjs/avatar/createAvatarIcon.js +0 -30
  509. package/lib/commonjs/avatar/createAvatarIcon.js.map +0 -1
  510. package/lib/commonjs/avatar/createAvatarImage.js +0 -51
  511. package/lib/commonjs/avatar/createAvatarImage.js.map +0 -1
  512. package/lib/commonjs/avatar/createAvatarRoot.js.map +0 -1
  513. package/lib/commonjs/avatar/createAvatarText.js +0 -50
  514. package/lib/commonjs/avatar/createAvatarText.js.map +0 -1
  515. package/lib/commonjs/button/createButtonGroup.js +0 -80
  516. package/lib/commonjs/button/createButtonGroup.js.map +0 -1
  517. package/lib/commonjs/button/createButtonIcon.js +0 -18
  518. package/lib/commonjs/button/createButtonIcon.js.map +0 -1
  519. package/lib/commonjs/button/createButtonRoot.js.map +0 -1
  520. package/lib/commonjs/button/createButtonSpinner.js +0 -34
  521. package/lib/commonjs/button/createButtonSpinner.js.map +0 -1
  522. package/lib/commonjs/button/createButtonText.js +0 -39
  523. package/lib/commonjs/button/createButtonText.js.map +0 -1
  524. package/lib/commonjs/checkbox/createCheckboxGroup.js.map +0 -1
  525. package/lib/commonjs/checkbox/createCheckboxIcon.js +0 -29
  526. package/lib/commonjs/checkbox/createCheckboxIcon.js.map +0 -1
  527. package/lib/commonjs/checkbox/createCheckboxIndicator.js +0 -47
  528. package/lib/commonjs/checkbox/createCheckboxIndicator.js.map +0 -1
  529. package/lib/commonjs/checkbox/createCheckboxLabel.js +0 -46
  530. package/lib/commonjs/checkbox/createCheckboxLabel.js.map +0 -1
  531. package/lib/commonjs/checkbox/createCheckboxRoot.js +0 -99
  532. package/lib/commonjs/checkbox/createCheckboxRoot.js.map +0 -1
  533. package/lib/commonjs/checkbox/createCheckboxRoot.web.js +0 -95
  534. package/lib/commonjs/checkbox/createCheckboxRoot.web.js.map +0 -1
  535. package/lib/commonjs/chip/createChipRoot.js +0 -132
  536. package/lib/commonjs/chip/createChipRoot.js.map +0 -1
  537. package/lib/commonjs/dialog/createDialogClose.js +0 -37
  538. package/lib/commonjs/dialog/createDialogClose.js.map +0 -1
  539. package/lib/commonjs/dialog/createDialogContent.js +0 -21
  540. package/lib/commonjs/dialog/createDialogContent.js.map +0 -1
  541. package/lib/commonjs/dialog/createDialogDescription.js +0 -30
  542. package/lib/commonjs/dialog/createDialogDescription.js.map +0 -1
  543. package/lib/commonjs/dialog/createDialogFooter.js.map +0 -1
  544. package/lib/commonjs/dialog/createDialogHeader.js +0 -21
  545. package/lib/commonjs/dialog/createDialogHeader.js.map +0 -1
  546. package/lib/commonjs/dialog/createDialogPopup.js.map +0 -1
  547. package/lib/commonjs/dialog/createDialogRoot.js.map +0 -1
  548. package/lib/commonjs/dialog/createDialogTitle.js +0 -21
  549. package/lib/commonjs/dialog/createDialogTitle.js.map +0 -1
  550. package/lib/commonjs/dialog/createDialogTrigger.js +0 -37
  551. package/lib/commonjs/dialog/createDialogTrigger.js.map +0 -1
  552. package/lib/commonjs/field/createFieldError.js +0 -41
  553. package/lib/commonjs/field/createFieldError.js.map +0 -1
  554. package/lib/commonjs/field/createFieldErrorIcon.js +0 -18
  555. package/lib/commonjs/field/createFieldErrorIcon.js.map +0 -1
  556. package/lib/commonjs/field/createFieldErrorText.js +0 -18
  557. package/lib/commonjs/field/createFieldErrorText.js.map +0 -1
  558. package/lib/commonjs/field/createFieldHelper.js +0 -41
  559. package/lib/commonjs/field/createFieldHelper.js.map +0 -1
  560. package/lib/commonjs/field/createFieldHelperText.js +0 -18
  561. package/lib/commonjs/field/createFieldHelperText.js.map +0 -1
  562. package/lib/commonjs/field/createFieldLabel.js +0 -36
  563. package/lib/commonjs/field/createFieldLabel.js.map +0 -1
  564. package/lib/commonjs/field/createFieldRoot.js +0 -35
  565. package/lib/commonjs/field/createFieldRoot.js.map +0 -1
  566. package/lib/commonjs/form/createFormRoot.js +0 -21
  567. package/lib/commonjs/form/createFormRoot.js.map +0 -1
  568. package/lib/commonjs/input/createInputField.js.map +0 -1
  569. package/lib/commonjs/input/createInputRoot.js.map +0 -1
  570. package/lib/commonjs/input/createInputSlot.js +0 -44
  571. package/lib/commonjs/input/createInputSlot.js.map +0 -1
  572. package/lib/commonjs/link/createLink.js.map +0 -1
  573. package/lib/commonjs/list-item/createListItemContent.js +0 -30
  574. package/lib/commonjs/list-item/createListItemContent.js.map +0 -1
  575. package/lib/commonjs/list-item/createListItemDescription.js +0 -25
  576. package/lib/commonjs/list-item/createListItemDescription.js.map +0 -1
  577. package/lib/commonjs/list-item/createListItemLeadingSlot.js +0 -34
  578. package/lib/commonjs/list-item/createListItemLeadingSlot.js.map +0 -1
  579. package/lib/commonjs/list-item/createListItemMeta.js +0 -25
  580. package/lib/commonjs/list-item/createListItemMeta.js.map +0 -1
  581. package/lib/commonjs/list-item/createListItemRoot.js.map +0 -1
  582. package/lib/commonjs/list-item/createListItemSectionHeader.js +0 -54
  583. package/lib/commonjs/list-item/createListItemSectionHeader.js.map +0 -1
  584. package/lib/commonjs/list-item/createListItemTitle.js +0 -25
  585. package/lib/commonjs/list-item/createListItemTitle.js.map +0 -1
  586. package/lib/commonjs/list-item/createListItemTrailingSlot.js +0 -28
  587. package/lib/commonjs/list-item/createListItemTrailingSlot.js.map +0 -1
  588. package/lib/commonjs/otp-input/createOtpInputCell.js +0 -29
  589. package/lib/commonjs/otp-input/createOtpInputCell.js.map +0 -1
  590. package/lib/commonjs/otp-input/createOtpInputField.js.map +0 -1
  591. package/lib/commonjs/otp-input/createOtpInputRoot.js.map +0 -1
  592. package/lib/commonjs/progress/context.js.map +0 -1
  593. package/lib/commonjs/progress/createProgressIndicator.js.map +0 -1
  594. package/lib/commonjs/progress/createProgressRoot.js.map +0 -1
  595. package/lib/commonjs/progress/index.js +0 -25
  596. package/lib/commonjs/progress/index.js.map +0 -1
  597. package/lib/commonjs/radio/createRadioGroup.js.map +0 -1
  598. package/lib/commonjs/radio/createRadioIndicator.js +0 -43
  599. package/lib/commonjs/radio/createRadioIndicator.js.map +0 -1
  600. package/lib/commonjs/radio/createRadioLabel.js +0 -38
  601. package/lib/commonjs/radio/createRadioLabel.js.map +0 -1
  602. package/lib/commonjs/radio/createRadioRoot.js +0 -95
  603. package/lib/commonjs/radio/createRadioRoot.js.map +0 -1
  604. package/lib/commonjs/radio/createRadioRoot.web.js +0 -87
  605. package/lib/commonjs/radio/createRadioRoot.web.js.map +0 -1
  606. package/lib/commonjs/select/createSelectContent.js.map +0 -1
  607. package/lib/commonjs/select/createSelectIcon.js +0 -43
  608. package/lib/commonjs/select/createSelectIcon.js.map +0 -1
  609. package/lib/commonjs/select/createSelectItem.js.map +0 -1
  610. package/lib/commonjs/select/createSelectItemLabel.js +0 -41
  611. package/lib/commonjs/select/createSelectItemLabel.js.map +0 -1
  612. package/lib/commonjs/select/createSelectRoot.js.map +0 -1
  613. package/lib/commonjs/select/createSelectTrigger.js +0 -192
  614. package/lib/commonjs/select/createSelectTrigger.js.map +0 -1
  615. package/lib/commonjs/select/createSelectValue.js +0 -53
  616. package/lib/commonjs/select/createSelectValue.js.map +0 -1
  617. package/lib/commonjs/switch/createSwitchRoot.js +0 -73
  618. package/lib/commonjs/switch/createSwitchRoot.js.map +0 -1
  619. package/lib/commonjs/tile/createTileContent.js +0 -30
  620. package/lib/commonjs/tile/createTileContent.js.map +0 -1
  621. package/lib/commonjs/tile/createTileDescription.js +0 -28
  622. package/lib/commonjs/tile/createTileDescription.js.map +0 -1
  623. package/lib/commonjs/tile/createTileGroup.js.map +0 -1
  624. package/lib/commonjs/tile/createTileIndicator.js +0 -46
  625. package/lib/commonjs/tile/createTileIndicator.js.map +0 -1
  626. package/lib/commonjs/tile/createTileLeadingSlot.js +0 -34
  627. package/lib/commonjs/tile/createTileLeadingSlot.js.map +0 -1
  628. package/lib/commonjs/tile/createTileRoot.js +0 -133
  629. package/lib/commonjs/tile/createTileRoot.js.map +0 -1
  630. package/lib/commonjs/tile/createTileTitle.js +0 -28
  631. package/lib/commonjs/tile/createTileTitle.js.map +0 -1
  632. package/lib/commonjs/tile/createTileTrailingSlot.js +0 -35
  633. package/lib/commonjs/tile/createTileTrailingSlot.js.map +0 -1
  634. package/lib/module/avatar/createAvatarBadge.js +0 -15
  635. package/lib/module/avatar/createAvatarBadge.js.map +0 -1
  636. package/lib/module/avatar/createAvatarIcon.js +0 -25
  637. package/lib/module/avatar/createAvatarIcon.js.map +0 -1
  638. package/lib/module/avatar/createAvatarImage.js +0 -46
  639. package/lib/module/avatar/createAvatarImage.js.map +0 -1
  640. package/lib/module/avatar/createAvatarRoot.js.map +0 -1
  641. package/lib/module/avatar/createAvatarText.js +0 -45
  642. package/lib/module/avatar/createAvatarText.js.map +0 -1
  643. package/lib/module/button/createButtonGroup.js +0 -74
  644. package/lib/module/button/createButtonGroup.js.map +0 -1
  645. package/lib/module/button/createButtonIcon.js +0 -13
  646. package/lib/module/button/createButtonIcon.js.map +0 -1
  647. package/lib/module/button/createButtonRoot.js.map +0 -1
  648. package/lib/module/button/createButtonSpinner.js +0 -29
  649. package/lib/module/button/createButtonSpinner.js.map +0 -1
  650. package/lib/module/button/createButtonText.js +0 -34
  651. package/lib/module/button/createButtonText.js.map +0 -1
  652. package/lib/module/checkbox/createCheckboxGroup.js.map +0 -1
  653. package/lib/module/checkbox/createCheckboxIcon.js +0 -24
  654. package/lib/module/checkbox/createCheckboxIcon.js.map +0 -1
  655. package/lib/module/checkbox/createCheckboxIndicator.js +0 -42
  656. package/lib/module/checkbox/createCheckboxIndicator.js.map +0 -1
  657. package/lib/module/checkbox/createCheckboxLabel.js +0 -41
  658. package/lib/module/checkbox/createCheckboxLabel.js.map +0 -1
  659. package/lib/module/checkbox/createCheckboxRoot.js +0 -94
  660. package/lib/module/checkbox/createCheckboxRoot.js.map +0 -1
  661. package/lib/module/checkbox/createCheckboxRoot.web.js +0 -91
  662. package/lib/module/checkbox/createCheckboxRoot.web.js.map +0 -1
  663. package/lib/module/chip/createChipRoot.js +0 -126
  664. package/lib/module/chip/createChipRoot.js.map +0 -1
  665. package/lib/module/dialog/createDialogClose.js +0 -31
  666. package/lib/module/dialog/createDialogClose.js.map +0 -1
  667. package/lib/module/dialog/createDialogContent.js +0 -15
  668. package/lib/module/dialog/createDialogContent.js.map +0 -1
  669. package/lib/module/dialog/createDialogDescription.js +0 -24
  670. package/lib/module/dialog/createDialogDescription.js.map +0 -1
  671. package/lib/module/dialog/createDialogFooter.js +0 -15
  672. package/lib/module/dialog/createDialogFooter.js.map +0 -1
  673. package/lib/module/dialog/createDialogHeader.js +0 -15
  674. package/lib/module/dialog/createDialogHeader.js.map +0 -1
  675. package/lib/module/dialog/createDialogPopup.js.map +0 -1
  676. package/lib/module/dialog/createDialogRoot.js.map +0 -1
  677. package/lib/module/dialog/createDialogTitle.js +0 -15
  678. package/lib/module/dialog/createDialogTitle.js.map +0 -1
  679. package/lib/module/dialog/createDialogTrigger.js +0 -31
  680. package/lib/module/dialog/createDialogTrigger.js.map +0 -1
  681. package/lib/module/field/createFieldError.js +0 -35
  682. package/lib/module/field/createFieldError.js.map +0 -1
  683. package/lib/module/field/createFieldErrorIcon.js +0 -13
  684. package/lib/module/field/createFieldErrorIcon.js.map +0 -1
  685. package/lib/module/field/createFieldErrorText.js +0 -13
  686. package/lib/module/field/createFieldErrorText.js.map +0 -1
  687. package/lib/module/field/createFieldHelper.js +0 -35
  688. package/lib/module/field/createFieldHelper.js.map +0 -1
  689. package/lib/module/field/createFieldHelperText.js +0 -13
  690. package/lib/module/field/createFieldHelperText.js.map +0 -1
  691. package/lib/module/field/createFieldLabel.js +0 -31
  692. package/lib/module/field/createFieldLabel.js.map +0 -1
  693. package/lib/module/field/createFieldRoot.js +0 -29
  694. package/lib/module/field/createFieldRoot.js.map +0 -1
  695. package/lib/module/form/createFormRoot.js +0 -15
  696. package/lib/module/form/createFormRoot.js.map +0 -1
  697. package/lib/module/input/createInputField.js.map +0 -1
  698. package/lib/module/input/createInputRoot.js.map +0 -1
  699. package/lib/module/input/createInputSlot.js +0 -39
  700. package/lib/module/input/createInputSlot.js.map +0 -1
  701. package/lib/module/link/createLink.js.map +0 -1
  702. package/lib/module/list-item/createListItemContent.js +0 -24
  703. package/lib/module/list-item/createListItemContent.js.map +0 -1
  704. package/lib/module/list-item/createListItemDescription.js +0 -19
  705. package/lib/module/list-item/createListItemDescription.js.map +0 -1
  706. package/lib/module/list-item/createListItemLeadingSlot.js +0 -28
  707. package/lib/module/list-item/createListItemLeadingSlot.js.map +0 -1
  708. package/lib/module/list-item/createListItemMeta.js +0 -19
  709. package/lib/module/list-item/createListItemMeta.js.map +0 -1
  710. package/lib/module/list-item/createListItemRoot.js.map +0 -1
  711. package/lib/module/list-item/createListItemSectionHeader.js +0 -48
  712. package/lib/module/list-item/createListItemSectionHeader.js.map +0 -1
  713. package/lib/module/list-item/createListItemTitle.js +0 -19
  714. package/lib/module/list-item/createListItemTitle.js.map +0 -1
  715. package/lib/module/list-item/createListItemTrailingSlot.js +0 -22
  716. package/lib/module/list-item/createListItemTrailingSlot.js.map +0 -1
  717. package/lib/module/otp-input/createOtpInputCell.js +0 -24
  718. package/lib/module/otp-input/createOtpInputCell.js.map +0 -1
  719. package/lib/module/otp-input/createOtpInputField.js.map +0 -1
  720. package/lib/module/otp-input/createOtpInputRoot.js.map +0 -1
  721. package/lib/module/progress/context.js.map +0 -1
  722. package/lib/module/progress/createProgressIndicator.js.map +0 -1
  723. package/lib/module/progress/createProgressRoot.js.map +0 -1
  724. package/lib/module/progress/index.js +0 -15
  725. package/lib/module/progress/index.js.map +0 -1
  726. package/lib/module/radio/createRadioGroup.js.map +0 -1
  727. package/lib/module/radio/createRadioIndicator.js +0 -38
  728. package/lib/module/radio/createRadioIndicator.js.map +0 -1
  729. package/lib/module/radio/createRadioLabel.js +0 -33
  730. package/lib/module/radio/createRadioLabel.js.map +0 -1
  731. package/lib/module/radio/createRadioRoot.js +0 -90
  732. package/lib/module/radio/createRadioRoot.js.map +0 -1
  733. package/lib/module/radio/createRadioRoot.web.js +0 -82
  734. package/lib/module/radio/createRadioRoot.web.js.map +0 -1
  735. package/lib/module/select/createSelectContent.js.map +0 -1
  736. package/lib/module/select/createSelectIcon.js +0 -38
  737. package/lib/module/select/createSelectIcon.js.map +0 -1
  738. package/lib/module/select/createSelectItem.js.map +0 -1
  739. package/lib/module/select/createSelectItemLabel.js +0 -36
  740. package/lib/module/select/createSelectItemLabel.js.map +0 -1
  741. package/lib/module/select/createSelectRoot.js.map +0 -1
  742. package/lib/module/select/createSelectTrigger.js +0 -187
  743. package/lib/module/select/createSelectTrigger.js.map +0 -1
  744. package/lib/module/select/createSelectValue.js +0 -48
  745. package/lib/module/select/createSelectValue.js.map +0 -1
  746. package/lib/module/switch/createSwitchRoot.js +0 -67
  747. package/lib/module/switch/createSwitchRoot.js.map +0 -1
  748. package/lib/module/tile/createTileContent.js +0 -24
  749. package/lib/module/tile/createTileContent.js.map +0 -1
  750. package/lib/module/tile/createTileDescription.js +0 -22
  751. package/lib/module/tile/createTileDescription.js.map +0 -1
  752. package/lib/module/tile/createTileGroup.js.map +0 -1
  753. package/lib/module/tile/createTileIndicator.js +0 -40
  754. package/lib/module/tile/createTileIndicator.js.map +0 -1
  755. package/lib/module/tile/createTileLeadingSlot.js +0 -28
  756. package/lib/module/tile/createTileLeadingSlot.js.map +0 -1
  757. package/lib/module/tile/createTileRoot.js.map +0 -1
  758. package/lib/module/tile/createTileTitle.js +0 -22
  759. package/lib/module/tile/createTileTitle.js.map +0 -1
  760. package/lib/module/tile/createTileTrailingSlot.js +0 -29
  761. package/lib/module/tile/createTileTrailingSlot.js.map +0 -1
  762. package/lib/typescript/avatar/createAvatarBadge.d.ts +0 -4
  763. package/lib/typescript/avatar/createAvatarBadge.d.ts.map +0 -1
  764. package/lib/typescript/avatar/createAvatarIcon.d.ts +0 -4
  765. package/lib/typescript/avatar/createAvatarIcon.d.ts.map +0 -1
  766. package/lib/typescript/avatar/createAvatarImage.d.ts +0 -4
  767. package/lib/typescript/avatar/createAvatarImage.d.ts.map +0 -1
  768. package/lib/typescript/avatar/createAvatarRoot.d.ts +0 -4
  769. package/lib/typescript/avatar/createAvatarRoot.d.ts.map +0 -1
  770. package/lib/typescript/avatar/createAvatarText.d.ts +0 -4
  771. package/lib/typescript/avatar/createAvatarText.d.ts.map +0 -1
  772. package/lib/typescript/button/createButtonGroup.d.ts +0 -4
  773. package/lib/typescript/button/createButtonGroup.d.ts.map +0 -1
  774. package/lib/typescript/button/createButtonIcon.d.ts +0 -2
  775. package/lib/typescript/button/createButtonIcon.d.ts.map +0 -1
  776. package/lib/typescript/button/createButtonRoot.d.ts +0 -6
  777. package/lib/typescript/button/createButtonRoot.d.ts.map +0 -1
  778. package/lib/typescript/button/createButtonSpinner.d.ts +0 -4
  779. package/lib/typescript/button/createButtonSpinner.d.ts.map +0 -1
  780. package/lib/typescript/button/createButtonText.d.ts +0 -4
  781. package/lib/typescript/button/createButtonText.d.ts.map +0 -1
  782. package/lib/typescript/checkbox/createCheckboxGroup.d.ts +0 -3
  783. package/lib/typescript/checkbox/createCheckboxGroup.d.ts.map +0 -1
  784. package/lib/typescript/checkbox/createCheckboxIcon.d.ts +0 -3
  785. package/lib/typescript/checkbox/createCheckboxIcon.d.ts.map +0 -1
  786. package/lib/typescript/checkbox/createCheckboxIndicator.d.ts +0 -5
  787. package/lib/typescript/checkbox/createCheckboxIndicator.d.ts.map +0 -1
  788. package/lib/typescript/checkbox/createCheckboxLabel.d.ts +0 -5
  789. package/lib/typescript/checkbox/createCheckboxLabel.d.ts.map +0 -1
  790. package/lib/typescript/checkbox/createCheckboxRoot.d.ts +0 -2
  791. package/lib/typescript/checkbox/createCheckboxRoot.d.ts.map +0 -1
  792. package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts +0 -6
  793. package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts.map +0 -1
  794. package/lib/typescript/chip/createChipRoot.d.ts +0 -4
  795. package/lib/typescript/chip/createChipRoot.d.ts.map +0 -1
  796. package/lib/typescript/dialog/createDialogClose.d.ts +0 -4
  797. package/lib/typescript/dialog/createDialogClose.d.ts.map +0 -1
  798. package/lib/typescript/dialog/createDialogContent.d.ts +0 -4
  799. package/lib/typescript/dialog/createDialogContent.d.ts.map +0 -1
  800. package/lib/typescript/dialog/createDialogDescription.d.ts +0 -4
  801. package/lib/typescript/dialog/createDialogDescription.d.ts.map +0 -1
  802. package/lib/typescript/dialog/createDialogFooter.d.ts +0 -4
  803. package/lib/typescript/dialog/createDialogFooter.d.ts.map +0 -1
  804. package/lib/typescript/dialog/createDialogHeader.d.ts +0 -4
  805. package/lib/typescript/dialog/createDialogHeader.d.ts.map +0 -1
  806. package/lib/typescript/dialog/createDialogPopup.d.ts +0 -4
  807. package/lib/typescript/dialog/createDialogPopup.d.ts.map +0 -1
  808. package/lib/typescript/dialog/createDialogRoot.d.ts +0 -4
  809. package/lib/typescript/dialog/createDialogRoot.d.ts.map +0 -1
  810. package/lib/typescript/dialog/createDialogTitle.d.ts +0 -4
  811. package/lib/typescript/dialog/createDialogTitle.d.ts.map +0 -1
  812. package/lib/typescript/dialog/createDialogTrigger.d.ts +0 -4
  813. package/lib/typescript/dialog/createDialogTrigger.d.ts.map +0 -1
  814. package/lib/typescript/field/createFieldError.d.ts +0 -5
  815. package/lib/typescript/field/createFieldError.d.ts.map +0 -1
  816. package/lib/typescript/field/createFieldErrorIcon.d.ts +0 -5
  817. package/lib/typescript/field/createFieldErrorIcon.d.ts.map +0 -1
  818. package/lib/typescript/field/createFieldErrorText.d.ts +0 -5
  819. package/lib/typescript/field/createFieldErrorText.d.ts.map +0 -1
  820. package/lib/typescript/field/createFieldHelper.d.ts +0 -5
  821. package/lib/typescript/field/createFieldHelper.d.ts.map +0 -1
  822. package/lib/typescript/field/createFieldHelperText.d.ts +0 -5
  823. package/lib/typescript/field/createFieldHelperText.d.ts.map +0 -1
  824. package/lib/typescript/field/createFieldLabel.d.ts +0 -6
  825. package/lib/typescript/field/createFieldLabel.d.ts.map +0 -1
  826. package/lib/typescript/field/createFieldRoot.d.ts +0 -6
  827. package/lib/typescript/field/createFieldRoot.d.ts.map +0 -1
  828. package/lib/typescript/form/createFormRoot.d.ts +0 -4
  829. package/lib/typescript/form/createFormRoot.d.ts.map +0 -1
  830. package/lib/typescript/input/createInputField.d.ts +0 -4
  831. package/lib/typescript/input/createInputField.d.ts.map +0 -1
  832. package/lib/typescript/input/createInputRoot.d.ts +0 -4
  833. package/lib/typescript/input/createInputRoot.d.ts.map +0 -1
  834. package/lib/typescript/input/createInputSlot.d.ts +0 -4
  835. package/lib/typescript/input/createInputSlot.d.ts.map +0 -1
  836. package/lib/typescript/link/createLink.d.ts +0 -6
  837. package/lib/typescript/link/createLink.d.ts.map +0 -1
  838. package/lib/typescript/list-item/createListItemContent.d.ts +0 -3
  839. package/lib/typescript/list-item/createListItemContent.d.ts.map +0 -1
  840. package/lib/typescript/list-item/createListItemDescription.d.ts +0 -3
  841. package/lib/typescript/list-item/createListItemDescription.d.ts.map +0 -1
  842. package/lib/typescript/list-item/createListItemLeadingSlot.d.ts +0 -4
  843. package/lib/typescript/list-item/createListItemLeadingSlot.d.ts.map +0 -1
  844. package/lib/typescript/list-item/createListItemMeta.d.ts +0 -3
  845. package/lib/typescript/list-item/createListItemMeta.d.ts.map +0 -1
  846. package/lib/typescript/list-item/createListItemRoot.d.ts +0 -4
  847. package/lib/typescript/list-item/createListItemRoot.d.ts.map +0 -1
  848. package/lib/typescript/list-item/createListItemSectionHeader.d.ts +0 -4
  849. package/lib/typescript/list-item/createListItemSectionHeader.d.ts.map +0 -1
  850. package/lib/typescript/list-item/createListItemTitle.d.ts +0 -3
  851. package/lib/typescript/list-item/createListItemTitle.d.ts.map +0 -1
  852. package/lib/typescript/list-item/createListItemTrailingSlot.d.ts +0 -3
  853. package/lib/typescript/list-item/createListItemTrailingSlot.d.ts.map +0 -1
  854. package/lib/typescript/otp-input/createOtpInputCell.d.ts +0 -4
  855. package/lib/typescript/otp-input/createOtpInputCell.d.ts.map +0 -1
  856. package/lib/typescript/otp-input/createOtpInputField.d.ts +0 -4
  857. package/lib/typescript/otp-input/createOtpInputField.d.ts.map +0 -1
  858. package/lib/typescript/otp-input/createOtpInputRoot.d.ts +0 -4
  859. package/lib/typescript/otp-input/createOtpInputRoot.d.ts.map +0 -1
  860. package/lib/typescript/progress/context.d.ts.map +0 -1
  861. package/lib/typescript/progress/createProgressIndicator.d.ts +0 -3
  862. package/lib/typescript/progress/createProgressIndicator.d.ts.map +0 -1
  863. package/lib/typescript/progress/createProgressRoot.d.ts +0 -4
  864. package/lib/typescript/progress/createProgressRoot.d.ts.map +0 -1
  865. package/lib/typescript/progress/index.d.ts +0 -10
  866. package/lib/typescript/progress/index.d.ts.map +0 -1
  867. package/lib/typescript/progress/types.d.ts.map +0 -1
  868. package/lib/typescript/radio/createRadioGroup.d.ts +0 -3
  869. package/lib/typescript/radio/createRadioGroup.d.ts.map +0 -1
  870. package/lib/typescript/radio/createRadioIndicator.d.ts +0 -5
  871. package/lib/typescript/radio/createRadioIndicator.d.ts.map +0 -1
  872. package/lib/typescript/radio/createRadioLabel.d.ts +0 -5
  873. package/lib/typescript/radio/createRadioLabel.d.ts.map +0 -1
  874. package/lib/typescript/radio/createRadioRoot.d.ts +0 -3
  875. package/lib/typescript/radio/createRadioRoot.d.ts.map +0 -1
  876. package/lib/typescript/radio/createRadioRoot.web.d.ts +0 -3
  877. package/lib/typescript/radio/createRadioRoot.web.d.ts.map +0 -1
  878. package/lib/typescript/select/createSelectContent.d.ts +0 -4
  879. package/lib/typescript/select/createSelectContent.d.ts.map +0 -1
  880. package/lib/typescript/select/createSelectIcon.d.ts +0 -2
  881. package/lib/typescript/select/createSelectIcon.d.ts.map +0 -1
  882. package/lib/typescript/select/createSelectItem.d.ts +0 -6
  883. package/lib/typescript/select/createSelectItem.d.ts.map +0 -1
  884. package/lib/typescript/select/createSelectItemLabel.d.ts +0 -4
  885. package/lib/typescript/select/createSelectItemLabel.d.ts.map +0 -1
  886. package/lib/typescript/select/createSelectRoot.d.ts +0 -4
  887. package/lib/typescript/select/createSelectRoot.d.ts.map +0 -1
  888. package/lib/typescript/select/createSelectTrigger.d.ts +0 -7
  889. package/lib/typescript/select/createSelectTrigger.d.ts.map +0 -1
  890. package/lib/typescript/select/createSelectValue.d.ts +0 -4
  891. package/lib/typescript/select/createSelectValue.d.ts.map +0 -1
  892. package/lib/typescript/switch/createSwitchRoot.d.ts +0 -3
  893. package/lib/typescript/switch/createSwitchRoot.d.ts.map +0 -1
  894. package/lib/typescript/tile/createTileContent.d.ts +0 -3
  895. package/lib/typescript/tile/createTileContent.d.ts.map +0 -1
  896. package/lib/typescript/tile/createTileDescription.d.ts +0 -3
  897. package/lib/typescript/tile/createTileDescription.d.ts.map +0 -1
  898. package/lib/typescript/tile/createTileGroup.d.ts +0 -4
  899. package/lib/typescript/tile/createTileGroup.d.ts.map +0 -1
  900. package/lib/typescript/tile/createTileIndicator.d.ts +0 -4
  901. package/lib/typescript/tile/createTileIndicator.d.ts.map +0 -1
  902. package/lib/typescript/tile/createTileLeadingSlot.d.ts +0 -4
  903. package/lib/typescript/tile/createTileLeadingSlot.d.ts.map +0 -1
  904. package/lib/typescript/tile/createTileRoot.d.ts +0 -4
  905. package/lib/typescript/tile/createTileRoot.d.ts.map +0 -1
  906. package/lib/typescript/tile/createTileTitle.d.ts +0 -3
  907. package/lib/typescript/tile/createTileTitle.d.ts.map +0 -1
  908. package/lib/typescript/tile/createTileTrailingSlot.d.ts +0 -9
  909. package/lib/typescript/tile/createTileTrailingSlot.d.ts.map +0 -1
  910. package/src/avatar/createAvatarBadge.tsx +0 -12
  911. package/src/avatar/createAvatarIcon.tsx +0 -16
  912. package/src/avatar/createAvatarImage.tsx +0 -40
  913. package/src/avatar/createAvatarRoot.tsx +0 -23
  914. package/src/avatar/createAvatarText.tsx +0 -39
  915. package/src/button/createButtonGroup.tsx +0 -88
  916. package/src/button/createButtonIcon.tsx +0 -8
  917. package/src/button/createButtonRoot.tsx +0 -102
  918. package/src/button/createButtonSpinner.tsx +0 -20
  919. package/src/button/createButtonText.tsx +0 -23
  920. package/src/button/index.tsx +0 -53
  921. package/src/checkbox/createCheckboxGroup.tsx +0 -32
  922. package/src/checkbox/createCheckboxIcon.tsx +0 -18
  923. package/src/checkbox/createCheckboxIndicator.tsx +0 -43
  924. package/src/checkbox/createCheckboxLabel.tsx +0 -42
  925. package/src/checkbox/createCheckboxRoot.tsx +0 -100
  926. package/src/checkbox/createCheckboxRoot.web.tsx +0 -83
  927. package/src/chip/createChipRoot.tsx +0 -144
  928. package/src/dialog/createDialogClose.tsx +0 -27
  929. package/src/dialog/createDialogContent.tsx +0 -11
  930. package/src/dialog/createDialogDescription.tsx +0 -20
  931. package/src/dialog/createDialogFooter.tsx +0 -11
  932. package/src/dialog/createDialogHeader.tsx +0 -11
  933. package/src/dialog/createDialogPopup.tsx +0 -146
  934. package/src/dialog/createDialogRoot.tsx +0 -66
  935. package/src/dialog/createDialogTitle.tsx +0 -11
  936. package/src/dialog/createDialogTrigger.tsx +0 -27
  937. package/src/field/createFieldError.tsx +0 -32
  938. package/src/field/createFieldErrorIcon.tsx +0 -9
  939. package/src/field/createFieldErrorText.tsx +0 -9
  940. package/src/field/createFieldHelper.tsx +0 -28
  941. package/src/field/createFieldHelperText.tsx +0 -9
  942. package/src/field/createFieldLabel.tsx +0 -33
  943. package/src/field/createFieldRoot.tsx +0 -27
  944. package/src/form/createFormRoot.tsx +0 -13
  945. package/src/input/createInputField.tsx +0 -120
  946. package/src/input/createInputRoot.tsx +0 -92
  947. package/src/input/createInputSlot.tsx +0 -39
  948. package/src/link/createLink.tsx +0 -89
  949. package/src/list-item/createListItemContent.tsx +0 -23
  950. package/src/list-item/createListItemDescription.tsx +0 -19
  951. package/src/list-item/createListItemLeadingSlot.tsx +0 -30
  952. package/src/list-item/createListItemMeta.tsx +0 -17
  953. package/src/list-item/createListItemRoot.tsx +0 -195
  954. package/src/list-item/createListItemSectionHeader.tsx +0 -53
  955. package/src/list-item/createListItemTitle.tsx +0 -17
  956. package/src/list-item/createListItemTrailingSlot.tsx +0 -21
  957. package/src/otp-input/createOtpInputCell.tsx +0 -22
  958. package/src/otp-input/createOtpInputField.tsx +0 -98
  959. package/src/otp-input/createOtpInputRoot.tsx +0 -179
  960. package/src/otp-input/index.tsx +0 -34
  961. package/src/progress/createProgressIndicator.tsx +0 -35
  962. package/src/progress/index.ts +0 -28
  963. package/src/radio/createRadioIndicator.tsx +0 -32
  964. package/src/radio/createRadioLabel.tsx +0 -28
  965. package/src/radio/createRadioRoot.tsx +0 -100
  966. package/src/radio/createRadioRoot.web.tsx +0 -81
  967. package/src/select/createSelectContent.tsx +0 -115
  968. package/src/select/createSelectIcon.tsx +0 -28
  969. package/src/select/createSelectItem.tsx +0 -121
  970. package/src/select/createSelectItemLabel.tsx +0 -30
  971. package/src/select/createSelectRoot.tsx +0 -134
  972. package/src/select/createSelectTrigger.tsx +0 -241
  973. package/src/select/createSelectValue.tsx +0 -38
  974. package/src/select/index.tsx +0 -73
  975. package/src/switch/createSwitchRoot.tsx +0 -72
  976. package/src/tile/createTileContent.tsx +0 -23
  977. package/src/tile/createTileDescription.tsx +0 -19
  978. package/src/tile/createTileGroup.tsx +0 -134
  979. package/src/tile/createTileIndicator.tsx +0 -38
  980. package/src/tile/createTileLeadingSlot.tsx +0 -30
  981. package/src/tile/createTileTitle.tsx +0 -19
  982. package/src/tile/createTileTrailingSlot.tsx +0 -25
  983. /package/lib/commonjs/{progress → progress-bar}/context.js +0 -0
  984. /package/lib/commonjs/{progress → progress-bar}/types.js +0 -0
  985. /package/lib/module/{progress → progress-bar}/context.js +0 -0
  986. /package/lib/module/{progress → progress-bar}/types.js +0 -0
  987. /package/lib/typescript/{progress → progress-bar}/context.d.ts +0 -0
  988. /package/src/{progress → progress-bar}/context.tsx +0 -0
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ import { forwardRef, useMemo } from 'react';
4
+ import { TextInput } from 'react-native';
5
+ import { mergeRefs, useFormControl, useFormControlContext } from '@cdx-ui/utils';
6
+ import { Slot } from '../slot';
7
+ import { useInputContext } from './context';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ export const InputField = /*#__PURE__*/forwardRef((props, ref) => {
10
+ const {
11
+ asChild,
12
+ children,
13
+ onKeyPress,
14
+ type = 'text',
15
+ accessibilityLabel,
16
+ 'aria-label': ariaLabelProp,
17
+ secureTextEntry,
18
+ editable,
19
+ disabled,
20
+ ...rest
21
+ } = props;
22
+ const {
23
+ isDisabled,
24
+ isReadOnly,
25
+ isFocused,
26
+ isInvalid,
27
+ setIsFocused,
28
+ inputFieldRef,
29
+ isRequired
30
+ } = useInputContext();
31
+ const inputProps = useFormControl({
32
+ isDisabled: rest.isDisabled || disabled,
33
+ isInvalid: rest.isInvalid,
34
+ isReadOnly: rest.isReadOnly,
35
+ isRequired: rest.isRequired,
36
+ id: rest.id
37
+ });
38
+ const field = useFormControlContext();
39
+ const reportLabelFocus = focused => {
40
+ const active = focused && !(isDisabled || inputProps.disabled);
41
+ field.setIsLabelFocused?.(active);
42
+ };
43
+ const handleFocus = (focusState, callback) => {
44
+ setIsFocused?.(focusState);
45
+ reportLabelFocus(focusState);
46
+ callback();
47
+ };
48
+ const mergedRef = mergeRefs(ref, inputFieldRef, field.inputRef);
49
+ const isEffectivelyDisabled = isDisabled || inputProps.disabled;
50
+ const ariaLabel = accessibilityLabel ?? ariaLabelProp;
51
+ const editableProp = useMemo(() => {
52
+ if (editable !== undefined) {
53
+ return editable;
54
+ }
55
+ return !(isDisabled || inputProps.disabled || isReadOnly);
56
+ }, [isDisabled, inputProps.disabled, isReadOnly, editable]);
57
+ const Comp = asChild ? Slot : TextInput;
58
+ return /*#__PURE__*/_jsx(Comp, {
59
+ ...inputProps,
60
+ ...rest,
61
+ type: type,
62
+ disabled: isEffectivelyDisabled,
63
+ secureTextEntry: secureTextEntry || type === 'password',
64
+ accessible: true,
65
+ accessibilityLabel: ariaLabel,
66
+ "aria-label": ariaLabel,
67
+ "aria-required": isRequired || inputProps.required,
68
+ "aria-invalid": isInvalid || inputProps['aria-invalid'],
69
+ "aria-disabled": isEffectivelyDisabled,
70
+ "aria-selected": isFocused,
71
+ accessibilityElementsHidden: isEffectivelyDisabled,
72
+ readOnly: !editableProp,
73
+ onKeyPress: e => {
74
+ e.persist();
75
+ onKeyPress?.(e);
76
+ },
77
+ onFocus: e => {
78
+ handleFocus(true, () => rest.onFocus?.(e));
79
+ },
80
+ onBlur: e => {
81
+ handleFocus(false, () => rest.onBlur?.(e));
82
+ },
83
+ ref: mergedRef,
84
+ children: children
85
+ });
86
+ });
87
+ InputField.displayName = 'InputField';
88
+ //# sourceMappingURL=InputField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","useMemo","TextInput","mergeRefs","useFormControl","useFormControlContext","Slot","useInputContext","jsx","_jsx","InputField","props","ref","asChild","children","onKeyPress","type","accessibilityLabel","ariaLabelProp","secureTextEntry","editable","disabled","rest","isDisabled","isReadOnly","isFocused","isInvalid","setIsFocused","inputFieldRef","isRequired","inputProps","id","field","reportLabelFocus","focused","active","setIsLabelFocused","handleFocus","focusState","callback","mergedRef","inputRef","isEffectivelyDisabled","ariaLabel","editableProp","undefined","Comp","accessible","required","accessibilityElementsHidden","readOnly","e","persist","onFocus","onBlur","displayName"],"sourceRoot":"../../../src","sources":["input/InputField.tsx"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+
3
+ import React, { forwardRef, useMemo } from 'react';
4
+ import { TextInput } from 'react-native';
5
+ import { mergeRefs, useFormControl, useFormControlContext } from '@cdx-ui/utils';
6
+ import { Slot } from '../slot';
7
+ import { useInputContext } from './context';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ const fileInputStyle = {
10
+ flex: 1,
11
+ minWidth: 0,
12
+ border: 'none',
13
+ outline: 'none',
14
+ background: 'transparent',
15
+ fontSize: 'inherit',
16
+ fontFamily: 'inherit'
17
+ };
18
+ export const InputField = /*#__PURE__*/forwardRef((props, ref) => {
19
+ const {
20
+ asChild,
21
+ children,
22
+ onKeyPress,
23
+ type = 'text',
24
+ accessibilityLabel,
25
+ 'aria-label': ariaLabelProp,
26
+ secureTextEntry,
27
+ editable,
28
+ disabled,
29
+ ...rest
30
+ } = props;
31
+ const {
32
+ isDisabled,
33
+ isReadOnly,
34
+ isInvalid,
35
+ setIsFocused,
36
+ isRequired,
37
+ inputFieldRef
38
+ } = useInputContext();
39
+ const inputProps = useFormControl({
40
+ isDisabled: rest.isDisabled || disabled,
41
+ isInvalid: rest.isInvalid,
42
+ isReadOnly: rest.isReadOnly,
43
+ isRequired: rest.isRequired,
44
+ id: rest.id
45
+ });
46
+ const field = useFormControlContext();
47
+ const reportLabelFocus = focused => {
48
+ const active = focused && !(isDisabled || inputProps.disabled);
49
+ field.setIsLabelFocused?.(active);
50
+ };
51
+ const handleFocus = (focusState, callback) => {
52
+ setIsFocused?.(focusState);
53
+ reportLabelFocus(focusState);
54
+ callback();
55
+ };
56
+ const mergedRef = mergeRefs(ref, inputFieldRef);
57
+ const isEffectivelyDisabled = isDisabled || inputProps.disabled;
58
+ const ariaLabel = accessibilityLabel ?? ariaLabelProp;
59
+ const editableProp = useMemo(() => {
60
+ if (editable !== undefined) {
61
+ return editable;
62
+ }
63
+ return !(isDisabled || inputProps.disabled || isReadOnly);
64
+ }, [isDisabled, inputProps.disabled, isReadOnly, editable]);
65
+ if (!asChild && type === 'file') {
66
+ const fileProps = rest;
67
+ return /*#__PURE__*/React.createElement('input', {
68
+ ref: mergedRef,
69
+ type: 'file',
70
+ accept: fileProps.accept || undefined,
71
+ multiple: fileProps.multiple || undefined,
72
+ capture: fileProps.capture || undefined,
73
+ disabled: isEffectivelyDisabled || undefined,
74
+ 'aria-label': ariaLabel,
75
+ 'aria-required': isRequired || inputProps.required || undefined,
76
+ 'aria-invalid': isInvalid || inputProps['aria-invalid'] || undefined,
77
+ 'aria-disabled': isEffectivelyDisabled || undefined,
78
+ onChange: e => {
79
+ const files = e.target.files;
80
+ if (files && fileProps.onFiles) {
81
+ fileProps.onFiles(Array.from(files));
82
+ }
83
+ },
84
+ onFocus: e => {
85
+ handleFocus(true, () => rest.onFocus?.(e));
86
+ },
87
+ onBlur: e => {
88
+ handleFocus(false, () => rest.onBlur?.(e));
89
+ },
90
+ style: {
91
+ ...fileInputStyle,
92
+ cursor: isEffectivelyDisabled ? 'not-allowed' : 'pointer'
93
+ }
94
+ });
95
+ }
96
+ const Comp = asChild ? Slot : TextInput;
97
+ return /*#__PURE__*/_jsx(Comp, {
98
+ ...inputProps,
99
+ ...rest,
100
+ type: type,
101
+ disabled: isEffectivelyDisabled,
102
+ secureTextEntry: secureTextEntry || type === 'password',
103
+ accessible: true,
104
+ accessibilityLabel: ariaLabel,
105
+ "aria-label": ariaLabel,
106
+ "aria-required": isRequired || inputProps.required,
107
+ "aria-invalid": isInvalid || inputProps['aria-invalid'],
108
+ "aria-disabled": isEffectivelyDisabled,
109
+ accessibilityElementsHidden: isEffectivelyDisabled,
110
+ readOnly: !editableProp,
111
+ onKeyPress: e => {
112
+ e.persist();
113
+ onKeyPress?.(e);
114
+ },
115
+ onFocus: e => {
116
+ handleFocus(true, () => rest.onFocus?.(e));
117
+ },
118
+ onBlur: e => {
119
+ handleFocus(false, () => rest.onBlur?.(e));
120
+ },
121
+ ref: mergedRef,
122
+ children: children
123
+ });
124
+ });
125
+ InputField.displayName = 'InputField';
126
+ //# sourceMappingURL=InputField.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","forwardRef","useMemo","TextInput","mergeRefs","useFormControl","useFormControlContext","Slot","useInputContext","jsx","_jsx","fileInputStyle","flex","minWidth","border","outline","background","fontSize","fontFamily","InputField","props","ref","asChild","children","onKeyPress","type","accessibilityLabel","ariaLabelProp","secureTextEntry","editable","disabled","rest","isDisabled","isReadOnly","isInvalid","setIsFocused","isRequired","inputFieldRef","inputProps","id","field","reportLabelFocus","focused","active","setIsLabelFocused","handleFocus","focusState","callback","mergedRef","isEffectivelyDisabled","ariaLabel","editableProp","undefined","fileProps","createElement","accept","multiple","capture","required","onChange","e","files","target","onFiles","Array","from","onFocus","onBlur","style","cursor","Comp","accessible","accessibilityElementsHidden","readOnly","persist","displayName"],"sourceRoot":"../../../src","sources":["input/InputField.web.tsx"],"mappings":"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","ignoreList":[]}
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
 
3
- import React, { forwardRef, useCallback, useMemo } from 'react';
3
+ import { forwardRef, useCallback, useMemo, useRef, useState } from 'react';
4
+ import { View } from 'react-native';
4
5
  import { mergeRefs, useFormControlContext } from '@cdx-ui/utils';
5
6
  import { useFocusRing } from '@react-native-aria/focus';
6
7
  import { useHover } from '@react-native-aria/interactions';
7
- import { dataAttributes } from '../utils/dataAttributes';
8
+ import { Slot } from '../slot';
9
+ import { dataAttributes, mergeDataAttributes } from '../utils/dataAttributes';
8
10
  import { InputProvider } from './context';
9
11
  import { jsx as _jsx } from "react/jsx-runtime";
10
- // TODO: Does this need useControllableState?
11
-
12
- export const createInputRoot = BaseInput => /*#__PURE__*/forwardRef(({
12
+ export const InputRoot = /*#__PURE__*/forwardRef(({
13
+ asChild,
13
14
  children,
14
15
  isReadOnly,
15
16
  isDisabled,
@@ -18,11 +19,11 @@ export const createInputRoot = BaseInput => /*#__PURE__*/forwardRef(({
18
19
  isHovered: isHoveredProp,
19
20
  isFocused: isFocusedProp,
20
21
  isFocusVisible: isFocusVisibleProp,
21
- ...props
22
+ ...rest
22
23
  }, ref) => {
23
- const inputRef = React.useRef(null);
24
- const inputFieldRef = React.useRef(null);
25
- const [isFocused, setIsFocused] = React.useState(false);
24
+ const inputRef = useRef(null);
25
+ const inputFieldRef = useRef(null);
26
+ const [isFocused, setIsFocused] = useState(false);
26
27
  const handleFocus = useCallback((focusState, callback) => {
27
28
  setIsFocused(focusState);
28
29
  callback();
@@ -41,6 +42,8 @@ export const createInputRoot = BaseInput => /*#__PURE__*/forwardRef(({
41
42
  const resolvedHovered = isHoveredProp || isHovered;
42
43
  const resolvedFocused = isFocusedProp || isFocused;
43
44
  const resolvedFocusVisible = isFocusVisibleProp || isFocusVisible;
45
+
46
+ // TODO: Remove is prefix from props (align with ButtonRoot)
44
47
  const contextValue = useMemo(() => ({
45
48
  isDisabled: resolvedDisabled,
46
49
  isInvalid: resolvedInvalid,
@@ -54,23 +57,24 @@ export const createInputRoot = BaseInput => /*#__PURE__*/forwardRef(({
54
57
  setIsFocused,
55
58
  inputFieldRef
56
59
  }), [resolvedDisabled, resolvedInvalid, resolvedHovered, resolvedFocused, resolvedFocusVisible, resolvedReadOnly, resolvedRequired, handleFocus]);
57
- return /*#__PURE__*/_jsx(BaseInput, {
58
- ...dataAttributes({
59
- hover: resolvedHovered,
60
- focus: resolvedFocused,
61
- disabled: resolvedDisabled,
62
- invalid: resolvedInvalid,
63
- readonly: resolvedReadOnly,
64
- required: resolvedRequired,
65
- focusVisible: resolvedFocusVisible
66
- }),
67
- ...props,
68
- ref: mergeRefs(inputRef, ref) // TODO: Somehow utils and primitives package are resolving to different versions of react (@types/react?)
69
- ,
70
- children: /*#__PURE__*/_jsx(InputProvider, {
71
- value: contextValue,
60
+ const Comp = asChild ? Slot : View;
61
+ return /*#__PURE__*/_jsx(InputProvider, {
62
+ value: contextValue,
63
+ children: /*#__PURE__*/_jsx(Comp, {
64
+ ref: mergeRefs(inputRef, ref),
65
+ ...rest,
66
+ ...mergeDataAttributes(rest, dataAttributes({
67
+ hover: resolvedHovered,
68
+ focus: resolvedFocused,
69
+ disabled: resolvedDisabled,
70
+ invalid: resolvedInvalid,
71
+ readonly: resolvedReadOnly,
72
+ required: resolvedRequired,
73
+ focusVisible: resolvedFocusVisible
74
+ })),
72
75
  children: children
73
76
  })
74
77
  });
75
78
  });
76
- //# sourceMappingURL=createInputRoot.js.map
79
+ InputRoot.displayName = 'InputRoot';
80
+ //# sourceMappingURL=InputRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","useCallback","useMemo","useRef","useState","View","mergeRefs","useFormControlContext","useFocusRing","useHover","Slot","dataAttributes","mergeDataAttributes","InputProvider","jsx","_jsx","InputRoot","asChild","children","isReadOnly","isDisabled","isInvalid","isRequired","isHovered","isHoveredProp","isFocused","isFocusedProp","isFocusVisible","isFocusVisibleProp","rest","ref","inputRef","inputFieldRef","setIsFocused","handleFocus","focusState","callback","inputProps","resolvedDisabled","resolvedInvalid","resolvedReadOnly","resolvedRequired","resolvedHovered","resolvedFocused","resolvedFocusVisible","contextValue","Comp","value","hover","focus","disabled","invalid","readonly","required","focusVisible","displayName"],"sourceRoot":"../../../src","sources":["input/InputRoot.tsx"],"mappings":"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","ignoreList":[]}
@@ -1,18 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { createInputField } from './createInputField';
4
- import { createInputRoot } from './createInputRoot';
5
- import { createInputSlot } from './createInputSlot';
6
- export function createInput(BaseComponents) {
7
- const Input = createInputRoot(BaseComponents.Root);
8
- const Slot = createInputSlot(BaseComponents.Slot);
9
- const Field = createInputField(BaseComponents.Field);
10
- Input.displayName = 'InputPrimitive';
11
- Slot.displayName = 'InputPrimitive.Slot';
12
- Field.displayName = 'InputPrimitive.Field';
13
- return Object.assign(Input, {
14
- Slot,
15
- Field
16
- });
17
- }
3
+ export { useInputContext } from './context';
4
+ export { InputRoot } from './InputRoot';
5
+ export { InputField } from './InputField';
18
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createInputField","createInputRoot","createInputSlot","createInput","BaseComponents","Input","Root","Slot","Field","displayName","Object","assign"],"sourceRoot":"../../../src","sources":["input/index.tsx"],"mappings":";;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,eAAe,QAAQ,mBAAmB;AAWnD,OAAO,SAASC,WAAWA,CAMzBC,cAID,EAAE;EACD,MAAMC,KAAK,GAAGJ,eAAe,CAACG,cAAc,CAACE,IAAI,CAAC;EAClD,MAAMC,IAAI,GAAGL,eAAe,CAACE,cAAc,CAACG,IAAI,CAAC;EACjD,MAAMC,KAAK,GAAGR,gBAAgB,CAACI,cAAc,CAACI,KAAK,CAAC;EAEpDH,KAAK,CAACI,WAAW,GAAG,gBAAgB;EACpCF,IAAI,CAACE,WAAW,GAAG,qBAAqB;EACxCD,KAAK,CAACC,WAAW,GAAG,sBAAsB;EAE1C,OAAOC,MAAM,CAACC,MAAM,CAACN,KAAK,EAAE;IAC1BE,IAAI;IACJC;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["useInputContext","InputRoot","InputField"],"sourceRoot":"../../../src","sources":["input/index.tsx"],"mappings":";;AACA,SAASA,eAAe,QAAQ,WAAW;AAC3C,SAASC,SAAS,QAA6B,aAAa;AAC5D,SAASC,UAAU,QAA8B,cAAc","ignoreList":[]}
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
2
 
3
- import React, { forwardRef, useMemo } from 'react';
3
+ import { forwardRef, useMemo } from 'react';
4
+ import { Pressable } from 'react-native';
4
5
  import { composeEventHandlers } from '@cdx-ui/utils';
5
- import { useFocusRing, useFocus } from '@react-native-aria/focus';
6
+ import { useFocus, useFocusRing } from '@react-native-aria/focus';
6
7
  import { useHover, usePress } from '@react-native-aria/interactions';
7
- import { dataAttributes } from '../utils/dataAttributes';
8
+ import { Slot } from '../slot';
9
+ import { dataAttributes, mergeDataAttributes } from '../utils/dataAttributes';
8
10
  import { LinkInteractionProvider } from './context';
9
11
  import { useLink } from './useLink';
10
12
  import { jsx as _jsx } from "react/jsx-runtime";
11
- export const createLink = ({
12
- Root
13
- }) => /*#__PURE__*/forwardRef(({
13
+ export const LinkRoot = /*#__PURE__*/forwardRef(({
14
+ asChild,
14
15
  children,
15
16
  isHovered: isHoveredProp,
16
17
  isPressed: isPressedProp,
@@ -50,33 +51,34 @@ export const createLink = ({
50
51
  const hover = isHoveredProp || isHovered;
51
52
  const visited = isVisitedProp ?? false;
52
53
  const focusVisible = isFocusVisibleProp || isFocusVisible;
53
- const interactionState = useMemo(() => ({
54
+ const contextValue = useMemo(() => ({
54
55
  hover,
55
56
  visited,
56
57
  focusVisible
57
58
  }), [hover, visited, focusVisible]);
58
- const interactionAttrs = dataAttributes({
59
- hover,
60
- focus: isFocusedProp || isFocused,
61
- active: isPressedProp || isPressed,
62
- focusVisible,
63
- visited
64
- });
59
+ const Comp = asChild ? Slot : Pressable;
65
60
  return /*#__PURE__*/_jsx(LinkInteractionProvider, {
66
- value: interactionState,
67
- children: /*#__PURE__*/_jsx(Root, {
61
+ value: contextValue,
62
+ children: /*#__PURE__*/_jsx(Comp, {
68
63
  ref: ref,
69
- ...interactionAttrs,
70
64
  ...linkProps,
71
65
  ...props,
66
+ ...mergeDataAttributes(props, dataAttributes({
67
+ hover,
68
+ focus: isFocusedProp || isFocused,
69
+ active: isPressedProp || isPressed,
70
+ focusVisible,
71
+ visited
72
+ })),
72
73
  onPressIn: composeEventHandlers(props?.onPressIn, pressProps.onPressIn),
73
74
  onPressOut: composeEventHandlers(props?.onPressOut, pressProps.onPressOut),
74
75
  onHoverIn: composeEventHandlers(props?.onHoverIn, hoverProps.onHoverIn),
75
76
  onHoverOut: composeEventHandlers(props?.onHoverOut, hoverProps.onHoverOut),
76
77
  onFocus: composeEventHandlers(composeEventHandlers(props?.onFocus, focusProps.onFocus), focusRingProps.onFocus),
77
78
  onBlur: composeEventHandlers(composeEventHandlers(props?.onBlur, focusProps.onBlur), focusRingProps.onBlur),
78
- children: children
79
+ children: typeof children === 'function' ? children(contextValue) : children
79
80
  })
80
81
  });
81
82
  });
82
- //# sourceMappingURL=createLink.js.map
83
+ LinkRoot.displayName = 'LinkRoot';
84
+ //# sourceMappingURL=LinkRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","useMemo","Pressable","composeEventHandlers","useFocus","useFocusRing","useHover","usePress","Slot","dataAttributes","mergeDataAttributes","LinkInteractionProvider","useLink","jsx","_jsx","LinkRoot","asChild","children","isHovered","isHoveredProp","isPressed","isPressedProp","isFocused","isFocusedProp","isFocusVisible","isFocusVisibleProp","isVisited","isVisitedProp","href","onPress","action","webProps","props","ref","focusProps","focusRingProps","pressProps","hoverProps","linkProps","hover","visited","focusVisible","contextValue","Comp","value","focus","active","onPressIn","onPressOut","onHoverIn","onHoverOut","onFocus","onBlur","displayName"],"sourceRoot":"../../../src","sources":["link/LinkRoot.tsx"],"mappings":"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","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- export { createLink } from './createLink';
3
+ export { LinkRoot } from './LinkRoot';
4
4
  export { LinkInteractionProvider, useLinkInteractionContext } from './context';
5
5
  export { LinkProvider } from './LinkProvider';
6
6
  export { useLink } from './useLink';
@@ -1 +1 @@
1
- {"version":3,"names":["createLink","LinkInteractionProvider","useLinkInteractionContext","LinkProvider","useLink"],"sourceRoot":"../../../src","sources":["link/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,uBAAuB,EAAEC,yBAAyB,QAAQ,WAAW;AAE9E,SAASC,YAAY,QAAQ,gBAAgB;AAE7C,SAASC,OAAO,QAAQ,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["LinkRoot","LinkInteractionProvider","useLinkInteractionContext","LinkProvider","useLink"],"sourceRoot":"../../../src","sources":["link/index.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAA4B,YAAY;AACzD,SAASC,uBAAuB,EAAEC,yBAAyB,QAAQ,WAAW;AAE9E,SAASC,YAAY,QAAQ,gBAAgB;AAE7C,SAASC,OAAO,QAAQ,WAAW","ignoreList":[]}
@@ -1,20 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  import React, { forwardRef, useMemo } from 'react';
4
- import { composeEventHandlers, mergeRefs } from '@cdx-ui/utils';
4
+ import { Pressable, View } from 'react-native';
5
+ import { composeEventHandlers } from '@cdx-ui/utils';
5
6
  import { useFocus, useFocusRing } from '@react-native-aria/focus';
6
7
  import { useHover, usePress } from '@react-native-aria/interactions';
7
- import { dataAttributes } from '../utils/dataAttributes';
8
+ import { Slot } from '../slot';
9
+ import { dataAttributes, mergeDataAttributes } from '../utils/dataAttributes';
8
10
  import { ListItemProvider } from './context';
9
11
  import { jsx as _jsx } from "react/jsx-runtime";
10
- function listItemRootDataAttrs(size, showSeparator, crossAlign) {
11
- return dataAttributes({
12
- slot: 'list-item',
13
- size: size ?? 'default',
14
- separator: showSeparator ?? true,
15
- crossAlign: crossAlign ?? 'center'
16
- });
17
- }
18
12
  function rowStyleForCrossAlign(crossAlign) {
19
13
  return {
20
14
  flexDirection: 'row',
@@ -22,23 +16,15 @@ function rowStyleForCrossAlign(crossAlign) {
22
16
  alignItems: crossAlign === 'start' ? 'flex-start' : 'center'
23
17
  };
24
18
  }
25
- export const createListItemRoot = (BaseView, BasePressable) => /*#__PURE__*/forwardRef(({
19
+ export const ListItemRoot = /*#__PURE__*/forwardRef(({
26
20
  asChild = false,
27
21
  children,
28
22
  onPress,
29
- size = 'default',
30
- showSeparator = true,
31
23
  crossAlign = 'center',
32
24
  isDisabled = false,
33
25
  style,
34
26
  ...restProps
35
27
  }, ref) => {
36
- const childOnPress = /*#__PURE__*/React.isValidElement(children) ? children.props.onPress : undefined;
37
-
38
- // asChild always wins when explicitly set with a valid element — even when the press
39
- // surface is built internally by the child (e.g. `Link` adds its onPress via `useLink`,
40
- // not as a JSX-level prop). The clone path below preserves the child's own press by
41
- // *omitting* `onPress` when there is nothing to compose.
42
28
  const asChildInteractive = asChild && /*#__PURE__*/React.isValidElement(children);
43
29
  const isPressableRoot = !!onPress && !asChildInteractive;
44
30
  const pressState = usePress({
@@ -58,61 +44,51 @@ export const createListItemRoot = (BaseView, BasePressable) => /*#__PURE__*/forw
58
44
  isFocusVisible,
59
45
  focusProps: focusRingProps
60
46
  } = useFocusRing();
61
- const slotAttrs = listItemRootDataAttrs(size, showSeparator, crossAlign);
47
+ const childDisabled = asChildInteractive && !!(children.props.isDisabled ?? children.props.disabled);
48
+ const resolvedDisabled = isDisabled || childDisabled;
62
49
  const contextValue = useMemo(() => ({
63
- isPressed: isPressableRoot ? isPressed : false,
64
- isHovered,
65
- isDisabled,
66
- crossAlign: crossAlign ?? 'center'
67
- }), [isPressableRoot, isPressed, isHovered, isDisabled, crossAlign]);
50
+ hover: isPressableRoot ? isHovered : false,
51
+ focus: isPressableRoot ? isFocused : false,
52
+ active: isPressableRoot ? isPressed : false,
53
+ disabled: isPressableRoot ? isDisabled : resolvedDisabled,
54
+ focusVisible: isPressableRoot ? isFocusVisible : false
55
+ }), [isPressableRoot, isHovered, isFocused, isPressed, isDisabled, resolvedDisabled, isFocusVisible]);
68
56
  if (asChildInteractive) {
69
- const child = children;
70
- const childProps = child.props;
71
- const childDisabled = !!(childProps.isDisabled ?? childProps.disabled);
72
- const resolvedDisabled = isDisabled || childDisabled;
73
- const cloneProps = {
57
+ const slotMergeProps = {
74
58
  ...restProps,
75
- ...slotAttrs,
76
- ...dataAttributes({
77
- disabled: resolvedDisabled
78
- }),
79
59
  ...(resolvedDisabled && {
80
60
  accessibilityState: {
81
61
  disabled: true
82
62
  }
83
63
  }),
84
64
  disabled: resolvedDisabled,
85
- ref: mergeRefs(ref, child.props.ref),
86
- style: [rowStyleForCrossAlign(crossAlign), style, child.props.style]
65
+ style: [rowStyleForCrossAlign(crossAlign), style]
87
66
  };
88
67
 
89
- // Only override the child's `onPress` when we have something to add (a parent handler)
90
- // or need to suppress (disabled). Otherwise leave the child's own onPress alone e.g.
91
- // `Link` builds its navigation handler inside `useLink`, not as a JSX-level prop, and
92
- // overriding here would shadow it.
93
- if (resolvedDisabled) {
94
- cloneProps.onPress = undefined;
95
- } else if (onPress) {
96
- cloneProps.onPress = composeEventHandlers(childOnPress, onPress);
68
+ // Only set onPress when we have a parent handler to compose. Slot merges this
69
+ // with the child's own onPress (child first, then ours). When there is no parent
70
+ // onPress, omitting it preserves the child's internal handler (e.g. Link's useLink).
71
+ // When disabled, `disabled` prop suppresses press events on the child.
72
+ if (!resolvedDisabled && onPress) {
73
+ slotMergeProps.onPress = onPress;
97
74
  }
98
75
  return /*#__PURE__*/_jsx(ListItemProvider, {
99
- value: {
100
- isPressed: false,
101
- isHovered: false,
102
- isDisabled: resolvedDisabled,
103
- crossAlign: crossAlign ?? 'center'
104
- },
105
- children: /*#__PURE__*/React.cloneElement(child, cloneProps)
76
+ value: contextValue,
77
+ children: /*#__PURE__*/_jsx(Slot, {
78
+ ref: ref,
79
+ ...slotMergeProps,
80
+ ...mergeDataAttributes(restProps, dataAttributes({
81
+ active: false,
82
+ hover: false,
83
+ focus: false,
84
+ focusVisible: false,
85
+ disabled: resolvedDisabled
86
+ })),
87
+ children: children
88
+ })
106
89
  });
107
90
  }
108
91
  if (isPressableRoot) {
109
- const interactionAttrs = dataAttributes({
110
- active: isPressed,
111
- hover: isHovered,
112
- focus: isFocused,
113
- focusVisible: isFocusVisible,
114
- disabled: isDisabled
115
- });
116
92
  const {
117
93
  onPressIn: onPressInProp,
118
94
  onPressOut: onPressOutProp,
@@ -123,17 +99,15 @@ export const createListItemRoot = (BaseView, BasePressable) => /*#__PURE__*/forw
123
99
  } = restProps;
124
100
  return /*#__PURE__*/_jsx(ListItemProvider, {
125
101
  value: contextValue,
126
- children: /*#__PURE__*/_jsx(BasePressable, {
102
+ children: /*#__PURE__*/_jsx(Pressable, {
127
103
  ...restProps,
128
- ...slotAttrs,
129
- ...interactionAttrs,
104
+ ref: ref,
130
105
  ...(isDisabled && {
131
106
  accessibilityState: {
132
107
  disabled: true
133
108
  }
134
109
  }),
135
110
  disabled: isDisabled,
136
- ref: ref,
137
111
  style: [rowStyleForCrossAlign(crossAlign), style],
138
112
  onPress: isDisabled ? undefined : onPress,
139
113
  onPressIn: composeEventHandlers(onPressInProp, pressProps.onPressIn),
@@ -142,22 +116,29 @@ export const createListItemRoot = (BaseView, BasePressable) => /*#__PURE__*/forw
142
116
  onHoverOut: composeEventHandlers(onHoverOutProp, hoverProps.onHoverOut),
143
117
  onFocus: composeEventHandlers(composeEventHandlers(onFocusProp, focusProps.onFocus), focusRingProps.onFocus),
144
118
  onBlur: composeEventHandlers(composeEventHandlers(onBlurProp, focusProps.onBlur), focusRingProps.onBlur),
119
+ ...mergeDataAttributes(restProps, dataAttributes({
120
+ active: isPressed,
121
+ hover: isHovered,
122
+ focus: isFocused,
123
+ focusVisible: isFocusVisible,
124
+ disabled: isDisabled
125
+ })),
145
126
  children: children
146
127
  })
147
128
  });
148
129
  }
149
130
  return /*#__PURE__*/_jsx(ListItemProvider, {
150
131
  value: contextValue,
151
- children: /*#__PURE__*/_jsx(BaseView, {
132
+ children: /*#__PURE__*/_jsx(View, {
152
133
  ...restProps,
153
- ...slotAttrs,
154
- ...(isDisabled ? dataAttributes({
155
- disabled: true
156
- }) : undefined),
157
134
  ref: ref,
158
135
  style: [rowStyleForCrossAlign(crossAlign), style],
136
+ ...mergeDataAttributes(restProps, isDisabled ? dataAttributes({
137
+ disabled: true
138
+ }) : undefined),
159
139
  children: children
160
140
  })
161
141
  });
162
142
  });
163
- //# sourceMappingURL=createListItemRoot.js.map
143
+ ListItemRoot.displayName = 'ListItemRoot';
144
+ //# sourceMappingURL=ListItemRoot.js.map