@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,334 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Toolbar as AriaToolbar, useLocale } from "react-aria-components";
5
+ import { Button } from "../action/button.js";
6
+ import { clearSelectionLabel, selectedCountLabel } from "../i18n.js";
7
+ /**
8
+ * Controls that act on the view below it. One Tab stop: arrow keys move between the controls (mirrored
9
+ * in RTL). Put a `ToolbarSpacer` before the view and export controls to push them to the end.
10
+ * A text-editing control inside (a SearchField's input, a DateField's segments) keeps ←/→ for its caret
11
+ * and segments; at its edge (the caret at the start or end, the first or last segment) the arrow moves on
12
+ * to the next control, so every control stays reachable by the arrows. Arrowing into a date or time field
13
+ * lands on the segment nearest the way in: in RTL the visually nearest one, whatever the DOM order of its
14
+ * segments. A raw `type="number"` or
15
+ * `type="email"` input with a value has no readable caret and keeps ←/→ (Tab leaves it); prefer NumberField,
16
+ * or TextField with `inputMode`, inside a toolbar.
17
+ */
18
+ export function Toolbar({ children, "aria-label": label }) {
19
+ const ref = React.useRef(null);
20
+ const { toolbarProps } = useToolbarKeys(ref);
21
+ return (_jsx("div", { ref: ref, "data-slot": "toolbar", className: "flex flex-wrap items-center gap-ds-100 rounded-ds-large bg-ds-surface-raised px-ds-150 py-ds-100 shadow-ds-raised", "data-rac": "", "aria-label": label, ...toolbarProps, children: children }));
22
+ }
23
+ /*
24
+ * React Aria's Toolbar (react-aria-components) handles ←/→ in a capture listener on the toolbar and
25
+ * takes no key handler of its own, so it cannot leave the arrows to a text control inside it. This
26
+ * mirrors its useToolbar (horizontal): same role, arrows mirrored in RTL, no wrap, Tab leaving via the
27
+ * first/last control, focus restored on return. The one change: ←/→ on a text-editing target belong
28
+ * to that target until the caret or segment focus is at the target's edge in the arrow's direction.
29
+ */
30
+ // React Aria's focusable-element selector (isFocusable), so the arrows reach the same controls.
31
+ const FOCUSABLE = [
32
+ "input:not([disabled]):not([type=hidden])",
33
+ "select:not([disabled])",
34
+ "textarea:not([disabled])",
35
+ "button:not([disabled])",
36
+ "a[href]",
37
+ "area[href]",
38
+ "summary",
39
+ "iframe",
40
+ "object",
41
+ "embed",
42
+ "audio[controls]",
43
+ "video[controls]",
44
+ '[contenteditable]:not([contenteditable^="false"])',
45
+ "permission",
46
+ ]
47
+ .map((selector) => `${selector}:not([hidden])`)
48
+ .concat("[tabindex]:not([disabled]):not([hidden])")
49
+ .join(",");
50
+ /*
51
+ * React Aria's shadow-DOM-aware helpers (getActiveElement, nodeContains, getEventTarget in
52
+ * react-aria/private/utils/shadowdom) are not part of the public react-aria-components surface, and
53
+ * react-aria itself is not a dependency of this package, so they are mirrored here. React Aria only
54
+ * walks shadow roots when its shadowDOM flag is on; in the light DOM (the flag's default) these give
55
+ * exactly document.activeElement, Node.contains and event.target, as React Aria does.
56
+ */
57
+ function getActiveElement(doc = document) {
58
+ let active = doc.activeElement;
59
+ while (active?.shadowRoot?.activeElement)
60
+ active = active.shadowRoot.activeElement;
61
+ return active;
62
+ }
63
+ function nodeContains(node, other) {
64
+ if (!node || !other)
65
+ return false;
66
+ for (let current = other; current;) {
67
+ if (current === node)
68
+ return true;
69
+ const slot = current.assignedSlot;
70
+ // A slotted element continues from its slot (a slot itself walks up as usual).
71
+ if (typeof current.assignedElements !== "function" && slot?.parentNode)
72
+ current = slot.parentNode;
73
+ else if (current instanceof ShadowRoot)
74
+ current = current.host;
75
+ else
76
+ current = current.parentNode;
77
+ }
78
+ return false;
79
+ }
80
+ function getEventTarget(e) {
81
+ const target = e.target;
82
+ if (target instanceof Element && target.shadowRoot) {
83
+ const inner = e.nativeEvent.composedPath?.()[0];
84
+ if (inner instanceof Element)
85
+ return inner;
86
+ }
87
+ return target;
88
+ }
89
+ // Inputs that do not use ←/→ themselves: the toolbar always takes the arrows from them.
90
+ const ARROWLESS_INPUTS = new Set(["button", "submit", "reset", "checkbox", "image", "file", "color"]);
91
+ /*
92
+ * Inputs whose value ←/→ change, so the arrows always stay with them: React Aria's RadioGroup moves the
93
+ * selection between its radios and its Slider moves the thumb with ←/→ (no caret, so no edge).
94
+ */
95
+ const VALUE_ARROW_INPUTS = new Set(["radio", "range"]);
96
+ function isRtl(element, fallback) {
97
+ const computed = getComputedStyle(element).direction;
98
+ if (computed === "rtl" || computed === "ltr")
99
+ return computed === "rtl";
100
+ // jsdom resolves no `direction`; :dir() reads the dir attribute the same way the browser does.
101
+ try {
102
+ return element.matches(":dir(rtl)");
103
+ }
104
+ catch {
105
+ return fallback === "rtl";
106
+ }
107
+ }
108
+ /**
109
+ * The segment group (`role="group"`) of a date/time segment inside the toolbar, else undefined. Only
110
+ * segments step from their group: a text input is one element, and its group (the field frame) also holds
111
+ * controls of its own (a SearchField's clear button, InputActions) that the arrows should still reach.
112
+ */
113
+ function segmentGroup(target, toolbar) {
114
+ if (target.getAttribute("role") !== "spinbutton")
115
+ return undefined;
116
+ const group = target.closest('[role="group"]');
117
+ return group && group !== toolbar && toolbar.contains(group) ? group : undefined;
118
+ }
119
+ function isTabbable(element) {
120
+ return element.tabIndex >= 0;
121
+ }
122
+ /**
123
+ * True when the arrow key belongs to the target: a caret that can still move that way in a text input or
124
+ * textarea, a date/time segment with another segment that way, a radio or slider, or a contenteditable
125
+ * or textbox whose caret the toolbar cannot read. A non-collapsed selection always stays with the field.
126
+ * `direction` is the toolbar's (the locale's), as React Aria's date segments use it.
127
+ */
128
+ function keepsArrows(target, key, direction) {
129
+ const tag = target.tagName;
130
+ if (tag === "INPUT" || tag === "TEXTAREA") {
131
+ const field = target;
132
+ if (tag === "INPUT" && ARROWLESS_INPUTS.has(field.type))
133
+ return false;
134
+ if (tag === "INPUT" && VALUE_ARROW_INPUTS.has(field.type))
135
+ return true;
136
+ let start;
137
+ let end;
138
+ try {
139
+ start = field.selectionStart;
140
+ end = field.selectionEnd;
141
+ }
142
+ catch {
143
+ start = end = null;
144
+ }
145
+ /*
146
+ * number, email…: the browser exposes no caret (selectionStart is null), so the toolbar cannot tell
147
+ * an edge. Empty, there is no caret to move and the arrows move on; with a value the field keeps them,
148
+ * since taking them would leave no way to move the caret. Tab leaves such a field. The DS's own
149
+ * fields avoid this: NumberField is a text input, and TextField takes `inputMode` for e-mail.
150
+ */
151
+ if (start == null || end == null)
152
+ return field.value !== "";
153
+ if (start !== end)
154
+ return true;
155
+ // The caret's back key is ← in an LTR field and → in an RTL one: the field's own direction.
156
+ const back = isRtl(field, direction) ? key === "ArrowRight" : key === "ArrowLeft";
157
+ return back ? start > 0 : end < field.value.length;
158
+ }
159
+ const role = target.getAttribute("role");
160
+ if (role === "spinbutton") {
161
+ const group = target.closest('[role="group"]');
162
+ if (group)
163
+ return hasSegmentToward(group, target, key, direction);
164
+ return true;
165
+ }
166
+ if (role === "textbox" || role === "searchbox")
167
+ return true;
168
+ return target.closest('[contenteditable]:not([contenteditable^="false"])') != null;
169
+ }
170
+ /**
171
+ * Whether React Aria's date/time field would move to another segment for this arrow (useDatePickerGroup):
172
+ * in LTR the previous/next tabbable segment in DOM order; in RTL the nearest segment visually to that
173
+ * side (its bounding box), since RTL date and time segments are not laid out in DOM order.
174
+ */
175
+ function hasSegmentToward(group, segment, key, direction) {
176
+ const segments = Array.from(group.querySelectorAll(FOCUSABLE)).filter((element) => isTabbable(element) && isVisible(element));
177
+ if (direction === "rtl") {
178
+ const from = segment.getBoundingClientRect().x;
179
+ const sign = key === "ArrowRight" ? 1 : -1;
180
+ return segments.some((element) => element !== segment && Math.sign(element.getBoundingClientRect().x - from) === sign);
181
+ }
182
+ const index = segments.indexOf(segment);
183
+ if (index === -1)
184
+ return true;
185
+ return key === "ArrowLeft" ? index > 0 : index < segments.length - 1;
186
+ }
187
+ /**
188
+ * In RTL, the segment an arrow should land on when it moves INTO a date/time field: the one
189
+ * visually nearest the side focus enters from, by bounding box as `hasSegmentToward` reads it, since RTL
190
+ * segments need not be laid out in DOM order. A step toward the toolbar's end (`step` 1, ← in RTL) enters
191
+ * at the field's start side, the segment furthest toward the start; a step toward the start enters at its
192
+ * end side. Any other target, or segments without a layout (equal boxes), keep the DOM-order choice.
193
+ */
194
+ function entrySegment(next, toolbar, step) {
195
+ const group = segmentGroup(next, toolbar);
196
+ if (!group)
197
+ return next;
198
+ const segments = Array.from(group.querySelectorAll(FOCUSABLE)).filter((element) => isTabbable(element) && isVisible(element));
199
+ // In RTL the start side is the larger x: a step of 1 enters the field at its start side (largest x), -1 at its end side.
200
+ const enterAtStartSide = step === 1;
201
+ let best = next;
202
+ let bestX = next.getBoundingClientRect().x;
203
+ for (const element of segments) {
204
+ const x = element.getBoundingClientRect().x;
205
+ if (enterAtStartSide ? x > bestX : x < bestX) {
206
+ best = element;
207
+ bestX = x;
208
+ }
209
+ }
210
+ return best;
211
+ }
212
+ function isVisible(element) {
213
+ if (typeof element.checkVisibility === "function") {
214
+ return element.checkVisibility({ visibilityProperty: true }) && !element.closest("[data-react-aria-prevent-focus]");
215
+ }
216
+ for (let node = element; node; node = node.parentElement) {
217
+ if (node.hasAttribute("hidden") || node.hasAttribute("data-react-aria-prevent-focus"))
218
+ return false;
219
+ const { display, visibility } = getComputedStyle(node);
220
+ if (display === "none" || visibility === "hidden" || visibility === "collapse")
221
+ return false;
222
+ }
223
+ return true;
224
+ }
225
+ function focusables(root) {
226
+ return Array.from(root.querySelectorAll(FOCUSABLE)).filter((element) => !element.closest("[inert]") && isVisible(element));
227
+ }
228
+ function useToolbarKeys(ref) {
229
+ const { direction } = useLocale();
230
+ const [isInToolbar, setInToolbar] = React.useState(false);
231
+ React.useLayoutEffect(() => {
232
+ setInToolbar(!!ref.current?.parentElement?.closest('[role="toolbar"]'));
233
+ });
234
+ const lastFocused = React.useRef(null);
235
+ /*
236
+ * Moves to the next/previous control in DOM order from `from` (the focused element by default). `from` is
237
+ * a whole segment group when the arrow leaves a date/time field: the step starts after (or before) the
238
+ * group, never at a sibling segment, since in RTL the visual edge segment need not be the DOM-order edge
239
+ * (an `ar` TimeField or a `he-IL` date keeps DOM order; an `ar` date is reversed). Arrowing INTO such a
240
+ * field in RTL lands on its segment visually nearest the way in (`entrySegment`); LTR keeps DOM order.
241
+ * Plain focus(), as React Aria's focus manager does: the control scrolls into view.
242
+ */
243
+ const move = (step, from) => {
244
+ const root = ref.current;
245
+ if (!root)
246
+ return;
247
+ const all = focusables(root);
248
+ const active = from ?? getActiveElement();
249
+ let next;
250
+ if (!active || !nodeContains(root, active))
251
+ next = step === 1 ? all[0] : all[all.length - 1];
252
+ else if (step === 1) {
253
+ // FOLLOWING includes the group's own descendants: skip them.
254
+ next = all.find((el) => active.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING && !active.contains(el));
255
+ }
256
+ else
257
+ next = all.filter((el) => active.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING).pop();
258
+ // Into a date/time field in RTL: the segment nearest the side the arrow enters from, not the DOM-first one.
259
+ if (next && direction === "rtl")
260
+ next = entrySegment(next, root, step);
261
+ next?.focus();
262
+ };
263
+ const edge = (end) => {
264
+ const all = ref.current ? focusables(ref.current) : [];
265
+ (end === "first" ? all[0] : all[all.length - 1])?.focus();
266
+ };
267
+ const onKeyDownCapture = (e) => {
268
+ const target = getEventTarget(e);
269
+ // Portalled content (a popover opened from a control) is not the toolbar's.
270
+ if (!nodeContains(e.currentTarget, target))
271
+ return;
272
+ if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
273
+ if (keepsArrows(target, e.key, direction))
274
+ return;
275
+ const forward = e.key === "ArrowRight" ? 1 : -1;
276
+ move(direction === "rtl" ? -forward : forward, segmentGroup(target, e.currentTarget));
277
+ }
278
+ else if (e.key === "Tab") {
279
+ // Focus the first/last control and let the browser's Tab carry focus out from there.
280
+ lastFocused.current = getActiveElement();
281
+ edge(e.shiftKey ? "first" : "last");
282
+ return;
283
+ }
284
+ else
285
+ return;
286
+ // Keep nested action groups (and the field the arrow moved out of) from handling the arrows too.
287
+ e.stopPropagation();
288
+ e.preventDefault();
289
+ };
290
+ // Remember the control focus came from, and return to it when focus comes back into the toolbar.
291
+ const onBlurCapture = (e) => {
292
+ if (!nodeContains(e.currentTarget, e.relatedTarget) && !lastFocused.current)
293
+ lastFocused.current = getEventTarget(e);
294
+ };
295
+ const onFocusCapture = (e) => {
296
+ const last = lastFocused.current;
297
+ if (last && !nodeContains(e.currentTarget, e.relatedTarget) && nodeContains(ref.current, getEventTarget(e))) {
298
+ lastFocused.current = null;
299
+ last.focus?.();
300
+ }
301
+ };
302
+ return {
303
+ toolbarProps: {
304
+ role: isInToolbar ? "group" : "toolbar",
305
+ "aria-orientation": "horizontal",
306
+ "data-orientation": "horizontal",
307
+ onKeyDownCapture: isInToolbar ? undefined : onKeyDownCapture,
308
+ onFocusCapture: isInToolbar ? undefined : onFocusCapture,
309
+ onBlurCapture: isInToolbar ? undefined : onBlurCapture,
310
+ },
311
+ };
312
+ }
313
+ /** Pushes the controls after it to the toolbar's end. */
314
+ export function ToolbarSpacer() {
315
+ return _jsx("span", { "aria-hidden": true, "data-slot": "toolbar-spacer", className: "flex-1" });
316
+ }
317
+ /**
318
+ * Replaces the toolbar while rows are selected: the count, the bulk actions and a clear button, on
319
+ * `ds-background-neutral-bold`. One Tab stop with arrow keys inside, like the toolbar. Buttons in the bar
320
+ * are drawn transparent with inverse text whatever their variant: pass default (not primary) actions.
321
+ */
322
+ export function BulkBar({ selectedCount, actions, onClear, "aria-label": label }) {
323
+ const { locale } = useLocale();
324
+ const count = selectedCountLabel(locale, selectedCount);
325
+ const [spoken, setSpoken] = React.useState("");
326
+ React.useEffect(() => setSpoken(count), [count]);
327
+ return (_jsxs(AriaToolbar, { "aria-label": label, "data-slot": "bulk-bar", className: "flex flex-wrap items-center gap-ds-150 rounded-ds-large bg-ds-background-neutral-bold px-ds-150 py-ds-100 text-ds-text-inverse " +
328
+ // Buttons read on the dark bar: transparent with inverse text, the neutral pressed step on hover.
329
+ "[&_[data-slot=button]]:bg-transparent [&_[data-slot=button]]:text-ds-text-inverse " +
330
+ "[&_[data-slot=button][data-hovered]]:bg-ds-background-neutral-pressed [&_[data-slot=button][data-hovered]]:text-ds-text " +
331
+ "[&_[data-slot=button][data-pressed]]:bg-ds-background-neutral-pressed [&_[data-slot=button][data-pressed]]:text-ds-text " +
332
+ "[&_[data-slot=button][data-focus-visible]]:inset-ring-ds-text-inverse", children: [_jsx("span", { "data-slot": "bulk-bar-count", "aria-hidden": true, className: "text-body-strong tabular-nums", children: count }), _jsx("span", { "data-slot": "bulk-bar-announcer", role: "status", className: "sr-only", children: spoken }), actions, _jsx("span", { "aria-hidden": true, className: "flex-1" }), _jsx(Button, { size: "small", iconOnly: true, iconBefore: "x", "aria-label": clearSelectionLabel(locale), onPress: onClear })] }));
333
+ }
334
+ //# sourceMappingURL=toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar.js","sourceRoot":"","sources":["../../src/layout/toolbar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AASlE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,QAA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vC,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,QAAC,UAAU,EAAC,GAAG,gBAAa,mBAAmB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,GAAI,IAC9F,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Toolbar as AriaToolbar, useLocale } from \"react-aria-components\";\n\nimport { Button } from \"../action/button\";\nimport { clearSelectionLabel, selectedCountLabel } from \"../i18n\";\n\nexport type ToolbarProps = {\n /** Compact (32px) controls acting on the view below: search, filters, date range, view switch, export. */\n children: React.ReactNode;\n /** Names the toolbar (\"Order tools\"). */\n \"aria-label\": string;\n};\n\n/**\n * Controls that act on the view below it. One Tab stop: arrow keys move between the controls (mirrored\n * in RTL). Put a `ToolbarSpacer` before the view and export controls to push them to the end.\n * A text-editing control inside (a SearchField's input, a DateField's segments) keeps ←/→ for its caret\n * and segments; at its edge (the caret at the start or end, the first or last segment) the arrow moves on\n * to the next control, so every control stays reachable by the arrows. Arrowing into a date or time field\n * lands on the segment nearest the way in: in RTL the visually nearest one, whatever the DOM order of its\n * segments. A raw `type=\"number\"` or\n * `type=\"email\"` input with a value has no readable caret and keeps ←/→ (Tab leaves it); prefer NumberField,\n * or TextField with `inputMode`, inside a toolbar.\n */\nexport function Toolbar({ children, \"aria-label\": label }: ToolbarProps) {\n const ref = React.useRef<HTMLDivElement>(null);\n const { toolbarProps } = useToolbarKeys(ref);\n return (\n <div\n ref={ref}\n data-slot=\"toolbar\"\n className=\"flex flex-wrap items-center gap-ds-100 rounded-ds-large bg-ds-surface-raised px-ds-150 py-ds-100 shadow-ds-raised\"\n data-rac=\"\"\n aria-label={label}\n {...toolbarProps}\n >\n {children}\n </div>\n );\n}\n\n/*\n * React Aria's Toolbar (react-aria-components) handles ←/→ in a capture listener on the toolbar and\n * takes no key handler of its own, so it cannot leave the arrows to a text control inside it. This\n * mirrors its useToolbar (horizontal): same role, arrows mirrored in RTL, no wrap, Tab leaving via the\n * first/last control, focus restored on return. The one change: ←/→ on a text-editing target belong\n * to that target until the caret or segment focus is at the target's edge in the arrow's direction.\n */\n\n// React Aria's focusable-element selector (isFocusable), so the arrows reach the same controls.\nconst FOCUSABLE = [\n \"input:not([disabled]):not([type=hidden])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"button:not([disabled])\",\n \"a[href]\",\n \"area[href]\",\n \"summary\",\n \"iframe\",\n \"object\",\n \"embed\",\n \"audio[controls]\",\n \"video[controls]\",\n '[contenteditable]:not([contenteditable^=\"false\"])',\n \"permission\",\n]\n .map((selector) => `${selector}:not([hidden])`)\n .concat(\"[tabindex]:not([disabled]):not([hidden])\")\n .join(\",\");\n\n/*\n * React Aria's shadow-DOM-aware helpers (getActiveElement, nodeContains, getEventTarget in\n * react-aria/private/utils/shadowdom) are not part of the public react-aria-components surface, and\n * react-aria itself is not a dependency of this package, so they are mirrored here. React Aria only\n * walks shadow roots when its shadowDOM flag is on; in the light DOM (the flag's default) these give\n * exactly document.activeElement, Node.contains and event.target, as React Aria does.\n */\nfunction getActiveElement(doc: Document = document): Element | null {\n let active = doc.activeElement;\n while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;\n return active;\n}\n\nfunction nodeContains(node: Node | null | undefined, other: Node | null | undefined): boolean {\n if (!node || !other) return false;\n for (let current: Node | null = other; current; ) {\n if (current === node) return true;\n const slot: HTMLSlotElement | null | undefined = (current as Element).assignedSlot;\n // A slotted element continues from its slot (a slot itself walks up as usual).\n if (typeof (current as HTMLSlotElement).assignedElements !== \"function\" && slot?.parentNode) current = slot.parentNode;\n else if (current instanceof ShadowRoot) current = current.host;\n else current = current.parentNode;\n }\n return false;\n}\n\nfunction getEventTarget(e: React.SyntheticEvent): Element {\n const target = e.target as Element;\n if (target instanceof Element && target.shadowRoot) {\n const inner = e.nativeEvent.composedPath?.()[0];\n if (inner instanceof Element) return inner;\n }\n return target;\n}\n\n// Inputs that do not use ←/→ themselves: the toolbar always takes the arrows from them.\nconst ARROWLESS_INPUTS = new Set([\"button\", \"submit\", \"reset\", \"checkbox\", \"image\", \"file\", \"color\"]);\n/*\n * Inputs whose value ←/→ change, so the arrows always stay with them: React Aria's RadioGroup moves the\n * selection between its radios and its Slider moves the thumb with ←/→ (no caret, so no edge).\n */\nconst VALUE_ARROW_INPUTS = new Set([\"radio\", \"range\"]);\n\nfunction isRtl(element: Element, fallback: \"ltr\" | \"rtl\") {\n const computed = getComputedStyle(element).direction;\n if (computed === \"rtl\" || computed === \"ltr\") return computed === \"rtl\";\n // jsdom resolves no `direction`; :dir() reads the dir attribute the same way the browser does.\n try {\n return element.matches(\":dir(rtl)\");\n } catch {\n return fallback === \"rtl\";\n }\n}\n\n/**\n * The segment group (`role=\"group\"`) of a date/time segment inside the toolbar, else undefined. Only\n * segments step from their group: a text input is one element, and its group (the field frame) also holds\n * controls of its own (a SearchField's clear button, InputActions) that the arrows should still reach.\n */\nfunction segmentGroup(target: Element, toolbar: Element): Element | undefined {\n if (target.getAttribute(\"role\") !== \"spinbutton\") return undefined;\n const group = target.closest('[role=\"group\"]');\n return group && group !== toolbar && toolbar.contains(group) ? group : undefined;\n}\n\nfunction isTabbable(element: HTMLElement) {\n return element.tabIndex >= 0;\n}\n\n/**\n * True when the arrow key belongs to the target: a caret that can still move that way in a text input or\n * textarea, a date/time segment with another segment that way, a radio or slider, or a contenteditable\n * or textbox whose caret the toolbar cannot read. A non-collapsed selection always stays with the field.\n * `direction` is the toolbar's (the locale's), as React Aria's date segments use it.\n */\nfunction keepsArrows(target: Element, key: \"ArrowLeft\" | \"ArrowRight\", direction: \"ltr\" | \"rtl\") {\n const tag = target.tagName;\n if (tag === \"INPUT\" || tag === \"TEXTAREA\") {\n const field = target as HTMLInputElement | HTMLTextAreaElement;\n if (tag === \"INPUT\" && ARROWLESS_INPUTS.has(field.type)) return false;\n if (tag === \"INPUT\" && VALUE_ARROW_INPUTS.has(field.type)) return true;\n let start: number | null;\n let end: number | null;\n try {\n start = field.selectionStart;\n end = field.selectionEnd;\n } catch {\n start = end = null;\n }\n /*\n * number, email…: the browser exposes no caret (selectionStart is null), so the toolbar cannot tell\n * an edge. Empty, there is no caret to move and the arrows move on; with a value the field keeps them,\n * since taking them would leave no way to move the caret. Tab leaves such a field. The DS's own\n * fields avoid this: NumberField is a text input, and TextField takes `inputMode` for e-mail.\n */\n if (start == null || end == null) return field.value !== \"\";\n if (start !== end) return true;\n // The caret's back key is ← in an LTR field and → in an RTL one: the field's own direction.\n const back = isRtl(field, direction) ? key === \"ArrowRight\" : key === \"ArrowLeft\";\n return back ? start > 0 : end < field.value.length;\n }\n const role = target.getAttribute(\"role\");\n if (role === \"spinbutton\") {\n const group = target.closest('[role=\"group\"]');\n if (group) return hasSegmentToward(group, target as HTMLElement, key, direction);\n return true;\n }\n if (role === \"textbox\" || role === \"searchbox\") return true;\n return target.closest('[contenteditable]:not([contenteditable^=\"false\"])') != null;\n}\n\n/**\n * Whether React Aria's date/time field would move to another segment for this arrow (useDatePickerGroup):\n * in LTR the previous/next tabbable segment in DOM order; in RTL the nearest segment visually to that\n * side (its bounding box), since RTL date and time segments are not laid out in DOM order.\n */\nfunction hasSegmentToward(group: Element, segment: HTMLElement, key: \"ArrowLeft\" | \"ArrowRight\", direction: \"ltr\" | \"rtl\") {\n const segments = Array.from(group.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (element) => isTabbable(element) && isVisible(element),\n );\n if (direction === \"rtl\") {\n const from = segment.getBoundingClientRect().x;\n const sign = key === \"ArrowRight\" ? 1 : -1;\n return segments.some((element) => element !== segment && Math.sign(element.getBoundingClientRect().x - from) === sign);\n }\n const index = segments.indexOf(segment);\n if (index === -1) return true;\n return key === \"ArrowLeft\" ? index > 0 : index < segments.length - 1;\n}\n\n/**\n * In RTL, the segment an arrow should land on when it moves INTO a date/time field: the one\n * visually nearest the side focus enters from, by bounding box as `hasSegmentToward` reads it, since RTL\n * segments need not be laid out in DOM order. A step toward the toolbar's end (`step` 1, ← in RTL) enters\n * at the field's start side, the segment furthest toward the start; a step toward the start enters at its\n * end side. Any other target, or segments without a layout (equal boxes), keep the DOM-order choice.\n */\nfunction entrySegment(next: HTMLElement, toolbar: Element, step: 1 | -1): HTMLElement {\n const group = segmentGroup(next, toolbar);\n if (!group) return next;\n const segments = Array.from(group.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (element) => isTabbable(element) && isVisible(element),\n );\n // In RTL the start side is the larger x: a step of 1 enters the field at its start side (largest x), -1 at its end side.\n const enterAtStartSide = step === 1;\n let best = next;\n let bestX = next.getBoundingClientRect().x;\n for (const element of segments) {\n const x = element.getBoundingClientRect().x;\n if (enterAtStartSide ? x > bestX : x < bestX) {\n best = element;\n bestX = x;\n }\n }\n return best;\n}\n\nfunction isVisible(element: Element): boolean {\n if (typeof element.checkVisibility === \"function\") {\n return element.checkVisibility({ visibilityProperty: true }) && !element.closest(\"[data-react-aria-prevent-focus]\");\n }\n for (let node: Element | null = element; node; node = node.parentElement) {\n if (node.hasAttribute(\"hidden\") || node.hasAttribute(\"data-react-aria-prevent-focus\")) return false;\n const { display, visibility } = getComputedStyle(node);\n if (display === \"none\" || visibility === \"hidden\" || visibility === \"collapse\") return false;\n }\n return true;\n}\n\nfunction focusables(root: HTMLElement) {\n return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (element) => !element.closest(\"[inert]\") && isVisible(element),\n );\n}\n\nfunction useToolbarKeys(ref: React.RefObject<HTMLDivElement | null>) {\n const { direction } = useLocale();\n const [isInToolbar, setInToolbar] = React.useState(false);\n React.useLayoutEffect(() => {\n setInToolbar(!!ref.current?.parentElement?.closest('[role=\"toolbar\"]'));\n });\n const lastFocused = React.useRef<Element | null>(null);\n\n /*\n * Moves to the next/previous control in DOM order from `from` (the focused element by default). `from` is\n * a whole segment group when the arrow leaves a date/time field: the step starts after (or before) the\n * group, never at a sibling segment, since in RTL the visual edge segment need not be the DOM-order edge\n * (an `ar` TimeField or a `he-IL` date keeps DOM order; an `ar` date is reversed). Arrowing INTO such a\n * field in RTL lands on its segment visually nearest the way in (`entrySegment`); LTR keeps DOM order.\n * Plain focus(), as React Aria's focus manager does: the control scrolls into view.\n */\n const move = (step: 1 | -1, from?: Element) => {\n const root = ref.current;\n if (!root) return;\n const all = focusables(root);\n const active = from ?? getActiveElement();\n let next: HTMLElement | undefined;\n if (!active || !nodeContains(root, active)) next = step === 1 ? all[0] : all[all.length - 1];\n else if (step === 1) {\n // FOLLOWING includes the group's own descendants: skip them.\n next = all.find((el) => active.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING && !active.contains(el));\n } else next = all.filter((el) => active.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING).pop();\n // Into a date/time field in RTL: the segment nearest the side the arrow enters from, not the DOM-first one.\n if (next && direction === \"rtl\") next = entrySegment(next, root, step);\n next?.focus();\n };\n const edge = (end: \"first\" | \"last\") => {\n const all = ref.current ? focusables(ref.current) : [];\n (end === \"first\" ? all[0] : all[all.length - 1])?.focus();\n };\n\n const onKeyDownCapture = (e: React.KeyboardEvent<HTMLDivElement>) => {\n const target = getEventTarget(e);\n // Portalled content (a popover opened from a control) is not the toolbar's.\n if (!nodeContains(e.currentTarget, target)) return;\n if (e.key === \"ArrowRight\" || e.key === \"ArrowLeft\") {\n if (keepsArrows(target, e.key, direction)) return;\n const forward = e.key === \"ArrowRight\" ? 1 : -1;\n move(direction === \"rtl\" ? (-forward as 1 | -1) : forward, segmentGroup(target, e.currentTarget));\n } else if (e.key === \"Tab\") {\n // Focus the first/last control and let the browser's Tab carry focus out from there.\n lastFocused.current = getActiveElement();\n edge(e.shiftKey ? \"first\" : \"last\");\n return;\n } else return;\n // Keep nested action groups (and the field the arrow moved out of) from handling the arrows too.\n e.stopPropagation();\n e.preventDefault();\n };\n // Remember the control focus came from, and return to it when focus comes back into the toolbar.\n const onBlurCapture = (e: React.FocusEvent<HTMLDivElement>) => {\n if (!nodeContains(e.currentTarget, e.relatedTarget) && !lastFocused.current) lastFocused.current = getEventTarget(e);\n };\n const onFocusCapture = (e: React.FocusEvent<HTMLDivElement>) => {\n const last = lastFocused.current;\n if (last && !nodeContains(e.currentTarget, e.relatedTarget) && nodeContains(ref.current, getEventTarget(e))) {\n lastFocused.current = null;\n (last as HTMLElement).focus?.();\n }\n };\n\n return {\n toolbarProps: {\n role: isInToolbar ? \"group\" : \"toolbar\",\n \"aria-orientation\": \"horizontal\" as const,\n \"data-orientation\": \"horizontal\",\n onKeyDownCapture: isInToolbar ? undefined : onKeyDownCapture,\n onFocusCapture: isInToolbar ? undefined : onFocusCapture,\n onBlurCapture: isInToolbar ? undefined : onBlurCapture,\n },\n };\n}\n\n/** Pushes the controls after it to the toolbar's end. */\nexport function ToolbarSpacer() {\n return <span aria-hidden data-slot=\"toolbar-spacer\" className=\"flex-1\" />;\n}\n\nexport type BulkBarProps = {\n /** How many rows are selected; announced as it changes. */\n selectedCount: number;\n /** The bulk actions (compact Buttons): \"Send reminder\", \"Export\". */\n actions: React.ReactNode;\n /** Clears the selection; the bar goes with it. */\n onClear: () => void;\n /** Names the bar (\"Selected orders\"). */\n \"aria-label\": string;\n};\n\n/**\n * Replaces the toolbar while rows are selected: the count, the bulk actions and a clear button, on\n * `ds-background-neutral-bold`. One Tab stop with arrow keys inside, like the toolbar. Buttons in the bar\n * are drawn transparent with inverse text whatever their variant: pass default (not primary) actions.\n */\nexport function BulkBar({ selectedCount, actions, onClear, \"aria-label\": label }: BulkBarProps) {\n const { locale } = useLocale();\n const count = selectedCountLabel(locale, selectedCount);\n const [spoken, setSpoken] = React.useState(\"\");\n React.useEffect(() => setSpoken(count), [count]);\n return (\n <AriaToolbar\n aria-label={label}\n data-slot=\"bulk-bar\"\n className={\n \"flex flex-wrap items-center gap-ds-150 rounded-ds-large bg-ds-background-neutral-bold px-ds-150 py-ds-100 text-ds-text-inverse \" +\n // Buttons read on the dark bar: transparent with inverse text, the neutral pressed step on hover.\n \"[&_[data-slot=button]]:bg-transparent [&_[data-slot=button]]:text-ds-text-inverse \" +\n \"[&_[data-slot=button][data-hovered]]:bg-ds-background-neutral-pressed [&_[data-slot=button][data-hovered]]:text-ds-text \" +\n \"[&_[data-slot=button][data-pressed]]:bg-ds-background-neutral-pressed [&_[data-slot=button][data-pressed]]:text-ds-text \" +\n \"[&_[data-slot=button][data-focus-visible]]:inset-ring-ds-text-inverse\"\n }\n >\n <span data-slot=\"bulk-bar-count\" aria-hidden className=\"text-body-strong tabular-nums\">\n {count}\n </span>\n {/* Mounted empty and filled after mount: a live region born with its text is usually not read, so the\n first count (0 → 1, the bar appearing) would go unannounced. */}\n <span data-slot=\"bulk-bar-announcer\" role=\"status\" className=\"sr-only\">\n {spoken}\n </span>\n {actions}\n <span aria-hidden className=\"flex-1\" />\n <Button size=\"small\" iconOnly iconBefore=\"x\" aria-label={clearSelectionLabel(locale)} onPress={onClear} />\n </AriaToolbar>\n );\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import type { RouterProvider } from "react-aria-components";
3
+ type Navigate = React.ComponentProps<typeof RouterProvider>["navigate"];
4
+ /**
5
+ * @internal The host router's `navigate` from DesignSystemProvider, for parts
6
+ * that write the URL themselves (a data table's view state). Apps pass
7
+ * `navigate` to the provider once.
8
+ */
9
+ export declare const NavigateContext: React.Context<((path: string, routerOptions: never | undefined) => void) | null>;
10
+ /** @internal The provider's `navigate`; null outside a DesignSystemProvider. */
11
+ export declare function useDesignSystemNavigate(): Navigate | null;
12
+ export {};
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ /**
4
+ * @internal The host router's `navigate` from DesignSystemProvider, for parts
5
+ * that write the URL themselves (a data table's view state). Apps pass
6
+ * `navigate` to the provider once.
7
+ */
8
+ export const NavigateContext = React.createContext(null);
9
+ /** @internal The provider's `navigate`; null outside a DesignSystemProvider. */
10
+ export function useDesignSystemNavigate() {
11
+ return React.useContext(NavigateContext);
12
+ }
13
+ //# sourceMappingURL=navigate-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigate-context.js","sourceRoot":"","sources":["../src/navigate-context.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAkB,IAAI,CAAC,CAAC;AAE1E,gFAAgF;AAChF,MAAM,UAAU,uBAAuB;IACrC,OAAO,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type { RouterProvider } from \"react-aria-components\";\n\ntype Navigate = React.ComponentProps<typeof RouterProvider>[\"navigate\"];\n\n/**\n * @internal The host router's `navigate` from DesignSystemProvider, for parts\n * that write the URL themselves (a data table's view state). Apps pass\n * `navigate` to the provider once.\n */\nexport const NavigateContext = React.createContext<Navigate | null>(null);\n\n/** @internal The provider's `navigate`; null outside a DesignSystemProvider. */\nexport function useDesignSystemNavigate(): Navigate | null {\n return React.useContext(NavigateContext);\n}\n"]}
@@ -0,0 +1,40 @@
1
+ import * as React from "react";
2
+ import { type WithMotion } from "../defaults.js";
3
+ import { type Key } from "react-aria-components";
4
+ export type DisclosureProps = {
5
+ /** A full question or a clear section name ("When is my deposit refunded?"). */
6
+ title: React.ReactNode;
7
+ children: React.ReactNode;
8
+ isExpanded?: boolean;
9
+ defaultExpanded?: boolean;
10
+ onExpandedChange?: (isExpanded: boolean) => void;
11
+ /** The heading level of the title in the page outline; the Accordion's, or 3 by default. */
12
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
13
+ /** Inside an Accordion: its key. */
14
+ id?: Key;
15
+ };
16
+ /**
17
+ * Shows and hides one section. The trigger is a button inside a heading, so the page outline keeps the
18
+ * title; its chevron turns as it opens. Never hide a required field or an error in a closed panel: open
19
+ * it when it holds one.
20
+ */
21
+ export declare function Disclosure({ motion, ...props }: DisclosureProps & WithMotion): React.JSX.Element;
22
+ export type AccordionItem = {
23
+ id: Key;
24
+ title: React.ReactNode;
25
+ content: React.ReactNode;
26
+ };
27
+ export type AccordionProps = {
28
+ /** FAQ entries, settings groups, long-form sections. Leave it out to compose `Disclosure`s as children instead. */
29
+ items?: readonly AccordionItem[];
30
+ /** With no `items`: `Disclosure`s, each with an `id` (the key `expandedKeys` uses). */
31
+ children?: React.ReactNode;
32
+ expandedKeys?: Iterable<Key>;
33
+ defaultExpandedKeys?: Iterable<Key>;
34
+ onExpandedChange?: (keys: Set<Key>) => void;
35
+ /** Several open at once; by default opening one closes the others. */
36
+ allowsMultipleExpanded?: boolean;
37
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
38
+ };
39
+ /** Accordion with its own `motion` (auto, reduce or none); see AccordionBody for the component itself. */
40
+ export declare function Accordion({ motion, ...props }: AccordionProps & WithMotion): React.JSX.Element;
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { MotionScope } from "../defaults.js";
5
+ import { Button as AriaButton, Disclosure as AriaDisclosure, DisclosureGroup, DisclosurePanel, Heading, } from "react-aria-components";
6
+ import { IconGlyph } from "../display/icon.js";
7
+ const TRIGGER = "group flex min-h-12 w-full cursor-default items-center justify-between gap-ds-150 rounded-ds-small text-start text-body font-medium text-ds-text outline-hidden " +
8
+ "data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused";
9
+ /**
10
+ * Shows and hides one section. The trigger is a button inside a heading, so the page outline keeps the
11
+ * title; its chevron turns as it opens. Never hide a required field or an error in a closed panel: open
12
+ * it when it holds one.
13
+ */
14
+ export function Disclosure({ motion, ...props }) {
15
+ return (_jsx(MotionScope, { motion: motion, children: _jsx(DisclosureBody, { ...props }) }));
16
+ }
17
+ /** The Accordion's heading level, for the Disclosures composed inside it. */
18
+ const HeadingLevelContext = React.createContext(undefined);
19
+ function DisclosureBody({ title, children, isExpanded, defaultExpanded, onExpandedChange, headingLevel: own, id }) {
20
+ const headingLevel = own ?? React.useContext(HeadingLevelContext) ?? 3;
21
+ return (_jsxs(AriaDisclosure, { id: id, isExpanded: isExpanded, defaultExpanded: defaultExpanded, onExpandedChange: onExpandedChange, "data-slot": "disclosure", className: "border-b border-ds-border", children: [_jsx(Heading, { level: headingLevel, className: "m-0", children: _jsxs(AriaButton, { slot: "trigger", "data-slot": "disclosure-trigger", className: TRIGGER, children: [_jsx("span", { className: "min-w-0 flex-1", children: title }), _jsx(IconGlyph, { name: "chevron-down", "data-slot": "disclosure-chevron", className: "text-ds-icon-subtle transition-transform duration-(--ds-duration-fast) ease-ds-standard group-aria-expanded:rotate-180 motion-reduce:transition-none" })] }) }), _jsx(DisclosurePanel, { "data-slot": "disclosure-panel", className: "text-body text-ds-text-subtle", children: _jsx("div", { className: "pb-ds-200", children: children }) })] }));
22
+ }
23
+ /** Stacked Disclosures with a 1px rule between them (FAQ, settings groups, long forms). */
24
+ function AccordionBody({ items, children, expandedKeys, defaultExpandedKeys, onExpandedChange, allowsMultipleExpanded, headingLevel }) {
25
+ return (_jsx(DisclosureGroup, { expandedKeys: expandedKeys, defaultExpandedKeys: defaultExpandedKeys, onExpandedChange: onExpandedChange, allowsMultipleExpanded: allowsMultipleExpanded, "data-slot": "accordion", className: "border-t border-ds-border", children: _jsx(HeadingLevelContext.Provider, { value: headingLevel, children: items
26
+ ? items.map((item) => (_jsx(DisclosureBody, { id: item.id, title: item.title, children: item.content }, item.id)))
27
+ : children }) }));
28
+ }
29
+ /** Accordion with its own `motion` (auto, reduce or none); see AccordionBody for the component itself. */
30
+ export function Accordion({ motion, ...props }) {
31
+ return (_jsx(MotionScope, { motion: motion, children: _jsx(AccordionBody, { ...props }) }));
32
+ }
33
+ //# sourceMappingURL=accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/navigation/accordion.tsx"],"names":[],"mappings":"AAAA,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IAAI,EAAC,cAAc,eACT,oBAAoB,EAC9B,SAAS,EAAC,sJAAsJ,GAChK,IACS,GACL,EACV,KAAC,eAAe,iBAAW,kBAAkB,EAAC,SAAS,EAAC,+BAA+B,YACrF,cAAK,SAAS,EAAC,WAAW,YAAE,QAAQ,GAAO,GAC3B,IACH,CAClB,CAAC;AACJ,CAAC;AAiBD,2FAA2F;AAC3F,SAAS,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,YAAY,EAAkB;IACnJ,OAAO,CACL,KAAC,eAAe,IACd,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,EAAE,sBAAsB,eACpC,WAAW,EACrB,SAAS,EAAC,2BAA2B,YAErC,KAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC9C,KAAK;gBACJ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAClB,KAAC,cAAc,IAAe,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,YACzD,IAAI,CAAC,OAAO,IADM,IAAI,CAAC,EAAE,CAEX,CAClB,CAAC;gBACJ,CAAC,CAAC,QAAQ,GACiB,GACf,CACnB,CAAC;AACJ,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA+B;IACzE,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,aAAa,OAAM,KAAwB,GAAI,GACpC,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { MotionScope, type WithMotion } from \"../defaults\";\nimport {\n Button as AriaButton,\n Disclosure as AriaDisclosure,\n DisclosureGroup,\n DisclosurePanel,\n Heading,\n type Key,\n} from \"react-aria-components\";\n\nimport { IconGlyph } from \"../display/icon\";\n\nexport type DisclosureProps = {\n /** A full question or a clear section name (\"When is my deposit refunded?\"). */\n title: React.ReactNode;\n children: React.ReactNode;\n isExpanded?: boolean;\n defaultExpanded?: boolean;\n onExpandedChange?: (isExpanded: boolean) => void;\n /** The heading level of the title in the page outline; the Accordion's, or 3 by default. */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n /** Inside an Accordion: its key. */\n id?: Key;\n};\n\nconst TRIGGER =\n \"group flex min-h-12 w-full cursor-default items-center justify-between gap-ds-150 rounded-ds-small text-start text-body font-medium text-ds-text outline-hidden \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\";\n\n/**\n * Shows and hides one section. The trigger is a button inside a heading, so the page outline keeps the\n * title; its chevron turns as it opens. Never hide a required field or an error in a closed panel: open\n * it when it holds one.\n */\nexport function Disclosure({ motion, ...props }: DisclosureProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <DisclosureBody {...props} />\n </MotionScope>\n );\n}\n\n/** The Accordion's heading level, for the Disclosures composed inside it. */\nconst HeadingLevelContext = React.createContext<DisclosureProps[\"headingLevel\"]>(undefined);\n\nfunction DisclosureBody({ title, children, isExpanded, defaultExpanded, onExpandedChange, headingLevel: own, id }: DisclosureProps) {\n const headingLevel = own ?? React.useContext(HeadingLevelContext) ?? 3;\n return (\n <AriaDisclosure\n id={id}\n isExpanded={isExpanded}\n defaultExpanded={defaultExpanded}\n onExpandedChange={onExpandedChange}\n data-slot=\"disclosure\"\n className=\"border-b border-ds-border\"\n >\n <Heading level={headingLevel} className=\"m-0\">\n <AriaButton slot=\"trigger\" data-slot=\"disclosure-trigger\" className={TRIGGER}>\n <span className=\"min-w-0 flex-1\">{title}</span>\n <IconGlyph\n name=\"chevron-down\"\n data-slot=\"disclosure-chevron\"\n className=\"text-ds-icon-subtle transition-transform duration-(--ds-duration-fast) ease-ds-standard group-aria-expanded:rotate-180 motion-reduce:transition-none\"\n />\n </AriaButton>\n </Heading>\n <DisclosurePanel data-slot=\"disclosure-panel\" className=\"text-body text-ds-text-subtle\">\n <div className=\"pb-ds-200\">{children}</div>\n </DisclosurePanel>\n </AriaDisclosure>\n );\n}\n\nexport type AccordionItem = { id: Key; title: React.ReactNode; content: React.ReactNode };\n\nexport type AccordionProps = {\n /** FAQ entries, settings groups, long-form sections. Leave it out to compose `Disclosure`s as children instead. */\n items?: readonly AccordionItem[];\n /** With no `items`: `Disclosure`s, each with an `id` (the key `expandedKeys` uses). */\n children?: React.ReactNode;\n expandedKeys?: Iterable<Key>;\n defaultExpandedKeys?: Iterable<Key>;\n onExpandedChange?: (keys: Set<Key>) => void;\n /** Several open at once; by default opening one closes the others. */\n allowsMultipleExpanded?: boolean;\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n};\n\n/** Stacked Disclosures with a 1px rule between them (FAQ, settings groups, long forms). */\nfunction AccordionBody({ items, children, expandedKeys, defaultExpandedKeys, onExpandedChange, allowsMultipleExpanded, headingLevel }: AccordionProps) {\n return (\n <DisclosureGroup\n expandedKeys={expandedKeys}\n defaultExpandedKeys={defaultExpandedKeys}\n onExpandedChange={onExpandedChange}\n allowsMultipleExpanded={allowsMultipleExpanded}\n data-slot=\"accordion\"\n className=\"border-t border-ds-border\"\n >\n <HeadingLevelContext.Provider value={headingLevel}>\n {items\n ? items.map((item) => (\n <DisclosureBody key={item.id} id={item.id} title={item.title}>\n {item.content}\n </DisclosureBody>\n ))\n : children}\n </HeadingLevelContext.Provider>\n </DisclosureGroup>\n );\n}\n\n/** Accordion with its own `motion` (auto, reduce or none); see AccordionBody for the component itself. */\nexport function Accordion({ motion, ...props }: AccordionProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <AccordionBody {...(props as AccordionProps)} />\n </MotionScope>\n );\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { type BadgeCountTone } from "../display/badge.js";
3
+ import { type IconName } from "../display/icon.js";
4
+ export type BottomNavItem = {
5
+ /** Unique; `currentKey` matches it. */
6
+ id: string;
7
+ /** Always shown under the icon ("Orders"); the last item is "More" when the app has more. */
8
+ label: string;
9
+ icon: IconName;
10
+ href: string;
11
+ badge?: {
12
+ value: number;
13
+ tone?: BadgeCountTone;
14
+ };
15
+ };
16
+ export type BottomNavProps = {
17
+ /** Four or five top destinations. */
18
+ items: readonly BottomNavItem[];
19
+ currentKey?: string;
20
+ /** Names the navigation landmark; "Main menu" by default. */
21
+ "aria-label"?: string;
22
+ };
23
+ /**
24
+ * The bottom tab bar: four or five destinations, icon over label, padded for the home indicator.
25
+ * Shown at every width; where it appears is the app's choice (render it on phones only, beside a
26
+ * Sidebar on wide screens…). Hidden while the on-screen keyboard is open; leave it out of
27
+ * full-screen flows (checkout).
28
+ */
29
+ export declare function BottomNav({ items, currentKey, "aria-label": label }: BottomNavProps): React.JSX.Element;
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Link as AriaLink, useLocale } from "react-aria-components";
5
+ import { cn } from "../utils.js";
6
+ import { Badge, BadgeOnIconContext } from "../display/badge.js";
7
+ import { IconGlyph } from "../display/icon.js";
8
+ import { mainNavigationLabel } from "../i18n.js";
9
+ import { LAYER } from "../layers.js";
10
+ /** True while the on-screen keyboard covers part of the layout viewport (a field has focus). */
11
+ function useKeyboardOpen() {
12
+ const [open, setOpen] = React.useState(false);
13
+ React.useEffect(() => {
14
+ const viewport = window.visualViewport;
15
+ if (!viewport)
16
+ return;
17
+ const update = () => {
18
+ const editing = document.activeElement instanceof HTMLElement && document.activeElement.matches("input, textarea, select, [contenteditable]:not([contenteditable='false'])");
19
+ // The keyboard takes a quarter of the height or more; a URL bar collapsing takes far less.
20
+ setOpen(editing && viewport.height < window.innerHeight * 0.75);
21
+ };
22
+ viewport.addEventListener("resize", update);
23
+ window.addEventListener("focusin", update);
24
+ window.addEventListener("focusout", update);
25
+ return () => {
26
+ viewport.removeEventListener("resize", update);
27
+ window.removeEventListener("focusin", update);
28
+ window.removeEventListener("focusout", update);
29
+ };
30
+ }, []);
31
+ return open;
32
+ }
33
+ /**
34
+ * The bottom tab bar: four or five destinations, icon over label, padded for the home indicator.
35
+ * Shown at every width; where it appears is the app's choice (render it on phones only, beside a
36
+ * Sidebar on wide screens…). Hidden while the on-screen keyboard is open; leave it out of
37
+ * full-screen flows (checkout).
38
+ */
39
+ export function BottomNav({ items, currentKey, "aria-label": label }) {
40
+ const { locale } = useLocale();
41
+ const keyboard = useKeyboardOpen();
42
+ return (_jsx("nav", { "aria-label": label ?? mainNavigationLabel(locale), "data-slot": "bottom-nav", hidden: keyboard || undefined, className: cn("fixed inset-x-0 bottom-0 border-t border-ds-border bg-ds-surface-overlay shadow-ds-overflow",
43
+ // Safe-area insets are physical edges, so they pair with physical padding.
44
+ "[padding-left:max(var(--ds-space-100),env(safe-area-inset-left,0px))] [padding-right:max(var(--ds-space-100),env(safe-area-inset-right,0px))] pt-ds-075 pb-[max(var(--ds-space-150),env(safe-area-inset-bottom,0px))]", LAYER.stickyBar), children: _jsx("ul", { className: "mx-auto grid max-w-[24.375rem] auto-cols-fr grid-flow-col", children: items.map((item) => (_jsx("li", { className: "flex", children: _jsxs(AriaLink, { href: item.href, "data-slot": "bottom-nav-item", "aria-current": item.id === currentKey ? "page" : undefined, className: cn("group/bottom-nav flex min-h-11 flex-1 flex-col items-center justify-center gap-0.5 rounded-ds-medium py-ds-050 text-[11px] leading-[14px] font-[500] text-ds-text-subtle outline-hidden", "data-[pressed]:bg-ds-background-neutral-pressed data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused aria-[current=page]:text-ds-text"), children: [_jsxs("span", { className: "relative", children: [_jsx(IconGlyph, { name: item.icon, "data-slot": "bottom-nav-item-icon", className: "size-[22px] group-aria-[current=page]/bottom-nav:text-ds-icon-brand" }), item.badge && item.badge.value > 0 && (
45
+ // Drawn on the icon; read after the label ("Mesajlar, 2").
46
+ _jsx("span", { "data-slot": "bottom-nav-item-badge", "aria-hidden": true, className: "absolute -top-1 -end-2.5", children: _jsx(BadgeOnIconContext.Provider, { value: true, children: _jsx(Badge, { variant: "count", value: item.badge.value, tone: item.badge.tone }) }) }))] }), _jsx("span", { "data-slot": "bottom-nav-item-label", className: "max-w-full truncate px-ds-025", children: item.label }), item.badge && item.badge.value > 0 && _jsx("span", { className: "sr-only", children: `, ${item.badge.value}` })] }) }, item.id))) }) }));
47
+ }
48
+ //# sourceMappingURL=bottom-nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bottom-nav.js","sourceRoot":"","sources":["../../src/navigation/bottom-nav.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAuB,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAoBlC,gGAAgG;AAChG,SAAS,eAAe;IACtB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC;QACvC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,YAAY,WAAW,IAA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QAAQ,IACP,IAAI,EAAE,IAAI,CAAC,IAAI,eACL,iBAAiB,kBACb,IAAI,CAAC,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACzD,SAAS,EAAE,EAAE,CACX,yLAAyL,EACzL,sKAAsK,CACvK,aAED,gBAAM,SAAS,EAAC,UAAU,aACxB,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,eAAY,sBAAsB,EAAC,SAAS,EAAC,qEAAqE,GAAG,EAC9I,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI;gCACrC,2DAA2D;gCAC3D,4BAAgB,uBAAuB,uBAAa,SAAS,EAAC,0BAA0B,YACtF,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YACtC,KAAC,KAAK,IAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAI,GAC7C,GACzB,CACR,IACI,EACP,4BAAgB,uBAAuB,EAAC,SAAS,EAAC,+BAA+B,YAAE,IAAI,CAAC,KAAK,GAAQ,EACpG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAQ,IACxF,IAvBJ,IAAI,CAAC,EAAE,CAwBX,CACN,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Link as AriaLink, useLocale } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { Badge, BadgeOnIconContext, type BadgeCountTone } from \"../display/badge\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { mainNavigationLabel } from \"../i18n\";\nimport { LAYER } from \"../layers\";\n\nexport type BottomNavItem = {\n /** Unique; `currentKey` matches it. */\n id: string;\n /** Always shown under the icon (\"Orders\"); the last item is \"More\" when the app has more. */\n label: string;\n icon: IconName;\n href: string;\n badge?: { value: number; tone?: BadgeCountTone };\n};\n\nexport type BottomNavProps = {\n /** Four or five top destinations. */\n items: readonly BottomNavItem[];\n currentKey?: string;\n /** Names the navigation landmark; \"Main menu\" by default. */\n \"aria-label\"?: string;\n};\n\n/** True while the on-screen keyboard covers part of the layout viewport (a field has focus). */\nfunction useKeyboardOpen() {\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n const viewport = window.visualViewport;\n if (!viewport) return;\n const update = () => {\n const editing = document.activeElement instanceof HTMLElement && document.activeElement.matches(\"input, textarea, select, [contenteditable]:not([contenteditable='false'])\");\n // The keyboard takes a quarter of the height or more; a URL bar collapsing takes far less.\n setOpen(editing && viewport.height < window.innerHeight * 0.75);\n };\n viewport.addEventListener(\"resize\", update);\n window.addEventListener(\"focusin\", update);\n window.addEventListener(\"focusout\", update);\n return () => {\n viewport.removeEventListener(\"resize\", update);\n window.removeEventListener(\"focusin\", update);\n window.removeEventListener(\"focusout\", update);\n };\n }, []);\n return open;\n}\n\n/**\n * The bottom tab bar: four or five destinations, icon over label, padded for the home indicator.\n * Shown at every width; where it appears is the app's choice (render it on phones only, beside a\n * Sidebar on wide screens…). Hidden while the on-screen keyboard is open; leave it out of\n * full-screen flows (checkout).\n */\nexport function BottomNav({ items, currentKey, \"aria-label\": label }: BottomNavProps) {\n const { locale } = useLocale();\n const keyboard = useKeyboardOpen();\n return (\n <nav\n aria-label={label ?? mainNavigationLabel(locale)}\n data-slot=\"bottom-nav\"\n hidden={keyboard || undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 border-t border-ds-border bg-ds-surface-overlay shadow-ds-overflow\",\n // Safe-area insets are physical edges, so they pair with physical padding.\n \"[padding-left:max(var(--ds-space-100),env(safe-area-inset-left,0px))] [padding-right:max(var(--ds-space-100),env(safe-area-inset-right,0px))] pt-ds-075 pb-[max(var(--ds-space-150),env(safe-area-inset-bottom,0px))]\",\n LAYER.stickyBar,\n )}\n >\n <ul className=\"mx-auto grid max-w-[24.375rem] auto-cols-fr grid-flow-col\">\n {items.map((item) => (\n <li key={item.id} className=\"flex\">\n <AriaLink\n href={item.href}\n data-slot=\"bottom-nav-item\"\n aria-current={item.id === currentKey ? \"page\" : undefined}\n className={cn(\n \"group/bottom-nav flex min-h-11 flex-1 flex-col items-center justify-center gap-0.5 rounded-ds-medium py-ds-050 text-[11px] leading-[14px] font-[500] text-ds-text-subtle outline-hidden\",\n \"data-[pressed]:bg-ds-background-neutral-pressed data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused aria-[current=page]:text-ds-text\",\n )}\n >\n <span className=\"relative\">\n <IconGlyph name={item.icon} data-slot=\"bottom-nav-item-icon\" className=\"size-[22px] group-aria-[current=page]/bottom-nav:text-ds-icon-brand\" />\n {item.badge && item.badge.value > 0 && (\n // Drawn on the icon; read after the label (\"Mesajlar, 2\").\n <span data-slot=\"bottom-nav-item-badge\" aria-hidden className=\"absolute -top-1 -end-2.5\">\n <BadgeOnIconContext.Provider value={true}>\n <Badge variant=\"count\" value={item.badge.value} tone={item.badge.tone} />\n </BadgeOnIconContext.Provider>\n </span>\n )}\n </span>\n <span data-slot=\"bottom-nav-item-label\" className=\"max-w-full truncate px-ds-025\">{item.label}</span>\n {item.badge && item.badge.value > 0 && <span className=\"sr-only\">{`, ${item.badge.value}`}</span>}\n </AriaLink>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n"]}