@cdx-ui/primitives 0.0.1-beta.7 → 0.0.1-beta.70

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 (978) hide show
  1. package/README.md +52 -26
  2. package/lib/commonjs/CLAUDE.md +84 -0
  3. package/lib/commonjs/avatar/AvatarRoot.js +38 -0
  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/ButtonRoot.js +85 -0
  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/CheckboxGroup.js +52 -0
  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 +20 -0
  24. package/lib/commonjs/chip/index.js.map +1 -0
  25. package/lib/commonjs/chip/types.js.map +1 -0
  26. package/lib/commonjs/dialog/DialogClose.js +32 -0
  27. package/lib/commonjs/dialog/DialogClose.js.map +1 -0
  28. package/lib/commonjs/dialog/DialogPopup.js +161 -0
  29. package/lib/commonjs/dialog/DialogPopup.js.map +1 -0
  30. package/lib/commonjs/dialog/DialogRoot.js +57 -0
  31. package/lib/commonjs/dialog/DialogRoot.js.map +1 -0
  32. package/lib/commonjs/dialog/DialogTrigger.js +32 -0
  33. package/lib/commonjs/dialog/DialogTrigger.js.map +1 -0
  34. package/lib/commonjs/dialog/index.js +28 -41
  35. package/lib/commonjs/dialog/index.js.map +1 -1
  36. package/lib/commonjs/field/FieldLabel.js +48 -0
  37. package/lib/commonjs/field/FieldLabel.js.map +1 -0
  38. package/lib/commonjs/field/FieldLabel.web.js +60 -0
  39. package/lib/commonjs/field/FieldLabel.web.js.map +1 -0
  40. package/lib/commonjs/field/FieldRoot.js +38 -0
  41. package/lib/commonjs/field/FieldRoot.js.map +1 -0
  42. package/lib/commonjs/field/index.js +14 -40
  43. package/lib/commonjs/field/index.js.map +1 -1
  44. package/lib/commonjs/form/FormRoot.js +25 -0
  45. package/lib/commonjs/form/FormRoot.js.map +1 -0
  46. package/lib/commonjs/form/FormRoot.web.js +27 -0
  47. package/lib/commonjs/form/FormRoot.web.js.map +1 -0
  48. package/lib/commonjs/form/index.js +7 -9
  49. package/lib/commonjs/form/index.js.map +1 -1
  50. package/lib/commonjs/index.js +86 -5
  51. package/lib/commonjs/index.js.map +1 -1
  52. package/lib/commonjs/input/InputField.android.js +98 -0
  53. package/lib/commonjs/input/InputField.android.js.map +1 -0
  54. package/lib/commonjs/input/InputField.js +92 -0
  55. package/lib/commonjs/input/InputField.js.map +1 -0
  56. package/lib/commonjs/input/InputField.web.js +131 -0
  57. package/lib/commonjs/input/InputField.web.js.map +1 -0
  58. package/lib/commonjs/input/InputRoot.js +84 -0
  59. package/lib/commonjs/input/InputRoot.js.map +1 -0
  60. package/lib/commonjs/input/index.js +21 -16
  61. package/lib/commonjs/input/index.js.map +1 -1
  62. package/lib/commonjs/link/LinkRoot.js +88 -0
  63. package/lib/commonjs/link/LinkRoot.js.map +1 -0
  64. package/lib/commonjs/link/context.js +11 -0
  65. package/lib/commonjs/link/context.js.map +1 -0
  66. package/lib/commonjs/link/index.js +16 -3
  67. package/lib/commonjs/link/index.js.map +1 -1
  68. package/lib/commonjs/list-item/ListItemRoot.js +149 -0
  69. package/lib/commonjs/list-item/ListItemRoot.js.map +1 -0
  70. package/lib/commonjs/list-item/context.js.map +1 -1
  71. package/lib/commonjs/list-item/index.js +7 -36
  72. package/lib/commonjs/list-item/index.js.map +1 -1
  73. package/lib/commonjs/otp-input/OtpInputField.js +120 -0
  74. package/lib/commonjs/otp-input/OtpInputField.js.map +1 -0
  75. package/lib/commonjs/otp-input/index.js +39 -16
  76. package/lib/commonjs/otp-input/index.js.map +1 -1
  77. package/lib/commonjs/otp-input/useOtpInput.js +120 -0
  78. package/lib/commonjs/otp-input/useOtpInput.js.map +1 -0
  79. package/lib/commonjs/overlay/useDismissOverlay.js +0 -2
  80. package/lib/commonjs/overlay/useDismissOverlay.js.map +1 -1
  81. package/lib/commonjs/overlay/useEscapeKey.js +0 -2
  82. package/lib/commonjs/overlay/useEscapeKey.js.map +1 -1
  83. package/lib/commonjs/progress-bar/ProgressBarIndicator.js +45 -0
  84. package/lib/commonjs/progress-bar/ProgressBarIndicator.js.map +1 -0
  85. package/lib/commonjs/progress-bar/ProgressBarRoot.js +100 -0
  86. package/lib/commonjs/progress-bar/ProgressBarRoot.js.map +1 -0
  87. package/lib/commonjs/progress-bar/context.js.map +1 -0
  88. package/lib/commonjs/progress-bar/index.js +27 -0
  89. package/lib/commonjs/progress-bar/index.js.map +1 -0
  90. package/lib/commonjs/progress-bar/types.js +6 -0
  91. package/lib/commonjs/progress-bar/types.js.map +1 -0
  92. package/lib/commonjs/radio/RadioGroup.js +74 -0
  93. package/lib/commonjs/radio/RadioGroup.js.map +1 -0
  94. package/lib/commonjs/radio/RadioRoot.js +99 -0
  95. package/lib/commonjs/radio/RadioRoot.js.map +1 -0
  96. package/lib/commonjs/radio/RadioRoot.web.js +91 -0
  97. package/lib/commonjs/radio/RadioRoot.web.js.map +1 -0
  98. package/lib/commonjs/radio/context.js +14 -0
  99. package/lib/commonjs/radio/context.js.map +1 -0
  100. package/lib/commonjs/radio/index.js +27 -0
  101. package/lib/commonjs/radio/index.js.map +1 -0
  102. package/lib/commonjs/radio/types.js +6 -0
  103. package/lib/commonjs/radio/types.js.map +1 -0
  104. package/lib/commonjs/radio/useRadioRoot.js +64 -0
  105. package/lib/commonjs/radio/useRadioRoot.js.map +1 -0
  106. package/lib/commonjs/select/SelectContent.js +105 -0
  107. package/lib/commonjs/select/SelectContent.js.map +1 -0
  108. package/lib/commonjs/select/SelectItem.js +104 -0
  109. package/lib/commonjs/select/SelectItem.js.map +1 -0
  110. package/lib/commonjs/select/SelectRoot.js +105 -0
  111. package/lib/commonjs/select/SelectRoot.js.map +1 -0
  112. package/lib/commonjs/select/SelectTrigger.js +72 -0
  113. package/lib/commonjs/select/SelectTrigger.js.map +1 -0
  114. package/lib/commonjs/select/SelectTrigger.web.js +175 -0
  115. package/lib/commonjs/select/SelectTrigger.web.js.map +1 -0
  116. package/lib/commonjs/select/context.js +3 -12
  117. package/lib/commonjs/select/context.js.map +1 -1
  118. package/lib/commonjs/select/index.js +41 -32
  119. package/lib/commonjs/select/index.js.map +1 -1
  120. package/lib/commonjs/select/useContentFocus.js +1 -1
  121. package/lib/commonjs/select/useSelectTrigger.js +206 -0
  122. package/lib/commonjs/select/useSelectTrigger.js.map +1 -0
  123. package/lib/commonjs/select/useSelectTrigger.web.js +192 -0
  124. package/lib/commonjs/select/useSelectTrigger.web.js.map +1 -0
  125. package/lib/commonjs/slot/index.js +19 -0
  126. package/lib/commonjs/slot/index.js.map +1 -0
  127. package/lib/commonjs/switch/index.js +7 -9
  128. package/lib/commonjs/switch/index.js.map +1 -1
  129. package/lib/commonjs/switch/useSwitch.js +81 -0
  130. package/lib/commonjs/switch/useSwitch.js.map +1 -0
  131. package/lib/commonjs/tile/TileGroup.js +111 -0
  132. package/lib/commonjs/tile/TileGroup.js.map +1 -0
  133. package/lib/commonjs/tile/TileRoot.js +129 -0
  134. package/lib/commonjs/tile/TileRoot.js.map +1 -0
  135. package/lib/commonjs/tile/context.js +30 -0
  136. package/lib/commonjs/tile/context.js.map +1 -0
  137. package/lib/commonjs/tile/index.js +33 -0
  138. package/lib/commonjs/tile/index.js.map +1 -0
  139. package/lib/commonjs/tile/types.js +6 -0
  140. package/lib/commonjs/tile/types.js.map +1 -0
  141. package/lib/commonjs/utils/dataAttributes.js +12 -25
  142. package/lib/commonjs/utils/dataAttributes.js.map +1 -1
  143. package/lib/commonjs/utils/dataAttributes.web.js +25 -0
  144. package/lib/commonjs/utils/dataAttributes.web.js.map +1 -1
  145. package/lib/commonjs/utils/domDataAttributes.js +64 -0
  146. package/lib/commonjs/utils/domDataAttributes.js.map +1 -0
  147. package/lib/module/CLAUDE.md +84 -0
  148. package/lib/module/avatar/AvatarRoot.js +34 -0
  149. package/lib/module/avatar/AvatarRoot.js.map +1 -0
  150. package/lib/module/avatar/index.js +2 -23
  151. package/lib/module/avatar/index.js.map +1 -1
  152. package/lib/module/button/ButtonRoot.js +81 -0
  153. package/lib/module/button/ButtonRoot.js.map +1 -0
  154. package/lib/module/button/index.js +1 -23
  155. package/lib/module/button/index.js.map +1 -1
  156. package/lib/module/checkbox/CheckboxGroup.js +48 -0
  157. package/lib/module/checkbox/CheckboxGroup.js.map +1 -0
  158. package/lib/module/checkbox/CheckboxRoot.js +99 -0
  159. package/lib/module/checkbox/CheckboxRoot.js.map +1 -0
  160. package/lib/module/checkbox/CheckboxRoot.web.js +90 -0
  161. package/lib/module/checkbox/CheckboxRoot.web.js.map +1 -0
  162. package/lib/module/checkbox/index.js +3 -23
  163. package/lib/module/checkbox/index.js.map +1 -1
  164. package/lib/module/chip/ChipRoot.js +142 -0
  165. package/lib/module/chip/ChipRoot.js.map +1 -0
  166. package/lib/module/chip/context.js +5 -0
  167. package/lib/module/chip/context.js.map +1 -0
  168. package/lib/module/chip/index.js +5 -0
  169. package/lib/module/chip/index.js.map +1 -0
  170. package/lib/module/chip/types.js.map +1 -0
  171. package/lib/module/dialog/DialogClose.js +28 -0
  172. package/lib/module/dialog/DialogClose.js.map +1 -0
  173. package/lib/module/dialog/DialogPopup.js +157 -0
  174. package/lib/module/dialog/DialogPopup.js.map +1 -0
  175. package/lib/module/dialog/DialogRoot.js +53 -0
  176. package/lib/module/dialog/DialogRoot.js.map +1 -0
  177. package/lib/module/dialog/DialogTrigger.js +28 -0
  178. package/lib/module/dialog/DialogTrigger.js.map +1 -0
  179. package/lib/module/dialog/index.js +5 -42
  180. package/lib/module/dialog/index.js.map +1 -1
  181. package/lib/module/field/FieldLabel.js +44 -0
  182. package/lib/module/field/FieldLabel.js.map +1 -0
  183. package/lib/module/field/FieldLabel.web.js +55 -0
  184. package/lib/module/field/FieldLabel.web.js.map +1 -0
  185. package/lib/module/field/FieldRoot.js +34 -0
  186. package/lib/module/field/FieldRoot.js.map +1 -0
  187. package/lib/module/field/index.js +2 -39
  188. package/lib/module/field/index.js.map +1 -1
  189. package/lib/module/form/FormRoot.js +21 -0
  190. package/lib/module/form/FormRoot.js.map +1 -0
  191. package/lib/module/form/FormRoot.web.js +22 -0
  192. package/lib/module/form/FormRoot.web.js.map +1 -0
  193. package/lib/module/form/index.js +1 -8
  194. package/lib/module/form/index.js.map +1 -1
  195. package/lib/module/index.js +8 -2
  196. package/lib/module/index.js.map +1 -1
  197. package/lib/module/input/InputField.android.js +94 -0
  198. package/lib/module/input/InputField.android.js.map +1 -0
  199. package/lib/module/input/InputField.js +88 -0
  200. package/lib/module/input/InputField.js.map +1 -0
  201. package/lib/module/input/InputField.web.js +126 -0
  202. package/lib/module/input/InputField.web.js.map +1 -0
  203. package/lib/module/input/InputRoot.js +80 -0
  204. package/lib/module/input/InputRoot.js.map +1 -0
  205. package/lib/module/input/index.js +3 -15
  206. package/lib/module/input/index.js.map +1 -1
  207. package/lib/module/link/LinkRoot.js +84 -0
  208. package/lib/module/link/LinkRoot.js.map +1 -0
  209. package/lib/module/link/context.js +5 -0
  210. package/lib/module/link/context.js.map +1 -0
  211. package/lib/module/link/index.js +2 -1
  212. package/lib/module/link/index.js.map +1 -1
  213. package/lib/module/list-item/ListItemRoot.js +144 -0
  214. package/lib/module/list-item/ListItemRoot.js.map +1 -0
  215. package/lib/module/list-item/context.js.map +1 -1
  216. package/lib/module/list-item/index.js +1 -35
  217. package/lib/module/list-item/index.js.map +1 -1
  218. package/lib/module/otp-input/OtpInputField.js +116 -0
  219. package/lib/module/otp-input/OtpInputField.js.map +1 -0
  220. package/lib/module/otp-input/index.js +3 -15
  221. package/lib/module/otp-input/index.js.map +1 -1
  222. package/lib/module/otp-input/useOtpInput.js +116 -0
  223. package/lib/module/otp-input/useOtpInput.js.map +1 -0
  224. package/lib/module/overlay/useDismissOverlay.js +0 -2
  225. package/lib/module/overlay/useDismissOverlay.js.map +1 -1
  226. package/lib/module/overlay/useEscapeKey.js +0 -2
  227. package/lib/module/overlay/useEscapeKey.js.map +1 -1
  228. package/lib/module/progress-bar/ProgressBarIndicator.js +41 -0
  229. package/lib/module/progress-bar/ProgressBarIndicator.js.map +1 -0
  230. package/lib/module/progress-bar/ProgressBarRoot.js +96 -0
  231. package/lib/module/progress-bar/ProgressBarRoot.js.map +1 -0
  232. package/lib/module/progress-bar/context.js.map +1 -0
  233. package/lib/module/progress-bar/index.js +6 -0
  234. package/lib/module/progress-bar/index.js.map +1 -0
  235. package/lib/module/progress-bar/types.js +4 -0
  236. package/lib/module/progress-bar/types.js.map +1 -0
  237. package/lib/module/radio/RadioGroup.js +70 -0
  238. package/lib/module/radio/RadioGroup.js.map +1 -0
  239. package/lib/module/radio/RadioRoot.js +95 -0
  240. package/lib/module/radio/RadioRoot.js.map +1 -0
  241. package/lib/module/radio/RadioRoot.web.js +87 -0
  242. package/lib/module/radio/RadioRoot.web.js.map +1 -0
  243. package/lib/module/radio/context.js +7 -0
  244. package/lib/module/radio/context.js.map +1 -0
  245. package/lib/module/radio/index.js +6 -0
  246. package/lib/module/radio/index.js.map +1 -0
  247. package/lib/module/radio/types.js +4 -0
  248. package/lib/module/radio/types.js.map +1 -0
  249. package/lib/module/radio/useRadioRoot.js +60 -0
  250. package/lib/module/radio/useRadioRoot.js.map +1 -0
  251. package/lib/module/select/SelectContent.js +100 -0
  252. package/lib/module/select/SelectContent.js.map +1 -0
  253. package/lib/module/select/SelectItem.js +100 -0
  254. package/lib/module/select/SelectItem.js.map +1 -0
  255. package/lib/module/select/SelectRoot.js +101 -0
  256. package/lib/module/select/SelectRoot.js.map +1 -0
  257. package/lib/module/select/SelectTrigger.js +67 -0
  258. package/lib/module/select/SelectTrigger.js.map +1 -0
  259. package/lib/module/select/SelectTrigger.web.js +170 -0
  260. package/lib/module/select/SelectTrigger.web.js.map +1 -0
  261. package/lib/module/select/context.js +1 -8
  262. package/lib/module/select/context.js.map +1 -1
  263. package/lib/module/select/index.js +5 -31
  264. package/lib/module/select/index.js.map +1 -1
  265. package/lib/module/select/useContentFocus.js +1 -1
  266. package/lib/module/select/useSelectTrigger.js +202 -0
  267. package/lib/module/select/useSelectTrigger.js.map +1 -0
  268. package/lib/module/select/useSelectTrigger.web.js +188 -0
  269. package/lib/module/select/useSelectTrigger.web.js.map +1 -0
  270. package/lib/module/slot/index.js +4 -0
  271. package/lib/module/slot/index.js.map +1 -0
  272. package/lib/module/switch/index.js +1 -8
  273. package/lib/module/switch/index.js.map +1 -1
  274. package/lib/module/switch/useSwitch.js +77 -0
  275. package/lib/module/switch/useSwitch.js.map +1 -0
  276. package/lib/module/tile/TileGroup.js +107 -0
  277. package/lib/module/tile/TileGroup.js.map +1 -0
  278. package/lib/module/tile/TileRoot.js +125 -0
  279. package/lib/module/tile/TileRoot.js.map +1 -0
  280. package/lib/module/tile/context.js +21 -0
  281. package/lib/module/tile/context.js.map +1 -0
  282. package/lib/module/tile/index.js +6 -0
  283. package/lib/module/tile/index.js.map +1 -0
  284. package/lib/module/tile/types.js +4 -0
  285. package/lib/module/tile/types.js.map +1 -0
  286. package/lib/module/utils/dataAttributes.js +4 -22
  287. package/lib/module/utils/dataAttributes.js.map +1 -1
  288. package/lib/module/utils/dataAttributes.web.js +24 -0
  289. package/lib/module/utils/dataAttributes.web.js.map +1 -1
  290. package/lib/module/utils/domDataAttributes.js +59 -0
  291. package/lib/module/utils/domDataAttributes.js.map +1 -0
  292. package/lib/typescript/avatar/AvatarRoot.d.ts +8 -0
  293. package/lib/typescript/avatar/AvatarRoot.d.ts.map +1 -0
  294. package/lib/typescript/avatar/index.d.ts +3 -10
  295. package/lib/typescript/avatar/index.d.ts.map +1 -1
  296. package/lib/typescript/avatar/types.d.ts +1 -17
  297. package/lib/typescript/avatar/types.d.ts.map +1 -1
  298. package/lib/typescript/button/ButtonRoot.d.ts +9 -0
  299. package/lib/typescript/button/ButtonRoot.d.ts.map +1 -0
  300. package/lib/typescript/button/index.d.ts +2 -10
  301. package/lib/typescript/button/index.d.ts.map +1 -1
  302. package/lib/typescript/button/types.d.ts +1 -34
  303. package/lib/typescript/button/types.d.ts.map +1 -1
  304. package/lib/typescript/checkbox/CheckboxGroup.d.ts +9 -0
  305. package/lib/typescript/checkbox/CheckboxGroup.d.ts.map +1 -0
  306. package/lib/typescript/checkbox/CheckboxRoot.d.ts +6 -0
  307. package/lib/typescript/checkbox/CheckboxRoot.d.ts.map +1 -0
  308. package/lib/typescript/checkbox/CheckboxRoot.web.d.ts +6 -0
  309. package/lib/typescript/checkbox/CheckboxRoot.web.d.ts.map +1 -0
  310. package/lib/typescript/checkbox/index.d.ts +4 -10
  311. package/lib/typescript/checkbox/index.d.ts.map +1 -1
  312. package/lib/typescript/checkbox/types.d.ts +0 -17
  313. package/lib/typescript/checkbox/types.d.ts.map +1 -1
  314. package/lib/typescript/checkbox/useCheckboxRoot.d.ts +3 -1
  315. package/lib/typescript/checkbox/useCheckboxRoot.d.ts.map +1 -1
  316. package/lib/typescript/chip/ChipRoot.d.ts +7 -0
  317. package/lib/typescript/chip/ChipRoot.d.ts.map +1 -0
  318. package/lib/typescript/chip/context.d.ts +6 -0
  319. package/lib/typescript/chip/context.d.ts.map +1 -0
  320. package/lib/typescript/chip/index.d.ts +4 -0
  321. package/lib/typescript/chip/index.d.ts.map +1 -0
  322. package/lib/typescript/chip/types.d.ts +16 -0
  323. package/lib/typescript/chip/types.d.ts.map +1 -0
  324. package/lib/typescript/dialog/DialogClose.d.ts +5 -0
  325. package/lib/typescript/dialog/DialogClose.d.ts.map +1 -0
  326. package/lib/typescript/dialog/DialogPopup.d.ts +14 -0
  327. package/lib/typescript/dialog/DialogPopup.d.ts.map +1 -0
  328. package/lib/typescript/dialog/DialogRoot.d.ts +7 -0
  329. package/lib/typescript/dialog/DialogRoot.d.ts.map +1 -0
  330. package/lib/typescript/dialog/DialogTrigger.d.ts +5 -0
  331. package/lib/typescript/dialog/DialogTrigger.d.ts.map +1 -0
  332. package/lib/typescript/dialog/index.d.ts +6 -17
  333. package/lib/typescript/dialog/index.d.ts.map +1 -1
  334. package/lib/typescript/dialog/types.d.ts +14 -25
  335. package/lib/typescript/dialog/types.d.ts.map +1 -1
  336. package/lib/typescript/field/FieldLabel.d.ts +12 -0
  337. package/lib/typescript/field/FieldLabel.d.ts.map +1 -0
  338. package/lib/typescript/field/FieldLabel.web.d.ts +24 -0
  339. package/lib/typescript/field/FieldLabel.web.d.ts.map +1 -0
  340. package/lib/typescript/field/FieldRoot.d.ts +8 -0
  341. package/lib/typescript/field/FieldRoot.d.ts.map +1 -0
  342. package/lib/typescript/field/index.d.ts +3 -12
  343. package/lib/typescript/field/index.d.ts.map +1 -1
  344. package/lib/typescript/field/types.d.ts +0 -20
  345. package/lib/typescript/field/types.d.ts.map +1 -1
  346. package/lib/typescript/form/FormRoot.d.ts +8 -0
  347. package/lib/typescript/form/FormRoot.d.ts.map +1 -0
  348. package/lib/typescript/form/FormRoot.web.d.ts +8 -0
  349. package/lib/typescript/form/FormRoot.web.d.ts.map +1 -0
  350. package/lib/typescript/form/index.d.ts +2 -5
  351. package/lib/typescript/form/index.d.ts.map +1 -1
  352. package/lib/typescript/form/types.d.ts +8 -9
  353. package/lib/typescript/form/types.d.ts.map +1 -1
  354. package/lib/typescript/index.d.ts +8 -2
  355. package/lib/typescript/index.d.ts.map +1 -1
  356. package/lib/typescript/input/InputField.android.d.ts +5 -0
  357. package/lib/typescript/input/InputField.android.d.ts.map +1 -0
  358. package/lib/typescript/input/InputField.d.ts +5 -0
  359. package/lib/typescript/input/InputField.d.ts.map +1 -0
  360. package/lib/typescript/input/InputField.web.d.ts +6 -0
  361. package/lib/typescript/input/InputField.web.d.ts.map +1 -0
  362. package/lib/typescript/input/InputRoot.d.ts +5 -0
  363. package/lib/typescript/input/InputRoot.d.ts.map +1 -0
  364. package/lib/typescript/input/index.d.ts +4 -8
  365. package/lib/typescript/input/index.d.ts.map +1 -1
  366. package/lib/typescript/input/types.d.ts +20 -39
  367. package/lib/typescript/input/types.d.ts.map +1 -1
  368. package/lib/typescript/link/LinkRoot.d.ts +9 -0
  369. package/lib/typescript/link/LinkRoot.d.ts.map +1 -0
  370. package/lib/typescript/link/context.d.ts +10 -0
  371. package/lib/typescript/link/context.d.ts.map +1 -0
  372. package/lib/typescript/link/index.d.ts +3 -1
  373. package/lib/typescript/link/index.d.ts.map +1 -1
  374. package/lib/typescript/link/types.d.ts +1 -0
  375. package/lib/typescript/link/types.d.ts.map +1 -1
  376. package/lib/typescript/list-item/ListItemRoot.d.ts +7 -0
  377. package/lib/typescript/list-item/ListItemRoot.d.ts.map +1 -0
  378. package/lib/typescript/list-item/context.d.ts +3 -3
  379. package/lib/typescript/list-item/context.d.ts.map +1 -1
  380. package/lib/typescript/list-item/index.d.ts +2 -14
  381. package/lib/typescript/list-item/index.d.ts.map +1 -1
  382. package/lib/typescript/list-item/types.d.ts +5 -59
  383. package/lib/typescript/list-item/types.d.ts.map +1 -1
  384. package/lib/typescript/otp-input/OtpInputField.d.ts +19 -0
  385. package/lib/typescript/otp-input/OtpInputField.d.ts.map +1 -0
  386. package/lib/typescript/otp-input/index.d.ts +4 -8
  387. package/lib/typescript/otp-input/index.d.ts.map +1 -1
  388. package/lib/typescript/otp-input/types.d.ts +0 -9
  389. package/lib/typescript/otp-input/types.d.ts.map +1 -1
  390. package/lib/typescript/otp-input/useOtpInput.d.ts +19 -0
  391. package/lib/typescript/otp-input/useOtpInput.d.ts.map +1 -0
  392. package/lib/typescript/overlay/useDismissOverlay.d.ts.map +1 -1
  393. package/lib/typescript/overlay/useEscapeKey.d.ts.map +1 -1
  394. package/lib/typescript/progress-bar/ProgressBarIndicator.d.ts +6 -0
  395. package/lib/typescript/progress-bar/ProgressBarIndicator.d.ts.map +1 -0
  396. package/lib/typescript/progress-bar/ProgressBarRoot.d.ts +6 -0
  397. package/lib/typescript/progress-bar/ProgressBarRoot.d.ts.map +1 -0
  398. package/lib/typescript/progress-bar/context.d.ts.map +1 -0
  399. package/lib/typescript/progress-bar/index.d.ts +6 -0
  400. package/lib/typescript/progress-bar/index.d.ts.map +1 -0
  401. package/lib/typescript/progress-bar/types.d.ts +22 -0
  402. package/lib/typescript/progress-bar/types.d.ts.map +1 -0
  403. package/lib/typescript/radio/RadioGroup.d.ts +9 -0
  404. package/lib/typescript/radio/RadioGroup.d.ts.map +1 -0
  405. package/lib/typescript/radio/RadioRoot.d.ts +6 -0
  406. package/lib/typescript/radio/RadioRoot.d.ts.map +1 -0
  407. package/lib/typescript/radio/RadioRoot.web.d.ts +6 -0
  408. package/lib/typescript/radio/RadioRoot.web.d.ts.map +1 -0
  409. package/lib/typescript/radio/context.d.ts +21 -0
  410. package/lib/typescript/radio/context.d.ts.map +1 -0
  411. package/lib/typescript/radio/index.d.ts +5 -0
  412. package/lib/typescript/radio/index.d.ts.map +1 -0
  413. package/lib/typescript/radio/types.d.ts +43 -0
  414. package/lib/typescript/radio/types.d.ts.map +1 -0
  415. package/lib/typescript/radio/useRadioRoot.d.ts +151 -0
  416. package/lib/typescript/radio/useRadioRoot.d.ts.map +1 -0
  417. package/lib/typescript/select/SelectContent.d.ts +9 -0
  418. package/lib/typescript/select/SelectContent.d.ts.map +1 -0
  419. package/lib/typescript/select/SelectItem.d.ts +8 -0
  420. package/lib/typescript/select/SelectItem.d.ts.map +1 -0
  421. package/lib/typescript/select/SelectRoot.d.ts +8 -0
  422. package/lib/typescript/select/SelectRoot.d.ts.map +1 -0
  423. package/lib/typescript/select/SelectTrigger.d.ts +9 -0
  424. package/lib/typescript/select/SelectTrigger.d.ts.map +1 -0
  425. package/lib/typescript/select/SelectTrigger.web.d.ts +13 -0
  426. package/lib/typescript/select/SelectTrigger.web.d.ts.map +1 -0
  427. package/lib/typescript/select/context.d.ts +1 -11
  428. package/lib/typescript/select/context.d.ts.map +1 -1
  429. package/lib/typescript/select/index.d.ts +6 -12
  430. package/lib/typescript/select/index.d.ts.map +1 -1
  431. package/lib/typescript/select/types.d.ts +1 -9
  432. package/lib/typescript/select/types.d.ts.map +1 -1
  433. package/lib/typescript/select/useContentFocus.d.ts +1 -1
  434. package/lib/typescript/select/useSelectTrigger.d.ts +77 -0
  435. package/lib/typescript/select/useSelectTrigger.d.ts.map +1 -0
  436. package/lib/typescript/select/useSelectTrigger.web.d.ts +16 -0
  437. package/lib/typescript/select/useSelectTrigger.web.d.ts.map +1 -0
  438. package/lib/typescript/slot/index.d.ts +2 -0
  439. package/lib/typescript/slot/index.d.ts.map +1 -0
  440. package/lib/typescript/switch/index.d.ts +2 -6
  441. package/lib/typescript/switch/index.d.ts.map +1 -1
  442. package/lib/typescript/switch/types.d.ts +35 -6
  443. package/lib/typescript/switch/types.d.ts.map +1 -1
  444. package/lib/typescript/switch/useSwitch.d.ts +20 -0
  445. package/lib/typescript/switch/useSwitch.d.ts.map +1 -0
  446. package/lib/typescript/tile/TileGroup.d.ts +5 -0
  447. package/lib/typescript/tile/TileGroup.d.ts.map +1 -0
  448. package/lib/typescript/tile/TileRoot.d.ts +5 -0
  449. package/lib/typescript/tile/TileRoot.d.ts.map +1 -0
  450. package/lib/typescript/tile/context.d.ts +9 -0
  451. package/lib/typescript/tile/context.d.ts.map +1 -0
  452. package/lib/typescript/tile/index.d.ts +5 -0
  453. package/lib/typescript/tile/index.d.ts.map +1 -0
  454. package/lib/typescript/tile/types.d.ts +108 -0
  455. package/lib/typescript/tile/types.d.ts.map +1 -0
  456. package/lib/typescript/utils/dataAttributes.d.ts +4 -10
  457. package/lib/typescript/utils/dataAttributes.d.ts.map +1 -1
  458. package/lib/typescript/utils/dataAttributes.web.d.ts +16 -0
  459. package/lib/typescript/utils/dataAttributes.web.d.ts.map +1 -1
  460. package/lib/typescript/utils/domDataAttributes.d.ts +28 -0
  461. package/lib/typescript/utils/domDataAttributes.d.ts.map +1 -0
  462. package/package.json +6 -2
  463. package/src/CLAUDE.md +84 -0
  464. package/src/avatar/AvatarRoot.tsx +39 -0
  465. package/src/avatar/index.ts +3 -43
  466. package/src/avatar/types.ts +1 -47
  467. package/src/button/ButtonRoot.tsx +115 -0
  468. package/src/button/index.ts +3 -0
  469. package/src/button/types.ts +1 -52
  470. package/src/checkbox/CheckboxGroup.tsx +50 -0
  471. package/src/checkbox/CheckboxRoot.tsx +102 -0
  472. package/src/checkbox/CheckboxRoot.web.tsx +92 -0
  473. package/src/checkbox/index.ts +4 -42
  474. package/src/checkbox/types.ts +1 -32
  475. package/src/chip/ChipRoot.tsx +168 -0
  476. package/src/chip/context.tsx +4 -0
  477. package/src/chip/index.ts +3 -0
  478. package/src/chip/types.ts +20 -0
  479. package/src/dialog/DialogClose.tsx +26 -0
  480. package/src/dialog/DialogPopup.tsx +162 -0
  481. package/src/dialog/DialogRoot.tsx +72 -0
  482. package/src/dialog/DialogTrigger.tsx +26 -0
  483. package/src/dialog/index.tsx +6 -87
  484. package/src/dialog/types.ts +14 -57
  485. package/src/field/FieldLabel.tsx +43 -0
  486. package/src/field/FieldLabel.web.tsx +71 -0
  487. package/src/field/FieldRoot.tsx +39 -0
  488. package/src/field/index.tsx +3 -68
  489. package/src/field/types.tsx +0 -34
  490. package/src/form/FormRoot.tsx +18 -0
  491. package/src/form/FormRoot.web.tsx +17 -0
  492. package/src/form/index.tsx +2 -12
  493. package/src/form/types.tsx +9 -11
  494. package/src/index.ts +12 -2
  495. package/src/input/InputField.android.tsx +107 -0
  496. package/src/input/InputField.tsx +100 -0
  497. package/src/input/InputField.web.tsx +141 -0
  498. package/src/input/InputRoot.tsx +104 -0
  499. package/src/input/index.tsx +4 -38
  500. package/src/input/types.ts +21 -53
  501. package/src/link/LinkRoot.tsx +108 -0
  502. package/src/link/context.tsx +10 -0
  503. package/src/link/index.tsx +3 -1
  504. package/src/link/types.ts +1 -0
  505. package/src/list-item/ListItemRoot.tsx +183 -0
  506. package/src/list-item/context.tsx +2 -2
  507. package/src/list-item/index.ts +2 -80
  508. package/src/list-item/types.ts +5 -89
  509. package/src/otp-input/OtpInputField.tsx +122 -0
  510. package/src/otp-input/index.ts +16 -0
  511. package/src/otp-input/types.ts +0 -23
  512. package/src/otp-input/useOtpInput.ts +156 -0
  513. package/src/overlay/useDismissOverlay.ts +0 -2
  514. package/src/overlay/useEscapeKey.ts +0 -2
  515. package/src/progress-bar/ProgressBarIndicator.tsx +34 -0
  516. package/src/progress-bar/ProgressBarRoot.tsx +117 -0
  517. package/src/progress-bar/index.ts +5 -0
  518. package/src/progress-bar/types.ts +24 -0
  519. package/src/radio/RadioGroup.tsx +85 -0
  520. package/src/radio/RadioRoot.tsx +98 -0
  521. package/src/radio/RadioRoot.web.tsx +90 -0
  522. package/src/radio/context.tsx +21 -0
  523. package/src/radio/index.ts +5 -0
  524. package/src/radio/types.ts +45 -0
  525. package/src/radio/useRadioRoot.ts +69 -0
  526. package/src/select/SelectContent.tsx +120 -0
  527. package/src/select/SelectItem.tsx +139 -0
  528. package/src/select/SelectRoot.tsx +154 -0
  529. package/src/select/SelectTrigger.tsx +82 -0
  530. package/src/select/SelectTrigger.web.tsx +238 -0
  531. package/src/select/context.tsx +1 -10
  532. package/src/select/index.ts +17 -0
  533. package/src/select/types.ts +1 -32
  534. package/src/select/useContentFocus.ts +1 -1
  535. package/src/select/useSelectTrigger.ts +345 -0
  536. package/src/select/useSelectTrigger.web.ts +267 -0
  537. package/src/slot/index.ts +1 -0
  538. package/src/switch/index.ts +7 -16
  539. package/src/switch/types.ts +35 -10
  540. package/src/switch/useSwitch.ts +75 -0
  541. package/src/tile/TileGroup.tsx +137 -0
  542. package/src/tile/TileRoot.tsx +137 -0
  543. package/src/tile/context.tsx +23 -0
  544. package/src/tile/index.ts +18 -0
  545. package/src/tile/types.ts +121 -0
  546. package/src/utils/dataAttributes.ts +7 -25
  547. package/src/utils/dataAttributes.web.ts +24 -0
  548. package/src/utils/domDataAttributes.ts +63 -0
  549. package/lib/commonjs/avatar/createAvatarBadge.js +0 -20
  550. package/lib/commonjs/avatar/createAvatarBadge.js.map +0 -1
  551. package/lib/commonjs/avatar/createAvatarIcon.js +0 -30
  552. package/lib/commonjs/avatar/createAvatarIcon.js.map +0 -1
  553. package/lib/commonjs/avatar/createAvatarImage.js +0 -51
  554. package/lib/commonjs/avatar/createAvatarImage.js.map +0 -1
  555. package/lib/commonjs/avatar/createAvatarRoot.js +0 -34
  556. package/lib/commonjs/avatar/createAvatarRoot.js.map +0 -1
  557. package/lib/commonjs/avatar/createAvatarText.js +0 -42
  558. package/lib/commonjs/avatar/createAvatarText.js.map +0 -1
  559. package/lib/commonjs/button/createButtonGroup.js +0 -80
  560. package/lib/commonjs/button/createButtonGroup.js.map +0 -1
  561. package/lib/commonjs/button/createButtonIcon.js +0 -18
  562. package/lib/commonjs/button/createButtonIcon.js.map +0 -1
  563. package/lib/commonjs/button/createButtonRoot.js +0 -81
  564. package/lib/commonjs/button/createButtonRoot.js.map +0 -1
  565. package/lib/commonjs/button/createButtonSpinner.js +0 -34
  566. package/lib/commonjs/button/createButtonSpinner.js.map +0 -1
  567. package/lib/commonjs/button/createButtonText.js +0 -38
  568. package/lib/commonjs/button/createButtonText.js.map +0 -1
  569. package/lib/commonjs/checkbox/createCheckboxGroup.js +0 -44
  570. package/lib/commonjs/checkbox/createCheckboxGroup.js.map +0 -1
  571. package/lib/commonjs/checkbox/createCheckboxIcon.js +0 -29
  572. package/lib/commonjs/checkbox/createCheckboxIcon.js.map +0 -1
  573. package/lib/commonjs/checkbox/createCheckboxIndicator.js +0 -47
  574. package/lib/commonjs/checkbox/createCheckboxIndicator.js.map +0 -1
  575. package/lib/commonjs/checkbox/createCheckboxLabel.js +0 -46
  576. package/lib/commonjs/checkbox/createCheckboxLabel.js.map +0 -1
  577. package/lib/commonjs/checkbox/createCheckboxRoot.js +0 -99
  578. package/lib/commonjs/checkbox/createCheckboxRoot.js.map +0 -1
  579. package/lib/commonjs/checkbox/createCheckboxRoot.web.js +0 -90
  580. package/lib/commonjs/checkbox/createCheckboxRoot.web.js.map +0 -1
  581. package/lib/commonjs/dialog/createDialogBody.js +0 -21
  582. package/lib/commonjs/dialog/createDialogBody.js.map +0 -1
  583. package/lib/commonjs/dialog/createDialogClose.js +0 -37
  584. package/lib/commonjs/dialog/createDialogClose.js.map +0 -1
  585. package/lib/commonjs/dialog/createDialogContent.js +0 -141
  586. package/lib/commonjs/dialog/createDialogContent.js.map +0 -1
  587. package/lib/commonjs/dialog/createDialogDescription.js +0 -30
  588. package/lib/commonjs/dialog/createDialogDescription.js.map +0 -1
  589. package/lib/commonjs/dialog/createDialogFooter.js +0 -21
  590. package/lib/commonjs/dialog/createDialogFooter.js.map +0 -1
  591. package/lib/commonjs/dialog/createDialogHeader.js +0 -21
  592. package/lib/commonjs/dialog/createDialogHeader.js.map +0 -1
  593. package/lib/commonjs/dialog/createDialogRoot.js +0 -54
  594. package/lib/commonjs/dialog/createDialogRoot.js.map +0 -1
  595. package/lib/commonjs/dialog/createDialogTitle.js +0 -21
  596. package/lib/commonjs/dialog/createDialogTitle.js.map +0 -1
  597. package/lib/commonjs/dialog/createDialogTrigger.js +0 -37
  598. package/lib/commonjs/dialog/createDialogTrigger.js.map +0 -1
  599. package/lib/commonjs/field/createFieldError.js +0 -41
  600. package/lib/commonjs/field/createFieldError.js.map +0 -1
  601. package/lib/commonjs/field/createFieldErrorIcon.js +0 -18
  602. package/lib/commonjs/field/createFieldErrorIcon.js.map +0 -1
  603. package/lib/commonjs/field/createFieldErrorText.js +0 -18
  604. package/lib/commonjs/field/createFieldErrorText.js.map +0 -1
  605. package/lib/commonjs/field/createFieldHelper.js +0 -41
  606. package/lib/commonjs/field/createFieldHelper.js.map +0 -1
  607. package/lib/commonjs/field/createFieldHelperText.js +0 -18
  608. package/lib/commonjs/field/createFieldHelperText.js.map +0 -1
  609. package/lib/commonjs/field/createFieldLabel.js +0 -36
  610. package/lib/commonjs/field/createFieldLabel.js.map +0 -1
  611. package/lib/commonjs/field/createFieldRoot.js +0 -35
  612. package/lib/commonjs/field/createFieldRoot.js.map +0 -1
  613. package/lib/commonjs/form/createFormRoot.js +0 -21
  614. package/lib/commonjs/form/createFormRoot.js.map +0 -1
  615. package/lib/commonjs/input/createInputField.js +0 -95
  616. package/lib/commonjs/input/createInputField.js.map +0 -1
  617. package/lib/commonjs/input/createInputRoot.js +0 -82
  618. package/lib/commonjs/input/createInputRoot.js.map +0 -1
  619. package/lib/commonjs/input/createInputSlot.js +0 -44
  620. package/lib/commonjs/input/createInputSlot.js.map +0 -1
  621. package/lib/commonjs/link/createLink.js +0 -74
  622. package/lib/commonjs/link/createLink.js.map +0 -1
  623. package/lib/commonjs/list-item/createListItemContent.js +0 -30
  624. package/lib/commonjs/list-item/createListItemContent.js.map +0 -1
  625. package/lib/commonjs/list-item/createListItemDescription.js +0 -25
  626. package/lib/commonjs/list-item/createListItemDescription.js.map +0 -1
  627. package/lib/commonjs/list-item/createListItemLeadingSlot.js +0 -34
  628. package/lib/commonjs/list-item/createListItemLeadingSlot.js.map +0 -1
  629. package/lib/commonjs/list-item/createListItemMeta.js +0 -25
  630. package/lib/commonjs/list-item/createListItemMeta.js.map +0 -1
  631. package/lib/commonjs/list-item/createListItemRoot.js +0 -142
  632. package/lib/commonjs/list-item/createListItemRoot.js.map +0 -1
  633. package/lib/commonjs/list-item/createListItemSectionHeader.js +0 -54
  634. package/lib/commonjs/list-item/createListItemSectionHeader.js.map +0 -1
  635. package/lib/commonjs/list-item/createListItemTitle.js +0 -25
  636. package/lib/commonjs/list-item/createListItemTitle.js.map +0 -1
  637. package/lib/commonjs/list-item/createListItemTrailingSlot.js +0 -28
  638. package/lib/commonjs/list-item/createListItemTrailingSlot.js.map +0 -1
  639. package/lib/commonjs/otp-input/createOtpInputCell.js +0 -29
  640. package/lib/commonjs/otp-input/createOtpInputCell.js.map +0 -1
  641. package/lib/commonjs/otp-input/createOtpInputField.js +0 -104
  642. package/lib/commonjs/otp-input/createOtpInputField.js.map +0 -1
  643. package/lib/commonjs/otp-input/createOtpInputRoot.js +0 -136
  644. package/lib/commonjs/otp-input/createOtpInputRoot.js.map +0 -1
  645. package/lib/commonjs/progress/context.js.map +0 -1
  646. package/lib/commonjs/progress/createProgressIndicator.js +0 -42
  647. package/lib/commonjs/progress/createProgressIndicator.js.map +0 -1
  648. package/lib/commonjs/progress/createProgressRoot.js +0 -96
  649. package/lib/commonjs/progress/createProgressRoot.js.map +0 -1
  650. package/lib/commonjs/progress/index.js +0 -25
  651. package/lib/commonjs/progress/index.js.map +0 -1
  652. package/lib/commonjs/progress/types.js.map +0 -1
  653. package/lib/commonjs/select/createSelectContent.js +0 -102
  654. package/lib/commonjs/select/createSelectContent.js.map +0 -1
  655. package/lib/commonjs/select/createSelectIcon.js +0 -41
  656. package/lib/commonjs/select/createSelectIcon.js.map +0 -1
  657. package/lib/commonjs/select/createSelectItem.js +0 -101
  658. package/lib/commonjs/select/createSelectItem.js.map +0 -1
  659. package/lib/commonjs/select/createSelectItemLabel.js +0 -41
  660. package/lib/commonjs/select/createSelectItemLabel.js.map +0 -1
  661. package/lib/commonjs/select/createSelectRoot.js +0 -102
  662. package/lib/commonjs/select/createSelectRoot.js.map +0 -1
  663. package/lib/commonjs/select/createSelectTrigger.js +0 -179
  664. package/lib/commonjs/select/createSelectTrigger.js.map +0 -1
  665. package/lib/commonjs/select/createSelectValue.js +0 -53
  666. package/lib/commonjs/select/createSelectValue.js.map +0 -1
  667. package/lib/commonjs/switch/createSwitchRoot.js +0 -73
  668. package/lib/commonjs/switch/createSwitchRoot.js.map +0 -1
  669. package/lib/module/avatar/createAvatarBadge.js +0 -15
  670. package/lib/module/avatar/createAvatarBadge.js.map +0 -1
  671. package/lib/module/avatar/createAvatarIcon.js +0 -25
  672. package/lib/module/avatar/createAvatarIcon.js.map +0 -1
  673. package/lib/module/avatar/createAvatarImage.js +0 -46
  674. package/lib/module/avatar/createAvatarImage.js.map +0 -1
  675. package/lib/module/avatar/createAvatarRoot.js +0 -29
  676. package/lib/module/avatar/createAvatarRoot.js.map +0 -1
  677. package/lib/module/avatar/createAvatarText.js +0 -37
  678. package/lib/module/avatar/createAvatarText.js.map +0 -1
  679. package/lib/module/button/createButtonGroup.js +0 -74
  680. package/lib/module/button/createButtonGroup.js.map +0 -1
  681. package/lib/module/button/createButtonIcon.js +0 -13
  682. package/lib/module/button/createButtonIcon.js.map +0 -1
  683. package/lib/module/button/createButtonRoot.js +0 -76
  684. package/lib/module/button/createButtonRoot.js.map +0 -1
  685. package/lib/module/button/createButtonSpinner.js +0 -29
  686. package/lib/module/button/createButtonSpinner.js.map +0 -1
  687. package/lib/module/button/createButtonText.js +0 -33
  688. package/lib/module/button/createButtonText.js.map +0 -1
  689. package/lib/module/checkbox/createCheckboxGroup.js +0 -39
  690. package/lib/module/checkbox/createCheckboxGroup.js.map +0 -1
  691. package/lib/module/checkbox/createCheckboxIcon.js +0 -24
  692. package/lib/module/checkbox/createCheckboxIcon.js.map +0 -1
  693. package/lib/module/checkbox/createCheckboxIndicator.js +0 -42
  694. package/lib/module/checkbox/createCheckboxIndicator.js.map +0 -1
  695. package/lib/module/checkbox/createCheckboxLabel.js +0 -41
  696. package/lib/module/checkbox/createCheckboxLabel.js.map +0 -1
  697. package/lib/module/checkbox/createCheckboxRoot.js +0 -94
  698. package/lib/module/checkbox/createCheckboxRoot.js.map +0 -1
  699. package/lib/module/checkbox/createCheckboxRoot.web.js +0 -85
  700. package/lib/module/checkbox/createCheckboxRoot.web.js.map +0 -1
  701. package/lib/module/dialog/createDialogBody.js +0 -15
  702. package/lib/module/dialog/createDialogBody.js.map +0 -1
  703. package/lib/module/dialog/createDialogClose.js +0 -31
  704. package/lib/module/dialog/createDialogClose.js.map +0 -1
  705. package/lib/module/dialog/createDialogContent.js +0 -136
  706. package/lib/module/dialog/createDialogContent.js.map +0 -1
  707. package/lib/module/dialog/createDialogDescription.js +0 -24
  708. package/lib/module/dialog/createDialogDescription.js.map +0 -1
  709. package/lib/module/dialog/createDialogFooter.js +0 -15
  710. package/lib/module/dialog/createDialogFooter.js.map +0 -1
  711. package/lib/module/dialog/createDialogHeader.js +0 -15
  712. package/lib/module/dialog/createDialogHeader.js.map +0 -1
  713. package/lib/module/dialog/createDialogRoot.js +0 -49
  714. package/lib/module/dialog/createDialogRoot.js.map +0 -1
  715. package/lib/module/dialog/createDialogTitle.js +0 -15
  716. package/lib/module/dialog/createDialogTitle.js.map +0 -1
  717. package/lib/module/dialog/createDialogTrigger.js +0 -31
  718. package/lib/module/dialog/createDialogTrigger.js.map +0 -1
  719. package/lib/module/field/createFieldError.js +0 -35
  720. package/lib/module/field/createFieldError.js.map +0 -1
  721. package/lib/module/field/createFieldErrorIcon.js +0 -13
  722. package/lib/module/field/createFieldErrorIcon.js.map +0 -1
  723. package/lib/module/field/createFieldErrorText.js +0 -13
  724. package/lib/module/field/createFieldErrorText.js.map +0 -1
  725. package/lib/module/field/createFieldHelper.js +0 -35
  726. package/lib/module/field/createFieldHelper.js.map +0 -1
  727. package/lib/module/field/createFieldHelperText.js +0 -13
  728. package/lib/module/field/createFieldHelperText.js.map +0 -1
  729. package/lib/module/field/createFieldLabel.js +0 -31
  730. package/lib/module/field/createFieldLabel.js.map +0 -1
  731. package/lib/module/field/createFieldRoot.js +0 -29
  732. package/lib/module/field/createFieldRoot.js.map +0 -1
  733. package/lib/module/form/createFormRoot.js +0 -15
  734. package/lib/module/form/createFormRoot.js.map +0 -1
  735. package/lib/module/input/createInputField.js +0 -90
  736. package/lib/module/input/createInputField.js.map +0 -1
  737. package/lib/module/input/createInputRoot.js +0 -76
  738. package/lib/module/input/createInputRoot.js.map +0 -1
  739. package/lib/module/input/createInputSlot.js +0 -39
  740. package/lib/module/input/createInputSlot.js.map +0 -1
  741. package/lib/module/link/createLink.js +0 -68
  742. package/lib/module/link/createLink.js.map +0 -1
  743. package/lib/module/list-item/createListItemContent.js +0 -24
  744. package/lib/module/list-item/createListItemContent.js.map +0 -1
  745. package/lib/module/list-item/createListItemDescription.js +0 -19
  746. package/lib/module/list-item/createListItemDescription.js.map +0 -1
  747. package/lib/module/list-item/createListItemLeadingSlot.js +0 -28
  748. package/lib/module/list-item/createListItemLeadingSlot.js.map +0 -1
  749. package/lib/module/list-item/createListItemMeta.js +0 -19
  750. package/lib/module/list-item/createListItemMeta.js.map +0 -1
  751. package/lib/module/list-item/createListItemRoot.js +0 -136
  752. package/lib/module/list-item/createListItemRoot.js.map +0 -1
  753. package/lib/module/list-item/createListItemSectionHeader.js +0 -48
  754. package/lib/module/list-item/createListItemSectionHeader.js.map +0 -1
  755. package/lib/module/list-item/createListItemTitle.js +0 -19
  756. package/lib/module/list-item/createListItemTitle.js.map +0 -1
  757. package/lib/module/list-item/createListItemTrailingSlot.js +0 -22
  758. package/lib/module/list-item/createListItemTrailingSlot.js.map +0 -1
  759. package/lib/module/otp-input/createOtpInputCell.js +0 -24
  760. package/lib/module/otp-input/createOtpInputCell.js.map +0 -1
  761. package/lib/module/otp-input/createOtpInputField.js +0 -99
  762. package/lib/module/otp-input/createOtpInputField.js.map +0 -1
  763. package/lib/module/otp-input/createOtpInputRoot.js +0 -131
  764. package/lib/module/otp-input/createOtpInputRoot.js.map +0 -1
  765. package/lib/module/progress/context.js.map +0 -1
  766. package/lib/module/progress/createProgressIndicator.js +0 -37
  767. package/lib/module/progress/createProgressIndicator.js.map +0 -1
  768. package/lib/module/progress/createProgressRoot.js +0 -91
  769. package/lib/module/progress/createProgressRoot.js.map +0 -1
  770. package/lib/module/progress/index.js +0 -15
  771. package/lib/module/progress/index.js.map +0 -1
  772. package/lib/module/progress/types.js.map +0 -1
  773. package/lib/module/select/createSelectContent.js +0 -97
  774. package/lib/module/select/createSelectContent.js.map +0 -1
  775. package/lib/module/select/createSelectIcon.js +0 -36
  776. package/lib/module/select/createSelectIcon.js.map +0 -1
  777. package/lib/module/select/createSelectItem.js +0 -96
  778. package/lib/module/select/createSelectItem.js.map +0 -1
  779. package/lib/module/select/createSelectItemLabel.js +0 -36
  780. package/lib/module/select/createSelectItemLabel.js.map +0 -1
  781. package/lib/module/select/createSelectRoot.js +0 -97
  782. package/lib/module/select/createSelectRoot.js.map +0 -1
  783. package/lib/module/select/createSelectTrigger.js +0 -174
  784. package/lib/module/select/createSelectTrigger.js.map +0 -1
  785. package/lib/module/select/createSelectValue.js +0 -48
  786. package/lib/module/select/createSelectValue.js.map +0 -1
  787. package/lib/module/switch/createSwitchRoot.js +0 -67
  788. package/lib/module/switch/createSwitchRoot.js.map +0 -1
  789. package/lib/typescript/avatar/createAvatarBadge.d.ts +0 -4
  790. package/lib/typescript/avatar/createAvatarBadge.d.ts.map +0 -1
  791. package/lib/typescript/avatar/createAvatarIcon.d.ts +0 -4
  792. package/lib/typescript/avatar/createAvatarIcon.d.ts.map +0 -1
  793. package/lib/typescript/avatar/createAvatarImage.d.ts +0 -4
  794. package/lib/typescript/avatar/createAvatarImage.d.ts.map +0 -1
  795. package/lib/typescript/avatar/createAvatarRoot.d.ts +0 -4
  796. package/lib/typescript/avatar/createAvatarRoot.d.ts.map +0 -1
  797. package/lib/typescript/avatar/createAvatarText.d.ts +0 -4
  798. package/lib/typescript/avatar/createAvatarText.d.ts.map +0 -1
  799. package/lib/typescript/button/createButtonGroup.d.ts +0 -4
  800. package/lib/typescript/button/createButtonGroup.d.ts.map +0 -1
  801. package/lib/typescript/button/createButtonIcon.d.ts +0 -2
  802. package/lib/typescript/button/createButtonIcon.d.ts.map +0 -1
  803. package/lib/typescript/button/createButtonRoot.d.ts +0 -6
  804. package/lib/typescript/button/createButtonRoot.d.ts.map +0 -1
  805. package/lib/typescript/button/createButtonSpinner.d.ts +0 -4
  806. package/lib/typescript/button/createButtonSpinner.d.ts.map +0 -1
  807. package/lib/typescript/button/createButtonText.d.ts +0 -4
  808. package/lib/typescript/button/createButtonText.d.ts.map +0 -1
  809. package/lib/typescript/checkbox/createCheckboxGroup.d.ts +0 -3
  810. package/lib/typescript/checkbox/createCheckboxGroup.d.ts.map +0 -1
  811. package/lib/typescript/checkbox/createCheckboxIcon.d.ts +0 -3
  812. package/lib/typescript/checkbox/createCheckboxIcon.d.ts.map +0 -1
  813. package/lib/typescript/checkbox/createCheckboxIndicator.d.ts +0 -5
  814. package/lib/typescript/checkbox/createCheckboxIndicator.d.ts.map +0 -1
  815. package/lib/typescript/checkbox/createCheckboxLabel.d.ts +0 -5
  816. package/lib/typescript/checkbox/createCheckboxLabel.d.ts.map +0 -1
  817. package/lib/typescript/checkbox/createCheckboxRoot.d.ts +0 -2
  818. package/lib/typescript/checkbox/createCheckboxRoot.d.ts.map +0 -1
  819. package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts +0 -2
  820. package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts.map +0 -1
  821. package/lib/typescript/dialog/createDialogBody.d.ts +0 -4
  822. package/lib/typescript/dialog/createDialogBody.d.ts.map +0 -1
  823. package/lib/typescript/dialog/createDialogClose.d.ts +0 -4
  824. package/lib/typescript/dialog/createDialogClose.d.ts.map +0 -1
  825. package/lib/typescript/dialog/createDialogContent.d.ts +0 -4
  826. package/lib/typescript/dialog/createDialogContent.d.ts.map +0 -1
  827. package/lib/typescript/dialog/createDialogDescription.d.ts +0 -4
  828. package/lib/typescript/dialog/createDialogDescription.d.ts.map +0 -1
  829. package/lib/typescript/dialog/createDialogFooter.d.ts +0 -4
  830. package/lib/typescript/dialog/createDialogFooter.d.ts.map +0 -1
  831. package/lib/typescript/dialog/createDialogHeader.d.ts +0 -4
  832. package/lib/typescript/dialog/createDialogHeader.d.ts.map +0 -1
  833. package/lib/typescript/dialog/createDialogRoot.d.ts +0 -4
  834. package/lib/typescript/dialog/createDialogRoot.d.ts.map +0 -1
  835. package/lib/typescript/dialog/createDialogTitle.d.ts +0 -4
  836. package/lib/typescript/dialog/createDialogTitle.d.ts.map +0 -1
  837. package/lib/typescript/dialog/createDialogTrigger.d.ts +0 -4
  838. package/lib/typescript/dialog/createDialogTrigger.d.ts.map +0 -1
  839. package/lib/typescript/field/createFieldError.d.ts +0 -5
  840. package/lib/typescript/field/createFieldError.d.ts.map +0 -1
  841. package/lib/typescript/field/createFieldErrorIcon.d.ts +0 -5
  842. package/lib/typescript/field/createFieldErrorIcon.d.ts.map +0 -1
  843. package/lib/typescript/field/createFieldErrorText.d.ts +0 -5
  844. package/lib/typescript/field/createFieldErrorText.d.ts.map +0 -1
  845. package/lib/typescript/field/createFieldHelper.d.ts +0 -5
  846. package/lib/typescript/field/createFieldHelper.d.ts.map +0 -1
  847. package/lib/typescript/field/createFieldHelperText.d.ts +0 -5
  848. package/lib/typescript/field/createFieldHelperText.d.ts.map +0 -1
  849. package/lib/typescript/field/createFieldLabel.d.ts +0 -6
  850. package/lib/typescript/field/createFieldLabel.d.ts.map +0 -1
  851. package/lib/typescript/field/createFieldRoot.d.ts +0 -6
  852. package/lib/typescript/field/createFieldRoot.d.ts.map +0 -1
  853. package/lib/typescript/form/createFormRoot.d.ts +0 -4
  854. package/lib/typescript/form/createFormRoot.d.ts.map +0 -1
  855. package/lib/typescript/input/createInputField.d.ts +0 -4
  856. package/lib/typescript/input/createInputField.d.ts.map +0 -1
  857. package/lib/typescript/input/createInputRoot.d.ts +0 -4
  858. package/lib/typescript/input/createInputRoot.d.ts.map +0 -1
  859. package/lib/typescript/input/createInputSlot.d.ts +0 -4
  860. package/lib/typescript/input/createInputSlot.d.ts.map +0 -1
  861. package/lib/typescript/link/createLink.d.ts +0 -6
  862. package/lib/typescript/link/createLink.d.ts.map +0 -1
  863. package/lib/typescript/list-item/createListItemContent.d.ts +0 -3
  864. package/lib/typescript/list-item/createListItemContent.d.ts.map +0 -1
  865. package/lib/typescript/list-item/createListItemDescription.d.ts +0 -3
  866. package/lib/typescript/list-item/createListItemDescription.d.ts.map +0 -1
  867. package/lib/typescript/list-item/createListItemLeadingSlot.d.ts +0 -4
  868. package/lib/typescript/list-item/createListItemLeadingSlot.d.ts.map +0 -1
  869. package/lib/typescript/list-item/createListItemMeta.d.ts +0 -3
  870. package/lib/typescript/list-item/createListItemMeta.d.ts.map +0 -1
  871. package/lib/typescript/list-item/createListItemRoot.d.ts +0 -4
  872. package/lib/typescript/list-item/createListItemRoot.d.ts.map +0 -1
  873. package/lib/typescript/list-item/createListItemSectionHeader.d.ts +0 -4
  874. package/lib/typescript/list-item/createListItemSectionHeader.d.ts.map +0 -1
  875. package/lib/typescript/list-item/createListItemTitle.d.ts +0 -3
  876. package/lib/typescript/list-item/createListItemTitle.d.ts.map +0 -1
  877. package/lib/typescript/list-item/createListItemTrailingSlot.d.ts +0 -3
  878. package/lib/typescript/list-item/createListItemTrailingSlot.d.ts.map +0 -1
  879. package/lib/typescript/otp-input/createOtpInputCell.d.ts +0 -4
  880. package/lib/typescript/otp-input/createOtpInputCell.d.ts.map +0 -1
  881. package/lib/typescript/otp-input/createOtpInputField.d.ts +0 -4
  882. package/lib/typescript/otp-input/createOtpInputField.d.ts.map +0 -1
  883. package/lib/typescript/otp-input/createOtpInputRoot.d.ts +0 -4
  884. package/lib/typescript/otp-input/createOtpInputRoot.d.ts.map +0 -1
  885. package/lib/typescript/progress/context.d.ts.map +0 -1
  886. package/lib/typescript/progress/createProgressIndicator.d.ts +0 -3
  887. package/lib/typescript/progress/createProgressIndicator.d.ts.map +0 -1
  888. package/lib/typescript/progress/createProgressRoot.d.ts +0 -4
  889. package/lib/typescript/progress/createProgressRoot.d.ts.map +0 -1
  890. package/lib/typescript/progress/index.d.ts +0 -10
  891. package/lib/typescript/progress/index.d.ts.map +0 -1
  892. package/lib/typescript/progress/types.d.ts +0 -25
  893. package/lib/typescript/progress/types.d.ts.map +0 -1
  894. package/lib/typescript/select/createSelectContent.d.ts +0 -4
  895. package/lib/typescript/select/createSelectContent.d.ts.map +0 -1
  896. package/lib/typescript/select/createSelectIcon.d.ts +0 -2
  897. package/lib/typescript/select/createSelectIcon.d.ts.map +0 -1
  898. package/lib/typescript/select/createSelectItem.d.ts +0 -6
  899. package/lib/typescript/select/createSelectItem.d.ts.map +0 -1
  900. package/lib/typescript/select/createSelectItemLabel.d.ts +0 -4
  901. package/lib/typescript/select/createSelectItemLabel.d.ts.map +0 -1
  902. package/lib/typescript/select/createSelectRoot.d.ts +0 -4
  903. package/lib/typescript/select/createSelectRoot.d.ts.map +0 -1
  904. package/lib/typescript/select/createSelectTrigger.d.ts +0 -7
  905. package/lib/typescript/select/createSelectTrigger.d.ts.map +0 -1
  906. package/lib/typescript/select/createSelectValue.d.ts +0 -4
  907. package/lib/typescript/select/createSelectValue.d.ts.map +0 -1
  908. package/lib/typescript/switch/createSwitchRoot.d.ts +0 -3
  909. package/lib/typescript/switch/createSwitchRoot.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 -30
  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 -22
  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 -79
  927. package/src/dialog/createDialogBody.tsx +0 -11
  928. package/src/dialog/createDialogClose.tsx +0 -27
  929. package/src/dialog/createDialogContent.tsx +0 -122
  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/createDialogRoot.tsx +0 -66
  934. package/src/dialog/createDialogTitle.tsx +0 -11
  935. package/src/dialog/createDialogTrigger.tsx +0 -27
  936. package/src/field/createFieldError.tsx +0 -32
  937. package/src/field/createFieldErrorIcon.tsx +0 -9
  938. package/src/field/createFieldErrorText.tsx +0 -9
  939. package/src/field/createFieldHelper.tsx +0 -28
  940. package/src/field/createFieldHelperText.tsx +0 -9
  941. package/src/field/createFieldLabel.tsx +0 -30
  942. package/src/field/createFieldRoot.tsx +0 -27
  943. package/src/form/createFormRoot.tsx +0 -13
  944. package/src/input/createInputField.tsx +0 -114
  945. package/src/input/createInputRoot.tsx +0 -92
  946. package/src/input/createInputSlot.tsx +0 -39
  947. package/src/link/createLink.tsx +0 -71
  948. package/src/list-item/createListItemContent.tsx +0 -23
  949. package/src/list-item/createListItemDescription.tsx +0 -19
  950. package/src/list-item/createListItemLeadingSlot.tsx +0 -30
  951. package/src/list-item/createListItemMeta.tsx +0 -17
  952. package/src/list-item/createListItemRoot.tsx +0 -163
  953. package/src/list-item/createListItemSectionHeader.tsx +0 -53
  954. package/src/list-item/createListItemTitle.tsx +0 -17
  955. package/src/list-item/createListItemTrailingSlot.tsx +0 -21
  956. package/src/otp-input/createOtpInputCell.tsx +0 -22
  957. package/src/otp-input/createOtpInputField.tsx +0 -98
  958. package/src/otp-input/createOtpInputRoot.tsx +0 -179
  959. package/src/otp-input/index.tsx +0 -34
  960. package/src/progress/createProgressIndicator.tsx +0 -35
  961. package/src/progress/createProgressRoot.tsx +0 -109
  962. package/src/progress/index.ts +0 -28
  963. package/src/progress/types.ts +0 -37
  964. package/src/select/createSelectContent.tsx +0 -115
  965. package/src/select/createSelectIcon.tsx +0 -27
  966. package/src/select/createSelectItem.tsx +0 -121
  967. package/src/select/createSelectItemLabel.tsx +0 -30
  968. package/src/select/createSelectRoot.tsx +0 -134
  969. package/src/select/createSelectTrigger.tsx +0 -218
  970. package/src/select/createSelectValue.tsx +0 -38
  971. package/src/select/index.tsx +0 -73
  972. package/src/switch/createSwitchRoot.tsx +0 -72
  973. /package/lib/commonjs/{progress → chip}/types.js +0 -0
  974. /package/lib/commonjs/{progress → progress-bar}/context.js +0 -0
  975. /package/lib/module/{progress → chip}/types.js +0 -0
  976. /package/lib/module/{progress → progress-bar}/context.js +0 -0
  977. /package/lib/typescript/{progress → progress-bar}/context.d.ts +0 -0
  978. /package/src/{progress → progress-bar}/context.tsx +0 -0
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InputField = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _utils = require("@cdx-ui/utils");
10
+ var _slot = require("../slot");
11
+ var _context = require("./context");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ const androidDefaults = {
14
+ includeFontPadding: false,
15
+ textAlignVertical: 'center'
16
+ };
17
+ const InputField = exports.InputField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
18
+ const {
19
+ asChild,
20
+ children,
21
+ onKeyPress,
22
+ type = 'text',
23
+ accessibilityLabel,
24
+ 'aria-label': ariaLabelProp,
25
+ secureTextEntry,
26
+ editable,
27
+ disabled,
28
+ style,
29
+ ...rest
30
+ } = props;
31
+ const {
32
+ isDisabled,
33
+ isReadOnly,
34
+ isFocused,
35
+ isInvalid,
36
+ setIsFocused,
37
+ inputFieldRef,
38
+ isRequired
39
+ } = (0, _context.useInputContext)();
40
+ const inputProps = (0, _utils.useFormControl)({
41
+ isDisabled: rest.isDisabled || disabled,
42
+ isInvalid: rest.isInvalid,
43
+ isReadOnly: rest.isReadOnly,
44
+ isRequired: rest.isRequired,
45
+ id: rest.id
46
+ });
47
+ const field = (0, _utils.useFormControlContext)();
48
+ const reportLabelFocus = focused => {
49
+ const active = focused && !(isDisabled || inputProps.disabled);
50
+ field.setIsLabelFocused?.(active);
51
+ };
52
+ const handleFocus = (focusState, callback) => {
53
+ setIsFocused?.(focusState);
54
+ reportLabelFocus(focusState);
55
+ callback();
56
+ };
57
+ const mergedRef = (0, _utils.mergeRefs)(ref, inputFieldRef, field.inputRef);
58
+ const isEffectivelyDisabled = isDisabled || inputProps.disabled;
59
+ const ariaLabel = accessibilityLabel ?? ariaLabelProp;
60
+ const editableProp = (0, _react.useMemo)(() => {
61
+ if (editable !== undefined) {
62
+ return editable;
63
+ }
64
+ return !(isDisabled || inputProps.disabled || isReadOnly);
65
+ }, [isDisabled, inputProps.disabled, isReadOnly, editable]);
66
+ const Comp = asChild ? _slot.Slot : _reactNative.TextInput;
67
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
68
+ ...inputProps,
69
+ ...rest,
70
+ style: [androidDefaults, style],
71
+ type: type,
72
+ disabled: isEffectivelyDisabled,
73
+ secureTextEntry: secureTextEntry || type === 'password',
74
+ accessible: true,
75
+ accessibilityLabel: ariaLabel,
76
+ "aria-label": ariaLabel,
77
+ "aria-required": isRequired || inputProps.required,
78
+ "aria-invalid": isInvalid || inputProps['aria-invalid'],
79
+ "aria-disabled": isEffectivelyDisabled,
80
+ "aria-selected": isFocused,
81
+ accessibilityElementsHidden: isEffectivelyDisabled,
82
+ readOnly: !editableProp,
83
+ onKeyPress: e => {
84
+ e.persist();
85
+ onKeyPress?.(e);
86
+ },
87
+ onFocus: e => {
88
+ handleFocus(true, () => rest.onFocus?.(e));
89
+ },
90
+ onBlur: e => {
91
+ handleFocus(false, () => rest.onBlur?.(e));
92
+ },
93
+ ref: mergedRef,
94
+ children: children
95
+ });
96
+ });
97
+ InputField.displayName = 'InputField';
98
+ //# sourceMappingURL=InputField.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_utils","_slot","_context","_jsxRuntime","androidDefaults","includeFontPadding","textAlignVertical","InputField","exports","forwardRef","props","ref","asChild","children","onKeyPress","type","accessibilityLabel","ariaLabelProp","secureTextEntry","editable","disabled","style","rest","isDisabled","isReadOnly","isFocused","isInvalid","setIsFocused","inputFieldRef","isRequired","useInputContext","inputProps","useFormControl","id","field","useFormControlContext","reportLabelFocus","focused","active","setIsLabelFocused","handleFocus","focusState","callback","mergedRef","mergeRefs","inputRef","isEffectivelyDisabled","ariaLabel","editableProp","useMemo","undefined","Comp","Slot","TextInput","jsx","accessible","required","accessibilityElementsHidden","readOnly","e","persist","onFocus","onBlur","displayName"],"sourceRoot":"../../../src","sources":["input/InputField.android.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAA4C,IAAAK,WAAA,GAAAL,OAAA;AAK5C,MAAMM,eAAe,GAAG;EACtBC,kBAAkB,EAAE,KAAK;EACzBC,iBAAiB,EAAE;AACrB,CAAC;AAEM,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,gBAAG,IAAAE,iBAAU,EAA6B,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC/E,MAAM;IACJC,OAAO;IACPC,QAAQ;IACRC,UAAU;IACVC,IAAI,GAAG,MAAM;IACbC,kBAAkB;IAClB,YAAY,EAAEC,aAAa;IAC3BC,eAAe;IACfC,QAAQ;IACRC,QAAQ;IACRC,KAAK;IACL,GAAGC;EACL,CAAC,GAAGZ,KAAK;EAET,MAAM;IAAEa,UAAU;IAAEC,UAAU;IAAEC,SAAS;IAAEC,SAAS;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAW,CAAC,GAC7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GAAGvC,OAAO,GAAGwC,UAAI,GAAGC,sBAAS;EAEvC,oBACE,IAAAlD,WAAA,CAAAmD,GAAA,EAACH,IAAI;IAAA,GACCpB,UAAU;IAAA,GACVT,IAAI;IACRD,KAAK,EAAE,CAACjB,eAAe,EAAEiB,KAAK,CAAE;IAChCN,IAAI,EAAEA,IAAK;IACXK,QAAQ,EAAE0B,qBAAsB;IAChC5B,eAAe,EAAEA,eAAe,IAAIH,IAAI,KAAK,UAAW;IACxDwC,UAAU;IACVvC,kBAAkB,EAAE+B,SAAU;IAC9B,cAAYA,SAAU;IACtB,iBAAelB,UAAU,IAAIE,UAAU,CAACyB,QAAS;IACjD,gBAAc9B,SAAS,IAAIK,UAAU,CAAC,cAAc,CAAE;IACtD,iBAAee,qBAAsB;IACrC,iBAAerB,SAAU;IACzBgC,2BAA2B,EAAEX,qBAAsB;IACnDY,QAAQ,EAAE,CAACV,YAAa;IACxBlC,UAAU,EAAG6C,CAAyB,IAAK;MACzCA,CAAC,CAACC,OAAO,CAAC,CAAC;MACX9C,UAAU,GAAG6C,CAAC,CAAC;IACjB,CAAE;IACFE,OAAO,EAAGF,CAAa,IAAK;MAC1BnB,WAAW,CAAC,IAAI,EAAE,MAAMlB,IAAI,CAACuC,OAAO,GAAGF,CAAC,CAAC,CAAC;IAC5C,CAAE;IACFG,MAAM,EAAGH,CAAY,IAAK;MACxBnB,WAAW,CAAC,KAAK,EAAE,MAAMlB,IAAI,CAACwC,MAAM,GAAGH,CAAC,CAAC,CAAC;IAC5C,CAAE;IACFhD,GAAG,EAAEgC,SAAU;IAAA9B,QAAA,EAEdA;EAAQ,CACL,CAAC;AAEX,CAAC,CAAC;AAEFN,UAAU,CAACwD,WAAW,GAAG,YAAY","ignoreList":[]}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InputField = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _utils = require("@cdx-ui/utils");
10
+ var _slot = require("../slot");
11
+ var _context = require("./context");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ const InputField = exports.InputField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
14
+ const {
15
+ asChild,
16
+ children,
17
+ onKeyPress,
18
+ type = 'text',
19
+ accessibilityLabel,
20
+ 'aria-label': ariaLabelProp,
21
+ secureTextEntry,
22
+ editable,
23
+ disabled,
24
+ ...rest
25
+ } = props;
26
+ const {
27
+ isDisabled,
28
+ isReadOnly,
29
+ isFocused,
30
+ isInvalid,
31
+ setIsFocused,
32
+ inputFieldRef,
33
+ isRequired
34
+ } = (0, _context.useInputContext)();
35
+ const inputProps = (0, _utils.useFormControl)({
36
+ isDisabled: rest.isDisabled || disabled,
37
+ isInvalid: rest.isInvalid,
38
+ isReadOnly: rest.isReadOnly,
39
+ isRequired: rest.isRequired,
40
+ id: rest.id
41
+ });
42
+ const field = (0, _utils.useFormControlContext)();
43
+ const reportLabelFocus = focused => {
44
+ const active = focused && !(isDisabled || inputProps.disabled);
45
+ field.setIsLabelFocused?.(active);
46
+ };
47
+ const handleFocus = (focusState, callback) => {
48
+ setIsFocused?.(focusState);
49
+ reportLabelFocus(focusState);
50
+ callback();
51
+ };
52
+ const mergedRef = (0, _utils.mergeRefs)(ref, inputFieldRef, field.inputRef);
53
+ const isEffectivelyDisabled = isDisabled || inputProps.disabled;
54
+ const ariaLabel = accessibilityLabel ?? ariaLabelProp;
55
+ const editableProp = (0, _react.useMemo)(() => {
56
+ if (editable !== undefined) {
57
+ return editable;
58
+ }
59
+ return !(isDisabled || inputProps.disabled || isReadOnly);
60
+ }, [isDisabled, inputProps.disabled, isReadOnly, editable]);
61
+ const Comp = asChild ? _slot.Slot : _reactNative.TextInput;
62
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
63
+ ...inputProps,
64
+ ...rest,
65
+ type: type,
66
+ disabled: isEffectivelyDisabled,
67
+ secureTextEntry: secureTextEntry || type === 'password',
68
+ accessible: true,
69
+ accessibilityLabel: ariaLabel,
70
+ "aria-label": ariaLabel,
71
+ "aria-required": isRequired || inputProps.required,
72
+ "aria-invalid": isInvalid || inputProps['aria-invalid'],
73
+ "aria-disabled": isEffectivelyDisabled,
74
+ "aria-selected": isFocused,
75
+ accessibilityElementsHidden: isEffectivelyDisabled,
76
+ readOnly: !editableProp,
77
+ onKeyPress: e => {
78
+ e.persist();
79
+ onKeyPress?.(e);
80
+ },
81
+ onFocus: e => {
82
+ handleFocus(true, () => rest.onFocus?.(e));
83
+ },
84
+ onBlur: e => {
85
+ handleFocus(false, () => rest.onBlur?.(e));
86
+ },
87
+ ref: mergedRef,
88
+ children: children
89
+ });
90
+ });
91
+ InputField.displayName = 'InputField';
92
+ //# sourceMappingURL=InputField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_utils","_slot","_context","_jsxRuntime","InputField","exports","forwardRef","props","ref","asChild","children","onKeyPress","type","accessibilityLabel","ariaLabelProp","secureTextEntry","editable","disabled","rest","isDisabled","isReadOnly","isFocused","isInvalid","setIsFocused","inputFieldRef","isRequired","useInputContext","inputProps","useFormControl","id","field","useFormControlContext","reportLabelFocus","focused","active","setIsLabelFocused","handleFocus","focusState","callback","mergedRef","mergeRefs","inputRef","isEffectivelyDisabled","ariaLabel","editableProp","useMemo","undefined","Comp","Slot","TextInput","jsx","accessible","required","accessibilityElementsHidden","readOnly","e","persist","onFocus","onBlur","displayName"],"sourceRoot":"../../../src","sources":["input/InputField.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAA4C,IAAAK,WAAA,GAAAL,OAAA;AAKrC,MAAMM,UAAU,GAAAC,OAAA,CAAAD,UAAA,gBAAG,IAAAE,iBAAU,EA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CAAE;IACF/C,GAAG,EAAE+B,SAAU;IAAA7B,QAAA,EAEdA;EAAQ,CACL,CAAC;AAEX,CAAC,CAAC;AAEFN,UAAU,CAACuD,WAAW,GAAG,YAAY","ignoreList":[]}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InputField = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _utils = require("@cdx-ui/utils");
10
+ var _slot = require("../slot");
11
+ var _context = require("./context");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ const fileInputStyle = {
15
+ flex: 1,
16
+ minWidth: 0,
17
+ border: 'none',
18
+ outline: 'none',
19
+ background: 'transparent',
20
+ fontSize: 'inherit',
21
+ fontFamily: 'inherit'
22
+ };
23
+ const InputField = exports.InputField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
24
+ const {
25
+ asChild,
26
+ children,
27
+ onKeyPress,
28
+ type = 'text',
29
+ accessibilityLabel,
30
+ 'aria-label': ariaLabelProp,
31
+ secureTextEntry,
32
+ editable,
33
+ disabled,
34
+ ...rest
35
+ } = props;
36
+ const {
37
+ isDisabled,
38
+ isReadOnly,
39
+ isInvalid,
40
+ setIsFocused,
41
+ isRequired,
42
+ inputFieldRef
43
+ } = (0, _context.useInputContext)();
44
+ const inputProps = (0, _utils.useFormControl)({
45
+ isDisabled: rest.isDisabled || disabled,
46
+ isInvalid: rest.isInvalid,
47
+ isReadOnly: rest.isReadOnly,
48
+ isRequired: rest.isRequired,
49
+ id: rest.id
50
+ });
51
+ const field = (0, _utils.useFormControlContext)();
52
+ const reportLabelFocus = focused => {
53
+ const active = focused && !(isDisabled || inputProps.disabled);
54
+ field.setIsLabelFocused?.(active);
55
+ };
56
+ const handleFocus = (focusState, callback) => {
57
+ setIsFocused?.(focusState);
58
+ reportLabelFocus(focusState);
59
+ callback();
60
+ };
61
+ const mergedRef = (0, _utils.mergeRefs)(ref, inputFieldRef);
62
+ const isEffectivelyDisabled = isDisabled || inputProps.disabled;
63
+ const ariaLabel = accessibilityLabel ?? ariaLabelProp;
64
+ const editableProp = (0, _react.useMemo)(() => {
65
+ if (editable !== undefined) {
66
+ return editable;
67
+ }
68
+ return !(isDisabled || inputProps.disabled || isReadOnly);
69
+ }, [isDisabled, inputProps.disabled, isReadOnly, editable]);
70
+ if (!asChild && type === 'file') {
71
+ const fileProps = rest;
72
+ return /*#__PURE__*/_react.default.createElement('input', {
73
+ ref: mergedRef,
74
+ type: 'file',
75
+ accept: fileProps.accept || undefined,
76
+ multiple: fileProps.multiple || undefined,
77
+ capture: fileProps.capture || undefined,
78
+ disabled: isEffectivelyDisabled || undefined,
79
+ 'aria-label': ariaLabel,
80
+ 'aria-required': isRequired || inputProps.required || undefined,
81
+ 'aria-invalid': isInvalid || inputProps['aria-invalid'] || undefined,
82
+ 'aria-disabled': isEffectivelyDisabled || undefined,
83
+ onChange: e => {
84
+ const files = e.target.files;
85
+ if (files && fileProps.onFiles) {
86
+ fileProps.onFiles(Array.from(files));
87
+ }
88
+ },
89
+ onFocus: e => {
90
+ handleFocus(true, () => rest.onFocus?.(e));
91
+ },
92
+ onBlur: e => {
93
+ handleFocus(false, () => rest.onBlur?.(e));
94
+ },
95
+ style: {
96
+ ...fileInputStyle,
97
+ cursor: isEffectivelyDisabled ? 'not-allowed' : 'pointer'
98
+ }
99
+ });
100
+ }
101
+ const Comp = asChild ? _slot.Slot : _reactNative.TextInput;
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
103
+ ...inputProps,
104
+ ...rest,
105
+ type: type,
106
+ disabled: isEffectivelyDisabled,
107
+ secureTextEntry: secureTextEntry || type === 'password',
108
+ accessible: true,
109
+ accessibilityLabel: ariaLabel,
110
+ "aria-label": ariaLabel,
111
+ "aria-required": isRequired || inputProps.required,
112
+ "aria-invalid": isInvalid || inputProps['aria-invalid'],
113
+ "aria-disabled": isEffectivelyDisabled,
114
+ accessibilityElementsHidden: isEffectivelyDisabled,
115
+ readOnly: !editableProp,
116
+ onKeyPress: e => {
117
+ e.persist();
118
+ onKeyPress?.(e);
119
+ },
120
+ onFocus: e => {
121
+ handleFocus(true, () => rest.onFocus?.(e));
122
+ },
123
+ onBlur: e => {
124
+ handleFocus(false, () => rest.onBlur?.(e));
125
+ },
126
+ ref: mergedRef,
127
+ children: children
128
+ });
129
+ });
130
+ InputField.displayName = 'InputField';
131
+ //# sourceMappingURL=InputField.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_utils","_slot","_context","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","fileInputStyle","flex","minWidth","border","outline","background","fontSize","fontFamily","InputField","exports","forwardRef","props","ref","asChild","children","onKeyPress","type","accessibilityLabel","ariaLabelProp","secureTextEntry","editable","disabled","rest","isDisabled","isReadOnly","isInvalid","setIsFocused","isRequired","inputFieldRef","useInputContext","inputProps","useFormControl","id","field","useFormControlContext","reportLabelFocus","focused","active","setIsLabelFocused","handleFocus","focusState","callback","mergedRef","mergeRefs","isEffectivelyDisabled","ariaLabel","editableProp","useMemo","undefined","fileProps","React","createElement","accept","multiple","capture","required","onChange","files","target","onFiles","Array","from","onFocus","onBlur","style","cursor","Comp","Slot","TextInput","js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AGjF,CAAa,IAAK;MAC1B0D,WAAW,CAAC,IAAI,EAAE,MAAMjB,IAAI,CAACwC,OAAO,GAAGjF,CAAC,CAAC,CAAC;IAC5C,CAAE;IACFkF,MAAM,EAAGlF,CAAY,IAAK;MACxB0D,WAAW,CAAC,KAAK,EAAE,MAAMjB,IAAI,CAACyC,MAAM,GAAGlF,CAAC,CAAC,CAAC;IAC5C,CAAE;IACF+B,GAAG,EAAE8B,SAAU;IAAA5B,QAAA,EAEdA;EAAQ,CACL,CAAC;AAEX,CAAC,CAAC;AAEFN,UAAU,CAACkE,WAAW,GAAG,YAAY","ignoreList":[]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InputRoot = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _utils = require("@cdx-ui/utils");
10
+ var _focus = require("@react-native-aria/focus");
11
+ var _interactions = require("@react-native-aria/interactions");
12
+ var _slot = require("../slot");
13
+ var _dataAttributes = require("../utils/dataAttributes");
14
+ var _context = require("./context");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ const InputRoot = exports.InputRoot = /*#__PURE__*/(0, _react.forwardRef)(({
17
+ asChild,
18
+ children,
19
+ isReadOnly,
20
+ isDisabled,
21
+ isInvalid,
22
+ isRequired,
23
+ isHovered: isHoveredProp,
24
+ isFocused: isFocusedProp,
25
+ isFocusVisible: isFocusVisibleProp,
26
+ ...rest
27
+ }, ref) => {
28
+ const inputRef = (0, _react.useRef)(null);
29
+ const inputFieldRef = (0, _react.useRef)(null);
30
+ const [isFocused, setIsFocused] = (0, _react.useState)(false);
31
+ const handleFocus = (0, _react.useCallback)((focusState, callback) => {
32
+ setIsFocused(focusState);
33
+ callback();
34
+ }, []);
35
+ const inputProps = (0, _utils.useFormControlContext)();
36
+ const {
37
+ isHovered
38
+ } = (0, _interactions.useHover)({}, inputRef);
39
+ const {
40
+ isFocusVisible
41
+ } = (0, _focus.useFocusRing)();
42
+ const resolvedDisabled = isDisabled || inputProps.isDisabled;
43
+ const resolvedInvalid = isInvalid || inputProps.isInvalid;
44
+ const resolvedReadOnly = isReadOnly || inputProps.isReadOnly;
45
+ const resolvedRequired = isRequired || inputProps.isRequired;
46
+ const resolvedHovered = isHoveredProp || isHovered;
47
+ const resolvedFocused = isFocusedProp || isFocused;
48
+ const resolvedFocusVisible = isFocusVisibleProp || isFocusVisible;
49
+
50
+ // TODO: Remove is prefix from props (align with ButtonRoot)
51
+ const contextValue = (0, _react.useMemo)(() => ({
52
+ isDisabled: resolvedDisabled,
53
+ isInvalid: resolvedInvalid,
54
+ isHovered: resolvedHovered,
55
+ isFocused: resolvedFocused,
56
+ isFocusVisible: resolvedFocusVisible,
57
+ isReadOnly: resolvedReadOnly,
58
+ isRequired: resolvedRequired,
59
+ inputRef,
60
+ handleFocus,
61
+ setIsFocused,
62
+ inputFieldRef
63
+ }), [resolvedDisabled, resolvedInvalid, resolvedHovered, resolvedFocused, resolvedFocusVisible, resolvedReadOnly, resolvedRequired, handleFocus]);
64
+ const Comp = asChild ? _slot.Slot : _reactNative.View;
65
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.InputProvider, {
66
+ value: contextValue,
67
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
68
+ ref: (0, _utils.mergeRefs)(inputRef, ref),
69
+ ...rest,
70
+ ...(0, _dataAttributes.mergeDataAttributes)(rest, (0, _dataAttributes.dataAttributes)({
71
+ hover: resolvedHovered,
72
+ focus: resolvedFocused,
73
+ disabled: resolvedDisabled,
74
+ invalid: resolvedInvalid,
75
+ readonly: resolvedReadOnly,
76
+ required: resolvedRequired,
77
+ focusVisible: resolvedFocusVisible
78
+ })),
79
+ children: children
80
+ })
81
+ });
82
+ });
83
+ InputRoot.displayName = 'InputRoot';
84
+ //# sourceMappingURL=InputRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_utils","_focus","_interactions","_slot","_dataAttributes","_context","_jsxRuntime","InputRoot","exports","forwardRef","asChild","children","isReadOnly","isDisabled","isInvalid","isRequired","isHovered","isHoveredProp","isFocused","isFocusedProp","isFocusVisible","isFocusVisibleProp","rest","ref","inputRef","useRef","inputFieldRef","setIsFocused","useState","handleFocus","useCallback","focusState","callback","inputProps","useFormControlContext","useHover","useFocusRing","resolvedDisabled","resolvedInvalid","resolvedReadOnly","resolvedRequired","resolvedHovered","resolvedFocused","resolvedFocusVisible","contextValue","useMemo","Comp","Slot","View","jsx","InputProvider","value","mergeRefs","mergeDataAttributes","dataAttributes","hover","focus","disabled","invalid","readonly","required","focusVisible","displayName"],"sourceRoot":"../../../src","sources":["input/InputRoot.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAA0C,IAAAQ,WAAA,GAAAR,OAAA;AAKnC,MAAMS,SAAS,GAAAC,OAAA,CAAAD,SAAA,gBAAG,IAAAE,iBAAU,EACjC,CACE;EACEC,OAAO;EACPC,QAAQ;EACRC,UAAU;EACVC,UAAU;EACVC,SAAS;EACTC,UAAU;EACVC,SAAS,EAAEC,aAAa;EACxBC,SAAS,EAAEC,aAAa;EACxBC,cAAc,EAAEC,kBAAkB;EAClC,GAAGC;AACL,CAAC,EACDC,GAAG,KACA;EACH,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAmC,IAAI,CAAC;EAC/D,MAAMC,aAAa,GAAG,IAAAD,aAAM,EAAC,IAAI,CAAC;EAElC,MAAM,CAACP,SAAS,EAAES,YAAY,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EACjD,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,WAAW,CAEf,CAAC;EAED,MAAMiB,IAAI,GAAGpC,OAAO,GAAGqC,UAAI,GAAGC,iBAAI;EAElC,oBACE,IAAA1C,WAAA,CAAA2C,GAAA,EAAC5C,QAAA,CAAA6C,aAAa;IAACC,KAAK,EAAEP,YAAa;IAAAjC,QAAA,eACjC,IAAAL,WAAA,CAAA2C,GAAA,EAACH,IAAI;MACHvB,GAAG,EAAE,IAAA6B,gBAAS,EAAC5B,QAAQ,EAAED,GAAG,CAAE;MAAA,GACzBD,IAAI;MAAA,GACL,IAAA+B,mCAAmB,EACrB/B,IAAI,EACJ,IAAAgC,8BAAc,EAAC;QACbC,KAAK,EAAEd,eAAe;QACtBe,KAAK,EAAEd,eAAe;QACtBe,QAAQ,EAAEpB,gBAAgB;QAC1BqB,OAAO,EAAEpB,eAAe;QACxBqB,QAAQ,EAAEpB,gBAAgB;QAC1BqB,QAAQ,EAAEpB,gBAAgB;QAC1BqB,YAAY,EAAElB;MAChB,CAAC,CACH,CAAC;MAAAhC,QAAA,EAEAA;IAAQ,CACL;EAAC,CACM,CAAC;AAEpB,CACF,CAAC;AAEDJ,SAAS,CAACuD,WAAW,GAAG,WAAW","ignoreList":[]}
@@ -3,20 +3,25 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.createInput = createInput;
7
- var _createInputField = require("./createInputField");
8
- var _createInputRoot = require("./createInputRoot");
9
- var _createInputSlot = require("./createInputSlot");
10
- function createInput(BaseComponents) {
11
- const Input = (0, _createInputRoot.createInputRoot)(BaseComponents.Root);
12
- const Slot = (0, _createInputSlot.createInputSlot)(BaseComponents.Slot);
13
- const Field = (0, _createInputField.createInputField)(BaseComponents.Field);
14
- Input.displayName = 'InputPrimitive';
15
- Slot.displayName = 'InputPrimitive.Slot';
16
- Field.displayName = 'InputPrimitive.Field';
17
- return Object.assign(Input, {
18
- Slot,
19
- Field
20
- });
21
- }
6
+ Object.defineProperty(exports, "InputField", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _InputField.InputField;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "InputRoot", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _InputRoot.InputRoot;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "useInputContext", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _context.useInputContext;
22
+ }
23
+ });
24
+ var _context = require("./context");
25
+ var _InputRoot = require("./InputRoot");
26
+ var _InputField = require("./InputField");
22
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_createInputField","require","_createInputRoot","_createInputSlot","createInput","BaseComponents","Input","createInputRoot","Root","Slot","createInputSlot","Field","createInputField","displayName","Object","assign"],"sourceRoot":"../../../src","sources":["input/index.tsx"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AAWO,SAASG,WAAWA,CAMzBC,cAID,EAAE;EACD,MAAMC,KAAK,GAAG,IAAAC,gCAAe,EAACF,cAAc,CAACG,IAAI,CAAC;EAClD,MAAMC,IAAI,GAAG,IAAAC,gCAAe,EAACL,cAAc,CAACI,IAAI,CAAC;EACjD,MAAME,KAAK,GAAG,IAAAC,kCAAgB,EAACP,cAAc,CAACM,KAAK,CAAC;EAEpDL,KAAK,CAACO,WAAW,GAAG,gBAAgB;EACpCJ,IAAI,CAACI,WAAW,GAAG,qBAAqB;EACxCF,KAAK,CAACE,WAAW,GAAG,sBAAsB;EAE1C,OAAOC,MAAM,CAACC,MAAM,CAACT,KAAK,EAAE;IAC1BG,IAAI;IACJE;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_context","require","_InputRoot","_InputField"],"sourceRoot":"../../../src","sources":["input/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA","ignoreList":[]}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LinkRoot = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _utils = require("@cdx-ui/utils");
10
+ var _focus = require("@react-native-aria/focus");
11
+ var _interactions = require("@react-native-aria/interactions");
12
+ var _slot = require("../slot");
13
+ var _dataAttributes = require("../utils/dataAttributes");
14
+ var _context = require("./context");
15
+ var _useLink = require("./useLink");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ const LinkRoot = exports.LinkRoot = /*#__PURE__*/(0, _react.forwardRef)(({
18
+ asChild,
19
+ children,
20
+ isHovered: isHoveredProp,
21
+ isPressed: isPressedProp,
22
+ isFocused: isFocusedProp,
23
+ isFocusVisible: isFocusVisibleProp,
24
+ isVisited: isVisitedProp,
25
+ href,
26
+ onPress,
27
+ action,
28
+ webProps,
29
+ ...props
30
+ }, ref) => {
31
+ const {
32
+ isFocused,
33
+ focusProps
34
+ } = (0, _focus.useFocus)();
35
+ const {
36
+ isFocusVisible,
37
+ focusProps: focusRingProps
38
+ } = (0, _focus.useFocusRing)();
39
+ const {
40
+ pressProps,
41
+ isPressed
42
+ } = (0, _interactions.usePress)({});
43
+ const {
44
+ isHovered,
45
+ hoverProps
46
+ } = (0, _interactions.useHover)();
47
+ const {
48
+ linkProps
49
+ } = (0, _useLink.useLink)({
50
+ href,
51
+ onPress,
52
+ action,
53
+ webProps
54
+ });
55
+ const hover = isHoveredProp || isHovered;
56
+ const visited = isVisitedProp ?? false;
57
+ const focusVisible = isFocusVisibleProp || isFocusVisible;
58
+ const contextValue = (0, _react.useMemo)(() => ({
59
+ hover,
60
+ visited,
61
+ focusVisible
62
+ }), [hover, visited, focusVisible]);
63
+ const Comp = asChild ? _slot.Slot : _reactNative.Pressable;
64
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.LinkInteractionProvider, {
65
+ value: contextValue,
66
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
67
+ ref: ref,
68
+ ...linkProps,
69
+ ...props,
70
+ ...(0, _dataAttributes.mergeDataAttributes)(props, (0, _dataAttributes.dataAttributes)({
71
+ hover,
72
+ focus: isFocusedProp || isFocused,
73
+ active: isPressedProp || isPressed,
74
+ focusVisible,
75
+ visited
76
+ })),
77
+ onPressIn: (0, _utils.composeEventHandlers)(props?.onPressIn, pressProps.onPressIn),
78
+ onPressOut: (0, _utils.composeEventHandlers)(props?.onPressOut, pressProps.onPressOut),
79
+ onHoverIn: (0, _utils.composeEventHandlers)(props?.onHoverIn, hoverProps.onHoverIn),
80
+ onHoverOut: (0, _utils.composeEventHandlers)(props?.onHoverOut, hoverProps.onHoverOut),
81
+ onFocus: (0, _utils.composeEventHandlers)((0, _utils.composeEventHandlers)(props?.onFocus, focusProps.onFocus), focusRingProps.onFocus),
82
+ onBlur: (0, _utils.composeEventHandlers)((0, _utils.composeEventHandlers)(props?.onBlur, focusProps.onBlur), focusRingProps.onBlur),
83
+ children: typeof children === 'function' ? children(contextValue) : children
84
+ })
85
+ });
86
+ });
87
+ LinkRoot.displayName = 'LinkRoot';
88
+ //# sourceMappingURL=LinkRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_utils","_focus","_interactions","_slot","_dataAttributes","_context","_useLink","_jsxRuntime","LinkRoot","exports","forwardRef","asChild","children","isHovered","isHoveredProp","isPressed","isPressedProp","isFocused","isFocusedProp","isFocusVisible","isFocusVisibleProp","isVisited","isVisitedProp","href","onPress","action","webProps","props","ref","focusProps","useFocus","focusRingProps","useFocusRing","pressProps","usePress","hoverProps","useHover","linkProps","useLink","hover","visited","focusVisible","contextValue","useMemo","Comp","Slot","Pressable","jsx","LinkInteractionProvider","value","mergeDataAttributes","dataAttributes","focus","active","onPressIn","composeEventHandlers","onPressOut","onHoverIn","onHoverOut","onFocus","onBlur","displayName"],"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AAc,CAAC4B,OACjB,CAAE;MACFC,MAAM,EAAE,IAAAL,2BAAoB,EAC1B,IAAAA,2BAAoB,EAClB5B,KAAK,EAAEiC,MAAM,EACb/B,UAAU,CAAC+B,MACb,CAAC,EACD7B,cAAc,CAAC6B,MACjB,CAAE;MAAAhD,QAAA,EAED,OAAOA,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAAC8B,YAAY,CAAC,GAAG9B;IAAQ,CAC/D;EAAC,CACgB,CAAC;AAE9B,CACF,CAAC;AAEDJ,QAAQ,CAACqD,WAAW,GAAG,UAAU","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useLinkInteractionContext = exports.LinkInteractionProvider = void 0;
7
+ var _utils = require("@cdx-ui/utils");
8
+ const [LinkInteractionProvider, useLinkInteractionContext] = (0, _utils.createContext)('LinkInteractionContext');
9
+ exports.useLinkInteractionContext = useLinkInteractionContext;
10
+ exports.LinkInteractionProvider = LinkInteractionProvider;
11
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_utils","require","LinkInteractionProvider","useLinkInteractionContext","createContext","exports"],"sourceRoot":"../../../src","sources":["link/context.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQO,MAAM,CAACC,uBAAuB,EAAEC,yBAAyB,CAAC,GAC/D,IAAAC,oBAAa,EAAuB,wBAAwB,CAAC;AAACC,OAAA,CAAAF,yBAAA,GAAAA,yBAAA;AAAAE,OAAA,CAAAH,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -3,16 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "LinkInteractionProvider", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _context.LinkInteractionProvider;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "LinkProvider", {
7
13
  enumerable: true,
8
14
  get: function () {
9
15
  return _LinkProvider.LinkProvider;
10
16
  }
11
17
  });
12
- Object.defineProperty(exports, "createLink", {
18
+ Object.defineProperty(exports, "LinkRoot", {
13
19
  enumerable: true,
14
20
  get: function () {
15
- return _createLink.createLink;
21
+ return _LinkRoot.LinkRoot;
16
22
  }
17
23
  });
18
24
  Object.defineProperty(exports, "useLink", {
@@ -21,7 +27,14 @@ Object.defineProperty(exports, "useLink", {
21
27
  return _useLink.useLink;
22
28
  }
23
29
  });
24
- var _createLink = require("./createLink");
30
+ Object.defineProperty(exports, "useLinkInteractionContext", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _context.useLinkInteractionContext;
34
+ }
35
+ });
36
+ var _LinkRoot = require("./LinkRoot");
37
+ var _context = require("./context");
25
38
  var _LinkProvider = require("./LinkProvider");
26
39
  var _useLink = require("./useLink");
27
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_createLink","require","_LinkProvider","_useLink"],"sourceRoot":"../../../src","sources":["link/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_LinkRoot","require","_context","_LinkProvider","_useLink"],"sourceRoot":"../../../src","sources":["link/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA","ignoreList":[]}