@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,169 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createDialogComponent } from "../dialog/dialog.js";
|
|
3
|
+
import { useHovercard } from "../hovercard/hovercard.js";
|
|
4
|
+
import { useMenuProviderContext } from "./menu-context.js";
|
|
5
|
+
import { useMenuList } from "./menu-list.js";
|
|
6
|
+
import { createElement, createHook, forwardRef, useMergeRefs } from "@ariakit/react-utils";
|
|
7
|
+
import { fireEvent, hasFocusWithin, invariant, isFalsyBooleanCallback } from "@ariakit/utils";
|
|
8
|
+
import { createRef, useEffect, useMemo, useRef, useState } from "react";
|
|
9
|
+
import { useStoreState } from "@ariakit/react-store";
|
|
10
|
+
//#region src/menu/menu.tsx
|
|
11
|
+
const TagName = "div";
|
|
12
|
+
/**
|
|
13
|
+
* Returns props to create a `Menu` component.
|
|
14
|
+
* @see https://ariakit.com/components/menu
|
|
15
|
+
* @example
|
|
16
|
+
* ```jsx
|
|
17
|
+
* const store = useMenuStore();
|
|
18
|
+
* const props = useMenu({ store });
|
|
19
|
+
* <MenuButton store={store}>Edit</MenuButton>
|
|
20
|
+
* <Role {...props}>
|
|
21
|
+
* <MenuItem>Undo</MenuItem>
|
|
22
|
+
* <MenuItem>Redo</MenuItem>
|
|
23
|
+
* </Role>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
const useMenu = createHook(function useMenu({ store, modal: modalProp = false, portal = modalProp, hideOnEscape = true, autoFocusOnShow = true, hideOnHoverOutside, alwaysVisible, ...props }) {
|
|
27
|
+
const context = useMenuProviderContext();
|
|
28
|
+
store = store || context;
|
|
29
|
+
invariant(store, "Menu must receive a `store` prop or be wrapped in a MenuProvider component.");
|
|
30
|
+
const ref = useRef(null);
|
|
31
|
+
const parentMenu = store.parent;
|
|
32
|
+
const parentMenubar = store.menubar;
|
|
33
|
+
const hasParentMenu = !!parentMenu;
|
|
34
|
+
const parentIsMenubar = !!parentMenubar && !hasParentMenu;
|
|
35
|
+
const modal = hasParentMenu ? false : modalProp;
|
|
36
|
+
props = {
|
|
37
|
+
...props,
|
|
38
|
+
ref: useMergeRefs(ref, props.ref)
|
|
39
|
+
};
|
|
40
|
+
const { "aria-labelledby": ariaLabelledBy, ...menuListProps } = useMenuList({
|
|
41
|
+
store,
|
|
42
|
+
alwaysVisible,
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
props = menuListProps;
|
|
46
|
+
const [initialFocusRef, setInitialFocusRef] = useState();
|
|
47
|
+
const autoFocusOnShowState = useStoreState(store, "autoFocusOnShow");
|
|
48
|
+
const initialFocus = useStoreState(store, "initialFocus");
|
|
49
|
+
const baseElement = useStoreState(store, "baseElement");
|
|
50
|
+
const items = useStoreState(store, "renderedItems");
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
let cleaning = false;
|
|
53
|
+
setInitialFocusRef((prevInitialFocusRef) => {
|
|
54
|
+
if (cleaning) return;
|
|
55
|
+
if (modal && prevInitialFocusRef?.current?.isConnected) return prevInitialFocusRef;
|
|
56
|
+
if (!autoFocusOnShowState) return;
|
|
57
|
+
let element;
|
|
58
|
+
switch (initialFocus) {
|
|
59
|
+
case "first":
|
|
60
|
+
element = items.find((item) => !item.disabled && item.element)?.element || null;
|
|
61
|
+
break;
|
|
62
|
+
case "last":
|
|
63
|
+
element = [...items].reverse().find((item) => !item.disabled && item.element)?.element || null;
|
|
64
|
+
break;
|
|
65
|
+
default: element = baseElement;
|
|
66
|
+
}
|
|
67
|
+
if (element && element === prevInitialFocusRef?.current) return prevInitialFocusRef;
|
|
68
|
+
const ref = createRef();
|
|
69
|
+
ref.current = element;
|
|
70
|
+
return ref;
|
|
71
|
+
});
|
|
72
|
+
return () => {
|
|
73
|
+
cleaning = true;
|
|
74
|
+
};
|
|
75
|
+
}, [
|
|
76
|
+
store,
|
|
77
|
+
modal,
|
|
78
|
+
autoFocusOnShowState,
|
|
79
|
+
initialFocus,
|
|
80
|
+
items,
|
|
81
|
+
baseElement
|
|
82
|
+
]);
|
|
83
|
+
const canAutoFocusOnShow = !!initialFocusRef || !!props.initialFocus || modal;
|
|
84
|
+
const autoFocusOnShowProp = autoFocusOnShow === false ? false : canAutoFocusOnShow && autoFocusOnShow;
|
|
85
|
+
const contentElement = useStoreState(store.combobox || store, "contentElement");
|
|
86
|
+
const parentContentElement = useStoreState(parentMenu?.combobox || parentMenu, "contentElement");
|
|
87
|
+
const preserveTabOrderAnchor = useMemo(() => {
|
|
88
|
+
if (!parentContentElement) return;
|
|
89
|
+
if (!contentElement) return;
|
|
90
|
+
const role = contentElement.getAttribute("role");
|
|
91
|
+
const parentRole = parentContentElement.getAttribute("role");
|
|
92
|
+
if ((parentRole === "menu" || parentRole === "menubar") && role === "menu") return;
|
|
93
|
+
return parentContentElement;
|
|
94
|
+
}, [contentElement, parentContentElement]);
|
|
95
|
+
if (preserveTabOrderAnchor !== void 0) props = {
|
|
96
|
+
preserveTabOrderAnchor,
|
|
97
|
+
...props
|
|
98
|
+
};
|
|
99
|
+
props = useHovercard({
|
|
100
|
+
store,
|
|
101
|
+
alwaysVisible,
|
|
102
|
+
initialFocus: initialFocusRef,
|
|
103
|
+
autoFocusOnShow: autoFocusOnShowProp,
|
|
104
|
+
...props,
|
|
105
|
+
hideOnEscape(event) {
|
|
106
|
+
if (isFalsyBooleanCallback(hideOnEscape, event)) return false;
|
|
107
|
+
store?.hideAll();
|
|
108
|
+
return true;
|
|
109
|
+
},
|
|
110
|
+
hideOnHoverOutside(event) {
|
|
111
|
+
const disclosureElement = store?.getState().disclosureElement;
|
|
112
|
+
const getHideOnHoverOutside = () => {
|
|
113
|
+
if (typeof hideOnHoverOutside === "function") return hideOnHoverOutside(event);
|
|
114
|
+
if (hideOnHoverOutside != null) return hideOnHoverOutside;
|
|
115
|
+
if (hasParentMenu) return true;
|
|
116
|
+
if (!parentIsMenubar) return false;
|
|
117
|
+
if (!disclosureElement) return true;
|
|
118
|
+
if (hasFocusWithin(disclosureElement)) return false;
|
|
119
|
+
return true;
|
|
120
|
+
};
|
|
121
|
+
if (!getHideOnHoverOutside()) return false;
|
|
122
|
+
if (event.defaultPrevented) return true;
|
|
123
|
+
if (!hasParentMenu) return true;
|
|
124
|
+
if (!disclosureElement) return true;
|
|
125
|
+
fireEvent(disclosureElement, "mouseout", event);
|
|
126
|
+
if (!hasFocusWithin(disclosureElement)) return true;
|
|
127
|
+
requestAnimationFrame(() => {
|
|
128
|
+
if (hasFocusWithin(disclosureElement)) return;
|
|
129
|
+
store?.hide();
|
|
130
|
+
});
|
|
131
|
+
return false;
|
|
132
|
+
},
|
|
133
|
+
modal,
|
|
134
|
+
portal,
|
|
135
|
+
backdrop: hasParentMenu ? false : props.backdrop
|
|
136
|
+
});
|
|
137
|
+
props = {
|
|
138
|
+
"aria-labelledby": ariaLabelledBy,
|
|
139
|
+
...props
|
|
140
|
+
};
|
|
141
|
+
return props;
|
|
142
|
+
});
|
|
143
|
+
/**
|
|
144
|
+
* Renders a dropdown menu element that's controlled by a
|
|
145
|
+
* [`MenuButton`](https://ariakit.com/reference/menu-button) component.
|
|
146
|
+
*
|
|
147
|
+
* This component uses the primitive
|
|
148
|
+
* [`MenuList`](https://ariakit.com/reference/menu-list) component under the
|
|
149
|
+
* hood. It renders a popover and automatically focuses on items when the menu
|
|
150
|
+
* is shown.
|
|
151
|
+
* @see https://ariakit.com/components/menu
|
|
152
|
+
* @example
|
|
153
|
+
* ```jsx {3-6}
|
|
154
|
+
* <MenuProvider>
|
|
155
|
+
* <MenuButton>Edit</MenuButton>
|
|
156
|
+
* <Menu>
|
|
157
|
+
* <MenuItem>Undo</MenuItem>
|
|
158
|
+
* <MenuItem>Redo</MenuItem>
|
|
159
|
+
* </Menu>
|
|
160
|
+
* </MenuProvider>
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
const Menu = createDialogComponent(forwardRef(function Menu(props) {
|
|
164
|
+
return createElement(TagName, useMenu(props));
|
|
165
|
+
}), useMenuProviderContext);
|
|
166
|
+
//#endregion
|
|
167
|
+
export { Menu, useMenu };
|
|
168
|
+
|
|
169
|
+
//# sourceMappingURL=menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.js","names":[],"sources":["../../src/menu/menu.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useMergeRefs,\n createElement,\n createHook,\n forwardRef,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport {\n fireEvent,\n hasFocusWithin,\n invariant,\n isFalsyBooleanCallback,\n} from \"@ariakit/utils\";\nimport type { ElementType, MutableRefObject } from \"react\";\nimport { createRef, useEffect, useMemo, useRef, useState } from \"react\";\nimport { createDialogComponent } from \"../dialog/dialog.tsx\";\nimport type { HovercardOptions } from \"../hovercard/hovercard.tsx\";\nimport { useHovercard } from \"../hovercard/hovercard.tsx\";\nimport { useMenuProviderContext } from \"./menu-context.tsx\";\nimport type { MenuListOptions } from \"./menu-list.tsx\";\nimport { useMenuList } from \"./menu-list.tsx\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype HTMLType = HTMLElementTagNameMap[TagName];\n\n/**\n * Returns props to create a `Menu` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore();\n * const props = useMenu({ store });\n * <MenuButton store={store}>Edit</MenuButton>\n * <Role {...props}>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </Role>\n * ```\n */\nexport const useMenu = createHook<TagName, MenuOptions>(function useMenu({\n store,\n modal: modalProp = false,\n portal = modalProp,\n hideOnEscape = true,\n autoFocusOnShow = true,\n hideOnHoverOutside,\n alwaysVisible,\n ...props\n}) {\n const context = useMenuProviderContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"Menu must receive a `store` prop or be wrapped in a MenuProvider component.\",\n );\n\n const ref = useRef<HTMLType>(null);\n\n const parentMenu = store.parent;\n const parentMenubar = store.menubar;\n const hasParentMenu = !!parentMenu;\n const parentIsMenubar = !!parentMenubar && !hasParentMenu;\n // If it's a submenu, it shouldn't behave like a modal dialog.\n const modal = hasParentMenu ? false : modalProp;\n\n props = {\n ...props,\n ref: useMergeRefs(ref, props.ref),\n };\n\n // The aria-labelledby prop on MenuList defaults to the MenuButton's id. On\n // Dialog/Popover/Hovercard/Menu, we need to consider MenuHeading as well\n // and it should take precedence. That's why we need to destructure this\n // prop here and check if aria-labelledby is set later.\n const { \"aria-labelledby\": ariaLabelledBy, ...menuListProps } = useMenuList({\n store,\n alwaysVisible,\n ...props,\n });\n\n props = menuListProps;\n\n const [initialFocusRef, setInitialFocusRef] =\n useState<MutableRefObject<HTMLElement | null>>();\n\n const autoFocusOnShowState = useStoreState(store, \"autoFocusOnShow\");\n const initialFocus = useStoreState(store, \"initialFocus\");\n const baseElement = useStoreState(store, \"baseElement\");\n const items = useStoreState(store, \"renderedItems\");\n\n // Sets the initial focus ref.\n useEffect(() => {\n let cleaning = false;\n setInitialFocusRef((prevInitialFocusRef) => {\n if (cleaning) return;\n if (modal && prevInitialFocusRef?.current?.isConnected) {\n return prevInitialFocusRef;\n }\n if (!autoFocusOnShowState) return;\n let element: HTMLElement | null;\n switch (initialFocus) {\n // TODO: Refactor\n case \"first\":\n element =\n items.find((item) => !item.disabled && item.element)?.element ||\n null;\n break;\n case \"last\":\n element =\n [...items].reverse().find((item) => !item.disabled && item.element)\n ?.element || null;\n break;\n default:\n element = baseElement;\n }\n if (element && element === prevInitialFocusRef?.current) {\n return prevInitialFocusRef;\n }\n const ref = createRef() as MutableRefObject<HTMLElement | null>;\n ref.current = element;\n return ref;\n });\n return () => {\n cleaning = true;\n };\n }, [store, modal, autoFocusOnShowState, initialFocus, items, baseElement]);\n\n // When the `autoFocusOnShow` prop is set to `true` (default), we'll only\n // move focus to the menu when there's an initialFocusRef set or the menu is\n // modal. Otherwise, users would have to manually call\n // store.setAutoFocusOnShow(true) every time they want to open the menu.\n // This differs from the usual dialog behavior that would automatically\n // focus on the dialog container when no initialFocusRef is set.\n const canAutoFocusOnShow = !!initialFocusRef || !!props.initialFocus || modal;\n const autoFocusOnShowProp =\n autoFocusOnShow === false ? false : canAutoFocusOnShow && autoFocusOnShow;\n\n const contentElement = useStoreState(\n store.combobox || store,\n \"contentElement\",\n );\n const parentContentElement = useStoreState(\n parentMenu?.combobox || parentMenu,\n \"contentElement\",\n );\n\n // This ensures that, when the menu is nested in a non-menu wrapper, the tab\n // order will be preserved from the parent content element rather than from\n // the anchor element. This is because the preserveTabOrderAnchor feature\n // will use aria-owns to fix the tab order on screen readers. The parent\n // content element may have a role that does not allow this menu's role as a\n // child. By passing the parent content element as the tab order anchor, the\n // aria-owns element will be added as a sibling instead. TODO: Test this.\n const preserveTabOrderAnchor = useMemo(() => {\n if (!parentContentElement) return;\n if (!contentElement) return;\n const role = contentElement.getAttribute(\"role\");\n const parentRole = parentContentElement.getAttribute(\"role\");\n const parentIsMenuOrMenubar =\n parentRole === \"menu\" || parentRole === \"menubar\";\n if (parentIsMenuOrMenubar && role === \"menu\") return;\n return parentContentElement;\n }, [contentElement, parentContentElement]);\n\n if (preserveTabOrderAnchor !== undefined) {\n props = {\n preserveTabOrderAnchor,\n ...props,\n };\n }\n\n props = useHovercard({\n store,\n alwaysVisible,\n initialFocus: initialFocusRef,\n autoFocusOnShow: autoFocusOnShowProp,\n ...props,\n hideOnEscape(event) {\n if (isFalsyBooleanCallback(hideOnEscape, event)) return false;\n store?.hideAll();\n return true;\n },\n hideOnHoverOutside(event) {\n const disclosureElement = store?.getState().disclosureElement;\n const getHideOnHoverOutside = () => {\n if (typeof hideOnHoverOutside === \"function\") {\n return hideOnHoverOutside(event);\n }\n if (hideOnHoverOutside != null) return hideOnHoverOutside;\n // Hide the menu when hovering outside if it's a submenu in a dropdown\n // menu or if it's a menu in a menubar and the menu button doesn't\n // have focus.\n if (hasParentMenu) return true;\n if (!parentIsMenubar) return false;\n if (!disclosureElement) return true;\n if (hasFocusWithin(disclosureElement)) return false;\n return true;\n };\n if (!getHideOnHoverOutside()) return false;\n if (event.defaultPrevented) return true;\n if (!hasParentMenu) return true;\n if (!disclosureElement) return true;\n // This can be tested by hovering over a menu item (that's also a menu\n // button), waiting for the menu to open, and then moving towards the\n // menu, but stopping before reaching it. Then, move the mouse to the\n // other direction. The menu should close, but since we've already left\n // the menu button, the mouseout and therefore the blurOnHoverEnd\n // behavior won't be fired. That's why we need to manually re-fire it\n // here when the menu is closed by hovering away.\n fireEvent(disclosureElement, \"mouseout\", event);\n if (!hasFocusWithin(disclosureElement)) return true;\n // When the focus is determined by the aria-activedescendant attribute\n // (virtual focus), the mouseout event above won't update the state\n // synchronously. That is, the hasFocusWithin function above (which also\n // takes into account aria-activedescendant) will be true even though\n // the mouseout event has blurred the menu button.\n requestAnimationFrame(() => {\n if (hasFocusWithin(disclosureElement)) return;\n store?.hide();\n });\n return false;\n },\n modal,\n portal,\n backdrop: hasParentMenu ? false : props.backdrop,\n });\n\n props = {\n \"aria-labelledby\": ariaLabelledBy,\n ...props,\n };\n\n return props;\n});\n\n/**\n * Renders a dropdown menu element that's controlled by a\n * [`MenuButton`](https://ariakit.com/reference/menu-button) component.\n *\n * This component uses the primitive\n * [`MenuList`](https://ariakit.com/reference/menu-list) component under the\n * hood. It renders a popover and automatically focuses on items when the menu\n * is shown.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx {3-6}\n * <MenuProvider>\n * <MenuButton>Edit</MenuButton>\n * <Menu>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </Menu>\n * </MenuProvider>\n * ```\n */\nexport const Menu = createDialogComponent(\n forwardRef(function Menu(props: MenuProps) {\n const htmlProps = useMenu(props);\n return createElement(TagName, htmlProps);\n }),\n useMenuProviderContext,\n);\n\nexport interface MenuOptions<T extends ElementType = TagName>\n extends MenuListOptions<T>, Omit<HovercardOptions<T>, \"store\"> {}\n\nexport type MenuProps<T extends ElementType = TagName> = Props<\n T,\n MenuOptions<T>\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAmDE,UAAM,WAAU,SAAA,QAAuB,EAAA,OAAA,OAAA,YAAA,OAAA,SAAA,WAAA,eAAA,MAAA,kBAAA,MAAA,oBAAA,eAAA,GAAA,SAAA;CACvC,MAAA,UAAQ,uBAAS;CAEjB,QAAA,SAGI;CAGJ,UAAM,OAAM,6EAAqB;CAEjC,MAAM,MAAA,OAAa,IAAA;CACnB,MAAM,aAAA,MAAgB;CACtB,MAAM,gBAAgB,MAAE;CACxB,MAAM,gBAAA,CAAA,CAAkB;CAExB,MAAM,kBAAQ,CAAA,CAAA,iBAAwB,CAAA;CAEtC,MAAA,QAAQ,gBAAA,QAAA;SACH;EACH,GAAA;EACF,KAAA,aAAA,KAAA,MAAA,GAAA;CAMA;OACE,EAAA,mBAAA,gBAAA,GAAA,kBAAA,YAAA;EACA;EACA;EACD,GAAA;CAED,CAAA;CAEA,QAAO;CAGP,MAAM,CAAA,iBAAA,sBAAqC,SAAO;CAClD,MAAM,uBAAe,cAAqB,OAAA,iBAAc;CACxD,MAAM,eAAc,cAAc,OAAO,cAAa;CACtD,MAAM,cAAQ,cAAc,OAAO,aAAe;CAGlD,MAAA,QAAA,cAAgB,OAAA,eAAA;iBACC;EACf,IAAA,WAAA;sBACgB,wBAAA;GACd,IAAI,UAAS;GAGb,IAAI,SAAC,qBAAsB,SAAA,aAAA,OAAA;GAC3B,IAAI,CAAA,sBAAA;GACJ,IAAA;WAEO;SACH;KAGA,UAAA,MAAA,MAAA,SAAA,CAAA,KAAA,YAAA,KAAA,OAAA,GAAA,WAAA;KACF;SACE;KAGA,UAAA,CAAA,GAAA,KAAA,EAAA,QAAA,EAAA,MAAA,SAAA,CAAA,KAAA,YAAA,KAAA,OAAA,GAAA,WAAA;KACF;IAEF,SAAA,UAAA;GACA;GAGA,IAAA,WAAY,YAAU,qBAAA,SAAA,OAAA;GACtB,MAAI,MAAA,UAAU;GACd,IAAA,UAAO;GACR,OAAA;EACD,CAAA;eACa;GACb,WAAA;EACF;IAAI;EAAO;EAAO;EAAsB;EAAc;EAAO;EAAY;CAQzE,CAAA;CACA,MAAM,qBAAA,CACJ,CAAA,mBAAoB,CAAA,CAAA,MAAQ,gBAAQ;CAEtC,MAAM,sBAAiB,oBACf,QAAY,QAClB,sBACF;CACA,MAAM,iBAAA,cAAuB,MAC3B,YAAY,OAAA,gBAAY;CAW1B,MAAM,uBAAA,cAAyB,YAAc,YAAA,YAAA,gBAAA;OACtC,yBAAsB,cAAA;EAC3B,IAAI,CAAC,sBAAgB;EACrB,IAAA,CAAA,gBAAa;EACb,MAAM,OAAA,eAAa,aAAqB,MAAA;EAGxC,MADE,aAAA,qBAAyB,aAAe,MACb;EAC7B,KAAA,eAAO,UAAA,eAAA,cAAA,SAAA,QAAA;EACT,OAAI;CAEJ,GAAA,CAAI,gBAAA,oBACF,CAAA;KACE,2BAAA,KAAA,GAAA,QAAA;EACA;EACF,GAAA;CAGF;SACE,aAAA;EACA;EACA;EACA,cAAA;EACA,iBAAG;EACH,GAAA;eACM,OAAA;GACJ,IAAA,uBAAe,cAAA,KAAA,GAAA,OAAA;GACf,OAAO,QAAA;GACT,OAAA;EACA;qBACQ,OAAA;GACN,MAAM,oBAAA,OAAA,SAA8B,EAAA;SAC9B,8BAA8B;IAGlC,IAAI,OAAA,uBAA4B,YAAO,OAAA,mBAAA,KAAA;IAIvC,IAAI,sBAAsB,MAAA,OAAA;IAC1B,IAAI,eAAC,OAAiB;IACtB,IAAI,CAAC,iBAAA,OAAmB;IACxB,IAAI,CAAA,mBAAe,OAAA;IACnB,IAAA,eAAO,iBAAA,GAAA,OAAA;IACT,OAAA;GACA;GACA,IAAI,CAAA,sBAAM,GAAkB,OAAO;GACnC,IAAI,MAAC,kBAAsB,OAAA;GAC3B,IAAI,CAAC,eAAA,OAAmB;GAQxB,IAAA,CAAA,mBAAU,OAAmB;GAC7B,UAAK,mBAAe,YAAoB,KAAA;GAMxC,IAAA,CAAA,eAAA,iBAA4B,GAAA,OAAA;+BACP;IACnB,IAAA,eAAY,iBAAA,GAAA;IACb,OAAA,KAAA;GACD,CAAA;GACF,OAAA;EACA;EACA;EACA;EACD,UAAA,gBAAA,QAAA,MAAA;CAED,CAAA;SACE;EACA,mBAAG;EACL,GAAA;CAEA;CACD,OAAA;;;;;;;;;;;;;;;;;;;;;;MAyBG,OAAO,sBADW,WACqB,SAAA,KAAA,OAAA;CACxC,OACD,cAAA,SACF,QAAA,KAAA,CAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { t as DisclosureStore } from "./disclosure-store-BsaBaRKv.js";
|
|
2
|
+
import { i as CompositeStoreOptions, n as CompositeStoreFunctions, o as CompositeStoreState } from "./composite-store-DyJc-XRA.js";
|
|
3
|
+
import { t as ComboboxStore } from "./combobox-store-DEVQ45mZ.js";
|
|
4
|
+
import { a as HovercardStoreState, n as HovercardStoreFunctions, r as HovercardStoreOptions } from "./hovercard-store-gIeoQEn_.js";
|
|
5
|
+
import { t as MenubarStore } from "./menubar-store-3h0eNIbS.js";
|
|
6
|
+
import { BivariantCallback, PickRequired } from "@ariakit/utils";
|
|
7
|
+
import { Store } from "@ariakit/react-store";
|
|
8
|
+
import * as Core from "@ariakit/components/menu/menu-store";
|
|
9
|
+
|
|
10
|
+
//#region src/menu/menu-store.d.ts
|
|
11
|
+
declare function useMenuStoreProps<T extends Core.MenuStore>(store: T, update: () => void, props: MenuStoreProps): T & {
|
|
12
|
+
disclosure: DisclosureStore | null | undefined;
|
|
13
|
+
} & {
|
|
14
|
+
combobox: ComboboxStore<import("@ariakit/components/combobox/combobox-store").ComboboxStoreSelectedValue> | null | undefined;
|
|
15
|
+
parent: MenuStore<Core.MenuStoreValues> | null | undefined;
|
|
16
|
+
menubar: MenubarStore | null | undefined;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Creates a menu store to control the state of
|
|
20
|
+
* [Menu](https://ariakit.com/components/menu) components.
|
|
21
|
+
* @see https://ariakit.com/components/menu
|
|
22
|
+
* @example
|
|
23
|
+
* ```jsx
|
|
24
|
+
* const menu = useMenuStore({ placement: "top" });
|
|
25
|
+
*
|
|
26
|
+
* <MenuButton store={menu}>Edit</MenuButton>
|
|
27
|
+
* <Menu store={menu}>
|
|
28
|
+
* <MenuItem>Undo</MenuItem>
|
|
29
|
+
* <MenuItem>Redo</MenuItem>
|
|
30
|
+
* </Menu>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare function useMenuStore<T extends MenuStoreValues = MenuStoreValues>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
|
|
34
|
+
declare function useMenuStore(props?: MenuStoreProps): MenuStore;
|
|
35
|
+
type MenuStoreValues = Core.MenuStoreValues;
|
|
36
|
+
interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> extends Core.MenuStoreState<T>, CompositeStoreState, HovercardStoreState {}
|
|
37
|
+
interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues> extends Pick<MenuStoreOptions, "combobox" | "parent" | "menubar" | "disclosure">, Omit<Core.MenuStoreFunctions<T>, "combobox" | "parent" | "menubar" | "disclosure">, CompositeStoreFunctions, HovercardStoreFunctions {}
|
|
38
|
+
interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends Omit<Core.MenuStoreOptions<T>, "disclosure">, CompositeStoreOptions, HovercardStoreOptions {
|
|
39
|
+
/**
|
|
40
|
+
* A callback that gets called when the
|
|
41
|
+
* [`values`](https://ariakit.com/reference/menu-provider#values) state
|
|
42
|
+
* changes.
|
|
43
|
+
*
|
|
44
|
+
* Live examples:
|
|
45
|
+
* - [MenuItemCheckbox](https://ariakit.com/examples/menu-item-checkbox)
|
|
46
|
+
* - [Submenu with
|
|
47
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
48
|
+
*/
|
|
49
|
+
setValues?: BivariantCallback<(values: MenuStoreState<T>["values"]) => void>;
|
|
50
|
+
/**
|
|
51
|
+
* A reference to a [combobox
|
|
52
|
+
* store](https://ariakit.com/reference/use-combobox-store). It's
|
|
53
|
+
* automatically set when composing [Menu with
|
|
54
|
+
* Combobox](https://ariakit.com/examples/menu-combobox).
|
|
55
|
+
*/
|
|
56
|
+
combobox?: ComboboxStore | null;
|
|
57
|
+
/**
|
|
58
|
+
* A reference to a parent menu store. It's automatically set when nesting
|
|
59
|
+
* menus in the React tree. You should manually set this if menus aren't
|
|
60
|
+
* nested in the React tree.
|
|
61
|
+
*
|
|
62
|
+
* Live examples:
|
|
63
|
+
* - [Menubar](https://ariakit.com/components/menubar)
|
|
64
|
+
* - [Submenu](https://ariakit.com/examples/menu-nested)
|
|
65
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
66
|
+
*/
|
|
67
|
+
parent?: MenuStore | null;
|
|
68
|
+
/**
|
|
69
|
+
* A reference to a [menubar
|
|
70
|
+
* store](https://ariakit.com/reference/use-menubar-store). It's automatically
|
|
71
|
+
* set when rendering menus inside a
|
|
72
|
+
* [`Menubar`](https://ariakit.com/reference/menubar) in the React tree.
|
|
73
|
+
*
|
|
74
|
+
* Live examples:
|
|
75
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
76
|
+
*/
|
|
77
|
+
menubar?: MenubarStore | null;
|
|
78
|
+
}
|
|
79
|
+
interface MenuStoreProps<T extends MenuStoreValues = MenuStoreValues> extends MenuStoreOptions<T>, Omit<Core.MenuStoreProps<T>, "combobox" | "parent" | "menubar" | "disclosure"> {}
|
|
80
|
+
interface MenuStore<T extends MenuStoreValues = MenuStoreValues> extends MenuStoreFunctions<T>, Omit<Store<Core.MenuStore<T>>, "combobox" | "parent" | "menubar" | "disclosure"> {}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { MenuStoreState as a, useMenuStoreProps as c, MenuStoreProps as i, MenuStoreFunctions as n, MenuStoreValues as o, MenuStoreOptions as r, useMenuStore as s, MenuStore as t };
|
|
83
|
+
//# sourceMappingURL=menu-store-0CKKmNek.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-store-0CKKmNek.d.ts","names":["Core","Store","BivariantCallback","PickRequired","ComboboxStore","CompositeStoreFunctions","CompositeStoreOptions","CompositeStoreState","HovercardStoreFunctions","HovercardStoreOptions","HovercardStoreState","MenubarStore","useMenuStoreProps","T","MenuStore","MenuStoreProps","_$___disclosure_disclosure_store_ts0","DisclosureStore","MenuStoreValues","store","update","props","disclosure","combobox","ComboboxStoreSelectedValue","parent","menubar","useMenuStore","MenuStoreState","MenuStoreFunctions","MenuStoreOptions","Pick","Omit","setValues","values"],"sources":["../src/menu/menu-store.d.ts"],"mappings":";;;;;;;;;;iBAOwBY,iBAAAA,WAA4BZ,IAAAA,CAAKc,SAAAA,CAAAA,CAAWK,KAAAA,EAAON,CAAAA,EAAGO,MAAAA,cAAoBC,KAAAA,EAAON,cAAAA,GAAiBF,CAAAA;EACtHS,UAAAA,EADuHN,eAAAA;AAAAA;EAGvHO,QAAAA,EAAUnB,aAAAA,uDAAoEoB,0BAAAA;EAC9EC,MAAAA,EAAQX,SAAAA,CAAUd,IAAAA,CAAKkB,eAAAA;EACvBQ,OAAAA,EAASf,YAAAA;AAAAA;;;;;;;;;;;;;;;;iBAiBWgB,YAAAA,WAAuBT,eAAAA,GAAkBA,eAAAA,CAAAA,CAAiBG,KAAAA,EAAOlB,YAAAA,CAAaY,cAAAA,CAAeF,CAAAA,iCAAkCC,SAAAA,CAAUD,CAAAA;AAAAA,iBACzIc,YAAAA,CAAaN,KAAAA,GAAQN,cAAAA,GAAiBD,SAAS;AAAA,KAC3DI,eAAAA,GAAkBlB,IAAAA,CAAKkB,eAAe;AAAA,UACjCU,cAAAA,WAAyBV,eAAAA,GAAkBA,eAAAA,UAAyBlB,IAAAA,CAAK4B,cAAAA,CAAef,CAAAA,GAAIN,mBAAAA,EAAqBG,mBAAAA;AAAAA,UAEjHmB,kBAAAA,WAA6BX,eAAAA,GAAkBA,eAAAA,UAAyBa,IAAAA,CAAKD,gBAAAA,qDAAqEE,IAAAA,CAAKhC,IAAAA,CAAK6B,kBAAAA,CAAmBhB,CAAAA,sDAAuDR,uBAAAA,EAAyBG,uBAAAA;AAAAA,UAE/PsB,gBAAAA,WAA2BZ,eAAAA,GAAkBA,eAAAA,UAAyBc,IAAAA,CAAKhC,IAAAA,CAAK8B,gBAAAA,CAAiBjB,CAAAA,kBAAmBP,qBAAAA,EAAuBG,qBAAAA;EA1B1Ee;;;;;;;;AAEzD;AAiBzB;EAkBIS,SAAAA,GAAY/B,iBAAAA,EAAmBgC,MAAAA,EAAQN,cAAAA,CAAef,CAAAA;EAlBtBA;;;;;;EAyBhCU,QAAAA,GAAWnB,aAAAA;EAzBwIU;;;;;;;;;;EAoCnJW,MAAAA,GAASX,SAAAA;EApCoJD;;AAAC;AAClK;;;;;;EA6CIa,OAAAA,GAAUf,YAAAA;AAAAA;AAAAA,UAEGI,cAAAA,WAAyBG,eAAAA,GAAkBA,eAAAA,UAAyBY,gBAAAA,CAAiBjB,CAAAA,GAAImB,IAAAA,CAAKhC,IAAAA,CAAKe,cAAAA,CAAeF,CAAAA;AAAAA,UAElHC,SAAAA,WAAoBI,eAAAA,GAAkBA,eAAAA,UAAyBW,kBAAAA,CAAmBhB,CAAAA,GAAImB,IAAAA,CAAK/B,KAAAA,CAAMD,IAAAA,CAAKc,SAAAA,CAAUD,CAAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { t as MenubarStore } from "../menubar-store-3h0eNIbS.js";
|
|
2
|
+
|
|
3
|
+
//#region src/menubar/menubar-context.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns the menubar store from the nearest menubar container.
|
|
6
|
+
* @example
|
|
7
|
+
* function Menubar() {
|
|
8
|
+
* const store = useMenubarContext();
|
|
9
|
+
*
|
|
10
|
+
* if (!store) {
|
|
11
|
+
* throw new Error("Menubar must be wrapped in MenubarProvider");
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* // Use the store...
|
|
15
|
+
* }
|
|
16
|
+
*/
|
|
17
|
+
declare const useMenubarContext: () => MenubarStore | undefined;
|
|
18
|
+
declare const useMenubarScopedContext: (onlyScoped?: boolean) => MenubarStore | undefined;
|
|
19
|
+
declare const useMenubarProviderContext: () => MenubarStore | undefined;
|
|
20
|
+
declare const MenubarContextProvider: (props: import("react").ProviderProps<MenubarStore | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const MenubarScopedContextProvider: (props: import("react").ProviderProps<MenubarStore | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare const MenuItemCheckedContext: import("react").Context<boolean | undefined>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { MenuItemCheckedContext, MenubarContextProvider, MenubarScopedContextProvider, useMenubarContext, useMenubarProviderContext, useMenubarScopedContext };
|
|
25
|
+
//# sourceMappingURL=menubar-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar-context.d.ts","names":["MenubarStore","useMenubarContext","useMenubarScopedContext","onlyScoped","useMenubarProviderContext","MenubarContextProvider","ProviderProps","props","JSX","Element","MenubarScopedContextProvider","MenuItemCheckedContext","Context"],"sources":["../../src/menubar/menubar-context.d.ts"],"mappings":";;;;;AAcA;;;;AAA0D;AAC1D;;;;AAAoF;AACpF;cAFqBC,iBAAAA,QAAyBD,YAAY;AAAA,cACrCE,uBAAAA,GAA0BC,UAAAA,eAAyBH,YAAY;AAAA,cAC/DI,yBAAAA,QAAiCJ,YAAY;AAAA,cAC7CK,sBAAAA,GAAyBE,KAAAA,kBAAuBD,aAAAA,CAAcN,YAAY,8CAA8CQ,GAAAA,CAAIC,OAAAA;AAAAA,cAC5HC,4BAAAA,GAA+BH,KAAAA,kBAAuBD,aAAAA,CAAcN,YAAY,8CAA8CQ,GAAAA,CAAIC,OAAAA;AAAAA,cAClIE,sBAAAA,kBAAwCC,OAAO"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { CompositeContextProvider, CompositeScopedContextProvider } from "../composite/composite-context.js";
|
|
3
|
+
import { createStoreContext } from "@ariakit/react-utils";
|
|
4
|
+
import { createContext } from "react";
|
|
5
|
+
//#region src/menubar/menubar-context.tsx
|
|
6
|
+
const menubar = createStoreContext([CompositeContextProvider], [CompositeScopedContextProvider]);
|
|
7
|
+
/**
|
|
8
|
+
* Returns the menubar store from the nearest menubar container.
|
|
9
|
+
* @example
|
|
10
|
+
* function Menubar() {
|
|
11
|
+
* const store = useMenubarContext();
|
|
12
|
+
*
|
|
13
|
+
* if (!store) {
|
|
14
|
+
* throw new Error("Menubar must be wrapped in MenubarProvider");
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* // Use the store...
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
const useMenubarContext = menubar.useContext;
|
|
21
|
+
const useMenubarScopedContext = menubar.useScopedContext;
|
|
22
|
+
const useMenubarProviderContext = menubar.useProviderContext;
|
|
23
|
+
const MenubarContextProvider = menubar.ContextProvider;
|
|
24
|
+
const MenubarScopedContextProvider = menubar.ScopedContextProvider;
|
|
25
|
+
const MenuItemCheckedContext = createContext(void 0);
|
|
26
|
+
//#endregion
|
|
27
|
+
export { MenuItemCheckedContext, MenubarContextProvider, MenubarScopedContextProvider, useMenubarContext, useMenubarProviderContext, useMenubarScopedContext };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=menubar-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar-context.js","names":[],"sources":["../../src/menubar/menubar-context.tsx"],"sourcesContent":["import { createStoreContext } from \"@ariakit/react-utils\";\nimport { createContext } from \"react\";\nimport {\n CompositeContextProvider,\n CompositeScopedContextProvider,\n} from \"../composite/composite-context.tsx\";\nimport type { MenubarStore } from \"./menubar-store.ts\";\n\nconst menubar = createStoreContext<MenubarStore>(\n [CompositeContextProvider],\n [CompositeScopedContextProvider],\n);\n\n/**\n * Returns the menubar store from the nearest menubar container.\n * @example\n * function Menubar() {\n * const store = useMenubarContext();\n *\n * if (!store) {\n * throw new Error(\"Menubar must be wrapped in MenubarProvider\");\n * }\n *\n * // Use the store...\n * }\n */\nexport const useMenubarContext = menubar.useContext;\n\nexport const useMenubarScopedContext = menubar.useScopedContext;\n\nexport const useMenubarProviderContext = menubar.useProviderContext;\n\nexport const MenubarContextProvider = menubar.ContextProvider;\n\nexport const MenubarScopedContextProvider = menubar.ScopedContextProvider;\n\nexport const MenuItemCheckedContext = createContext<boolean | undefined>(\n undefined,\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,MAAa,oBAAA,QAA0B;AAEvC,MAAa,0BAAA,QAA4B;AAEzC,MAAa,4BAAyB,QAAQ;AAE9C,MAAa,yBAAA,QAA+B;AAE5C,MAAa,+BAAyB,QACpC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { i as MenubarStoreProps } from "../menubar-store-3h0eNIbS.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/menubar/menubar-provider.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Provides a menubar store to [Menubar](https://ariakit.com/components/menubar)
|
|
7
|
+
* components.
|
|
8
|
+
* @see https://ariakit.com/components/menubar
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* <MenubarProvider>
|
|
12
|
+
* <Menubar>
|
|
13
|
+
* <MenuProvider>
|
|
14
|
+
* <MenuItem render={<MenuButton />}>File</MenuItem>
|
|
15
|
+
* <Menu>
|
|
16
|
+
* <MenuItem>New File</MenuItem>
|
|
17
|
+
* <MenuItem>New Window</MenuItem>
|
|
18
|
+
* </Menu>
|
|
19
|
+
* </MenuProvider>
|
|
20
|
+
* <MenuProvider>
|
|
21
|
+
* <MenuItem render={<MenuButton />}>Edit</MenuItem>
|
|
22
|
+
* <Menu>
|
|
23
|
+
* <MenuItem>Undo</MenuItem>
|
|
24
|
+
* <MenuItem>Redo</MenuItem>
|
|
25
|
+
* </Menu>
|
|
26
|
+
* </MenuProvider>
|
|
27
|
+
* </Menubar>
|
|
28
|
+
* </MenubarProvider>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare function MenubarProvider(props?: MenubarProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
interface MenubarProviderProps extends MenubarStoreProps {
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { MenubarProvider, MenubarProviderProps };
|
|
37
|
+
//# sourceMappingURL=menubar-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar-provider.d.ts","names":["ReactNode","MenubarStoreProps","MenubarProvider","MenubarProviderProps","props","JSX","Element","children"],"sources":["../../src/menubar/menubar-provider.d.ts"],"mappings":";;;;;;AA4BA;;;;;;;;;AAA8G;AAC9G;;;;;;;;AACwB;;;;;;iBAFAE,eAAAA,CAAgBE,KAAAA,GAAQD,oBAAoB,+BAA+BE,GAAAA,CAAIC,OAAAA;AAAAA,UACtFH,oBAAAA,SAA6BF,iBAAiB;EAC3DM,QAAAA,GAAWP,SAAAA;AAAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { MenubarContextProvider } from "./menubar-context.js";
|
|
3
|
+
import { useMenubarStore } from "./menubar-store.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/menubar/menubar-provider.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Provides a menubar store to [Menubar](https://ariakit.com/components/menubar)
|
|
8
|
+
* components.
|
|
9
|
+
* @see https://ariakit.com/components/menubar
|
|
10
|
+
* @example
|
|
11
|
+
* ```jsx
|
|
12
|
+
* <MenubarProvider>
|
|
13
|
+
* <Menubar>
|
|
14
|
+
* <MenuProvider>
|
|
15
|
+
* <MenuItem render={<MenuButton />}>File</MenuItem>
|
|
16
|
+
* <Menu>
|
|
17
|
+
* <MenuItem>New File</MenuItem>
|
|
18
|
+
* <MenuItem>New Window</MenuItem>
|
|
19
|
+
* </Menu>
|
|
20
|
+
* </MenuProvider>
|
|
21
|
+
* <MenuProvider>
|
|
22
|
+
* <MenuItem render={<MenuButton />}>Edit</MenuItem>
|
|
23
|
+
* <Menu>
|
|
24
|
+
* <MenuItem>Undo</MenuItem>
|
|
25
|
+
* <MenuItem>Redo</MenuItem>
|
|
26
|
+
* </Menu>
|
|
27
|
+
* </MenuProvider>
|
|
28
|
+
* </Menubar>
|
|
29
|
+
* </MenubarProvider>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function MenubarProvider(props = {}) {
|
|
33
|
+
return /* @__PURE__ */ jsx(MenubarContextProvider, {
|
|
34
|
+
value: useMenubarStore(props),
|
|
35
|
+
children: props.children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { MenubarProvider };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=menubar-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar-provider.js","names":[],"sources":["../../src/menubar/menubar-provider.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { MenubarContextProvider } from \"./menubar-context.tsx\";\nimport type { MenubarStoreProps } from \"./menubar-store.ts\";\nimport { useMenubarStore } from \"./menubar-store.ts\";\n\n/**\n * Provides a menubar store to [Menubar](https://ariakit.com/components/menubar)\n * components.\n * @see https://ariakit.com/components/menubar\n * @example\n * ```jsx\n * <MenubarProvider>\n * <Menubar>\n * <MenuProvider>\n * <MenuItem render={<MenuButton />}>File</MenuItem>\n * <Menu>\n * <MenuItem>New File</MenuItem>\n * <MenuItem>New Window</MenuItem>\n * </Menu>\n * </MenuProvider>\n * <MenuProvider>\n * <MenuItem render={<MenuButton />}>Edit</MenuItem>\n * <Menu>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </Menu>\n * </MenuProvider>\n * </Menubar>\n * </MenubarProvider>\n * ```\n */\nexport function MenubarProvider(props: MenubarProviderProps = {}) {\n const store = useMenubarStore(props);\n return (\n <MenubarContextProvider value={store}>\n {props.children}\n </MenubarContextProvider>\n );\n}\n\nexport interface MenubarProviderProps extends MenubarStoreProps {\n children?: ReactNode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAkCI,gBAAA,QAAC,CAAA,GAAA;QAFW,oBAAgB,wBAEO;yBAC1B,KAAA;EACe,UAAA,MAAA;CAE5B,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MenubarStoreState, i as MenubarStoreProps, n as MenubarStoreFunctions, o as useMenubarStore, r as MenubarStoreOptions, s as useMenubarStoreProps, t as MenubarStore } from "../menubar-store-3h0eNIbS.js";
|
|
2
|
+
export { MenubarStore, MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreProps, MenubarStoreState, useMenubarStore, useMenubarStoreProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCompositeStoreProps } from "../composite/composite-store.js";
|
|
3
|
+
import { useStore } from "@ariakit/react-store";
|
|
4
|
+
import * as Core from "@ariakit/components/menubar/menubar-store";
|
|
5
|
+
//#region src/menubar/menubar-store.ts
|
|
6
|
+
function useMenubarStoreProps(store, update, props) {
|
|
7
|
+
return useCompositeStoreProps(store, update, props);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a menubar store to control the state of
|
|
11
|
+
* [Menubar](https://ariakit.com/components/menubar) components.
|
|
12
|
+
* @see https://ariakit.com/components/menubar
|
|
13
|
+
* @example
|
|
14
|
+
* ```jsx
|
|
15
|
+
* const menu = useMenubarStore();
|
|
16
|
+
*
|
|
17
|
+
* <Menubar store={menu} />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
function useMenubarStore(props = {}) {
|
|
21
|
+
const [store, update] = useStore(Core.createMenubarStore, props);
|
|
22
|
+
return useMenubarStoreProps(store, update, props);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { useMenubarStore, useMenubarStoreProps };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=menubar-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar-store.js","names":[],"sources":["../../src/menubar/menubar-store.ts"],"sourcesContent":["import * as Core from \"@ariakit/components/menubar/menubar-store\";\nimport { useStore } from \"@ariakit/react-store\";\nimport type { Store } from \"@ariakit/react-store\";\nimport type {\n CompositeStoreFunctions,\n CompositeStoreOptions,\n CompositeStoreState,\n} from \"../composite/composite-store.ts\";\nimport { useCompositeStoreProps } from \"../composite/composite-store.ts\";\n\nexport function useMenubarStoreProps<T extends Core.MenubarStore>(\n store: T,\n update: () => void,\n props: MenubarStoreProps,\n) {\n return useCompositeStoreProps(store, update, props);\n}\n\n/**\n * Creates a menubar store to control the state of\n * [Menubar](https://ariakit.com/components/menubar) components.\n * @see https://ariakit.com/components/menubar\n * @example\n * ```jsx\n * const menu = useMenubarStore();\n *\n * <Menubar store={menu} />\n * ```\n */\nexport function useMenubarStore(props: MenubarStoreProps = {}): MenubarStore {\n const [store, update] = useStore(Core.createMenubarStore, props);\n return useMenubarStoreProps(store, update, props);\n}\n\nexport interface MenubarStoreState\n extends Core.MenubarStoreState, CompositeStoreState {}\n\nexport interface MenubarStoreFunctions\n extends Core.MenubarStoreFunctions, CompositeStoreFunctions {}\n\nexport interface MenubarStoreOptions\n extends Core.MenubarStoreOptions, CompositeStoreOptions {}\n\nexport interface MenubarStoreProps\n extends MenubarStoreOptions, Core.MenubarStoreProps {}\n\nexport interface MenubarStore\n extends MenubarStoreFunctions, Store<Core.MenubarStore> {}\n"],"mappings":";;;;;SAeS,qBAAA,OAAuB,QAAO,OAAa;CACpD,OAAA,uBAAA,OAAA,QAAA,KAAA;;;;;;;;;;;;;SAcS,gBAAiB,QAAA,CAAS,GAAA;CACjC,MAAA,CAAO,OAAA,UAAA,SAAqB,KAAO,oBAAa,KAAA;CAClD,OAAA,qBAAA,OAAA,QAAA,KAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { n as CompositeOptions } from "../composite-DLvyFHMq.js";
|
|
2
|
+
import { i as MenubarStoreProps, t as MenubarStore } from "../menubar-store-3h0eNIbS.js";
|
|
3
|
+
import { Props } from "@ariakit/react-utils";
|
|
4
|
+
import { ElementType } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/menubar/menubar.d.ts
|
|
7
|
+
declare const TagName = "div";
|
|
8
|
+
type TagName = typeof TagName;
|
|
9
|
+
/**
|
|
10
|
+
* Returns props to create a `Menubar` component.
|
|
11
|
+
* @see https://ariakit.com/components/menubar
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* const store = useMenubarStore();
|
|
15
|
+
* const menubarProps = useMenubar({ store });
|
|
16
|
+
* const fileProps = useMenuItem({ store });
|
|
17
|
+
* const fileMenu = useMenuStore();
|
|
18
|
+
* <Role {...menubarProps}>
|
|
19
|
+
* <MenuButton {...fileProps} store={fileMenu}>
|
|
20
|
+
* File
|
|
21
|
+
* </MenuButton>
|
|
22
|
+
* <Menu store={fileMenu}>
|
|
23
|
+
* <MenuItem>New File</MenuItem>
|
|
24
|
+
* <MenuItem>New Window</MenuItem>
|
|
25
|
+
* </Menu>
|
|
26
|
+
* </Role>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare const useMenubar: import("@ariakit/react-utils").Hook<"div", MenubarOptions<"div">>;
|
|
30
|
+
/**
|
|
31
|
+
* Renders a menubar that may contain a group of
|
|
32
|
+
* [`MenuItem`](https://ariakit.com/reference/menu-item) elements that control
|
|
33
|
+
* other submenus.
|
|
34
|
+
* @see https://ariakit.com/components/menubar
|
|
35
|
+
* @example
|
|
36
|
+
* ```jsx
|
|
37
|
+
* <Menubar>
|
|
38
|
+
* <MenuProvider>
|
|
39
|
+
* <MenuItem render={<MenuButton />}>File</MenuItem>
|
|
40
|
+
* <Menu>
|
|
41
|
+
* <MenuItem>New File</MenuItem>
|
|
42
|
+
* <MenuItem>New Window</MenuItem>
|
|
43
|
+
* </Menu>
|
|
44
|
+
* </MenuProvider>
|
|
45
|
+
* <MenuProvider>
|
|
46
|
+
* <MenuItem render={<MenuButton />}>Edit</MenuItem>
|
|
47
|
+
* <Menu>
|
|
48
|
+
* <MenuItem>Undo</MenuItem>
|
|
49
|
+
* <MenuItem>Redo</MenuItem>
|
|
50
|
+
* </Menu>
|
|
51
|
+
* </MenuProvider>
|
|
52
|
+
* </Menubar>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare const Menubar: (props: MenubarProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
56
|
+
interface MenubarOptions<T extends ElementType = TagName> extends CompositeOptions<T>, Pick<MenubarStoreProps, "focusLoop" | "orientation" | "rtl" | "virtualFocus"> {
|
|
57
|
+
/**
|
|
58
|
+
* Object returned by the
|
|
59
|
+
* [`useMenubarStore`](https://ariakit.com/reference/use-menubar-store) hook.
|
|
60
|
+
* If not provided, the closest
|
|
61
|
+
* [`MenubarProvider`](https://ariakit.com/reference/menubar-provider)
|
|
62
|
+
* component context will be used. If the component is not wrapped in a
|
|
63
|
+
* [`MenubarProvider`](https://ariakit.com/reference/menubar-provider)
|
|
64
|
+
* component, an internal store will be used.
|
|
65
|
+
*/
|
|
66
|
+
store?: MenubarStore;
|
|
67
|
+
}
|
|
68
|
+
type MenubarProps<T extends ElementType = TagName> = Props<T, MenubarOptions<T>>;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { Menubar, MenubarOptions, MenubarProps, useMenubar };
|
|
71
|
+
//# sourceMappingURL=menubar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar.d.ts","names":["Props","ElementType","CompositeOptions","MenubarStore","MenubarStoreProps","TagName","useMenubar","MenubarOptions","Hook","Menubar","MenubarProps","props","ReactElement","JSXElementConstructor","T","Pick","store"],"sources":["../../src/menubar/menubar.d.ts"],"mappings":";;;;;;cAIcK,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAF6C;;;;AACrD;AAAA;;;;AACQ;AAqB7B;;;;AAA0F;AA0B1F;;;;;AAjD0E,cAuBrDC,UAAAA,iCAA2CE,IAAAA,QAAYD,cAAc;;;;AA0B6C;AACvI;;;;;;;;;;;;;;;;;;;;;cADqBE,OAAAA,GAAUE,KAAAA,EAAOD,YAAY,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACjGN,cAAAA,WAAyBN,WAAAA,GAAcI,OAAAA,UAAiBH,gBAAAA,CAAiBY,CAAAA,GAAIC,IAAAA,CAAKX,iBAAAA;EAYvFM;;;;;;;;;EAFRM,KAAAA,GAAQb,YAAAA;AAAAA;AAAAA,KAEAO,YAAAA,WAAuBT,WAAAA,GAAcI,OAAAA,IAAWL,KAAAA,CAAMc,CAAAA,EAAGP,cAAAA,CAAeO,CAAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComposite } from "../composite/composite.js";
|
|
3
|
+
import { MenubarScopedContextProvider, useMenubarProviderContext } from "./menubar-context.js";
|
|
4
|
+
import { useMenubarStore } from "./menubar-store.js";
|
|
5
|
+
import { createElement, createHook, forwardRef, useWrapElement } from "@ariakit/react-utils";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { useStoreState } from "@ariakit/react-store";
|
|
8
|
+
//#region src/menubar/menubar.tsx
|
|
9
|
+
const TagName = "div";
|
|
10
|
+
/**
|
|
11
|
+
* Returns props to create a `Menubar` component.
|
|
12
|
+
* @see https://ariakit.com/components/menubar
|
|
13
|
+
* @example
|
|
14
|
+
* ```jsx
|
|
15
|
+
* const store = useMenubarStore();
|
|
16
|
+
* const menubarProps = useMenubar({ store });
|
|
17
|
+
* const fileProps = useMenuItem({ store });
|
|
18
|
+
* const fileMenu = useMenuStore();
|
|
19
|
+
* <Role {...menubarProps}>
|
|
20
|
+
* <MenuButton {...fileProps} store={fileMenu}>
|
|
21
|
+
* File
|
|
22
|
+
* </MenuButton>
|
|
23
|
+
* <Menu store={fileMenu}>
|
|
24
|
+
* <MenuItem>New File</MenuItem>
|
|
25
|
+
* <MenuItem>New Window</MenuItem>
|
|
26
|
+
* </Menu>
|
|
27
|
+
* </Role>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const useMenubar = createHook(function useMenubar({ store: storeProp, composite = true, orientation: orientationProp, virtualFocus, focusLoop, rtl, ...props }) {
|
|
31
|
+
const context = useMenubarProviderContext();
|
|
32
|
+
storeProp = storeProp || context;
|
|
33
|
+
const store = useMenubarStore({
|
|
34
|
+
store: storeProp,
|
|
35
|
+
orientation: orientationProp,
|
|
36
|
+
virtualFocus,
|
|
37
|
+
focusLoop,
|
|
38
|
+
rtl
|
|
39
|
+
});
|
|
40
|
+
const orientation = useStoreState(store, (state) => !composite || state.orientation === "both" ? void 0 : state.orientation);
|
|
41
|
+
props = useWrapElement(props, (element) => /* @__PURE__ */ jsx(MenubarScopedContextProvider, {
|
|
42
|
+
value: store,
|
|
43
|
+
children: element
|
|
44
|
+
}), [store]);
|
|
45
|
+
if (composite) props = {
|
|
46
|
+
role: "menubar",
|
|
47
|
+
"aria-orientation": orientation,
|
|
48
|
+
...props
|
|
49
|
+
};
|
|
50
|
+
props = useComposite({
|
|
51
|
+
store,
|
|
52
|
+
composite,
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
return props;
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Renders a menubar that may contain a group of
|
|
59
|
+
* [`MenuItem`](https://ariakit.com/reference/menu-item) elements that control
|
|
60
|
+
* other submenus.
|
|
61
|
+
* @see https://ariakit.com/components/menubar
|
|
62
|
+
* @example
|
|
63
|
+
* ```jsx
|
|
64
|
+
* <Menubar>
|
|
65
|
+
* <MenuProvider>
|
|
66
|
+
* <MenuItem render={<MenuButton />}>File</MenuItem>
|
|
67
|
+
* <Menu>
|
|
68
|
+
* <MenuItem>New File</MenuItem>
|
|
69
|
+
* <MenuItem>New Window</MenuItem>
|
|
70
|
+
* </Menu>
|
|
71
|
+
* </MenuProvider>
|
|
72
|
+
* <MenuProvider>
|
|
73
|
+
* <MenuItem render={<MenuButton />}>Edit</MenuItem>
|
|
74
|
+
* <Menu>
|
|
75
|
+
* <MenuItem>Undo</MenuItem>
|
|
76
|
+
* <MenuItem>Redo</MenuItem>
|
|
77
|
+
* </Menu>
|
|
78
|
+
* </MenuProvider>
|
|
79
|
+
* </Menubar>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
const Menubar = forwardRef(function Menubar(props) {
|
|
83
|
+
return createElement(TagName, useMenubar(props));
|
|
84
|
+
});
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Menubar, useMenubar };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=menubar.js.map
|