@ariakit/react-components 0.1.1 → 0.1.2
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 +51 -0
- package/dist/button/button.d.ts +1 -1
- package/dist/{button-Cp853csH.d.ts → button-CVWcOgxs.d.ts} +3 -3
- package/dist/{button-Cp853csH.d.ts.map → button-CVWcOgxs.d.ts.map} +1 -1
- package/dist/checkbox/checkbox-check.d.ts +1 -1
- package/dist/checkbox/checkbox-check.d.ts.map +1 -1
- package/dist/checkbox/checkbox.d.ts +2 -2
- package/dist/checkbox/checkbox.d.ts.map +1 -1
- package/dist/collection/collection-item-offscreen.d.ts +1 -1
- package/dist/collection/collection-item-offscreen.js +1 -1
- package/dist/collection/collection-item-offscreen.js.map +1 -1
- package/dist/collection/collection-item.d.ts +1 -1
- package/dist/collection/collection-renderer.d.ts +1 -1
- package/dist/collection/collection-renderer.js +1 -1
- package/dist/collection/collection-renderer.js.map +1 -1
- package/dist/collection/collection.d.ts +1 -1
- package/dist/collection/collection.d.ts.map +1 -1
- package/dist/{collection-item-offscreen-DyXa-sqj.d.ts → collection-item-offscreen-B5E5vNFi.d.ts} +2 -2
- package/dist/{collection-item-offscreen-DyXa-sqj.d.ts.map → collection-item-offscreen-B5E5vNFi.d.ts.map} +1 -1
- package/dist/{collection-item-C-g2BwVF.d.ts → collection-item-pvEWNoNs.d.ts} +2 -2
- package/dist/{collection-item-C-g2BwVF.d.ts.map → collection-item-pvEWNoNs.d.ts.map} +1 -1
- package/dist/{collection-renderer-DsPD9ksD.d.ts → collection-renderer-BhzF21Du.d.ts} +29 -15
- package/dist/collection-renderer-BhzF21Du.d.ts.map +1 -0
- package/dist/combobox/combobox-cancel.d.ts +2 -2
- package/dist/combobox/combobox-cancel.d.ts.map +1 -1
- package/dist/combobox/combobox-cancel.js +1 -1
- package/dist/combobox/combobox-cancel.js.map +1 -1
- package/dist/combobox/combobox-disclosure.d.ts +2 -2
- package/dist/combobox/combobox-disclosure.d.ts.map +1 -1
- package/dist/combobox/combobox-disclosure.js +1 -1
- package/dist/combobox/combobox-disclosure.js.map +1 -1
- package/dist/combobox/combobox-group-label.d.ts +1 -1
- package/dist/combobox/combobox-group-label.d.ts.map +1 -1
- package/dist/combobox/combobox-group.d.ts +1 -1
- package/dist/combobox/combobox-group.d.ts.map +1 -1
- package/dist/combobox/combobox-group.js +1 -1
- package/dist/combobox/combobox-group.js.map +1 -1
- package/dist/combobox/combobox-item-check.d.ts +1 -1
- package/dist/combobox/combobox-item-check.d.ts.map +1 -1
- package/dist/combobox/combobox-item-value.d.ts +1 -1
- package/dist/combobox/combobox-item-value.d.ts.map +1 -1
- package/dist/combobox/combobox-item.d.ts +3 -3
- package/dist/combobox/combobox-item.d.ts.map +1 -1
- package/dist/combobox/combobox-item.js +1 -1
- package/dist/combobox/combobox-item.js.map +1 -1
- package/dist/combobox/combobox-label.d.ts +1 -1
- package/dist/combobox/combobox-label.d.ts.map +1 -1
- package/dist/combobox/combobox-label.js +1 -1
- package/dist/combobox/combobox-label.js.map +1 -1
- package/dist/combobox/combobox-list.d.ts +1 -1
- package/dist/combobox/combobox-list.d.ts.map +1 -1
- package/dist/combobox/combobox-list.js +1 -1
- package/dist/combobox/combobox-list.js.map +1 -1
- package/dist/combobox/combobox-popover.d.ts +1 -1
- package/dist/combobox/combobox-popover.js +1 -1
- package/dist/combobox/combobox-popover.js.map +1 -1
- package/dist/combobox/combobox-row.d.ts +1 -1
- package/dist/combobox/combobox-row.d.ts.map +1 -1
- package/dist/combobox/combobox-row.js +1 -1
- package/dist/combobox/combobox-row.js.map +1 -1
- package/dist/combobox/combobox-separator.d.ts +1 -1
- package/dist/combobox/combobox-separator.d.ts.map +1 -1
- package/dist/combobox/combobox-separator.js +1 -1
- package/dist/combobox/combobox-separator.js.map +1 -1
- package/dist/combobox/combobox-value.js +1 -1
- package/dist/combobox/combobox-value.js.map +1 -1
- package/dist/combobox/combobox.d.ts +3 -3
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/combobox.js +16 -2
- package/dist/combobox/combobox.js.map +1 -1
- package/dist/command/command.d.ts +1 -1
- package/dist/{command-DckndCUK.d.ts → command-B9C8p3_S.d.ts} +3 -3
- package/dist/{command-DckndCUK.d.ts.map → command-B9C8p3_S.d.ts.map} +1 -1
- package/dist/composite/composite-container.d.ts +1 -1
- package/dist/composite/composite-container.d.ts.map +1 -1
- package/dist/composite/composite-container.js +2 -2
- package/dist/composite/composite-container.js.map +1 -1
- package/dist/composite/composite-group-label.d.ts +2 -2
- package/dist/composite/composite-group-label.d.ts.map +1 -1
- package/dist/composite/composite-group.d.ts +2 -2
- package/dist/composite/composite-group.d.ts.map +1 -1
- package/dist/composite/composite-hover.d.ts +1 -1
- package/dist/composite/composite-hover.js +9 -13
- package/dist/composite/composite-hover.js.map +1 -1
- package/dist/composite/composite-input.d.ts +1 -1
- package/dist/composite/composite-input.d.ts.map +1 -1
- package/dist/composite/composite-input.js +1 -1
- package/dist/composite/composite-input.js.map +1 -1
- package/dist/composite/composite-item-offscreen.d.ts +2 -2
- package/dist/composite/composite-item-offscreen.js +2 -2
- package/dist/composite/composite-item-offscreen.js.map +1 -1
- package/dist/composite/composite-item.d.ts +1 -1
- package/dist/composite/composite-item.js +2 -2
- package/dist/composite/composite-item.js.map +1 -1
- package/dist/composite/composite-overflow-disclosure.d.ts +2 -2
- package/dist/composite/composite-overflow-disclosure.d.ts.map +1 -1
- package/dist/composite/composite-overflow.d.ts +2 -2
- package/dist/composite/composite-overflow.d.ts.map +1 -1
- package/dist/composite/composite-renderer.d.ts +28 -14
- package/dist/composite/composite-renderer.d.ts.map +1 -1
- package/dist/composite/composite-renderer.js +2 -2
- package/dist/composite/composite-renderer.js.map +1 -1
- package/dist/composite/composite-row.d.ts +1 -1
- package/dist/composite/composite-row.d.ts.map +1 -1
- package/dist/composite/composite-row.js +3 -3
- package/dist/composite/composite-row.js.map +1 -1
- package/dist/composite/composite-separator.d.ts +2 -2
- package/dist/composite/composite-separator.d.ts.map +1 -1
- package/dist/composite/composite-separator.js +3 -3
- package/dist/composite/composite-separator.js.map +1 -1
- package/dist/composite/composite-typeahead.d.ts +1 -1
- package/dist/composite/composite-typeahead.js +3 -3
- package/dist/composite/composite-typeahead.js.map +1 -1
- package/dist/composite/composite.d.ts +1 -1
- package/dist/composite/composite.js +3 -3
- package/dist/composite/composite.js.map +1 -1
- package/dist/{composite-DLvyFHMq.d.ts → composite-KBhCGLEy.d.ts} +3 -3
- package/dist/{composite-DLvyFHMq.d.ts.map → composite-KBhCGLEy.d.ts.map} +1 -1
- package/dist/{composite-hover-C7ul163w.d.ts → composite-hover-BpXq3T8J.d.ts} +2 -2
- package/dist/{composite-hover-C7ul163w.d.ts.map → composite-hover-BpXq3T8J.d.ts.map} +1 -1
- package/dist/{composite-item-B4WTelVz.d.ts → composite-item-d4UXaZ84.d.ts} +4 -4
- package/dist/{composite-item-B4WTelVz.d.ts.map → composite-item-d4UXaZ84.d.ts.map} +1 -1
- package/dist/{composite-typeahead-DDhpyKqm.d.ts → composite-typeahead-0euW43GU.d.ts} +2 -2
- package/dist/{composite-typeahead-DDhpyKqm.d.ts.map → composite-typeahead-0euW43GU.d.ts.map} +1 -1
- package/dist/dialog/dialog-backdrop.d.ts +1 -1
- package/dist/dialog/dialog-description.d.ts +1 -1
- package/dist/dialog/dialog-disclosure.d.ts +1 -1
- package/dist/dialog/dialog-disclosure.js +1 -1
- package/dist/dialog/dialog-disclosure.js.map +1 -1
- package/dist/dialog/dialog-dismiss.d.ts +1 -1
- package/dist/dialog/dialog-heading.d.ts +1 -1
- package/dist/dialog/dialog.d.ts +1 -1
- package/dist/dialog/dialog.js +18 -6
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts +1 -3
- package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts.map +1 -1
- package/dist/dialog/utils/disable-accessibility-tree-outside.js +1 -15
- package/dist/dialog/utils/disable-accessibility-tree-outside.js.map +1 -1
- package/dist/dialog/utils/use-hide-on-interact-outside.d.ts +1 -1
- package/dist/dialog/utils/use-hide-on-interact-outside.js +2 -2
- package/dist/dialog/utils/use-hide-on-interact-outside.js.map +1 -1
- package/dist/dialog/utils/use-prevent-body-scroll.js +2 -1
- package/dist/dialog/utils/use-prevent-body-scroll.js.map +1 -1
- package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts +1 -1
- package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts.map +1 -1
- package/dist/{dialog-C__C-zX2.d.ts → dialog-D23r2ZWj.d.ts} +4 -4
- package/dist/{dialog-C__C-zX2.d.ts.map → dialog-D23r2ZWj.d.ts.map} +1 -1
- package/dist/{dialog-description-BCZJ1Kyd.d.ts → dialog-description-CJGxnEvk.d.ts} +2 -2
- package/dist/{dialog-description-BCZJ1Kyd.d.ts.map → dialog-description-CJGxnEvk.d.ts.map} +1 -1
- package/dist/{dialog-disclosure-DLD10zlb.d.ts → dialog-disclosure-DSESk5pv.d.ts} +3 -3
- package/dist/{dialog-disclosure-DLD10zlb.d.ts.map → dialog-disclosure-DSESk5pv.d.ts.map} +1 -1
- package/dist/{dialog-dismiss-CnwEbzc6.d.ts → dialog-dismiss-DW3XQYvp.d.ts} +3 -3
- package/dist/{dialog-dismiss-CnwEbzc6.d.ts.map → dialog-dismiss-DW3XQYvp.d.ts.map} +1 -1
- package/dist/{dialog-heading-DQvnOfZH.d.ts → dialog-heading-DGA5d8VH.d.ts} +3 -3
- package/dist/{dialog-heading-DQvnOfZH.d.ts.map → dialog-heading-DGA5d8VH.d.ts.map} +1 -1
- package/dist/disclosure/disclosure-content.js +1 -1
- package/dist/disclosure/disclosure-content.js.map +1 -1
- package/dist/disclosure/disclosure.d.ts +1 -1
- package/dist/disclosure/disclosure.js +1 -1
- package/dist/disclosure/disclosure.js.map +1 -1
- package/dist/{disclosure-CQ37hPVP.d.ts → disclosure-C4F4sCVZ.d.ts} +3 -3
- package/dist/{disclosure-CQ37hPVP.d.ts.map → disclosure-C4F4sCVZ.d.ts.map} +1 -1
- package/dist/focus-trap/focus-trap-region.d.ts +1 -1
- package/dist/focus-trap/focus-trap-region.d.ts.map +1 -1
- package/dist/focus-trap/focus-trap.d.ts +1 -1
- package/dist/focus-trap/focus-trap.d.ts.map +1 -1
- package/dist/focusable/focusable-container.d.ts +1 -1
- package/dist/focusable/focusable-container.d.ts.map +1 -1
- package/dist/focusable/focusable.d.ts +1 -1
- package/dist/focusable/focusable.js +49 -8
- package/dist/focusable/focusable.js.map +1 -1
- package/dist/{focusable-B00tOxtB.d.ts → focusable-dBZH13-T.d.ts} +2 -2
- package/dist/{focusable-B00tOxtB.d.ts.map → focusable-dBZH13-T.d.ts.map} +1 -1
- package/dist/form/form-checkbox.d.ts +1 -1
- package/dist/form/form-checkbox.d.ts.map +1 -1
- package/dist/form/form-checkbox.js +1 -1
- package/dist/form/form-checkbox.js.map +1 -1
- package/dist/form/form-control.d.ts +2 -2
- package/dist/form/form-control.d.ts.map +1 -1
- package/dist/form/form-control.js +1 -1
- package/dist/form/form-control.js.map +1 -1
- package/dist/form/form-description.d.ts +2 -2
- package/dist/form/form-description.d.ts.map +1 -1
- package/dist/form/form-description.js +1 -1
- package/dist/form/form-description.js.map +1 -1
- package/dist/form/form-error.d.ts +2 -2
- package/dist/form/form-error.d.ts.map +1 -1
- package/dist/form/form-error.js +1 -1
- package/dist/form/form-error.js.map +1 -1
- package/dist/form/form-field.d.ts +1 -1
- package/dist/form/form-field.d.ts.map +1 -1
- package/dist/form/form-group-label.d.ts +2 -2
- package/dist/form/form-group-label.d.ts.map +1 -1
- package/dist/form/form-group.d.ts +2 -2
- package/dist/form/form-group.d.ts.map +1 -1
- package/dist/form/form-input.d.ts +2 -2
- package/dist/form/form-input.d.ts.map +1 -1
- package/dist/form/form-input.js +1 -1
- package/dist/form/form-input.js.map +1 -1
- package/dist/form/form-label.d.ts +2 -2
- package/dist/form/form-label.d.ts.map +1 -1
- package/dist/form/form-label.js +1 -1
- package/dist/form/form-label.js.map +1 -1
- package/dist/form/form-push.d.ts +3 -3
- package/dist/form/form-push.d.ts.map +1 -1
- package/dist/form/form-push.js +1 -1
- package/dist/form/form-push.js.map +1 -1
- package/dist/form/form-radio-group.d.ts +1 -1
- package/dist/form/form-radio-group.d.ts.map +1 -1
- package/dist/form/form-radio.d.ts +1 -1
- package/dist/form/form-radio.d.ts.map +1 -1
- package/dist/form/form-radio.js +1 -1
- package/dist/form/form-radio.js.map +1 -1
- package/dist/form/form-remove.d.ts +16 -12
- package/dist/form/form-remove.d.ts.map +1 -1
- package/dist/form/form-remove.js +15 -11
- package/dist/form/form-remove.js.map +1 -1
- package/dist/form/form-reset.d.ts +2 -2
- package/dist/form/form-reset.d.ts.map +1 -1
- package/dist/form/form-reset.js +1 -1
- package/dist/form/form-reset.js.map +1 -1
- package/dist/form/form-submit.d.ts +2 -2
- package/dist/form/form-submit.d.ts.map +1 -1
- package/dist/form/form-submit.js +1 -1
- package/dist/form/form-submit.js.map +1 -1
- package/dist/form/form.d.ts +1 -1
- package/dist/form/form.d.ts.map +1 -1
- package/dist/form/form.js +1 -1
- package/dist/form/form.js.map +1 -1
- package/dist/group/group-label.d.ts +1 -1
- package/dist/group/group.d.ts +1 -1
- package/dist/{group-label-C16IDs1b.d.ts → group-label-BKYqD4Sj.d.ts} +2 -2
- package/dist/{group-label-C16IDs1b.d.ts.map → group-label-BKYqD4Sj.d.ts.map} +1 -1
- package/dist/{group-CamegDJA.d.ts → group-nGD9e6Dj.d.ts} +2 -2
- package/dist/{group-CamegDJA.d.ts.map → group-nGD9e6Dj.d.ts.map} +1 -1
- package/dist/heading/heading.d.ts +1 -1
- package/dist/heading/heading.js +2 -2
- package/dist/heading/heading.js.map +1 -1
- package/dist/{heading-zY9g_9K-.d.ts → heading-D_AmeqL5.d.ts} +2 -2
- package/dist/{heading-zY9g_9K-.d.ts.map → heading-D_AmeqL5.d.ts.map} +1 -1
- package/dist/hovercard/hovercard-anchor.d.ts +2 -2
- package/dist/hovercard/hovercard-anchor.d.ts.map +1 -1
- package/dist/hovercard/hovercard-anchor.js +1 -1
- package/dist/hovercard/hovercard-anchor.js.map +1 -1
- package/dist/hovercard/hovercard-arrow.d.ts +1 -1
- package/dist/hovercard/hovercard-arrow.d.ts.map +1 -1
- package/dist/hovercard/hovercard-description.d.ts +2 -2
- package/dist/hovercard/hovercard-description.d.ts.map +1 -1
- package/dist/hovercard/hovercard-disclosure.d.ts +2 -2
- package/dist/hovercard/hovercard-disclosure.d.ts.map +1 -1
- package/dist/hovercard/hovercard-disclosure.js +4 -4
- package/dist/hovercard/hovercard-disclosure.js.map +1 -1
- package/dist/hovercard/hovercard-dismiss.d.ts +2 -2
- package/dist/hovercard/hovercard-dismiss.d.ts.map +1 -1
- package/dist/hovercard/hovercard-heading.d.ts +2 -2
- package/dist/hovercard/hovercard-heading.d.ts.map +1 -1
- package/dist/hovercard/hovercard.d.ts +1 -1
- package/dist/hovercard/hovercard.js +2 -2
- package/dist/hovercard/hovercard.js.map +1 -1
- package/dist/menu/menu-arrow.d.ts +2 -2
- package/dist/menu/menu-arrow.d.ts.map +1 -1
- package/dist/menu/menu-bar-provider.js +1 -1
- package/dist/menu/menu-bar-provider.js.map +1 -1
- package/dist/menu/menu-bar-store.d.ts +3 -3
- package/dist/menu/menu-bar-store.js +3 -3
- package/dist/menu/menu-bar-store.js.map +1 -1
- package/dist/menu/menu-bar.d.ts +1 -1
- package/dist/menu/menu-bar.d.ts.map +1 -1
- package/dist/menu/menu-bar.js +1 -1
- package/dist/menu/menu-bar.js.map +1 -1
- package/dist/menu/menu-button-arrow.d.ts +2 -2
- package/dist/menu/menu-button-arrow.d.ts.map +1 -1
- package/dist/menu/menu-button.d.ts +3 -3
- package/dist/menu/menu-button.d.ts.map +1 -1
- package/dist/menu/menu-button.js +1 -1
- package/dist/menu/menu-button.js.map +1 -1
- package/dist/menu/menu-context.d.ts +10 -3
- package/dist/menu/menu-context.d.ts.map +1 -1
- package/dist/menu/menu-context.js +8 -1
- package/dist/menu/menu-context.js.map +1 -1
- package/dist/menu/menu-description.d.ts +2 -2
- package/dist/menu/menu-description.d.ts.map +1 -1
- package/dist/menu/menu-dismiss.d.ts +2 -2
- package/dist/menu/menu-dismiss.d.ts.map +1 -1
- package/dist/menu/menu-group-label.d.ts +2 -2
- package/dist/menu/menu-group-label.d.ts.map +1 -1
- package/dist/menu/menu-group.d.ts +2 -2
- package/dist/menu/menu-group.d.ts.map +1 -1
- package/dist/menu/menu-heading.d.ts +2 -2
- package/dist/menu/menu-heading.d.ts.map +1 -1
- package/dist/menu/menu-item-check.d.ts +2 -2
- package/dist/menu/menu-item-check.d.ts.map +1 -1
- package/dist/menu/menu-item-checkbox.d.ts +2 -2
- package/dist/menu/menu-item-checkbox.d.ts.map +1 -1
- package/dist/menu/menu-item-checkbox.js +1 -1
- package/dist/menu/menu-item-checkbox.js.map +1 -1
- package/dist/menu/menu-item-radio.d.ts +2 -2
- package/dist/menu/menu-item-radio.d.ts.map +1 -1
- package/dist/menu/menu-item-radio.js +1 -1
- package/dist/menu/menu-item-radio.js.map +1 -1
- package/dist/menu/menu-item.d.ts +5 -5
- package/dist/menu/menu-item.d.ts.map +1 -1
- package/dist/menu/menu-item.js +8 -4
- package/dist/menu/menu-item.js.map +1 -1
- package/dist/menu/menu-list.d.ts +4 -4
- package/dist/menu/menu-list.d.ts.map +1 -1
- package/dist/menu/menu-list.js +6 -2
- package/dist/menu/menu-list.js.map +1 -1
- package/dist/menu/menu-provider.d.ts +1 -1
- package/dist/menu/menu-separator.d.ts +2 -2
- package/dist/menu/menu-separator.d.ts.map +1 -1
- package/dist/menu/menu-store.d.ts +1 -1
- package/dist/menu/menu.js +1 -1
- package/dist/menu/menu.js.map +1 -1
- package/dist/{menu-store-0CKKmNek.d.ts → menu-store-BpTJdcL8.d.ts} +2 -2
- package/dist/{menu-store-0CKKmNek.d.ts.map → menu-store-BpTJdcL8.d.ts.map} +1 -1
- package/dist/menubar/menubar-context.d.ts +2 -3
- package/dist/menubar/menubar-context.d.ts.map +1 -1
- package/dist/menubar/menubar-context.js +1 -3
- package/dist/menubar/menubar-context.js.map +1 -1
- package/dist/menubar/menubar-provider.d.ts +1 -1
- package/dist/menubar/menubar-store.d.ts +1 -1
- package/dist/menubar/menubar-store.js +2 -2
- package/dist/menubar/menubar-store.js.map +1 -1
- package/dist/menubar/menubar.d.ts +3 -3
- package/dist/menubar/menubar.d.ts.map +1 -1
- package/dist/{menubar-store-3h0eNIbS.d.ts → menubar-store-C553OKBw.d.ts} +3 -3
- package/dist/{menubar-store-3h0eNIbS.d.ts.map → menubar-store-C553OKBw.d.ts.map} +1 -1
- package/dist/popover/popover-anchor.d.ts +1 -1
- package/dist/popover/popover-arrow.d.ts +1 -1
- package/dist/popover/popover-arrow.d.ts.map +1 -1
- package/dist/popover/popover-arrow.js +4 -4
- package/dist/popover/popover-arrow.js.map +1 -1
- package/dist/popover/popover-description.d.ts +1 -1
- package/dist/popover/popover-disclosure-arrow.d.ts +1 -1
- package/dist/popover/popover-disclosure-arrow.d.ts.map +1 -1
- package/dist/popover/popover-disclosure-arrow.js +1 -1
- package/dist/popover/popover-disclosure-arrow.js.map +1 -1
- package/dist/popover/popover-disclosure.d.ts +3 -3
- package/dist/popover/popover-disclosure.d.ts.map +1 -1
- package/dist/popover/popover-disclosure.js +1 -1
- package/dist/popover/popover-disclosure.js.map +1 -1
- package/dist/popover/popover-dismiss.d.ts +1 -1
- package/dist/popover/popover-heading.d.ts +1 -1
- package/dist/popover/popover.d.ts +1 -1
- package/dist/popover/popover.js +2 -2
- package/dist/popover/popover.js.map +1 -1
- package/dist/{popover-CCqiRKqg.d.ts → popover-B9PxE5iP.d.ts} +10 -2
- package/dist/popover-B9PxE5iP.d.ts.map +1 -0
- package/dist/{popover-anchor-PgfeXyzs.d.ts → popover-anchor-W18KUmuM.d.ts} +2 -2
- package/dist/{popover-anchor-PgfeXyzs.d.ts.map → popover-anchor-W18KUmuM.d.ts.map} +1 -1
- package/dist/{popover-description-DU753dah.d.ts → popover-description-DbW4mVBb.d.ts} +3 -3
- package/dist/{popover-description-DU753dah.d.ts.map → popover-description-DbW4mVBb.d.ts.map} +1 -1
- package/dist/{popover-dismiss-DPeI6Zse.d.ts → popover-dismiss-CQFvuLzJ.d.ts} +3 -3
- package/dist/{popover-dismiss-DPeI6Zse.d.ts.map → popover-dismiss-CQFvuLzJ.d.ts.map} +1 -1
- package/dist/{popover-heading-DGsr6D5W.d.ts → popover-heading-DC8rYnwo.d.ts} +3 -3
- package/dist/{popover-heading-DGsr6D5W.d.ts.map → popover-heading-DC8rYnwo.d.ts.map} +1 -1
- package/dist/portal/portal.d.ts +1 -1
- package/dist/{portal-CMBWiayp.d.ts → portal-CKFTfCWH.d.ts} +2 -2
- package/dist/{portal-CMBWiayp.d.ts.map → portal-CKFTfCWH.d.ts.map} +1 -1
- package/dist/radio/radio-group.d.ts +2 -2
- package/dist/radio/radio-group.d.ts.map +1 -1
- package/dist/radio/radio-group.js +1 -1
- package/dist/radio/radio-group.js.map +1 -1
- package/dist/radio/radio.d.ts +2 -2
- package/dist/radio/radio.d.ts.map +1 -1
- package/dist/select/select-arrow.d.ts +1 -1
- package/dist/select/select-arrow.d.ts.map +1 -1
- package/dist/select/select-dismiss.d.ts +2 -2
- package/dist/select/select-dismiss.d.ts.map +1 -1
- package/dist/select/select-group-label.d.ts +1 -1
- package/dist/select/select-group-label.d.ts.map +1 -1
- package/dist/select/select-group.d.ts +1 -1
- package/dist/select/select-group.d.ts.map +1 -1
- package/dist/select/select-heading.d.ts +2 -2
- package/dist/select/select-heading.d.ts.map +1 -1
- package/dist/select/select-item-check.d.ts +1 -1
- package/dist/select/select-item-check.d.ts.map +1 -1
- package/dist/select/select-item.d.ts +3 -3
- package/dist/select/select-item.d.ts.map +1 -1
- package/dist/select/select-item.js +1 -1
- package/dist/select/select-item.js.map +1 -1
- package/dist/select/select-label.d.ts +1 -1
- package/dist/select/select-label.d.ts.map +1 -1
- package/dist/select/select-label.js +1 -1
- package/dist/select/select-label.js.map +1 -1
- package/dist/select/select-list.d.ts +3 -3
- package/dist/select/select-list.d.ts.map +1 -1
- package/dist/select/select-list.js +1 -1
- package/dist/select/select-list.js.map +1 -1
- package/dist/select/select-popover.d.ts +1 -1
- package/dist/select/select-renderer.d.ts +2 -2
- package/dist/select/select-renderer.d.ts.map +1 -1
- package/dist/select/select-row.d.ts +1 -1
- package/dist/select/select-row.d.ts.map +1 -1
- package/dist/select/select-row.js +1 -1
- package/dist/select/select-row.js.map +1 -1
- package/dist/select/select-separator.d.ts +1 -1
- package/dist/select/select-separator.d.ts.map +1 -1
- package/dist/select/select.d.ts +2 -2
- package/dist/select/select.d.ts.map +1 -1
- package/dist/select/select.js +1 -1
- package/dist/select/select.js.map +1 -1
- package/dist/separator/separator.d.ts +1 -1
- package/dist/{separator--ozQfMcK.d.ts → separator-BnvSVwBa.d.ts} +2 -2
- package/dist/{separator--ozQfMcK.d.ts.map → separator-BnvSVwBa.d.ts.map} +1 -1
- package/dist/tab/tab-list.d.ts +2 -2
- package/dist/tab/tab-list.d.ts.map +1 -1
- package/dist/tab/tab-list.js +1 -1
- package/dist/tab/tab-list.js.map +1 -1
- package/dist/tab/tab-panel.d.ts +3 -3
- package/dist/tab/tab-panel.d.ts.map +1 -1
- package/dist/tab/tab-panel.js +2 -3
- package/dist/tab/tab-panel.js.map +1 -1
- package/dist/tab/tab.d.ts +2 -2
- package/dist/tab/tab.d.ts.map +1 -1
- package/dist/tab/tab.js +1 -1
- package/dist/tab/tab.js.map +1 -1
- package/dist/tag/tag-input.d.ts +2 -2
- package/dist/tag/tag-input.d.ts.map +1 -1
- package/dist/tag/tag-input.js +1 -2
- package/dist/tag/tag-input.js.map +1 -1
- package/dist/tag/tag-list-label.d.ts +2 -2
- package/dist/tag/tag-list-label.d.ts.map +1 -1
- package/dist/tag/tag-list-label.js +1 -1
- package/dist/tag/tag-list-label.js.map +1 -1
- package/dist/tag/tag-list.d.ts +2 -2
- package/dist/tag/tag-list.d.ts.map +1 -1
- package/dist/tag/tag-list.js +1 -1
- package/dist/tag/tag-list.js.map +1 -1
- package/dist/tag/tag-remove.d.ts +1 -1
- package/dist/tag/tag-remove.d.ts.map +1 -1
- package/dist/tag/tag-remove.js +1 -2
- package/dist/tag/tag-remove.js.map +1 -1
- package/dist/tag/tag-value.js +1 -1
- package/dist/tag/tag-value.js.map +1 -1
- package/dist/tag/tag-values.js +1 -1
- package/dist/tag/tag-values.js.map +1 -1
- package/dist/tag/tag.d.ts +2 -2
- package/dist/tag/tag.d.ts.map +1 -1
- package/dist/tag/tag.js +1 -1
- package/dist/tag/tag.js.map +1 -1
- package/dist/toolbar/toolbar-container.d.ts +1 -1
- package/dist/toolbar/toolbar-container.d.ts.map +1 -1
- package/dist/toolbar/toolbar-input.d.ts +1 -1
- package/dist/toolbar/toolbar-input.d.ts.map +1 -1
- package/dist/toolbar/toolbar-item.d.ts +2 -2
- package/dist/toolbar/toolbar-item.d.ts.map +1 -1
- package/dist/toolbar/toolbar-separator.d.ts +1 -1
- package/dist/toolbar/toolbar-separator.d.ts.map +1 -1
- package/dist/toolbar/toolbar.d.ts +2 -2
- package/dist/toolbar/toolbar.d.ts.map +1 -1
- package/dist/tooltip/tooltip-anchor.d.ts +1 -1
- package/dist/tooltip/tooltip-anchor.d.ts.map +1 -1
- package/dist/tooltip/tooltip-anchor.js +15 -4
- package/dist/tooltip/tooltip-anchor.js.map +1 -1
- package/dist/tooltip/tooltip-arrow.d.ts +1 -1
- package/dist/tooltip/tooltip-arrow.d.ts.map +1 -1
- package/dist/tooltip/tooltip-arrow.js +1 -1
- package/dist/tooltip/tooltip-arrow.js.map +1 -1
- package/dist/tooltip/tooltip.js +1 -1
- package/dist/tooltip/tooltip.js.map +1 -1
- package/dist/visually-hidden/visually-hidden.d.ts +1 -1
- package/dist/visually-hidden/visually-hidden.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/collection/collection-item-offscreen.tsx +1 -1
- package/src/combobox/combobox.tsx +47 -1
- package/src/composite/composite-container.tsx +2 -2
- package/src/composite/composite-hover.tsx +8 -14
- package/src/composite/composite-item-offscreen.tsx +2 -2
- package/src/composite/composite-item.tsx +2 -2
- package/src/composite/composite-renderer.tsx +2 -2
- package/src/composite/composite-row.tsx +2 -2
- package/src/composite/composite-separator.tsx +2 -2
- package/src/composite/composite-typeahead.tsx +2 -2
- package/src/composite/composite.tsx +3 -3
- package/src/dialog/dialog.tsx +33 -10
- package/src/dialog/utils/disable-accessibility-tree-outside.ts +0 -25
- package/src/dialog/utils/use-hide-on-interact-outside.ts +3 -2
- package/src/focusable/focusable.tsx +53 -10
- package/src/form/form-remove.tsx +14 -10
- package/src/form/form.tsx +3 -1
- package/src/heading/heading.tsx +2 -5
- package/src/hovercard/hovercard-disclosure.tsx +18 -4
- package/src/hovercard/hovercard.tsx +1 -1
- package/src/menu/menu-bar-store.ts +2 -2
- package/src/menu/menu-context.tsx +8 -0
- package/src/menu/menu-item.tsx +18 -1
- package/src/menu/menu-list.tsx +15 -0
- package/src/menubar/menubar-context.tsx +0 -5
- package/src/menubar/menubar-store.ts +2 -2
- package/src/popover/popover-arrow.tsx +3 -3
- package/src/popover/popover.tsx +8 -0
- package/src/tab/tab-panel.tsx +1 -1
- package/src/tag/tag-input.tsx +0 -1
- package/src/tag/tag-remove.tsx +0 -1
- package/src/tooltip/tooltip-anchor.tsx +23 -8
- package/dist/collection-renderer-DsPD9ksD.d.ts.map +0 -1
- package/dist/popover-CCqiRKqg.d.ts.map +0 -1
- package/src/hovercard/utils/__tests__/polygon-test.ts +0 -66
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
useCollectionRenderer,
|
|
17
17
|
} from "../collection/collection-renderer.tsx";
|
|
18
18
|
import type { CollectionStoreItem } from "../collection/collection-store.ts";
|
|
19
|
-
import {
|
|
19
|
+
import { useCompositeScopedContext } from "./composite-context.tsx";
|
|
20
20
|
import type { CompositeStore, CompositeStoreItem } from "./composite-store.ts";
|
|
21
21
|
|
|
22
22
|
const TagName = "div" satisfies ElementType;
|
|
@@ -102,7 +102,7 @@ export function useCompositeRenderer<T extends Item = any>({
|
|
|
102
102
|
"aria-posinset": ariaPosInSet = 1,
|
|
103
103
|
...props
|
|
104
104
|
}: CompositeRendererProps<T>) {
|
|
105
|
-
const context =
|
|
105
|
+
const context = useCompositeScopedContext();
|
|
106
106
|
store = store || (context as typeof store);
|
|
107
107
|
|
|
108
108
|
const orientation = useStoreState(store, (state) =>
|
|
@@ -12,7 +12,7 @@ import type { ElementType } from "react";
|
|
|
12
12
|
import { useMemo } from "react";
|
|
13
13
|
import {
|
|
14
14
|
CompositeRowContext,
|
|
15
|
-
|
|
15
|
+
useCompositeScopedContext,
|
|
16
16
|
} from "./composite-context.tsx";
|
|
17
17
|
import type { CompositeStore } from "./composite-store.ts";
|
|
18
18
|
|
|
@@ -44,7 +44,7 @@ export const useCompositeRow = createHook<TagName, CompositeRowOptions>(
|
|
|
44
44
|
"aria-posinset": ariaPosInSet,
|
|
45
45
|
...props
|
|
46
46
|
}) {
|
|
47
|
-
const context =
|
|
47
|
+
const context = useCompositeScopedContext();
|
|
48
48
|
store = store || context;
|
|
49
49
|
|
|
50
50
|
invariant(
|
|
@@ -5,7 +5,7 @@ import { invariant } from "@ariakit/utils";
|
|
|
5
5
|
import type { ElementType } from "react";
|
|
6
6
|
import type { SeparatorOptions } from "../separator/separator.tsx";
|
|
7
7
|
import { useSeparator } from "../separator/separator.tsx";
|
|
8
|
-
import {
|
|
8
|
+
import { useCompositeScopedContext } from "./composite-context.tsx";
|
|
9
9
|
import type { CompositeStore } from "./composite-store.ts";
|
|
10
10
|
|
|
11
11
|
const TagName = "hr" satisfies ElementType;
|
|
@@ -29,7 +29,7 @@ export const useCompositeSeparator = createHook<
|
|
|
29
29
|
TagName,
|
|
30
30
|
CompositeSeparatorOptions
|
|
31
31
|
>(function useCompositeSeparator({ store, ...props }) {
|
|
32
|
-
const context =
|
|
32
|
+
const context = useCompositeScopedContext();
|
|
33
33
|
store = store || context;
|
|
34
34
|
|
|
35
35
|
invariant(
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "@ariakit/utils";
|
|
17
17
|
import type { ElementType, KeyboardEvent } from "react";
|
|
18
18
|
import { useRef } from "react";
|
|
19
|
-
import {
|
|
19
|
+
import { useCompositeScopedContext } from "./composite-context.tsx";
|
|
20
20
|
import type { CompositeStore, CompositeStoreItem } from "./composite-store.ts";
|
|
21
21
|
import { flipItems } from "./utils.ts";
|
|
22
22
|
|
|
@@ -112,7 +112,7 @@ export const useCompositeTypeahead = createHook<
|
|
|
112
112
|
TagName,
|
|
113
113
|
CompositeTypeaheadOptions
|
|
114
114
|
>(function useCompositeTypeahead({ store, typeahead = true, ...props }) {
|
|
115
|
-
const context =
|
|
115
|
+
const context = useCompositeScopedContext();
|
|
116
116
|
store = store || context;
|
|
117
117
|
|
|
118
118
|
invariant(
|
|
@@ -35,7 +35,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
35
35
|
import type { FocusableOptions } from "../focusable/focusable.tsx";
|
|
36
36
|
import { useFocusable } from "../focusable/focusable.tsx";
|
|
37
37
|
import {
|
|
38
|
-
|
|
38
|
+
CompositeScopedContextProvider,
|
|
39
39
|
useCompositeProviderContext,
|
|
40
40
|
} from "./composite-context.tsx";
|
|
41
41
|
import type { CompositeStore, CompositeStoreItem } from "./composite-store.ts";
|
|
@@ -445,9 +445,9 @@ export const useComposite = createHook<TagName, CompositeOptions>(
|
|
|
445
445
|
props = useWrapElement(
|
|
446
446
|
props,
|
|
447
447
|
(element) => (
|
|
448
|
-
<
|
|
448
|
+
<CompositeScopedContextProvider value={store}>
|
|
449
449
|
{element}
|
|
450
|
-
</
|
|
450
|
+
</CompositeScopedContextProvider>
|
|
451
451
|
),
|
|
452
452
|
[store],
|
|
453
453
|
);
|
package/src/dialog/dialog.tsx
CHANGED
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
getWindow,
|
|
21
21
|
addGlobalEventListener,
|
|
22
22
|
getFirstTabbableIn,
|
|
23
|
+
isElement,
|
|
24
|
+
isNode,
|
|
23
25
|
isFocusable,
|
|
24
26
|
chain,
|
|
25
27
|
isSafari,
|
|
@@ -497,13 +499,16 @@ export const useDialog = createHook<TagName, DialogOptions>(function useDialog({
|
|
|
497
499
|
// Ignore the event if the current dialog is marked by another dialog.
|
|
498
500
|
// This guarantees that only the topmost dialog will close on Escape.
|
|
499
501
|
if (isElementMarked(dialog)) return;
|
|
500
|
-
const target = event.target
|
|
501
|
-
|
|
502
|
+
const target = event.target;
|
|
503
|
+
// Guard against non-node targets (e.g. a synthetic event dispatched on
|
|
504
|
+
// window) so `contains` doesn't throw. `isNode` rather than `isElement`
|
|
505
|
+
// keeps non-element nodes working with `contains`, as before.
|
|
506
|
+
if (!isNode(target)) return;
|
|
502
507
|
const { disclosureElement } = store.getState();
|
|
503
508
|
// This considers valid targets only the disclosure element or descendants
|
|
504
509
|
// of the dialog element.
|
|
505
510
|
const isValidTarget = () => {
|
|
506
|
-
if (target.tagName === "BODY") return true;
|
|
511
|
+
if (isElement(target) && target.tagName === "BODY") return true;
|
|
507
512
|
if (contains(dialog, target)) return true;
|
|
508
513
|
if (!disclosureElement) return true;
|
|
509
514
|
if (contains(disclosureElement, target)) return true;
|
|
@@ -608,6 +613,23 @@ export function createDialogComponent<T extends DialogOptions>(
|
|
|
608
613
|
});
|
|
609
614
|
}
|
|
610
615
|
|
|
616
|
+
const DialogImpl = forwardRef(function DialogImpl(props: DialogProps) {
|
|
617
|
+
const htmlProps = useDialog(props);
|
|
618
|
+
return createElement(TagName, htmlProps);
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
const DialogWithStore = createDialogComponent(
|
|
622
|
+
DialogImpl,
|
|
623
|
+
useDialogProviderContext,
|
|
624
|
+
);
|
|
625
|
+
|
|
626
|
+
const DialogWithInternalStore = forwardRef(function DialogWithInternalStore(
|
|
627
|
+
props: DialogProps,
|
|
628
|
+
) {
|
|
629
|
+
const store = useDialogStore({ open: props.open });
|
|
630
|
+
return <DialogWithStore {...props} store={store} />;
|
|
631
|
+
});
|
|
632
|
+
|
|
611
633
|
/**
|
|
612
634
|
* Renders a dialog similar to the native `dialog` element that's rendered in a
|
|
613
635
|
* [`portal`](https://ariakit.com/reference/dialog#portal) by default.
|
|
@@ -628,13 +650,14 @@ export function createDialogComponent<T extends DialogOptions>(
|
|
|
628
650
|
* </Dialog>
|
|
629
651
|
* ```
|
|
630
652
|
*/
|
|
631
|
-
export const Dialog =
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
653
|
+
export const Dialog = forwardRef(function Dialog(props: DialogProps) {
|
|
654
|
+
const context = useDialogProviderContext();
|
|
655
|
+
// The hoisted store is only needed for the unmountOnHide mounted-state gate.
|
|
656
|
+
if (props.store || context || !props.unmountOnHide) {
|
|
657
|
+
return <DialogWithStore {...props} />;
|
|
658
|
+
}
|
|
659
|
+
return <DialogWithInternalStore {...props} />;
|
|
660
|
+
});
|
|
638
661
|
|
|
639
662
|
export interface DialogOptions<T extends ElementType = TagName>
|
|
640
663
|
extends FocusableOptions<T>, PortalOptions<T>, DisclosureContentOptions<T> {
|
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
import { isBackdrop } from "./is-backdrop.ts";
|
|
2
1
|
import { setAttribute } from "./orchestrate.ts";
|
|
3
|
-
import { walkTreeOutside } from "./walk-tree-outside.ts";
|
|
4
|
-
|
|
5
|
-
type Elements = Array<Element | null>;
|
|
6
2
|
|
|
7
3
|
export function hideElementFromAccessibilityTree(element: Element) {
|
|
8
4
|
return setAttribute(element, "aria-hidden", "true");
|
|
9
5
|
}
|
|
10
|
-
|
|
11
|
-
export function disableAccessibilityTreeOutside(
|
|
12
|
-
id: string,
|
|
13
|
-
elements: Elements,
|
|
14
|
-
) {
|
|
15
|
-
const cleanups: Array<() => void> = [];
|
|
16
|
-
const ids = elements.map((el) => el?.id);
|
|
17
|
-
|
|
18
|
-
walkTreeOutside(id, elements, (element) => {
|
|
19
|
-
if (isBackdrop(element, ...ids)) return;
|
|
20
|
-
cleanups.unshift(hideElementFromAccessibilityTree(element));
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const restoreAccessibilityTree = () => {
|
|
24
|
-
for (const cleanup of cleanups) {
|
|
25
|
-
cleanup();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return restoreAccessibilityTree;
|
|
30
|
-
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
getDocument,
|
|
6
6
|
getWindow,
|
|
7
7
|
addGlobalEventListener,
|
|
8
|
+
isElement,
|
|
8
9
|
} from "@ariakit/utils";
|
|
9
10
|
import type { MutableRefObject } from "react";
|
|
10
11
|
import { useEffect, useRef } from "react";
|
|
@@ -78,9 +79,9 @@ function useEventOutside({
|
|
|
78
79
|
if (!open) return;
|
|
79
80
|
const onEvent = (event: Event) => {
|
|
80
81
|
const { contentElement, disclosureElement } = store.getState();
|
|
81
|
-
const target = event.target
|
|
82
|
+
const target = event.target;
|
|
82
83
|
if (!contentElement) return;
|
|
83
|
-
if (!target) return;
|
|
84
|
+
if (!isElement(target)) return;
|
|
84
85
|
// When an element is unmounted right after it receives focus, the focus
|
|
85
86
|
// event is triggered after that, when the element isn't part of the
|
|
86
87
|
// current document anymore. We just ignore it.
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import type { Options, Props } from "@ariakit/react-utils";
|
|
11
11
|
import {
|
|
12
12
|
addGlobalEventListener,
|
|
13
|
+
isElement,
|
|
13
14
|
isFocusEventOutside,
|
|
14
15
|
isSelfTarget,
|
|
15
16
|
queueBeforeEvent,
|
|
@@ -119,6 +120,18 @@ function needsSafariTabIndex(tagName?: string, inputType?: string) {
|
|
|
119
120
|
return false;
|
|
120
121
|
}
|
|
121
122
|
|
|
123
|
+
function isNativeSubmitControl(element: HTMLElement) {
|
|
124
|
+
if (element.tagName === "BUTTON") {
|
|
125
|
+
const { type } = element as HTMLButtonElement;
|
|
126
|
+
return type === "submit";
|
|
127
|
+
}
|
|
128
|
+
if (element.tagName === "INPUT") {
|
|
129
|
+
const { type } = element as HTMLInputElement;
|
|
130
|
+
return type === "submit" || type === "image";
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
|
|
122
135
|
function getTabIndex({
|
|
123
136
|
focusable,
|
|
124
137
|
trulyDisabled,
|
|
@@ -170,13 +183,11 @@ let hasInstalledGlobalEventListeners = false;
|
|
|
170
183
|
let isKeyboardModality = true;
|
|
171
184
|
|
|
172
185
|
function onGlobalMouseDown(event: MouseEvent) {
|
|
173
|
-
const target = event.target
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
isKeyboardModality = false;
|
|
179
|
-
}
|
|
186
|
+
const target = event.target;
|
|
187
|
+
// If the target element is already focus-visible, we keep the keyboard
|
|
188
|
+
// modality.
|
|
189
|
+
if (isElement(target) && !target.hasAttribute("data-focus-visible")) {
|
|
190
|
+
isKeyboardModality = false;
|
|
180
191
|
}
|
|
181
192
|
}
|
|
182
193
|
|
|
@@ -225,16 +236,26 @@ export const useFocusable = createHook<TagName, FocusableOptions>(
|
|
|
225
236
|
const disabled = focusable && disabledFromProps(props);
|
|
226
237
|
const trulyDisabled = disabled && !accessibleWhenDisabled;
|
|
227
238
|
const [focusVisible, setFocusVisible] = useState(false);
|
|
239
|
+
const focusVisibleRef = useRef(false);
|
|
240
|
+
const nativeSubmitObserverCleanupRef = useRef<(() => void) | null>(null);
|
|
241
|
+
const cleanupFocusVisible = useEvent((element: HTMLElement | null) => {
|
|
242
|
+
nativeSubmitObserverCleanupRef.current?.();
|
|
243
|
+
nativeSubmitObserverCleanupRef.current = null;
|
|
244
|
+
focusVisibleRef.current = false;
|
|
245
|
+
element?.removeAttribute("data-focus-visible");
|
|
246
|
+
});
|
|
228
247
|
|
|
229
248
|
// When the focusable element is disabled, it doesn't trigger a blur event
|
|
230
249
|
// so we can't set focusVisible to false there. Instead, we have to do it
|
|
231
250
|
// here by checking the element's disabled attribute.
|
|
232
251
|
useEffect(() => {
|
|
233
252
|
if (!focusable) return;
|
|
234
|
-
if (trulyDisabled
|
|
253
|
+
if (!trulyDisabled) return;
|
|
254
|
+
cleanupFocusVisible(ref.current);
|
|
255
|
+
if (focusVisible) {
|
|
235
256
|
setFocusVisible(false);
|
|
236
257
|
}
|
|
237
|
-
}, [focusable, trulyDisabled, focusVisible]);
|
|
258
|
+
}, [focusable, trulyDisabled, focusVisible, cleanupFocusVisible]);
|
|
238
259
|
|
|
239
260
|
// When an element that has focus becomes hidden, it doesn't trigger a blur
|
|
240
261
|
// event so we can't set focusVisible to false there. We observe the element
|
|
@@ -248,6 +269,7 @@ export const useFocusable = createHook<TagName, FocusableOptions>(
|
|
|
248
269
|
if (typeof IntersectionObserver === "undefined") return;
|
|
249
270
|
const observer = new IntersectionObserver(() => {
|
|
250
271
|
if (!isFocusable(element)) {
|
|
272
|
+
focusVisibleRef.current = false;
|
|
251
273
|
setFocusVisible(false);
|
|
252
274
|
}
|
|
253
275
|
});
|
|
@@ -255,6 +277,10 @@ export const useFocusable = createHook<TagName, FocusableOptions>(
|
|
|
255
277
|
return () => observer.disconnect();
|
|
256
278
|
}, [focusable, focusVisible]);
|
|
257
279
|
|
|
280
|
+
useEffect(() => {
|
|
281
|
+
return () => nativeSubmitObserverCleanupRef.current?.();
|
|
282
|
+
}, []);
|
|
283
|
+
|
|
258
284
|
// Disable events when the element is disabled.
|
|
259
285
|
const onKeyPressCapture = useDisableEvent(
|
|
260
286
|
props.onKeyPressCapture,
|
|
@@ -286,6 +312,22 @@ export const useFocusable = createHook<TagName, FocusableOptions>(
|
|
|
286
312
|
// other data attributes like data-active-item. See
|
|
287
313
|
// https://github.com/ariakit/ariakit/issues/4083
|
|
288
314
|
element.dataset.focusVisible = "true";
|
|
315
|
+
focusVisibleRef.current = true;
|
|
316
|
+
// React 19's useFormStatus may lose the pending state when local
|
|
317
|
+
// component state changes while a native submit control is pending.
|
|
318
|
+
if (isNativeSubmitControl(element)) {
|
|
319
|
+
nativeSubmitObserverCleanupRef.current?.();
|
|
320
|
+
nativeSubmitObserverCleanupRef.current = null;
|
|
321
|
+
if (typeof IntersectionObserver !== "undefined") {
|
|
322
|
+
const observer = new IntersectionObserver(() => {
|
|
323
|
+
if (isFocusable(element)) return;
|
|
324
|
+
cleanupFocusVisible(element);
|
|
325
|
+
});
|
|
326
|
+
observer.observe(element);
|
|
327
|
+
nativeSubmitObserverCleanupRef.current = () => observer.disconnect();
|
|
328
|
+
}
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
289
331
|
setFocusVisible(true);
|
|
290
332
|
};
|
|
291
333
|
|
|
@@ -296,6 +338,7 @@ export const useFocusable = createHook<TagName, FocusableOptions>(
|
|
|
296
338
|
if (event.defaultPrevented) return;
|
|
297
339
|
if (!focusable) return;
|
|
298
340
|
if (focusVisible) return;
|
|
341
|
+
if (focusVisibleRef.current) return;
|
|
299
342
|
if (event.metaKey) return;
|
|
300
343
|
if (event.altKey) return;
|
|
301
344
|
if (event.ctrlKey) return;
|
|
@@ -335,7 +378,7 @@ export const useFocusable = createHook<TagName, FocusableOptions>(
|
|
|
335
378
|
// Since we set the data-focus-visible attribute on the element in the
|
|
336
379
|
// handleFocusVisible function, we remove it directly here. Otherwise, the
|
|
337
380
|
// attribute might not be removed on lower-end devices.
|
|
338
|
-
event.currentTarget
|
|
381
|
+
cleanupFocusVisible(event.currentTarget);
|
|
339
382
|
setFocusVisible(false);
|
|
340
383
|
});
|
|
341
384
|
|
package/src/form/form-remove.tsx
CHANGED
|
@@ -62,9 +62,10 @@ function findPushButton(
|
|
|
62
62
|
* const values = useStoreState(store, "values");
|
|
63
63
|
*
|
|
64
64
|
* <Form store={store}>
|
|
65
|
-
* {values.languages.map((
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* {values.languages.map((language, i) => {
|
|
66
|
+
* if (language == null) return null;
|
|
67
|
+
* return <FormInput key={i} name={store.names.languages[i]} />;
|
|
68
|
+
* })}
|
|
68
69
|
* <Role {...props}>Remove first language</Role>
|
|
69
70
|
* </Form>
|
|
70
71
|
* ```
|
|
@@ -136,7 +137,7 @@ export const useFormRemove = createHook<TagName, FormRemoveOptions>(
|
|
|
136
137
|
* prop to `false`.
|
|
137
138
|
* @see https://ariakit.com/components/form
|
|
138
139
|
* @example
|
|
139
|
-
* ```jsx {
|
|
140
|
+
* ```jsx {15}
|
|
140
141
|
* const form = useFormStore({
|
|
141
142
|
* defaultValues: {
|
|
142
143
|
* languages: ["JavaScript", "PHP"],
|
|
@@ -146,12 +147,15 @@ export const useFormRemove = createHook<TagName, FormRemoveOptions>(
|
|
|
146
147
|
* const values = useStoreState(form, "values");
|
|
147
148
|
*
|
|
148
149
|
* <Form store={form}>
|
|
149
|
-
* {values.languages.map((
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* <
|
|
153
|
-
*
|
|
154
|
-
*
|
|
150
|
+
* {values.languages.map((language, i) => {
|
|
151
|
+
* if (language == null) return null;
|
|
152
|
+
* return (
|
|
153
|
+
* <div key={i}>
|
|
154
|
+
* <FormInput name={form.names.languages[i]} />
|
|
155
|
+
* <FormRemove name={form.names.languages} index={i} />
|
|
156
|
+
* </div>
|
|
157
|
+
* );
|
|
158
|
+
* })}
|
|
155
159
|
* </Form>
|
|
156
160
|
* ```
|
|
157
161
|
*/
|
package/src/form/form.tsx
CHANGED
|
@@ -104,8 +104,10 @@ export const useForm = createHook<TagName, FormOptions>(function useForm({
|
|
|
104
104
|
}, [autoFocusOnSubmit, submitFailed, items]);
|
|
105
105
|
|
|
106
106
|
const onSubmitProp = props.onSubmit;
|
|
107
|
+
// React 19 types submit handlers with SubmitEvent instead of FormEvent.
|
|
108
|
+
type SubmitEvent = Parameters<NonNullable<typeof onSubmitProp>>[0];
|
|
107
109
|
|
|
108
|
-
const onSubmit = useEvent((event:
|
|
110
|
+
const onSubmit = useEvent((event: SubmitEvent) => {
|
|
109
111
|
onSubmitProp?.(event);
|
|
110
112
|
if (event.defaultPrevented) return;
|
|
111
113
|
event.preventDefault();
|
package/src/heading/heading.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@ariakit/react-utils";
|
|
8
8
|
import type { Options, Props } from "@ariakit/react-utils";
|
|
9
9
|
import type { ElementType } from "react";
|
|
10
|
-
import { useContext,
|
|
10
|
+
import { useContext, useRef } from "react";
|
|
11
11
|
import { HeadingContext } from "./heading-context.tsx";
|
|
12
12
|
import type { HeadingLevels } from "./utils.ts";
|
|
13
13
|
|
|
@@ -33,10 +33,7 @@ export const useHeading = createHook<TagName, HeadingOptions>(
|
|
|
33
33
|
const level: HeadingLevels = useContext(HeadingContext) || 1;
|
|
34
34
|
const Element = `h${level}` as const;
|
|
35
35
|
const tagName = useTagName(ref, Element);
|
|
36
|
-
const isNativeHeading =
|
|
37
|
-
() => !!tagName && /^h\d$/.test(tagName),
|
|
38
|
-
[tagName],
|
|
39
|
-
);
|
|
36
|
+
const isNativeHeading = !!tagName && /^h\d$/.test(tagName);
|
|
40
37
|
|
|
41
38
|
props = {
|
|
42
39
|
render: <Element />,
|
|
@@ -7,7 +7,13 @@ import {
|
|
|
7
7
|
} from "@ariakit/react-utils";
|
|
8
8
|
import type { Props } from "@ariakit/react-utils";
|
|
9
9
|
import { sync } from "@ariakit/store";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
contains,
|
|
12
|
+
addGlobalEventListener,
|
|
13
|
+
invariant,
|
|
14
|
+
isElement,
|
|
15
|
+
isNode,
|
|
16
|
+
} from "@ariakit/utils";
|
|
11
17
|
import type {
|
|
12
18
|
ElementType,
|
|
13
19
|
MouseEvent,
|
|
@@ -58,8 +64,11 @@ export const useHovercardDisclosure = createHook<
|
|
|
58
64
|
if (!visible) return;
|
|
59
65
|
const onBlur = (event: FocusEvent) => {
|
|
60
66
|
if (!store) return;
|
|
61
|
-
const nextActiveElement = event.relatedTarget
|
|
62
|
-
|
|
67
|
+
const nextActiveElement = event.relatedTarget;
|
|
68
|
+
// `isNode` rather than `isElement` so non-element nodes keep working with
|
|
69
|
+
// `contains` (as before); a non-node relatedTarget (e.g. window) would
|
|
70
|
+
// make `contains` throw, so it falls through to hiding the disclosure.
|
|
71
|
+
if (isNode(nextActiveElement)) {
|
|
63
72
|
const {
|
|
64
73
|
anchorElement: anchor,
|
|
65
74
|
popoverElement: popover,
|
|
@@ -72,7 +81,12 @@ export const useHovercardDisclosure = createHook<
|
|
|
72
81
|
// it's going to render focus trap elements outside of the portal.
|
|
73
82
|
// These elements may transfer focus to the disclosure button, so we
|
|
74
83
|
// also ignore them here.
|
|
75
|
-
if (
|
|
84
|
+
if (
|
|
85
|
+
isElement(nextActiveElement) &&
|
|
86
|
+
nextActiveElement.hasAttribute("data-focus-trap")
|
|
87
|
+
) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
76
90
|
}
|
|
77
91
|
setVisible(false);
|
|
78
92
|
};
|
|
@@ -65,7 +65,7 @@ function isMovingOnHovercard(
|
|
|
65
65
|
// The mouse is moving on an element inside the anchor element.
|
|
66
66
|
if (anchor && contains(anchor, target)) return true;
|
|
67
67
|
// The mouse is moving on an element inside a nested hovercard.
|
|
68
|
-
if (nested?.some((card) =>
|
|
68
|
+
if (nested?.some((card) => hasFocusWithin(card) || contains(card, target))) {
|
|
69
69
|
return true;
|
|
70
70
|
}
|
|
71
71
|
return false;
|
|
@@ -27,8 +27,8 @@ export function useMenuBarStoreProps<T extends Core.MenuBarStore>(
|
|
|
27
27
|
* instead.
|
|
28
28
|
* @example
|
|
29
29
|
* ```jsx
|
|
30
|
-
* const
|
|
31
|
-
* <MenuBar store={
|
|
30
|
+
* const menubar = useMenuBarStore();
|
|
31
|
+
* <MenuBar store={menubar} />
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export function useMenuBarStore(props: MenuBarStoreProps = {}): MenuBarStore {
|
|
@@ -74,3 +74,11 @@ export const MenuBarScopedContextProvider = MenubarScopedContextProvider;
|
|
|
74
74
|
export const MenuItemCheckedContext = createContext<boolean | undefined>(
|
|
75
75
|
undefined,
|
|
76
76
|
);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Whether the enclosing menu list is currently hidden (e.g. a closed menu
|
|
80
|
+
* rendered without `unmountOnHide`). `MenuItem` uses it to skip registering
|
|
81
|
+
* items that aren't shown yet. Defaults to `false` so items without a menu list
|
|
82
|
+
* ancestor (such as menubar items) keep registering.
|
|
83
|
+
*/
|
|
84
|
+
export const MenuListHiddenContext = createContext(false);
|
package/src/menu/menu-item.tsx
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
invariant,
|
|
18
18
|
} from "@ariakit/utils";
|
|
19
19
|
import type { BooleanOrCallback } from "@ariakit/utils";
|
|
20
|
+
import { useContext } from "react";
|
|
20
21
|
import type { ElementType, MouseEvent } from "react";
|
|
21
22
|
import type { CompositeHoverOptions } from "../composite/composite-hover.tsx";
|
|
22
23
|
import { useCompositeHover } from "../composite/composite-hover.tsx";
|
|
@@ -24,7 +25,10 @@ import type { CompositeItemOptions } from "../composite/composite-item.tsx";
|
|
|
24
25
|
import { useCompositeItem } from "../composite/composite-item.tsx";
|
|
25
26
|
import { useMenubarScopedContext } from "../menubar/menubar-context.tsx";
|
|
26
27
|
import type { MenubarStore } from "../menubar/menubar-store.ts";
|
|
27
|
-
import {
|
|
28
|
+
import {
|
|
29
|
+
MenuListHiddenContext,
|
|
30
|
+
useMenuScopedContext,
|
|
31
|
+
} from "./menu-context.tsx";
|
|
28
32
|
import type { MenuStore, MenuStoreState } from "./menu-store.ts";
|
|
29
33
|
|
|
30
34
|
const TagName = "div" satisfies ElementType;
|
|
@@ -108,6 +112,10 @@ export const useMenuItem = createHook<TagName, MenuItemOptions>(
|
|
|
108
112
|
"contentElement" in state ? state.contentElement : null,
|
|
109
113
|
);
|
|
110
114
|
|
|
115
|
+
// Whether the enclosing menu list is currently hidden (provided by
|
|
116
|
+
// `MenuList`; see `MenuListHiddenContext`).
|
|
117
|
+
const menuListHidden = useContext(MenuListHiddenContext);
|
|
118
|
+
|
|
111
119
|
const role = getPopupItemRole(contentElement, "menuitem");
|
|
112
120
|
|
|
113
121
|
props = {
|
|
@@ -120,6 +128,15 @@ export const useMenuItem = createHook<TagName, MenuItemOptions>(
|
|
|
120
128
|
store,
|
|
121
129
|
preventScrollOnKeyDown,
|
|
122
130
|
...props,
|
|
131
|
+
// Skip registering items while the menu list is hidden. Unlike a Select,
|
|
132
|
+
// a Menu doesn't interact with its items while hidden, so registering
|
|
133
|
+
// them isn't useful. Registering many hidden menus' items at once on
|
|
134
|
+
// mount can also cascade into React's "Maximum update depth exceeded"
|
|
135
|
+
// error. Using the list's actual hidden state (rather than the store's
|
|
136
|
+
// `mounted` state) keeps items registered in `alwaysVisible` or
|
|
137
|
+
// `hidden={false}` menus, where the list is shown even while closed.
|
|
138
|
+
// See https://github.com/ariakit/ariakit/issues/3214.
|
|
139
|
+
shouldRegisterItem: menuListHidden ? false : props.shouldRegisterItem,
|
|
123
140
|
});
|
|
124
141
|
|
|
125
142
|
props = useCompositeHover({
|
package/src/menu/menu-list.tsx
CHANGED
|
@@ -19,6 +19,7 @@ import { useComposite } from "../composite/composite.tsx";
|
|
|
19
19
|
import type { DisclosureContentOptions } from "../disclosure/disclosure-content.tsx";
|
|
20
20
|
import { isHidden } from "../disclosure/disclosure-content.tsx";
|
|
21
21
|
import {
|
|
22
|
+
MenuListHiddenContext,
|
|
22
23
|
MenuScopedContextProvider,
|
|
23
24
|
useMenuProviderContext,
|
|
24
25
|
} from "./menu-context.tsx";
|
|
@@ -157,6 +158,20 @@ export const useMenuList = createHook<TagName, MenuListOptions>(
|
|
|
157
158
|
const hidden = isHidden(mounted, props.hidden, alwaysVisible);
|
|
158
159
|
const style = hidden ? { ...props.style, display: "none" } : props.style;
|
|
159
160
|
|
|
161
|
+
// Expose the list's actual hidden state so MenuItem can avoid registering
|
|
162
|
+
// items while they're not shown. This accounts for `alwaysVisible` and
|
|
163
|
+
// `hidden={false}`, where the list is visible even though the store is
|
|
164
|
+
// closed. See https://github.com/ariakit/ariakit/issues/3214.
|
|
165
|
+
props = useWrapElement(
|
|
166
|
+
props,
|
|
167
|
+
(element) => (
|
|
168
|
+
<MenuListHiddenContext.Provider value={hidden}>
|
|
169
|
+
{element}
|
|
170
|
+
</MenuListHiddenContext.Provider>
|
|
171
|
+
),
|
|
172
|
+
[hidden],
|
|
173
|
+
);
|
|
174
|
+
|
|
160
175
|
props = {
|
|
161
176
|
"aria-labelledby": ariaLabelledBy,
|
|
162
177
|
hidden,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createStoreContext } from "@ariakit/react-utils";
|
|
2
|
-
import { createContext } from "react";
|
|
3
2
|
import {
|
|
4
3
|
CompositeContextProvider,
|
|
5
4
|
CompositeScopedContextProvider,
|
|
@@ -33,7 +32,3 @@ export const useMenubarProviderContext = menubar.useProviderContext;
|
|
|
33
32
|
export const MenubarContextProvider = menubar.ContextProvider;
|
|
34
33
|
|
|
35
34
|
export const MenubarScopedContextProvider = menubar.ScopedContextProvider;
|
|
36
|
-
|
|
37
|
-
export const MenuItemCheckedContext = createContext<boolean | undefined>(
|
|
38
|
-
undefined,
|
|
39
|
-
);
|
|
@@ -22,9 +22,9 @@ export function useMenubarStoreProps<T extends Core.MenubarStore>(
|
|
|
22
22
|
* @see https://ariakit.com/components/menubar
|
|
23
23
|
* @example
|
|
24
24
|
* ```jsx
|
|
25
|
-
* const
|
|
25
|
+
* const menubar = useMenubarStore();
|
|
26
26
|
*
|
|
27
|
-
* <Menubar store={
|
|
27
|
+
* <Menubar store={menubar} />
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
export function useMenubarStore(props: MenubarStoreProps = {}): MenubarStore {
|
|
@@ -128,7 +128,7 @@ export const usePopoverArrow = createHook<TagName, PopoverArrowOptions>(
|
|
|
128
128
|
// the appearance of borders on HTML elements.
|
|
129
129
|
<path
|
|
130
130
|
fill="none"
|
|
131
|
-
stroke={
|
|
131
|
+
stroke={fill}
|
|
132
132
|
d={POPOVER_ARROW_PATH}
|
|
133
133
|
mask={`url(#${maskId})`}
|
|
134
134
|
/>
|
|
@@ -162,8 +162,8 @@ export const usePopoverArrow = createHook<TagName, PopoverArrowOptions>(
|
|
|
162
162
|
width: "1em",
|
|
163
163
|
height: "1em",
|
|
164
164
|
pointerEvents: "none",
|
|
165
|
-
fill
|
|
166
|
-
stroke
|
|
165
|
+
fill,
|
|
166
|
+
stroke,
|
|
167
167
|
strokeWidth,
|
|
168
168
|
...props.style,
|
|
169
169
|
},
|
package/src/popover/popover.tsx
CHANGED
|
@@ -526,6 +526,14 @@ export interface PopoverOptions<
|
|
|
526
526
|
* @default false
|
|
527
527
|
*/
|
|
528
528
|
fixed?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* @default false
|
|
531
|
+
*/
|
|
532
|
+
modal?: DialogOptions<T>["modal"];
|
|
533
|
+
/**
|
|
534
|
+
* @default false
|
|
535
|
+
*/
|
|
536
|
+
portal?: DialogOptions<T>["portal"];
|
|
529
537
|
/**
|
|
530
538
|
* The distance between the popover and the anchor element.
|
|
531
539
|
*
|
package/src/tab/tab-panel.tsx
CHANGED
|
@@ -123,7 +123,7 @@ export const useTabPanel = createHook<TagName, TabPanelOptions>(
|
|
|
123
123
|
return () => {
|
|
124
124
|
element.removeEventListener("scroll", onScroll);
|
|
125
125
|
};
|
|
126
|
-
}, [scrollRestoration, mounted, tabId, getScrollElement
|
|
126
|
+
}, [scrollRestoration, mounted, tabId, getScrollElement]);
|
|
127
127
|
|
|
128
128
|
const [hasTabbableChildren, setHasTabbableChildren] = useState(false);
|
|
129
129
|
|