@senvenli/react 0.0.0-stage → 0.1.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 (636) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -2
  3. package/dist/action/button-group.d.ts +26 -0
  4. package/dist/action/button-group.js +12 -0
  5. package/dist/action/button-group.js.map +1 -0
  6. package/dist/action/button.d.ts +42 -0
  7. package/dist/action/button.js +58 -0
  8. package/dist/action/button.js.map +1 -0
  9. package/dist/action/close-button.d.ts +12 -0
  10. package/dist/action/close-button.js +13 -0
  11. package/dist/action/close-button.js.map +1 -0
  12. package/dist/action/copy-button.d.ts +21 -0
  13. package/dist/action/copy-button.js +38 -0
  14. package/dist/action/copy-button.js.map +1 -0
  15. package/dist/action/fab.d.ts +29 -0
  16. package/dist/action/fab.js +57 -0
  17. package/dist/action/fab.js.map +1 -0
  18. package/dist/action/files.d.ts +70 -0
  19. package/dist/action/files.js +156 -0
  20. package/dist/action/files.js.map +1 -0
  21. package/dist/action/index.d.ts +23 -0
  22. package/dist/action/index.js +16 -0
  23. package/dist/action/index.js.map +1 -0
  24. package/dist/action/language-names.d.ts +19 -0
  25. package/dist/action/language-names.js +79 -0
  26. package/dist/action/language-names.js.map +1 -0
  27. package/dist/action/language-switcher.d.ts +57 -0
  28. package/dist/action/language-switcher.js +53 -0
  29. package/dist/action/language-switcher.js.map +1 -0
  30. package/dist/action/link-button.d.ts +57 -0
  31. package/dist/action/link-button.js +48 -0
  32. package/dist/action/link-button.js.map +1 -0
  33. package/dist/action/link.d.ts +24 -0
  34. package/dist/action/link.js +18 -0
  35. package/dist/action/link.js.map +1 -0
  36. package/dist/action/pressable.d.ts +40 -0
  37. package/dist/action/pressable.js +65 -0
  38. package/dist/action/pressable.js.map +1 -0
  39. package/dist/action/styles.d.ts +60 -0
  40. package/dist/action/styles.js +109 -0
  41. package/dist/action/styles.js.map +1 -0
  42. package/dist/action/theme-script.d.ts +12 -0
  43. package/dist/action/theme-script.js +23 -0
  44. package/dist/action/theme-script.js.map +1 -0
  45. package/dist/action/theme-switcher.d.ts +43 -0
  46. package/dist/action/theme-switcher.js +260 -0
  47. package/dist/action/theme-switcher.js.map +1 -0
  48. package/dist/action/theme-toggle.d.ts +43 -0
  49. package/dist/action/theme-toggle.js +259 -0
  50. package/dist/action/theme-toggle.js.map +1 -0
  51. package/dist/action/toggle.d.ts +44 -0
  52. package/dist/action/toggle.js +28 -0
  53. package/dist/action/toggle.js.map +1 -0
  54. package/dist/action/touch-target.d.ts +9 -0
  55. package/dist/action/touch-target.js +14 -0
  56. package/dist/action/touch-target.js.map +1 -0
  57. package/dist/charts/axis-width.d.ts +186 -0
  58. package/dist/charts/axis-width.js +1262 -0
  59. package/dist/charts/axis-width.js.map +1 -0
  60. package/dist/charts/bar-public.d.ts +16 -0
  61. package/dist/charts/bar-public.js +16 -0
  62. package/dist/charts/bar-public.js.map +1 -0
  63. package/dist/charts/chart-parts.d.ts +136 -0
  64. package/dist/charts/chart-parts.js +160 -0
  65. package/dist/charts/chart-parts.js.map +1 -0
  66. package/dist/charts/core-charts.d.ts +157 -0
  67. package/dist/charts/core-charts.js +505 -0
  68. package/dist/charts/core-charts.js.map +1 -0
  69. package/dist/charts/index.d.ts +12 -0
  70. package/dist/charts/index.js +8 -0
  71. package/dist/charts/index.js.map +1 -0
  72. package/dist/charts/list-charts.d.ts +124 -0
  73. package/dist/charts/list-charts.js +308 -0
  74. package/dist/charts/list-charts.js.map +1 -0
  75. package/dist/charts/more-charts.d.ts +138 -0
  76. package/dist/charts/more-charts.js +284 -0
  77. package/dist/charts/more-charts.js.map +1 -0
  78. package/dist/charts/report-charts.d.ts +138 -0
  79. package/dist/charts/report-charts.js +370 -0
  80. package/dist/charts/report-charts.js.map +1 -0
  81. package/dist/charts/value-tick.d.ts +178 -0
  82. package/dist/charts/value-tick.js +240 -0
  83. package/dist/charts/value-tick.js.map +1 -0
  84. package/dist/collection/data-table-url-hook.d.ts +34 -0
  85. package/dist/collection/data-table-url-hook.js +70 -0
  86. package/dist/collection/data-table-url-hook.js.map +1 -0
  87. package/dist/collection/data-table-url.d.ts +30 -0
  88. package/dist/collection/data-table-url.js +48 -0
  89. package/dist/collection/data-table-url.js.map +1 -0
  90. package/dist/collection/data-table.d.ts +112 -0
  91. package/dist/collection/data-table.js +188 -0
  92. package/dist/collection/data-table.js.map +1 -0
  93. package/dist/collection/grid-list-public.d.ts +18 -0
  94. package/dist/collection/grid-list-public.js +19 -0
  95. package/dist/collection/grid-list-public.js.map +1 -0
  96. package/dist/collection/grid-list.d.ts +73 -0
  97. package/dist/collection/grid-list.js +46 -0
  98. package/dist/collection/grid-list.js.map +1 -0
  99. package/dist/collection/index.d.ts +14 -0
  100. package/dist/collection/index.js +8 -0
  101. package/dist/collection/index.js.map +1 -0
  102. package/dist/collection/list.d.ts +61 -0
  103. package/dist/collection/list.js +38 -0
  104. package/dist/collection/list.js.map +1 -0
  105. package/dist/collection/selection-checkbox.d.ts +5 -0
  106. package/dist/collection/selection-checkbox.js +13 -0
  107. package/dist/collection/selection-checkbox.js.map +1 -0
  108. package/dist/collection/table.d.ts +91 -0
  109. package/dist/collection/table.js +183 -0
  110. package/dist/collection/table.js.map +1 -0
  111. package/dist/collection/tree.d.ts +31 -0
  112. package/dist/collection/tree.js +22 -0
  113. package/dist/collection/tree.js.map +1 -0
  114. package/dist/color/color.d.ts +87 -0
  115. package/dist/color/color.js +200 -0
  116. package/dist/color/color.js.map +1 -0
  117. package/dist/color/contrast.d.ts +34 -0
  118. package/dist/color/contrast.js +44 -0
  119. package/dist/color/contrast.js.map +1 -0
  120. package/dist/color/index.d.ts +4 -0
  121. package/dist/color/index.js +5 -0
  122. package/dist/color/index.js.map +1 -0
  123. package/dist/date/calendar.d.ts +71 -0
  124. package/dist/date/calendar.js +291 -0
  125. package/dist/date/calendar.js.map +1 -0
  126. package/dist/date/fields.d.ts +174 -0
  127. package/dist/date/fields.js +250 -0
  128. package/dist/date/fields.js.map +1 -0
  129. package/dist/date/index.d.ts +7 -0
  130. package/dist/date/index.js +6 -0
  131. package/dist/date/index.js.map +1 -0
  132. package/dist/date/month-grid.d.ts +31 -0
  133. package/dist/date/month-grid.js +115 -0
  134. package/dist/date/month-grid.js.map +1 -0
  135. package/dist/date/pickers.d.ts +118 -0
  136. package/dist/date/pickers.js +176 -0
  137. package/dist/date/pickers.js.map +1 -0
  138. package/dist/date/public.d.ts +25 -0
  139. package/dist/date/public.js +24 -0
  140. package/dist/date/public.js.map +1 -0
  141. package/dist/date/segments.d.ts +153 -0
  142. package/dist/date/segments.js +433 -0
  143. package/dist/date/segments.js.map +1 -0
  144. package/dist/defaults.d.ts +74 -0
  145. package/dist/defaults.js +100 -0
  146. package/dist/defaults.js.map +1 -0
  147. package/dist/density.d.ts +2 -0
  148. package/dist/density.js +2 -0
  149. package/dist/density.js.map +1 -0
  150. package/dist/display/avatar.d.ts +29 -0
  151. package/dist/display/avatar.js +71 -0
  152. package/dist/display/avatar.js.map +1 -0
  153. package/dist/display/badge.d.ts +65 -0
  154. package/dist/display/badge.js +99 -0
  155. package/dist/display/badge.js.map +1 -0
  156. package/dist/display/card.d.ts +72 -0
  157. package/dist/display/card.js +91 -0
  158. package/dist/display/card.js.map +1 -0
  159. package/dist/display/carousel.d.ts +47 -0
  160. package/dist/display/carousel.js +214 -0
  161. package/dist/display/carousel.js.map +1 -0
  162. package/dist/display/description-list.d.ts +25 -0
  163. package/dist/display/description-list.js +36 -0
  164. package/dist/display/description-list.js.map +1 -0
  165. package/dist/display/icon-aliases.d.ts +1 -0
  166. package/dist/display/icon-aliases.js +259 -0
  167. package/dist/display/icon-aliases.js.map +1 -0
  168. package/dist/display/icon-names.d.ts +4 -0
  169. package/dist/display/icon-names.js +2 -0
  170. package/dist/display/icon-names.js.map +1 -0
  171. package/dist/display/icon.d.ts +51 -0
  172. package/dist/display/icon.js +96 -0
  173. package/dist/display/icon.js.map +1 -0
  174. package/dist/display/image-crop.d.ts +106 -0
  175. package/dist/display/image-crop.js +117 -0
  176. package/dist/display/image-crop.js.map +1 -0
  177. package/dist/display/image-cropper.d.ts +68 -0
  178. package/dist/display/image-cropper.js +284 -0
  179. package/dist/display/image-cropper.js.map +1 -0
  180. package/dist/display/image-viewer.d.ts +54 -0
  181. package/dist/display/image-viewer.js +84 -0
  182. package/dist/display/image-viewer.js.map +1 -0
  183. package/dist/display/image.d.ts +26 -0
  184. package/dist/display/image.js +17 -0
  185. package/dist/display/image.js.map +1 -0
  186. package/dist/display/index.d.ts +29 -0
  187. package/dist/display/index.js +16 -0
  188. package/dist/display/index.js.map +1 -0
  189. package/dist/display/iso-chip.d.ts +19 -0
  190. package/dist/display/iso-chip.js +21 -0
  191. package/dist/display/iso-chip.js.map +1 -0
  192. package/dist/display/kbd.d.ts +11 -0
  193. package/dist/display/kbd.js +33 -0
  194. package/dist/display/kbd.js.map +1 -0
  195. package/dist/display/lozenge.d.ts +30 -0
  196. package/dist/display/lozenge.js +55 -0
  197. package/dist/display/lozenge.js.map +1 -0
  198. package/dist/display/scroll-area.d.ts +29 -0
  199. package/dist/display/scroll-area.js +95 -0
  200. package/dist/display/scroll-area.js.map +1 -0
  201. package/dist/display/separator.d.ts +13 -0
  202. package/dist/display/separator.js +24 -0
  203. package/dist/display/separator.js.map +1 -0
  204. package/dist/display/stat.d.ts +35 -0
  205. package/dist/display/stat.js +41 -0
  206. package/dist/display/stat.js.map +1 -0
  207. package/dist/display/timeline.d.ts +44 -0
  208. package/dist/display/timeline.js +111 -0
  209. package/dist/display/timeline.js.map +1 -0
  210. package/dist/display/typography.d.ts +37 -0
  211. package/dist/display/typography.js +53 -0
  212. package/dist/display/typography.js.map +1 -0
  213. package/dist/display/visually-hidden.d.ts +14 -0
  214. package/dist/display/visually-hidden.js +10 -0
  215. package/dist/display/visually-hidden.js.map +1 -0
  216. package/dist/feedback/banner.d.ts +46 -0
  217. package/dist/feedback/banner.js +157 -0
  218. package/dist/feedback/banner.js.map +1 -0
  219. package/dist/feedback/cooldown.d.ts +17 -0
  220. package/dist/feedback/cooldown.js +59 -0
  221. package/dist/feedback/cooldown.js.map +1 -0
  222. package/dist/feedback/empty-state.d.ts +35 -0
  223. package/dist/feedback/empty-state.js +39 -0
  224. package/dist/feedback/empty-state.js.map +1 -0
  225. package/dist/feedback/index.d.ts +12 -0
  226. package/dist/feedback/index.js +11 -0
  227. package/dist/feedback/index.js.map +1 -0
  228. package/dist/feedback/meter.d.ts +33 -0
  229. package/dist/feedback/meter.js +42 -0
  230. package/dist/feedback/meter.js.map +1 -0
  231. package/dist/feedback/motion.d.ts +9 -0
  232. package/dist/feedback/motion.js +57 -0
  233. package/dist/feedback/motion.js.map +1 -0
  234. package/dist/feedback/progress.d.ts +39 -0
  235. package/dist/feedback/progress.js +68 -0
  236. package/dist/feedback/progress.js.map +1 -0
  237. package/dist/feedback/skeleton.d.ts +48 -0
  238. package/dist/feedback/skeleton.js +61 -0
  239. package/dist/feedback/skeleton.js.map +1 -0
  240. package/dist/feedback/spinner.d.ts +19 -0
  241. package/dist/feedback/spinner.js +29 -0
  242. package/dist/feedback/spinner.js.map +1 -0
  243. package/dist/feedback/status-dot.d.ts +23 -0
  244. package/dist/feedback/status-dot.js +37 -0
  245. package/dist/feedback/status-dot.js.map +1 -0
  246. package/dist/form/countries.d.ts +34 -0
  247. package/dist/form/countries.js +273 -0
  248. package/dist/form/countries.js.map +1 -0
  249. package/dist/form/data-attributes.d.ts +11 -0
  250. package/dist/form/data-attributes.js +22 -0
  251. package/dist/form/data-attributes.js.map +1 -0
  252. package/dist/form/field-parts.d.ts +113 -0
  253. package/dist/form/field-parts.js +178 -0
  254. package/dist/form/field-parts.js.map +1 -0
  255. package/dist/form/field.d.ts +36 -0
  256. package/dist/form/field.js +65 -0
  257. package/dist/form/field.js.map +1 -0
  258. package/dist/form/files.d.ts +70 -0
  259. package/dist/form/files.js +156 -0
  260. package/dist/form/files.js.map +1 -0
  261. package/dist/form/form.d.ts +40 -0
  262. package/dist/form/form.js +74 -0
  263. package/dist/form/form.js.map +1 -0
  264. package/dist/form/image-crop.d.ts +106 -0
  265. package/dist/form/image-crop.js +117 -0
  266. package/dist/form/image-crop.js.map +1 -0
  267. package/dist/form/image-cropper.d.ts +68 -0
  268. package/dist/form/image-cropper.js +284 -0
  269. package/dist/form/image-cropper.js.map +1 -0
  270. package/dist/form/index.d.ts +24 -0
  271. package/dist/form/index.js +15 -0
  272. package/dist/form/index.js.map +1 -0
  273. package/dist/form/input-group.d.ts +63 -0
  274. package/dist/form/input-group.js +63 -0
  275. package/dist/form/input-group.js.map +1 -0
  276. package/dist/form/input-otp.d.ts +35 -0
  277. package/dist/form/input-otp.js +83 -0
  278. package/dist/form/input-otp.js.map +1 -0
  279. package/dist/form/input.d.ts +36 -0
  280. package/dist/form/input.js +41 -0
  281. package/dist/form/input.js.map +1 -0
  282. package/dist/form/number-field.d.ts +84 -0
  283. package/dist/form/number-field.js +81 -0
  284. package/dist/form/number-field.js.map +1 -0
  285. package/dist/form/otp-field.d.ts +37 -0
  286. package/dist/form/otp-field.js +116 -0
  287. package/dist/form/otp-field.js.map +1 -0
  288. package/dist/form/password-field.d.ts +61 -0
  289. package/dist/form/password-field.js +61 -0
  290. package/dist/form/password-field.js.map +1 -0
  291. package/dist/form/phone-field.d.ts +104 -0
  292. package/dist/form/phone-field.js +275 -0
  293. package/dist/form/phone-field.js.map +1 -0
  294. package/dist/form/phone-paste.d.ts +24 -0
  295. package/dist/form/phone-paste.js +40 -0
  296. package/dist/form/phone-paste.js.map +1 -0
  297. package/dist/form/phone.d.ts +159 -0
  298. package/dist/form/phone.js +309 -0
  299. package/dist/form/phone.js.map +1 -0
  300. package/dist/form/search-field.d.ts +29 -0
  301. package/dist/form/search-field.js +23 -0
  302. package/dist/form/search-field.js.map +1 -0
  303. package/dist/form/styles.d.ts +31 -0
  304. package/dist/form/styles.js +43 -0
  305. package/dist/form/styles.js.map +1 -0
  306. package/dist/form/text-area.d.ts +70 -0
  307. package/dist/form/text-area.js +93 -0
  308. package/dist/form/text-area.js.map +1 -0
  309. package/dist/form/text-field.d.ts +131 -0
  310. package/dist/form/text-field.js +59 -0
  311. package/dist/form/text-field.js.map +1 -0
  312. package/dist/form/validation.d.ts +145 -0
  313. package/dist/form/validation.js +136 -0
  314. package/dist/form/validation.js.map +1 -0
  315. package/dist/i18n.d.ts +438 -0
  316. package/dist/i18n.js +948 -0
  317. package/dist/i18n.js.map +1 -0
  318. package/dist/index.d.ts +9 -0
  319. package/dist/index.js +7 -0
  320. package/dist/index.js.map +1 -0
  321. package/dist/intl-locale.d.ts +30 -0
  322. package/dist/intl-locale.js +83 -0
  323. package/dist/intl-locale.js.map +1 -0
  324. package/dist/layers.d.ts +32 -0
  325. package/dist/layers.js +33 -0
  326. package/dist/layers.js.map +1 -0
  327. package/dist/layout/auth-form-layout.d.ts +71 -0
  328. package/dist/layout/auth-form-layout.js +61 -0
  329. package/dist/layout/auth-form-layout.js.map +1 -0
  330. package/dist/layout/auth-layout.d.ts +59 -0
  331. package/dist/layout/auth-layout.js +26 -0
  332. package/dist/layout/auth-layout.js.map +1 -0
  333. package/dist/layout/box.d.ts +26 -0
  334. package/dist/layout/box.js +16 -0
  335. package/dist/layout/box.js.map +1 -0
  336. package/dist/layout/grid.d.ts +27 -0
  337. package/dist/layout/grid.js +26 -0
  338. package/dist/layout/grid.js.map +1 -0
  339. package/dist/layout/index.d.ts +16 -0
  340. package/dist/layout/index.js +12 -0
  341. package/dist/layout/index.js.map +1 -0
  342. package/dist/layout/pressable.d.ts +40 -0
  343. package/dist/layout/pressable.js +65 -0
  344. package/dist/layout/pressable.js.map +1 -0
  345. package/dist/layout/reset-sent-card.d.ts +39 -0
  346. package/dist/layout/reset-sent-card.js +22 -0
  347. package/dist/layout/reset-sent-card.js.map +1 -0
  348. package/dist/layout/scroll-area.d.ts +29 -0
  349. package/dist/layout/scroll-area.js +95 -0
  350. package/dist/layout/scroll-area.js.map +1 -0
  351. package/dist/layout/section.d.ts +41 -0
  352. package/dist/layout/section.js +22 -0
  353. package/dist/layout/section.js.map +1 -0
  354. package/dist/layout/split.d.ts +50 -0
  355. package/dist/layout/split.js +35 -0
  356. package/dist/layout/split.js.map +1 -0
  357. package/dist/layout/stack.d.ts +44 -0
  358. package/dist/layout/stack.js +36 -0
  359. package/dist/layout/stack.js.map +1 -0
  360. package/dist/layout/tokens.d.ts +33 -0
  361. package/dist/layout/tokens.js +85 -0
  362. package/dist/layout/tokens.js.map +1 -0
  363. package/dist/layout/toolbar.d.ts +37 -0
  364. package/dist/layout/toolbar.js +334 -0
  365. package/dist/layout/toolbar.js.map +1 -0
  366. package/dist/navigate-context.d.ts +12 -0
  367. package/dist/navigate-context.js +13 -0
  368. package/dist/navigate-context.js.map +1 -0
  369. package/dist/navigation/accordion.d.ts +40 -0
  370. package/dist/navigation/accordion.js +33 -0
  371. package/dist/navigation/accordion.js.map +1 -0
  372. package/dist/navigation/bottom-nav.d.ts +29 -0
  373. package/dist/navigation/bottom-nav.js +48 -0
  374. package/dist/navigation/bottom-nav.js.map +1 -0
  375. package/dist/navigation/brand-link-context.d.ts +8 -0
  376. package/dist/navigation/brand-link-context.js +9 -0
  377. package/dist/navigation/brand-link-context.js.map +1 -0
  378. package/dist/navigation/breadcrumbs.d.ts +36 -0
  379. package/dist/navigation/breadcrumbs.js +51 -0
  380. package/dist/navigation/breadcrumbs.js.map +1 -0
  381. package/dist/navigation/dock.d.ts +27 -0
  382. package/dist/navigation/dock.js +47 -0
  383. package/dist/navigation/dock.js.map +1 -0
  384. package/dist/navigation/footer.d.ts +43 -0
  385. package/dist/navigation/footer.js +43 -0
  386. package/dist/navigation/footer.js.map +1 -0
  387. package/dist/navigation/index.d.ts +22 -0
  388. package/dist/navigation/index.js +17 -0
  389. package/dist/navigation/index.js.map +1 -0
  390. package/dist/navigation/language-names.d.ts +19 -0
  391. package/dist/navigation/language-names.js +79 -0
  392. package/dist/navigation/language-names.js.map +1 -0
  393. package/dist/navigation/language-switcher.d.ts +55 -0
  394. package/dist/navigation/language-switcher.js +53 -0
  395. package/dist/navigation/language-switcher.js.map +1 -0
  396. package/dist/navigation/nav-panel.d.ts +18 -0
  397. package/dist/navigation/nav-panel.js +51 -0
  398. package/dist/navigation/nav-panel.js.map +1 -0
  399. package/dist/navigation/navbar.d.ts +73 -0
  400. package/dist/navigation/navbar.js +64 -0
  401. package/dist/navigation/navbar.js.map +1 -0
  402. package/dist/navigation/page-header.d.ts +37 -0
  403. package/dist/navigation/page-header.js +50 -0
  404. package/dist/navigation/page-header.js.map +1 -0
  405. package/dist/navigation/pagination.d.ts +25 -0
  406. package/dist/navigation/pagination.js +51 -0
  407. package/dist/navigation/pagination.js.map +1 -0
  408. package/dist/navigation/panel-header.d.ts +37 -0
  409. package/dist/navigation/panel-header.js +50 -0
  410. package/dist/navigation/panel-header.js.map +1 -0
  411. package/dist/navigation/sidebar-script.d.ts +12 -0
  412. package/dist/navigation/sidebar-script.js +20 -0
  413. package/dist/navigation/sidebar-script.js.map +1 -0
  414. package/dist/navigation/sidebar.d.ts +149 -0
  415. package/dist/navigation/sidebar.js +332 -0
  416. package/dist/navigation/sidebar.js.map +1 -0
  417. package/dist/navigation/skip-link.d.ts +12 -0
  418. package/dist/navigation/skip-link.js +30 -0
  419. package/dist/navigation/skip-link.js.map +1 -0
  420. package/dist/navigation/stepper.d.ts +50 -0
  421. package/dist/navigation/stepper.js +96 -0
  422. package/dist/navigation/stepper.js.map +1 -0
  423. package/dist/navigation/tabs.d.ts +84 -0
  424. package/dist/navigation/tabs.js +118 -0
  425. package/dist/navigation/tabs.js.map +1 -0
  426. package/dist/navigation/toolbar.d.ts +37 -0
  427. package/dist/navigation/toolbar.js +334 -0
  428. package/dist/navigation/toolbar.js.map +1 -0
  429. package/dist/overlay/alert-dialog.d.ts +63 -0
  430. package/dist/overlay/alert-dialog.js +76 -0
  431. package/dist/overlay/alert-dialog.js.map +1 -0
  432. package/dist/overlay/command-palette.d.ts +53 -0
  433. package/dist/overlay/command-palette.js +130 -0
  434. package/dist/overlay/command-palette.js.map +1 -0
  435. package/dist/overlay/command.d.ts +53 -0
  436. package/dist/overlay/command.js +129 -0
  437. package/dist/overlay/command.js.map +1 -0
  438. package/dist/overlay/context-menu.d.ts +29 -0
  439. package/dist/overlay/context-menu.js +58 -0
  440. package/dist/overlay/context-menu.js.map +1 -0
  441. package/dist/overlay/dialog.d.ts +162 -0
  442. package/dist/overlay/dialog.js +174 -0
  443. package/dist/overlay/dialog.js.map +1 -0
  444. package/dist/overlay/drawer.d.ts +41 -0
  445. package/dist/overlay/drawer.js +114 -0
  446. package/dist/overlay/drawer.js.map +1 -0
  447. package/dist/overlay/floating.d.ts +142 -0
  448. package/dist/overlay/floating.js +226 -0
  449. package/dist/overlay/floating.js.map +1 -0
  450. package/dist/overlay/hover-card.d.ts +19 -0
  451. package/dist/overlay/hover-card.js +31 -0
  452. package/dist/overlay/hover-card.js.map +1 -0
  453. package/dist/overlay/index.d.ts +18 -0
  454. package/dist/overlay/index.js +12 -0
  455. package/dist/overlay/index.js.map +1 -0
  456. package/dist/overlay/overlay-base.d.ts +105 -0
  457. package/dist/overlay/overlay-base.js +250 -0
  458. package/dist/overlay/overlay-base.js.map +1 -0
  459. package/dist/overlay/overlay.d.ts +299 -0
  460. package/dist/overlay/overlay.js +558 -0
  461. package/dist/overlay/overlay.js.map +1 -0
  462. package/dist/overlay/toast.d.ts +58 -0
  463. package/dist/overlay/toast.js +145 -0
  464. package/dist/overlay/toast.js.map +1 -0
  465. package/dist/provider.d.ts +26 -0
  466. package/dist/provider.js +30 -0
  467. package/dist/provider.js.map +1 -0
  468. package/dist/selection/autocomplete.d.ts +54 -0
  469. package/dist/selection/autocomplete.js +122 -0
  470. package/dist/selection/autocomplete.js.map +1 -0
  471. package/dist/selection/checkbox.d.ts +56 -0
  472. package/dist/selection/checkbox.js +49 -0
  473. package/dist/selection/checkbox.js.map +1 -0
  474. package/dist/selection/choice-size.d.ts +26 -0
  475. package/dist/selection/choice-size.js +50 -0
  476. package/dist/selection/choice-size.js.map +1 -0
  477. package/dist/selection/choice-text.d.ts +21 -0
  478. package/dist/selection/choice-text.js +33 -0
  479. package/dist/selection/choice-text.js.map +1 -0
  480. package/dist/selection/combobox.d.ts +173 -0
  481. package/dist/selection/combobox.js +410 -0
  482. package/dist/selection/combobox.js.map +1 -0
  483. package/dist/selection/index.d.ts +20 -0
  484. package/dist/selection/index.js +13 -0
  485. package/dist/selection/index.js.map +1 -0
  486. package/dist/selection/list-box.d.ts +30 -0
  487. package/dist/selection/list-box.js +16 -0
  488. package/dist/selection/list-box.js.map +1 -0
  489. package/dist/selection/listbox.d.ts +44 -0
  490. package/dist/selection/listbox.js +49 -0
  491. package/dist/selection/listbox.js.map +1 -0
  492. package/dist/selection/match.d.ts +20 -0
  493. package/dist/selection/match.js +57 -0
  494. package/dist/selection/match.js.map +1 -0
  495. package/dist/selection/multi-select.d.ts +72 -0
  496. package/dist/selection/multi-select.js +138 -0
  497. package/dist/selection/multi-select.js.map +1 -0
  498. package/dist/selection/radio-card.d.ts +31 -0
  499. package/dist/selection/radio-card.js +29 -0
  500. package/dist/selection/radio-card.js.map +1 -0
  501. package/dist/selection/radio.d.ts +72 -0
  502. package/dist/selection/radio.js +64 -0
  503. package/dist/selection/radio.js.map +1 -0
  504. package/dist/selection/select-public.d.ts +19 -0
  505. package/dist/selection/select-public.js +24 -0
  506. package/dist/selection/select-public.js.map +1 -0
  507. package/dist/selection/select.d.ts +72 -0
  508. package/dist/selection/select.js +69 -0
  509. package/dist/selection/select.js.map +1 -0
  510. package/dist/selection/slider.d.ts +16 -0
  511. package/dist/selection/slider.js +44 -0
  512. package/dist/selection/slider.js.map +1 -0
  513. package/dist/selection/styles.d.ts +26 -0
  514. package/dist/selection/styles.js +78 -0
  515. package/dist/selection/styles.js.map +1 -0
  516. package/dist/selection/switch.d.ts +24 -0
  517. package/dist/selection/switch.js +27 -0
  518. package/dist/selection/switch.js.map +1 -0
  519. package/dist/selection/tag-group.d.ts +38 -0
  520. package/dist/selection/tag-group.js +45 -0
  521. package/dist/selection/tag-group.js.map +1 -0
  522. package/dist/tone.d.ts +6 -0
  523. package/dist/tone.js +2 -0
  524. package/dist/tone.js.map +1 -0
  525. package/dist/utils.d.ts +9 -0
  526. package/dist/utils.js +42 -0
  527. package/dist/utils.js.map +1 -0
  528. package/manifest/component.full.schema.json +391 -0
  529. package/manifest/component.schema.json +279 -0
  530. package/manifests/accordion.json +299 -0
  531. package/manifests/alert-dialog.json +261 -0
  532. package/manifests/area-chart.json +338 -0
  533. package/manifests/autocomplete.json +299 -0
  534. package/manifests/avatar.json +253 -0
  535. package/manifests/badge.json +288 -0
  536. package/manifests/banner.json +185 -0
  537. package/manifests/bar-chart.json +454 -0
  538. package/manifests/bar-list.json +262 -0
  539. package/manifests/bottom-nav.json +139 -0
  540. package/manifests/box.json +3450 -0
  541. package/manifests/breadcrumbs.json +199 -0
  542. package/manifests/button-group.json +2294 -0
  543. package/manifests/button.json +1211 -0
  544. package/manifests/calendar-heatmap.json +218 -0
  545. package/manifests/calendar.json +299 -0
  546. package/manifests/card.json +308 -0
  547. package/manifests/carousel.json +263 -0
  548. package/manifests/chart-parts.json +309 -0
  549. package/manifests/checkbox.json +998 -0
  550. package/manifests/close-button.json +1000 -0
  551. package/manifests/color-field.json +276 -0
  552. package/manifests/color-picker.json +161 -0
  553. package/manifests/color-swatch-picker.json +220 -0
  554. package/manifests/color-swatch.json +140 -0
  555. package/manifests/combobox.json +581 -0
  556. package/manifests/command.json +275 -0
  557. package/manifests/composed-chart.json +287 -0
  558. package/manifests/context-menu.json +148 -0
  559. package/manifests/copy-button.json +192 -0
  560. package/manifests/data-table.json +334 -0
  561. package/manifests/date-field.json +302 -0
  562. package/manifests/date-picker.json +472 -0
  563. package/manifests/description-list.json +201 -0
  564. package/manifests/dialog.json +322 -0
  565. package/manifests/donut-chart.json +264 -0
  566. package/manifests/drawer.json +211 -0
  567. package/manifests/empty-state.json +185 -0
  568. package/manifests/fab.json +172 -0
  569. package/manifests/field.json +209 -0
  570. package/manifests/file-upload.json +791 -0
  571. package/manifests/form.json +829 -0
  572. package/manifests/funnel-chart.json +223 -0
  573. package/manifests/gauge-chart.json +252 -0
  574. package/manifests/grid-list.json +335 -0
  575. package/manifests/grid.json +3482 -0
  576. package/manifests/heading.json +183 -0
  577. package/manifests/heatmap.json +265 -0
  578. package/manifests/hover-card.json +172 -0
  579. package/manifests/icon.json +201 -0
  580. package/manifests/image-cropper.json +295 -0
  581. package/manifests/image-viewer.json +198 -0
  582. package/manifests/image.json +193 -0
  583. package/manifests/index.json +2035 -0
  584. package/manifests/input-group.json +3571 -0
  585. package/manifests/input.json +1557 -0
  586. package/manifests/kbd.json +98 -0
  587. package/manifests/language-switcher.json +274 -0
  588. package/manifests/line-chart.json +342 -0
  589. package/manifests/link.json +867 -0
  590. package/manifests/list-box.json +213 -0
  591. package/manifests/menu.json +453 -0
  592. package/manifests/meter.json +145 -0
  593. package/manifests/navbar.json +281 -0
  594. package/manifests/otp-field.json +1029 -0
  595. package/manifests/page-header.json +164 -0
  596. package/manifests/pagination.json +181 -0
  597. package/manifests/popover.json +205 -0
  598. package/manifests/pressable.json +367 -0
  599. package/manifests/progress.json +282 -0
  600. package/manifests/radar-chart.json +229 -0
  601. package/manifests/radial-chart.json +195 -0
  602. package/manifests/radio.json +975 -0
  603. package/manifests/scatter-chart.json +277 -0
  604. package/manifests/scroll-area.json +127 -0
  605. package/manifests/section.json +169 -0
  606. package/manifests/select.json +474 -0
  607. package/manifests/separator.json +119 -0
  608. package/manifests/sidebar.json +584 -0
  609. package/manifests/skeleton.json +235 -0
  610. package/manifests/skip-link.json +89 -0
  611. package/manifests/slider.json +706 -0
  612. package/manifests/sparkline.json +208 -0
  613. package/manifests/spinner.json +105 -0
  614. package/manifests/split.json +6618 -0
  615. package/manifests/stack.json +3541 -0
  616. package/manifests/stat.json +192 -0
  617. package/manifests/stepper.json +279 -0
  618. package/manifests/switch.json +205 -0
  619. package/manifests/table.json +375 -0
  620. package/manifests/tabs.json +438 -0
  621. package/manifests/tag-group.json +264 -0
  622. package/manifests/text-area.json +1136 -0
  623. package/manifests/text.json +244 -0
  624. package/manifests/theme-switcher.json +152 -0
  625. package/manifests/time-field.json +284 -0
  626. package/manifests/timeline.json +196 -0
  627. package/manifests/toast.json +87 -0
  628. package/manifests/toggle-button.json +1489 -0
  629. package/manifests/toolbar.json +145 -0
  630. package/manifests/tooltip.json +181 -0
  631. package/manifests/tracker.json +192 -0
  632. package/manifests/tree.json +245 -0
  633. package/manifests/visually-hidden.json +114 -0
  634. package/package.json +117 -3
  635. package/styles/base.css +56 -0
  636. package/styles/theme.css +154 -0
@@ -0,0 +1,309 @@
1
+ /**
2
+ * Dial codes and national number shapes for phone fields.
3
+ *
4
+ * One free-text box stores "+382 67 123 456", "067123456" and "38267123456" as three spellings of one number.
5
+ * A phone field instead has the reader pick a calling code, groups the digits as they are typed, and stores one
6
+ * E.164 spelling on submit.
7
+ *
8
+ * `libphonenumber-js` is the exhaustive answer, at the cost of a large dependency. This table covers common
9
+ * markets with their grouping, length and trunk prefix; any other country falls back to the shared `DIAL_CODES`
10
+ * list plus digits grouped in threes. The table is the *formatting* table, not the list of countries the picker
11
+ * offers: that comes from `COUNTRIES`. A dialling code belongs in the shared list; a group shape belongs here.
12
+ */
13
+ import { COUNTRIES, DIAL_CODES } from "./countries.js";
14
+ import { intlLocale, regionNames } from "../intl-locale.js";
15
+ /**
16
+ * Sorted by ISO code. Where two countries share a calling code, the one listed first wins when a pasted
17
+ * number is read; no two rows here share one.
18
+ *
19
+ * Trunk prefixes (`trunkPrefix`). Sources, cited per row:
20
+ * [OB994] ITU-T, "Dialling procedures (international prefix, national (trunk) prefix and national (significant)
21
+ * number)", position on 15 December 2011, Annex to ITU Operational Bulletin No. 994 (T-SP-E.164C-2011),
22
+ * column "National prefix" (notes 2: in France and Switzerland the 0 is dialled on every domestic call).
23
+ * [ME-NNP] ITU-T national numbering plan communication of 5.XI.2014, EKIP Podgorica: "National prefix: 0".
24
+ * [AL-NNP] ITU-T national numbering plan communication of 13.II.2017, AKEP: a closed plan, domestic calls use
25
+ * "the full length number with the prefix 0"; the table lists "0 National prefix".
26
+ * [RS-PN] RATEL, Numbering Plan for Telecommunication Networks (16.06.2006): a national call dials "the national
27
+ * prefix 0", which "is not part of the national number".
28
+ * [PL-DU] Rozporządzenie Ministra Administracji i Cyfryzacji z 30.10.2013 w sprawie planu numeracji krajowej
29
+ * (Dz.U. 2013 poz. 1281), § 4 pkt 2: a national number is dialled "~ KNA", with no prefix; the "0" was
30
+ * withdrawn from 30.09.2009 (Dz.U. 2009 poz. 1225). [OB994]'s "0" for Poland predates the change.
31
+ * [RU-142] Rossvyaz plan (Mininformsvyazi order No. 142 of 17.11.2006, as amended): the long-distance prefix "8";
32
+ * the planned move to "0" was postponed repeatedly and is not recorded here. National numbers also
33
+ * begin with 8 (ABC 810–880, DEF 800–809, ITU-T communication of 26.X.2016), hence
34
+ * `trunkPrefixStartsNumbers`.
35
+ * [XK] Kosovo, the one row without a regulator source: trunk prefix "0" from
36
+ * secondary sources only (the Wikipedia "Telephone numbers in Kosovo" infobox; dialling guides). [OB994]
37
+ * predates +383, and ARKEP's ITU-T communications (15.III.2017, 31.X.2019) state none; revisit if ARKEP
38
+ * publishes one.
39
+ * [XK-NNP] ITU-T communication of 15.III.2017, ARKEP: national numbers are 8 to 9 digits; the fixed NDCs 280, 290
40
+ * and 390 take 9.
41
+ */
42
+ export const PHONE_COUNTRIES = [
43
+ { iso: "AL", dial: "355", groups: [3, 3, 3], min: 9, max: 9, trunkPrefix: "0" }, // [OB994], [AL-NNP]
44
+ { iso: "AT", dial: "43", groups: [3, 3, 4], min: 10, max: 10, trunkPrefix: "0" }, // [OB994]
45
+ { iso: "BA", dial: "387", groups: [2, 3, 3], min: 8, max: 8, trunkPrefix: "0" }, // [OB994]
46
+ { iso: "CH", dial: "41", groups: [2, 3, 2, 2], min: 9, max: 9, trunkPrefix: "0" }, // [OB994] note 2
47
+ { iso: "DE", dial: "49", groups: [3, 4, 4], min: 10, max: 11, trunkPrefix: "0" }, // [OB994]
48
+ { iso: "FR", dial: "33", groups: [1, 2, 2, 2, 2], min: 9, max: 9, trunkPrefix: "0" }, // [OB994] note 2
49
+ { iso: "GB", dial: "44", groups: [4, 3, 3], min: 10, max: 10, trunkPrefix: "0" }, // [OB994]
50
+ { iso: "HR", dial: "385", groups: [2, 3, 4], min: 8, max: 9, trunkPrefix: "0" }, // [OB994]
51
+ { iso: "IT", dial: "39", groups: [3, 3, 4], min: 9, max: 10, trunkPrefix: null }, // [OB994]: none, the 0 is part of the number
52
+ { iso: "ME", dial: "382", groups: [2, 3, 3], min: 8, max: 8, trunkPrefix: "0" }, // [OB994], [ME-NNP]
53
+ { iso: "MK", dial: "389", groups: [2, 3, 3], min: 8, max: 8, trunkPrefix: "0" }, // [OB994]
54
+ { iso: "NL", dial: "31", groups: [1, 4, 4], min: 9, max: 9, trunkPrefix: "0" }, // [OB994]
55
+ { iso: "PL", dial: "48", groups: [3, 3, 3], min: 9, max: 9, trunkPrefix: null }, // [PL-DU]
56
+ { iso: "RS", dial: "381", groups: [2, 3, 4], min: 8, max: 9, trunkPrefix: "0" }, // [OB994], [RS-PN]
57
+ { iso: "RU", dial: "7", groups: [3, 3, 2, 2], min: 10, max: 10, trunkPrefix: "8", trunkPrefixStartsNumbers: true }, // [OB994], [RU-142]
58
+ { iso: "SI", dial: "386", groups: [2, 3, 3], min: 8, max: 8, trunkPrefix: "0" }, // [OB994]
59
+ { iso: "TR", dial: "90", groups: [3, 3, 2, 2], min: 10, max: 10, trunkPrefix: "0" }, // [OB994]
60
+ { iso: "UA", dial: "380", groups: [2, 3, 2, 2], min: 9, max: 9, trunkPrefix: "0" }, // [OB994]
61
+ { iso: "US", dial: "1", groups: [3, 3, 4], min: 10, max: 10, trunkPrefix: "1" }, // [OB994]: NANP numbers never begin with 1
62
+ { iso: "XK", dial: "383", groups: [2, 3, 3], min: 8, max: 9, trunkPrefix: "0" }, // [XK], [XK-NNP]
63
+ ];
64
+ /** The shape used when the country is not in the table. */
65
+ const FALLBACK_GROUPS = [3, 3, 3, 3];
66
+ const FALLBACK_MIN = 6;
67
+ const FALLBACK_MAX = 15;
68
+ /**
69
+ * The country a phone field opens on when the app names none: the locale's region ("de-AT" → AT), or the region
70
+ * its language most likely means ("de" → DE, "en" → US); "US" when neither has a calling code.
71
+ */
72
+ export function localeCountry(locale) {
73
+ try {
74
+ const region = new Intl.Locale(intlLocale(locale)).maximize().region;
75
+ if (region && DIAL_CODES[region])
76
+ return region;
77
+ }
78
+ catch {
79
+ // An app's private tag Intl cannot read falls through.
80
+ }
81
+ return "US";
82
+ }
83
+ /**
84
+ * The shape for a country: from the table when it is there, and from the
85
+ * shared dialling codes when it is not.
86
+ *
87
+ * An undefined answer would be silent and expensive — `toE164` writes
88
+ * `+${country?.dial ?? ""}`, so a customer choosing Japan would have stored a
89
+ * number with no country code at all.
90
+ *
91
+ * A synthesised entry carries the real dialling code with the fallback shape.
92
+ * Its trunk prefix is unknown, so nothing is stripped from its
93
+ * numbers.
94
+ */
95
+ export function findCountry(iso) {
96
+ const known = PHONE_COUNTRIES.find((country) => country.iso === iso);
97
+ if (known)
98
+ return known;
99
+ const dial = DIAL_CODES[iso];
100
+ if (!dial)
101
+ return undefined;
102
+ return {
103
+ iso,
104
+ dial,
105
+ groups: FALLBACK_GROUPS,
106
+ min: FALLBACK_MIN,
107
+ max: FALLBACK_MAX,
108
+ };
109
+ }
110
+ const DECIMAL_DIGIT = /\p{Nd}/u;
111
+ /**
112
+ * The ASCII digit for any Unicode decimal digit: full-width "5" from a Japanese IME, Arabic-Indic "٥",
113
+ * Extended Arabic-Indic "۵", Devanagari "५"… Unicode keeps every decimal digit set as ten consecutive code
114
+ * points, 0 to 9, so a digit's value is its distance from the start of its run, modulo ten (some sets sit
115
+ * back to back, like the five mathematical ones).
116
+ */
117
+ function asciiDigit(digit) {
118
+ const point = digit.codePointAt(0);
119
+ if (point <= 0x39)
120
+ return digit;
121
+ let start = point;
122
+ while (DECIMAL_DIGIT.test(String.fromCodePoint(start - 1)))
123
+ start -= 1;
124
+ return String((point - start) % 10);
125
+ }
126
+ /**
127
+ * Digits only, as ASCII. Everything a person might type between them is decoration; a digit typed in another
128
+ * script (a full-width IME, an Arabic or Persian keyboard) is the same digit.
129
+ */
130
+ export function digitsOf(value) {
131
+ return value.replace(/\p{Nd}/gu, asciiDigit).replace(/\D/g, "");
132
+ }
133
+ /** How many digits sit to the left of `caret` in a formatted (or raw) string. */
134
+ export function digitCountBefore(value, caret) {
135
+ const clamped = Math.max(0, Math.min(caret, value.length));
136
+ return digitsOf(value.slice(0, clamped)).length;
137
+ }
138
+ /**
139
+ * Character index in `formatted` that sits after `digitCount` digits.
140
+ * Skips a following space so the next keystroke lands in the next group.
141
+ */
142
+ export function caretAfterDigits(formatted, digitCount) {
143
+ if (digitCount <= 0)
144
+ return 0;
145
+ let seen = 0;
146
+ for (let i = 0; i < formatted.length; i++) {
147
+ if (formatted[i] >= "0" && formatted[i] <= "9") {
148
+ seen += 1;
149
+ if (seen === digitCount) {
150
+ let caret = i + 1;
151
+ while (caret < formatted.length && formatted[caret] === " ")
152
+ caret += 1;
153
+ return caret;
154
+ }
155
+ }
156
+ }
157
+ return formatted.length;
158
+ }
159
+ /**
160
+ * Grouping spaces are not characters. Backspace/Delete against a space
161
+ * should remove the adjacent digit — otherwise the formatted value is
162
+ * unchanged, React rewrites the input, and the caret jumps to the end
163
+ *.
164
+ */
165
+ export function digitIndexForSeparatorKey(formatted, caret, key) {
166
+ const idx = key === "Backspace" ? caret - 1 : caret;
167
+ if (idx < 0 || idx >= formatted.length || formatted[idx] !== " ")
168
+ return null;
169
+ const before = digitCountBefore(formatted, caret);
170
+ if (key === "Backspace")
171
+ return before > 0 ? before - 1 : null;
172
+ return before < digitsOf(formatted).length ? before : null;
173
+ }
174
+ /**
175
+ * Group `digits` the way `country` says the number is spoken.
176
+ *
177
+ * Formats what is there rather than what is missing — a half-typed number gets
178
+ * the spaces it has earned and no trailing separator, so the caret never sits
179
+ * after a space the reader did not type. Digits past the last group stay
180
+ * attached rather than being dropped.
181
+ */
182
+ export function formatNational(digits, country) {
183
+ const groups = country?.groups ?? FALLBACK_GROUPS;
184
+ const clean = digitsOf(digits);
185
+ const parts = [];
186
+ let index = 0;
187
+ for (const size of groups) {
188
+ if (index >= clean.length)
189
+ break;
190
+ parts.push(clean.slice(index, index + size));
191
+ index += size;
192
+ }
193
+ if (index < clean.length)
194
+ parts.push(clean.slice(index));
195
+ return parts.join(" ");
196
+ }
197
+ /** `+90 539 340 76 24` — for display and for anything a human reads. */
198
+ export function formatPhone(digits, country) {
199
+ const national = formatNational(digits, country);
200
+ const dial = country?.dial;
201
+ if (!dial)
202
+ return national;
203
+ return national ? `+${dial} ${national}` : `+${dial}`;
204
+ }
205
+ /**
206
+ * `+905393407624` — the form sent to the API and used to build a WhatsApp
207
+ * link. Spaces are for reading; a stored number should have one spelling.
208
+ */
209
+ export function toE164(digits, country) {
210
+ const clean = digitsOf(digits);
211
+ if (!clean)
212
+ return "";
213
+ return `+${country?.dial ?? ""}${clean}`;
214
+ }
215
+ export function isCompleteNational(digits, country) {
216
+ const length = digitsOf(digits).length;
217
+ const min = country?.min ?? FALLBACK_MIN;
218
+ const max = country?.max ?? FALLBACK_MAX;
219
+ return length >= min && length <= max;
220
+ }
221
+ /**
222
+ * Split a stored `+…` number back into a country and its national digits, so
223
+ * returning to a saved draft puts the reader where they left off.
224
+ *
225
+ * Longest dial code first: `+38` is a prefix of `+380`, `+381`, `+382`…
226
+ * Matching short would put a Ukrainian number under Serbia. The curated
227
+ * table is tried first so known shapes win; then every shared dial code so
228
+ * a Japanese number is not handed back as an unrecognised blob.
229
+ */
230
+ export function parsePhone(value) {
231
+ const clean = digitsOf(value);
232
+ if (!clean)
233
+ return { country: undefined, national: "" };
234
+ const known = [...PHONE_COUNTRIES].sort((a, b) => b.dial.length - a.dial.length);
235
+ for (const country of known) {
236
+ if (clean.startsWith(country.dial)) {
237
+ return { country, national: clean.slice(country.dial.length) };
238
+ }
239
+ }
240
+ const shared = Object.entries(DIAL_CODES)
241
+ .map(([iso, dial]) => ({ iso, dial }))
242
+ .sort((a, b) => b.dial.length - a.dial.length || a.iso.localeCompare(b.iso));
243
+ for (const { iso, dial } of shared) {
244
+ if (clean.startsWith(dial)) {
245
+ return { country: findCountry(iso), national: clean.slice(dial.length) };
246
+ }
247
+ }
248
+ return { country: undefined, national: clean };
249
+ }
250
+ /**
251
+ * Localized country name via `Intl.DisplayNames`, e.g. "Germany" / "Deutschland" / "Allemagne".
252
+ * Distinct from `countries.countryName`,
253
+ * which returns the English catalog entry.
254
+ */
255
+ export function countryName(iso, locale) {
256
+ // A locale the runtime does not know is not a reason to lose the picker.
257
+ return regionNames(locale)(iso) ?? iso;
258
+ }
259
+ /** The `Intl` locale a phone field names and sorts its countries in. */
260
+ export function phoneDisplayLocale(locale) {
261
+ // An app's own tag ("me" for Montenegrin) reaches Intl through `registerLocaleAliases`.
262
+ return intlLocale(locale);
263
+ }
264
+ /**
265
+ * Every country a phone field offers, named in the reader's language and
266
+ * sorted by that name the way that language sorts ("Tunus" before "Türkiye"
267
+ * in Turkish). Sorting by ISO code instead would show a Turkish reader
268
+ * Ekvator Ginesi, Yunanistan, Guatemala…
269
+ *
270
+ */
271
+ export function phoneCountries(locale) {
272
+ const displayLocale = phoneDisplayLocale(locale);
273
+ // One formatter for the whole list: building one per country is what
274
+ // made opening the field slow.
275
+ const names = regionNames(displayLocale);
276
+ let collator;
277
+ try {
278
+ collator = new Intl.Collator(displayLocale);
279
+ }
280
+ catch {
281
+ // A locale the runtime does not know is not a reason to lose the picker.
282
+ collator = new Intl.Collator();
283
+ }
284
+ return COUNTRIES.map((item) => ({
285
+ code: item.code,
286
+ name: names(item.code) ?? item.code,
287
+ })).sort((a, b) => collator.compare(a.name, b.name));
288
+ }
289
+ /** Complete national number whose E.164 spelling is at most 15 digits. */
290
+ export function isSubmittedPhone(value) {
291
+ const parsed = parsePhone(value);
292
+ if (!isCompleteNational(parsed.national, parsed.country))
293
+ return false;
294
+ return digitsOf(toE164(parsed.national, parsed.country)).length <= 15;
295
+ }
296
+ /**
297
+ * National digits of a stored E.164 value for the *selected* country.
298
+ * Prefer this over `parsePhone` when the picker already knows the ISO:
299
+ * `parsePhone` has to guess, and shared prefixes (NANP `+1`) can guess wrong.
300
+ */
301
+ export function nationalDigits(value, country) {
302
+ const clean = digitsOf(value);
303
+ if (!clean)
304
+ return "";
305
+ if (clean.startsWith(country.dial))
306
+ return clean.slice(country.dial.length);
307
+ return clean;
308
+ }
309
+ //# sourceMappingURL=phone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone.js","sourceRoot":"","sources":["../../src/form/phone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAgB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA8BzD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,eAAe,GAA4B;IACtD,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,oBAAoB;IACrG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,UAAU;IAC5F,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,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,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IACvE,OAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC;AACxE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,OAAqB;IACjE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5E,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * Dial codes and national number shapes for phone fields.\n *\n * One free-text box stores \"+382 67 123 456\", \"067123456\" and \"38267123456\" as three spellings of one number.\n * A phone field instead has the reader pick a calling code, groups the digits as they are typed, and stores one\n * E.164 spelling on submit.\n *\n * `libphonenumber-js` is the exhaustive answer, at the cost of a large dependency. This table covers common\n * markets with their grouping, length and trunk prefix; any other country falls back to the shared `DIAL_CODES`\n * list plus digits grouped in threes. The table is the *formatting* table, not the list of countries the picker\n * offers: that comes from `COUNTRIES`. A dialling code belongs in the shared list; a group shape belongs here.\n */\n\nimport { COUNTRIES, DIAL_CODES, type Country } from \"./countries\";\nimport { intlLocale, regionNames } from \"../intl-locale\";\n\nexport interface PhoneCountry {\n /** ISO 3166-1 alpha-2 — the key `Intl.DisplayNames` resolves. */\n iso: string;\n /** Dial code without the plus. */\n dial: string;\n /**\n * How the national number is spoken aloud, as digit-group lengths.\n * Turkish 5393407624 is \"539 340 76 24\", so [3, 3, 2, 2].\n */\n groups: number[];\n /** National digit count, inclusive. Some countries genuinely vary. */\n min: number;\n max: number;\n /**\n * The national (trunk) prefix dialled before the national number inside the country (\"0\" for Montenegro's\n * \"068 555 444\", \"8\" for Russia, \"1\" for the United States), never part of the E.164 number.\n * `null`: the country has none, its numbers are dialled whole (Italy's \"06 1234 5678\" keeps its 0). Left out:\n * not known, and nothing is ever stripped. Each value is sourced in the table's comment.\n */\n trunkPrefix?: string | null;\n /**\n * The trunk prefix's digits can also begin a valid national number (Russia: \"8\" is the trunk prefix and 812 is\n * St Petersburg). Then the prefix is stripped only when the rest is a whole number on its own, at the longest\n * length, so a complete national number that starts with those digits is never cut.\n */\n trunkPrefixStartsNumbers?: boolean;\n}\n\n/**\n * Sorted by ISO code. Where two countries share a calling code, the one listed first wins when a pasted\n * number is read; no two rows here share one.\n *\n * Trunk prefixes (`trunkPrefix`). Sources, cited per row:\n * [OB994] ITU-T, \"Dialling procedures (international prefix, national (trunk) prefix and national (significant)\n * number)\", position on 15 December 2011, Annex to ITU Operational Bulletin No. 994 (T-SP-E.164C-2011),\n * column \"National prefix\" (notes 2: in France and Switzerland the 0 is dialled on every domestic call).\n * [ME-NNP] ITU-T national numbering plan communication of 5.XI.2014, EKIP Podgorica: \"National prefix: 0\".\n * [AL-NNP] ITU-T national numbering plan communication of 13.II.2017, AKEP: a closed plan, domestic calls use\n * \"the full length number with the prefix 0\"; the table lists \"0 National prefix\".\n * [RS-PN] RATEL, Numbering Plan for Telecommunication Networks (16.06.2006): a national call dials \"the national\n * prefix 0\", which \"is not part of the national number\".\n * [PL-DU] Rozporządzenie Ministra Administracji i Cyfryzacji z 30.10.2013 w sprawie planu numeracji krajowej\n * (Dz.U. 2013 poz. 1281), § 4 pkt 2: a national number is dialled \"~ KNA\", with no prefix; the \"0\" was\n * withdrawn from 30.09.2009 (Dz.U. 2009 poz. 1225). [OB994]'s \"0\" for Poland predates the change.\n * [RU-142] Rossvyaz plan (Mininformsvyazi order No. 142 of 17.11.2006, as amended): the long-distance prefix \"8\";\n * the planned move to \"0\" was postponed repeatedly and is not recorded here. National numbers also\n * begin with 8 (ABC 810–880, DEF 800–809, ITU-T communication of 26.X.2016), hence\n * `trunkPrefixStartsNumbers`.\n * [XK] Kosovo, the one row without a regulator source: trunk prefix \"0\" from\n * secondary sources only (the Wikipedia \"Telephone numbers in Kosovo\" infobox; dialling guides). [OB994]\n * predates +383, and ARKEP's ITU-T communications (15.III.2017, 31.X.2019) state none; revisit if ARKEP\n * publishes one.\n * [XK-NNP] ITU-T communication of 15.III.2017, ARKEP: national numbers are 8 to 9 digits; the fixed NDCs 280, 290\n * and 390 take 9.\n */\nexport const PHONE_COUNTRIES: readonly PhoneCountry[] = [\n { iso: \"AL\", dial: \"355\", groups: [3, 3, 3], min: 9, max: 9, trunkPrefix: \"0\" }, // [OB994], [AL-NNP]\n { iso: \"AT\", dial: \"43\", groups: [3, 3, 4], min: 10, max: 10, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"BA\", dial: \"387\", groups: [2, 3, 3], min: 8, max: 8, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"CH\", dial: \"41\", groups: [2, 3, 2, 2], min: 9, max: 9, trunkPrefix: \"0\" }, // [OB994] note 2\n { iso: \"DE\", dial: \"49\", groups: [3, 4, 4], min: 10, max: 11, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"FR\", dial: \"33\", groups: [1, 2, 2, 2, 2], min: 9, max: 9, trunkPrefix: \"0\" }, // [OB994] note 2\n { iso: \"GB\", dial: \"44\", groups: [4, 3, 3], min: 10, max: 10, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"HR\", dial: \"385\", groups: [2, 3, 4], min: 8, max: 9, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"IT\", dial: \"39\", groups: [3, 3, 4], min: 9, max: 10, trunkPrefix: null }, // [OB994]: none, the 0 is part of the number\n { iso: \"ME\", dial: \"382\", groups: [2, 3, 3], min: 8, max: 8, trunkPrefix: \"0\" }, // [OB994], [ME-NNP]\n { iso: \"MK\", dial: \"389\", groups: [2, 3, 3], min: 8, max: 8, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"NL\", dial: \"31\", groups: [1, 4, 4], min: 9, max: 9, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"PL\", dial: \"48\", groups: [3, 3, 3], min: 9, max: 9, trunkPrefix: null }, // [PL-DU]\n { iso: \"RS\", dial: \"381\", groups: [2, 3, 4], min: 8, max: 9, trunkPrefix: \"0\" }, // [OB994], [RS-PN]\n { iso: \"RU\", dial: \"7\", groups: [3, 3, 2, 2], min: 10, max: 10, trunkPrefix: \"8\", trunkPrefixStartsNumbers: true }, // [OB994], [RU-142]\n { iso: \"SI\", dial: \"386\", groups: [2, 3, 3], min: 8, max: 8, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"TR\", dial: \"90\", groups: [3, 3, 2, 2], min: 10, max: 10, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"UA\", dial: \"380\", groups: [2, 3, 2, 2], min: 9, max: 9, trunkPrefix: \"0\" }, // [OB994]\n { iso: \"US\", dial: \"1\", groups: [3, 3, 4], min: 10, max: 10, trunkPrefix: \"1\" }, // [OB994]: NANP numbers never begin with 1\n { iso: \"XK\", dial: \"383\", groups: [2, 3, 3], min: 8, max: 9, trunkPrefix: \"0\" }, // [XK], [XK-NNP]\n];\n\n/** The shape used when the country is not in the table. */\nconst FALLBACK_GROUPS = [3, 3, 3, 3];\nconst FALLBACK_MIN = 6;\nconst FALLBACK_MAX = 15;\n\n/**\n * The country a phone field opens on when the app names none: the locale's region (\"de-AT\" → AT), or the region\n * its language most likely means (\"de\" → DE, \"en\" → US); \"US\" when neither has a calling code.\n */\nexport function localeCountry(locale: string): string {\n try {\n const region = new Intl.Locale(intlLocale(locale)).maximize().region;\n if (region && DIAL_CODES[region]) return region;\n } catch {\n // An app's private tag Intl cannot read falls through.\n }\n return \"US\";\n}\n\n/**\n * The shape for a country: from the table when it is there, and from the\n * shared dialling codes when it is not.\n *\n * An undefined answer would be silent and expensive — `toE164` writes\n * `+${country?.dial ?? \"\"}`, so a customer choosing Japan would have stored a\n * number with no country code at all.\n *\n * A synthesised entry carries the real dialling code with the fallback shape.\n * Its trunk prefix is unknown, so nothing is stripped from its\n * numbers.\n */\nexport function findCountry(iso: string): PhoneCountry | undefined {\n const known = PHONE_COUNTRIES.find((country) => country.iso === iso);\n if (known) return known;\n\n const dial = DIAL_CODES[iso];\n if (!dial) return undefined;\n\n return {\n iso,\n dial,\n groups: FALLBACK_GROUPS,\n min: FALLBACK_MIN,\n max: FALLBACK_MAX,\n };\n}\n\nconst DECIMAL_DIGIT = /\\p{Nd}/u;\n\n/**\n * The ASCII digit for any Unicode decimal digit: full-width \"5\" from a Japanese IME, Arabic-Indic \"٥\",\n * Extended Arabic-Indic \"۵\", Devanagari \"५\"… Unicode keeps every decimal digit set as ten consecutive code\n * points, 0 to 9, so a digit's value is its distance from the start of its run, modulo ten (some sets sit\n * back to back, like the five mathematical ones).\n */\nfunction asciiDigit(digit: string): string {\n const point = digit.codePointAt(0)!;\n if (point <= 0x39) return digit;\n let start = point;\n while (DECIMAL_DIGIT.test(String.fromCodePoint(start - 1))) start -= 1;\n return String((point - start) % 10);\n}\n\n/**\n * Digits only, as ASCII. Everything a person might type between them is decoration; a digit typed in another\n * script (a full-width IME, an Arabic or Persian keyboard) is the same digit.\n */\nexport function digitsOf(value: string): string {\n return value.replace(/\\p{Nd}/gu, asciiDigit).replace(/\\D/g, \"\");\n}\n\n/** How many digits sit to the left of `caret` in a formatted (or raw) string. */\nexport function digitCountBefore(value: string, caret: number): number {\n const clamped = Math.max(0, Math.min(caret, value.length));\n return digitsOf(value.slice(0, clamped)).length;\n}\n\n/**\n * Character index in `formatted` that sits after `digitCount` digits.\n * Skips a following space so the next keystroke lands in the next group.\n */\nexport function caretAfterDigits(formatted: string, digitCount: number): number {\n if (digitCount <= 0) return 0;\n let seen = 0;\n for (let i = 0; i < formatted.length; i++) {\n if (formatted[i] >= \"0\" && formatted[i] <= \"9\") {\n seen += 1;\n if (seen === digitCount) {\n let caret = i + 1;\n while (caret < formatted.length && formatted[caret] === \" \") caret += 1;\n return caret;\n }\n }\n }\n return formatted.length;\n}\n\n/**\n * Grouping spaces are not characters. Backspace/Delete against a space\n * should remove the adjacent digit — otherwise the formatted value is\n * unchanged, React rewrites the input, and the caret jumps to the end\n *.\n */\nexport function digitIndexForSeparatorKey(\n formatted: string,\n caret: number,\n key: \"Backspace\" | \"Delete\",\n): number | null {\n const idx = key === \"Backspace\" ? caret - 1 : caret;\n if (idx < 0 || idx >= formatted.length || formatted[idx] !== \" \") return null;\n const before = digitCountBefore(formatted, caret);\n if (key === \"Backspace\") return before > 0 ? before - 1 : null;\n return before < digitsOf(formatted).length ? before : null;\n}\n\n/**\n * Group `digits` the way `country` says the number is spoken.\n *\n * Formats what is there rather than what is missing — a half-typed number gets\n * the spaces it has earned and no trailing separator, so the caret never sits\n * after a space the reader did not type. Digits past the last group stay\n * attached rather than being dropped.\n */\nexport function formatNational(digits: string, country?: PhoneCountry): string {\n const groups = country?.groups ?? FALLBACK_GROUPS;\n const clean = digitsOf(digits);\n\n const parts: string[] = [];\n let index = 0;\n for (const size of groups) {\n if (index >= clean.length) break;\n parts.push(clean.slice(index, index + size));\n index += size;\n }\n if (index < clean.length) parts.push(clean.slice(index));\n\n return parts.join(\" \");\n}\n\n/** `+90 539 340 76 24` — for display and for anything a human reads. */\nexport function formatPhone(digits: string, country?: PhoneCountry): string {\n const national = formatNational(digits, country);\n const dial = country?.dial;\n if (!dial) return national;\n return national ? `+${dial} ${national}` : `+${dial}`;\n}\n\n/**\n * `+905393407624` — the form sent to the API and used to build a WhatsApp\n * link. Spaces are for reading; a stored number should have one spelling.\n */\nexport function toE164(digits: string, country?: PhoneCountry): string {\n const clean = digitsOf(digits);\n if (!clean) return \"\";\n return `+${country?.dial ?? \"\"}${clean}`;\n}\n\nexport function isCompleteNational(\n digits: string,\n country?: PhoneCountry,\n): boolean {\n const length = digitsOf(digits).length;\n const min = country?.min ?? FALLBACK_MIN;\n const max = country?.max ?? FALLBACK_MAX;\n return length >= min && length <= max;\n}\n\n/**\n * Split a stored `+…` number back into a country and its national digits, so\n * returning to a saved draft puts the reader where they left off.\n *\n * Longest dial code first: `+38` is a prefix of `+380`, `+381`, `+382`…\n * Matching short would put a Ukrainian number under Serbia. The curated\n * table is tried first so known shapes win; then every shared dial code so\n * a Japanese number is not handed back as an unrecognised blob.\n */\nexport function parsePhone(value: string): {\n country?: PhoneCountry;\n national: string;\n} {\n const clean = digitsOf(value);\n if (!clean) return { country: undefined, national: \"\" };\n\n const known = [...PHONE_COUNTRIES].sort((a, b) => b.dial.length - a.dial.length);\n for (const country of known) {\n if (clean.startsWith(country.dial)) {\n return { country, national: clean.slice(country.dial.length) };\n }\n }\n\n const shared = Object.entries(DIAL_CODES)\n .map(([iso, dial]) => ({ iso, dial }))\n .sort((a, b) => b.dial.length - a.dial.length || a.iso.localeCompare(b.iso));\n for (const { iso, dial } of shared) {\n if (clean.startsWith(dial)) {\n return { country: findCountry(iso), national: clean.slice(dial.length) };\n }\n }\n\n return { country: undefined, national: clean };\n}\n\n/**\n * Localized country name via `Intl.DisplayNames`, e.g. \"Germany\" / \"Deutschland\" / \"Allemagne\".\n * Distinct from `countries.countryName`,\n * which returns the English catalog entry.\n */\nexport function countryName(iso: string, locale: string): string {\n // A locale the runtime does not know is not a reason to lose the picker.\n return regionNames(locale)(iso) ?? iso;\n}\n\n/** The `Intl` locale a phone field names and sorts its countries in. */\nexport function phoneDisplayLocale(locale: string): string {\n // An app's own tag (\"me\" for Montenegrin) reaches Intl through `registerLocaleAliases`.\n return intlLocale(locale);\n}\n\n/**\n * Every country a phone field offers, named in the reader's language and\n * sorted by that name the way that language sorts (\"Tunus\" before \"Türkiye\"\n * in Turkish). Sorting by ISO code instead would show a Turkish reader\n * Ekvator Ginesi, Yunanistan, Guatemala…\n *\n */\nexport function phoneCountries(locale: string): Country[] {\n const displayLocale = phoneDisplayLocale(locale);\n // One formatter for the whole list: building one per country is what\n // made opening the field slow.\n const names = regionNames(displayLocale);\n let collator: Intl.Collator;\n try {\n collator = new Intl.Collator(displayLocale);\n } catch {\n // A locale the runtime does not know is not a reason to lose the picker.\n collator = new Intl.Collator();\n }\n return COUNTRIES.map((item) => ({\n code: item.code,\n name: names(item.code) ?? item.code,\n })).sort((a, b) => collator.compare(a.name, b.name));\n}\n\n/** Complete national number whose E.164 spelling is at most 15 digits. */\nexport function isSubmittedPhone(value: string): boolean {\n const parsed = parsePhone(value);\n if (!isCompleteNational(parsed.national, parsed.country)) return false;\n return digitsOf(toE164(parsed.national, parsed.country)).length <= 15;\n}\n\n/**\n * National digits of a stored E.164 value for the *selected* country.\n * Prefer this over `parsePhone` when the picker already knows the ISO:\n * `parsePhone` has to guess, and shared prefixes (NANP `+1`) can guess wrong.\n */\nexport function nationalDigits(value: string, country: PhoneCountry): string {\n const clean = digitsOf(value);\n if (!clean) return \"\";\n if (clean.startsWith(country.dial)) return clean.slice(country.dial.length);\n return clean;\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { type SearchFieldProps as AriaSearchFieldProps } from "react-aria-components";
3
+ import { type FieldSize } from "./styles.js";
4
+ export type SearchFieldProps = Omit<AriaSearchFieldProps, "className" | "style" | "children"> & {
5
+ /** Names the field when there is no visible label ("Search"). */
6
+ "aria-label"?: string;
7
+ /** Optional visible label. */
8
+ label?: React.ReactNode;
9
+ /** Lists what can be searched: "Name, email or order number". */
10
+ placeholder?: string;
11
+ /** A key hint shown at rest ("/"); the app binds the key. */
12
+ shortcut?: string;
13
+ size?: FieldSize;
14
+ };
15
+ /**
16
+ * Filters a list or opens results: a search icon, a clear button once there
17
+ * is text, Esc clears, Enter submits (`onSubmit`). Debounce in the app.
18
+ */
19
+ export declare const SearchField: React.ForwardRefExoticComponent<Omit<AriaSearchFieldProps, "children" | "style" | "className"> & {
20
+ /** Names the field when there is no visible label ("Search"). */
21
+ "aria-label"?: string;
22
+ /** Optional visible label. */
23
+ label?: React.ReactNode;
24
+ /** Lists what can be searched: "Name, email or order number". */
25
+ placeholder?: string;
26
+ /** A key hint shown at rest ("/"); the app binds the key. */
27
+ shortcut?: string;
28
+ size?: FieldSize;
29
+ } & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Button as AriaButton, Input, SearchField as AriaSearchField, useLocale, } from "react-aria-components";
5
+ import { IconGlyph } from "../display/icon.js";
6
+ import { cn } from "../utils.js";
7
+ import { useFieldSize } from "../defaults.js";
8
+ import { clearLabel } from "../i18n.js";
9
+ import { FieldLabel } from "./field-parts.js";
10
+ import { InputGroup } from "./input-group.js";
11
+ import { FIELD_ICON, FIELD_STACK, INLINE_ACTION, INPUT } from "./styles.js";
12
+ import { splitDataAttributes } from "./data-attributes.js";
13
+ /**
14
+ * Filters a list or opens results: a search icon, a clear button once there
15
+ * is text, Esc clears, Enter submits (`onSubmit`). Debounce in the app.
16
+ */
17
+ export const SearchField = React.forwardRef(function SearchField({ label, placeholder, shortcut, size: fieldSize, ...rest }, ref) {
18
+ const size = useFieldSize(fieldSize);
19
+ const { locale } = useLocale();
20
+ const { wrapperProps, controlData } = splitDataAttributes(rest);
21
+ return (_jsx(AriaSearchField, { ...wrapperProps, "data-slot": "search-field", className: cn(FIELD_STACK, "group/search"), children: ({ isEmpty, isDisabled, isInvalid }) => (_jsxs(_Fragment, { children: [label && _jsx(FieldLabel, { children: label }), _jsxs(InputGroup, { size: size, isDisabled: isDisabled, isInvalid: isInvalid, children: [_jsx(IconGlyph, { name: "search", "data-slot": "field-icon", className: FIELD_ICON }), _jsx(Input, { ...controlData, ref: ref, placeholder: placeholder, "data-slot": "search-field-input", className: cn(INPUT, "text-body [&::-webkit-search-cancel-button]:hidden") }), isEmpty && shortcut && (_jsx("kbd", { "aria-hidden": "true", "data-slot": "search-field-shortcut", className: "rounded-ds-small border border-ds-border px-ds-050 font-ds-mono text-body-small text-ds-text-subtlest", children: shortcut })), !isEmpty && (_jsx(AriaButton, { "aria-label": clearLabel(locale), "data-slot": "input-action", className: INLINE_ACTION, children: _jsx(IconGlyph, { name: "circle-x", "data-slot": "search-field-clear-icon" }) }))] })] })) }));
22
+ });
23
+ //# sourceMappingURL=search-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-field.js","sourceRoot":"","sources":["../../src/form/search-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,KAAK,EACL,WAAW,IAAI,eAAe,EAC9B,SAAS,GAEV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAkB,MAAM,UAAU,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAcxD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAqC,SAAS,WAAW,CAClG,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAC1D,GAAG;IAEH,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAChE,OAAO,CACL,KAAC,eAAe,OAAK,YAAY,eAAY,cAAc,EAAC,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC,YACnG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CACvC,8BACG,KAAK,IAAI,KAAC,UAAU,cAAE,KAAK,GAAc,EAC1C,MAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,aAClE,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,eAAW,YAAY,EAAC,SAAS,EAAE,UAAU,GAAI,EACzE,KAAC,KAAK,OACA,WAAW,EACf,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,WAAW,eACd,oBAAoB,EAC9B,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,oDAAoD,CAAC,GAC1E,EACD,OAAO,IAAI,QAAQ,IAAI,CACtB,6BACc,MAAM,eACR,uBAAuB,EACjC,SAAS,EAAC,uGAAuG,YAEhH,QAAQ,GACL,CACP,EACA,CAAC,OAAO,IAAI,CACX,KAAC,UAAU,kBAAa,UAAU,CAAC,MAAM,CAAC,eAAY,cAAc,EAAC,SAAS,EAAE,aAAa,YAC3F,KAAC,SAAS,IAAC,IAAI,EAAC,UAAU,eAAW,yBAAyB,GAAG,GACtD,CACd,IACU,IACZ,CACJ,GACe,CACnB,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Button as AriaButton,\n Input,\n SearchField as AriaSearchField,\n useLocale,\n type SearchFieldProps as AriaSearchFieldProps,\n} from \"react-aria-components\";\nimport { IconGlyph } from \"../display/icon\";\n\nimport { cn } from \"../utils\";\nimport { useFieldSize } from \"../defaults\";\nimport { clearLabel } from \"../i18n\";\nimport { FieldLabel } from \"./field-parts\";\nimport { InputGroup } from \"./input-group\";\nimport { FIELD_ICON, FIELD_STACK, INLINE_ACTION, INPUT, type FieldSize } from \"./styles\";\nimport { splitDataAttributes } from \"./data-attributes\";\n\nexport type SearchFieldProps = Omit<AriaSearchFieldProps, \"className\" | \"style\" | \"children\"> & {\n /** Names the field when there is no visible label (\"Search\"). */\n \"aria-label\"?: string;\n /** Optional visible label. */\n label?: React.ReactNode;\n /** Lists what can be searched: \"Name, email or order number\". */\n placeholder?: string;\n /** A key hint shown at rest (\"/\"); the app binds the key. */\n shortcut?: string;\n size?: FieldSize;\n};\n\n/**\n * Filters a list or opens results: a search icon, a clear button once there\n * is text, Esc clears, Enter submits (`onSubmit`). Debounce in the app.\n */\nexport const SearchField = React.forwardRef<HTMLInputElement, SearchFieldProps>(function SearchField(\n { label, placeholder, shortcut, size: fieldSize, ...rest },\n ref,\n) {\n const size = useFieldSize(fieldSize);\n const { locale } = useLocale();\n const { wrapperProps, controlData } = splitDataAttributes(rest);\n return (\n <AriaSearchField {...wrapperProps} data-slot=\"search-field\" className={cn(FIELD_STACK, \"group/search\")}>\n {({ isEmpty, isDisabled, isInvalid }) => (\n <>\n {label && <FieldLabel>{label}</FieldLabel>}\n <InputGroup size={size} isDisabled={isDisabled} isInvalid={isInvalid}>\n <IconGlyph name=\"search\" data-slot=\"field-icon\" className={FIELD_ICON} />\n <Input\n {...controlData}\n ref={ref}\n placeholder={placeholder}\n data-slot=\"search-field-input\"\n className={cn(INPUT, \"text-body [&::-webkit-search-cancel-button]:hidden\")}\n />\n {isEmpty && shortcut && (\n <kbd\n aria-hidden=\"true\"\n data-slot=\"search-field-shortcut\"\n className=\"rounded-ds-small border border-ds-border px-ds-050 font-ds-mono text-body-small text-ds-text-subtlest\"\n >\n {shortcut}\n </kbd>\n )}\n {!isEmpty && (\n <AriaButton aria-label={clearLabel(locale)} data-slot=\"input-action\" className={INLINE_ACTION}>\n <IconGlyph name=\"circle-x\" data-slot=\"search-field-clear-icon\" />\n </AriaButton>\n )}\n </InputGroup>\n </>\n )}\n </AriaSearchField>\n );\n});\n"]}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Field recipes. The frame is a React Aria `Group`, so it gets
3
+ * `data-hovered`, `data-focus-within`, `data-invalid` and `data-disabled`.
4
+ *
5
+ * Focus (a design rule): no ring. The field's own 1px
6
+ * `ds-border-bold` turns `ds-border-focused` and a 1px inner line joins it,
7
+ * 2px in all. The inner line is an outline pulled inside the border
8
+ * (`-outline-offset-2`), never outside: outlines paint above the addons'
9
+ * fill, so the 2px edge stays whole next to them; invalid uses the same 2px in `ds-border-danger` and stays red
10
+ * while the field is focused, so the error never disappears under the caret.
11
+ */
12
+ export declare const FIELD_FRAME: string;
13
+ export type FieldSize = "small" | "medium" | "large";
14
+ /** `--field-pad` carries the inline padding so addons can sit flush with the edge. */
15
+ export declare const FIELD_SIZE: Record<FieldSize, string>;
16
+ export declare const INPUT = "min-w-0 flex-1 self-stretch bg-transparent text-inherit outline-hidden placeholder:text-ds-text-subtlest disabled:cursor-not-allowed";
17
+ export declare const LABEL = "flex items-baseline gap-ds-050 text-body-small font-medium text-ds-text-subtle";
18
+ export declare const REQUIRED_MARK = "text-ds-text-danger";
19
+ export declare const OPTIONAL_MARK = "font-normal text-ds-text-subtlest";
20
+ export declare const DESCRIPTION = "text-body-small text-ds-text-subtlest";
21
+ export declare const ERROR = "flex items-center gap-ds-050 text-body-small text-ds-text-danger";
22
+ export declare const FIELD_STACK = "flex min-w-0 flex-col gap-ds-050";
23
+ export declare const ADDON = "flex shrink-0 items-center self-stretch bg-ds-surface-sunken px-ds-100 text-body text-ds-text-subtle tabular-nums select-none";
24
+ /** Flush with the frame's start edge, divided from the value by `ds-border`. */
25
+ /** Parts inside the frame take its radius minus the 1px border (`--ds-field-radius`), so their fill never crosses the curve. */
26
+ export declare const ADDON_START = "-ms-(--field-pad) rounded-s-[max(0px,calc(var(--ds-field-radius,var(--ds-radius-medium))-1px))] border-e border-ds-border";
27
+ /** At the end; flush with the edge unless something (a stepper) follows it. */
28
+ export declare const ADDON_END = "border-s border-ds-border";
29
+ export declare const ADDON_END_FLUSH = "-me-(--field-pad) rounded-e-[max(0px,calc(var(--ds-field-radius,var(--ds-radius-medium))-1px))]";
30
+ export declare const INLINE_ACTION: string;
31
+ export declare const FIELD_ICON = "size-ds-icon shrink-0 text-ds-icon-subtle";
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Field recipes. The frame is a React Aria `Group`, so it gets
3
+ * `data-hovered`, `data-focus-within`, `data-invalid` and `data-disabled`.
4
+ *
5
+ * Focus (a design rule): no ring. The field's own 1px
6
+ * `ds-border-bold` turns `ds-border-focused` and a 1px inner line joins it,
7
+ * 2px in all. The inner line is an outline pulled inside the border
8
+ * (`-outline-offset-2`), never outside: outlines paint above the addons'
9
+ * fill, so the 2px edge stays whole next to them; invalid uses the same 2px in `ds-border-danger` and stays red
10
+ * while the field is focused, so the error never disappears under the caret.
11
+ */
12
+ export const FIELD_FRAME = "relative flex w-full items-center gap-ds-075 rounded-ds-control-medium [--ds-field-radius:var(--ds-radius-control-medium,var(--ds-radius-medium))] border border-ds-border-bold bg-ds-background-input text-ds-text outline-hidden " +
13
+ "transition-colors duration-(--ds-duration-instant) ease-ds-standard " +
14
+ "data-[hovered]:bg-ds-background-input-hovered " +
15
+ "data-[focus-within]:border-ds-border-focused data-[focus-within]:outline-1 data-[focus-within]:outline-solid data-[focus-within]:-outline-offset-2 data-[focus-within]:outline-ds-border-focused " +
16
+ "data-[invalid]:border-ds-border-danger data-[invalid]:outline-1 data-[invalid]:outline-solid data-[invalid]:-outline-offset-2 data-[invalid]:outline-ds-border-danger " +
17
+ "data-[invalid]:data-[focus-within]:border-ds-border-danger data-[invalid]:data-[focus-within]:outline-ds-border-danger " +
18
+ "data-[disabled]:border-transparent data-[disabled]:bg-ds-background-disabled data-[disabled]:text-ds-text-disabled";
19
+ /** `--field-pad` carries the inline padding so addons can sit flush with the edge. */
20
+ export const FIELD_SIZE = {
21
+ medium: "min-h-ds-control [--field-pad:var(--ds-space-150)] px-(--field-pad)",
22
+ small: "min-h-ds-control-compact [--field-pad:var(--ds-space-100)] px-(--field-pad)",
23
+ large: "min-h-ds-control-large [--field-pad:var(--ds-space-200)] px-(--field-pad) text-body-large",
24
+ };
25
+ export const INPUT = "min-w-0 flex-1 self-stretch bg-transparent text-inherit outline-hidden placeholder:text-ds-text-subtlest disabled:cursor-not-allowed";
26
+ export const LABEL = "flex items-baseline gap-ds-050 text-body-small font-medium text-ds-text-subtle";
27
+ export const REQUIRED_MARK = "text-ds-text-danger";
28
+ export const OPTIONAL_MARK = "font-normal text-ds-text-subtlest";
29
+ export const DESCRIPTION = "text-body-small text-ds-text-subtlest";
30
+ export const ERROR = "flex items-center gap-ds-050 text-body-small text-ds-text-danger";
31
+ export const FIELD_STACK = "flex min-w-0 flex-col gap-ds-050";
32
+ export const ADDON = "flex shrink-0 items-center self-stretch bg-ds-surface-sunken px-ds-100 text-body text-ds-text-subtle tabular-nums select-none";
33
+ /** Flush with the frame's start edge, divided from the value by `ds-border`. */
34
+ /** Parts inside the frame take its radius minus the 1px border (`--ds-field-radius`), so their fill never crosses the curve. */
35
+ export const ADDON_START = "-ms-(--field-pad) rounded-s-[max(0px,calc(var(--ds-field-radius,var(--ds-radius-medium))-1px))] border-e border-ds-border";
36
+ /** At the end; flush with the edge unless something (a stepper) follows it. */
37
+ export const ADDON_END = "border-s border-ds-border";
38
+ export const ADDON_END_FLUSH = "-me-(--field-pad) rounded-e-[max(0px,calc(var(--ds-field-radius,var(--ds-radius-medium))-1px))]";
39
+ export const INLINE_ACTION = "inline-flex size-6 shrink-0 items-center justify-center rounded-[max(var(--ds-radius-small),calc(var(--ds-field-radius,var(--ds-radius-medium))-6px))] text-ds-icon-subtle cursor-pointer outline-hidden " +
40
+ "data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[pressed]:bg-ds-background-neutral-pressed " +
41
+ "data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused";
42
+ export const FIELD_ICON = "size-ds-icon shrink-0 text-ds-icon-subtle";
43
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/form/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GACtB,qOAAqO;IACrO,sEAAsE;IACtE,gDAAgD;IAChD,mMAAmM;IACnM,wKAAwK;IACxK,yHAAyH;IACzH,oHAAoH,CAAC;AAIvH,sFAAsF;AACtF,MAAM,CAAC,MAAM,UAAU,GAA8B;IACnD,MAAM,EAAE,qEAAqE;IAC7E,KAAK,EAAE,6EAA6E;IACpF,KAAK,EAAE,2FAA2F;CACnG,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAChB,sIAAsI,CAAC;AAEzI,MAAM,CAAC,MAAM,KAAK,GAAG,gFAAgF,CAAC;AACtG,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,mCAAmC,CAAC;AACjE,MAAM,CAAC,MAAM,WAAW,GAAG,uCAAuC,CAAC;AACnE,MAAM,CAAC,MAAM,KAAK,GAAG,kEAAkE,CAAC;AACxF,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAE9D,MAAM,CAAC,MAAM,KAAK,GAChB,+HAA+H,CAAC;AAClI,gFAAgF;AAChF,gIAAgI;AAChI,MAAM,CAAC,MAAM,WAAW,GAAG,2HAA2H,CAAC;AACvJ,+EAA+E;AAC/E,MAAM,CAAC,MAAM,SAAS,GAAG,2BAA2B,CAAC;AACrD,MAAM,CAAC,MAAM,eAAe,GAAG,iGAAiG,CAAC;AAEjI,MAAM,CAAC,MAAM,aAAa,GACxB,2MAA2M;IAC3M,yGAAyG;IACzG,qFAAqF,CAAC;AAExF,MAAM,CAAC,MAAM,UAAU,GAAG,2CAA2C,CAAC","sourcesContent":["/**\n * Field recipes. The frame is a React Aria `Group`, so it gets\n * `data-hovered`, `data-focus-within`, `data-invalid` and `data-disabled`.\n *\n * Focus (a design rule): no ring. The field's own 1px\n * `ds-border-bold` turns `ds-border-focused` and a 1px inner line joins it,\n * 2px in all. The inner line is an outline pulled inside the border\n * (`-outline-offset-2`), never outside: outlines paint above the addons'\n * fill, so the 2px edge stays whole next to them; invalid uses the same 2px in `ds-border-danger` and stays red\n * while the field is focused, so the error never disappears under the caret.\n */\nexport const FIELD_FRAME =\n \"relative flex w-full items-center gap-ds-075 rounded-ds-control-medium [--ds-field-radius:var(--ds-radius-control-medium,var(--ds-radius-medium))] border border-ds-border-bold bg-ds-background-input text-ds-text outline-hidden \" +\n \"transition-colors duration-(--ds-duration-instant) ease-ds-standard \" +\n \"data-[hovered]:bg-ds-background-input-hovered \" +\n \"data-[focus-within]:border-ds-border-focused data-[focus-within]:outline-1 data-[focus-within]:outline-solid data-[focus-within]:-outline-offset-2 data-[focus-within]:outline-ds-border-focused \" +\n \"data-[invalid]:border-ds-border-danger data-[invalid]:outline-1 data-[invalid]:outline-solid data-[invalid]:-outline-offset-2 data-[invalid]:outline-ds-border-danger \" +\n \"data-[invalid]:data-[focus-within]:border-ds-border-danger data-[invalid]:data-[focus-within]:outline-ds-border-danger \" +\n \"data-[disabled]:border-transparent data-[disabled]:bg-ds-background-disabled data-[disabled]:text-ds-text-disabled\";\n\nexport type FieldSize = \"small\" | \"medium\" | \"large\";\n\n/** `--field-pad` carries the inline padding so addons can sit flush with the edge. */\nexport const FIELD_SIZE: Record<FieldSize, string> = {\n medium: \"min-h-ds-control [--field-pad:var(--ds-space-150)] px-(--field-pad)\",\n small: \"min-h-ds-control-compact [--field-pad:var(--ds-space-100)] px-(--field-pad)\",\n large: \"min-h-ds-control-large [--field-pad:var(--ds-space-200)] px-(--field-pad) text-body-large\",\n};\n\nexport const INPUT =\n \"min-w-0 flex-1 self-stretch bg-transparent text-inherit outline-hidden placeholder:text-ds-text-subtlest disabled:cursor-not-allowed\";\n\nexport const LABEL = \"flex items-baseline gap-ds-050 text-body-small font-medium text-ds-text-subtle\";\nexport const REQUIRED_MARK = \"text-ds-text-danger\";\nexport const OPTIONAL_MARK = \"font-normal text-ds-text-subtlest\";\nexport const DESCRIPTION = \"text-body-small text-ds-text-subtlest\";\nexport const ERROR = \"flex items-center gap-ds-050 text-body-small text-ds-text-danger\";\nexport const FIELD_STACK = \"flex min-w-0 flex-col gap-ds-050\";\n\nexport const ADDON =\n \"flex shrink-0 items-center self-stretch bg-ds-surface-sunken px-ds-100 text-body text-ds-text-subtle tabular-nums select-none\";\n/** Flush with the frame's start edge, divided from the value by `ds-border`. */\n/** Parts inside the frame take its radius minus the 1px border (`--ds-field-radius`), so their fill never crosses the curve. */\nexport const ADDON_START = \"-ms-(--field-pad) rounded-s-[max(0px,calc(var(--ds-field-radius,var(--ds-radius-medium))-1px))] border-e border-ds-border\";\n/** At the end; flush with the edge unless something (a stepper) follows it. */\nexport const ADDON_END = \"border-s border-ds-border\";\nexport const ADDON_END_FLUSH = \"-me-(--field-pad) rounded-e-[max(0px,calc(var(--ds-field-radius,var(--ds-radius-medium))-1px))]\";\n\nexport const INLINE_ACTION =\n \"inline-flex size-6 shrink-0 items-center justify-center rounded-[max(var(--ds-radius-small),calc(var(--ds-field-radius,var(--ds-radius-medium))-6px))] text-ds-icon-subtle cursor-pointer outline-hidden \" +\n \"data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[pressed]:bg-ds-background-neutral-pressed \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\";\n\nexport const FIELD_ICON = \"size-ds-icon shrink-0 text-ds-icon-subtle\";\n"]}
@@ -0,0 +1,70 @@
1
+ import * as React from "react";
2
+ import { type TextFieldProps as AriaTextFieldProps } from "react-aria-components";
3
+ import { type WithRadius } from "../defaults.js";
4
+ import { type RequiredValidation } from "./validation.js";
5
+ /** The field is 72px minimum, grows with the content up to 240px, then scrolls (design). */
6
+ export declare const TEXTAREA_MIN_HEIGHT = 72;
7
+ export declare const TEXTAREA_MAX_HEIGHT = 240;
8
+ type TextAreaFieldProps = Omit<AriaTextFieldProps, "className" | "style" | "children" | "maxLength"> & {
9
+ label: React.ReactNode;
10
+ /**
11
+ * Keeps the label for screen readers only: it still names the field, but takes no
12
+ * space. For a field whose purpose the surface already shows, such as a chat reply box under its
13
+ * conversation. A visible label stays the default.
14
+ */
15
+ isLabelHidden?: boolean;
16
+ description?: React.ReactNode;
17
+ errorMessage?: React.ReactNode;
18
+ isOptional?: boolean;
19
+ placeholder?: string;
20
+ /**
21
+ * Shows the counter. The user may type or paste past it; the field turns
22
+ * invalid and blocks on submit, so pasted text is never cut silently.
23
+ */
24
+ maxLength?: number;
25
+ /**
26
+ * Shows the "89 / 500" count under the field; `true` by default whenever `maxLength`
27
+ * is set. `false` hides only the visible count: the limit still marks the field invalid past
28
+ * `maxLength`, and screen readers still hear when it is exceeded.
29
+ */
30
+ showCounter?: boolean;
31
+ /**
32
+ * Who says an empty required field is missing: `field` (default) or `app`. With `app` a DS
33
+ * Form's `onSubmit` runs with the field empty, and the app's own error must clear on change. See
34
+ * {@link RequiredValidation} for the whole contract.
35
+ */
36
+ requiredValidation?: RequiredValidation;
37
+ };
38
+ export type TextAreaProps = TextAreaFieldProps & WithRadius;
39
+ /** Several lines of text, with a label, description, error and an optional character count. */
40
+ export declare const TextArea: React.ForwardRefExoticComponent<Omit<AriaTextFieldProps, "children" | "style" | "className" | "maxLength"> & {
41
+ label: React.ReactNode;
42
+ /**
43
+ * Keeps the label for screen readers only: it still names the field, but takes no
44
+ * space. For a field whose purpose the surface already shows, such as a chat reply box under its
45
+ * conversation. A visible label stays the default.
46
+ */
47
+ isLabelHidden?: boolean;
48
+ description?: React.ReactNode;
49
+ errorMessage?: React.ReactNode;
50
+ isOptional?: boolean;
51
+ placeholder?: string;
52
+ /**
53
+ * Shows the counter. The user may type or paste past it; the field turns
54
+ * invalid and blocks on submit, so pasted text is never cut silently.
55
+ */
56
+ maxLength?: number;
57
+ /**
58
+ * Shows the "89 / 500" count under the field; `true` by default whenever `maxLength`
59
+ * is set. `false` hides only the visible count: the limit still marks the field invalid past
60
+ * `maxLength`, and screen readers still hear when it is exceeded.
61
+ */
62
+ showCounter?: boolean;
63
+ /**
64
+ * Who says an empty required field is missing: `field` (default) or `app`. With `app` a DS
65
+ * Form's `onSubmit` runs with the field empty, and the app's own error must clear on change. See
66
+ * {@link RequiredValidation} for the whole contract.
67
+ */
68
+ requiredValidation?: RequiredValidation;
69
+ } & WithRadius & React.RefAttributes<HTMLTextAreaElement>>;
70
+ export {};