@ariakit/react-components 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/button/button.d.ts +2 -0
- package/dist/button/button.js +53 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button-Cp853csH.d.ts +34 -0
- package/dist/button-Cp853csH.d.ts.map +1 -0
- package/dist/checkbox/checkbox-check.d.ts +56 -0
- package/dist/checkbox/checkbox-check.d.ts.map +1 -0
- package/dist/checkbox/checkbox-check.js +77 -0
- package/dist/checkbox/checkbox-check.js.map +1 -0
- package/dist/checkbox/checkbox-checked-context.d.ts +5 -0
- package/dist/checkbox/checkbox-checked-context.d.ts.map +1 -0
- package/dist/checkbox/checkbox-checked-context.js +8 -0
- package/dist/checkbox/checkbox-checked-context.js.map +1 -0
- package/dist/checkbox/checkbox-context.d.ts +24 -0
- package/dist/checkbox/checkbox-context.d.ts.map +1 -0
- package/dist/checkbox/checkbox-context.js +26 -0
- package/dist/checkbox/checkbox-context.js.map +1 -0
- package/dist/checkbox/checkbox-provider.d.ts +35 -0
- package/dist/checkbox/checkbox-provider.d.ts.map +1 -0
- package/dist/checkbox/checkbox-provider.js +15 -0
- package/dist/checkbox/checkbox-provider.js.map +1 -0
- package/dist/checkbox/checkbox-store.d.ts +2 -0
- package/dist/checkbox/checkbox-store.js +18 -0
- package/dist/checkbox/checkbox-store.js.map +1 -0
- package/dist/checkbox/checkbox.d.ts +91 -0
- package/dist/checkbox/checkbox.d.ts.map +1 -0
- package/dist/checkbox/checkbox.js +148 -0
- package/dist/checkbox/checkbox.js.map +1 -0
- package/dist/checkbox-store-CYZPR4N4.d.ts +38 -0
- package/dist/checkbox-store-CYZPR4N4.d.ts.map +1 -0
- package/dist/collection/collection-context.d.ts +24 -0
- package/dist/collection/collection-context.d.ts.map +1 -0
- package/dist/collection/collection-context.js +26 -0
- package/dist/collection/collection-context.js.map +1 -0
- package/dist/collection/collection-item-offscreen.d.ts +2 -0
- package/dist/collection/collection-item-offscreen.js +88 -0
- package/dist/collection/collection-item-offscreen.js.map +1 -0
- package/dist/collection/collection-item.d.ts +2 -0
- package/dist/collection/collection-item.js +69 -0
- package/dist/collection/collection-item.js.map +1 -0
- package/dist/collection/collection-provider.d.ts +26 -0
- package/dist/collection/collection-provider.d.ts.map +1 -0
- package/dist/collection/collection-provider.js +15 -0
- package/dist/collection/collection-provider.js.map +1 -0
- package/dist/collection/collection-renderer.d.ts +2 -0
- package/dist/collection/collection-renderer.js +580 -0
- package/dist/collection/collection-renderer.js.map +1 -0
- package/dist/collection/collection-store.d.ts +2 -0
- package/dist/collection/collection-store.js +18 -0
- package/dist/collection/collection-store.js.map +1 -0
- package/dist/collection/collection.d.ts +55 -0
- package/dist/collection/collection.d.ts.map +1 -0
- package/dist/collection/collection.js +55 -0
- package/dist/collection/collection.js.map +1 -0
- package/dist/collection-item-C-g2BwVF.d.ts +84 -0
- package/dist/collection-item-C-g2BwVF.d.ts.map +1 -0
- package/dist/collection-item-offscreen-DyXa-sqj.d.ts +30 -0
- package/dist/collection-item-offscreen-DyXa-sqj.d.ts.map +1 -0
- package/dist/collection-renderer-DsPD9ksD.d.ts +469 -0
- package/dist/collection-renderer-DsPD9ksD.d.ts.map +1 -0
- package/dist/collection-store-CbwzYsWf.d.ts +42 -0
- package/dist/collection-store-CbwzYsWf.d.ts.map +1 -0
- package/dist/combobox/combobox-cancel.d.ts +62 -0
- package/dist/combobox/combobox-cancel.d.ts.map +1 -0
- package/dist/combobox/combobox-cancel.js +98 -0
- package/dist/combobox/combobox-cancel.js.map +1 -0
- package/dist/combobox/combobox-context.d.ts +27 -0
- package/dist/combobox/combobox-context.d.ts.map +1 -0
- package/dist/combobox/combobox-context.js +32 -0
- package/dist/combobox/combobox-context.js.map +1 -0
- package/dist/combobox/combobox-disclosure.d.ts +63 -0
- package/dist/combobox/combobox-disclosure.d.ts.map +1 -0
- package/dist/combobox/combobox-disclosure.js +108 -0
- package/dist/combobox/combobox-disclosure.js.map +1 -0
- package/dist/combobox/combobox-group-label.d.ts +56 -0
- package/dist/combobox/combobox-group-label.d.ts.map +1 -0
- package/dist/combobox/combobox-group-label.js +47 -0
- package/dist/combobox/combobox-group-label.js.map +1 -0
- package/dist/combobox/combobox-group.d.ts +63 -0
- package/dist/combobox/combobox-group.d.ts.map +1 -0
- package/dist/combobox/combobox-group.js +67 -0
- package/dist/combobox/combobox-group.js.map +1 -0
- package/dist/combobox/combobox-item-check.d.ts +61 -0
- package/dist/combobox/combobox-item-check.d.ts.map +1 -0
- package/dist/combobox/combobox-item-check.js +62 -0
- package/dist/combobox/combobox-item-check.js.map +1 -0
- package/dist/combobox/combobox-item-offscreen.d.ts +34 -0
- package/dist/combobox/combobox-item-offscreen.d.ts.map +1 -0
- package/dist/combobox/combobox-item-offscreen.js +53 -0
- package/dist/combobox/combobox-item-offscreen.js.map +1 -0
- package/dist/combobox/combobox-item-value.d.ts +103 -0
- package/dist/combobox/combobox-item-value.d.ts.map +1 -0
- package/dist/combobox/combobox-item-value.js +143 -0
- package/dist/combobox/combobox-item-value.js.map +1 -0
- package/dist/combobox/combobox-item.d.ts +146 -0
- package/dist/combobox/combobox-item.d.ts.map +1 -0
- package/dist/combobox/combobox-item.js +157 -0
- package/dist/combobox/combobox-item.js.map +1 -0
- package/dist/combobox/combobox-label.d.ts +50 -0
- package/dist/combobox/combobox-label.d.ts.map +1 -0
- package/dist/combobox/combobox-label.js +51 -0
- package/dist/combobox/combobox-label.js.map +1 -0
- package/dist/combobox/combobox-list.d.ts +55 -0
- package/dist/combobox/combobox-list.d.ts.map +1 -0
- package/dist/combobox/combobox-list.js +106 -0
- package/dist/combobox/combobox-list.js.map +1 -0
- package/dist/combobox/combobox-popover.d.ts +46 -0
- package/dist/combobox/combobox-popover.d.ts.map +1 -0
- package/dist/combobox/combobox-popover.js +115 -0
- package/dist/combobox/combobox-popover.js.map +1 -0
- package/dist/combobox/combobox-provider.d.ts +30 -0
- package/dist/combobox/combobox-provider.d.ts.map +1 -0
- package/dist/combobox/combobox-provider.js +15 -0
- package/dist/combobox/combobox-provider.js.map +1 -0
- package/dist/combobox/combobox-row.d.ts +66 -0
- package/dist/combobox/combobox-row.d.ts.map +1 -0
- package/dist/combobox/combobox-row.js +70 -0
- package/dist/combobox/combobox-row.js.map +1 -0
- package/dist/combobox/combobox-separator.d.ts +61 -0
- package/dist/combobox/combobox-separator.d.ts.map +1 -0
- package/dist/combobox/combobox-separator.js +60 -0
- package/dist/combobox/combobox-separator.js.map +1 -0
- package/dist/combobox/combobox-store.d.ts +2 -0
- package/dist/combobox/combobox-store.js +33 -0
- package/dist/combobox/combobox-store.js.map +1 -0
- package/dist/combobox/combobox-value.d.ts +49 -0
- package/dist/combobox/combobox-value.d.ts.map +1 -0
- package/dist/combobox/combobox-value.js +40 -0
- package/dist/combobox/combobox-value.js.map +1 -0
- package/dist/combobox/combobox.d.ts +268 -0
- package/dist/combobox/combobox.d.ts.map +1 -0
- package/dist/combobox/combobox.js +399 -0
- package/dist/combobox/combobox.js.map +1 -0
- package/dist/combobox-store-DEVQ45mZ.d.ts +80 -0
- package/dist/combobox-store-DEVQ45mZ.d.ts.map +1 -0
- package/dist/command/command.d.ts +2 -0
- package/dist/command/command.js +130 -0
- package/dist/command/command.js.map +1 -0
- package/dist/command-DckndCUK.d.ts +59 -0
- package/dist/command-DckndCUK.d.ts.map +1 -0
- package/dist/composite/composite-container.d.ts +59 -0
- package/dist/composite/composite-container.d.ts.map +1 -0
- package/dist/composite/composite-container.js +164 -0
- package/dist/composite/composite-container.js.map +1 -0
- package/dist/composite/composite-context.d.ts +34 -0
- package/dist/composite/composite-context.d.ts.map +1 -0
- package/dist/composite/composite-context.js +30 -0
- package/dist/composite/composite-context.js.map +1 -0
- package/dist/composite/composite-group-label.d.ts +55 -0
- package/dist/composite/composite-group-label.d.ts.map +1 -0
- package/dist/composite/composite-group-label.js +46 -0
- package/dist/composite/composite-group-label.js.map +1 -0
- package/dist/composite/composite-group.d.ts +60 -0
- package/dist/composite/composite-group.d.ts.map +1 -0
- package/dist/composite/composite-group.js +51 -0
- package/dist/composite/composite-group.js.map +1 -0
- package/dist/composite/composite-hover.d.ts +2 -0
- package/dist/composite/composite-hover.js +114 -0
- package/dist/composite/composite-hover.js.map +1 -0
- package/dist/composite/composite-input.d.ts +55 -0
- package/dist/composite/composite-input.d.ts.map +1 -0
- package/dist/composite/composite-input.js +91 -0
- package/dist/composite/composite-input.js.map +1 -0
- package/dist/composite/composite-item-offscreen.d.ts +39 -0
- package/dist/composite/composite-item-offscreen.d.ts.map +1 -0
- package/dist/composite/composite-item-offscreen.js +72 -0
- package/dist/composite/composite-item-offscreen.js.map +1 -0
- package/dist/composite/composite-item.d.ts +2 -0
- package/dist/composite/composite-item.js +290 -0
- package/dist/composite/composite-item.js.map +1 -0
- package/dist/composite/composite-overflow-disclosure.d.ts +53 -0
- package/dist/composite/composite-overflow-disclosure.d.ts.map +1 -0
- package/dist/composite/composite-overflow-disclosure.js +84 -0
- package/dist/composite/composite-overflow-disclosure.js.map +1 -0
- package/dist/composite/composite-overflow-store.d.ts +38 -0
- package/dist/composite/composite-overflow-store.d.ts.map +1 -0
- package/dist/composite/composite-overflow-store.js +36 -0
- package/dist/composite/composite-overflow-store.js.map +1 -0
- package/dist/composite/composite-overflow.d.ts +54 -0
- package/dist/composite/composite-overflow.d.ts.map +1 -0
- package/dist/composite/composite-overflow.js +82 -0
- package/dist/composite/composite-overflow.js.map +1 -0
- package/dist/composite/composite-provider.d.ts +28 -0
- package/dist/composite/composite-provider.d.ts.map +1 -0
- package/dist/composite/composite-provider.js +15 -0
- package/dist/composite/composite-provider.js.map +1 -0
- package/dist/composite/composite-renderer.d.ts +329 -0
- package/dist/composite/composite-renderer.d.ts.map +1 -0
- package/dist/composite/composite-renderer.js +121 -0
- package/dist/composite/composite-renderer.js.map +1 -0
- package/dist/composite/composite-row.d.ts +67 -0
- package/dist/composite/composite-row.d.ts.map +1 -0
- package/dist/composite/composite-row.js +86 -0
- package/dist/composite/composite-row.js.map +1 -0
- package/dist/composite/composite-separator.d.ts +61 -0
- package/dist/composite/composite-separator.d.ts.map +1 -0
- package/dist/composite/composite-separator.js +55 -0
- package/dist/composite/composite-separator.js.map +1 -0
- package/dist/composite/composite-store.d.ts +2 -0
- package/dist/composite/composite-store.js +33 -0
- package/dist/composite/composite-store.js.map +1 -0
- package/dist/composite/composite-typeahead.d.ts +2 -0
- package/dist/composite/composite-typeahead.js +126 -0
- package/dist/composite/composite-typeahead.js.map +1 -0
- package/dist/composite/composite.d.ts +2 -0
- package/dist/composite/composite.js +273 -0
- package/dist/composite/composite.js.map +1 -0
- package/dist/composite/utils.d.ts +52 -0
- package/dist/composite/utils.d.ts.map +1 -0
- package/dist/composite/utils.js +93 -0
- package/dist/composite/utils.js.map +1 -0
- package/dist/composite-DLvyFHMq.d.ts +124 -0
- package/dist/composite-DLvyFHMq.d.ts.map +1 -0
- package/dist/composite-hover-C7ul163w.d.ts +103 -0
- package/dist/composite-hover-C7ul163w.d.ts.map +1 -0
- package/dist/composite-item-B4WTelVz.d.ts +141 -0
- package/dist/composite-item-B4WTelVz.d.ts.map +1 -0
- package/dist/composite-store-DyJc-XRA.d.ts +43 -0
- package/dist/composite-store-DyJc-XRA.d.ts.map +1 -0
- package/dist/composite-typeahead-DDhpyKqm.d.ts +63 -0
- package/dist/composite-typeahead-DDhpyKqm.d.ts.map +1 -0
- package/dist/dialog/dialog-backdrop.d.ts +16 -0
- package/dist/dialog/dialog-backdrop.d.ts.map +1 -0
- package/dist/dialog/dialog-backdrop.js +58 -0
- package/dist/dialog/dialog-backdrop.js.map +1 -0
- package/dist/dialog/dialog-context.d.ts +27 -0
- package/dist/dialog/dialog-context.d.ts.map +1 -0
- package/dist/dialog/dialog-context.js +30 -0
- package/dist/dialog/dialog-context.js.map +1 -0
- package/dist/dialog/dialog-description.d.ts +2 -0
- package/dist/dialog/dialog-description.js +53 -0
- package/dist/dialog/dialog-description.js.map +1 -0
- package/dist/dialog/dialog-disclosure.d.ts +2 -0
- package/dist/dialog/dialog-disclosure.js +52 -0
- package/dist/dialog/dialog-disclosure.js.map +1 -0
- package/dist/dialog/dialog-dismiss.d.ts +2 -0
- package/dist/dialog/dialog-dismiss.js +80 -0
- package/dist/dialog/dialog-dismiss.js.map +1 -0
- package/dist/dialog/dialog-heading.d.ts +2 -0
- package/dist/dialog/dialog-heading.js +54 -0
- package/dist/dialog/dialog-heading.js.map +1 -0
- package/dist/dialog/dialog-provider.d.ts +22 -0
- package/dist/dialog/dialog-provider.d.ts.map +1 -0
- package/dist/dialog/dialog-provider.js +26 -0
- package/dist/dialog/dialog-provider.js.map +1 -0
- package/dist/dialog/dialog-store.d.ts +2 -0
- package/dist/dialog/dialog-store.js +28 -0
- package/dist/dialog/dialog-store.js.map +1 -0
- package/dist/dialog/dialog.d.ts +2 -0
- package/dist/dialog/dialog.js +429 -0
- package/dist/dialog/dialog.js.map +1 -0
- package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts +7 -0
- package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts.map +1 -0
- package/dist/dialog/utils/disable-accessibility-tree-outside.js +24 -0
- package/dist/dialog/utils/disable-accessibility-tree-outside.js.map +1 -0
- package/dist/dialog/utils/disable-tree.d.ts +9 -0
- package/dist/dialog/utils/disable-tree.d.ts.map +1 -0
- package/dist/dialog/utils/disable-tree.js +48 -0
- package/dist/dialog/utils/disable-tree.js.map +1 -0
- package/dist/dialog/utils/is-backdrop.d.ts +5 -0
- package/dist/dialog/utils/is-backdrop.d.ts.map +1 -0
- package/dist/dialog/utils/is-backdrop.js +15 -0
- package/dist/dialog/utils/is-backdrop.js.map +1 -0
- package/dist/dialog/utils/is-focus-trap.d.ts +5 -0
- package/dist/dialog/utils/is-focus-trap.d.ts.map +1 -0
- package/dist/dialog/utils/is-focus-trap.js +14 -0
- package/dist/dialog/utils/is-focus-trap.js.map +1 -0
- package/dist/dialog/utils/mark-tree-outside.d.ts +9 -0
- package/dist/dialog/utils/mark-tree-outside.d.ts.map +1 -0
- package/dist/dialog/utils/mark-tree-outside.js +44 -0
- package/dist/dialog/utils/mark-tree-outside.js.map +1 -0
- package/dist/dialog/utils/orchestrate.d.ts +9 -0
- package/dist/dialog/utils/orchestrate.d.ts.map +1 -0
- package/dist/dialog/utils/orchestrate.js +77 -0
- package/dist/dialog/utils/orchestrate.js.map +1 -0
- package/dist/dialog/utils/prepend-hidden-dismiss.d.ts +5 -0
- package/dist/dialog/utils/prepend-hidden-dismiss.d.ts.map +1 -0
- package/dist/dialog/utils/prepend-hidden-dismiss.js +31 -0
- package/dist/dialog/utils/prepend-hidden-dismiss.js.map +1 -0
- package/dist/dialog/utils/supports-inert.d.ts +5 -0
- package/dist/dialog/utils/supports-inert.d.ts.map +1 -0
- package/dist/dialog/utils/supports-inert.js +9 -0
- package/dist/dialog/utils/supports-inert.js.map +1 -0
- package/dist/dialog/utils/use-hide-on-interact-outside.d.ts +9 -0
- package/dist/dialog/utils/use-hide-on-interact-outside.d.ts.map +1 -0
- package/dist/dialog/utils/use-hide-on-interact-outside.js +123 -0
- package/dist/dialog/utils/use-hide-on-interact-outside.js.map +1 -0
- package/dist/dialog/utils/use-nested-dialogs.d.ts +11 -0
- package/dist/dialog/utils/use-nested-dialogs.d.ts.map +1 -0
- package/dist/dialog/utils/use-nested-dialogs.js +40 -0
- package/dist/dialog/utils/use-nested-dialogs.js.map +1 -0
- package/dist/dialog/utils/use-prevent-body-scroll.d.ts +5 -0
- package/dist/dialog/utils/use-prevent-body-scroll.d.ts.map +1 -0
- package/dist/dialog/utils/use-prevent-body-scroll.js +60 -0
- package/dist/dialog/utils/use-prevent-body-scroll.js.map +1 -0
- package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts +5 -0
- package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts.map +1 -0
- package/dist/dialog/utils/use-previous-mouse-down-ref.js +22 -0
- package/dist/dialog/utils/use-previous-mouse-down-ref.js.map +1 -0
- package/dist/dialog/utils/use-root-dialog.d.ts +16 -0
- package/dist/dialog/utils/use-root-dialog.d.ts.map +1 -0
- package/dist/dialog/utils/use-root-dialog.js +47 -0
- package/dist/dialog/utils/use-root-dialog.js.map +1 -0
- package/dist/dialog/utils/walk-tree-outside.d.ts +8 -0
- package/dist/dialog/utils/walk-tree-outside.d.ts.map +1 -0
- package/dist/dialog/utils/walk-tree-outside.js +58 -0
- package/dist/dialog/utils/walk-tree-outside.js.map +1 -0
- package/dist/dialog-C__C-zX2.d.ts +267 -0
- package/dist/dialog-C__C-zX2.d.ts.map +1 -0
- package/dist/dialog-description-BCZJ1Kyd.d.ts +48 -0
- package/dist/dialog-description-BCZJ1Kyd.d.ts.map +1 -0
- package/dist/dialog-disclosure-DLD10zlb.d.ts +47 -0
- package/dist/dialog-disclosure-DLD10zlb.d.ts.map +1 -0
- package/dist/dialog-dismiss-CnwEbzc6.d.ts +48 -0
- package/dist/dialog-dismiss-CnwEbzc6.d.ts.map +1 -0
- package/dist/dialog-heading-DQvnOfZH.d.ts +49 -0
- package/dist/dialog-heading-DQvnOfZH.d.ts.map +1 -0
- package/dist/dialog-store-Cjt12T_Y.d.ts +29 -0
- package/dist/dialog-store-Cjt12T_Y.d.ts.map +1 -0
- package/dist/disclosure/disclosure-content.d.ts +2 -0
- package/dist/disclosure/disclosure-content.js +171 -0
- package/dist/disclosure/disclosure-content.js.map +1 -0
- package/dist/disclosure/disclosure-context.d.ts +24 -0
- package/dist/disclosure/disclosure-context.d.ts.map +1 -0
- package/dist/disclosure/disclosure-context.js +26 -0
- package/dist/disclosure/disclosure-context.js.map +1 -0
- package/dist/disclosure/disclosure-provider.d.ts +23 -0
- package/dist/disclosure/disclosure-provider.d.ts.map +1 -0
- package/dist/disclosure/disclosure-provider.js +27 -0
- package/dist/disclosure/disclosure-provider.js.map +1 -0
- package/dist/disclosure/disclosure-store.d.ts +2 -0
- package/dist/disclosure/disclosure-store.js +32 -0
- package/dist/disclosure/disclosure-store.js.map +1 -0
- package/dist/disclosure/disclosure.d.ts +2 -0
- package/dist/disclosure/disclosure.js +83 -0
- package/dist/disclosure/disclosure.js.map +1 -0
- package/dist/disclosure-CQ37hPVP.d.ts +60 -0
- package/dist/disclosure-CQ37hPVP.d.ts.map +1 -0
- package/dist/disclosure-content-BbPkZgAc.d.ts +88 -0
- package/dist/disclosure-content-BbPkZgAc.d.ts.map +1 -0
- package/dist/disclosure-store-BsaBaRKv.d.ts +58 -0
- package/dist/disclosure-store-BsaBaRKv.d.ts.map +1 -0
- package/dist/focus-trap/focus-trap-region.d.ts +42 -0
- package/dist/focus-trap/focus-trap-region.d.ts.map +1 -0
- package/dist/focus-trap/focus-trap-region.js +69 -0
- package/dist/focus-trap/focus-trap-region.js.map +1 -0
- package/dist/focus-trap/focus-trap.d.ts +31 -0
- package/dist/focus-trap/focus-trap.d.ts.map +1 -0
- package/dist/focus-trap/focus-trap.js +45 -0
- package/dist/focus-trap/focus-trap.js.map +1 -0
- package/dist/focusable/focusable-container.d.ts +43 -0
- package/dist/focusable/focusable-container.d.ts.map +1 -0
- package/dist/focusable/focusable-container.js +41 -0
- package/dist/focusable/focusable-container.js.map +1 -0
- package/dist/focusable/focusable-context.d.ts +5 -0
- package/dist/focusable/focusable-context.d.ts.map +1 -0
- package/dist/focusable/focusable-context.js +8 -0
- package/dist/focusable/focusable-context.js.map +1 -0
- package/dist/focusable/focusable.d.ts +2 -0
- package/dist/focusable/focusable.js +273 -0
- package/dist/focusable/focusable.js.map +1 -0
- package/dist/focusable-B00tOxtB.d.ts +142 -0
- package/dist/focusable-B00tOxtB.d.ts.map +1 -0
- package/dist/form/form-checkbox.d.ts +50 -0
- package/dist/form/form-checkbox.d.ts.map +1 -0
- package/dist/form/form-checkbox.js +73 -0
- package/dist/form/form-checkbox.js.map +1 -0
- package/dist/form/form-context.d.ts +24 -0
- package/dist/form/form-context.d.ts.map +1 -0
- package/dist/form/form-context.js +27 -0
- package/dist/form/form-context.js.map +1 -0
- package/dist/form/form-control.d.ts +100 -0
- package/dist/form/form-control.d.ts.map +1 -0
- package/dist/form/form-control.js +139 -0
- package/dist/form/form-control.js.map +1 -0
- package/dist/form/form-description.d.ts +73 -0
- package/dist/form/form-description.d.ts.map +1 -0
- package/dist/form/form-description.js +83 -0
- package/dist/form/form-description.js.map +1 -0
- package/dist/form/form-error.d.ts +82 -0
- package/dist/form/form-error.d.ts.map +1 -0
- package/dist/form/form-error.js +102 -0
- package/dist/form/form-error.js.map +1 -0
- package/dist/form/form-field.d.ts +73 -0
- package/dist/form/form-field.d.ts.map +1 -0
- package/dist/form/form-field.js +74 -0
- package/dist/form/form-field.js.map +1 -0
- package/dist/form/form-group-label.d.ts +62 -0
- package/dist/form/form-group-label.d.ts.map +1 -0
- package/dist/form/form-group-label.js +54 -0
- package/dist/form/form-group-label.js.map +1 -0
- package/dist/form/form-group.d.ts +64 -0
- package/dist/form/form-group.d.ts.map +1 -0
- package/dist/form/form-group.js +56 -0
- package/dist/form/form-group.js.map +1 -0
- package/dist/form/form-input.d.ts +50 -0
- package/dist/form/form-input.d.ts.map +1 -0
- package/dist/form/form-input.js +74 -0
- package/dist/form/form-input.js.map +1 -0
- package/dist/form/form-label.d.ts +77 -0
- package/dist/form/form-label.d.ts.map +1 -0
- package/dist/form/form-label.js +120 -0
- package/dist/form/form-label.js.map +1 -0
- package/dist/form/form-provider.d.ts +28 -0
- package/dist/form/form-provider.d.ts.map +1 -0
- package/dist/form/form-provider.js +15 -0
- package/dist/form/form-provider.js.map +1 -0
- package/dist/form/form-push.d.ts +102 -0
- package/dist/form/form-push.d.ts.map +1 -0
- package/dist/form/form-push.js +134 -0
- package/dist/form/form-push.js.map +1 -0
- package/dist/form/form-radio-group.d.ts +56 -0
- package/dist/form/form-radio-group.d.ts.map +1 -0
- package/dist/form/form-radio-group.js +68 -0
- package/dist/form/form-radio-group.js.map +1 -0
- package/dist/form/form-radio.d.ts +58 -0
- package/dist/form/form-radio.d.ts.map +1 -0
- package/dist/form/form-radio.js +90 -0
- package/dist/form/form-radio.js.map +1 -0
- package/dist/form/form-remove.d.ts +102 -0
- package/dist/form/form-remove.d.ts.map +1 -0
- package/dist/form/form-remove.js +116 -0
- package/dist/form/form-remove.js.map +1 -0
- package/dist/form/form-reset.d.ts +51 -0
- package/dist/form/form-reset.d.ts.map +1 -0
- package/dist/form/form-reset.js +54 -0
- package/dist/form/form-reset.js.map +1 -0
- package/dist/form/form-store.d.ts +2 -0
- package/dist/form/form-store.js +41 -0
- package/dist/form/form-store.js.map +1 -0
- package/dist/form/form-submit.d.ts +57 -0
- package/dist/form/form-submit.d.ts.map +1 -0
- package/dist/form/form-submit.js +59 -0
- package/dist/form/form-submit.js.map +1 -0
- package/dist/form/form.d.ts +101 -0
- package/dist/form/form.d.ts.map +1 -0
- package/dist/form/form.js +146 -0
- package/dist/form/form.js.map +1 -0
- package/dist/form-store-C4Kf5QHm.d.ts +120 -0
- package/dist/form-store-C4Kf5QHm.d.ts.map +1 -0
- package/dist/group/group-label-context.d.ts +7 -0
- package/dist/group/group-label-context.d.ts.map +1 -0
- package/dist/group/group-label-context.js +8 -0
- package/dist/group/group-label-context.js.map +1 -0
- package/dist/group/group-label.d.ts +2 -0
- package/dist/group/group-label.js +52 -0
- package/dist/group/group-label.js.map +1 -0
- package/dist/group/group.d.ts +2 -0
- package/dist/group/group.js +47 -0
- package/dist/group/group.js.map +1 -0
- package/dist/group-CamegDJA.d.ts +32 -0
- package/dist/group-CamegDJA.d.ts.map +1 -0
- package/dist/group-label-C16IDs1b.d.ts +37 -0
- package/dist/group-label-C16IDs1b.d.ts.map +1 -0
- package/dist/heading/heading-context.d.ts +7 -0
- package/dist/heading/heading-context.d.ts.map +1 -0
- package/dist/heading/heading-context.js +8 -0
- package/dist/heading/heading-context.js.map +1 -0
- package/dist/heading/heading-level.d.ts +35 -0
- package/dist/heading/heading-level.d.ts.map +1 -0
- package/dist/heading/heading-level.js +33 -0
- package/dist/heading/heading-level.js.map +1 -0
- package/dist/heading/heading.d.ts +2 -0
- package/dist/heading/heading.js +56 -0
- package/dist/heading/heading.js.map +1 -0
- package/dist/heading/utils.d.ts +2 -0
- package/dist/heading/utils.js +1 -0
- package/dist/heading-zY9g_9K-.d.ts +42 -0
- package/dist/heading-zY9g_9K-.d.ts.map +1 -0
- package/dist/hovercard/hovercard-anchor.d.ts +59 -0
- package/dist/hovercard/hovercard-anchor.d.ts.map +1 -0
- package/dist/hovercard/hovercard-anchor.js +106 -0
- package/dist/hovercard/hovercard-anchor.js.map +1 -0
- package/dist/hovercard/hovercard-arrow.d.ts +54 -0
- package/dist/hovercard/hovercard-arrow.d.ts.map +1 -0
- package/dist/hovercard/hovercard-arrow.js +51 -0
- package/dist/hovercard/hovercard-arrow.js.map +1 -0
- package/dist/hovercard/hovercard-context.d.ts +24 -0
- package/dist/hovercard/hovercard-context.d.ts.map +1 -0
- package/dist/hovercard/hovercard-context.js +27 -0
- package/dist/hovercard/hovercard-context.js.map +1 -0
- package/dist/hovercard/hovercard-description.d.ts +51 -0
- package/dist/hovercard/hovercard-description.d.ts.map +1 -0
- package/dist/hovercard/hovercard-description.js +42 -0
- package/dist/hovercard/hovercard-description.js.map +1 -0
- package/dist/hovercard/hovercard-disclosure.d.ts +51 -0
- package/dist/hovercard/hovercard-disclosure.d.ts.map +1 -0
- package/dist/hovercard/hovercard-disclosure.js +122 -0
- package/dist/hovercard/hovercard-disclosure.js.map +1 -0
- package/dist/hovercard/hovercard-dismiss.d.ts +50 -0
- package/dist/hovercard/hovercard-dismiss.d.ts.map +1 -0
- package/dist/hovercard/hovercard-dismiss.js +47 -0
- package/dist/hovercard/hovercard-dismiss.js.map +1 -0
- package/dist/hovercard/hovercard-heading.d.ts +51 -0
- package/dist/hovercard/hovercard-heading.d.ts.map +1 -0
- package/dist/hovercard/hovercard-heading.js +42 -0
- package/dist/hovercard/hovercard-heading.js.map +1 -0
- package/dist/hovercard/hovercard-provider.d.ts +23 -0
- package/dist/hovercard/hovercard-provider.d.ts.map +1 -0
- package/dist/hovercard/hovercard-provider.js +27 -0
- package/dist/hovercard/hovercard-provider.js.map +1 -0
- package/dist/hovercard/hovercard-store.d.ts +2 -0
- package/dist/hovercard/hovercard-store.js +31 -0
- package/dist/hovercard/hovercard-store.js.map +1 -0
- package/dist/hovercard/hovercard.d.ts +80 -0
- package/dist/hovercard/hovercard.d.ts.map +1 -0
- package/dist/hovercard/hovercard.js +240 -0
- package/dist/hovercard/hovercard.js.map +1 -0
- package/dist/hovercard/utils/debug-polygon.d.ts +7 -0
- package/dist/hovercard/utils/debug-polygon.d.ts.map +1 -0
- package/dist/hovercard/utils/debug-polygon.js +33 -0
- package/dist/hovercard/utils/debug-polygon.js.map +1 -0
- package/dist/hovercard/utils/polygon.d.ts +9 -0
- package/dist/hovercard/utils/polygon.d.ts.map +1 -0
- package/dist/hovercard/utils/polygon.js +70 -0
- package/dist/hovercard/utils/polygon.js.map +1 -0
- package/dist/hovercard-store-gIeoQEn_.d.ts +30 -0
- package/dist/hovercard-store-gIeoQEn_.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/menu/menu-arrow.d.ts +52 -0
- package/dist/menu/menu-arrow.d.ts.map +1 -0
- package/dist/menu/menu-arrow.js +49 -0
- package/dist/menu/menu-arrow.js.map +1 -0
- package/dist/menu/menu-bar-provider.d.ts +35 -0
- package/dist/menu/menu-bar-provider.d.ts.map +1 -0
- package/dist/menu/menu-bar-provider.js +42 -0
- package/dist/menu/menu-bar-provider.js.map +1 -0
- package/dist/menu/menu-bar-store.d.ts +25 -0
- package/dist/menu/menu-bar-store.d.ts.map +1 -0
- package/dist/menu/menu-bar-store.js +28 -0
- package/dist/menu/menu-bar-store.js.map +1 -0
- package/dist/menu/menu-bar.d.ts +61 -0
- package/dist/menu/menu-bar.d.ts.map +1 -0
- package/dist/menu/menu-bar.js +66 -0
- package/dist/menu/menu-bar.js.map +1 -0
- package/dist/menu/menu-button-arrow.d.ts +65 -0
- package/dist/menu/menu-button-arrow.d.ts.map +1 -0
- package/dist/menu/menu-button-arrow.js +62 -0
- package/dist/menu/menu-button-arrow.js.map +1 -0
- package/dist/menu/menu-button.d.ts +67 -0
- package/dist/menu/menu-button.d.ts.map +1 -0
- package/dist/menu/menu-button.js +183 -0
- package/dist/menu/menu-button.js.map +1 -0
- package/dist/menu/menu-context.d.ts +47 -0
- package/dist/menu/menu-context.d.ts.map +1 -0
- package/dist/menu/menu-context.js +52 -0
- package/dist/menu/menu-context.js.map +1 -0
- package/dist/menu/menu-description.d.ts +50 -0
- package/dist/menu/menu-description.d.ts.map +1 -0
- package/dist/menu/menu-description.js +42 -0
- package/dist/menu/menu-description.js.map +1 -0
- package/dist/menu/menu-dismiss.d.ts +49 -0
- package/dist/menu/menu-dismiss.d.ts.map +1 -0
- package/dist/menu/menu-dismiss.js +47 -0
- package/dist/menu/menu-dismiss.js.map +1 -0
- package/dist/menu/menu-group-label.d.ts +55 -0
- package/dist/menu/menu-group-label.d.ts.map +1 -0
- package/dist/menu/menu-group-label.js +47 -0
- package/dist/menu/menu-group-label.js.map +1 -0
- package/dist/menu/menu-group.d.ts +61 -0
- package/dist/menu/menu-group.d.ts.map +1 -0
- package/dist/menu/menu-group.js +53 -0
- package/dist/menu/menu-group.js.map +1 -0
- package/dist/menu/menu-heading.d.ts +50 -0
- package/dist/menu/menu-heading.d.ts.map +1 -0
- package/dist/menu/menu-heading.js +42 -0
- package/dist/menu/menu-heading.js.map +1 -0
- package/dist/menu/menu-item-check.d.ts +58 -0
- package/dist/menu/menu-item-check.d.ts.map +1 -0
- package/dist/menu/menu-item-check.js +60 -0
- package/dist/menu/menu-item-check.js.map +1 -0
- package/dist/menu/menu-item-checkbox.d.ts +104 -0
- package/dist/menu/menu-item-checkbox.d.ts.map +1 -0
- package/dist/menu/menu-item-checkbox.js +151 -0
- package/dist/menu/menu-item-checkbox.js.map +1 -0
- package/dist/menu/menu-item-radio.d.ts +91 -0
- package/dist/menu/menu-item-radio.d.ts.map +1 -0
- package/dist/menu/menu-item-radio.js +121 -0
- package/dist/menu/menu-item-radio.js.map +1 -0
- package/dist/menu/menu-item.d.ts +75 -0
- package/dist/menu/menu-item.d.ts.map +1 -0
- package/dist/menu/menu-item.js +122 -0
- package/dist/menu/menu-item.js.map +1 -0
- package/dist/menu/menu-list.d.ts +59 -0
- package/dist/menu/menu-list.d.ts.map +1 -0
- package/dist/menu/menu-list.js +168 -0
- package/dist/menu/menu-list.js.map +1 -0
- package/dist/menu/menu-provider.d.ts +29 -0
- package/dist/menu/menu-provider.d.ts.map +1 -0
- package/dist/menu/menu-provider.js +15 -0
- package/dist/menu/menu-provider.js.map +1 -0
- package/dist/menu/menu-separator.d.ts +59 -0
- package/dist/menu/menu-separator.d.ts.map +1 -0
- package/dist/menu/menu-separator.js +57 -0
- package/dist/menu/menu-separator.js.map +1 -0
- package/dist/menu/menu-store.d.ts +2 -0
- package/dist/menu/menu-store.js +40 -0
- package/dist/menu/menu-store.js.map +1 -0
- package/dist/menu/menu.d.ts +49 -0
- package/dist/menu/menu.d.ts.map +1 -0
- package/dist/menu/menu.js +169 -0
- package/dist/menu/menu.js.map +1 -0
- package/dist/menu-store-0CKKmNek.d.ts +83 -0
- package/dist/menu-store-0CKKmNek.d.ts.map +1 -0
- package/dist/menubar/menubar-context.d.ts +25 -0
- package/dist/menubar/menubar-context.d.ts.map +1 -0
- package/dist/menubar/menubar-context.js +29 -0
- package/dist/menubar/menubar-context.js.map +1 -0
- package/dist/menubar/menubar-provider.d.ts +37 -0
- package/dist/menubar/menubar-provider.d.ts.map +1 -0
- package/dist/menubar/menubar-provider.js +41 -0
- package/dist/menubar/menubar-provider.js.map +1 -0
- package/dist/menubar/menubar-store.d.ts +2 -0
- package/dist/menubar/menubar-store.js +27 -0
- package/dist/menubar/menubar-store.js.map +1 -0
- package/dist/menubar/menubar.d.ts +71 -0
- package/dist/menubar/menubar.d.ts.map +1 -0
- package/dist/menubar/menubar.js +88 -0
- package/dist/menubar/menubar.js.map +1 -0
- package/dist/menubar-store-3h0eNIbS.d.ts +26 -0
- package/dist/menubar-store-3h0eNIbS.d.ts.map +1 -0
- package/dist/popover/popover-anchor.d.ts +2 -0
- package/dist/popover/popover-anchor.js +45 -0
- package/dist/popover/popover-anchor.js.map +1 -0
- package/dist/popover/popover-arrow-path.d.ts +5 -0
- package/dist/popover/popover-arrow-path.d.ts.map +1 -0
- package/dist/popover/popover-arrow-path.js +7 -0
- package/dist/popover/popover-arrow-path.js.map +1 -0
- package/dist/popover/popover-arrow.d.ts +65 -0
- package/dist/popover/popover-arrow.d.ts.map +1 -0
- package/dist/popover/popover-arrow.js +160 -0
- package/dist/popover/popover-arrow.js.map +1 -0
- package/dist/popover/popover-context.d.ts +24 -0
- package/dist/popover/popover-context.d.ts.map +1 -0
- package/dist/popover/popover-context.js +27 -0
- package/dist/popover/popover-context.js.map +1 -0
- package/dist/popover/popover-description.d.ts +2 -0
- package/dist/popover/popover-description.js +42 -0
- package/dist/popover/popover-description.js.map +1 -0
- package/dist/popover/popover-disclosure-arrow.d.ts +62 -0
- package/dist/popover/popover-disclosure-arrow.d.ts.map +1 -0
- package/dist/popover/popover-disclosure-arrow.js +81 -0
- package/dist/popover/popover-disclosure-arrow.js.map +1 -0
- package/dist/popover/popover-disclosure.d.ts +38 -0
- package/dist/popover/popover-disclosure.d.ts.map +1 -0
- package/dist/popover/popover-disclosure.js +66 -0
- package/dist/popover/popover-disclosure.js.map +1 -0
- package/dist/popover/popover-dismiss.d.ts +2 -0
- package/dist/popover/popover-dismiss.js +47 -0
- package/dist/popover/popover-dismiss.js.map +1 -0
- package/dist/popover/popover-heading.d.ts +2 -0
- package/dist/popover/popover-heading.js +42 -0
- package/dist/popover/popover-heading.js.map +1 -0
- package/dist/popover/popover-provider.d.ts +23 -0
- package/dist/popover/popover-provider.d.ts.map +1 -0
- package/dist/popover/popover-provider.js +27 -0
- package/dist/popover/popover-provider.js.map +1 -0
- package/dist/popover/popover-store.d.ts +2 -0
- package/dist/popover/popover-store.js +30 -0
- package/dist/popover/popover-store.js.map +1 -0
- package/dist/popover/popover.d.ts +2 -0
- package/dist/popover/popover.js +312 -0
- package/dist/popover/popover.js.map +1 -0
- package/dist/popover-CCqiRKqg.d.ts +181 -0
- package/dist/popover-CCqiRKqg.d.ts.map +1 -0
- package/dist/popover-anchor-PgfeXyzs.d.ts +47 -0
- package/dist/popover-anchor-PgfeXyzs.d.ts.map +1 -0
- package/dist/popover-description-DU753dah.d.ts +51 -0
- package/dist/popover-description-DU753dah.d.ts.map +1 -0
- package/dist/popover-dismiss-DPeI6Zse.d.ts +50 -0
- package/dist/popover-dismiss-DPeI6Zse.d.ts.map +1 -0
- package/dist/popover-heading-DGsr6D5W.d.ts +51 -0
- package/dist/popover-heading-DGsr6D5W.d.ts.map +1 -0
- package/dist/popover-store-Bc-l5VVO.d.ts +29 -0
- package/dist/popover-store-Bc-l5VVO.d.ts.map +1 -0
- package/dist/portal/portal-context.d.ts +21 -0
- package/dist/portal/portal-context.d.ts.map +1 -0
- package/dist/portal/portal-context.js +24 -0
- package/dist/portal/portal-context.js.map +1 -0
- package/dist/portal/portal.d.ts +2 -0
- package/dist/portal/portal.js +242 -0
- package/dist/portal/portal.js.map +1 -0
- package/dist/portal-CMBWiayp.d.ts +149 -0
- package/dist/portal-CMBWiayp.d.ts.map +1 -0
- package/dist/radio/radio-context.d.ts +24 -0
- package/dist/radio/radio-context.d.ts.map +1 -0
- package/dist/radio/radio-context.js +27 -0
- package/dist/radio/radio-context.js.map +1 -0
- package/dist/radio/radio-group.d.ts +51 -0
- package/dist/radio/radio-group.d.ts.map +1 -0
- package/dist/radio/radio-group.js +60 -0
- package/dist/radio/radio-group.js.map +1 -0
- package/dist/radio/radio-provider.d.ts +25 -0
- package/dist/radio/radio-provider.d.ts.map +1 -0
- package/dist/radio/radio-provider.js +29 -0
- package/dist/radio/radio-provider.js.map +1 -0
- package/dist/radio/radio-store.d.ts +2 -0
- package/dist/radio/radio-store.js +33 -0
- package/dist/radio/radio-store.js.map +1 -0
- package/dist/radio/radio.d.ts +76 -0
- package/dist/radio/radio.d.ts.map +1 -0
- package/dist/radio/radio.js +143 -0
- package/dist/radio/radio.js.map +1 -0
- package/dist/radio-store-DOZ_1RSk.d.ts +36 -0
- package/dist/radio-store-DOZ_1RSk.d.ts.map +1 -0
- package/dist/role/role.d.ts +34 -0
- package/dist/role/role.d.ts.map +1 -0
- package/dist/role/role.js +68 -0
- package/dist/role/role.js.map +1 -0
- package/dist/select/select-arrow.d.ts +60 -0
- package/dist/select/select-arrow.d.ts.map +1 -0
- package/dist/select/select-arrow.js +58 -0
- package/dist/select/select-arrow.js.map +1 -0
- package/dist/select/select-context.d.ts +27 -0
- package/dist/select/select-context.d.ts.map +1 -0
- package/dist/select/select-context.js +31 -0
- package/dist/select/select-context.js.map +1 -0
- package/dist/select/select-dismiss.d.ts +59 -0
- package/dist/select/select-dismiss.d.ts.map +1 -0
- package/dist/select/select-dismiss.js +56 -0
- package/dist/select/select-dismiss.js.map +1 -0
- package/dist/select/select-group-label.d.ts +61 -0
- package/dist/select/select-group-label.d.ts.map +1 -0
- package/dist/select/select-group-label.js +52 -0
- package/dist/select/select-group-label.js.map +1 -0
- package/dist/select/select-group.d.ts +62 -0
- package/dist/select/select-group.d.ts.map +1 -0
- package/dist/select/select-group.js +53 -0
- package/dist/select/select-group.js.map +1 -0
- package/dist/select/select-heading.d.ts +59 -0
- package/dist/select/select-heading.d.ts.map +1 -0
- package/dist/select/select-heading.js +62 -0
- package/dist/select/select-heading.js.map +1 -0
- package/dist/select/select-item-check.d.ts +59 -0
- package/dist/select/select-item-check.d.ts.map +1 -0
- package/dist/select/select-item-check.js +61 -0
- package/dist/select/select-item-check.js.map +1 -0
- package/dist/select/select-item-offscreen.d.ts +37 -0
- package/dist/select/select-item-offscreen.d.ts.map +1 -0
- package/dist/select/select-item-offscreen.js +38 -0
- package/dist/select/select-item-offscreen.js.map +1 -0
- package/dist/select/select-item.d.ts +108 -0
- package/dist/select/select-item.d.ts.map +1 -0
- package/dist/select/select-item.js +143 -0
- package/dist/select/select-item.js.map +1 -0
- package/dist/select/select-label.d.ts +55 -0
- package/dist/select/select-label.d.ts.map +1 -0
- package/dist/select/select-label.js +70 -0
- package/dist/select/select-label.js.map +1 -0
- package/dist/select/select-list.d.ts +80 -0
- package/dist/select/select-list.d.ts.map +1 -0
- package/dist/select/select-list.js +143 -0
- package/dist/select/select-list.js.map +1 -0
- package/dist/select/select-popover.d.ts +44 -0
- package/dist/select/select-popover.d.ts.map +1 -0
- package/dist/select/select-popover.js +59 -0
- package/dist/select/select-popover.js.map +1 -0
- package/dist/select/select-provider.d.ts +30 -0
- package/dist/select/select-provider.d.ts.map +1 -0
- package/dist/select/select-provider.js +15 -0
- package/dist/select/select-provider.js.map +1 -0
- package/dist/select/select-renderer.d.ts +44 -0
- package/dist/select/select-renderer.d.ts.map +1 -0
- package/dist/select/select-renderer.js +61 -0
- package/dist/select/select-renderer.js.map +1 -0
- package/dist/select/select-row.d.ts +63 -0
- package/dist/select/select-row.d.ts.map +1 -0
- package/dist/select/select-row.js +67 -0
- package/dist/select/select-row.js.map +1 -0
- package/dist/select/select-separator.d.ts +60 -0
- package/dist/select/select-separator.d.ts.map +1 -0
- package/dist/select/select-separator.js +57 -0
- package/dist/select/select-separator.js.map +1 -0
- package/dist/select/select-store.d.ts +2 -0
- package/dist/select/select-store.js +31 -0
- package/dist/select/select-store.js.map +1 -0
- package/dist/select/select-value.d.ts +84 -0
- package/dist/select/select-value.d.ts.map +1 -0
- package/dist/select/select-value.js +18 -0
- package/dist/select/select-value.js.map +1 -0
- package/dist/select/select.d.ts +89 -0
- package/dist/select/select.d.ts.map +1 -0
- package/dist/select/select.js +211 -0
- package/dist/select/select.js.map +1 -0
- package/dist/select-store-BsLTAyKh.d.ts +68 -0
- package/dist/select-store-BsLTAyKh.d.ts.map +1 -0
- package/dist/separator/separator.d.ts +2 -0
- package/dist/separator/separator.js +36 -0
- package/dist/separator/separator.js.map +1 -0
- package/dist/separator--ozQfMcK.d.ts +36 -0
- package/dist/separator--ozQfMcK.d.ts.map +1 -0
- package/dist/store.d.ts +1 -0
- package/dist/store.js +2 -0
- package/dist/tab/tab-context.d.ts +24 -0
- package/dist/tab/tab-context.d.ts.map +1 -0
- package/dist/tab/tab-context.js +27 -0
- package/dist/tab/tab-context.js.map +1 -0
- package/dist/tab/tab-list.d.ts +55 -0
- package/dist/tab/tab-list.d.ts.map +1 -0
- package/dist/tab/tab-list.js +71 -0
- package/dist/tab/tab-list.js.map +1 -0
- package/dist/tab/tab-panel.d.ts +122 -0
- package/dist/tab/tab-panel.d.ts.map +1 -0
- package/dist/tab/tab-panel.js +169 -0
- package/dist/tab/tab-panel.js.map +1 -0
- package/dist/tab/tab-provider.d.ts +26 -0
- package/dist/tab/tab-provider.d.ts.map +1 -0
- package/dist/tab/tab-provider.js +30 -0
- package/dist/tab/tab-provider.js.map +1 -0
- package/dist/tab/tab-store.d.ts +77 -0
- package/dist/tab/tab-store.d.ts.map +1 -0
- package/dist/tab/tab-store.js +55 -0
- package/dist/tab/tab-store.js.map +1 -0
- package/dist/tab/tab.d.ts +56 -0
- package/dist/tab/tab.d.ts.map +1 -0
- package/dist/tab/tab.js +115 -0
- package/dist/tab/tab.js.map +1 -0
- package/dist/tag/tag-context.d.ts +26 -0
- package/dist/tag/tag-context.d.ts.map +1 -0
- package/dist/tag/tag-context.js +30 -0
- package/dist/tag/tag-context.js.map +1 -0
- package/dist/tag/tag-input.d.ts +126 -0
- package/dist/tag/tag-input.d.ts.map +1 -0
- package/dist/tag/tag-input.js +162 -0
- package/dist/tag/tag-input.js.map +1 -0
- package/dist/tag/tag-list-label.d.ts +59 -0
- package/dist/tag/tag-list-label.d.ts.map +1 -0
- package/dist/tag/tag-list-label.js +62 -0
- package/dist/tag/tag-list-label.js.map +1 -0
- package/dist/tag/tag-list.d.ts +62 -0
- package/dist/tag/tag-list.d.ts.map +1 -0
- package/dist/tag/tag-list.js +127 -0
- package/dist/tag/tag-list.js.map +1 -0
- package/dist/tag/tag-provider.d.ts +34 -0
- package/dist/tag/tag-provider.d.ts.map +1 -0
- package/dist/tag/tag-provider.js +38 -0
- package/dist/tag/tag-provider.js.map +1 -0
- package/dist/tag/tag-remove.d.ts +71 -0
- package/dist/tag/tag-remove.d.ts.map +1 -0
- package/dist/tag/tag-remove.js +102 -0
- package/dist/tag/tag-remove.js.map +1 -0
- package/dist/tag/tag-store.d.ts +2 -0
- package/dist/tag/tag-store.js +38 -0
- package/dist/tag/tag-store.js.map +1 -0
- package/dist/tag/tag-value.d.ts +49 -0
- package/dist/tag/tag-value.d.ts.map +1 -0
- package/dist/tag/tag-value.js +40 -0
- package/dist/tag/tag-value.js.map +1 -0
- package/dist/tag/tag-values.d.ts +60 -0
- package/dist/tag/tag-values.d.ts.map +1 -0
- package/dist/tag/tag-values.js +50 -0
- package/dist/tag/tag-values.js.map +1 -0
- package/dist/tag/tag.d.ts +78 -0
- package/dist/tag/tag.d.ts.map +1 -0
- package/dist/tag/tag.js +114 -0
- package/dist/tag/tag.js.map +1 -0
- package/dist/tag/utils.d.ts +5 -0
- package/dist/tag/utils.d.ts.map +1 -0
- package/dist/tag/utils.js +15 -0
- package/dist/tag/utils.js.map +1 -0
- package/dist/tag-store-xANOvuGo.d.ts +49 -0
- package/dist/tag-store-xANOvuGo.d.ts.map +1 -0
- package/dist/toolbar/toolbar-container.d.ts +41 -0
- package/dist/toolbar/toolbar-container.d.ts.map +1 -0
- package/dist/toolbar/toolbar-container.js +53 -0
- package/dist/toolbar/toolbar-container.js.map +1 -0
- package/dist/toolbar/toolbar-context.d.ts +24 -0
- package/dist/toolbar/toolbar-context.d.ts.map +1 -0
- package/dist/toolbar/toolbar-context.js +27 -0
- package/dist/toolbar/toolbar-context.js.map +1 -0
- package/dist/toolbar/toolbar-input.d.ts +39 -0
- package/dist/toolbar/toolbar-input.d.ts.map +1 -0
- package/dist/toolbar/toolbar-input.js +47 -0
- package/dist/toolbar/toolbar-input.js.map +1 -0
- package/dist/toolbar/toolbar-item.d.ts +47 -0
- package/dist/toolbar/toolbar-item.d.ts.map +1 -0
- package/dist/toolbar/toolbar-item.js +45 -0
- package/dist/toolbar/toolbar-item.js.map +1 -0
- package/dist/toolbar/toolbar-provider.d.ts +26 -0
- package/dist/toolbar/toolbar-provider.d.ts.map +1 -0
- package/dist/toolbar/toolbar-provider.js +30 -0
- package/dist/toolbar/toolbar-provider.js.map +1 -0
- package/dist/toolbar/toolbar-separator.d.ts +51 -0
- package/dist/toolbar/toolbar-separator.d.ts.map +1 -0
- package/dist/toolbar/toolbar-separator.js +49 -0
- package/dist/toolbar/toolbar-separator.js.map +1 -0
- package/dist/toolbar/toolbar-store.d.ts +2 -0
- package/dist/toolbar/toolbar-store.js +31 -0
- package/dist/toolbar/toolbar-store.js.map +1 -0
- package/dist/toolbar/toolbar.d.ts +50 -0
- package/dist/toolbar/toolbar.d.ts.map +1 -0
- package/dist/toolbar/toolbar.js +66 -0
- package/dist/toolbar/toolbar.js.map +1 -0
- package/dist/toolbar-store-Cs-9cGHx.d.ts +30 -0
- package/dist/toolbar-store-Cs-9cGHx.d.ts.map +1 -0
- package/dist/tooltip/tooltip-anchor.d.ts +53 -0
- package/dist/tooltip/tooltip-anchor.d.ts.map +1 -0
- package/dist/tooltip/tooltip-anchor.js +121 -0
- package/dist/tooltip/tooltip-anchor.js.map +1 -0
- package/dist/tooltip/tooltip-arrow.d.ts +54 -0
- package/dist/tooltip/tooltip-arrow.d.ts.map +1 -0
- package/dist/tooltip/tooltip-arrow.js +54 -0
- package/dist/tooltip/tooltip-arrow.js.map +1 -0
- package/dist/tooltip/tooltip-context.d.ts +24 -0
- package/dist/tooltip/tooltip-context.d.ts.map +1 -0
- package/dist/tooltip/tooltip-context.js +27 -0
- package/dist/tooltip/tooltip-context.js.map +1 -0
- package/dist/tooltip/tooltip-provider.d.ts +23 -0
- package/dist/tooltip/tooltip-provider.d.ts.map +1 -0
- package/dist/tooltip/tooltip-provider.js +27 -0
- package/dist/tooltip/tooltip-provider.js.map +1 -0
- package/dist/tooltip/tooltip-store.d.ts +30 -0
- package/dist/tooltip/tooltip-store.d.ts.map +1 -0
- package/dist/tooltip/tooltip-store.js +30 -0
- package/dist/tooltip/tooltip-store.js.map +1 -0
- package/dist/tooltip/tooltip.d.ts +61 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -0
- package/dist/tooltip/tooltip.js +81 -0
- package/dist/tooltip/tooltip.js.map +1 -0
- package/dist/utils-DUF1aMov.d.ts +5 -0
- package/dist/utils-DUF1aMov.d.ts.map +1 -0
- package/dist/visually-hidden/visually-hidden.d.ts +37 -0
- package/dist/visually-hidden/visually-hidden.d.ts.map +1 -0
- package/dist/visually-hidden/visually-hidden.js +53 -0
- package/dist/visually-hidden/visually-hidden.js.map +1 -0
- package/license +21 -0
- package/package.json +936 -0
- package/readme.md +19 -0
- package/src/button/button.tsx +76 -0
- package/src/checkbox/checkbox-check.tsx +116 -0
- package/src/checkbox/checkbox-checked-context.tsx +3 -0
- package/src/checkbox/checkbox-context.tsx +27 -0
- package/src/checkbox/checkbox-provider.tsx +53 -0
- package/src/checkbox/checkbox-store.ts +76 -0
- package/src/checkbox/checkbox.tsx +271 -0
- package/src/collection/collection-context.tsx +27 -0
- package/src/collection/collection-item-offscreen.tsx +157 -0
- package/src/collection/collection-item.tsx +136 -0
- package/src/collection/collection-provider.tsx +47 -0
- package/src/collection/collection-renderer.tsx +994 -0
- package/src/collection/collection-store.ts +84 -0
- package/src/collection/collection.tsx +93 -0
- package/src/combobox/combobox-cancel.tsx +153 -0
- package/src/combobox/combobox-context.tsx +49 -0
- package/src/combobox/combobox-disclosure.tsx +162 -0
- package/src/combobox/combobox-group-label.tsx +74 -0
- package/src/combobox/combobox-group.tsx +100 -0
- package/src/combobox/combobox-item-check.tsx +83 -0
- package/src/combobox/combobox-item-offscreen.tsx +87 -0
- package/src/combobox/combobox-item-value.tsx +231 -0
- package/src/combobox/combobox-item.tsx +363 -0
- package/src/combobox/combobox-label.tsx +89 -0
- package/src/combobox/combobox-list.tsx +176 -0
- package/src/combobox/combobox-popover.tsx +179 -0
- package/src/combobox/combobox-provider.tsx +50 -0
- package/src/combobox/combobox-row.tsx +102 -0
- package/src/combobox/combobox-separator.tsx +90 -0
- package/src/combobox/combobox-store.ts +168 -0
- package/src/combobox/combobox-value.tsx +63 -0
- package/src/combobox/combobox.tsx +900 -0
- package/src/command/command.tsx +215 -0
- package/src/composite/composite-container.tsx +278 -0
- package/src/composite/composite-context.tsx +53 -0
- package/src/composite/composite-group-label.tsx +73 -0
- package/src/composite/composite-group.tsx +77 -0
- package/src/composite/composite-hover.tsx +230 -0
- package/src/composite/composite-input.tsx +147 -0
- package/src/composite/composite-item-offscreen.tsx +112 -0
- package/src/composite/composite-item.tsx +567 -0
- package/src/composite/composite-overflow-disclosure.ts +117 -0
- package/src/composite/composite-overflow-store.ts +61 -0
- package/src/composite/composite-overflow.tsx +123 -0
- package/src/composite/composite-provider.tsx +47 -0
- package/src/composite/composite-renderer.tsx +231 -0
- package/src/composite/composite-row.tsx +133 -0
- package/src/composite/composite-separator.tsx +96 -0
- package/src/composite/composite-store.ts +101 -0
- package/src/composite/composite-typeahead.tsx +246 -0
- package/src/composite/composite.tsx +592 -0
- package/src/composite/utils.ts +121 -0
- package/src/dialog/dialog-backdrop.tsx +71 -0
- package/src/dialog/dialog-context.tsx +43 -0
- package/src/dialog/dialog-description.tsx +86 -0
- package/src/dialog/dialog-disclosure.tsx +84 -0
- package/src/dialog/dialog-dismiss.tsx +113 -0
- package/src/dialog/dialog-heading.tsx +88 -0
- package/src/dialog/dialog-provider.tsx +28 -0
- package/src/dialog/dialog-store.ts +51 -0
- package/src/dialog/dialog.tsx +866 -0
- package/src/dialog/utils/disable-accessibility-tree-outside.ts +30 -0
- package/src/dialog/utils/disable-tree.ts +81 -0
- package/src/dialog/utils/is-backdrop.ts +12 -0
- package/src/dialog/utils/is-focus-trap.ts +11 -0
- package/src/dialog/utils/mark-tree-outside.ts +67 -0
- package/src/dialog/utils/orchestrate.ts +123 -0
- package/src/dialog/utils/prepend-hidden-dismiss.ts +35 -0
- package/src/dialog/utils/supports-inert.ts +5 -0
- package/src/dialog/utils/use-hide-on-interact-outside.ts +181 -0
- package/src/dialog/utils/use-nested-dialogs.tsx +55 -0
- package/src/dialog/utils/use-prevent-body-scroll.ts +86 -0
- package/src/dialog/utils/use-previous-mouse-down-ref.ts +19 -0
- package/src/dialog/utils/use-root-dialog.ts +49 -0
- package/src/dialog/utils/walk-tree-outside.ts +85 -0
- package/src/disclosure/disclosure-content.tsx +344 -0
- package/src/disclosure/disclosure-context.tsx +27 -0
- package/src/disclosure/disclosure-provider.tsx +29 -0
- package/src/disclosure/disclosure-store.ts +85 -0
- package/src/disclosure/disclosure.tsx +144 -0
- package/src/focus-trap/focus-trap-region.tsx +112 -0
- package/src/focus-trap/focus-trap.tsx +60 -0
- package/src/focusable/focusable-container.tsx +75 -0
- package/src/focusable/focusable-context.tsx +3 -0
- package/src/focusable/focusable.tsx +559 -0
- package/src/form/form-checkbox.tsx +106 -0
- package/src/form/form-context.tsx +34 -0
- package/src/form/form-control.tsx +227 -0
- package/src/form/form-description.tsx +142 -0
- package/src/form/form-error.tsx +156 -0
- package/src/form/form-field.tsx +94 -0
- package/src/form/form-group-label.tsx +79 -0
- package/src/form/form-group.tsx +79 -0
- package/src/form/form-input.tsx +104 -0
- package/src/form/form-label.tsx +192 -0
- package/src/form/form-provider.tsx +49 -0
- package/src/form/form-push.tsx +200 -0
- package/src/form/form-radio-group.tsx +93 -0
- package/src/form/form-radio.tsx +122 -0
- package/src/form/form-remove.tsx +198 -0
- package/src/form/form-reset.tsx +85 -0
- package/src/form/form-store.ts +195 -0
- package/src/form/form-submit.tsx +93 -0
- package/src/form/form.tsx +249 -0
- package/src/group/group-label-context.tsx +6 -0
- package/src/group/group-label.tsx +75 -0
- package/src/group/group.tsx +69 -0
- package/src/heading/heading-context.tsx +4 -0
- package/src/heading/heading-level.tsx +42 -0
- package/src/heading/heading.tsx +81 -0
- package/src/heading/utils.ts +1 -0
- package/src/hovercard/hovercard-anchor.tsx +195 -0
- package/src/hovercard/hovercard-arrow.tsx +74 -0
- package/src/hovercard/hovercard-context.tsx +34 -0
- package/src/hovercard/hovercard-description.tsx +69 -0
- package/src/hovercard/hovercard-disclosure.tsx +196 -0
- package/src/hovercard/hovercard-dismiss.tsx +70 -0
- package/src/hovercard/hovercard-heading.tsx +68 -0
- package/src/hovercard/hovercard-provider.tsx +29 -0
- package/src/hovercard/hovercard-store.ts +58 -0
- package/src/hovercard/hovercard.tsx +445 -0
- package/src/hovercard/utils/__tests__/polygon-test.ts +66 -0
- package/src/hovercard/utils/debug-polygon.ts +37 -0
- package/src/hovercard/utils/polygon.ts +96 -0
- package/src/index.ts +1 -0
- package/src/menu/menu-arrow.tsx +69 -0
- package/src/menu/menu-bar-provider.tsx +44 -0
- package/src/menu/menu-bar-store.ts +54 -0
- package/src/menu/menu-bar.tsx +84 -0
- package/src/menu/menu-button-arrow.tsx +85 -0
- package/src/menu/menu-button.tsx +338 -0
- package/src/menu/menu-context.tsx +76 -0
- package/src/menu/menu-description.tsx +67 -0
- package/src/menu/menu-dismiss.tsx +69 -0
- package/src/menu/menu-group-label.tsx +72 -0
- package/src/menu/menu-group.tsx +76 -0
- package/src/menu/menu-heading.tsx +67 -0
- package/src/menu/menu-item-check.tsx +79 -0
- package/src/menu/menu-item-checkbox.tsx +227 -0
- package/src/menu/menu-item-radio.tsx +198 -0
- package/src/menu/menu-item.tsx +223 -0
- package/src/menu/menu-list.tsx +230 -0
- package/src/menu/menu-provider.tsx +42 -0
- package/src/menu/menu-separator.tsx +79 -0
- package/src/menu/menu-store.ts +155 -0
- package/src/menu/menu.tsx +274 -0
- package/src/menubar/menubar-context.tsx +39 -0
- package/src/menubar/menubar-provider.tsx +43 -0
- package/src/menubar/menubar-store.ts +48 -0
- package/src/menubar/menubar.tsx +145 -0
- package/src/popover/popover-anchor.tsx +74 -0
- package/src/popover/popover-arrow-path.ts +21 -0
- package/src/popover/popover-arrow.tsx +228 -0
- package/src/popover/popover-context.tsx +34 -0
- package/src/popover/popover-description.tsx +69 -0
- package/src/popover/popover-disclosure-arrow.tsx +135 -0
- package/src/popover/popover-disclosure.tsx +101 -0
- package/src/popover/popover-dismiss.tsx +70 -0
- package/src/popover/popover-heading.tsx +68 -0
- package/src/popover/popover-provider.tsx +29 -0
- package/src/popover/popover-store.ts +53 -0
- package/src/popover/popover.tsx +649 -0
- package/src/portal/portal-context.tsx +19 -0
- package/src/portal/portal.tsx +493 -0
- package/src/radio/radio-context.tsx +34 -0
- package/src/radio/radio-group.tsx +103 -0
- package/src/radio/radio-provider.tsx +29 -0
- package/src/radio/radio-store.ts +64 -0
- package/src/radio/radio.tsx +242 -0
- package/src/role/role.tsx +88 -0
- package/src/select/select-arrow.tsx +80 -0
- package/src/select/select-context.tsx +46 -0
- package/src/select/select-dismiss.tsx +79 -0
- package/src/select/select-group-label.tsx +78 -0
- package/src/select/select-group.tsx +79 -0
- package/src/select/select-heading.tsx +98 -0
- package/src/select/select-item-check.tsx +80 -0
- package/src/select/select-item-offscreen.tsx +59 -0
- package/src/select/select-item.tsx +294 -0
- package/src/select/select-label.tsx +117 -0
- package/src/select/select-list.tsx +251 -0
- package/src/select/select-popover.tsx +67 -0
- package/src/select/select-provider.tsx +45 -0
- package/src/select/select-renderer.tsx +160 -0
- package/src/select/select-row.tsx +97 -0
- package/src/select/select-separator.tsx +80 -0
- package/src/select/select-store.ts +139 -0
- package/src/select/select-value.tsx +108 -0
- package/src/select/select.tsx +371 -0
- package/src/separator/separator.tsx +54 -0
- package/src/store.ts +1 -0
- package/src/tab/tab-context.tsx +34 -0
- package/src/tab/tab-list.tsx +120 -0
- package/src/tab/tab-panel.tsx +314 -0
- package/src/tab/tab-provider.tsx +30 -0
- package/src/tab/tab-store.ts +124 -0
- package/src/tab/tab.tsx +208 -0
- package/src/tag/tag-context.tsx +40 -0
- package/src/tag/tag-input.tsx +321 -0
- package/src/tag/tag-list-label.tsx +102 -0
- package/src/tag/tag-list.tsx +210 -0
- package/src/tag/tag-provider.tsx +38 -0
- package/src/tag/tag-remove.tsx +174 -0
- package/src/tag/tag-store.ts +72 -0
- package/src/tag/tag-value.tsx +63 -0
- package/src/tag/tag-values.tsx +74 -0
- package/src/tag/tag.tsx +199 -0
- package/src/tag/utils.ts +12 -0
- package/src/toolbar/toolbar-container.tsx +67 -0
- package/src/toolbar/toolbar-context.tsx +34 -0
- package/src/toolbar/toolbar-input.tsx +64 -0
- package/src/toolbar/toolbar-item.tsx +72 -0
- package/src/toolbar/toolbar-provider.tsx +32 -0
- package/src/toolbar/toolbar-separator.tsx +71 -0
- package/src/toolbar/toolbar-store.ts +52 -0
- package/src/toolbar/toolbar.tsx +119 -0
- package/src/tooltip/tooltip-anchor.tsx +210 -0
- package/src/tooltip/tooltip-arrow.tsx +84 -0
- package/src/tooltip/tooltip-context.tsx +34 -0
- package/src/tooltip/tooltip-provider.tsx +29 -0
- package/src/tooltip/tooltip-store.ts +53 -0
- package/src/tooltip/tooltip.tsx +153 -0
- package/src/visually-hidden/visually-hidden.tsx +67 -0
|
@@ -0,0 +1,866 @@
|
|
|
1
|
+
import { useStoreState } from "@ariakit/react-store";
|
|
2
|
+
import {
|
|
3
|
+
useBooleanEvent,
|
|
4
|
+
useEvent,
|
|
5
|
+
useId,
|
|
6
|
+
useMergeRefs,
|
|
7
|
+
usePortalRef,
|
|
8
|
+
useSafeLayoutEffect,
|
|
9
|
+
useWrapElement,
|
|
10
|
+
createElement,
|
|
11
|
+
createHook,
|
|
12
|
+
forwardRef,
|
|
13
|
+
} from "@ariakit/react-utils";
|
|
14
|
+
import type { Props } from "@ariakit/react-utils";
|
|
15
|
+
import { sync } from "@ariakit/store";
|
|
16
|
+
import {
|
|
17
|
+
contains,
|
|
18
|
+
getActiveElement,
|
|
19
|
+
getDocument,
|
|
20
|
+
getWindow,
|
|
21
|
+
addGlobalEventListener,
|
|
22
|
+
getFirstTabbableIn,
|
|
23
|
+
isFocusable,
|
|
24
|
+
chain,
|
|
25
|
+
isSafari,
|
|
26
|
+
} from "@ariakit/utils";
|
|
27
|
+
import type { BooleanOrCallback } from "@ariakit/utils";
|
|
28
|
+
import type {
|
|
29
|
+
ComponentPropsWithRef,
|
|
30
|
+
ElementType,
|
|
31
|
+
FC,
|
|
32
|
+
ReactElement,
|
|
33
|
+
KeyboardEvent as ReactKeyboardEvent,
|
|
34
|
+
RefObject,
|
|
35
|
+
SyntheticEvent,
|
|
36
|
+
} from "react";
|
|
37
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
38
|
+
import type { DisclosureContentOptions } from "../disclosure/disclosure-content.tsx";
|
|
39
|
+
import {
|
|
40
|
+
isHidden,
|
|
41
|
+
useDisclosureContent,
|
|
42
|
+
} from "../disclosure/disclosure-content.tsx";
|
|
43
|
+
import { useFocusableContainer } from "../focusable/focusable-container.tsx";
|
|
44
|
+
import type { FocusableOptions } from "../focusable/focusable.tsx";
|
|
45
|
+
import { useFocusable } from "../focusable/focusable.tsx";
|
|
46
|
+
import { HeadingLevel } from "../heading/heading-level.tsx";
|
|
47
|
+
import type { PortalOptions } from "../portal/portal.tsx";
|
|
48
|
+
import { usePortal } from "../portal/portal.tsx";
|
|
49
|
+
import { DialogBackdrop } from "./dialog-backdrop.tsx";
|
|
50
|
+
import {
|
|
51
|
+
DialogDescriptionContext,
|
|
52
|
+
DialogHeadingContext,
|
|
53
|
+
DialogScopedContextProvider,
|
|
54
|
+
useDialogProviderContext,
|
|
55
|
+
} from "./dialog-context.tsx";
|
|
56
|
+
import type { DialogStore } from "./dialog-store.ts";
|
|
57
|
+
import { useDialogStore } from "./dialog-store.ts";
|
|
58
|
+
import { disableTree, disableTreeOutside } from "./utils/disable-tree.ts";
|
|
59
|
+
import { isElementMarked, markTreeOutside } from "./utils/mark-tree-outside.ts";
|
|
60
|
+
import { prependHiddenDismiss } from "./utils/prepend-hidden-dismiss.ts";
|
|
61
|
+
import { supportsInert } from "./utils/supports-inert.ts";
|
|
62
|
+
import { useHideOnInteractOutside } from "./utils/use-hide-on-interact-outside.ts";
|
|
63
|
+
import { useNestedDialogs } from "./utils/use-nested-dialogs.tsx";
|
|
64
|
+
import { usePreventBodyScroll } from "./utils/use-prevent-body-scroll.ts";
|
|
65
|
+
import { createWalkTreeSnapshot } from "./utils/walk-tree-outside.ts";
|
|
66
|
+
|
|
67
|
+
const TagName = "div" satisfies ElementType;
|
|
68
|
+
type TagName = typeof TagName;
|
|
69
|
+
type HTMLType = HTMLElementTagNameMap[TagName];
|
|
70
|
+
|
|
71
|
+
const isSafariBrowser = isSafari();
|
|
72
|
+
|
|
73
|
+
function isAlreadyFocusingAnotherElement(dialog?: HTMLElement | null) {
|
|
74
|
+
const activeElement = getActiveElement(dialog);
|
|
75
|
+
if (!activeElement) return false;
|
|
76
|
+
if (dialog && contains(dialog, activeElement)) return false;
|
|
77
|
+
if (isFocusable(activeElement)) return true;
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function getElementFromProp(
|
|
82
|
+
prop?: HTMLElement | RefObject<HTMLElement | null> | null,
|
|
83
|
+
focusable = false,
|
|
84
|
+
) {
|
|
85
|
+
if (!prop) return null;
|
|
86
|
+
const element = "current" in prop ? prop.current : prop;
|
|
87
|
+
if (!element) return null;
|
|
88
|
+
if (focusable) return isFocusable(element) ? element : null;
|
|
89
|
+
return element;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Returns props to create a `Dialog` component.
|
|
94
|
+
* @see https://ariakit.com/components/dialog
|
|
95
|
+
* @example
|
|
96
|
+
* ```jsx
|
|
97
|
+
* const store = useDialogStore();
|
|
98
|
+
* const props = useDialog({ store });
|
|
99
|
+
* <Role {...props}>Dialog</Role>
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export const useDialog = createHook<TagName, DialogOptions>(function useDialog({
|
|
103
|
+
store: storeProp,
|
|
104
|
+
open: openProp,
|
|
105
|
+
onClose,
|
|
106
|
+
focusable = true,
|
|
107
|
+
modal = true,
|
|
108
|
+
portal = modal,
|
|
109
|
+
backdrop = modal,
|
|
110
|
+
hideOnEscape = true,
|
|
111
|
+
hideOnInteractOutside = true,
|
|
112
|
+
getPersistentElements,
|
|
113
|
+
preventBodyScroll = modal,
|
|
114
|
+
autoFocusOnShow = true,
|
|
115
|
+
autoFocusOnHide = true,
|
|
116
|
+
initialFocus,
|
|
117
|
+
finalFocus,
|
|
118
|
+
unmountOnHide,
|
|
119
|
+
unstable_treeSnapshotKey,
|
|
120
|
+
...props
|
|
121
|
+
}) {
|
|
122
|
+
const context = useDialogProviderContext();
|
|
123
|
+
const ref = useRef<HTMLType>(null);
|
|
124
|
+
|
|
125
|
+
const store = useDialogStore({
|
|
126
|
+
store: storeProp || context,
|
|
127
|
+
open: openProp,
|
|
128
|
+
setOpen(open) {
|
|
129
|
+
if (open) return;
|
|
130
|
+
const dialog = ref.current;
|
|
131
|
+
if (!dialog) return;
|
|
132
|
+
const event = new Event("close", { bubbles: false, cancelable: true });
|
|
133
|
+
if (onClose) {
|
|
134
|
+
dialog.addEventListener("close", onClose, { once: true });
|
|
135
|
+
}
|
|
136
|
+
dialog.dispatchEvent(event);
|
|
137
|
+
if (!event.defaultPrevented) return;
|
|
138
|
+
store.setOpen(true);
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// domReady can be also the portal node element so it's updated when the
|
|
143
|
+
// portal node changes (like in between re-renders), triggering effects
|
|
144
|
+
// again.
|
|
145
|
+
const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
|
|
146
|
+
// Sets preserveTabOrder to true only if the dialog is not a modal and is
|
|
147
|
+
// open.
|
|
148
|
+
const preserveTabOrderProp = props.preserveTabOrder;
|
|
149
|
+
const preserveTabOrder = useStoreState(
|
|
150
|
+
store,
|
|
151
|
+
(state) => preserveTabOrderProp && !modal && state.mounted,
|
|
152
|
+
);
|
|
153
|
+
const id = useId(props.id);
|
|
154
|
+
const open = useStoreState(store, "open");
|
|
155
|
+
const mounted = useStoreState(store, "mounted");
|
|
156
|
+
const contentElement = useStoreState(store, "contentElement");
|
|
157
|
+
const hidden = isHidden(mounted, props.hidden, props.alwaysVisible);
|
|
158
|
+
|
|
159
|
+
usePreventBodyScroll(contentElement, id, preventBodyScroll && !hidden);
|
|
160
|
+
|
|
161
|
+
// Tracks whether the dialog was hidden by an outside click or context menu.
|
|
162
|
+
// When true, focusOnHide skips focus restoration to match native HTML
|
|
163
|
+
// behavior where trigger buttons don't receive focus when you click outside.
|
|
164
|
+
// Reset when the dialog opens to avoid stale flags from prevented closes
|
|
165
|
+
// (e.g., onClose calling event.preventDefault), async closes with
|
|
166
|
+
// animations, or when autoFocusOnHide is disabled.
|
|
167
|
+
const interactedOutsideRef = useRef(false);
|
|
168
|
+
useSafeLayoutEffect(() => {
|
|
169
|
+
return sync(store, ["open"], (state) => {
|
|
170
|
+
if (!state.open) return;
|
|
171
|
+
interactedOutsideRef.current = false;
|
|
172
|
+
});
|
|
173
|
+
}, [store]);
|
|
174
|
+
useHideOnInteractOutside(
|
|
175
|
+
store,
|
|
176
|
+
hideOnInteractOutside,
|
|
177
|
+
domReady,
|
|
178
|
+
interactedOutsideRef,
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
const { wrapElement, nestedDialogs } = useNestedDialogs(store);
|
|
182
|
+
props = useWrapElement(props, wrapElement, [wrapElement]);
|
|
183
|
+
|
|
184
|
+
// On Safari, buttons don't receive focus on mousedown unless they have an
|
|
185
|
+
// explicit tabIndex. Non-Ariakit buttons (which don't go through
|
|
186
|
+
// useFocusable) won't have this, so activeElement may still be BODY when the
|
|
187
|
+
// dialog opens. We track the last mousedown target as a fallback.
|
|
188
|
+
const lastMousedownRef = useRef<Element | null>(null);
|
|
189
|
+
|
|
190
|
+
if (isSafariBrowser) {
|
|
191
|
+
useEffect(() => {
|
|
192
|
+
if (!domReady) return;
|
|
193
|
+
const dialog = ref.current;
|
|
194
|
+
if (!dialog) return;
|
|
195
|
+
const doc = getDocument(dialog);
|
|
196
|
+
const onMousedown = (event: MouseEvent) => {
|
|
197
|
+
lastMousedownRef.current = event.target as Element;
|
|
198
|
+
};
|
|
199
|
+
doc.addEventListener("mousedown", onMousedown, true);
|
|
200
|
+
return () => {
|
|
201
|
+
doc.removeEventListener("mousedown", onMousedown, true);
|
|
202
|
+
};
|
|
203
|
+
}, [domReady]);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Sets disclosure element using the current active element right after the
|
|
207
|
+
// dialog is opened.
|
|
208
|
+
useSafeLayoutEffect(() => {
|
|
209
|
+
if (!open) return;
|
|
210
|
+
const dialog = ref.current;
|
|
211
|
+
const activeElement = getActiveElement(dialog, true);
|
|
212
|
+
if (!activeElement) return;
|
|
213
|
+
if (activeElement.tagName === "BODY") {
|
|
214
|
+
// Safari fallback: use the last mousedown target when activeElement is
|
|
215
|
+
// BODY (happens with native buttons that lack an explicit tabIndex).
|
|
216
|
+
const fallback = lastMousedownRef.current;
|
|
217
|
+
lastMousedownRef.current = null;
|
|
218
|
+
if (!fallback?.isConnected) return;
|
|
219
|
+
if (!isFocusable(fallback)) return;
|
|
220
|
+
if (dialog && contains(dialog, fallback)) return;
|
|
221
|
+
store.setDisclosureElement(fallback as HTMLElement);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
// The disclosure element can't be inside the dialog.
|
|
225
|
+
if (dialog && contains(dialog, activeElement)) return;
|
|
226
|
+
store.setDisclosureElement(activeElement);
|
|
227
|
+
}, [store, open]);
|
|
228
|
+
|
|
229
|
+
// Sets --dialog-viewport-height CSS variable to the height of the visual
|
|
230
|
+
// viewport. This allows the dialog to be positioned correctly when the
|
|
231
|
+
// viewport height changes (e.g., when the keyboard is shown on mobile).
|
|
232
|
+
useEffect(() => {
|
|
233
|
+
if (!mounted) return;
|
|
234
|
+
if (!domReady) return;
|
|
235
|
+
const dialog = ref.current;
|
|
236
|
+
if (!dialog) return;
|
|
237
|
+
const win = getWindow(dialog);
|
|
238
|
+
const viewport = win.visualViewport || win;
|
|
239
|
+
const setViewportHeight = () => {
|
|
240
|
+
const height = win.visualViewport?.height ?? win.innerHeight;
|
|
241
|
+
dialog.style.setProperty("--dialog-viewport-height", `${height}px`);
|
|
242
|
+
};
|
|
243
|
+
setViewportHeight();
|
|
244
|
+
viewport.addEventListener("resize", setViewportHeight);
|
|
245
|
+
return () => {
|
|
246
|
+
viewport.removeEventListener("resize", setViewportHeight);
|
|
247
|
+
};
|
|
248
|
+
}, [mounted, domReady]);
|
|
249
|
+
|
|
250
|
+
// Renders a hidden dismiss button at the top of the modal dialog element. So
|
|
251
|
+
// that screen reader users aren't trapped in the dialog when there's no
|
|
252
|
+
// visible dismiss button.
|
|
253
|
+
useEffect(() => {
|
|
254
|
+
if (!modal) return;
|
|
255
|
+
if (!mounted) return;
|
|
256
|
+
if (!domReady) return;
|
|
257
|
+
const dialog = ref.current;
|
|
258
|
+
if (!dialog) return;
|
|
259
|
+
// If there's already a DialogDismiss component, it does nothing.
|
|
260
|
+
const existingDismiss = dialog.querySelector("[data-dialog-dismiss]");
|
|
261
|
+
if (existingDismiss) return;
|
|
262
|
+
return prependHiddenDismiss(dialog, store.hide);
|
|
263
|
+
}, [store, modal, mounted, domReady]);
|
|
264
|
+
|
|
265
|
+
// When the dialog is animated, the open state will be false and the mounted
|
|
266
|
+
// state will be true. The dialog will still be visible until the animation is
|
|
267
|
+
// complete. We need to disable the dialog tree completely in this case. TODO:
|
|
268
|
+
// We should probably do this in a more generic way in the DisclosureContent
|
|
269
|
+
// component.
|
|
270
|
+
useSafeLayoutEffect(() => {
|
|
271
|
+
if (!supportsInert()) return;
|
|
272
|
+
if (open) return;
|
|
273
|
+
if (!mounted) return;
|
|
274
|
+
if (!domReady) return;
|
|
275
|
+
const dialog = ref.current;
|
|
276
|
+
if (!dialog) return;
|
|
277
|
+
return disableTree(dialog);
|
|
278
|
+
}, [open, mounted, domReady]);
|
|
279
|
+
|
|
280
|
+
const canTakeTreeSnapshot = open && domReady;
|
|
281
|
+
|
|
282
|
+
useSafeLayoutEffect(() => {
|
|
283
|
+
if (!id) return;
|
|
284
|
+
if (!canTakeTreeSnapshot) return;
|
|
285
|
+
const dialog = ref.current;
|
|
286
|
+
// When the dialog opens, we capture a snapshot of the document. This
|
|
287
|
+
// snapshot is then used to disable elements outside the dialog in the
|
|
288
|
+
// subsequent effect. However, the issue arises as this next effect also
|
|
289
|
+
// relies on nested dialogs. Meaning, each time a nested dialog is rendered,
|
|
290
|
+
// we capture a new document snapshot, which might disable third-party
|
|
291
|
+
// dialogs. Hence, we take the snapshot here, independent of any nested
|
|
292
|
+
// dialogs.
|
|
293
|
+
return createWalkTreeSnapshot(id, [dialog]);
|
|
294
|
+
}, [id, canTakeTreeSnapshot, unstable_treeSnapshotKey]);
|
|
295
|
+
|
|
296
|
+
const getPersistentElementsProp = useEvent(getPersistentElements);
|
|
297
|
+
|
|
298
|
+
// Disables/enables the element tree around the modal dialog element.
|
|
299
|
+
useSafeLayoutEffect(() => {
|
|
300
|
+
if (!id) return;
|
|
301
|
+
if (!canTakeTreeSnapshot) return;
|
|
302
|
+
const { disclosureElement } = store.getState();
|
|
303
|
+
const dialog = ref.current;
|
|
304
|
+
const persistentElements = getPersistentElementsProp() || [];
|
|
305
|
+
const allElements = [
|
|
306
|
+
dialog,
|
|
307
|
+
...persistentElements,
|
|
308
|
+
...nestedDialogs.map((dialog) => dialog.getState().contentElement),
|
|
309
|
+
];
|
|
310
|
+
if (modal) {
|
|
311
|
+
return chain(
|
|
312
|
+
markTreeOutside(id, allElements),
|
|
313
|
+
disableTreeOutside(id, allElements),
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
return markTreeOutside(id, [disclosureElement, ...allElements]);
|
|
317
|
+
}, [
|
|
318
|
+
id,
|
|
319
|
+
store,
|
|
320
|
+
canTakeTreeSnapshot,
|
|
321
|
+
getPersistentElementsProp,
|
|
322
|
+
nestedDialogs,
|
|
323
|
+
modal,
|
|
324
|
+
unstable_treeSnapshotKey,
|
|
325
|
+
]);
|
|
326
|
+
|
|
327
|
+
const mayAutoFocusOnShow = !!autoFocusOnShow;
|
|
328
|
+
const autoFocusOnShowProp = useBooleanEvent(autoFocusOnShow);
|
|
329
|
+
// We have to wait for the dialog to be mounted before allowing focusable
|
|
330
|
+
// elements to be auto focused. Otherwise, there could be unintended scroll
|
|
331
|
+
// jumps. See select-animated browser tests.
|
|
332
|
+
const [autoFocusEnabled, setAutoFocusEnabled] = useState(false);
|
|
333
|
+
|
|
334
|
+
// Auto focus on show.
|
|
335
|
+
useEffect(() => {
|
|
336
|
+
if (!open) return;
|
|
337
|
+
if (!mayAutoFocusOnShow) return;
|
|
338
|
+
// Makes sure to wait for the portalNode to be created before moving focus.
|
|
339
|
+
// This is useful for when the Dialog component is unmounted when hidden.
|
|
340
|
+
if (!domReady) return;
|
|
341
|
+
// The dialog element may change for different reasons. For example, when
|
|
342
|
+
// the modal or portal props change, the HTML structure will also change,
|
|
343
|
+
// which will affect the dialog element reference. That's why we're
|
|
344
|
+
// listening to contentElement state here instead of getting the ref.current
|
|
345
|
+
// value. This ensures this effect will re-run when the dialog element
|
|
346
|
+
// reference changes.
|
|
347
|
+
if (!contentElement?.isConnected) return;
|
|
348
|
+
const element =
|
|
349
|
+
getElementFromProp(initialFocus, true) ||
|
|
350
|
+
// If no initial focus is specified, we try to focus the first element
|
|
351
|
+
// with the autofocus attribute. If it's an Ariakit component, the
|
|
352
|
+
// Focusable component will consume the autoFocus prop and add the
|
|
353
|
+
// data-autofocus attribute to the element instead.
|
|
354
|
+
contentElement.querySelector<HTMLElement>(
|
|
355
|
+
"[data-autofocus=true],[autofocus]",
|
|
356
|
+
) ||
|
|
357
|
+
// We have to fallback to the first focusable element otherwise portaled
|
|
358
|
+
// dialogs with preserveTabOrder set to true will not receive focus
|
|
359
|
+
// properly because the elements aren't tabbable until the dialog receives
|
|
360
|
+
// focus.
|
|
361
|
+
getFirstTabbableIn(contentElement, true, portal && preserveTabOrder) ||
|
|
362
|
+
// Finally, we fallback to the dialog element itself.
|
|
363
|
+
contentElement;
|
|
364
|
+
const isElementFocusable = isFocusable(element);
|
|
365
|
+
if (!autoFocusOnShowProp(isElementFocusable ? element : null)) return;
|
|
366
|
+
setAutoFocusEnabled(true);
|
|
367
|
+
queueMicrotask(() => {
|
|
368
|
+
// If the dialog was closed between scheduling and executing this
|
|
369
|
+
// microtask, skip the focus call. Otherwise, focusing a now-hidden
|
|
370
|
+
// element could steal focus from the disclosure that focusOnHide already
|
|
371
|
+
// restored.
|
|
372
|
+
if (!store.getState().open) return;
|
|
373
|
+
element.focus();
|
|
374
|
+
// Safari doesn't scroll to the element on focus, so we have to do it
|
|
375
|
+
// manually here.
|
|
376
|
+
if (!isSafariBrowser) return;
|
|
377
|
+
if (!isElementFocusable) return;
|
|
378
|
+
element.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
379
|
+
});
|
|
380
|
+
}, [
|
|
381
|
+
open,
|
|
382
|
+
mayAutoFocusOnShow,
|
|
383
|
+
domReady,
|
|
384
|
+
contentElement,
|
|
385
|
+
initialFocus,
|
|
386
|
+
portal,
|
|
387
|
+
preserveTabOrder,
|
|
388
|
+
store,
|
|
389
|
+
autoFocusOnShowProp,
|
|
390
|
+
]);
|
|
391
|
+
|
|
392
|
+
const mayAutoFocusOnHide = !!autoFocusOnHide;
|
|
393
|
+
const autoFocusOnHideProp = useBooleanEvent(autoFocusOnHide);
|
|
394
|
+
|
|
395
|
+
// Sets a `hasOpened` flag on an effect so we only auto focus on hide if the
|
|
396
|
+
// dialog was open before.
|
|
397
|
+
const [hasOpened, setHasOpened] = useState(false);
|
|
398
|
+
|
|
399
|
+
useSafeLayoutEffect(() => {
|
|
400
|
+
if (!open) return;
|
|
401
|
+
setHasOpened(true);
|
|
402
|
+
return () => setHasOpened(false);
|
|
403
|
+
}, [open]);
|
|
404
|
+
|
|
405
|
+
const focusOnHide = useCallback(
|
|
406
|
+
(dialog: HTMLElement | null, retry = true) => {
|
|
407
|
+
// Hide was triggered by clicking or right-clicking outside the dialog.
|
|
408
|
+
// Native HTML dialogs and popovers don't restore focus to the trigger
|
|
409
|
+
// in this case, so we skip focus restoration entirely.
|
|
410
|
+
if (interactedOutsideRef.current) return;
|
|
411
|
+
const { disclosureElement } = store.getState();
|
|
412
|
+
// Hide was triggered by a click/focus on a tabbable element outside the
|
|
413
|
+
// dialog. We won't change focus then.
|
|
414
|
+
if (isAlreadyFocusingAnotherElement(dialog)) return;
|
|
415
|
+
let element = getElementFromProp(finalFocus) || disclosureElement;
|
|
416
|
+
if (element?.id) {
|
|
417
|
+
const doc = getDocument(element);
|
|
418
|
+
const selector = `[aria-activedescendant="${element.id}"]`;
|
|
419
|
+
const composite = doc.querySelector<HTMLElement>(selector);
|
|
420
|
+
// If the element is an item in a composite widget that handles focus
|
|
421
|
+
// with the `aria-activedescendant` attribute, we want to focus on the
|
|
422
|
+
// composite element itself.
|
|
423
|
+
if (composite) {
|
|
424
|
+
element = composite;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
// If the element is not focusable by the time the dialog is hidden, it's
|
|
428
|
+
// probably because it's an element inside another popover or menu that
|
|
429
|
+
// also got hidden when this dialog was shown. We'll try to focus on their
|
|
430
|
+
// disclosure element instead.
|
|
431
|
+
if (element && !isFocusable(element)) {
|
|
432
|
+
const maybeParentDialog = element.closest("[data-dialog]");
|
|
433
|
+
if (maybeParentDialog?.id) {
|
|
434
|
+
const doc = getDocument(maybeParentDialog);
|
|
435
|
+
const selector = `[aria-controls~="${maybeParentDialog.id}"]`;
|
|
436
|
+
const control = doc.querySelector<HTMLElement>(selector);
|
|
437
|
+
if (control) {
|
|
438
|
+
element = control;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
const isElementFocusable = element && isFocusable(element);
|
|
443
|
+
if (!isElementFocusable && retry) {
|
|
444
|
+
// If the element is still not focusable by this time, we retry once
|
|
445
|
+
// again on the next frame. This is sometimes necessary because there
|
|
446
|
+
// may be nested dialogs that still need a tick to remove the inert
|
|
447
|
+
// attribute from elements outside.
|
|
448
|
+
requestAnimationFrame(() => focusOnHide(dialog, false));
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (!autoFocusOnHideProp(isElementFocusable ? element : null)) return;
|
|
452
|
+
if (!isElementFocusable) return;
|
|
453
|
+
element?.focus();
|
|
454
|
+
},
|
|
455
|
+
[store, finalFocus, autoFocusOnHideProp],
|
|
456
|
+
);
|
|
457
|
+
|
|
458
|
+
const focusedOnHideRef = useRef(false);
|
|
459
|
+
|
|
460
|
+
// Auto focus on hide with an always rendered dialog.
|
|
461
|
+
useSafeLayoutEffect(() => {
|
|
462
|
+
if (open) return;
|
|
463
|
+
if (!hasOpened) return;
|
|
464
|
+
if (!mayAutoFocusOnHide) return;
|
|
465
|
+
const dialog = ref.current;
|
|
466
|
+
// We don't want to focus on hide twice if the dialog is not unmounted, so
|
|
467
|
+
// we set this flag here that will be checked in the cleanup effect below.
|
|
468
|
+
focusedOnHideRef.current = true;
|
|
469
|
+
focusOnHide(dialog);
|
|
470
|
+
}, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]);
|
|
471
|
+
|
|
472
|
+
// Auto focus on hide with a dialog that gets unmounted when hidden.
|
|
473
|
+
useEffect(() => {
|
|
474
|
+
if (!hasOpened) return;
|
|
475
|
+
if (!mayAutoFocusOnHide) return;
|
|
476
|
+
const dialog = ref.current;
|
|
477
|
+
return () => {
|
|
478
|
+
if (focusedOnHideRef.current) {
|
|
479
|
+
focusedOnHideRef.current = false;
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
focusOnHide(dialog);
|
|
483
|
+
};
|
|
484
|
+
}, [hasOpened, mayAutoFocusOnHide, focusOnHide]);
|
|
485
|
+
|
|
486
|
+
const hideOnEscapeProp = useBooleanEvent(hideOnEscape);
|
|
487
|
+
|
|
488
|
+
// Hide on Escape.
|
|
489
|
+
useEffect(() => {
|
|
490
|
+
if (!domReady) return;
|
|
491
|
+
if (!mounted) return;
|
|
492
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
493
|
+
if (event.key !== "Escape") return;
|
|
494
|
+
if (event.defaultPrevented) return;
|
|
495
|
+
const dialog = ref.current;
|
|
496
|
+
if (!dialog) return;
|
|
497
|
+
// Ignore the event if the current dialog is marked by another dialog.
|
|
498
|
+
// This guarantees that only the topmost dialog will close on Escape.
|
|
499
|
+
if (isElementMarked(dialog)) return;
|
|
500
|
+
const target = event.target as Element | null;
|
|
501
|
+
if (!target) return;
|
|
502
|
+
const { disclosureElement } = store.getState();
|
|
503
|
+
// This considers valid targets only the disclosure element or descendants
|
|
504
|
+
// of the dialog element.
|
|
505
|
+
const isValidTarget = () => {
|
|
506
|
+
if (target.tagName === "BODY") return true;
|
|
507
|
+
if (contains(dialog, target)) return true;
|
|
508
|
+
if (!disclosureElement) return true;
|
|
509
|
+
if (contains(disclosureElement, target)) return true;
|
|
510
|
+
return false;
|
|
511
|
+
};
|
|
512
|
+
if (!isValidTarget()) return;
|
|
513
|
+
if (!hideOnEscapeProp(event)) return;
|
|
514
|
+
store.hide();
|
|
515
|
+
};
|
|
516
|
+
// We're attatching the listener to the document instead of the dialog
|
|
517
|
+
// element so we can listen to the Escape key anywhere in the document, even
|
|
518
|
+
// when the dialog is not focused. By using the capture phase, users can
|
|
519
|
+
// call `event.stopPropagation()` on the `hideOnEscape` function prop.
|
|
520
|
+
const win = contentElement ? getWindow(contentElement) : undefined;
|
|
521
|
+
return addGlobalEventListener("keydown", onKeyDown, true, win);
|
|
522
|
+
}, [store, domReady, mounted, contentElement, hideOnEscapeProp]);
|
|
523
|
+
|
|
524
|
+
// Resets the heading levels inside the modal dialog so they start with h1.
|
|
525
|
+
props = useWrapElement(
|
|
526
|
+
props,
|
|
527
|
+
(element) => (
|
|
528
|
+
<HeadingLevel level={modal ? 1 : undefined}>{element}</HeadingLevel>
|
|
529
|
+
),
|
|
530
|
+
[modal],
|
|
531
|
+
);
|
|
532
|
+
|
|
533
|
+
const hiddenProp = props.hidden;
|
|
534
|
+
const alwaysVisible = props.alwaysVisible;
|
|
535
|
+
|
|
536
|
+
// Wraps the dialog with a backdrop element if the backdrop prop is truthy.
|
|
537
|
+
props = useWrapElement(
|
|
538
|
+
props,
|
|
539
|
+
(element) => {
|
|
540
|
+
if (!backdrop) return element;
|
|
541
|
+
return (
|
|
542
|
+
<>
|
|
543
|
+
<DialogBackdrop
|
|
544
|
+
store={store}
|
|
545
|
+
backdrop={backdrop}
|
|
546
|
+
hidden={hiddenProp}
|
|
547
|
+
alwaysVisible={alwaysVisible}
|
|
548
|
+
/>
|
|
549
|
+
{element}
|
|
550
|
+
</>
|
|
551
|
+
);
|
|
552
|
+
},
|
|
553
|
+
[store, backdrop, hiddenProp, alwaysVisible],
|
|
554
|
+
);
|
|
555
|
+
|
|
556
|
+
const [headingId, setHeadingId] = useState<string>();
|
|
557
|
+
const [descriptionId, setDescriptionId] = useState<string>();
|
|
558
|
+
|
|
559
|
+
props = useWrapElement(
|
|
560
|
+
props,
|
|
561
|
+
(element) => (
|
|
562
|
+
<DialogScopedContextProvider value={store}>
|
|
563
|
+
<DialogHeadingContext.Provider value={setHeadingId}>
|
|
564
|
+
<DialogDescriptionContext.Provider value={setDescriptionId}>
|
|
565
|
+
{element}
|
|
566
|
+
</DialogDescriptionContext.Provider>
|
|
567
|
+
</DialogHeadingContext.Provider>
|
|
568
|
+
</DialogScopedContextProvider>
|
|
569
|
+
),
|
|
570
|
+
[store],
|
|
571
|
+
);
|
|
572
|
+
|
|
573
|
+
props = {
|
|
574
|
+
"data-dialog": "",
|
|
575
|
+
role: "dialog",
|
|
576
|
+
tabIndex: focusable ? -1 : undefined,
|
|
577
|
+
"aria-labelledby": props["aria-label"] != null ? undefined : headingId,
|
|
578
|
+
"aria-describedby": descriptionId,
|
|
579
|
+
...props,
|
|
580
|
+
id,
|
|
581
|
+
ref: useMergeRefs(ref, props.ref),
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
props = useFocusableContainer({
|
|
585
|
+
...props,
|
|
586
|
+
autoFocusOnShow: autoFocusEnabled,
|
|
587
|
+
});
|
|
588
|
+
props = useDisclosureContent({ store, ...props });
|
|
589
|
+
props = useFocusable({ ...props, focusable });
|
|
590
|
+
props = usePortal({ portal, ...props, portalRef, preserveTabOrder });
|
|
591
|
+
|
|
592
|
+
return props;
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
export function createDialogComponent<T extends DialogOptions>(
|
|
596
|
+
Component: FC<T>,
|
|
597
|
+
useProviderContext = useDialogProviderContext,
|
|
598
|
+
) {
|
|
599
|
+
return forwardRef(function DialogComponent(props: T) {
|
|
600
|
+
const context = useProviderContext();
|
|
601
|
+
const store = props.store || context;
|
|
602
|
+
const mounted = useStoreState(
|
|
603
|
+
store,
|
|
604
|
+
(state) => !props.unmountOnHide || state?.mounted || !!props.open,
|
|
605
|
+
);
|
|
606
|
+
if (!mounted) return null;
|
|
607
|
+
return <Component {...props} />;
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Renders a dialog similar to the native `dialog` element that's rendered in a
|
|
613
|
+
* [`portal`](https://ariakit.com/reference/dialog#portal) by default.
|
|
614
|
+
*
|
|
615
|
+
* The dialog can be either
|
|
616
|
+
* [`modal`](https://ariakit.com/reference/dialog#modal) or non-modal. The
|
|
617
|
+
* visibility state can be controlled with the
|
|
618
|
+
* [`open`](https://ariakit.com/reference/dialog#open) and
|
|
619
|
+
* [`onClose`](https://ariakit.com/reference/dialog#onclose) props.
|
|
620
|
+
* @see https://ariakit.com/components/dialog
|
|
621
|
+
* @example
|
|
622
|
+
* ```jsx {4-6}
|
|
623
|
+
* const [open, setOpen] = useState(false);
|
|
624
|
+
*
|
|
625
|
+
* <button onClick={() => setOpen(true)}>Open dialog</button>
|
|
626
|
+
* <Dialog open={open} onClose={() => setOpen(false)}>
|
|
627
|
+
* Dialog
|
|
628
|
+
* </Dialog>
|
|
629
|
+
* ```
|
|
630
|
+
*/
|
|
631
|
+
export const Dialog = createDialogComponent(
|
|
632
|
+
forwardRef(function Dialog(props: DialogProps) {
|
|
633
|
+
const htmlProps = useDialog(props);
|
|
634
|
+
return createElement(TagName, htmlProps);
|
|
635
|
+
}),
|
|
636
|
+
useDialogProviderContext,
|
|
637
|
+
);
|
|
638
|
+
|
|
639
|
+
export interface DialogOptions<T extends ElementType = TagName>
|
|
640
|
+
extends FocusableOptions<T>, PortalOptions<T>, DisclosureContentOptions<T> {
|
|
641
|
+
/**
|
|
642
|
+
* Object returned by the
|
|
643
|
+
* [`useDialogStore`](https://ariakit.com/reference/use-dialog-store) hook. If
|
|
644
|
+
* not provided, the closest
|
|
645
|
+
* [`DialogProvider`](https://ariakit.com/reference/dialog-provider)
|
|
646
|
+
* component's context will be used. Otherwise, an internal store will be
|
|
647
|
+
* created.
|
|
648
|
+
*/
|
|
649
|
+
store?: DialogStore;
|
|
650
|
+
/**
|
|
651
|
+
* Controls the open state of the dialog. This is similar to the
|
|
652
|
+
* [`open`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/open)
|
|
653
|
+
* attribute on native dialog elements.
|
|
654
|
+
*
|
|
655
|
+
* Live examples:
|
|
656
|
+
* - [Dialog with scrollable
|
|
657
|
+
* backdrop](https://ariakit.com/examples/dialog-backdrop-scrollable)
|
|
658
|
+
* - [Dialog with details &
|
|
659
|
+
* summary](https://ariakit.com/examples/dialog-details)
|
|
660
|
+
* - [Warning on Dialog
|
|
661
|
+
* hide](https://ariakit.com/examples/dialog-hide-warning)
|
|
662
|
+
* - [Dialog with Menu](https://ariakit.com/examples/dialog-menu)
|
|
663
|
+
*/
|
|
664
|
+
open?: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* This is an event handler prop triggered when the dialog's `close` event is
|
|
667
|
+
* dispatched. The `close` event is similar to the native dialog
|
|
668
|
+
* [`close`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/close_event)
|
|
669
|
+
* event. The only difference is that this event can be canceled with
|
|
670
|
+
* `event.preventDefault()`, which will prevent the dialog from hiding.
|
|
671
|
+
*
|
|
672
|
+
* It's important to note that this event only fires when the dialog store's
|
|
673
|
+
* [`open`](https://ariakit.com/reference/use-dialog-store#open) state is set
|
|
674
|
+
* to `false`. If the controlled
|
|
675
|
+
* [`open`](https://ariakit.com/reference/dialog#open) prop value changes, or
|
|
676
|
+
* if the dialog's visibility is altered in any other way (such as unmounting
|
|
677
|
+
* the dialog without adjusting the open state), this event won't be
|
|
678
|
+
* triggered.
|
|
679
|
+
*
|
|
680
|
+
* Live examples:
|
|
681
|
+
* - [Dialog with scrollable
|
|
682
|
+
* backdrop](https://ariakit.com/examples/dialog-backdrop-scrollable)
|
|
683
|
+
* - [Dialog with details &
|
|
684
|
+
* summary](https://ariakit.com/examples/dialog-details)
|
|
685
|
+
* - [Warning on Dialog
|
|
686
|
+
* hide](https://ariakit.com/examples/dialog-hide-warning)
|
|
687
|
+
* - [Dialog with Menu](https://ariakit.com/examples/dialog-menu)
|
|
688
|
+
*/
|
|
689
|
+
onClose?: (event: Event) => void;
|
|
690
|
+
/**
|
|
691
|
+
* Determines whether the dialog is modal. Modal dialogs have distinct states
|
|
692
|
+
* and behaviors:
|
|
693
|
+
* - The [`portal`](https://ariakit.com/reference/dialog#portal) and
|
|
694
|
+
* [`preventBodyScroll`](https://ariakit.com/reference/dialog#preventbodyscroll)
|
|
695
|
+
* props are set to `true`. They can still be manually set to `false`.
|
|
696
|
+
* - When using the [`Heading`](https://ariakit.com/reference/heading) or
|
|
697
|
+
* [`DialogHeading`](https://ariakit.com/reference/dialog-heading)
|
|
698
|
+
* components within the dialog, their level will be reset so they start
|
|
699
|
+
* with `h1`.
|
|
700
|
+
* - A visually hidden dismiss button will be rendered if the
|
|
701
|
+
* [`DialogDismiss`](https://ariakit.com/reference/dialog-dismiss) component
|
|
702
|
+
* hasn't been used. This allows screen reader users to close the dialog.
|
|
703
|
+
* - When the dialog is open, element tree outside it will be inert.
|
|
704
|
+
*
|
|
705
|
+
* Live examples:
|
|
706
|
+
* - [Combobox with Tabs](https://ariakit.com/examples/combobox-tabs)
|
|
707
|
+
* - [Dialog with details &
|
|
708
|
+
* summary](https://ariakit.com/examples/dialog-details)
|
|
709
|
+
* - [Form with Select](https://ariakit.com/examples/form-select)
|
|
710
|
+
* - [Context menu](https://ariakit.com/examples/menu-context-menu)
|
|
711
|
+
* - [Responsive Popover](https://ariakit.com/examples/popover-responsive)
|
|
712
|
+
* @default true
|
|
713
|
+
*/
|
|
714
|
+
modal?: boolean;
|
|
715
|
+
/**
|
|
716
|
+
* Determines whether there will be a backdrop behind the dialog. On modal
|
|
717
|
+
* dialogs, this is `true` by default. Besides a `boolean`, this prop can also
|
|
718
|
+
* be a React component or JSX element that will be rendered as the backdrop.
|
|
719
|
+
*
|
|
720
|
+
* **Note**: If a custom component is used, it must [accept ref and spread all
|
|
721
|
+
* props to its underlying DOM
|
|
722
|
+
* element](https://ariakit.com/guide/composition#custom-components-must-be-open-for-extension),
|
|
723
|
+
* the same way a native element would.
|
|
724
|
+
*
|
|
725
|
+
* Live examples:
|
|
726
|
+
* - [Animated Dialog](https://ariakit.com/examples/dialog-animated)
|
|
727
|
+
* - [Dialog with scrollable
|
|
728
|
+
* backdrop](https://ariakit.com/examples/dialog-backdrop-scrollable)
|
|
729
|
+
* - [Dialog with
|
|
730
|
+
* Motion](https://ariakit.com/examples/dialog-framer-motion)
|
|
731
|
+
* - [Dialog with Menu](https://ariakit.com/examples/dialog-menu)
|
|
732
|
+
* - [Nested Dialog](https://ariakit.com/examples/dialog-nested)
|
|
733
|
+
* - [Dialog with Next.js App
|
|
734
|
+
* Router](https://ariakit.com/examples/dialog-next-router)
|
|
735
|
+
* @example
|
|
736
|
+
* ```jsx
|
|
737
|
+
* <Dialog backdrop={<div className="backdrop" />} />
|
|
738
|
+
* ```
|
|
739
|
+
*/
|
|
740
|
+
backdrop?:
|
|
741
|
+
| boolean
|
|
742
|
+
| ReactElement<ComponentPropsWithRef<"div">>
|
|
743
|
+
| ElementType<ComponentPropsWithRef<"div">>;
|
|
744
|
+
/**
|
|
745
|
+
* Determines if the dialog will hide when the user presses the Escape key.
|
|
746
|
+
*
|
|
747
|
+
* This prop can be either a boolean or a function that accepts an event as an
|
|
748
|
+
* argument and returns a boolean. The event object represents the keydown
|
|
749
|
+
* event that initiated the hide action, which could be either a native
|
|
750
|
+
* keyboard event or a React synthetic event.
|
|
751
|
+
*
|
|
752
|
+
* **Note**: When placing Ariakit dialogs inside third-party dialogs, using
|
|
753
|
+
* `event.stopPropagation()` within this function will stop the event from
|
|
754
|
+
* reaching the third-party dialog, closing only the Ariakit dialog.
|
|
755
|
+
* @default true
|
|
756
|
+
*/
|
|
757
|
+
hideOnEscape?: BooleanOrCallback<KeyboardEvent | ReactKeyboardEvent>;
|
|
758
|
+
/**
|
|
759
|
+
* Determines if the dialog should hide when the user clicks or focuses on an
|
|
760
|
+
* element outside the dialog.
|
|
761
|
+
*
|
|
762
|
+
* This prop can be either a boolean or a function that takes an event as an
|
|
763
|
+
* argument and returns a boolean. The event object represents the event that
|
|
764
|
+
* triggered the action, which could be a native event or a React synthetic
|
|
765
|
+
* event of various types.
|
|
766
|
+
*
|
|
767
|
+
* Live examples:
|
|
768
|
+
* - [Selection Popover](https://ariakit.com/examples/popover-selection)
|
|
769
|
+
* @default true
|
|
770
|
+
*/
|
|
771
|
+
hideOnInteractOutside?: BooleanOrCallback<Event | SyntheticEvent>;
|
|
772
|
+
/**
|
|
773
|
+
* When a dialog is open, the elements outside of it are disabled to prevent
|
|
774
|
+
* interaction if the dialog is
|
|
775
|
+
* [`modal`](https://ariakit.com/reference/dialog#modal). For non-modal
|
|
776
|
+
* dialogs, interacting with elements outside the dialog prompts it to close.
|
|
777
|
+
*
|
|
778
|
+
* This function allows you to return an iterable collection of elements that
|
|
779
|
+
* will be considered as part of the dialog, thus excluding them from this
|
|
780
|
+
* behavior.
|
|
781
|
+
*
|
|
782
|
+
* **Note**: The elements returned by this function must exist in the DOM when
|
|
783
|
+
* the dialog opens.
|
|
784
|
+
*
|
|
785
|
+
* Live examples:
|
|
786
|
+
* - [Dialog with
|
|
787
|
+
* React-Toastify](https://ariakit.com/examples/dialog-react-toastify)
|
|
788
|
+
*/
|
|
789
|
+
getPersistentElements?: () => Iterable<Element>;
|
|
790
|
+
/**
|
|
791
|
+
* Determines whether the body scrolling will be prevented when the dialog is
|
|
792
|
+
* shown. This is automatically set to `true` when the dialog is
|
|
793
|
+
* [`modal`](https://ariakit.com/reference/dialog#modal). You can disable this
|
|
794
|
+
* prop if you want to implement your own logic.
|
|
795
|
+
*/
|
|
796
|
+
preventBodyScroll?: boolean;
|
|
797
|
+
/**
|
|
798
|
+
* Determines whether an element inside the dialog will receive focus when the
|
|
799
|
+
* dialog is shown. By default, this is usually the first tabbable element in
|
|
800
|
+
* the dialog or the dialog itself. The
|
|
801
|
+
* [`initialFocus`](https://ariakit.com/reference/dialog#initialfocus) prop
|
|
802
|
+
* can be used to set a different element to receive focus.
|
|
803
|
+
*
|
|
804
|
+
* Live examples:
|
|
805
|
+
* - [Warning on Dialog
|
|
806
|
+
* hide](https://ariakit.com/examples/dialog-hide-warning)
|
|
807
|
+
* - [Sliding Menu](https://ariakit.com/examples/menu-slide)
|
|
808
|
+
* - [Selection Popover](https://ariakit.com/examples/popover-selection)
|
|
809
|
+
* @default true
|
|
810
|
+
*/
|
|
811
|
+
autoFocusOnShow?: BooleanOrCallback<HTMLElement | null>;
|
|
812
|
+
/**
|
|
813
|
+
* Determines whether an element outside of the dialog will be focused when
|
|
814
|
+
* the dialog is hidden if another element hasn't been focused in the action
|
|
815
|
+
* of hiding the dialog (for example, by clicking or tabbing into another
|
|
816
|
+
* tabbable element outside of the dialog).
|
|
817
|
+
*
|
|
818
|
+
* By default, this is usually the disclosure element. The
|
|
819
|
+
* [`finalFocus`](https://ariakit.com/reference/dialog#finalfocus) prop can be
|
|
820
|
+
* used to define a different element to be focused.
|
|
821
|
+
*
|
|
822
|
+
* Live examples:
|
|
823
|
+
* - [Dialog with Next.js App
|
|
824
|
+
* Router](https://ariakit.com/examples/dialog-next-router)
|
|
825
|
+
* - [Sliding menu](https://ariakit.com/examples/menu-slide)
|
|
826
|
+
* @default true
|
|
827
|
+
*/
|
|
828
|
+
autoFocusOnHide?: BooleanOrCallback<HTMLElement | null>;
|
|
829
|
+
/**
|
|
830
|
+
* Specifies the element that will receive focus when the dialog is first
|
|
831
|
+
* opened. It can be an `HTMLElement` or a `React.RefObject` with an
|
|
832
|
+
* `HTMLElement`.
|
|
833
|
+
*
|
|
834
|
+
* If
|
|
835
|
+
* [`autoFocusOnShow`](https://ariakit.com/reference/dialog#autofocusonshow)
|
|
836
|
+
* is set to `false`, this prop will have no effect. If left unset, the dialog
|
|
837
|
+
* will attempt to determine the initial focus element in the following order:
|
|
838
|
+
* 1. A [Focusable](https://ariakit.com/components/focusable) element with an
|
|
839
|
+
* [`autoFocus`](https://ariakit.com/reference/focusable#autofocus) prop.
|
|
840
|
+
* 2. The first tabbable element inside the dialog.
|
|
841
|
+
* 3. The first focusable element inside the dialog.
|
|
842
|
+
* 4. The dialog element itself.
|
|
843
|
+
*/
|
|
844
|
+
initialFocus?: HTMLElement | RefObject<HTMLElement | null> | null;
|
|
845
|
+
/**
|
|
846
|
+
* Determines the element that will receive focus once the dialog is closed,
|
|
847
|
+
* provided that no other element has been focused while the dialog was being
|
|
848
|
+
* hidden (e.g., by clicking or tabbing into another tabbable element outside
|
|
849
|
+
* of the dialog).
|
|
850
|
+
* - If
|
|
851
|
+
* [`autoFocusOnHide`](https://ariakit.com/reference/dialog#autofocusonhide)
|
|
852
|
+
* is set to `false`, this prop will have no effect.
|
|
853
|
+
* - If left unset, the element that was focused before the dialog was opened
|
|
854
|
+
* will be focused again.
|
|
855
|
+
*/
|
|
856
|
+
finalFocus?: HTMLElement | RefObject<HTMLElement | null> | null;
|
|
857
|
+
/**
|
|
858
|
+
* @private
|
|
859
|
+
*/
|
|
860
|
+
unstable_treeSnapshotKey?: string | number | boolean | null;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export type DialogProps<T extends ElementType = TagName> = Props<
|
|
864
|
+
T,
|
|
865
|
+
DialogOptions<T>
|
|
866
|
+
>;
|