@televet/kibble-ui 4.0.0-beta.65 → 4.0.0-beta.66
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/dist/chunks/{alert.types-Dth5h5qO.js → alert.types-DYf5xFEG.js} +3 -3
- package/dist/chunks/{alert.types-Dth5h5qO.js.map → alert.types-DYf5xFEG.js.map} +1 -1
- package/dist/chunks/{alert.types-BvnpOwve.js → alert.types-DbqCOYr5.js} +2 -2
- package/dist/chunks/{alert.types-BvnpOwve.js.map → alert.types-DbqCOYr5.js.map} +1 -1
- package/dist/chunks/{avatar.component-BPCJZRyT.js → avatar.component-Bk8VVA0l.js} +14 -14
- package/dist/chunks/{avatar.component-BPCJZRyT.js.map → avatar.component-Bk8VVA0l.js.map} +1 -1
- package/dist/chunks/avatar.component-TAfT1LM1.js +2 -0
- package/dist/chunks/{avatar.component-y7gTa1dV.js.map → avatar.component-TAfT1LM1.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-Mfl8jvgp.js → avatarGroup.component-BGF4gl5d.js} +2 -2
- package/dist/chunks/{avatarGroup.component-Mfl8jvgp.js.map → avatarGroup.component-BGF4gl5d.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-BnRXVOIV.js → avatarGroup.component-CZnhQOWy.js} +2 -2
- package/dist/chunks/{avatarGroup.component-BnRXVOIV.js.map → avatarGroup.component-CZnhQOWy.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-6ZBOJbfR.js → buttonGroup.component-CGxtwaQg.js} +2 -2
- package/dist/chunks/{buttonGroup.component-6ZBOJbfR.js.map → buttonGroup.component-CGxtwaQg.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-DQfB4Nj3.js → buttonGroup.component-IGM-yn-V.js} +2 -2
- package/dist/chunks/{buttonGroup.component-DQfB4Nj3.js.map → buttonGroup.component-IGM-yn-V.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-Cs0y0DOj.js → characterCounter.component-CWDjnYNU.js} +3 -3
- package/dist/chunks/{characterCounter.component-Cs0y0DOj.js.map → characterCounter.component-CWDjnYNU.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-4T8NHb11.js → characterCounter.component-WOgGxKRq.js} +2 -2
- package/dist/chunks/{characterCounter.component-4T8NHb11.js.map → characterCounter.component-WOgGxKRq.js.map} +1 -1
- package/dist/chunks/{checkbox.component-DqlWmIyY.js → checkbox.component-B6-MOy86.js} +10 -10
- package/dist/chunks/{checkbox.component-DqlWmIyY.js.map → checkbox.component-B6-MOy86.js.map} +1 -1
- package/dist/chunks/checkbox.component-nkydue0g.js +2 -0
- package/dist/chunks/{checkbox.component-CFuJaYmY.js.map → checkbox.component-nkydue0g.js.map} +1 -1
- package/dist/chunks/{checkbox.records-08YIiUZO.js → checkbox.records-BtLBaHBy.js} +12 -12
- package/dist/chunks/{checkbox.records-08YIiUZO.js.map → checkbox.records-BtLBaHBy.js.map} +1 -1
- package/dist/chunks/checkbox.records-wbkLltak.js +2 -0
- package/dist/chunks/{checkbox.records-B7refmmT.js.map → checkbox.records-wbkLltak.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-DaxmsqdZ.js → checkboxGroup.component-B1HL2vbn.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-DaxmsqdZ.js.map → checkboxGroup.component-B1HL2vbn.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-DBqDJvPC.js → checkboxGroup.component-DCg4fRL0.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-DBqDJvPC.js.map → checkboxGroup.component-DCg4fRL0.js.map} +1 -1
- package/dist/chunks/{config-DlTdf-Yt.js → config-B1FINd7s.js} +3 -3
- package/dist/chunks/{config-DlTdf-Yt.js.map → config-B1FINd7s.js.map} +1 -1
- package/dist/chunks/conversationCard.component-2jO70XtY.js +2 -0
- package/dist/chunks/{conversationCard.component-CBrw3VnT.js.map → conversationCard.component-2jO70XtY.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-Bg1Q9FdN.js → conversationCard.component-Uv0-JSnX.js} +17 -18
- package/dist/chunks/{conversationCard.component-Bg1Q9FdN.js.map → conversationCard.component-Uv0-JSnX.js.map} +1 -1
- package/dist/chunks/datePicker.component-CM8TIMiW.js +15 -0
- package/dist/chunks/{datePicker.component-u52NQcza.js.map → datePicker.component-CM8TIMiW.js.map} +1 -1
- package/dist/chunks/{datePicker.component-DfQNebKg.js → datePicker.component-DeOquWMk.js} +8 -8
- package/dist/chunks/{datePicker.component-DfQNebKg.js.map → datePicker.component-DeOquWMk.js.map} +1 -1
- package/dist/chunks/dialog-trigger-BCeZGpGO.js +2 -0
- package/dist/chunks/{dialog-trigger-B5NK0lr-.js.map → dialog-trigger-BCeZGpGO.js.map} +1 -1
- package/dist/chunks/{dialog-trigger-BPlPzPU-.js → dialog-trigger-D2uDgMJr.js} +9 -9
- package/dist/chunks/{dialog-trigger-BPlPzPU-.js.map → dialog-trigger-D2uDgMJr.js.map} +1 -1
- package/dist/chunks/{heading.component-BXcyhAEU.js → heading.component-Bu1JbEVn.js} +2 -2
- package/dist/chunks/{heading.component-BXcyhAEU.js.map → heading.component-Bu1JbEVn.js.map} +1 -1
- package/dist/chunks/{heading.component-ZD_UVarx.js → heading.component-wD7BkQLG.js} +2 -2
- package/dist/chunks/{heading.component-ZD_UVarx.js.map → heading.component-wD7BkQLG.js.map} +1 -1
- package/dist/chunks/index-5cRW642o.js +2 -0
- package/dist/chunks/{index-Dyxhds_1.js.map → index-5cRW642o.js.map} +1 -1
- package/dist/chunks/index-B4fjIWcA.js +2 -0
- package/dist/chunks/{index-CZz7hHWb.js.map → index-B4fjIWcA.js.map} +1 -1
- package/dist/chunks/index-BfD9Ne2e.js +2 -0
- package/dist/chunks/{index-BYf7SZUC.js.map → index-BfD9Ne2e.js.map} +1 -1
- package/dist/chunks/index-BlGAWSIX.js +3 -0
- package/dist/chunks/index-BlGAWSIX.js.map +1 -0
- package/dist/chunks/index-BmcSWiFh.js +2 -0
- package/dist/chunks/{index-ZaGEDS_0.js.map → index-BmcSWiFh.js.map} +1 -1
- package/dist/chunks/index-C323eOJV.js +1328 -0
- package/dist/chunks/index-C323eOJV.js.map +1 -0
- package/dist/chunks/{index-BNYygzo-.js → index-CBh9RZVL.js} +17 -18
- package/dist/chunks/{index-BNYygzo-.js.map → index-CBh9RZVL.js.map} +1 -1
- package/dist/chunks/index-CEYJbpt4.js +2 -0
- package/dist/chunks/{index-BDnnTdaJ.js.map → index-CEYJbpt4.js.map} +1 -1
- package/dist/chunks/index-CFnNmQf0.js +2 -0
- package/dist/chunks/{index-MlhL0PDC.js.map → index-CFnNmQf0.js.map} +1 -1
- package/dist/chunks/{index-Co91SHhW.js → index-CZPHIn6T.js} +3 -3
- package/dist/chunks/{index-Co91SHhW.js.map → index-CZPHIn6T.js.map} +1 -1
- package/dist/chunks/index-CedYIQt5.js +8 -0
- package/dist/chunks/{index-UWtj4ULm.js.map → index-CedYIQt5.js.map} +1 -1
- package/dist/chunks/{index-CjNAJEk5.js → index-Cqwkg1hU.js} +105 -106
- package/dist/chunks/{index-CjNAJEk5.js.map → index-Cqwkg1hU.js.map} +1 -1
- package/dist/chunks/{index-C2kxTsiE.js → index-Cuu1x05z.js} +16 -17
- package/dist/chunks/{index-C2kxTsiE.js.map → index-Cuu1x05z.js.map} +1 -1
- package/dist/chunks/{index-D9DU-5GF.js → index-D5Dscg8T.js} +48 -49
- package/dist/chunks/{index-D9DU-5GF.js.map → index-D5Dscg8T.js.map} +1 -1
- package/dist/chunks/{index-MDMqrELk.js → index-DMSZTX7A.js} +9 -9
- package/dist/chunks/{index-MDMqrELk.js.map → index-DMSZTX7A.js.map} +1 -1
- package/dist/chunks/{index-BBZxmcrY.js → index-DZGYG5M4.js} +2 -2
- package/dist/chunks/{index-BBZxmcrY.js.map → index-DZGYG5M4.js.map} +1 -1
- package/dist/chunks/{index-S1uNQPZj.js → index-Dq91nN6-.js} +3 -3
- package/dist/chunks/{index-S1uNQPZj.js.map → index-Dq91nN6-.js.map} +1 -1
- package/dist/chunks/{index-DcJZ8q0f.js → index-Dx94WMw1.js} +43 -44
- package/dist/chunks/{index-DcJZ8q0f.js.map → index-Dx94WMw1.js.map} +1 -1
- package/dist/chunks/index-Fztcdoo_.js +2 -0
- package/dist/chunks/index-Fztcdoo_.js.map +1 -0
- package/dist/chunks/index-WyVSig7F.js +70 -0
- package/dist/chunks/index-WyVSig7F.js.map +1 -0
- package/dist/chunks/{index-DUHFrLMI.js → index-f4Ba8Pq7.js} +15 -15
- package/dist/chunks/{index-DUHFrLMI.js.map → index-f4Ba8Pq7.js.map} +1 -1
- package/dist/chunks/index-hGlTuPbK.js +2 -0
- package/dist/chunks/{index-COoMV9Mh.js.map → index-hGlTuPbK.js.map} +1 -1
- package/dist/chunks/{logo.types-By8TqyNf.js → logo.types-CXQsathd.js} +2 -2
- package/dist/chunks/{logo.types-By8TqyNf.js.map → logo.types-CXQsathd.js.map} +1 -1
- package/dist/chunks/{menu.component-D4gknsq1.js → menu.component-BKY1dybr.js} +26 -26
- package/dist/chunks/{menu.component-D4gknsq1.js.map → menu.component-BKY1dybr.js.map} +1 -1
- package/dist/chunks/menu.component-DllVICUa.js +2 -0
- package/dist/chunks/{menu.component-CiZzHc2D.js.map → menu.component-DllVICUa.js.map} +1 -1
- package/dist/chunks/modal.context-DSKLfsJK.js +12 -0
- package/dist/chunks/modal.context-DSKLfsJK.js.map +1 -0
- package/dist/chunks/modal.context-EJ67QNzq.js +2 -0
- package/dist/chunks/modal.context-EJ67QNzq.js.map +1 -0
- package/dist/chunks/modal.types-Bsq-uLZ0.js +2 -0
- package/dist/chunks/{modal.types-9-Bz6ybC.js.map → modal.types-Bsq-uLZ0.js.map} +1 -1
- package/dist/chunks/{modal.types-BV8Eand2.js → modal.types-CRH5aJ0U.js} +5 -5
- package/dist/chunks/{modal.types-BV8Eand2.js.map → modal.types-CRH5aJ0U.js.map} +1 -1
- package/dist/chunks/{notificationCounter.component-Bei8mHSZ.js → notificationCounter.component-DMr4Mlm9.js} +2 -2
- package/dist/chunks/{notificationCounter.component-Bei8mHSZ.js.map → notificationCounter.component-DMr4Mlm9.js.map} +1 -1
- package/dist/chunks/{pinInput.types-U7Tfj5It.js → pinInput.types-B-BknmcG.js} +8 -8
- package/dist/chunks/{pinInput.types-U7Tfj5It.js.map → pinInput.types-B-BknmcG.js.map} +1 -1
- package/dist/chunks/pinInput.types-tJTQQJxe.js +2 -0
- package/dist/chunks/{pinInput.types-B-RchRm_.js.map → pinInput.types-tJTQQJxe.js.map} +1 -1
- package/dist/chunks/{popover-B9rNOU0g.js → popover-D0QoPsrG.js} +26 -26
- package/dist/chunks/{popover-B9rNOU0g.js.map → popover-D0QoPsrG.js.map} +1 -1
- package/dist/chunks/popover-DPEovmxh.js +2 -0
- package/dist/chunks/{popover-80QH8HEJ.js.map → popover-DPEovmxh.js.map} +1 -1
- package/dist/chunks/popover-root-provider-BYJE5I-P.js +2 -0
- package/dist/chunks/{popover-root-provider-DAMDDAHQ.js.map → popover-root-provider-BYJE5I-P.js.map} +1 -1
- package/dist/chunks/{popover-root-provider-CeLLpesI.js → popover-root-provider-Dt02njg5.js} +8 -8
- package/dist/chunks/{popover-root-provider-CeLLpesI.js.map → popover-root-provider-Dt02njg5.js.map} +1 -1
- package/dist/chunks/popover.component-CLMQkEDo.js +2 -0
- package/dist/chunks/popover.component-CLMQkEDo.js.map +1 -0
- package/dist/chunks/popover.component-MbM0Ajnr.js +264 -0
- package/dist/chunks/popover.component-MbM0Ajnr.js.map +1 -0
- package/dist/chunks/popover.recipe-BLsWPsAa.js +124 -0
- package/dist/chunks/popover.recipe-BLsWPsAa.js.map +1 -0
- package/dist/chunks/popover.recipe-av5Jdn1r.js +2 -0
- package/dist/chunks/popover.recipe-av5Jdn1r.js.map +1 -0
- package/dist/chunks/{use-locale-context-D-agiW5E.js → portal-D2KZrSzZ.js} +242 -242
- package/dist/chunks/portal-D2KZrSzZ.js.map +1 -0
- package/dist/chunks/portal-TWtD47zg.js +22 -0
- package/dist/chunks/portal-TWtD47zg.js.map +1 -0
- package/dist/chunks/radio.records-CEgwvLIL.js +2 -0
- package/dist/chunks/{radio.records-DLffZyeq.js.map → radio.records-CEgwvLIL.js.map} +1 -1
- package/dist/chunks/{radio.records-D7VFHW-s.js → radio.records-CzNYznSb.js} +16 -16
- package/dist/chunks/{radio.records-D7VFHW-s.js.map → radio.records-CzNYznSb.js.map} +1 -1
- package/dist/chunks/radioGroup.component-DAGmgDZ2.js +2 -0
- package/dist/chunks/{radioGroup.component-CZwrCppd.js.map → radioGroup.component-DAGmgDZ2.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-DVsMiHFI.js → radioGroup.component-DEPDXEhQ.js} +11 -11
- package/dist/chunks/{radioGroup.component-DVsMiHFI.js.map → radioGroup.component-DEPDXEhQ.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-qbroWQhZ.js → ratingDots.component-BB7vPYdN.js} +2 -2
- package/dist/chunks/{ratingDots.component-qbroWQhZ.js.map → ratingDots.component-BB7vPYdN.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-1U-hoEpC.js → ratingDots.component-C32gNAmO.js} +4 -4
- package/dist/chunks/{ratingDots.component-1U-hoEpC.js.map → ratingDots.component-C32gNAmO.js.map} +1 -1
- package/dist/chunks/render-strategy-CdSSbgPU.js +2 -0
- package/dist/chunks/{render-strategy-BmWbSgqh.js.map → render-strategy-CdSSbgPU.js.map} +1 -1
- package/dist/chunks/{render-strategy-C8hwN3bm.js → render-strategy-ql9Qx5Cz.js} +2 -2
- package/dist/chunks/{render-strategy-C8hwN3bm.js.map → render-strategy-ql9Qx5Cz.js.map} +1 -1
- package/dist/chunks/select.component-BtBJUTF2.js +2 -0
- package/dist/chunks/{select.component-C_Fs6Xeq.js.map → select.component-BtBJUTF2.js.map} +1 -1
- package/dist/chunks/{select.component-5vAzdrZa.js → select.component-DfkLDyYt.js} +44 -44
- package/dist/chunks/{select.component-5vAzdrZa.js.map → select.component-DfkLDyYt.js.map} +1 -1
- package/dist/chunks/{sortableList.component-B_O-YB3I.js → sortableList.component-B0lnVMXW.js} +3 -3
- package/dist/chunks/{sortableList.component-B_O-YB3I.js.map → sortableList.component-B0lnVMXW.js.map} +1 -1
- package/dist/chunks/{sortableList.component-BX3EvpRM.js → sortableList.component-B88NRcwx.js} +3 -3
- package/dist/chunks/{sortableList.component-BX3EvpRM.js.map → sortableList.component-B88NRcwx.js.map} +1 -1
- package/dist/chunks/{spinner.component-CzhcJOwX.js → spinner.component-DVjwuOVs.js} +2 -2
- package/dist/chunks/{spinner.component-CzhcJOwX.js.map → spinner.component-DVjwuOVs.js.map} +1 -1
- package/dist/chunks/{spinner.component-lHj69hIF.js → spinner.component-DWh3YuBJ.js} +3 -3
- package/dist/chunks/{spinner.component-lHj69hIF.js.map → spinner.component-DWh3YuBJ.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-BvHm6hKS.js → styledAvatar.types-ClVT0QDd.js} +2 -2
- package/dist/chunks/{styledAvatar.types-BvHm6hKS.js.map → styledAvatar.types-ClVT0QDd.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-B9SHiNfg.js → styledAvatar.types-DamSY23W.js} +2 -2
- package/dist/chunks/{styledAvatar.types-B9SHiNfg.js.map → styledAvatar.types-DamSY23W.js.map} +1 -1
- package/dist/chunks/{swatch.types-DbgA3RWc.js → swatch.types-B8OSJZ-a.js} +2 -2
- package/dist/chunks/{swatch.types-DbgA3RWc.js.map → swatch.types-B8OSJZ-a.js.map} +1 -1
- package/dist/chunks/{switch.component-DjOGsCIQ.js → switch.component-BEkYEUKY.js} +11 -11
- package/dist/chunks/{switch.component-DjOGsCIQ.js.map → switch.component-BEkYEUKY.js.map} +1 -1
- package/dist/chunks/switch.component-DjbXfvMa.js +2 -0
- package/dist/chunks/{switch.component-B3Gfgft9.js.map → switch.component-DjbXfvMa.js.map} +1 -1
- package/dist/chunks/{tabs.component-Ca9jVGv0.js → tabs.component-Bmg0kB-p.js} +48 -48
- package/dist/chunks/{tabs.component-Ca9jVGv0.js.map → tabs.component-Bmg0kB-p.js.map} +1 -1
- package/dist/chunks/tabs.component-Bn_7bf0X.js +2 -0
- package/dist/chunks/{tabs.component-pl0kO5_M.js.map → tabs.component-Bn_7bf0X.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-CnPbyaGH.js → tagBlock.component-3ypfB6tz.js} +5 -5
- package/dist/chunks/{tagBlock.component-CnPbyaGH.js.map → tagBlock.component-3ypfB6tz.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-C2DAQrQE.js → tagBlock.component-x3oh7uht.js} +2 -2
- package/dist/chunks/{tagBlock.component-C2DAQrQE.js.map → tagBlock.component-x3oh7uht.js.map} +1 -1
- package/dist/chunks/textInput.component-B1--78Mp.js +2 -0
- package/dist/chunks/{textInput.component-D-galjwy.js.map → textInput.component-B1--78Mp.js.map} +1 -1
- package/dist/chunks/{textInput.component-DXtEgbkr.js → textInput.component-D9Dl8cP3.js} +12 -12
- package/dist/chunks/{textInput.component-DXtEgbkr.js.map → textInput.component-D9Dl8cP3.js.map} +1 -1
- package/dist/chunks/textarea.component-BxC5lB4t.js +2 -0
- package/dist/chunks/{textarea.component-DmxMuMCU.js.map → textarea.component-BxC5lB4t.js.map} +1 -1
- package/dist/chunks/{textarea.component-Do0zHf-1.js → textarea.component-DZXDIbZg.js} +7 -7
- package/dist/chunks/{textarea.component-Do0zHf-1.js.map → textarea.component-DZXDIbZg.js.map} +1 -1
- package/dist/chunks/theme.provider-CpxxMiXd.js +26 -0
- package/dist/chunks/theme.provider-CpxxMiXd.js.map +1 -0
- package/dist/chunks/{theme.provider-Dj4pZ815.js → theme.provider-DmGvaymX.js} +1830 -1699
- package/dist/chunks/theme.provider-DmGvaymX.js.map +1 -0
- package/dist/chunks/{timePicker.component-DTs3MjOx.js → timePicker.component-DnFPWIcy.js} +4 -4
- package/dist/chunks/{timePicker.component-DTs3MjOx.js.map → timePicker.component-DnFPWIcy.js.map} +1 -1
- package/dist/chunks/{timePicker.component-CophNE3d.js → timePicker.component-F9o8MNWu.js} +2 -2
- package/dist/chunks/{timePicker.component-CophNE3d.js.map → timePicker.component-F9o8MNWu.js.map} +1 -1
- package/dist/chunks/{timeRange.component-C5dt8sZn.js → timeRange.component-Bh2FiRi8.js} +2 -2
- package/dist/chunks/{timeRange.component-C5dt8sZn.js.map → timeRange.component-Bh2FiRi8.js.map} +1 -1
- package/dist/chunks/{timeRange.component-C5wSyUiZ.js → timeRange.component-Bj-9ynHS.js} +2 -2
- package/dist/chunks/{timeRange.component-C5wSyUiZ.js.map → timeRange.component-Bj-9ynHS.js.map} +1 -1
- package/dist/chunks/timestamp.component-BKr4dkxB.js +53 -0
- package/dist/chunks/{timestamp.component-BPU8bf7p.js.map → timestamp.component-BKr4dkxB.js.map} +1 -1
- package/dist/chunks/timestamp.component-CfjeVkJs.js +2 -0
- package/dist/chunks/{timestamp.component-rTLrzBPA.js.map → timestamp.component-CfjeVkJs.js.map} +1 -1
- package/dist/chunks/toaster.records-CGym-iT-.js +2 -0
- package/dist/chunks/{toaster.records-BJo0j1IZ.js.map → toaster.records-CGym-iT-.js.map} +1 -1
- package/dist/chunks/{toaster.records-BGfpUOVt.js → toaster.records-Cf8bpHo8.js} +21 -22
- package/dist/chunks/{toaster.records-BGfpUOVt.js.map → toaster.records-Cf8bpHo8.js.map} +1 -1
- package/dist/chunks/{typography.records-C6G_65b4.js → typography.records-BeoK0Uyj.js} +2 -2
- package/dist/chunks/{typography.records-C6G_65b4.js.map → typography.records-BeoK0Uyj.js.map} +1 -1
- package/dist/chunks/{typography.records-jnjWfTLS.js → typography.records-Xg59taw9.js} +2 -2
- package/dist/chunks/{typography.records-jnjWfTLS.js.map → typography.records-Xg59taw9.js.map} +1 -1
- package/dist/chunks/{use-field-context-B_G7Yziz.js → use-field-context-C4IwmN39.js} +2 -2
- package/dist/chunks/{use-field-context-B_G7Yziz.js.map → use-field-context-C4IwmN39.js.map} +1 -1
- package/dist/chunks/use-field-context-xBX4EpFz.js +2 -0
- package/dist/chunks/{use-field-context--wBJQY1R.js.map → use-field-context-xBX4EpFz.js.map} +1 -1
- package/dist/chunks/withFormControl-BHjeRAfg.js +2 -0
- package/dist/chunks/{withFormControl-DpytztWF.js.map → withFormControl-BHjeRAfg.js.map} +1 -1
- package/dist/chunks/{withFormControl-BDuV97Vb.js → withFormControl-KA9fAHrR.js} +49 -49
- package/dist/chunks/{withFormControl-BDuV97Vb.js.map → withFormControl-KA9fAHrR.js.map} +1 -1
- package/dist/chunks/withTruncation-CQUQzrTa.js +561 -0
- package/dist/chunks/withTruncation-CQUQzrTa.js.map +1 -0
- package/dist/chunks/withTruncation-DguVvIAI.js +2 -0
- package/dist/chunks/withTruncation-DguVvIAI.js.map +1 -0
- package/dist/chunks/{wrap-B8tBNeBY.js → wrap-CYgSj8wY.js} +2 -2
- package/dist/chunks/{wrap-B8tBNeBY.js.map → wrap-CYgSj8wY.js.map} +1 -1
- package/dist/cjs/chakra/index.cjs +1 -1
- package/dist/cjs/chakra/index.cjs.map +1 -1
- package/dist/cjs/components/Alert/index.cjs +1 -1
- package/dist/cjs/components/Avatar/index.cjs +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/CharacterCounter/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/Heading/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/Modal/index.cjs +1 -1
- package/dist/cjs/components/PinInput/index.cjs +1 -1
- package/dist/cjs/components/Popover/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/RatingDots/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/SortableList/index.cjs +1 -1
- package/dist/cjs/components/Spinner/index.cjs +1 -1
- package/dist/cjs/components/StyledAvatar/index.cjs +1 -1
- package/dist/cjs/components/Switch/index.cjs +1 -1
- package/dist/cjs/components/Tabs/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/Text/index.cjs +1 -1
- package/dist/cjs/components/TextInput/index.cjs +1 -1
- package/dist/cjs/components/Textarea/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/Timestamp/index.cjs +1 -1
- package/dist/cjs/components/Toast/index.cjs +1 -1
- package/dist/cjs/components/Tooltip/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/esm/chakra/index.js +69 -69
- package/dist/esm/components/Alert/index.js +1 -1
- package/dist/esm/components/Avatar/index.js +1 -1
- package/dist/esm/components/AvatarGroup/index.js +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/CharacterCounter/index.js +1 -1
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +1 -1
- package/dist/esm/components/Heading/index.js +1 -1
- package/dist/esm/components/Logo/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/NotificationCounter/index.js +1 -1
- package/dist/esm/components/PinInput/index.js +1 -1
- package/dist/esm/components/Popover/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/RatingDots/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/SortableList/index.js +1 -1
- package/dist/esm/components/Spinner/index.js +1 -1
- package/dist/esm/components/StyledAvatar/index.js +1 -1
- package/dist/esm/components/Swatch/index.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/Text/index.js +1 -1
- package/dist/esm/components/TextInput/index.js +1 -1
- package/dist/esm/components/Textarea/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/Timestamp/index.js +1 -1
- package/dist/esm/components/Toast/index.js +1 -1
- package/dist/esm/components/Tooltip/index.js +1 -1
- package/dist/esm/components/index.js +41 -42
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/index.js +60 -61
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/theme/index.js +1 -1
- package/dist/types/components/Menu/menu.recipe.d.ts +1 -1
- package/dist/types/components/Modal/modal.recipe.d.ts +1 -1
- package/dist/types/components/TimePicker/timePicker.recipe.d.ts +1 -1
- package/dist/types/components/Tooltip/tooltip.component.d.ts +5 -6
- package/dist/types/theme/tokens/shadows/shadows.config.d.ts +3 -3
- package/dist/types/theme/tokens/sizes/sizes.config.d.ts +3 -3
- package/dist/types/theme/tokens/zIndices/zIndices.config.d.ts +10 -10
- package/package.json +1 -1
- package/dist/chunks/avatar.component-y7gTa1dV.js +0 -2
- package/dist/chunks/checkbox.component-CFuJaYmY.js +0 -2
- package/dist/chunks/checkbox.records-B7refmmT.js +0 -2
- package/dist/chunks/conversationCard.component-CBrw3VnT.js +0 -2
- package/dist/chunks/datePicker.component-u52NQcza.js +0 -15
- package/dist/chunks/dialog-trigger-B5NK0lr-.js +0 -2
- package/dist/chunks/index-BDnnTdaJ.js +0 -2
- package/dist/chunks/index-BGwwyukg.js +0 -2
- package/dist/chunks/index-BGwwyukg.js.map +0 -1
- package/dist/chunks/index-BYf7SZUC.js +0 -2
- package/dist/chunks/index-COoMV9Mh.js +0 -2
- package/dist/chunks/index-CYk-7wwG.js +0 -1018
- package/dist/chunks/index-CYk-7wwG.js.map +0 -1
- package/dist/chunks/index-CZ42b9rT.js +0 -3
- package/dist/chunks/index-CZ42b9rT.js.map +0 -1
- package/dist/chunks/index-CZz7hHWb.js +0 -2
- package/dist/chunks/index-Dyxhds_1.js +0 -2
- package/dist/chunks/index-MlhL0PDC.js +0 -2
- package/dist/chunks/index-UWtj4ULm.js +0 -8
- package/dist/chunks/index-ZaGEDS_0.js +0 -2
- package/dist/chunks/index-j7W9Hyzx.js +0 -322
- package/dist/chunks/index-j7W9Hyzx.js.map +0 -1
- package/dist/chunks/menu.component-CiZzHc2D.js +0 -2
- package/dist/chunks/modal.types-9-Bz6ybC.js +0 -2
- package/dist/chunks/pinInput.types-B-RchRm_.js +0 -2
- package/dist/chunks/popover-80QH8HEJ.js +0 -2
- package/dist/chunks/popover-root-provider-DAMDDAHQ.js +0 -2
- package/dist/chunks/popover.component-A8In7d2B.js +0 -2
- package/dist/chunks/popover.component-A8In7d2B.js.map +0 -1
- package/dist/chunks/popover.component-BR8W3Jb8.js +0 -322
- package/dist/chunks/popover.component-BR8W3Jb8.js.map +0 -1
- package/dist/chunks/popover.recipe--gMRcQTS.js +0 -479
- package/dist/chunks/popover.recipe--gMRcQTS.js.map +0 -1
- package/dist/chunks/popover.recipe-DLeyokHo.js +0 -2
- package/dist/chunks/popover.recipe-DLeyokHo.js.map +0 -1
- package/dist/chunks/radio.records-DLffZyeq.js +0 -2
- package/dist/chunks/radioGroup.component-CZwrCppd.js +0 -2
- package/dist/chunks/render-strategy-BmWbSgqh.js +0 -2
- package/dist/chunks/select.component-C_Fs6Xeq.js +0 -2
- package/dist/chunks/switch.component-B3Gfgft9.js +0 -2
- package/dist/chunks/tabs.component-pl0kO5_M.js +0 -2
- package/dist/chunks/text.component-CnnBhB3c.js +0 -2
- package/dist/chunks/text.component-CnnBhB3c.js.map +0 -1
- package/dist/chunks/text.component-Cpruo7MB.js +0 -12
- package/dist/chunks/text.component-Cpruo7MB.js.map +0 -1
- package/dist/chunks/textInput.component-D-galjwy.js +0 -2
- package/dist/chunks/textarea.component-DmxMuMCU.js +0 -2
- package/dist/chunks/theme.provider-CIJGn9Kh.js +0 -26
- package/dist/chunks/theme.provider-CIJGn9Kh.js.map +0 -1
- package/dist/chunks/theme.provider-Dj4pZ815.js.map +0 -1
- package/dist/chunks/timestamp.component-BPU8bf7p.js +0 -54
- package/dist/chunks/timestamp.component-rTLrzBPA.js +0 -2
- package/dist/chunks/toaster.records-BJo0j1IZ.js +0 -2
- package/dist/chunks/tooltip.component-CwrXAVEq.js +0 -2
- package/dist/chunks/tooltip.component-CwrXAVEq.js.map +0 -1
- package/dist/chunks/tooltip.component-DgOzrNG3.js +0 -758
- package/dist/chunks/tooltip.component-DgOzrNG3.js.map +0 -1
- package/dist/chunks/use-field-context--wBJQY1R.js +0 -2
- package/dist/chunks/use-locale-context-BdqHZ8L8.js +0 -22
- package/dist/chunks/use-locale-context-BdqHZ8L8.js.map +0 -1
- package/dist/chunks/use-locale-context-D-agiW5E.js.map +0 -1
- package/dist/chunks/withFormControl-DpytztWF.js +0 -2
- package/dist/chunks/withTruncation-DPbMF-jg.js +0 -2
- package/dist/chunks/withTruncation-DPbMF-jg.js.map +0 -1
- package/dist/chunks/withTruncation-DoQriKuH.js +0 -67
- package/dist/chunks/withTruncation-DoQriKuH.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const i=require("./index-BlGAWSIX.js");function b(e){return!(e.metaKey||!i.isMac()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var k=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function h(e,r,t){const n=t?i.getEventTarget(t):null,a=i.getWindow(n);return e=e||n instanceof a.HTMLInputElement&&!k.has(n?.type)||n instanceof a.HTMLTextAreaElement||n instanceof a.HTMLElement&&n.isContentEditable,!(e&&r==="keyboard"&&t instanceof a.KeyboardEvent&&!Reflect.has(F,t.key))}var s=null,v=new Set,d=new Map,u=!1,f=!1,F={Tab:!0,Escape:!0};function l(e,r){for(let t of v)t(e,r)}function c(e){u=!0,b(e)&&(s="keyboard",l("keyboard",e))}function o(e){s="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(u=!0,l("pointer",e))}function y(e){i.isVirtualClick(e)&&(u=!0,s="virtual")}function L(e){const r=i.getEventTarget(e);r===i.getWindow(r)||r===i.getDocument(r)||(!u&&!f&&(s="virtual",l("virtual",e)),u=!1,f=!1)}function g(){u=!1,f=!0}function T(e){if(typeof window>"u"||d.get(i.getWindow(e)))return;const r=i.getWindow(e),t=i.getDocument(e);let n=r.HTMLElement.prototype.focus;r.HTMLElement.prototype.focus=function(){s="virtual",l("virtual",null),u=!0,n.apply(this,arguments)},t.addEventListener("keydown",c,!0),t.addEventListener("keyup",c,!0),t.addEventListener("click",y,!0),r.addEventListener("focus",L,!0),r.addEventListener("blur",g,!1),typeof r.PointerEvent<"u"?(t.addEventListener("pointerdown",o,!0),t.addEventListener("pointermove",o,!0),t.addEventListener("pointerup",o,!0)):(t.addEventListener("mousedown",o,!0),t.addEventListener("mousemove",o,!0),t.addEventListener("mouseup",o,!0)),r.addEventListener("beforeunload",()=>{M(e)},{once:!0}),d.set(r,{focus:n})}var M=(e,r)=>{const t=i.getWindow(e),n=i.getDocument(e);d.has(t)&&(t.HTMLElement.prototype.focus=d.get(t).focus,n.removeEventListener("keydown",c,!0),n.removeEventListener("keyup",c,!0),n.removeEventListener("click",y,!0),t.removeEventListener("focus",L,!0),t.removeEventListener("blur",g,!1),typeof t.PointerEvent<"u"?(n.removeEventListener("pointerdown",o,!0),n.removeEventListener("pointermove",o,!0),n.removeEventListener("pointerup",o,!0)):(n.removeEventListener("mousedown",o,!0),n.removeEventListener("mousemove",o,!0),n.removeEventListener("mouseup",o,!0)),d.delete(t))};function E(){return s==="keyboard"}function V(e={}){const{isTextInput:r,autoFocus:t,onChange:n,root:a}=e;T(a),n?.({isFocusVisible:t||E(),modality:s});const m=(p,w)=>{h(!!r,p,w)&&n?.({isFocusVisible:E(),modality:p})};return v.add(m),()=>{v.delete(m)}}exports.isFocusVisible=E;exports.trackFocusVisible=V;
|
|
2
|
+
//# sourceMappingURL=index-Fztcdoo_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Fztcdoo_.js","sources":["../../node_modules/@zag-js/focus-visible/dist/index.mjs"],"sourcesContent":["import { getWindow, getDocument, getEventTarget, isVirtualClick, isMac } from '@zag-js/dom-query';\n\n// src/index.ts\nfunction isValidKey(e) {\n return !(e.metaKey || !isMac() && e.altKey || e.ctrlKey || e.key === \"Control\" || e.key === \"Shift\" || e.key === \"Meta\");\n}\nvar nonTextInputTypes = /* @__PURE__ */ new Set([\"checkbox\", \"radio\", \"range\", \"color\", \"file\", \"image\", \"button\", \"submit\", \"reset\"]);\nfunction isKeyboardFocusEvent(isTextInput, modality, e) {\n const target = e ? getEventTarget(e) : null;\n const win = getWindow(target);\n isTextInput = isTextInput || target instanceof win.HTMLInputElement && !nonTextInputTypes.has(target?.type) || target instanceof win.HTMLTextAreaElement || target instanceof win.HTMLElement && target.isContentEditable;\n return !(isTextInput && modality === \"keyboard\" && e instanceof win.KeyboardEvent && !Reflect.has(FOCUS_VISIBLE_INPUT_KEYS, e.key));\n}\nvar currentModality = null;\nvar changeHandlers = /* @__PURE__ */ new Set();\nvar listenerMap = /* @__PURE__ */ new Map();\nvar hasEventBeforeFocus = false;\nvar hasBlurredWindowRecently = false;\nvar FOCUS_VISIBLE_INPUT_KEYS = {\n Tab: true,\n Escape: true\n};\nfunction triggerChangeHandlers(modality, e) {\n for (let handler of changeHandlers) {\n handler(modality, e);\n }\n}\nfunction handleKeyboardEvent(e) {\n hasEventBeforeFocus = true;\n if (isValidKey(e)) {\n currentModality = \"keyboard\";\n triggerChangeHandlers(\"keyboard\", e);\n }\n}\nfunction handlePointerEvent(e) {\n currentModality = \"pointer\";\n if (e.type === \"mousedown\" || e.type === \"pointerdown\") {\n hasEventBeforeFocus = true;\n triggerChangeHandlers(\"pointer\", e);\n }\n}\nfunction handleClickEvent(e) {\n if (isVirtualClick(e)) {\n hasEventBeforeFocus = true;\n currentModality = \"virtual\";\n }\n}\nfunction handleFocusEvent(e) {\n const target = getEventTarget(e);\n if (target === getWindow(target) || target === getDocument(target)) {\n return;\n }\n if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {\n currentModality = \"virtual\";\n triggerChangeHandlers(\"virtual\", e);\n }\n hasEventBeforeFocus = false;\n hasBlurredWindowRecently = false;\n}\nfunction handleWindowBlur() {\n hasEventBeforeFocus = false;\n hasBlurredWindowRecently = true;\n}\nfunction setupGlobalFocusEvents(root) {\n if (typeof window === \"undefined\" || listenerMap.get(getWindow(root))) {\n return;\n }\n const win = getWindow(root);\n const doc = getDocument(root);\n let focus = win.HTMLElement.prototype.focus;\n win.HTMLElement.prototype.focus = function() {\n currentModality = \"virtual\";\n triggerChangeHandlers(\"virtual\", null);\n hasEventBeforeFocus = true;\n focus.apply(this, arguments);\n };\n doc.addEventListener(\"keydown\", handleKeyboardEvent, true);\n doc.addEventListener(\"keyup\", handleKeyboardEvent, true);\n doc.addEventListener(\"click\", handleClickEvent, true);\n win.addEventListener(\"focus\", handleFocusEvent, true);\n win.addEventListener(\"blur\", handleWindowBlur, false);\n if (typeof win.PointerEvent !== \"undefined\") {\n doc.addEventListener(\"pointerdown\", handlePointerEvent, true);\n doc.addEventListener(\"pointermove\", handlePointerEvent, true);\n doc.addEventListener(\"pointerup\", handlePointerEvent, true);\n } else {\n doc.addEventListener(\"mousedown\", handlePointerEvent, true);\n doc.addEventListener(\"mousemove\", handlePointerEvent, true);\n doc.addEventListener(\"mouseup\", handlePointerEvent, true);\n }\n win.addEventListener(\n \"beforeunload\",\n () => {\n tearDownWindowFocusTracking(root);\n },\n { once: true }\n );\n listenerMap.set(win, { focus });\n}\nvar tearDownWindowFocusTracking = (root, loadListener) => {\n const win = getWindow(root);\n const doc = getDocument(root);\n if (!listenerMap.has(win)) {\n return;\n }\n win.HTMLElement.prototype.focus = listenerMap.get(win).focus;\n doc.removeEventListener(\"keydown\", handleKeyboardEvent, true);\n doc.removeEventListener(\"keyup\", handleKeyboardEvent, true);\n doc.removeEventListener(\"click\", handleClickEvent, true);\n win.removeEventListener(\"focus\", handleFocusEvent, true);\n win.removeEventListener(\"blur\", handleWindowBlur, false);\n if (typeof win.PointerEvent !== \"undefined\") {\n doc.removeEventListener(\"pointerdown\", handlePointerEvent, true);\n doc.removeEventListener(\"pointermove\", handlePointerEvent, true);\n doc.removeEventListener(\"pointerup\", handlePointerEvent, true);\n } else {\n doc.removeEventListener(\"mousedown\", handlePointerEvent, true);\n doc.removeEventListener(\"mousemove\", handlePointerEvent, true);\n doc.removeEventListener(\"mouseup\", handlePointerEvent, true);\n }\n listenerMap.delete(win);\n};\nfunction getInteractionModality() {\n return currentModality;\n}\nfunction setInteractionModality(modality) {\n currentModality = modality;\n triggerChangeHandlers(modality, null);\n}\nfunction trackInteractionModality(props) {\n const { onChange, root } = props;\n setupGlobalFocusEvents(root);\n onChange({ modality: currentModality });\n const handler = () => onChange({ modality: currentModality });\n changeHandlers.add(handler);\n return () => {\n changeHandlers.delete(handler);\n };\n}\nfunction isFocusVisible() {\n return currentModality === \"keyboard\";\n}\nfunction trackFocusVisible(props = {}) {\n const { isTextInput, autoFocus, onChange, root } = props;\n setupGlobalFocusEvents(root);\n onChange?.({ isFocusVisible: autoFocus || isFocusVisible(), modality: currentModality });\n const handler = (modality, e) => {\n if (!isKeyboardFocusEvent(!!isTextInput, modality, e)) return;\n onChange?.({ isFocusVisible: isFocusVisible(), modality });\n };\n changeHandlers.add(handler);\n return () => {\n changeHandlers.delete(handler);\n };\n}\n\nexport { getInteractionModality, isFocusVisible, listenerMap, setInteractionModality, trackFocusVisible, trackInteractionModality };\n"],"names":["isValidKey","isMac","nonTextInputTypes","isKeyboardFocusEvent","isTextInput","modality","e","target","getEventTarget","win","getWindow","FOCUS_VISIBLE_INPUT_KEYS","currentModality","changeHandlers","listenerMap","hasEventBeforeFocus","hasBlurredWindowRecently","triggerChangeHandlers","handler","handleKeyboardEvent","handlePointerEvent","handleClickEvent","isVirtualClick","handleFocusEvent","getDocument","handleWindowBlur","setupGlobalFocusEvents","root","doc","focus","tearDownWindowFocusTracking","loadListener","isFocusVisible","trackFocusVisible","props","autoFocus","onChange"],"mappings":"oDAGA,SAASA,EAAW,EAAG,CACrB,MAAO,EAAE,EAAE,SAAW,CAACC,EAAK,MAAA,GAAM,EAAE,QAAU,EAAE,SAAW,EAAE,MAAQ,WAAa,EAAE,MAAQ,SAAW,EAAE,MAAQ,OACnH,CACA,IAAIC,EAAoC,IAAI,IAAI,CAAC,WAAY,QAAS,QAAS,QAAS,OAAQ,QAAS,SAAU,SAAU,OAAO,CAAC,EACrI,SAASC,EAAqBC,EAAaC,EAAUC,EAAG,CACtD,MAAMC,EAASD,EAAIE,iBAAeF,CAAC,EAAI,KACjCG,EAAMC,EAAS,UAACH,CAAM,EAC5B,OAAAH,EAAcA,GAAeG,aAAkBE,EAAI,kBAAoB,CAACP,EAAkB,IAAIK,GAAQ,IAAI,GAAKA,aAAkBE,EAAI,qBAAuBF,aAAkBE,EAAI,aAAeF,EAAO,kBACjM,EAAEH,GAAeC,IAAa,YAAcC,aAAaG,EAAI,eAAiB,CAAC,QAAQ,IAAIE,EAA0BL,EAAE,GAAG,EACnI,CACA,IAAIM,EAAkB,KAClBC,EAAiC,IAAI,IACrCC,EAA8B,IAAI,IAClCC,EAAsB,GACtBC,EAA2B,GAC3BL,EAA2B,CAC7B,IAAK,GACL,OAAQ,EACV,EACA,SAASM,EAAsBZ,EAAUC,EAAG,CAC1C,QAASY,KAAWL,EAClBK,EAAQb,EAAUC,CAAC,CAEvB,CACA,SAASa,EAAoB,EAAG,CAC9BJ,EAAsB,GAClBf,EAAW,CAAC,IACdY,EAAkB,WAClBK,EAAsB,WAAY,CAAC,EAEvC,CACA,SAASG,EAAmB,EAAG,CAC7BR,EAAkB,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vF,MAAMM,EAAU,CAACb,EAAUC,IAAM,CAC1BH,EAAqB,CAAC,CAACC,EAAaC,EAAUC,CAAC,GACpD8B,IAAW,CAAE,eAAgBJ,EAAgB,EAAE,SAAA3B,CAAQ,CAAE,CAC1D,EACD,OAAAQ,EAAe,IAAIK,CAAO,EACnB,IAAM,CACXL,EAAe,OAAOK,CAAO,CAC9B,CACH","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { F as d, G as E, H as g, E as L, I as F } from "./index-C323eOJV.js";
|
|
2
|
+
function T(e) {
|
|
3
|
+
return !(e.metaKey || !F() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
4
|
+
}
|
|
5
|
+
var M = /* @__PURE__ */ new Set(["checkbox", "radio", "range", "color", "file", "image", "button", "submit", "reset"]);
|
|
6
|
+
function H(e, r, t) {
|
|
7
|
+
const n = t ? L(t) : null, u = d(n);
|
|
8
|
+
return e = e || n instanceof u.HTMLInputElement && !M.has(n?.type) || n instanceof u.HTMLTextAreaElement || n instanceof u.HTMLElement && n.isContentEditable, !(e && r === "keyboard" && t instanceof u.KeyboardEvent && !Reflect.has(K, t.key));
|
|
9
|
+
}
|
|
10
|
+
var s = null, v = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), i = !1, f = !1, K = {
|
|
11
|
+
Tab: !0,
|
|
12
|
+
Escape: !0
|
|
13
|
+
};
|
|
14
|
+
function c(e, r) {
|
|
15
|
+
for (let t of v)
|
|
16
|
+
t(e, r);
|
|
17
|
+
}
|
|
18
|
+
function l(e) {
|
|
19
|
+
i = !0, T(e) && (s = "keyboard", c("keyboard", e));
|
|
20
|
+
}
|
|
21
|
+
function o(e) {
|
|
22
|
+
s = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (i = !0, c("pointer", e));
|
|
23
|
+
}
|
|
24
|
+
function w(e) {
|
|
25
|
+
g(e) && (i = !0, s = "virtual");
|
|
26
|
+
}
|
|
27
|
+
function b(e) {
|
|
28
|
+
const r = L(e);
|
|
29
|
+
r === d(r) || r === E(r) || (!i && !f && (s = "virtual", c("virtual", e)), i = !1, f = !1);
|
|
30
|
+
}
|
|
31
|
+
function k() {
|
|
32
|
+
i = !1, f = !0;
|
|
33
|
+
}
|
|
34
|
+
function C(e) {
|
|
35
|
+
if (typeof window > "u" || a.get(d(e)))
|
|
36
|
+
return;
|
|
37
|
+
const r = d(e), t = E(e);
|
|
38
|
+
let n = r.HTMLElement.prototype.focus;
|
|
39
|
+
r.HTMLElement.prototype.focus = function() {
|
|
40
|
+
s = "virtual", c("virtual", null), i = !0, n.apply(this, arguments);
|
|
41
|
+
}, t.addEventListener("keydown", l, !0), t.addEventListener("keyup", l, !0), t.addEventListener("click", w, !0), r.addEventListener("focus", b, !0), r.addEventListener("blur", k, !1), typeof r.PointerEvent < "u" ? (t.addEventListener("pointerdown", o, !0), t.addEventListener("pointermove", o, !0), t.addEventListener("pointerup", o, !0)) : (t.addEventListener("mousedown", o, !0), t.addEventListener("mousemove", o, !0), t.addEventListener("mouseup", o, !0)), r.addEventListener(
|
|
42
|
+
"beforeunload",
|
|
43
|
+
() => {
|
|
44
|
+
V(e);
|
|
45
|
+
},
|
|
46
|
+
{ once: !0 }
|
|
47
|
+
), a.set(r, { focus: n });
|
|
48
|
+
}
|
|
49
|
+
var V = (e, r) => {
|
|
50
|
+
const t = d(e), n = E(e);
|
|
51
|
+
a.has(t) && (t.HTMLElement.prototype.focus = a.get(t).focus, n.removeEventListener("keydown", l, !0), n.removeEventListener("keyup", l, !0), n.removeEventListener("click", w, !0), t.removeEventListener("focus", b, !0), t.removeEventListener("blur", k, !1), typeof t.PointerEvent < "u" ? (n.removeEventListener("pointerdown", o, !0), n.removeEventListener("pointermove", o, !0), n.removeEventListener("pointerup", o, !0)) : (n.removeEventListener("mousedown", o, !0), n.removeEventListener("mousemove", o, !0), n.removeEventListener("mouseup", o, !0)), a.delete(t));
|
|
52
|
+
};
|
|
53
|
+
function y() {
|
|
54
|
+
return s === "keyboard";
|
|
55
|
+
}
|
|
56
|
+
function I(e = {}) {
|
|
57
|
+
const { isTextInput: r, autoFocus: t, onChange: n, root: u } = e;
|
|
58
|
+
C(u), n?.({ isFocusVisible: t || y(), modality: s });
|
|
59
|
+
const p = (m, h) => {
|
|
60
|
+
H(!!r, m, h) && n?.({ isFocusVisible: y(), modality: m });
|
|
61
|
+
};
|
|
62
|
+
return v.add(p), () => {
|
|
63
|
+
v.delete(p);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
y as i,
|
|
68
|
+
I as t
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=index-WyVSig7F.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-WyVSig7F.js","sources":["../../node_modules/@zag-js/focus-visible/dist/index.mjs"],"sourcesContent":["import { getWindow, getDocument, getEventTarget, isVirtualClick, isMac } from '@zag-js/dom-query';\n\n// src/index.ts\nfunction isValidKey(e) {\n return !(e.metaKey || !isMac() && e.altKey || e.ctrlKey || e.key === \"Control\" || e.key === \"Shift\" || e.key === \"Meta\");\n}\nvar nonTextInputTypes = /* @__PURE__ */ new Set([\"checkbox\", \"radio\", \"range\", \"color\", \"file\", \"image\", \"button\", \"submit\", \"reset\"]);\nfunction isKeyboardFocusEvent(isTextInput, modality, e) {\n const target = e ? getEventTarget(e) : null;\n const win = getWindow(target);\n isTextInput = isTextInput || target instanceof win.HTMLInputElement && !nonTextInputTypes.has(target?.type) || target instanceof win.HTMLTextAreaElement || target instanceof win.HTMLElement && target.isContentEditable;\n return !(isTextInput && modality === \"keyboard\" && e instanceof win.KeyboardEvent && !Reflect.has(FOCUS_VISIBLE_INPUT_KEYS, e.key));\n}\nvar currentModality = null;\nvar changeHandlers = /* @__PURE__ */ new Set();\nvar listenerMap = /* @__PURE__ */ new Map();\nvar hasEventBeforeFocus = false;\nvar hasBlurredWindowRecently = false;\nvar FOCUS_VISIBLE_INPUT_KEYS = {\n Tab: true,\n Escape: true\n};\nfunction triggerChangeHandlers(modality, e) {\n for (let handler of changeHandlers) {\n handler(modality, e);\n }\n}\nfunction handleKeyboardEvent(e) {\n hasEventBeforeFocus = true;\n if (isValidKey(e)) {\n currentModality = \"keyboard\";\n triggerChangeHandlers(\"keyboard\", e);\n }\n}\nfunction handlePointerEvent(e) {\n currentModality = \"pointer\";\n if (e.type === \"mousedown\" || e.type === \"pointerdown\") {\n hasEventBeforeFocus = true;\n triggerChangeHandlers(\"pointer\", e);\n }\n}\nfunction handleClickEvent(e) {\n if (isVirtualClick(e)) {\n hasEventBeforeFocus = true;\n currentModality = \"virtual\";\n }\n}\nfunction handleFocusEvent(e) {\n const target = getEventTarget(e);\n if (target === getWindow(target) || target === getDocument(target)) {\n return;\n }\n if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {\n currentModality = \"virtual\";\n triggerChangeHandlers(\"virtual\", e);\n }\n hasEventBeforeFocus = false;\n hasBlurredWindowRecently = false;\n}\nfunction handleWindowBlur() {\n hasEventBeforeFocus = false;\n hasBlurredWindowRecently = true;\n}\nfunction setupGlobalFocusEvents(root) {\n if (typeof window === \"undefined\" || listenerMap.get(getWindow(root))) {\n return;\n }\n const win = getWindow(root);\n const doc = getDocument(root);\n let focus = win.HTMLElement.prototype.focus;\n win.HTMLElement.prototype.focus = function() {\n currentModality = \"virtual\";\n triggerChangeHandlers(\"virtual\", null);\n hasEventBeforeFocus = true;\n focus.apply(this, arguments);\n };\n doc.addEventListener(\"keydown\", handleKeyboardEvent, true);\n doc.addEventListener(\"keyup\", handleKeyboardEvent, true);\n doc.addEventListener(\"click\", handleClickEvent, true);\n win.addEventListener(\"focus\", handleFocusEvent, true);\n win.addEventListener(\"blur\", handleWindowBlur, false);\n if (typeof win.PointerEvent !== \"undefined\") {\n doc.addEventListener(\"pointerdown\", handlePointerEvent, true);\n doc.addEventListener(\"pointermove\", handlePointerEvent, true);\n doc.addEventListener(\"pointerup\", handlePointerEvent, true);\n } else {\n doc.addEventListener(\"mousedown\", handlePointerEvent, true);\n doc.addEventListener(\"mousemove\", handlePointerEvent, true);\n doc.addEventListener(\"mouseup\", handlePointerEvent, true);\n }\n win.addEventListener(\n \"beforeunload\",\n () => {\n tearDownWindowFocusTracking(root);\n },\n { once: true }\n );\n listenerMap.set(win, { focus });\n}\nvar tearDownWindowFocusTracking = (root, loadListener) => {\n const win = getWindow(root);\n const doc = getDocument(root);\n if (!listenerMap.has(win)) {\n return;\n }\n win.HTMLElement.prototype.focus = listenerMap.get(win).focus;\n doc.removeEventListener(\"keydown\", handleKeyboardEvent, true);\n doc.removeEventListener(\"keyup\", handleKeyboardEvent, true);\n doc.removeEventListener(\"click\", handleClickEvent, true);\n win.removeEventListener(\"focus\", handleFocusEvent, true);\n win.removeEventListener(\"blur\", handleWindowBlur, false);\n if (typeof win.PointerEvent !== \"undefined\") {\n doc.removeEventListener(\"pointerdown\", handlePointerEvent, true);\n doc.removeEventListener(\"pointermove\", handlePointerEvent, true);\n doc.removeEventListener(\"pointerup\", handlePointerEvent, true);\n } else {\n doc.removeEventListener(\"mousedown\", handlePointerEvent, true);\n doc.removeEventListener(\"mousemove\", handlePointerEvent, true);\n doc.removeEventListener(\"mouseup\", handlePointerEvent, true);\n }\n listenerMap.delete(win);\n};\nfunction getInteractionModality() {\n return currentModality;\n}\nfunction setInteractionModality(modality) {\n currentModality = modality;\n triggerChangeHandlers(modality, null);\n}\nfunction trackInteractionModality(props) {\n const { onChange, root } = props;\n setupGlobalFocusEvents(root);\n onChange({ modality: currentModality });\n const handler = () => onChange({ modality: currentModality });\n changeHandlers.add(handler);\n return () => {\n changeHandlers.delete(handler);\n };\n}\nfunction isFocusVisible() {\n return currentModality === \"keyboard\";\n}\nfunction trackFocusVisible(props = {}) {\n const { isTextInput, autoFocus, onChange, root } = props;\n setupGlobalFocusEvents(root);\n onChange?.({ isFocusVisible: autoFocus || isFocusVisible(), modality: currentModality });\n const handler = (modality, e) => {\n if (!isKeyboardFocusEvent(!!isTextInput, modality, e)) return;\n onChange?.({ isFocusVisible: isFocusVisible(), modality });\n };\n changeHandlers.add(handler);\n return () => {\n changeHandlers.delete(handler);\n };\n}\n\nexport { getInteractionModality, isFocusVisible, listenerMap, setInteractionModality, trackFocusVisible, trackInteractionModality };\n"],"names":["isValidKey","isMac","nonTextInputTypes","isKeyboardFocusEvent","isTextInput","modality","e","target","getEventTarget","win","getWindow","FOCUS_VISIBLE_INPUT_KEYS","currentModality","changeHandlers","listenerMap","hasEventBeforeFocus","hasBlurredWindowRecently","triggerChangeHandlers","handler","handleKeyboardEvent","handlePointerEvent","handleClickEvent","isVirtualClick","handleFocusEvent","getDocument","handleWindowBlur","setupGlobalFocusEvents","root","doc","focus","tearDownWindowFocusTracking","loadListener","isFocusVisible","trackFocusVisible","props","autoFocus","onChange"],"mappings":";AAGA,SAASA,EAAW,GAAG;AACrB,SAAO,EAAE,EAAE,WAAW,CAACC,EAAK,KAAM,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,aAAa,EAAE,QAAQ,WAAW,EAAE,QAAQ;AACnH;AACA,IAAIC,IAAoC,oBAAI,IAAI,CAAC,YAAY,SAAS,SAAS,SAAS,QAAQ,SAAS,UAAU,UAAU,OAAO,CAAC;AACrI,SAASC,EAAqBC,GAAaC,GAAUC,GAAG;AACtD,QAAMC,IAASD,IAAIE,EAAeF,CAAC,IAAI,MACjCG,IAAMC,EAAUH,CAAM;AAC5B,SAAAH,IAAcA,KAAeG,aAAkBE,EAAI,oBAAoB,CAACP,EAAkB,IAAIK,GAAQ,IAAI,KAAKA,aAAkBE,EAAI,uBAAuBF,aAAkBE,EAAI,eAAeF,EAAO,mBACjM,EAAEH,KAAeC,MAAa,cAAcC,aAAaG,EAAI,iBAAiB,CAAC,QAAQ,IAAIE,GAA0BL,EAAE,GAAG;AACnI;AACA,IAAIM,IAAkB,MAClBC,IAAiC,oBAAI,IAAK,GAC1CC,IAA8B,oBAAI,IAAK,GACvCC,I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oBAAoB,aAAaR,GAAoB,EAAI,GAC7DQ,EAAI,oBAAoB,WAAWR,GAAoB,EAAI,IAE7DN,EAAY,OAAOL,CAAG;AACxB;AAkBA,SAASuB,IAAiB;AACxB,SAAOpB,MAAoB;AAC7B;AACA,SAASqB,EAAkBC,IAAQ,IAAI;AACrC,QAAM,EAAE,aAAA9B,GAAa,WAAA+B,GAAW,UAAAC,GAAU,MAAAT,EAAM,IAAGO;AACnD,EAAAR,EAAuBC,CAAI,GAC3BS,IAAW,EAAE,gBAAgBD,KAAaH,EAAc,GAAI,UAAUpB,GAAiB;AACvF,QAAMM,IAAU,CAACb,GAAUC,MAAM;AAC/B,IAAKH,EAAqB,CAAC,CAACC,GAAaC,GAAUC,CAAC,KACpD8B,IAAW,EAAE,gBAAgBJ,EAAgB,GAAE,UAAA3B,EAAQ,CAAE;AAAA,EAC1D;AACD,SAAAQ,EAAe,IAAIK,CAAO,GACnB,MAAM;AACX,IAAAL,EAAe,OAAOK,CAAO;AAAA,EAC9B;AACH;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as K,
|
|
2
|
-
var N = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = {},
|
|
1
|
+
import { r as K, G as R, ad as M, ae as L, af as v, ag as m, W as g, E as O, ah as S, ai as A, aj as W, ak as _, al as G, am as $ } from "./index-C323eOJV.js";
|
|
2
|
+
var N = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = {}, C = 0, B = (e) => e && (e.host || B(e.parentNode)), V = (e, i) => i.map((o) => {
|
|
3
3
|
if (e.contains(o)) return o;
|
|
4
4
|
const t = B(o);
|
|
5
5
|
return t && e.contains(t) ? t : (console.error("[zag-js > ariaHidden] target", o, "in not contained inside", e, ". Doing nothing"), null);
|
|
@@ -24,11 +24,11 @@ var N = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = {}
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
return b(o), l.clear(),
|
|
27
|
+
return b(o), l.clear(), C++, () => {
|
|
28
28
|
u.forEach((c) => {
|
|
29
29
|
const f = N.get(c) - 1, p = a.get(c) - 1;
|
|
30
30
|
N.set(c, f), a.set(c, p), f || (I.has(c) || c.removeAttribute(s), I.delete(c)), p || c.removeAttribute(t);
|
|
31
|
-
}),
|
|
31
|
+
}), C--, C || (N = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = {});
|
|
32
32
|
};
|
|
33
33
|
}, X = (e) => (Array.isArray(e) ? e[0] : e).ownerDocument.body, Y = (e, i = X(e), o = "data-aria-hidden") => {
|
|
34
34
|
if (i)
|
|
@@ -52,7 +52,7 @@ function it(e, i = {}) {
|
|
|
52
52
|
s.forEach((n) => n?.());
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
var q = Object.defineProperty, z = (e, i, o) => i in e ? q(e, i, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[i] = o, h = (e, i, o) => z(e, typeof i != "symbol" ? i + "" : i, o),
|
|
55
|
+
var q = Object.defineProperty, z = (e, i, o) => i in e ? q(e, i, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[i] = o, h = (e, i, o) => z(e, typeof i != "symbol" ? i + "" : i, o), P = {
|
|
56
56
|
activateTrap(e, i) {
|
|
57
57
|
if (e.length > 0) {
|
|
58
58
|
const t = e[e.length - 1];
|
|
@@ -149,7 +149,7 @@ var q = Object.defineProperty, z = (e, i, o) => i in e ? q(e, i, { enumerable: !
|
|
|
149
149
|
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
150
150
|
return t.isConnected || (t = this.getNodeForOption("fallbackFocus")), t;
|
|
151
151
|
}), h(this, "tryFocus", (t) => {
|
|
152
|
-
if (t !== !1 && t !==
|
|
152
|
+
if (t !== !1 && t !== W(this.doc)) {
|
|
153
153
|
if (!t || !t.focus) {
|
|
154
154
|
this.tryFocus(this.getInitialFocusNode());
|
|
155
155
|
return;
|
|
@@ -164,7 +164,7 @@ var q = Object.defineProperty, z = (e, i, o) => i in e ? q(e, i, { enumerable: !
|
|
|
164
164
|
checkCanReturnFocus: this.config.checkCanReturnFocus,
|
|
165
165
|
...t
|
|
166
166
|
};
|
|
167
|
-
clearTimeout(this.state.delayInitialFocusTimer), this.state.delayInitialFocusTimer = void 0, this.removeListeners(), this.state.active = !1, this.state.paused = !1, this.updateObservedNodes(),
|
|
167
|
+
clearTimeout(this.state.delayInitialFocusTimer), this.state.delayInitialFocusTimer = void 0, this.removeListeners(), this.state.active = !1, this.state.paused = !1, this.updateObservedNodes(), P.deactivateTrap(this.trapStack, this);
|
|
168
168
|
const n = this.getOption(s, "onDeactivate"), a = this.getOption(s, "onPostDeactivate"), u = this.getOption(s, "checkCanReturnFocus"), l = this.getOption(s, "returnFocus", "returnFocusOnDeactivate");
|
|
169
169
|
n?.();
|
|
170
170
|
const r = () => {
|
|
@@ -301,7 +301,7 @@ var q = Object.defineProperty, z = (e, i, o) => i in e ? q(e, i, { enumerable: !
|
|
|
301
301
|
}
|
|
302
302
|
addListeners() {
|
|
303
303
|
if (this.state.active)
|
|
304
|
-
return
|
|
304
|
+
return P.activateTrap(this.trapStack, this), this.state.delayInitialFocusTimer = this.config.delayInitialFocus ? E(() => {
|
|
305
305
|
this.tryFocus(this.getInitialFocusNode());
|
|
306
306
|
}) : this.tryFocus(this.getInitialFocusNode()), this.listenerCleanups.push(
|
|
307
307
|
g(this.doc, "focusin", this.handleFocus, !0),
|
|
@@ -352,20 +352,20 @@ function at(e, i = {}) {
|
|
|
352
352
|
o?.deactivate(), t();
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
|
-
var
|
|
355
|
+
var D = "data-scroll-lock";
|
|
356
356
|
function et(e) {
|
|
357
357
|
const i = e.getBoundingClientRect().left;
|
|
358
358
|
return Math.round(i) + e.scrollLeft ? "paddingLeft" : "paddingRight";
|
|
359
359
|
}
|
|
360
360
|
function ot(e) {
|
|
361
361
|
const i = e ?? document, o = i.defaultView ?? window, { documentElement: t, body: s } = i;
|
|
362
|
-
if (s.hasAttribute(
|
|
363
|
-
s.setAttribute(
|
|
364
|
-
const a = o.innerWidth - t.clientWidth, u = () =>
|
|
362
|
+
if (s.hasAttribute(D)) return;
|
|
363
|
+
s.setAttribute(D, "");
|
|
364
|
+
const a = o.innerWidth - t.clientWidth, u = () => _(t, "--scrollbar-width", `${a}px`), l = et(t), r = () => G(s, {
|
|
365
365
|
overflow: "hidden",
|
|
366
366
|
[l]: `${a}px`
|
|
367
367
|
}), d = () => {
|
|
368
|
-
const { scrollX: c, scrollY: f, visualViewport: p } = o, w = p?.offsetLeft ?? 0, T = p?.offsetTop ?? 0, x =
|
|
368
|
+
const { scrollX: c, scrollY: f, visualViewport: p } = o, w = p?.offsetLeft ?? 0, T = p?.offsetTop ?? 0, x = G(s, {
|
|
369
369
|
position: "fixed",
|
|
370
370
|
overflow: "hidden",
|
|
371
371
|
top: `${-(f - Math.floor(T))}px`,
|
|
@@ -378,7 +378,7 @@ function ot(e) {
|
|
|
378
378
|
};
|
|
379
379
|
}, b = [u(), $() ? d() : r()];
|
|
380
380
|
return () => {
|
|
381
|
-
b.forEach((c) => c?.()), s.removeAttribute(
|
|
381
|
+
b.forEach((c) => c?.()), s.removeAttribute(D);
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
384
|
export {
|
|
@@ -386,4 +386,4 @@ export {
|
|
|
386
386
|
ot as p,
|
|
387
387
|
at as t
|
|
388
388
|
};
|
|
389
|
-
//# sourceMappingURL=index-
|
|
389
|
+
//# sourceMappingURL=index-f4Ba8Pq7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-DUHFrLMI.js","sources":["../../node_modules/@zag-js/aria-hidden/dist/index.mjs","../../node_modules/@zag-js/focus-trap/dist/index.mjs","../../node_modules/@zag-js/remove-scroll/dist/index.mjs"],"sourcesContent":["// src/walk-tree-outside.ts\nvar counterMap = /* @__PURE__ */ new WeakMap();\nvar uncontrolledNodes = /* @__PURE__ */ new WeakMap();\nvar markerMap = {};\nvar lockCount = 0;\nvar unwrapHost = (node) => node && (node.host || unwrapHost(node.parentNode));\nvar correctTargets = (parent, targets) => targets.map((target) => {\n if (parent.contains(target)) return target;\n const correctedTarget = unwrapHost(target);\n if (correctedTarget && parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n console.error(\"[zag-js > ariaHidden] target\", target, \"in not contained inside\", parent, \". Doing nothing\");\n return null;\n}).filter((x) => Boolean(x));\nvar isIgnoredNode = (node) => {\n if (node.localName === \"next-route-announcer\") return true;\n if (node.localName === \"script\") return true;\n if (node.hasAttribute(\"aria-live\")) return true;\n return node.matches(\"[data-live-announcer]\");\n};\nvar walkTreeOutside = (originalTarget, props) => {\n const { parentNode, markerName, controlAttribute} = props;\n const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n markerMap[markerName] || (markerMap[markerName] = /* @__PURE__ */ new WeakMap());\n const markerCounter = markerMap[markerName];\n const hiddenNodes = [];\n const elementsToKeep = /* @__PURE__ */ new Set();\n const elementsToStop = new Set(targets);\n const keep = (el) => {\n if (!el || elementsToKeep.has(el)) return;\n elementsToKeep.add(el);\n keep(el.parentNode);\n };\n targets.forEach(keep);\n const deep = (parent) => {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n Array.prototype.forEach.call(parent.children, (node) => {\n if (elementsToKeep.has(node)) {\n deep(node);\n } else {\n try {\n if (isIgnoredNode(node)) return;\n const attr = node.getAttribute(controlAttribute);\n const alreadyHidden = attr === \"true\" ;\n const counterValue = (counterMap.get(node) || 0) + 1;\n const markerValue = (markerCounter.get(node) || 0) + 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenNodes.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledNodes.set(node, true);\n }\n if (markerValue === 1) {\n node.setAttribute(markerName, \"\");\n }\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, \"true\" );\n }\n } catch (e) {\n console.error(\"[zag-js > ariaHidden] cannot operate on \", node, e);\n }\n }\n });\n };\n deep(parentNode);\n elementsToKeep.clear();\n lockCount++;\n return () => {\n hiddenNodes.forEach((node) => {\n const counterValue = counterMap.get(node) - 1;\n const markerValue = markerCounter.get(node) - 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n if (!counterValue) {\n if (!uncontrolledNodes.has(node)) {\n node.removeAttribute(controlAttribute);\n }\n uncontrolledNodes.delete(node);\n }\n if (!markerValue) {\n node.removeAttribute(markerName);\n }\n });\n lockCount--;\n if (!lockCount) {\n counterMap = /* @__PURE__ */ new WeakMap();\n counterMap = /* @__PURE__ */ new WeakMap();\n uncontrolledNodes = /* @__PURE__ */ new WeakMap();\n markerMap = {};\n }\n };\n};\n\n// src/aria-hidden.ts\nvar getParentNode = (originalTarget) => {\n const target = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;\n return target.ownerDocument.body;\n};\nvar hideOthers = (originalTarget, parentNode = getParentNode(originalTarget), markerName = \"data-aria-hidden\") => {\n if (!parentNode) return;\n return walkTreeOutside(originalTarget, {\n parentNode,\n markerName,\n controlAttribute: \"aria-hidden\"});\n};\n\n// src/index.ts\nvar raf = (fn) => {\n const frameId = requestAnimationFrame(() => fn());\n return () => cancelAnimationFrame(frameId);\n};\nfunction ariaHidden(targetsOrFn, options = {}) {\n const { defer = true } = options;\n const func = defer ? raf : (v) => v();\n const cleanups = [];\n cleanups.push(\n func(() => {\n const targets = typeof targetsOrFn === \"function\" ? targetsOrFn() : targetsOrFn;\n const elements = targets.filter(Boolean);\n if (elements.length === 0) return;\n cleanups.push(hideOthers(elements));\n })\n );\n return () => {\n cleanups.forEach((fn) => fn?.());\n };\n}\n\nexport { ariaHidden };\n","import { getDocument, getTabbables, getFocusables, isTabbable, getTabIndex, addDomEvent, raf, getEventTarget, isDocument, isFocusable, getActiveElement } from '@zag-js/dom-query';\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nvar activeFocusTraps = {\n activateTrap(trapStack, trap) {\n if (trapStack.length > 0) {\n const activeTrap = trapStack[trapStack.length - 1];\n if (activeTrap !== trap) {\n activeTrap.pause();\n }\n }\n const trapIndex = trapStack.indexOf(trap);\n if (trapIndex === -1) {\n trapStack.push(trap);\n } else {\n trapStack.splice(trapIndex, 1);\n trapStack.push(trap);\n }\n },\n deactivateTrap(trapStack, trap) {\n const trapIndex = trapStack.indexOf(trap);\n if (trapIndex !== -1) {\n trapStack.splice(trapIndex, 1);\n }\n if (trapStack.length > 0) {\n trapStack[trapStack.length - 1].unpause();\n }\n }\n};\nvar sharedTrapStack = [];\nvar FocusTrap = class {\n constructor(elements, options) {\n __publicField(this, \"trapStack\");\n __publicField(this, \"config\");\n __publicField(this, \"doc\");\n __publicField(this, \"state\", {\n containers: [],\n containerGroups: [],\n tabbableGroups: [],\n nodeFocusedBeforeActivation: null,\n mostRecentlyFocusedNode: null,\n active: false,\n paused: false,\n delayInitialFocusTimer: void 0,\n recentNavEvent: void 0\n });\n __publicField(this, \"listenerCleanups\", []);\n __publicField(this, \"handleFocus\", (event) => {\n const target = getEventTarget(event);\n const targetContained = this.findContainerIndex(target, event) >= 0;\n if (targetContained || isDocument(target)) {\n if (targetContained) {\n this.state.mostRecentlyFocusedNode = target;\n }\n } else {\n event.stopImmediatePropagation();\n let nextNode;\n let navAcrossContainers = true;\n if (this.state.mostRecentlyFocusedNode) {\n if (getTabIndex(this.state.mostRecentlyFocusedNode) > 0) {\n const mruContainerIdx = this.findContainerIndex(this.state.mostRecentlyFocusedNode);\n const { tabbableNodes } = this.state.containerGroups[mruContainerIdx];\n if (tabbableNodes.length > 0) {\n const mruTabIdx = tabbableNodes.findIndex((node) => node === this.state.mostRecentlyFocusedNode);\n if (mruTabIdx >= 0) {\n if (this.config.isKeyForward(this.state.recentNavEvent)) {\n if (mruTabIdx + 1 < tabbableNodes.length) {\n nextNode = tabbableNodes[mruTabIdx + 1];\n navAcrossContainers = false;\n }\n } else {\n if (mruTabIdx - 1 >= 0) {\n nextNode = tabbableNodes[mruTabIdx - 1];\n navAcrossContainers = false;\n }\n }\n }\n }\n } else {\n if (!this.state.containerGroups.some((g) => g.tabbableNodes.some((n) => getTabIndex(n) > 0))) {\n navAcrossContainers = false;\n }\n }\n } else {\n navAcrossContainers = false;\n }\n if (navAcrossContainers) {\n nextNode = this.findNextNavNode({\n // move FROM the MRU node, not event-related node (which will be the node that is\n // outside the trap causing the focus escape we're trying to fix)\n target: this.state.mostRecentlyFocusedNode,\n isBackward: this.config.isKeyBackward(this.state.recentNavEvent)\n });\n }\n if (nextNode) {\n this.tryFocus(nextNode);\n } else {\n this.tryFocus(this.state.mostRecentlyFocusedNode || this.getInitialFocusNode());\n }\n }\n this.state.recentNavEvent = void 0;\n });\n __publicField(this, \"handlePointerDown\", (event) => {\n const target = getEventTarget(event);\n if (this.findContainerIndex(target, event) >= 0) {\n return;\n }\n if (valueOrHandler(this.config.clickOutsideDeactivates, event)) {\n this.deactivate({ returnFocus: this.config.returnFocusOnDeactivate });\n return;\n }\n if (valueOrHandler(this.config.allowOutsideClick, event)) {\n return;\n }\n event.preventDefault();\n });\n __publicField(this, \"handleClick\", (event) => {\n const target = getEventTarget(event);\n if (this.findContainerIndex(target, event) >= 0) {\n return;\n }\n if (valueOrHandler(this.config.clickOutsideDeactivates, event)) {\n return;\n }\n if (valueOrHandler(this.config.allowOutsideClick, event)) {\n return;\n }\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n __publicField(this, \"handleTabKey\", (event) => {\n if (this.config.isKeyForward(event) || this.config.isKeyBackward(event)) {\n this.state.recentNavEvent = event;\n const isBackward = this.config.isKeyBackward(event);\n const destinationNode = this.findNextNavNode({ event, isBackward });\n if (!destinationNode) return;\n if (isTabEvent(event)) {\n event.preventDefault();\n }\n this.tryFocus(destinationNode);\n }\n });\n __publicField(this, \"handleEscapeKey\", (event) => {\n if (isEscapeEvent(event) && valueOrHandler(this.config.escapeDeactivates, event) !== false) {\n event.preventDefault();\n this.deactivate();\n }\n });\n __publicField(this, \"_mutationObserver\");\n __publicField(this, \"setupMutationObserver\", () => {\n const win = this.doc.defaultView || window;\n this._mutationObserver = new win.MutationObserver((mutations) => {\n const isFocusedNodeRemoved = mutations.some((mutation) => {\n const removedNodes = Array.from(mutation.removedNodes);\n return removedNodes.some((node) => node === this.state.mostRecentlyFocusedNode);\n });\n if (isFocusedNodeRemoved) {\n this.tryFocus(this.getInitialFocusNode());\n }\n });\n });\n __publicField(this, \"updateObservedNodes\", () => {\n this._mutationObserver?.disconnect();\n if (this.state.active && !this.state.paused) {\n this.state.containers.map((container) => {\n this._mutationObserver?.observe(container, { subtree: true, childList: true });\n });\n }\n });\n __publicField(this, \"getInitialFocusNode\", () => {\n let node = this.getNodeForOption(\"initialFocus\", { hasFallback: true });\n if (node === false) {\n return false;\n }\n if (node === void 0 || node && !isFocusable(node)) {\n if (this.findContainerIndex(this.doc.activeElement) >= 0) {\n node = this.doc.activeElement;\n } else {\n const firstTabbableGroup = this.state.tabbableGroups[0];\n const firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;\n node = firstTabbableNode || this.getNodeForOption(\"fallbackFocus\");\n }\n } else if (node === null) {\n node = this.getNodeForOption(\"fallbackFocus\");\n }\n if (!node) {\n throw new Error(\"Your focus-trap needs to have at least one focusable element\");\n }\n if (!node.isConnected) {\n node = this.getNodeForOption(\"fallbackFocus\");\n }\n return node;\n });\n __publicField(this, \"tryFocus\", (node) => {\n if (node === false) return;\n if (node === getActiveElement(this.doc)) return;\n if (!node || !node.focus) {\n this.tryFocus(this.getInitialFocusNode());\n return;\n }\n node.focus({ preventScroll: !!this.config.preventScroll });\n this.state.mostRecentlyFocusedNode = node;\n if (isSelectableInput(node)) {\n node.select();\n }\n });\n __publicField(this, \"deactivate\", (deactivateOptions) => {\n if (!this.state.active) return this;\n const options = {\n onDeactivate: this.config.onDeactivate,\n onPostDeactivate: this.config.onPostDeactivate,\n checkCanReturnFocus: this.config.checkCanReturnFocus,\n ...deactivateOptions\n };\n clearTimeout(this.state.delayInitialFocusTimer);\n this.state.delayInitialFocusTimer = void 0;\n this.removeListeners();\n this.state.active = false;\n this.state.paused = false;\n this.updateObservedNodes();\n activeFocusTraps.deactivateTrap(this.trapStack, this);\n const onDeactivate = this.getOption(options, \"onDeactivate\");\n const onPostDeactivate = this.getOption(options, \"onPostDeactivate\");\n const checkCanReturnFocus = this.getOption(options, \"checkCanReturnFocus\");\n const returnFocus = this.getOption(options, \"returnFocus\", \"returnFocusOnDeactivate\");\n onDeactivate?.();\n const finishDeactivation = () => {\n delay(() => {\n if (returnFocus) {\n const returnFocusNode = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);\n this.tryFocus(returnFocusNode);\n }\n onPostDeactivate?.();\n });\n };\n if (returnFocus && checkCanReturnFocus) {\n const returnFocusNode = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);\n checkCanReturnFocus(returnFocusNode).then(finishDeactivation, finishDeactivation);\n return this;\n }\n finishDeactivation();\n return this;\n });\n __publicField(this, \"pause\", (pauseOptions) => {\n if (this.state.paused || !this.state.active) {\n return this;\n }\n const onPause = this.getOption(pauseOptions, \"onPause\");\n const onPostPause = this.getOption(pauseOptions, \"onPostPause\");\n this.state.paused = true;\n onPause?.();\n this.removeListeners();\n this.updateObservedNodes();\n onPostPause?.();\n return this;\n });\n __publicField(this, \"unpause\", (unpauseOptions) => {\n if (!this.state.paused || !this.state.active) {\n return this;\n }\n const onUnpause = this.getOption(unpauseOptions, \"onUnpause\");\n const onPostUnpause = this.getOption(unpauseOptions, \"onPostUnpause\");\n this.state.paused = false;\n onUnpause?.();\n this.updateTabbableNodes();\n this.addListeners();\n this.updateObservedNodes();\n onPostUnpause?.();\n return this;\n });\n __publicField(this, \"updateContainerElements\", (containerElements) => {\n this.state.containers = Array.isArray(containerElements) ? containerElements.filter(Boolean) : [containerElements].filter(Boolean);\n if (this.state.active) {\n this.updateTabbableNodes();\n }\n this.updateObservedNodes();\n return this;\n });\n __publicField(this, \"getReturnFocusNode\", (previousActiveElement) => {\n const node = this.getNodeForOption(\"setReturnFocus\", {\n params: [previousActiveElement]\n });\n return node ? node : node === false ? false : previousActiveElement;\n });\n __publicField(this, \"getOption\", (configOverrideOptions, optionName, configOptionName) => {\n return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : (\n // @ts-expect-error\n this.config[configOptionName || optionName]\n );\n });\n __publicField(this, \"getNodeForOption\", (optionName, { hasFallback = false, params = [] } = {}) => {\n let optionValue = this.config[optionName];\n if (typeof optionValue === \"function\") optionValue = optionValue(...params);\n if (optionValue === true) optionValue = void 0;\n if (!optionValue) {\n if (optionValue === void 0 || optionValue === false) {\n return optionValue;\n }\n throw new Error(`\\`${optionName}\\` was specified but was not a node, or did not return a node`);\n }\n let node = optionValue;\n if (typeof optionValue === \"string\") {\n try {\n node = this.doc.querySelector(optionValue);\n } catch (err) {\n throw new Error(`\\`${optionName}\\` appears to be an invalid selector; error=\"${err.message}\"`);\n }\n if (!node) {\n if (!hasFallback) {\n throw new Error(`\\`${optionName}\\` as selector refers to no known node`);\n }\n }\n }\n return node;\n });\n __publicField(this, \"findNextNavNode\", (opts) => {\n const { event, isBackward = false } = opts;\n const target = opts.target || getEventTarget(event);\n this.updateTabbableNodes();\n let destinationNode = null;\n if (this.state.tabbableGroups.length > 0) {\n const containerIndex = this.findContainerIndex(target, event);\n const containerGroup = containerIndex >= 0 ? this.state.containerGroups[containerIndex] : void 0;\n if (containerIndex < 0) {\n if (isBackward) {\n destinationNode = this.state.tabbableGroups[this.state.tabbableGroups.length - 1].lastTabbableNode;\n } else {\n destinationNode = this.state.tabbableGroups[0].firstTabbableNode;\n }\n } else if (isBackward) {\n let startOfGroupIndex = this.state.tabbableGroups.findIndex(\n ({ firstTabbableNode }) => target === firstTabbableNode\n );\n if (startOfGroupIndex < 0 && (containerGroup?.container === target || isFocusable(target) && !isTabbable(target) && !containerGroup?.nextTabbableNode(target, false))) {\n startOfGroupIndex = containerIndex;\n }\n if (startOfGroupIndex >= 0) {\n const destinationGroupIndex = startOfGroupIndex === 0 ? this.state.tabbableGroups.length - 1 : startOfGroupIndex - 1;\n const destinationGroup = this.state.tabbableGroups[destinationGroupIndex];\n destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;\n } else if (!isTabEvent(event)) {\n destinationNode = containerGroup?.nextTabbableNode(target, false);\n }\n } else {\n let lastOfGroupIndex = this.state.tabbableGroups.findIndex(\n ({ lastTabbableNode }) => target === lastTabbableNode\n );\n if (lastOfGroupIndex < 0 && (containerGroup?.container === target || isFocusable(target) && !isTabbable(target) && !containerGroup?.nextTabbableNode(target))) {\n lastOfGroupIndex = containerIndex;\n }\n if (lastOfGroupIndex >= 0) {\n const destinationGroupIndex = lastOfGroupIndex === this.state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;\n const destinationGroup = this.state.tabbableGroups[destinationGroupIndex];\n destinationNode = getTabIndex(target) >= 0 ? destinationGroup.firstTabbableNode : destinationGroup.firstDomTabbableNode;\n } else if (!isTabEvent(event)) {\n destinationNode = containerGroup?.nextTabbableNode(target);\n }\n }\n } else {\n destinationNode = this.getNodeForOption(\"fallbackFocus\");\n }\n return destinationNode;\n });\n this.trapStack = options.trapStack || sharedTrapStack;\n const config = {\n returnFocusOnDeactivate: true,\n escapeDeactivates: true,\n delayInitialFocus: true,\n isKeyForward(e) {\n return isTabEvent(e) && !e.shiftKey;\n },\n isKeyBackward(e) {\n return isTabEvent(e) && e.shiftKey;\n },\n ...options\n };\n this.doc = config.document || getDocument(Array.isArray(elements) ? elements[0] : elements);\n this.config = config;\n this.updateContainerElements(elements);\n this.setupMutationObserver();\n }\n get active() {\n return this.state.active;\n }\n get paused() {\n return this.state.paused;\n }\n findContainerIndex(element, event) {\n const composedPath = typeof event?.composedPath === \"function\" ? event.composedPath() : void 0;\n return this.state.containerGroups.findIndex(\n ({ container, tabbableNodes }) => container.contains(element) || composedPath?.includes(container) || tabbableNodes.find((node) => node === element)\n );\n }\n updateTabbableNodes() {\n this.state.containerGroups = this.state.containers.map((container) => {\n const tabbableNodes = getTabbables(container);\n const focusableNodes = getFocusables(container);\n const firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : void 0;\n const lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : void 0;\n const firstDomTabbableNode = focusableNodes.find((node) => isTabbable(node));\n const lastDomTabbableNode = focusableNodes.slice().reverse().find((node) => isTabbable(node));\n const posTabIndexesFound = !!tabbableNodes.find((node) => getTabIndex(node) > 0);\n function nextTabbableNode(node, forward = true) {\n const nodeIdx = tabbableNodes.indexOf(node);\n if (nodeIdx < 0) {\n if (forward) {\n return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find((el) => isTabbable(el));\n }\n return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find((el) => isTabbable(el));\n }\n return tabbableNodes[nodeIdx + (forward ? 1 : -1)];\n }\n return {\n container,\n tabbableNodes,\n focusableNodes,\n posTabIndexesFound,\n firstTabbableNode,\n lastTabbableNode,\n firstDomTabbableNode,\n lastDomTabbableNode,\n nextTabbableNode\n };\n });\n this.state.tabbableGroups = this.state.containerGroups.filter((group) => group.tabbableNodes.length > 0);\n if (this.state.tabbableGroups.length <= 0 && !this.getNodeForOption(\"fallbackFocus\")) {\n throw new Error(\n \"Your focus-trap must have at least one container with at least one tabbable node in it at all times\"\n );\n }\n if (this.state.containerGroups.find((g) => g.posTabIndexesFound) && this.state.containerGroups.length > 1) {\n throw new Error(\n \"At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.\"\n );\n }\n }\n addListeners() {\n if (!this.state.active) return;\n activeFocusTraps.activateTrap(this.trapStack, this);\n this.state.delayInitialFocusTimer = this.config.delayInitialFocus ? delay(() => {\n this.tryFocus(this.getInitialFocusNode());\n }) : this.tryFocus(this.getInitialFocusNode());\n this.listenerCleanups.push(\n addDomEvent(this.doc, \"focusin\", this.handleFocus, true),\n addDomEvent(this.doc, \"mousedown\", this.handlePointerDown, { capture: true, passive: false }),\n addDomEvent(this.doc, \"touchstart\", this.handlePointerDown, { capture: true, passive: false }),\n addDomEvent(this.doc, \"click\", this.handleClick, { capture: true, passive: false }),\n addDomEvent(this.doc, \"keydown\", this.handleTabKey, { capture: true, passive: false }),\n addDomEvent(this.doc, \"keydown\", this.handleEscapeKey)\n );\n return this;\n }\n removeListeners() {\n if (!this.state.active) return;\n this.listenerCleanups.forEach((cleanup) => cleanup());\n this.listenerCleanups = [];\n return this;\n }\n activate(activateOptions) {\n if (this.state.active) {\n return this;\n }\n const onActivate = this.getOption(activateOptions, \"onActivate\");\n const onPostActivate = this.getOption(activateOptions, \"onPostActivate\");\n const checkCanFocusTrap = this.getOption(activateOptions, \"checkCanFocusTrap\");\n if (!checkCanFocusTrap) {\n this.updateTabbableNodes();\n }\n this.state.active = true;\n this.state.paused = false;\n this.state.nodeFocusedBeforeActivation = this.doc.activeElement || null;\n onActivate?.();\n const finishActivation = () => {\n if (checkCanFocusTrap) {\n this.updateTabbableNodes();\n }\n this.addListeners();\n this.updateObservedNodes();\n onPostActivate?.();\n };\n if (checkCanFocusTrap) {\n checkCanFocusTrap(this.state.containers.concat()).then(finishActivation, finishActivation);\n return this;\n }\n finishActivation();\n return this;\n }\n};\nvar isTabEvent = (event) => event.key === \"Tab\";\nvar valueOrHandler = (value, ...params) => typeof value === \"function\" ? value(...params) : value;\nvar isEscapeEvent = (event) => !event.isComposing && event.key === \"Escape\";\nvar delay = (fn) => setTimeout(fn, 0);\nvar isSelectableInput = (node) => node.localName === \"input\" && \"select\" in node && typeof node.select === \"function\";\n\n// src/index.ts\nfunction trapFocus(el, options = {}) {\n let trap;\n const cleanup = raf(() => {\n const contentEl = typeof el === \"function\" ? el() : el;\n if (!contentEl) return;\n trap = new FocusTrap(contentEl, {\n escapeDeactivates: false,\n allowOutsideClick: true,\n preventScroll: true,\n returnFocusOnDeactivate: true,\n delayInitialFocus: false,\n fallbackFocus: contentEl,\n ...options,\n document: getDocument(contentEl)\n });\n try {\n trap.activate();\n } catch {\n }\n });\n return function destroy() {\n trap?.deactivate();\n cleanup();\n };\n}\n\nexport { FocusTrap, trapFocus };\n","import { setStyleProperty, setStyle, isIos } from '@zag-js/dom-query';\n\n// src/index.ts\nvar LOCK_CLASSNAME = \"data-scroll-lock\";\nfunction getPaddingProperty(documentElement) {\n const documentLeft = documentElement.getBoundingClientRect().left;\n const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft;\n return scrollbarX ? \"paddingLeft\" : \"paddingRight\";\n}\nfunction preventBodyScroll(_document) {\n const doc = _document ?? document;\n const win = doc.defaultView ?? window;\n const { documentElement, body } = doc;\n const locked = body.hasAttribute(LOCK_CLASSNAME);\n if (locked) return;\n body.setAttribute(LOCK_CLASSNAME, \"\");\n const scrollbarWidth = win.innerWidth - documentElement.clientWidth;\n const setScrollbarWidthProperty = () => setStyleProperty(documentElement, \"--scrollbar-width\", `${scrollbarWidth}px`);\n const paddingProperty = getPaddingProperty(documentElement);\n const setBodyStyle = () => setStyle(body, {\n overflow: \"hidden\",\n [paddingProperty]: `${scrollbarWidth}px`\n });\n const setBodyStyleIOS = () => {\n const { scrollX, scrollY, visualViewport } = win;\n const offsetLeft = visualViewport?.offsetLeft ?? 0;\n const offsetTop = visualViewport?.offsetTop ?? 0;\n const restoreStyle = setStyle(body, {\n position: \"fixed\",\n overflow: \"hidden\",\n top: `${-(scrollY - Math.floor(offsetTop))}px`,\n left: `${-(scrollX - Math.floor(offsetLeft))}px`,\n right: \"0\",\n [paddingProperty]: `${scrollbarWidth}px`\n });\n return () => {\n restoreStyle?.();\n win.scrollTo({ left: scrollX, top: scrollY, behavior: \"instant\" });\n };\n };\n const cleanups = [setScrollbarWidthProperty(), isIos() ? setBodyStyleIOS() : setBodyStyle()];\n return () => {\n cleanups.forEach((fn) => fn?.());\n body.removeAttribute(LOCK_CLASSNAME);\n };\n}\n\nexport { preventBodyScroll };\n"],"names":["counterMap","uncontrolledNodes","markerMap","lockCount","unwrapHost","node","correctTargets","parent","targets","target","correctedTarget","x","isIgnoredNode","walkTreeOutside","originalTarget","props","parentNode","markerName","controlAttribute","markerCounter","hiddenNodes","elementsToKeep","elementsToStop","keep","el","deep","alreadyHidden","counterValue","markerValue","e","getParentNode","hideOthers","raf","fn","frameId","ariaHidden","targetsOrFn","options","defer","func","v","cleanups","elements","__defProp","__defNormalProp","obj","key","value","__publicField","activeFocusTraps","trapStack","trap","activeTrap","trapIndex","sharedTrapStack","FocusTrap","event","getEventTarget","targetContained","isDocument","nextNode","navAcrossContainers","getTabIndex","mruContainerIdx","tabbableNodes","mruTabIdx","g","n","valueOrHandler","isBackward","destinationNode","isTabEvent","isEscapeEvent","win","mutations","mutation","container","isFocusable","firstTabbableGroup","getActiveElement","isSelectableInput","deactivateOptions","onDeactivate","onPostDeactivate","checkCanReturnFocus","returnFocus","finishDeactivation","delay","returnFocusNode","pauseOptions","onPause","onPostPause","unpauseOptions","onUnpause","onPostUnpause","containerElements","previousActiveElement","configOverrideOptions","optionName","configOptionName","hasFallback","params","optionValue","err","opts","containerIndex","containerGroup","startOfGroupIndex","firstTabbableNode","isTabbable","destinationGroupIndex","destinationGroup","lastOfGroupIndex","lastTabbableNode","config","getDocument","element","composedPath","getTabbables","focusableNodes","getFocusables","firstDomTabbableNode","lastDomTabbableNode","posTabIndexesFound","nextTabbableNode","forward","nodeIdx","group","addDomEvent","cleanup","activateOptions","onActivate","onPostActivate","checkCanFocusTrap","finishActivation","trapFocus","contentEl","LOCK_CLASSNAME","getPaddingProperty","documentElement","documentLeft","preventBodyScroll","_document","doc","body","scrollbarWidth","setScrollbarWidthProperty","setStyleProperty","paddingProperty","setBodyStyle","setStyle","setBodyStyleIOS","scrollX","scrollY","visualViewport","offsetLeft","offsetTop","restoreStyle","isIos"],"mappings":";AACA,IAAIA,IAA6B,oBAAI,QAAS,GAC1CC,IAAoC,oBAAI,QAAS,GACjDC,IAAY,CAAE,GACdC,IAAY,GACZC,IAAa,CAACC,MAASA,MAASA,EAAK,QAAQD,EAAWC,EAAK,UAAU,IACvEC,IAAiB,CAACC,GAAQC,MAAYA,EAAQ,IAAI,CAACC,MAAW;AAChE,MAAIF,EAAO,SAASE,CAAM,EAAG,QAAOA;AACpC,QAAMC,IAAkBN,EAAWK,CAAM;AACzC,SAAIC,KAAmBH,EAAO,SAASG,CAAe,IAC7CA,KAET,QAAQ,MAAM,gCAAgCD,GAAQ,2BAA2BF,GAAQ,iBAAiB,GACnG;AACT,CAAC,EAAE,OAAO,CAACI,MAAM,EAAQA,CAAE,GACvBC,IAAgB,CAACP,MACfA,EAAK,cAAc,0BACnBA,EAAK,cAAc,YACnBA,EAAK,aAAa,WAAW,IAAU,KACpCA,EAAK,QAAQ,uBAAuB,GAEzCQ,IAAkB,CAACC,GAAgBC,MAAU;AAC/C,QAAM,EAAE,YAAAC,GAAY,YAAAC,GAAY,kBAAAC,EAAgB,IAAIH,GAC9CP,IAAUF,EAAeU,GAAY,MAAM,QAAQF,CAAc,IAAIA,IAAiB,CAACA,CAAc,CAAC;AAC5G,EAAAZ,EAAUe,CAAU,MAAMf,EAAUe,CAAU,IAAoB,oBAAI;AACtE,QAAME,IAAgBjB,EAAUe,CAAU,GACpCG,IAAc,CAAE,GAChBC,IAAiC,oBAAI,IAAK,GAC1CC,IAAiB,IAAI,IAAId,CAAO,GAChCe,IAAO,CAACC,MAAO;AACnB,IAAI,CAACA,KAAMH,EAAe,IAAIG,CAAE,MAChCH,EAAe,IAAIG,CAAE,GACrBD,EAAKC,EAAG,UAAU;AAAA,EACnB;A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iB,qBAAqB,GAAGM,CAAc,IAAI,GAC9GG,IAAkBV,GAAmBC,CAAe,GACpDU,IAAe,MAAMC,EAASN,GAAM;AAAA,IACxC,UAAU;AAAA,IACV,CAACI,CAAe,GAAG,GAAGH,CAAc;AAAA,EACxC,CAAG,GACKM,IAAkB,MAAM;AAC5B,UAAM,EAAE,SAAAC,GAAS,SAAAC,GAAS,gBAAAC,EAAgB,IAAGjF,GACvCkF,IAAaD,GAAgB,cAAc,GAC3CE,IAAYF,GAAgB,aAAa,GACzCG,IAAeP,EAASN,GAAM;AAAA,MAClC,UAAU;AAAA,MACV,UAAU;AAAA,MACV,KAAK,GAAG,EAAES,IAAU,KAAK,MAAMG,CAAS,EAAE;AAAA,MAC1C,MAAM,GAAG,EAAEJ,IAAU,KAAK,MAAMG,CAAU,EAAE;AAAA,MAC5C,OAAO;AAAA,MACP,CAACP,CAAe,GAAG,GAAGH,CAAc;AAAA,IAC1C,CAAK;AACD,WAAO,MAAM;AACX,MAAAY,IAAgB,GAChBpF,EAAI,SAAS,EAAE,MAAM+E,GAAS,KAAKC,GAAS,UAAU,WAAW;AAAA,IAClE;AAAA,EACF,GACKhH,IAAW,CAACyG,EAA2B,GAAEY,EAAK,IAAKP,EAAe,IAAKF,GAAc;AAC3F,SAAO,MAAM;AACX,IAAA5G,EAAS,QAAQ,CAACR,MAAOA,IAAE,CAAI,GAC/B+G,EAAK,gBAAgBP,CAAc;AAAA,EACpC;AACH;","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"index-f4Ba8Pq7.js","sources":["../../node_modules/@zag-js/aria-hidden/dist/index.mjs","../../node_modules/@zag-js/focus-trap/dist/index.mjs","../../node_modules/@zag-js/remove-scroll/dist/index.mjs"],"sourcesContent":["// src/walk-tree-outside.ts\nvar counterMap = /* @__PURE__ */ new WeakMap();\nvar uncontrolledNodes = /* @__PURE__ */ new WeakMap();\nvar markerMap = {};\nvar lockCount = 0;\nvar unwrapHost = (node) => node && (node.host || unwrapHost(node.parentNode));\nvar correctTargets = (parent, targets) => targets.map((target) => {\n if (parent.contains(target)) return target;\n const correctedTarget = unwrapHost(target);\n if (correctedTarget && parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n console.error(\"[zag-js > ariaHidden] target\", target, \"in not contained inside\", parent, \". Doing nothing\");\n return null;\n}).filter((x) => Boolean(x));\nvar isIgnoredNode = (node) => {\n if (node.localName === \"next-route-announcer\") return true;\n if (node.localName === \"script\") return true;\n if (node.hasAttribute(\"aria-live\")) return true;\n return node.matches(\"[data-live-announcer]\");\n};\nvar walkTreeOutside = (originalTarget, props) => {\n const { parentNode, markerName, controlAttribute} = props;\n const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n markerMap[markerName] || (markerMap[markerName] = /* @__PURE__ */ new WeakMap());\n const markerCounter = markerMap[markerName];\n const hiddenNodes = [];\n const elementsToKeep = /* @__PURE__ */ new Set();\n const elementsToStop = new Set(targets);\n const keep = (el) => {\n if (!el || elementsToKeep.has(el)) return;\n elementsToKeep.add(el);\n keep(el.parentNode);\n };\n targets.forEach(keep);\n const deep = (parent) => {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n Array.prototype.forEach.call(parent.children, (node) => {\n if (elementsToKeep.has(node)) {\n deep(node);\n } else {\n try {\n if (isIgnoredNode(node)) return;\n const attr = node.getAttribute(controlAttribute);\n const alreadyHidden = attr === \"true\" ;\n const counterValue = (counterMap.get(node) || 0) + 1;\n const markerValue = (markerCounter.get(node) || 0) + 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenNodes.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledNodes.set(node, true);\n }\n if (markerValue === 1) {\n node.setAttribute(markerName, \"\");\n }\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, \"true\" );\n }\n } catch (e) {\n console.error(\"[zag-js > ariaHidden] cannot operate on \", node, e);\n }\n }\n });\n };\n deep(parentNode);\n elementsToKeep.clear();\n lockCount++;\n return () => {\n hiddenNodes.forEach((node) => {\n const counterValue = counterMap.get(node) - 1;\n const markerValue = markerCounter.get(node) - 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n if (!counterValue) {\n if (!uncontrolledNodes.has(node)) {\n node.removeAttribute(controlAttribute);\n }\n uncontrolledNodes.delete(node);\n }\n if (!markerValue) {\n node.removeAttribute(markerName);\n }\n });\n lockCount--;\n if (!lockCount) {\n counterMap = /* @__PURE__ */ new WeakMap();\n counterMap = /* @__PURE__ */ new WeakMap();\n uncontrolledNodes = /* @__PURE__ */ new WeakMap();\n markerMap = {};\n }\n };\n};\n\n// src/aria-hidden.ts\nvar getParentNode = (originalTarget) => {\n const target = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;\n return target.ownerDocument.body;\n};\nvar hideOthers = (originalTarget, parentNode = getParentNode(originalTarget), markerName = \"data-aria-hidden\") => {\n if (!parentNode) return;\n return walkTreeOutside(originalTarget, {\n parentNode,\n markerName,\n controlAttribute: \"aria-hidden\"});\n};\n\n// src/index.ts\nvar raf = (fn) => {\n const frameId = requestAnimationFrame(() => fn());\n return () => cancelAnimationFrame(frameId);\n};\nfunction ariaHidden(targetsOrFn, options = {}) {\n const { defer = true } = options;\n const func = defer ? raf : (v) => v();\n const cleanups = [];\n cleanups.push(\n func(() => {\n const targets = typeof targetsOrFn === \"function\" ? targetsOrFn() : targetsOrFn;\n const elements = targets.filter(Boolean);\n if (elements.length === 0) return;\n cleanups.push(hideOthers(elements));\n })\n );\n return () => {\n cleanups.forEach((fn) => fn?.());\n };\n}\n\nexport { ariaHidden };\n","import { getDocument, getTabbables, getFocusables, isTabbable, getTabIndex, addDomEvent, raf, getEventTarget, isDocument, isFocusable, getActiveElement } from '@zag-js/dom-query';\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nvar activeFocusTraps = {\n activateTrap(trapStack, trap) {\n if (trapStack.length > 0) {\n const activeTrap = trapStack[trapStack.length - 1];\n if (activeTrap !== trap) {\n activeTrap.pause();\n }\n }\n const trapIndex = trapStack.indexOf(trap);\n if (trapIndex === -1) {\n trapStack.push(trap);\n } else {\n trapStack.splice(trapIndex, 1);\n trapStack.push(trap);\n }\n },\n deactivateTrap(trapStack, trap) {\n const trapIndex = trapStack.indexOf(trap);\n if (trapIndex !== -1) {\n trapStack.splice(trapIndex, 1);\n }\n if (trapStack.length > 0) {\n trapStack[trapStack.length - 1].unpause();\n }\n }\n};\nvar sharedTrapStack = [];\nvar FocusTrap = class {\n constructor(elements, options) {\n __publicField(this, \"trapStack\");\n __publicField(this, \"config\");\n __publicField(this, \"doc\");\n __publicField(this, \"state\", {\n containers: [],\n containerGroups: [],\n tabbableGroups: [],\n nodeFocusedBeforeActivation: null,\n mostRecentlyFocusedNode: null,\n active: false,\n paused: false,\n delayInitialFocusTimer: void 0,\n recentNavEvent: void 0\n });\n __publicField(this, \"listenerCleanups\", []);\n __publicField(this, \"handleFocus\", (event) => {\n const target = getEventTarget(event);\n const targetContained = this.findContainerIndex(target, event) >= 0;\n if (targetContained || isDocument(target)) {\n if (targetContained) {\n this.state.mostRecentlyFocusedNode = target;\n }\n } else {\n event.stopImmediatePropagation();\n let nextNode;\n let navAcrossContainers = true;\n if (this.state.mostRecentlyFocusedNode) {\n if (getTabIndex(this.state.mostRecentlyFocusedNode) > 0) {\n const mruContainerIdx = this.findContainerIndex(this.state.mostRecentlyFocusedNode);\n const { tabbableNodes } = this.state.containerGroups[mruContainerIdx];\n if (tabbableNodes.length > 0) {\n const mruTabIdx = tabbableNodes.findIndex((node) => node === this.state.mostRecentlyFocusedNode);\n if (mruTabIdx >= 0) {\n if (this.config.isKeyForward(this.state.recentNavEvent)) {\n if (mruTabIdx + 1 < tabbableNodes.length) {\n nextNode = tabbableNodes[mruTabIdx + 1];\n navAcrossContainers = false;\n }\n } else {\n if (mruTabIdx - 1 >= 0) {\n nextNode = tabbableNodes[mruTabIdx - 1];\n navAcrossContainers = false;\n }\n }\n }\n }\n } else {\n if (!this.state.containerGroups.some((g) => g.tabbableNodes.some((n) => getTabIndex(n) > 0))) {\n navAcrossContainers = false;\n }\n }\n } else {\n navAcrossContainers = false;\n }\n if (navAcrossContainers) {\n nextNode = this.findNextNavNode({\n // move FROM the MRU node, not event-related node (which will be the node that is\n // outside the trap causing the focus escape we're trying to fix)\n target: this.state.mostRecentlyFocusedNode,\n isBackward: this.config.isKeyBackward(this.state.recentNavEvent)\n });\n }\n if (nextNode) {\n this.tryFocus(nextNode);\n } else {\n this.tryFocus(this.state.mostRecentlyFocusedNode || this.getInitialFocusNode());\n }\n }\n this.state.recentNavEvent = void 0;\n });\n __publicField(this, \"handlePointerDown\", (event) => {\n const target = getEventTarget(event);\n if (this.findContainerIndex(target, event) >= 0) {\n return;\n }\n if (valueOrHandler(this.config.clickOutsideDeactivates, event)) {\n this.deactivate({ returnFocus: this.config.returnFocusOnDeactivate });\n return;\n }\n if (valueOrHandler(this.config.allowOutsideClick, event)) {\n return;\n }\n event.preventDefault();\n });\n __publicField(this, \"handleClick\", (event) => {\n const target = getEventTarget(event);\n if (this.findContainerIndex(target, event) >= 0) {\n return;\n }\n if (valueOrHandler(this.config.clickOutsideDeactivates, event)) {\n return;\n }\n if (valueOrHandler(this.config.allowOutsideClick, event)) {\n return;\n }\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n __publicField(this, \"handleTabKey\", (event) => {\n if (this.config.isKeyForward(event) || this.config.isKeyBackward(event)) {\n this.state.recentNavEvent = event;\n const isBackward = this.config.isKeyBackward(event);\n const destinationNode = this.findNextNavNode({ event, isBackward });\n if (!destinationNode) return;\n if (isTabEvent(event)) {\n event.preventDefault();\n }\n this.tryFocus(destinationNode);\n }\n });\n __publicField(this, \"handleEscapeKey\", (event) => {\n if (isEscapeEvent(event) && valueOrHandler(this.config.escapeDeactivates, event) !== false) {\n event.preventDefault();\n this.deactivate();\n }\n });\n __publicField(this, \"_mutationObserver\");\n __publicField(this, \"setupMutationObserver\", () => {\n const win = this.doc.defaultView || window;\n this._mutationObserver = new win.MutationObserver((mutations) => {\n const isFocusedNodeRemoved = mutations.some((mutation) => {\n const removedNodes = Array.from(mutation.removedNodes);\n return removedNodes.some((node) => node === this.state.mostRecentlyFocusedNode);\n });\n if (isFocusedNodeRemoved) {\n this.tryFocus(this.getInitialFocusNode());\n }\n });\n });\n __publicField(this, \"updateObservedNodes\", () => {\n this._mutationObserver?.disconnect();\n if (this.state.active && !this.state.paused) {\n this.state.containers.map((container) => {\n this._mutationObserver?.observe(container, { subtree: true, childList: true });\n });\n }\n });\n __publicField(this, \"getInitialFocusNode\", () => {\n let node = this.getNodeForOption(\"initialFocus\", { hasFallback: true });\n if (node === false) {\n return false;\n }\n if (node === void 0 || node && !isFocusable(node)) {\n if (this.findContainerIndex(this.doc.activeElement) >= 0) {\n node = this.doc.activeElement;\n } else {\n const firstTabbableGroup = this.state.tabbableGroups[0];\n const firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;\n node = firstTabbableNode || this.getNodeForOption(\"fallbackFocus\");\n }\n } else if (node === null) {\n node = this.getNodeForOption(\"fallbackFocus\");\n }\n if (!node) {\n throw new Error(\"Your focus-trap needs to have at least one focusable element\");\n }\n if (!node.isConnected) {\n node = this.getNodeForOption(\"fallbackFocus\");\n }\n return node;\n });\n __publicField(this, \"tryFocus\", (node) => {\n if (node === false) return;\n if (node === getActiveElement(this.doc)) return;\n if (!node || !node.focus) {\n this.tryFocus(this.getInitialFocusNode());\n return;\n }\n node.focus({ preventScroll: !!this.config.preventScroll });\n this.state.mostRecentlyFocusedNode = node;\n if (isSelectableInput(node)) {\n node.select();\n }\n });\n __publicField(this, \"deactivate\", (deactivateOptions) => {\n if (!this.state.active) return this;\n const options = {\n onDeactivate: this.config.onDeactivate,\n onPostDeactivate: this.config.onPostDeactivate,\n checkCanReturnFocus: this.config.checkCanReturnFocus,\n ...deactivateOptions\n };\n clearTimeout(this.state.delayInitialFocusTimer);\n this.state.delayInitialFocusTimer = void 0;\n this.removeListeners();\n this.state.active = false;\n this.state.paused = false;\n this.updateObservedNodes();\n activeFocusTraps.deactivateTrap(this.trapStack, this);\n const onDeactivate = this.getOption(options, \"onDeactivate\");\n const onPostDeactivate = this.getOption(options, \"onPostDeactivate\");\n const checkCanReturnFocus = this.getOption(options, \"checkCanReturnFocus\");\n const returnFocus = this.getOption(options, \"returnFocus\", \"returnFocusOnDeactivate\");\n onDeactivate?.();\n const finishDeactivation = () => {\n delay(() => {\n if (returnFocus) {\n const returnFocusNode = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);\n this.tryFocus(returnFocusNode);\n }\n onPostDeactivate?.();\n });\n };\n if (returnFocus && checkCanReturnFocus) {\n const returnFocusNode = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);\n checkCanReturnFocus(returnFocusNode).then(finishDeactivation, finishDeactivation);\n return this;\n }\n finishDeactivation();\n return this;\n });\n __publicField(this, \"pause\", (pauseOptions) => {\n if (this.state.paused || !this.state.active) {\n return this;\n }\n const onPause = this.getOption(pauseOptions, \"onPause\");\n const onPostPause = this.getOption(pauseOptions, \"onPostPause\");\n this.state.paused = true;\n onPause?.();\n this.removeListeners();\n this.updateObservedNodes();\n onPostPause?.();\n return this;\n });\n __publicField(this, \"unpause\", (unpauseOptions) => {\n if (!this.state.paused || !this.state.active) {\n return this;\n }\n const onUnpause = this.getOption(unpauseOptions, \"onUnpause\");\n const onPostUnpause = this.getOption(unpauseOptions, \"onPostUnpause\");\n this.state.paused = false;\n onUnpause?.();\n this.updateTabbableNodes();\n this.addListeners();\n this.updateObservedNodes();\n onPostUnpause?.();\n return this;\n });\n __publicField(this, \"updateContainerElements\", (containerElements) => {\n this.state.containers = Array.isArray(containerElements) ? containerElements.filter(Boolean) : [containerElements].filter(Boolean);\n if (this.state.active) {\n this.updateTabbableNodes();\n }\n this.updateObservedNodes();\n return this;\n });\n __publicField(this, \"getReturnFocusNode\", (previousActiveElement) => {\n const node = this.getNodeForOption(\"setReturnFocus\", {\n params: [previousActiveElement]\n });\n return node ? node : node === false ? false : previousActiveElement;\n });\n __publicField(this, \"getOption\", (configOverrideOptions, optionName, configOptionName) => {\n return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : (\n // @ts-expect-error\n this.config[configOptionName || optionName]\n );\n });\n __publicField(this, \"getNodeForOption\", (optionName, { hasFallback = false, params = [] } = {}) => {\n let optionValue = this.config[optionName];\n if (typeof optionValue === \"function\") optionValue = optionValue(...params);\n if (optionValue === true) optionValue = void 0;\n if (!optionValue) {\n if (optionValue === void 0 || optionValue === false) {\n return optionValue;\n }\n throw new Error(`\\`${optionName}\\` was specified but was not a node, or did not return a node`);\n }\n let node = optionValue;\n if (typeof optionValue === \"string\") {\n try {\n node = this.doc.querySelector(optionValue);\n } catch (err) {\n throw new Error(`\\`${optionName}\\` appears to be an invalid selector; error=\"${err.message}\"`);\n }\n if (!node) {\n if (!hasFallback) {\n throw new Error(`\\`${optionName}\\` as selector refers to no known node`);\n }\n }\n }\n return node;\n });\n __publicField(this, \"findNextNavNode\", (opts) => {\n const { event, isBackward = false } = opts;\n const target = opts.target || getEventTarget(event);\n this.updateTabbableNodes();\n let destinationNode = null;\n if (this.state.tabbableGroups.length > 0) {\n const containerIndex = this.findContainerIndex(target, event);\n const containerGroup = containerIndex >= 0 ? this.state.containerGroups[containerIndex] : void 0;\n if (containerIndex < 0) {\n if (isBackward) {\n destinationNode = this.state.tabbableGroups[this.state.tabbableGroups.length - 1].lastTabbableNode;\n } else {\n destinationNode = this.state.tabbableGroups[0].firstTabbableNode;\n }\n } else if (isBackward) {\n let startOfGroupIndex = this.state.tabbableGroups.findIndex(\n ({ firstTabbableNode }) => target === firstTabbableNode\n );\n if (startOfGroupIndex < 0 && (containerGroup?.container === target || isFocusable(target) && !isTabbable(target) && !containerGroup?.nextTabbableNode(target, false))) {\n startOfGroupIndex = containerIndex;\n }\n if (startOfGroupIndex >= 0) {\n const destinationGroupIndex = startOfGroupIndex === 0 ? this.state.tabbableGroups.length - 1 : startOfGroupIndex - 1;\n const destinationGroup = this.state.tabbableGroups[destinationGroupIndex];\n destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;\n } else if (!isTabEvent(event)) {\n destinationNode = containerGroup?.nextTabbableNode(target, false);\n }\n } else {\n let lastOfGroupIndex = this.state.tabbableGroups.findIndex(\n ({ lastTabbableNode }) => target === lastTabbableNode\n );\n if (lastOfGroupIndex < 0 && (containerGroup?.container === target || isFocusable(target) && !isTabbable(target) && !containerGroup?.nextTabbableNode(target))) {\n lastOfGroupIndex = containerIndex;\n }\n if (lastOfGroupIndex >= 0) {\n const destinationGroupIndex = lastOfGroupIndex === this.state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;\n const destinationGroup = this.state.tabbableGroups[destinationGroupIndex];\n destinationNode = getTabIndex(target) >= 0 ? destinationGroup.firstTabbableNode : destinationGroup.firstDomTabbableNode;\n } else if (!isTabEvent(event)) {\n destinationNode = containerGroup?.nextTabbableNode(target);\n }\n }\n } else {\n destinationNode = this.getNodeForOption(\"fallbackFocus\");\n }\n return destinationNode;\n });\n this.trapStack = options.trapStack || sharedTrapStack;\n const config = {\n returnFocusOnDeactivate: true,\n escapeDeactivates: true,\n delayInitialFocus: true,\n isKeyForward(e) {\n return isTabEvent(e) && !e.shiftKey;\n },\n isKeyBackward(e) {\n return isTabEvent(e) && e.shiftKey;\n },\n ...options\n };\n this.doc = config.document || getDocument(Array.isArray(elements) ? elements[0] : elements);\n this.config = config;\n this.updateContainerElements(elements);\n this.setupMutationObserver();\n }\n get active() {\n return this.state.active;\n }\n get paused() {\n return this.state.paused;\n }\n findContainerIndex(element, event) {\n const composedPath = typeof event?.composedPath === \"function\" ? event.composedPath() : void 0;\n return this.state.containerGroups.findIndex(\n ({ container, tabbableNodes }) => container.contains(element) || composedPath?.includes(container) || tabbableNodes.find((node) => node === element)\n );\n }\n updateTabbableNodes() {\n this.state.containerGroups = this.state.containers.map((container) => {\n const tabbableNodes = getTabbables(container);\n const focusableNodes = getFocusables(container);\n const firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : void 0;\n const lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : void 0;\n const firstDomTabbableNode = focusableNodes.find((node) => isTabbable(node));\n const lastDomTabbableNode = focusableNodes.slice().reverse().find((node) => isTabbable(node));\n const posTabIndexesFound = !!tabbableNodes.find((node) => getTabIndex(node) > 0);\n function nextTabbableNode(node, forward = true) {\n const nodeIdx = tabbableNodes.indexOf(node);\n if (nodeIdx < 0) {\n if (forward) {\n return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find((el) => isTabbable(el));\n }\n return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find((el) => isTabbable(el));\n }\n return tabbableNodes[nodeIdx + (forward ? 1 : -1)];\n }\n return {\n container,\n tabbableNodes,\n focusableNodes,\n posTabIndexesFound,\n firstTabbableNode,\n lastTabbableNode,\n firstDomTabbableNode,\n lastDomTabbableNode,\n nextTabbableNode\n };\n });\n this.state.tabbableGroups = this.state.containerGroups.filter((group) => group.tabbableNodes.length > 0);\n if (this.state.tabbableGroups.length <= 0 && !this.getNodeForOption(\"fallbackFocus\")) {\n throw new Error(\n \"Your focus-trap must have at least one container with at least one tabbable node in it at all times\"\n );\n }\n if (this.state.containerGroups.find((g) => g.posTabIndexesFound) && this.state.containerGroups.length > 1) {\n throw new Error(\n \"At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.\"\n );\n }\n }\n addListeners() {\n if (!this.state.active) return;\n activeFocusTraps.activateTrap(this.trapStack, this);\n this.state.delayInitialFocusTimer = this.config.delayInitialFocus ? delay(() => {\n this.tryFocus(this.getInitialFocusNode());\n }) : this.tryFocus(this.getInitialFocusNode());\n this.listenerCleanups.push(\n addDomEvent(this.doc, \"focusin\", this.handleFocus, true),\n addDomEvent(this.doc, \"mousedown\", this.handlePointerDown, { capture: true, passive: false }),\n addDomEvent(this.doc, \"touchstart\", this.handlePointerDown, { capture: true, passive: false }),\n addDomEvent(this.doc, \"click\", this.handleClick, { capture: true, passive: false }),\n addDomEvent(this.doc, \"keydown\", this.handleTabKey, { capture: true, passive: false }),\n addDomEvent(this.doc, \"keydown\", this.handleEscapeKey)\n );\n return this;\n }\n removeListeners() {\n if (!this.state.active) return;\n this.listenerCleanups.forEach((cleanup) => cleanup());\n this.listenerCleanups = [];\n return this;\n }\n activate(activateOptions) {\n if (this.state.active) {\n return this;\n }\n const onActivate = this.getOption(activateOptions, \"onActivate\");\n const onPostActivate = this.getOption(activateOptions, \"onPostActivate\");\n const checkCanFocusTrap = this.getOption(activateOptions, \"checkCanFocusTrap\");\n if (!checkCanFocusTrap) {\n this.updateTabbableNodes();\n }\n this.state.active = true;\n this.state.paused = false;\n this.state.nodeFocusedBeforeActivation = this.doc.activeElement || null;\n onActivate?.();\n const finishActivation = () => {\n if (checkCanFocusTrap) {\n this.updateTabbableNodes();\n }\n this.addListeners();\n this.updateObservedNodes();\n onPostActivate?.();\n };\n if (checkCanFocusTrap) {\n checkCanFocusTrap(this.state.containers.concat()).then(finishActivation, finishActivation);\n return this;\n }\n finishActivation();\n return this;\n }\n};\nvar isTabEvent = (event) => event.key === \"Tab\";\nvar valueOrHandler = (value, ...params) => typeof value === \"function\" ? value(...params) : value;\nvar isEscapeEvent = (event) => !event.isComposing && event.key === \"Escape\";\nvar delay = (fn) => setTimeout(fn, 0);\nvar isSelectableInput = (node) => node.localName === \"input\" && \"select\" in node && typeof node.select === \"function\";\n\n// src/index.ts\nfunction trapFocus(el, options = {}) {\n let trap;\n const cleanup = raf(() => {\n const contentEl = typeof el === \"function\" ? el() : el;\n if (!contentEl) return;\n trap = new FocusTrap(contentEl, {\n escapeDeactivates: false,\n allowOutsideClick: true,\n preventScroll: true,\n returnFocusOnDeactivate: true,\n delayInitialFocus: false,\n fallbackFocus: contentEl,\n ...options,\n document: getDocument(contentEl)\n });\n try {\n trap.activate();\n } catch {\n }\n });\n return function destroy() {\n trap?.deactivate();\n cleanup();\n };\n}\n\nexport { FocusTrap, trapFocus };\n","import { setStyleProperty, setStyle, isIos } from '@zag-js/dom-query';\n\n// src/index.ts\nvar LOCK_CLASSNAME = \"data-scroll-lock\";\nfunction getPaddingProperty(documentElement) {\n const documentLeft = documentElement.getBoundingClientRect().left;\n const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft;\n return scrollbarX ? \"paddingLeft\" : \"paddingRight\";\n}\nfunction preventBodyScroll(_document) {\n const doc = _document ?? document;\n const win = doc.defaultView ?? window;\n const { documentElement, body } = doc;\n const locked = body.hasAttribute(LOCK_CLASSNAME);\n if (locked) return;\n body.setAttribute(LOCK_CLASSNAME, \"\");\n const scrollbarWidth = win.innerWidth - documentElement.clientWidth;\n const setScrollbarWidthProperty = () => setStyleProperty(documentElement, \"--scrollbar-width\", `${scrollbarWidth}px`);\n const paddingProperty = getPaddingProperty(documentElement);\n const setBodyStyle = () => setStyle(body, {\n overflow: \"hidden\",\n [paddingProperty]: `${scrollbarWidth}px`\n });\n const setBodyStyleIOS = () => {\n const { scrollX, scrollY, visualViewport } = win;\n const offsetLeft = visualViewport?.offsetLeft ?? 0;\n const offsetTop = visualViewport?.offsetTop ?? 0;\n const restoreStyle = setStyle(body, {\n position: \"fixed\",\n overflow: \"hidden\",\n top: `${-(scrollY - Math.floor(offsetTop))}px`,\n left: `${-(scrollX - Math.floor(offsetLeft))}px`,\n right: \"0\",\n [paddingProperty]: `${scrollbarWidth}px`\n });\n return () => {\n restoreStyle?.();\n win.scrollTo({ left: scrollX, top: scrollY, behavior: \"instant\" });\n };\n };\n const cleanups = [setScrollbarWidthProperty(), isIos() ? setBodyStyleIOS() : setBodyStyle()];\n return () => {\n cleanups.forEach((fn) => fn?.());\n body.removeAttribute(LOCK_CLASSNAME);\n };\n}\n\nexport { preventBodyScroll };\n"],"names":["counterMap","uncontrolledNodes","markerMap","lockCount","unwrapHost","node","correctTargets","parent","targets","target","correctedTarget","x","isIgnoredNode","walkTreeOutside","originalTarget","props","parentNode","markerName","controlAttribute","markerCounter","hiddenNodes","elementsToKeep","elementsToStop","keep","el","deep","alreadyHidden","counterValue","markerValue","e","getParentNode","hideOthers","raf","fn","frameId","ariaHidden","targetsOrFn","options","defer","func","v","cleanups","elements","__defProp","__defNormalProp","obj","key","value","__publicField","activeFocusTraps","trapStack","trap","activeTrap","trapIndex","sharedTrapStack","FocusTrap","event","getEventTarget","targetContained","isDocument","nextNode","navAcrossContainers","getTabIndex","mruContainerIdx","tabbableNodes","mruTabIdx","g","n","valueOrHandler","isBackward","destinationNode","isTabEvent","isEscapeEvent","win","mutations","mutation","container","isFocusable","firstTabbableGroup","getActiveElement","isSelectableInput","deactivateOptions","onDeactivate","onPostDeactivate","checkCanReturnFocus","returnFocus","finishDeactivation","delay","returnFocusNode","pauseOptions","onPause","onPostPause","unpauseOptions","onUnpause","onPostUnpause","containerElements","previousActiveElement","configOverrideOptions","optionName","configOptionName","hasFallback","params","optionValue","err","opts","containerIndex","containerGroup","startOfGroupIndex","firstTabbableNode","isTabbable","destinationGroupIndex","destinationGroup","lastOfGroupIndex","lastTabbableNode","config","getDocument","element","composedPath","getTabbables","focusableNodes","getFocusables","firstDomTabbableNode","lastDomTabbableNode","posTabIndexesFound","nextTabbableNode","forward","nodeIdx","group","addDomEvent","cleanup","activateOptions","onActivate","onPostActivate","checkCanFocusTrap","finishActivation","trapFocus","contentEl","LOCK_CLASSNAME","getPaddingProperty","documentElement","documentLeft","preventBodyScroll","_document","doc","body","scrollbarWidth","setScrollbarWidthProperty","setStyleProperty","paddingProperty","setBodyStyle","setStyle","setBodyStyleIOS","scrollX","scrollY","visualViewport","offsetLeft","offsetTop","restoreStyle","isIos"],"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,CAAc;AAAA,EACxC,CAAG,GACKM,IAAkB,MAAM;AAC5B,UAAM,EAAE,SAAAC,GAAS,SAAAC,GAAS,gBAAAC,EAAgB,IAAGjF,GACvCkF,IAAaD,GAAgB,cAAc,GAC3CE,IAAYF,GAAgB,aAAa,GACzCG,IAAeP,EAASN,GAAM;AAAA,MAClC,UAAU;AAAA,MACV,UAAU;AAAA,MACV,KAAK,GAAG,EAAES,IAAU,KAAK,MAAMG,CAAS,EAAE;AAAA,MAC1C,MAAM,GAAG,EAAEJ,IAAU,KAAK,MAAMG,CAAU,EAAE;AAAA,MAC5C,OAAO;AAAA,MACP,CAACP,CAAe,GAAG,GAAGH,CAAc;AAAA,IAC1C,CAAK;AACD,WAAO,MAAM;AACX,MAAAY,IAAgB,GAChBpF,EAAI,SAAS,EAAE,MAAM+E,GAAS,KAAKC,GAAS,UAAU,WAAW;AAAA,IAClE;AAAA,EACF,GACKhH,IAAW,CAACyG,EAA2B,GAAEY,EAAK,IAAKP,EAAe,IAAKF,GAAc;AAC3F,SAAO,MAAM;AACX,IAAA5G,EAAS,QAAQ,CAACR,MAAOA,IAAE,CAAI,GAC/B+G,EAAK,gBAAgBP,CAAc;AAAA,EACpC;AACH;","x_google_ignoreList":[0,1,2]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const u=require("./index-BlGAWSIX.js"),N=require("./portal-TWtD47zg.js");var L=u.createAnatomy("pinInput").parts("root","label","input","control"),A=L.build(),v=e=>e.ids?.root??`pin-input:${e.id}`,b=(e,t)=>e.ids?.input?.(t)??`pin-input:${e.id}:${t}`,T=e=>e.ids?.hiddenInput??`pin-input:${e.id}:hidden`,U=e=>e.ids?.label??`pin-input:${e.id}:label`,S=e=>e.ids?.control??`pin-input:${e.id}:control`,R=e=>e.getById(v(e)),y=e=>{const a=`input[data-ownedby=${CSS.escape(v(e))}]`;return u.queryAll(R(e),a)},g=(e,t)=>y(e)[t],O=e=>y(e)[0],F=e=>e.getById(T(e)),E=(e,t)=>{e.value=t,e.setAttribute("value",t)},$={numeric:/^[0-9]+$/,alphabetic:/^[A-Za-z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/i};function _(e,t){return e?!!$[e]?.test(t):!0}function w(e,t,a){return a?new RegExp(a,"g").test(e):_(t,e)}function B(e,t){const{send:a,context:l,computed:o,prop:n,scope:d}=e,f=o("isValueComplete"),I=n("invalid"),h=n("translations"),m=l.get("focusedIndex");function V(){O(d)?.focus()}return{focus:V,count:l.get("count"),items:Array.from({length:l.get("count")}).map((c,r)=>r),value:l.get("value"),valueAsString:o("valueAsString"),complete:f,setValue(c){Array.isArray(c)||u.invariant("[pin-input/setValue] value must be an array"),a({type:"VALUE.SET",value:c})},clearValue(){a({type:"VALUE.CLEAR"})},setValueAtIndex(c,r){a({type:"VALUE.SET",value:r,index:c})},getRootProps(){return t.element({dir:n("dir"),...A.root.attrs,id:v(d),"data-invalid":u.dataAttr(I),"data-disabled":u.dataAttr(n("disabled")),"data-complete":u.dataAttr(f),"data-readonly":u.dataAttr(n("readOnly"))})},getLabelProps(){return t.label({...A.label.attrs,dir:n("dir"),htmlFor:T(d),id:U(d),"data-invalid":u.dataAttr(I),"data-disabled":u.dataAttr(n("disabled")),"data-complete":u.dataAttr(f),"data-readonly":u.dataAttr(n("readOnly")),onClick(c){c.preventDefault(),V()}})},getHiddenInputProps(){return t.input({"aria-hidden":!0,type:"text",tabIndex:-1,id:T(d),readOnly:n("readOnly"),disabled:n("disabled"),required:n("required"),name:n("name"),form:n("form"),style:u.visuallyHiddenStyle,maxLength:o("valueLength"),defaultValue:o("valueAsString")})},getControlProps(){return t.element({...A.control.attrs,dir:n("dir"),id:S(d)})},getInputProps(c){const{index:r}=c,P=n("type")==="numeric"?"tel":"text";return t.input({...A.input.attrs,dir:n("dir"),disabled:n("disabled"),"data-disabled":u.dataAttr(n("disabled")),"data-complete":u.dataAttr(f),id:b(d,r.toString()),"data-index":r,"data-ownedby":v(d),"aria-label":h?.inputLabel?.(r,o("valueLength")),inputMode:n("otp")||n("type")==="numeric"?"numeric":"text","aria-invalid":u.ariaAttr(I),"data-invalid":u.dataAttr(I),type:n("mask")?"password":P,defaultValue:l.get("value")[r]||"",readOnly:n("readOnly"),autoCapitalize:"none",autoComplete:n("otp")?"one-time-code":"off",placeholder:m===r?"":n("placeholder"),onBeforeInput(s){try{const i=u.getBeforeInputValue(s);w(i,n("type"),n("pattern"))||(a({type:"VALUE.INVALID",value:i}),s.preventDefault()),i.length>2&&s.currentTarget.setSelectionRange(0,1,"forward")}catch{}},onChange(s){const i=u.getNativeEvent(s),{value:p}=s.currentTarget;if(i.inputType==="insertFromPaste"||p.length>2){a({type:"INPUT.PASTE",value:p}),s.currentTarget.value=p[0],s.preventDefault();return}if(i.inputType==="deleteContentBackward"){a({type:"INPUT.BACKSPACE"});return}a({type:"INPUT.CHANGE",value:p,index:r})},onKeyDown(s){if(s.defaultPrevented||u.isComposingEvent(s)||u.isModifierKey(s))return;const p={Backspace(){a({type:"INPUT.BACKSPACE"})},Delete(){a({type:"INPUT.DELETE"})},ArrowLeft(){a({type:"INPUT.ARROW_LEFT"})},ArrowRight(){a({type:"INPUT.ARROW_RIGHT"})},Enter(){a({type:"INPUT.ENTER"})}}[u.getEventKey(s,{dir:n("dir"),orientation:"horizontal"})];p&&(p(s),s.preventDefault())},onFocus(){a({type:"INPUT.FOCUS",index:r})},onBlur(s){const i=s.relatedTarget;u.isHTMLElement(i)&&i.dataset.ownedby===v(d)||a({type:"INPUT.BLUR",index:r})}})}}}var{choose:q,createMachine:D}=u.setup(),M=D({props({props:e}){return{placeholder:"○",otp:!1,type:"numeric",defaultValue:e.count?x([],e.count):[],...e,translations:{inputLabel:(t,a)=>`pin code ${t+1} of ${a}`,...e.translations}}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({value:e("value"),defaultValue:e("defaultValue"),isEqual:u.isEqual,onChange(a){e("onValueChange")?.({value:a,valueAsString:a.join("")})}})),focusedIndex:t(()=>({sync:!0,defaultValue:-1})),count:t(()=>({defaultValue:e("count")}))}},computed:{_value:({context:e})=>x(e.get("value"),e.get("count")),valueLength:({computed:e})=>e("_value").length,filledValueLength:({computed:e})=>e("_value").filter(t=>t?.trim()!=="").length,isValueComplete:({computed:e})=>e("valueLength")===e("filledValueLength"),valueAsString:({computed:e})=>e("_value").join(""),focusedValue:({computed:e,context:t})=>e("_value")[t.get("focusedIndex")]||""},entry:q([{guard:"autoFocus",actions:["setInputCount","setFocusIndexToFirst"]},{actions:["setInputCount"]}]),watch({action:e,track:t,context:a,computed:l}){t([()=>a.get("focusedIndex")],()=>{e(["focusInput","selectInputIfNeeded"])}),t([()=>a.get("value").join(",")],()=>{e(["syncInputElements","dispatchInputEvent"])}),t([()=>l("isValueComplete")],()=>{e(["invokeOnComplete","blurFocusedInputIfNeeded"])})},on:{"VALUE.SET":[{guard:"hasIndex",actions:["setValueAtIndex"]},{actions:["setValue"]}],"VALUE.CLEAR":{actions:["clearValue","setFocusIndexToFirst"]}},states:{idle:{on:{"INPUT.FOCUS":{target:"focused",actions:["setFocusedIndex"]}}},focused:{on:{"INPUT.CHANGE":{actions:["setFocusedValue","syncInputValue","setNextFocusedIndex"]},"INPUT.PASTE":{actions:["setPastedValue","setLastValueFocusIndex"]},"INPUT.FOCUS":{actions:["setFocusedIndex"]},"INPUT.BLUR":{target:"idle",actions:["clearFocusedIndex"]},"INPUT.DELETE":{guard:"hasValue",actions:["clearFocusedValue"]},"INPUT.ARROW_LEFT":{actions:["setPrevFocusedIndex"]},"INPUT.ARROW_RIGHT":{actions:["setNextFocusedIndex"]},"INPUT.BACKSPACE":[{guard:"hasValue",actions:["clearFocusedValue"]},{actions:["setPrevFocusedIndex","clearFocusedValue"]}],"INPUT.ENTER":{guard:"isValueComplete",actions:["requestFormSubmit"]},"VALUE.INVALID":{actions:["invokeOnInvalid"]}}}},implementations:{guards:{autoFocus:({prop:e})=>!!e("autoFocus"),hasValue:({context:e})=>e.get("value")[e.get("focusedIndex")]!=="",isValueComplete:({computed:e})=>e("isValueComplete"),hasIndex:({event:e})=>e.index!==void 0},actions:{dispatchInputEvent({computed:e,scope:t}){const a=F(t);u.dispatchInputValueEvent(a,{value:e("valueAsString")})},setInputCount({scope:e,context:t,prop:a}){if(a("count"))return;const l=y(e);t.set("count",l.length)},focusInput({context:e,scope:t}){const a=e.get("focusedIndex");a!==-1&&g(t,a)?.focus({preventScroll:!0})},selectInputIfNeeded({context:e,prop:t,scope:a}){const l=e.get("focusedIndex");!t("selectOnFocus")||l===-1||u.raf(()=>{g(a,l)?.select()})},invokeOnComplete({computed:e,prop:t}){e("isValueComplete")&&t("onValueComplete")?.({value:e("_value"),valueAsString:e("valueAsString")})},invokeOnInvalid({context:e,event:t,prop:a}){a("onValueInvalid")?.({value:t.value,index:e.get("focusedIndex")})},clearFocusedIndex({context:e}){e.set("focusedIndex",-1)},setFocusedIndex({context:e,event:t}){e.set("focusedIndex",t.index)},setValue({context:e,event:t}){const a=x(t.value,e.get("count"));e.set("value",a)},setFocusedValue({context:e,event:t,computed:a,flush:l}){const o=a("focusedValue"),n=e.get("focusedIndex"),d=C(o,t.value);l(()=>{e.set("value",u.setValueAtIndex(a("_value"),n,d))})},revertInputValue({context:e,computed:t,scope:a}){const l=g(a,e.get("focusedIndex"));E(l,t("focusedValue"))},syncInputValue({context:e,event:t,scope:a}){const l=e.get("value"),o=g(a,t.index);E(o,l[t.index])},syncInputElements({context:e,scope:t}){const a=y(t),l=e.get("value");a.forEach((o,n)=>{E(o,l[n])})},setPastedValue({context:e,event:t,computed:a,flush:l}){u.raf(()=>{const o=a("valueAsString"),n=e.get("focusedIndex"),d=a("valueLength"),f=a("filledValueLength"),I=Math.min(n,f),h=I>0?o.substring(0,n):"",m=t.value.substring(0,d-I),V=x(`${h}${m}`.split(""),d);l(()=>{e.set("value",V)})})},setValueAtIndex({context:e,event:t,computed:a}){const l=C(a("focusedValue"),t.value);e.set("value",u.setValueAtIndex(a("_value"),t.index,l))},clearValue({context:e}){const t=Array.from({length:e.get("count")}).fill("");e.set("value",t)},clearFocusedValue({context:e,computed:t}){const a=e.get("focusedIndex");a!==-1&&e.set("value",u.setValueAtIndex(t("_value"),a,""))},setFocusIndexToFirst({context:e}){e.set("focusedIndex",0)},setNextFocusedIndex({context:e,computed:t}){e.set("focusedIndex",Math.min(e.get("focusedIndex")+1,t("valueLength")-1))},setPrevFocusedIndex({context:e}){e.set("focusedIndex",Math.max(e.get("focusedIndex")-1,0))},setLastValueFocusIndex({context:e,computed:t}){u.raf(()=>{e.set("focusedIndex",Math.min(t("filledValueLength"),t("valueLength")-1))})},blurFocusedInputIfNeeded({context:e,prop:t,scope:a}){t("blurOnComplete")&&u.raf(()=>{g(a,e.get("focusedIndex"))?.blur()})},requestFormSubmit({computed:e,prop:t,scope:a}){if(!t("name")||!e("isValueComplete"))return;F(a)?.form?.requestSubmit()}}}});function C(e,t){let a=t;return e[0]===t[0]?a=t[1]:e[0]===t[1]&&(a=t[0]),a.split("")[a.length-1]}function x(e,t){return Array.from({length:t}).fill("").map((a,l)=>e[l]||a)}N.createProps()(["autoFocus","blurOnComplete","count","defaultValue","dir","disabled","form","getRootNode","id","ids","invalid","mask","name","onValueChange","onValueComplete","onValueInvalid","otp","pattern","placeholder","readOnly","required","selectOnFocus","translations","type","value"]);exports.anatomy=L;exports.connect=B;exports.machine=M;
|
|
2
|
+
//# sourceMappingURL=index-hGlTuPbK.js.map
|