@ariakit/react-core 0.3.2 → 0.3.4
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 +108 -0
- package/cjs/__chunks/{FWCQCCG3.cjs → 232HWSNY.cjs} +12 -12
- package/cjs/__chunks/{GBOZYA5C.cjs → 2H4Y2NEY.cjs} +4 -4
- package/cjs/__chunks/{LCKU3TYW.cjs → 35G5ZXPH.cjs} +12 -2
- package/cjs/__chunks/{LJBXMHCD.cjs → 3DILH277.cjs} +6 -6
- package/cjs/__chunks/{B3TGB2C3.cjs → 4QHHTATP.cjs} +7 -7
- package/cjs/__chunks/{ZJ4ICN62.cjs → 5ZP4D2SQ.cjs} +4 -4
- package/cjs/__chunks/{SKVJLFWS.cjs → 6UYPIKG4.cjs} +8 -8
- package/cjs/__chunks/{GCTYF2Y6.cjs → 76UBACFC.cjs} +3 -3
- package/cjs/__chunks/{HYYXXXEK.cjs → BSOHJE7R.cjs} +2 -2
- package/cjs/__chunks/{ZPTFLDSU.cjs → CAKLNUKE.cjs} +7 -7
- package/cjs/__chunks/{INDMFBTS.cjs → COHI5HTS.cjs} +17 -16
- package/cjs/__chunks/{DPLHWKRP.cjs → DFFFHQVQ.cjs} +3 -3
- package/cjs/__chunks/{HFISYIKE.cjs → DYNIQRKI.cjs} +7 -7
- package/cjs/__chunks/{S4UMINQJ.cjs → EMNY7J2W.cjs} +2 -2
- package/cjs/__chunks/{I63PYP2U.cjs → EVNF7KMT.cjs} +3 -35
- package/cjs/__chunks/{ZQTMT453.cjs → EZKYHQVF.cjs} +2 -2
- package/cjs/__chunks/{NBCR3CLP.cjs → F4RJLWZG.cjs} +3 -3
- package/cjs/__chunks/{G33PRHOG.cjs → GUWJ7VTO.cjs} +10 -10
- package/cjs/__chunks/{4HKELPDA.cjs → GWFSX7RQ.cjs} +8 -8
- package/cjs/__chunks/{2FEEKOTF.cjs → GZMKQINI.cjs} +2 -2
- package/cjs/__chunks/{3ULNMLN7.cjs → HSOKUBYY.cjs} +5 -5
- package/cjs/__chunks/{NPDPNCSD.cjs → HWZH54NB.cjs} +3 -2
- package/cjs/__chunks/{BPPAZUXP.cjs → J37FS72U.cjs} +2 -2
- package/cjs/__chunks/{5E5FKYEO.cjs → L2VQ4YLN.cjs} +18 -1
- package/cjs/__chunks/{7F6H5HXC.cjs → LCC3WQBM.cjs} +4 -4
- package/cjs/__chunks/{E4C2KZA5.cjs → O6SYRTZH.cjs} +5 -5
- package/cjs/__chunks/{2C7LUQOS.cjs → OOFSNUBV.cjs} +2 -2
- package/cjs/__chunks/{DMTOMUIM.cjs → QBOBT66Y.cjs} +8 -7
- package/cjs/__chunks/{QEG5AJH6.cjs → QFGI3BJE.cjs} +107 -58
- package/cjs/__chunks/{JKMBJCXA.cjs → QK4GI6B3.cjs} +7 -12
- package/cjs/__chunks/{OX7M6AXH.cjs → QMFZ4CLT.cjs} +4 -4
- package/cjs/__chunks/{HCQYEOCO.cjs → R7CSCUVW.cjs} +6 -6
- package/cjs/__chunks/{6UXB6PRK.cjs → RU4K4ZH6.cjs} +7 -7
- package/cjs/__chunks/{6BAHKJ5K.cjs → RWS2MAR2.cjs} +0 -7
- package/cjs/__chunks/{J77SNKFZ.cjs → SE2X2FG7.cjs} +4 -4
- package/cjs/__chunks/{6G5GJF5Q.cjs → SELCJFCB.cjs} +2 -2
- package/cjs/__chunks/{WBPFHFAX.cjs → T222USYS.cjs} +35 -35
- package/cjs/__chunks/TLA46MN6.cjs +79 -0
- package/cjs/__chunks/{V37GXOUJ.cjs → TYMYFAUI.cjs} +4 -4
- package/cjs/__chunks/{DNFCOHE4.cjs → UK2DHDQU.cjs} +2 -2
- package/cjs/__chunks/{4ULJINEP.cjs → VAF2GKYW.cjs} +8 -8
- package/cjs/__chunks/{XOHN6PER.cjs → VAY4A33A.cjs} +10 -6
- package/cjs/__chunks/{JNVNPB37.cjs → VGU6RMHO.cjs} +2 -2
- package/cjs/__chunks/{27A4YAUB.cjs → VVU2UQJ2.cjs} +4 -4
- package/cjs/__chunks/{EQEXTQQ6.cjs → YCBMXOIO.cjs} +5 -5
- package/cjs/__chunks/{2VQBXUAI.cjs → YLOTLD6S.cjs} +2 -2
- package/cjs/__chunks/{HDYD5S2P.cjs → ZIEW4CQO.cjs} +3 -3
- package/cjs/__chunks/{X3UARAKT.cjs → ZQZC54NS.cjs} +2 -2
- package/cjs/__chunks/{NATUYKIW.cjs → ZZZ5MQHA.cjs} +4 -4
- package/cjs/button/button.cjs +4 -4
- package/cjs/checkbox/checkbox-provider.cjs +3 -3
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/checkbox/checkbox.cjs +5 -5
- package/cjs/collection/collection-provider.cjs +3 -3
- package/cjs/collection/collection-renderer.cjs +3 -3
- package/cjs/collection/collection-renderer.d.ts +53 -53
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/combobox/combobox-cancel.cjs +4 -4
- package/cjs/combobox/combobox-disclosure.cjs +6 -6
- package/cjs/combobox/combobox-item.cjs +5 -5
- package/cjs/combobox/combobox-list.cjs +5 -4
- package/cjs/combobox/combobox-popover.cjs +24 -20
- package/cjs/combobox/combobox-provider.cjs +8 -8
- package/cjs/combobox/combobox-store.cjs +8 -8
- package/cjs/combobox/combobox.cjs +7 -5
- package/cjs/command/command.cjs +3 -3
- package/cjs/composite/composite-container.cjs +3 -3
- package/cjs/composite/composite-item.cjs +5 -5
- package/cjs/composite/composite-overflow-disclosure.cjs +10 -10
- package/cjs/composite/composite-overflow-store.cjs +6 -6
- package/cjs/composite/composite-overflow.cjs +15 -14
- package/cjs/composite/composite-provider.cjs +4 -4
- package/cjs/composite/composite-renderer.cjs +4 -4
- package/cjs/composite/composite-renderer.d.ts +53 -53
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/composite/composite-typeahead.d.ts +0 -4
- package/cjs/composite/composite.cjs +3 -3
- package/cjs/dialog/dialog-backdrop.cjs +7 -7
- package/cjs/dialog/dialog-disclosure.cjs +6 -6
- package/cjs/dialog/dialog-dismiss.cjs +5 -5
- package/cjs/dialog/dialog-provider.cjs +4 -4
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/dialog/dialog.cjs +16 -13
- package/cjs/dialog/dialog.d.ts +83 -14
- package/cjs/dialog/utils/disable-accessibility-tree-outside.cjs +3 -3
- package/cjs/dialog/utils/disable-accessibility-tree-outside.d.ts +1 -1
- package/cjs/dialog/utils/disable-tree.cjs +14 -0
- package/cjs/dialog/utils/disable-tree.d.ts +5 -0
- package/cjs/dialog/utils/mark-tree-outside.cjs +3 -3
- package/cjs/dialog/utils/mark-tree-outside.d.ts +1 -1
- package/cjs/dialog/utils/use-hide-on-interact-outside.cjs +4 -4
- package/cjs/dialog/utils/use-nested-dialogs.cjs +2 -2
- package/cjs/dialog/utils/walk-tree-outside.cjs +5 -2
- package/cjs/dialog/utils/walk-tree-outside.d.ts +3 -2
- package/cjs/disclosure/disclosure-content.cjs +3 -2
- package/cjs/disclosure/disclosure-content.d.ts +14 -0
- package/cjs/disclosure/disclosure-provider.cjs +3 -3
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/disclosure/disclosure.cjs +5 -5
- package/cjs/focusable/focusable.cjs +2 -2
- package/cjs/focusable/focusable.d.ts +2 -0
- package/cjs/form/form-checkbox.cjs +7 -7
- package/cjs/form/form-input.cjs +2 -2
- package/cjs/form/form-provider.cjs +4 -4
- package/cjs/form/form-push.cjs +4 -4
- package/cjs/form/form-radio.cjs +6 -6
- package/cjs/form/form-remove.cjs +4 -4
- package/cjs/form/form-reset.cjs +4 -4
- package/cjs/form/form-store.cjs +4 -4
- package/cjs/form/form-submit.cjs +4 -4
- package/cjs/hovercard/hovercard-anchor.cjs +3 -3
- package/cjs/hovercard/hovercard-disclosure.cjs +6 -6
- package/cjs/hovercard/hovercard-dismiss.cjs +7 -7
- package/cjs/hovercard/hovercard-provider.cjs +6 -6
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard.cjs +16 -15
- package/cjs/menu/menu-arrow.d.ts +11 -7
- package/cjs/menu/menu-bar-provider.cjs +5 -5
- package/cjs/menu/menu-bar-store.cjs +5 -5
- package/cjs/menu/menu-bar.cjs +3 -3
- package/cjs/menu/menu-bar.d.ts +23 -22
- package/cjs/menu/menu-button-arrow.d.ts +16 -11
- package/cjs/menu/menu-button.cjs +11 -11
- package/cjs/menu/menu-button.d.ts +19 -11
- package/cjs/menu/menu-description.d.ts +13 -8
- package/cjs/menu/menu-dismiss.cjs +7 -7
- package/cjs/menu/menu-dismiss.d.ts +10 -6
- package/cjs/menu/menu-group-label.d.ts +15 -10
- package/cjs/menu/menu-group.d.ts +15 -10
- package/cjs/menu/menu-heading.d.ts +10 -6
- package/cjs/menu/menu-item-check.d.ts +15 -15
- package/cjs/menu/menu-item-checkbox.cjs +10 -10
- package/cjs/menu/menu-item-checkbox.d.ts +13 -8
- package/cjs/menu/menu-item-radio.cjs +8 -8
- package/cjs/menu/menu-item-radio.d.ts +18 -13
- package/cjs/menu/menu-item.cjs +6 -6
- package/cjs/menu/menu-item.d.ts +16 -9
- package/cjs/menu/menu-list.cjs +6 -6
- package/cjs/menu/menu-list.d.ts +12 -7
- package/cjs/menu/menu-provider.cjs +9 -9
- package/cjs/menu/menu-separator.d.ts +14 -10
- package/cjs/menu/menu-store.cjs +9 -9
- package/cjs/menu/menu-store.d.ts +9 -9
- package/cjs/menu/menu.cjs +46 -52
- package/cjs/menu/menu.d.ts +9 -8
- package/cjs/popover/popover-anchor.d.ts +9 -4
- package/cjs/popover/popover-arrow.d.ts +14 -8
- package/cjs/popover/popover-description.d.ts +13 -8
- package/cjs/popover/popover-disclosure-arrow.d.ts +18 -10
- package/cjs/popover/popover-disclosure.cjs +7 -7
- package/cjs/popover/popover-disclosure.d.ts +4 -3
- package/cjs/popover/popover-dismiss.cjs +6 -6
- package/cjs/popover/popover-dismiss.d.ts +13 -7
- package/cjs/popover/popover-heading.d.ts +14 -8
- package/cjs/popover/popover-provider.cjs +5 -5
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover.cjs +15 -14
- package/cjs/popover/popover.d.ts +13 -9
- package/cjs/portal/portal.d.ts +17 -6
- package/cjs/radio/radio-group.cjs +3 -3
- package/cjs/radio/radio-group.d.ts +5 -1
- package/cjs/radio/radio-provider.cjs +5 -5
- package/cjs/radio/radio-store.cjs +5 -5
- package/cjs/radio/radio-store.d.ts +0 -5
- package/cjs/radio/radio.cjs +6 -6
- package/cjs/radio/radio.d.ts +6 -2
- package/cjs/select/select-arrow.d.ts +18 -13
- package/cjs/select/select-group-label.d.ts +22 -17
- package/cjs/select/select-group.d.ts +17 -12
- package/cjs/select/select-item-check.d.ts +23 -17
- package/cjs/select/select-item.cjs +5 -5
- package/cjs/select/select-item.d.ts +51 -24
- package/cjs/select/select-label.d.ts +18 -14
- package/cjs/select/select-list.cjs +6 -5
- package/cjs/select/select-list.d.ts +26 -16
- package/cjs/select/select-popover.cjs +27 -21
- package/cjs/select/select-popover.d.ts +11 -10
- package/cjs/select/select-provider.cjs +8 -8
- package/cjs/select/select-renderer.cjs +7 -7
- package/cjs/select/select-row.d.ts +20 -15
- package/cjs/select/select-separator.d.ts +16 -11
- package/cjs/select/select-store.cjs +8 -8
- package/cjs/select/select-store.d.ts +0 -4
- package/cjs/select/select.cjs +7 -7
- package/cjs/select/select.d.ts +39 -17
- package/cjs/tab/tab-list.cjs +3 -3
- package/cjs/tab/tab-list.d.ts +14 -9
- package/cjs/tab/tab-panel.cjs +7 -7
- package/cjs/tab/tab-panel.d.ts +15 -10
- package/cjs/tab/tab-provider.cjs +5 -5
- package/cjs/tab/tab-store.cjs +5 -5
- package/cjs/tab/tab-store.d.ts +0 -7
- package/cjs/tab/tab.cjs +5 -5
- package/cjs/tab/tab.d.ts +13 -10
- package/cjs/toolbar/toolbar-container.cjs +8 -8
- package/cjs/toolbar/toolbar-container.d.ts +3 -4
- package/cjs/toolbar/toolbar-input.cjs +6 -6
- package/cjs/toolbar/toolbar-input.d.ts +3 -4
- package/cjs/toolbar/toolbar-item.cjs +6 -6
- package/cjs/toolbar/toolbar-item.d.ts +7 -5
- package/cjs/toolbar/toolbar-provider.cjs +5 -5
- package/cjs/toolbar/toolbar-separator.d.ts +7 -5
- package/cjs/toolbar/toolbar-store.cjs +5 -5
- package/cjs/toolbar/toolbar.cjs +8 -8
- package/cjs/toolbar/toolbar.d.ts +8 -3
- package/cjs/tooltip/tooltip-anchor.cjs +3 -3
- package/cjs/tooltip/tooltip-anchor.d.ts +13 -8
- package/cjs/tooltip/tooltip-arrow.d.ts +16 -10
- package/cjs/tooltip/tooltip-provider.cjs +7 -7
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/tooltip/tooltip.cjs +25 -19
- package/cjs/tooltip/tooltip.d.ts +10 -5
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/store.cjs +2 -2
- package/cjs/utils/system.d.ts +2 -2
- package/dialog/utils/disable-tree/package.json +8 -0
- package/esm/__chunks/{VDTDCNMP.js → 2BTPJSKW.js} +3 -3
- package/esm/__chunks/{3HFOFZP4.js → 2FIUKXIM.js} +1 -1
- package/esm/__chunks/{KZMKUBQH.js → 2Q7ASGJM.js} +1 -1
- package/esm/__chunks/{QJMIKN5O.js → 3FLPLDNL.js} +2 -2
- package/esm/__chunks/{HMYMEP6U.js → 3KBWC7LF.js} +1 -1
- package/esm/__chunks/{4SB2BYFE.js → 3X3TLUHU.js} +4 -3
- package/esm/__chunks/{HYNMOU7J.js → 56TAEBRJ.js} +1 -1
- package/esm/__chunks/{TQ2YQL6O.js → 5EAW3TWZ.js} +11 -1
- package/esm/__chunks/{V5EW3YHP.js → 6F7MKZK2.js} +3 -3
- package/esm/__chunks/{UQFOL5I6.js → 6W46XYWY.js} +2 -2
- package/esm/__chunks/{HAVCR65N.js → 7LB47D2O.js} +1 -1
- package/esm/__chunks/{X5VV5CBA.js → 7VWXICM7.js} +3 -3
- package/esm/__chunks/{VPTWELSR.js → AE5ABTKC.js} +2 -2
- package/esm/__chunks/{LND6SMHN.js → CAIAWNDV.js} +2 -1
- package/esm/__chunks/{C5JX5C3O.js → DCODCZJS.js} +3 -3
- package/esm/__chunks/{R4FKKQYI.js → DE62M4L2.js} +2 -2
- package/esm/__chunks/{IFNQMENS.js → DLZTS5NV.js} +3 -3
- package/esm/__chunks/{D5TF3EQR.js → E3ZC4HKO.js} +2 -2
- package/esm/__chunks/{XASENZA4.js → EGOOWJGN.js} +16 -15
- package/esm/__chunks/{34JEM52B.js → F7UYWUBJ.js} +34 -34
- package/esm/__chunks/{KGDYSCOM.js → FRKOFFMT.js} +6 -11
- package/esm/__chunks/{GP4UGJIZ.js → H3CXUGYG.js} +9 -5
- package/esm/__chunks/{4WK6LN27.js → HUAF5DID.js} +2 -2
- package/esm/__chunks/{PLOINBVB.js → HWJ7DGMR.js} +0 -7
- package/esm/__chunks/{MXSIXS3C.js → HXYXHHNW.js} +1 -1
- package/esm/__chunks/{FBTQUSIH.js → I6Y4PDFW.js} +2 -2
- package/esm/__chunks/{K6BB6DTS.js → IADMQBOS.js} +2 -2
- package/esm/__chunks/{72OJKUSZ.js → IQXVWBXC.js} +2 -2
- package/esm/__chunks/{UY3UQ4QI.js → IZFXPXHG.js} +2 -2
- package/esm/__chunks/{HGW6FZYU.js → J2AZPLFF.js} +2 -2
- package/esm/__chunks/{EKIHOHWR.js → JRZOTPWS.js} +2 -2
- package/esm/__chunks/{3D7ZB3CS.js → KK6NPMOP.js} +18 -1
- package/esm/__chunks/{54DCICBS.js → KXTLHNBI.js} +1 -1
- package/esm/__chunks/{RJEKIG5Y.js → LBTB6WEV.js} +1 -1
- package/esm/__chunks/{HZPJPDJY.js → LFLKMTFW.js} +2 -2
- package/esm/__chunks/{7AFOF5E7.js → LRDCOOWL.js} +1 -1
- package/esm/__chunks/{W575AF63.js → NXB7YL3C.js} +3 -3
- package/esm/__chunks/{35WVCYXU.js → OAQFZVKH.js} +2 -2
- package/esm/__chunks/{A2ONBKVT.js → OD3JT64N.js} +1 -1
- package/esm/__chunks/{AYWP3ZW6.js → OQUFN5QO.js} +1 -1
- package/esm/__chunks/{H2BG4QDT.js → QTZ67ALK.js} +2 -2
- package/esm/__chunks/{QPWEKAWF.js → TONP6TZ5.js} +1 -1
- package/esm/__chunks/{4RP654JS.js → UXIMR4AS.js} +100 -51
- package/esm/__chunks/VRCYQ6JX.js +79 -0
- package/esm/__chunks/{XXO3VVQU.js → WHAB4XD6.js} +3 -35
- package/esm/__chunks/{4JNX5L5C.js → WNHMGHG5.js} +1 -1
- package/esm/__chunks/{WGAKICTY.js → WRZGD4DH.js} +2 -2
- package/esm/__chunks/{NWDF5QDV.js → YS46MLTR.js} +1 -1
- package/esm/__chunks/{IZ6ZARCP.js → ZYB5SMUW.js} +1 -1
- package/esm/button/button.js +3 -3
- package/esm/checkbox/checkbox-provider.js +2 -2
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/checkbox/checkbox.js +4 -4
- package/esm/collection/collection-provider.js +2 -2
- package/esm/collection/collection-renderer.d.ts +53 -53
- package/esm/collection/collection-renderer.js +2 -2
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-cancel.js +3 -3
- package/esm/combobox/combobox-disclosure.js +5 -5
- package/esm/combobox/combobox-item.js +4 -4
- package/esm/combobox/combobox-list.js +4 -3
- package/esm/combobox/combobox-popover.js +22 -18
- package/esm/combobox/combobox-provider.js +7 -7
- package/esm/combobox/combobox-store.js +7 -7
- package/esm/combobox/combobox.js +6 -4
- package/esm/command/command.js +2 -2
- package/esm/composite/composite-container.js +2 -2
- package/esm/composite/composite-item.js +4 -4
- package/esm/composite/composite-overflow-disclosure.js +8 -8
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-overflow.js +14 -13
- package/esm/composite/composite-provider.js +3 -3
- package/esm/composite/composite-renderer.d.ts +53 -53
- package/esm/composite/composite-renderer.js +3 -3
- package/esm/composite/composite-store.js +3 -3
- package/esm/composite/composite-typeahead.d.ts +0 -4
- package/esm/composite/composite.js +2 -2
- package/esm/dialog/dialog-backdrop.js +6 -6
- package/esm/dialog/dialog-disclosure.js +5 -5
- package/esm/dialog/dialog-dismiss.js +4 -4
- package/esm/dialog/dialog-provider.js +3 -3
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/dialog/dialog.d.ts +83 -14
- package/esm/dialog/dialog.js +15 -12
- package/esm/dialog/utils/disable-accessibility-tree-outside.d.ts +1 -1
- package/esm/dialog/utils/disable-accessibility-tree-outside.js +2 -2
- package/esm/dialog/utils/disable-tree.d.ts +5 -0
- package/esm/dialog/utils/{disable-tree-outside.js → disable-tree.js} +5 -3
- package/esm/dialog/utils/mark-tree-outside.d.ts +1 -1
- package/esm/dialog/utils/mark-tree-outside.js +2 -2
- package/esm/dialog/utils/use-hide-on-interact-outside.js +3 -3
- package/esm/dialog/utils/use-nested-dialogs.js +1 -1
- package/esm/dialog/utils/walk-tree-outside.d.ts +3 -2
- package/esm/dialog/utils/walk-tree-outside.js +4 -1
- package/esm/disclosure/disclosure-content.d.ts +14 -0
- package/esm/disclosure/disclosure-content.js +2 -1
- package/esm/disclosure/disclosure-provider.js +2 -2
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/disclosure/disclosure.js +4 -4
- package/esm/focusable/focusable.d.ts +2 -0
- package/esm/focusable/focusable.js +1 -1
- package/esm/form/form-checkbox.js +5 -5
- package/esm/form/form-input.js +1 -1
- package/esm/form/form-provider.js +3 -3
- package/esm/form/form-push.js +3 -3
- package/esm/form/form-radio.js +5 -5
- package/esm/form/form-remove.js +3 -3
- package/esm/form/form-reset.js +3 -3
- package/esm/form/form-store.js +3 -3
- package/esm/form/form-submit.js +3 -3
- package/esm/hovercard/hovercard-anchor.js +2 -2
- package/esm/hovercard/hovercard-disclosure.js +5 -5
- package/esm/hovercard/hovercard-dismiss.js +6 -6
- package/esm/hovercard/hovercard-provider.js +5 -5
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/hovercard/hovercard.js +15 -14
- package/esm/menu/menu-arrow.d.ts +11 -7
- package/esm/menu/menu-bar-provider.js +4 -4
- package/esm/menu/menu-bar-store.js +4 -4
- package/esm/menu/menu-bar.d.ts +23 -22
- package/esm/menu/menu-bar.js +2 -2
- package/esm/menu/menu-button-arrow.d.ts +16 -11
- package/esm/menu/menu-button.d.ts +19 -11
- package/esm/menu/menu-button.js +8 -8
- package/esm/menu/menu-description.d.ts +13 -8
- package/esm/menu/menu-dismiss.d.ts +10 -6
- package/esm/menu/menu-dismiss.js +6 -6
- package/esm/menu/menu-group-label.d.ts +15 -10
- package/esm/menu/menu-group.d.ts +15 -10
- package/esm/menu/menu-heading.d.ts +10 -6
- package/esm/menu/menu-item-check.d.ts +15 -15
- package/esm/menu/menu-item-checkbox.d.ts +13 -8
- package/esm/menu/menu-item-checkbox.js +7 -7
- package/esm/menu/menu-item-radio.d.ts +18 -13
- package/esm/menu/menu-item-radio.js +6 -6
- package/esm/menu/menu-item.d.ts +16 -9
- package/esm/menu/menu-item.js +5 -5
- package/esm/menu/menu-list.d.ts +12 -7
- package/esm/menu/menu-list.js +5 -5
- package/esm/menu/menu-provider.js +8 -8
- package/esm/menu/menu-separator.d.ts +14 -10
- package/esm/menu/menu-store.d.ts +9 -9
- package/esm/menu/menu-store.js +8 -8
- package/esm/menu/menu.d.ts +9 -8
- package/esm/menu/menu.js +45 -51
- package/esm/popover/popover-anchor.d.ts +9 -4
- package/esm/popover/popover-arrow.d.ts +14 -8
- package/esm/popover/popover-description.d.ts +13 -8
- package/esm/popover/popover-disclosure-arrow.d.ts +18 -10
- package/esm/popover/popover-disclosure.d.ts +4 -3
- package/esm/popover/popover-disclosure.js +6 -6
- package/esm/popover/popover-dismiss.d.ts +13 -7
- package/esm/popover/popover-dismiss.js +5 -5
- package/esm/popover/popover-heading.d.ts +14 -8
- package/esm/popover/popover-provider.js +4 -4
- package/esm/popover/popover-store.js +4 -4
- package/esm/popover/popover.d.ts +13 -9
- package/esm/popover/popover.js +14 -13
- package/esm/portal/portal.d.ts +17 -6
- package/esm/radio/radio-group.d.ts +5 -1
- package/esm/radio/radio-group.js +2 -2
- package/esm/radio/radio-provider.js +4 -4
- package/esm/radio/radio-store.d.ts +0 -5
- package/esm/radio/radio-store.js +4 -4
- package/esm/radio/radio.d.ts +6 -2
- package/esm/radio/radio.js +5 -5
- package/esm/select/select-arrow.d.ts +18 -13
- package/esm/select/select-group-label.d.ts +22 -17
- package/esm/select/select-group.d.ts +17 -12
- package/esm/select/select-item-check.d.ts +23 -17
- package/esm/select/select-item.d.ts +51 -24
- package/esm/select/select-item.js +4 -4
- package/esm/select/select-label.d.ts +18 -14
- package/esm/select/select-list.d.ts +26 -16
- package/esm/select/select-list.js +5 -4
- package/esm/select/select-popover.d.ts +11 -10
- package/esm/select/select-popover.js +25 -19
- package/esm/select/select-provider.js +7 -7
- package/esm/select/select-renderer.js +3 -3
- package/esm/select/select-row.d.ts +20 -15
- package/esm/select/select-separator.d.ts +16 -11
- package/esm/select/select-store.d.ts +0 -4
- package/esm/select/select-store.js +7 -7
- package/esm/select/select.d.ts +39 -17
- package/esm/select/select.js +6 -6
- package/esm/tab/tab-list.d.ts +14 -9
- package/esm/tab/tab-list.js +2 -2
- package/esm/tab/tab-panel.d.ts +15 -10
- package/esm/tab/tab-panel.js +4 -4
- package/esm/tab/tab-provider.js +4 -4
- package/esm/tab/tab-store.d.ts +0 -7
- package/esm/tab/tab-store.js +4 -4
- package/esm/tab/tab.d.ts +13 -10
- package/esm/tab/tab.js +4 -4
- package/esm/toolbar/toolbar-container.d.ts +3 -4
- package/esm/toolbar/toolbar-container.js +6 -6
- package/esm/toolbar/toolbar-input.d.ts +3 -4
- package/esm/toolbar/toolbar-input.js +5 -5
- package/esm/toolbar/toolbar-item.d.ts +7 -5
- package/esm/toolbar/toolbar-item.js +5 -5
- package/esm/toolbar/toolbar-provider.js +4 -4
- package/esm/toolbar/toolbar-separator.d.ts +7 -5
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/toolbar/toolbar.d.ts +8 -3
- package/esm/toolbar/toolbar.js +6 -6
- package/esm/tooltip/tooltip-anchor.d.ts +13 -8
- package/esm/tooltip/tooltip-anchor.js +2 -2
- package/esm/tooltip/tooltip-arrow.d.ts +16 -10
- package/esm/tooltip/tooltip-provider.js +6 -6
- package/esm/tooltip/tooltip-store.js +6 -6
- package/esm/tooltip/tooltip.d.ts +10 -5
- package/esm/tooltip/tooltip.js +24 -18
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/store.js +1 -1
- package/esm/utils/system.d.ts +2 -2
- package/package.json +5 -5
- package/cjs/__chunks/PD5YFDLO.cjs +0 -41
- package/cjs/dialog/utils/disable-tree-outside.cjs +0 -12
- package/cjs/dialog/utils/disable-tree-outside.d.ts +0 -3
- package/dialog/utils/disable-tree-outside/package.json +0 -8
- package/esm/__chunks/5M4ITSXL.js +0 -41
- package/esm/dialog/utils/disable-tree-outside.d.ts +0 -3
- package/cjs/__chunks/{BFLDQF3L.cjs → GQAB4M3B.cjs} +3 -3
- package/esm/__chunks/{M4OAD5XF.js → YTHH33BK.js} +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCommand
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./CAIAWNDV.js";
|
|
4
4
|
import {
|
|
5
5
|
useCollectionItem
|
|
6
6
|
} from "./XIA3HAXM.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./CFEUKV6C.js";
|
|
22
22
|
import {
|
|
23
23
|
useStoreState
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./WHAB4XD6.js";
|
|
25
25
|
import {
|
|
26
26
|
useBooleanEvent,
|
|
27
27
|
useEvent,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./M5KYRTQG.js";
|
|
7
7
|
import {
|
|
8
8
|
useCommand
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./CAIAWNDV.js";
|
|
10
10
|
import {
|
|
11
11
|
createComponent,
|
|
12
12
|
createElement,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./CFEUKV6C.js";
|
|
15
15
|
import {
|
|
16
16
|
useStoreState
|
|
17
|
-
} from "./
|
|
17
|
+
} from "./WHAB4XD6.js";
|
|
18
18
|
import {
|
|
19
19
|
useEvent,
|
|
20
20
|
useMergeRefs,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./XCH4OEEE.js";
|
|
11
11
|
import {
|
|
12
12
|
useCompositeItem
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./IQXVWBXC.js";
|
|
14
14
|
import {
|
|
15
15
|
createElement,
|
|
16
16
|
createHook,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./CFEUKV6C.js";
|
|
19
19
|
import {
|
|
20
20
|
useStoreState
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./WHAB4XD6.js";
|
|
22
22
|
import {
|
|
23
23
|
useBooleanEvent,
|
|
24
24
|
useEvent
|
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
createElement,
|
|
10
10
|
createHook
|
|
11
11
|
} from "./CFEUKV6C.js";
|
|
12
|
+
import {
|
|
13
|
+
useStoreState
|
|
14
|
+
} from "./WHAB4XD6.js";
|
|
12
15
|
import {
|
|
13
16
|
useId,
|
|
14
17
|
useMergeRefs,
|
|
@@ -121,12 +124,26 @@ var useDisclosureContent = createHook(
|
|
|
121
124
|
return props;
|
|
122
125
|
}
|
|
123
126
|
);
|
|
124
|
-
var
|
|
127
|
+
var DisclosureContentImpl = createComponent(
|
|
125
128
|
(props) => {
|
|
126
129
|
const htmlProps = useDisclosureContent(props);
|
|
127
130
|
return createElement("div", htmlProps);
|
|
128
131
|
}
|
|
129
132
|
);
|
|
133
|
+
var DisclosureContent = createComponent(
|
|
134
|
+
(_a) => {
|
|
135
|
+
var _b = _a, { unmountOnHide } = _b, props = __objRest(_b, ["unmountOnHide"]);
|
|
136
|
+
const context = useDisclosureProviderContext();
|
|
137
|
+
const store = props.store || context;
|
|
138
|
+
const mounted = useStoreState(
|
|
139
|
+
store,
|
|
140
|
+
(state) => !unmountOnHide || (state == null ? void 0 : state.mounted)
|
|
141
|
+
);
|
|
142
|
+
if (mounted === false)
|
|
143
|
+
return null;
|
|
144
|
+
return /* @__PURE__ */ jsx(DisclosureContentImpl, __spreadValues({}, props));
|
|
145
|
+
}
|
|
146
|
+
);
|
|
130
147
|
if (process.env.NODE_ENV !== "production") {
|
|
131
148
|
DisclosureContent.displayName = "DisclosureContent";
|
|
132
149
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useHovercardStoreProps
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./6W46XYWY.js";
|
|
4
4
|
import {
|
|
5
5
|
useStore,
|
|
6
6
|
useStoreProps
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./WHAB4XD6.js";
|
|
8
8
|
|
|
9
9
|
// src/tooltip/tooltip-store.ts
|
|
10
10
|
import * as Core from "@ariakit/core/tooltip/tooltip-store";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
markAncestor
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./FRKOFFMT.js";
|
|
4
4
|
import {
|
|
5
5
|
Role
|
|
6
6
|
} from "./PGK6S5NC.js";
|
|
7
7
|
import {
|
|
8
8
|
useDisclosureContent
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./KK6NPMOP.js";
|
|
10
10
|
import {
|
|
11
11
|
useDisclosureStore
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./OD3JT64N.js";
|
|
13
13
|
import {
|
|
14
14
|
useMergeRefs,
|
|
15
15
|
useSafeLayoutEffect
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DialogBackdrop
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./NXB7YL3C.js";
|
|
4
4
|
import {
|
|
5
5
|
useNestedDialogs
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./HWJ7DGMR.js";
|
|
7
7
|
import {
|
|
8
8
|
useHideOnInteractOutside
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./7LB47D2O.js";
|
|
10
10
|
import {
|
|
11
11
|
prependHiddenDismiss
|
|
12
12
|
} from "./62DFK33R.js";
|
|
13
13
|
import {
|
|
14
14
|
isElementMarked,
|
|
15
15
|
markTreeOutside
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./FRKOFFMT.js";
|
|
17
17
|
import {
|
|
18
|
+
disableTree,
|
|
18
19
|
disableTreeOutside
|
|
19
|
-
} from "./
|
|
20
|
+
} from "./EGOOWJGN.js";
|
|
20
21
|
import {
|
|
21
22
|
disableAccessibilityTreeOutside
|
|
22
|
-
} from "./
|
|
23
|
+
} from "./7VWXICM7.js";
|
|
24
|
+
import {
|
|
25
|
+
createWalkTreeSnapshot
|
|
26
|
+
} from "./VRCYQ6JX.js";
|
|
23
27
|
import {
|
|
24
28
|
usePreventBodyScroll
|
|
25
29
|
} from "./3LGVTTHD.js";
|
|
@@ -35,7 +39,7 @@ import {
|
|
|
35
39
|
import {
|
|
36
40
|
isHidden,
|
|
37
41
|
useDisclosureContent
|
|
38
|
-
} from "./
|
|
42
|
+
} from "./KK6NPMOP.js";
|
|
39
43
|
import {
|
|
40
44
|
DialogDescriptionContext,
|
|
41
45
|
DialogHeadingContext,
|
|
@@ -44,12 +48,18 @@ import {
|
|
|
44
48
|
} from "./5YYGDU4E.js";
|
|
45
49
|
import {
|
|
46
50
|
useFocusable
|
|
47
|
-
} from "./
|
|
51
|
+
} from "./YTHH33BK.js";
|
|
48
52
|
import {
|
|
49
53
|
createComponent,
|
|
50
54
|
createElement,
|
|
51
55
|
createHook
|
|
52
56
|
} from "./CFEUKV6C.js";
|
|
57
|
+
import {
|
|
58
|
+
useDialogStore
|
|
59
|
+
} from "./IZFXPXHG.js";
|
|
60
|
+
import {
|
|
61
|
+
useStoreState
|
|
62
|
+
} from "./WHAB4XD6.js";
|
|
53
63
|
import {
|
|
54
64
|
useBooleanEvent,
|
|
55
65
|
useEvent,
|
|
@@ -83,7 +93,7 @@ import {
|
|
|
83
93
|
getFirstTabbableIn,
|
|
84
94
|
isFocusable
|
|
85
95
|
} from "@ariakit/core/utils/focus";
|
|
86
|
-
import { chain
|
|
96
|
+
import { chain } from "@ariakit/core/utils/misc";
|
|
87
97
|
import { isSafari } from "@ariakit/core/utils/platform";
|
|
88
98
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
89
99
|
var isSafariBrowser = isSafari();
|
|
@@ -110,7 +120,9 @@ function getElementFromProp(prop, focusable = false) {
|
|
|
110
120
|
var useDialog = createHook(
|
|
111
121
|
(_a) => {
|
|
112
122
|
var _b = _a, {
|
|
113
|
-
store,
|
|
123
|
+
store: storeProp,
|
|
124
|
+
open: openProp,
|
|
125
|
+
onClose,
|
|
114
126
|
focusable = true,
|
|
115
127
|
modal = true,
|
|
116
128
|
portal = !!modal,
|
|
@@ -123,9 +135,12 @@ var useDialog = createHook(
|
|
|
123
135
|
autoFocusOnShow = true,
|
|
124
136
|
autoFocusOnHide = true,
|
|
125
137
|
initialFocus,
|
|
126
|
-
finalFocus
|
|
138
|
+
finalFocus,
|
|
139
|
+
unmountOnHide
|
|
127
140
|
} = _b, props = __objRest(_b, [
|
|
128
141
|
"store",
|
|
142
|
+
"open",
|
|
143
|
+
"onClose",
|
|
129
144
|
"focusable",
|
|
130
145
|
"modal",
|
|
131
146
|
"portal",
|
|
@@ -138,15 +153,30 @@ var useDialog = createHook(
|
|
|
138
153
|
"autoFocusOnShow",
|
|
139
154
|
"autoFocusOnHide",
|
|
140
155
|
"initialFocus",
|
|
141
|
-
"finalFocus"
|
|
156
|
+
"finalFocus",
|
|
157
|
+
"unmountOnHide"
|
|
142
158
|
]);
|
|
143
159
|
const context = useDialogProviderContext();
|
|
144
|
-
store = store || context;
|
|
145
|
-
invariant(
|
|
146
|
-
store,
|
|
147
|
-
process.env.NODE_ENV !== "production" && "Dialog must receive a `store` prop or be wrapped in a DialogProvider component."
|
|
148
|
-
);
|
|
149
160
|
const ref = useRef(null);
|
|
161
|
+
const store = useDialogStore({
|
|
162
|
+
store: storeProp || context,
|
|
163
|
+
open: openProp,
|
|
164
|
+
setOpen(open2) {
|
|
165
|
+
if (open2)
|
|
166
|
+
return;
|
|
167
|
+
const dialog = ref.current;
|
|
168
|
+
if (!dialog)
|
|
169
|
+
return;
|
|
170
|
+
const event = new Event("close", { bubbles: false, cancelable: true });
|
|
171
|
+
if (onClose) {
|
|
172
|
+
dialog.addEventListener("close", onClose, { once: true });
|
|
173
|
+
}
|
|
174
|
+
dialog.dispatchEvent(event);
|
|
175
|
+
if (!event.defaultPrevented)
|
|
176
|
+
return;
|
|
177
|
+
store.setOpen(true);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
150
180
|
const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
|
|
151
181
|
const preserveTabOrderProp = props.preserveTabOrder;
|
|
152
182
|
const preserveTabOrder = store.useState(
|
|
@@ -174,8 +204,6 @@ var useDialog = createHook(
|
|
|
174
204
|
useSafeLayoutEffect(() => {
|
|
175
205
|
if (!open)
|
|
176
206
|
return;
|
|
177
|
-
if (!store)
|
|
178
|
-
return;
|
|
179
207
|
const dialog = ref.current;
|
|
180
208
|
const activeElement = getActiveElement(dialog, true);
|
|
181
209
|
if (!activeElement)
|
|
@@ -188,8 +216,6 @@ var useDialog = createHook(
|
|
|
188
216
|
}, [store, open]);
|
|
189
217
|
if (isSafariBrowser) {
|
|
190
218
|
useEffect(() => {
|
|
191
|
-
if (!store)
|
|
192
|
-
return;
|
|
193
219
|
if (!mounted)
|
|
194
220
|
return;
|
|
195
221
|
const { disclosureElement } = store.getState();
|
|
@@ -224,8 +250,6 @@ var useDialog = createHook(
|
|
|
224
250
|
// disable pointer events because it's just for screen readers.
|
|
225
251
|
portal && preserveTabOrder && isSafari();
|
|
226
252
|
useEffect(() => {
|
|
227
|
-
if (!store)
|
|
228
|
-
return;
|
|
229
253
|
if (!mounted)
|
|
230
254
|
return;
|
|
231
255
|
if (!domReady)
|
|
@@ -240,15 +264,32 @@ var useDialog = createHook(
|
|
|
240
264
|
return;
|
|
241
265
|
return prependHiddenDismiss(dialog, store.hide);
|
|
242
266
|
}, [store, mounted, domReady, shouldDisableAccessibilityTree]);
|
|
243
|
-
const getPersistentElementsProp = useEvent(getPersistentElements);
|
|
244
267
|
useSafeLayoutEffect(() => {
|
|
245
|
-
if (
|
|
268
|
+
if (open)
|
|
269
|
+
return;
|
|
270
|
+
if (!mounted)
|
|
246
271
|
return;
|
|
247
272
|
if (!domReady)
|
|
248
273
|
return;
|
|
274
|
+
const dialog = ref.current;
|
|
275
|
+
if (!dialog)
|
|
276
|
+
return;
|
|
277
|
+
return disableTree(dialog);
|
|
278
|
+
}, [open, mounted, domReady]);
|
|
279
|
+
const canTakeTreeSnapshot = open && domReady;
|
|
280
|
+
useSafeLayoutEffect(() => {
|
|
249
281
|
if (!id)
|
|
250
282
|
return;
|
|
251
|
-
if (!
|
|
283
|
+
if (!canTakeTreeSnapshot)
|
|
284
|
+
return;
|
|
285
|
+
const dialog = ref.current;
|
|
286
|
+
return createWalkTreeSnapshot(id, [dialog]);
|
|
287
|
+
}, [id, canTakeTreeSnapshot]);
|
|
288
|
+
const getPersistentElementsProp = useEvent(getPersistentElements);
|
|
289
|
+
useSafeLayoutEffect(() => {
|
|
290
|
+
if (!id)
|
|
291
|
+
return;
|
|
292
|
+
if (!canTakeTreeSnapshot)
|
|
252
293
|
return;
|
|
253
294
|
const { disclosureElement } = store.getState();
|
|
254
295
|
const dialog = ref.current;
|
|
@@ -259,23 +300,22 @@ var useDialog = createHook(
|
|
|
259
300
|
...nestedDialogs.map((dialog2) => dialog2.getState().contentElement)
|
|
260
301
|
];
|
|
261
302
|
if (!shouldDisableAccessibilityTree) {
|
|
262
|
-
return markTreeOutside(id, disclosureElement, ...allElements);
|
|
303
|
+
return markTreeOutside(id, [disclosureElement, ...allElements]);
|
|
263
304
|
}
|
|
264
305
|
if (modal) {
|
|
265
306
|
return chain(
|
|
266
|
-
markTreeOutside(id,
|
|
267
|
-
disableTreeOutside(
|
|
307
|
+
markTreeOutside(id, allElements),
|
|
308
|
+
disableTreeOutside(id, allElements)
|
|
268
309
|
);
|
|
269
310
|
}
|
|
270
311
|
return chain(
|
|
271
|
-
markTreeOutside(id, disclosureElement, ...allElements),
|
|
272
|
-
disableAccessibilityTreeOutside(
|
|
312
|
+
markTreeOutside(id, [disclosureElement, ...allElements]),
|
|
313
|
+
disableAccessibilityTreeOutside(id, allElements)
|
|
273
314
|
);
|
|
274
315
|
}, [
|
|
275
|
-
store,
|
|
276
|
-
domReady,
|
|
277
316
|
id,
|
|
278
|
-
|
|
317
|
+
store,
|
|
318
|
+
canTakeTreeSnapshot,
|
|
279
319
|
getPersistentElementsProp,
|
|
280
320
|
nestedDialogs,
|
|
281
321
|
shouldDisableAccessibilityTree,
|
|
@@ -336,11 +376,7 @@ var useDialog = createHook(
|
|
|
336
376
|
}, [open]);
|
|
337
377
|
const focusOnHide = useCallback(
|
|
338
378
|
(dialog, retry = true) => {
|
|
339
|
-
|
|
340
|
-
return;
|
|
341
|
-
const { open: open2, disclosureElement } = store.getState();
|
|
342
|
-
if (open2)
|
|
343
|
-
return;
|
|
379
|
+
const { disclosureElement } = store.getState();
|
|
344
380
|
if (isAlreadyFocusingAnotherElement(dialog))
|
|
345
381
|
return;
|
|
346
382
|
let element = getElementFromProp(finalFocus) || disclosureElement;
|
|
@@ -385,7 +421,7 @@ var useDialog = createHook(
|
|
|
385
421
|
return;
|
|
386
422
|
const dialog = ref.current;
|
|
387
423
|
focusOnHide(dialog);
|
|
388
|
-
}, [open, hasOpened, mayAutoFocusOnHide, focusOnHide]);
|
|
424
|
+
}, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]);
|
|
389
425
|
useEffect(() => {
|
|
390
426
|
if (!hasOpened)
|
|
391
427
|
return;
|
|
@@ -405,8 +441,6 @@ var useDialog = createHook(
|
|
|
405
441
|
return;
|
|
406
442
|
if (event.defaultPrevented)
|
|
407
443
|
return;
|
|
408
|
-
if (!store)
|
|
409
|
-
return;
|
|
410
444
|
const dialog = ref.current;
|
|
411
445
|
if (!dialog)
|
|
412
446
|
return;
|
|
@@ -422,7 +456,7 @@ var useDialog = createHook(
|
|
|
422
456
|
if (contains(dialog, target))
|
|
423
457
|
return true;
|
|
424
458
|
if (!disclosureElement)
|
|
425
|
-
return
|
|
459
|
+
return true;
|
|
426
460
|
if (contains(disclosureElement, target))
|
|
427
461
|
return true;
|
|
428
462
|
return false;
|
|
@@ -433,8 +467,8 @@ var useDialog = createHook(
|
|
|
433
467
|
return;
|
|
434
468
|
store.hide();
|
|
435
469
|
};
|
|
436
|
-
return addGlobalEventListener("keydown", onKeyDown);
|
|
437
|
-
}, [store,
|
|
470
|
+
return addGlobalEventListener("keydown", onKeyDown, true);
|
|
471
|
+
}, [store, domReady, mounted, hideOnEscapeProp]);
|
|
438
472
|
props = useWrapElement(
|
|
439
473
|
props,
|
|
440
474
|
(element) => /* @__PURE__ */ jsx(HeadingLevel, { level: modal ? 1 : void 0, children: element }),
|
|
@@ -445,8 +479,6 @@ var useDialog = createHook(
|
|
|
445
479
|
props = useWrapElement(
|
|
446
480
|
props,
|
|
447
481
|
(element) => {
|
|
448
|
-
if (!store)
|
|
449
|
-
return element;
|
|
450
482
|
if (!backdrop)
|
|
451
483
|
return element;
|
|
452
484
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -491,15 +523,32 @@ var useDialog = createHook(
|
|
|
491
523
|
return props;
|
|
492
524
|
}
|
|
493
525
|
);
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
526
|
+
function createDialogComponent(Component, useProviderContext = useDialogProviderContext) {
|
|
527
|
+
return createComponent((props) => {
|
|
528
|
+
const context = useProviderContext();
|
|
529
|
+
const store = props.store || context;
|
|
530
|
+
const mounted = useStoreState(
|
|
531
|
+
store,
|
|
532
|
+
(state) => !props.unmountOnHide || (state == null ? void 0 : state.mounted) || !!props.open
|
|
533
|
+
);
|
|
534
|
+
if (!mounted)
|
|
535
|
+
return null;
|
|
536
|
+
return /* @__PURE__ */ jsx(Component, __spreadValues({}, props));
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
var Dialog = createDialogComponent(
|
|
540
|
+
createComponent((props) => {
|
|
541
|
+
const htmlProps = useDialog(props);
|
|
542
|
+
return createElement("div", htmlProps);
|
|
543
|
+
}),
|
|
544
|
+
useDialogProviderContext
|
|
545
|
+
);
|
|
498
546
|
if (process.env.NODE_ENV !== "production") {
|
|
499
547
|
Dialog.displayName = "Dialog";
|
|
500
548
|
}
|
|
501
549
|
|
|
502
550
|
export {
|
|
503
551
|
useDialog,
|
|
552
|
+
createDialogComponent,
|
|
504
553
|
Dialog
|
|
505
554
|
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setProperty
|
|
3
|
+
} from "./FW6QFGFT.js";
|
|
4
|
+
|
|
5
|
+
// src/dialog/utils/walk-tree-outside.ts
|
|
6
|
+
import { contains, getDocument } from "@ariakit/core/utils/dom";
|
|
7
|
+
import { chain } from "@ariakit/core/utils/misc";
|
|
8
|
+
var ignoreTags = ["SCRIPT", "STYLE"];
|
|
9
|
+
function getSnapshotPropertyName(id) {
|
|
10
|
+
return `__ariakit-dialog-snapshot-${id}`;
|
|
11
|
+
}
|
|
12
|
+
function inSnapshot(id, element) {
|
|
13
|
+
const doc = getDocument(element);
|
|
14
|
+
const propertyName = getSnapshotPropertyName(id);
|
|
15
|
+
if (!doc.body[propertyName])
|
|
16
|
+
return true;
|
|
17
|
+
do {
|
|
18
|
+
if (element === doc.body)
|
|
19
|
+
return false;
|
|
20
|
+
if (!!element[propertyName])
|
|
21
|
+
return true;
|
|
22
|
+
if (!element.parentElement)
|
|
23
|
+
return false;
|
|
24
|
+
element = element.parentElement;
|
|
25
|
+
} while (true);
|
|
26
|
+
}
|
|
27
|
+
function isValidElement(id, element, ignoredElements) {
|
|
28
|
+
if (ignoreTags.includes(element.tagName))
|
|
29
|
+
return false;
|
|
30
|
+
if (!inSnapshot(id, element))
|
|
31
|
+
return false;
|
|
32
|
+
return !ignoredElements.some(
|
|
33
|
+
(enabledElement) => enabledElement && contains(element, enabledElement)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function walkTreeOutside(id, elements, callback, ancestorCallback) {
|
|
37
|
+
for (let element of elements) {
|
|
38
|
+
if (!(element == null ? void 0 : element.isConnected))
|
|
39
|
+
continue;
|
|
40
|
+
const hasAncestorAlready = elements.some((maybeAncestor) => {
|
|
41
|
+
if (!maybeAncestor)
|
|
42
|
+
return false;
|
|
43
|
+
if (maybeAncestor === element)
|
|
44
|
+
return false;
|
|
45
|
+
return maybeAncestor.contains(element);
|
|
46
|
+
});
|
|
47
|
+
const doc = getDocument(element);
|
|
48
|
+
const originalElement = element;
|
|
49
|
+
while (element.parentElement && element !== doc.body) {
|
|
50
|
+
ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement, originalElement);
|
|
51
|
+
if (!hasAncestorAlready) {
|
|
52
|
+
for (const child of element.parentElement.children) {
|
|
53
|
+
if (isValidElement(id, child, elements)) {
|
|
54
|
+
callback(child, originalElement);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
element = element.parentElement;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function createWalkTreeSnapshot(id, elements) {
|
|
63
|
+
const { body } = getDocument(elements[0]);
|
|
64
|
+
const cleanups = [];
|
|
65
|
+
const markElement = (element) => {
|
|
66
|
+
cleanups.push(setProperty(element, getSnapshotPropertyName(id), true));
|
|
67
|
+
};
|
|
68
|
+
walkTreeOutside(id, elements, markElement);
|
|
69
|
+
return chain(
|
|
70
|
+
setProperty(body, getSnapshotPropertyName(id), true),
|
|
71
|
+
() => cleanups.forEach((fn) => fn())
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
isValidElement,
|
|
77
|
+
walkTreeOutside,
|
|
78
|
+
createWalkTreeSnapshot
|
|
79
|
+
};
|