@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.
- package/CHANGELOG.md +472 -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 +307 -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,400 @@
|
|
|
1
|
+
import Modifier from 'ember-modifier';
|
|
2
|
+
import { ControllableState } from '../controllable-state.ts';
|
|
3
|
+
import { type PartModifier, type PartSpec } from '../part.ts';
|
|
4
|
+
import { type QuestionnaireItemDefinition, type QuestionnaireItemRegistration, type QuestionnaireItemStatus, type QuestionnaireShortcutMode } from './utils.ts';
|
|
5
|
+
/** The state a navigation button renders: upstream's `QuestionnaireNavigationState`. */
|
|
6
|
+
export interface QuestionnaireNavigationOptions {
|
|
7
|
+
/** Whether it is disabled (the caller's choice: it never disables itself). */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Where a `QuestionnaireState` reads its settings. Each is a function, so it reads them live. */
|
|
11
|
+
export interface QuestionnaireOptions {
|
|
12
|
+
/** The collection of items, for progress, the actions and the shortcuts from the first render. */
|
|
13
|
+
items?: () => readonly QuestionnaireItemDefinition[] | undefined;
|
|
14
|
+
/** The active item, when the caller controls it. */
|
|
15
|
+
item?: () => string | undefined;
|
|
16
|
+
/** The item it starts on, when uncontrolled. Default the first enabled item. */
|
|
17
|
+
defaultItem?: () => string | undefined;
|
|
18
|
+
/** Called with the name of each item it moves to. */
|
|
19
|
+
onItemChange?: () => ((item: string) => void) | undefined;
|
|
20
|
+
/** The keys that pick a fixed answer. */
|
|
21
|
+
shortcuts?: () => QuestionnaireShortcutMode | undefined;
|
|
22
|
+
/** `false` turns on the browser's own validation of filled answers. Default `true`. */
|
|
23
|
+
noValidate?: () => boolean | undefined;
|
|
24
|
+
/** Called when every item is valid and the form submits. */
|
|
25
|
+
onSubmit?: () => ((event: SubmitEvent) => void) | undefined;
|
|
26
|
+
/** Called when the form resets, before the answers go back to their defaults. */
|
|
27
|
+
onReset?: () => ((event: Event) => void) | undefined;
|
|
28
|
+
}
|
|
29
|
+
interface PendingFocus {
|
|
30
|
+
name: string;
|
|
31
|
+
target: 'item' | 'invalid';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A questionnaire's state and behaviour, as `@shadcn/react`'s Questionnaire has them: the
|
|
35
|
+
* ordered items, the active one, progress, validation, navigation and its keyboard. The root
|
|
36
|
+
* is a native `<form>`, and answers are read with `FormData`.
|
|
37
|
+
*
|
|
38
|
+
* questionnaire = new QuestionnaireState(this, {
|
|
39
|
+
* items: () => this.args.items,
|
|
40
|
+
* onSubmit: () => this.args.onSubmit,
|
|
41
|
+
* })
|
|
42
|
+
* <form {{this.questionnaire.root}} {{this.questionnaire.focusEffect this.questionnaire.activeName}}>
|
|
43
|
+
*/
|
|
44
|
+
export declare class QuestionnaireState {
|
|
45
|
+
#private;
|
|
46
|
+
/** Bumped after items come or go, so what depends on them renders again. */
|
|
47
|
+
revision: number;
|
|
48
|
+
/**
|
|
49
|
+
* The first item, taken without a word while the state, uncontrolled, has named none of its
|
|
50
|
+
* own yet (no `@items` and no `@defaultItem`, before the items render), as upstream does.
|
|
51
|
+
*/
|
|
52
|
+
private settledOn;
|
|
53
|
+
/** The form, once rendered. */
|
|
54
|
+
element: HTMLFormElement | null;
|
|
55
|
+
/** The active item's name, controlled (`@item`) or the questionnaire's own. */
|
|
56
|
+
readonly active: ControllableState<string | null>;
|
|
57
|
+
/** Put it on the `<form>`: its listeners and state attributes. */
|
|
58
|
+
readonly root: PartModifier<HTMLFormElement>;
|
|
59
|
+
/** Put it on the progress element. */
|
|
60
|
+
readonly progress: PartModifier;
|
|
61
|
+
/** The navigation buttons' parts. */
|
|
62
|
+
readonly previous: PartModifier<HTMLButtonElement, QuestionnaireNavigationOptions>;
|
|
63
|
+
readonly skip: PartModifier<HTMLButtonElement, QuestionnaireNavigationOptions>;
|
|
64
|
+
readonly next: PartModifier<HTMLButtonElement, QuestionnaireNavigationOptions>;
|
|
65
|
+
readonly submit: PartModifier<HTMLButtonElement, QuestionnaireNavigationOptions>;
|
|
66
|
+
/**
|
|
67
|
+
* Put it on the form with the active item's name (`{{q.focusEffect q.activeName}}`): after
|
|
68
|
+
* the questionnaire moves, it focuses the item it moved to (or, when it moved to report an
|
|
69
|
+
* invalid one, that item's first answer), as upstream's layout effect does. In development,
|
|
70
|
+
* it also warns where `@items` and the rendered items part, as upstream's effect does.
|
|
71
|
+
*/
|
|
72
|
+
readonly focusEffect: typeof Modifier<{
|
|
73
|
+
Element: HTMLElement;
|
|
74
|
+
Args: {
|
|
75
|
+
Positional: [string | null];
|
|
76
|
+
};
|
|
77
|
+
}>;
|
|
78
|
+
constructor(owner: object, options?: QuestionnaireOptions);
|
|
79
|
+
/** The collection given as `@items`, if any. */
|
|
80
|
+
get definitions(): readonly QuestionnaireItemDefinition[] | undefined;
|
|
81
|
+
/** The definition of a named item, from `@items`. */
|
|
82
|
+
definition(name: string): QuestionnaireItemDefinition | undefined;
|
|
83
|
+
/** The shortcut mode, or `null` for none. */
|
|
84
|
+
get shortcuts(): QuestionnaireShortcutMode | null;
|
|
85
|
+
/** Whether the browser's own validation checks filled answers (`@noValidate={{false}}`). */
|
|
86
|
+
get nativeValidation(): boolean;
|
|
87
|
+
/** @internal An item comes; the returned function is for when it goes. */
|
|
88
|
+
register(item: QuestionnaireItemState): () => void;
|
|
89
|
+
/** @internal Re-renders what depends on the items, after the render that changed them. */
|
|
90
|
+
bump(): void;
|
|
91
|
+
/** The rendered items that aren't disabled, in document order. */
|
|
92
|
+
get runtimeItems(): QuestionnaireItemState[];
|
|
93
|
+
/** The rendered item with a name, unless it is disabled. */
|
|
94
|
+
itemNamed(name: string | null): QuestionnaireItemState | null;
|
|
95
|
+
/** The names of the items it steps through, in order: `@items`' enabled ones, or the rendered. */
|
|
96
|
+
get names(): string[];
|
|
97
|
+
/** The rendered items it steps through, in the collection's order. */
|
|
98
|
+
get orderedItems(): QuestionnaireItemState[];
|
|
99
|
+
/**
|
|
100
|
+
* The active item's name. Where the state names no item it steps through (nothing yet, an
|
|
101
|
+
* unknown one, or one that is now disabled), the first stands in for the render, and then
|
|
102
|
+
* the questionnaire moves to it (see `#moveToFirst`).
|
|
103
|
+
*/
|
|
104
|
+
get activeName(): string | null;
|
|
105
|
+
/** The active item's position from 0, or -1 with none. */
|
|
106
|
+
get index(): number;
|
|
107
|
+
/** How many items it steps through. */
|
|
108
|
+
get total(): number;
|
|
109
|
+
/** The active item's position from 1, or 0 with none. */
|
|
110
|
+
get current(): number;
|
|
111
|
+
/** Whether the active item is the first. */
|
|
112
|
+
get first(): boolean;
|
|
113
|
+
/** Whether the active item is the last. */
|
|
114
|
+
get last(): boolean;
|
|
115
|
+
/** The active item, once it has rendered. */
|
|
116
|
+
get activeItem(): QuestionnaireItemState | null;
|
|
117
|
+
/** Whether the active item must be answered, or `null` with none. */
|
|
118
|
+
get activeRequired(): boolean | null;
|
|
119
|
+
/** The active item's status, or `null` with none. */
|
|
120
|
+
get activeStatus(): QuestionnaireItemStatus | null;
|
|
121
|
+
/** Moves to a named item, focusing it (or its first answer) once it shows. */
|
|
122
|
+
setItem: (name: string, target?: PendingFocus["target"]) => void;
|
|
123
|
+
/** Moves to the item before the active one. */
|
|
124
|
+
goPrevious: () => void;
|
|
125
|
+
/** Moves to the next item, once the active one is valid. */
|
|
126
|
+
goNext: () => void;
|
|
127
|
+
/** Confirms the active item: moves on, or on the last, submits. */
|
|
128
|
+
confirm: () => void;
|
|
129
|
+
/** Skips the active item, unless it is required, and moves on (or submits). */
|
|
130
|
+
skipCurrent: () => void;
|
|
131
|
+
/** The rendered items, disabled ones too, in document order, as upstream registers them. */
|
|
132
|
+
get registrations(): QuestionnaireItemRegistration[];
|
|
133
|
+
/**
|
|
134
|
+
* Where `@items` (and `@defaultItem`) and the rendered items part: duplicate names, an unknown
|
|
135
|
+
* `@defaultItem`, an item or a choice on one side only, and shortcuts that won't match.
|
|
136
|
+
* None without `@items`.
|
|
137
|
+
*/
|
|
138
|
+
get collectionWarnings(): string[];
|
|
139
|
+
/** The `aria-keyshortcuts` names of the keys that go back and forward, in this direction. */
|
|
140
|
+
arrowKeys(element: Element | null): {
|
|
141
|
+
back: string;
|
|
142
|
+
forward: string;
|
|
143
|
+
};
|
|
144
|
+
/** What the form renders: its state, as upstream's `data-*`, and its listeners. */
|
|
145
|
+
rootSpec(): PartSpec<HTMLFormElement>;
|
|
146
|
+
/** The words a screen reader hears for the progress: `Question 2 of 3`. */
|
|
147
|
+
progressText(format?: (current: number, total: number) => string): string | undefined;
|
|
148
|
+
/** What the progress element renders: a named, live progressbar. */
|
|
149
|
+
progressSpec(): PartSpec;
|
|
150
|
+
/** Whether a navigation button shows now. */
|
|
151
|
+
isVisible(kind: 'previous' | 'skip' | 'next' | 'submit'): boolean;
|
|
152
|
+
/** What a navigation button renders: shown or hidden (and inert), and its click. */
|
|
153
|
+
navigationSpec(kind: 'previous' | 'skip' | 'next' | 'submit', { disabled }: QuestionnaireNavigationOptions): PartSpec<HTMLButtonElement>;
|
|
154
|
+
}
|
|
155
|
+
/** Where a `QuestionnaireItemState` reads its settings. */
|
|
156
|
+
export interface QuestionnaireItemOptions {
|
|
157
|
+
/** Its name: the form field's, and the item's in `@items`, `@item` and `@defaultItem`. */
|
|
158
|
+
name: () => string;
|
|
159
|
+
/** Whether it must be answered: it can't be skipped. */
|
|
160
|
+
required?: () => boolean | undefined;
|
|
161
|
+
/** Whether it takes more than one fixed answer (checkboxes, not radios). */
|
|
162
|
+
multiple?: () => boolean | undefined;
|
|
163
|
+
/** Whether it is left out: skipped by navigation, not submitted. */
|
|
164
|
+
disabled?: () => boolean | undefined;
|
|
165
|
+
/** Whether the caller's own validation found it invalid. */
|
|
166
|
+
invalid?: () => boolean | undefined;
|
|
167
|
+
/** Called with its status whenever that changes. */
|
|
168
|
+
onStatusChange?: () => ((status: QuestionnaireItemStatus) => void) | undefined;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* One item of a questionnaire: a `<fieldset>` of answers (fixed choices and a freeform input),
|
|
172
|
+
* its status, and its validation, as `@shadcn/react`'s `Questionnaire.Item`.
|
|
173
|
+
*/
|
|
174
|
+
export declare class QuestionnaireItemState {
|
|
175
|
+
#private;
|
|
176
|
+
readonly questionnaire: QuestionnaireState;
|
|
177
|
+
/** Bumped after answers, descriptions or errors come or go. */
|
|
178
|
+
revision: number;
|
|
179
|
+
/** The selected answers' ids once someone has chosen; `null` while they are the defaults. */
|
|
180
|
+
selection: string[] | null;
|
|
181
|
+
skipped: boolean;
|
|
182
|
+
validationAttempted: boolean;
|
|
183
|
+
/** The fieldset, once rendered. */
|
|
184
|
+
element: HTMLFieldSetElement | null;
|
|
185
|
+
/** Put it on the `<fieldset>`. */
|
|
186
|
+
readonly item: PartModifier<HTMLFieldSetElement>;
|
|
187
|
+
/** Put it on the title (a `<legend>`, or your own heading). */
|
|
188
|
+
readonly title: PartModifier;
|
|
189
|
+
/** Put it on a description: the item's `aria-describedby` names it. */
|
|
190
|
+
readonly description: PartModifier;
|
|
191
|
+
/** Put it on the element that holds the choices. */
|
|
192
|
+
readonly choices: PartModifier;
|
|
193
|
+
/** Put it on the error message, shown while the item is invalid. */
|
|
194
|
+
readonly error: PartModifier;
|
|
195
|
+
constructor(owner: object, questionnaire: QuestionnaireState, options: QuestionnaireItemOptions);
|
|
196
|
+
get name(): string;
|
|
197
|
+
get required(): boolean;
|
|
198
|
+
get multiple(): boolean;
|
|
199
|
+
get disabled(): boolean;
|
|
200
|
+
/** Whether it is the item the questionnaire shows. */
|
|
201
|
+
get isActive(): boolean;
|
|
202
|
+
/** @internal Re-renders what depends on the answers, after the render that changed them. */
|
|
203
|
+
bump(): void;
|
|
204
|
+
/** @internal An answer comes; the returned function is for when it goes. */
|
|
205
|
+
register(answer: QuestionnaireAnswerState): () => void;
|
|
206
|
+
/** Every answer control, in document order. */
|
|
207
|
+
get controls(): QuestionnaireAnswerState[];
|
|
208
|
+
/** The answers that aren't disabled, in document order. */
|
|
209
|
+
get answers(): QuestionnaireAnswerState[];
|
|
210
|
+
/** Whether it has a freeform answer, which makes its fixed answers' `required` unneeded. */
|
|
211
|
+
get hasInputAnswer(): boolean;
|
|
212
|
+
/** Whether an answer is selected: chosen, or for a controlled choice, its `@checked`. */
|
|
213
|
+
isSelected(answer: QuestionnaireAnswerState): boolean;
|
|
214
|
+
/**
|
|
215
|
+
* @internal Puts a controlled answer's selection in step with its value, as upstream's
|
|
216
|
+
* `syncControlledAnswerSelection`: selected, it is no longer skipped; deselected, it leaves
|
|
217
|
+
* the rest as they are.
|
|
218
|
+
*/
|
|
219
|
+
syncSelection(answer: QuestionnaireAnswerState, selected: boolean): void;
|
|
220
|
+
/** Selects or deselects an answer, as someone choosing it does. It is no longer skipped. */
|
|
221
|
+
select(answer: QuestionnaireAnswerState, selected: boolean): void;
|
|
222
|
+
/** Whether an answer is selected. */
|
|
223
|
+
get answered(): boolean;
|
|
224
|
+
/** `skipped`, `answered` or `unanswered`. */
|
|
225
|
+
get status(): QuestionnaireItemStatus;
|
|
226
|
+
/** Whether the caller's validation found it invalid (`@invalid`). */
|
|
227
|
+
get externallyInvalid(): boolean;
|
|
228
|
+
/** Whether it may be left: disabled, skipped on purpose, or answered (and not found invalid). */
|
|
229
|
+
get valid(): boolean;
|
|
230
|
+
/** Whether it shows as invalid: found invalid, or not valid once someone tried to leave it. */
|
|
231
|
+
get invalid(): boolean;
|
|
232
|
+
/** Calls `@onStatusChange`, once a render is over, when the status has changed. */
|
|
233
|
+
reportStatus(): void;
|
|
234
|
+
/** Checks it may be left, showing its error when not. */
|
|
235
|
+
validate(): boolean;
|
|
236
|
+
/** Focuses the item itself (its fieldset), as moving to it does. */
|
|
237
|
+
focus(): void;
|
|
238
|
+
/** Focuses its chosen freeform answer, else its first control, else itself. */
|
|
239
|
+
focusInvalid(): void;
|
|
240
|
+
/** Puts its answers back to their defaults, as a form reset does. */
|
|
241
|
+
reset(): void;
|
|
242
|
+
/** Skips it on purpose, clearing its answers, unless it is required. */
|
|
243
|
+
skip(): void;
|
|
244
|
+
/** The shortcut of each fixed answer by value, from `@items`, or `null` without it. */
|
|
245
|
+
get shortcutsByValue(): Map<string, string> | null;
|
|
246
|
+
/** A fixed answer's shortcut, or `null`. */
|
|
247
|
+
shortcutFor(answer: QuestionnaireChoiceState): string | null;
|
|
248
|
+
/** The enabled answer whose control is `element`. */
|
|
249
|
+
answerByElement(element: Element): QuestionnaireAnswerState | null;
|
|
250
|
+
/** The enabled fixed answer a shortcut picks. */
|
|
251
|
+
answerByShortcut(shortcut: string): QuestionnaireChoiceState | null;
|
|
252
|
+
/**
|
|
253
|
+
* Moves focus from `element` to the next or previous answer, wrapping, as the up and down
|
|
254
|
+
* arrows do. A radio picks itself as it is focused. Between two radios the browser moves, so
|
|
255
|
+
* this leaves them be; in a freeform answer with text, the arrows stay the caret's.
|
|
256
|
+
*/
|
|
257
|
+
moveAnswerFocus(element: Element, direction: 'next' | 'previous'): boolean;
|
|
258
|
+
/** The ids its `aria-describedby` names: its descriptions, and its errors while invalid. */
|
|
259
|
+
get describedBy(): string | undefined;
|
|
260
|
+
/** The keys it answers to while active, for `aria-keyshortcuts`. */
|
|
261
|
+
get keyShortcuts(): string | undefined;
|
|
262
|
+
/**
|
|
263
|
+
* What the fieldset renders: hidden and inert unless active, and its state. A caller's own
|
|
264
|
+
* `aria-describedby` and `aria-keyshortcuts` are kept, as upstream merges them: the item's
|
|
265
|
+
* descriptions and errors come before the caller's ids, and the caller's keys before its own.
|
|
266
|
+
*/
|
|
267
|
+
itemSpec(): PartSpec<HTMLFieldSetElement>;
|
|
268
|
+
/** What the title renders. */
|
|
269
|
+
titleSpec(): PartSpec;
|
|
270
|
+
/** What a description renders: an id (its own, or one it is given) the item names. */
|
|
271
|
+
descriptionSpec(): PartSpec;
|
|
272
|
+
/** The default error message: the required or the optional one. */
|
|
273
|
+
get defaultError(): string;
|
|
274
|
+
/** What the error renders: shown, as an alert, only while the item is invalid. */
|
|
275
|
+
errorSpec(): PartSpec;
|
|
276
|
+
}
|
|
277
|
+
/** A fixed answer or a freeform one: what an item's answers have in common. */
|
|
278
|
+
export declare abstract class QuestionnaireAnswerState {
|
|
279
|
+
readonly item: QuestionnaireItemState;
|
|
280
|
+
/** The control's id, which a `<label>` around it doesn't need, but `aria-*` may. */
|
|
281
|
+
readonly id: string;
|
|
282
|
+
/** The control (`<input>`), once rendered. */
|
|
283
|
+
element: HTMLInputElement | null;
|
|
284
|
+
constructor(item: QuestionnaireItemState);
|
|
285
|
+
/** Whether it can't be chosen: its own `@disabled`, or its item's. */
|
|
286
|
+
abstract get isDisabled(): boolean;
|
|
287
|
+
/** Whether it is selected by default. */
|
|
288
|
+
abstract get defaultSelected(): boolean;
|
|
289
|
+
/** Whether it counts as given, for Enter to confirm it. */
|
|
290
|
+
abstract get isAnswerFilled(): boolean;
|
|
291
|
+
/** Puts its control back as it started, as a form reset does. */
|
|
292
|
+
abstract reset(): void;
|
|
293
|
+
/** Whether it is selected now. */
|
|
294
|
+
get isSelected(): boolean;
|
|
295
|
+
/** @internal Registers the control's element with its item. */
|
|
296
|
+
protected attach(element: HTMLInputElement): () => void;
|
|
297
|
+
}
|
|
298
|
+
/** Where a `QuestionnaireChoiceState` reads its settings. */
|
|
299
|
+
export interface QuestionnaireChoiceOptions {
|
|
300
|
+
/** The value it submits. */
|
|
301
|
+
value: () => string;
|
|
302
|
+
/** Whether it is checked, when the caller controls it. */
|
|
303
|
+
checked?: () => boolean | undefined;
|
|
304
|
+
/** Whether it starts checked, when uncontrolled. */
|
|
305
|
+
defaultChecked?: () => boolean | undefined;
|
|
306
|
+
/** Whether it can't be chosen. */
|
|
307
|
+
disabled?: () => boolean | undefined;
|
|
308
|
+
/**
|
|
309
|
+
* Called as it is checked or unchecked, with the `change` event. Calling `preventDefault()`
|
|
310
|
+
* on the event keeps the questionnaire from taking the change.
|
|
311
|
+
*/
|
|
312
|
+
onCheckedChange?: () => ((checked: boolean, event: Event) => void) | undefined;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* A fixed answer: a radio (or a checkbox, in an item that takes several) inside a `<label>`,
|
|
316
|
+
* with the rest of the label its text, and its shortcut key, as `Questionnaire.Choice`.
|
|
317
|
+
*/
|
|
318
|
+
export declare class QuestionnaireChoiceState extends QuestionnaireAnswerState {
|
|
319
|
+
#private;
|
|
320
|
+
/** Put it on the `<label>` around the choice. */
|
|
321
|
+
readonly choice: PartModifier;
|
|
322
|
+
/** Put it on the `<input>`. */
|
|
323
|
+
readonly input: PartModifier<HTMLInputElement>;
|
|
324
|
+
/** Put it on the element that holds the choice's text. */
|
|
325
|
+
readonly label: PartModifier;
|
|
326
|
+
/** Put it on the element that shows its shortcut key. */
|
|
327
|
+
readonly shortcutKey: PartModifier;
|
|
328
|
+
/**
|
|
329
|
+
* Put it on the `<input>` after `input`: it keeps the control's `checked` (and the
|
|
330
|
+
* `defaultChecked` a form reset returns to) in step with the questionnaire.
|
|
331
|
+
*/
|
|
332
|
+
readonly sync: typeof Modifier<{
|
|
333
|
+
Element: HTMLInputElement;
|
|
334
|
+
}>;
|
|
335
|
+
constructor(item: QuestionnaireItemState, options: QuestionnaireChoiceOptions);
|
|
336
|
+
get value(): string;
|
|
337
|
+
/** Whether the caller controls it (`@checked`). */
|
|
338
|
+
get isControlled(): boolean;
|
|
339
|
+
/** The caller's `@checked`. */
|
|
340
|
+
get controlledChecked(): boolean;
|
|
341
|
+
/** Its own `@disabled`. */
|
|
342
|
+
get ownDisabled(): boolean;
|
|
343
|
+
get isDisabled(): boolean;
|
|
344
|
+
get defaultSelected(): boolean;
|
|
345
|
+
/** What a form reset puts back: the default, or for a controlled choice, its `@checked`. */
|
|
346
|
+
get defaultCheckedProperty(): boolean;
|
|
347
|
+
/** Whether it is checked. */
|
|
348
|
+
get isChecked(): boolean;
|
|
349
|
+
get isAnswerFilled(): boolean;
|
|
350
|
+
/** `checkbox` in an item that takes several answers, else `radio`. */
|
|
351
|
+
get type(): 'checkbox' | 'radio';
|
|
352
|
+
/** Its shortcut key, or `null`. */
|
|
353
|
+
get shortcut(): string | null;
|
|
354
|
+
reset(): void;
|
|
355
|
+
/** The state its label and input render, as upstream's `data-*`. */
|
|
356
|
+
get stateAttributes(): Record<string, string | boolean | null | undefined>;
|
|
357
|
+
/** What the `<input>` renders. */
|
|
358
|
+
inputSpec(): PartSpec<HTMLInputElement>;
|
|
359
|
+
}
|
|
360
|
+
/** Where a `QuestionnaireInputState` reads its settings. */
|
|
361
|
+
export interface QuestionnaireInputOptions {
|
|
362
|
+
/** The value, when the caller controls it. */
|
|
363
|
+
value?: () => string | undefined;
|
|
364
|
+
/** The value it starts with, when uncontrolled. */
|
|
365
|
+
defaultValue?: () => string | undefined;
|
|
366
|
+
/** Whether it can't be typed in. */
|
|
367
|
+
disabled?: () => boolean | undefined;
|
|
368
|
+
/** Called with the new value as someone types. */
|
|
369
|
+
onValueChange?: () => ((value: string) => void) | undefined;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* A freeform answer: a text `<input>` beside the fixed answers, as `Questionnaire.Input`. It
|
|
373
|
+
* is the item's answer while it has text and was the last answer given; only then does it
|
|
374
|
+
* belong to the form (so it submits), and choosing a fixed answer of a single-answer item
|
|
375
|
+
* takes over from it.
|
|
376
|
+
*/
|
|
377
|
+
export declare class QuestionnaireInputState extends QuestionnaireAnswerState {
|
|
378
|
+
#private;
|
|
379
|
+
/** Whether it has text, once someone has typed; `null` while it shows its default. */
|
|
380
|
+
typedFilled: boolean | null;
|
|
381
|
+
/** Put it on the `<input>`, with `{{nativeValue}}` for its value. */
|
|
382
|
+
readonly input: PartModifier<HTMLInputElement>;
|
|
383
|
+
constructor(item: QuestionnaireItemState, options: QuestionnaireInputOptions);
|
|
384
|
+
get isControlled(): boolean;
|
|
385
|
+
get isDisabled(): boolean;
|
|
386
|
+
get defaultSelected(): boolean;
|
|
387
|
+
/** Whether it has text. */
|
|
388
|
+
get filled(): boolean;
|
|
389
|
+
get isAnswerFilled(): boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Hears the text change: selects it while it has text, as typing an answer does. A controlled
|
|
392
|
+
* one only tells `@onValueChange`: its selection follows the value it is given back.
|
|
393
|
+
*/
|
|
394
|
+
onValueChange: (value: string) => void;
|
|
395
|
+
reset(): void;
|
|
396
|
+
/** What the `<input>` renders. */
|
|
397
|
+
inputSpec(): PartSpec<HTMLInputElement>;
|
|
398
|
+
}
|
|
399
|
+
export {};
|
|
400
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/questionnaire/state.ts"],"names":[],"mappings":"AAUA,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,EAAoB,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC/E,OAAO,EAYL,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC/B,MAAM,YAAY,CAAA;AAyBnB,wFAAwF;AACxF,MAAM,WAAW,8BAA8B;IAC7C,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,kGAAkG;AAClG,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,KAAK,CAAC,EAAE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,SAAQ,wBAAwB;;IAEnE,sFAAsF;IAC7E,WAAW,EAAE,OAAO,GAAG,IAAI,CAAO;IAI3C,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAA;gBAElC,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,yBAAyB;IAM5E,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,2BAA2B;IAC3B,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED;;;OAGG;IACH,aAAa,GAAI,OAAO,MAAM,KAAG,IAAI,CAMpC;IAgBD,KAAK,IAAI,IAAI;IAoBb,kCAAkC;IAClC,SAAS,IAAI,QAAQ,CAAC,gBAAgB,CAAC;CAwBxC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** An item's answer state: nothing chosen, an answer chosen, or skipped on purpose. */
|
|
2
|
+
export type QuestionnaireItemStatus = 'unanswered' | 'answered' | 'skipped';
|
|
3
|
+
/** Which keys pick a fixed answer: `letters` (A–Z) or `numbers` (1–9). */
|
|
4
|
+
export type QuestionnaireShortcutMode = 'letters' | 'numbers';
|
|
5
|
+
/** A fixed answer, as the root's `@items` describes it. */
|
|
6
|
+
export interface QuestionnaireChoiceDefinition {
|
|
7
|
+
value: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* An item, as the root's `@items` describes it: its name, whether it must be answered or is
|
|
12
|
+
* left out, and its fixed answers in order (for the shortcuts). Pass the collection to the
|
|
13
|
+
* root so progress, the actions and the shortcuts are right from the first render.
|
|
14
|
+
*/
|
|
15
|
+
export interface QuestionnaireItemDefinition {
|
|
16
|
+
name: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
choices?: readonly QuestionnaireChoiceDefinition[];
|
|
20
|
+
}
|
|
21
|
+
/** Whether a value has any text, as upstream's `hasInputValue`. */
|
|
22
|
+
export declare function hasInputValue(value: unknown): boolean;
|
|
23
|
+
/** The keys a shortcut mode gives out, in order. */
|
|
24
|
+
export declare function shortcutKeys(shortcuts: QuestionnaireShortcutMode | null | undefined): string[];
|
|
25
|
+
/** The shortcut a key press names, or `null`: a letter in any case, or a digit. */
|
|
26
|
+
export declare function shortcutFromKey(key: string, shortcuts: QuestionnaireShortcutMode): string | null;
|
|
27
|
+
/** An answer's `aria-keyshortcuts`: its shortcut, and `Enter` once it is filled. */
|
|
28
|
+
export declare function answerKeyShortcuts(shortcut: string | null, filled: boolean): string | undefined;
|
|
29
|
+
/** Whether a key press is typing into a field, which arrows and letters must be left to. */
|
|
30
|
+
export declare function isTextEntryTarget(element: Element): boolean;
|
|
31
|
+
/** Whether an element is a radio, whose arrow keys the browser already handles. */
|
|
32
|
+
export declare function isRadioTarget(element: Element): boolean;
|
|
33
|
+
/** Sorts things with elements into document order; those without one go last. */
|
|
34
|
+
export declare function byDocumentOrder<T extends {
|
|
35
|
+
element: Element | null;
|
|
36
|
+
}>(a: T, b: T): number;
|
|
37
|
+
/** The item a questionnaire starts on: `defaultItem` when it names an enabled item, else the first. */
|
|
38
|
+
export declare function initialItemName(items: readonly QuestionnaireItemDefinition[] | undefined, defaultItem: string | undefined): string | null;
|
|
39
|
+
/** Each fixed answer's shortcut, from the item's definition: enabled choices, in order. */
|
|
40
|
+
export declare function shortcutsByChoiceValue(item: QuestionnaireItemDefinition | undefined, shortcuts: QuestionnaireShortcutMode | null): Map<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* A rendered item, as the development warnings compare it with `@items`: its name, its own
|
|
43
|
+
* `@disabled` and `@required`, and its fixed answers in document order, each with its own
|
|
44
|
+
* `@disabled` (upstream's `ItemRegistration`).
|
|
45
|
+
*/
|
|
46
|
+
export interface QuestionnaireItemRegistration {
|
|
47
|
+
name: string;
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
required: boolean;
|
|
50
|
+
choices: readonly {
|
|
51
|
+
value: string;
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* What is wrong with `@items` and `@defaultItem` on their own: upstream's
|
|
57
|
+
* `getCollectionDefinitionWarnings`, its messages in Joinery's terms.
|
|
58
|
+
*/
|
|
59
|
+
export declare function collectionDefinitionWarnings(items: readonly QuestionnaireItemDefinition[], defaultItem: string | undefined): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Where the rendered items and choices part from `@items`: upstream's
|
|
62
|
+
* `getCollectionRegistrationWarnings`, its messages in Joinery's terms.
|
|
63
|
+
*/
|
|
64
|
+
export declare function collectionRegistrationWarnings(items: readonly QuestionnaireItemDefinition[], registrations: readonly QuestionnaireItemRegistration[], shortcuts: QuestionnaireShortcutMode | null): string[];
|
|
65
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/questionnaire/utils.ts"],"names":[],"mappings":"AAGA,uFAAuF;AACvF,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,CAAA;AAE3E,0EAA0E;AAC1E,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,SAAS,CAAA;AAE7D,2DAA2D;AAC3D,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,6BAA6B,EAAE,CAAA;CACnD;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,KAA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AAE,OAAO,CAAA;KAAE,EAAE,CAAA;CACzD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,SAAS,2BAA2B,EAAE,EAC7C,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,MAAM,EAAE,CAyBV;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,SAAS,2BAA2B,EAAE,EAC7C,aAAa,EAAE,SAAS,6BAA6B,EAAE,EACvD,SAAS,EAAE,yBAAyB,GAAG,IAAI,GAC1C,MAAM,EAAE,CAqEV"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
3
|
+
import { type TagName } from './as';
|
|
4
|
+
import { ControllableState } from './controllable-state.ts';
|
|
5
|
+
import type { Direction } from './direction';
|
|
6
|
+
import { RovingFocus, type Orientation } from './roving-focus';
|
|
7
|
+
import { FormControl } from './-private/form-control.ts';
|
|
8
|
+
import { Indicator } from './-private/indicator';
|
|
9
|
+
export interface RadioGroupItemSignature {
|
|
10
|
+
Args: {
|
|
11
|
+
/** What choosing it sets the group's value to. Unique in the group. */
|
|
12
|
+
value: string;
|
|
13
|
+
/** Whether it can't be chosen. The arrow keys pass over it. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** The tag to render. Default `button`. */
|
|
16
|
+
as?: TagName;
|
|
17
|
+
/** @internal Bound by the group. */
|
|
18
|
+
group: RadioGroup;
|
|
19
|
+
};
|
|
20
|
+
Blocks: {
|
|
21
|
+
default: [
|
|
22
|
+
item: {
|
|
23
|
+
/** The mark, rendered while it is chosen: `<item.Indicator>●</item.Indicator>`. */
|
|
24
|
+
Indicator: WithBoundArgs<typeof Indicator, 'present' | 'state' | 'disabled'>;
|
|
25
|
+
/** Whether it is the group's value. */
|
|
26
|
+
isChecked: boolean;
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
};
|
|
30
|
+
/** A `<button role="radio">`, or the tag `@as` names. */
|
|
31
|
+
Element: HTMLButtonElement;
|
|
32
|
+
}
|
|
33
|
+
/** One choice in a `<RadioGroup>`, yielded as `group.Item`: Radix's `RadioGroup.Item`. */
|
|
34
|
+
declare class RadioGroupItem extends Component<RadioGroupItemSignature> {
|
|
35
|
+
get isChecked(): boolean;
|
|
36
|
+
get isDisabled(): boolean;
|
|
37
|
+
get isFocusable(): boolean;
|
|
38
|
+
get stateName(): string;
|
|
39
|
+
/** Chooses it, unless a listener of the caller's called `preventDefault()` first. */
|
|
40
|
+
choose: (event: MouseEvent) => void;
|
|
41
|
+
/** An arrow key moved focus here: choose it too, as Radix does. */
|
|
42
|
+
focused: (event: FocusEvent) => void;
|
|
43
|
+
}
|
|
44
|
+
export interface RadioGroupSignature {
|
|
45
|
+
Args: {
|
|
46
|
+
/** The controlled value: the chosen item's `@value`, or `null` for none. */
|
|
47
|
+
value?: string | null;
|
|
48
|
+
/** The first value, when uncontrolled. Default: none. */
|
|
49
|
+
defaultValue?: string;
|
|
50
|
+
/** Called with each value the user chooses. */
|
|
51
|
+
onValueChange?: (value: string) => void;
|
|
52
|
+
/** Whether every item is disabled. */
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/** Whether a form needs a choice to submit. */
|
|
55
|
+
required?: boolean;
|
|
56
|
+
/** Which arrow keys move between items: `horizontal`, `vertical`, or (unset) all four. */
|
|
57
|
+
orientation?: Orientation;
|
|
58
|
+
/** The text direction, for the arrow keys. Default: the document's, from the nearest `dir`. */
|
|
59
|
+
dir?: Direction;
|
|
60
|
+
/** Whether the arrow keys go round from the last item to the first and back. Default `true`. */
|
|
61
|
+
loop?: boolean;
|
|
62
|
+
/** The tag to render. Default `div`. */
|
|
63
|
+
as?: TagName;
|
|
64
|
+
/**
|
|
65
|
+
* The form field its choice submits as, in a form: each item's hidden radio takes this
|
|
66
|
+
* `name`. (Radix's `name`; the root is a `<div>`, which takes no `name` attribute.)
|
|
67
|
+
*/
|
|
68
|
+
formName?: string;
|
|
69
|
+
/** Its name, for `RadioGroupHarness` (`data-test-jn-name`). Its form field is `@formName`. */
|
|
70
|
+
name?: string;
|
|
71
|
+
};
|
|
72
|
+
Blocks: {
|
|
73
|
+
default: [
|
|
74
|
+
group: {
|
|
75
|
+
/** One choice: `<group.Item @value="comfortable" id="r2" />`. */
|
|
76
|
+
Item: WithBoundArgs<typeof RadioGroupItem, 'group'>;
|
|
77
|
+
/** The chosen item's value, or `null`. */
|
|
78
|
+
value: string | null;
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
};
|
|
82
|
+
Element: HTMLDivElement;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A set of choices of which one, at most, is chosen: Radix's `RadioGroup`, headless. It is a
|
|
86
|
+
* `role="radiogroup"` whose items are `<button role="radio">`s with `aria-checked`, sharing one
|
|
87
|
+
* tab stop. Tab enters on the chosen item (or the first); the arrow keys move between the
|
|
88
|
+
* items and choose the one they reach, going round at the ends (`@loop`), flipped right to
|
|
89
|
+
* left; Space chooses the focused item; Home and End move without choosing. Its value is
|
|
90
|
+
* controlled or not, as in Radix:
|
|
91
|
+
*
|
|
92
|
+
* <RadioGroup @defaultValue="comfortable" aria-label="Spacing" as |group|>
|
|
93
|
+
* <group.Item @value="default" id="r1" as |item|><item.Indicator>●</item.Indicator></group.Item>
|
|
94
|
+
* <label for="r1">Default</label>
|
|
95
|
+
* </RadioGroup>
|
|
96
|
+
*
|
|
97
|
+
* In a form, each item renders a hidden native radio beside it, as Radix's does, named by the
|
|
98
|
+
* group's `@formName`, so the form submits the chosen value and checks `@required`.
|
|
99
|
+
*
|
|
100
|
+
* Each item names the group's `id` in `data-test-jn-owner`, the caller's own when they give the
|
|
101
|
+
* group one, so `RadioGroupHarness` still finds an item that sits inside another component, such
|
|
102
|
+
* as a Field or a label around it.
|
|
103
|
+
*/
|
|
104
|
+
export declare class RadioGroup extends Component<RadioGroupSignature> {
|
|
105
|
+
selection: ControllableState<string | null>;
|
|
106
|
+
roving: RovingFocus;
|
|
107
|
+
form: FormControl;
|
|
108
|
+
/** @internal Whether an arrow key is down, so the item it focuses is chosen too. */
|
|
109
|
+
isArrowKeyPressed: boolean;
|
|
110
|
+
get value(): string | null;
|
|
111
|
+
/** @internal */
|
|
112
|
+
choose(value: string): void;
|
|
113
|
+
}
|
|
114
|
+
export default RadioGroup;
|
|
115
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../src/radio-group.gts"],"names":[],"mappings":"AA8QA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAK1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAM,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAe,WAAW,EAAgB,MAAM,4BAA4B,CAAA;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AA6CpD,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE;QACJ,uEAAuE;QACvE,KAAK,EAAE,MAAM,CAAA;QACb,+DAA+D;QAC/D,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,2CAA2C;QAC3C,EAAE,CAAC,EAAE,OAAO,CAAA;QACZ,oCAAoC;QACpC,KAAK,EAAE,UAAU,CAAA;KAClB,CAAA;IACD,MAAM,EAAE;QACN,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,mFAAmF;gBACnF,SAAS,EAAE,aAAa,CAAC,OAAO,SAAS,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC,CAAA;gBAC5E,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