@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 @@
1
+ {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../src/overlay/drawer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAmB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACzI,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAkB,eAAe,EAAoB,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAoC1J,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAc,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAEtE;;;GAGG;AACH,MAAM,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BAChB,CAAC,GACD,IACS,GACP,GACK,CAChB,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA4B;IACnE,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,UAAU,OAAM,KAAqB,GAAI,GAC9B,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as AriaDialog, Heading, Modal, ModalOverlay, useLocale } from \"react-aria-components\";\nimport { cn } from \"../utils\";\nimport { MotionScope, type WithMotion, useMotionAttribute } from \"../defaults\";\nimport { Button } from \"../action/button\";\nimport { CloseButton } from \"../action/close-button\";\nimport { collapseSheetLabel, discardCloseLabel, expandSheetLabel, keepEditingLabel, unsavedBodyLabel, unsavedTitleLabel } from \"../i18n\";\nimport { BLANKET, DIALOG_ELEMENT, DRAWER_WIDTH, type OpenProps, OverlayContents, type OverlaySize, hasDescription, useOverlayOpen } from \"./overlay-base\";\n\nexport type DrawerProps = OpenProps & {\n title: React.ReactNode;\n /**\n * Under the title: \"Jordan Lee · 14–18 Oct\". When given, the drawer is described by it\n * (`aria-describedby`); without it (or with `\"\"`, `false`, `null`) nothing is rendered.\n */\n description?: React.ReactNode;\n /** Beside the close button: a status Badge, a menu. */\n headerActions?: React.ReactNode;\n children: React.ReactNode;\n /** Sticky at the bottom: the record's actions. */\n footer?: React.ReactNode;\n /** small 380px, large 560px (medium reads as large). */\n size?: OverlaySize;\n /**\n * The edge it slides in from, at every width (the app decides, e.g. `bottom` on phones): `end` (default) and\n * `start` are the inline sides and mirror in right-to-left; `bottom` is a sheet that snaps between half and full\n * height; `top` drops down from above.\n */\n position?: DrawerPosition;\n /** Closing (button, Esc, scrim, useDrawerClose) asks first: \"Unsaved changes\". */\n hasUnsavedChanges?: boolean;\n};\n\nexport type DrawerPosition = \"start\" | \"end\" | \"top\" | \"bottom\";\n\nexport type DrawerClose = (options?: {\n /**\n * Close without the unsaved question: after a save (\"Save and close\"), when the parent's\n * `hasUnsavedChanges` has not re-rendered yet.\n */\n force?: boolean;\n}) => void;\n\nconst DrawerCloseContext = React.createContext<DrawerClose>(() => {});\n\n/**\n * The drawer's close, for its footer or body. By default it asks first with unsaved edits, like the close\n * button, Esc and the scrim; after saving call `close({ force: true })`.\n */\nexport function useDrawerClose(): DrawerClose {\n return React.useContext(DrawerCloseContext);\n}\n\n/** Where each position sits and the way it slides; the sides use logical edges, so right-to-left mirrors them. */\nconst DRAWER_POSITION: Record<DrawerPosition, string> = {\n end: cn(\n // Clear of a notch at the top and, in landscape, at the inline end.\n \"inset-y-0 end-0 max-w-full pt-[env(safe-area-inset-top,0px)] pe-[env(safe-area-inset-right,0px)] rtl:pe-[env(safe-area-inset-left,0px)]\",\n \"data-[entering]:translate-x-full data-[exiting]:translate-x-full rtl:data-[entering]:-translate-x-full rtl:data-[exiting]:-translate-x-full\",\n ),\n start: cn(\n \"inset-y-0 start-0 max-w-full pt-[env(safe-area-inset-top,0px)] ps-[env(safe-area-inset-left,0px)] rtl:ps-[env(safe-area-inset-right,0px)]\",\n \"data-[entering]:-translate-x-full data-[exiting]:-translate-x-full rtl:data-[entering]:translate-x-full rtl:data-[exiting]:translate-x-full\",\n ),\n bottom: \"inset-x-0 bottom-0 rounded-t-ds-xlarge data-[entering]:translate-y-full data-[exiting]:translate-y-full\",\n top: \"inset-x-0 top-0 max-h-[85dvh] rounded-b-ds-xlarge pt-[env(safe-area-inset-top,0px)] data-[entering]:-translate-y-full data-[exiting]:-translate-y-full\",\n};\n\n/** Drag distance on the grip that counts as a swipe rather than a tap (px). */\nconst SWIPE = 40;\n\n/** The sheet's grip: tap toggles half/full; swipe up expands, swipe down collapses (or closes from half). */\nfunction Grip({ expanded, onExpand, onCollapse, onDismiss }: { expanded: boolean; onExpand: () => void; onCollapse: () => void; onDismiss: () => void }) {\n const { locale } = useLocale();\n const start = React.useRef<number | null>(null);\n const moved = React.useRef(false);\n return (\n <button\n type=\"button\"\n data-slot=\"drawer-grip\"\n aria-label={expanded ? collapseSheetLabel(locale) : expandSheetLabel(locale)}\n aria-expanded={expanded}\n onPointerDown={(event) => {\n start.current = event.clientY;\n moved.current = false;\n // Keep the pointer while it drags past the 24px grip (touch is captured anyway; a mouse is not).\n event.currentTarget.setPointerCapture?.(event.pointerId);\n }}\n onPointerUp={(event) => {\n if (start.current === null) return;\n const dy = event.clientY - start.current;\n start.current = null;\n if (Math.abs(dy) < SWIPE) return;\n moved.current = true;\n if (dy < 0) onExpand();\n else if (expanded) onCollapse();\n else onDismiss();\n }}\n onClick={() => {\n if (moved.current) {\n moved.current = false;\n return;\n }\n if (expanded) onCollapse();\n else onExpand();\n }}\n className=\"mx-auto mt-ds-100 grid h-6 w-full shrink-0 cursor-grab touch-none place-items-center outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-ds-border-focused\"\n >\n <span aria-hidden className=\"h-1 w-9 rounded-ds-full bg-ds-border-bold\" />\n </button>\n );\n}\n\n/** \"Unsaved changes\": a real nested modal (focus kept inside, the drawer behind it inert, Esc = keep editing). */\nfunction UnsavedPrompt({ isOpen, onKeep, onDiscard }: { isOpen: boolean; onKeep: () => void; onDiscard: () => void }) {\n const { locale } = useLocale();\n return (\n <ModalOverlay\n {...useMotionAttribute()}\n isOpen={isOpen}\n onOpenChange={(next) => {\n if (!next) onKeep();\n }}\n isDismissable\n data-slot=\"drawer-unsaved-overlay\"\n className={cn(BLANKET, \"grid place-items-center p-ds-300\")}\n >\n <Modal data-slot=\"drawer-unsaved-modal\" className=\"w-full max-w-90 rounded-ds-xlarge bg-ds-surface-overlay text-ds-text shadow-ds-overlay outline-hidden\">\n <AriaDialog role=\"alertdialog\" data-slot=\"drawer-unsaved\" className=\"flex flex-col gap-ds-150 p-ds-300 outline-hidden\">\n <Heading slot=\"title\" data-slot=\"drawer-unsaved-title\" className=\"m-0 text-heading-small\">{unsavedTitleLabel(locale)}</Heading>\n <span data-slot=\"drawer-unsaved-body\" className=\"text-body text-ds-text-subtle\">{unsavedBodyLabel(locale)}</span>\n <div data-slot=\"drawer-unsaved-actions\" className=\"flex flex-wrap justify-end gap-ds-100\">\n <Button variant=\"subtle\" autoFocus onPress={onKeep} data-slot=\"drawer-keep-editing\">{keepEditingLabel(locale)}</Button>\n <Button variant=\"primary\" tone=\"danger\" onPress={onDiscard} data-slot=\"drawer-discard\">{discardCloseLabel(locale)}</Button>\n </div>\n </AriaDialog>\n </Modal>\n </ModalOverlay>\n );\n}\n\n/**\n * A panel over the page to show or edit one record without losing the list behind it, from the edge `position`\n * names: an inline side (380 or 560px, full height), the bottom (a sheet that snaps between half and full height)\n * or the top. Header with\n * title, description and status; a scrolling body; a sticky footer; both keep clear of notches and the home\n * indicator. With unsaved edits every way of closing asks first. The title names the drawer and the\n * description, when there is one, describes it.\n */\nfunction DrawerBody({\n size = \"small\", position = \"end\", isOpen, defaultOpen, onOpenChange, hasUnsavedChanges,\n title, description: subtitle, headerActions, children, footer,\n}: DrawerProps) {\n const state = useOverlayOpen({ isOpen, defaultOpen, onOpenChange });\n const subtitleId = React.useId();\n // Described only when there is a subtitle, as Dialog's description; otherwise the drawer's DOM is unchanged.\n const describedBy = hasDescription(subtitle) ? subtitleId : undefined;\n const bottom = position === \"bottom\";\n const [expanded, setExpanded] = React.useState(false);\n // A sheet opens at half height every time. Reset as it opens, not as it closes, so the closing slide does\n // not also animate the height down.\n const [wasOpen, setWasOpen] = React.useState(state.isOpen);\n if (wasOpen !== state.isOpen) {\n setWasOpen(state.isOpen);\n if (state.isOpen) setExpanded(false);\n }\n const [asking, setAsking] = React.useState(false);\n // Every close request (button, Esc, scrim, grip swipe, useDrawerClose) comes through here.\n const request = () => (hasUnsavedChanges ? setAsking(true) : state.close());\n const close: DrawerClose = (options) => (options?.force ? state.close() : request());\n return (\n <ModalOverlay\n {...useMotionAttribute()}\n isOpen={state.isOpen}\n onOpenChange={(next) => {\n if (!next) request();\n }}\n isDismissable\n data-slot=\"drawer-overlay\"\n data-position={position}\n className={BLANKET}\n >\n <Modal\n data-slot=\"drawer\"\n className={cn(\n \"fixed flex flex-col overflow-hidden bg-ds-surface-overlay text-ds-text shadow-ds-overlay outline-hidden\",\n \"transition-[translate,height] duration-(--ds-duration-slow) ease-ds-enter data-[exiting]:ease-ds-exit motion-reduce:transition-none\",\n DRAWER_POSITION[position],\n bottom && (expanded ? \"h-[calc(100dvh-env(safe-area-inset-top,0px)-var(--ds-space-200))]\" : \"h-[50dvh]\"),\n (position === \"start\" || position === \"end\") && DRAWER_WIDTH[size],\n )}\n >\n <AriaDialog aria-describedby={describedBy} data-slot=\"drawer-dialog\" className={DIALOG_ELEMENT}>\n <OverlayContents>\n <DrawerCloseContext.Provider value={close}>\n {bottom && (\n <Grip expanded={expanded} onExpand={() => setExpanded(true)} onCollapse={() => setExpanded(false)} onDismiss={request} />\n )}\n <div data-slot=\"drawer-header\" className=\"flex items-start justify-between gap-ds-200 border-b border-ds-border px-ds-300 py-ds-200\">\n <div data-slot=\"drawer-heading\" className=\"flex min-w-0 flex-col gap-ds-025\">\n <Heading slot=\"title\" data-slot=\"drawer-title\" className=\"m-0 text-heading-medium\">{title}</Heading>\n {describedBy && <span id={describedBy} data-slot=\"drawer-subtitle\" className=\"text-body-small text-ds-text-subtle\">{subtitle}</span>}\n </div>\n <div data-slot=\"drawer-header-actions\" className=\"flex shrink-0 items-center gap-ds-100\">\n {headerActions}\n <CloseButton data-slot=\"drawer-close\" onPress={request} />\n </div>\n </div>\n <div\n data-slot=\"drawer-body\"\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto px-ds-300 pt-ds-200 text-body\",\n // Without a footer the body is the last thing above the home indicator.\n footer ? \"pb-ds-200\" : \"pb-[max(var(--ds-space-200),env(safe-area-inset-bottom,0px))]\",\n )}\n >\n {children}\n </div>\n {footer && (\n <div\n data-slot=\"drawer-footer\"\n className=\"flex flex-wrap items-center justify-end gap-ds-100 border-t border-ds-border px-ds-300 pt-ds-150 pb-[max(var(--ds-space-150),env(safe-area-inset-bottom,0px))]\"\n >\n {footer}\n </div>\n )}\n </DrawerCloseContext.Provider>\n </OverlayContents>\n <UnsavedPrompt\n isOpen={asking}\n onKeep={() => setAsking(false)}\n onDiscard={() => {\n setAsking(false);\n state.close();\n }}\n />\n </AriaDialog>\n </Modal>\n </ModalOverlay>\n );\n}\n\n/** Drawer with its own `motion` (auto, reduce or none); see DrawerBody for the component itself. */\nexport function Drawer({ motion, ...props }: DrawerProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <DrawerBody {...(props as DrawerProps)} />\n </MotionScope>\n );\n}\n"]}
@@ -0,0 +1,142 @@
1
+ import * as React from "react";
2
+ import { type Key, type Placement, type Selection } from "react-aria-components";
3
+ import { type WithMotion } from "../defaults.js";
4
+ import { type IconName } from "../display/icon.js";
5
+ /**
6
+ * One floating surface for Popover and Menu: `ds-surface-overlay`, `ds-shadow-overlay`, `ds-radius-large`,
7
+ * anchored to its trigger by React Aria (flips and shifts at the viewport edge, mirrors in RTL). React Aria
8
+ * caps its height to the space left on screen; the panel's content scrolls inside (SCROLL) instead of running
9
+ * off it. The surface itself does not clip, or it would hide the arrow React Aria places outside it.
10
+ */
11
+ export declare const SURFACE: string;
12
+ /** The scrolling inside a floating surface: as tall as React Aria lets the surface be, no taller. */
13
+ export declare const SCROLL = "min-h-0 max-h-[inherit] overflow-auto";
14
+ export type PopoverProps = {
15
+ /** The pressable that opens it (a DS Button: "Filtre"). */
16
+ trigger: React.ReactElement;
17
+ children: React.ReactNode;
18
+ /** "bottom start" by default; React Aria flips it when there is no room. */
19
+ placement?: Placement;
20
+ isOpen?: boolean;
21
+ defaultOpen?: boolean;
22
+ onOpenChange?: (isOpen: boolean) => void;
23
+ /** A heading that also names the panel ("Filters"); without it, give `aria-label`. */
24
+ title?: React.ReactNode;
25
+ "aria-label"?: string;
26
+ };
27
+ export type TooltipProps = {
28
+ /** Plain text only: the same words as the control's `aria-label`, or a truncated value in full. */
29
+ content: string;
30
+ /** The trigger. It must be focusable; a non-interactive element (a truncated lozenge) is made focusable. */
31
+ children: React.ReactElement;
32
+ placement?: Placement;
33
+ /** A keyboard shortcut shown as a chip ("F"). */
34
+ shortcut?: string;
35
+ /**
36
+ * Readable on touch screens: a tap on the trigger opens the tooltip and a second tap closes it;
37
+ * a tap anywhere else, or Esc, closes it. Mouse hover and keyboard focus work exactly as without it. For a
38
+ * trigger that does nothing on its own (a country flag, a truncated value); on a button the tap still presses it.
39
+ */
40
+ openOnTouch?: boolean;
41
+ };
42
+ /**
43
+ * Inside the design system only (not exported from the package): a tooltip on a child that is itself a
44
+ * React Aria focusable (a `Link`, a `Button slot="trigger"`), so it takes the trigger props directly.
45
+ */
46
+ export declare function TooltipFor({ content, children, placement, shortcut, openOnTouch }: TooltipProps): React.JSX.Element;
47
+ export type MenuItemDef = {
48
+ id: Key;
49
+ /** A verb ("Edit"); a disabled item says why ("Send invoice (payment pending)"). */
50
+ label: string;
51
+ icon?: IconName;
52
+ /** Shown in mono at the end ("E"). */
53
+ shortcut?: string;
54
+ isDisabled?: boolean;
55
+ /** `danger` for the destructive action; it is placed last, after a separator. */
56
+ tone?: "danger";
57
+ /** A submenu: opens on hover and on → (← in RTL). */
58
+ children?: readonly MenuItemDef[];
59
+ /** Makes the item a link (a language of the page, another page); it goes through the host router. */
60
+ href?: string;
61
+ /** The language of the label, when it differs from the page ("English" in a Turkish language list). */
62
+ lang?: string;
63
+ };
64
+ export type MenuSectionDef = {
65
+ id: Key;
66
+ /** "Share". */
67
+ title: string;
68
+ items: readonly MenuItemDef[];
69
+ };
70
+ export type MenuEntry = MenuItemDef | MenuSectionDef;
71
+ export type MenuProps = {
72
+ /** The pressable that opens it: the row "…" button, the account button. */
73
+ trigger: React.ReactElement;
74
+ /** Items, or sections of items with a title. Leave it out to compose the menu as children instead. */
75
+ items?: readonly MenuEntry[];
76
+ /**
77
+ * With no `items`: `MenuItem`, `MenuSection`, `MenuSubmenu` and `MenuSeparator`, in the order given (put the
78
+ * destructive item last yourself; with `items` the menu moves it there).
79
+ */
80
+ children?: React.ReactNode;
81
+ onAction?: (id: Key) => void;
82
+ disabledKeys?: Iterable<Key>;
83
+ /** "bottom end" by default: under the trigger, aligned to its inline end, as row menus sit. */
84
+ placement?: Placement;
85
+ /** For menus that also hold a choice (a view option): checkmarks on the selected items. */
86
+ selectionMode?: "none" | "single" | "multiple";
87
+ selectedKeys?: Iterable<Key>;
88
+ defaultSelectedKeys?: Iterable<Key>;
89
+ onSelectionChange?: (keys: Selection) => void;
90
+ isOpen?: boolean;
91
+ onOpenChange?: (isOpen: boolean) => void;
92
+ /** Names the menu when the trigger's own name is not enough. */
93
+ "aria-label"?: string;
94
+ };
95
+ /** A line between groups of items. */
96
+ export declare function MenuSeparator(): React.JSX.Element;
97
+ /** Groups in order, separators between them, the destructive items last after one more separator. */
98
+ export declare function MenuBody({ entries }: {
99
+ entries: readonly MenuEntry[];
100
+ }): React.JSX.Element;
101
+ export type MenuItemProps = {
102
+ id: Key;
103
+ /** The label: a verb ("Edit"). It may hold more than text (an avatar, two lines); then give `textValue`. */
104
+ children: React.ReactNode;
105
+ /** The words typing jumps to; the label itself when it is plain text. */
106
+ textValue?: string;
107
+ icon?: IconName;
108
+ /** Shown in mono at the end ("E"). */
109
+ shortcut?: string;
110
+ isDisabled?: boolean;
111
+ /** `danger` for the destructive action; put it last, after a `MenuSeparator`. */
112
+ tone?: "danger";
113
+ /** Makes the item a link; it goes through the host router. */
114
+ href?: string;
115
+ /** The language of the label, when it differs from the page. */
116
+ lang?: string;
117
+ };
118
+ /** One action in a Menu or ContextMenu composed from parts. */
119
+ export declare function MenuItem({ children, textValue, ...rest }: MenuItemProps): React.JSX.Element;
120
+ export type MenuSectionProps = {
121
+ id?: Key;
122
+ /** The section's title ("Share"); it names the group. */
123
+ title: string;
124
+ /** `MenuItem`s and `MenuSubmenu`s. */
125
+ children: React.ReactNode;
126
+ };
127
+ /** A titled group of items. */
128
+ export declare function MenuSection({ id, title, children }: MenuSectionProps): React.JSX.Element;
129
+ export type MenuSubmenuProps = Omit<MenuItemProps, "href" | "children" | "textValue" | "tone"> & {
130
+ /** The item that opens the submenu ("Move to"). */
131
+ label: string;
132
+ /** The submenu's `MenuItem`s. */
133
+ children: React.ReactNode;
134
+ };
135
+ /** An item that opens a submenu: on hover and on → (← in RTL); under the item on phones. */
136
+ export declare function MenuSubmenu({ label, children, ...rest }: MenuSubmenuProps): React.JSX.Element;
137
+ /** Popover with its own `motion` (auto, reduce or none); see PopoverBody for the component itself. */
138
+ export declare function Popover({ motion, ...props }: PopoverProps & WithMotion): React.JSX.Element;
139
+ /** Menu with its own `motion` (auto, reduce or none); see MenuRoot for the component itself. */
140
+ export declare function Menu({ motion, ...props }: MenuProps & WithMotion): React.JSX.Element;
141
+ /** Tooltip with its own `motion` (auto, reduce or none); see TooltipBody for the component itself. */
142
+ export declare function Tooltip({ motion, ...props }: TooltipProps & WithMotion): React.JSX.Element;
@@ -0,0 +1,226 @@
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 { Dialog as AriaDialog, DialogTrigger as AriaDialogTrigger, Focusable, Heading, Header, Keyboard, Menu as AriaMenu, MenuItem as AriaMenuItem, MenuSection as AriaMenuSection, MenuTrigger, OverlayArrow, Popover as AriaPopover, Separator, SubmenuTrigger, Tooltip as AriaTooltip, TooltipTrigger } from "react-aria-components";
5
+ import { cn } from "../utils.js";
6
+ import { MotionScope, useMotionAttribute } from "../defaults.js";
7
+ import { Button, CloseButton, Fab, Link, ToggleButton } from "../action/index.js";
8
+ import { IconGlyph } from "../display/icon.js";
9
+ import { Kbd } from "../display/kbd.js";
10
+ import { OverlayContents } from "./overlay-base.js";
11
+ /**
12
+ * One floating surface for Popover and Menu: `ds-surface-overlay`, `ds-shadow-overlay`, `ds-radius-large`,
13
+ * anchored to its trigger by React Aria (flips and shifts at the viewport edge, mirrors in RTL). React Aria
14
+ * caps its height to the space left on screen; the panel's content scrolls inside (SCROLL) instead of running
15
+ * off it. The surface itself does not clip, or it would hide the arrow React Aria places outside it.
16
+ */
17
+ export const SURFACE = "flex flex-col rounded-ds-large [--ds-surface-radius:var(--ds-radius-large)] bg-ds-surface-overlay text-ds-text shadow-ds-overlay outline-hidden " +
18
+ "transition-[opacity,translate] duration-(--ds-duration-medium) ease-ds-enter data-[exiting]:ease-ds-exit motion-reduce:transition-none " +
19
+ "data-[entering]:opacity-0 data-[exiting]:opacity-0 " +
20
+ "data-[placement=bottom]:data-[entering]:-translate-y-1 data-[placement=top]:data-[entering]:translate-y-1";
21
+ /** The scrolling inside a floating surface: as tall as React Aria lets the surface be, no taller. */
22
+ export const SCROLL = "min-h-0 max-h-[inherit] overflow-auto";
23
+ /** The 12px arrow pointing at the trigger, turned to whichever side the panel opened on. */
24
+ function Arrow() {
25
+ return (_jsx(OverlayArrow, { "data-slot": "popover-arrow", className: "group", children: _jsx("svg", { width: 12, height: 12, viewBox: "0 0 12 12", "aria-hidden": true, className: "block fill-ds-surface-overlay group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90", children: _jsx("path", { d: "M0 0 L6 6 L12 0" }) }) }));
26
+ }
27
+ /**
28
+ * A small non-modal panel anchored to its trigger: filters, a quick edit, extra details. 240–360px wide,
29
+ * with an arrow to the trigger. Esc and an outside click close it; focus moves in on open and back to the
30
+ * trigger on close. One small task; more than about four fields belongs in a Drawer.
31
+ */
32
+ function PopoverBody({ trigger, children, placement = "bottom start", isOpen, defaultOpen, onOpenChange, title, "aria-label": ariaLabel }) {
33
+ return (_jsxs(AriaDialogTrigger, { isOpen: isOpen, defaultOpen: defaultOpen, onOpenChange: onOpenChange, children: [trigger, _jsxs(AriaPopover, { ...useMotionAttribute(), "data-slot": "popover", placement: placement, offset: 10, className: cn(SURFACE, "min-w-60 max-w-90"), children: [_jsx(Arrow, {}), _jsx(AriaDialog, { "aria-label": title ? undefined : ariaLabel, "data-slot": "popover-dialog", className: cn(SCROLL, "flex flex-col gap-ds-150 p-ds-200 outline-hidden"), children: _jsxs(OverlayContents, { children: [title && _jsx(Heading, { slot: "title", "data-slot": "popover-title", className: "m-0 text-heading-xsmall", children: title }), children] }) })] })] }));
34
+ }
35
+ /** DS controls built on React Aria: they take a tooltip as they are. */
36
+ const ARIA_TRIGGERS = new Set([Button, CloseButton, ToggleButton, Link, Fab]);
37
+ /**
38
+ * The tooltip's trigger. A DS button or link is used as it is. A plain element gets a tab stop (keeping one it
39
+ * already has). Any other component (a Badge, a truncated value) is wrapped in a focusable span, since React
40
+ * Aria can only attach to an element it can reach; the wrapper takes no tab stop of its own when what it holds
41
+ * is already focusable (a raw React Aria button), so keyboard users still meet one stop. For a Menu or a
42
+ * Popover, put the Tooltip on its trigger button, not around the whole component.
43
+ */
44
+ function TooltipTarget({ children }) {
45
+ const wrapper = React.useRef(null);
46
+ const [holdsFocusable, setHoldsFocusable] = React.useState(false);
47
+ React.useLayoutEffect(() => {
48
+ setHoldsFocusable(!!wrapper.current?.querySelector("button, a[href], input, select, textarea, [tabindex]:not([tabindex='-1'])"));
49
+ });
50
+ if (ARIA_TRIGGERS.has(children.type))
51
+ return children;
52
+ if (typeof children.type === "string") {
53
+ const props = children.props;
54
+ return _jsx(Focusable, { children: React.cloneElement(children, { tabIndex: props.tabIndex ?? 0 }) });
55
+ }
56
+ return (
57
+ // React Aria gives a Focusable child tabIndex 0 unless it is excluded from the tab order.
58
+ _jsx(Focusable, { excludeFromTabOrder: holdsFocusable, children: _jsx("span", { ref: wrapper, tabIndex: holdsFocusable ? -1 : 0, "data-slot": "tooltip-target", className: "inline-flex rounded-ds-small outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-ds-border-focused", children: children }) }));
59
+ }
60
+ /**
61
+ * Names an icon-only control or shows a truncated value in full. Shows after 300ms of hover and at once on
62
+ * keyboard focus; Esc hides it. The control keeps its own `aria-label` (the tooltip only describes it), and
63
+ * touch users never see a tooltip, so it never holds anything needed to finish a task. With `openOnTouch` a tap
64
+ * toggles it, for a value that a touch user should also be able to read. No provider needed.
65
+ */
66
+ function TooltipBody(props) {
67
+ return _jsx(TooltipFor, { ...props, children: _jsx(TooltipTarget, { children: props.children }) });
68
+ }
69
+ /**
70
+ * Inside the design system only (not exported from the package): a tooltip on a child that is itself a
71
+ * React Aria focusable (a `Link`, a `Button slot="trigger"`), so it takes the trigger props directly.
72
+ */
73
+ export function TooltipFor({ content, children, placement = "top", shortcut, openOnTouch }) {
74
+ if (openOnTouch)
75
+ return _jsx(TouchTooltipFor, { content: content, placement: placement, shortcut: shortcut, children: children });
76
+ return (_jsxs(TooltipTrigger, { delay: 300, closeDelay: 0, children: [children, _jsx(TooltipBubble, { content: content, placement: placement, shortcut: shortcut })] }));
77
+ }
78
+ const TooltipBubble = React.forwardRef(function TooltipBubble({ content, placement, shortcut }, ref) {
79
+ return (_jsxs(AriaTooltip, { ...useMotionAttribute(), ref: ref, "data-slot": "tooltip", placement: placement, offset: 6, className: cn("flex max-w-60 items-center gap-ds-075 rounded-ds-small bg-ds-background-neutral-bold px-ds-100 py-ds-050 text-body-small text-ds-text-inverse", "transition-opacity duration-(--ds-duration-fast) data-[entering]:opacity-0 data-[exiting]:opacity-0 motion-reduce:transition-none"), children: [_jsx("span", { "data-slot": "tooltip-content", children: content }), shortcut && (_jsx("span", { "data-slot": "tooltip-shortcut", className: "flex", children: _jsx(Kbd, { children: shortcut }) }))] }));
80
+ });
81
+ /**
82
+ * `openOnTouch`. The tooltip is controlled: React Aria still opens it on hover and keyboard focus and
83
+ * closes it on press, blur and Esc through `onOpenChange`. A touch tap is decided on pointerdown, from the state
84
+ * the finger found (React Aria's own close-on-press runs in the same event), and applied on pointerup, so a tap
85
+ * toggles it; a scroll that cancels the touch changes nothing. While it is open, a pointer down outside the trigger
86
+ * and the bubble closes it. The trigger sits in a `display: contents` span, which adds no box to the layout.
87
+ */
88
+ function TouchTooltipFor({ content, children, placement, shortcut }) {
89
+ const [isOpen, setOpen] = React.useState(false);
90
+ const zone = React.useRef(null);
91
+ const bubble = React.useRef(null);
92
+ const tap = React.useRef(null);
93
+ React.useEffect(() => {
94
+ if (!isOpen)
95
+ return;
96
+ const outside = (event) => {
97
+ const target = event.target;
98
+ if (target && (zone.current?.contains(target) || bubble.current?.contains(target)))
99
+ return;
100
+ setOpen(false);
101
+ };
102
+ document.addEventListener("pointerdown", outside, true);
103
+ return () => document.removeEventListener("pointerdown", outside, true);
104
+ }, [isOpen]);
105
+ return (_jsx("span", { ref: zone, "data-slot": "tooltip-touch", className: "contents", onPointerDownCapture: (event) => {
106
+ // React events bubble through the portal: a tap on the bubble is not a tap on the trigger.
107
+ const onTrigger = zone.current?.contains(event.target) ?? false;
108
+ tap.current = event.pointerType === "touch" && onTrigger ? !isOpen : null;
109
+ }, onPointerUp: (event) => {
110
+ const next = tap.current;
111
+ tap.current = null;
112
+ if (event.pointerType === "touch" && next !== null)
113
+ setOpen(next);
114
+ }, onPointerCancel: () => {
115
+ tap.current = null;
116
+ }, children: _jsxs(TooltipTrigger, { delay: 300, closeDelay: 0, isOpen: isOpen, onOpenChange: setOpen, children: [children, _jsx(TooltipBubble, { ref: bubble, content: content, placement: placement, shortcut: shortcut })] }) }));
117
+ }
118
+ const ITEM = "group flex min-h-8 cursor-default items-center gap-ds-100 rounded-[max(var(--ds-radius-small),calc(var(--ds-surface-radius,var(--ds-radius-large))-var(--ds-space-050)))] px-ds-100 text-body outline-hidden select-none " +
119
+ "data-[focused]:bg-ds-background-neutral-subtle-hovered data-[pressed]:bg-ds-background-neutral-pressed " +
120
+ "data-[disabled]:cursor-not-allowed data-[disabled]:text-ds-text-disabled";
121
+ function isSection(entry) {
122
+ return "items" in entry;
123
+ }
124
+ /**
125
+ * The menu as rendered: entries in the order given, consecutive loose items as one group, and every
126
+ * destructive item pulled out of its group and placed once at the end. Separators go between the groups that
127
+ * actually render, and before the destructive ones.
128
+ */
129
+ function layout(entries) {
130
+ const groups = [];
131
+ const danger = [];
132
+ for (const entry of entries) {
133
+ if (isSection(entry)) {
134
+ const items = entry.items.filter((item) => (item.tone === "danger" ? (danger.push(item), false) : true));
135
+ if (items.length)
136
+ groups.push({ kind: "section", section: entry, items });
137
+ }
138
+ else if (entry.tone === "danger") {
139
+ danger.push(entry);
140
+ }
141
+ else {
142
+ const last = groups[groups.length - 1];
143
+ if (last?.kind === "run")
144
+ last.items.push(entry);
145
+ else
146
+ groups.push({ kind: "run", key: `run-${String(entry.id)}`, items: [entry] });
147
+ }
148
+ }
149
+ return { groups, danger };
150
+ }
151
+ /** A line between groups of items. */
152
+ export function MenuSeparator() {
153
+ return _jsx(Separator, { "data-slot": "menu-separator", className: "my-ds-050 border-t border-ds-border" });
154
+ }
155
+ /** Phones (below 640px): a submenu opens under its item, inside the menu's width, not beside it off-screen. */
156
+ function useNarrow() {
157
+ return React.useSyncExternalStore((notify) => {
158
+ if (typeof window.matchMedia !== "function")
159
+ return () => { };
160
+ const query = window.matchMedia("(max-width: 639px)");
161
+ query.addEventListener("change", notify);
162
+ return () => query.removeEventListener("change", notify);
163
+ }, () => typeof window.matchMedia === "function" && window.matchMedia("(max-width: 639px)").matches, () => false);
164
+ }
165
+ function Submenu({ children }) {
166
+ const narrow = useNarrow();
167
+ return (_jsx(AriaPopover, { ...useMotionAttribute(), "data-slot": "menu-submenu", placement: narrow ? "bottom end" : "end top", offset: narrow ? 2 : -4, crossOffset: narrow ? 0 : -4, className: cn(SURFACE, "min-w-48 max-w-[min(22.5rem,calc(100vw-1.5rem))]"), children: _jsx(AriaMenu, { "data-slot": "menu-list", className: cn(SCROLL, "p-ds-050 outline-hidden"), children: children }) }));
168
+ }
169
+ /** Groups in order, separators between them, the destructive items last after one more separator. */
170
+ export function MenuBody({ entries }) {
171
+ const { groups, danger } = layout(entries);
172
+ return (_jsxs(_Fragment, { children: [groups.map((group, index) => (_jsxs(React.Fragment, { children: [index > 0 && _jsx(MenuSeparator, {}), group.kind === "section" ? (_jsx(MenuSection, { id: group.section.id, title: group.section.title, children: group.items.map((item) => _jsx(Item, { item: item }, String(item.id))) })) : (group.items.map((item) => _jsx(Item, { item: item }, String(item.id))))] }, group.kind === "section" ? String(group.section.id) : group.key))), danger.length > 0 && groups.length > 0 && _jsx(MenuSeparator, {}), danger.map((item) => _jsx(Item, { item: item }, String(item.id)))] }));
173
+ }
174
+ function Item({ item }) {
175
+ const row = { id: item.id, textValue: item.label, icon: item.icon, shortcut: item.shortcut, isDisabled: item.isDisabled, tone: item.tone, href: item.href, lang: item.lang };
176
+ if (!item.children)
177
+ return _jsx(ItemRow, { ...row, children: item.label });
178
+ return (_jsxs(SubmenuTrigger, { children: [_jsx(ItemRow, { ...row, hasSubmenu: true, children: item.label }), _jsx(Submenu, { children: _jsx(MenuBody, { entries: item.children }) })] }));
179
+ }
180
+ /** One 32px row: a check when the menu selects, an icon, the label, then a shortcut or a submenu chevron. */
181
+ function ItemRow({ id, children, textValue, icon, shortcut, isDisabled, tone, href, lang, hasSubmenu }) {
182
+ return (_jsx(AriaMenuItem, { id: id, textValue: textValue, isDisabled: isDisabled, href: href, "data-slot": "menu-item", "data-tone": tone, className: cn(ITEM, tone === "danger" && "text-ds-text-danger"), children: ({ isSelected, selectionMode }) => (_jsxs(_Fragment, { children: [selectionMode !== "none" && (_jsx("span", { "data-slot": "menu-item-check", className: "grid size-4 shrink-0 place-items-center", children: isSelected && _jsx(IconGlyph, { name: "check", size: "small" }) })), icon && (_jsx(IconGlyph, { name: icon, size: "small", "data-slot": "menu-item-icon", className: cn(tone === "danger" ? "text-ds-icon-danger" : "text-ds-icon-subtle", "group-data-[disabled]:text-ds-text-disabled") })), _jsx("span", { "data-slot": "menu-item-label", lang: lang, className: "min-w-0 flex-1 truncate", children: children }), shortcut && (_jsx(Keyboard, { "data-slot": "menu-item-shortcut", className: "font-ds-mono text-code text-ds-text-subtlest", children: shortcut })), hasSubmenu && _jsx(IconGlyph, { name: "chevron-right", size: "small", "data-slot": "menu-item-submenu", className: "text-ds-icon-subtle" })] })) }));
183
+ }
184
+ function textOf(children, textValue, part) {
185
+ if (textValue !== undefined)
186
+ return textValue;
187
+ if (typeof children === "string" || typeof children === "number")
188
+ return String(children);
189
+ if (process.env.NODE_ENV !== "production")
190
+ console.warn(`${part}: give textValue when the label is not plain text, so typing can jump to it.`);
191
+ return "";
192
+ }
193
+ /** One action in a Menu or ContextMenu composed from parts. */
194
+ export function MenuItem({ children, textValue, ...rest }) {
195
+ return (_jsx(ItemRow, { ...rest, textValue: textOf(children, textValue, "MenuItem"), children: children }));
196
+ }
197
+ /** A titled group of items. */
198
+ export function MenuSection({ id, title, children }) {
199
+ return (_jsxs(AriaMenuSection, { "data-slot": "menu-section", id: id, children: [_jsx(Header, { "data-slot": "menu-section-title", className: "px-ds-100 pt-ds-100 pb-ds-050 text-heading-xxsmall text-ds-text-subtle", children: title }), children] }));
200
+ }
201
+ /** An item that opens a submenu: on hover and on → (← in RTL); under the item on phones. */
202
+ export function MenuSubmenu({ label, children, ...rest }) {
203
+ return (_jsxs(SubmenuTrigger, { children: [_jsx(ItemRow, { ...rest, textValue: label, hasSubmenu: true, children: label }), _jsx(Submenu, { children: children })] }));
204
+ }
205
+ /**
206
+ * The actions for an object behind a trigger: the row "…" menu, the account menu. 32px items with an icon,
207
+ * a label and a shortcut or a submenu chevron; the destructive action last, after a separator. Anchored to
208
+ * its trigger on every viewport and in RTL. Arrows move, typing jumps, Home/End go to the ends,
209
+ * Enter acts, Esc closes and returns focus to the trigger. Choosing a value is a Select, not a Menu.
210
+ */
211
+ function MenuRoot({ trigger, items, children, onAction, disabledKeys, placement = "bottom end", selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, isOpen, onOpenChange, "aria-label": ariaLabel, }) {
212
+ return (_jsxs(MenuTrigger, { isOpen: isOpen, onOpenChange: onOpenChange, children: [trigger, _jsx(AriaPopover, { ...useMotionAttribute(), "data-slot": "menu-popover", placement: placement, offset: 4, className: cn(SURFACE, "min-w-60 max-w-90"), children: _jsx(AriaMenu, { "aria-label": ariaLabel, onAction: onAction, disabledKeys: disabledKeys, selectionMode: selectionMode, selectedKeys: selectedKeys, defaultSelectedKeys: defaultSelectedKeys, onSelectionChange: onSelectionChange, "data-slot": "menu", className: cn(SCROLL, "p-ds-050 outline-hidden"), children: items ? _jsx(MenuBody, { entries: items }) : children }) })] }));
213
+ }
214
+ /** Popover with its own `motion` (auto, reduce or none); see PopoverBody for the component itself. */
215
+ export function Popover({ motion, ...props }) {
216
+ return (_jsx(MotionScope, { motion: motion, children: _jsx(PopoverBody, { ...props }) }));
217
+ }
218
+ /** Menu with its own `motion` (auto, reduce or none); see MenuRoot for the component itself. */
219
+ export function Menu({ motion, ...props }) {
220
+ return (_jsx(MotionScope, { motion: motion, children: _jsx(MenuRoot, { ...props }) }));
221
+ }
222
+ /** Tooltip with its own `motion` (auto, reduce or none); see TooltipBody for the component itself. */
223
+ export function Tooltip({ motion, ...props }) {
224
+ return (_jsx(MotionScope, { motion: motion, children: _jsx(TooltipBody, { ...props }) }));
225
+ }
226
+ //# sourceMappingURL=floating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floating.js","sourceRoot":"","sources":["../../src/overlay/floating.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,aAAa,IAAI,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,QAAQ,EAAE,QAAQ,IAAI,YAAY,EAAE,WAAW,IAAI,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,IAAI,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,IAAI,WAAW,EAAE,cAAc,EAA4C,MAAM,uBAAuB,CAAC;AACnX,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAmB,kBAAk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C1B,MAAM,EAChB,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,yBAAyB,CAAC,YAE/C,KAAK,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,OAAO,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,QAAQ,GACvC,GACC,IACF,CACf,CAAC;AACJ,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA6B;IACrE,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,WAAW,OAAM,KAAsB,GAAI,GAChC,CACf,CAAC;AACJ,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA0B;IAC/D,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,QAAQ,OAAM,KAAmB,GAAI,GAC1B,CACf,CAAC;AACJ,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA6B;IACrE,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,WAAW,OAAM,KAAsB,GAAI,GAChC,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as AriaDialog, DialogTrigger as AriaDialogTrigger, Focusable, Heading, Header, Keyboard, Menu as AriaMenu, MenuItem as AriaMenuItem, MenuSection as AriaMenuSection, MenuTrigger, OverlayArrow, Popover as AriaPopover, Separator, SubmenuTrigger, Tooltip as AriaTooltip, TooltipTrigger, type Key, type Placement, type Selection } from \"react-aria-components\";\nimport { cn } from \"../utils\";\nimport { MotionScope, type WithMotion, useMotionAttribute } from \"../defaults\";\nimport { Button, CloseButton, Fab, Link, ToggleButton } from \"../action/index\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { Kbd } from \"../display/kbd\";\nimport { OverlayContents } from \"./overlay-base\";\n\n/**\n * One floating surface for Popover and Menu: `ds-surface-overlay`, `ds-shadow-overlay`, `ds-radius-large`,\n * anchored to its trigger by React Aria (flips and shifts at the viewport edge, mirrors in RTL). React Aria\n * caps its height to the space left on screen; the panel's content scrolls inside (SCROLL) instead of running\n * off it. The surface itself does not clip, or it would hide the arrow React Aria places outside it.\n */\nexport const SURFACE =\n \"flex flex-col rounded-ds-large [--ds-surface-radius:var(--ds-radius-large)] bg-ds-surface-overlay text-ds-text shadow-ds-overlay outline-hidden \" +\n \"transition-[opacity,translate] duration-(--ds-duration-medium) ease-ds-enter data-[exiting]:ease-ds-exit motion-reduce:transition-none \" +\n \"data-[entering]:opacity-0 data-[exiting]:opacity-0 \" +\n \"data-[placement=bottom]:data-[entering]:-translate-y-1 data-[placement=top]:data-[entering]:translate-y-1\";\n\n/** The scrolling inside a floating surface: as tall as React Aria lets the surface be, no taller. */\nexport const SCROLL = \"min-h-0 max-h-[inherit] overflow-auto\";\n\n/** The 12px arrow pointing at the trigger, turned to whichever side the panel opened on. */\nfunction Arrow() {\n return (\n <OverlayArrow data-slot=\"popover-arrow\" className=\"group\">\n <svg width={12} height={12} viewBox=\"0 0 12 12\" aria-hidden className=\"block fill-ds-surface-overlay group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90\">\n <path d=\"M0 0 L6 6 L12 0\" />\n </svg>\n </OverlayArrow>\n );\n}\n\nexport type PopoverProps = {\n /** The pressable that opens it (a DS Button: \"Filtre\"). */\n trigger: React.ReactElement;\n children: React.ReactNode;\n /** \"bottom start\" by default; React Aria flips it when there is no room. */\n placement?: Placement;\n isOpen?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n /** A heading that also names the panel (\"Filters\"); without it, give `aria-label`. */\n title?: React.ReactNode;\n \"aria-label\"?: string;\n};\n\n/**\n * A small non-modal panel anchored to its trigger: filters, a quick edit, extra details. 240–360px wide,\n * with an arrow to the trigger. Esc and an outside click close it; focus moves in on open and back to the\n * trigger on close. One small task; more than about four fields belongs in a Drawer.\n */\nfunction PopoverBody({ trigger, children, placement = \"bottom start\", isOpen, defaultOpen, onOpenChange, title, \"aria-label\": ariaLabel }: PopoverProps) {\n return (\n <AriaDialogTrigger isOpen={isOpen} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n {trigger}\n <AriaPopover {...useMotionAttribute()} data-slot=\"popover\" placement={placement} offset={10} className={cn(SURFACE, \"min-w-60 max-w-90\")}>\n <Arrow />\n <AriaDialog aria-label={title ? undefined : ariaLabel} data-slot=\"popover-dialog\" className={cn(SCROLL, \"flex flex-col gap-ds-150 p-ds-200 outline-hidden\")}>\n <OverlayContents>\n {title && <Heading slot=\"title\" data-slot=\"popover-title\" className=\"m-0 text-heading-xsmall\">{title}</Heading>}\n {children}\n </OverlayContents>\n </AriaDialog>\n </AriaPopover>\n </AriaDialogTrigger>\n );\n}\n\nexport type TooltipProps = {\n /** Plain text only: the same words as the control's `aria-label`, or a truncated value in full. */\n content: string;\n /** The trigger. It must be focusable; a non-interactive element (a truncated lozenge) is made focusable. */\n children: React.ReactElement;\n placement?: Placement;\n /** A keyboard shortcut shown as a chip (\"F\"). */\n shortcut?: string;\n /**\n * Readable on touch screens: a tap on the trigger opens the tooltip and a second tap closes it;\n * a tap anywhere else, or Esc, closes it. Mouse hover and keyboard focus work exactly as without it. For a\n * trigger that does nothing on its own (a country flag, a truncated value); on a button the tap still presses it.\n */\n openOnTouch?: boolean;\n};\n\n/** DS controls built on React Aria: they take a tooltip as they are. */\nconst ARIA_TRIGGERS = new Set<unknown>([Button, CloseButton, ToggleButton, Link, Fab]);\n\n/**\n * The tooltip's trigger. A DS button or link is used as it is. A plain element gets a tab stop (keeping one it\n * already has). Any other component (a Badge, a truncated value) is wrapped in a focusable span, since React\n * Aria can only attach to an element it can reach; the wrapper takes no tab stop of its own when what it holds\n * is already focusable (a raw React Aria button), so keyboard users still meet one stop. For a Menu or a\n * Popover, put the Tooltip on its trigger button, not around the whole component.\n */\nfunction TooltipTarget({ children }: { children: React.ReactElement }) {\n const wrapper = React.useRef<HTMLSpanElement>(null);\n const [holdsFocusable, setHoldsFocusable] = React.useState(false);\n React.useLayoutEffect(() => {\n setHoldsFocusable(!!wrapper.current?.querySelector(\"button, a[href], input, select, textarea, [tabindex]:not([tabindex='-1'])\"));\n });\n if (ARIA_TRIGGERS.has(children.type)) return children;\n type Focus = React.ComponentProps<typeof Focusable>[\"children\"];\n if (typeof children.type === \"string\") {\n const props = children.props as { tabIndex?: number };\n return <Focusable>{React.cloneElement(children as React.ReactElement<{ tabIndex?: number }>, { tabIndex: props.tabIndex ?? 0 }) as Focus}</Focusable>;\n }\n return (\n // React Aria gives a Focusable child tabIndex 0 unless it is excluded from the tab order.\n <Focusable excludeFromTabOrder={holdsFocusable}>\n <span\n ref={wrapper}\n tabIndex={holdsFocusable ? -1 : 0}\n data-slot=\"tooltip-target\"\n className=\"inline-flex rounded-ds-small outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-ds-border-focused\"\n >\n {children}\n </span>\n </Focusable>\n );\n}\n\n/**\n * Names an icon-only control or shows a truncated value in full. Shows after 300ms of hover and at once on\n * keyboard focus; Esc hides it. The control keeps its own `aria-label` (the tooltip only describes it), and\n * touch users never see a tooltip, so it never holds anything needed to finish a task. With `openOnTouch` a tap\n * toggles it, for a value that a touch user should also be able to read. No provider needed.\n */\nfunction TooltipBody(props: TooltipProps) {\n return <TooltipFor {...props} children={<TooltipTarget>{props.children}</TooltipTarget>} />;\n}\n\n/**\n * Inside the design system only (not exported from the package): a tooltip on a child that is itself a\n * React Aria focusable (a `Link`, a `Button slot=\"trigger\"`), so it takes the trigger props directly.\n */\nexport function TooltipFor({ content, children, placement = \"top\", shortcut, openOnTouch }: TooltipProps) {\n if (openOnTouch) return <TouchTooltipFor content={content} placement={placement} shortcut={shortcut}>{children}</TouchTooltipFor>;\n return (\n <TooltipTrigger delay={300} closeDelay={0}>\n {children}\n <TooltipBubble content={content} placement={placement} shortcut={shortcut} />\n </TooltipTrigger>\n );\n}\n\nconst TooltipBubble = React.forwardRef<HTMLDivElement, Pick<TooltipProps, \"content\" | \"placement\" | \"shortcut\">>(function TooltipBubble(\n { content, placement, shortcut },\n ref,\n) {\n return (\n <AriaTooltip\n {...useMotionAttribute()}\n ref={ref}\n data-slot=\"tooltip\"\n placement={placement}\n offset={6}\n className={cn(\n \"flex max-w-60 items-center gap-ds-075 rounded-ds-small bg-ds-background-neutral-bold px-ds-100 py-ds-050 text-body-small text-ds-text-inverse\",\n \"transition-opacity duration-(--ds-duration-fast) data-[entering]:opacity-0 data-[exiting]:opacity-0 motion-reduce:transition-none\",\n )}\n >\n <span data-slot=\"tooltip-content\">{content}</span>\n {shortcut && (\n <span data-slot=\"tooltip-shortcut\" className=\"flex\">\n <Kbd>{shortcut}</Kbd>\n </span>\n )}\n </AriaTooltip>\n );\n});\n\n/**\n * `openOnTouch`. The tooltip is controlled: React Aria still opens it on hover and keyboard focus and\n * closes it on press, blur and Esc through `onOpenChange`. A touch tap is decided on pointerdown, from the state\n * the finger found (React Aria's own close-on-press runs in the same event), and applied on pointerup, so a tap\n * toggles it; a scroll that cancels the touch changes nothing. While it is open, a pointer down outside the trigger\n * and the bubble closes it. The trigger sits in a `display: contents` span, which adds no box to the layout.\n */\nfunction TouchTooltipFor({ content, children, placement, shortcut }: Omit<TooltipProps, \"openOnTouch\">) {\n const [isOpen, setOpen] = React.useState(false);\n const zone = React.useRef<HTMLSpanElement>(null);\n const bubble = React.useRef<HTMLDivElement>(null);\n const tap = React.useRef<boolean | null>(null);\n React.useEffect(() => {\n if (!isOpen) return;\n const outside = (event: PointerEvent) => {\n const target = event.target as Node | null;\n if (target && (zone.current?.contains(target) || bubble.current?.contains(target))) return;\n setOpen(false);\n };\n document.addEventListener(\"pointerdown\", outside, true);\n return () => document.removeEventListener(\"pointerdown\", outside, true);\n }, [isOpen]);\n return (\n <span\n ref={zone}\n data-slot=\"tooltip-touch\"\n className=\"contents\"\n onPointerDownCapture={(event) => {\n // React events bubble through the portal: a tap on the bubble is not a tap on the trigger.\n const onTrigger = zone.current?.contains(event.target as Node) ?? false;\n tap.current = event.pointerType === \"touch\" && onTrigger ? !isOpen : null;\n }}\n onPointerUp={(event) => {\n const next = tap.current;\n tap.current = null;\n if (event.pointerType === \"touch\" && next !== null) setOpen(next);\n }}\n onPointerCancel={() => {\n tap.current = null;\n }}\n >\n <TooltipTrigger delay={300} closeDelay={0} isOpen={isOpen} onOpenChange={setOpen}>\n {children}\n <TooltipBubble ref={bubble} content={content} placement={placement} shortcut={shortcut} />\n </TooltipTrigger>\n </span>\n );\n}\n\nexport type MenuItemDef = {\n id: Key;\n /** A verb (\"Edit\"); a disabled item says why (\"Send invoice (payment pending)\"). */\n label: string;\n icon?: IconName;\n /** Shown in mono at the end (\"E\"). */\n shortcut?: string;\n isDisabled?: boolean;\n /** `danger` for the destructive action; it is placed last, after a separator. */\n tone?: \"danger\";\n /** A submenu: opens on hover and on → (← in RTL). */\n children?: readonly MenuItemDef[];\n /** Makes the item a link (a language of the page, another page); it goes through the host router. */\n href?: string;\n /** The language of the label, when it differs from the page (\"English\" in a Turkish language list). */\n lang?: string;\n};\n\nexport type MenuSectionDef = {\n id: Key;\n /** \"Share\". */\n title: string;\n items: readonly MenuItemDef[];\n};\n\nexport type MenuEntry = MenuItemDef | MenuSectionDef;\n\nexport type MenuProps = {\n /** The pressable that opens it: the row \"…\" button, the account button. */\n trigger: React.ReactElement;\n /** Items, or sections of items with a title. Leave it out to compose the menu as children instead. */\n items?: readonly MenuEntry[];\n /**\n * With no `items`: `MenuItem`, `MenuSection`, `MenuSubmenu` and `MenuSeparator`, in the order given (put the\n * destructive item last yourself; with `items` the menu moves it there).\n */\n children?: React.ReactNode;\n onAction?: (id: Key) => void;\n disabledKeys?: Iterable<Key>;\n /** \"bottom end\" by default: under the trigger, aligned to its inline end, as row menus sit. */\n placement?: Placement;\n /** For menus that also hold a choice (a view option): checkmarks on the selected items. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n selectedKeys?: Iterable<Key>;\n defaultSelectedKeys?: Iterable<Key>;\n onSelectionChange?: (keys: Selection) => void;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n /** Names the menu when the trigger's own name is not enough. */\n \"aria-label\"?: string;\n};\n\nconst ITEM =\n \"group flex min-h-8 cursor-default items-center gap-ds-100 rounded-[max(var(--ds-radius-small),calc(var(--ds-surface-radius,var(--ds-radius-large))-var(--ds-space-050)))] px-ds-100 text-body outline-hidden select-none \" +\n \"data-[focused]:bg-ds-background-neutral-subtle-hovered data-[pressed]:bg-ds-background-neutral-pressed \" +\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-ds-text-disabled\";\n\nfunction isSection(entry: MenuEntry): entry is MenuSectionDef {\n return \"items\" in entry;\n}\n\ntype Group = { kind: \"section\"; section: MenuSectionDef; items: MenuItemDef[] } | { kind: \"run\"; key: string; items: MenuItemDef[] };\n\n/**\n * The menu as rendered: entries in the order given, consecutive loose items as one group, and every\n * destructive item pulled out of its group and placed once at the end. Separators go between the groups that\n * actually render, and before the destructive ones.\n */\nfunction layout(entries: readonly MenuEntry[]) {\n const groups: Group[] = [];\n const danger: MenuItemDef[] = [];\n for (const entry of entries) {\n if (isSection(entry)) {\n const items = entry.items.filter((item) => (item.tone === \"danger\" ? (danger.push(item), false) : true));\n if (items.length) groups.push({ kind: \"section\", section: entry, items });\n } else if (entry.tone === \"danger\") {\n danger.push(entry);\n } else {\n const last = groups[groups.length - 1];\n if (last?.kind === \"run\") last.items.push(entry);\n else groups.push({ kind: \"run\", key: `run-${String(entry.id)}`, items: [entry] });\n }\n }\n return { groups, danger };\n}\n\n/** A line between groups of items. */\nexport function MenuSeparator() {\n return <Separator data-slot=\"menu-separator\" className=\"my-ds-050 border-t border-ds-border\" />;\n}\n\n/** Phones (below 640px): a submenu opens under its item, inside the menu's width, not beside it off-screen. */\nfunction useNarrow() {\n return React.useSyncExternalStore(\n (notify) => {\n if (typeof window.matchMedia !== \"function\") return () => {};\n const query = window.matchMedia(\"(max-width: 639px)\");\n query.addEventListener(\"change\", notify);\n return () => query.removeEventListener(\"change\", notify);\n },\n () => typeof window.matchMedia === \"function\" && window.matchMedia(\"(max-width: 639px)\").matches,\n () => false,\n );\n}\n\nfunction Submenu({ children }: { children: React.ReactNode }) {\n const narrow = useNarrow();\n return (\n <AriaPopover\n {...useMotionAttribute()}\n data-slot=\"menu-submenu\"\n placement={narrow ? \"bottom end\" : \"end top\"}\n offset={narrow ? 2 : -4}\n crossOffset={narrow ? 0 : -4}\n className={cn(SURFACE, \"min-w-48 max-w-[min(22.5rem,calc(100vw-1.5rem))]\")}\n >\n <AriaMenu data-slot=\"menu-list\" className={cn(SCROLL, \"p-ds-050 outline-hidden\")}>\n {children}\n </AriaMenu>\n </AriaPopover>\n );\n}\n\n/** Groups in order, separators between them, the destructive items last after one more separator. */\nexport function MenuBody({ entries }: { entries: readonly MenuEntry[] }) {\n const { groups, danger } = layout(entries);\n return (\n <>\n {groups.map((group, index) => (\n <React.Fragment key={group.kind === \"section\" ? String(group.section.id) : group.key}>\n {index > 0 && <MenuSeparator />}\n {group.kind === \"section\" ? (\n <MenuSection id={group.section.id} title={group.section.title}>\n {group.items.map((item) => <Item key={String(item.id)} item={item} />)}\n </MenuSection>\n ) : (\n group.items.map((item) => <Item key={String(item.id)} item={item} />)\n )}\n </React.Fragment>\n ))}\n {danger.length > 0 && groups.length > 0 && <MenuSeparator />}\n {danger.map((item) => <Item key={String(item.id)} item={item} />)}\n </>\n );\n}\n\nfunction Item({ item }: { item: MenuItemDef }) {\n const row = { id: item.id, textValue: item.label, icon: item.icon, shortcut: item.shortcut, isDisabled: item.isDisabled, tone: item.tone, href: item.href, lang: item.lang };\n if (!item.children) return <ItemRow {...row}>{item.label}</ItemRow>;\n return (\n <SubmenuTrigger>\n <ItemRow {...row} hasSubmenu>\n {item.label}\n </ItemRow>\n <Submenu>\n <MenuBody entries={item.children} />\n </Submenu>\n </SubmenuTrigger>\n );\n}\n\ntype ItemRowProps = Omit<MenuItemProps, \"textValue\"> & { textValue: string; hasSubmenu?: boolean };\n\n/** One 32px row: a check when the menu selects, an icon, the label, then a shortcut or a submenu chevron. */\nfunction ItemRow({ id, children, textValue, icon, shortcut, isDisabled, tone, href, lang, hasSubmenu }: ItemRowProps) {\n return (\n <AriaMenuItem\n id={id}\n textValue={textValue}\n isDisabled={isDisabled}\n href={href}\n data-slot=\"menu-item\"\n data-tone={tone}\n className={cn(ITEM, tone === \"danger\" && \"text-ds-text-danger\")}\n >\n {({ isSelected, selectionMode }) => (\n <>\n {selectionMode !== \"none\" && (\n <span data-slot=\"menu-item-check\" className=\"grid size-4 shrink-0 place-items-center\">\n {isSelected && <IconGlyph name=\"check\" size=\"small\" />}\n </span>\n )}\n {icon && (\n <IconGlyph\n name={icon}\n size=\"small\"\n data-slot=\"menu-item-icon\"\n className={cn(tone === \"danger\" ? \"text-ds-icon-danger\" : \"text-ds-icon-subtle\", \"group-data-[disabled]:text-ds-text-disabled\")}\n />\n )}\n <span data-slot=\"menu-item-label\" lang={lang} className=\"min-w-0 flex-1 truncate\">{children}</span>\n {shortcut && (\n <Keyboard data-slot=\"menu-item-shortcut\" className=\"font-ds-mono text-code text-ds-text-subtlest\">{shortcut}</Keyboard>\n )}\n {hasSubmenu && <IconGlyph name=\"chevron-right\" size=\"small\" data-slot=\"menu-item-submenu\" className=\"text-ds-icon-subtle\" />}\n </>\n )}\n </AriaMenuItem>\n );\n}\n\n// ---- Composed from parts ---------------------------------------------------------------------------------------\n\nexport type MenuItemProps = {\n id: Key;\n /** The label: a verb (\"Edit\"). It may hold more than text (an avatar, two lines); then give `textValue`. */\n children: React.ReactNode;\n /** The words typing jumps to; the label itself when it is plain text. */\n textValue?: string;\n icon?: IconName;\n /** Shown in mono at the end (\"E\"). */\n shortcut?: string;\n isDisabled?: boolean;\n /** `danger` for the destructive action; put it last, after a `MenuSeparator`. */\n tone?: \"danger\";\n /** Makes the item a link; it goes through the host router. */\n href?: string;\n /** The language of the label, when it differs from the page. */\n lang?: string;\n};\n\nfunction textOf(children: React.ReactNode, textValue: string | undefined, part: string): string {\n if (textValue !== undefined) return textValue;\n if (typeof children === \"string\" || typeof children === \"number\") return String(children);\n if (process.env.NODE_ENV !== \"production\") console.warn(`${part}: give textValue when the label is not plain text, so typing can jump to it.`);\n return \"\";\n}\n\n/** One action in a Menu or ContextMenu composed from parts. */\nexport function MenuItem({ children, textValue, ...rest }: MenuItemProps) {\n return (\n <ItemRow {...rest} textValue={textOf(children, textValue, \"MenuItem\")}>\n {children}\n </ItemRow>\n );\n}\n\nexport type MenuSectionProps = {\n id?: Key;\n /** The section's title (\"Share\"); it names the group. */\n title: string;\n /** `MenuItem`s and `MenuSubmenu`s. */\n children: React.ReactNode;\n};\n\n/** A titled group of items. */\nexport function MenuSection({ id, title, children }: MenuSectionProps) {\n return (\n <AriaMenuSection data-slot=\"menu-section\" id={id}>\n <Header data-slot=\"menu-section-title\" className=\"px-ds-100 pt-ds-100 pb-ds-050 text-heading-xxsmall text-ds-text-subtle\">\n {title}\n </Header>\n {children}\n </AriaMenuSection>\n );\n}\n\nexport type MenuSubmenuProps = Omit<MenuItemProps, \"href\" | \"children\" | \"textValue\" | \"tone\"> & {\n /** The item that opens the submenu (\"Move to\"). */\n label: string;\n /** The submenu's `MenuItem`s. */\n children: React.ReactNode;\n};\n\n/** An item that opens a submenu: on hover and on → (← in RTL); under the item on phones. */\nexport function MenuSubmenu({ label, children, ...rest }: MenuSubmenuProps) {\n return (\n <SubmenuTrigger>\n <ItemRow {...rest} textValue={label} hasSubmenu>\n {label}\n </ItemRow>\n <Submenu>{children}</Submenu>\n </SubmenuTrigger>\n );\n}\n\n/**\n * The actions for an object behind a trigger: the row \"…\" menu, the account menu. 32px items with an icon,\n * a label and a shortcut or a submenu chevron; the destructive action last, after a separator. Anchored to\n * its trigger on every viewport and in RTL. Arrows move, typing jumps, Home/End go to the ends,\n * Enter acts, Esc closes and returns focus to the trigger. Choosing a value is a Select, not a Menu.\n */\nfunction MenuRoot({\n trigger, items, children, onAction, disabledKeys, placement = \"bottom end\", selectionMode = \"none\", selectedKeys, defaultSelectedKeys,\n onSelectionChange, isOpen, onOpenChange, \"aria-label\": ariaLabel,\n}: MenuProps) {\n return (\n <MenuTrigger isOpen={isOpen} onOpenChange={onOpenChange}>\n {trigger}\n <AriaPopover {...useMotionAttribute()} data-slot=\"menu-popover\" placement={placement} offset={4} className={cn(SURFACE, \"min-w-60 max-w-90\")}>\n <AriaMenu\n aria-label={ariaLabel}\n onAction={onAction}\n disabledKeys={disabledKeys}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n data-slot=\"menu\"\n className={cn(SCROLL, \"p-ds-050 outline-hidden\")}\n >\n {items ? <MenuBody entries={items} /> : children}\n </AriaMenu>\n </AriaPopover>\n </MenuTrigger>\n );\n}\n\n/** Popover with its own `motion` (auto, reduce or none); see PopoverBody for the component itself. */\nexport function Popover({ motion, ...props }: PopoverProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <PopoverBody {...(props as PopoverProps)} />\n </MotionScope>\n );\n}\n\n/** Menu with its own `motion` (auto, reduce or none); see MenuRoot for the component itself. */\nexport function Menu({ motion, ...props }: MenuProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <MenuRoot {...(props as MenuProps)} />\n </MotionScope>\n );\n}\n\n/** Tooltip with its own `motion` (auto, reduce or none); see TooltipBody for the component itself. */\nexport function Tooltip({ motion, ...props }: TooltipProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <TooltipBody {...(props as TooltipProps)} />\n </MotionScope>\n );\n}\n\n/* ── ContextMenu ─────────────────────────────────────────────────────────── */\n"]}
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { type Placement } from "react-aria-components";
3
+ export type HoverCardProps = {
4
+ /** A link (or a focusable element) whose preview the card shows: a person's name, a record reference. */
5
+ trigger: React.ReactElement;
6
+ /** The preview: an avatar and a line about the person, a record's key fields. Supplementary, never essential. */
7
+ children: React.ReactNode;
8
+ /** Before it opens (ms); default 500, so moving across the page does not flash cards. */
9
+ openDelay?: number;
10
+ /** Before it closes after the pointer leaves (ms); default 200, enough to reach the card. */
11
+ closeDelay?: number;
12
+ placement?: Placement;
13
+ };
14
+ /**
15
+ * A preview card that opens when the pointer rests on its trigger, or the trigger gets keyboard focus, and stays
16
+ * while the pointer is over the card. Esc closes it. The trigger must make sense without it (a link to the full
17
+ * page), since touch screens and screen readers may never see the card.
18
+ */
19
+ export declare function HoverCard({ trigger, children, openDelay, closeDelay, placement }: HoverCardProps): React.JSX.Element;
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Popover as AriaPopover } from "react-aria-components";
5
+ import { cn } from "../utils.js";
6
+ import { useMotionAttribute } from "../defaults.js";
7
+ import { SURFACE } from "./floating.js";
8
+ /**
9
+ * A preview card that opens when the pointer rests on its trigger, or the trigger gets keyboard focus, and stays
10
+ * while the pointer is over the card. Esc closes it. The trigger must make sense without it (a link to the full
11
+ * page), since touch screens and screen readers may never see the card.
12
+ */
13
+ export function HoverCard({ trigger, children, openDelay = 500, closeDelay = 200, placement = "bottom" }) {
14
+ const [isOpen, setOpen] = React.useState(false);
15
+ const ref = React.useRef(null);
16
+ const timer = React.useRef(undefined);
17
+ const motion = useMotionAttribute();
18
+ const schedule = (open) => {
19
+ window.clearTimeout(timer.current);
20
+ timer.current = window.setTimeout(() => setOpen(open), open ? openDelay : closeDelay);
21
+ };
22
+ React.useEffect(() => () => window.clearTimeout(timer.current), []);
23
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: ref, "data-slot": "hover-card-trigger", className: "inline-flex", onPointerEnter: (event) => event.pointerType !== "touch" && schedule(true), onPointerLeave: (event) => event.pointerType !== "touch" && schedule(false), onFocus: () => schedule(true), onBlur: () => schedule(false), onKeyDown: (event) => {
24
+ if (event.key === "Escape")
25
+ setOpen(false);
26
+ }, children: trigger }), _jsx(AriaPopover, { ...motion, triggerRef: ref, isOpen: isOpen, onOpenChange: setOpen, isNonModal: true, placement: placement, offset: 8, "data-slot": "hover-card", className: cn(SURFACE, "w-80 max-w-[calc(100vw-2rem)] p-ds-200"), children: _jsx("div", { onPointerEnter: () => window.clearTimeout(timer.current), onPointerLeave: () => schedule(false), onKeyDown: (event) => {
27
+ if (event.key === "Escape")
28
+ setOpen(false);
29
+ }, children: children }) })] }));
30
+ }
31
+ //# sourceMappingURL=hover-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover-card.js","sourceRoot":"","sources":["../../src/overlay/hover-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAkB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAcrC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EAAE,SAAS,GAAG,QAAQ,EAAkB;IACtH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAkB,IAAI,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAqB,SAAS,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAA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AAwC,CAAC,YAEhE,cACE,cAAc,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EACxD,cAAc,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACrC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;wBACnB,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ;4BAAE,OAAO,CAAC,KAAK,CAAC,CAAC;oBAC7C,CAAC,YAEA,QAAQ,GACL,GACM,IACb,CACJ,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Popover as AriaPopover, type Placement } from \"react-aria-components\";\nimport { cn } from \"../utils\";\nimport { useMotionAttribute } from \"../defaults\";\nimport { SURFACE } from \"./floating\";\n\nexport type HoverCardProps = {\n /** A link (or a focusable element) whose preview the card shows: a person's name, a record reference. */\n trigger: React.ReactElement;\n /** The preview: an avatar and a line about the person, a record's key fields. Supplementary, never essential. */\n children: React.ReactNode;\n /** Before it opens (ms); default 500, so moving across the page does not flash cards. */\n openDelay?: number;\n /** Before it closes after the pointer leaves (ms); default 200, enough to reach the card. */\n closeDelay?: number;\n placement?: Placement;\n};\n\n/**\n * A preview card that opens when the pointer rests on its trigger, or the trigger gets keyboard focus, and stays\n * while the pointer is over the card. Esc closes it. The trigger must make sense without it (a link to the full\n * page), since touch screens and screen readers may never see the card.\n */\nexport function HoverCard({ trigger, children, openDelay = 500, closeDelay = 200, placement = \"bottom\" }: HoverCardProps) {\n const [isOpen, setOpen] = React.useState(false);\n const ref = React.useRef<HTMLSpanElement>(null);\n const timer = React.useRef<number | undefined>(undefined);\n const motion = useMotionAttribute();\n const schedule = (open: boolean) => {\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => setOpen(open), open ? openDelay : closeDelay);\n };\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n return (\n <>\n <span\n ref={ref}\n data-slot=\"hover-card-trigger\"\n className=\"inline-flex\"\n onPointerEnter={(event) => event.pointerType !== \"touch\" && schedule(true)}\n onPointerLeave={(event) => event.pointerType !== \"touch\" && schedule(false)}\n onFocus={() => schedule(true)}\n onBlur={() => schedule(false)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") setOpen(false);\n }}\n >\n {trigger}\n </span>\n <AriaPopover\n {...motion}\n triggerRef={ref}\n isOpen={isOpen}\n onOpenChange={setOpen}\n isNonModal\n placement={placement}\n offset={8}\n data-slot=\"hover-card\"\n className={cn(SURFACE, \"w-80 max-w-[calc(100vw-2rem)] p-ds-200\")}\n >\n <div\n onPointerEnter={() => window.clearTimeout(timer.current)}\n onPointerLeave={() => schedule(false)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") setOpen(false);\n }}\n >\n {children}\n </div>\n </AriaPopover>\n </>\n );\n}\n"]}
@@ -0,0 +1,18 @@
1
+ export { DialogTrigger } from "./overlay-base.js";
2
+ export type { OverlaySize } from "./overlay-base.js";
3
+ export { Dialog, useDialogClose } from "./dialog.js";
4
+ export type { DialogAction, DialogProps } from "./dialog.js";
5
+ export { AlertDialog } from "./alert-dialog.js";
6
+ export type { AlertDialogProps } from "./alert-dialog.js";
7
+ export { Drawer, useDrawerClose } from "./drawer.js";
8
+ export type { DrawerClose, DrawerPosition, DrawerProps } from "./drawer.js";
9
+ export { Menu, MenuItem, MenuSection, MenuSeparator, MenuSubmenu, Popover, Tooltip } from "./floating.js";
10
+ export type { MenuEntry, MenuItemDef, MenuItemProps, MenuProps, MenuSectionDef, MenuSectionProps, MenuSubmenuProps, PopoverProps, TooltipProps } from "./floating.js";
11
+ export { ContextMenu, ContextMenuTrigger } from "./context-menu.js";
12
+ export type { ContextMenuProps, ContextMenuTriggerProps } from "./context-menu.js";
13
+ export { HoverCard } from "./hover-card.js";
14
+ export type { HoverCardProps } from "./hover-card.js";
15
+ export { Command } from "./command.js";
16
+ export type { CommandGroup, CommandItem, CommandProps } from "./command.js";
17
+ export { Toaster, toast } from "./toast.js";
18
+ export type { ToastOptions, ToastPromiseMessages, ToastTone } from "./toast.js";
@@ -0,0 +1,12 @@
1
+ // @senvenli/react/overlay: Dialog, AlertDialog, Drawer and DialogTrigger; Popover, Tooltip, Menu, ContextMenu and HoverCard;
2
+ // Command, Toaster and toast(). Each is built on React Aria Components.
3
+ export { DialogTrigger } from "./overlay-base.js";
4
+ export { Dialog, useDialogClose } from "./dialog.js";
5
+ export { AlertDialog } from "./alert-dialog.js";
6
+ export { Drawer, useDrawerClose } from "./drawer.js";
7
+ export { Menu, MenuItem, MenuSection, MenuSeparator, MenuSubmenu, Popover, Tooltip } from "./floating.js";
8
+ export { ContextMenu, ContextMenuTrigger } from "./context-menu.js";
9
+ export { HoverCard } from "./hover-card.js";
10
+ export { Command } from "./command.js";
11
+ export { Toaster, toast } from "./toast.js";
12
+ //# sourceMappingURL=index.js.map