@ember-joinery/primitives 0.0.0-stage → 1.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.
- package/CHANGELOG.md +480 -0
- package/LICENSE.md +9 -0
- package/NOTICE +532 -0
- package/README.md +11 -2
- package/addon-main.cjs +4 -0
- package/declarations/-private/combobox-list.d.ts +59 -0
- package/declarations/-private/combobox-list.d.ts.map +1 -0
- package/declarations/-private/command-score.d.ts +33 -0
- package/declarations/-private/command-score.d.ts.map +1 -0
- package/declarations/-private/delay-group.d.ts +47 -0
- package/declarations/-private/delay-group.d.ts.map +1 -0
- package/declarations/-private/dialog.d.ts +180 -0
- package/declarations/-private/dialog.d.ts.map +1 -0
- package/declarations/-private/form-control.d.ts +70 -0
- package/declarations/-private/form-control.d.ts.map +1 -0
- package/declarations/-private/form-data.d.ts +14 -0
- package/declarations/-private/form-data.d.ts.map +1 -0
- package/declarations/-private/hover-intent.d.ts +48 -0
- package/declarations/-private/hover-intent.d.ts.map +1 -0
- package/declarations/-private/image-loading.d.ts +77 -0
- package/declarations/-private/image-loading.d.ts.map +1 -0
- package/declarations/-private/indicator.d.ts +27 -0
- package/declarations/-private/indicator.d.ts.map +1 -0
- package/declarations/-private/instances.d.ts +11 -0
- package/declarations/-private/instances.d.ts.map +1 -0
- package/declarations/-private/layout-styles.d.ts +34 -0
- package/declarations/-private/layout-styles.d.ts.map +1 -0
- package/declarations/-private/menu.d.ts +616 -0
- package/declarations/-private/menu.d.ts.map +1 -0
- package/declarations/-private/observers.d.ts +35 -0
- package/declarations/-private/observers.d.ts.map +1 -0
- package/declarations/-private/popper.d.ts +149 -0
- package/declarations/-private/popper.d.ts.map +1 -0
- package/declarations/-private/presence-chart.d.ts +39 -0
- package/declarations/-private/presence-chart.d.ts.map +1 -0
- package/declarations/-private/promise-state.d.ts +41 -0
- package/declarations/-private/promise-state.d.ts.map +1 -0
- package/declarations/-private/scroll-end.d.ts +16 -0
- package/declarations/-private/scroll-end.d.ts.map +1 -0
- package/declarations/-private/scroll-visibility.d.ts +68 -0
- package/declarations/-private/scroll-visibility.d.ts.map +1 -0
- package/declarations/-private/toast.d.ts +119 -0
- package/declarations/-private/toast.d.ts.map +1 -0
- package/declarations/-private/typeahead-search.d.ts +29 -0
- package/declarations/-private/typeahead-search.d.ts.map +1 -0
- package/declarations/accordion.d.ts +284 -0
- package/declarations/accordion.d.ts.map +1 -0
- package/declarations/alert-dialog.d.ts +80 -0
- package/declarations/alert-dialog.d.ts.map +1 -0
- package/declarations/anchor/component.d.ts +63 -0
- package/declarations/anchor/component.d.ts.map +1 -0
- package/declarations/anchor/index.d.ts +7 -0
- package/declarations/anchor/index.d.ts.map +1 -0
- package/declarations/anchor/middleware.d.ts +46 -0
- package/declarations/anchor/middleware.d.ts.map +1 -0
- package/declarations/anchor/modifier.d.ts +34 -0
- package/declarations/anchor/modifier.d.ts.map +1 -0
- package/declarations/anchor/options.d.ts +112 -0
- package/declarations/anchor/options.d.ts.map +1 -0
- package/declarations/anchor/position.d.ts +36 -0
- package/declarations/anchor/position.d.ts.map +1 -0
- package/declarations/anchor.d.ts +2 -0
- package/declarations/as.d.ts +33 -0
- package/declarations/as.d.ts.map +1 -0
- package/declarations/aspect-ratio.d.ts +34 -0
- package/declarations/aspect-ratio.d.ts.map +1 -0
- package/declarations/avatar.d.ts +178 -0
- package/declarations/avatar.d.ts.map +1 -0
- package/declarations/body-class.d.ts +30 -0
- package/declarations/body-class.d.ts.map +1 -0
- package/declarations/breadcrumb.d.ts +64 -0
- package/declarations/breadcrumb.d.ts.map +1 -0
- package/declarations/calendar/dates.d.ts +142 -0
- package/declarations/calendar/dates.d.ts.map +1 -0
- package/declarations/calendar/index.d.ts +59 -0
- package/declarations/calendar/index.d.ts.map +1 -0
- package/declarations/calendar/state.d.ts +415 -0
- package/declarations/calendar/state.d.ts.map +1 -0
- package/declarations/calendar.d.ts +3 -0
- package/declarations/checkbox.d.ts +71 -0
- package/declarations/checkbox.d.ts.map +1 -0
- package/declarations/collapsible.d.ts +216 -0
- package/declarations/collapsible.d.ts.map +1 -0
- package/declarations/color-scheme.d.ts +115 -0
- package/declarations/color-scheme.d.ts.map +1 -0
- package/declarations/combobox.d.ts +569 -0
- package/declarations/combobox.d.ts.map +1 -0
- package/declarations/command.d.ts +410 -0
- package/declarations/command.d.ts.map +1 -0
- package/declarations/context-menu.d.ts +155 -0
- package/declarations/context-menu.d.ts.map +1 -0
- package/declarations/controllable-state.d.ts +85 -0
- package/declarations/controllable-state.d.ts.map +1 -0
- package/declarations/dialog.d.ts +80 -0
- package/declarations/dialog.d.ts.map +1 -0
- package/declarations/direction.d.ts +55 -0
- package/declarations/direction.d.ts.map +1 -0
- package/declarations/dismiss.d.ts +111 -0
- package/declarations/dismiss.d.ts.map +1 -0
- package/declarations/dom-context.d.ts +74 -0
- package/declarations/dom-context.d.ts.map +1 -0
- package/declarations/drawer/controller.d.ts +174 -0
- package/declarations/drawer/controller.d.ts.map +1 -0
- package/declarations/drawer/index.d.ts +105 -0
- package/declarations/drawer/index.d.ts.map +1 -0
- package/declarations/drawer/machine.d.ts +139 -0
- package/declarations/drawer/machine.d.ts.map +1 -0
- package/declarations/drawer/parts.d.ts +85 -0
- package/declarations/drawer/parts.d.ts.map +1 -0
- package/declarations/drawer.d.ts +2 -0
- package/declarations/dropdown-menu.d.ts +169 -0
- package/declarations/dropdown-menu.d.ts.map +1 -0
- package/declarations/external-link.d.ts +26 -0
- package/declarations/external-link.d.ts.map +1 -0
- package/declarations/file-drop.d.ts +119 -0
- package/declarations/file-drop.d.ts.map +1 -0
- package/declarations/focus-scope.d.ts +105 -0
- package/declarations/focus-scope.d.ts.map +1 -0
- package/declarations/focus.d.ts +114 -0
- package/declarations/focus.d.ts.map +1 -0
- package/declarations/head.d.ts +20 -0
- package/declarations/head.d.ts.map +1 -0
- package/declarations/heading.d.ts +59 -0
- package/declarations/heading.d.ts.map +1 -0
- package/declarations/hero.d.ts +32 -0
- package/declarations/hero.d.ts.map +1 -0
- package/declarations/hide-others.d.ts +35 -0
- package/declarations/hide-others.d.ts.map +1 -0
- package/declarations/hover-card.d.ts +148 -0
- package/declarations/hover-card.d.ts.map +1 -0
- package/declarations/i18n.d.ts +47 -0
- package/declarations/i18n.d.ts.map +1 -0
- package/declarations/id.d.ts +15 -0
- package/declarations/id.d.ts.map +1 -0
- package/declarations/iframe.d.ts +12 -0
- package/declarations/iframe.d.ts.map +1 -0
- package/declarations/incremental-each.d.ts +81 -0
- package/declarations/incremental-each.d.ts.map +1 -0
- package/declarations/index.d.ts +108 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/input-otp.d.ts +201 -0
- package/declarations/input-otp.d.ts.map +1 -0
- package/declarations/keys.d.ts +50 -0
- package/declarations/keys.d.ts.map +1 -0
- package/declarations/label.d.ts +36 -0
- package/declarations/label.d.ts.map +1 -0
- package/declarations/layer.d.ts +56 -0
- package/declarations/layer.d.ts.map +1 -0
- package/declarations/link-helper.d.ts +73 -0
- package/declarations/link-helper.d.ts.map +1 -0
- package/declarations/link.d.ts +60 -0
- package/declarations/link.d.ts.map +1 -0
- package/declarations/load.d.ts +47 -0
- package/declarations/load.d.ts.map +1 -0
- package/declarations/menubar.d.ts +231 -0
- package/declarations/menubar.d.ts.map +1 -0
- package/declarations/message-scroller/components.d.ts +229 -0
- package/declarations/message-scroller/components.d.ts.map +1 -0
- package/declarations/message-scroller/geometry.d.ts +95 -0
- package/declarations/message-scroller/geometry.d.ts.map +1 -0
- package/declarations/message-scroller/index.d.ts +4 -0
- package/declarations/message-scroller/index.d.ts.map +1 -0
- package/declarations/message-scroller/state.d.ts +124 -0
- package/declarations/message-scroller/state.d.ts.map +1 -0
- package/declarations/message-scroller.d.ts +2 -0
- package/declarations/messages.d.ts +166 -0
- package/declarations/messages.d.ts.map +1 -0
- package/declarations/narrowing.d.ts +24 -0
- package/declarations/narrowing.d.ts.map +1 -0
- package/declarations/native-form.d.ts +56 -0
- package/declarations/native-form.d.ts.map +1 -0
- package/declarations/native-value.d.ts +47 -0
- package/declarations/native-value.d.ts.map +1 -0
- package/declarations/navigation-menu.d.ts +406 -0
- package/declarations/navigation-menu.d.ts.map +1 -0
- package/declarations/on-resize.d.ts +32 -0
- package/declarations/on-resize.d.ts.map +1 -0
- package/declarations/part.d.ts +99 -0
- package/declarations/part.d.ts.map +1 -0
- package/declarations/popover.d.ts +236 -0
- package/declarations/popover.d.ts.map +1 -0
- package/declarations/portal/index.d.ts +3 -0
- package/declarations/portal/index.d.ts.map +1 -0
- package/declarations/portal/portal.d.ts +46 -0
- package/declarations/portal/portal.d.ts.map +1 -0
- package/declarations/portal/targets.d.ts +40 -0
- package/declarations/portal/targets.d.ts.map +1 -0
- package/declarations/portal.d.ts +2 -0
- package/declarations/presence.d.ts +80 -0
- package/declarations/presence.d.ts.map +1 -0
- package/declarations/progress.d.ts +98 -0
- package/declarations/progress.d.ts.map +1 -0
- package/declarations/proper-links.d.ts +69 -0
- package/declarations/proper-links.d.ts.map +1 -0
- package/declarations/qp.d.ts +55 -0
- package/declarations/qp.d.ts.map +1 -0
- package/declarations/questionnaire/components.d.ts +348 -0
- package/declarations/questionnaire/components.d.ts.map +1 -0
- package/declarations/questionnaire/index.d.ts +4 -0
- package/declarations/questionnaire/index.d.ts.map +1 -0
- package/declarations/questionnaire/state.d.ts +400 -0
- package/declarations/questionnaire/state.d.ts.map +1 -0
- package/declarations/questionnaire/utils.d.ts +65 -0
- package/declarations/questionnaire/utils.d.ts.map +1 -0
- package/declarations/questionnaire.d.ts +2 -0
- package/declarations/radio-group.d.ts +115 -0
- package/declarations/radio-group.d.ts.map +1 -0
- package/declarations/rating.d.ts +214 -0
- package/declarations/rating.d.ts.map +1 -0
- package/declarations/resizable/components.d.ts +107 -0
- package/declarations/resizable/components.d.ts.map +1 -0
- package/declarations/resizable/index.d.ts +4 -0
- package/declarations/resizable/index.d.ts.map +1 -0
- package/declarations/resizable/layout.d.ts +93 -0
- package/declarations/resizable/layout.d.ts.map +1 -0
- package/declarations/resizable/state.d.ts +211 -0
- package/declarations/resizable/state.d.ts.map +1 -0
- package/declarations/resizable.d.ts +2 -0
- package/declarations/resize-observer.d.ts +40 -0
- package/declarations/resize-observer.d.ts.map +1 -0
- package/declarations/roving-focus.d.ts +204 -0
- package/declarations/roving-focus.d.ts.map +1 -0
- package/declarations/scroll-area/components.d.ts +125 -0
- package/declarations/scroll-area/components.d.ts.map +1 -0
- package/declarations/scroll-area/index.d.ts +3 -0
- package/declarations/scroll-area/index.d.ts.map +1 -0
- package/declarations/scroll-area/state.d.ts +147 -0
- package/declarations/scroll-area/state.d.ts.map +1 -0
- package/declarations/scroll-area.d.ts +2 -0
- package/declarations/scroll-lock.d.ts +69 -0
- package/declarations/scroll-lock.d.ts.map +1 -0
- package/declarations/scroller.d.ts +71 -0
- package/declarations/scroller.d.ts.map +1 -0
- package/declarations/select.d.ts +459 -0
- package/declarations/select.d.ts.map +1 -0
- package/declarations/separator.d.ts +71 -0
- package/declarations/separator.d.ts.map +1 -0
- package/declarations/service.d.ts +83 -0
- package/declarations/service.d.ts.map +1 -0
- package/declarations/shadowed.d.ts +63 -0
- package/declarations/shadowed.d.ts.map +1 -0
- package/declarations/slider.d.ts +283 -0
- package/declarations/slider.d.ts.map +1 -0
- package/declarations/sticky-footer.d.ts +43 -0
- package/declarations/sticky-footer.d.ts.map +1 -0
- package/declarations/store.d.ts +47 -0
- package/declarations/store.d.ts.map +1 -0
- package/declarations/switch.d.ts +76 -0
- package/declarations/switch.d.ts.map +1 -0
- package/declarations/tabs.d.ts +250 -0
- package/declarations/tabs.d.ts.map +1 -0
- package/declarations/toast/icons.d.ts +29 -0
- package/declarations/toast/icons.d.ts.map +1 -0
- package/declarations/toast/index.d.ts +4 -0
- package/declarations/toast/index.d.ts.map +1 -0
- package/declarations/toast/item.d.ts +162 -0
- package/declarations/toast/item.d.ts.map +1 -0
- package/declarations/toast/state.d.ts +276 -0
- package/declarations/toast/state.d.ts.map +1 -0
- package/declarations/toast/styles.d.ts +20 -0
- package/declarations/toast/styles.d.ts.map +1 -0
- package/declarations/toast/toaster.d.ts +173 -0
- package/declarations/toast/toaster.d.ts.map +1 -0
- package/declarations/toast.d.ts +2 -0
- package/declarations/toggle-group.d.ts +161 -0
- package/declarations/toggle-group.d.ts.map +1 -0
- package/declarations/toggle.d.ts +70 -0
- package/declarations/toggle.d.ts.map +1 -0
- package/declarations/tooltip.d.ts +227 -0
- package/declarations/tooltip.d.ts.map +1 -0
- package/declarations/typeahead.d.ts +97 -0
- package/declarations/typeahead.d.ts.map +1 -0
- package/declarations/viewport.d.ts +109 -0
- package/declarations/viewport.d.ts.map +1 -0
- package/declarations/visually-hidden.d.ts +42 -0
- package/declarations/visually-hidden.d.ts.map +1 -0
- package/declarations/zoetrope.d.ts +120 -0
- package/declarations/zoetrope.d.ts.map +1 -0
- package/dist/accordion.js +367 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert-dialog.js +122 -0
- package/dist/alert-dialog.js.map +1 -0
- package/dist/anchor.js +2 -0
- package/dist/anchor.js.map +1 -0
- package/dist/as.js +60 -0
- package/dist/as.js.map +1 -0
- package/dist/aspect-ratio.js +59 -0
- package/dist/aspect-ratio.js.map +1 -0
- package/dist/avatar.js +464 -0
- package/dist/avatar.js.map +1 -0
- package/dist/body-class.js +57 -0
- package/dist/body-class.js.map +1 -0
- package/dist/breadcrumb.js +59 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/calendar.js +1494 -0
- package/dist/calendar.js.map +1 -0
- package/dist/checkbox.js +81 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/collapsible.js +255 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/color-scheme.js +306 -0
- package/dist/color-scheme.js.map +1 -0
- package/dist/combobox.js +1413 -0
- package/dist/combobox.js.map +1 -0
- package/dist/command.js +1054 -0
- package/dist/command.js.map +1 -0
- package/dist/component-DqLt83fo.js +886 -0
- package/dist/component-DqLt83fo.js.map +1 -0
- package/dist/components-CWfg0cFs.js +1745 -0
- package/dist/components-CWfg0cFs.js.map +1 -0
- package/dist/components-DBWszEI3.js +1285 -0
- package/dist/components-DBWszEI3.js.map +1 -0
- package/dist/components-DI8Azu05.js +1542 -0
- package/dist/components-DI8Azu05.js.map +1 -0
- package/dist/components-F0Ini448.js +875 -0
- package/dist/components-F0Ini448.js.map +1 -0
- package/dist/context-menu.js +207 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/controllable-state.js +134 -0
- package/dist/controllable-state.js.map +1 -0
- package/dist/delay-group-B1K03gBL.js +75 -0
- package/dist/delay-group-B1K03gBL.js.map +1 -0
- package/dist/dialog-3gfz_8NA.js +349 -0
- package/dist/dialog-3gfz_8NA.js.map +1 -0
- package/dist/dialog.js +57 -0
- package/dist/dialog.js.map +1 -0
- package/dist/direction.js +75 -0
- package/dist/direction.js.map +1 -0
- package/dist/dismiss.js +329 -0
- package/dist/dismiss.js.map +1 -0
- package/dist/dom-context.js +104 -0
- package/dist/dom-context.js.map +1 -0
- package/dist/drawer.js +1456 -0
- package/dist/drawer.js.map +1 -0
- package/dist/dropdown-menu.js +201 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/external-link.js +21 -0
- package/dist/external-link.js.map +1 -0
- package/dist/file-drop.js +183 -0
- package/dist/file-drop.js.map +1 -0
- package/dist/focus-scope.js +292 -0
- package/dist/focus-scope.js.map +1 -0
- package/dist/focus.js +311 -0
- package/dist/focus.js.map +1 -0
- package/dist/form-control-Ca_KHSKK.js +177 -0
- package/dist/form-control-Ca_KHSKK.js.map +1 -0
- package/dist/head.js +25 -0
- package/dist/head.js.map +1 -0
- package/dist/heading.js +152 -0
- package/dist/heading.js.map +1 -0
- package/dist/hero.js +36 -0
- package/dist/hero.js.map +1 -0
- package/dist/hide-others.js +108 -0
- package/dist/hide-others.js.map +1 -0
- package/dist/hover-card.js +246 -0
- package/dist/hover-card.js.map +1 -0
- package/dist/hover-intent-Bxb83fgX.js +92 -0
- package/dist/hover-intent-Bxb83fgX.js.map +1 -0
- package/dist/i18n.js +72 -0
- package/dist/i18n.js.map +1 -0
- package/dist/id.js +24 -0
- package/dist/id.js.map +1 -0
- package/dist/iframe.js +19 -0
- package/dist/iframe.js.map +1 -0
- package/dist/incremental-each.js +181 -0
- package/dist/incremental-each.js.map +1 -0
- package/dist/index.js +87 -0
- package/dist/index.js.map +1 -0
- package/dist/indicator-sYuRuFJA.js +26 -0
- package/dist/indicator-sYuRuFJA.js.map +1 -0
- package/dist/input-otp.js +611 -0
- package/dist/input-otp.js.map +1 -0
- package/dist/keys.js +65 -0
- package/dist/keys.js.map +1 -0
- package/dist/label.js +41 -0
- package/dist/label.js.map +1 -0
- package/dist/layer.js +157 -0
- package/dist/layer.js.map +1 -0
- package/dist/layout-styles-DY86so8a.js +81 -0
- package/dist/layout-styles-DY86so8a.js.map +1 -0
- package/dist/link-helper.js +122 -0
- package/dist/link-helper.js.map +1 -0
- package/dist/link.js +39 -0
- package/dist/link.js.map +1 -0
- package/dist/load.js +54 -0
- package/dist/load.js.map +1 -0
- package/dist/menu-Da1LFCet.js +1109 -0
- package/dist/menu-Da1LFCet.js.map +1 -0
- package/dist/menubar.js +357 -0
- package/dist/menubar.js.map +1 -0
- package/dist/message-scroller.js +2 -0
- package/dist/message-scroller.js.map +1 -0
- package/dist/messages.js +168 -0
- package/dist/messages.js.map +1 -0
- package/dist/narrowing.js +29 -0
- package/dist/narrowing.js.map +1 -0
- package/dist/native-form.js +134 -0
- package/dist/native-form.js.map +1 -0
- package/dist/native-value.js +125 -0
- package/dist/native-value.js.map +1 -0
- package/dist/navigation-menu.js +872 -0
- package/dist/navigation-menu.js.map +1 -0
- package/dist/observers-aItWe029.js +113 -0
- package/dist/observers-aItWe029.js.map +1 -0
- package/dist/on-resize.js +47 -0
- package/dist/on-resize.js.map +1 -0
- package/dist/part.js +291 -0
- package/dist/part.js.map +1 -0
- package/dist/popover.js +419 -0
- package/dist/popover.js.map +1 -0
- package/dist/popper-BbTzV8dP.js +323 -0
- package/dist/popper-BbTzV8dP.js.map +1 -0
- package/dist/portal-U554WDI9.js +214 -0
- package/dist/portal-U554WDI9.js.map +1 -0
- package/dist/portal.js +2 -0
- package/dist/portal.js.map +1 -0
- package/dist/presence.js +243 -0
- package/dist/presence.js.map +1 -0
- package/dist/progress.js +106 -0
- package/dist/progress.js.map +1 -0
- package/dist/promise-state-BMi2zVoT.js +91 -0
- package/dist/promise-state-BMi2zVoT.js.map +1 -0
- package/dist/proper-links.js +136 -0
- package/dist/proper-links.js.map +1 -0
- package/dist/qp.js +77 -0
- package/dist/qp.js.map +1 -0
- package/dist/questionnaire.js +2 -0
- package/dist/questionnaire.js.map +1 -0
- package/dist/radio-group.js +149 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/rating.js +261 -0
- package/dist/rating.js.map +1 -0
- package/dist/resizable.js +2 -0
- package/dist/resizable.js.map +1 -0
- package/dist/resize-observer.js +85 -0
- package/dist/resize-observer.js.map +1 -0
- package/dist/roving-focus.js +355 -0
- package/dist/roving-focus.js.map +1 -0
- package/dist/scroll-area.js +2 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/scroll-end-Cer8JSIB.js +87 -0
- package/dist/scroll-end-Cer8JSIB.js.map +1 -0
- package/dist/scroll-lock.js +267 -0
- package/dist/scroll-lock.js.map +1 -0
- package/dist/scroller.js +117 -0
- package/dist/scroller.js.map +1 -0
- package/dist/select.js +1223 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.js +80 -0
- package/dist/separator.js.map +1 -0
- package/dist/service.js +160 -0
- package/dist/service.js.map +1 -0
- package/dist/shadowed.js +70 -0
- package/dist/shadowed.js.map +1 -0
- package/dist/slider.js +586 -0
- package/dist/slider.js.map +1 -0
- package/dist/sticky-footer.js +40 -0
- package/dist/sticky-footer.js.map +1 -0
- package/dist/store-BjiAd-KP.js +93 -0
- package/dist/store-BjiAd-KP.js.map +1 -0
- package/dist/store.js +4 -0
- package/dist/store.js.map +1 -0
- package/dist/switch.js +58 -0
- package/dist/switch.js.map +1 -0
- package/dist/tabs.js +458 -0
- package/dist/tabs.js.map +1 -0
- package/dist/toast.js +2 -0
- package/dist/toast.js.map +1 -0
- package/dist/toaster-DwprFZ1J.js +1518 -0
- package/dist/toaster-DwprFZ1J.js.map +1 -0
- package/dist/toggle-group.js +221 -0
- package/dist/toggle-group.js.map +1 -0
- package/dist/toggle.js +78 -0
- package/dist/toggle.js.map +1 -0
- package/dist/tooltip.js +422 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/typeahead.js +233 -0
- package/dist/typeahead.js.map +1 -0
- package/dist/viewport.js +138 -0
- package/dist/viewport.js.map +1 -0
- package/dist/visually-hidden.js +49 -0
- package/dist/visually-hidden.js.map +1 -0
- package/dist/zoetrope.js +336 -0
- package/dist/zoetrope.js.map +1 -0
- package/package.json +101 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import Modifier from 'ember-modifier';
|
|
2
|
+
/** An attribute's value in a part: `true` sets it empty, and `false`, `null` or `undefined` leave it off. */
|
|
3
|
+
export type AttributeValue = string | number | boolean | null | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* An attribute that merges with the element's own value instead of replacing it: given that
|
|
6
|
+
* value (`null` for none), it returns the part's. A list of ids or keys (`aria-describedby`,
|
|
7
|
+
* `aria-keyshortcuts`) keeps the caller's with `own => joinTokens(own, mine)`, and it is asked
|
|
8
|
+
* again whenever either side changes.
|
|
9
|
+
*/
|
|
10
|
+
export type AttributeMerge = (own: string | null) => AttributeValue;
|
|
11
|
+
/**
|
|
12
|
+
* Joins space-separated token lists, leaving out empty ones and repeats: what an
|
|
13
|
+
* `AttributeMerge` returns for an id or key list. `undefined` when nothing is left.
|
|
14
|
+
*/
|
|
15
|
+
export declare function joinTokens(...lists: (string | null | undefined)[]): string | undefined;
|
|
16
|
+
/** Event listeners by event name, as `{ click: …, keydown: … }`. */
|
|
17
|
+
export type PartListeners = {
|
|
18
|
+
[K in keyof HTMLElementEventMap]?: (event: HTMLElementEventMap[K]) => void;
|
|
19
|
+
};
|
|
20
|
+
/** What a part puts on its element. */
|
|
21
|
+
export interface PartSpec<E extends Element = HTMLElement> {
|
|
22
|
+
/**
|
|
23
|
+
* The part's attributes: its ARIA (`aria-expanded`, `aria-controls`), `role`, `id`,
|
|
24
|
+
* `data-state`, `data-slot` and `data-test-jn-part`. They are kept up to date, they win over
|
|
25
|
+
* the element's own (even when those re-render), and an attribute the part stops setting goes
|
|
26
|
+
* back to the element's own value. Put classes in `class`, not here. A function instead of a
|
|
27
|
+
* value merges with the element's own (see `AttributeMerge`).
|
|
28
|
+
*/
|
|
29
|
+
attributes?: Readonly<Record<string, AttributeValue | AttributeMerge>>;
|
|
30
|
+
/**
|
|
31
|
+
* Classes to add, space separated. They go next to the element's own, and stay when the
|
|
32
|
+
* element's own `class` re-renders.
|
|
33
|
+
*/
|
|
34
|
+
class?: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Listeners. As in Radix, a listener is skipped when an earlier one for the same event (one
|
|
37
|
+
* of the caller's own, on the same element) called `event.preventDefault()`.
|
|
38
|
+
*/
|
|
39
|
+
on?: PartListeners;
|
|
40
|
+
/**
|
|
41
|
+
* Called once, with the element, when the part is installed: to keep it for focus or
|
|
42
|
+
* positioning. It may return a cleanup, called when the element goes. It runs during
|
|
43
|
+
* rendering, so it must not change tracked state the template has read.
|
|
44
|
+
*/
|
|
45
|
+
element?: (element: E) => void | (() => void);
|
|
46
|
+
}
|
|
47
|
+
/** The signature of a part's modifier: the element it goes on, and the arguments it takes. */
|
|
48
|
+
export interface PartSignature<E extends Element = HTMLElement, Named extends object = Record<string, never>, Positional extends unknown[] = []> {
|
|
49
|
+
Element: E;
|
|
50
|
+
Args: {
|
|
51
|
+
Named: Named;
|
|
52
|
+
Positional: Positional;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** A part's modifier, as `part()` makes it. */
|
|
56
|
+
export type PartModifier<E extends Element = HTMLElement, Named extends object = Record<string, never>, Positional extends unknown[] = []> = typeof Modifier<PartSignature<E, Named, Positional>>;
|
|
57
|
+
/**
|
|
58
|
+
* A modifier that turns any element into one of a component's parts: it sets the part's
|
|
59
|
+
* attributes, adds its classes and listens for its events, and keeps them current. A component
|
|
60
|
+
* yields one for each part that callers may want to render themselves, which is how
|
|
61
|
+
* `<LinkTo {{d.trigger}}>` (or any element or component) becomes the trigger. The part's own
|
|
62
|
+
* component uses the same modifier, so both render the same thing:
|
|
63
|
+
*
|
|
64
|
+
* class Disclosure extends Component {
|
|
65
|
+
* open = controllable(this, 'open', false)
|
|
66
|
+
*
|
|
67
|
+
* trigger = part(() => ({
|
|
68
|
+
* attributes: {
|
|
69
|
+
* 'aria-expanded': String(this.open.value),
|
|
70
|
+
* 'aria-controls': idFor(this, 'content'),
|
|
71
|
+
* 'data-state': this.open.value ? 'open' : 'closed',
|
|
72
|
+
* 'data-test-jn-part': 'trigger',
|
|
73
|
+
* },
|
|
74
|
+
* on: { click: () => this.open.set(open => !open) },
|
|
75
|
+
* }))
|
|
76
|
+
*
|
|
77
|
+
* <template>
|
|
78
|
+
* {{yield (hash trigger=this.trigger Trigger=(component Trigger part=this.trigger))}}
|
|
79
|
+
* </template>
|
|
80
|
+
* }
|
|
81
|
+
*
|
|
82
|
+
* // the Trigger part: the caller's attributes, then the part's
|
|
83
|
+
* <As @as={{@as}} @tag="button" type="button" ...attributes {{@part}}>{{yield}}</As>
|
|
84
|
+
*
|
|
85
|
+
* The function runs again whenever tracked state it reads changes, and only what changed is
|
|
86
|
+
* touched on the element. A part that takes arguments, such as an item's value, reads them from
|
|
87
|
+
* the modifier's arguments: `part((named) => …)` for `<a {{m.item value="profile"}}>`.
|
|
88
|
+
*
|
|
89
|
+
* The part's attributes win over the element's own, and its classes add to the element's.
|
|
90
|
+
* That holds when the element's own re-render (a `class` that changes, as LinkTo's does on
|
|
91
|
+
* every route change, or `title={{this.title}}`): the part puts its own back, and keeps the
|
|
92
|
+
* element's new value to restore when it stops setting that attribute. Where two parts on one
|
|
93
|
+
* element set the same attribute, the last to set it wins. On events, the caller's listeners
|
|
94
|
+
* run first when they come first (`...attributes` before the part modifier), and can stop the
|
|
95
|
+
* part's by calling `preventDefault()`. The function's `this` is the modifier, which has the app's
|
|
96
|
+
* owner (for `translate(this, …)`).
|
|
97
|
+
*/
|
|
98
|
+
export declare function part<E extends Element = HTMLElement, Named extends object = Record<string, never>, Positional extends unknown[] = []>(spec: (this: object, named: Named, positional: Positional) => PartSpec<E>): PartModifier<E, Named, Positional>;
|
|
99
|
+
//# sourceMappingURL=part.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"part.d.ts","sourceRoot":"","sources":["../src/part.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AAIrC,6GAA6G;AAC7G,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,cAAc,CAAA;AAEnE;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,GAAG,SAAS,CAGtF;AAED,oEAAoE;AACpE,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,MAAM,mBAAmB,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,IAAI;CAC3E,CAAA;AAED,uCAAuC;AACvC,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,OAAO,GAAG,WAAW;IACvD;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAAC,CAAC,CAAA;IACtE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;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{ TOC } from '@ember/component/template-only';
|
|
3
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
4
|
+
import { type TagName } from './as';
|
|
5
|
+
import type { AnchorData, AnchorOptions } from './anchor/index.ts';
|
|
6
|
+
import { type ControllableArgs } from './controllable-state.ts';
|
|
7
|
+
import { type DismissReason, type FocusOutsideEvent, type PointerDownOutsideEvent } from './dismiss.ts';
|
|
8
|
+
import { type PartModifier } from './part.ts';
|
|
9
|
+
import { ElementRef, PlacedData, type PopperContentArgs } from './-private/popper';
|
|
10
|
+
/** ember-primitives' Popover arguments, which every Content of the popover takes from its root. */
|
|
11
|
+
type PopoverPositionArgs = Pick<PopperContentArgs, 'placement' | 'offsetOptions' | 'flipOptions' | 'shiftOptions' | 'middleware' | 'strategy'>;
|
|
12
|
+
/** What a `<Popover>` takes. */
|
|
13
|
+
export type PopoverArgs = ControllableArgs<'open', boolean> & PopoverPositionArgs & {
|
|
14
|
+
/**
|
|
15
|
+
* Whether it is modal: focus stays inside, and until it closes the rest of the page ignores
|
|
16
|
+
* the pointer, is hidden from assistive technology and doesn't scroll. Default `false`.
|
|
17
|
+
*/
|
|
18
|
+
modal?: boolean;
|
|
19
|
+
/** Its name, for `PopoverHarness` (`data-test-jn-name`). */
|
|
20
|
+
name?: string;
|
|
21
|
+
};
|
|
22
|
+
/** What a popover's Content takes: where it goes (Radix's Popper arguments) and what it does. */
|
|
23
|
+
export interface PopoverContentArgs extends PopperContentArgs {
|
|
24
|
+
/** The tag to render. Default `div`. */
|
|
25
|
+
as?: TagName;
|
|
26
|
+
/** Keep it rendered while closed, for animating it yourself. */
|
|
27
|
+
forceMount?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Called when it opens, before focus moves in (to its first focusable element that isn't a
|
|
30
|
+
* link, or the content itself). `preventDefault()` to move focus yourself.
|
|
31
|
+
*/
|
|
32
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Called when it has closed, before focus goes back to the trigger. `preventDefault()` to send
|
|
35
|
+
* focus somewhere else.
|
|
36
|
+
*/
|
|
37
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
38
|
+
/** Escape was pressed. `preventDefault()` keeps it open. */
|
|
39
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
40
|
+
/** A pointer went down outside it. `preventDefault()` keeps it open. */
|
|
41
|
+
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
|
|
42
|
+
/** Focus moved outside it. `preventDefault()` keeps it open. */
|
|
43
|
+
onFocusOutside?: (event: FocusOutsideEvent) => void;
|
|
44
|
+
/** Either of the last two, after its own handler. `preventDefault()` keeps it open. */
|
|
45
|
+
onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;
|
|
46
|
+
}
|
|
47
|
+
export interface PopoverPartSignature<E extends Element> {
|
|
48
|
+
Args: {
|
|
49
|
+
/** The part's modifier, bound by the popover. */
|
|
50
|
+
part: PartModifier;
|
|
51
|
+
/** The tag to render instead. */
|
|
52
|
+
as?: TagName;
|
|
53
|
+
};
|
|
54
|
+
Blocks: {
|
|
55
|
+
default: [];
|
|
56
|
+
};
|
|
57
|
+
Element: E;
|
|
58
|
+
}
|
|
59
|
+
/** A `<button type="button">`, or `@as`, that opens and closes the popover. */
|
|
60
|
+
declare const PopoverTrigger: TOC<PopoverPartSignature<HTMLButtonElement>>;
|
|
61
|
+
/** An element to place the content against instead of the trigger: Radix's `Popover.Anchor`. */
|
|
62
|
+
declare const PopoverAnchor: TOC<PopoverPartSignature<HTMLDivElement>>;
|
|
63
|
+
/** A `<button type="button">`, or `@as`, that closes the popover. */
|
|
64
|
+
declare const PopoverClose: TOC<PopoverPartSignature<HTMLButtonElement>>;
|
|
65
|
+
/** An `<h2>`, or `@as`, that names the content (its `aria-labelledby`). */
|
|
66
|
+
declare const PopoverTitle: TOC<PopoverPartSignature<HTMLHeadingElement>>;
|
|
67
|
+
/** A `<p>`, or `@as`, that describes the content (its `aria-describedby`). */
|
|
68
|
+
declare const PopoverDescription: TOC<PopoverPartSignature<HTMLParagraphElement>>;
|
|
69
|
+
export interface PopoverContentSignature {
|
|
70
|
+
Args: PopoverContentArgs & {
|
|
71
|
+
/** @internal Bound by the popover. */
|
|
72
|
+
popover: Popover;
|
|
73
|
+
};
|
|
74
|
+
Blocks: {
|
|
75
|
+
default: [];
|
|
76
|
+
};
|
|
77
|
+
Element: HTMLDivElement;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The popover itself: in the top layer while it is open (and while it animates out), placed
|
|
81
|
+
* against its trigger (or Anchor), flipping to stay in view, with Escape and presses outside
|
|
82
|
+
* closing it and focus moving in when it opens and back when it closes. While a modal one is
|
|
83
|
+
* open, the rest of the page is hidden from assistive technology and its scroll is locked (the
|
|
84
|
+
* content still scrolls, and a pinch still zooms), as Radix's `RemoveScroll` does.
|
|
85
|
+
*/
|
|
86
|
+
declare class PopoverContent extends Component<PopoverContentSignature> {
|
|
87
|
+
get popover(): Popover;
|
|
88
|
+
get anchorOptions(): AnchorOptions;
|
|
89
|
+
/** Focus moves in and is kept while it is shown; a force-mounted content that is closed is left alone. */
|
|
90
|
+
get scopesFocus(): boolean;
|
|
91
|
+
onOpenAutoFocus: (event: Event) => void;
|
|
92
|
+
onCloseAutoFocus: (event: Event) => void;
|
|
93
|
+
onEscapeKeyDown: (event: KeyboardEvent) => void;
|
|
94
|
+
onPointerDownOutside: (event: PointerDownOutsideEvent) => void;
|
|
95
|
+
onFocusOutside: (event: FocusOutsideEvent) => void;
|
|
96
|
+
onInteractOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;
|
|
97
|
+
}
|
|
98
|
+
export interface PopoverArrowSignature {
|
|
99
|
+
Args: {
|
|
100
|
+
/** @internal Bound by the popover. */
|
|
101
|
+
popover: Popover;
|
|
102
|
+
/** Its width, in pixels. Default 10. */
|
|
103
|
+
width?: number;
|
|
104
|
+
/** Its height, in pixels. Default 5. */
|
|
105
|
+
height?: number;
|
|
106
|
+
};
|
|
107
|
+
/** A shape of your own instead of the triangle, inside the `<svg>`. */
|
|
108
|
+
Blocks: {
|
|
109
|
+
default: [];
|
|
110
|
+
};
|
|
111
|
+
Element: SVGSVGElement;
|
|
112
|
+
}
|
|
113
|
+
/** Radix's `Popover.Arrow`: an `<svg>` triangle on the content's edge, pointing at the trigger. */
|
|
114
|
+
declare const PopoverArrow: TOC<PopoverArrowSignature>;
|
|
115
|
+
/** What a `<Popover>` yields: its parts, their modifiers, where its content went, and its state. */
|
|
116
|
+
export interface PopoverBlockParams {
|
|
117
|
+
/** A `<button>` that opens and closes it (`@as` for another tag). */
|
|
118
|
+
Trigger: WithBoundArgs<typeof PopoverTrigger, 'part'>;
|
|
119
|
+
/** Something to place the content against instead of the trigger. */
|
|
120
|
+
Anchor: WithBoundArgs<typeof PopoverAnchor, 'part'>;
|
|
121
|
+
/** The popover itself, in the top layer while it is open. */
|
|
122
|
+
Content: WithBoundArgs<typeof PopoverContent, 'popover'>;
|
|
123
|
+
/** A `<button>` that closes it. */
|
|
124
|
+
Close: WithBoundArgs<typeof PopoverClose, 'part'>;
|
|
125
|
+
/** An arrow on the content's edge, pointing at the trigger. Put it inside the Content. */
|
|
126
|
+
Arrow: WithBoundArgs<typeof PopoverArrow, 'popover'>;
|
|
127
|
+
/** An `<h2>` that names the content. */
|
|
128
|
+
Title: WithBoundArgs<typeof PopoverTitle, 'part'>;
|
|
129
|
+
/** A `<p>` that describes the content. */
|
|
130
|
+
Description: WithBoundArgs<typeof PopoverDescription, 'part'>;
|
|
131
|
+
/** Makes your own element or component the trigger: `<Button {{p.trigger}}>`. */
|
|
132
|
+
trigger: PartModifier;
|
|
133
|
+
/** Makes your own element the anchor. */
|
|
134
|
+
anchor: PartModifier;
|
|
135
|
+
/** Makes your own element or component close the popover. */
|
|
136
|
+
close: PartModifier;
|
|
137
|
+
/** Makes your own element the title. */
|
|
138
|
+
title: PartModifier;
|
|
139
|
+
/** Makes your own element the description. */
|
|
140
|
+
description: PartModifier;
|
|
141
|
+
/** Makes your own element the arrow, which the content places on its edge (ember-primitives'). */
|
|
142
|
+
arrow: PartModifier;
|
|
143
|
+
/** ember-primitives' name for `anchor`: the element the content is placed against. */
|
|
144
|
+
reference: PartModifier;
|
|
145
|
+
/** Sets that element yourself, from a modifier of your own (ember-primitives'). */
|
|
146
|
+
setReference: (element: HTMLElement | SVGElement) => void;
|
|
147
|
+
/** Where the content went: its placement, position and middleware data (ember-primitives'). */
|
|
148
|
+
data: AnchorData | undefined;
|
|
149
|
+
/** Whether it is open. */
|
|
150
|
+
isOpen: boolean;
|
|
151
|
+
/** Whether it is modal. */
|
|
152
|
+
isModal: boolean;
|
|
153
|
+
/** Opens it. */
|
|
154
|
+
open: () => void;
|
|
155
|
+
/** Opens it if it is closed, and closes it if it is open. */
|
|
156
|
+
toggle: () => void;
|
|
157
|
+
/** Opens (`true`) or closes (`false`) it: `(fn p.setOpen false)`. */
|
|
158
|
+
setOpen: (open: boolean) => void;
|
|
159
|
+
}
|
|
160
|
+
export interface PopoverSignature {
|
|
161
|
+
Args: PopoverArgs;
|
|
162
|
+
Blocks: {
|
|
163
|
+
default: [PopoverBlockParams];
|
|
164
|
+
};
|
|
165
|
+
/** An element with `display: contents`, so it doesn't change the layout. */
|
|
166
|
+
Element: HTMLDivElement;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Rich content in a layer, opened by a button, as Radix's Popover (which shadcn's is built on),
|
|
170
|
+
* and covering ember-primitives' Popover. It renders no box of its own, and yields its parts:
|
|
171
|
+
*
|
|
172
|
+
* <Popover as |p|>
|
|
173
|
+
* <p.Trigger>Open</p.Trigger>
|
|
174
|
+
* <p.Content @side="bottom" @align="start" @sideOffset={{4}}>
|
|
175
|
+
* <p.Title>Dimensions</p.Title>
|
|
176
|
+
* …
|
|
177
|
+
* <p.Close>Done</p.Close>
|
|
178
|
+
* </p.Content>
|
|
179
|
+
* </Popover>
|
|
180
|
+
*
|
|
181
|
+
* Its state is its own, or yours with `@open` and `@onOpenChange` (and `@defaultOpen` to start
|
|
182
|
+
* open). While it is open, the content is in the browser's top layer (above everything, with no
|
|
183
|
+
* portal), placed against the trigger and flipped to the other side when there's no room;
|
|
184
|
+
* Escape or a press outside closes it; and focus moves into it, and back to the trigger when it
|
|
185
|
+
* closes. It animates out: it stays until a `data-state="closed"` animation ends.
|
|
186
|
+
*
|
|
187
|
+
* ember-primitives' arguments (`@placement`, `@offsetOptions`, `@flipOptions`,
|
|
188
|
+
* `@shiftOptions`, `@middleware`, `@strategy`) go on the root or the Content, and it yields
|
|
189
|
+
* `reference`, `setReference`, `arrow` and `data` as ember-primitives' does.
|
|
190
|
+
*/
|
|
191
|
+
export declare class Popover extends Component<PopoverSignature> {
|
|
192
|
+
#private;
|
|
193
|
+
openState: import("./controllable-state.ts").ControllableState<NonNullable<boolean | undefined>>;
|
|
194
|
+
triggerRef: ElementRef<HTMLElement>;
|
|
195
|
+
anchorRef: ElementRef<HTMLElement>;
|
|
196
|
+
arrowRef: ElementRef<HTMLElement>;
|
|
197
|
+
titleRef: ElementRef<HTMLElement>;
|
|
198
|
+
descriptionRef: ElementRef<HTMLElement>;
|
|
199
|
+
placed: PlacedData;
|
|
200
|
+
get id(): string;
|
|
201
|
+
get contentId(): string;
|
|
202
|
+
get isOpen(): boolean;
|
|
203
|
+
get isModal(): boolean;
|
|
204
|
+
get state(): 'open' | 'closed';
|
|
205
|
+
/**
|
|
206
|
+
* Whether focus is kept inside, and the rest of the page hidden and kept from scrolling: while
|
|
207
|
+
* a modal popover is open (not while it animates out).
|
|
208
|
+
*/
|
|
209
|
+
get trapsFocus(): boolean;
|
|
210
|
+
/** What the content is placed against: the Anchor, or else the trigger. */
|
|
211
|
+
get reference(): Element | null;
|
|
212
|
+
/** The elements that count as part of the content: the trigger, which toggles it itself. */
|
|
213
|
+
get inside(): Array<Element | null>;
|
|
214
|
+
/** What names the content: its Title, or else its trigger. */
|
|
215
|
+
get labelledBy(): string | undefined;
|
|
216
|
+
get describedBy(): string | undefined;
|
|
217
|
+
setOpen: (open: boolean) => void;
|
|
218
|
+
show: () => void;
|
|
219
|
+
hide: () => void;
|
|
220
|
+
toggle: () => void;
|
|
221
|
+
dismiss: (_reason: DismissReason) => void;
|
|
222
|
+
setReference: (element: HTMLElement | SVGElement) => void;
|
|
223
|
+
closeAutoFocus(event: Event, handler?: (event: Event) => void): void;
|
|
224
|
+
pointerDownOutside(event: PointerDownOutsideEvent, handler?: (event: PointerDownOutsideEvent) => void): void;
|
|
225
|
+
focusOutside(event: FocusOutsideEvent, handler?: (event: FocusOutsideEvent) => void): void;
|
|
226
|
+
interactOutside(event: PointerDownOutsideEvent | FocusOutsideEvent, handler?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void): void;
|
|
227
|
+
trigger: PartModifier;
|
|
228
|
+
anchor: PartModifier;
|
|
229
|
+
close: PartModifier;
|
|
230
|
+
title: PartModifier;
|
|
231
|
+
description: PartModifier;
|
|
232
|
+
arrow: PartModifier;
|
|
233
|
+
content: PartModifier;
|
|
234
|
+
}
|
|
235
|
+
export default Popover;
|
|
236
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../src/popover.gts"],"names":[],"mappings":"AAqoBA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAI1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAM,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC7E,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC7B,MAAM,c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Y,CAIhB;IAEH,KAAK,EAAE,YAAY,CAMhB;IAEH,WAAW,EAAE,YAAY,CAMtB;IAEH,KAAK,EAAE,YAAY,CAMhB;IAEH,OAAO,EAAE,YAAY,CASlB;CA4CJ;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/portal/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AACrE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { TOC } from '@ember/component/template-only';
|
|
2
|
+
import { type PortalName } from './targets';
|
|
3
|
+
/**
|
|
4
|
+
* The element for an id or a selector, as ember-primitives' `wormhole` (ember-wormhole's
|
|
5
|
+
* `destinationElementId`): `<Portal @to={{wormhole "sidebar"}}>`. An element is returned as is.
|
|
6
|
+
*/
|
|
7
|
+
export declare function wormhole(query: string | Element | null | undefined): Element | null;
|
|
8
|
+
export interface PortalSignature {
|
|
9
|
+
Args: {
|
|
10
|
+
/**
|
|
11
|
+
* Where to render: a target's name (`popover`, `tooltip`, `modal`, a `<PortalTarget
|
|
12
|
+
* @name>`, or a selector), found nearest to the portal, or an element. Without `@to` or
|
|
13
|
+
* `@wormhole`, the content goes at the end of `<body>`, as Radix's Portal does.
|
|
14
|
+
*/
|
|
15
|
+
to?: PortalName | (string & {}) | Element;
|
|
16
|
+
/**
|
|
17
|
+
* Add to what the target holds, instead of replacing it. Default `false`, as in
|
|
18
|
+
* ember-primitives. Rendering to `<body>` always appends.
|
|
19
|
+
*/
|
|
20
|
+
append?: boolean;
|
|
21
|
+
/** ember-wormhole's way: an element's id, or a selector, or an element. Always appends. */
|
|
22
|
+
wormhole?: string | Element;
|
|
23
|
+
};
|
|
24
|
+
Blocks: {
|
|
25
|
+
/** The content to render elsewhere. */
|
|
26
|
+
default: [];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Renders its content somewhere else in the document, as ember-primitives' and Radix's
|
|
31
|
+
* `Portal` do: in a named target, an element, an id (`@wormhole`), or the end of `<body>`.
|
|
32
|
+
* The content stays part of the component that renders it (its state, actions and
|
|
33
|
+
* destruction), only its DOM moves.
|
|
34
|
+
*
|
|
35
|
+
* <PortalTargets /> {{! once, in the application template }}
|
|
36
|
+
*
|
|
37
|
+
* <Portal @to="popover">…</Portal> {{! renders in the popover target }}
|
|
38
|
+
* <Portal>…</Portal> {{! renders at the end of <body> }}
|
|
39
|
+
*
|
|
40
|
+
* Joinery's overlays don't need one: the top layer (`topLayer`) puts them above everything
|
|
41
|
+
* without moving them. Use a portal where the DOM position matters, such as rendering into
|
|
42
|
+
* another part of the page. A part rendered elsewhere carries `data-test-jn-owner`, so the
|
|
43
|
+
* harnesses still find it.
|
|
44
|
+
*/
|
|
45
|
+
export declare const Portal: TOC<PortalSignature>;
|
|
46
|
+
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/portal/portal.gts"],"names":[],"mappings":"AA+KA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAA;AAEzD,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAA;AAIlE;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAInF;AA2JD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE;QACJ;;;;WAIG;QACH,EAAE,CAAC,EAAE,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,OAAO,CAAA;QACzC;;;WAGG;QACH,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,2FAA2F;QAC3F,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAC5B,CAAA;IACD,MAAM,EAAE;QACN,uCAAuC;QACvC,OAAO,EAAE,EAAE,CAAA;KACZ,CAAA;CACF;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,EAAE,GAAG,CAAC,eAAe,CA8CtC,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { TOC } from '@ember/component/template-only';
|
|
2
|
+
/**
|
|
3
|
+
* The names of the targets `<PortalTargets>` renders, as ember-primitives' `PORTALS`. `@to`
|
|
4
|
+
* also takes the short names: `<Portal @to="popover">`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PORTALS: Readonly<{
|
|
7
|
+
popover: "joinery__portal-targets__popover";
|
|
8
|
+
tooltip: "joinery__portal-targets__tooltip";
|
|
9
|
+
modal: "joinery__portal-targets__modal";
|
|
10
|
+
}>;
|
|
11
|
+
/** A target `<PortalTargets>` renders, by its short name or its full one. */
|
|
12
|
+
export type PortalName = keyof typeof PORTALS | (typeof PORTALS)[keyof typeof PORTALS];
|
|
13
|
+
/**
|
|
14
|
+
* The target nearest to `origin` for a portal name, as ember-primitives' `findNearestTarget`:
|
|
15
|
+
* from the origin's parent up to the document, the first ancestor holding a target. A target
|
|
16
|
+
* is a `<PortalTarget @name>` registered under the name, or else, for the names `PORTALS`
|
|
17
|
+
* lists, an element with that `data-portal-name`, and for any other name, an element matching
|
|
18
|
+
* it as a selector.
|
|
19
|
+
*/
|
|
20
|
+
export declare function findNearestTarget(origin: Element, name: string): Element | undefined;
|
|
21
|
+
export interface PortalTargetsSignature {
|
|
22
|
+
Element: null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The three targets ember-primitives' `<PortalTargets>` renders, for popovers, tooltips and
|
|
26
|
+
* modals, each an empty `<div data-portal-name>`. Put it once near the end of your application
|
|
27
|
+
* template, and `<Portal @to="popover">` renders there. Joinery's own overlays use the top
|
|
28
|
+
* layer and need no target.
|
|
29
|
+
*/
|
|
30
|
+
export declare const PortalTargets: TOC<PortalTargetsSignature>;
|
|
31
|
+
export interface PortalTargetSignature {
|
|
32
|
+
Element: HTMLDivElement;
|
|
33
|
+
Args: {
|
|
34
|
+
/** The name a `<Portal @to>` finds it by. */
|
|
35
|
+
name: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** A target of your own: `<PortalTarget @name="sidebar" />`, for `<Portal @to="sidebar">`. */
|
|
39
|
+
export declare const PortalTarget: TOC<PortalTargetSignature>;
|
|
40
|
+
//# sourceMappingURL=targets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../src/portal/targets.gts"],"names":[],"mappings":"AAgIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAA;AAGzD;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;EAIlB,CAAA;AAEF,6EAA6E;AAC7E,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAA;AAkCtF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAuBpF;AAgBD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAA;CACd;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,GAAG,CAAC,sBAAsB,CA0BpD,CAAA;AAEF,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE;QACJ,6CAA6C;QAC7C,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;CACF;AAED,8FAA8F;AAC9F,eAAO,MAAM,YAAY,EAAE,GAAG,CAAC,qBAAqB,CASlD,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import Modifier from 'ember-modifier';
|
|
3
|
+
import type Owner from '@ember/owner';
|
|
4
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
5
|
+
interface PresenceRefSignature {
|
|
6
|
+
Element: Element;
|
|
7
|
+
Args: {
|
|
8
|
+
Named: {
|
|
9
|
+
presence: Presence;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** Tells a `Presence` which element animates, and runs after each render that changes it. */
|
|
14
|
+
declare class PresenceRef extends Modifier<PresenceRefSignature> {
|
|
15
|
+
#private;
|
|
16
|
+
modify(element: Element, _: [], { presence }: {
|
|
17
|
+
presence: Presence;
|
|
18
|
+
}): void;
|
|
19
|
+
}
|
|
20
|
+
export interface PresenceSignature {
|
|
21
|
+
Args: {
|
|
22
|
+
/** Whether the content should be shown: usually the part's open state. */
|
|
23
|
+
present: boolean;
|
|
24
|
+
/** Keep the content rendered even when it isn't present, for animating it yourself. */
|
|
25
|
+
forceMount?: boolean;
|
|
26
|
+
};
|
|
27
|
+
Blocks: {
|
|
28
|
+
default: [
|
|
29
|
+
presence: {
|
|
30
|
+
/**
|
|
31
|
+
* Put it on the element whose `data-state` drives the exit animation, so Presence
|
|
32
|
+
* can wait for that animation before removing it.
|
|
33
|
+
*/
|
|
34
|
+
ref: WithBoundArgs<typeof PresenceRef, 'presence'>;
|
|
35
|
+
/** `@present`: false while the content is on its way out. */
|
|
36
|
+
isPresent: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the content is on its way out: `@present` is false and its exit animation
|
|
39
|
+
* hasn't ended. With `@forceMount`, which keeps the content rendered, it says when to
|
|
40
|
+
* hide it, as Radix's Collapsible does with `hidden`.
|
|
41
|
+
*/
|
|
42
|
+
isExiting: boolean;
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Keeps a part rendered while it animates out, as Radix's `Presence` does. The content renders
|
|
49
|
+
* while `@present` is true. When it turns false, the part's `data-state` becomes `closed` and
|
|
50
|
+
* Presence looks at the element given `ref`: if a new CSS animation started (the part's exit
|
|
51
|
+
* animation, such as `data-[state=closed]:animate-out`), the content stays until it ends, and
|
|
52
|
+
* otherwise it goes at once. Turning `@present` back on during the exit keeps it.
|
|
53
|
+
*
|
|
54
|
+
* <Presence @present={{this.open.value}} as |presence|>
|
|
55
|
+
* <div {{presence.ref}} data-state={{if this.open.value "open" "closed"}}>…</div>
|
|
56
|
+
* </Presence>
|
|
57
|
+
*
|
|
58
|
+
* `ref` can go anywhere among the element's modifiers, before or after the part modifier that
|
|
59
|
+
* sets `data-state`: Presence looks for the animation once the render is over.
|
|
60
|
+
*
|
|
61
|
+
* Tests wait for the exit: `settled()` resolves once the content is gone.
|
|
62
|
+
*/
|
|
63
|
+
export declare class Presence extends Component<PresenceSignature> {
|
|
64
|
+
#private;
|
|
65
|
+
/** Whether an element has been given `ref`; without one there is nothing to wait for. */
|
|
66
|
+
private observed;
|
|
67
|
+
constructor(owner: Owner, args: PresenceSignature['Args']);
|
|
68
|
+
get isRendered(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the content is leaving: not present, and not yet exited. While it is present this
|
|
71
|
+
* reads only `@present`, so the render that makes it present again may send `enter()`.
|
|
72
|
+
*/
|
|
73
|
+
get isExiting(): boolean;
|
|
74
|
+
/** Called by `ref` after every render that touches the element or `@present`. */
|
|
75
|
+
observe(element: Element): void;
|
|
76
|
+
/** Called when the element given `ref` is removed. */
|
|
77
|
+
release(element: Element): void;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=presence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../src/presence.g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ACH,IAAI,SAAS,IAAI,OAAO,CAGvB;IAED,iFAAiF;IACjF,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAU/B,sDAAsD;IACtD,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAoGhC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { TOC } from '@ember/component/template-only';
|
|
3
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
4
|
+
/**
|
|
5
|
+
* Where a progress bar is, as Radix's `data-state`: `indeterminate` without a value, `complete`
|
|
6
|
+
* at its max, and `loading` in between.
|
|
7
|
+
*/
|
|
8
|
+
export type ProgressState = 'indeterminate' | 'loading' | 'complete';
|
|
9
|
+
/** Names a value for assistive technology (`aria-valuetext`), as Radix's `getValueLabel`. */
|
|
10
|
+
export type ProgressValueLabel = (value: number, max: number) => string;
|
|
11
|
+
/** A progress bar's value, resolved from its arguments. */
|
|
12
|
+
export interface ResolvedProgress {
|
|
13
|
+
/** The value, clamped to `[0, max]`, or `null` when it is indeterminate. */
|
|
14
|
+
value: number | null;
|
|
15
|
+
/** The max: `@max`, or 100 when that isn't a number above 0. */
|
|
16
|
+
max: number;
|
|
17
|
+
/** How far along it is, from 0 to 100, rounded to two places (0 when indeterminate). */
|
|
18
|
+
percent: number;
|
|
19
|
+
/** How far along it is, from 0 to 1 (0 when indeterminate). */
|
|
20
|
+
decimal: number;
|
|
21
|
+
state: ProgressState;
|
|
22
|
+
}
|
|
23
|
+
/** Radix's `data-state` for a value and its max. */
|
|
24
|
+
export declare function progressState(value: number | null | undefined, max: number): ProgressState;
|
|
25
|
+
/** The value as a whole percentage, `33%`: Radix's and ember-primitives' default value label. */
|
|
26
|
+
export declare function defaultProgressLabel(value: number, max: number): string;
|
|
27
|
+
/** What a progress bar renders for a value and a max, as `<Progress>` resolves them. */
|
|
28
|
+
export declare function resolveProgress(value: number | null | undefined, max: number | null | undefined): ResolvedProgress;
|
|
29
|
+
export interface ProgressIndicatorSignature {
|
|
30
|
+
Args: {
|
|
31
|
+
/** Set by `<Progress>`. */
|
|
32
|
+
progress: ResolvedProgress;
|
|
33
|
+
};
|
|
34
|
+
Blocks: {
|
|
35
|
+
default: [];
|
|
36
|
+
};
|
|
37
|
+
Element: HTMLDivElement;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The bar inside a progress bar, as Radix's `Progress.Indicator` and ember-primitives'
|
|
41
|
+
* `Indicator`: a `div` with the progress bar's state, for you to size or move with CSS
|
|
42
|
+
* (`width: {{p.percent}}%`, or a transform, as the styled Progress does).
|
|
43
|
+
*/
|
|
44
|
+
export declare const ProgressIndicator: TOC<ProgressIndicatorSignature>;
|
|
45
|
+
/** What `<Progress>` yields. */
|
|
46
|
+
export interface ProgressYield {
|
|
47
|
+
/** The bar, with the progress bar's state on it. */
|
|
48
|
+
Indicator: WithBoundArgs<typeof ProgressIndicator, 'progress'>;
|
|
49
|
+
/** The value, clamped to `[0, max]`, or `null` while it is indeterminate. */
|
|
50
|
+
value: number | null;
|
|
51
|
+
/** The max. */
|
|
52
|
+
max: number;
|
|
53
|
+
/** How far along it is, from 0 to 100, rounded to two places. */
|
|
54
|
+
percent: number;
|
|
55
|
+
/** How far along it is, from 0 to 1. */
|
|
56
|
+
decimal: number;
|
|
57
|
+
state: ProgressState;
|
|
58
|
+
}
|
|
59
|
+
export interface ProgressSignature {
|
|
60
|
+
Args: {
|
|
61
|
+
/**
|
|
62
|
+
* How far along it is, from 0 to `@max`. A value outside that range is clamped into it;
|
|
63
|
+
* leave it out (or pass `null`) while there's no telling, and the bar is indeterminate.
|
|
64
|
+
*/
|
|
65
|
+
value?: number | null;
|
|
66
|
+
/** The value it completes at. Default 100. */
|
|
67
|
+
max?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Names the value for assistive technology (`aria-valuetext`). Default the whole
|
|
70
|
+
* percentage, `33%`.
|
|
71
|
+
*/
|
|
72
|
+
getValueLabel?: ProgressValueLabel;
|
|
73
|
+
/** Its name, for its harness (`data-test-jn-name`). */
|
|
74
|
+
name?: string;
|
|
75
|
+
};
|
|
76
|
+
Blocks: {
|
|
77
|
+
default: [ProgressYield];
|
|
78
|
+
};
|
|
79
|
+
Element: HTMLDivElement;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Shows how far along a task is, as ember-primitives' and Radix's `Progress`: a `div` with the
|
|
83
|
+
* `progressbar` role, its value in ARIA and data attributes, and an `Indicator` to draw. It has
|
|
84
|
+
* no styles; the styled Progress is built on it.
|
|
85
|
+
*
|
|
86
|
+
* <Progress @value={{this.uploaded}} aria-label="Upload" as |p|>
|
|
87
|
+
* <p.Indicator style="width: {{p.percent}}%" />
|
|
88
|
+
* </Progress>
|
|
89
|
+
*
|
|
90
|
+
* Give it a name: `aria-label`, or `aria-labelledby` naming its label (a `<label for>` doesn't
|
|
91
|
+
* name a progress bar).
|
|
92
|
+
*/
|
|
93
|
+
export declare class Progress extends Component<ProgressSignature> {
|
|
94
|
+
get progress(): ResolvedProgress;
|
|
95
|
+
get valueText(): string | undefined;
|
|
96
|
+
}
|
|
97
|
+
export default Progress;
|
|
98
|
+
//# sourceMappingURL=progress.d.ts.map
|