@ember-joinery/primitives 0.0.0-stage → 1.0.1

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 (485) hide show
  1. package/CHANGELOG.md +472 -0
  2. package/LICENSE.md +9 -0
  3. package/NOTICE +532 -0
  4. package/README.md +11 -2
  5. package/addon-main.cjs +4 -0
  6. package/declarations/-private/combobox-list.d.ts +59 -0
  7. package/declarations/-private/combobox-list.d.ts.map +1 -0
  8. package/declarations/-private/command-score.d.ts +33 -0
  9. package/declarations/-private/command-score.d.ts.map +1 -0
  10. package/declarations/-private/delay-group.d.ts +47 -0
  11. package/declarations/-private/delay-group.d.ts.map +1 -0
  12. package/declarations/-private/dialog.d.ts +180 -0
  13. package/declarations/-private/dialog.d.ts.map +1 -0
  14. package/declarations/-private/form-control.d.ts +70 -0
  15. package/declarations/-private/form-control.d.ts.map +1 -0
  16. package/declarations/-private/form-data.d.ts +14 -0
  17. package/declarations/-private/form-data.d.ts.map +1 -0
  18. package/declarations/-private/hover-intent.d.ts +48 -0
  19. package/declarations/-private/hover-intent.d.ts.map +1 -0
  20. package/declarations/-private/image-loading.d.ts +77 -0
  21. package/declarations/-private/image-loading.d.ts.map +1 -0
  22. package/declarations/-private/indicator.d.ts +27 -0
  23. package/declarations/-private/indicator.d.ts.map +1 -0
  24. package/declarations/-private/instances.d.ts +11 -0
  25. package/declarations/-private/instances.d.ts.map +1 -0
  26. package/declarations/-private/layout-styles.d.ts +34 -0
  27. package/declarations/-private/layout-styles.d.ts.map +1 -0
  28. package/declarations/-private/menu.d.ts +616 -0
  29. package/declarations/-private/menu.d.ts.map +1 -0
  30. package/declarations/-private/observers.d.ts +35 -0
  31. package/declarations/-private/observers.d.ts.map +1 -0
  32. package/declarations/-private/popper.d.ts +149 -0
  33. package/declarations/-private/popper.d.ts.map +1 -0
  34. package/declarations/-private/presence-chart.d.ts +39 -0
  35. package/declarations/-private/presence-chart.d.ts.map +1 -0
  36. package/declarations/-private/promise-state.d.ts +41 -0
  37. package/declarations/-private/promise-state.d.ts.map +1 -0
  38. package/declarations/-private/scroll-end.d.ts +16 -0
  39. package/declarations/-private/scroll-end.d.ts.map +1 -0
  40. package/declarations/-private/scroll-visibility.d.ts +68 -0
  41. package/declarations/-private/scroll-visibility.d.ts.map +1 -0
  42. package/declarations/-private/toast.d.ts +119 -0
  43. package/declarations/-private/toast.d.ts.map +1 -0
  44. package/declarations/-private/typeahead-search.d.ts +29 -0
  45. package/declarations/-private/typeahead-search.d.ts.map +1 -0
  46. package/declarations/accordion.d.ts +284 -0
  47. package/declarations/accordion.d.ts.map +1 -0
  48. package/declarations/alert-dialog.d.ts +80 -0
  49. package/declarations/alert-dialog.d.ts.map +1 -0
  50. package/declarations/anchor/component.d.ts +63 -0
  51. package/declarations/anchor/component.d.ts.map +1 -0
  52. package/declarations/anchor/index.d.ts +7 -0
  53. package/declarations/anchor/index.d.ts.map +1 -0
  54. package/declarations/anchor/middleware.d.ts +46 -0
  55. package/declarations/anchor/middleware.d.ts.map +1 -0
  56. package/declarations/anchor/modifier.d.ts +34 -0
  57. package/declarations/anchor/modifier.d.ts.map +1 -0
  58. package/declarations/anchor/options.d.ts +112 -0
  59. package/declarations/anchor/options.d.ts.map +1 -0
  60. package/declarations/anchor/position.d.ts +36 -0
  61. package/declarations/anchor/position.d.ts.map +1 -0
  62. package/declarations/anchor.d.ts +2 -0
  63. package/declarations/as.d.ts +33 -0
  64. package/declarations/as.d.ts.map +1 -0
  65. package/declarations/aspect-ratio.d.ts +34 -0
  66. package/declarations/aspect-ratio.d.ts.map +1 -0
  67. package/declarations/avatar.d.ts +178 -0
  68. package/declarations/avatar.d.ts.map +1 -0
  69. package/declarations/body-class.d.ts +30 -0
  70. package/declarations/body-class.d.ts.map +1 -0
  71. package/declarations/breadcrumb.d.ts +64 -0
  72. package/declarations/breadcrumb.d.ts.map +1 -0
  73. package/declarations/calendar/dates.d.ts +142 -0
  74. package/declarations/calendar/dates.d.ts.map +1 -0
  75. package/declarations/calendar/index.d.ts +59 -0
  76. package/declarations/calendar/index.d.ts.map +1 -0
  77. package/declarations/calendar/state.d.ts +415 -0
  78. package/declarations/calendar/state.d.ts.map +1 -0
  79. package/declarations/calendar.d.ts +3 -0
  80. package/declarations/checkbox.d.ts +71 -0
  81. package/declarations/checkbox.d.ts.map +1 -0
  82. package/declarations/collapsible.d.ts +216 -0
  83. package/declarations/collapsible.d.ts.map +1 -0
  84. package/declarations/color-scheme.d.ts +115 -0
  85. package/declarations/color-scheme.d.ts.map +1 -0
  86. package/declarations/combobox.d.ts +569 -0
  87. package/declarations/combobox.d.ts.map +1 -0
  88. package/declarations/command.d.ts +410 -0
  89. package/declarations/command.d.ts.map +1 -0
  90. package/declarations/context-menu.d.ts +155 -0
  91. package/declarations/context-menu.d.ts.map +1 -0
  92. package/declarations/controllable-state.d.ts +85 -0
  93. package/declarations/controllable-state.d.ts.map +1 -0
  94. package/declarations/dialog.d.ts +80 -0
  95. package/declarations/dialog.d.ts.map +1 -0
  96. package/declarations/direction.d.ts +55 -0
  97. package/declarations/direction.d.ts.map +1 -0
  98. package/declarations/dismiss.d.ts +111 -0
  99. package/declarations/dismiss.d.ts.map +1 -0
  100. package/declarations/dom-context.d.ts +74 -0
  101. package/declarations/dom-context.d.ts.map +1 -0
  102. package/declarations/drawer/controller.d.ts +174 -0
  103. package/declarations/drawer/controller.d.ts.map +1 -0
  104. package/declarations/drawer/index.d.ts +105 -0
  105. package/declarations/drawer/index.d.ts.map +1 -0
  106. package/declarations/drawer/machine.d.ts +139 -0
  107. package/declarations/drawer/machine.d.ts.map +1 -0
  108. package/declarations/drawer/parts.d.ts +85 -0
  109. package/declarations/drawer/parts.d.ts.map +1 -0
  110. package/declarations/drawer.d.ts +2 -0
  111. package/declarations/dropdown-menu.d.ts +169 -0
  112. package/declarations/dropdown-menu.d.ts.map +1 -0
  113. package/declarations/external-link.d.ts +26 -0
  114. package/declarations/external-link.d.ts.map +1 -0
  115. package/declarations/file-drop.d.ts +119 -0
  116. package/declarations/file-drop.d.ts.map +1 -0
  117. package/declarations/focus-scope.d.ts +105 -0
  118. package/declarations/focus-scope.d.ts.map +1 -0
  119. package/declarations/focus.d.ts +114 -0
  120. package/declarations/focus.d.ts.map +1 -0
  121. package/declarations/head.d.ts +20 -0
  122. package/declarations/head.d.ts.map +1 -0
  123. package/declarations/heading.d.ts +59 -0
  124. package/declarations/heading.d.ts.map +1 -0
  125. package/declarations/hero.d.ts +32 -0
  126. package/declarations/hero.d.ts.map +1 -0
  127. package/declarations/hide-others.d.ts +35 -0
  128. package/declarations/hide-others.d.ts.map +1 -0
  129. package/declarations/hover-card.d.ts +148 -0
  130. package/declarations/hover-card.d.ts.map +1 -0
  131. package/declarations/i18n.d.ts +47 -0
  132. package/declarations/i18n.d.ts.map +1 -0
  133. package/declarations/id.d.ts +15 -0
  134. package/declarations/id.d.ts.map +1 -0
  135. package/declarations/iframe.d.ts +12 -0
  136. package/declarations/iframe.d.ts.map +1 -0
  137. package/declarations/incremental-each.d.ts +81 -0
  138. package/declarations/incremental-each.d.ts.map +1 -0
  139. package/declarations/index.d.ts +108 -0
  140. package/declarations/index.d.ts.map +1 -0
  141. package/declarations/input-otp.d.ts +201 -0
  142. package/declarations/input-otp.d.ts.map +1 -0
  143. package/declarations/keys.d.ts +50 -0
  144. package/declarations/keys.d.ts.map +1 -0
  145. package/declarations/label.d.ts +36 -0
  146. package/declarations/label.d.ts.map +1 -0
  147. package/declarations/layer.d.ts +56 -0
  148. package/declarations/layer.d.ts.map +1 -0
  149. package/declarations/link-helper.d.ts +73 -0
  150. package/declarations/link-helper.d.ts.map +1 -0
  151. package/declarations/link.d.ts +60 -0
  152. package/declarations/link.d.ts.map +1 -0
  153. package/declarations/load.d.ts +47 -0
  154. package/declarations/load.d.ts.map +1 -0
  155. package/declarations/menubar.d.ts +231 -0
  156. package/declarations/menubar.d.ts.map +1 -0
  157. package/declarations/message-scroller/components.d.ts +229 -0
  158. package/declarations/message-scroller/components.d.ts.map +1 -0
  159. package/declarations/message-scroller/geometry.d.ts +95 -0
  160. package/declarations/message-scroller/geometry.d.ts.map +1 -0
  161. package/declarations/message-scroller/index.d.ts +4 -0
  162. package/declarations/message-scroller/index.d.ts.map +1 -0
  163. package/declarations/message-scroller/state.d.ts +124 -0
  164. package/declarations/message-scroller/state.d.ts.map +1 -0
  165. package/declarations/message-scroller.d.ts +2 -0
  166. package/declarations/messages.d.ts +166 -0
  167. package/declarations/messages.d.ts.map +1 -0
  168. package/declarations/narrowing.d.ts +24 -0
  169. package/declarations/narrowing.d.ts.map +1 -0
  170. package/declarations/native-form.d.ts +56 -0
  171. package/declarations/native-form.d.ts.map +1 -0
  172. package/declarations/native-value.d.ts +47 -0
  173. package/declarations/native-value.d.ts.map +1 -0
  174. package/declarations/navigation-menu.d.ts +406 -0
  175. package/declarations/navigation-menu.d.ts.map +1 -0
  176. package/declarations/on-resize.d.ts +32 -0
  177. package/declarations/on-resize.d.ts.map +1 -0
  178. package/declarations/part.d.ts +99 -0
  179. package/declarations/part.d.ts.map +1 -0
  180. package/declarations/popover.d.ts +236 -0
  181. package/declarations/popover.d.ts.map +1 -0
  182. package/declarations/portal/index.d.ts +3 -0
  183. package/declarations/portal/index.d.ts.map +1 -0
  184. package/declarations/portal/portal.d.ts +46 -0
  185. package/declarations/portal/portal.d.ts.map +1 -0
  186. package/declarations/portal/targets.d.ts +40 -0
  187. package/declarations/portal/targets.d.ts.map +1 -0
  188. package/declarations/portal.d.ts +2 -0
  189. package/declarations/presence.d.ts +80 -0
  190. package/declarations/presence.d.ts.map +1 -0
  191. package/declarations/progress.d.ts +98 -0
  192. package/declarations/progress.d.ts.map +1 -0
  193. package/declarations/proper-links.d.ts +69 -0
  194. package/declarations/proper-links.d.ts.map +1 -0
  195. package/declarations/qp.d.ts +55 -0
  196. package/declarations/qp.d.ts.map +1 -0
  197. package/declarations/questionnaire/components.d.ts +348 -0
  198. package/declarations/questionnaire/components.d.ts.map +1 -0
  199. package/declarations/questionnaire/index.d.ts +4 -0
  200. package/declarations/questionnaire/index.d.ts.map +1 -0
  201. package/declarations/questionnaire/state.d.ts +400 -0
  202. package/declarations/questionnaire/state.d.ts.map +1 -0
  203. package/declarations/questionnaire/utils.d.ts +65 -0
  204. package/declarations/questionnaire/utils.d.ts.map +1 -0
  205. package/declarations/questionnaire.d.ts +2 -0
  206. package/declarations/radio-group.d.ts +115 -0
  207. package/declarations/radio-group.d.ts.map +1 -0
  208. package/declarations/rating.d.ts +214 -0
  209. package/declarations/rating.d.ts.map +1 -0
  210. package/declarations/resizable/components.d.ts +107 -0
  211. package/declarations/resizable/components.d.ts.map +1 -0
  212. package/declarations/resizable/index.d.ts +4 -0
  213. package/declarations/resizable/index.d.ts.map +1 -0
  214. package/declarations/resizable/layout.d.ts +93 -0
  215. package/declarations/resizable/layout.d.ts.map +1 -0
  216. package/declarations/resizable/state.d.ts +211 -0
  217. package/declarations/resizable/state.d.ts.map +1 -0
  218. package/declarations/resizable.d.ts +2 -0
  219. package/declarations/resize-observer.d.ts +40 -0
  220. package/declarations/resize-observer.d.ts.map +1 -0
  221. package/declarations/roving-focus.d.ts +204 -0
  222. package/declarations/roving-focus.d.ts.map +1 -0
  223. package/declarations/scroll-area/components.d.ts +125 -0
  224. package/declarations/scroll-area/components.d.ts.map +1 -0
  225. package/declarations/scroll-area/index.d.ts +3 -0
  226. package/declarations/scroll-area/index.d.ts.map +1 -0
  227. package/declarations/scroll-area/state.d.ts +147 -0
  228. package/declarations/scroll-area/state.d.ts.map +1 -0
  229. package/declarations/scroll-area.d.ts +2 -0
  230. package/declarations/scroll-lock.d.ts +69 -0
  231. package/declarations/scroll-lock.d.ts.map +1 -0
  232. package/declarations/scroller.d.ts +71 -0
  233. package/declarations/scroller.d.ts.map +1 -0
  234. package/declarations/select.d.ts +459 -0
  235. package/declarations/select.d.ts.map +1 -0
  236. package/declarations/separator.d.ts +71 -0
  237. package/declarations/separator.d.ts.map +1 -0
  238. package/declarations/service.d.ts +83 -0
  239. package/declarations/service.d.ts.map +1 -0
  240. package/declarations/shadowed.d.ts +63 -0
  241. package/declarations/shadowed.d.ts.map +1 -0
  242. package/declarations/slider.d.ts +283 -0
  243. package/declarations/slider.d.ts.map +1 -0
  244. package/declarations/sticky-footer.d.ts +43 -0
  245. package/declarations/sticky-footer.d.ts.map +1 -0
  246. package/declarations/store.d.ts +47 -0
  247. package/declarations/store.d.ts.map +1 -0
  248. package/declarations/switch.d.ts +76 -0
  249. package/declarations/switch.d.ts.map +1 -0
  250. package/declarations/tabs.d.ts +250 -0
  251. package/declarations/tabs.d.ts.map +1 -0
  252. package/declarations/toast/icons.d.ts +29 -0
  253. package/declarations/toast/icons.d.ts.map +1 -0
  254. package/declarations/toast/index.d.ts +4 -0
  255. package/declarations/toast/index.d.ts.map +1 -0
  256. package/declarations/toast/item.d.ts +162 -0
  257. package/declarations/toast/item.d.ts.map +1 -0
  258. package/declarations/toast/state.d.ts +276 -0
  259. package/declarations/toast/state.d.ts.map +1 -0
  260. package/declarations/toast/styles.d.ts +20 -0
  261. package/declarations/toast/styles.d.ts.map +1 -0
  262. package/declarations/toast/toaster.d.ts +173 -0
  263. package/declarations/toast/toaster.d.ts.map +1 -0
  264. package/declarations/toast.d.ts +2 -0
  265. package/declarations/toggle-group.d.ts +161 -0
  266. package/declarations/toggle-group.d.ts.map +1 -0
  267. package/declarations/toggle.d.ts +70 -0
  268. package/declarations/toggle.d.ts.map +1 -0
  269. package/declarations/tooltip.d.ts +227 -0
  270. package/declarations/tooltip.d.ts.map +1 -0
  271. package/declarations/typeahead.d.ts +97 -0
  272. package/declarations/typeahead.d.ts.map +1 -0
  273. package/declarations/viewport.d.ts +109 -0
  274. package/declarations/viewport.d.ts.map +1 -0
  275. package/declarations/visually-hidden.d.ts +42 -0
  276. package/declarations/visually-hidden.d.ts.map +1 -0
  277. package/declarations/zoetrope.d.ts +120 -0
  278. package/declarations/zoetrope.d.ts.map +1 -0
  279. package/dist/accordion.js +367 -0
  280. package/dist/accordion.js.map +1 -0
  281. package/dist/alert-dialog.js +122 -0
  282. package/dist/alert-dialog.js.map +1 -0
  283. package/dist/anchor.js +2 -0
  284. package/dist/anchor.js.map +1 -0
  285. package/dist/as.js +60 -0
  286. package/dist/as.js.map +1 -0
  287. package/dist/aspect-ratio.js +59 -0
  288. package/dist/aspect-ratio.js.map +1 -0
  289. package/dist/avatar.js +464 -0
  290. package/dist/avatar.js.map +1 -0
  291. package/dist/body-class.js +57 -0
  292. package/dist/body-class.js.map +1 -0
  293. package/dist/breadcrumb.js +59 -0
  294. package/dist/breadcrumb.js.map +1 -0
  295. package/dist/calendar.js +1494 -0
  296. package/dist/calendar.js.map +1 -0
  297. package/dist/checkbox.js +81 -0
  298. package/dist/checkbox.js.map +1 -0
  299. package/dist/collapsible.js +255 -0
  300. package/dist/collapsible.js.map +1 -0
  301. package/dist/color-scheme.js +306 -0
  302. package/dist/color-scheme.js.map +1 -0
  303. package/dist/combobox.js +1413 -0
  304. package/dist/combobox.js.map +1 -0
  305. package/dist/command.js +1054 -0
  306. package/dist/command.js.map +1 -0
  307. package/dist/component-DqLt83fo.js +886 -0
  308. package/dist/component-DqLt83fo.js.map +1 -0
  309. package/dist/components-CWfg0cFs.js +1745 -0
  310. package/dist/components-CWfg0cFs.js.map +1 -0
  311. package/dist/components-DBWszEI3.js +1285 -0
  312. package/dist/components-DBWszEI3.js.map +1 -0
  313. package/dist/components-DI8Azu05.js +1542 -0
  314. package/dist/components-DI8Azu05.js.map +1 -0
  315. package/dist/components-F0Ini448.js +875 -0
  316. package/dist/components-F0Ini448.js.map +1 -0
  317. package/dist/context-menu.js +207 -0
  318. package/dist/context-menu.js.map +1 -0
  319. package/dist/controllable-state.js +134 -0
  320. package/dist/controllable-state.js.map +1 -0
  321. package/dist/delay-group-B1K03gBL.js +75 -0
  322. package/dist/delay-group-B1K03gBL.js.map +1 -0
  323. package/dist/dialog-3gfz_8NA.js +349 -0
  324. package/dist/dialog-3gfz_8NA.js.map +1 -0
  325. package/dist/dialog.js +57 -0
  326. package/dist/dialog.js.map +1 -0
  327. package/dist/direction.js +75 -0
  328. package/dist/direction.js.map +1 -0
  329. package/dist/dismiss.js +329 -0
  330. package/dist/dismiss.js.map +1 -0
  331. package/dist/dom-context.js +104 -0
  332. package/dist/dom-context.js.map +1 -0
  333. package/dist/drawer.js +1456 -0
  334. package/dist/drawer.js.map +1 -0
  335. package/dist/dropdown-menu.js +201 -0
  336. package/dist/dropdown-menu.js.map +1 -0
  337. package/dist/external-link.js +21 -0
  338. package/dist/external-link.js.map +1 -0
  339. package/dist/file-drop.js +183 -0
  340. package/dist/file-drop.js.map +1 -0
  341. package/dist/focus-scope.js +292 -0
  342. package/dist/focus-scope.js.map +1 -0
  343. package/dist/focus.js +307 -0
  344. package/dist/focus.js.map +1 -0
  345. package/dist/form-control-Ca_KHSKK.js +177 -0
  346. package/dist/form-control-Ca_KHSKK.js.map +1 -0
  347. package/dist/head.js +25 -0
  348. package/dist/head.js.map +1 -0
  349. package/dist/heading.js +152 -0
  350. package/dist/heading.js.map +1 -0
  351. package/dist/hero.js +36 -0
  352. package/dist/hero.js.map +1 -0
  353. package/dist/hide-others.js +108 -0
  354. package/dist/hide-others.js.map +1 -0
  355. package/dist/hover-card.js +246 -0
  356. package/dist/hover-card.js.map +1 -0
  357. package/dist/hover-intent-Bxb83fgX.js +92 -0
  358. package/dist/hover-intent-Bxb83fgX.js.map +1 -0
  359. package/dist/i18n.js +72 -0
  360. package/dist/i18n.js.map +1 -0
  361. package/dist/id.js +24 -0
  362. package/dist/id.js.map +1 -0
  363. package/dist/iframe.js +19 -0
  364. package/dist/iframe.js.map +1 -0
  365. package/dist/incremental-each.js +181 -0
  366. package/dist/incremental-each.js.map +1 -0
  367. package/dist/index.js +87 -0
  368. package/dist/index.js.map +1 -0
  369. package/dist/indicator-sYuRuFJA.js +26 -0
  370. package/dist/indicator-sYuRuFJA.js.map +1 -0
  371. package/dist/input-otp.js +611 -0
  372. package/dist/input-otp.js.map +1 -0
  373. package/dist/keys.js +65 -0
  374. package/dist/keys.js.map +1 -0
  375. package/dist/label.js +41 -0
  376. package/dist/label.js.map +1 -0
  377. package/dist/layer.js +157 -0
  378. package/dist/layer.js.map +1 -0
  379. package/dist/layout-styles-DY86so8a.js +81 -0
  380. package/dist/layout-styles-DY86so8a.js.map +1 -0
  381. package/dist/link-helper.js +122 -0
  382. package/dist/link-helper.js.map +1 -0
  383. package/dist/link.js +39 -0
  384. package/dist/link.js.map +1 -0
  385. package/dist/load.js +54 -0
  386. package/dist/load.js.map +1 -0
  387. package/dist/menu-Da1LFCet.js +1109 -0
  388. package/dist/menu-Da1LFCet.js.map +1 -0
  389. package/dist/menubar.js +357 -0
  390. package/dist/menubar.js.map +1 -0
  391. package/dist/message-scroller.js +2 -0
  392. package/dist/message-scroller.js.map +1 -0
  393. package/dist/messages.js +168 -0
  394. package/dist/messages.js.map +1 -0
  395. package/dist/narrowing.js +29 -0
  396. package/dist/narrowing.js.map +1 -0
  397. package/dist/native-form.js +134 -0
  398. package/dist/native-form.js.map +1 -0
  399. package/dist/native-value.js +125 -0
  400. package/dist/native-value.js.map +1 -0
  401. package/dist/navigation-menu.js +872 -0
  402. package/dist/navigation-menu.js.map +1 -0
  403. package/dist/observers-aItWe029.js +113 -0
  404. package/dist/observers-aItWe029.js.map +1 -0
  405. package/dist/on-resize.js +47 -0
  406. package/dist/on-resize.js.map +1 -0
  407. package/dist/part.js +291 -0
  408. package/dist/part.js.map +1 -0
  409. package/dist/popover.js +419 -0
  410. package/dist/popover.js.map +1 -0
  411. package/dist/popper-BbTzV8dP.js +323 -0
  412. package/dist/popper-BbTzV8dP.js.map +1 -0
  413. package/dist/portal-U554WDI9.js +214 -0
  414. package/dist/portal-U554WDI9.js.map +1 -0
  415. package/dist/portal.js +2 -0
  416. package/dist/portal.js.map +1 -0
  417. package/dist/presence.js +243 -0
  418. package/dist/presence.js.map +1 -0
  419. package/dist/progress.js +106 -0
  420. package/dist/progress.js.map +1 -0
  421. package/dist/promise-state-BMi2zVoT.js +91 -0
  422. package/dist/promise-state-BMi2zVoT.js.map +1 -0
  423. package/dist/proper-links.js +136 -0
  424. package/dist/proper-links.js.map +1 -0
  425. package/dist/qp.js +77 -0
  426. package/dist/qp.js.map +1 -0
  427. package/dist/questionnaire.js +2 -0
  428. package/dist/questionnaire.js.map +1 -0
  429. package/dist/radio-group.js +149 -0
  430. package/dist/radio-group.js.map +1 -0
  431. package/dist/rating.js +261 -0
  432. package/dist/rating.js.map +1 -0
  433. package/dist/resizable.js +2 -0
  434. package/dist/resizable.js.map +1 -0
  435. package/dist/resize-observer.js +85 -0
  436. package/dist/resize-observer.js.map +1 -0
  437. package/dist/roving-focus.js +355 -0
  438. package/dist/roving-focus.js.map +1 -0
  439. package/dist/scroll-area.js +2 -0
  440. package/dist/scroll-area.js.map +1 -0
  441. package/dist/scroll-end-Cer8JSIB.js +87 -0
  442. package/dist/scroll-end-Cer8JSIB.js.map +1 -0
  443. package/dist/scroll-lock.js +267 -0
  444. package/dist/scroll-lock.js.map +1 -0
  445. package/dist/scroller.js +117 -0
  446. package/dist/scroller.js.map +1 -0
  447. package/dist/select.js +1223 -0
  448. package/dist/select.js.map +1 -0
  449. package/dist/separator.js +80 -0
  450. package/dist/separator.js.map +1 -0
  451. package/dist/service.js +160 -0
  452. package/dist/service.js.map +1 -0
  453. package/dist/shadowed.js +70 -0
  454. package/dist/shadowed.js.map +1 -0
  455. package/dist/slider.js +586 -0
  456. package/dist/slider.js.map +1 -0
  457. package/dist/sticky-footer.js +40 -0
  458. package/dist/sticky-footer.js.map +1 -0
  459. package/dist/store-BjiAd-KP.js +93 -0
  460. package/dist/store-BjiAd-KP.js.map +1 -0
  461. package/dist/store.js +4 -0
  462. package/dist/store.js.map +1 -0
  463. package/dist/switch.js +58 -0
  464. package/dist/switch.js.map +1 -0
  465. package/dist/tabs.js +458 -0
  466. package/dist/tabs.js.map +1 -0
  467. package/dist/toast.js +2 -0
  468. package/dist/toast.js.map +1 -0
  469. package/dist/toaster-DwprFZ1J.js +1518 -0
  470. package/dist/toaster-DwprFZ1J.js.map +1 -0
  471. package/dist/toggle-group.js +221 -0
  472. package/dist/toggle-group.js.map +1 -0
  473. package/dist/toggle.js +78 -0
  474. package/dist/toggle.js.map +1 -0
  475. package/dist/tooltip.js +422 -0
  476. package/dist/tooltip.js.map +1 -0
  477. package/dist/typeahead.js +233 -0
  478. package/dist/typeahead.js.map +1 -0
  479. package/dist/viewport.js +138 -0
  480. package/dist/viewport.js.map +1 -0
  481. package/dist/visually-hidden.js +49 -0
  482. package/dist/visually-hidden.js.map +1 -0
  483. package/dist/zoetrope.js +336 -0
  484. package/dist/zoetrope.js.map +1 -0
  485. package/package.json +101 -3
@@ -0,0 +1,85 @@
1
+ /** The next value, or a function from the current value to the next. */
2
+ export type NextValue<T> = T | ((current: T) => T);
3
+ /** Where a `ControllableState` reads its inputs. Each is a function, so it reads them live. */
4
+ export interface ControllableStateOptions<T> {
5
+ /** The controlled value. While it returns anything but `undefined`, the caller owns the state. */
6
+ value: () => T | undefined;
7
+ /** The starting value when uncontrolled. Read once, the first time the state is read. */
8
+ defaultValue?: () => T | undefined;
9
+ /** Called with every new value, controlled or not. */
10
+ onChange?: () => ((value: T) => void) | undefined;
11
+ /** The value when there is neither a controlled value nor a default. */
12
+ fallback: T;
13
+ /** What the state is called in warnings, such as `open`. */
14
+ name?: string;
15
+ }
16
+ /**
17
+ * State that a component can own or hand to its caller, as Radix's components do. While the
18
+ * caller passes a value (`@open`, `@value`), the state is that value, and `set()` only tells the
19
+ * caller what it should become. Otherwise the state is the component's own, starting from the
20
+ * default (`@defaultOpen`, `@defaultValue`). Either way, `onChange` (`@onOpenChange`,
21
+ * `@onValueChange`) hears every change, and nothing is called when the value stays the same.
22
+ *
23
+ * open = new ControllableState({
24
+ * value: () => this.args.open,
25
+ * defaultValue: () => this.args.defaultOpen,
26
+ * onChange: () => this.args.onOpenChange,
27
+ * fallback: false,
28
+ * })
29
+ *
30
+ * this.open.value // read it (tracked)
31
+ * this.open.set(true) // ask for a change
32
+ * this.open.set(open => !open)
33
+ *
34
+ * `controllable(this, 'open', false)` builds the same thing from a component's arguments.
35
+ */
36
+ export declare class ControllableState<T> {
37
+ #private;
38
+ /** The component's own value, once `set()` has changed it while uncontrolled. */
39
+ private changed;
40
+ constructor(options: ControllableStateOptions<T>);
41
+ /** Whether the caller controls the state now (it passes a value that isn't `undefined`). */
42
+ get isControlled(): boolean;
43
+ /** The current value: the controlled value, or the component's own. */
44
+ get value(): T;
45
+ /**
46
+ * Asks for a new value. Uncontrolled, the state takes it. Controlled, the state stays as the
47
+ * caller passes it, so the caller decides. `onChange` is called with the new value either way,
48
+ * unless it equals the current one.
49
+ */
50
+ set(next: NextValue<T>): void;
51
+ }
52
+ type Capitalized<Name extends string> = Capitalize<Name>;
53
+ /**
54
+ * The arguments a controllable state named `Name` reads: `@<name>`, `@default<Name>` and
55
+ * `@on<Name>Change`, as in `@open`, `@defaultOpen` and `@onOpenChange`.
56
+ */
57
+ export type ControllableArgs<Name extends string, T> = {
58
+ readonly [K in Name]?: T;
59
+ } & {
60
+ readonly [K in `default${Capitalized<Name>}`]?: T;
61
+ } & {
62
+ readonly [K in `on${Capitalized<Name>}Change`]?: (value: T) => void;
63
+ };
64
+ /**
65
+ * A `ControllableState` read from a component's arguments, by the Radix naming pattern:
66
+ * `controllable(this, 'open', false)` reads `@open`, `@defaultOpen` and `@onOpenChange`;
67
+ * `controllable(this, 'value', '')` reads `@value`, `@defaultValue` and `@onValueChange`.
68
+ *
69
+ * class Disclosure extends Component<{ Args: ControllableArgs<'open', boolean> }> {
70
+ * open = controllable(this, 'open', false)
71
+ * toggle = () => this.open.set(open => !open)
72
+ * }
73
+ *
74
+ * The name must be one of the component's arguments, so a misspelling (`'opn'`) doesn't
75
+ * compile, and the state's type is that argument's.
76
+ *
77
+ * @param component anything with `args`, usually a Glimmer component
78
+ * @param name the controlled argument's name
79
+ * @param fallback the value when neither the argument nor its default is given
80
+ */
81
+ export declare function controllable<Args extends object, Name extends keyof Args & string>(component: {
82
+ readonly args: Args;
83
+ }, name: Name, fallback: NonNullable<Args[Name]>): ControllableState<NonNullable<Args[Name]>>;
84
+ export {};
85
+ //# sourceMappingURL=controllable-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controllable-state.d.ts","sourceRoot":"","sources":["../src/controllable-state.ts"],"names":[],"mappings":"AAIA,wEAAwE;AACxE,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AAElD,+FAA+F;AAC/F,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;IAC1B,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;IAClC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IACjD,wEAAwE;IACxE,QAAQ,EAAE,CAAC,CAAA;IACX,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,iBAAiB,CAAC,CAAC;;IAM9B,iFAAiF;IACxE,OAAO,CAAC,OAAO,CAA0B;gBAEtC,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAKhD,4FAA4F;IAC5F,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,uEAAuE;IACvE,IAAI,KAAK,IAAI,CAAC,CAGb;IAED;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI;CAqC9B;AAED,KAAK,WAAW,CAAC,IAAI,SAAS,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;AAExD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,SAAS,MAAM,EAAE,CAAC,IAAI;IACrD,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC;CACzB,GAAG;IACF,QAAQ,EAAE,CAAC,IAAI,UAAU,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;CAClD,GAAG;IACF,QAAQ,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI;CACpE,CAAA;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,IAAI,SAAS,MAAM,EAAE,IAAI,SAAS,MAAM,IAAI,GAAG,MAAM,EAChF,SAAS,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EAClC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAChC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAW5C"}
@@ -0,0 +1,80 @@
1
+ import Component from '@glimmer/component';
2
+ import type { WithBoundArgs } from '@glint/template';
3
+ import type { PartModifier } from './part.ts';
4
+ import { DialogClose, DialogContent, DialogController, DialogDescription, DialogOverlay, DialogTitle, DialogTrigger, type DialogArgs } from './-private/dialog';
5
+ export { DialogController, type DialogArgs, type DialogContentArgs, type DialogRole, type InteractOutsideEvent, } from './-private/dialog';
6
+ /** What a `<Dialog>` yields: its parts, their modifiers, and its state. */
7
+ export interface DialogBlockParams {
8
+ /** A `<button>` that opens and closes it (`@as` for another tag). */
9
+ Trigger: WithBoundArgs<typeof DialogTrigger, 'part'>;
10
+ /** What covers the page behind a modal dialog. A non-modal dialog renders none. */
11
+ Overlay: WithBoundArgs<typeof DialogOverlay, 'dialog'>;
12
+ /** The dialog itself, rendered in the top layer while it is open. */
13
+ Content: WithBoundArgs<typeof DialogContent, 'dialog'>;
14
+ /** An `<h2>` that names it. */
15
+ Title: WithBoundArgs<typeof DialogTitle, 'part'>;
16
+ /** A `<p>` that describes it. */
17
+ Description: WithBoundArgs<typeof DialogDescription, 'part'>;
18
+ /** A `<button>` that closes it. */
19
+ Close: WithBoundArgs<typeof DialogClose, 'part'>;
20
+ /** Makes your own element or component the trigger: `<Button {{d.trigger}}>`. */
21
+ trigger: PartModifier;
22
+ /** Makes your own element or component close the dialog: `<Button {{d.close}}>`. */
23
+ close: PartModifier;
24
+ /** Makes your own element its title. */
25
+ title: PartModifier;
26
+ /** Makes your own element its description. */
27
+ description: PartModifier;
28
+ /** Whether it is open. */
29
+ isOpen: boolean;
30
+ /** Whether it is modal. */
31
+ isModal: boolean;
32
+ /** Opens it. */
33
+ open: () => void;
34
+ /** Opens it if it is closed, and closes it if it is open. */
35
+ toggle: () => void;
36
+ /** Opens (`true`) or closes (`false`) it: `(fn d.setOpen false)`. */
37
+ setOpen: (open: boolean) => void;
38
+ /** The `value` of the button that submitted a `<form method="dialog">` inside it, or `''`. */
39
+ returnValue: string;
40
+ }
41
+ export interface DialogSignature {
42
+ Args: DialogArgs;
43
+ Blocks: {
44
+ default: [DialogBlockParams];
45
+ };
46
+ /** An element with `display: contents`, so it doesn't change the layout. */
47
+ Element: HTMLDivElement;
48
+ }
49
+ /**
50
+ * A window over the page, as Radix's Dialog (which shadcn's Dialog, Sheet and Alert Dialog are
51
+ * built on), covering ember-primitives' Dialog and Modal too. It renders no box of its own, and
52
+ * yields its parts:
53
+ *
54
+ * <Dialog as |d|>
55
+ * <d.Trigger>Edit profile</d.Trigger>
56
+ * <d.Overlay />
57
+ * <d.Content>
58
+ * <d.Title>Edit profile</d.Title>
59
+ * <d.Description>Make changes to your profile here.</d.Description>
60
+ * <d.Close>Done</d.Close>
61
+ * </d.Content>
62
+ * </Dialog>
63
+ *
64
+ * Its state is its own, or yours with `@open` and `@onOpenChange` (and `@defaultOpen` to start
65
+ * open). While it is open:
66
+ *
67
+ * - the content is in the browser's top layer (above everything, with no portal), and the
68
+ * overlay under it;
69
+ * - Escape closes it, and so does a press outside the content (the overlay, for a modal one);
70
+ * - focus moves into the content (its first focusable element that isn't a link), and goes back
71
+ * to the trigger when it closes;
72
+ * - a modal one (the default) keeps focus inside, makes the rest of the page inert as a modal
73
+ * `<dialog>` does, and the overlay stops the page scrolling.
74
+ *
75
+ * Content and overlay animate out: they stay until a `data-state="closed"` animation ends.
76
+ */
77
+ export declare class Dialog extends Component<DialogSignature> {
78
+ dialog: DialogController;
79
+ }
80
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../src/dialog.gts"],"names":[],"mappings":"AAiIA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EACL,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,aAAa,EAEb,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAA;AAE9B,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,OAAO,EAAE,aAAa,CAAC,OAAO,aAAa,EAAE,MAAM,CAAC,CAAA;IACpD,mFAAmF;IACnF,OAAO,EAAE,aAAa,CAAC,OAAO,aAAa,EAAE,QAAQ,CAAC,CAAA;IACtD,qEAAqE;IACrE,OAAO,EAAE,aAAa,CAAC,OAAO,aAAa,EAAE,QAAQ,CAAC,CAAA;IACtD,+BAA+B;IAC/B,KAAK,EAAE,aAAa,CAAC,OAAO,WAAW,EAAE,MAAM,CAAC,CAAA;IAChD,iCAAiC;IACjC,WAAW,EAAE,aAAa,CAAC,OAAO,iBAAiB,EAAE,MAAM,CAAC,CAAA;IAC5D,mCAAmC;IACnC,KAAK,EAAE,aAAa,CAAC,OAAO,WAAW,EAAE,MAAM,CAAC,CAAA;IAChD,iFAAiF;IACjF,OAAO,EAAE,YAAY,CAAA;IACrB,oFAAoF;IACpF,KAAK,EAAE,YAAY,CAAA;IACnB,wCAAwC;IACxC,KAAK,EAAE,YAAY,CAAA;IACnB,8CAA8C;IAC9C,WAAW,EAAE,YAAY,CAAA;IACzB,0BAA0B;IAC1B,MAAM,EAAE,OAAO,CAAA;IACf,2BAA2B;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB;IAChB,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,qEAAqE;IACrE,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAChC,8FAA8F;IAC9F,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC,iBAAiB,CAAC,CAAA;KAAE,CAAA;IACxC,4EAA4E;IAC5E,OAAO,EAAE,cAAc,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,MAAO,SAAQ,SAAS,CAAC,eAAe,CAAC;IACpD,MAAM,mBAA6B;CAuCpC"}
@@ -0,0 +1,55 @@
1
+ import type { TOC } from '@ember/component/template-only';
2
+ import { type TagName } from './as';
3
+ /** A text direction: left to right, or right to left. */
4
+ export type Direction = 'ltr' | 'rtl';
5
+ /**
6
+ * The text direction at an element: `explicit` when it is `ltr` or `rtl` (a component's `@dir`),
7
+ * and otherwise whatever the document says there, from the nearest `dir` attribute (including
8
+ * `dir="auto"`, resolved from the text) up to `<html>`. Components call it when they need the
9
+ * direction, for example to decide which way the arrow keys move, so it is always current.
10
+ *
11
+ * getDirection(this.element) // 'rtl' inside <DirectionProvider @dir="rtl">
12
+ * getDirection(this.element, this.args.dir)
13
+ *
14
+ * Without an element, it reads `<html>`.
15
+ */
16
+ export declare function getDirection(element?: Element | null, explicit?: string | null): Direction;
17
+ /** Whether the text direction at an element is right to left. See `getDirection`. */
18
+ export declare function isRTL(element?: Element | null, explicit?: string | null): boolean;
19
+ export interface DirectionProviderSignature {
20
+ Args: {
21
+ /** The direction of everything inside: `ltr` or `rtl`. Default `ltr`. */
22
+ dir?: Direction;
23
+ /** The same as `@dir`, by the name shadcn's `DirectionProvider` uses. It wins over `@dir`. */
24
+ direction?: Direction;
25
+ /**
26
+ * The tag to render. Default `div`; use `span` inside phrasing content, such as a `<p>` or
27
+ * a `<button>`, where a `<div>` isn't allowed.
28
+ */
29
+ as?: TagName;
30
+ };
31
+ Blocks: {
32
+ /** The content, given the direction. */
33
+ default: [dir: Direction];
34
+ };
35
+ Element: HTMLElement;
36
+ }
37
+ /**
38
+ * Sets the text direction for everything inside it, as Radix's `DirectionProvider` does. It
39
+ * renders a `<div dir>` (or `@as`) with `display: contents`, so it adds no box to the layout,
40
+ * and every Joinery component inside reads the direction from the document (`getDirection`),
41
+ * so their arrow keys, sides and alignment follow it. Set `dir` on `<html>` too for a whole
42
+ * RTL app.
43
+ *
44
+ * <DirectionProvider @dir="rtl">
45
+ * <Tabs …/>
46
+ * </DirectionProvider>
47
+ *
48
+ * Radix's provider renders nothing; this one needs an element to carry `dir`, because Joinery's
49
+ * components read the direction from the DOM rather than from a context. It wraps content, so
50
+ * it isn't a component root for the harnesses (no `data-test-jn`): a part inside it still
51
+ * belongs to the component around it. Tests read the direction where it matters, from the
52
+ * component inside (`getDirection(element)`).
53
+ */
54
+ export declare const DirectionProvider: TOC<DirectionProviderSignature>;
55
+ //# sourceMappingURL=direction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../src/direction.gts"],"names":[],"mappings":"AAuGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAA;AAEzD,OAAO,EAAM,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAE3C,yDAAyD;AACzD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,CAAA;AAMrC;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAW1F;AAED,qFAAqF;AACrF,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAEjF;AAeD,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE;QACJ,yEAAyE;QACzE,GAAG,CAAC,EAAE,SAAS,CAAA;QACf,8FAA8F;QAC9F,SAAS,CAAC,EAAE,SAAS,CAAA;QACrB;;;WAGG;QACH,EAAE,CAAC,EAAE,OAAO,CAAA;KACb,CAAA;IACD,MAAM,EAAE;QACN,wCAAwC;QACxC,OAAO,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KAC1B,CAAA;IACD,OAAO,EAAE,WAAW,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,GAAG,CAAC,0BAA0B,CA0B5D,CAAA"}
@@ -0,0 +1,111 @@
1
+ import Modifier from 'ember-modifier';
2
+ /** A pointer that went down outside a layer: cancel it (`preventDefault()`) to keep the layer. */
3
+ export type PointerDownOutsideEvent = CustomEvent<{
4
+ originalEvent: PointerEvent;
5
+ }>;
6
+ /** Focus that moved outside a layer: cancel it (`preventDefault()`) to keep the layer. */
7
+ export type FocusOutsideEvent = CustomEvent<{
8
+ originalEvent: FocusEvent;
9
+ }>;
10
+ /** Why a layer was dismissed. */
11
+ export type DismissReason = 'escape-key' | 'pointer-outside' | 'focus-outside';
12
+ export interface DismissableOptions {
13
+ /**
14
+ * Called when the layer should close: Escape while it is the top layer, or a pointer or
15
+ * focus outside it, unless a handler below cancelled the event. Close the layer here.
16
+ */
17
+ onDismiss?: (reason: DismissReason) => void;
18
+ /** Escape was pressed while this is the top layer. `preventDefault()` keeps it open. */
19
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
20
+ /** A pointer went down outside the layer. `preventDefault()` keeps it open. */
21
+ onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
22
+ /** Focus moved outside the layer. `preventDefault()` keeps it open. */
23
+ onFocusOutside?: (event: FocusOutsideEvent) => void;
24
+ /** Either of the two above, after its own handler. `preventDefault()` keeps it open. */
25
+ onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;
26
+ /**
27
+ * Make everything outside this layer (and the layers above it) ignore the pointer, as a
28
+ * modal menu does: `pointer-events: none` on `<body>`, and `auto` on the layers that still
29
+ * take it. Layers below this one stop hearing pointers outside them, too.
30
+ */
31
+ disableOutsidePointerEvents?: boolean;
32
+ /**
33
+ * Elements that count as part of the layer, though they are outside it: usually the trigger
34
+ * that opened it, so pressing the trigger toggles the layer instead of dismissing it first.
35
+ * A layer whose element or trigger is inside another layer is nested in that one.
36
+ */
37
+ inside?: ReadonlyArray<Element | null | undefined>;
38
+ /** Turn the layer's dismissal off for now, keeping its place in the stack. Default `true`. */
39
+ enabled?: boolean;
40
+ }
41
+ /** A layer in the dismiss stack, as `registerDismissable` returns it. */
42
+ export interface DismissableLayer {
43
+ /** The layer's element. */
44
+ readonly element: Element;
45
+ /** Whether this is the top layer now, the one Escape closes. */
46
+ readonly isTop: boolean;
47
+ /** Replaces the layer's options (its place in the stack stays). */
48
+ update(options: DismissableOptions): void;
49
+ /** Takes the layer off the stack. */
50
+ remove(): void;
51
+ }
52
+ /**
53
+ * Puts an element on the dismiss stack, the list of open layers (popovers, menus, dialogs) that
54
+ * Escape and pointers outside them close, as Radix's `DismissableLayer` does:
55
+ *
56
+ * - **Escape** goes to the top layer only. Unless `onEscapeKeyDown` cancels it, `onDismiss` is
57
+ * called and the keydown is cancelled, so nothing underneath (a `<dialog>`, another layer)
58
+ * closes with it.
59
+ * - **A pointer down outside** goes to every layer it is outside of, top first, unless a layer
60
+ * below the pointer turned outside pointers off (`disableOutsidePointerEvents`).
61
+ * - **Focus moving outside** goes to every layer it left.
62
+ *
63
+ * A layer nested in another (its element or its trigger is inside that one) counts as inside
64
+ * it, wherever it is rendered, so pressing in a submenu leaves its menu open. Events from
65
+ * before the layer opened, such as the press that opened it, are ignored.
66
+ *
67
+ * const layer = registerDismissable(element, { onDismiss: () => this.open.set(false) })
68
+ * layer.update({ …options })
69
+ * layer.remove()
70
+ *
71
+ * In a template, the `{{dismissable}}` modifier does the same for the element it is on.
72
+ */
73
+ export declare function registerDismissable(element: Element, options?: DismissableOptions, { native }?: {
74
+ native?: boolean;
75
+ }): DismissableLayer;
76
+ /** The elements on the dismiss stack, bottom first: the last one is the top layer. */
77
+ export declare function dismissableLayers(): Element[];
78
+ interface DismissableSignature {
79
+ Element: Element;
80
+ Args: {
81
+ Named: DismissableOptions;
82
+ };
83
+ }
84
+ declare class DismissableModifier extends Modifier<DismissableSignature> {
85
+ #private;
86
+ modify(element: Element, _: [], options: DismissableOptions): void;
87
+ }
88
+ /**
89
+ * Puts the element on the dismiss stack while it is rendered: see `registerDismissable`.
90
+ *
91
+ * <div {{dismissable onDismiss=this.close inside=(array this.trigger)}}>…</div>
92
+ *
93
+ * Its arguments can change; the layer keeps its place in the stack.
94
+ */
95
+ export declare const dismissable: typeof DismissableModifier;
96
+ declare class DismissableBranchModifier extends Modifier<{
97
+ Element: Element;
98
+ }> {
99
+ #private;
100
+ modify(element: Element): void;
101
+ }
102
+ /**
103
+ * Makes an element count as inside every layer, as Radix's `DismissableLayer.Branch` does: a
104
+ * pointer or focus there dismisses nothing. For things that sit beside the layers, such as a
105
+ * toast region.
106
+ *
107
+ * <ol {{dismissableBranch}}>…toasts…</ol>
108
+ */
109
+ export declare const dismissableBranch: typeof DismissableBranchModifier;
110
+ export {};
111
+ //# sourceMappingURL=dismiss.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dismiss.d.ts","sourceRoot":"","sources":["../src/dismiss.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AAGrC,kGAAkG;AAClG,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC;IAAE,aAAa,EAAE,YAAY,CAAA;CAAE,CAAC,CAAA;AAElF,0FAA0F;AAC1F,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAAE,aAAa,EAAE,UAAU,CAAA;CAAE,CAAC,CAAA;AAE1E,iCAAiC;AACjC,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,iBAAiB,GAAG,eAAe,CAAA;AAE9E,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAA;IAC3C,wFAAwF;IACxF,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IAChD,+EAA+E;IAC/E,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC/D,uEAAuE;IACvE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACnD,wFAAwF;IACxF,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,GAAG,iBAAiB,KAAK,IAAI,CAAA;IAChF;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAA;IACrC;;;;OAIG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAA;IAClD,8FAA8F;IAC9F,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,mEAAmE;IACnE,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAA;IACzC,qCAAqC;IACrC,MAAM,IAAI,IAAI,CAAA;CACf;AAgQD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,kBAAuB,EAChC,EAAE,MAAc,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,gBAAgB,CAgClB;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,IAAI,OAAO,EAAE,CAE7C;AAED,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE;QAAE,KAAK,EAAE,kBAAkB,CAAA;KAAE,CAAA;CACpC;AAED,cAAM,mBAAoB,SAAQ,QAAQ,CAAC,oBAAoB,CAAC;;IAGrD,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI;CAK5E;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,4BAAsB,CAAA;AAE9C,cAAM,yBAA0B,SAAQ,QAAQ,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;;IAG3D,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAMxC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kCAA4B,CAAA"}
@@ -0,0 +1,74 @@
1
+ import Component from '@glimmer/component';
2
+ import type Owner from '@ember/owner';
3
+ import { type Newable } from './narrowing.ts';
4
+ export interface ProvideSignature<Data extends object> {
5
+ /** There is none to give attributes to: the provider's element is its own. */
6
+ Element: null;
7
+ Args: {
8
+ /**
9
+ * What the subtree gets. A class or function is made into one instance for this provider,
10
+ * with the provider's owner and lifetime (`createStore`); anything else is given as is.
11
+ */
12
+ data: Data | (() => Data) | Newable<Data>;
13
+ /**
14
+ * What consumers ask for, when it isn't `@data` itself: say `@data` is an instance, and
15
+ * consumers ask by its class. Compared by identity. A string works but leaves `<Consume>`'s
16
+ * data untyped; a class or object gives it the type.
17
+ */
18
+ key?: string | object;
19
+ /**
20
+ * The provider's own element, around the subtree: a tag (default `div`, with
21
+ * `display: contents`, so it doesn't affect layout), or `false` for none. With `false` the
22
+ * provider marks its place with an empty text node, which also lets siblings that come
23
+ * after it (not only its descendants) find it.
24
+ */
25
+ element?: keyof HTMLElementTagNameMap | false;
26
+ };
27
+ Blocks: {
28
+ /** The subtree that can consume the data. */
29
+ default: [];
30
+ };
31
+ }
32
+ /**
33
+ * Provides data to everything rendered inside it, found by `<Consume>` through the DOM, as
34
+ * React's context is found through the component tree:
35
+ *
36
+ * class Theme { @tracked accent = 'violet' }
37
+ *
38
+ * <Provide @data={{Theme}}>
39
+ * …
40
+ * <Consume @key={{Theme}} as |theme|>{{theme.data.accent}}</Consume>
41
+ * </Provide>
42
+ *
43
+ * It is ember-primitives' `Provide`.
44
+ */
45
+ export declare class Provide<Data extends object> extends Component<ProvideSignature<Data>> {
46
+ readonly node: Text | HTMLElement;
47
+ constructor(owner: Owner, args: ProvideSignature<Data>['Args']);
48
+ get data(): Data;
49
+ }
50
+ /** What `<Consume @key={{Key}}>` gives: the instance for a class or function, else the value. */
51
+ export type DataForKey<Key> = Key extends string ? unknown : Key extends Newable<infer T> ? T : Key extends () => infer T ? T : Key;
52
+ export interface ConsumeSignature<Key extends object | string> {
53
+ Args: {
54
+ /** The `@key` (or `@data`) of the provider to read. */
55
+ key: Key;
56
+ };
57
+ Blocks: {
58
+ /** `context.data` is the nearest provider's data; reading it is reactive. */
59
+ default: [context: {
60
+ readonly data: DataForKey<Key>;
61
+ }];
62
+ };
63
+ }
64
+ /**
65
+ * Reads the data of the nearest `<Provide>` above it with the same key: `context.data`. It
66
+ * throws if there is none. It is ember-primitives' `Consume`.
67
+ */
68
+ export declare class Consume<Key extends object | string> extends Component<ConsumeSignature<Key>> {
69
+ readonly node: Text;
70
+ get context(): {
71
+ readonly data: DataForKey<Key>;
72
+ };
73
+ }
74
+ //# sourceMappingURL=dom-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-context.d.ts","sourceRoot":"","sources":["../src/dom-context.gts"],"names":[],"mappings":"AAsKA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAcxD,MAAM,WAAW,gBAAgB,CAAC,IAAI,SAAS,MAAM;IACnD,8EAA8E;IAC9E,OAAO,EAAE,IAAI,CAAA;IACb,IAAI,EAAE;QACJ;;;WAGG;QACH,IAAI,EAAE,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;QACzC;;;;WAIG;QACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;QACrB;;;;;WAKG;QACH,OAAO,CAAC,EAAE,MAAM,qBAAqB,GAAG,KAAK,CAAA;KAC9C,CAAA;IACD,MAAM,EAAE;QACN,6CAA6C;QAC7C,OAAO,EAAE,EAAE,CAAA;KACZ,CAAA;CACF;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,OAAO,CAAC,IAAI,SAAS,MAAM,CAAE,SAAQ,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACjF,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,CAAA;gBAErB,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAe9D,IAAI,IAAI,IAAI,IAAI,CAMf;CAmBF;AAmBD,iGAAiG;AACjG,MAAM,MAAM,UAAU,CAAC,GAAG,IAAI,GAAG,SAAS,MAAM,GAC5C,OAAO,GACP,GAAG,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAC1B,CAAC,GACD,GAAG,SAAS,MAAM,MAAM,CAAC,GACvB,CAAC,GACD,GAAG,CAAA;AAEX,MAAM,WAAW,gBAAgB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IAC3D,IAAI,EAAE;QACJ,uDAAuD;QACvD,GAAG,EAAE,GAAG,CAAA;KACT,CAAA;IACD,MAAM,EAAE;QACN,6EAA6E;QAC7E,OAAO,EAAE,CAAC,OAAO,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAA;SAAE,CAAC,CAAA;KACvD,CAAA;CACF;AAED;;;GAGG;AACH,qBAAa,OAAO,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACxF,QAAQ,CAAC,IAAI,OAA8B;IAE3C,IACI,OAAO,IAAI;QAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAA;KAAE,CAchD;CAOF"}
@@ -0,0 +1,174 @@
1
+ import { ControllableState, type ControllableArgs } from '../controllable-state.ts';
2
+ import type { FocusOutsideEvent, PointerDownOutsideEvent } from '../dismiss.ts';
3
+ import { type PartModifier } from '../part.ts';
4
+ import { DialogController, type DialogArgs } from '../-private/dialog';
5
+ /** The edge of the screen a drawer comes in from. */
6
+ export type DrawerDirection = 'top' | 'bottom' | 'left' | 'right';
7
+ /**
8
+ * Where a drawer can rest: a fraction of the screen (`0.5`, half of it), or a size in pixels as
9
+ * a string (`'148px'`), as vaul's snap points.
10
+ */
11
+ export type SnapPoint = number | string;
12
+ /** What a Drawer takes: a Dialog's arguments, and vaul's. */
13
+ export type DrawerArgs = Omit<DialogArgs, 'slot'> & ControllableArgs<'activeSnapPoint', SnapPoint | null> & {
14
+ /**
15
+ * The edge it comes in from: `top`, `right`, `bottom` (the default) or `left`. Left and
16
+ * right are the inline start and end, as Joinery's styles place them: right to left, a
17
+ * `left` drawer is on the right, and drags and slides as one.
18
+ */
19
+ direction?: DrawerDirection;
20
+ /**
21
+ * Whether a drag, a press outside, Escape, its close parts and its trigger can close it.
22
+ * Default `true`. With `false`, only you close it, with `@open` or `setOpen`.
23
+ */
24
+ dismissible?: boolean;
25
+ /** Where it can rest, smallest first: fractions of the screen, or `'<n>px'` strings. */
26
+ snapPoints?: readonly SnapPoint[];
27
+ /** The snap point from which the overlay fades in. Default the last. */
28
+ fadeFromIndex?: number;
29
+ /** Never skip a snap point on a fast swipe. Default `false`. */
30
+ snapToSequentialPoint?: boolean;
31
+ /** How much of it, from 0 to 1, a drag must hide to close it. Default `0.25`. */
32
+ closeThreshold?: number;
33
+ /** How long after its content scrolls it can't be dragged, in ms. Default `100`. */
34
+ scrollLockTimeout?: number;
35
+ /** Only its Handle drags it. Default `false`. */
36
+ handleOnly?: boolean;
37
+ /**
38
+ * Scale the element marked `data-vaul-drawer-wrapper` (your app's root, say) back while it
39
+ * is open, as iOS sheets do. Default `false`.
40
+ */
41
+ shouldScaleBackground?: boolean;
42
+ /** While the background is scaled, make `<body>` black behind it. Default `true`. */
43
+ setBackgroundColorOnScale?: boolean;
44
+ /** Leave `<body>`'s styles alone. Default `false`. */
45
+ noBodyStyles?: boolean;
46
+ /**
47
+ * Move focus to its first focusable element when it opens, as a Dialog does. By default
48
+ * focus goes to the drawer itself, so a phone's keyboard doesn't pop up for an input in it.
49
+ */
50
+ autoFocus?: boolean;
51
+ /**
52
+ * While an input in it has focus and a phone's keyboard opens, resize it to stay in view.
53
+ * Default `true`.
54
+ */
55
+ repositionInputs?: boolean;
56
+ /** With `repositionInputs`, shrink it rather than move it up. Default `false`. */
57
+ fixed?: boolean;
58
+ /** Called as it is dragged, with how far (0 to 1) toward closed. */
59
+ onDrag?: (event: PointerEvent, percentageDragged: number) => void;
60
+ /** Called when a drag lets go, with whether it stays open. */
61
+ onRelease?: (event: PointerEvent, open: boolean) => void;
62
+ /** Called once it has finished opening or closing (its animation takes 500ms). */
63
+ onAnimationEnd?: (open: boolean) => void;
64
+ /** The drawer this one is nested in: bound by the outer drawer's `Nested`. */
65
+ parent?: DrawerController;
66
+ };
67
+ /** The class a drawer has while it is dragged. */
68
+ export declare const DRAG_CLASS = "vaul-dragging";
69
+ export declare function isVertical(direction: DrawerDirection): boolean;
70
+ type Styles = Record<string, string>;
71
+ /** Sets styles through the CSSOM, which a strict Content Security Policy allows. */
72
+ export declare function setStyles(element: Element | null | undefined, styles: Styles): void;
73
+ /** How far an element is translated along a direction's axis, from its computed transform. */
74
+ export declare function getTranslate(element: Element | null, direction: DrawerDirection): number | null;
75
+ /**
76
+ * One drawer's state and parts: a Dialog's (`DialogController`), with vaul's gestures. The
77
+ * content follows a drag along its axis and closes when let go far or fast enough, rests at its
78
+ * snap points, fades the overlay as it goes, scales the page behind it, and moves a drawer it is
79
+ * nested in back a step.
80
+ */
81
+ export declare class DrawerController extends DialogController {
82
+ #private;
83
+ readonly activeSnapPointState: ControllableState<SnapPoint | null>;
84
+ /** The window's size, kept as it resizes (snap points are measured against it). */
85
+ private viewportSize;
86
+ constructor(owner: {
87
+ readonly args: DrawerArgs;
88
+ });
89
+ /** Whether it is being dragged now (or pressed, about to be). */
90
+ get isDragging(): boolean;
91
+ get args(): DrawerArgs;
92
+ get slot(): string;
93
+ get direction(): DrawerDirection;
94
+ /**
95
+ * The physical edge it is on: its direction, but with left and right swapped right to left
96
+ * (where `left`, the inline start, is on the right).
97
+ */
98
+ get side(): DrawerDirection;
99
+ get dismissible(): boolean;
100
+ get snapPoints(): readonly SnapPoint[] | undefined;
101
+ get hasSnapPoints(): boolean;
102
+ get fadeFromIndex(): number | undefined;
103
+ get closeThreshold(): number;
104
+ get scrollLockTimeout(): number;
105
+ get repositionInputs(): boolean;
106
+ get activeSnapPoint(): SnapPoint | null;
107
+ setActiveSnapPoint: (snapPoint: SnapPoint | null) => void;
108
+ get activeSnapPointIndex(): number | null;
109
+ get isLastSnapPoint(): boolean;
110
+ /** Whether the overlay shows: always without snap points, else from `fadeFromIndex` on. */
111
+ get shouldFade(): boolean;
112
+ /** Called when the window resizes, so the snap points are measured again. */
113
+ measure: () => void;
114
+ /** Each snap point as the translation, in pixels along its axis, that rests the drawer there. */
115
+ get snapPointsOffset(): number[];
116
+ get activeSnapPointOffset(): number | null;
117
+ /** Rests the drawer at the snap point with this offset, and makes it the active one. */
118
+ snapToPoint(dimension: number | undefined): void;
119
+ /** Moves the drawer to a snap point and fades the overlay to match, as vaul's snapToPoint. */
120
+ applySnapPoint(index: number): void;
121
+ /** Opens or closes it, whatever `@dismissible` says (your own code calling it decides). */
122
+ setOpen: (open: boolean) => void;
123
+ /** A close part, a `<form method="dialog">`: closes it, if it is dismissible. */
124
+ hide: () => void;
125
+ /** The trigger: opens it, or closes it if it is dismissible. */
126
+ toggle: () => void;
127
+ /** Escape or a press outside: closes it, if it is dismissible. */
128
+ dismiss: () => void;
129
+ /** Closes it after a drag (vaul's closeDrawer). */
130
+ closeDrawer(): void;
131
+ /**
132
+ * Called by the root when it has opened or closed, however that came about: `initial` when it
133
+ * renders open, where nothing slides in (and, as vaul's, `onAnimationEnd` isn't called).
134
+ */
135
+ openChanged(open: boolean, initial?: boolean): void;
136
+ /** Called by the root once it has rendered, a frame after which opening animates. */
137
+ rendered(): void;
138
+ teardown(): void;
139
+ /** Focus goes to the drawer itself, unless `@autoFocus` asks for its first focusable element. */
140
+ onOpenAutoFocus(event: Event, handler?: (event: Event) => void): void;
141
+ onPointerDownOutside(event: PointerDownOutsideEvent, handler?: (event: PointerDownOutsideEvent) => void): void;
142
+ /** Focus moving outside never closes a drawer. */
143
+ onFocusOutside(event: FocusOutsideEvent, handler?: (event: FocusOutsideEvent) => void): void;
144
+ /** A pointer went down on the drawer: it may be the start of a drag. */
145
+ onPress(event: PointerEvent): void;
146
+ /** The pointer moved while pressed: the drawer follows it. */
147
+ onDrag(event: PointerEvent): void;
148
+ /** Stops a drag without letting it go anywhere. */
149
+ cancelDrag(): void;
150
+ /** Puts it back where it rests, after a drag that didn't close it. */
151
+ resetDrawer(): void;
152
+ /** The pointer let go: close it, snap it, or put it back. */
153
+ onRelease(event: PointerEvent | MouseEvent | null): void;
154
+ /** A drawer nested in this one opened or closed: step this one back, or forward again. */
155
+ onNestedOpenChange(open: boolean): void;
156
+ /** A drawer nested in this one is dragged: this one comes forward as it goes. */
157
+ onNestedDrag(percentageDragged: number): void;
158
+ /** A drawer nested in this one was let go: if it stays open, this one steps back again. */
159
+ onNestedRelease(open: boolean): void;
160
+ /** Scales the background back, while it is open; returns the function that undoes it. */
161
+ scaleBackground(element: HTMLElement): (() => void) | undefined;
162
+ /** The visual viewport resized: if a phone's keyboard opened over an input, keep it in view. */
163
+ onVisualViewportChange: () => void;
164
+ /** vaul's attributes and pointer listeners on the content, beside the Dialog's content part. */
165
+ drawerContent: PartModifier;
166
+ /** vaul's attributes on the overlay, beside the Dialog's overlay part. */
167
+ drawerOverlay: PartModifier;
168
+ /** Makes your own element the handle: `<div {{d.handle}}>`. */
169
+ handle: PartModifier<HTMLElement, {
170
+ preventCycle?: boolean;
171
+ }>;
172
+ }
173
+ export {};
174
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/drawer/controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EAAQ,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAA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