innxt-design-system 1.6.0

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 (2499) hide show
  1. package/.browserslistrc +223 -0
  2. package/.circleci/config.yml +361 -0
  3. package/.claude/launch.json +11 -0
  4. package/.codex/environments/environment.toml +11 -0
  5. package/.editorconfig +14 -0
  6. package/.gitattributes +6 -0
  7. package/.lintignore +16 -0
  8. package/.remarkrc.mjs +22 -0
  9. package/.vale.ini +35 -0
  10. package/.vscode/extensions.json +18 -0
  11. package/.vscode/settings.json +13 -0
  12. package/AGENTS.md +72 -0
  13. package/CHANGELOG.md +2648 -0
  14. package/CHANGELOG.old.md +220 -0
  15. package/CLAUDE.md +1 -0
  16. package/CONTRIBUTING.md +181 -0
  17. package/LICENSE +21 -0
  18. package/README.md +37 -0
  19. package/SECURITY.md +14 -0
  20. package/babel.config.mjs +49 -0
  21. package/docs/.env +1 -0
  22. package/docs/README.md +35 -0
  23. package/docs/next.config.mjs +178 -0
  24. package/docs/package.json +91 -0
  25. package/docs/postcss.config.js +7 -0
  26. package/docs/public/_headers +24 -0
  27. package/docs/public/_redirects +26 -0
  28. package/docs/public/fonts/die-grotesk-a-bold.woff2 +0 -0
  29. package/docs/public/fonts/die-grotesk-a-regular.woff2 +0 -0
  30. package/docs/public/fonts/die-grotesk-b-bold.woff2 +0 -0
  31. package/docs/public/fonts/die-grotesk-b-regular.woff2 +0 -0
  32. package/docs/public/fonts/paper-mono.woff2 +0 -0
  33. package/docs/public/static/apple-touch-icon.png +0 -0
  34. package/docs/public/static/favicon-dev.ico +0 -0
  35. package/docs/public/static/favicon-dev.svg +10 -0
  36. package/docs/public/static/favicon.ico +0 -0
  37. package/docs/public/static/favicon.svg +10 -0
  38. package/docs/public/static/logo.svg +5 -0
  39. package/docs/scripts/generateLlmTxt/__snapshots__/mdxToMarkdown.test.mjs.snap +1143 -0
  40. package/docs/scripts/generateLlmTxt/demoProcessor.mjs +172 -0
  41. package/docs/scripts/generateLlmTxt/index.mjs +324 -0
  42. package/docs/scripts/generateLlmTxt/mdxNodeHelpers.mjs +199 -0
  43. package/docs/scripts/generateLlmTxt/mdxToMarkdown.mjs +320 -0
  44. package/docs/scripts/generateLlmTxt/mdxToMarkdown.test.mjs +104 -0
  45. package/docs/scripts/generateLlmTxt/propsReferenceTableProcessor.mjs +174 -0
  46. package/docs/scripts/generateLlmTxt/releaseTimelineProcessor.mjs +80 -0
  47. package/docs/scripts/generateLlmTxt/resolver.mjs +49 -0
  48. package/docs/scripts/generateLlmTxt/typedocProcessor.mjs +50 -0
  49. package/docs/scripts/playground.template.tsx +5 -0
  50. package/docs/scripts/rehypeExtractLinkUrls.mts +46 -0
  51. package/docs/scripts/reportBrokenLinks.mts +16 -0
  52. package/docs/scripts/stylelint/no-unknown-demo-colors.test.mjs +136 -0
  53. package/docs/src/app/(docs)/kb/components/accordion/demos/_index.module.css +100 -0
  54. package/docs/src/app/(docs)/kb/components/accordion/demos/hero/css-modules/index.tsx +69 -0
  55. package/docs/src/app/(docs)/kb/components/accordion/demos/hero/index.ts +9 -0
  56. package/docs/src/app/(docs)/kb/components/accordion/demos/hero/tailwind/index.tsx +68 -0
  57. package/docs/src/app/(docs)/kb/components/accordion/demos/multiple/css-modules/index.tsx +69 -0
  58. package/docs/src/app/(docs)/kb/components/accordion/demos/multiple/index.ts +8 -0
  59. package/docs/src/app/(docs)/kb/components/accordion/demos/multiple/tailwind/index.tsx +71 -0
  60. package/docs/src/app/(docs)/kb/components/accordion/page.mdx +77 -0
  61. package/docs/src/app/(docs)/kb/components/accordion/types.md +402 -0
  62. package/docs/src/app/(docs)/kb/components/accordion/types.ts +7 -0
  63. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/_index.module.css +166 -0
  64. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/detached-triggers-controlled/css-modules/index.tsx +91 -0
  65. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/detached-triggers-controlled/index.ts +8 -0
  66. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/detached-triggers-controlled/tailwind/index.tsx +93 -0
  67. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/detached-triggers-simple/css-modules/index.tsx +39 -0
  68. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/detached-triggers-simple/index.ts +8 -0
  69. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/detached-triggers-simple/tailwind/index.tsx +38 -0
  70. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/hero/css-modules/index.module.css +159 -0
  71. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/hero/css-modules/index.tsx +29 -0
  72. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/hero/index.ts +9 -0
  73. package/docs/src/app/(docs)/kb/components/alert-dialog/demos/hero/tailwind/index.tsx +29 -0
  74. package/docs/src/app/(docs)/kb/components/alert-dialog/page.mdx +257 -0
  75. package/docs/src/app/(docs)/kb/components/alert-dialog/types.md +466 -0
  76. package/docs/src/app/(docs)/kb/components/alert-dialog/types.ts +7 -0
  77. package/docs/src/app/(docs)/kb/components/autocomplete/demos/async/css-modules/index.module.css +186 -0
  78. package/docs/src/app/(docs)/kb/components/autocomplete/demos/async/css-modules/index.tsx +242 -0
  79. package/docs/src/app/(docs)/kb/components/autocomplete/demos/async/index.ts +8 -0
  80. package/docs/src/app/(docs)/kb/components/autocomplete/demos/async/tailwind/index.tsx +260 -0
  81. package/docs/src/app/(docs)/kb/components/autocomplete/demos/auto-highlight/css-modules/index.module.css +142 -0
  82. package/docs/src/app/(docs)/kb/components/autocomplete/demos/auto-highlight/css-modules/index.tsx +80 -0
  83. package/docs/src/app/(docs)/kb/components/autocomplete/demos/auto-highlight/index.ts +8 -0
  84. package/docs/src/app/(docs)/kb/components/autocomplete/demos/auto-highlight/tailwind/index.tsx +88 -0
  85. package/docs/src/app/(docs)/kb/components/autocomplete/demos/command-palette/css-modules/index.module.css +376 -0
  86. package/docs/src/app/(docs)/kb/components/autocomplete/demos/command-palette/css-modules/index.tsx +141 -0
  87. package/docs/src/app/(docs)/kb/components/autocomplete/demos/command-palette/index.ts +8 -0
  88. package/docs/src/app/(docs)/kb/components/autocomplete/demos/command-palette/tailwind/index.tsx +149 -0
  89. package/docs/src/app/(docs)/kb/components/autocomplete/demos/fuzzy-matching/css-modules/index.module.css +176 -0
  90. package/docs/src/app/(docs)/kb/components/autocomplete/demos/fuzzy-matching/css-modules/index.tsx +168 -0
  91. package/docs/src/app/(docs)/kb/components/autocomplete/demos/fuzzy-matching/index.ts +8 -0
  92. package/docs/src/app/(docs)/kb/components/autocomplete/demos/fuzzy-matching/tailwind/index.tsx +182 -0
  93. package/docs/src/app/(docs)/kb/components/autocomplete/demos/grid/css-modules/index.module.css +366 -0
  94. package/docs/src/app/(docs)/kb/components/autocomplete/demos/grid/css-modules/index.tsx +251 -0
  95. package/docs/src/app/(docs)/kb/components/autocomplete/demos/grid/index.ts +8 -0
  96. package/docs/src/app/(docs)/kb/components/autocomplete/demos/grid/tailwind/index.tsx +254 -0
  97. package/docs/src/app/(docs)/kb/components/autocomplete/demos/grouped/css-modules/index.module.css +174 -0
  98. package/docs/src/app/(docs)/kb/components/autocomplete/demos/grouped/css-modules/index.tsx +106 -0
  99. package/docs/src/app/(docs)/kb/components/autocomplete/demos/grouped/index.ts +8 -0
  100. package/docs/src/app/(docs)/kb/components/autocomplete/demos/grouped/tailwind/index.tsx +118 -0
  101. package/docs/src/app/(docs)/kb/components/autocomplete/demos/hero/css-modules/index.module.css +152 -0
  102. package/docs/src/app/(docs)/kb/components/autocomplete/demos/hero/css-modules/index.tsx +80 -0
  103. package/docs/src/app/(docs)/kb/components/autocomplete/demos/hero/index.ts +9 -0
  104. package/docs/src/app/(docs)/kb/components/autocomplete/demos/hero/tailwind/index.tsx +88 -0
  105. package/docs/src/app/(docs)/kb/components/autocomplete/demos/inline/css-modules/index.module.css +141 -0
  106. package/docs/src/app/(docs)/kb/components/autocomplete/demos/inline/css-modules/index.tsx +77 -0
  107. package/docs/src/app/(docs)/kb/components/autocomplete/demos/inline/index.ts +8 -0
  108. package/docs/src/app/(docs)/kb/components/autocomplete/demos/inline/tailwind/index.tsx +83 -0
  109. package/docs/src/app/(docs)/kb/components/autocomplete/demos/limit/css-modules/index.module.css +146 -0
  110. package/docs/src/app/(docs)/kb/components/autocomplete/demos/limit/css-modules/index.tsx +116 -0
  111. package/docs/src/app/(docs)/kb/components/autocomplete/demos/limit/index.ts +8 -0
  112. package/docs/src/app/(docs)/kb/components/autocomplete/demos/limit/tailwind/index.tsx +124 -0
  113. package/docs/src/app/(docs)/kb/components/autocomplete/demos/virtualized/css-modules/index.module.css +138 -0
  114. package/docs/src/app/(docs)/kb/components/autocomplete/demos/virtualized/css-modules/index.tsx +154 -0
  115. package/docs/src/app/(docs)/kb/components/autocomplete/demos/virtualized/index.ts +8 -0
  116. package/docs/src/app/(docs)/kb/components/autocomplete/demos/virtualized/tailwind/index.tsx +151 -0
  117. package/docs/src/app/(docs)/kb/components/autocomplete/page.mdx +285 -0
  118. package/docs/src/app/(docs)/kb/components/autocomplete/types.md +1088 -0
  119. package/docs/src/app/(docs)/kb/components/autocomplete/types.ts +7 -0
  120. package/docs/src/app/(docs)/kb/components/avatar/demos/hero/css-modules/index.module.css +37 -0
  121. package/docs/src/app/(docs)/kb/components/avatar/demos/hero/css-modules/index.tsx +21 -0
  122. package/docs/src/app/(docs)/kb/components/avatar/demos/hero/index.ts +9 -0
  123. package/docs/src/app/(docs)/kb/components/avatar/demos/hero/tailwind/index.tsx +22 -0
  124. package/docs/src/app/(docs)/kb/components/avatar/page.mdx +58 -0
  125. package/docs/src/app/(docs)/kb/components/avatar/types.md +134 -0
  126. package/docs/src/app/(docs)/kb/components/avatar/types.ts +7 -0
  127. package/docs/src/app/(docs)/kb/components/button/demos/hero/css-modules/index.module.css +64 -0
  128. package/docs/src/app/(docs)/kb/components/button/demos/hero/css-modules/index.tsx +6 -0
  129. package/docs/src/app/(docs)/kb/components/button/demos/hero/index.ts +9 -0
  130. package/docs/src/app/(docs)/kb/components/button/demos/hero/tailwind/index.tsx +10 -0
  131. package/docs/src/app/(docs)/kb/components/button/demos/loading/css-modules/index.module.css +64 -0
  132. package/docs/src/app/(docs)/kb/components/button/demos/loading/css-modules/index.tsx +24 -0
  133. package/docs/src/app/(docs)/kb/components/button/demos/loading/index.ts +5 -0
  134. package/docs/src/app/(docs)/kb/components/button/demos/loading/tailwind/index.tsx +23 -0
  135. package/docs/src/app/(docs)/kb/components/button/page.mdx +81 -0
  136. package/docs/src/app/(docs)/kb/components/button/types.md +53 -0
  137. package/docs/src/app/(docs)/kb/components/button/types.ts +4 -0
  138. package/docs/src/app/(docs)/kb/components/checkbox/demos/hero/css-modules/Checkbox.tsx +58 -0
  139. package/docs/src/app/(docs)/kb/components/checkbox/demos/hero/css-modules/index.module.css +63 -0
  140. package/docs/src/app/(docs)/kb/components/checkbox/demos/hero/css-modules/index.tsx +5 -0
  141. package/docs/src/app/(docs)/kb/components/checkbox/demos/hero/index.ts +9 -0
  142. package/docs/src/app/(docs)/kb/components/checkbox/demos/hero/tailwind/index.tsx +34 -0
  143. package/docs/src/app/(docs)/kb/components/checkbox/page.mdx +121 -0
  144. package/docs/src/app/(docs)/kb/components/checkbox/types.md +209 -0
  145. package/docs/src/app/(docs)/kb/components/checkbox/types.ts +7 -0
  146. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/hero/css-modules/index.module.css +76 -0
  147. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/hero/css-modules/index.tsx +63 -0
  148. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/hero/index.ts +9 -0
  149. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/hero/tailwind/index.tsx +74 -0
  150. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/nested/css-modules/index.module.css +76 -0
  151. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/nested/css-modules/index.tsx +174 -0
  152. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/nested/index.ts +4 -0
  153. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/parent/css-modules/index.module.css +76 -0
  154. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/parent/css-modules/index.tsx +101 -0
  155. package/docs/src/app/(docs)/kb/components/checkbox-group/demos/parent/index.ts +4 -0
  156. package/docs/src/app/(docs)/kb/components/checkbox-group/page.mdx +162 -0
  157. package/docs/src/app/(docs)/kb/components/checkbox-group/types.md +87 -0
  158. package/docs/src/app/(docs)/kb/components/checkbox-group/types.ts +4 -0
  159. package/docs/src/app/(docs)/kb/components/collapsible/demos/hero/css-modules/index.module.css +112 -0
  160. package/docs/src/app/(docs)/kb/components/collapsible/demos/hero/css-modules/index.tsx +36 -0
  161. package/docs/src/app/(docs)/kb/components/collapsible/demos/hero/index.ts +9 -0
  162. package/docs/src/app/(docs)/kb/components/collapsible/demos/hero/tailwind/index.tsx +35 -0
  163. package/docs/src/app/(docs)/kb/components/collapsible/page.mdx +56 -0
  164. package/docs/src/app/(docs)/kb/components/collapsible/types.md +168 -0
  165. package/docs/src/app/(docs)/kb/components/collapsible/types.ts +7 -0
  166. package/docs/src/app/(docs)/kb/components/combobox/demos/async-multiple/css-modules/index.module.css +341 -0
  167. package/docs/src/app/(docs)/kb/components/combobox/demos/async-multiple/css-modules/index.tsx +361 -0
  168. package/docs/src/app/(docs)/kb/components/combobox/demos/async-multiple/index.ts +8 -0
  169. package/docs/src/app/(docs)/kb/components/combobox/demos/async-multiple/tailwind/index.tsx +384 -0
  170. package/docs/src/app/(docs)/kb/components/combobox/demos/async-single/css-modules/index.module.css +282 -0
  171. package/docs/src/app/(docs)/kb/components/combobox/demos/async-single/css-modules/index.tsx +337 -0
  172. package/docs/src/app/(docs)/kb/components/combobox/demos/async-single/index.ts +8 -0
  173. package/docs/src/app/(docs)/kb/components/combobox/demos/async-single/tailwind/index.tsx +363 -0
  174. package/docs/src/app/(docs)/kb/components/combobox/demos/creatable/css-modules/index.module.css +496 -0
  175. package/docs/src/app/(docs)/kb/components/combobox/demos/creatable/css-modules/index.tsx +286 -0
  176. package/docs/src/app/(docs)/kb/components/combobox/demos/creatable/index.ts +8 -0
  177. package/docs/src/app/(docs)/kb/components/combobox/demos/creatable/tailwind/index.tsx +306 -0
  178. package/docs/src/app/(docs)/kb/components/combobox/demos/grouped/css-modules/index.module.css +240 -0
  179. package/docs/src/app/(docs)/kb/components/combobox/demos/grouped/css-modules/index.tsx +145 -0
  180. package/docs/src/app/(docs)/kb/components/combobox/demos/grouped/index.ts +8 -0
  181. package/docs/src/app/(docs)/kb/components/combobox/demos/grouped/tailwind/index.tsx +164 -0
  182. package/docs/src/app/(docs)/kb/components/combobox/demos/hero/css-modules/index.module.css +221 -0
  183. package/docs/src/app/(docs)/kb/components/combobox/demos/hero/css-modules/index.tsx +128 -0
  184. package/docs/src/app/(docs)/kb/components/combobox/demos/hero/index.ts +9 -0
  185. package/docs/src/app/(docs)/kb/components/combobox/demos/hero/tailwind/index.tsx +143 -0
  186. package/docs/src/app/(docs)/kb/components/combobox/demos/input-inside-popup/css-modules/index.module.css +273 -0
  187. package/docs/src/app/(docs)/kb/components/combobox/demos/input-inside-popup/css-modules/index.tsx +290 -0
  188. package/docs/src/app/(docs)/kb/components/combobox/demos/input-inside-popup/index.ts +8 -0
  189. package/docs/src/app/(docs)/kb/components/combobox/demos/input-inside-popup/tailwind/index.tsx +303 -0
  190. package/docs/src/app/(docs)/kb/components/combobox/demos/multiple/css-modules/index.module.css +312 -0
  191. package/docs/src/app/(docs)/kb/components/combobox/demos/multiple/css-modules/index.tsx +121 -0
  192. package/docs/src/app/(docs)/kb/components/combobox/demos/multiple/index.ts +8 -0
  193. package/docs/src/app/(docs)/kb/components/combobox/demos/multiple/tailwind/index.tsx +129 -0
  194. package/docs/src/app/(docs)/kb/components/combobox/demos/virtualized/css-modules/index.module.css +150 -0
  195. package/docs/src/app/(docs)/kb/components/combobox/demos/virtualized/css-modules/index.tsx +172 -0
  196. package/docs/src/app/(docs)/kb/components/combobox/demos/virtualized/index.ts +8 -0
  197. package/docs/src/app/(docs)/kb/components/combobox/demos/virtualized/tailwind/index.tsx +175 -0
  198. package/docs/src/app/(docs)/kb/components/combobox/page.mdx +358 -0
  199. package/docs/src/app/(docs)/kb/components/combobox/types.md +1278 -0
  200. package/docs/src/app/(docs)/kb/components/combobox/types.ts +7 -0
  201. package/docs/src/app/(docs)/kb/components/context-menu/demos/hero/css-modules/index.module.css +108 -0
  202. package/docs/src/app/(docs)/kb/components/context-menu/demos/hero/css-modules/index.tsx +24 -0
  203. package/docs/src/app/(docs)/kb/components/context-menu/demos/hero/index.ts +9 -0
  204. package/docs/src/app/(docs)/kb/components/context-menu/demos/hero/tailwind/index.tsx +28 -0
  205. package/docs/src/app/(docs)/kb/components/context-menu/demos/submenu/css-modules/index.module.css +191 -0
  206. package/docs/src/app/(docs)/kb/components/context-menu/demos/submenu/css-modules/index.tsx +63 -0
  207. package/docs/src/app/(docs)/kb/components/context-menu/demos/submenu/index.ts +8 -0
  208. package/docs/src/app/(docs)/kb/components/context-menu/demos/submenu/tailwind/index.tsx +66 -0
  209. package/docs/src/app/(docs)/kb/components/context-menu/page.mdx +156 -0
  210. package/docs/src/app/(docs)/kb/components/context-menu/types.md +1129 -0
  211. package/docs/src/app/(docs)/kb/components/context-menu/types.ts +7 -0
  212. package/docs/src/app/(docs)/kb/components/dialog/demos/_index.module.css +158 -0
  213. package/docs/src/app/(docs)/kb/components/dialog/demos/close-confirmation/css-modules/index.module.css +219 -0
  214. package/docs/src/app/(docs)/kb/components/dialog/demos/close-confirmation/css-modules/index.tsx +91 -0
  215. package/docs/src/app/(docs)/kb/components/dialog/demos/close-confirmation/index.ts +8 -0
  216. package/docs/src/app/(docs)/kb/components/dialog/demos/close-confirmation/tailwind/index.tsx +97 -0
  217. package/docs/src/app/(docs)/kb/components/dialog/demos/detached-triggers-controlled/css-modules/index.tsx +66 -0
  218. package/docs/src/app/(docs)/kb/components/dialog/demos/detached-triggers-controlled/index.ts +8 -0
  219. package/docs/src/app/(docs)/kb/components/dialog/demos/detached-triggers-controlled/tailwind/index.tsx +83 -0
  220. package/docs/src/app/(docs)/kb/components/dialog/demos/detached-triggers-simple/css-modules/index.tsx +33 -0
  221. package/docs/src/app/(docs)/kb/components/dialog/demos/detached-triggers-simple/index.ts +8 -0
  222. package/docs/src/app/(docs)/kb/components/dialog/demos/detached-triggers-simple/tailwind/index.tsx +37 -0
  223. package/docs/src/app/(docs)/kb/components/dialog/demos/hero/css-modules/index.module.css +151 -0
  224. package/docs/src/app/(docs)/kb/components/dialog/demos/hero/css-modules/index.tsx +24 -0
  225. package/docs/src/app/(docs)/kb/components/dialog/demos/hero/index.ts +9 -0
  226. package/docs/src/app/(docs)/kb/components/dialog/demos/hero/tailwind/index.tsx +27 -0
  227. package/docs/src/app/(docs)/kb/components/dialog/demos/inside-scroll/css-modules/index.module.css +273 -0
  228. package/docs/src/app/(docs)/kb/components/dialog/demos/inside-scroll/css-modules/index.tsx +130 -0
  229. package/docs/src/app/(docs)/kb/components/dialog/demos/inside-scroll/index.ts +8 -0
  230. package/docs/src/app/(docs)/kb/components/dialog/demos/inside-scroll/tailwind/index.tsx +133 -0
  231. package/docs/src/app/(docs)/kb/components/dialog/demos/nested/css-modules/index.module.css +218 -0
  232. package/docs/src/app/(docs)/kb/components/dialog/demos/nested/css-modules/index.tsx +39 -0
  233. package/docs/src/app/(docs)/kb/components/dialog/demos/nested/index.ts +5 -0
  234. package/docs/src/app/(docs)/kb/components/dialog/demos/nested/tailwind/index.tsx +46 -0
  235. package/docs/src/app/(docs)/kb/components/dialog/demos/outside-scroll/css-modules/index.module.css +328 -0
  236. package/docs/src/app/(docs)/kb/components/dialog/demos/outside-scroll/css-modules/index.tsx +173 -0
  237. package/docs/src/app/(docs)/kb/components/dialog/demos/outside-scroll/index.ts +8 -0
  238. package/docs/src/app/(docs)/kb/components/dialog/demos/outside-scroll/tailwind/index.tsx +189 -0
  239. package/docs/src/app/(docs)/kb/components/dialog/demos/uncontained/css-modules/index.module.css +198 -0
  240. package/docs/src/app/(docs)/kb/components/dialog/demos/uncontained/css-modules/index.tsx +39 -0
  241. package/docs/src/app/(docs)/kb/components/dialog/demos/uncontained/index.ts +8 -0
  242. package/docs/src/app/(docs)/kb/components/dialog/demos/uncontained/tailwind/index.tsx +43 -0
  243. package/docs/src/app/(docs)/kb/components/dialog/page.mdx +356 -0
  244. package/docs/src/app/(docs)/kb/components/dialog/types.md +512 -0
  245. package/docs/src/app/(docs)/kb/components/dialog/types.ts +7 -0
  246. package/docs/src/app/(docs)/kb/components/drawer/demos/close-confirmation/css-modules/index.module.css +299 -0
  247. package/docs/src/app/(docs)/kb/components/drawer/demos/close-confirmation/css-modules/index.tsx +100 -0
  248. package/docs/src/app/(docs)/kb/components/drawer/demos/close-confirmation/index.ts +8 -0
  249. package/docs/src/app/(docs)/kb/components/drawer/demos/close-confirmation/tailwind/index.tsx +110 -0
  250. package/docs/src/app/(docs)/kb/components/drawer/demos/hero/css-modules/index.module.css +190 -0
  251. package/docs/src/app/(docs)/kb/components/drawer/demos/hero/css-modules/index.tsx +26 -0
  252. package/docs/src/app/(docs)/kb/components/drawer/demos/hero/index.ts +9 -0
  253. package/docs/src/app/(docs)/kb/components/drawer/demos/hero/tailwind/index.tsx +29 -0
  254. package/docs/src/app/(docs)/kb/components/drawer/demos/indent-provider/css-modules/index.module.css +236 -0
  255. package/docs/src/app/(docs)/kb/components/drawer/demos/indent-provider/css-modules/index.tsx +40 -0
  256. package/docs/src/app/(docs)/kb/components/drawer/demos/indent-provider/index.ts +8 -0
  257. package/docs/src/app/(docs)/kb/components/drawer/demos/indent-provider/tailwind/index.tsx +45 -0
  258. package/docs/src/app/(docs)/kb/components/drawer/demos/mobile-nav/css-modules/index.module.css +385 -0
  259. package/docs/src/app/(docs)/kb/components/drawer/demos/mobile-nav/css-modules/index.tsx +132 -0
  260. package/docs/src/app/(docs)/kb/components/drawer/demos/mobile-nav/index.ts +8 -0
  261. package/docs/src/app/(docs)/kb/components/drawer/demos/mobile-nav/tailwind/index.tsx +151 -0
  262. package/docs/src/app/(docs)/kb/components/drawer/demos/nested/css-modules/index.module.css +383 -0
  263. package/docs/src/app/(docs)/kb/components/drawer/demos/nested/css-modules/index.tsx +112 -0
  264. package/docs/src/app/(docs)/kb/components/drawer/demos/nested/index.ts +5 -0
  265. package/docs/src/app/(docs)/kb/components/drawer/demos/nested/tailwind/index.tsx +136 -0
  266. package/docs/src/app/(docs)/kb/components/drawer/demos/non-modal/css-modules/index.module.css +195 -0
  267. package/docs/src/app/(docs)/kb/components/drawer/demos/non-modal/css-modules/index.tsx +26 -0
  268. package/docs/src/app/(docs)/kb/components/drawer/demos/non-modal/index.ts +8 -0
  269. package/docs/src/app/(docs)/kb/components/drawer/demos/non-modal/tailwind/index.tsx +29 -0
  270. package/docs/src/app/(docs)/kb/components/drawer/demos/position/css-modules/index.module.css +181 -0
  271. package/docs/src/app/(docs)/kb/components/drawer/demos/position/css-modules/index.tsx +27 -0
  272. package/docs/src/app/(docs)/kb/components/drawer/demos/position/index.ts +5 -0
  273. package/docs/src/app/(docs)/kb/components/drawer/demos/position/tailwind/index.tsx +32 -0
  274. package/docs/src/app/(docs)/kb/components/drawer/demos/snap-points/css-modules/index.module.css +255 -0
  275. package/docs/src/app/(docs)/kb/components/drawer/demos/snap-points/css-modules/index.tsx +50 -0
  276. package/docs/src/app/(docs)/kb/components/drawer/demos/snap-points/index.ts +8 -0
  277. package/docs/src/app/(docs)/kb/components/drawer/demos/snap-points/tailwind/index.tsx +55 -0
  278. package/docs/src/app/(docs)/kb/components/drawer/demos/swipe-area/css-modules/index.module.css +271 -0
  279. package/docs/src/app/(docs)/kb/components/drawer/demos/swipe-area/css-modules/index.tsx +39 -0
  280. package/docs/src/app/(docs)/kb/components/drawer/demos/swipe-area/index.ts +8 -0
  281. package/docs/src/app/(docs)/kb/components/drawer/demos/swipe-area/tailwind/index.tsx +45 -0
  282. package/docs/src/app/(docs)/kb/components/drawer/demos/uncontained/css-modules/index.module.css +273 -0
  283. package/docs/src/app/(docs)/kb/components/drawer/demos/uncontained/css-modules/index.tsx +53 -0
  284. package/docs/src/app/(docs)/kb/components/drawer/demos/uncontained/index.ts +8 -0
  285. package/docs/src/app/(docs)/kb/components/drawer/demos/uncontained/tailwind/index.tsx +59 -0
  286. package/docs/src/app/(docs)/kb/components/drawer/demos/virtual-keyboard-aware/css-modules/index.module.css +434 -0
  287. package/docs/src/app/(docs)/kb/components/drawer/demos/virtual-keyboard-aware/css-modules/index.tsx +75 -0
  288. package/docs/src/app/(docs)/kb/components/drawer/demos/virtual-keyboard-aware/index.ts +8 -0
  289. package/docs/src/app/(docs)/kb/components/drawer/demos/virtual-keyboard-aware/tailwind/index.tsx +88 -0
  290. package/docs/src/app/(docs)/kb/components/drawer/page.mdx +452 -0
  291. package/docs/src/app/(docs)/kb/components/drawer/types.md +796 -0
  292. package/docs/src/app/(docs)/kb/components/drawer/types.ts +7 -0
  293. package/docs/src/app/(docs)/kb/components/field/demos/hero/css-modules/index.module.css +84 -0
  294. package/docs/src/app/(docs)/kb/components/field/demos/hero/css-modules/index.tsx +17 -0
  295. package/docs/src/app/(docs)/kb/components/field/demos/hero/index.ts +9 -0
  296. package/docs/src/app/(docs)/kb/components/field/demos/hero/tailwind/index.tsx +21 -0
  297. package/docs/src/app/(docs)/kb/components/field/page.mdx +77 -0
  298. package/docs/src/app/(docs)/kb/components/field/types.md +458 -0
  299. package/docs/src/app/(docs)/kb/components/field/types.ts +7 -0
  300. package/docs/src/app/(docs)/kb/components/fieldset/demos/hero/css-modules/index.module.css +106 -0
  301. package/docs/src/app/(docs)/kb/components/fieldset/demos/hero/css-modules/index.tsx +21 -0
  302. package/docs/src/app/(docs)/kb/components/fieldset/demos/hero/index.ts +9 -0
  303. package/docs/src/app/(docs)/kb/components/fieldset/demos/hero/tailwind/index.tsx +32 -0
  304. package/docs/src/app/(docs)/kb/components/fieldset/page.mdx +53 -0
  305. package/docs/src/app/(docs)/kb/components/fieldset/types.md +72 -0
  306. package/docs/src/app/(docs)/kb/components/fieldset/types.ts +7 -0
  307. package/docs/src/app/(docs)/kb/components/form/demos/form-action/css-modules/index.module.css +145 -0
  308. package/docs/src/app/(docs)/kb/components/form/demos/form-action/css-modules/index.tsx +62 -0
  309. package/docs/src/app/(docs)/kb/components/form/demos/form-action/index.ts +8 -0
  310. package/docs/src/app/(docs)/kb/components/form/demos/form-action/tailwind/index.tsx +72 -0
  311. package/docs/src/app/(docs)/kb/components/form/demos/hero/css-modules/index.module.css +145 -0
  312. package/docs/src/app/(docs)/kb/components/form/demos/hero/css-modules/index.tsx +67 -0
  313. package/docs/src/app/(docs)/kb/components/form/demos/hero/index.ts +9 -0
  314. package/docs/src/app/(docs)/kb/components/form/demos/hero/tailwind/index.tsx +73 -0
  315. package/docs/src/app/(docs)/kb/components/form/demos/zod/css-modules/index.module.css +145 -0
  316. package/docs/src/app/(docs)/kb/components/form/demos/zod/css-modules/index.tsx +55 -0
  317. package/docs/src/app/(docs)/kb/components/form/demos/zod/index.ts +5 -0
  318. package/docs/src/app/(docs)/kb/components/form/demos/zod/tailwind/index.tsx +67 -0
  319. package/docs/src/app/(docs)/kb/components/form/page.mdx +91 -0
  320. package/docs/src/app/(docs)/kb/components/form/types.md +88 -0
  321. package/docs/src/app/(docs)/kb/components/form/types.ts +4 -0
  322. package/docs/src/app/(docs)/kb/components/input/demos/hero/css-modules/index.module.css +58 -0
  323. package/docs/src/app/(docs)/kb/components/input/demos/hero/css-modules/index.tsx +11 -0
  324. package/docs/src/app/(docs)/kb/components/input/demos/hero/index.ts +9 -0
  325. package/docs/src/app/(docs)/kb/components/input/demos/hero/tailwind/index.tsx +13 -0
  326. package/docs/src/app/(docs)/kb/components/input/page.mdx +51 -0
  327. package/docs/src/app/(docs)/kb/components/input/types.md +92 -0
  328. package/docs/src/app/(docs)/kb/components/input/types.ts +4 -0
  329. package/docs/src/app/(docs)/kb/components/menu/demos/_index.module.css +250 -0
  330. package/docs/src/app/(docs)/kb/components/menu/demos/arrow/css-modules/index.module.css +199 -0
  331. package/docs/src/app/(docs)/kb/components/menu/demos/arrow/css-modules/index.tsx +47 -0
  332. package/docs/src/app/(docs)/kb/components/menu/demos/arrow/index.ts +8 -0
  333. package/docs/src/app/(docs)/kb/components/menu/demos/arrow/tailwind/index.tsx +49 -0
  334. package/docs/src/app/(docs)/kb/components/menu/demos/checkbox-items/css-modules/index.module.css +172 -0
  335. package/docs/src/app/(docs)/kb/components/menu/demos/checkbox-items/css-modules/index.tsx +85 -0
  336. package/docs/src/app/(docs)/kb/components/menu/demos/checkbox-items/index.ts +8 -0
  337. package/docs/src/app/(docs)/kb/components/menu/demos/checkbox-items/tailwind/index.tsx +87 -0
  338. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-controlled/css-modules/index.tsx +103 -0
  339. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-controlled/index.ts +8 -0
  340. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-controlled/tailwind/index.tsx +112 -0
  341. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-full/css-modules/index.module.css +75 -0
  342. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-full/css-modules/index.tsx +90 -0
  343. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-full/index.ts +8 -0
  344. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-full/tailwind/index.tsx +150 -0
  345. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-simple/css-modules/index.tsx +48 -0
  346. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-simple/index.ts +8 -0
  347. package/docs/src/app/(docs)/kb/components/menu/demos/detached-triggers-simple/tailwind/index.tsx +56 -0
  348. package/docs/src/app/(docs)/kb/components/menu/demos/group-labels/css-modules/index.module.css +190 -0
  349. package/docs/src/app/(docs)/kb/components/menu/demos/group-labels/css-modules/index.tsx +113 -0
  350. package/docs/src/app/(docs)/kb/components/menu/demos/group-labels/index.ts +8 -0
  351. package/docs/src/app/(docs)/kb/components/menu/demos/group-labels/tailwind/index.tsx +119 -0
  352. package/docs/src/app/(docs)/kb/components/menu/demos/hero/css-modules/index.module.css +160 -0
  353. package/docs/src/app/(docs)/kb/components/menu/demos/hero/css-modules/index.tsx +42 -0
  354. package/docs/src/app/(docs)/kb/components/menu/demos/hero/index.ts +9 -0
  355. package/docs/src/app/(docs)/kb/components/menu/demos/hero/tailwind/index.tsx +44 -0
  356. package/docs/src/app/(docs)/kb/components/menu/demos/open-on-hover/css-modules/index.module.css +160 -0
  357. package/docs/src/app/(docs)/kb/components/menu/demos/open-on-hover/css-modules/index.tsx +39 -0
  358. package/docs/src/app/(docs)/kb/components/menu/demos/open-on-hover/index.ts +8 -0
  359. package/docs/src/app/(docs)/kb/components/menu/demos/open-on-hover/tailwind/index.tsx +44 -0
  360. package/docs/src/app/(docs)/kb/components/menu/demos/radio-items/css-modules/index.module.css +171 -0
  361. package/docs/src/app/(docs)/kb/components/menu/demos/radio-items/css-modules/index.tsx +72 -0
  362. package/docs/src/app/(docs)/kb/components/menu/demos/radio-items/index.ts +8 -0
  363. package/docs/src/app/(docs)/kb/components/menu/demos/radio-items/tailwind/index.tsx +74 -0
  364. package/docs/src/app/(docs)/kb/components/menu/demos/submenu/css-modules/index.module.css +193 -0
  365. package/docs/src/app/(docs)/kb/components/menu/demos/submenu/css-modules/index.tsx +84 -0
  366. package/docs/src/app/(docs)/kb/components/menu/demos/submenu/index.ts +5 -0
  367. package/docs/src/app/(docs)/kb/components/menu/demos/submenu/tailwind/index.tsx +93 -0
  368. package/docs/src/app/(docs)/kb/components/menu/page.mdx +450 -0
  369. package/docs/src/app/(docs)/kb/components/menu/types.md +1205 -0
  370. package/docs/src/app/(docs)/kb/components/menu/types.ts +7 -0
  371. package/docs/src/app/(docs)/kb/components/menubar/demos/hero/css-modules/index.module.css +185 -0
  372. package/docs/src/app/(docs)/kb/components/menubar/demos/hero/css-modules/index.tsx +151 -0
  373. package/docs/src/app/(docs)/kb/components/menubar/demos/hero/index.ts +9 -0
  374. package/docs/src/app/(docs)/kb/components/menubar/demos/hero/tailwind/index.tsx +198 -0
  375. package/docs/src/app/(docs)/kb/components/menubar/page.mdx +79 -0
  376. package/docs/src/app/(docs)/kb/components/menubar/types.md +61 -0
  377. package/docs/src/app/(docs)/kb/components/menubar/types.ts +4 -0
  378. package/docs/src/app/(docs)/kb/components/meter/demos/hero/css-modules/index.module.css +49 -0
  379. package/docs/src/app/(docs)/kb/components/meter/demos/hero/css-modules/index.tsx +14 -0
  380. package/docs/src/app/(docs)/kb/components/meter/demos/hero/index.ts +9 -0
  381. package/docs/src/app/(docs)/kb/components/meter/demos/hero/tailwind/index.tsx +15 -0
  382. package/docs/src/app/(docs)/kb/components/meter/page.mdx +70 -0
  383. package/docs/src/app/(docs)/kb/components/meter/types.md +152 -0
  384. package/docs/src/app/(docs)/kb/components/meter/types.ts +7 -0
  385. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/hero/css-modules/index.module.css +348 -0
  386. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/hero/css-modules/index.tsx +146 -0
  387. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/hero/index.ts +9 -0
  388. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/hero/tailwind/index.tsx +170 -0
  389. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested/css-modules/index.module.css +363 -0
  390. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested/css-modules/index.tsx +169 -0
  391. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested/index.ts +8 -0
  392. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested/tailwind/index.tsx +199 -0
  393. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested-inline/css-modules/index.module.css +579 -0
  394. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested-inline/css-modules/index.tsx +145 -0
  395. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested-inline/data.ts +126 -0
  396. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested-inline/index.ts +8 -0
  397. package/docs/src/app/(docs)/kb/components/navigation-menu/demos/nested-inline/tailwind/index.tsx +191 -0
  398. package/docs/src/app/(docs)/kb/components/navigation-menu/page.mdx +185 -0
  399. package/docs/src/app/(docs)/kb/components/navigation-menu/types.md +643 -0
  400. package/docs/src/app/(docs)/kb/components/navigation-menu/types.ts +7 -0
  401. package/docs/src/app/(docs)/kb/components/number-field/demos/hero/css-modules/index.module.css +136 -0
  402. package/docs/src/app/(docs)/kb/components/number-field/demos/hero/css-modules/index.tsx +81 -0
  403. package/docs/src/app/(docs)/kb/components/number-field/demos/hero/index.ts +9 -0
  404. package/docs/src/app/(docs)/kb/components/number-field/demos/hero/tailwind/index.tsx +86 -0
  405. package/docs/src/app/(docs)/kb/components/number-field/page.mdx +86 -0
  406. package/docs/src/app/(docs)/kb/components/number-field/types.md +577 -0
  407. package/docs/src/app/(docs)/kb/components/number-field/types.ts +7 -0
  408. package/docs/src/app/(docs)/kb/components/otp-field/demos/alphanumeric/css-modules/index.module.css +73 -0
  409. package/docs/src/app/(docs)/kb/components/otp-field/demos/alphanumeric/css-modules/index.tsx +37 -0
  410. package/docs/src/app/(docs)/kb/components/otp-field/demos/alphanumeric/index.ts +8 -0
  411. package/docs/src/app/(docs)/kb/components/otp-field/demos/alphanumeric/tailwind/index.tsx +36 -0
  412. package/docs/src/app/(docs)/kb/components/otp-field/demos/custom-sanitize/css-modules/index.module.css +153 -0
  413. package/docs/src/app/(docs)/kb/components/otp-field/demos/custom-sanitize/css-modules/index.tsx +74 -0
  414. package/docs/src/app/(docs)/kb/components/otp-field/demos/custom-sanitize/index.ts +6 -0
  415. package/docs/src/app/(docs)/kb/components/otp-field/demos/custom-sanitize/useInvalidFeedback.ts +61 -0
  416. package/docs/src/app/(docs)/kb/components/otp-field/demos/focused-placeholder/css-modules/index.module.css +81 -0
  417. package/docs/src/app/(docs)/kb/components/otp-field/demos/focused-placeholder/css-modules/index.tsx +36 -0
  418. package/docs/src/app/(docs)/kb/components/otp-field/demos/focused-placeholder/index.ts +8 -0
  419. package/docs/src/app/(docs)/kb/components/otp-field/demos/focused-placeholder/tailwind/index.tsx +35 -0
  420. package/docs/src/app/(docs)/kb/components/otp-field/demos/grouped/css-modules/index.module.css +75 -0
  421. package/docs/src/app/(docs)/kb/components/otp-field/demos/grouped/css-modules/index.tsx +38 -0
  422. package/docs/src/app/(docs)/kb/components/otp-field/demos/grouped/index.ts +8 -0
  423. package/docs/src/app/(docs)/kb/components/otp-field/demos/grouped/tailwind/index.tsx +37 -0
  424. package/docs/src/app/(docs)/kb/components/otp-field/demos/hero/css-modules/index.module.css +69 -0
  425. package/docs/src/app/(docs)/kb/components/otp-field/demos/hero/css-modules/index.tsx +35 -0
  426. package/docs/src/app/(docs)/kb/components/otp-field/demos/hero/index.ts +8 -0
  427. package/docs/src/app/(docs)/kb/components/otp-field/demos/hero/tailwind/index.tsx +34 -0
  428. package/docs/src/app/(docs)/kb/components/otp-field/demos/password/css-modules/index.module.css +74 -0
  429. package/docs/src/app/(docs)/kb/components/otp-field/demos/password/css-modules/index.tsx +36 -0
  430. package/docs/src/app/(docs)/kb/components/otp-field/demos/password/index.ts +8 -0
  431. package/docs/src/app/(docs)/kb/components/otp-field/demos/password/tailwind/index.tsx +35 -0
  432. package/docs/src/app/(docs)/kb/components/otp-field/page.mdx +159 -0
  433. package/docs/src/app/(docs)/kb/components/otp-field/types.md +272 -0
  434. package/docs/src/app/(docs)/kb/components/otp-field/types.ts +7 -0
  435. package/docs/src/app/(docs)/kb/components/page.mdx +2013 -0
  436. package/docs/src/app/(docs)/kb/components/popover/demos/_index.module.css +184 -0
  437. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-controlled/css-modules/index.tsx +64 -0
  438. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-controlled/index.ts +8 -0
  439. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-controlled/tailwind/index.tsx +69 -0
  440. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-full/css-modules/index.module.css +271 -0
  441. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-full/css-modules/index.tsx +89 -0
  442. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-full/index.ts +8 -0
  443. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-full/tailwind/index.tsx +130 -0
  444. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-simple/css-modules/index.tsx +30 -0
  445. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-simple/index.ts +8 -0
  446. package/docs/src/app/(docs)/kb/components/popover/demos/detached-triggers-simple/tailwind/index.tsx +32 -0
  447. package/docs/src/app/(docs)/kb/components/popover/demos/hero/css-modules/index.tsx +22 -0
  448. package/docs/src/app/(docs)/kb/components/popover/demos/hero/index.ts +9 -0
  449. package/docs/src/app/(docs)/kb/components/popover/demos/hero/tailwind/index.tsx +23 -0
  450. package/docs/src/app/(docs)/kb/components/popover/demos/open-on-hover/css-modules/index.tsx +24 -0
  451. package/docs/src/app/(docs)/kb/components/popover/demos/open-on-hover/index.ts +8 -0
  452. package/docs/src/app/(docs)/kb/components/popover/demos/open-on-hover/tailwind/index.tsx +25 -0
  453. package/docs/src/app/(docs)/kb/components/popover/page.mdx +273 -0
  454. package/docs/src/app/(docs)/kb/components/popover/types.md +629 -0
  455. package/docs/src/app/(docs)/kb/components/popover/types.ts +7 -0
  456. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-controlled/css-modules/index.tsx +132 -0
  457. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-controlled/index.ts +8 -0
  458. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-controlled/tailwind/index.tsx +134 -0
  459. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-full/css-modules/index.module.css +204 -0
  460. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-full/css-modules/index.tsx +104 -0
  461. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-full/index.ts +8 -0
  462. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-full/tailwind/index.tsx +109 -0
  463. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-simple/css-modules/index.tsx +46 -0
  464. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-simple/index.ts +8 -0
  465. package/docs/src/app/(docs)/kb/components/preview-card/demos/detached-triggers-simple/tailwind/index.tsx +45 -0
  466. package/docs/src/app/(docs)/kb/components/preview-card/demos/hero/css-modules/index.tsx +40 -0
  467. package/docs/src/app/(docs)/kb/components/preview-card/demos/hero/index.ts +9 -0
  468. package/docs/src/app/(docs)/kb/components/preview-card/demos/hero/tailwind/index.tsx +39 -0
  469. package/docs/src/app/(docs)/kb/components/preview-card/demos/index.module.css +221 -0
  470. package/docs/src/app/(docs)/kb/components/preview-card/page.mdx +250 -0
  471. package/docs/src/app/(docs)/kb/components/preview-card/types.md +525 -0
  472. package/docs/src/app/(docs)/kb/components/preview-card/types.ts +7 -0
  473. package/docs/src/app/(docs)/kb/components/progress/demos/hero/css-modules/index.module.css +49 -0
  474. package/docs/src/app/(docs)/kb/components/progress/demos/hero/css-modules/index.tsx +26 -0
  475. package/docs/src/app/(docs)/kb/components/progress/demos/hero/index.ts +9 -0
  476. package/docs/src/app/(docs)/kb/components/progress/demos/hero/tailwind/index.tsx +27 -0
  477. package/docs/src/app/(docs)/kb/components/progress/page.mdx +70 -0
  478. package/docs/src/app/(docs)/kb/components/progress/types.md +216 -0
  479. package/docs/src/app/(docs)/kb/components/progress/types.ts +7 -0
  480. package/docs/src/app/(docs)/kb/components/radio/demos/hero/css-modules/index.module.css +85 -0
  481. package/docs/src/app/(docs)/kb/components/radio/demos/hero/css-modules/index.tsx +37 -0
  482. package/docs/src/app/(docs)/kb/components/radio/demos/hero/index.ts +9 -0
  483. package/docs/src/app/(docs)/kb/components/radio/demos/hero/tailwind/index.tsx +49 -0
  484. package/docs/src/app/(docs)/kb/components/radio/page.mdx +155 -0
  485. package/docs/src/app/(docs)/kb/components/radio/types.md +147 -0
  486. package/docs/src/app/(docs)/kb/components/radio/types.ts +7 -0
  487. package/docs/src/app/(docs)/kb/components/radio-group/types.md +96 -0
  488. package/docs/src/app/(docs)/kb/components/radio-group/types.ts +4 -0
  489. package/docs/src/app/(docs)/kb/components/scroll-area/demos/both/css-modules/index.module.css +95 -0
  490. package/docs/src/app/(docs)/kb/components/scroll-area/demos/both/css-modules/index.tsx +27 -0
  491. package/docs/src/app/(docs)/kb/components/scroll-area/demos/both/index.ts +8 -0
  492. package/docs/src/app/(docs)/kb/components/scroll-area/demos/both/tailwind/index.tsx +32 -0
  493. package/docs/src/app/(docs)/kb/components/scroll-area/demos/hero/css-modules/index.module.css +84 -0
  494. package/docs/src/app/(docs)/kb/components/scroll-area/demos/hero/css-modules/index.tsx +35 -0
  495. package/docs/src/app/(docs)/kb/components/scroll-area/demos/hero/index.ts +9 -0
  496. package/docs/src/app/(docs)/kb/components/scroll-area/demos/hero/tailwind/index.tsx +34 -0
  497. package/docs/src/app/(docs)/kb/components/scroll-area/demos/scroll-fade/css-modules/index.module.css +92 -0
  498. package/docs/src/app/(docs)/kb/components/scroll-area/demos/scroll-fade/css-modules/index.tsx +35 -0
  499. package/docs/src/app/(docs)/kb/components/scroll-area/demos/scroll-fade/index.ts +8 -0
  500. package/docs/src/app/(docs)/kb/components/scroll-area/demos/scroll-fade/tailwind/index.tsx +34 -0
  501. package/docs/src/app/(docs)/kb/components/scroll-area/page.mdx +142 -0
  502. package/docs/src/app/(docs)/kb/components/scroll-area/types.md +356 -0
  503. package/docs/src/app/(docs)/kb/components/scroll-area/types.ts +7 -0
  504. package/docs/src/app/(docs)/kb/components/select/demos/grouped/css-modules/index.module.css +269 -0
  505. package/docs/src/app/(docs)/kb/components/select/demos/grouped/css-modules/index.tsx +148 -0
  506. package/docs/src/app/(docs)/kb/components/select/demos/grouped/index.ts +8 -0
  507. package/docs/src/app/(docs)/kb/components/select/demos/grouped/tailwind/index.tsx +156 -0
  508. package/docs/src/app/(docs)/kb/components/select/demos/hero/css-modules/index.module.css +232 -0
  509. package/docs/src/app/(docs)/kb/components/select/demos/hero/css-modules/index.tsx +110 -0
  510. package/docs/src/app/(docs)/kb/components/select/demos/hero/index.ts +9 -0
  511. package/docs/src/app/(docs)/kb/components/select/demos/hero/tailwind/index.tsx +118 -0
  512. package/docs/src/app/(docs)/kb/components/select/demos/multiple/css-modules/index.module.css +182 -0
  513. package/docs/src/app/(docs)/kb/components/select/demos/multiple/css-modules/index.tsx +96 -0
  514. package/docs/src/app/(docs)/kb/components/select/demos/multiple/index.ts +5 -0
  515. package/docs/src/app/(docs)/kb/components/select/demos/multiple/tailwind/index.tsx +103 -0
  516. package/docs/src/app/(docs)/kb/components/select/demos/object-values/css-modules/index.module.css +279 -0
  517. package/docs/src/app/(docs)/kb/components/select/demos/object-values/css-modules/index.tsx +145 -0
  518. package/docs/src/app/(docs)/kb/components/select/demos/object-values/index.ts +8 -0
  519. package/docs/src/app/(docs)/kb/components/select/demos/object-values/tailwind/index.tsx +150 -0
  520. package/docs/src/app/(docs)/kb/components/select/page.mdx +330 -0
  521. package/docs/src/app/(docs)/kb/components/select/types.md +907 -0
  522. package/docs/src/app/(docs)/kb/components/select/types.ts +7 -0
  523. package/docs/src/app/(docs)/kb/components/separator/demos/hero/css-modules/index.module.css +45 -0
  524. package/docs/src/app/(docs)/kb/components/separator/demos/hero/css-modules/index.tsx +30 -0
  525. package/docs/src/app/(docs)/kb/components/separator/demos/hero/index.ts +9 -0
  526. package/docs/src/app/(docs)/kb/components/separator/demos/hero/tailwind/index.tsx +47 -0
  527. package/docs/src/app/(docs)/kb/components/separator/page.mdx +46 -0
  528. package/docs/src/app/(docs)/kb/components/separator/types.md +53 -0
  529. package/docs/src/app/(docs)/kb/components/separator/types.ts +4 -0
  530. package/docs/src/app/(docs)/kb/components/slider/demos/edge-alignment/css-modules/index.module.css +56 -0
  531. package/docs/src/app/(docs)/kb/components/slider/demos/edge-alignment/css-modules/index.tsx +15 -0
  532. package/docs/src/app/(docs)/kb/components/slider/demos/edge-alignment/index.ts +8 -0
  533. package/docs/src/app/(docs)/kb/components/slider/demos/edge-alignment/tailwind/index.tsx +17 -0
  534. package/docs/src/app/(docs)/kb/components/slider/demos/hero/css-modules/index.module.css +56 -0
  535. package/docs/src/app/(docs)/kb/components/slider/demos/hero/css-modules/index.tsx +15 -0
  536. package/docs/src/app/(docs)/kb/components/slider/demos/hero/index.ts +9 -0
  537. package/docs/src/app/(docs)/kb/components/slider/demos/hero/tailwind/index.tsx +17 -0
  538. package/docs/src/app/(docs)/kb/components/slider/demos/range-slider/css-modules/index.module.css +56 -0
  539. package/docs/src/app/(docs)/kb/components/slider/demos/range-slider/css-modules/index.tsx +16 -0
  540. package/docs/src/app/(docs)/kb/components/slider/demos/range-slider/index.ts +8 -0
  541. package/docs/src/app/(docs)/kb/components/slider/demos/range-slider/tailwind/index.tsx +23 -0
  542. package/docs/src/app/(docs)/kb/components/slider/demos/vertical/css-modules/index.module.css +61 -0
  543. package/docs/src/app/(docs)/kb/components/slider/demos/vertical/css-modules/index.tsx +15 -0
  544. package/docs/src/app/(docs)/kb/components/slider/demos/vertical/index.ts +8 -0
  545. package/docs/src/app/(docs)/kb/components/slider/demos/vertical/tailwind/index.tsx +17 -0
  546. package/docs/src/app/(docs)/kb/components/slider/page.mdx +207 -0
  547. package/docs/src/app/(docs)/kb/components/slider/types.md +641 -0
  548. package/docs/src/app/(docs)/kb/components/slider/types.ts +7 -0
  549. package/docs/src/app/(docs)/kb/components/switch/demos/hero/css-modules/index.module.css +69 -0
  550. package/docs/src/app/(docs)/kb/components/switch/demos/hero/css-modules/index.tsx +13 -0
  551. package/docs/src/app/(docs)/kb/components/switch/demos/hero/index.ts +9 -0
  552. package/docs/src/app/(docs)/kb/components/switch/demos/hero/tailwind/index.tsx +15 -0
  553. package/docs/src/app/(docs)/kb/components/switch/page.mdx +118 -0
  554. package/docs/src/app/(docs)/kb/components/switch/types.md +178 -0
  555. package/docs/src/app/(docs)/kb/components/switch/types.ts +7 -0
  556. package/docs/src/app/(docs)/kb/components/tabs/demos/hero/css-modules/index.module.css +145 -0
  557. package/docs/src/app/(docs)/kb/components/tabs/demos/hero/css-modules/index.tsx +32 -0
  558. package/docs/src/app/(docs)/kb/components/tabs/demos/hero/index.ts +9 -0
  559. package/docs/src/app/(docs)/kb/components/tabs/demos/hero/tailwind/index.tsx +37 -0
  560. package/docs/src/app/(docs)/kb/components/tabs/page.mdx +97 -0
  561. package/docs/src/app/(docs)/kb/components/tabs/types.md +331 -0
  562. package/docs/src/app/(docs)/kb/components/tabs/types.ts +7 -0
  563. package/docs/src/app/(docs)/kb/components/toast/demos/anchored/css-modules/index.module.css +457 -0
  564. package/docs/src/app/(docs)/kb/components/toast/demos/anchored/css-modules/index.tsx +160 -0
  565. package/docs/src/app/(docs)/kb/components/toast/demos/anchored/index.ts +8 -0
  566. package/docs/src/app/(docs)/kb/components/toast/demos/anchored/tailwind/index.tsx +176 -0
  567. package/docs/src/app/(docs)/kb/components/toast/demos/custom/css-modules/index.module.css +271 -0
  568. package/docs/src/app/(docs)/kb/components/toast/demos/custom/css-modules/index.tsx +69 -0
  569. package/docs/src/app/(docs)/kb/components/toast/demos/custom/index.ts +4 -0
  570. package/docs/src/app/(docs)/kb/components/toast/demos/deduplicate/css-modules/index.module.css +305 -0
  571. package/docs/src/app/(docs)/kb/components/toast/demos/deduplicate/css-modules/index.tsx +62 -0
  572. package/docs/src/app/(docs)/kb/components/toast/demos/deduplicate/index.ts +4 -0
  573. package/docs/src/app/(docs)/kb/components/toast/demos/hero/css-modules/index.module.css +271 -0
  574. package/docs/src/app/(docs)/kb/components/toast/demos/hero/css-modules/index.tsx +51 -0
  575. package/docs/src/app/(docs)/kb/components/toast/demos/hero/index.ts +9 -0
  576. package/docs/src/app/(docs)/kb/components/toast/demos/hero/tailwind/index.tsx +60 -0
  577. package/docs/src/app/(docs)/kb/components/toast/demos/position/css-modules/index.module.css +266 -0
  578. package/docs/src/app/(docs)/kb/components/toast/demos/position/css-modules/index.tsx +51 -0
  579. package/docs/src/app/(docs)/kb/components/toast/demos/position/index.ts +5 -0
  580. package/docs/src/app/(docs)/kb/components/toast/demos/position/tailwind/index.tsx +61 -0
  581. package/docs/src/app/(docs)/kb/components/toast/demos/promise/css-modules/index.module.css +287 -0
  582. package/docs/src/app/(docs)/kb/components/toast/demos/promise/css-modules/index.tsx +63 -0
  583. package/docs/src/app/(docs)/kb/components/toast/demos/promise/index.ts +4 -0
  584. package/docs/src/app/(docs)/kb/components/toast/demos/undo/css-modules/index.module.css +277 -0
  585. package/docs/src/app/(docs)/kb/components/toast/demos/undo/css-modules/index.tsx +62 -0
  586. package/docs/src/app/(docs)/kb/components/toast/demos/undo/index.ts +4 -0
  587. package/docs/src/app/(docs)/kb/components/toast/demos/varying-heights/css-modules/index.module.css +271 -0
  588. package/docs/src/app/(docs)/kb/components/toast/demos/varying-heights/css-modules/index.tsx +59 -0
  589. package/docs/src/app/(docs)/kb/components/toast/demos/varying-heights/index.ts +4 -0
  590. package/docs/src/app/(docs)/kb/components/toast/page.mdx +477 -0
  591. package/docs/src/app/(docs)/kb/components/toast/types.md +947 -0
  592. package/docs/src/app/(docs)/kb/components/toast/types.ts +7 -0
  593. package/docs/src/app/(docs)/kb/components/toggle/demos/hero/css-modules/index.module.css +55 -0
  594. package/docs/src/app/(docs)/kb/components/toggle/demos/hero/css-modules/index.tsx +64 -0
  595. package/docs/src/app/(docs)/kb/components/toggle/demos/hero/index.ts +9 -0
  596. package/docs/src/app/(docs)/kb/components/toggle/demos/hero/tailwind/index.tsx +61 -0
  597. package/docs/src/app/(docs)/kb/components/toggle/page.mdx +43 -0
  598. package/docs/src/app/(docs)/kb/components/toggle/types.md +82 -0
  599. package/docs/src/app/(docs)/kb/components/toggle/types.ts +4 -0
  600. package/docs/src/app/(docs)/kb/components/toggle-group/demos/hero/css-modules/index.module.css +82 -0
  601. package/docs/src/app/(docs)/kb/components/toggle-group/demos/hero/css-modules/index.tsx +66 -0
  602. package/docs/src/app/(docs)/kb/components/toggle-group/demos/hero/index.ts +9 -0
  603. package/docs/src/app/(docs)/kb/components/toggle-group/demos/hero/tailwind/index.tsx +81 -0
  604. package/docs/src/app/(docs)/kb/components/toggle-group/demos/multiple/css-modules/index.module.css +82 -0
  605. package/docs/src/app/(docs)/kb/components/toggle-group/demos/multiple/css-modules/index.tsx +69 -0
  606. package/docs/src/app/(docs)/kb/components/toggle-group/demos/multiple/index.ts +8 -0
  607. package/docs/src/app/(docs)/kb/components/toggle-group/demos/multiple/tailwind/index.tsx +80 -0
  608. package/docs/src/app/(docs)/kb/components/toggle-group/page.mdx +52 -0
  609. package/docs/src/app/(docs)/kb/components/toggle-group/types.md +98 -0
  610. package/docs/src/app/(docs)/kb/components/toggle-group/types.ts +4 -0
  611. package/docs/src/app/(docs)/kb/components/toolbar/demos/hero/css-modules/index.module.css +242 -0
  612. package/docs/src/app/(docs)/kb/components/toolbar/demos/hero/css-modules/index.tsx +102 -0
  613. package/docs/src/app/(docs)/kb/components/toolbar/demos/hero/index.ts +9 -0
  614. package/docs/src/app/(docs)/kb/components/toolbar/demos/hero/tailwind/index.tsx +119 -0
  615. package/docs/src/app/(docs)/kb/components/toolbar/page.mdx +139 -0
  616. package/docs/src/app/(docs)/kb/components/toolbar/types.md +275 -0
  617. package/docs/src/app/(docs)/kb/components/toolbar/types.ts +7 -0
  618. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-controlled/css-modules/index.tsx +138 -0
  619. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-controlled/index.ts +8 -0
  620. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-controlled/tailwind/index.tsx +94 -0
  621. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-full/css-modules/index.module.css +229 -0
  622. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-full/css-modules/index.tsx +115 -0
  623. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-full/index.ts +8 -0
  624. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-full/tailwind/index.tsx +116 -0
  625. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-simple/css-modules/index.tsx +49 -0
  626. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-simple/index.ts +8 -0
  627. package/docs/src/app/(docs)/kb/components/tooltip/demos/detached-triggers-simple/tailwind/index.tsx +34 -0
  628. package/docs/src/app/(docs)/kb/components/tooltip/demos/hero/css-modules/index.module.css +149 -0
  629. package/docs/src/app/(docs)/kb/components/tooltip/demos/hero/css-modules/index.tsx +98 -0
  630. package/docs/src/app/(docs)/kb/components/tooltip/demos/hero/index.ts +9 -0
  631. package/docs/src/app/(docs)/kb/components/tooltip/demos/hero/tailwind/index.tsx +104 -0
  632. package/docs/src/app/(docs)/kb/components/tooltip/demos/icons-tw.tsx +61 -0
  633. package/docs/src/app/(docs)/kb/components/tooltip/demos/index.module.css +233 -0
  634. package/docs/src/app/(docs)/kb/components/tooltip/page.mdx +270 -0
  635. package/docs/src/app/(docs)/kb/components/tooltip/types.md +524 -0
  636. package/docs/src/app/(docs)/kb/components/tooltip/types.ts +7 -0
  637. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-popover-motion-keep-mounted-false/css-modules/index.module.css +90 -0
  638. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-popover-motion-keep-mounted-false/css-modules/index.tsx +35 -0
  639. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-popover-motion-keep-mounted-false/index.ts +6 -0
  640. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-popover-motion-keep-mounted-true/css-modules/index.module.css +89 -0
  641. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-popover-motion-keep-mounted-true/css-modules/index.tsx +32 -0
  642. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-popover-motion-keep-mounted-true/index.ts +6 -0
  643. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-select-motion/css-modules/index.module.css +238 -0
  644. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-select-motion/css-modules/index.tsx +107 -0
  645. package/docs/src/app/(docs)/kb/handbook/animation/demos/animated-select-motion/index.ts +6 -0
  646. package/docs/src/app/(docs)/kb/handbook/animation/page.mdx +233 -0
  647. package/docs/src/app/(docs)/kb/handbook/composition/page.mdx +113 -0
  648. package/docs/src/app/(docs)/kb/handbook/customization/page.mdx +144 -0
  649. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/autocomplete.tsx +73 -0
  650. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/button.tsx +20 -0
  651. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/checkbox-group.tsx +15 -0
  652. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/checkbox.tsx +21 -0
  653. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/combobox.tsx +161 -0
  654. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/field.tsx +56 -0
  655. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/fieldset.tsx +16 -0
  656. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/form.tsx +12 -0
  657. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/number-field.tsx +53 -0
  658. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/radio-group.tsx +15 -0
  659. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/radio.tsx +27 -0
  660. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/select.tsx +129 -0
  661. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/slider.tsx +55 -0
  662. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/switch.tsx +27 -0
  663. package/docs/src/app/(docs)/kb/handbook/forms/demos/components/toast.tsx +64 -0
  664. package/docs/src/app/(docs)/kb/handbook/forms/demos/hero/index.ts +8 -0
  665. package/docs/src/app/(docs)/kb/handbook/forms/demos/hero/tailwind/index.tsx +357 -0
  666. package/docs/src/app/(docs)/kb/handbook/forms/demos/react-hook-form/index.ts +4 -0
  667. package/docs/src/app/(docs)/kb/handbook/forms/demos/react-hook-form/tailwind/index.tsx +511 -0
  668. package/docs/src/app/(docs)/kb/handbook/forms/demos/tanstack-form/index.ts +4 -0
  669. package/docs/src/app/(docs)/kb/handbook/forms/demos/tanstack-form/tailwind/index.tsx +591 -0
  670. package/docs/src/app/(docs)/kb/handbook/forms/page.mdx +736 -0
  671. package/docs/src/app/(docs)/kb/handbook/page.mdx +167 -0
  672. package/docs/src/app/(docs)/kb/handbook/styling/page.mdx +176 -0
  673. package/docs/src/app/(docs)/kb/handbook/typescript/page.mdx +93 -0
  674. package/docs/src/app/(docs)/kb/overview/accessibility/page.mdx +63 -0
  675. package/docs/src/app/(docs)/kb/overview/page.mdx +128 -0
  676. package/docs/src/app/(docs)/kb/overview/quick-start/page.mdx +95 -0
  677. package/docs/src/app/(docs)/kb/page.mdx +130 -0
  678. package/docs/src/app/(docs)/kb/utils/csp-provider/page.mdx +107 -0
  679. package/docs/src/app/(docs)/kb/utils/csp-provider/types.md +35 -0
  680. package/docs/src/app/(docs)/kb/utils/csp-provider/types.ts +4 -0
  681. package/docs/src/app/(docs)/kb/utils/direction-provider/demos/hero/css-modules/index.module.css +56 -0
  682. package/docs/src/app/(docs)/kb/utils/direction-provider/demos/hero/css-modules/index.tsx +20 -0
  683. package/docs/src/app/(docs)/kb/utils/direction-provider/demos/hero/index.ts +9 -0
  684. package/docs/src/app/(docs)/kb/utils/direction-provider/demos/hero/tailwind/index.tsx +19 -0
  685. package/docs/src/app/(docs)/kb/utils/direction-provider/page.mdx +62 -0
  686. package/docs/src/app/(docs)/kb/utils/direction-provider/types.md +48 -0
  687. package/docs/src/app/(docs)/kb/utils/direction-provider/types.ts +8 -0
  688. package/docs/src/app/(docs)/kb/utils/merge-props/demos/prevent-base-ui-handler/css-modules/index.module.css +123 -0
  689. package/docs/src/app/(docs)/kb/utils/merge-props/demos/prevent-base-ui-handler/css-modules/index.tsx +74 -0
  690. package/docs/src/app/(docs)/kb/utils/merge-props/demos/prevent-base-ui-handler/index.ts +4 -0
  691. package/docs/src/app/(docs)/kb/utils/merge-props/page.mdx +87 -0
  692. package/docs/src/app/(docs)/kb/utils/merge-props/types.md +96 -0
  693. package/docs/src/app/(docs)/kb/utils/merge-props/types.ts +7 -0
  694. package/docs/src/app/(docs)/kb/utils/page.mdx +126 -0
  695. package/docs/src/app/(docs)/kb/utils/use-render/demos/render/css-modules/index.module.css +13 -0
  696. package/docs/src/app/(docs)/kb/utils/use-render/demos/render/css-modules/index.tsx +27 -0
  697. package/docs/src/app/(docs)/kb/utils/use-render/demos/render/index.ts +8 -0
  698. package/docs/src/app/(docs)/kb/utils/use-render/demos/render-callback/css-modules/index.module.css +71 -0
  699. package/docs/src/app/(docs)/kb/utils/use-render/demos/render-callback/css-modules/index.tsx +55 -0
  700. package/docs/src/app/(docs)/kb/utils/use-render/demos/render-callback/index.ts +6 -0
  701. package/docs/src/app/(docs)/kb/utils/use-render/page.mdx +198 -0
  702. package/docs/src/app/(docs)/kb/utils/use-render/types.md +557 -0
  703. package/docs/src/app/(docs)/kb/utils/use-render/types.ts +4 -0
  704. package/docs/src/app/(docs)/layout.css +89 -0
  705. package/docs/src/app/(docs)/layout.tsx +196 -0
  706. package/docs/src/app/(docs)/opengraph-image.png +0 -0
  707. package/docs/src/app/(docs)/production-error/ErrorCode.tsx +23 -0
  708. package/docs/src/app/(docs)/production-error/ErrorDisplay.tsx +36 -0
  709. package/docs/src/app/(docs)/production-error/page.mdx +16 -0
  710. package/docs/src/app/(private)/docs-theme/page.module.css +250 -0
  711. package/docs/src/app/(private)/docs-theme/page.tsx +220 -0
  712. package/docs/src/app/(private)/experiments/[...slug]/page.tsx +74 -0
  713. package/docs/src/app/(private)/experiments/_components/Button.module.css +22 -0
  714. package/docs/src/app/(private)/experiments/_components/Button.tsx +29 -0
  715. package/docs/src/app/(private)/experiments/_components/EditPanel.tsx +132 -0
  716. package/docs/src/app/(private)/experiments/_components/ExperimentRoot.module.css +61 -0
  717. package/docs/src/app/(private)/experiments/_components/ExperimentRoot.tsx +41 -0
  718. package/docs/src/app/(private)/experiments/_components/ExperimentsList.module.css +29 -0
  719. package/docs/src/app/(private)/experiments/_components/ExperimentsList.tsx +93 -0
  720. package/docs/src/app/(private)/experiments/_components/HideSidebar.tsx +20 -0
  721. package/docs/src/app/(private)/experiments/_components/Input.module.css +18 -0
  722. package/docs/src/app/(private)/experiments/_components/Input.tsx +7 -0
  723. package/docs/src/app/(private)/experiments/_components/SandboxLink.tsx +53 -0
  724. package/docs/src/app/(private)/experiments/_components/Select.module.css +174 -0
  725. package/docs/src/app/(private)/experiments/_components/Select.tsx +91 -0
  726. package/docs/src/app/(private)/experiments/_components/SettingsPanel.module.css +111 -0
  727. package/docs/src/app/(private)/experiments/_components/SettingsPanel.tsx +282 -0
  728. package/docs/src/app/(private)/experiments/_components/ShowSidebar.module.css +48 -0
  729. package/docs/src/app/(private)/experiments/_components/ShowSidebar.tsx +21 -0
  730. package/docs/src/app/(private)/experiments/_components/Sidebar.module.css +15 -0
  731. package/docs/src/app/(private)/experiments/_components/Sidebar.tsx +35 -0
  732. package/docs/src/app/(private)/experiments/_components/Switch.module.css +104 -0
  733. package/docs/src/app/(private)/experiments/_components/Switch.tsx +42 -0
  734. package/docs/src/app/(private)/experiments/_components/Tooltip.module.css +76 -0
  735. package/docs/src/app/(private)/experiments/_components/Tooltip.tsx +47 -0
  736. package/docs/src/app/(private)/experiments/_css/index.css +61 -0
  737. package/docs/src/app/(private)/experiments/_css/reset.css +384 -0
  738. package/docs/src/app/(private)/experiments/accordion/_components/Accordion.module.css +69 -0
  739. package/docs/src/app/(private)/experiments/accordion/_components/Accordion.tsx +35 -0
  740. package/docs/src/app/(private)/experiments/accordion/accordion.module.css +21 -0
  741. package/docs/src/app/(private)/experiments/accordion/animations.module.css +37 -0
  742. package/docs/src/app/(private)/experiments/accordion/animations.tsx +223 -0
  743. package/docs/src/app/(private)/experiments/accordion/horizontal.module.css +115 -0
  744. package/docs/src/app/(private)/experiments/accordion/horizontal.tsx +107 -0
  745. package/docs/src/app/(private)/experiments/accordion/transitions.module.css +19 -0
  746. package/docs/src/app/(private)/experiments/accordion/transitions.tsx +302 -0
  747. package/docs/src/app/(private)/experiments/anchor-positioning.module.css +12 -0
  748. package/docs/src/app/(private)/experiments/anchor-positioning.tsx +402 -0
  749. package/docs/src/app/(private)/experiments/anchor-side-animations.module.css +46 -0
  750. package/docs/src/app/(private)/experiments/anchor-side-animations.tsx +32 -0
  751. package/docs/src/app/(private)/experiments/collapsible/_components/Collapsible.module.css +54 -0
  752. package/docs/src/app/(private)/experiments/collapsible/_components/Collapsible.tsx +27 -0
  753. package/docs/src/app/(private)/experiments/collapsible/animate-presence.tsx +57 -0
  754. package/docs/src/app/(private)/experiments/collapsible/animations.module.css +58 -0
  755. package/docs/src/app/(private)/experiments/collapsible/animations.tsx +183 -0
  756. package/docs/src/app/(private)/experiments/collapsible/collapsible.module.css +21 -0
  757. package/docs/src/app/(private)/experiments/collapsible/plain.tsx +56 -0
  758. package/docs/src/app/(private)/experiments/collapsible/transitions.module.css +18 -0
  759. package/docs/src/app/(private)/experiments/collapsible/transitions.tsx +154 -0
  760. package/docs/src/app/(private)/experiments/combobox/creatable-tags.module.css +153 -0
  761. package/docs/src/app/(private)/experiments/combobox/creatable-tags.tsx +307 -0
  762. package/docs/src/app/(private)/experiments/combobox/dialog-combobox-multiple.tsx +112 -0
  763. package/docs/src/app/(private)/experiments/combobox/dialog-combobox.module.css +318 -0
  764. package/docs/src/app/(private)/experiments/combobox/dialog-combobox.tsx +88 -0
  765. package/docs/src/app/(private)/experiments/combobox/limited-chips.module.css +278 -0
  766. package/docs/src/app/(private)/experiments/combobox/limited-chips.tsx +203 -0
  767. package/docs/src/app/(private)/experiments/combobox/priority-combobox.module.css +187 -0
  768. package/docs/src/app/(private)/experiments/combobox/priority-combobox.tsx +171 -0
  769. package/docs/src/app/(private)/experiments/combobox-composition.module.css +154 -0
  770. package/docs/src/app/(private)/experiments/combobox-composition.tsx +114 -0
  771. package/docs/src/app/(private)/experiments/combobox-perf.module.css +166 -0
  772. package/docs/src/app/(private)/experiments/combobox-perf.tsx +158 -0
  773. package/docs/src/app/(private)/experiments/context-menu.module.css +342 -0
  774. package/docs/src/app/(private)/experiments/context-menu.tsx +409 -0
  775. package/docs/src/app/(private)/experiments/dialog/dialog.module.css +83 -0
  776. package/docs/src/app/(private)/experiments/dialog/dialogs.tsx +358 -0
  777. package/docs/src/app/(private)/experiments/dialog/nested.module.css +276 -0
  778. package/docs/src/app/(private)/experiments/dialog/nested.tsx +215 -0
  779. package/docs/src/app/(private)/experiments/drawer/cross-axis-scroll.module.css +136 -0
  780. package/docs/src/app/(private)/experiments/drawer/cross-axis-scroll.tsx +162 -0
  781. package/docs/src/app/(private)/experiments/drawer/drawer-controlled-opening.module.css +174 -0
  782. package/docs/src/app/(private)/experiments/drawer/drawer-controlled-opening.tsx +57 -0
  783. package/docs/src/app/(private)/experiments/drawer/touch-ignore.module.css +338 -0
  784. package/docs/src/app/(private)/experiments/drawer/touch-ignore.tsx +155 -0
  785. package/docs/src/app/(private)/experiments/drawer/virtual-keyboard-aware.module.css +112 -0
  786. package/docs/src/app/(private)/experiments/drawer/virtual-keyboard-aware.tsx +220 -0
  787. package/docs/src/app/(private)/experiments/drawer-slider.module.css +196 -0
  788. package/docs/src/app/(private)/experiments/drawer-slider.tsx +39 -0
  789. package/docs/src/app/(private)/experiments/forms/_icons.tsx +47 -0
  790. package/docs/src/app/(private)/experiments/forms/autofill.module.css +467 -0
  791. package/docs/src/app/(private)/experiments/forms/autofill.tsx +325 -0
  792. package/docs/src/app/(private)/experiments/forms/button-controls.tsx +195 -0
  793. package/docs/src/app/(private)/experiments/forms/form.module.css +693 -0
  794. package/docs/src/app/(private)/experiments/forms/form.tsx +523 -0
  795. package/docs/src/app/(private)/experiments/forms/rhf.tsx +988 -0
  796. package/docs/src/app/(private)/experiments/inline-positioning.module.css +171 -0
  797. package/docs/src/app/(private)/experiments/inline-positioning.tsx +169 -0
  798. package/docs/src/app/(private)/experiments/layout.tsx +5 -0
  799. package/docs/src/app/(private)/experiments/long-select.module.css +241 -0
  800. package/docs/src/app/(private)/experiments/long-select.tsx +375 -0
  801. package/docs/src/app/(private)/experiments/menu/complex-nesting.tsx +136 -0
  802. package/docs/src/app/(private)/experiments/menu/dialog-trigger-item.tsx +130 -0
  803. package/docs/src/app/(private)/experiments/menu/menu-anchor-el.tsx +40 -0
  804. package/docs/src/app/(private)/experiments/menu/menu-anchor-ref.tsx +37 -0
  805. package/docs/src/app/(private)/experiments/menu/menu-disabled-items.tsx +87 -0
  806. package/docs/src/app/(private)/experiments/menu/menu-fully-featured.tsx +312 -0
  807. package/docs/src/app/(private)/experiments/menu/menu-horizontal.module.css +193 -0
  808. package/docs/src/app/(private)/experiments/menu/menu-horizontal.tsx +127 -0
  809. package/docs/src/app/(private)/experiments/menu/menu-nested.module.css +190 -0
  810. package/docs/src/app/(private)/experiments/menu/menu-nested.tsx +133 -0
  811. package/docs/src/app/(private)/experiments/menu/menu-submenus.tsx +182 -0
  812. package/docs/src/app/(private)/experiments/menu/menu.module.css +412 -0
  813. package/docs/src/app/(private)/experiments/menu/nested-detached-triggers.module.css +115 -0
  814. package/docs/src/app/(private)/experiments/menu/nested-detached-triggers.tsx +270 -0
  815. package/docs/src/app/(private)/experiments/menu/perf-contained.tsx +90 -0
  816. package/docs/src/app/(private)/experiments/menu/perf-detached.tsx +99 -0
  817. package/docs/src/app/(private)/experiments/menu/pointer-events-scope.module.css +305 -0
  818. package/docs/src/app/(private)/experiments/menu/pointer-events-scope.tsx +254 -0
  819. package/docs/src/app/(private)/experiments/menu/triggers.module.css +47 -0
  820. package/docs/src/app/(private)/experiments/menu/triggers.tsx +421 -0
  821. package/docs/src/app/(private)/experiments/menubar.module.css +63 -0
  822. package/docs/src/app/(private)/experiments/menubar.tsx +239 -0
  823. package/docs/src/app/(private)/experiments/meter.module.css +52 -0
  824. package/docs/src/app/(private)/experiments/meter.tsx +44 -0
  825. package/docs/src/app/(private)/experiments/mobile-scroll-lock.module.css +100 -0
  826. package/docs/src/app/(private)/experiments/mobile-scroll-lock.tsx +38 -0
  827. package/docs/src/app/(private)/experiments/modality.module.css +239 -0
  828. package/docs/src/app/(private)/experiments/modality.tsx +128 -0
  829. package/docs/src/app/(private)/experiments/motion.tsx +113 -0
  830. package/docs/src/app/(private)/experiments/navigation-menu-popups.tsx +214 -0
  831. package/docs/src/app/(private)/experiments/navigation-menu.module.css +638 -0
  832. package/docs/src/app/(private)/experiments/navigation-menu.tsx +611 -0
  833. package/docs/src/app/(private)/experiments/page.tsx +15 -0
  834. package/docs/src/app/(private)/experiments/perf/contained-triggers.tsx +270 -0
  835. package/docs/src/app/(private)/experiments/perf/detached-triggers.tsx +317 -0
  836. package/docs/src/app/(private)/experiments/perf/menu-open.tsx +167 -0
  837. package/docs/src/app/(private)/experiments/perf/perf.module.css +171 -0
  838. package/docs/src/app/(private)/experiments/perf/radix-triggers.tsx +261 -0
  839. package/docs/src/app/(private)/experiments/perf/utils/benchmark.tsx +208 -0
  840. package/docs/src/app/(private)/experiments/perf/utils/wait.ts +27 -0
  841. package/docs/src/app/(private)/experiments/popover/calendar-shared.ts +15 -0
  842. package/docs/src/app/(private)/experiments/popover/calendar.module.css +187 -0
  843. package/docs/src/app/(private)/experiments/popover/calendar.tsx +175 -0
  844. package/docs/src/app/(private)/experiments/popover/dynamic-size.module.css +11 -0
  845. package/docs/src/app/(private)/experiments/popover/dynamic-size.tsx +87 -0
  846. package/docs/src/app/(private)/experiments/popover/nested-open-on-hover.module.css +179 -0
  847. package/docs/src/app/(private)/experiments/popover/nested-open-on-hover.tsx +64 -0
  848. package/docs/src/app/(private)/experiments/popover/popovers.module.css +91 -0
  849. package/docs/src/app/(private)/experiments/popover/popovers.tsx +335 -0
  850. package/docs/src/app/(private)/experiments/popover/vertical-shared.ts +3 -0
  851. package/docs/src/app/(private)/experiments/popover/vertical.module.css +411 -0
  852. package/docs/src/app/(private)/experiments/popover/vertical.tsx +207 -0
  853. package/docs/src/app/(private)/experiments/popup-tabbing.module.css +399 -0
  854. package/docs/src/app/(private)/experiments/popup-tabbing.tsx +247 -0
  855. package/docs/src/app/(private)/experiments/popups/popups-in-popups.module.css +806 -0
  856. package/docs/src/app/(private)/experiments/popups/popups-in-popups.tsx +510 -0
  857. package/docs/src/app/(private)/experiments/popups/popups-transform-origin.module.css +42 -0
  858. package/docs/src/app/(private)/experiments/popups/popups-transform-origin.tsx +77 -0
  859. package/docs/src/app/(private)/experiments/preview-card/nested.module.css +119 -0
  860. package/docs/src/app/(private)/experiments/preview-card/nested.tsx +61 -0
  861. package/docs/src/app/(private)/experiments/preview-card/triggers.module.css +156 -0
  862. package/docs/src/app/(private)/experiments/preview-card/triggers.tsx +446 -0
  863. package/docs/src/app/(private)/experiments/rtl.module.css +170 -0
  864. package/docs/src/app/(private)/experiments/rtl.tsx +187 -0
  865. package/docs/src/app/(private)/experiments/scroll-area/inside-menu.module.css +207 -0
  866. package/docs/src/app/(private)/experiments/scroll-area/inside-menu.tsx +90 -0
  867. package/docs/src/app/(private)/experiments/scroll-area/inside-select.module.css +204 -0
  868. package/docs/src/app/(private)/experiments/scroll-area/inside-select.tsx +67 -0
  869. package/docs/src/app/(private)/experiments/scroll-area/scroll-area-inset.module.css +41 -0
  870. package/docs/src/app/(private)/experiments/scroll-area/scroll-area-inset.tsx +55 -0
  871. package/docs/src/app/(private)/experiments/scroll-area/scroll-area-slight.module.css +30 -0
  872. package/docs/src/app/(private)/experiments/scroll-area/scroll-area-slight.tsx +23 -0
  873. package/docs/src/app/(private)/experiments/scroll-area/scroll-area.module.css +82 -0
  874. package/docs/src/app/(private)/experiments/scroll-area/scroll-area.tsx +25 -0
  875. package/docs/src/app/(private)/experiments/scroll-area/tabs-scroll-area.tsx +109 -0
  876. package/docs/src/app/(private)/experiments/scroll-lock.tsx +136 -0
  877. package/docs/src/app/(private)/experiments/select-perf.module.css +177 -0
  878. package/docs/src/app/(private)/experiments/select-perf.tsx +80 -0
  879. package/docs/src/app/(private)/experiments/select-rtl-align-item-with-trigger.tsx +313 -0
  880. package/docs/src/app/(private)/experiments/slider/inset.module.css +254 -0
  881. package/docs/src/app/(private)/experiments/slider/inset.tsx +150 -0
  882. package/docs/src/app/(private)/experiments/slider/slider.module.css +67 -0
  883. package/docs/src/app/(private)/experiments/slider/slider.tsx +191 -0
  884. package/docs/src/app/(private)/experiments/slider/small.module.css +83 -0
  885. package/docs/src/app/(private)/experiments/slider/vertical.module.css +64 -0
  886. package/docs/src/app/(private)/experiments/storeWithControlledValues.module.css +23 -0
  887. package/docs/src/app/(private)/experiments/storeWithControlledValues.tsx +125 -0
  888. package/docs/src/app/(private)/experiments/tabs/tabs-animations.module.css +264 -0
  889. package/docs/src/app/(private)/experiments/tabs/tabs-animations.tsx +110 -0
  890. package/docs/src/app/(private)/experiments/tabs/tabs-basic.module.css +162 -0
  891. package/docs/src/app/(private)/experiments/tabs/tabs-basic.tsx +96 -0
  892. package/docs/src/app/(private)/experiments/tabs/tabs-onValueChange.module.css +187 -0
  893. package/docs/src/app/(private)/experiments/tabs/tabs-onValueChange.tsx +260 -0
  894. package/docs/src/app/(private)/experiments/tabs/tabs-overflow.module.css +92 -0
  895. package/docs/src/app/(private)/experiments/tabs/tabs-overflow.tsx +81 -0
  896. package/docs/src/app/(private)/experiments/toast.module.css +91 -0
  897. package/docs/src/app/(private)/experiments/toast.tsx +124 -0
  898. package/docs/src/app/(private)/experiments/toggle-group.tsx +121 -0
  899. package/docs/src/app/(private)/experiments/toggle.module.css +75 -0
  900. package/docs/src/app/(private)/experiments/toolbar/_icons.tsx +223 -0
  901. package/docs/src/app/(private)/experiments/toolbar/basic.tsx +101 -0
  902. package/docs/src/app/(private)/experiments/toolbar/slider.module.css +118 -0
  903. package/docs/src/app/(private)/experiments/toolbar/text-editor.tsx +365 -0
  904. package/docs/src/app/(private)/experiments/toolbar/toolbar.module.css +302 -0
  905. package/docs/src/app/(private)/experiments/toolbar/triggers.module.css +52 -0
  906. package/docs/src/app/(private)/experiments/toolbar/triggers.tsx +371 -0
  907. package/docs/src/app/(private)/experiments/tooltip/disabled.module.css +188 -0
  908. package/docs/src/app/(private)/experiments/tooltip/disabled.tsx +72 -0
  909. package/docs/src/app/(private)/experiments/tooltip/nested.module.css +36 -0
  910. package/docs/src/app/(private)/experiments/tooltip/nested.tsx +112 -0
  911. package/docs/src/app/(private)/experiments/tooltip/prevent-open.module.css +119 -0
  912. package/docs/src/app/(private)/experiments/tooltip/prevent-open.tsx +123 -0
  913. package/docs/src/app/(private)/experiments/tooltip/tooltips.module.css +196 -0
  914. package/docs/src/app/(private)/experiments/tooltip/tooltips.tsx +406 -0
  915. package/docs/src/app/(private)/experiments/tooltip/transitions.module.css +109 -0
  916. package/docs/src/app/(private)/experiments/tooltip/transitions.tsx +217 -0
  917. package/docs/src/app/(private)/experiments/transition-attrs.module.css +296 -0
  918. package/docs/src/app/(private)/experiments/transition-attrs.tsx +253 -0
  919. package/docs/src/app/(private)/hydration-repro/index.css +4 -0
  920. package/docs/src/app/(private)/hydration-repro/page.tsx +42 -0
  921. package/docs/src/app/(private)/layout.tsx +63 -0
  922. package/docs/src/app/(private)/playground/[slug]/page.tsx +54 -0
  923. package/docs/src/app/(private)/playground/index.css +9 -0
  924. package/docs/src/app/(private)/playground/layout.tsx +5 -0
  925. package/docs/src/app/(website)/careers/design-engineer/page.tsx +213 -0
  926. package/docs/src/app/(website)/css/components/Accordion.css +60 -0
  927. package/docs/src/app/(website)/css/components/Body.css +8 -0
  928. package/docs/src/app/(website)/css/components/BulletList.css +11 -0
  929. package/docs/src/app/(website)/css/components/Figure.css +10 -0
  930. package/docs/src/app/(website)/css/components/Icon.css +7 -0
  931. package/docs/src/app/(website)/css/components/List.css +14 -0
  932. package/docs/src/app/(website)/css/components/Separator.css +8 -0
  933. package/docs/src/app/(website)/css/components/Text.css +97 -0
  934. package/docs/src/app/(website)/css/index.css +10 -0
  935. package/docs/src/app/(website)/icons/MinusIcon.tsx +19 -0
  936. package/docs/src/app/(website)/icons/PlusIcon.tsx +19 -0
  937. package/docs/src/app/(website)/layout.tsx +108 -0
  938. package/docs/src/app/(website)/logos/GitHub.tsx +9 -0
  939. package/docs/src/app/(website)/logos/HighlightAI.tsx +20 -0
  940. package/docs/src/app/(website)/logos/Interfere.tsx +22 -0
  941. package/docs/src/app/(website)/logos/Operate.tsx +12 -0
  942. package/docs/src/app/(website)/logos/Paper.tsx +12 -0
  943. package/docs/src/app/(website)/logos/Unsplash.tsx +16 -0
  944. package/docs/src/app/(website)/logos/Zed.tsx +21 -0
  945. package/docs/src/app/(website)/opengraph-image.png +0 -0
  946. package/docs/src/app/(website)/page.tsx +47 -0
  947. package/docs/src/app/global-not-found.tsx +20 -0
  948. package/docs/src/app/robots.txt +9 -0
  949. package/docs/src/app/sitemap/index.ts +12 -0
  950. package/docs/src/blocks/Demo/DemoContext.ts +25 -0
  951. package/docs/src/blocks/Demo/DemoPlayground.tsx +29 -0
  952. package/docs/src/blocks/Demo/DemoRoot.tsx +43 -0
  953. package/docs/src/blocks/Demo/DemoSourceCopy.tsx +48 -0
  954. package/docs/src/blocks/Demo/index.ts +6 -0
  955. package/docs/src/blocks/Demo/types.ts +37 -0
  956. package/docs/src/blocks/GoogleAnalyticsProvider.tsx +158 -0
  957. package/docs/src/blocks/GoogleTagManager.tsx +17 -0
  958. package/docs/src/blocks/PackageManagerSnippet/PackageManagerSnippetCode.tsx +16 -0
  959. package/docs/src/blocks/PackageManagerSnippet/PackageManagerSnippetProvider.tsx +59 -0
  960. package/docs/src/blocks/PackageManagerSnippet/PackageManagerSnippetRoot.tsx +49 -0
  961. package/docs/src/blocks/PackageManagerSnippet/index.ts +2 -0
  962. package/docs/src/blocks/README.txt +1 -0
  963. package/docs/src/blocks/createCodeSandbox/CreateReactApp.ts +62 -0
  964. package/docs/src/blocks/createCodeSandbox/addHiddenInput.ts +7 -0
  965. package/docs/src/blocks/createCodeSandbox/createCodeSandbox.ts +190 -0
  966. package/docs/src/blocks/createCodeSandbox/createStackBlitzProject.ts +162 -0
  967. package/docs/src/blocks/createCodeSandbox/flattenRelativeImports.ts +10 -0
  968. package/docs/src/blocks/createCodeSandbox/packDemo.test.ts +66 -0
  969. package/docs/src/blocks/createCodeSandbox/packDemo.ts +60 -0
  970. package/docs/src/code-components.tsx +22 -0
  971. package/docs/src/components/Accordion.css +183 -0
  972. package/docs/src/components/Accordion.tsx +132 -0
  973. package/docs/src/components/Code.css +40 -0
  974. package/docs/src/components/Code.tsx +6 -0
  975. package/docs/src/components/CodeBlock/CodeBlock.css +139 -0
  976. package/docs/src/components/CodeBlock/CodeBlock.tsx +138 -0
  977. package/docs/src/components/CodeBlock/CodeBlockPreComputed.tsx +44 -0
  978. package/docs/src/components/CodeBlock/CodeBlockPreComputedContent.tsx +24 -0
  979. package/docs/src/components/CodeBlock/index.ts +1 -0
  980. package/docs/src/components/CodeBlock/rehypeEagerCodeBlocks.mjs +20 -0
  981. package/docs/src/components/Demo/Demo.css +475 -0
  982. package/docs/src/components/Demo/Demo.tsx +271 -0
  983. package/docs/src/components/Demo/DemoCodeBlock.tsx +96 -0
  984. package/docs/src/components/Demo/DemoErrorFallback.tsx +15 -0
  985. package/docs/src/components/Demo/DemoFileSelector.tsx +83 -0
  986. package/docs/src/components/Demo/DemoPlayground.tsx +24 -0
  987. package/docs/src/components/Demo/DemoVariantSelector.tsx +52 -0
  988. package/docs/src/components/DescriptionList.css +101 -0
  989. package/docs/src/components/DescriptionList.tsx +34 -0
  990. package/docs/src/components/DocsProviders.tsx +19 -0
  991. package/docs/src/components/GhostButton.css +43 -0
  992. package/docs/src/components/GhostButton.tsx +18 -0
  993. package/docs/src/components/GoogleAnalytics.tsx +32 -0
  994. package/docs/src/components/Header.css +184 -0
  995. package/docs/src/components/Header.tsx +101 -0
  996. package/docs/src/components/HeadingLink.css +34 -0
  997. package/docs/src/components/HeadingLink.tsx +7 -0
  998. package/docs/src/components/InstallationBlock/InstallationBlock.css +105 -0
  999. package/docs/src/components/InstallationBlock/InstallationBlock.tsx +73 -0
  1000. package/docs/src/components/InstallationBlock/index.ts +1 -0
  1001. package/docs/src/components/InstallationBlock/model.ts +12 -0
  1002. package/docs/src/components/Kbd/Kbd.css +47 -0
  1003. package/docs/src/components/Kbd/Kbd.tsx +7 -0
  1004. package/docs/src/components/Kbd/rehypeKbd.mjs +14 -0
  1005. package/docs/src/components/Link.css +63 -0
  1006. package/docs/src/components/Link.tsx +54 -0
  1007. package/docs/src/components/Logo.tsx +10 -0
  1008. package/docs/src/components/Menu.css +87 -0
  1009. package/docs/src/components/Menu.tsx +37 -0
  1010. package/docs/src/components/MobileNav.css +273 -0
  1011. package/docs/src/components/MobileNav.tsx +218 -0
  1012. package/docs/src/components/Popup.css +30 -0
  1013. package/docs/src/components/Popup.tsx +7 -0
  1014. package/docs/src/components/QuickNav/QuickNav.css +134 -0
  1015. package/docs/src/components/QuickNav/QuickNav.tsx +71 -0
  1016. package/docs/src/components/QuickNav/rehypeConcatHeadings.mjs +36 -0
  1017. package/docs/src/components/QuickNav/rehypeQuickNav.mjs +134 -0
  1018. package/docs/src/components/QuickNav/rehypeSlug.mjs +70 -0
  1019. package/docs/src/components/QuickNav/remarkQuickNavExcludeHeading.mjs +31 -0
  1020. package/docs/src/components/ReferenceTable/AdditionalTypes.tsx +77 -0
  1021. package/docs/src/components/ReferenceTable/AttributesReferenceTable.tsx +92 -0
  1022. package/docs/src/components/ReferenceTable/CssVariablesReferenceTable.tsx +93 -0
  1023. package/docs/src/components/ReferenceTable/MethodsReferenceAccordion.tsx +147 -0
  1024. package/docs/src/components/ReferenceTable/ParametersReferenceTable.tsx +35 -0
  1025. package/docs/src/components/ReferenceTable/PropertiesReferenceAccordion.tsx +139 -0
  1026. package/docs/src/components/ReferenceTable/ReferenceAccordion.tsx +168 -0
  1027. package/docs/src/components/ReferenceTable/ReferenceTable.css +391 -0
  1028. package/docs/src/components/ReferenceTable/ReferenceTable.tsx +264 -0
  1029. package/docs/src/components/ReleaseTimeline/ReleaseTimeline.css +219 -0
  1030. package/docs/src/components/ReleaseTimeline/ReleaseTimeline.tsx +54 -0
  1031. package/docs/src/components/ReleaseTimeline/index.tsx +1 -0
  1032. package/docs/src/components/ScrollArea.css +92 -0
  1033. package/docs/src/components/ScrollArea.tsx +21 -0
  1034. package/docs/src/components/Search/Search.css +329 -0
  1035. package/docs/src/components/Search/Search.tsx +73 -0
  1036. package/docs/src/components/Search/SearchBar.tsx +450 -0
  1037. package/docs/src/components/Search/index.ts +1 -0
  1038. package/docs/src/components/SearchTrigger.css +57 -0
  1039. package/docs/src/components/SearchTrigger.tsx +40 -0
  1040. package/docs/src/components/Select.css +91 -0
  1041. package/docs/src/components/Select.tsx +40 -0
  1042. package/docs/src/components/SideNav.css +202 -0
  1043. package/docs/src/components/SideNav.tsx +122 -0
  1044. package/docs/src/components/SkipNav.css +38 -0
  1045. package/docs/src/components/SkipNav.tsx +10 -0
  1046. package/docs/src/components/Subtitle/MarkdownLink.tsx +22 -0
  1047. package/docs/src/components/Subtitle/Subtitle.css +65 -0
  1048. package/docs/src/components/Subtitle/Subtitle.tsx +21 -0
  1049. package/docs/src/components/Subtitle/ViewSourceLink.tsx +51 -0
  1050. package/docs/src/components/Subtitle/rehypeSubtitle.mjs +19 -0
  1051. package/docs/src/components/Table.css +90 -0
  1052. package/docs/src/components/Table.tsx +61 -0
  1053. package/docs/src/components/TableCode.css +6 -0
  1054. package/docs/src/components/TableCode.tsx +10 -0
  1055. package/docs/src/components/TypePropRef/TypePropRef.css +8 -0
  1056. package/docs/src/components/TypePropRef/TypePropRef.tsx +33 -0
  1057. package/docs/src/components/TypePropRef/index.ts +1 -0
  1058. package/docs/src/components/TypeRef/TypeRef.css +87 -0
  1059. package/docs/src/components/TypeRef/TypeRef.tsx +103 -0
  1060. package/docs/src/components/TypeRef/index.ts +1 -0
  1061. package/docs/src/css/README.md +3 -0
  1062. package/docs/src/css/custom-media.css +9 -0
  1063. package/docs/src/css/fonts/index.css +41 -0
  1064. package/docs/src/css/index.css +452 -0
  1065. package/docs/src/css/mdx-components.css +110 -0
  1066. package/docs/src/css/syntax.css +299 -0
  1067. package/docs/src/css/utilities/align-items.css +13 -0
  1068. package/docs/src/css/utilities/box-sizing.css +5 -0
  1069. package/docs/src/css/utilities/display.css +87 -0
  1070. package/docs/src/css/utilities/flex-direction.css +5 -0
  1071. package/docs/src/css/utilities/flex-wrap.css +9 -0
  1072. package/docs/src/css/utilities/font-weight.css +9 -0
  1073. package/docs/src/css/utilities/gap.css +179 -0
  1074. package/docs/src/css/utilities/grid-auto-rows.css +5 -0
  1075. package/docs/src/css/utilities/grid-column-end.css +227 -0
  1076. package/docs/src/css/utilities/grid-column-start.css +247 -0
  1077. package/docs/src/css/utilities/grid-template-columns.css +107 -0
  1078. package/docs/src/css/utilities/height.css +5 -0
  1079. package/docs/src/css/utilities/index.css +25 -0
  1080. package/docs/src/css/utilities/justify-content.css +17 -0
  1081. package/docs/src/css/utilities/left.css +5 -0
  1082. package/docs/src/css/utilities/margin.css +25 -0
  1083. package/docs/src/css/utilities/outline.css +5 -0
  1084. package/docs/src/css/utilities/padding.css +211 -0
  1085. package/docs/src/css/utilities/position.css +5 -0
  1086. package/docs/src/css/utilities/scroll-margin-top.css +5 -0
  1087. package/docs/src/css/utilities/text-align.css +13 -0
  1088. package/docs/src/css/utilities/top.css +5 -0
  1089. package/docs/src/css/utilities/visibility.css +5 -0
  1090. package/docs/src/css/utilities/visually-hidden.css +13 -0
  1091. package/docs/src/css/utilities/white-space.css +5 -0
  1092. package/docs/src/css/utilities/width.css +9 -0
  1093. package/docs/src/data/releases.ts +283 -0
  1094. package/docs/src/demo-data/theme/css-modules/theme.css +33 -0
  1095. package/docs/src/error-codes.json +99 -0
  1096. package/docs/src/icons/ArrowRightIcon.tsx +15 -0
  1097. package/docs/src/icons/CaretSortIcon.tsx +9 -0
  1098. package/docs/src/icons/CheckIcon.tsx +9 -0
  1099. package/docs/src/icons/CopyIcon.tsx +9 -0
  1100. package/docs/src/icons/ExternalLinkIcon.tsx +10 -0
  1101. package/docs/src/icons/GitHubIcon.tsx +9 -0
  1102. package/docs/src/icons/MagnifyingGlassIcon.tsx +19 -0
  1103. package/docs/src/icons/MarkdownIcon.tsx +12 -0
  1104. package/docs/src/icons/MoreVertIcon.tsx +9 -0
  1105. package/docs/src/icons/NpmIcon.tsx +11 -0
  1106. package/docs/src/mdx/createHast.mjs +10 -0
  1107. package/docs/src/mdx/createMdxComponent.ts +14 -0
  1108. package/docs/src/mdx/createMdxElement.mjs +58 -0
  1109. package/docs/src/mdx-components.tsx +89 -0
  1110. package/docs/src/utils/camelToSentenceCase.ts +14 -0
  1111. package/docs/src/utils/createDemo.ts +29 -0
  1112. package/docs/src/utils/createTypes.tsx +55 -0
  1113. package/docs/src/utils/demoExportOptions.test.ts +201 -0
  1114. package/docs/src/utils/demoExportOptions.ts +751 -0
  1115. package/docs/src/utils/getGitHubDemoUrl.test.ts +58 -0
  1116. package/docs/src/utils/getGitHubDemoUrl.ts +43 -0
  1117. package/docs/src/utils/observeScrollableInner.ts +36 -0
  1118. package/docs/src/utils/typeOrder.mjs +209 -0
  1119. package/docs/tsconfig.json +47 -0
  1120. package/docs/types.d.ts +18 -0
  1121. package/docs/vitest.config.mts +19 -0
  1122. package/eslint.config.mjs +201 -0
  1123. package/examples/tanstack-start-tailwind-css/.devcontainer/devcontainer.json +4 -0
  1124. package/examples/tanstack-start-tailwind-css/.prettierignore +4 -0
  1125. package/examples/tanstack-start-tailwind-css/.vscode/settings.json +11 -0
  1126. package/examples/tanstack-start-tailwind-css/README.md +57 -0
  1127. package/examples/tanstack-start-tailwind-css/eslint.config.js +13 -0
  1128. package/examples/tanstack-start-tailwind-css/package.json +40 -0
  1129. package/examples/tanstack-start-tailwind-css/prettier.config.js +14 -0
  1130. package/examples/tanstack-start-tailwind-css/public/favicon.ico +0 -0
  1131. package/examples/tanstack-start-tailwind-css/public/logo192.png +0 -0
  1132. package/examples/tanstack-start-tailwind-css/public/logo512.png +0 -0
  1133. package/examples/tanstack-start-tailwind-css/public/manifest.json +25 -0
  1134. package/examples/tanstack-start-tailwind-css/public/robots.txt +3 -0
  1135. package/examples/tanstack-start-tailwind-css/public/tanstack-circle-logo.png +0 -0
  1136. package/examples/tanstack-start-tailwind-css/src/components/button.tsx +15 -0
  1137. package/examples/tanstack-start-tailwind-css/src/components/combobox.tsx +120 -0
  1138. package/examples/tanstack-start-tailwind-css/src/components/dialog.tsx +67 -0
  1139. package/examples/tanstack-start-tailwind-css/src/components/input.tsx +21 -0
  1140. package/examples/tanstack-start-tailwind-css/src/components/link.tsx +19 -0
  1141. package/examples/tanstack-start-tailwind-css/src/components/menu.tsx +109 -0
  1142. package/examples/tanstack-start-tailwind-css/src/components/navigation-menu.tsx +177 -0
  1143. package/examples/tanstack-start-tailwind-css/src/components/popover.tsx +78 -0
  1144. package/examples/tanstack-start-tailwind-css/src/components/toggle.tsx +21 -0
  1145. package/examples/tanstack-start-tailwind-css/src/routeTree.gen.ts +86 -0
  1146. package/examples/tanstack-start-tailwind-css/src/router.tsx +16 -0
  1147. package/examples/tanstack-start-tailwind-css/src/routes/__root.tsx +59 -0
  1148. package/examples/tanstack-start-tailwind-css/src/routes/combobox-server-fn.tsx +91 -0
  1149. package/examples/tanstack-start-tailwind-css/src/routes/index.tsx +153 -0
  1150. package/examples/tanstack-start-tailwind-css/src/styles.css +17 -0
  1151. package/examples/tanstack-start-tailwind-css/tsconfig.json +29 -0
  1152. package/examples/tanstack-start-tailwind-css/vite.config.ts +14 -0
  1153. package/examples/vite-css/README.md +46 -0
  1154. package/examples/vite-css/eslint.config.js +25 -0
  1155. package/examples/vite-css/index.html +14 -0
  1156. package/examples/vite-css/package.json +30 -0
  1157. package/examples/vite-css/src/App.css +52 -0
  1158. package/examples/vite-css/src/App.tsx +39 -0
  1159. package/examples/vite-css/src/assets/base-ui.svg +5 -0
  1160. package/examples/vite-css/src/assets/react.svg +1 -0
  1161. package/examples/vite-css/src/assets/vite.svg +1 -0
  1162. package/examples/vite-css/src/index.css +105 -0
  1163. package/examples/vite-css/src/main.tsx +10 -0
  1164. package/examples/vite-css/src/vite-env.d.ts +1 -0
  1165. package/examples/vite-css/src/widgets/Switch.module.css +89 -0
  1166. package/examples/vite-css/src/widgets/Switch.tsx +13 -0
  1167. package/examples/vite-css/tsconfig.app.json +27 -0
  1168. package/examples/vite-css/tsconfig.json +4 -0
  1169. package/examples/vite-css/tsconfig.node.json +25 -0
  1170. package/examples/vite-css/vite.config.ts +7 -0
  1171. package/greptile.json +3 -0
  1172. package/lerna.json +5 -0
  1173. package/my_docs/vanilla-extract-setup.md +82 -0
  1174. package/netlify/functions/deploy-succeeded.js +41 -0
  1175. package/netlify.toml +13 -0
  1176. package/nx.json +10 -0
  1177. package/package.json +118 -0
  1178. package/packages/react/README.md +47 -0
  1179. package/packages/react/package.json +173 -0
  1180. package/packages/react/scripts/stagePublishedDocs.mjs +29 -0
  1181. package/packages/react/src/accordion/header/AccordionHeader.test.tsx +16 -0
  1182. package/packages/react/src/accordion/header/AccordionHeader.tsx +40 -0
  1183. package/packages/react/src/accordion/header/AccordionHeaderDataAttributes.ts +15 -0
  1184. package/packages/react/src/accordion/index.parts.ts +5 -0
  1185. package/packages/react/src/accordion/index.ts +7 -0
  1186. package/packages/react/src/accordion/item/AccordionItem.test.tsx +45 -0
  1187. package/packages/react/src/accordion/item/AccordionItem.tsx +199 -0
  1188. package/packages/react/src/accordion/item/AccordionItemContext.ts +24 -0
  1189. package/packages/react/src/accordion/item/AccordionItemDataAttributes.ts +15 -0
  1190. package/packages/react/src/accordion/item/stateAttributesMapping.ts +14 -0
  1191. package/packages/react/src/accordion/panel/AccordionPanel.test.tsx +253 -0
  1192. package/packages/react/src/accordion/panel/AccordionPanel.tsx +158 -0
  1193. package/packages/react/src/accordion/panel/AccordionPanelCssVars.ts +12 -0
  1194. package/packages/react/src/accordion/panel/AccordionPanelDataAttributes.ts +29 -0
  1195. package/packages/react/src/accordion/root/AccordionRoot.spec.tsx +63 -0
  1196. package/packages/react/src/accordion/root/AccordionRoot.test.tsx +865 -0
  1197. package/packages/react/src/accordion/root/AccordionRoot.tsx +251 -0
  1198. package/packages/react/src/accordion/root/AccordionRootContext.ts +30 -0
  1199. package/packages/react/src/accordion/root/AccordionRootDataAttributes.ts +10 -0
  1200. package/packages/react/src/accordion/trigger/AccordionTrigger.test.tsx +38 -0
  1201. package/packages/react/src/accordion/trigger/AccordionTrigger.tsx +79 -0
  1202. package/packages/react/src/accordion/trigger/AccordionTriggerDataAttributes.ts +10 -0
  1203. package/packages/react/src/alert-dialog/handle.ts +32 -0
  1204. package/packages/react/src/alert-dialog/index.parts.ts +10 -0
  1205. package/packages/react/src/alert-dialog/index.ts +33 -0
  1206. package/packages/react/src/alert-dialog/root/AlertDialogRoot.spec.tsx +42 -0
  1207. package/packages/react/src/alert-dialog/root/AlertDialogRoot.test.tsx +1144 -0
  1208. package/packages/react/src/alert-dialog/root/AlertDialogRoot.tsx +59 -0
  1209. package/packages/react/src/alert-dialog/trigger/AlertDialogTrigger.tsx +38 -0
  1210. package/packages/react/src/alert-dialog/trigger/AlertDialogTriggerDataAttributes.ts +12 -0
  1211. package/packages/react/src/autocomplete/clear/AutocompleteClearDataAttributes.ts +1 -0
  1212. package/packages/react/src/autocomplete/index.parts.ts +25 -0
  1213. package/packages/react/src/autocomplete/index.ts +73 -0
  1214. package/packages/react/src/autocomplete/input-group/AutocompleteInputGroup.tsx +53 -0
  1215. package/packages/react/src/autocomplete/input-group/AutocompleteInputGroupDataAttributes.ts +51 -0
  1216. package/packages/react/src/autocomplete/item/AutocompleteItem.test.tsx +101 -0
  1217. package/packages/react/src/autocomplete/item/AutocompleteItem.tsx +56 -0
  1218. package/packages/react/src/autocomplete/item/AutocompleteItemDataAttributes.ts +12 -0
  1219. package/packages/react/src/autocomplete/root/AutocompleteRoot.spec.tsx +117 -0
  1220. package/packages/react/src/autocomplete/root/AutocompleteRoot.test.tsx +2158 -0
  1221. package/packages/react/src/autocomplete/root/AutocompleteRoot.tsx +285 -0
  1222. package/packages/react/src/autocomplete/trigger/AutocompleteTrigger.tsx +53 -0
  1223. package/packages/react/src/autocomplete/trigger/AutocompleteTriggerDataAttributes.ts +57 -0
  1224. package/packages/react/src/autocomplete/value/AutocompleteValue.test.tsx +97 -0
  1225. package/packages/react/src/autocomplete/value/AutocompleteValue.tsx +37 -0
  1226. package/packages/react/src/avatar/Avatar.spec.tsx +31 -0
  1227. package/packages/react/src/avatar/fallback/AvatarFallback.test.tsx +271 -0
  1228. package/packages/react/src/avatar/fallback/AvatarFallback.tsx +64 -0
  1229. package/packages/react/src/avatar/image/AvatarImage.test.tsx +383 -0
  1230. package/packages/react/src/avatar/image/AvatarImage.tsx +108 -0
  1231. package/packages/react/src/avatar/image/AvatarImageDataAttributes.ts +12 -0
  1232. package/packages/react/src/avatar/image/useImageLoadingStatus.ts +65 -0
  1233. package/packages/react/src/avatar/index.parts.ts +3 -0
  1234. package/packages/react/src/avatar/index.ts +5 -0
  1235. package/packages/react/src/avatar/root/AvatarRoot.test.tsx +11 -0
  1236. package/packages/react/src/avatar/root/AvatarRoot.tsx +58 -0
  1237. package/packages/react/src/avatar/root/AvatarRootContext.ts +20 -0
  1238. package/packages/react/src/avatar/root/stateAttributesMapping.ts +3 -0
  1239. package/packages/react/src/button/Button.css.ts +170 -0
  1240. package/packages/react/src/button/Button.spec.tsx +10 -0
  1241. package/packages/react/src/button/Button.test.tsx +198 -0
  1242. package/packages/react/src/button/Button.tsx +140 -0
  1243. package/packages/react/src/button/ButtonDataAttributes.tsx +6 -0
  1244. package/packages/react/src/button/index.ts +3 -0
  1245. package/packages/react/src/checkbox/index.parts.ts +2 -0
  1246. package/packages/react/src/checkbox/index.ts +4 -0
  1247. package/packages/react/src/checkbox/indicator/CheckboxIndicator.test.tsx +293 -0
  1248. package/packages/react/src/checkbox/indicator/CheckboxIndicator.tsx +94 -0
  1249. package/packages/react/src/checkbox/indicator/CheckboxIndicatorDataAttributes.ts +60 -0
  1250. package/packages/react/src/checkbox/root/Checkbox.css.ts +76 -0
  1251. package/packages/react/src/checkbox/root/CheckboxRoot.test.tsx +1512 -0
  1252. package/packages/react/src/checkbox/root/CheckboxRoot.tsx +557 -0
  1253. package/packages/react/src/checkbox/root/CheckboxRootContext.ts +18 -0
  1254. package/packages/react/src/checkbox/root/CheckboxRootDataAttributes.ts +50 -0
  1255. package/packages/react/src/checkbox/utils/useStateAttributesMapping.ts +31 -0
  1256. package/packages/react/src/checkbox-group/CheckboxGroup.test.tsx +1027 -0
  1257. package/packages/react/src/checkbox-group/CheckboxGroup.tsx +207 -0
  1258. package/packages/react/src/checkbox-group/CheckboxGroupContext.ts +37 -0
  1259. package/packages/react/src/checkbox-group/CheckboxGroupDataAttributes.ts +6 -0
  1260. package/packages/react/src/checkbox-group/index.ts +2 -0
  1261. package/packages/react/src/checkbox-group/useCheckboxGroupParent.test.tsx +404 -0
  1262. package/packages/react/src/checkbox-group/useCheckboxGroupParent.ts +151 -0
  1263. package/packages/react/src/collapsible/index.parts.ts +3 -0
  1264. package/packages/react/src/collapsible/index.ts +5 -0
  1265. package/packages/react/src/collapsible/panel/CollapsiblePanel.test.tsx +1190 -0
  1266. package/packages/react/src/collapsible/panel/CollapsiblePanel.tsx +163 -0
  1267. package/packages/react/src/collapsible/panel/CollapsiblePanelCssVars.ts +12 -0
  1268. package/packages/react/src/collapsible/panel/CollapsiblePanelDataAttributes.ts +20 -0
  1269. package/packages/react/src/collapsible/panel/useCollapsiblePanel.ts +555 -0
  1270. package/packages/react/src/collapsible/root/CollapsibleRoot.spec.tsx +45 -0
  1271. package/packages/react/src/collapsible/root/CollapsibleRoot.test.tsx +384 -0
  1272. package/packages/react/src/collapsible/root/CollapsibleRoot.tsx +115 -0
  1273. package/packages/react/src/collapsible/root/CollapsibleRootContext.ts +24 -0
  1274. package/packages/react/src/collapsible/root/stateAttributesMapping.ts +9 -0
  1275. package/packages/react/src/collapsible/root/useCollapsibleRoot.ts +116 -0
  1276. package/packages/react/src/collapsible/trigger/CollapsibleTrigger.test.tsx +32 -0
  1277. package/packages/react/src/collapsible/trigger/CollapsibleTrigger.tsx +76 -0
  1278. package/packages/react/src/collapsible/trigger/CollapsibleTriggerDataAttributes.ts +6 -0
  1279. package/packages/react/src/combobox/arrow/ComboboxArrow.test.tsx +19 -0
  1280. package/packages/react/src/combobox/arrow/ComboboxArrow.tsx +72 -0
  1281. package/packages/react/src/combobox/arrow/ComboboxArrowDataAttributes.ts +26 -0
  1282. package/packages/react/src/combobox/backdrop/ComboboxBackdrop.test.tsx +17 -0
  1283. package/packages/react/src/combobox/backdrop/ComboboxBackdrop.tsx +75 -0
  1284. package/packages/react/src/combobox/backdrop/ComboboxBackdropDataAttributes.ts +20 -0
  1285. package/packages/react/src/combobox/chip/ComboboxChip.test.tsx +447 -0
  1286. package/packages/react/src/combobox/chip/ComboboxChip.tsx +152 -0
  1287. package/packages/react/src/combobox/chip/ComboboxChipContext.ts +18 -0
  1288. package/packages/react/src/combobox/chip-remove/ComboboxChipRemove.test.tsx +305 -0
  1289. package/packages/react/src/combobox/chip-remove/ComboboxChipRemove.tsx +146 -0
  1290. package/packages/react/src/combobox/chips/ComboboxChips.test.tsx +246 -0
  1291. package/packages/react/src/combobox/chips/ComboboxChips.tsx +78 -0
  1292. package/packages/react/src/combobox/chips/ComboboxChipsContext.ts +16 -0
  1293. package/packages/react/src/combobox/clear/ComboboxClear.test.tsx +252 -0
  1294. package/packages/react/src/combobox/clear/ComboboxClear.tsx +183 -0
  1295. package/packages/react/src/combobox/clear/ComboboxClearDataAttributes.ts +27 -0
  1296. package/packages/react/src/combobox/collection/ComboboxCollection.test.tsx +35 -0
  1297. package/packages/react/src/combobox/collection/ComboboxCollection.tsx +38 -0
  1298. package/packages/react/src/combobox/collection/GroupCollectionContext.tsx +31 -0
  1299. package/packages/react/src/combobox/empty/ComboboxEmpty.test.tsx +214 -0
  1300. package/packages/react/src/combobox/empty/ComboboxEmpty.tsx +56 -0
  1301. package/packages/react/src/combobox/group/ComboboxGroup.test.tsx +54 -0
  1302. package/packages/react/src/combobox/group/ComboboxGroup.tsx +66 -0
  1303. package/packages/react/src/combobox/group/ComboboxGroupContext.ts +26 -0
  1304. package/packages/react/src/combobox/group-label/ComboboxGroupLabel.test.tsx +60 -0
  1305. package/packages/react/src/combobox/group-label/ComboboxGroupLabel.tsx +50 -0
  1306. package/packages/react/src/combobox/icon/ComboboxIcon.test.tsx +13 -0
  1307. package/packages/react/src/combobox/icon/ComboboxIcon.tsx +39 -0
  1308. package/packages/react/src/combobox/index.parts.ts +30 -0
  1309. package/packages/react/src/combobox/index.ts +32 -0
  1310. package/packages/react/src/combobox/input/ComboboxInput.test.tsx +682 -0
  1311. package/packages/react/src/combobox/input/ComboboxInput.tsx +552 -0
  1312. package/packages/react/src/combobox/input/ComboboxInputDataAttributes.ts +57 -0
  1313. package/packages/react/src/combobox/input-group/ComboboxInputGroup.test.tsx +206 -0
  1314. package/packages/react/src/combobox/input-group/ComboboxInputGroup.tsx +116 -0
  1315. package/packages/react/src/combobox/input-group/ComboboxInputGroupDataAttributes.ts +55 -0
  1316. package/packages/react/src/combobox/item/ComboboxItem.test.tsx +519 -0
  1317. package/packages/react/src/combobox/item/ComboboxItem.tsx +328 -0
  1318. package/packages/react/src/combobox/item/ComboboxItemContext.ts +19 -0
  1319. package/packages/react/src/combobox/item/ComboboxItemDataAttributes.ts +14 -0
  1320. package/packages/react/src/combobox/item-indicator/ComboboxItemIndicator.test.tsx +17 -0
  1321. package/packages/react/src/combobox/item-indicator/ComboboxItemIndicator.tsx +107 -0
  1322. package/packages/react/src/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.ts +12 -0
  1323. package/packages/react/src/combobox/label/ComboboxLabel.test.tsx +25 -0
  1324. package/packages/react/src/combobox/label/ComboboxLabel.tsx +83 -0
  1325. package/packages/react/src/combobox/list/ComboboxList.test.tsx +34 -0
  1326. package/packages/react/src/combobox/list/ComboboxList.tsx +149 -0
  1327. package/packages/react/src/combobox/popup/ComboboxPopup.test.tsx +74 -0
  1328. package/packages/react/src/combobox/popup/ComboboxPopup.tsx +214 -0
  1329. package/packages/react/src/combobox/popup/ComboboxPopupDataAttributes.ts +39 -0
  1330. package/packages/react/src/combobox/portal/ComboboxPortal.test.tsx +14 -0
  1331. package/packages/react/src/combobox/portal/ComboboxPortal.tsx +52 -0
  1332. package/packages/react/src/combobox/portal/ComboboxPortalContext.tsx +12 -0
  1333. package/packages/react/src/combobox/positioner/ComboboxPositioner.test.tsx +144 -0
  1334. package/packages/react/src/combobox/positioner/ComboboxPositioner.tsx +171 -0
  1335. package/packages/react/src/combobox/positioner/ComboboxPositionerContext.tsx +30 -0
  1336. package/packages/react/src/combobox/positioner/ComboboxPositionerCssVars.ts +27 -0
  1337. package/packages/react/src/combobox/positioner/ComboboxPositionerDataAttributes.ts +30 -0
  1338. package/packages/react/src/combobox/root/AriaCombobox.tsx +1687 -0
  1339. package/packages/react/src/combobox/root/ComboboxRoot.spec.tsx +279 -0
  1340. package/packages/react/src/combobox/root/ComboboxRoot.test.tsx +7788 -0
  1341. package/packages/react/src/combobox/root/ComboboxRoot.tsx +176 -0
  1342. package/packages/react/src/combobox/root/ComboboxRootContext.tsx +62 -0
  1343. package/packages/react/src/combobox/root/utils/constants.ts +5 -0
  1344. package/packages/react/src/combobox/root/utils/index.ts +65 -0
  1345. package/packages/react/src/combobox/root/utils/useFilter.ts +55 -0
  1346. package/packages/react/src/combobox/root/utils/useFilteredItems.ts +9 -0
  1347. package/packages/react/src/combobox/row/ComboboxRow.tsx +35 -0
  1348. package/packages/react/src/combobox/row/ComboboxRowContext.ts +8 -0
  1349. package/packages/react/src/combobox/status/ComboboxStatus.iOS.test.tsx +49 -0
  1350. package/packages/react/src/combobox/status/ComboboxStatus.test.tsx +124 -0
  1351. package/packages/react/src/combobox/status/ComboboxStatus.tsx +47 -0
  1352. package/packages/react/src/combobox/store.ts +180 -0
  1353. package/packages/react/src/combobox/trigger/ComboboxTrigger.test.tsx +785 -0
  1354. package/packages/react/src/combobox/trigger/ComboboxTrigger.tsx +327 -0
  1355. package/packages/react/src/combobox/trigger/ComboboxTriggerDataAttributes.ts +61 -0
  1356. package/packages/react/src/combobox/utils/ComboboxInternalDismissButton.tsx +46 -0
  1357. package/packages/react/src/combobox/utils/handleInputPress.ts +39 -0
  1358. package/packages/react/src/combobox/utils/stateAttributesMapping.ts +17 -0
  1359. package/packages/react/src/combobox/utils/useInitialLiveRegionTextMutation.ts +65 -0
  1360. package/packages/react/src/combobox/value/ComboboxValue.test.tsx +900 -0
  1361. package/packages/react/src/combobox/value/ComboboxValue.tsx +58 -0
  1362. package/packages/react/src/context-menu/index.parts.ts +21 -0
  1363. package/packages/react/src/context-menu/index.ts +69 -0
  1364. package/packages/react/src/context-menu/root/ContextMenuRoot.non-mac.test.tsx +76 -0
  1365. package/packages/react/src/context-menu/root/ContextMenuRoot.test.tsx +283 -0
  1366. package/packages/react/src/context-menu/root/ContextMenuRoot.tsx +80 -0
  1367. package/packages/react/src/context-menu/root/ContextMenuRootContext.ts +33 -0
  1368. package/packages/react/src/context-menu/trigger/ContextMenuTrigger.test.tsx +343 -0
  1369. package/packages/react/src/context-menu/trigger/ContextMenuTrigger.tsx +218 -0
  1370. package/packages/react/src/context-menu/trigger/ContextMenuTriggerDataAttributes.ts +12 -0
  1371. package/packages/react/src/csp-provider/CSPProvider.test.tsx +76 -0
  1372. package/packages/react/src/csp-provider/CSPProvider.tsx +43 -0
  1373. package/packages/react/src/csp-provider/index.parts.ts +1 -0
  1374. package/packages/react/src/csp-provider/index.ts +3 -0
  1375. package/packages/react/src/dialog/backdrop/DialogBackdrop.test.tsx +149 -0
  1376. package/packages/react/src/dialog/backdrop/DialogBackdrop.tsx +81 -0
  1377. package/packages/react/src/dialog/backdrop/DialogBackdropDataAttributes.ts +20 -0
  1378. package/packages/react/src/dialog/close/DialogClose.test.tsx +117 -0
  1379. package/packages/react/src/dialog/close/DialogClose.tsx +65 -0
  1380. package/packages/react/src/dialog/close/DialogCloseDataAttributes.ts +6 -0
  1381. package/packages/react/src/dialog/description/DialogDescription.test.tsx +19 -0
  1382. package/packages/react/src/dialog/description/DialogDescription.tsx +39 -0
  1383. package/packages/react/src/dialog/index.parts.ts +10 -0
  1384. package/packages/react/src/dialog/index.ts +11 -0
  1385. package/packages/react/src/dialog/popup/DialogPopup.test.tsx +987 -0
  1386. package/packages/react/src/dialog/popup/DialogPopup.tsx +181 -0
  1387. package/packages/react/src/dialog/popup/DialogPopupCssVars.ts +7 -0
  1388. package/packages/react/src/dialog/popup/DialogPopupDataAttributes.ts +28 -0
  1389. package/packages/react/src/dialog/portal/DialogPortal.test.tsx +56 -0
  1390. package/packages/react/src/dialog/portal/DialogPortal.tsx +61 -0
  1391. package/packages/react/src/dialog/portal/DialogPortalContext.ts +12 -0
  1392. package/packages/react/src/dialog/root/DialogRoot.detached-triggers.test.tsx +791 -0
  1393. package/packages/react/src/dialog/root/DialogRoot.spec.tsx +28 -0
  1394. package/packages/react/src/dialog/root/DialogRoot.test.tsx +1718 -0
  1395. package/packages/react/src/dialog/root/DialogRoot.tsx +116 -0
  1396. package/packages/react/src/dialog/root/DialogRootContext.ts +25 -0
  1397. package/packages/react/src/dialog/root/useDialogRoot.ts +152 -0
  1398. package/packages/react/src/dialog/root/useRenderDialogRoot.tsx +93 -0
  1399. package/packages/react/src/dialog/store/DialogHandle.ts +83 -0
  1400. package/packages/react/src/dialog/store/DialogStore.ts +145 -0
  1401. package/packages/react/src/dialog/title/DialogTitle.test.tsx +19 -0
  1402. package/packages/react/src/dialog/title/DialogTitle.tsx +39 -0
  1403. package/packages/react/src/dialog/trigger/DialogTrigger.test.tsx +72 -0
  1404. package/packages/react/src/dialog/trigger/DialogTrigger.tsx +140 -0
  1405. package/packages/react/src/dialog/trigger/DialogTriggerDataAttributes.ts +12 -0
  1406. package/packages/react/src/dialog/viewport/DialogViewport.test.tsx +66 -0
  1407. package/packages/react/src/dialog/viewport/DialogViewport.tsx +101 -0
  1408. package/packages/react/src/dialog/viewport/DialogViewportDataAttributes.ts +28 -0
  1409. package/packages/react/src/direction-provider/DirectionProvider.spec.tsx +28 -0
  1410. package/packages/react/src/direction-provider/DirectionProvider.test.tsx +42 -0
  1411. package/packages/react/src/direction-provider/DirectionProvider.tsx +37 -0
  1412. package/packages/react/src/direction-provider/index.parts.ts +5 -0
  1413. package/packages/react/src/direction-provider/index.ts +2 -0
  1414. package/packages/react/src/drawer/backdrop/DrawerBackdrop.tsx +86 -0
  1415. package/packages/react/src/drawer/backdrop/DrawerBackdropCssVars.ts +7 -0
  1416. package/packages/react/src/drawer/backdrop/DrawerBackdropDataAttributes.ts +20 -0
  1417. package/packages/react/src/drawer/close/DrawerClose.tsx +31 -0
  1418. package/packages/react/src/drawer/content/DrawerContent.test.tsx +40 -0
  1419. package/packages/react/src/drawer/content/DrawerContent.tsx +35 -0
  1420. package/packages/react/src/drawer/content/DrawerContentDataAttributes.ts +1 -0
  1421. package/packages/react/src/drawer/description/DrawerDescription.tsx +25 -0
  1422. package/packages/react/src/drawer/indent/DrawerIndent.test.tsx +40 -0
  1423. package/packages/react/src/drawer/indent/DrawerIndent.tsx +102 -0
  1424. package/packages/react/src/drawer/indent-background/DrawerIndentBackground.test.tsx +39 -0
  1425. package/packages/react/src/drawer/indent-background/DrawerIndentBackground.tsx +59 -0
  1426. package/packages/react/src/drawer/index.parts.ts +19 -0
  1427. package/packages/react/src/drawer/index.ts +17 -0
  1428. package/packages/react/src/drawer/popup/DrawerPopup.test.tsx +586 -0
  1429. package/packages/react/src/drawer/popup/DrawerPopup.tsx +481 -0
  1430. package/packages/react/src/drawer/popup/DrawerPopupCssVars.ts +37 -0
  1431. package/packages/react/src/drawer/popup/DrawerPopupDataAttributes.ts +45 -0
  1432. package/packages/react/src/drawer/portal/DrawerPortal.tsx +38 -0
  1433. package/packages/react/src/drawer/provider/DrawerProvider.tsx +129 -0
  1434. package/packages/react/src/drawer/provider/DrawerProviderContext.ts +36 -0
  1435. package/packages/react/src/drawer/root/DrawerRoot.spec.tsx +39 -0
  1436. package/packages/react/src/drawer/root/DrawerRoot.test.tsx +1263 -0
  1437. package/packages/react/src/drawer/root/DrawerRoot.tsx +483 -0
  1438. package/packages/react/src/drawer/root/DrawerRootContext.ts +111 -0
  1439. package/packages/react/src/drawer/root/useDrawerSnapPoints.test.ts +18 -0
  1440. package/packages/react/src/drawer/root/useDrawerSnapPoints.ts +205 -0
  1441. package/packages/react/src/drawer/swipe-area/DrawerSwipeArea.test.tsx +522 -0
  1442. package/packages/react/src/drawer/swipe-area/DrawerSwipeArea.tsx +488 -0
  1443. package/packages/react/src/drawer/swipe-area/DrawerSwipeAreaDataAttributes.ts +25 -0
  1444. package/packages/react/src/drawer/title/DrawerTitle.tsx +25 -0
  1445. package/packages/react/src/drawer/trigger/DrawerTrigger.tsx +53 -0
  1446. package/packages/react/src/drawer/viewport/DrawerViewport.test.tsx +2524 -0
  1447. package/packages/react/src/drawer/viewport/DrawerViewport.tsx +1405 -0
  1448. package/packages/react/src/drawer/viewport/DrawerViewportContext.tsx +25 -0
  1449. package/packages/react/src/drawer/viewport/DrawerViewportCssVars.ts +8 -0
  1450. package/packages/react/src/drawer/viewport/DrawerViewportDataAttributes.ts +24 -0
  1451. package/packages/react/src/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.tsx +19 -0
  1452. package/packages/react/src/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.test.tsx +2053 -0
  1453. package/packages/react/src/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.tsx +644 -0
  1454. package/packages/react/src/field/control/FieldControl.spec.tsx +7 -0
  1455. package/packages/react/src/field/control/FieldControl.test.tsx +104 -0
  1456. package/packages/react/src/field/control/FieldControl.tsx +179 -0
  1457. package/packages/react/src/field/control/FieldControlDataAttributes.ts +30 -0
  1458. package/packages/react/src/field/description/FieldDescription.test.tsx +54 -0
  1459. package/packages/react/src/field/description/FieldDescription.tsx +65 -0
  1460. package/packages/react/src/field/description/FieldDescriptionDataAttributes.ts +30 -0
  1461. package/packages/react/src/field/error/FieldError.test.tsx +393 -0
  1462. package/packages/react/src/field/error/FieldError.tsx +158 -0
  1463. package/packages/react/src/field/error/FieldErrorDataAttributes.ts +40 -0
  1464. package/packages/react/src/field/index.parts.ts +9 -0
  1465. package/packages/react/src/field/index.ts +9 -0
  1466. package/packages/react/src/field/item/FieldItem.test.tsx +84 -0
  1467. package/packages/react/src/field/item/FieldItem.tsx +69 -0
  1468. package/packages/react/src/field/item/FieldItemContext.ts +14 -0
  1469. package/packages/react/src/field/item/FieldItemDataAttributes.ts +30 -0
  1470. package/packages/react/src/field/label/FieldLabel.test.tsx +128 -0
  1471. package/packages/react/src/field/label/FieldLabel.tsx +104 -0
  1472. package/packages/react/src/field/label/FieldLabelDataAttributes.ts +30 -0
  1473. package/packages/react/src/field/root/FieldRoot.test.tsx +1688 -0
  1474. package/packages/react/src/field/root/FieldRoot.tsx +344 -0
  1475. package/packages/react/src/field/root/FieldRootDataAttributes.ts +30 -0
  1476. package/packages/react/src/field/root/useFieldValidation.ts +363 -0
  1477. package/packages/react/src/field/utils/getCombinedFieldValidityData.ts +18 -0
  1478. package/packages/react/src/field/validity/FieldValidity.test.tsx +104 -0
  1479. package/packages/react/src/field/validity/FieldValidity.tsx +66 -0
  1480. package/packages/react/src/fieldset/index.parts.ts +2 -0
  1481. package/packages/react/src/fieldset/index.ts +4 -0
  1482. package/packages/react/src/fieldset/legend/FieldsetLegend.test.tsx +79 -0
  1483. package/packages/react/src/fieldset/legend/FieldsetLegend.tsx +57 -0
  1484. package/packages/react/src/fieldset/root/FieldsetRoot.test.tsx +66 -0
  1485. package/packages/react/src/fieldset/root/FieldsetRoot.tsx +72 -0
  1486. package/packages/react/src/fieldset/root/FieldsetRootContext.ts +22 -0
  1487. package/packages/react/src/floating-ui-react/components/FloatingDelayGroup.test.tsx +344 -0
  1488. package/packages/react/src/floating-ui-react/components/FloatingDelayGroup.tsx +286 -0
  1489. package/packages/react/src/floating-ui-react/components/FloatingFocusManager.test.tsx +2325 -0
  1490. package/packages/react/src/floating-ui-react/components/FloatingFocusManager.tsx +991 -0
  1491. package/packages/react/src/floating-ui-react/components/FloatingPortal.test.tsx +153 -0
  1492. package/packages/react/src/floating-ui-react/components/FloatingPortal.tsx +307 -0
  1493. package/packages/react/src/floating-ui-react/components/FloatingRootStore.ts +140 -0
  1494. package/packages/react/src/floating-ui-react/components/FloatingTree.tsx +95 -0
  1495. package/packages/react/src/floating-ui-react/components/FloatingTreeStore.ts +23 -0
  1496. package/packages/react/src/floating-ui-react/hooks/gridNavigation.ts +50 -0
  1497. package/packages/react/src/floating-ui-react/hooks/useClick.test.tsx +298 -0
  1498. package/packages/react/src/floating-ui-react/hooks/useClick.ts +226 -0
  1499. package/packages/react/src/floating-ui-react/hooks/useClientPoint.test.tsx +505 -0
  1500. package/packages/react/src/floating-ui-react/hooks/useClientPoint.ts +260 -0
  1501. package/packages/react/src/floating-ui-react/hooks/useDismiss.test.tsx +1217 -0
  1502. package/packages/react/src/floating-ui-react/hooks/useDismiss.ts +754 -0
  1503. package/packages/react/src/floating-ui-react/hooks/useFloating.test.tsx +42 -0
  1504. package/packages/react/src/floating-ui-react/hooks/useFloating.ts +184 -0
  1505. package/packages/react/src/floating-ui-react/hooks/useFloatingRootContext.ts +80 -0
  1506. package/packages/react/src/floating-ui-react/hooks/useFocus.ts +250 -0
  1507. package/packages/react/src/floating-ui-react/hooks/useHover.test.tsx +369 -0
  1508. package/packages/react/src/floating-ui-react/hooks/useHover.ts +467 -0
  1509. package/packages/react/src/floating-ui-react/hooks/useHoverFloatingInteraction.ts +273 -0
  1510. package/packages/react/src/floating-ui-react/hooks/useHoverInteractionSharedState.ts +131 -0
  1511. package/packages/react/src/floating-ui-react/hooks/useHoverReferenceInteraction.test.tsx +350 -0
  1512. package/packages/react/src/floating-ui-react/hooks/useHoverReferenceInteraction.ts +481 -0
  1513. package/packages/react/src/floating-ui-react/hooks/useHoverShared.ts +72 -0
  1514. package/packages/react/src/floating-ui-react/hooks/useListNavigation.test.tsx +1528 -0
  1515. package/packages/react/src/floating-ui-react/hooks/useListNavigation.ts +930 -0
  1516. package/packages/react/src/floating-ui-react/hooks/useSyncedFloatingRootContext.ts +101 -0
  1517. package/packages/react/src/floating-ui-react/hooks/useTypeahead.test.tsx +343 -0
  1518. package/packages/react/src/floating-ui-react/hooks/useTypeahead.ts +253 -0
  1519. package/packages/react/src/floating-ui-react/index.ts +41 -0
  1520. package/packages/react/src/floating-ui-react/middleware/arrow.ts +123 -0
  1521. package/packages/react/src/floating-ui-react/safePolygon.test.ts +340 -0
  1522. package/packages/react/src/floating-ui-react/safePolygon.ts +451 -0
  1523. package/packages/react/src/floating-ui-react/types.ts +202 -0
  1524. package/packages/react/src/floating-ui-react/utils/composite.test.ts +45 -0
  1525. package/packages/react/src/floating-ui-react/utils/composite.ts +518 -0
  1526. package/packages/react/src/floating-ui-react/utils/constants.ts +10 -0
  1527. package/packages/react/src/floating-ui-react/utils/createAttribute.ts +3 -0
  1528. package/packages/react/src/floating-ui-react/utils/createEventEmitter.ts +19 -0
  1529. package/packages/react/src/floating-ui-react/utils/element.ts +95 -0
  1530. package/packages/react/src/floating-ui-react/utils/enqueueFocus.ts +37 -0
  1531. package/packages/react/src/floating-ui-react/utils/event.ts +59 -0
  1532. package/packages/react/src/floating-ui-react/utils/getEmptyRootContext.ts +17 -0
  1533. package/packages/react/src/floating-ui-react/utils/markOthers.test.ts +310 -0
  1534. package/packages/react/src/floating-ui-react/utils/markOthers.ts +219 -0
  1535. package/packages/react/src/floating-ui-react/utils/nodes.test.ts +115 -0
  1536. package/packages/react/src/floating-ui-react/utils/nodes.ts +54 -0
  1537. package/packages/react/src/floating-ui-react/utils/tabbable.test.ts +378 -0
  1538. package/packages/react/src/floating-ui-react/utils/tabbable.ts +282 -0
  1539. package/packages/react/src/floating-ui-react/utils.ts +5 -0
  1540. package/packages/react/src/form/Form.spec.tsx +17 -0
  1541. package/packages/react/src/form/Form.test.tsx +752 -0
  1542. package/packages/react/src/form/Form.tsx +229 -0
  1543. package/packages/react/src/form/index.ts +3 -0
  1544. package/packages/react/src/global.d.ts +9 -0
  1545. package/packages/react/src/index.test.ts +60 -0
  1546. package/packages/react/src/index.ts +44 -0
  1547. package/packages/react/src/input/Input.spec.tsx +7 -0
  1548. package/packages/react/src/input/Input.test.tsx +12 -0
  1549. package/packages/react/src/input/Input.tsx +44 -0
  1550. package/packages/react/src/input/InputDataAttributes.ts +30 -0
  1551. package/packages/react/src/input/index.ts +3 -0
  1552. package/packages/react/src/internals/RequestQueue.test.ts +152 -0
  1553. package/packages/react/src/internals/RequestQueue.ts +126 -0
  1554. package/packages/react/src/internals/TimeoutManager.test.ts +76 -0
  1555. package/packages/react/src/internals/TimeoutManager.ts +29 -0
  1556. package/packages/react/src/internals/areArraysEqual.ts +12 -0
  1557. package/packages/react/src/internals/clamp.test.ts +10 -0
  1558. package/packages/react/src/internals/clamp.ts +7 -0
  1559. package/packages/react/src/internals/composite/composite.ts +182 -0
  1560. package/packages/react/src/internals/composite/constants.ts +1 -0
  1561. package/packages/react/src/internals/composite/index.ts +18 -0
  1562. package/packages/react/src/internals/composite/item/CompositeItem.tsx +59 -0
  1563. package/packages/react/src/internals/composite/item/useCompositeItem.ts +49 -0
  1564. package/packages/react/src/internals/composite/list/CompositeList.test.tsx +37 -0
  1565. package/packages/react/src/internals/composite/list/CompositeList.tsx +195 -0
  1566. package/packages/react/src/internals/composite/list/CompositeListContext.ts +25 -0
  1567. package/packages/react/src/internals/composite/list/useCompositeListItem.ts +103 -0
  1568. package/packages/react/src/internals/composite/root/CompositeRoot.test.tsx +1018 -0
  1569. package/packages/react/src/internals/composite/root/CompositeRoot.tsx +141 -0
  1570. package/packages/react/src/internals/composite/root/CompositeRootContext.ts +32 -0
  1571. package/packages/react/src/internals/composite/root/gridNavigation.ts +127 -0
  1572. package/packages/react/src/internals/composite/root/useCompositeRoot.ts +355 -0
  1573. package/packages/react/src/internals/constants.ts +41 -0
  1574. package/packages/react/src/internals/createBaseUIEventDetails.spec.ts +12 -0
  1575. package/packages/react/src/internals/createBaseUIEventDetails.ts +166 -0
  1576. package/packages/react/src/internals/csp-context/CSPContext.tsx +23 -0
  1577. package/packages/react/src/internals/csp-context/index.ts +2 -0
  1578. package/packages/react/src/internals/direction-context/DirectionContext.tsx +19 -0
  1579. package/packages/react/src/internals/direction-context/index.ts +2 -0
  1580. package/packages/react/src/internals/field-constants/constants.ts +48 -0
  1581. package/packages/react/src/internals/field-constants/index.ts +6 -0
  1582. package/packages/react/src/internals/field-register-control/index.ts +6 -0
  1583. package/packages/react/src/internals/field-register-control/useFieldControlRegistration.ts +169 -0
  1584. package/packages/react/src/internals/field-register-control/useRegisterFieldControl.ts +43 -0
  1585. package/packages/react/src/internals/field-root-context/FieldRootContext.ts +94 -0
  1586. package/packages/react/src/internals/field-root-context/index.ts +2 -0
  1587. package/packages/react/src/internals/filter.test.ts +11 -0
  1588. package/packages/react/src/internals/filter.ts +82 -0
  1589. package/packages/react/src/internals/form-context/FormContext.ts +48 -0
  1590. package/packages/react/src/internals/form-context/index.ts +2 -0
  1591. package/packages/react/src/internals/getStateAttributesProps.test.ts +83 -0
  1592. package/packages/react/src/internals/getStateAttributesProps.ts +32 -0
  1593. package/packages/react/src/internals/itemEquality.ts +60 -0
  1594. package/packages/react/src/internals/labelable-provider/LabelableContext.ts +42 -0
  1595. package/packages/react/src/internals/labelable-provider/LabelableProvider.tsx +116 -0
  1596. package/packages/react/src/internals/labelable-provider/index.ts +6 -0
  1597. package/packages/react/src/internals/labelable-provider/useAriaLabelledBy.ts +75 -0
  1598. package/packages/react/src/internals/labelable-provider/useLabel.ts +111 -0
  1599. package/packages/react/src/internals/labelable-provider/useLabelableId.ts +100 -0
  1600. package/packages/react/src/internals/noop.ts +1 -0
  1601. package/packages/react/src/internals/reason-parts.ts +42 -0
  1602. package/packages/react/src/internals/reasons.ts +5 -0
  1603. package/packages/react/src/internals/resolveValueLabel.test.ts +101 -0
  1604. package/packages/react/src/internals/resolveValueLabel.tsx +151 -0
  1605. package/packages/react/src/internals/serializeValue.ts +13 -0
  1606. package/packages/react/src/internals/shadowDom.ts +47 -0
  1607. package/packages/react/src/internals/stateAttributesMapping.ts +28 -0
  1608. package/packages/react/src/internals/temporal/index.ts +2 -0
  1609. package/packages/react/src/internals/temporal/temporal-adapter.ts +382 -0
  1610. package/packages/react/src/internals/temporal/temporal.ts +49 -0
  1611. package/packages/react/src/internals/temporal-adapter-date-fns/TemporalAdapterDateFns.test.ts +63 -0
  1612. package/packages/react/src/internals/temporal-adapter-date-fns/TemporalAdapterDateFns.ts +474 -0
  1613. package/packages/react/src/internals/temporal-adapter-date-fns/index.ts +1 -0
  1614. package/packages/react/src/internals/temporal-adapter-luxon/TemporalAdapterLuxon.test.ts +16 -0
  1615. package/packages/react/src/internals/temporal-adapter-luxon/TemporalAdapterLuxon.ts +380 -0
  1616. package/packages/react/src/internals/temporal-adapter-luxon/index.ts +1 -0
  1617. package/packages/react/src/internals/types.ts +97 -0
  1618. package/packages/react/src/internals/use-button/index.ts +1 -0
  1619. package/packages/react/src/internals/use-button/useButton.test.tsx +820 -0
  1620. package/packages/react/src/internals/use-button/useButton.ts +290 -0
  1621. package/packages/react/src/internals/useAnimationsFinished.ts +121 -0
  1622. package/packages/react/src/internals/useBaseUiId.ts +11 -0
  1623. package/packages/react/src/internals/useOpenChangeComplete.tsx +50 -0
  1624. package/packages/react/src/internals/usePressAndHold.ts +288 -0
  1625. package/packages/react/src/internals/useRenderElement.spec.tsx +38 -0
  1626. package/packages/react/src/internals/useRenderElement.test.tsx +588 -0
  1627. package/packages/react/src/internals/useRenderElement.tsx +287 -0
  1628. package/packages/react/src/internals/useTransitionStatus.ts +89 -0
  1629. package/packages/react/src/internals/useValueChanged.ts +21 -0
  1630. package/packages/react/src/menu/arrow/MenuArrow.test.tsx +21 -0
  1631. package/packages/react/src/menu/arrow/MenuArrow.tsx +69 -0
  1632. package/packages/react/src/menu/arrow/MenuArrowDataAttributes.ts +26 -0
  1633. package/packages/react/src/menu/backdrop/MenuBackdrop.test.tsx +55 -0
  1634. package/packages/react/src/menu/backdrop/MenuBackdrop.tsx +80 -0
  1635. package/packages/react/src/menu/backdrop/MenuBackdropDataAttributes.ts +20 -0
  1636. package/packages/react/src/menu/checkbox-item/MenuCheckboxItem.test.tsx +452 -0
  1637. package/packages/react/src/menu/checkbox-item/MenuCheckboxItem.tsx +180 -0
  1638. package/packages/react/src/menu/checkbox-item/MenuCheckboxItemContext.ts +23 -0
  1639. package/packages/react/src/menu/checkbox-item/MenuCheckboxItemDataAttributes.ts +18 -0
  1640. package/packages/react/src/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.test.tsx +131 -0
  1641. package/packages/react/src/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.tsx +92 -0
  1642. package/packages/react/src/menu/checkbox-item-indicator/MenuCheckboxItemIndicatorDataAttributes.ts +24 -0
  1643. package/packages/react/src/menu/group/MenuGroup.test.tsx +18 -0
  1644. package/packages/react/src/menu/group/MenuGroup.tsx +45 -0
  1645. package/packages/react/src/menu/group/MenuGroupContext.ts +17 -0
  1646. package/packages/react/src/menu/group-label/MenuGroupLabel.test.tsx +142 -0
  1647. package/packages/react/src/menu/group-label/MenuGroupLabel.tsx +49 -0
  1648. package/packages/react/src/menu/index.parts.ts +21 -0
  1649. package/packages/react/src/menu/index.ts +21 -0
  1650. package/packages/react/src/menu/item/MenuItem.test.tsx +257 -0
  1651. package/packages/react/src/menu/item/MenuItem.tsx +105 -0
  1652. package/packages/react/src/menu/item/MenuItemDataAttributes.ts +10 -0
  1653. package/packages/react/src/menu/item/useMenuItem.ts +144 -0
  1654. package/packages/react/src/menu/item/useMenuItemCommonProps.ts +136 -0
  1655. package/packages/react/src/menu/link-item/MenuLinkItem.test.tsx +167 -0
  1656. package/packages/react/src/menu/link-item/MenuLinkItem.tsx +100 -0
  1657. package/packages/react/src/menu/link-item/MenuLinkItemDataAttributes.ts +6 -0
  1658. package/packages/react/src/menu/popup/MenuPopup.test.tsx +214 -0
  1659. package/packages/react/src/menu/popup/MenuPopup.tsx +210 -0
  1660. package/packages/react/src/menu/popup/MenuPopupDataAttributes.ts +35 -0
  1661. package/packages/react/src/menu/portal/MenuPortal.test.tsx +14 -0
  1662. package/packages/react/src/menu/portal/MenuPortal.tsx +48 -0
  1663. package/packages/react/src/menu/portal/MenuPortalContext.ts +12 -0
  1664. package/packages/react/src/menu/positioner/MenuPositioner.spec.tsx +4 -0
  1665. package/packages/react/src/menu/positioner/MenuPositioner.test.tsx +662 -0
  1666. package/packages/react/src/menu/positioner/MenuPositioner.tsx +355 -0
  1667. package/packages/react/src/menu/positioner/MenuPositionerContext.ts +24 -0
  1668. package/packages/react/src/menu/positioner/MenuPositionerCssVars.ts +27 -0
  1669. package/packages/react/src/menu/positioner/MenuPositionerDataAttributes.ts +26 -0
  1670. package/packages/react/src/menu/radio-group/MenuRadioGroup.test.tsx +18 -0
  1671. package/packages/react/src/menu/radio-group/MenuRadioGroup.tsx +130 -0
  1672. package/packages/react/src/menu/radio-group/MenuRadioGroupContext.ts +24 -0
  1673. package/packages/react/src/menu/radio-item/MenuRadioItem.test.tsx +528 -0
  1674. package/packages/react/src/menu/radio-item/MenuRadioItem.tsx +152 -0
  1675. package/packages/react/src/menu/radio-item/MenuRadioItemContext.ts +23 -0
  1676. package/packages/react/src/menu/radio-item/MenuRadioItemDataAttributes.ts +18 -0
  1677. package/packages/react/src/menu/radio-item-indicator/MenuRadioItemIndicator.test.tsx +141 -0
  1678. package/packages/react/src/menu/radio-item-indicator/MenuRadioItemIndicator.tsx +92 -0
  1679. package/packages/react/src/menu/radio-item-indicator/MenuRadioItemIndicatorDataAttributes.ts +24 -0
  1680. package/packages/react/src/menu/root/MenuRoot.detached-triggers.test.tsx +1126 -0
  1681. package/packages/react/src/menu/root/MenuRoot.test.tsx +2761 -0
  1682. package/packages/react/src/menu/root/MenuRoot.tsx +684 -0
  1683. package/packages/react/src/menu/root/MenuRootContext.ts +24 -0
  1684. package/packages/react/src/menu/store/MenuHandle.ts +56 -0
  1685. package/packages/react/src/menu/store/MenuStore.ts +216 -0
  1686. package/packages/react/src/menu/submenu-root/MenuSubmenuRoot.tsx +65 -0
  1687. package/packages/react/src/menu/submenu-root/MenuSubmenuRootContext.ts +15 -0
  1688. package/packages/react/src/menu/submenu-trigger/MenuSubmenuTrigger.test.tsx +242 -0
  1689. package/packages/react/src/menu/submenu-trigger/MenuSubmenuTrigger.tsx +245 -0
  1690. package/packages/react/src/menu/submenu-trigger/MenuSubmenuTriggerDataAttributes.ts +16 -0
  1691. package/packages/react/src/menu/trigger/MenuTrigger.test.tsx +468 -0
  1692. package/packages/react/src/menu/trigger/MenuTrigger.tsx +417 -0
  1693. package/packages/react/src/menu/trigger/MenuTriggerDataAttributes.ts +12 -0
  1694. package/packages/react/src/menu/utils/findRootOwnerId.ts +13 -0
  1695. package/packages/react/src/menu/utils/stateAttributesMapping.ts +17 -0
  1696. package/packages/react/src/menu/utils/types.ts +8 -0
  1697. package/packages/react/src/menu/viewport/MenuViewport.test.tsx +410 -0
  1698. package/packages/react/src/menu/viewport/MenuViewport.tsx +85 -0
  1699. package/packages/react/src/menu/viewport/MenuViewportCssVars.ts +14 -0
  1700. package/packages/react/src/menu/viewport/MenuViewportDataAttributes.ts +26 -0
  1701. package/packages/react/src/menubar/Menubar.test.tsx +1342 -0
  1702. package/packages/react/src/menubar/Menubar.tsx +169 -0
  1703. package/packages/react/src/menubar/MenubarContext.ts +30 -0
  1704. package/packages/react/src/menubar/MenubarDataAttributes.ts +15 -0
  1705. package/packages/react/src/menubar/index.ts +3 -0
  1706. package/packages/react/src/merge-props/index.ts +1 -0
  1707. package/packages/react/src/merge-props/mergeProps.test.ts +599 -0
  1708. package/packages/react/src/merge-props/mergeProps.ts +296 -0
  1709. package/packages/react/src/meter/index.parts.ts +5 -0
  1710. package/packages/react/src/meter/index.ts +7 -0
  1711. package/packages/react/src/meter/indicator/MeterIndicator.test.tsx +89 -0
  1712. package/packages/react/src/meter/indicator/MeterIndicator.tsx +44 -0
  1713. package/packages/react/src/meter/label/MeterLabel.test.tsx +13 -0
  1714. package/packages/react/src/meter/label/MeterLabel.tsx +44 -0
  1715. package/packages/react/src/meter/root/MeterRoot.test.tsx +262 -0
  1716. package/packages/react/src/meter/root/MeterRoot.tsx +129 -0
  1717. package/packages/react/src/meter/root/MeterRootContext.ts +27 -0
  1718. package/packages/react/src/meter/track/MeterTrack.test.tsx +13 -0
  1719. package/packages/react/src/meter/track/MeterTrack.tsx +32 -0
  1720. package/packages/react/src/meter/value/MeterValue.test.tsx +87 -0
  1721. package/packages/react/src/meter/value/MeterValue.tsx +46 -0
  1722. package/packages/react/src/navigation-menu/arrow/NavigationMenuArrow.test.tsx +19 -0
  1723. package/packages/react/src/navigation-menu/arrow/NavigationMenuArrow.tsx +75 -0
  1724. package/packages/react/src/navigation-menu/arrow/NavigationMenuArrowDataAttributes.ts +26 -0
  1725. package/packages/react/src/navigation-menu/backdrop/NavigationMenuBackdrop.test.tsx +13 -0
  1726. package/packages/react/src/navigation-menu/backdrop/NavigationMenuBackdrop.tsx +74 -0
  1727. package/packages/react/src/navigation-menu/backdrop/NavigationMenuBackdropDataAttributes.ts +20 -0
  1728. package/packages/react/src/navigation-menu/content/NavigationMenuContent.test.tsx +221 -0
  1729. package/packages/react/src/navigation-menu/content/NavigationMenuContent.tsx +205 -0
  1730. package/packages/react/src/navigation-menu/content/NavigationMenuContentDataAttributes.ts +25 -0
  1731. package/packages/react/src/navigation-menu/icon/NavigationMenuIcon.test.tsx +17 -0
  1732. package/packages/react/src/navigation-menu/icon/NavigationMenuIcon.tsx +54 -0
  1733. package/packages/react/src/navigation-menu/icon/NavigationMenuIconDataAttributes.ts +8 -0
  1734. package/packages/react/src/navigation-menu/index.parts.ts +13 -0
  1735. package/packages/react/src/navigation-menu/index.ts +15 -0
  1736. package/packages/react/src/navigation-menu/item/NavigationMenuItem.test.tsx +13 -0
  1737. package/packages/react/src/navigation-menu/item/NavigationMenuItem.tsx +57 -0
  1738. package/packages/react/src/navigation-menu/item/NavigationMenuItemContext.ts +20 -0
  1739. package/packages/react/src/navigation-menu/link/NavigationMenuLink.test.tsx +133 -0
  1740. package/packages/react/src/navigation-menu/link/NavigationMenuLink.tsx +105 -0
  1741. package/packages/react/src/navigation-menu/link/NavigationMenuLinkDataAttributes.ts +6 -0
  1742. package/packages/react/src/navigation-menu/list/NavigationMenuDismissContext.ts +11 -0
  1743. package/packages/react/src/navigation-menu/list/NavigationMenuList.test.tsx +13 -0
  1744. package/packages/react/src/navigation-menu/list/NavigationMenuList.tsx +142 -0
  1745. package/packages/react/src/navigation-menu/popup/NavigationMenuPopup.test.tsx +19 -0
  1746. package/packages/react/src/navigation-menu/popup/NavigationMenuPopup.tsx +111 -0
  1747. package/packages/react/src/navigation-menu/popup/NavigationMenuPopupCssVars.ts +12 -0
  1748. package/packages/react/src/navigation-menu/popup/NavigationMenuPopupDataAttributes.ts +34 -0
  1749. package/packages/react/src/navigation-menu/portal/NavigationMenuPortal.test.tsx +14 -0
  1750. package/packages/react/src/navigation-menu/portal/NavigationMenuPortal.tsx +51 -0
  1751. package/packages/react/src/navigation-menu/portal/NavigationMenuPortalContext.ts +12 -0
  1752. package/packages/react/src/navigation-menu/positioner/NavigationMenuPositioner.test.tsx +17 -0
  1753. package/packages/react/src/navigation-menu/positioner/NavigationMenuPositioner.tsx +219 -0
  1754. package/packages/react/src/navigation-menu/positioner/NavigationMenuPositionerContext.ts +25 -0
  1755. package/packages/react/src/navigation-menu/positioner/NavigationMenuPositionerCssVars.ts +37 -0
  1756. package/packages/react/src/navigation-menu/positioner/NavigationMenuPositionerDataAttributes.ts +30 -0
  1757. package/packages/react/src/navigation-menu/root/NavigationMenuRoot.spec.tsx +63 -0
  1758. package/packages/react/src/navigation-menu/root/NavigationMenuRoot.test.tsx +3769 -0
  1759. package/packages/react/src/navigation-menu/root/NavigationMenuRoot.tsx +439 -0
  1760. package/packages/react/src/navigation-menu/root/NavigationMenuRoot.webkit.test.tsx +140 -0
  1761. package/packages/react/src/navigation-menu/root/NavigationMenuRootContext.ts +83 -0
  1762. package/packages/react/src/navigation-menu/trigger/NavigationMenuTrigger.test.tsx +448 -0
  1763. package/packages/react/src/navigation-menu/trigger/NavigationMenuTrigger.tsx +914 -0
  1764. package/packages/react/src/navigation-menu/trigger/NavigationMenuTriggerDataAttributes.ts +12 -0
  1765. package/packages/react/src/navigation-menu/utils/constants.ts +3 -0
  1766. package/packages/react/src/navigation-menu/utils/isOutsideMenuEvent.ts +41 -0
  1767. package/packages/react/src/navigation-menu/utils/setSharedFixedSize.ts +20 -0
  1768. package/packages/react/src/navigation-menu/viewport/NavigationMenuViewport.test.tsx +13 -0
  1769. package/packages/react/src/navigation-menu/viewport/NavigationMenuViewport.tsx +144 -0
  1770. package/packages/react/src/number-field/decrement/NumberFieldDecrement.test.tsx +572 -0
  1771. package/packages/react/src/number-field/decrement/NumberFieldDecrement.tsx +28 -0
  1772. package/packages/react/src/number-field/decrement/NumberFieldDecrementDataAttributes.ts +42 -0
  1773. package/packages/react/src/number-field/group/NumberFieldGroup.test.tsx +24 -0
  1774. package/packages/react/src/number-field/group/NumberFieldGroup.tsx +40 -0
  1775. package/packages/react/src/number-field/group/NumberFieldGroupDataAttributes.ts +42 -0
  1776. package/packages/react/src/number-field/increment/NumberFieldIncrement.test.tsx +829 -0
  1777. package/packages/react/src/number-field/increment/NumberFieldIncrement.tsx +28 -0
  1778. package/packages/react/src/number-field/increment/NumberFieldIncrementDataAttributes.ts +42 -0
  1779. package/packages/react/src/number-field/index.parts.ts +7 -0
  1780. package/packages/react/src/number-field/index.ts +9 -0
  1781. package/packages/react/src/number-field/input/NumberFieldInput.test.tsx +1408 -0
  1782. package/packages/react/src/number-field/input/NumberFieldInput.tsx +485 -0
  1783. package/packages/react/src/number-field/input/NumberFieldInputDataAttributes.ts +42 -0
  1784. package/packages/react/src/number-field/root/NumberFieldRoot.spec.tsx +74 -0
  1785. package/packages/react/src/number-field/root/NumberFieldRoot.test.tsx +2595 -0
  1786. package/packages/react/src/number-field/root/NumberFieldRoot.tsx +718 -0
  1787. package/packages/react/src/number-field/root/NumberFieldRootContext.ts +57 -0
  1788. package/packages/react/src/number-field/root/NumberFieldRootDataAttributes.ts +42 -0
  1789. package/packages/react/src/number-field/root/useNumberFieldButton.ts +175 -0
  1790. package/packages/react/src/number-field/root/useNumberFieldStepperButton.ts +91 -0
  1791. package/packages/react/src/number-field/scrub-area/NumberFieldScrubArea.test.tsx +351 -0
  1792. package/packages/react/src/number-field/scrub-area/NumberFieldScrubArea.tsx +393 -0
  1793. package/packages/react/src/number-field/scrub-area/NumberFieldScrubAreaContext.ts +23 -0
  1794. package/packages/react/src/number-field/scrub-area/NumberFieldScrubAreaDataAttributes.ts +42 -0
  1795. package/packages/react/src/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.test.tsx +203 -0
  1796. package/packages/react/src/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.tsx +71 -0
  1797. package/packages/react/src/number-field/scrub-area-cursor/NumberFieldScrubAreaCursorDataAttributes.ts +42 -0
  1798. package/packages/react/src/number-field/utils/constants.ts +3 -0
  1799. package/packages/react/src/number-field/utils/getViewportRect.ts +34 -0
  1800. package/packages/react/src/number-field/utils/parse.test.ts +298 -0
  1801. package/packages/react/src/number-field/utils/parse.ts +252 -0
  1802. package/packages/react/src/number-field/utils/stateAttributesMapping.ts +9 -0
  1803. package/packages/react/src/number-field/utils/subscribeToVisualViewportResize.ts +24 -0
  1804. package/packages/react/src/number-field/utils/types.ts +24 -0
  1805. package/packages/react/src/number-field/utils/validate.test.ts +730 -0
  1806. package/packages/react/src/number-field/utils/validate.ts +151 -0
  1807. package/packages/react/src/otp-field/index.parts.ts +3 -0
  1808. package/packages/react/src/otp-field/index.ts +4 -0
  1809. package/packages/react/src/otp-field/input/OTPFieldInput.spec.tsx +5 -0
  1810. package/packages/react/src/otp-field/input/OTPFieldInput.test.tsx +811 -0
  1811. package/packages/react/src/otp-field/input/OTPFieldInput.tsx +356 -0
  1812. package/packages/react/src/otp-field/input/OTPFieldInputDataAttributes.ts +42 -0
  1813. package/packages/react/src/otp-field/root/OTPFieldRoot.spec.tsx +113 -0
  1814. package/packages/react/src/otp-field/root/OTPFieldRoot.test.tsx +1407 -0
  1815. package/packages/react/src/otp-field/root/OTPFieldRoot.tsx +680 -0
  1816. package/packages/react/src/otp-field/root/OTPFieldRootContext.ts +57 -0
  1817. package/packages/react/src/otp-field/root/OTPFieldRootDataAttributes.ts +42 -0
  1818. package/packages/react/src/otp-field/utils/otp.test.ts +94 -0
  1819. package/packages/react/src/otp-field/utils/otp.ts +118 -0
  1820. package/packages/react/src/otp-field/utils/stateAttributesMapping.ts +16 -0
  1821. package/packages/react/src/popover/arrow/PopoverArrow.test.tsx +22 -0
  1822. package/packages/react/src/popover/arrow/PopoverArrow.tsx +67 -0
  1823. package/packages/react/src/popover/arrow/PopoverArrowDataAttributes.ts +26 -0
  1824. package/packages/react/src/popover/backdrop/PopoverBackdrop.test.tsx +55 -0
  1825. package/packages/react/src/popover/backdrop/PopoverBackdrop.tsx +78 -0
  1826. package/packages/react/src/popover/backdrop/PopoverBackdropDataAttributes.ts +20 -0
  1827. package/packages/react/src/popover/close/PopoverClose.test.tsx +159 -0
  1828. package/packages/react/src/popover/close/PopoverClose.tsx +63 -0
  1829. package/packages/react/src/popover/description/PopoverDescription.test.tsx +42 -0
  1830. package/packages/react/src/popover/description/PopoverDescription.tsx +44 -0
  1831. package/packages/react/src/popover/index.parts.ts +15 -0
  1832. package/packages/react/src/popover/index.ts +13 -0
  1833. package/packages/react/src/popover/popup/PopoverPopup.test.tsx +623 -0
  1834. package/packages/react/src/popover/popup/PopoverPopup.tsx +200 -0
  1835. package/packages/react/src/popover/popup/PopoverPopupCssVars.ts +10 -0
  1836. package/packages/react/src/popover/popup/PopoverPopupDataAttributes.ts +35 -0
  1837. package/packages/react/src/popover/portal/PopoverPortal.test.tsx +14 -0
  1838. package/packages/react/src/popover/portal/PopoverPortal.tsx +48 -0
  1839. package/packages/react/src/popover/portal/PopoverPortalContext.ts +12 -0
  1840. package/packages/react/src/popover/positioner/PopoverPositioner.spec.tsx +4 -0
  1841. package/packages/react/src/popover/positioner/PopoverPositioner.test.tsx +478 -0
  1842. package/packages/react/src/popover/positioner/PopoverPositioner.tsx +200 -0
  1843. package/packages/react/src/popover/positioner/PopoverPositionerContext.ts +27 -0
  1844. package/packages/react/src/popover/positioner/PopoverPositionerCssVars.ts +37 -0
  1845. package/packages/react/src/popover/positioner/PopoverPositionerDataAttributes.ts +26 -0
  1846. package/packages/react/src/popover/root/PopoverRoot.detached-triggers.test.tsx +961 -0
  1847. package/packages/react/src/popover/root/PopoverRoot.spec.tsx +27 -0
  1848. package/packages/react/src/popover/root/PopoverRoot.test.tsx +2347 -0
  1849. package/packages/react/src/popover/root/PopoverRoot.tsx +249 -0
  1850. package/packages/react/src/popover/root/PopoverRootContext.ts +21 -0
  1851. package/packages/react/src/popover/store/PopoverHandle.ts +64 -0
  1852. package/packages/react/src/popover/store/PopoverStore.ts +216 -0
  1853. package/packages/react/src/popover/title/PopoverTitle.test.tsx +42 -0
  1854. package/packages/react/src/popover/title/PopoverTitle.tsx +44 -0
  1855. package/packages/react/src/popover/trigger/PopoverTrigger.test.tsx +411 -0
  1856. package/packages/react/src/popover/trigger/PopoverTrigger.tsx +233 -0
  1857. package/packages/react/src/popover/trigger/PopoverTriggerDataAttributes.ts +12 -0
  1858. package/packages/react/src/popover/utils/constants.ts +1 -0
  1859. package/packages/react/src/popover/viewport/PopoverViewport.test.tsx +494 -0
  1860. package/packages/react/src/popover/viewport/PopoverViewport.tsx +85 -0
  1861. package/packages/react/src/popover/viewport/PopoverViewportCssVars.ts +14 -0
  1862. package/packages/react/src/popover/viewport/PopoverViewportDataAttributes.ts +26 -0
  1863. package/packages/react/src/preview-card/arrow/PreviewCardArrow.test.tsx +21 -0
  1864. package/packages/react/src/preview-card/arrow/PreviewCardArrow.tsx +68 -0
  1865. package/packages/react/src/preview-card/arrow/PreviewCardArrowDataAttributes.ts +26 -0
  1866. package/packages/react/src/preview-card/backdrop/PreviewCardBackdrop.test.tsx +37 -0
  1867. package/packages/react/src/preview-card/backdrop/PreviewCardBackdrop.tsx +78 -0
  1868. package/packages/react/src/preview-card/backdrop/PreviewCardBackdropDataAttributes.ts +20 -0
  1869. package/packages/react/src/preview-card/index.parts.ts +12 -0
  1870. package/packages/react/src/preview-card/index.ts +10 -0
  1871. package/packages/react/src/preview-card/popup/PreviewCardPopup.test.tsx +35 -0
  1872. package/packages/react/src/preview-card/popup/PreviewCardPopup.tsx +105 -0
  1873. package/packages/react/src/preview-card/popup/PreviewCardPopupDataAttributes.ts +30 -0
  1874. package/packages/react/src/preview-card/portal/PreviewCardPortal.test.tsx +14 -0
  1875. package/packages/react/src/preview-card/portal/PreviewCardPortal.tsx +48 -0
  1876. package/packages/react/src/preview-card/portal/PreviewCardPortalContext.ts +12 -0
  1877. package/packages/react/src/preview-card/positioner/PreviewCardPositioner.spec.tsx +4 -0
  1878. package/packages/react/src/preview-card/positioner/PreviewCardPositioner.test.tsx +1103 -0
  1879. package/packages/react/src/preview-card/positioner/PreviewCardPositioner.tsx +144 -0
  1880. package/packages/react/src/preview-card/positioner/PreviewCardPositionerContext.ts +23 -0
  1881. package/packages/react/src/preview-card/positioner/PreviewCardPositionerCssVars.ts +27 -0
  1882. package/packages/react/src/preview-card/positioner/PreviewCardPositionerDataAttributes.ts +26 -0
  1883. package/packages/react/src/preview-card/root/PreviewCardContext.ts +22 -0
  1884. package/packages/react/src/preview-card/root/PreviewCardRoot.detached-triggers.test.tsx +1385 -0
  1885. package/packages/react/src/preview-card/root/PreviewCardRoot.spec.tsx +27 -0
  1886. package/packages/react/src/preview-card/root/PreviewCardRoot.test.tsx +1165 -0
  1887. package/packages/react/src/preview-card/root/PreviewCardRoot.tsx +210 -0
  1888. package/packages/react/src/preview-card/store/PreviewCardHandle.ts +65 -0
  1889. package/packages/react/src/preview-card/store/PreviewCardStore.ts +120 -0
  1890. package/packages/react/src/preview-card/trigger/PreviewCardTrigger.test.tsx +13 -0
  1891. package/packages/react/src/preview-card/trigger/PreviewCardTrigger.tsx +148 -0
  1892. package/packages/react/src/preview-card/trigger/PreviewCardTriggerDataAttributes.ts +8 -0
  1893. package/packages/react/src/preview-card/utils/constants.ts +2 -0
  1894. package/packages/react/src/preview-card/viewport/PreviewCardViewport.test.tsx +424 -0
  1895. package/packages/react/src/preview-card/viewport/PreviewCardViewport.tsx +88 -0
  1896. package/packages/react/src/preview-card/viewport/PreviewCardViewportCssVars.ts +14 -0
  1897. package/packages/react/src/preview-card/viewport/PreviewCardViewportDataAttributes.ts +26 -0
  1898. package/packages/react/src/progress/index.parts.ts +7 -0
  1899. package/packages/react/src/progress/index.ts +7 -0
  1900. package/packages/react/src/progress/indicator/ProgressIndicator.test.tsx +65 -0
  1901. package/packages/react/src/progress/indicator/ProgressIndicator.tsx +61 -0
  1902. package/packages/react/src/progress/indicator/ProgressIndicatorDataAttributes.ts +14 -0
  1903. package/packages/react/src/progress/label/ProgressLabel.test.tsx +13 -0
  1904. package/packages/react/src/progress/label/ProgressLabel.tsx +49 -0
  1905. package/packages/react/src/progress/label/ProgressLabelDataAttributes.ts +14 -0
  1906. package/packages/react/src/progress/root/ProgressRoot.test.tsx +106 -0
  1907. package/packages/react/src/progress/root/ProgressRoot.tsx +145 -0
  1908. package/packages/react/src/progress/root/ProgressRootContext.tsx +41 -0
  1909. package/packages/react/src/progress/root/ProgressRootDataAttributes.ts +14 -0
  1910. package/packages/react/src/progress/root/stateAttributesMapping.ts +18 -0
  1911. package/packages/react/src/progress/track/ProgressTrack.test.tsx +13 -0
  1912. package/packages/react/src/progress/track/ProgressTrack.tsx +40 -0
  1913. package/packages/react/src/progress/track/ProgressTrackDataAttributes.ts +14 -0
  1914. package/packages/react/src/progress/value/ProgressValue.test.tsx +82 -0
  1915. package/packages/react/src/progress/value/ProgressValue.tsx +59 -0
  1916. package/packages/react/src/progress/value/ProgressValueDataAttributes.ts +14 -0
  1917. package/packages/react/src/radio/index.parts.ts +2 -0
  1918. package/packages/react/src/radio/index.ts +4 -0
  1919. package/packages/react/src/radio/indicator/RadioIndicator.test.tsx +237 -0
  1920. package/packages/react/src/radio/indicator/RadioIndicator.tsx +80 -0
  1921. package/packages/react/src/radio/indicator/RadioIndicatorDataAttributes.ts +56 -0
  1922. package/packages/react/src/radio/root/RadioRoot.spec.tsx +12 -0
  1923. package/packages/react/src/radio/root/RadioRoot.test.tsx +135 -0
  1924. package/packages/react/src/radio/root/RadioRoot.tsx +352 -0
  1925. package/packages/react/src/radio/root/RadioRootContext.ts +18 -0
  1926. package/packages/react/src/radio/root/RadioRootDataAttributes.ts +46 -0
  1927. package/packages/react/src/radio/utils/stateAttributesMapping.ts +20 -0
  1928. package/packages/react/src/radio-group/RadioGroup.spec.tsx +57 -0
  1929. package/packages/react/src/radio-group/RadioGroup.test.tsx +1396 -0
  1930. package/packages/react/src/radio-group/RadioGroup.tsx +338 -0
  1931. package/packages/react/src/radio-group/RadioGroupContext.ts +29 -0
  1932. package/packages/react/src/radio-group/RadioGroupDataAttributes.ts +6 -0
  1933. package/packages/react/src/radio-group/index.ts +3 -0
  1934. package/packages/react/src/scroll-area/constants.ts +2 -0
  1935. package/packages/react/src/scroll-area/content/ScrollAreaContent.test.tsx +18 -0
  1936. package/packages/react/src/scroll-area/content/ScrollAreaContent.tsx +88 -0
  1937. package/packages/react/src/scroll-area/content/ScrollAreaContentDataAttributes.ts +30 -0
  1938. package/packages/react/src/scroll-area/corner/ScrollAreaCorner.test.tsx +72 -0
  1939. package/packages/react/src/scroll-area/corner/ScrollAreaCorner.tsx +51 -0
  1940. package/packages/react/src/scroll-area/index.parts.ts +6 -0
  1941. package/packages/react/src/scroll-area/index.ts +8 -0
  1942. package/packages/react/src/scroll-area/root/ScrollAreaRoot.test.tsx +883 -0
  1943. package/packages/react/src/scroll-area/root/ScrollAreaRoot.tsx +404 -0
  1944. package/packages/react/src/scroll-area/root/ScrollAreaRootContext.ts +62 -0
  1945. package/packages/react/src/scroll-area/root/ScrollAreaRootCssVars.ts +12 -0
  1946. package/packages/react/src/scroll-area/root/ScrollAreaRootDataAttributes.ts +30 -0
  1947. package/packages/react/src/scroll-area/root/stateAttributes.ts +13 -0
  1948. package/packages/react/src/scroll-area/scrollbar/ScrollAreaScrollbar.test.tsx +573 -0
  1949. package/packages/react/src/scroll-area/scrollbar/ScrollAreaScrollbar.tsx +288 -0
  1950. package/packages/react/src/scroll-area/scrollbar/ScrollAreaScrollbarContext.ts +20 -0
  1951. package/packages/react/src/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.ts +12 -0
  1952. package/packages/react/src/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.ts +39 -0
  1953. package/packages/react/src/scroll-area/thumb/ScrollAreaThumb.test.tsx +227 -0
  1954. package/packages/react/src/scroll-area/thumb/ScrollAreaThumb.tsx +93 -0
  1955. package/packages/react/src/scroll-area/thumb/ScrollAreaThumbDataAttributes.ts +11 -0
  1956. package/packages/react/src/scroll-area/utils/getOffset.ts +22 -0
  1957. package/packages/react/src/scroll-area/viewport/ScrollAreaViewport.test.tsx +111 -0
  1958. package/packages/react/src/scroll-area/viewport/ScrollAreaViewport.tsx +482 -0
  1959. package/packages/react/src/scroll-area/viewport/ScrollAreaViewportContext.ts +20 -0
  1960. package/packages/react/src/scroll-area/viewport/ScrollAreaViewportCssVars.ts +22 -0
  1961. package/packages/react/src/scroll-area/viewport/ScrollAreaViewportDataAttributes.ts +30 -0
  1962. package/packages/react/src/select/arrow/SelectArrow.test.tsx +17 -0
  1963. package/packages/react/src/select/arrow/SelectArrow.tsx +82 -0
  1964. package/packages/react/src/select/arrow/SelectArrowDataAttributes.ts +26 -0
  1965. package/packages/react/src/select/backdrop/SelectBackdrop.test.tsx +13 -0
  1966. package/packages/react/src/select/backdrop/SelectBackdrop.tsx +77 -0
  1967. package/packages/react/src/select/backdrop/SelectBackdropDataAttributes.ts +20 -0
  1968. package/packages/react/src/select/group/SelectGroup.test.tsx +50 -0
  1969. package/packages/react/src/select/group/SelectGroup.tsx +50 -0
  1970. package/packages/react/src/select/group/SelectGroupContext.ts +19 -0
  1971. package/packages/react/src/select/group-label/SelectGroupLabel.test.tsx +17 -0
  1972. package/packages/react/src/select/group-label/SelectGroupLabel.tsx +44 -0
  1973. package/packages/react/src/select/icon/SelectIcon.test.tsx +13 -0
  1974. package/packages/react/src/select/icon/SelectIcon.tsx +51 -0
  1975. package/packages/react/src/select/icon/SelectIconDataAttributes.ts +8 -0
  1976. package/packages/react/src/select/index.parts.ts +19 -0
  1977. package/packages/react/src/select/index.ts +20 -0
  1978. package/packages/react/src/select/item/SelectItem.test.tsx +778 -0
  1979. package/packages/react/src/select/item/SelectItem.tsx +310 -0
  1980. package/packages/react/src/select/item/SelectItemContext.ts +22 -0
  1981. package/packages/react/src/select/item/SelectItemDataAttributes.ts +14 -0
  1982. package/packages/react/src/select/item-indicator/SelectItemIndicator.test.tsx +22 -0
  1983. package/packages/react/src/select/item-indicator/SelectItemIndicator.tsx +106 -0
  1984. package/packages/react/src/select/item-indicator/SelectItemIndicatorDataAttributes.ts +12 -0
  1985. package/packages/react/src/select/item-text/SelectItemText.test.tsx +19 -0
  1986. package/packages/react/src/select/item-text/SelectItemText.tsx +56 -0
  1987. package/packages/react/src/select/label/SelectLabel.test.tsx +21 -0
  1988. package/packages/react/src/select/label/SelectLabel.tsx +62 -0
  1989. package/packages/react/src/select/list/SelectList.test.tsx +21 -0
  1990. package/packages/react/src/select/list/SelectList.tsx +64 -0
  1991. package/packages/react/src/select/popup/SelectPopup.test.tsx +1189 -0
  1992. package/packages/react/src/select/popup/SelectPopup.tsx +629 -0
  1993. package/packages/react/src/select/popup/SelectPopupDataAttributes.ts +30 -0
  1994. package/packages/react/src/select/popup/utils.ts +12 -0
  1995. package/packages/react/src/select/portal/SelectPortal.test.tsx +14 -0
  1996. package/packages/react/src/select/portal/SelectPortal.tsx +43 -0
  1997. package/packages/react/src/select/portal/SelectPortalContext.ts +12 -0
  1998. package/packages/react/src/select/positioner/SelectPositioner.spec.tsx +4 -0
  1999. package/packages/react/src/select/positioner/SelectPositioner.test.tsx +284 -0
  2000. package/packages/react/src/select/positioner/SelectPositioner.tsx +283 -0
  2001. package/packages/react/src/select/positioner/SelectPositionerContext.ts +25 -0
  2002. package/packages/react/src/select/positioner/SelectPositionerCssVars.ts +27 -0
  2003. package/packages/react/src/select/positioner/SelectPositionerDataAttributes.ts +26 -0
  2004. package/packages/react/src/select/root/SelectRoot.spec.tsx +247 -0
  2005. package/packages/react/src/select/root/SelectRoot.test.tsx +5492 -0
  2006. package/packages/react/src/select/root/SelectRoot.tsx +810 -0
  2007. package/packages/react/src/select/root/SelectRootContext.ts +63 -0
  2008. package/packages/react/src/select/scroll-arrow/SelectScrollArrow.tsx +248 -0
  2009. package/packages/react/src/select/scroll-down-arrow/SelectScrollDownArrow.test.tsx +193 -0
  2010. package/packages/react/src/select/scroll-down-arrow/SelectScrollDownArrow.tsx +35 -0
  2011. package/packages/react/src/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.ts +26 -0
  2012. package/packages/react/src/select/scroll-up-arrow/SelectScrollUpArrow.test.tsx +105 -0
  2013. package/packages/react/src/select/scroll-up-arrow/SelectScrollUpArrow.tsx +35 -0
  2014. package/packages/react/src/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.ts +26 -0
  2015. package/packages/react/src/select/store.ts +120 -0
  2016. package/packages/react/src/select/trigger/SelectTrigger.test.tsx +268 -0
  2017. package/packages/react/src/select/trigger/SelectTrigger.tsx +287 -0
  2018. package/packages/react/src/select/trigger/SelectTriggerDataAttributes.ts +57 -0
  2019. package/packages/react/src/select/value/SelectValue.test.tsx +764 -0
  2020. package/packages/react/src/select/value/SelectValue.tsx +107 -0
  2021. package/packages/react/src/select/value/SelectValueDataAttributes.ts +6 -0
  2022. package/packages/react/src/separator/Separator.test.tsx +28 -0
  2023. package/packages/react/src/separator/Separator.tsx +47 -0
  2024. package/packages/react/src/separator/SeparatorDataAttributes.ts +7 -0
  2025. package/packages/react/src/separator/index.ts +3 -0
  2026. package/packages/react/src/slider/control/SliderControl.test.tsx +27 -0
  2027. package/packages/react/src/slider/control/SliderControl.tsx +563 -0
  2028. package/packages/react/src/slider/control/SliderControlDataAttributes.ts +35 -0
  2029. package/packages/react/src/slider/index.parts.ts +7 -0
  2030. package/packages/react/src/slider/index.ts +9 -0
  2031. package/packages/react/src/slider/indicator/SliderIndicator.test.tsx +13 -0
  2032. package/packages/react/src/slider/indicator/SliderIndicator.tsx +139 -0
  2033. package/packages/react/src/slider/indicator/SliderIndicatorDataAttributes.ts +35 -0
  2034. package/packages/react/src/slider/label/SliderLabel.test.tsx +20 -0
  2035. package/packages/react/src/slider/label/SliderLabel.tsx +69 -0
  2036. package/packages/react/src/slider/root/SliderRoot.spec.tsx +98 -0
  2037. package/packages/react/src/slider/root/SliderRoot.test.tsx +3321 -0
  2038. package/packages/react/src/slider/root/SliderRoot.tsx +630 -0
  2039. package/packages/react/src/slider/root/SliderRootContext.ts +112 -0
  2040. package/packages/react/src/slider/root/SliderRootDataAttributes.ts +35 -0
  2041. package/packages/react/src/slider/root/stateAttributesMapping.ts +13 -0
  2042. package/packages/react/src/slider/thumb/SliderThumb.test.tsx +1054 -0
  2043. package/packages/react/src/slider/thumb/SliderThumb.tsx +598 -0
  2044. package/packages/react/src/slider/thumb/SliderThumbDataAttributes.ts +39 -0
  2045. package/packages/react/src/slider/thumb/prehydrationScript.min.ts +5 -0
  2046. package/packages/react/src/slider/thumb/prehydrationScript.template.js +69 -0
  2047. package/packages/react/src/slider/track/SliderTrack.test.tsx +13 -0
  2048. package/packages/react/src/slider/track/SliderTrack.tsx +47 -0
  2049. package/packages/react/src/slider/track/SliderTrackDataAttributes.ts +35 -0
  2050. package/packages/react/src/slider/utils/asc.ts +3 -0
  2051. package/packages/react/src/slider/utils/getMidpoint.ts +9 -0
  2052. package/packages/react/src/slider/utils/getPushedThumbValues.test.ts +105 -0
  2053. package/packages/react/src/slider/utils/getPushedThumbValues.ts +72 -0
  2054. package/packages/react/src/slider/utils/getSliderValue.test.ts +27 -0
  2055. package/packages/react/src/slider/utils/getSliderValue.ts +26 -0
  2056. package/packages/react/src/slider/utils/replaceArrayItemAtIndex.ts +7 -0
  2057. package/packages/react/src/slider/utils/resolveThumbCollision.test.ts +235 -0
  2058. package/packages/react/src/slider/utils/resolveThumbCollision.ts +175 -0
  2059. package/packages/react/src/slider/utils/roundValueToStep.test.ts +8 -0
  2060. package/packages/react/src/slider/utils/roundValueToStep.ts +21 -0
  2061. package/packages/react/src/slider/utils/test-utils.ts +28 -0
  2062. package/packages/react/src/slider/utils/validateMinimumDistance.ts +21 -0
  2063. package/packages/react/src/slider/utils/valueArrayToPercentages.ts +10 -0
  2064. package/packages/react/src/slider/value/SliderValue.test.tsx +72 -0
  2065. package/packages/react/src/slider/value/SliderValue.tsx +85 -0
  2066. package/packages/react/src/slider/value/SliderValueDataAttributes.ts +35 -0
  2067. package/packages/react/src/switch/index.parts.ts +2 -0
  2068. package/packages/react/src/switch/index.ts +4 -0
  2069. package/packages/react/src/switch/root/SwitchRoot.test.tsx +1116 -0
  2070. package/packages/react/src/switch/root/SwitchRoot.tsx +348 -0
  2071. package/packages/react/src/switch/root/SwitchRootContext.ts +18 -0
  2072. package/packages/react/src/switch/root/SwitchRootDataAttributes.ts +46 -0
  2073. package/packages/react/src/switch/stateAttributesMapping.ts +19 -0
  2074. package/packages/react/src/switch/thumb/SwitchThumb.test.tsx +28 -0
  2075. package/packages/react/src/switch/thumb/SwitchThumb.tsx +38 -0
  2076. package/packages/react/src/switch/thumb/SwitchThumbDataAttributes.ts +46 -0
  2077. package/packages/react/src/tabs/index.parts.ts +5 -0
  2078. package/packages/react/src/tabs/index.ts +7 -0
  2079. package/packages/react/src/tabs/indicator/TabsIndicator.test.tsx +442 -0
  2080. package/packages/react/src/tabs/indicator/TabsIndicator.tsx +185 -0
  2081. package/packages/react/src/tabs/indicator/TabsIndicatorCssVars.ts +32 -0
  2082. package/packages/react/src/tabs/indicator/TabsIndicatorDataAttributes.ts +12 -0
  2083. package/packages/react/src/tabs/indicator/prehydrationScript.min.ts +5 -0
  2084. package/packages/react/src/tabs/indicator/prehydrationScript.template.js +87 -0
  2085. package/packages/react/src/tabs/list/TabsList.test.tsx +135 -0
  2086. package/packages/react/src/tabs/list/TabsList.tsx +167 -0
  2087. package/packages/react/src/tabs/list/TabsListContext.ts +27 -0
  2088. package/packages/react/src/tabs/list/TabsListDataAttributes.ts +12 -0
  2089. package/packages/react/src/tabs/panel/TabsPanel.test.tsx +186 -0
  2090. package/packages/react/src/tabs/panel/TabsPanel.tsx +157 -0
  2091. package/packages/react/src/tabs/panel/TabsPanelDataAttributes.ts +30 -0
  2092. package/packages/react/src/tabs/root/TabsRoot.test.tsx +2325 -0
  2093. package/packages/react/src/tabs/root/TabsRoot.tsx +514 -0
  2094. package/packages/react/src/tabs/root/TabsRootContext.ts +56 -0
  2095. package/packages/react/src/tabs/root/TabsRootDataAttributes.ts +12 -0
  2096. package/packages/react/src/tabs/root/stateAttributesMapping.ts +9 -0
  2097. package/packages/react/src/tabs/tab/TabsTab.test.tsx +90 -0
  2098. package/packages/react/src/tabs/tab/TabsTab.tsx +287 -0
  2099. package/packages/react/src/tabs/tab/TabsTabDataAttributes.ts +20 -0
  2100. package/packages/react/src/toast/action/ToastAction.test.tsx +81 -0
  2101. package/packages/react/src/toast/action/ToastAction.tsx +74 -0
  2102. package/packages/react/src/toast/action/ToastActionDataAttributes.ts +7 -0
  2103. package/packages/react/src/toast/arrow/ToastArrow.test.tsx +22 -0
  2104. package/packages/react/src/toast/arrow/ToastArrow.tsx +57 -0
  2105. package/packages/react/src/toast/arrow/ToastArrowDataAttributes.ts +18 -0
  2106. package/packages/react/src/toast/close/ToastClose.test.tsx +57 -0
  2107. package/packages/react/src/toast/close/ToastClose.tsx +80 -0
  2108. package/packages/react/src/toast/close/ToastCloseDataAttributes.ts +7 -0
  2109. package/packages/react/src/toast/content/ToastContent.test.tsx +87 -0
  2110. package/packages/react/src/toast/content/ToastContent.tsx +80 -0
  2111. package/packages/react/src/toast/content/ToastContentDataAttributes.ts +12 -0
  2112. package/packages/react/src/toast/createToastManager.spec.tsx +84 -0
  2113. package/packages/react/src/toast/createToastManager.test.tsx +795 -0
  2114. package/packages/react/src/toast/createToastManager.ts +98 -0
  2115. package/packages/react/src/toast/description/ToastDescription.test.tsx +92 -0
  2116. package/packages/react/src/toast/description/ToastDescription.tsx +82 -0
  2117. package/packages/react/src/toast/description/ToastDescriptionDataAttributes.ts +7 -0
  2118. package/packages/react/src/toast/index.parts.ts +14 -0
  2119. package/packages/react/src/toast/index.ts +15 -0
  2120. package/packages/react/src/toast/portal/ToastPortal.test.tsx +14 -0
  2121. package/packages/react/src/toast/portal/ToastPortal.tsx +20 -0
  2122. package/packages/react/src/toast/positioner/ToastPositioner.test.tsx +18 -0
  2123. package/packages/react/src/toast/positioner/ToastPositioner.tsx +155 -0
  2124. package/packages/react/src/toast/positioner/ToastPositionerContext.ts +22 -0
  2125. package/packages/react/src/toast/positioner/ToastPositionerCssVars.ts +27 -0
  2126. package/packages/react/src/toast/positioner/ToastPositionerDataAttributes.ts +18 -0
  2127. package/packages/react/src/toast/provider/ToastProvider.tsx +94 -0
  2128. package/packages/react/src/toast/provider/ToastProviderContext.ts +15 -0
  2129. package/packages/react/src/toast/root/ToastRoot.test.tsx +888 -0
  2130. package/packages/react/src/toast/root/ToastRoot.tsx +629 -0
  2131. package/packages/react/src/toast/root/ToastRootContext.ts +30 -0
  2132. package/packages/react/src/toast/root/ToastRootCssVars.ts +27 -0
  2133. package/packages/react/src/toast/root/ToastRootDataAttributes.ts +37 -0
  2134. package/packages/react/src/toast/store.test.ts +178 -0
  2135. package/packages/react/src/toast/store.ts +556 -0
  2136. package/packages/react/src/toast/title/ToastTitle.test.tsx +92 -0
  2137. package/packages/react/src/toast/title/ToastTitle.tsx +81 -0
  2138. package/packages/react/src/toast/title/ToastTitleDataAttributes.ts +7 -0
  2139. package/packages/react/src/toast/useToastManager.spec.tsx +88 -0
  2140. package/packages/react/src/toast/useToastManager.test.tsx +2024 -0
  2141. package/packages/react/src/toast/useToastManager.ts +149 -0
  2142. package/packages/react/src/toast/utils/focusVisible.ts +1 -0
  2143. package/packages/react/src/toast/utils/resolvePromiseOptions.ts +22 -0
  2144. package/packages/react/src/toast/utils/test-utils.tsx +39 -0
  2145. package/packages/react/src/toast/viewport/ToastViewport.test.tsx +720 -0
  2146. package/packages/react/src/toast/viewport/ToastViewport.tsx +338 -0
  2147. package/packages/react/src/toast/viewport/ToastViewportCssVars.ts +7 -0
  2148. package/packages/react/src/toast/viewport/ToastViewportDataAttributes.ts +7 -0
  2149. package/packages/react/src/toggle/Toggle.test.tsx +171 -0
  2150. package/packages/react/src/toggle/Toggle.tsx +201 -0
  2151. package/packages/react/src/toggle/ToggleDataAttributes.ts +10 -0
  2152. package/packages/react/src/toggle/index.ts +3 -0
  2153. package/packages/react/src/toggle-group/ToggleGroup.spec.tsx +27 -0
  2154. package/packages/react/src/toggle-group/ToggleGroup.test.tsx +527 -0
  2155. package/packages/react/src/toggle-group/ToggleGroup.tsx +218 -0
  2156. package/packages/react/src/toggle-group/ToggleGroupContext.ts +36 -0
  2157. package/packages/react/src/toggle-group/ToggleGroupDataAttributes.ts +15 -0
  2158. package/packages/react/src/toggle-group/index.ts +3 -0
  2159. package/packages/react/src/toolbar/button/ToolbarButton.test.tsx +1173 -0
  2160. package/packages/react/src/toolbar/button/ToolbarButton.tsx +106 -0
  2161. package/packages/react/src/toolbar/button/ToolbarButtonDataAttributes.ts +15 -0
  2162. package/packages/react/src/toolbar/group/ToolbarGroup.test.tsx +71 -0
  2163. package/packages/react/src/toolbar/group/ToolbarGroup.tsx +67 -0
  2164. package/packages/react/src/toolbar/group/ToolbarGroupContext.ts +20 -0
  2165. package/packages/react/src/toolbar/group/ToolbarGroupDataAttributes.ts +11 -0
  2166. package/packages/react/src/toolbar/index.parts.ts +8 -0
  2167. package/packages/react/src/toolbar/index.ts +9 -0
  2168. package/packages/react/src/toolbar/input/ToolbarInput.test.tsx +237 -0
  2169. package/packages/react/src/toolbar/input/ToolbarInput.tsx +108 -0
  2170. package/packages/react/src/toolbar/input/ToolbarInputDataAttributes.ts +15 -0
  2171. package/packages/react/src/toolbar/link/ToolbarLink.test.tsx +50 -0
  2172. package/packages/react/src/toolbar/link/ToolbarLink.tsx +58 -0
  2173. package/packages/react/src/toolbar/link/ToolbarLinkDataAttributes.ts +7 -0
  2174. package/packages/react/src/toolbar/root/ToolbarRoot.test.tsx +274 -0
  2175. package/packages/react/src/toolbar/root/ToolbarRoot.tsx +124 -0
  2176. package/packages/react/src/toolbar/root/ToolbarRootContext.ts +28 -0
  2177. package/packages/react/src/toolbar/root/ToolbarRootDataAttributes.ts +11 -0
  2178. package/packages/react/src/toolbar/separator/ToolbarSeparator.tsx +44 -0
  2179. package/packages/react/src/toolbar/separator/ToolbarSeparatorDataAttributes.ts +7 -0
  2180. package/packages/react/src/tooltip/arrow/TooltipArrow.test.tsx +21 -0
  2181. package/packages/react/src/tooltip/arrow/TooltipArrow.tsx +74 -0
  2182. package/packages/react/src/tooltip/arrow/TooltipArrowDataAttributes.ts +31 -0
  2183. package/packages/react/src/tooltip/index.parts.ts +12 -0
  2184. package/packages/react/src/tooltip/index.ts +10 -0
  2185. package/packages/react/src/tooltip/popup/TooltipPopup.test.tsx +35 -0
  2186. package/packages/react/src/tooltip/popup/TooltipPopup.tsx +107 -0
  2187. package/packages/react/src/tooltip/popup/TooltipPopupDataAttributes.ts +35 -0
  2188. package/packages/react/src/tooltip/portal/TooltipPortal.test.tsx +14 -0
  2189. package/packages/react/src/tooltip/portal/TooltipPortal.tsx +48 -0
  2190. package/packages/react/src/tooltip/portal/TooltipPortalContext.ts +12 -0
  2191. package/packages/react/src/tooltip/positioner/TooltipPositioner.spec.tsx +4 -0
  2192. package/packages/react/src/tooltip/positioner/TooltipPositioner.test.tsx +302 -0
  2193. package/packages/react/src/tooltip/positioner/TooltipPositioner.tsx +149 -0
  2194. package/packages/react/src/tooltip/positioner/TooltipPositionerContext.ts +22 -0
  2195. package/packages/react/src/tooltip/positioner/TooltipPositionerCssVars.ts +27 -0
  2196. package/packages/react/src/tooltip/positioner/TooltipPositionerDataAttributes.ts +26 -0
  2197. package/packages/react/src/tooltip/provider/TooltipProvider.test.tsx +183 -0
  2198. package/packages/react/src/tooltip/provider/TooltipProvider.tsx +57 -0
  2199. package/packages/react/src/tooltip/provider/TooltipProviderContext.ts +15 -0
  2200. package/packages/react/src/tooltip/root/TooltipRoot.detached-triggers.test.tsx +1021 -0
  2201. package/packages/react/src/tooltip/root/TooltipRoot.test.tsx +2634 -0
  2202. package/packages/react/src/tooltip/root/TooltipRoot.tsx +281 -0
  2203. package/packages/react/src/tooltip/root/TooltipRootContext.ts +20 -0
  2204. package/packages/react/src/tooltip/store/TooltipHandle.ts +65 -0
  2205. package/packages/react/src/tooltip/store/TooltipStore.ts +121 -0
  2206. package/packages/react/src/tooltip/trigger/TooltipTrigger.spec.tsx +6 -0
  2207. package/packages/react/src/tooltip/trigger/TooltipTrigger.test.tsx +90 -0
  2208. package/packages/react/src/tooltip/trigger/TooltipTrigger.tsx +365 -0
  2209. package/packages/react/src/tooltip/trigger/TooltipTriggerDataAttributes.ts +12 -0
  2210. package/packages/react/src/tooltip/utils/constants.ts +1 -0
  2211. package/packages/react/src/tooltip/viewport/TooltipViewport.test.tsx +421 -0
  2212. package/packages/react/src/tooltip/viewport/TooltipViewport.tsx +85 -0
  2213. package/packages/react/src/tooltip/viewport/TooltipViewportCssVars.ts +14 -0
  2214. package/packages/react/src/tooltip/viewport/TooltipViewportDataAttributes.ts +26 -0
  2215. package/packages/react/src/types/index.ts +26 -0
  2216. package/packages/react/src/unstable-use-media-query/index.ts +90 -0
  2217. package/packages/react/src/use-render/index.ts +2 -0
  2218. package/packages/react/src/use-render/useRender.spec.tsx +59 -0
  2219. package/packages/react/src/use-render/useRender.test.tsx +318 -0
  2220. package/packages/react/src/use-render/useRender.ts +113 -0
  2221. package/packages/react/src/utils/FloatingPortalLite.tsx +43 -0
  2222. package/packages/react/src/utils/FocusGuard.tsx +42 -0
  2223. package/packages/react/src/utils/InternalBackdrop.tsx +50 -0
  2224. package/packages/react/src/utils/adaptiveOriginMiddleware.ts +77 -0
  2225. package/packages/react/src/utils/closePart.tsx +46 -0
  2226. package/packages/react/src/utils/collapsibleOpenStateMapping.ts +35 -0
  2227. package/packages/react/src/utils/formatNumber.test.ts +42 -0
  2228. package/packages/react/src/utils/formatNumber.ts +43 -0
  2229. package/packages/react/src/utils/getCssDimensions.ts +24 -0
  2230. package/packages/react/src/utils/getDisabledMountTransitionStyles.ts +9 -0
  2231. package/packages/react/src/utils/getElementAtPoint.ts +3 -0
  2232. package/packages/react/src/utils/getPseudoElementBounds.test.ts +66 -0
  2233. package/packages/react/src/utils/getPseudoElementBounds.ts +49 -0
  2234. package/packages/react/src/utils/hideMiddleware.ts +17 -0
  2235. package/packages/react/src/utils/popupStateMapping.ts +100 -0
  2236. package/packages/react/src/utils/popups/index.ts +4 -0
  2237. package/packages/react/src/utils/popups/inlineRect.test.ts +470 -0
  2238. package/packages/react/src/utils/popups/inlineRect.ts +292 -0
  2239. package/packages/react/src/utils/popups/popupStoreUtils.test.tsx +630 -0
  2240. package/packages/react/src/utils/popups/popupStoreUtils.ts +512 -0
  2241. package/packages/react/src/utils/popups/popupTriggerMap.test.ts +94 -0
  2242. package/packages/react/src/utils/popups/popupTriggerMap.ts +104 -0
  2243. package/packages/react/src/utils/popups/store.test.ts +68 -0
  2244. package/packages/react/src/utils/popups/store.ts +224 -0
  2245. package/packages/react/src/utils/popups/useTriggerFocusGuards.ts +95 -0
  2246. package/packages/react/src/utils/resolveAriaLabelledBy.ts +12 -0
  2247. package/packages/react/src/utils/resolveClassName.ts +13 -0
  2248. package/packages/react/src/utils/resolveRef.ts +13 -0
  2249. package/packages/react/src/utils/resolveStyle.ts +13 -0
  2250. package/packages/react/src/utils/scrollEdges.test.ts +30 -0
  2251. package/packages/react/src/utils/scrollEdges.ts +33 -0
  2252. package/packages/react/src/utils/scrollable.ts +72 -0
  2253. package/packages/react/src/utils/stringifyLocale.test.ts +11 -0
  2254. package/packages/react/src/utils/stringifyLocale.ts +11 -0
  2255. package/packages/react/src/utils/styles.tsx +12 -0
  2256. package/packages/react/src/utils/useAnchorPositioning.ts +755 -0
  2257. package/packages/react/src/utils/useAnchoredPopupScrollLock.ts +43 -0
  2258. package/packages/react/src/utils/useFocusableWhenDisabled.ts +99 -0
  2259. package/packages/react/src/utils/useIsHydrating.test.tsx +39 -0
  2260. package/packages/react/src/utils/useIsHydrating.ts +22 -0
  2261. package/packages/react/src/utils/useMixedToggleClickHandler.ts +61 -0
  2262. package/packages/react/src/utils/useOpenInteractionType.ts +62 -0
  2263. package/packages/react/src/utils/usePopupAutoResize.ts +238 -0
  2264. package/packages/react/src/utils/usePopupViewport.tsx +375 -0
  2265. package/packages/react/src/utils/usePositioner.tsx +44 -0
  2266. package/packages/react/src/utils/useRegisteredLabelId.ts +20 -0
  2267. package/packages/react/src/utils/useSwipeDismiss.test.tsx +1404 -0
  2268. package/packages/react/src/utils/useSwipeDismiss.ts +1208 -0
  2269. package/packages/react/src/utils/valueToPercent.ts +3 -0
  2270. package/packages/react/test/addVitestMatchers.ts +49 -0
  2271. package/packages/react/test/conformanceTests/className.tsx +25 -0
  2272. package/packages/react/test/conformanceTests/propForwarding.tsx +129 -0
  2273. package/packages/react/test/conformanceTests/refForwarding.tsx +40 -0
  2274. package/packages/react/test/conformanceTests/renderProp.tsx +180 -0
  2275. package/packages/react/test/conformanceTests/utils.ts +6 -0
  2276. package/packages/react/test/createRenderer.ts +49 -0
  2277. package/packages/react/test/describeConformance.tsx +70 -0
  2278. package/packages/react/test/describeGregorianAdapter/describeGregorianAdapter.ts +24 -0
  2279. package/packages/react/test/describeGregorianAdapter/describeGregorianAdapter.types.ts +36 -0
  2280. package/packages/react/test/describeGregorianAdapter/describeGregorianAdapter.utils.ts +3 -0
  2281. package/packages/react/test/describeGregorianAdapter/index.ts +2 -0
  2282. package/packages/react/test/describeGregorianAdapter/testComputations.ts +858 -0
  2283. package/packages/react/test/describeGregorianAdapter/testFormats.ts +32 -0
  2284. package/packages/react/test/describeGregorianAdapter/testLocalization.ts +14 -0
  2285. package/packages/react/test/floating-ui-tests/Button.module.css +18 -0
  2286. package/packages/react/test/floating-ui-tests/Button.tsx +14 -0
  2287. package/packages/react/test/floating-ui-tests/ComplexGrid.module.css +12 -0
  2288. package/packages/react/test/floating-ui-tests/ComplexGrid.tsx +102 -0
  2289. package/packages/react/test/floating-ui-tests/EmojiPicker.module.css +83 -0
  2290. package/packages/react/test/floating-ui-tests/EmojiPicker.tsx +302 -0
  2291. package/packages/react/test/floating-ui-tests/Grid.module.css +12 -0
  2292. package/packages/react/test/floating-ui-tests/Grid.tsx +95 -0
  2293. package/packages/react/test/floating-ui-tests/ListboxFocus.tsx +120 -0
  2294. package/packages/react/test/floating-ui-tests/Menu.module.css +95 -0
  2295. package/packages/react/test/floating-ui-tests/Menu.tsx +420 -0
  2296. package/packages/react/test/floating-ui-tests/MenuOrientation.module.css +100 -0
  2297. package/packages/react/test/floating-ui-tests/MenuOrientation.tsx +505 -0
  2298. package/packages/react/test/floating-ui-tests/Navigation.module.css +56 -0
  2299. package/packages/react/test/floating-ui-tests/Navigation.tsx +143 -0
  2300. package/packages/react/test/floating-ui-tests/Popover.module.css +45 -0
  2301. package/packages/react/test/floating-ui-tests/Popover.tsx +192 -0
  2302. package/packages/react/test/floating-ui-tests/gridNavigationWithColumns.ts +27 -0
  2303. package/packages/react/test/floating-ui-tests/renderGridRows.tsx +17 -0
  2304. package/packages/react/test/index.ts +9 -0
  2305. package/packages/react/test/popupConformanceTests.tsx +281 -0
  2306. package/packages/react/test/types.d.ts +1 -0
  2307. package/packages/react/test/useTestInteractions.test.tsx +154 -0
  2308. package/packages/react/test/useTestInteractions.ts +161 -0
  2309. package/packages/react/test/wait.ts +19 -0
  2310. package/packages/react/tsconfig.build.json +19 -0
  2311. package/packages/react/tsconfig.json +11 -0
  2312. package/packages/react/tsconfig.test.json +25 -0
  2313. package/packages/react/vitest-env.d.ts +6 -0
  2314. package/packages/react/vitest.config.mts +16 -0
  2315. package/packages/utils/CHANGELOG.md +91 -0
  2316. package/packages/utils/MAINTAINERS.md +8 -0
  2317. package/packages/utils/README.md +3 -0
  2318. package/packages/utils/package.json +61 -0
  2319. package/packages/utils/src/addEventListener.spec.ts +41 -0
  2320. package/packages/utils/src/addEventListener.test.ts +21 -0
  2321. package/packages/utils/src/addEventListener.ts +63 -0
  2322. package/packages/utils/src/empty.ts +5 -0
  2323. package/packages/utils/src/error.ts +18 -0
  2324. package/packages/utils/src/fastHooks.ts +70 -0
  2325. package/packages/utils/src/fastObjectShallowCompare.ts +32 -0
  2326. package/packages/utils/src/formatErrorMessage.test.ts +49 -0
  2327. package/packages/utils/src/formatErrorMessage.ts +33 -0
  2328. package/packages/utils/src/generateId.ts +5 -0
  2329. package/packages/utils/src/getDefaultFormSubmitter.test.ts +70 -0
  2330. package/packages/utils/src/getDefaultFormSubmitter.ts +34 -0
  2331. package/packages/utils/src/getReactElementRef.test.tsx +38 -0
  2332. package/packages/utils/src/getReactElementRef.ts +16 -0
  2333. package/packages/utils/src/inertValue.ts +9 -0
  2334. package/packages/utils/src/isElementDisabled.ts +7 -0
  2335. package/packages/utils/src/isMouseWithinBounds.ts +20 -0
  2336. package/packages/utils/src/mergeCleanups.test.ts +15 -0
  2337. package/packages/utils/src/mergeCleanups.ts +15 -0
  2338. package/packages/utils/src/mergeObjects.ts +15 -0
  2339. package/packages/utils/src/owner.ts +5 -0
  2340. package/packages/utils/src/platform/engine.ts +22 -0
  2341. package/packages/utils/src/platform/env.ts +4 -0
  2342. package/packages/utils/src/platform/index.ts +27 -0
  2343. package/packages/utils/src/platform/os.ts +24 -0
  2344. package/packages/utils/src/platform/parts.ts +4 -0
  2345. package/packages/utils/src/platform/screen-reader.ts +12 -0
  2346. package/packages/utils/src/platform/shared.ts +51 -0
  2347. package/packages/utils/src/reactVersion.ts +9 -0
  2348. package/packages/utils/src/safeReact.ts +11 -0
  2349. package/packages/utils/src/store/ReactStore.spec.ts +94 -0
  2350. package/packages/utils/src/store/ReactStore.test.tsx +574 -0
  2351. package/packages/utils/src/store/ReactStore.ts +282 -0
  2352. package/packages/utils/src/store/Store.ts +123 -0
  2353. package/packages/utils/src/store/StoreInspector.tsx +595 -0
  2354. package/packages/utils/src/store/createSelector.ts +137 -0
  2355. package/packages/utils/src/store/createSelectorMemoized.ts +99 -0
  2356. package/packages/utils/src/store/index.ts +6 -0
  2357. package/packages/utils/src/store/useStore.ts +193 -0
  2358. package/packages/utils/src/testUtils.ts +21 -0
  2359. package/packages/utils/src/useAnimationFrame.ts +132 -0
  2360. package/packages/utils/src/useControlled.test.tsx +272 -0
  2361. package/packages/utils/src/useControlled.ts +112 -0
  2362. package/packages/utils/src/useEnhancedClickHandler.ts +50 -0
  2363. package/packages/utils/src/useForcedRerendering.ts +13 -0
  2364. package/packages/utils/src/useId.test.tsx +124 -0
  2365. package/packages/utils/src/useId.ts +42 -0
  2366. package/packages/utils/src/useInterval.ts +42 -0
  2367. package/packages/utils/src/useIsoLayoutEffect.ts +6 -0
  2368. package/packages/utils/src/useMergedRefs.test.tsx +174 -0
  2369. package/packages/utils/src/useMergedRefs.ts +151 -0
  2370. package/packages/utils/src/useOnFirstRender.ts +10 -0
  2371. package/packages/utils/src/useOnMount.ts +14 -0
  2372. package/packages/utils/src/usePreviousValue.test.tsx +185 -0
  2373. package/packages/utils/src/usePreviousValue.ts +20 -0
  2374. package/packages/utils/src/useRefWithInit.ts +23 -0
  2375. package/packages/utils/src/useScrollLock.ts +289 -0
  2376. package/packages/utils/src/useStableCallback.ts +62 -0
  2377. package/packages/utils/src/useTimeout.ts +52 -0
  2378. package/packages/utils/src/useValueAsRef.ts +30 -0
  2379. package/packages/utils/src/visuallyHidden.ts +24 -0
  2380. package/packages/utils/src/warn.ts +14 -0
  2381. package/packages/utils/tsconfig.build.json +19 -0
  2382. package/packages/utils/tsconfig.json +11 -0
  2383. package/packages/utils/tsconfig.test.json +16 -0
  2384. package/packages/utils/vitest.config.mts +12 -0
  2385. package/playground/vite-app/README.md +45 -0
  2386. package/playground/vite-app/index.html +13 -0
  2387. package/playground/vite-app/package.json +34 -0
  2388. package/playground/vite-app/public/base-ui-logo.svg +5 -0
  2389. package/playground/vite-app/public/vite.svg +1 -0
  2390. package/playground/vite-app/src/Home.tsx +41 -0
  2391. package/playground/vite-app/src/experiments/perf/SettingsPanel.tsx +115 -0
  2392. package/playground/vite-app/src/experiments/perf/contained-triggers.tsx +226 -0
  2393. package/playground/vite-app/src/experiments/perf/detached-triggers.tsx +286 -0
  2394. package/playground/vite-app/src/experiments/perf/perf.module.css +99 -0
  2395. package/playground/vite-app/src/experiments/perf/radix-triggers.tsx +224 -0
  2396. package/playground/vite-app/src/experiments/perf/utils/benchmark.tsx +184 -0
  2397. package/playground/vite-app/src/index.css +50 -0
  2398. package/playground/vite-app/src/index.tsx +74 -0
  2399. package/playground/vite-app/src/routes.tsx +50 -0
  2400. package/playground/vite-app/tsconfig.app.json +38 -0
  2401. package/playground/vite-app/tsconfig.json +4 -0
  2402. package/playground/vite-app/tsconfig.node.json +26 -0
  2403. package/playground/vite-app/vite.config.ts +36 -0
  2404. package/pnpm-workspace.yaml +31 -0
  2405. package/prettier.config.mjs +3 -0
  2406. package/renovate.json +31 -0
  2407. package/scripts/README.md +58 -0
  2408. package/scripts/changelog.config.mjs +60 -0
  2409. package/scripts/inlineScripts.mts +56 -0
  2410. package/scripts/stylelint/no-unknown-demo-colors.mjs +447 -0
  2411. package/scripts/tsconfig.json +10 -0
  2412. package/stylelint.config.mjs +59 -0
  2413. package/test/README.md +205 -0
  2414. package/test/assets/fake.png +0 -0
  2415. package/test/assets/fake2.png +0 -0
  2416. package/test/bundle-size/bundle-size-checker.config.mjs +69 -0
  2417. package/test/bundle-size/package.json +16 -0
  2418. package/test/docs-regressions-before.png +0 -0
  2419. package/test/docs-regressions-diff.png +0 -0
  2420. package/test/e2e/README.md +30 -0
  2421. package/test/e2e/TestViewer.tsx +21 -0
  2422. package/test/e2e/fixtures/.gitkeep +0 -0
  2423. package/test/e2e/fixtures/Radio.module.css +56 -0
  2424. package/test/e2e/fixtures/Radio.tsx +35 -0
  2425. package/test/e2e/fixtures/field/validate-on-change/Input.module.css +26 -0
  2426. package/test/e2e/fixtures/field/validate-on-change/Input.tsx +22 -0
  2427. package/test/e2e/fixtures/field/validate-on-change/Select.module.css +162 -0
  2428. package/test/e2e/fixtures/field/validate-on-change/Select.tsx +56 -0
  2429. package/test/e2e/fixtures/menu/LinkItemNavigation.module.css +50 -0
  2430. package/test/e2e/fixtures/menu/LinkItemNavigation.tsx +40 -0
  2431. package/test/e2e/fixtures/menu/PageOne.tsx +3 -0
  2432. package/test/e2e/fixtures/menu/PageTwo.tsx +3 -0
  2433. package/test/e2e/fixtures/menu/ReactRouterLinkItemNavigation.tsx +43 -0
  2434. package/test/e2e/fixtures/navigation-menu/InlineSubmenuHoverHandoff.tsx +293 -0
  2435. package/test/e2e/fixtures/slider/Inset.module.css +23 -0
  2436. package/test/e2e/fixtures/slider/Inset.tsx +13 -0
  2437. package/test/e2e/fixtures/slider/Range.module.css +33 -0
  2438. package/test/e2e/fixtures/slider/Range.tsx +15 -0
  2439. package/test/e2e/fixtures/slider/RangeSliderMax.module.css +33 -0
  2440. package/test/e2e/fixtures/slider/RangeSliderMax.tsx +15 -0
  2441. package/test/e2e/index.html +21 -0
  2442. package/test/e2e/index.test.ts +347 -0
  2443. package/test/e2e/main.tsx +134 -0
  2444. package/test/e2e/postcss.config.js +7 -0
  2445. package/test/e2e/serve.json +4 -0
  2446. package/test/e2e/vite.config.mjs +10 -0
  2447. package/test/e2e/vitest.config.mts +21 -0
  2448. package/test/node-resolution/index.mjs +6 -0
  2449. package/test/node-resolution/package.json +11 -0
  2450. package/test/package.json +25 -0
  2451. package/test/performance/package.json +19 -0
  2452. package/test/performance/tests/checkbox.bench.tsx +20 -0
  2453. package/test/performance/tests/combobox.bench.tsx +87 -0
  2454. package/test/performance/tests/dialog.bench.tsx +28 -0
  2455. package/test/performance/tests/menu.bench.tsx +70 -0
  2456. package/test/performance/tests/mixed.bench.tsx +173 -0
  2457. package/test/performance/tests/popover.bench.tsx +28 -0
  2458. package/test/performance/tests/scroll-area.bench.tsx +34 -0
  2459. package/test/performance/tests/select.bench.tsx +86 -0
  2460. package/test/performance/tests/shared.tsx +26 -0
  2461. package/test/performance/tests/slider.bench.tsx +26 -0
  2462. package/test/performance/tests/tabs.bench.tsx +33 -0
  2463. package/test/performance/tests/tooltip.bench.tsx +27 -0
  2464. package/test/performance/tsconfig.json +11 -0
  2465. package/test/performance/vitest.config.ts +3 -0
  2466. package/test/public-types/autocomplete.tsx +80 -0
  2467. package/test/public-types/checkbox.tsx +6 -0
  2468. package/test/public-types/combobox.tsx +71 -0
  2469. package/test/public-types/index.tsx +129 -0
  2470. package/test/public-types/menu.tsx +11 -0
  2471. package/test/public-types/package.json +10 -0
  2472. package/test/public-types/separator.tsx +6 -0
  2473. package/test/public-types/toast.tsx +27 -0
  2474. package/test/public-types/tsconfig.json +25 -0
  2475. package/test/public-types/use-render.tsx +59 -0
  2476. package/test/regressions/README.md +56 -0
  2477. package/test/regressions/TestViewer.tsx +84 -0
  2478. package/test/regressions/fixtures/.gitkeep +0 -0
  2479. package/test/regressions/fixtures.ts +111 -0
  2480. package/test/regressions/index.html +20 -0
  2481. package/test/regressions/index.test.ts +100 -0
  2482. package/test/regressions/main.tsx +127 -0
  2483. package/test/regressions/manual/README.md +4 -0
  2484. package/test/regressions/postcss.config.js +7 -0
  2485. package/test/regressions/public/fonts/die-grotesk-a-bold.woff2 +0 -0
  2486. package/test/regressions/public/fonts/die-grotesk-a-regular.woff2 +0 -0
  2487. package/test/regressions/public/fonts/die-grotesk-b-bold.woff2 +0 -0
  2488. package/test/regressions/public/fonts/die-grotesk-b-regular.woff2 +0 -0
  2489. package/test/regressions/serve.json +4 -0
  2490. package/test/regressions/vite.config.mjs +10 -0
  2491. package/test/regressions/vitest.config.mts +22 -0
  2492. package/test/setupVitest.ts +37 -0
  2493. package/test/tsconfig.json +10 -0
  2494. package/test/vite.d.ts +1 -0
  2495. package/test/vite.shared.config.mjs +25 -0
  2496. package/tsconfig.base.json +26 -0
  2497. package/tsconfig.json +22 -0
  2498. package/vitest.config.mts +30 -0
  2499. package/vitest.shared.mts +67 -0
@@ -0,0 +1,2595 @@
1
+ import { expect, vi } from 'vitest';
2
+ import * as React from 'react';
3
+ import { act, screen, fireEvent } from '@mui/internal-test-utils';
4
+ import { NumberField as NumberFieldBase } from '@lizuzsusil/react/number-field';
5
+ import { Field } from '@lizuzsusil/react/field';
6
+ import { Form } from '@lizuzsusil/react/form';
7
+ import { createRenderer, describeConformance, isJSDOM } from '#test-utils';
8
+ import { REASONS } from '../../internals/reasons';
9
+
10
+ describe('<NumberField />', () => {
11
+ const { render } = createRenderer();
12
+
13
+ function pasteText(target: HTMLElement, value: string) {
14
+ if (isJSDOM) {
15
+ fireEvent.paste(target, {
16
+ clipboardData: {
17
+ getData: (type: string) => (type === 'text/plain' ? value : ''),
18
+ },
19
+ });
20
+ return;
21
+ }
22
+
23
+ const pasteEvent = new Event('paste', { bubbles: true, cancelable: true });
24
+ Object.defineProperty(pasteEvent, 'clipboardData', {
25
+ value: {
26
+ getData: (type: string) => (type === 'text/plain' ? value : ''),
27
+ },
28
+ });
29
+
30
+ fireEvent(target, pasteEvent);
31
+ }
32
+
33
+ describeConformance(<NumberFieldBase.Root />, () => ({
34
+ refInstanceof: window.HTMLDivElement,
35
+ render,
36
+ }));
37
+
38
+ function NumberField(props: NumberFieldBase.Root.Props) {
39
+ return (
40
+ <NumberFieldBase.Root {...props}>
41
+ <NumberFieldBase.Group>
42
+ <NumberFieldBase.Input />
43
+ <NumberFieldBase.Increment />
44
+ <NumberFieldBase.Decrement />
45
+ <NumberFieldBase.ScrubArea />
46
+ </NumberFieldBase.Group>
47
+ </NumberFieldBase.Root>
48
+ );
49
+ }
50
+
51
+ describe('prop: defaultValue', () => {
52
+ it('should accept a number value', async () => {
53
+ await render(<NumberField defaultValue={1} />);
54
+ const input = screen.getByRole('textbox');
55
+ expect(input).toHaveValue('1');
56
+ });
57
+
58
+ it('should accept an `undefined` value', async () => {
59
+ await render(<NumberField />);
60
+ const input = screen.getByRole('textbox');
61
+ expect(input).toHaveValue('');
62
+ });
63
+ });
64
+
65
+ describe('prop: value', () => {
66
+ it('should accept a number value that can change over time', async () => {
67
+ const { rerender } = await render(<NumberField value={1} />);
68
+ const input = screen.getByRole('textbox');
69
+ expect(input).toHaveValue('1');
70
+ await rerender(<NumberField value={2} />);
71
+ expect(input).toHaveValue('2');
72
+ });
73
+
74
+ it('should accept an `undefined` value', async () => {
75
+ await render(<NumberField />);
76
+ const input = screen.getByRole('textbox');
77
+ expect(input).toHaveValue('');
78
+ });
79
+
80
+ it('should accept a `null` value', async () => {
81
+ await render(<NumberField value={null} />);
82
+ const input = screen.getByRole('textbox');
83
+ expect(input).toHaveValue('');
84
+ });
85
+
86
+ it('should be `null` when the input is empty but not trimmed', async () => {
87
+ const onValueChange = vi.fn();
88
+ await render(<NumberField value={1} onValueChange={onValueChange} />);
89
+ const input = screen.getByRole('textbox');
90
+ fireEvent.change(input, { target: { value: ' ' } });
91
+ expect(onValueChange.mock.calls[0][0]).toBe(null);
92
+ });
93
+ });
94
+
95
+ it('blocks submission when step mismatch occurs', async () => {
96
+ await render(
97
+ <form data-testid="form">
98
+ <NumberFieldBase.Root name="quantity" min={0} step={0.1}>
99
+ <NumberFieldBase.Group>
100
+ <NumberFieldBase.Input />
101
+ </NumberFieldBase.Group>
102
+ </NumberFieldBase.Root>
103
+ <button type="submit">Submit</button>
104
+ </form>,
105
+ );
106
+
107
+ const input = screen.getByRole('textbox');
108
+ fireEvent.change(input, { target: { value: '0.11' } });
109
+
110
+ const hiddenInput = document.querySelector(
111
+ 'input[type="number"][name="quantity"]',
112
+ ) as HTMLInputElement;
113
+ expect(hiddenInput).not.toBe(null);
114
+ expect(hiddenInput.validity.stepMismatch).toBe(true);
115
+
116
+ const form = screen.getByTestId<HTMLFormElement>('form');
117
+ expect(form.checkValidity()).toBe(false);
118
+ });
119
+
120
+ it.skipIf(isJSDOM)('blocks submission when step mismatch occurs with default step', async () => {
121
+ await render(
122
+ <form data-testid="form">
123
+ <NumberFieldBase.Root name="quantity" min={0}>
124
+ <NumberFieldBase.Group>
125
+ <NumberFieldBase.Input />
126
+ </NumberFieldBase.Group>
127
+ </NumberFieldBase.Root>
128
+ <button type="submit">Submit</button>
129
+ </form>,
130
+ );
131
+
132
+ const input = screen.getByRole('textbox');
133
+ fireEvent.change(input, { target: { value: '0.11' } });
134
+
135
+ const hiddenInput = document.querySelector(
136
+ 'input[type="number"][name="quantity"]',
137
+ ) as HTMLInputElement;
138
+ expect(hiddenInput).not.toBe(null);
139
+ expect(hiddenInput.validity.stepMismatch).toBe(true);
140
+
141
+ const form = screen.getByTestId<HTMLFormElement>('form');
142
+ expect(form.checkValidity()).toBe(false);
143
+ });
144
+
145
+ it('does not block submission when step="any"', async () => {
146
+ await render(
147
+ <form data-testid="form">
148
+ <NumberFieldBase.Root name="quantity" min={0} step="any">
149
+ <NumberFieldBase.Group>
150
+ <NumberFieldBase.Input />
151
+ </NumberFieldBase.Group>
152
+ </NumberFieldBase.Root>
153
+ <button type="submit">Submit</button>
154
+ </form>,
155
+ );
156
+
157
+ const input = screen.getByRole('textbox');
158
+ fireEvent.change(input, { target: { value: '0.11' } });
159
+
160
+ const hiddenInput = document.querySelector(
161
+ 'input[type="number"][name="quantity"]',
162
+ ) as HTMLInputElement;
163
+ expect(hiddenInput).not.toBe(null);
164
+ expect(hiddenInput.validity.stepMismatch).toBe(false);
165
+
166
+ const form = screen.getByTestId<HTMLFormElement>('form');
167
+ expect(form.checkValidity()).toBe(true);
168
+ });
169
+
170
+ describe('prop: onValueChange', () => {
171
+ it('should be called when the value changes', async () => {
172
+ const onValueChange = vi.fn();
173
+ function App() {
174
+ const [value, setValue] = React.useState<number | null>(1);
175
+ return (
176
+ <NumberField
177
+ value={value}
178
+ onValueChange={(val) => {
179
+ onValueChange(val);
180
+ setValue(val);
181
+ }}
182
+ />
183
+ );
184
+ }
185
+ await render(<App />);
186
+ const input = screen.getByRole('textbox');
187
+ fireEvent.change(input, { target: { value: '2' } });
188
+ expect(onValueChange.mock.calls.length).toBe(1);
189
+ expect(onValueChange.mock.calls[0][0]).toBe(2);
190
+ });
191
+
192
+ it('should be called with a number when transitioning from `null`', async () => {
193
+ const onValueChange = vi.fn();
194
+ function App() {
195
+ const [value, setValue] = React.useState<number | null>(null);
196
+ return (
197
+ <NumberField
198
+ value={value}
199
+ onValueChange={(val) => {
200
+ onValueChange(val);
201
+ setValue(val);
202
+ }}
203
+ />
204
+ );
205
+ }
206
+ await render(<App />);
207
+ const input = screen.getByRole('textbox');
208
+ fireEvent.change(input, { target: { value: '5' } });
209
+ expect(onValueChange.mock.calls.length).toBe(1);
210
+ expect(onValueChange.mock.calls[0][0]).toBe(5);
211
+ });
212
+
213
+ it('should be called with `null` when empty and transitioning from a number', async () => {
214
+ const onValueChange = vi.fn();
215
+ function App() {
216
+ const [value, setValue] = React.useState<number | null>(5);
217
+ return (
218
+ <NumberField
219
+ value={value}
220
+ onValueChange={(val) => {
221
+ onValueChange(val);
222
+ setValue(val);
223
+ }}
224
+ />
225
+ );
226
+ }
227
+ await render(<App />);
228
+ const input = screen.getByRole('textbox');
229
+ fireEvent.change(input, { target: { value: '' } });
230
+ expect(onValueChange.mock.calls.length).toBe(1);
231
+ expect(onValueChange.mock.calls[0][0]).toBe(null);
232
+ });
233
+
234
+ it('includes the reason for parseable typing', async () => {
235
+ const onValueChange = vi.fn();
236
+ await render(<NumberField onValueChange={onValueChange} />);
237
+ const input = screen.getByRole('textbox');
238
+
239
+ fireEvent.change(input, { target: { value: '12' } });
240
+
241
+ expect(onValueChange).toHaveBeenCalledTimes(1);
242
+ const [, details] = onValueChange.mock.calls[0] as [
243
+ number | null,
244
+ NumberFieldBase.Root.ChangeEventDetails,
245
+ ];
246
+ expect(details.reason).toBe(REASONS.inputChange);
247
+ });
248
+
249
+ it('includes the reason when clearing the value', async () => {
250
+ const onValueChange = vi.fn();
251
+ await render(<NumberField defaultValue={5} onValueChange={onValueChange} />);
252
+ const input = screen.getByRole('textbox');
253
+
254
+ fireEvent.change(input, { target: { value: '' } });
255
+
256
+ expect(onValueChange).toHaveBeenCalledTimes(1);
257
+ const [, details] = onValueChange.mock.calls[0] as [
258
+ number | null,
259
+ NumberFieldBase.Root.ChangeEventDetails,
260
+ ];
261
+ expect(details.reason).toBe(REASONS.inputClear);
262
+ });
263
+
264
+ it('includes the reason for keyboard increments', async () => {
265
+ const onValueChange = vi.fn();
266
+ await render(<NumberField defaultValue={1} onValueChange={onValueChange} />);
267
+ const input = screen.getByRole('textbox');
268
+
269
+ await act(async () => {
270
+ input.focus();
271
+ });
272
+ fireEvent.keyDown(input, { key: 'ArrowUp' });
273
+
274
+ expect(onValueChange).toHaveBeenCalledTimes(1);
275
+ const [, details] = onValueChange.mock.calls[0] as [
276
+ number | null,
277
+ NumberFieldBase.Root.ChangeEventDetails,
278
+ ];
279
+ expect(details.reason).toBe('keyboard');
280
+ });
281
+
282
+ it('includes the reason for increment button presses', async () => {
283
+ const onValueChange = vi.fn();
284
+ await render(<NumberField defaultValue={1} onValueChange={onValueChange} />);
285
+ const incrementButton = screen.getByRole('button', { name: 'Increase' });
286
+
287
+ fireEvent.click(incrementButton);
288
+
289
+ expect(onValueChange.mock.calls.length).toBe(1);
290
+ const [, details] = onValueChange.mock.calls[0] as [
291
+ number | null,
292
+ NumberFieldBase.Root.ChangeEventDetails,
293
+ ];
294
+ expect(details.reason).toBe('increment-press');
295
+ });
296
+
297
+ it('includes the reason for decrement button presses', async () => {
298
+ const onValueChange = vi.fn();
299
+ await render(<NumberField defaultValue={1} onValueChange={onValueChange} />);
300
+ const decrementButton = screen.getByRole('button', { name: 'Decrease' });
301
+
302
+ fireEvent.click(decrementButton);
303
+
304
+ expect(onValueChange.mock.calls.length).toBe(1);
305
+ const [, details] = onValueChange.mock.calls[0] as [
306
+ number | null,
307
+ NumberFieldBase.Root.ChangeEventDetails,
308
+ ];
309
+ expect(details.reason).toBe('decrement-press');
310
+ });
311
+
312
+ it('includes the reason for wheel scrubbing', async () => {
313
+ const onValueChange = vi.fn();
314
+ await render(<NumberField allowWheelScrub defaultValue={4} onValueChange={onValueChange} />);
315
+ const input = screen.getByRole('textbox');
316
+
317
+ await act(async () => {
318
+ input.focus();
319
+ });
320
+ fireEvent.wheel(input, { deltaY: -100 });
321
+
322
+ expect(onValueChange.mock.calls.length).toBe(1);
323
+ const [, details] = onValueChange.mock.calls[0] as [
324
+ number | null,
325
+ NumberFieldBase.Root.ChangeEventDetails,
326
+ ];
327
+ expect(details.reason).toBe('wheel');
328
+ });
329
+ });
330
+
331
+ describe('typing behavior (parseable changes)', () => {
332
+ it('fires onValueChange for each parseable change while typing', async () => {
333
+ const onValueChange = vi.fn();
334
+ const onValueCommitted = vi.fn();
335
+ await render(
336
+ <NumberField onValueChange={onValueChange} onValueCommitted={onValueCommitted} />,
337
+ );
338
+ const input = screen.getByRole('textbox');
339
+
340
+ // Type '1' -> parseable
341
+ fireEvent.change(input, { target: { value: '1' } });
342
+ // Type '12' -> parseable
343
+ fireEvent.change(input, { target: { value: '12' } });
344
+ // Type '12.' -> parseable (treated as 12)
345
+ fireEvent.change(input, { target: { value: '12.' } });
346
+ // Type '12.a' -> not parseable, should not fire
347
+ fireEvent.change(input, { target: { value: '12.a' } });
348
+
349
+ expect(onValueChange.mock.calls.length).toBe(3);
350
+ expect(onValueChange.mock.calls[0][0]).toBe(1);
351
+ expect(onValueChange.mock.calls[1][0]).toBe(12);
352
+ expect(onValueChange.mock.calls[2][0]).toBe(12);
353
+
354
+ expect(onValueCommitted.mock.calls.length).toBe(0);
355
+ });
356
+
357
+ it('does not fire onValueChange for non-numeric composition/partial input', async () => {
358
+ const onValueChange = vi.fn();
359
+ const onValueCommitted = vi.fn();
360
+ await render(
361
+ <NumberField onValueChange={onValueChange} onValueCommitted={onValueCommitted} />,
362
+ );
363
+ const input = screen.getByRole('textbox');
364
+
365
+ // Simulate IME composition of non-numeric text; intermediate values like 'ni'
366
+ fireEvent.compositionStart(input);
367
+ fireEvent.change(input, { target: { value: 'n' } });
368
+ fireEvent.change(input, { target: { value: 'ni' } });
369
+ fireEvent.compositionEnd(input);
370
+
371
+ expect(onValueChange.mock.calls.length).toBe(0);
372
+
373
+ // Now enter a Han numeral which is parseable
374
+ fireEvent.change(input, { target: { value: '一' } });
375
+ expect(onValueChange.mock.calls.length).toBe(1);
376
+ expect(onValueChange.mock.calls[0][0]).toBe(1);
377
+
378
+ expect(onValueCommitted.mock.calls.length).toBe(0);
379
+ fireEvent.blur(input);
380
+ expect(onValueCommitted.mock.calls.length).toBe(1);
381
+ expect(onValueCommitted.mock.calls[0][0]).toBe(1);
382
+ });
383
+
384
+ it('handles sign and decimal partials vs. parseable numbers', async () => {
385
+ const onValueChange = vi.fn();
386
+ const onValueCommitted = vi.fn();
387
+ await render(
388
+ <NumberField onValueChange={onValueChange} onValueCommitted={onValueCommitted} min={-10} />,
389
+ );
390
+ const input = screen.getByRole('textbox');
391
+
392
+ // '-' or '.' alone aren't parseable
393
+ fireEvent.change(input, { target: { value: '-' } });
394
+ fireEvent.change(input, { target: { value: '.' } });
395
+ // '0.' is parseable (-> 0)
396
+ fireEvent.change(input, { target: { value: '0.' } });
397
+ fireEvent.change(input, { target: { value: '-1' } });
398
+ fireEvent.change(input, { target: { value: '-1.5' } });
399
+
400
+ expect(onValueChange.mock.calls.length).toBe(3);
401
+ expect(onValueChange.mock.calls[0][0]).toBe(0);
402
+ expect(onValueChange.mock.calls[1][0]).toBe(-1);
403
+ expect(onValueChange.mock.calls[2][0]).toBe(-1.5);
404
+
405
+ // No commit until blur
406
+ expect(onValueCommitted.mock.calls.length).toBe(0);
407
+
408
+ fireEvent.blur(input);
409
+ expect(onValueCommitted.mock.calls.length).toBe(1);
410
+ expect(onValueCommitted.mock.calls[0][0]).toBe(-1.5);
411
+ });
412
+
413
+ it('allows typing a decimal while replacing a selection', async () => {
414
+ await render(<NumberField defaultValue={12.3} locale="en-US" />);
415
+ const input = screen.getByRole<HTMLInputElement>('textbox');
416
+
417
+ await act(async () => {
418
+ input.focus();
419
+ });
420
+
421
+ const decimalIndex = input.value.indexOf('.');
422
+ expect(decimalIndex).toBeGreaterThan(-1);
423
+ await act(async () => {
424
+ input.setSelectionRange(1, decimalIndex + 2);
425
+ });
426
+
427
+ const keydownResult = fireEvent.keyDown(input, { key: '.' });
428
+ expect(keydownResult).toBe(true);
429
+ });
430
+
431
+ it('accepts grouping while typing and parses progressively', async () => {
432
+ const onValueChange = vi.fn();
433
+ const onValueCommitted = vi.fn();
434
+ await render(
435
+ <NumberField onValueChange={onValueChange} onValueCommitted={onValueCommitted} />,
436
+ );
437
+ const input = screen.getByRole('textbox');
438
+
439
+ fireEvent.change(input, { target: { value: '1' } }); // 1
440
+ fireEvent.change(input, { target: { value: '1,' } }); // 1 (group symbol)
441
+ fireEvent.change(input, { target: { value: '1,2' } }); // 12
442
+ fireEvent.change(input, { target: { value: '1,23' } }); // 123
443
+ fireEvent.change(input, { target: { value: '1,234' } }); // 1234
444
+
445
+ expect(onValueChange.mock.calls.length).toBe(5);
446
+ expect(onValueChange.mock.calls[0][0]).toBe(1);
447
+ expect(onValueChange.mock.calls[1][0]).toBe(1);
448
+ expect(onValueChange.mock.calls[2][0]).toBe(12);
449
+ expect(onValueChange.mock.calls[3][0]).toBe(123);
450
+ expect(onValueChange.mock.calls[4][0]).toBe(1234);
451
+
452
+ expect(onValueCommitted.mock.calls.length).toBe(0);
453
+ fireEvent.blur(input);
454
+ expect(onValueCommitted.mock.calls.length).toBe(1);
455
+ expect(onValueCommitted.mock.calls[0][0]).toBe(1234);
456
+ });
457
+
458
+ it('respects locale decimal separator while typing (de-DE)', async () => {
459
+ const onValueChange = vi.fn();
460
+ const onValueCommitted = vi.fn();
461
+ await render(
462
+ <NumberField
463
+ onValueChange={onValueChange}
464
+ onValueCommitted={onValueCommitted}
465
+ locale="de-DE"
466
+ />,
467
+ );
468
+ const input = screen.getByRole('textbox');
469
+
470
+ fireEvent.change(input, { target: { value: '1' } }); // 1
471
+ fireEvent.change(input, { target: { value: '1,' } }); // 1 (decimal separator typed)
472
+ fireEvent.change(input, { target: { value: '1,5' } }); // 1.5
473
+
474
+ expect(onValueChange.mock.calls.length).toBe(3);
475
+ expect(onValueChange.mock.calls[0][0]).toBe(1);
476
+ expect(onValueChange.mock.calls[1][0]).toBe(1);
477
+ expect(onValueChange.mock.calls[2][0]).toBe(1.5);
478
+
479
+ fireEvent.blur(input);
480
+ expect(onValueCommitted.mock.calls.length).toBe(1);
481
+ expect(onValueCommitted.mock.calls[0][0]).toBe(1.5);
482
+ });
483
+
484
+ it('parses percent while typing and commits canonical percent value', async () => {
485
+ const onValueChange = vi.fn();
486
+ const onValueCommitted = vi.fn();
487
+ await render(
488
+ <NumberField
489
+ onValueChange={onValueChange}
490
+ onValueCommitted={onValueCommitted}
491
+ format={{ style: 'percent' }}
492
+ />,
493
+ );
494
+ const input = screen.getByRole('textbox');
495
+
496
+ // Typing digits in percent style represents a fraction (12 -> 0.12)
497
+ fireEvent.change(input, { target: { value: '12' } });
498
+ // Typing with explicit percent sign also remains 0.12
499
+ fireEvent.change(input, { target: { value: '12%' } });
500
+
501
+ expect(onValueChange.mock.calls.length).toBe(2);
502
+ expect(onValueChange.mock.calls[0][0]).toBe(0.12);
503
+ expect(onValueChange.mock.calls[1][0]).toBe(0.12);
504
+ expect(onValueCommitted.mock.calls.length).toBe(0);
505
+
506
+ fireEvent.blur(input);
507
+ expect(onValueCommitted.mock.calls.length).toBe(1);
508
+ expect(onValueCommitted.mock.calls[0][0]).toBe(0.12);
509
+ });
510
+
511
+ it('parses an interleaved percent sign while typing (1%2 -> 12%)', async () => {
512
+ const onValueCommitted = vi.fn();
513
+ await render(
514
+ <NumberField
515
+ defaultValue={0.01}
516
+ format={{ style: 'percent' }}
517
+ locale="en-US"
518
+ onValueCommitted={onValueCommitted}
519
+ />,
520
+ );
521
+
522
+ const input = screen.getByRole('textbox');
523
+ expect(input).toHaveValue('1%');
524
+
525
+ // Typing `2` after the rendered `1%` yields `1%2`, which must reformat to `12%` on blur.
526
+ fireEvent.focus(input);
527
+ fireEvent.change(input, { target: { value: '1%2' } });
528
+ fireEvent.blur(input);
529
+
530
+ expect(input).toHaveValue('12%');
531
+ expect(onValueCommitted.mock.calls.length).toBe(1);
532
+ expect(onValueCommitted.mock.calls[0][0]).toBe(0.12);
533
+ });
534
+
535
+ it('accepts currency symbol while typing and parses numeric value', async () => {
536
+ const onValueChange = vi.fn();
537
+ await render(
538
+ <NumberField
539
+ onValueChange={onValueChange}
540
+ format={{ style: 'currency', currency: 'USD' }}
541
+ />,
542
+ );
543
+ const input = screen.getByRole('textbox');
544
+
545
+ fireEvent.change(input, { target: { value: '$1' } });
546
+ fireEvent.change(input, { target: { value: '$1,2' } });
547
+
548
+ expect(onValueChange.mock.calls.length).toBe(2);
549
+ expect(onValueChange.mock.calls[0][0]).toBe(1);
550
+ expect(onValueChange.mock.calls[1][0]).toBe(12);
551
+ });
552
+
553
+ it('allows deleting trailing currency symbols with locale literals', async () => {
554
+ const onValueChange = vi.fn();
555
+ const format: Intl.NumberFormatOptions = {
556
+ style: 'currency',
557
+ currency: 'EUR',
558
+ minimumFractionDigits: 2,
559
+ maximumFractionDigits: 2,
560
+ };
561
+ const formatter = new Intl.NumberFormat('de-DE', format);
562
+
563
+ await render(
564
+ <NumberField
565
+ defaultValue={12.34}
566
+ locale="de-DE"
567
+ format={format}
568
+ onValueChange={onValueChange}
569
+ />,
570
+ );
571
+ const input = screen.getByRole('textbox');
572
+ const formatted = formatter.format(12.34);
573
+ const withoutCurrency = formatted.replace('€', '');
574
+
575
+ fireEvent.change(input, { target: { value: withoutCurrency } });
576
+
577
+ expect(input).toHaveValue(withoutCurrency);
578
+ expect(onValueChange.mock.calls.length).toBe(1);
579
+ expect(onValueChange.mock.calls[0][0]).toBe(12.34);
580
+ });
581
+
582
+ it('allows backspace to remove trailing currency symbol that follows a locale literal', async () => {
583
+ const onValueChange = vi.fn();
584
+ const format: Intl.NumberFormatOptions = {
585
+ style: 'currency',
586
+ currency: 'EUR',
587
+ minimumFractionDigits: 2,
588
+ maximumFractionDigits: 2,
589
+ };
590
+ const formatter = new Intl.NumberFormat('de-DE', format);
591
+
592
+ await render(
593
+ <NumberField
594
+ defaultValue={12.34}
595
+ locale="de-DE"
596
+ format={format}
597
+ onValueChange={onValueChange}
598
+ />,
599
+ );
600
+
601
+ const input = screen.getByRole('textbox');
602
+ const formatted = formatter.format(12.34);
603
+ const afterBackspace = formatted.slice(0, -1);
604
+
605
+ await act(async () => {
606
+ input.focus();
607
+ });
608
+
609
+ const keydownResult = fireEvent.keyDown(input, { key: 'Backspace' });
610
+ expect(keydownResult).toBe(true);
611
+
612
+ fireEvent.change(input, { target: { value: afterBackspace } });
613
+
614
+ expect(input).toHaveValue(afterBackspace);
615
+ expect(onValueChange.mock.calls.length).toBe(1);
616
+ expect(onValueChange.mock.calls[0][0]).toBe(12.34);
617
+ });
618
+
619
+ it('does not commit on blur for invalid input', async () => {
620
+ const onValueCommitted = vi.fn();
621
+ await render(<NumberField onValueCommitted={onValueCommitted} />);
622
+ const input = screen.getByRole('textbox');
623
+
624
+ fireEvent.change(input, { target: { value: '.' } });
625
+ expect(input).toHaveValue('.');
626
+ fireEvent.blur(input);
627
+
628
+ expect(onValueCommitted.mock.calls.length).toBe(0);
629
+ });
630
+ });
631
+
632
+ describe('prop: onValueCommitted', () => {
633
+ it('fires on blur with committed numeric value', async () => {
634
+ const onValueCommitted = vi.fn();
635
+ await render(<NumberField onValueCommitted={onValueCommitted} />);
636
+ const input = screen.getByRole('textbox');
637
+
638
+ fireEvent.focus(input);
639
+ fireEvent.change(input, { target: { value: '123.' } });
640
+ fireEvent.blur(input);
641
+
642
+ expect(onValueCommitted.mock.calls.length).toBe(1);
643
+ // Canonicalizes to 123
644
+ expect(onValueCommitted.mock.calls[0][0]).toBe(123);
645
+ });
646
+
647
+ it('fires null on blur when input is cleared', async () => {
648
+ const onValueCommitted = vi.fn();
649
+ await render(<NumberField defaultValue={5} onValueCommitted={onValueCommitted} />);
650
+ const input = screen.getByRole('textbox');
651
+
652
+ fireEvent.focus(input);
653
+ fireEvent.change(input, { target: { value: '' } });
654
+ fireEvent.blur(input);
655
+
656
+ expect(onValueCommitted.mock.calls.length).toBe(1);
657
+ expect(onValueCommitted.mock.calls[0][0]).toBe(null);
658
+ });
659
+
660
+ it('reports and displays the clamped value on blur, not the raw input', async () => {
661
+ const onValueCommitted = vi.fn();
662
+ await render(<NumberField max={10} onValueCommitted={onValueCommitted} />);
663
+ const input = screen.getByRole('textbox');
664
+
665
+ fireEvent.focus(input);
666
+ fireEvent.change(input, { target: { value: '1000' } });
667
+ fireEvent.blur(input);
668
+
669
+ expect(onValueCommitted.mock.calls.length).toBe(1);
670
+ expect(onValueCommitted.mock.calls[0][0]).toBe(10);
671
+ expect(input).toHaveValue('10');
672
+ });
673
+
674
+ it('reports and displays the min-clamped value on blur, not the raw input', async () => {
675
+ const onValueCommitted = vi.fn();
676
+ await render(<NumberField min={0} onValueCommitted={onValueCommitted} />);
677
+ const input = screen.getByRole('textbox');
678
+
679
+ fireEvent.focus(input);
680
+ fireEvent.change(input, { target: { value: '-50' } });
681
+ fireEvent.blur(input);
682
+
683
+ expect(onValueCommitted.mock.calls.length).toBe(1);
684
+ expect(onValueCommitted.mock.calls[0][0]).toBe(0);
685
+ expect(input).toHaveValue('0');
686
+ });
687
+
688
+ it('fires on keyboard interactions (ArrowUp/Down/Home/End)', async () => {
689
+ const onValueCommitted = vi.fn();
690
+ await render(
691
+ <NumberField defaultValue={0} min={-10} max={10} onValueCommitted={onValueCommitted} />,
692
+ );
693
+
694
+ const input = screen.getByRole('textbox');
695
+ await act(async () => input.focus());
696
+
697
+ fireEvent.keyDown(input, { key: 'ArrowUp' });
698
+ expect(onValueCommitted.mock.calls.length).toBe(1);
699
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(1);
700
+
701
+ fireEvent.keyDown(input, { key: 'ArrowDown' });
702
+ expect(onValueCommitted.mock.calls.length).toBe(2);
703
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(0);
704
+
705
+ fireEvent.keyDown(input, { key: 'Home' });
706
+ expect(onValueCommitted.mock.calls.length).toBe(3);
707
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(-10);
708
+
709
+ fireEvent.keyDown(input, { key: 'End' });
710
+ expect(onValueCommitted.mock.calls.length).toBe(4);
711
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(10);
712
+ });
713
+
714
+ it('fires when using increment/decrement buttons', async () => {
715
+ const onValueCommitted = vi.fn();
716
+ await render(<NumberField defaultValue={0} onValueCommitted={onValueCommitted} />);
717
+
718
+ const input = screen.getByRole('textbox');
719
+ const inc = screen.getByLabelText('Increase');
720
+ const dec = screen.getByLabelText('Decrease');
721
+
722
+ fireEvent.click(inc);
723
+ expect(onValueCommitted.mock.calls.length).toBe(1);
724
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(1);
725
+ expect(input).toHaveValue('1');
726
+
727
+ fireEvent.click(dec);
728
+ expect(onValueCommitted.mock.calls.length).toBe(2);
729
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(0);
730
+ expect(input).toHaveValue('0');
731
+ });
732
+
733
+ it('includes the correct reason for increment and decrement button presses', async () => {
734
+ const onValueCommitted = vi.fn();
735
+ await render(<NumberField defaultValue={0} onValueCommitted={onValueCommitted} />);
736
+
737
+ const inc = screen.getByLabelText('Increase');
738
+ const dec = screen.getByLabelText('Decrease');
739
+
740
+ fireEvent.click(inc);
741
+ expect(onValueCommitted.mock.lastCall?.[1].reason).toBe(REASONS.incrementPress);
742
+
743
+ fireEvent.click(dec);
744
+ expect(onValueCommitted.mock.lastCall?.[1].reason).toBe(REASONS.decrementPress);
745
+ });
746
+
747
+ it('does not fire when blurring an untouched empty field', async () => {
748
+ const onValueCommitted = vi.fn();
749
+ await render(<NumberField onValueCommitted={onValueCommitted} />);
750
+ const input = screen.getByRole('textbox');
751
+
752
+ fireEvent.focus(input);
753
+ fireEvent.blur(input);
754
+
755
+ expect(onValueCommitted.mock.calls.length).toBe(0);
756
+ });
757
+
758
+ it('does not fire on keyboard steps that do not change the value', async () => {
759
+ const onValueCommitted = vi.fn();
760
+ await render(
761
+ <NumberField defaultValue={5} min={0} max={5} onValueCommitted={onValueCommitted} />,
762
+ );
763
+ const input = screen.getByRole('textbox');
764
+ await act(async () => input.focus());
765
+
766
+ fireEvent.keyDown(input, { key: 'ArrowUp' });
767
+ fireEvent.keyDown(input, { key: 'End' });
768
+ expect(onValueCommitted.mock.calls.length).toBe(0);
769
+
770
+ fireEvent.keyDown(input, { key: 'ArrowDown' });
771
+ expect(onValueCommitted.mock.calls.length).toBe(1);
772
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(4);
773
+ });
774
+
775
+ it('fires once per press-release even after mouseleave/mouseenter during a hold', async () => {
776
+ const onValueCommitted = vi.fn();
777
+ await render(<NumberField defaultValue={0} onValueCommitted={onValueCommitted} />);
778
+ const inc = screen.getByLabelText('Increase');
779
+
780
+ fireEvent.pointerDown(inc, { button: 0 });
781
+ fireEvent.mouseLeave(inc);
782
+ fireEvent.mouseEnter(inc, { buttons: 1 });
783
+ fireEvent.pointerUp(inc, { button: 0 });
784
+
785
+ expect(onValueCommitted.mock.calls.length).toBe(1);
786
+ });
787
+
788
+ it('does not commit a canceled keyboard change', async () => {
789
+ const onValueChange = vi.fn((_value, details) => details.cancel());
790
+ const onValueCommitted = vi.fn();
791
+ await render(
792
+ <NumberField
793
+ defaultValue={0}
794
+ onValueChange={onValueChange}
795
+ onValueCommitted={onValueCommitted}
796
+ />,
797
+ );
798
+ const input = screen.getByRole('textbox');
799
+ await act(async () => input.focus());
800
+
801
+ fireEvent.keyDown(input, { key: 'ArrowUp' });
802
+
803
+ expect(input).toHaveValue('0');
804
+ expect(onValueCommitted.mock.calls.length).toBe(0);
805
+ });
806
+
807
+ it('does not commit a canceled clear on blur', async () => {
808
+ const onValueChange = vi.fn((_value, details) => details.cancel());
809
+ const onValueCommitted = vi.fn();
810
+ await render(
811
+ <NumberField
812
+ defaultValue={5}
813
+ onValueChange={onValueChange}
814
+ onValueCommitted={onValueCommitted}
815
+ />,
816
+ );
817
+ const input = screen.getByRole('textbox');
818
+
819
+ fireEvent.focus(input);
820
+ fireEvent.change(input, { target: { value: '' } });
821
+ fireEvent.blur(input);
822
+
823
+ expect(onValueCommitted.mock.calls.length).toBe(0);
824
+ });
825
+ });
826
+
827
+ describe('prop: disabled', () => {
828
+ it('should disable the input', async () => {
829
+ await render(<NumberField disabled />);
830
+ const input = screen.getByRole('textbox');
831
+ expect(input).toHaveAttribute('disabled');
832
+ });
833
+ });
834
+
835
+ describe('prop: readOnly', () => {
836
+ it('should mark the input as readOnly', async () => {
837
+ await render(<NumberField readOnly />);
838
+ const input = screen.getByRole('textbox');
839
+ expect(input).toHaveAttribute('readonly');
840
+ });
841
+
842
+ it('keeps focus state in sync on a readOnly field', async () => {
843
+ await render(
844
+ <Field.Root>
845
+ <NumberFieldBase.Root readOnly>
846
+ <NumberFieldBase.Input data-testid="input" />
847
+ </NumberFieldBase.Root>
848
+ </Field.Root>,
849
+ );
850
+ const input = screen.getByTestId('input');
851
+
852
+ fireEvent.focus(input);
853
+ expect(input).toHaveAttribute('data-focused', '');
854
+
855
+ fireEvent.blur(input);
856
+ expect(input).not.toHaveAttribute('data-focused');
857
+ });
858
+
859
+ it('does not render aria-readonly on stepper buttons', async () => {
860
+ await render(<NumberField readOnly />);
861
+
862
+ const input = screen.getByRole('textbox');
863
+ const increment = screen.getByRole('button', { name: 'Increase' });
864
+ const decrement = screen.getByRole('button', { name: 'Decrease' });
865
+
866
+ // `aria-readonly` isn't valid on the `button` role; the readonly state lives on the input,
867
+ // and the steppers are exposed as unavailable via disabled semantics instead.
868
+ expect(input).toHaveAttribute('readonly');
869
+ expect(increment).not.toHaveAttribute('aria-readonly');
870
+ expect(decrement).not.toHaveAttribute('aria-readonly');
871
+ expect(increment).toHaveAttribute('aria-disabled', 'true');
872
+ expect(decrement).toHaveAttribute('aria-disabled', 'true');
873
+ });
874
+ });
875
+
876
+ describe('prop: required', () => {
877
+ it('should mark the input as required', async () => {
878
+ await render(<NumberField required />);
879
+ const input = screen.getByRole('textbox');
880
+ expect(input).toHaveAttribute('required');
881
+ });
882
+ });
883
+
884
+ describe('prop: name', () => {
885
+ it('should set the name attribute on the hidden input', async () => {
886
+ await render(<NumberField name="test" />);
887
+ const hiddenInput = screen.getByText('', {
888
+ selector: 'input[aria-hidden][type=number]',
889
+ });
890
+ expect(hiddenInput).toHaveAttribute('name', 'test');
891
+ });
892
+
893
+ it('marks the hidden input readOnly when the field is readOnly', async () => {
894
+ await render(<NumberField name="test" readOnly />);
895
+ const hiddenInput = screen.getByText('', {
896
+ selector: 'input[aria-hidden][type=number]',
897
+ });
898
+ expect(hiddenInput).toHaveAttribute('readonly');
899
+ });
900
+ });
901
+
902
+ describe('prop: min', () => {
903
+ it('prevents the raw value from going below the `min` prop', async () => {
904
+ const fn = vi.fn();
905
+
906
+ function App() {
907
+ const [value, setValue] = React.useState<number | null>(5);
908
+ return (
909
+ <NumberField
910
+ value={value}
911
+ onValueChange={(v) => {
912
+ fn(v);
913
+ setValue(v);
914
+ }}
915
+ min={5}
916
+ />
917
+ );
918
+ }
919
+
920
+ await render(<App />);
921
+
922
+ const input = screen.getByRole('textbox');
923
+ fireEvent.change(input, { target: { value: '4' } });
924
+
925
+ expect(input).toHaveValue('4');
926
+ expect(fn.mock.calls[0][0]).toBe(5);
927
+ });
928
+
929
+ it('allows the value to go above the `min` prop', async () => {
930
+ const fn = vi.fn();
931
+
932
+ function App() {
933
+ const [value, setValue] = React.useState<number | null>(5);
934
+ return (
935
+ <NumberField
936
+ value={value}
937
+ onValueChange={(v) => {
938
+ fn(v);
939
+ setValue(v);
940
+ }}
941
+ min={5}
942
+ />
943
+ );
944
+ }
945
+
946
+ await render(<App />);
947
+
948
+ const input = screen.getByRole('textbox');
949
+ fireEvent.change(input, { target: { value: '6' } });
950
+
951
+ expect(input).toHaveValue('6');
952
+ });
953
+ });
954
+
955
+ describe('prop: max', () => {
956
+ it('prevents the value from going above the `max` prop', async () => {
957
+ const fn = vi.fn();
958
+
959
+ function App() {
960
+ const [value, setValue] = React.useState<number | null>(5);
961
+ return (
962
+ <NumberField
963
+ value={value}
964
+ onValueChange={(v) => {
965
+ fn(v);
966
+ setValue(v);
967
+ }}
968
+ max={5}
969
+ />
970
+ );
971
+ }
972
+
973
+ await render(<App />);
974
+
975
+ const input = screen.getByRole('textbox');
976
+ fireEvent.change(input, { target: { value: '6' } });
977
+
978
+ expect(input).toHaveValue('6');
979
+ expect(fn.mock.calls[0][0]).toBe(5);
980
+ });
981
+
982
+ it('allows the value to go below the `max` prop', async () => {
983
+ const fn = vi.fn();
984
+
985
+ function App() {
986
+ const [value, setValue] = React.useState<number | null>(5);
987
+ return (
988
+ <NumberField
989
+ value={value}
990
+ onValueChange={(v) => {
991
+ fn(v);
992
+ setValue(v);
993
+ }}
994
+ max={5}
995
+ />
996
+ );
997
+ }
998
+
999
+ await render(<App />);
1000
+
1001
+ const input = screen.getByRole('textbox');
1002
+ fireEvent.change(input, { target: { value: '4' } });
1003
+
1004
+ expect(input).toHaveValue('4');
1005
+ expect(fn.mock.calls[0][0]).toBe(4);
1006
+ });
1007
+ });
1008
+
1009
+ describe('prop: allowOutOfRange', () => {
1010
+ it('allows typing a negative value via keyboard when min is 0', async () => {
1011
+ await render(<NumberField min={0} allowOutOfRange />);
1012
+ const input = screen.getByRole('textbox') as HTMLInputElement;
1013
+ input.focus();
1014
+
1015
+ // The minus key must not be blocked, so native underflow validation is reachable.
1016
+ const preventDefaultSpy = vi.fn();
1017
+ fireEvent.keyDown(input, { key: '-', preventDefault: preventDefaultSpy });
1018
+ expect(preventDefaultSpy).toHaveBeenCalledTimes(0);
1019
+
1020
+ fireEvent.change(input, { target: { value: '-1' } });
1021
+ expect(input).toHaveValue('-1');
1022
+ });
1023
+
1024
+ it('allows range overflow validation when true', async () => {
1025
+ await render(
1026
+ <form data-testid="form">
1027
+ <NumberFieldBase.Root name="quantity" max={5} allowOutOfRange>
1028
+ <NumberFieldBase.Group>
1029
+ <NumberFieldBase.Input />
1030
+ </NumberFieldBase.Group>
1031
+ </NumberFieldBase.Root>
1032
+ <button type="submit">Submit</button>
1033
+ </form>,
1034
+ );
1035
+
1036
+ const input = screen.getByRole('textbox');
1037
+ fireEvent.change(input, { target: { value: '6' } });
1038
+
1039
+ const hiddenInput = document.querySelector(
1040
+ 'input[type="number"][name="quantity"]',
1041
+ ) as HTMLInputElement;
1042
+
1043
+ expect(hiddenInput).not.toBe(null);
1044
+ expect(hiddenInput.value).toBe('6');
1045
+ expect(hiddenInput.validity.rangeOverflow).toBe(true);
1046
+
1047
+ const form = screen.getByTestId<HTMLFormElement>('form');
1048
+ expect(form.checkValidity()).toBe(false);
1049
+ });
1050
+
1051
+ it('still clamps step interactions when true', async () => {
1052
+ await render(
1053
+ <form data-testid="form">
1054
+ <NumberField defaultValue={5} max={5} allowOutOfRange name="quantity" />
1055
+ <button type="submit">Submit</button>
1056
+ </form>,
1057
+ );
1058
+
1059
+ const input = screen.getByRole('textbox');
1060
+ fireEvent.click(screen.getByLabelText('Increase'));
1061
+
1062
+ const hiddenInput = document.querySelector(
1063
+ 'input[type="number"][name="quantity"]',
1064
+ ) as HTMLInputElement;
1065
+
1066
+ expect(input).toHaveValue('5');
1067
+ expect(hiddenInput).not.toBe(null);
1068
+ expect(hiddenInput.value).toBe('5');
1069
+ expect(hiddenInput.validity.rangeOverflow).toBe(false);
1070
+
1071
+ const form = screen.getByTestId<HTMLFormElement>('form');
1072
+ expect(form.checkValidity()).toBe(true);
1073
+ });
1074
+
1075
+ it('clamps to range when false', async () => {
1076
+ await render(
1077
+ <form data-testid="form">
1078
+ <NumberFieldBase.Root name="quantity" max={5} allowOutOfRange={false}>
1079
+ <NumberFieldBase.Group>
1080
+ <NumberFieldBase.Input />
1081
+ </NumberFieldBase.Group>
1082
+ </NumberFieldBase.Root>
1083
+ <button type="submit">Submit</button>
1084
+ </form>,
1085
+ );
1086
+
1087
+ const input = screen.getByRole('textbox');
1088
+ fireEvent.change(input, { target: { value: '6' } });
1089
+
1090
+ const hiddenInput = document.querySelector(
1091
+ 'input[type="number"][name="quantity"]',
1092
+ ) as HTMLInputElement;
1093
+
1094
+ expect(hiddenInput).not.toBe(null);
1095
+ expect(hiddenInput.value).toBe('5');
1096
+ expect(hiddenInput.validity.rangeOverflow).toBe(false);
1097
+
1098
+ const form = screen.getByTestId<HTMLFormElement>('form');
1099
+ expect(form.checkValidity()).toBe(true);
1100
+ });
1101
+ });
1102
+
1103
+ describe('prop: step', () => {
1104
+ it('defaults to 1', async () => {
1105
+ await render(<NumberField defaultValue={5} />);
1106
+ const input = screen.getByRole('textbox');
1107
+ fireEvent.click(screen.getByLabelText('Increase'));
1108
+ expect(input).toHaveValue('6');
1109
+ });
1110
+
1111
+ it('should increment the value by the `step` prop', async () => {
1112
+ await render(<NumberField defaultValue={4} step={2} />);
1113
+ const input = screen.getByRole('textbox');
1114
+ fireEvent.click(screen.getByLabelText('Increase'));
1115
+ expect(input).toHaveValue('6');
1116
+ });
1117
+
1118
+ it('should snap when incrementing to the nearest multiple of the `step` prop', async () => {
1119
+ await render(<NumberField defaultValue={5} step={2} snapOnStep />);
1120
+ const input = screen.getByRole('textbox');
1121
+ fireEvent.click(screen.getByLabelText('Increase'));
1122
+ expect(input).toHaveValue('6');
1123
+ });
1124
+
1125
+ it('should decrement the value by the `step` prop', async () => {
1126
+ await render(<NumberField defaultValue={6} step={2} />);
1127
+ const input = screen.getByRole('textbox');
1128
+ fireEvent.click(screen.getByLabelText('Decrease'));
1129
+ expect(input).toHaveValue('4');
1130
+ });
1131
+
1132
+ it('should snap when decrementing to the nearest multiple of the `step` prop', async () => {
1133
+ await render(<NumberField defaultValue={5} step={2} snapOnStep />);
1134
+ const input = screen.getByRole('textbox');
1135
+ fireEvent.click(screen.getByLabelText('Decrease'));
1136
+ expect(input).toHaveValue('4');
1137
+ });
1138
+ });
1139
+
1140
+ describe.skipIf(isJSDOM)('prop: largeStep', () => {
1141
+ it('should increment the value by the default `largeStep` prop of 10 while holding the shift key', async () => {
1142
+ await render(<NumberField defaultValue={5} />);
1143
+ const input = screen.getByRole('textbox');
1144
+ fireEvent.pointerDown(screen.getByLabelText('Increase'), { shiftKey: true });
1145
+ expect(input).toHaveValue('15');
1146
+ });
1147
+
1148
+ it('should decrement the value by the default `largeStep` prop of 10 while holding the shift key', async () => {
1149
+ await render(<NumberField defaultValue={6} />);
1150
+ const input = screen.getByRole('textbox');
1151
+ fireEvent.pointerDown(screen.getByLabelText('Decrease'), { shiftKey: true });
1152
+ expect(input).toHaveValue('-4');
1153
+ });
1154
+
1155
+ it('should use explicit `largeStep` value if provided while holding the shift key', async () => {
1156
+ await render(<NumberField defaultValue={5} largeStep={5} />);
1157
+ const input = screen.getByRole('textbox');
1158
+ fireEvent.pointerDown(screen.getByLabelText('Increase'), { shiftKey: true });
1159
+ expect(input).toHaveValue('10');
1160
+ });
1161
+
1162
+ it('should not use the `largeStep` prop if no longer holding the shift key', async () => {
1163
+ await render(<NumberField defaultValue={5} largeStep={5} />);
1164
+ const input = screen.getByRole('textbox');
1165
+ fireEvent.pointerDown(screen.getByLabelText('Increase'), { shiftKey: true });
1166
+ expect(input).toHaveValue('10');
1167
+ fireEvent.keyUp(input, { shiftKey: true });
1168
+ fireEvent.pointerDown(screen.getByLabelText('Increase'), { shiftKey: true });
1169
+ expect(input).toHaveValue('15');
1170
+ });
1171
+ });
1172
+
1173
+ describe.skipIf(isJSDOM)('prop: smallStep', () => {
1174
+ it('should increment the value by the default `smallStep` prop of 0.1 while holding the alt key', async () => {
1175
+ await render(<NumberField defaultValue={5} />);
1176
+ const input = screen.getByRole('textbox');
1177
+ fireEvent.pointerDown(screen.getByLabelText('Increase'), { altKey: true });
1178
+ expect(input).toHaveValue((5.1).toLocaleString());
1179
+ });
1180
+
1181
+ it('should decrement the value by the default `smallStep` prop of 0.1 while holding the alt key', async () => {
1182
+ await render(<NumberField defaultValue={6} />);
1183
+ const input = screen.getByRole('textbox');
1184
+ fireEvent.pointerDown(screen.getByLabelText('Decrease'), { altKey: true });
1185
+ expect(input).toHaveValue((5.9).toLocaleString());
1186
+ });
1187
+
1188
+ it('should use explicit `smallStep` value if provided while holding the alt key', async () => {
1189
+ await render(<NumberField defaultValue={5} smallStep={0.5} />);
1190
+ const input = screen.getByRole('textbox');
1191
+ fireEvent.keyDown(document.body, { altKey: true });
1192
+ fireEvent.pointerDown(screen.getByLabelText('Increase'), { altKey: true });
1193
+ expect(input).toHaveValue((5.5).toLocaleString());
1194
+ });
1195
+
1196
+ it('should not use the `smallStep` prop if no longer holding the alt key', async () => {
1197
+ await render(<NumberField defaultValue={5} smallStep={0.5} />);
1198
+ const input = screen.getByRole('textbox');
1199
+ const button = screen.getByLabelText('Increase');
1200
+ fireEvent.pointerDown(button, { altKey: true });
1201
+ expect(input).toHaveValue((5.5).toLocaleString());
1202
+ fireEvent.keyUp(input, { altKey: false });
1203
+ fireEvent.pointerDown(button);
1204
+ expect(input).toHaveValue((6.5).toLocaleString());
1205
+ });
1206
+ });
1207
+
1208
+ describe('prop: format', () => {
1209
+ it('reformats the visible text when the format prop changes at the same value', async () => {
1210
+ const { setProps } = await render(<NumberField value={1000} />);
1211
+ const input = screen.getByRole('textbox');
1212
+ expect(input).toHaveValue(new Intl.NumberFormat().format(1000));
1213
+
1214
+ await setProps({ format: { style: 'currency', currency: 'USD' } });
1215
+ expect(input).toHaveValue(
1216
+ new Intl.NumberFormat(undefined, { style: 'currency', currency: 'USD' }).format(1000),
1217
+ );
1218
+ });
1219
+
1220
+ it('should format the value using the provided options', async () => {
1221
+ await render(
1222
+ <NumberField defaultValue={1000} format={{ style: 'currency', currency: 'USD' }} />,
1223
+ );
1224
+ const input = screen.getByRole('textbox');
1225
+ const expectedValue = new Intl.NumberFormat(undefined, {
1226
+ style: 'currency',
1227
+ currency: 'USD',
1228
+ }).format(1000);
1229
+ expect(input).toHaveValue(expectedValue);
1230
+ });
1231
+
1232
+ it('reflects controlled value changes in the textbox', async () => {
1233
+ function App() {
1234
+ const [val, setVal] = React.useState<number | null>(1);
1235
+ return (
1236
+ <div>
1237
+ <NumberField value={val} onValueChange={setVal} />
1238
+ <button onClick={() => setVal(1234)}>set</button>
1239
+ </div>
1240
+ );
1241
+ }
1242
+
1243
+ const { user } = await render(<App />);
1244
+ const input = screen.getByRole('textbox');
1245
+
1246
+ expect(input).toHaveValue('1');
1247
+
1248
+ await user.click(screen.getByText('set'));
1249
+ expect(input).toHaveValue((1234).toLocaleString());
1250
+ });
1251
+ });
1252
+
1253
+ describe('prop: allowWheelScrub', () => {
1254
+ it('does not scrub on wheel when disabled', async () => {
1255
+ const onValueChange = vi.fn();
1256
+ await render(
1257
+ <NumberField defaultValue={5} allowWheelScrub disabled onValueChange={onValueChange} />,
1258
+ );
1259
+ fireEvent.wheel(screen.getByRole('textbox'), { deltaY: 1 });
1260
+ expect(onValueChange).not.toHaveBeenCalled();
1261
+ });
1262
+
1263
+ it('does not scrub on wheel when readOnly', async () => {
1264
+ const onValueChange = vi.fn();
1265
+ await render(
1266
+ <NumberField defaultValue={5} allowWheelScrub readOnly onValueChange={onValueChange} />,
1267
+ );
1268
+ fireEvent.wheel(screen.getByRole('textbox'), { deltaY: 1 });
1269
+ expect(onValueChange).not.toHaveBeenCalled();
1270
+ });
1271
+
1272
+ it('should allow the user to scrub the input value with the mouse wheel', async () => {
1273
+ await render(<NumberField defaultValue={5} allowWheelScrub />);
1274
+ const input = screen.getByRole('textbox');
1275
+ await act(async () => input.focus());
1276
+ fireEvent.wheel(input, { deltaY: 1 });
1277
+ expect(input).toHaveValue('4');
1278
+ fireEvent.wheel(input, { deltaY: -1 });
1279
+ expect(input).toHaveValue('5');
1280
+ });
1281
+
1282
+ it('should not allow the user to scrub the input value with the mouse wheel if `allowWheelScrub` is `false`', async () => {
1283
+ await render(<NumberField defaultValue={5} allowWheelScrub={false} />);
1284
+ const input = screen.getByRole('textbox');
1285
+ await act(async () => input.focus());
1286
+ fireEvent.wheel(input, { deltaY: 1 });
1287
+ expect(input).toHaveValue('5');
1288
+ fireEvent.wheel(input, { deltaY: -5 });
1289
+ expect(input).toHaveValue('5');
1290
+ });
1291
+
1292
+ it('does not scrub on wheel while pinch-zooming (ctrlKey)', async () => {
1293
+ const onValueChange = vi.fn();
1294
+ await render(<NumberField defaultValue={5} allowWheelScrub onValueChange={onValueChange} />);
1295
+ const input = screen.getByRole('textbox');
1296
+ await act(async () => input.focus());
1297
+
1298
+ fireEvent.wheel(input, { deltaY: 1, ctrlKey: true });
1299
+ expect(onValueChange).not.toHaveBeenCalled();
1300
+ });
1301
+
1302
+ it('does not scrub on wheel when the input is not focused', async () => {
1303
+ const onValueChange = vi.fn();
1304
+ await render(<NumberField defaultValue={5} allowWheelScrub onValueChange={onValueChange} />);
1305
+ const input = screen.getByRole('textbox');
1306
+
1307
+ fireEvent.wheel(input, { deltaY: 1 });
1308
+ expect(onValueChange).not.toHaveBeenCalled();
1309
+ });
1310
+
1311
+ it('uses largeStep when shift is held during wheel', async () => {
1312
+ const onValueChange = vi.fn();
1313
+ await render(
1314
+ <NumberField
1315
+ defaultValue={0}
1316
+ largeStep={10}
1317
+ allowWheelScrub
1318
+ onValueChange={onValueChange}
1319
+ />,
1320
+ );
1321
+ const input = screen.getByRole('textbox');
1322
+ await act(async () => input.focus());
1323
+
1324
+ fireEvent.wheel(input, { deltaY: -1, shiftKey: true });
1325
+ expect(onValueChange.mock.lastCall?.[0]).toBe(10);
1326
+ });
1327
+
1328
+ it('calls onValueChange and onValueCommitted on wheel', async () => {
1329
+ const onValueChange = vi.fn();
1330
+ const onValueCommitted = vi.fn();
1331
+ await render(
1332
+ <NumberField
1333
+ defaultValue={5}
1334
+ allowWheelScrub
1335
+ onValueChange={onValueChange}
1336
+ onValueCommitted={onValueCommitted}
1337
+ />,
1338
+ );
1339
+ const input = screen.getByRole('textbox');
1340
+ await act(async () => input.focus());
1341
+
1342
+ fireEvent.wheel(input, { deltaY: 1 });
1343
+ expect(onValueChange.mock.calls.length).toBe(1);
1344
+ expect(onValueChange.mock.lastCall?.[0]).toBe(4);
1345
+ expect(onValueCommitted.mock.calls.length).toBe(1);
1346
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(4);
1347
+ expect(onValueCommitted.mock.lastCall?.[1].reason).toBe(REASONS.wheel);
1348
+
1349
+ fireEvent.wheel(input, { deltaY: -1 });
1350
+ expect(onValueChange.mock.calls.length).toBe(2);
1351
+ expect(onValueChange.mock.lastCall?.[0]).toBe(5);
1352
+ expect(onValueCommitted.mock.calls.length).toBe(2);
1353
+ expect(onValueCommitted.mock.lastCall?.[0]).toBe(5);
1354
+
1355
+ // Blur doesn't commit again; the wheel changes were already committed.
1356
+ fireEvent.blur(input);
1357
+ expect(onValueCommitted.mock.calls.length).toBe(2);
1358
+ });
1359
+
1360
+ it('syncs the visible input value when using the mouse wheel after pasting', async () => {
1361
+ const onValueChange = vi.fn();
1362
+
1363
+ await render(<NumberField defaultValue={10} allowWheelScrub onValueChange={onValueChange} />);
1364
+
1365
+ const input = screen.getByRole('textbox') as HTMLInputElement;
1366
+ await act(async () => input.focus());
1367
+
1368
+ // Select the existing value so the paste replaces it rather than inserting at the caret.
1369
+ input.select();
1370
+ pasteText(input, '20');
1371
+
1372
+ expect(input).toHaveValue('20');
1373
+ expect(onValueChange.mock.lastCall?.[0]).toBe(20);
1374
+
1375
+ fireEvent.wheel(input, { deltaY: -1 });
1376
+
1377
+ expect(onValueChange.mock.lastCall?.[0]).toBe(21);
1378
+ expect(input).toHaveValue('21');
1379
+ });
1380
+ });
1381
+
1382
+ describe('Form', () => {
1383
+ it('should include the input value in the form submission', async ({ skip }) => {
1384
+ if (isJSDOM) {
1385
+ // FormData is not available in JSDOM
1386
+ skip();
1387
+ }
1388
+
1389
+ let fieldValue = '';
1390
+
1391
+ await render(
1392
+ <Form
1393
+ onSubmit={(event) => {
1394
+ event.preventDefault();
1395
+ const formData = new FormData(event.currentTarget);
1396
+ fieldValue = formData.get('test') as string;
1397
+ }}
1398
+ >
1399
+ <Field.Root name="test">
1400
+ <NumberFieldBase.Root defaultValue={undefined}>
1401
+ <NumberFieldBase.Input />
1402
+ </NumberFieldBase.Root>
1403
+ <button type="submit">Submit</button>
1404
+ </Field.Root>
1405
+ </Form>,
1406
+ );
1407
+
1408
+ const submitButton = screen.getByText('Submit');
1409
+ await act(async () => submitButton.click());
1410
+ expect(fieldValue).toBe('');
1411
+
1412
+ fireEvent.change(screen.getByRole('textbox'), { target: { value: '50' } });
1413
+ await act(async () => submitButton.click());
1414
+ expect(fieldValue).toBe('50');
1415
+ });
1416
+
1417
+ it('should not include formatting in the submitted value', async ({ skip }) => {
1418
+ if (isJSDOM) {
1419
+ // FormData is not available in JSDOM
1420
+ skip();
1421
+ }
1422
+
1423
+ const format: Intl.NumberFormatOptions = {
1424
+ style: 'currency',
1425
+ currency: 'EUR',
1426
+ minimumFractionDigits: 2,
1427
+ maximumFractionDigits: 2,
1428
+ };
1429
+
1430
+ let fieldValue = '';
1431
+
1432
+ await render(
1433
+ <Form
1434
+ onSubmit={(event) => {
1435
+ event.preventDefault();
1436
+ const formData = new FormData(event.currentTarget);
1437
+ fieldValue = formData.get('test') as string;
1438
+ }}
1439
+ >
1440
+ <Field.Root name="test">
1441
+ <NumberFieldBase.Root defaultValue={54.5} format={format} locale="de-DE">
1442
+ <NumberFieldBase.Input />
1443
+ </NumberFieldBase.Root>
1444
+ <button type="submit">Submit</button>
1445
+ </Field.Root>
1446
+ </Form>,
1447
+ );
1448
+
1449
+ const input = screen.getByRole('textbox');
1450
+ const expectedValue = new Intl.NumberFormat('de-DE', format).format(54.5);
1451
+ expect(input).toHaveValue(expectedValue);
1452
+
1453
+ const submitButton = screen.getByText('Submit');
1454
+
1455
+ await act(async () => submitButton.click());
1456
+
1457
+ expect(fieldValue).toBe('54.5');
1458
+ });
1459
+
1460
+ it.skipIf(isJSDOM)('submits to an external form when `form` is provided', async () => {
1461
+ let fieldValue = '';
1462
+
1463
+ await render(
1464
+ <React.Fragment>
1465
+ <form
1466
+ id="external-form"
1467
+ onSubmit={(event) => {
1468
+ event.preventDefault();
1469
+ const formData = new FormData(event.currentTarget);
1470
+ fieldValue = formData.get('test') as string;
1471
+ }}
1472
+ >
1473
+ <button type="submit">Submit</button>
1474
+ </form>
1475
+ <NumberFieldBase.Root name="test" form="external-form" defaultValue={54.5}>
1476
+ <NumberFieldBase.Input />
1477
+ </NumberFieldBase.Root>
1478
+ </React.Fragment>,
1479
+ );
1480
+
1481
+ await act(async () => screen.getByText('Submit').click());
1482
+
1483
+ expect(fieldValue).toBe('54.5');
1484
+ });
1485
+
1486
+ it('triggers native HTML validation on submit', async () => {
1487
+ const { user } = await render(
1488
+ <Form>
1489
+ <Field.Root name="test" data-testid="field">
1490
+ <NumberField required />
1491
+ <Field.Error match="valueMissing" data-testid="error">
1492
+ required
1493
+ </Field.Error>
1494
+ </Field.Root>
1495
+ <button type="submit">Submit</button>
1496
+ </Form>,
1497
+ );
1498
+
1499
+ const submit = screen.getByText('Submit');
1500
+
1501
+ expect(screen.queryByTestId('error')).toBe(null);
1502
+
1503
+ await user.click(submit);
1504
+
1505
+ const error = screen.getByTestId('error');
1506
+ expect(error).toHaveTextContent('required');
1507
+ });
1508
+
1509
+ it('focuses the input when the field receives an error from Form', async () => {
1510
+ function App() {
1511
+ const [errors, setErrors] = React.useState<Form.Props['errors']>({});
1512
+ return (
1513
+ <Form
1514
+ errors={errors}
1515
+ onSubmit={(event) => {
1516
+ event.preventDefault();
1517
+ setErrors({ quantity: 'server error' });
1518
+ }}
1519
+ >
1520
+ <Field.Root name="quantity" data-testid="field">
1521
+ <NumberField defaultValue={1} />
1522
+ <Field.Error data-testid="error" />
1523
+ </Field.Root>
1524
+ <button type="submit">Submit</button>
1525
+ </Form>
1526
+ );
1527
+ }
1528
+
1529
+ const { user } = await render(<App />);
1530
+ expect(screen.queryByTestId('error')).toBe(null);
1531
+ const submit = screen.getByText('Submit');
1532
+ await user.click(submit);
1533
+
1534
+ const input = screen.getByRole('textbox');
1535
+ expect(input).toHaveFocus();
1536
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1537
+ expect(screen.queryByTestId('error')).toHaveTextContent('server error');
1538
+ });
1539
+
1540
+ it('clears external errors on change', async () => {
1541
+ await render(
1542
+ <Form
1543
+ errors={{
1544
+ test: 'test',
1545
+ }}
1546
+ >
1547
+ <Field.Root name="test" data-testid="field">
1548
+ <NumberField defaultValue={1} />
1549
+ <Field.Error data-testid="error" />
1550
+ </Field.Root>
1551
+ </Form>,
1552
+ );
1553
+
1554
+ const input = screen.getByRole('textbox');
1555
+
1556
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1557
+ expect(screen.queryByTestId('error')).toHaveTextContent('test');
1558
+
1559
+ fireEvent.change(input, { target: { value: '5' } });
1560
+
1561
+ expect(input).not.toHaveAttribute('aria-invalid');
1562
+ expect(screen.queryByTestId('error')).toBe(null);
1563
+ });
1564
+
1565
+ it('revalidates immediately after form submission errors using increment button', async () => {
1566
+ const { user } = await render(
1567
+ <Form>
1568
+ <Field.Root name="quantity">
1569
+ <NumberField required />
1570
+ <Field.Error match="valueMissing" data-testid="error">
1571
+ required
1572
+ </Field.Error>
1573
+ </Field.Root>
1574
+ <button type="submit" data-testid="submit">
1575
+ Submit
1576
+ </button>
1577
+ </Form>,
1578
+ );
1579
+
1580
+ const submit = screen.getByTestId('submit');
1581
+ await user.click(submit);
1582
+
1583
+ expect(screen.getByTestId('error')).toHaveTextContent('required');
1584
+ const input = screen.getByRole('textbox');
1585
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1586
+
1587
+ const incrementButton = screen.getByLabelText('Increase');
1588
+ await user.click(incrementButton);
1589
+
1590
+ expect(screen.queryByTestId('error')).toBe(null);
1591
+ expect(input).not.toHaveAttribute('aria-invalid');
1592
+ });
1593
+
1594
+ it('should handle browser autofill', async () => {
1595
+ const onValueChange = vi.fn();
1596
+
1597
+ await render(
1598
+ <Field.Root name="quantity">
1599
+ <NumberFieldBase.Root onValueChange={onValueChange}>
1600
+ <NumberFieldBase.Input />
1601
+ </NumberFieldBase.Root>
1602
+ </Field.Root>,
1603
+ );
1604
+
1605
+ const input = screen.getByRole('textbox');
1606
+ const hiddenInput = document.querySelector('input[type="number"][name="quantity"]');
1607
+
1608
+ expect(hiddenInput).not.toBe(null);
1609
+ fireEvent.change(hiddenInput!, { target: { value: '42' } });
1610
+
1611
+ expect(onValueChange.mock.calls.length).toBe(1);
1612
+ expect(onValueChange.mock.calls[0][0]).toBe(42);
1613
+ expect(input).toHaveValue('42');
1614
+ });
1615
+
1616
+ it('validates the parsed number when handling browser autofill', async () => {
1617
+ const validate = vi.fn((_value: unknown) => null);
1618
+
1619
+ await render(
1620
+ <Field.Root name="quantity" validationMode="onChange" validate={validate}>
1621
+ <NumberFieldBase.Root>
1622
+ <NumberFieldBase.Input />
1623
+ </NumberFieldBase.Root>
1624
+ </Field.Root>,
1625
+ );
1626
+
1627
+ const hiddenInput = document.querySelector('input[type="number"][name="quantity"]');
1628
+
1629
+ expect(hiddenInput).not.toBe(null);
1630
+ fireEvent.change(hiddenInput!, { target: { value: '42' } });
1631
+
1632
+ expect(validate).toHaveBeenCalled();
1633
+ expect(validate.mock.calls.every(([value]) => value === 42)).toBe(true);
1634
+ expect(validate.mock.lastCall?.[0]).toBe(42);
1635
+ });
1636
+
1637
+ it.each([
1638
+ { lockState: 'readOnly', label: 'inside Field', withField: true },
1639
+ { lockState: 'disabled', label: 'inside Field', withField: true },
1640
+ { lockState: 'readOnly', label: 'outside Field', withField: false },
1641
+ { lockState: 'disabled', label: 'outside Field', withField: false },
1642
+ ] as const)(
1643
+ 'ignores hidden-input autofill when $lockState $label',
1644
+ async ({ lockState, withField }) => {
1645
+ const onValueChange = vi.fn();
1646
+ const numberField = (
1647
+ <NumberFieldBase.Root
1648
+ name={withField ? undefined : 'quantity'}
1649
+ defaultValue={1}
1650
+ readOnly={lockState === 'readOnly'}
1651
+ disabled={lockState === 'disabled'}
1652
+ onValueChange={onValueChange}
1653
+ >
1654
+ <NumberFieldBase.Input />
1655
+ </NumberFieldBase.Root>
1656
+ );
1657
+
1658
+ await render(
1659
+ withField ? (
1660
+ <Form errors={{ quantity: 'test' }}>
1661
+ <Field.Root name="quantity">
1662
+ {numberField}
1663
+ <Field.Error data-testid="error" />
1664
+ </Field.Root>
1665
+ </Form>
1666
+ ) : (
1667
+ numberField
1668
+ ),
1669
+ );
1670
+
1671
+ const input = screen.getByRole('textbox');
1672
+ const hiddenInput = document.querySelector(
1673
+ 'input[type="number"][name="quantity"]',
1674
+ ) as HTMLInputElement;
1675
+
1676
+ expect(hiddenInput).not.toBe(null);
1677
+
1678
+ if (withField) {
1679
+ expect(screen.getByTestId('error')).toHaveTextContent('test');
1680
+ if (lockState === 'disabled') {
1681
+ expect(input).not.toHaveAttribute('aria-invalid');
1682
+ } else {
1683
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1684
+ }
1685
+ }
1686
+
1687
+ fireEvent.change(hiddenInput, { target: { value: '42' } });
1688
+
1689
+ expect(onValueChange).not.toHaveBeenCalled();
1690
+ expect(input).toHaveValue('1');
1691
+
1692
+ if (withField) {
1693
+ expect(screen.getByTestId('error')).toHaveTextContent('test');
1694
+ }
1695
+ },
1696
+ );
1697
+ });
1698
+
1699
+ describe('Field', () => {
1700
+ it('[data-touched]', async () => {
1701
+ await render(
1702
+ <Field.Root>
1703
+ <NumberFieldBase.Root>
1704
+ <NumberFieldBase.Input />
1705
+ </NumberFieldBase.Root>
1706
+ </Field.Root>,
1707
+ );
1708
+
1709
+ const input = screen.getByRole<HTMLInputElement>('textbox');
1710
+
1711
+ fireEvent.focus(input);
1712
+ fireEvent.blur(input);
1713
+
1714
+ expect(input).toHaveAttribute('data-touched', '');
1715
+ });
1716
+
1717
+ it('[data-dirty]', async () => {
1718
+ await render(
1719
+ <Field.Root>
1720
+ <NumberFieldBase.Root>
1721
+ <NumberFieldBase.Input />
1722
+ </NumberFieldBase.Root>
1723
+ </Field.Root>,
1724
+ );
1725
+
1726
+ const input = screen.getByRole<HTMLInputElement>('textbox');
1727
+
1728
+ expect(input).not.toHaveAttribute('data-dirty');
1729
+
1730
+ fireEvent.change(input, { target: { value: '1' } });
1731
+
1732
+ expect(input).toHaveAttribute('data-dirty', '');
1733
+ });
1734
+
1735
+ describe('[data-filled]', () => {
1736
+ it('adds [data-filled] attribute when filled', async () => {
1737
+ await render(
1738
+ <Field.Root>
1739
+ <NumberFieldBase.Root>
1740
+ <NumberFieldBase.Input data-testid="input" />
1741
+ </NumberFieldBase.Root>
1742
+ </Field.Root>,
1743
+ );
1744
+
1745
+ const input = screen.getByTestId('input');
1746
+
1747
+ expect(input).not.toHaveAttribute('data-filled');
1748
+
1749
+ fireEvent.change(input, { target: { value: '1' } });
1750
+
1751
+ expect(input).toHaveAttribute('data-filled', '');
1752
+
1753
+ fireEvent.change(input, { target: { value: '' } });
1754
+
1755
+ expect(input).not.toHaveAttribute('data-filled');
1756
+ });
1757
+
1758
+ it('has [data-filled] attribute when already filled', async () => {
1759
+ await render(
1760
+ <Field.Root>
1761
+ <NumberFieldBase.Root defaultValue={1}>
1762
+ <NumberFieldBase.Input data-testid="input" />
1763
+ </NumberFieldBase.Root>
1764
+ </Field.Root>,
1765
+ );
1766
+
1767
+ const input = screen.getByTestId('input');
1768
+
1769
+ expect(input).toHaveAttribute('data-filled');
1770
+
1771
+ fireEvent.change(input, { target: { value: '' } });
1772
+
1773
+ expect(input).not.toHaveAttribute('data-filled');
1774
+ });
1775
+ });
1776
+
1777
+ it('[data-filled]', async () => {
1778
+ await render(
1779
+ <Field.Root>
1780
+ <NumberFieldBase.Root>
1781
+ <NumberFieldBase.Input data-testid="input" />
1782
+ </NumberFieldBase.Root>
1783
+ </Field.Root>,
1784
+ );
1785
+
1786
+ const input = screen.getByTestId('input');
1787
+
1788
+ expect(input).not.toHaveAttribute('data-focused');
1789
+
1790
+ fireEvent.focus(input);
1791
+
1792
+ expect(input).toHaveAttribute('data-focused', '');
1793
+
1794
+ fireEvent.blur(input);
1795
+
1796
+ expect(input).not.toHaveAttribute('data-focused');
1797
+ });
1798
+
1799
+ it('adds [data-focused] attribute on every focus', async () => {
1800
+ await render(
1801
+ <Field.Root>
1802
+ <NumberFieldBase.Root>
1803
+ <NumberFieldBase.Input data-testid="input" />
1804
+ </NumberFieldBase.Root>
1805
+ </Field.Root>,
1806
+ );
1807
+
1808
+ const input = screen.getByTestId('input');
1809
+
1810
+ fireEvent.focus(input);
1811
+ expect(input).toHaveAttribute('data-focused', '');
1812
+
1813
+ fireEvent.blur(input);
1814
+ expect(input).not.toHaveAttribute('data-focused');
1815
+
1816
+ fireEvent.focus(input);
1817
+ expect(input).toHaveAttribute('data-focused', '');
1818
+ });
1819
+
1820
+ it('prop: validate', async () => {
1821
+ await render(
1822
+ <Field.Root validationMode="onBlur" validate={() => 'error'}>
1823
+ <NumberFieldBase.Root>
1824
+ <NumberFieldBase.Input />
1825
+ </NumberFieldBase.Root>
1826
+ <Field.Error data-testid="error" />
1827
+ </Field.Root>,
1828
+ );
1829
+
1830
+ const input = screen.getByRole('textbox');
1831
+
1832
+ expect(input).not.toHaveAttribute('aria-invalid');
1833
+
1834
+ fireEvent.focus(input);
1835
+ fireEvent.blur(input);
1836
+
1837
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1838
+ });
1839
+
1840
+ describe('prop: validationMode', () => {
1841
+ it('onSubmit', async () => {
1842
+ await render(
1843
+ <Form>
1844
+ <Field.Root validate={(value) => (value === 1 ? 'custom error' : null)}>
1845
+ <NumberFieldBase.Root required data-testid="root">
1846
+ <NumberFieldBase.Input data-testid="input" />
1847
+ </NumberFieldBase.Root>
1848
+ <Field.Error data-testid="error" match="valueMissing">
1849
+ valueMissing error
1850
+ </Field.Error>
1851
+ <Field.Error data-testid="error" match="customError" />
1852
+ </Field.Root>
1853
+ <button type="submit">submit</button>
1854
+ </Form>,
1855
+ );
1856
+
1857
+ const input = screen.getByRole('textbox');
1858
+ expect(input).not.toHaveAttribute('aria-invalid');
1859
+
1860
+ fireEvent.change(input, { target: { value: '1' } });
1861
+ fireEvent.blur(input);
1862
+ expect(input).not.toHaveAttribute('aria-invalid');
1863
+ expect(screen.queryByTestId('error')).toBe(null);
1864
+
1865
+ fireEvent.change(input, { target: { value: '' } });
1866
+ fireEvent.blur(input);
1867
+ expect(input).not.toHaveAttribute('aria-invalid');
1868
+ expect(screen.queryByTestId('error')).toBe(null);
1869
+
1870
+ fireEvent.click(screen.getByText('submit'));
1871
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1872
+ expect(screen.queryByTestId('error')).toHaveTextContent('valueMissing error');
1873
+ expect(screen.getByTestId('root')).toHaveAttribute('data-invalid');
1874
+ expect(input).toHaveAttribute('data-invalid');
1875
+
1876
+ fireEvent.change(input, { target: { value: '2' } });
1877
+ expect(input).not.toHaveAttribute('aria-invalid');
1878
+ expect(screen.queryByTestId('error')).toBe(null);
1879
+ expect(screen.getByTestId('root')).not.toHaveAttribute('data-invalid');
1880
+ expect(input).not.toHaveAttribute('data-invalid');
1881
+ expect(screen.getByTestId('root')).toHaveAttribute('data-valid');
1882
+ expect(input).toHaveAttribute('data-valid');
1883
+ // re-invalidate the field value
1884
+ fireEvent.change(input, { target: { value: '1' } });
1885
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1886
+ expect(screen.queryByTestId('error')).toHaveTextContent('custom error');
1887
+
1888
+ fireEvent.change(input, { target: { value: '3' } });
1889
+ expect(input).not.toHaveAttribute('aria-invalid');
1890
+ expect(screen.queryByTestId('error')).toBe(null);
1891
+
1892
+ fireEvent.change(input, { target: { value: '' } });
1893
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1894
+ expect(screen.queryByTestId('error')).toHaveTextContent('valueMissing error');
1895
+ });
1896
+
1897
+ it('onChange', async () => {
1898
+ await render(
1899
+ <Field.Root
1900
+ validationMode="onChange"
1901
+ validate={(value) => {
1902
+ return value === 1 ? 'error' : null;
1903
+ }}
1904
+ >
1905
+ <NumberFieldBase.Root>
1906
+ <NumberFieldBase.Input data-testid="input" />
1907
+ </NumberFieldBase.Root>
1908
+ </Field.Root>,
1909
+ );
1910
+
1911
+ const input = screen.getByTestId('input');
1912
+
1913
+ expect(input).not.toHaveAttribute('aria-invalid');
1914
+
1915
+ fireEvent.change(input, { target: { value: '1' } });
1916
+
1917
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1918
+ });
1919
+
1920
+ it('revalidates when the controlled value changes externally', async () => {
1921
+ const validateSpy = vi.fn((value: unknown) =>
1922
+ (value as number | null) === 5 ? 'error' : null,
1923
+ );
1924
+
1925
+ function App() {
1926
+ const [value, setValue] = React.useState<number | null>(null);
1927
+
1928
+ return (
1929
+ <React.Fragment>
1930
+ <Field.Root validationMode="onChange" validate={validateSpy} name="quantity">
1931
+ <NumberFieldBase.Root value={value} onValueChange={(next) => setValue(next)}>
1932
+ <NumberFieldBase.Input data-testid="input" />
1933
+ </NumberFieldBase.Root>
1934
+ </Field.Root>
1935
+ <button type="button" onClick={() => setValue(5)}>
1936
+ Set externally
1937
+ </button>
1938
+ </React.Fragment>
1939
+ );
1940
+ }
1941
+
1942
+ await render(<App />);
1943
+
1944
+ const input = screen.getByTestId('input');
1945
+ const toggle = screen.getByText('Set externally');
1946
+
1947
+ expect(input).not.toHaveAttribute('aria-invalid');
1948
+ const initialCallCount = validateSpy.mock.calls.length;
1949
+
1950
+ fireEvent.click(toggle);
1951
+
1952
+ expect(validateSpy.mock.calls.length).toBe(initialCallCount + 1);
1953
+ expect(validateSpy.mock.lastCall?.[0]).toBe(5);
1954
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1955
+ });
1956
+
1957
+ it('onBlur', async () => {
1958
+ await render(
1959
+ <Field.Root
1960
+ validationMode="onBlur"
1961
+ validate={(value) => {
1962
+ return value === 1 ? 'error' : null;
1963
+ }}
1964
+ >
1965
+ <NumberFieldBase.Root required>
1966
+ <NumberFieldBase.Input data-testid="input" />
1967
+ </NumberFieldBase.Root>
1968
+ <Field.Error data-testid="error" />
1969
+ </Field.Root>,
1970
+ );
1971
+
1972
+ const input = screen.getByTestId('input');
1973
+ expect(input).not.toHaveAttribute('aria-invalid');
1974
+
1975
+ fireEvent.change(input, { target: { value: '1' } });
1976
+ expect(input).not.toHaveAttribute('aria-invalid');
1977
+ fireEvent.blur(input);
1978
+ expect(input).toHaveAttribute('aria-invalid', 'true');
1979
+ // revalidation
1980
+ fireEvent.change(input, { target: { value: '2' } });
1981
+ expect(input).not.toHaveAttribute('aria-invalid');
1982
+ expect(screen.queryByTestId('error')).toBe(null);
1983
+ });
1984
+ });
1985
+
1986
+ // Chromium shows a native validation popup when stepMismatch occurs that blocks the test
1987
+ it.skipIf(!isJSDOM)(
1988
+ 'prevents form submission when the value does not match the step',
1989
+ async () => {
1990
+ const handleSubmit = vi.fn();
1991
+ await render(
1992
+ <form onSubmit={handleSubmit}>
1993
+ <NumberFieldBase.Root name="quantity" defaultValue={0} min={0} step={0.1}>
1994
+ <NumberFieldBase.Input data-testid="input" />
1995
+ </NumberFieldBase.Root>
1996
+ <button type="submit">submit</button>
1997
+ </form>,
1998
+ );
1999
+
2000
+ const input = screen.getByTestId('input');
2001
+
2002
+ await act(async () => {
2003
+ input.focus();
2004
+ });
2005
+
2006
+ fireEvent.change(input, { target: { value: '0.11' } });
2007
+ fireEvent.click(screen.getByText('submit'));
2008
+
2009
+ expect(handleSubmit.mock.calls.length).toBe(0);
2010
+
2011
+ fireEvent.change(input, { target: { value: '0.1' } });
2012
+ fireEvent.click(screen.getByText('submit'));
2013
+
2014
+ expect(handleSubmit.mock.calls.length).toBe(1);
2015
+ expect(new FormData(handleSubmit.mock.calls[0][0].target).get('quantity')).toBe('0.1');
2016
+ },
2017
+ );
2018
+
2019
+ it('prevents Form/Field submission when the value does not match the step', async () => {
2020
+ const handleSubmit = vi.fn();
2021
+ await render(
2022
+ <Form onFormSubmit={handleSubmit}>
2023
+ <Field.Root name="quantity">
2024
+ <NumberFieldBase.Root defaultValue={0} min={0} step={0.1}>
2025
+ <NumberFieldBase.Input data-testid="input" />
2026
+ </NumberFieldBase.Root>
2027
+ <Field.Error match="stepMismatch" data-testid="error">
2028
+ step mismatch
2029
+ </Field.Error>
2030
+ </Field.Root>
2031
+ <button type="submit">submit</button>
2032
+ </Form>,
2033
+ );
2034
+
2035
+ const input = screen.getByTestId('input');
2036
+
2037
+ await act(async () => {
2038
+ input.focus();
2039
+ });
2040
+
2041
+ expect(screen.queryByTestId('error')).toBe(null);
2042
+
2043
+ fireEvent.change(input, { target: { value: '0.11' } });
2044
+ fireEvent.click(screen.getByText('submit'));
2045
+
2046
+ expect(handleSubmit.mock.calls.length).toBe(0);
2047
+ expect(screen.getByTestId('error')).toHaveTextContent('step mismatch');
2048
+
2049
+ fireEvent.change(input, { target: { value: '0.1' } });
2050
+ fireEvent.click(screen.getByText('submit'));
2051
+
2052
+ expect(handleSubmit.mock.calls.length).toBe(1);
2053
+ expect(handleSubmit.mock.calls[0][0].quantity).toBe(0.1);
2054
+ });
2055
+
2056
+ it('disables the input when disabled=true', async () => {
2057
+ await render(
2058
+ <Field.Root disabled>
2059
+ <NumberFieldBase.Root>
2060
+ <NumberFieldBase.Input />
2061
+ </NumberFieldBase.Root>
2062
+ </Field.Root>,
2063
+ );
2064
+
2065
+ const input = screen.getByRole<HTMLInputElement>('textbox');
2066
+
2067
+ expect(input).toHaveAttribute('disabled', '');
2068
+ });
2069
+
2070
+ it('does not disable the input when disabled=false', async () => {
2071
+ await render(
2072
+ <Field.Root disabled={false}>
2073
+ <NumberFieldBase.Root>
2074
+ <NumberFieldBase.Input />
2075
+ </NumberFieldBase.Root>
2076
+ </Field.Root>,
2077
+ );
2078
+
2079
+ const input = screen.getByRole<HTMLInputElement>('textbox');
2080
+
2081
+ expect(input).not.toHaveAttribute('disabled');
2082
+ });
2083
+
2084
+ it('is validated with latest value when validationMode=onBlur', async () => {
2085
+ const validate = vi.fn(() => 'error');
2086
+
2087
+ await render(
2088
+ <Form>
2089
+ <Field.Root validationMode="onBlur" validate={validate} name="quantity">
2090
+ <NumberFieldBase.Root defaultValue={undefined}>
2091
+ <NumberFieldBase.Input />
2092
+ </NumberFieldBase.Root>
2093
+ </Field.Root>
2094
+ </Form>,
2095
+ );
2096
+
2097
+ const input = screen.getByRole('textbox');
2098
+
2099
+ fireEvent.focus(input);
2100
+ fireEvent.change(input, { target: { value: '1' } });
2101
+ fireEvent.blur(input);
2102
+
2103
+ expect(validate.mock.calls.length).toBe(1);
2104
+ expect(validate.mock.calls[0]).toEqual([1, { quantity: 1 }]);
2105
+ });
2106
+
2107
+ it('is validated with clamped value when validationMode=onBlur', async () => {
2108
+ const validate = vi.fn(() => null);
2109
+
2110
+ await render(
2111
+ <Form>
2112
+ <Field.Root validationMode="onBlur" validate={validate} name="quantity">
2113
+ <NumberFieldBase.Root max={10}>
2114
+ <NumberFieldBase.Input />
2115
+ </NumberFieldBase.Root>
2116
+ </Field.Root>
2117
+ </Form>,
2118
+ );
2119
+
2120
+ const input = screen.getByRole('textbox');
2121
+
2122
+ fireEvent.focus(input);
2123
+ fireEvent.change(input, { target: { value: '1000' } });
2124
+ fireEvent.blur(input);
2125
+
2126
+ expect(validate.mock.calls.length).toBe(1);
2127
+ expect(validate.mock.calls[0]).toEqual([10, { quantity: 10 }]);
2128
+ expect(input).toHaveValue('10');
2129
+ });
2130
+
2131
+ it('revalidates an external change after a blur that normalizes back to the current value', async () => {
2132
+ const validate = (value: unknown) => (value === 5 ? 'error' : null);
2133
+
2134
+ function App() {
2135
+ const [value, setValue] = React.useState<number | null>(5);
2136
+ return (
2137
+ <Form>
2138
+ <Field.Root validationMode="onBlur" validate={validate} name="quantity">
2139
+ <NumberFieldBase.Root value={value} onValueChange={setValue} max={5}>
2140
+ <NumberFieldBase.Input />
2141
+ </NumberFieldBase.Root>
2142
+ </Field.Root>
2143
+ <button type="button" onClick={() => setValue(3)}>
2144
+ external
2145
+ </button>
2146
+ </Form>
2147
+ );
2148
+ }
2149
+
2150
+ const { user } = await render(<App />);
2151
+ const input = screen.getByRole('textbox');
2152
+
2153
+ // Blur after typing a value that clamps back to the current value (5). This sets the
2154
+ // internal block-revalidation flag and commits an error, but since the stored value is
2155
+ // unchanged `useValueChanged` won't fire to reset the flag.
2156
+ fireEvent.focus(input);
2157
+ fireEvent.change(input, { target: { value: '9' } });
2158
+ fireEvent.blur(input);
2159
+ expect(input).toHaveValue('5');
2160
+ expect(input).toHaveAttribute('aria-invalid', 'true');
2161
+
2162
+ // The flag must have been reset on blur so the next external change revalidates and
2163
+ // clears the error rather than being swallowed.
2164
+ await user.click(screen.getByText('external'));
2165
+ expect(input).not.toHaveAttribute('aria-invalid');
2166
+ });
2167
+
2168
+ it('Field.Label', async () => {
2169
+ await render(
2170
+ <Field.Root>
2171
+ <NumberFieldBase.Root>
2172
+ <NumberFieldBase.Input />
2173
+ </NumberFieldBase.Root>
2174
+ <Field.Label data-testid="label" />
2175
+ </Field.Root>,
2176
+ );
2177
+
2178
+ expect(screen.getByTestId('label')).toHaveAttribute('for', screen.getByRole('textbox').id);
2179
+ });
2180
+
2181
+ it('Field.Description', async () => {
2182
+ await render(
2183
+ <Field.Root>
2184
+ <NumberFieldBase.Root>
2185
+ <NumberFieldBase.Input aria-describedby="external-description" />
2186
+ </NumberFieldBase.Root>
2187
+ <Field.Description data-testid="description" />
2188
+ </Field.Root>,
2189
+ );
2190
+
2191
+ expect(screen.getByRole('textbox')).toHaveAttribute(
2192
+ 'aria-describedby',
2193
+ `external-description ${screen.getByTestId('description').id}`,
2194
+ );
2195
+ });
2196
+ });
2197
+
2198
+ describe('prop: inputMode', () => {
2199
+ it('should set the inputMode to numeric', async () => {
2200
+ await render(<NumberField />);
2201
+ const input = screen.getByRole('textbox');
2202
+ expect(input).toHaveAttribute('inputmode', 'numeric');
2203
+ });
2204
+ });
2205
+
2206
+ describe('integration: exotic inputs and IME', () => {
2207
+ it('accepts Persian digit keyboard input', async () => {
2208
+ const onValueChange = vi.fn();
2209
+ function App() {
2210
+ const [value, setValue] = React.useState<number | null>(null);
2211
+ return (
2212
+ <NumberField
2213
+ value={value}
2214
+ onValueChange={(v) => {
2215
+ onValueChange(v);
2216
+ setValue(v);
2217
+ }}
2218
+ />
2219
+ );
2220
+ }
2221
+ const { user } = await render(<App />);
2222
+ const input = screen.getByRole('textbox');
2223
+
2224
+ await user.type(input, '۱۲۳');
2225
+
2226
+ expect(onValueChange.mock.calls.at(-1)?.[0]).toBe(123);
2227
+ });
2228
+
2229
+ it('parses Persian digits and separators via change events', async () => {
2230
+ const onValueChange = vi.fn();
2231
+ function App() {
2232
+ const [value, setValue] = React.useState<number | null>(null);
2233
+ return (
2234
+ <NumberField
2235
+ value={value}
2236
+ onValueChange={(v) => {
2237
+ onValueChange(v);
2238
+ setValue(v);
2239
+ }}
2240
+ />
2241
+ );
2242
+ }
2243
+ await render(<App />);
2244
+
2245
+ const input = screen.getByRole('textbox');
2246
+ // ۱۲٫۳۴ => 12.34
2247
+ fireEvent.change(input, { target: { value: '۱۲٫۳۴' } });
2248
+
2249
+ expect(onValueChange.mock.calls.length).toBe(1);
2250
+ expect(onValueChange.mock.calls[0][0]).toBe(12.34);
2251
+ });
2252
+
2253
+ it('parses Persian digits with Arabic group/decimal separators', async () => {
2254
+ const onValueChange = vi.fn();
2255
+ function App() {
2256
+ const [value, setValue] = React.useState<number | null>(null);
2257
+ return (
2258
+ <NumberField
2259
+ value={value}
2260
+ onValueChange={(v) => {
2261
+ onValueChange(v);
2262
+ setValue(v);
2263
+ }}
2264
+ />
2265
+ );
2266
+ }
2267
+ await render(<App />);
2268
+
2269
+ const input = screen.getByRole('textbox');
2270
+ // ۱۲٬۳۴۵٫۶۷ => 12345.67
2271
+ fireEvent.change(input, { target: { value: '۱۲٬۳۴۵٫۶۷' } });
2272
+
2273
+ expect(onValueChange.mock.calls.length).toBe(1);
2274
+ expect(onValueChange.mock.calls[0][0]).toBe(12345.67);
2275
+ });
2276
+
2277
+ it('parses fullwidth digits and punctuation', async () => {
2278
+ const onValueChange = vi.fn();
2279
+ function App() {
2280
+ const [value, setValue] = React.useState<number | null>(null);
2281
+ return (
2282
+ <NumberField
2283
+ value={value}
2284
+ onValueChange={(v) => {
2285
+ onValueChange(v);
2286
+ setValue(v);
2287
+ }}
2288
+ />
2289
+ );
2290
+ }
2291
+
2292
+ await render(<App />);
2293
+
2294
+ const input = screen.getByRole('textbox');
2295
+
2296
+ fireEvent.change(input, { target: { value: '1,234.56' } });
2297
+
2298
+ expect(onValueChange.mock.calls.length).toBe(1);
2299
+ expect(onValueChange.mock.calls[0][0]).toBe(1234.56);
2300
+ });
2301
+
2302
+ it('parses percent and permille signs in exotic forms when formatted as percent', async () => {
2303
+ const onValueChange = vi.fn();
2304
+ function App() {
2305
+ const [value, setValue] = React.useState<number | null>(null);
2306
+ return (
2307
+ <NumberField
2308
+ value={value}
2309
+ format={{ style: 'percent' }}
2310
+ onValueChange={(v) => {
2311
+ onValueChange(v);
2312
+ setValue(v);
2313
+ }}
2314
+ />
2315
+ );
2316
+ }
2317
+
2318
+ await render(<App />);
2319
+
2320
+ const input = screen.getByRole('textbox');
2321
+ fireEvent.change(input, { target: { value: '١٢٪' } });
2322
+
2323
+ expect(onValueChange.mock.calls.length).toBe(1);
2324
+ expect(onValueChange.mock.calls[0][0]).toBe(0.12);
2325
+
2326
+ // reset by typing again
2327
+ fireEvent.change(input, { target: { value: '12؉' } });
2328
+ expect(onValueChange.mock.calls.length).toBe(2);
2329
+ expect(onValueChange.mock.calls[1][0]).toBe(0.012);
2330
+ });
2331
+
2332
+ it('ignores percent and permille symbols when not formatted as percent', async () => {
2333
+ const onValueChange = vi.fn();
2334
+ await render(<NumberField onValueChange={onValueChange} />);
2335
+
2336
+ const input = screen.getByRole('textbox');
2337
+ fireEvent.change(input, { target: { value: '12' } });
2338
+ expect(onValueChange.mock.calls.length).toBe(1);
2339
+ expect(onValueChange.mock.calls[0][0]).toBe(12);
2340
+
2341
+ fireEvent.change(input, { target: { value: '12%' } });
2342
+ fireEvent.change(input, { target: { value: '12‰' } });
2343
+
2344
+ expect(onValueChange.mock.calls.length).toBe(1);
2345
+ expect(input).toHaveValue('12');
2346
+ });
2347
+
2348
+ it('parses trailing unicode minus', async () => {
2349
+ const onValueChange = vi.fn();
2350
+ function App() {
2351
+ const [value, setValue] = React.useState<number | null>(null);
2352
+ return (
2353
+ <NumberField
2354
+ value={value}
2355
+ onValueChange={(v) => {
2356
+ onValueChange(v);
2357
+ setValue(v);
2358
+ }}
2359
+ />
2360
+ );
2361
+ }
2362
+
2363
+ await render(<App />);
2364
+
2365
+ const input = screen.getByRole('textbox');
2366
+ fireEvent.change(input, { target: { value: '1234−' } });
2367
+
2368
+ expect(onValueChange.mock.calls.length).toBe(1);
2369
+ expect(onValueChange.mock.calls[0][0]).toBe(-1234);
2370
+ });
2371
+
2372
+ it('treats parentheses negatives as invalid input', async () => {
2373
+ const onValueChange = vi.fn();
2374
+ function App() {
2375
+ const [value, setValue] = React.useState<number | null>(null);
2376
+ return (
2377
+ <NumberField
2378
+ value={value}
2379
+ onValueChange={(v) => {
2380
+ onValueChange(v);
2381
+ setValue(v);
2382
+ }}
2383
+ />
2384
+ );
2385
+ }
2386
+
2387
+ await render(<App />);
2388
+
2389
+ const input = screen.getByRole('textbox');
2390
+ fireEvent.change(input, { target: { value: '(1,234.5)' } });
2391
+
2392
+ expect(onValueChange.mock.calls.length).toBe(0);
2393
+ expect(input).toHaveValue('');
2394
+ });
2395
+
2396
+ it('collapses extra dots from mixed-locale inputs', async () => {
2397
+ const onValueChange = vi.fn();
2398
+ function App() {
2399
+ const [value, setValue] = React.useState<number | null>(null);
2400
+ return (
2401
+ <NumberField
2402
+ value={value}
2403
+ onValueChange={(v) => {
2404
+ onValueChange(v);
2405
+ setValue(v);
2406
+ }}
2407
+ />
2408
+ );
2409
+ }
2410
+
2411
+ await render(<App />);
2412
+
2413
+ const input = screen.getByRole('textbox');
2414
+ fireEvent.change(input, { target: { value: '1.234.567.89' } });
2415
+
2416
+ expect(onValueChange.mock.calls.length).toBe(1);
2417
+ expect(onValueChange.mock.calls[0][0]).toBe(1234567.89);
2418
+ });
2419
+
2420
+ it('allows composition key events (IME) without preventing default', async () => {
2421
+ await render(<NumberField />);
2422
+
2423
+ const input = screen.getByRole('textbox');
2424
+
2425
+ await act(async () => input.focus());
2426
+
2427
+ const preventDefaultSpy = vi.fn();
2428
+
2429
+ // 229 indicates a composition key event
2430
+ fireEvent.keyDown(input, { which: 229, preventDefault: preventDefaultSpy });
2431
+ expect(preventDefaultSpy).toHaveBeenCalledTimes(0);
2432
+ });
2433
+ });
2434
+
2435
+ describe.skipIf(isJSDOM)('pasting', () => {
2436
+ it('should allow pasting a valid number', async () => {
2437
+ await render(<NumberField />);
2438
+ const input = screen.getByRole('textbox');
2439
+
2440
+ const dataTransfer = new DataTransfer();
2441
+ dataTransfer.setData('text/plain', '123');
2442
+
2443
+ fireEvent.paste(input, { clipboardData: dataTransfer });
2444
+ fireEvent.change(input, { target: { value: '123' } });
2445
+ expect(input).toHaveValue('123');
2446
+ });
2447
+
2448
+ it('should not allow pasting an invalid number', async () => {
2449
+ await render(<NumberField />);
2450
+ const input = screen.getByRole('textbox');
2451
+
2452
+ const dataTransfer = new DataTransfer();
2453
+ dataTransfer.setData('text/plain', 'abc');
2454
+
2455
+ fireEvent.paste(input, { clipboardData: dataTransfer });
2456
+ fireEvent.change(input, { target: { value: 'abc' } });
2457
+ expect(input).toHaveValue('');
2458
+ fireEvent.blur(input);
2459
+ expect(input).toHaveValue('');
2460
+ });
2461
+ });
2462
+
2463
+ describe('pasting at the caret', () => {
2464
+ it('ignores a paste that does not parse to a number', async () => {
2465
+ const onValueChange = vi.fn();
2466
+ await render(<NumberField defaultValue={1} onValueChange={onValueChange} />);
2467
+ const input = screen.getByRole('textbox') as HTMLInputElement;
2468
+
2469
+ await act(async () => input.focus());
2470
+ input.select();
2471
+ pasteText(input, 'abc');
2472
+
2473
+ expect(input).toHaveValue('1');
2474
+ expect(onValueChange).not.toHaveBeenCalled();
2475
+ });
2476
+
2477
+ it('does not paste into a readOnly field', async () => {
2478
+ await render(<NumberField defaultValue={1} readOnly />);
2479
+ const input = screen.getByRole('textbox') as HTMLInputElement;
2480
+
2481
+ await act(async () => input.focus());
2482
+ input.select();
2483
+ pasteText(input, '9');
2484
+
2485
+ expect(input).toHaveValue('1');
2486
+ });
2487
+
2488
+ it('inserts pasted text at the caret instead of replacing the whole value', async () => {
2489
+ const onValueChange = vi.fn();
2490
+ await render(<NumberField defaultValue={123} onValueChange={onValueChange} />);
2491
+ const input = screen.getByRole('textbox') as HTMLInputElement;
2492
+
2493
+ await act(async () => input.focus());
2494
+ input.setSelectionRange(3, 3);
2495
+ pasteText(input, '5');
2496
+
2497
+ expect(input).toHaveValue('1235');
2498
+ expect(onValueChange.mock.lastCall?.[0]).toBe(1235);
2499
+ });
2500
+
2501
+ it('replaces the selected range when pasting over a selection', async () => {
2502
+ await render(<NumberField defaultValue={123} />);
2503
+ const input = screen.getByRole('textbox') as HTMLInputElement;
2504
+
2505
+ await act(async () => input.focus());
2506
+ input.setSelectionRange(1, 2);
2507
+ pasteText(input, '9');
2508
+
2509
+ expect(input).toHaveValue('193');
2510
+ });
2511
+
2512
+ it('keeps the caret just after the pasted text', async () => {
2513
+ await render(<NumberField defaultValue={123} />);
2514
+ const input = screen.getByRole('textbox') as HTMLInputElement;
2515
+
2516
+ await act(async () => input.focus());
2517
+ input.setSelectionRange(1, 2);
2518
+ pasteText(input, '9');
2519
+
2520
+ expect(input).toHaveValue('193');
2521
+ expect(input.selectionStart).toBe(2);
2522
+ expect(input.selectionEnd).toBe(2);
2523
+ });
2524
+ });
2525
+
2526
+ it('should allow navigation keys and not prevent their default behavior', async () => {
2527
+ await render(<NumberField />);
2528
+ const input = screen.getByRole('textbox') as HTMLInputElement;
2529
+ input.focus();
2530
+ fireEvent.change(input, { target: { value: '123' } });
2531
+
2532
+ const navigateKeys = ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab', 'Enter'];
2533
+ navigateKeys.forEach((key) => {
2534
+ const preventDefaultSpy = vi.fn();
2535
+ fireEvent.keyDown(input, { key, preventDefault: preventDefaultSpy });
2536
+ expect(preventDefaultSpy).toHaveBeenCalledTimes(0);
2537
+ });
2538
+ });
2539
+
2540
+ it('does not prevent native caret movement for Home/End without min/max', async () => {
2541
+ await render(<NumberField defaultValue={5} />);
2542
+ const input = screen.getByRole('textbox') as HTMLInputElement;
2543
+ input.focus();
2544
+
2545
+ ['Home', 'End'].forEach((key) => {
2546
+ const preventDefaultSpy = vi.fn();
2547
+ fireEvent.keyDown(input, { key, preventDefault: preventDefaultSpy });
2548
+ expect(preventDefaultSpy).toHaveBeenCalledTimes(0);
2549
+ });
2550
+ });
2551
+
2552
+ it('does not swallow non-printing keys it does not handle', async () => {
2553
+ await render(<NumberField defaultValue={5} />);
2554
+ const input = screen.getByRole('textbox') as HTMLInputElement;
2555
+ input.focus();
2556
+
2557
+ ['PageUp', 'PageDown', 'Insert', 'F5'].forEach((key) => {
2558
+ const preventDefaultSpy = vi.fn();
2559
+ fireEvent.keyDown(input, { key, preventDefault: preventDefaultSpy });
2560
+ expect(preventDefaultSpy).toHaveBeenCalledTimes(0);
2561
+ });
2562
+ });
2563
+
2564
+ describe('prop: locale', () => {
2565
+ it('should set the locale of the input', async () => {
2566
+ await render(<NumberField defaultValue={1000.5} locale="de-DE" />);
2567
+ const input = screen.getByRole('textbox');
2568
+
2569
+ // In German locale, numbers use dot as thousands separator and comma as decimal separator
2570
+ const expectedValue = new Intl.NumberFormat('de-DE').format(1000.5);
2571
+ expect(input).toHaveValue(expectedValue);
2572
+ });
2573
+
2574
+ it('should use the default locale if no locale is provided', async () => {
2575
+ await render(<NumberField defaultValue={1000.5} />);
2576
+ const input = screen.getByRole('textbox');
2577
+ const expectedValue = new Intl.NumberFormat().format(1000.5);
2578
+ expect(input).toHaveValue(expectedValue);
2579
+ });
2580
+
2581
+ it('should handle locales using space as the thousands separator', async () => {
2582
+ await render(<NumberField defaultValue={12345.5} locale="pl" />);
2583
+
2584
+ const input = screen.getByRole('textbox');
2585
+ const expectedValue = new Intl.NumberFormat('pl').format(12345.5);
2586
+ expect(input).toHaveValue(expectedValue);
2587
+
2588
+ const incrementButton = screen.getByLabelText('Increase');
2589
+ fireEvent.click(incrementButton);
2590
+
2591
+ const newExpectedValue = new Intl.NumberFormat('pl').format(12346.5);
2592
+ expect(input).toHaveValue(newExpectedValue);
2593
+ });
2594
+ });
2595
+ });