@televet/kibble-ui 4.0.0-beta.73 → 4.0.0-beta.76
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-Bxrz2UAB.js → alert.types-PdqwnPFk.js} +3 -3
- package/dist/chunks/{alert.types-Bxrz2UAB.js.map → alert.types-PdqwnPFk.js.map} +1 -1
- package/dist/chunks/{alert.types-Dl6ivTll.js → alert.types-nvUPBs5x.js} +2 -2
- package/dist/chunks/{alert.types-Dl6ivTll.js.map → alert.types-nvUPBs5x.js.map} +1 -1
- package/dist/chunks/avatar.component-CBN_huX5.js +2 -0
- package/dist/chunks/{avatar.component-BdkTgslj.js.map → avatar.component-CBN_huX5.js.map} +1 -1
- package/dist/chunks/{avatar.component-DPu-22kf.js → avatar.component-ChgtiH34.js} +13 -13
- package/dist/chunks/{avatar.component-DPu-22kf.js.map → avatar.component-ChgtiH34.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-BW26RkqL.js → avatarGroup.component-BdS6rqSd.js} +2 -2
- package/dist/chunks/{avatarGroup.component-BW26RkqL.js.map → avatarGroup.component-BdS6rqSd.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-DHhW8fL3.js → avatarGroup.component-DqY1U0nn.js} +2 -2
- package/dist/chunks/{avatarGroup.component-DHhW8fL3.js.map → avatarGroup.component-DqY1U0nn.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-B3nqpiRU.js → buttonGroup.component-B0YaQeld.js} +2 -2
- package/dist/chunks/{buttonGroup.component-B3nqpiRU.js.map → buttonGroup.component-B0YaQeld.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-Q7Ul0yrS.js → buttonGroup.component-Dw1eWco8.js} +2 -2
- package/dist/chunks/{buttonGroup.component-Q7Ul0yrS.js.map → buttonGroup.component-Dw1eWco8.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-D1qCNVkb.js → characterCounter.component-D2yESqaY.js} +2 -2
- package/dist/chunks/{characterCounter.component-D1qCNVkb.js.map → characterCounter.component-D2yESqaY.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-CNo6Xau3.js → characterCounter.component-DL4T3MCU.js} +2 -2
- package/dist/chunks/{characterCounter.component-CNo6Xau3.js.map → characterCounter.component-DL4T3MCU.js.map} +1 -1
- package/dist/chunks/{checkbox.component-CxnOW6Sj.js → checkbox.component-C9K_0aVs.js} +2 -2
- package/dist/chunks/{checkbox.component-CxnOW6Sj.js.map → checkbox.component-C9K_0aVs.js.map} +1 -1
- package/dist/chunks/{checkbox.component-GElI75y2.js → checkbox.component-Ctl_OMbe.js} +10 -10
- package/dist/chunks/{checkbox.component-GElI75y2.js.map → checkbox.component-Ctl_OMbe.js.map} +1 -1
- package/dist/chunks/{checkbox.records-4j704fMI.js → checkbox.records-CSpdkmTY.js} +12 -12
- package/dist/chunks/{checkbox.records-4j704fMI.js.map → checkbox.records-CSpdkmTY.js.map} +1 -1
- package/dist/chunks/checkbox.records-DQMCwuT0.js +2 -0
- package/dist/chunks/{checkbox.records-DI3mqSNf.js.map → checkbox.records-DQMCwuT0.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-CvEAkFlp.js → checkboxGroup.component-BXOO72eO.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-CvEAkFlp.js.map → checkboxGroup.component-BXOO72eO.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-Dc39GJV4.js → checkboxGroup.component-Bskd5dH5.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-Dc39GJV4.js.map → checkboxGroup.component-Bskd5dH5.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-DnIpQo_a.js → conversationCard.component-C-FkaUmK.js} +15 -16
- package/dist/chunks/{conversationCard.component-DnIpQo_a.js.map → conversationCard.component-C-FkaUmK.js.map} +1 -1
- package/dist/chunks/conversationCard.component-DzWJ5HQW.js +2 -0
- package/dist/chunks/{conversationCard.component-CHm8X5MK.js.map → conversationCard.component-DzWJ5HQW.js.map} +1 -1
- package/dist/chunks/{datePicker.component-27W5L9DI.js → datePicker.component-BBOkyyla.js} +8 -7
- package/dist/chunks/datePicker.component-BBOkyyla.js.map +1 -0
- package/dist/chunks/{datePicker.component-C7pwPHzo.js → datePicker.component-C9lbmDiW.js} +3 -3
- package/dist/chunks/datePicker.component-C9lbmDiW.js.map +1 -0
- package/dist/chunks/{dialog-trigger-MkOQUjzu.js → dialog-trigger-B5NK0lr-.js} +2 -2
- package/dist/chunks/{dialog-trigger-MkOQUjzu.js.map → dialog-trigger-B5NK0lr-.js.map} +1 -1
- package/dist/chunks/{dialog-trigger-eqGXDXGQ.js → dialog-trigger-Qc_jF1sR.js} +9 -9
- package/dist/chunks/{dialog-trigger-eqGXDXGQ.js.map → dialog-trigger-Qc_jF1sR.js.map} +1 -1
- package/dist/chunks/{heading.component-C7W_ipcL.js → heading.component-BzNpnXHK.js} +2 -2
- package/dist/chunks/{heading.component-C7W_ipcL.js.map → heading.component-BzNpnXHK.js.map} +1 -1
- package/dist/chunks/{heading.component-dGH5sXSB.js → heading.component-D84GW8Ex.js} +2 -2
- package/dist/chunks/{heading.component-dGH5sXSB.js.map → heading.component-D84GW8Ex.js.map} +1 -1
- package/dist/chunks/{index-Cbkb_94C.js → index-B2pGzKof.js} +49 -48
- package/dist/chunks/{index-Cbkb_94C.js.map → index-B2pGzKof.js.map} +1 -1
- package/dist/chunks/{index-CtXUprYH.js → index-BBZxmcrY.js} +2 -2
- package/dist/chunks/{index-CtXUprYH.js.map → index-BBZxmcrY.js.map} +1 -1
- package/dist/chunks/index-BDnnTdaJ.js +2 -0
- package/dist/chunks/{index-CS8X6LiC.js.map → index-BDnnTdaJ.js.map} +1 -1
- package/dist/chunks/index-BGwwyukg.js +2 -0
- package/dist/chunks/index-BGwwyukg.js.map +1 -0
- package/dist/chunks/index-BIz6smcP.js +322 -0
- package/dist/chunks/index-BIz6smcP.js.map +1 -0
- package/dist/chunks/{index-C_AXAeNS.js → index-BRCoaB60.js} +17 -16
- package/dist/chunks/{index-C_AXAeNS.js.map → index-BRCoaB60.js.map} +1 -1
- package/dist/chunks/{index-DOXzraja.js → index-BYf7SZUC.js} +2 -2
- package/dist/chunks/{index-DOXzraja.js.map → index-BYf7SZUC.js.map} +1 -1
- package/dist/chunks/{index-OpolRlgD.js → index-BwIBc5Vr.js} +3 -3
- package/dist/chunks/{index-OpolRlgD.js.map → index-BwIBc5Vr.js.map} +1 -1
- package/dist/chunks/index-C4Skb3ZI.js +2 -0
- package/dist/chunks/{index-DBk0LkcO.js.map → index-C4Skb3ZI.js.map} +1 -1
- package/dist/chunks/{index-Bff1r_rH.js → index-C6cNrRSG.js} +15 -15
- package/dist/chunks/{index-Bff1r_rH.js.map → index-C6cNrRSG.js.map} +1 -1
- package/dist/chunks/{index-DowO8Ued.js → index-COoMV9Mh.js} +2 -2
- package/dist/chunks/{index-DowO8Ued.js.map → index-COoMV9Mh.js.map} +1 -1
- package/dist/chunks/index-CZ42b9rT.js +3 -0
- package/dist/chunks/index-CZ42b9rT.js.map +1 -0
- package/dist/chunks/index-CZz7hHWb.js +2 -0
- package/dist/chunks/{index-QTIBH1Or.js.map → index-CZz7hHWb.js.map} +1 -1
- package/dist/chunks/index-Czx27hGN.js +1018 -0
- package/dist/chunks/index-Czx27hGN.js.map +1 -0
- package/dist/chunks/{index-cSjUS7Xj.js → index-DwxB1_tE.js} +44 -43
- package/dist/chunks/{index-cSjUS7Xj.js.map → index-DwxB1_tE.js.map} +1 -1
- package/dist/chunks/{index-CJLttzPM.js → index-Im8BYbf9.js} +3 -3
- package/dist/chunks/{index-CJLttzPM.js.map → index-Im8BYbf9.js.map} +1 -1
- package/dist/chunks/{index-DUY19L6M.js → index-KOHUWYh0.js} +106 -105
- package/dist/chunks/{index-DUY19L6M.js.map → index-KOHUWYh0.js.map} +1 -1
- package/dist/chunks/index-MlhL0PDC.js +2 -0
- package/dist/chunks/{index-BR7peqZO.js.map → index-MlhL0PDC.js.map} +1 -1
- package/dist/chunks/{index-L197Dry5.js → index-Ootk-hWL.js} +18 -17
- package/dist/chunks/{index-L197Dry5.js.map → index-Ootk-hWL.js.map} +1 -1
- package/dist/chunks/index-UWtj4ULm.js +8 -0
- package/dist/chunks/{index-iaug4k6v.js.map → index-UWtj4ULm.js.map} +1 -1
- package/dist/chunks/index-ZaGEDS_0.js +2 -0
- package/dist/chunks/{index-DSedXH1s.js.map → index-ZaGEDS_0.js.map} +1 -1
- package/dist/chunks/{index-DVNjUEDJ.js → index-ftlwWpKA.js} +9 -9
- package/dist/chunks/{index-DVNjUEDJ.js.map → index-ftlwWpKA.js.map} +1 -1
- package/dist/chunks/{menu.component-CFYFhp7-.js → menu.component-C6JbDroI.js} +26 -26
- package/dist/chunks/{menu.component-CFYFhp7-.js.map → menu.component-C6JbDroI.js.map} +1 -1
- package/dist/chunks/{menu.component-BGGElaYy.js → menu.component-DHh_2Eme.js} +2 -2
- package/dist/chunks/{menu.component-BGGElaYy.js.map → menu.component-DHh_2Eme.js.map} +1 -1
- package/dist/chunks/{modal.types-Bpoq1pcb.js → modal.types-CmgKqsZR.js} +2 -2
- package/dist/chunks/{modal.types-Bpoq1pcb.js.map → modal.types-CmgKqsZR.js.map} +1 -1
- package/dist/chunks/{modal.types-CUUJVRPN.js → modal.types-nOPrSEJd.js} +4 -4
- package/dist/chunks/{modal.types-CUUJVRPN.js.map → modal.types-nOPrSEJd.js.map} +1 -1
- package/dist/chunks/{pinInput.types-OnwTDVZV.js → pinInput.types-CtFQbT8o.js} +2 -2
- package/dist/chunks/{pinInput.types-OnwTDVZV.js.map → pinInput.types-CtFQbT8o.js.map} +1 -1
- package/dist/chunks/{pinInput.types-DX8ognpo.js → pinInput.types-W39JHqF7.js} +8 -8
- package/dist/chunks/{pinInput.types-DX8ognpo.js.map → pinInput.types-W39JHqF7.js.map} +1 -1
- package/dist/chunks/{popover-BSBYgvs4.js → popover-80QH8HEJ.js} +2 -2
- package/dist/chunks/{popover-BSBYgvs4.js.map → popover-80QH8HEJ.js.map} +1 -1
- package/dist/chunks/{popover-DNKVYG-J.js → popover-BpMSsJKD.js} +26 -26
- package/dist/chunks/{popover-DNKVYG-J.js.map → popover-BpMSsJKD.js.map} +1 -1
- package/dist/chunks/{popover-root-provider-C2iwUZJn.js → popover-root-provider-DAMDDAHQ.js} +2 -2
- package/dist/chunks/{popover-root-provider-C2iwUZJn.js.map → popover-root-provider-DAMDDAHQ.js.map} +1 -1
- package/dist/chunks/{popover-root-provider-BErev2-N.js → popover-root-provider-rmv9U0xr.js} +8 -8
- package/dist/chunks/{popover-root-provider-BErev2-N.js.map → popover-root-provider-rmv9U0xr.js.map} +1 -1
- package/dist/chunks/popover.component-C6ERLtW7.js +322 -0
- package/dist/chunks/popover.component-C6ERLtW7.js.map +1 -0
- package/dist/chunks/popover.component-XsWmj-kz.js +2 -0
- package/dist/chunks/popover.component-XsWmj-kz.js.map +1 -0
- package/dist/chunks/popover.recipe-DLeyokHo.js +2 -0
- package/dist/chunks/popover.recipe-DLeyokHo.js.map +1 -0
- package/dist/chunks/{tooltip.component-BdlSO_v_.js → popover.recipe-_90TbZhK.js} +157 -169
- package/dist/chunks/popover.recipe-_90TbZhK.js.map +1 -0
- package/dist/chunks/{radio.records-4ih1q8nO.js → radio.records-DE0E27Oo.js} +16 -16
- package/dist/chunks/{radio.records-4ih1q8nO.js.map → radio.records-DE0E27Oo.js.map} +1 -1
- package/dist/chunks/radio.records-DyRupgeD.js +2 -0
- package/dist/chunks/{radio.records-j0JOqaJ4.js.map → radio.records-DyRupgeD.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-C8_NKfl7.js → radioGroup.component-C9G5TnKb.js} +2 -2
- package/dist/chunks/{radioGroup.component-C8_NKfl7.js.map → radioGroup.component-C9G5TnKb.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-yIs1Q3VP.js → radioGroup.component-CprwLxl1.js} +11 -11
- package/dist/chunks/{radioGroup.component-yIs1Q3VP.js.map → radioGroup.component-CprwLxl1.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-CnCN-czr.js → ratingDots.component-DOB0-Fyl.js} +3 -3
- package/dist/chunks/{ratingDots.component-CnCN-czr.js.map → ratingDots.component-DOB0-Fyl.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-Dr2p3X9o.js → ratingDots.component-DbxCjCy6.js} +2 -2
- package/dist/chunks/{ratingDots.component-Dr2p3X9o.js.map → ratingDots.component-DbxCjCy6.js.map} +1 -1
- package/dist/chunks/{render-strategy-C_zp9LNQ.js → render-strategy-BmWbSgqh.js} +2 -2
- package/dist/chunks/{render-strategy-C_zp9LNQ.js.map → render-strategy-BmWbSgqh.js.map} +1 -1
- package/dist/chunks/{render-strategy-CHp7lb6C.js → render-strategy-m3gtiO9A.js} +2 -2
- package/dist/chunks/{render-strategy-CHp7lb6C.js.map → render-strategy-m3gtiO9A.js.map} +1 -1
- package/dist/chunks/{select.component-DtvSUpfM.js → select.component-D_UomQ_K.js} +43 -43
- package/dist/chunks/{select.component-DtvSUpfM.js.map → select.component-D_UomQ_K.js.map} +1 -1
- package/dist/chunks/{select.component-l3N_dfXw.js → select.component-ZLlCuJkB.js} +2 -2
- package/dist/chunks/{select.component-l3N_dfXw.js.map → select.component-ZLlCuJkB.js.map} +1 -1
- package/dist/chunks/{sortableList.component-fhJaRd25.js → sortableList.component-BcP0nTpP.js} +3 -3
- package/dist/chunks/{sortableList.component-fhJaRd25.js.map → sortableList.component-BcP0nTpP.js.map} +1 -1
- package/dist/chunks/{sortableList.component-CNysbmV6.js → sortableList.component-Du0lV3PZ.js} +3 -3
- package/dist/chunks/{sortableList.component-CNysbmV6.js.map → sortableList.component-Du0lV3PZ.js.map} +1 -1
- package/dist/chunks/{spinner.component-oz9gjaVV.js → spinner.component-DQgAPRaP.js} +2 -2
- package/dist/chunks/{spinner.component-oz9gjaVV.js.map → spinner.component-DQgAPRaP.js.map} +1 -1
- package/dist/chunks/{spinner.component-BJ6rOgt8.js → spinner.component-DRjoEc9z.js} +2 -2
- package/dist/chunks/{spinner.component-BJ6rOgt8.js.map → spinner.component-DRjoEc9z.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-SAw52UC4.js → styledAvatar.types-BgSRTKhc.js} +2 -2
- package/dist/chunks/{styledAvatar.types-SAw52UC4.js.map → styledAvatar.types-BgSRTKhc.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-BvW6YJrl.js → styledAvatar.types-Qai9NHfQ.js} +2 -2
- package/dist/chunks/{styledAvatar.types-BvW6YJrl.js.map → styledAvatar.types-Qai9NHfQ.js.map} +1 -1
- package/dist/chunks/{switch.component-DFQ_b2At.js → switch.component-C_YkOZVM.js} +2 -2
- package/dist/chunks/{switch.component-DFQ_b2At.js.map → switch.component-C_YkOZVM.js.map} +1 -1
- package/dist/chunks/{switch.component-C1hrMzRm.js → switch.component-Dg54t6kn.js} +11 -11
- package/dist/chunks/{switch.component-C1hrMzRm.js.map → switch.component-Dg54t6kn.js.map} +1 -1
- package/dist/chunks/{tabs.component-CI6YyzcT.js → tabs.component-4zh8jiEy.js} +2 -2
- package/dist/chunks/{tabs.component-CI6YyzcT.js.map → tabs.component-4zh8jiEy.js.map} +1 -1
- package/dist/chunks/{tabs.component-CmBdxZ28.js → tabs.component-U9KpRJQV.js} +47 -47
- package/dist/chunks/{tabs.component-CmBdxZ28.js.map → tabs.component-U9KpRJQV.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-33yx8LBM.js → tagBlock.component-BZG468o5.js} +5 -5
- package/dist/chunks/{tagBlock.component-33yx8LBM.js.map → tagBlock.component-BZG468o5.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-p44L1Jc9.js → tagBlock.component-V_JWEe9n.js} +2 -2
- package/dist/chunks/{tagBlock.component-p44L1Jc9.js.map → tagBlock.component-V_JWEe9n.js.map} +1 -1
- package/dist/chunks/{textInput.component-Cla6KfBZ.js → textInput.component-BLK32hA7.js} +2 -2
- package/dist/chunks/{textInput.component-Cla6KfBZ.js.map → textInput.component-BLK32hA7.js.map} +1 -1
- package/dist/chunks/{textInput.component-CUKklyGx.js → textInput.component-CcyrHWXa.js} +12 -12
- package/dist/chunks/{textInput.component-CUKklyGx.js.map → textInput.component-CcyrHWXa.js.map} +1 -1
- package/dist/chunks/{textarea.component-BcL2jK0X.js → textarea.component-B_KAENP6.js} +7 -7
- package/dist/chunks/{textarea.component-BcL2jK0X.js.map → textarea.component-B_KAENP6.js.map} +1 -1
- package/dist/chunks/{textarea.component-XYJZDZmM.js → textarea.component-D3el9l9H.js} +2 -2
- package/dist/chunks/{textarea.component-XYJZDZmM.js.map → textarea.component-D3el9l9H.js.map} +1 -1
- package/dist/chunks/theme.provider-Bar-AuPo.js +26 -0
- package/dist/chunks/theme.provider-Bar-AuPo.js.map +1 -0
- package/dist/chunks/{theme.provider-FIFC-_Wf.js → theme.provider-px_2ytDm.js} +1716 -1828
- package/dist/chunks/theme.provider-px_2ytDm.js.map +1 -0
- package/dist/chunks/{timePicker.component-ClmXeH3U.js → timePicker.component-BDngkTzk.js} +2 -2
- package/dist/chunks/timePicker.component-BDngkTzk.js.map +1 -0
- package/dist/chunks/{timePicker.component-CMouXVow.js → timePicker.component-Co16Tl6i.js} +20 -19
- package/dist/chunks/timePicker.component-Co16Tl6i.js.map +1 -0
- package/dist/chunks/{timeRange.component-nrPWV1NY.js → timeRange.component-CFgHqQ-a.js} +2 -2
- package/dist/chunks/{timeRange.component-nrPWV1NY.js.map → timeRange.component-CFgHqQ-a.js.map} +1 -1
- package/dist/chunks/{timeRange.component-DKkwvibd.js → timeRange.component-CXZA_5f5.js} +2 -2
- package/dist/chunks/{timeRange.component-DKkwvibd.js.map → timeRange.component-CXZA_5f5.js.map} +1 -1
- package/dist/chunks/timestamp.component-D1c35p1O.js +53 -0
- package/dist/chunks/{timestamp.component-Dtn5KtVA.js.map → timestamp.component-D1c35p1O.js.map} +1 -1
- package/dist/chunks/timestamp.component-xIXZ1QOP.js +2 -0
- package/dist/chunks/{timestamp.component-CNzJfora.js.map → timestamp.component-xIXZ1QOP.js.map} +1 -1
- package/dist/chunks/toaster.records-BJo0j1IZ.js +2 -0
- package/dist/chunks/{toaster.records-zJfplz5w.js.map → toaster.records-BJo0j1IZ.js.map} +1 -1
- package/dist/chunks/{toaster.records-CcwOeMM7.js → toaster.records-Dp_v1E5T.js} +22 -21
- package/dist/chunks/{toaster.records-CcwOeMM7.js.map → toaster.records-Dp_v1E5T.js.map} +1 -1
- package/dist/chunks/{typography.records-H4aA5AOA.js → typography.records-BVjSfRuB.js} +2 -2
- package/dist/chunks/{typography.records-H4aA5AOA.js.map → typography.records-BVjSfRuB.js.map} +1 -1
- package/dist/chunks/{typography.records-CSy2LmDd.js → typography.records-C6G_65b4.js} +2 -2
- package/dist/chunks/{typography.records-CSy2LmDd.js.map → typography.records-C6G_65b4.js.map} +1 -1
- package/dist/chunks/{use-field-context-CArmgHPP.js → use-field-context--wBJQY1R.js} +2 -2
- package/dist/chunks/{use-field-context-CArmgHPP.js.map → use-field-context--wBJQY1R.js.map} +1 -1
- package/dist/chunks/{use-field-context-Cm3grEyV.js → use-field-context-xndZXNT4.js} +2 -2
- package/dist/chunks/{use-field-context-Cm3grEyV.js.map → use-field-context-xndZXNT4.js.map} +1 -1
- package/dist/chunks/{use-locale-context-D0LByRu9.js → use-locale-context-BdqHZ8L8.js} +2 -2
- package/dist/chunks/{use-locale-context-D0LByRu9.js.map → use-locale-context-BdqHZ8L8.js.map} +1 -1
- package/dist/chunks/{use-locale-context-BiiNTYMT.js → use-locale-context-KeBTTMq9.js} +29 -29
- package/dist/chunks/{use-locale-context-BiiNTYMT.js.map → use-locale-context-KeBTTMq9.js.map} +1 -1
- package/dist/chunks/{withFormControl-C8knrDok.js → withFormControl-BAEE7_5w.js} +2 -2
- package/dist/chunks/{withFormControl-C8knrDok.js.map → withFormControl-BAEE7_5w.js.map} +1 -1
- package/dist/chunks/{withFormControl-CwPfUb2g.js → withFormControl-C8abg91Q.js} +49 -49
- package/dist/chunks/{withFormControl-CwPfUb2g.js.map → withFormControl-C8abg91Q.js.map} +1 -1
- package/dist/chunks/withTruncation-BAxxp5gA.js +822 -0
- package/dist/chunks/withTruncation-BAxxp5gA.js.map +1 -0
- package/dist/chunks/withTruncation-FFeS8Bf1.js +2 -0
- package/dist/chunks/withTruncation-FFeS8Bf1.js.map +1 -0
- package/dist/cjs/chakra/index.cjs +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 +8 -8
- 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/Menu/index.js +1 -1
- package/dist/esm/components/Modal/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/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 +38 -39
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/index.js +57 -58
- 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/Popover/popover.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 +2 -4
- package/dist/types/components/Tooltip/tooltip.recipe.d.ts +1 -1
- package/dist/types/theme/tokens/zIndices/zIndices.config.d.ts +3 -3
- package/package.json +1 -1
- package/dist/chunks/avatar.component-BdkTgslj.js +0 -2
- package/dist/chunks/checkbox.records-DI3mqSNf.js +0 -2
- package/dist/chunks/conversationCard.component-CHm8X5MK.js +0 -2
- package/dist/chunks/datePicker.component-27W5L9DI.js.map +0 -1
- package/dist/chunks/datePicker.component-C7pwPHzo.js.map +0 -1
- package/dist/chunks/index-BR7peqZO.js +0 -2
- package/dist/chunks/index-Bz8HDeWA.js +0 -70
- package/dist/chunks/index-Bz8HDeWA.js.map +0 -1
- package/dist/chunks/index-CHIISuTq.js +0 -3
- package/dist/chunks/index-CHIISuTq.js.map +0 -1
- package/dist/chunks/index-CS8X6LiC.js +0 -2
- package/dist/chunks/index-DBk0LkcO.js +0 -2
- package/dist/chunks/index-DSedXH1s.js +0 -2
- package/dist/chunks/index-DbTEJc-K.js +0 -2
- package/dist/chunks/index-DbTEJc-K.js.map +0 -1
- package/dist/chunks/index-QTIBH1Or.js +0 -2
- package/dist/chunks/index-YtNA0Ueo.js +0 -1328
- package/dist/chunks/index-YtNA0Ueo.js.map +0 -1
- package/dist/chunks/index-iaug4k6v.js +0 -8
- package/dist/chunks/popover.component-B1TLfpqD.js +0 -2
- package/dist/chunks/popover.component-B1TLfpqD.js.map +0 -1
- package/dist/chunks/popover.component-CDGsZ6d_.js +0 -387
- package/dist/chunks/popover.component-CDGsZ6d_.js.map +0 -1
- package/dist/chunks/radio.records-j0JOqaJ4.js +0 -2
- package/dist/chunks/text.component-Ck6rZy2v.js +0 -12
- package/dist/chunks/text.component-Ck6rZy2v.js.map +0 -1
- package/dist/chunks/text.component-H5f43IC6.js +0 -2
- package/dist/chunks/text.component-H5f43IC6.js.map +0 -1
- package/dist/chunks/theme.provider-FIFC-_Wf.js.map +0 -1
- package/dist/chunks/theme.provider-oCz4Rrwj.js +0 -26
- package/dist/chunks/theme.provider-oCz4Rrwj.js.map +0 -1
- package/dist/chunks/timePicker.component-CMouXVow.js.map +0 -1
- package/dist/chunks/timePicker.component-ClmXeH3U.js.map +0 -1
- package/dist/chunks/timestamp.component-CNzJfora.js +0 -2
- package/dist/chunks/timestamp.component-Dtn5KtVA.js +0 -54
- package/dist/chunks/toaster.records-zJfplz5w.js +0 -2
- package/dist/chunks/tooltip.component-BdlSO_v_.js.map +0 -1
- package/dist/chunks/tooltip.component-Dq7F5JIs.js +0 -2
- package/dist/chunks/tooltip.component-Dq7F5JIs.js.map +0 -1
- package/dist/chunks/withTruncation-C_btJ8Nx.js +0 -2
- package/dist/chunks/withTruncation-C_btJ8Nx.js.map +0 -1
- package/dist/chunks/withTruncation-D6letsku.js +0 -67
- package/dist/chunks/withTruncation-D6letsku.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-Bff1r_rH.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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U;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-C6cNrRSG.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,MAA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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,2 +1,2 @@
|
|
|
1
|
-
"use strict";const u=require("./index-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
"use strict";const u=require("./index-CZ42b9rT.js"),N=require("./use-locale-context-BdqHZ8L8.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],C=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=C(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=F(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=F(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;C(a)?.form?.requestSubmit()}}}});function F(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-COoMV9Mh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-DowO8Ued.js","sources":["../../node_modules/@zag-js/pin-input/dist/index.mjs"],"sourcesContent":["import { createAnatomy } from '@zag-js/anatomy';\nimport { raf, dispatchInputValueEvent, queryAll, dataAttr, ariaAttr, isHTMLElement, isComposingEvent, isModifierKey, getEventKey, getNativeEvent, getBeforeInputValue, visuallyHiddenStyle } from '@zag-js/dom-query';\nimport { setValueAtIndex, isEqual, createSplitProps, invariant } from '@zag-js/utils';\nimport { setup } from '@zag-js/core';\nimport { createProps } from '@zag-js/types';\n\n// src/pin-input.anatomy.ts\nvar anatomy = createAnatomy(\"pinInput\").parts(\"root\", \"label\", \"input\", \"control\");\nvar parts = anatomy.build();\nvar getRootId = (ctx) => ctx.ids?.root ?? `pin-input:${ctx.id}`;\nvar getInputId = (ctx, id) => ctx.ids?.input?.(id) ?? `pin-input:${ctx.id}:${id}`;\nvar getHiddenInputId = (ctx) => ctx.ids?.hiddenInput ?? `pin-input:${ctx.id}:hidden`;\nvar getLabelId = (ctx) => ctx.ids?.label ?? `pin-input:${ctx.id}:label`;\nvar getControlId = (ctx) => ctx.ids?.control ?? `pin-input:${ctx.id}:control`;\nvar getRootEl = (ctx) => ctx.getById(getRootId(ctx));\nvar getInputEls = (ctx) => {\n const ownerId = CSS.escape(getRootId(ctx));\n const selector = `input[data-ownedby=${ownerId}]`;\n return queryAll(getRootEl(ctx), selector);\n};\nvar getInputElAtIndex = (ctx, index) => getInputEls(ctx)[index];\nvar getFirstInputEl = (ctx) => getInputEls(ctx)[0];\nvar getHiddenInputEl = (ctx) => ctx.getById(getHiddenInputId(ctx));\nvar setInputValue = (inputEl, value) => {\n inputEl.value = value;\n inputEl.setAttribute(\"value\", value);\n};\n\n// src/pin-input.utils.ts\nvar REGEX = {\n numeric: /^[0-9]+$/,\n alphabetic: /^[A-Za-z]+$/,\n alphanumeric: /^[a-zA-Z0-9]+$/i\n};\nfunction isValidType(type, value) {\n if (!type) return true;\n return !!REGEX[type]?.test(value);\n}\nfunction isValidValue(value, type, pattern) {\n if (!pattern) return isValidType(type, value);\n const regex = new RegExp(pattern, \"g\");\n return regex.test(value);\n}\n\n// src/pin-input.connect.ts\nfunction connect(service, normalize) {\n const { send, context, computed, prop, scope } = service;\n const complete = computed(\"isValueComplete\");\n const invalid = prop(\"invalid\");\n const translations = prop(\"translations\");\n const focusedIndex = context.get(\"focusedIndex\");\n function focus() {\n getFirstInputEl(scope)?.focus();\n }\n return {\n focus,\n count: context.get(\"count\"),\n items: Array.from({ length: context.get(\"count\") }).map((_, i) => i),\n value: context.get(\"value\"),\n valueAsString: computed(\"valueAsString\"),\n complete,\n setValue(value) {\n if (!Array.isArray(value)) {\n invariant(\"[pin-input/setValue] value must be an array\");\n }\n send({ type: \"VALUE.SET\", value });\n },\n clearValue() {\n send({ type: \"VALUE.CLEAR\" });\n },\n setValueAtIndex(index, value) {\n send({ type: \"VALUE.SET\", value, index });\n },\n getRootProps() {\n return normalize.element({\n dir: prop(\"dir\"),\n ...parts.root.attrs,\n id: getRootId(scope),\n \"data-invalid\": dataAttr(invalid),\n \"data-disabled\": dataAttr(prop(\"disabled\")),\n \"data-complete\": dataAttr(complete),\n \"data-readonly\": dataAttr(prop(\"readOnly\"))\n });\n },\n getLabelProps() {\n return normalize.label({\n ...parts.label.attrs,\n dir: prop(\"dir\"),\n htmlFor: getHiddenInputId(scope),\n id: getLabelId(scope),\n \"data-invalid\": dataAttr(invalid),\n \"data-disabled\": dataAttr(prop(\"disabled\")),\n \"data-complete\": dataAttr(complete),\n \"data-readonly\": dataAttr(prop(\"readOnly\")),\n onClick(event) {\n event.preventDefault();\n focus();\n }\n });\n },\n getHiddenInputProps() {\n return normalize.input({\n \"aria-hidden\": true,\n type: \"text\",\n tabIndex: -1,\n id: getHiddenInputId(scope),\n readOnly: prop(\"readOnly\"),\n disabled: prop(\"disabled\"),\n required: prop(\"required\"),\n name: prop(\"name\"),\n form: prop(\"form\"),\n style: visuallyHiddenStyle,\n maxLength: computed(\"valueLength\"),\n defaultValue: computed(\"valueAsString\")\n });\n },\n getControlProps() {\n return normalize.element({\n ...parts.control.attrs,\n dir: prop(\"dir\"),\n id: getControlId(scope)\n });\n },\n getInputProps(props2) {\n const { index } = props2;\n const inputType = prop(\"type\") === \"numeric\" ? \"tel\" : \"text\";\n return normalize.input({\n ...parts.input.attrs,\n dir: prop(\"dir\"),\n disabled: prop(\"disabled\"),\n \"data-disabled\": dataAttr(prop(\"disabled\")),\n \"data-complete\": dataAttr(complete),\n id: getInputId(scope, index.toString()),\n \"data-index\": index,\n \"data-ownedby\": getRootId(scope),\n \"aria-label\": translations?.inputLabel?.(index, computed(\"valueLength\")),\n inputMode: prop(\"otp\") || prop(\"type\") === \"numeric\" ? \"numeric\" : \"text\",\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n type: prop(\"mask\") ? \"password\" : inputType,\n defaultValue: context.get(\"value\")[index] || \"\",\n readOnly: prop(\"readOnly\"),\n autoCapitalize: \"none\",\n autoComplete: prop(\"otp\") ? \"one-time-code\" : \"off\",\n placeholder: focusedIndex === index ? \"\" : prop(\"placeholder\"),\n onBeforeInput(event) {\n try {\n const value = getBeforeInputValue(event);\n const isValid = isValidValue(value, prop(\"type\"), prop(\"pattern\"));\n if (!isValid) {\n send({ type: \"VALUE.INVALID\", value });\n event.preventDefault();\n }\n if (value.length > 2) {\n event.currentTarget.setSelectionRange(0, 1, \"forward\");\n }\n } catch {\n }\n },\n onChange(event) {\n const evt = getNativeEvent(event);\n const { value } = event.currentTarget;\n if (evt.inputType === \"insertFromPaste\" || value.length > 2) {\n send({ type: \"INPUT.PASTE\", value });\n event.currentTarget.value = value[0];\n event.preventDefault();\n return;\n }\n if (evt.inputType === \"deleteContentBackward\") {\n send({ type: \"INPUT.BACKSPACE\" });\n return;\n }\n send({ type: \"INPUT.CHANGE\", value, index });\n },\n onKeyDown(event) {\n if (event.defaultPrevented) return;\n if (isComposingEvent(event)) return;\n if (isModifierKey(event)) return;\n const keyMap = {\n Backspace() {\n send({ type: \"INPUT.BACKSPACE\" });\n },\n Delete() {\n send({ type: \"INPUT.DELETE\" });\n },\n ArrowLeft() {\n send({ type: \"INPUT.ARROW_LEFT\" });\n },\n ArrowRight() {\n send({ type: \"INPUT.ARROW_RIGHT\" });\n },\n Enter() {\n send({ type: \"INPUT.ENTER\" });\n }\n };\n const exec = keyMap[getEventKey(event, {\n dir: prop(\"dir\"),\n orientation: \"horizontal\"\n })];\n if (exec) {\n exec(event);\n event.preventDefault();\n }\n },\n onFocus() {\n send({ type: \"INPUT.FOCUS\", index });\n },\n onBlur(event) {\n const target = event.relatedTarget;\n if (isHTMLElement(target) && target.dataset.ownedby === getRootId(scope)) return;\n send({ type: \"INPUT.BLUR\", index });\n }\n });\n }\n };\n}\nvar { choose, createMachine } = setup();\nvar machine = createMachine({\n props({ props: props2 }) {\n return {\n placeholder: \"\\u25CB\",\n otp: false,\n type: \"numeric\",\n defaultValue: props2.count ? fill([], props2.count) : [],\n ...props2,\n translations: {\n inputLabel: (index, length) => `pin code ${index + 1} of ${length}`,\n ...props2.translations\n }\n };\n },\n initialState() {\n return \"idle\";\n },\n context({ prop, bindable }) {\n return {\n value: bindable(() => ({\n value: prop(\"value\"),\n defaultValue: prop(\"defaultValue\"),\n isEqual,\n onChange(value) {\n prop(\"onValueChange\")?.({ value, valueAsString: value.join(\"\") });\n }\n })),\n focusedIndex: bindable(() => ({\n sync: true,\n defaultValue: -1\n })),\n // TODO: Move this to `props` in next major version\n count: bindable(() => ({\n defaultValue: prop(\"count\")\n }))\n };\n },\n computed: {\n _value: ({ context }) => fill(context.get(\"value\"), context.get(\"count\")),\n valueLength: ({ computed }) => computed(\"_value\").length,\n filledValueLength: ({ computed }) => computed(\"_value\").filter((v) => v?.trim() !== \"\").length,\n isValueComplete: ({ computed }) => computed(\"valueLength\") === computed(\"filledValueLength\"),\n valueAsString: ({ computed }) => computed(\"_value\").join(\"\"),\n focusedValue: ({ computed, context }) => computed(\"_value\")[context.get(\"focusedIndex\")] || \"\"\n },\n entry: choose([\n {\n guard: \"autoFocus\",\n actions: [\"setInputCount\", \"setFocusIndexToFirst\"]\n },\n { actions: [\"setInputCount\"] }\n ]),\n watch({ action, track, context, computed }) {\n track([() => context.get(\"focusedIndex\")], () => {\n action([\"focusInput\", \"selectInputIfNeeded\"]);\n });\n track([() => context.get(\"value\").join(\",\")], () => {\n action([\"syncInputElements\", \"dispatchInputEvent\"]);\n });\n track([() => computed(\"isValueComplete\")], () => {\n action([\"invokeOnComplete\", \"blurFocusedInputIfNeeded\"]);\n });\n },\n on: {\n \"VALUE.SET\": [\n {\n guard: \"hasIndex\",\n actions: [\"setValueAtIndex\"]\n },\n { actions: [\"setValue\"] }\n ],\n \"VALUE.CLEAR\": {\n actions: [\"clearValue\", \"setFocusIndexToFirst\"]\n }\n },\n states: {\n idle: {\n on: {\n \"INPUT.FOCUS\": {\n target: \"focused\",\n actions: [\"setFocusedIndex\"]\n }\n }\n },\n focused: {\n on: {\n \"INPUT.CHANGE\": {\n actions: [\"setFocusedValue\", \"syncInputValue\", \"setNextFocusedIndex\"]\n },\n \"INPUT.PASTE\": {\n actions: [\"setPastedValue\", \"setLastValueFocusIndex\"]\n },\n \"INPUT.FOCUS\": {\n actions: [\"setFocusedIndex\"]\n },\n \"INPUT.BLUR\": {\n target: \"idle\",\n actions: [\"clearFocusedIndex\"]\n },\n \"INPUT.DELETE\": {\n guard: \"hasValue\",\n actions: [\"clearFocusedValue\"]\n },\n \"INPUT.ARROW_LEFT\": {\n actions: [\"setPrevFocusedIndex\"]\n },\n \"INPUT.ARROW_RIGHT\": {\n actions: [\"setNextFocusedIndex\"]\n },\n \"INPUT.BACKSPACE\": [\n {\n guard: \"hasValue\",\n actions: [\"clearFocusedValue\"]\n },\n {\n actions: [\"setPrevFocusedIndex\", \"clearFocusedValue\"]\n }\n ],\n \"INPUT.ENTER\": {\n guard: \"isValueComplete\",\n actions: [\"requestFormSubmit\"]\n },\n \"VALUE.INVALID\": {\n actions: [\"invokeOnInvalid\"]\n }\n }\n }\n },\n implementations: {\n guards: {\n autoFocus: ({ prop }) => !!prop(\"autoFocus\"),\n hasValue: ({ context }) => context.get(\"value\")[context.get(\"focusedIndex\")] !== \"\",\n isValueComplete: ({ computed }) => computed(\"isValueComplete\"),\n hasIndex: ({ event }) => event.index !== void 0\n },\n actions: {\n dispatchInputEvent({ computed, scope }) {\n const inputEl = getHiddenInputEl(scope);\n dispatchInputValueEvent(inputEl, { value: computed(\"valueAsString\") });\n },\n setInputCount({ scope, context, prop }) {\n if (prop(\"count\")) return;\n const inputEls = getInputEls(scope);\n context.set(\"count\", inputEls.length);\n },\n focusInput({ context, scope }) {\n const focusedIndex = context.get(\"focusedIndex\");\n if (focusedIndex === -1) return;\n getInputElAtIndex(scope, focusedIndex)?.focus({ preventScroll: true });\n },\n selectInputIfNeeded({ context, prop, scope }) {\n const focusedIndex = context.get(\"focusedIndex\");\n if (!prop(\"selectOnFocus\") || focusedIndex === -1) return;\n raf(() => {\n getInputElAtIndex(scope, focusedIndex)?.select();\n });\n },\n invokeOnComplete({ computed, prop }) {\n if (!computed(\"isValueComplete\")) return;\n prop(\"onValueComplete\")?.({\n value: computed(\"_value\"),\n valueAsString: computed(\"valueAsString\")\n });\n },\n invokeOnInvalid({ context, event, prop }) {\n prop(\"onValueInvalid\")?.({\n value: event.value,\n index: context.get(\"focusedIndex\")\n });\n },\n clearFocusedIndex({ context }) {\n context.set(\"focusedIndex\", -1);\n },\n setFocusedIndex({ context, event }) {\n context.set(\"focusedIndex\", event.index);\n },\n setValue({ context, event }) {\n const value = fill(event.value, context.get(\"count\"));\n context.set(\"value\", value);\n },\n setFocusedValue({ context, event, computed, flush }) {\n const focusedValue = computed(\"focusedValue\");\n const focusedIndex = context.get(\"focusedIndex\");\n const value = getNextValue(focusedValue, event.value);\n flush(() => {\n context.set(\"value\", setValueAtIndex(computed(\"_value\"), focusedIndex, value));\n });\n },\n revertInputValue({ context, computed, scope }) {\n const inputEl = getInputElAtIndex(scope, context.get(\"focusedIndex\"));\n setInputValue(inputEl, computed(\"focusedValue\"));\n },\n syncInputValue({ context, event, scope }) {\n const value = context.get(\"value\");\n const inputEl = getInputElAtIndex(scope, event.index);\n setInputValue(inputEl, value[event.index]);\n },\n syncInputElements({ context, scope }) {\n const inputEls = getInputEls(scope);\n const value = context.get(\"value\");\n inputEls.forEach((inputEl, index) => {\n setInputValue(inputEl, value[index]);\n });\n },\n setPastedValue({ context, event, computed, flush }) {\n raf(() => {\n const valueAsString = computed(\"valueAsString\");\n const focusedIndex = context.get(\"focusedIndex\");\n const valueLength = computed(\"valueLength\");\n const filledValueLength = computed(\"filledValueLength\");\n const startIndex = Math.min(focusedIndex, filledValueLength);\n const left = startIndex > 0 ? valueAsString.substring(0, focusedIndex) : \"\";\n const right = event.value.substring(0, valueLength - startIndex);\n const value = fill(`${left}${right}`.split(\"\"), valueLength);\n flush(() => {\n context.set(\"value\", value);\n });\n });\n },\n setValueAtIndex({ context, event, computed }) {\n const nextValue = getNextValue(computed(\"focusedValue\"), event.value);\n context.set(\"value\", setValueAtIndex(computed(\"_value\"), event.index, nextValue));\n },\n clearValue({ context }) {\n const nextValue = Array.from({ length: context.get(\"count\") }).fill(\"\");\n context.set(\"value\", nextValue);\n },\n clearFocusedValue({ context, computed }) {\n const focusedIndex = context.get(\"focusedIndex\");\n if (focusedIndex === -1) return;\n context.set(\"value\", setValueAtIndex(computed(\"_value\"), focusedIndex, \"\"));\n },\n setFocusIndexToFirst({ context }) {\n context.set(\"focusedIndex\", 0);\n },\n setNextFocusedIndex({ context, computed }) {\n context.set(\"focusedIndex\", Math.min(context.get(\"focusedIndex\") + 1, computed(\"valueLength\") - 1));\n },\n setPrevFocusedIndex({ context }) {\n context.set(\"focusedIndex\", Math.max(context.get(\"focusedIndex\") - 1, 0));\n },\n setLastValueFocusIndex({ context, computed }) {\n raf(() => {\n context.set(\"focusedIndex\", Math.min(computed(\"filledValueLength\"), computed(\"valueLength\") - 1));\n });\n },\n blurFocusedInputIfNeeded({ context, prop, scope }) {\n if (!prop(\"blurOnComplete\")) return;\n raf(() => {\n getInputElAtIndex(scope, context.get(\"focusedIndex\"))?.blur();\n });\n },\n requestFormSubmit({ computed, prop, scope }) {\n if (!prop(\"name\") || !computed(\"isValueComplete\")) return;\n const inputEl = getHiddenInputEl(scope);\n inputEl?.form?.requestSubmit();\n }\n }\n }\n});\nfunction getNextValue(current, next) {\n let nextValue = next;\n if (current[0] === next[0]) nextValue = next[1];\n else if (current[0] === next[1]) nextValue = next[0];\n return nextValue.split(\"\")[nextValue.length - 1];\n}\nfunction fill(value, count) {\n return Array.from({ length: count }).fill(\"\").map((v, i) => value[i] || v);\n}\nvar props = createProps()([\n \"autoFocus\",\n \"blurOnComplete\",\n \"count\",\n \"defaultValue\",\n \"dir\",\n \"disabled\",\n \"form\",\n \"getRootNode\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"mask\",\n \"name\",\n \"onValueChange\",\n \"onValueComplete\",\n \"onValueInvalid\",\n \"otp\",\n \"pattern\",\n \"placeholder\",\n \"readOnly\",\n \"required\",\n \"selectOnFocus\",\n \"translations\",\n \"type\",\n \"value\"\n]);\nvar splitProps = createSplitProps(props);\n\nexport { anatomy, connect, machine, props, splitProps };\n"],"names":["anatomy","createAnatomy","parts","getRootId","ctx","getInputId","id","getHiddenInputId","getLabelId","getControlId","getRootEl","getInputEls","selector","queryAll","getInputElAtIndex","index","getFirstInputEl","getHiddenInputEl","setInputValue","inputEl","value","REGEX","isValidType","type","isValidValue","pattern","connect","service","normalize","send","context","computed","prop","scope","complete","invalid","translations","focusedIndex","focus","_","i","invariant","dataAttr","event","visuallyHiddenStyle","props2","inputType","ariaAttr","getBeforeInputValue","evt","getNativeEvent","isComposingEvent","isModifierKey","exec","getEventKey","target","isHTMLElement","choose","createMachine","setup","machine","fill","length","bindable","isEqual","v","action","track","dispatchInputValueEvent","inputEls","raf","flush","focusedValue","getNextValue","setValueAtIndex","valueAsString","valueLength","filledValueLength","startIndex","left","right","nextValue","current","next","count","createProps"],"mappings":"kGAOG,IAACA,EAAUC,EAAa,cAAC,UAAU,EAAE,MAAM,OAAQ,QAAS,QAAS,SAAS,EAC7EC,EAAQF,EAAQ,MAAO,EACvBG,EAAaC,GAAQA,EAAI,KAAK,MAAQ,aAAaA,EAAI,EAAE,GACzDC,EAAa,CAACD,EAAKE,IAAOF,EAAI,KAAK,QAAQE,CAAE,GAAK,aAAaF,EAAI,EAAE,IAAIE,CAAE,GAC3EC,EAAoBH,GAAQA,EAAI,KAAK,aAAe,aAAaA,EAAI,EAAE,UACvEI,EAAcJ,GAAQA,EAAI,KAAK,OAAS,aAAaA,EAAI,EAAE,SAC3DK,EAAgBL,GAAQA,EAAI,KAAK,SAAW,aAAaA,EAAI,EAAE,WAC/DM,EAAaN,GAAQA,EAAI,QAAQD,EAAUC,CAAG,CAAC,EAC/CO,EAAeP,GAAQ,CAEzB,MAAMQ,EAAW,sBADD,IAAI,OAAOT,EAAUC,CAAG,CAAC,CACK,IA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cAAe,CACtC,CACA,CACA,CACA,CAAC,EACD,SAASwC,EAAaS,EAASC,EAAM,CACnC,IAAIF,EAAYE,EAChB,OAAID,EAAQ,CAAC,IAAMC,EAAK,CAAC,EAAGF,EAAYE,EAAK,CAAC,EACrCD,EAAQ,CAAC,IAAMC,EAAK,CAAC,IAAGF,EAAYE,EAAK,CAAC,GAC5CF,EAAU,MAAM,EAAE,EAAEA,EAAU,OAAS,CAAC,CACjD,CACA,SAASpB,EAAKzC,EAAOgE,EAAO,CAC1B,OAAO,MAAM,KAAK,CAAE,OAAQA,CAAK,CAAE,EAAE,KAAK,EAAE,EAAE,IAAI,CAACnB,EAAGzB,IAAMpB,EAAMoB,CAAC,GAAKyB,CAAC,CAC3E,CACYoB,EAAAA,cAAc,CACxB,YACA,iBACA,QACA,eACA,MACA,WACA,OACA,cACA,KACA,MACA,UACA,OACA,OACA,gBACA,kBACA,iBACA,MACA,UACA,cACA,WACA,WACA,gBACA,eACA,OACA,OACF,CAAC","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index-COoMV9Mh.js","sources":["../../node_modules/@zag-js/pin-input/dist/index.mjs"],"sourcesContent":["import { createAnatomy } from '@zag-js/anatomy';\nimport { raf, dispatchInputValueEvent, queryAll, dataAttr, ariaAttr, isHTMLElement, isComposingEvent, isModifierKey, getEventKey, getNativeEvent, getBeforeInputValue, visuallyHiddenStyle } from '@zag-js/dom-query';\nimport { setValueAtIndex, isEqual, createSplitProps, invariant } from '@zag-js/utils';\nimport { setup } from '@zag-js/core';\nimport { createProps } from '@zag-js/types';\n\n// src/pin-input.anatomy.ts\nvar anatomy = createAnatomy(\"pinInput\").parts(\"root\", \"label\", \"input\", \"control\");\nvar parts = anatomy.build();\nvar getRootId = (ctx) => ctx.ids?.root ?? `pin-input:${ctx.id}`;\nvar getInputId = (ctx, id) => ctx.ids?.input?.(id) ?? `pin-input:${ctx.id}:${id}`;\nvar getHiddenInputId = (ctx) => ctx.ids?.hiddenInput ?? `pin-input:${ctx.id}:hidden`;\nvar getLabelId = (ctx) => ctx.ids?.label ?? `pin-input:${ctx.id}:label`;\nvar getControlId = (ctx) => ctx.ids?.control ?? `pin-input:${ctx.id}:control`;\nvar getRootEl = (ctx) => ctx.getById(getRootId(ctx));\nvar getInputEls = (ctx) => {\n const ownerId = CSS.escape(getRootId(ctx));\n const selector = `input[data-ownedby=${ownerId}]`;\n return queryAll(getRootEl(ctx), selector);\n};\nvar getInputElAtIndex = (ctx, index) => getInputEls(ctx)[index];\nvar getFirstInputEl = (ctx) => getInputEls(ctx)[0];\nvar getHiddenInputEl = (ctx) => ctx.getById(getHiddenInputId(ctx));\nvar setInputValue = (inputEl, value) => {\n inputEl.value = value;\n inputEl.setAttribute(\"value\", value);\n};\n\n// src/pin-input.utils.ts\nvar REGEX = {\n numeric: /^[0-9]+$/,\n alphabetic: /^[A-Za-z]+$/,\n alphanumeric: /^[a-zA-Z0-9]+$/i\n};\nfunction isValidType(type, value) {\n if (!type) return true;\n return !!REGEX[type]?.test(value);\n}\nfunction isValidValue(value, type, pattern) {\n if (!pattern) return isValidType(type, value);\n const regex = new RegExp(pattern, \"g\");\n return regex.test(value);\n}\n\n// src/pin-input.connect.ts\nfunction connect(service, normalize) {\n const { send, context, computed, prop, scope } = service;\n const complete = computed(\"isValueComplete\");\n const invalid = prop(\"invalid\");\n const translations = prop(\"translations\");\n const focusedIndex = context.get(\"focusedIndex\");\n function focus() {\n getFirstInputEl(scope)?.focus();\n }\n return {\n focus,\n count: context.get(\"count\"),\n items: Array.from({ length: context.get(\"count\") }).map((_, i) => i),\n value: context.get(\"value\"),\n valueAsString: computed(\"valueAsString\"),\n complete,\n setValue(value) {\n if (!Array.isArray(value)) {\n invariant(\"[pin-input/setValue] value must be an array\");\n }\n send({ type: \"VALUE.SET\", value });\n },\n clearValue() {\n send({ type: \"VALUE.CLEAR\" });\n },\n setValueAtIndex(index, value) {\n send({ type: \"VALUE.SET\", value, index });\n },\n getRootProps() {\n return normalize.element({\n dir: prop(\"dir\"),\n ...parts.root.attrs,\n id: getRootId(scope),\n \"data-invalid\": dataAttr(invalid),\n \"data-disabled\": dataAttr(prop(\"disabled\")),\n \"data-complete\": dataAttr(complete),\n \"data-readonly\": dataAttr(prop(\"readOnly\"))\n });\n },\n getLabelProps() {\n return normalize.label({\n ...parts.label.attrs,\n dir: prop(\"dir\"),\n htmlFor: getHiddenInputId(scope),\n id: getLabelId(scope),\n \"data-invalid\": dataAttr(invalid),\n \"data-disabled\": dataAttr(prop(\"disabled\")),\n \"data-complete\": dataAttr(complete),\n \"data-readonly\": dataAttr(prop(\"readOnly\")),\n onClick(event) {\n event.preventDefault();\n focus();\n }\n });\n },\n getHiddenInputProps() {\n return normalize.input({\n \"aria-hidden\": true,\n type: \"text\",\n tabIndex: -1,\n id: getHiddenInputId(scope),\n readOnly: prop(\"readOnly\"),\n disabled: prop(\"disabled\"),\n required: prop(\"required\"),\n name: prop(\"name\"),\n form: prop(\"form\"),\n style: visuallyHiddenStyle,\n maxLength: computed(\"valueLength\"),\n defaultValue: computed(\"valueAsString\")\n });\n },\n getControlProps() {\n return normalize.element({\n ...parts.control.attrs,\n dir: prop(\"dir\"),\n id: getControlId(scope)\n });\n },\n getInputProps(props2) {\n const { index } = props2;\n const inputType = prop(\"type\") === \"numeric\" ? \"tel\" : \"text\";\n return normalize.input({\n ...parts.input.attrs,\n dir: prop(\"dir\"),\n disabled: prop(\"disabled\"),\n \"data-disabled\": dataAttr(prop(\"disabled\")),\n \"data-complete\": dataAttr(complete),\n id: getInputId(scope, index.toString()),\n \"data-index\": index,\n \"data-ownedby\": getRootId(scope),\n \"aria-label\": translations?.inputLabel?.(index, computed(\"valueLength\")),\n inputMode: prop(\"otp\") || prop(\"type\") === \"numeric\" ? \"numeric\" : \"text\",\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n type: prop(\"mask\") ? \"password\" : inputType,\n defaultValue: context.get(\"value\")[index] || \"\",\n readOnly: prop(\"readOnly\"),\n autoCapitalize: \"none\",\n autoComplete: prop(\"otp\") ? \"one-time-code\" : \"off\",\n placeholder: focusedIndex === index ? \"\" : prop(\"placeholder\"),\n onBeforeInput(event) {\n try {\n const value = getBeforeInputValue(event);\n const isValid = isValidValue(value, prop(\"type\"), prop(\"pattern\"));\n if (!isValid) {\n send({ type: \"VALUE.INVALID\", value });\n event.preventDefault();\n }\n if (value.length > 2) {\n event.currentTarget.setSelectionRange(0, 1, \"forward\");\n }\n } catch {\n }\n },\n onChange(event) {\n const evt = getNativeEvent(event);\n const { value } = event.currentTarget;\n if (evt.inputType === \"insertFromPaste\" || value.length > 2) {\n send({ type: \"INPUT.PASTE\", value });\n event.currentTarget.value = value[0];\n event.preventDefault();\n return;\n }\n if (evt.inputType === \"deleteContentBackward\") {\n send({ type: \"INPUT.BACKSPACE\" });\n return;\n }\n send({ type: \"INPUT.CHANGE\", value, index });\n },\n onKeyDown(event) {\n if (event.defaultPrevented) return;\n if (isComposingEvent(event)) return;\n if (isModifierKey(event)) return;\n const keyMap = {\n Backspace() {\n send({ type: \"INPUT.BACKSPACE\" });\n },\n Delete() {\n send({ type: \"INPUT.DELETE\" });\n },\n ArrowLeft() {\n send({ type: \"INPUT.ARROW_LEFT\" });\n },\n ArrowRight() {\n send({ type: \"INPUT.ARROW_RIGHT\" });\n },\n Enter() {\n send({ type: \"INPUT.ENTER\" });\n }\n };\n const exec = keyMap[getEventKey(event, {\n dir: prop(\"dir\"),\n orientation: \"horizontal\"\n })];\n if (exec) {\n exec(event);\n event.preventDefault();\n }\n },\n onFocus() {\n send({ type: \"INPUT.FOCUS\", index });\n },\n onBlur(event) {\n const target = event.relatedTarget;\n if (isHTMLElement(target) && target.dataset.ownedby === getRootId(scope)) return;\n send({ type: \"INPUT.BLUR\", index });\n }\n });\n }\n };\n}\nvar { choose, createMachine } = setup();\nvar machine = createMachine({\n props({ props: props2 }) {\n return {\n placeholder: \"\\u25CB\",\n otp: false,\n type: \"numeric\",\n defaultValue: props2.count ? fill([], props2.count) : [],\n ...props2,\n translations: {\n inputLabel: (index, length) => `pin code ${index + 1} of ${length}`,\n ...props2.translations\n }\n };\n },\n initialState() {\n return \"idle\";\n },\n context({ prop, bindable }) {\n return {\n value: bindable(() => ({\n value: prop(\"value\"),\n defaultValue: prop(\"defaultValue\"),\n isEqual,\n onChange(value) {\n prop(\"onValueChange\")?.({ value, valueAsString: value.join(\"\") });\n }\n })),\n focusedIndex: bindable(() => ({\n sync: true,\n defaultValue: -1\n })),\n // TODO: Move this to `props` in next major version\n count: bindable(() => ({\n defaultValue: prop(\"count\")\n }))\n };\n },\n computed: {\n _value: ({ context }) => fill(context.get(\"value\"), context.get(\"count\")),\n valueLength: ({ computed }) => computed(\"_value\").length,\n filledValueLength: ({ computed }) => computed(\"_value\").filter((v) => v?.trim() !== \"\").length,\n isValueComplete: ({ computed }) => computed(\"valueLength\") === computed(\"filledValueLength\"),\n valueAsString: ({ computed }) => computed(\"_value\").join(\"\"),\n focusedValue: ({ computed, context }) => computed(\"_value\")[context.get(\"focusedIndex\")] || \"\"\n },\n entry: choose([\n {\n guard: \"autoFocus\",\n actions: [\"setInputCount\", \"setFocusIndexToFirst\"]\n },\n { actions: [\"setInputCount\"] }\n ]),\n watch({ action, track, context, computed }) {\n track([() => context.get(\"focusedIndex\")], () => {\n action([\"focusInput\", \"selectInputIfNeeded\"]);\n });\n track([() => context.get(\"value\").join(\",\")], () => {\n action([\"syncInputElements\", \"dispatchInputEvent\"]);\n });\n track([() => computed(\"isValueComplete\")], () => {\n action([\"invokeOnComplete\", \"blurFocusedInputIfNeeded\"]);\n });\n },\n on: {\n \"VALUE.SET\": [\n {\n guard: \"hasIndex\",\n actions: [\"setValueAtIndex\"]\n },\n { actions: [\"setValue\"] }\n ],\n \"VALUE.CLEAR\": {\n actions: [\"clearValue\", \"setFocusIndexToFirst\"]\n }\n },\n states: {\n idle: {\n on: {\n \"INPUT.FOCUS\": {\n target: \"focused\",\n actions: [\"setFocusedIndex\"]\n }\n }\n },\n focused: {\n on: {\n \"INPUT.CHANGE\": {\n actions: [\"setFocusedValue\", \"syncInputValue\", \"setNextFocusedIndex\"]\n },\n \"INPUT.PASTE\": {\n actions: [\"setPastedValue\", \"setLastValueFocusIndex\"]\n },\n \"INPUT.FOCUS\": {\n actions: [\"setFocusedIndex\"]\n },\n \"INPUT.BLUR\": {\n target: \"idle\",\n actions: [\"clearFocusedIndex\"]\n },\n \"INPUT.DELETE\": {\n guard: \"hasValue\",\n actions: [\"clearFocusedValue\"]\n },\n \"INPUT.ARROW_LEFT\": {\n actions: [\"setPrevFocusedIndex\"]\n },\n \"INPUT.ARROW_RIGHT\": {\n actions: [\"setNextFocusedIndex\"]\n },\n \"INPUT.BACKSPACE\": [\n {\n guard: \"hasValue\",\n actions: [\"clearFocusedValue\"]\n },\n {\n actions: [\"setPrevFocusedIndex\", \"clearFocusedValue\"]\n }\n ],\n \"INPUT.ENTER\": {\n guard: \"isValueComplete\",\n actions: [\"requestFormSubmit\"]\n },\n \"VALUE.INVALID\": {\n actions: [\"invokeOnInvalid\"]\n }\n }\n }\n },\n implementations: {\n guards: {\n autoFocus: ({ prop }) => !!prop(\"autoFocus\"),\n hasValue: ({ context }) => context.get(\"value\")[context.get(\"focusedIndex\")] !== \"\",\n isValueComplete: ({ computed }) => computed(\"isValueComplete\"),\n hasIndex: ({ event }) => event.index !== void 0\n },\n actions: {\n dispatchInputEvent({ computed, scope }) {\n const inputEl = getHiddenInputEl(scope);\n dispatchInputValueEvent(inputEl, { value: computed(\"valueAsString\") });\n },\n setInputCount({ scope, context, prop }) {\n if (prop(\"count\")) return;\n const inputEls = getInputEls(scope);\n context.set(\"count\", inputEls.length);\n },\n focusInput({ context, scope }) {\n const focusedIndex = context.get(\"focusedIndex\");\n if (focusedIndex === -1) return;\n getInputElAtIndex(scope, focusedIndex)?.focus({ preventScroll: true });\n },\n selectInputIfNeeded({ context, prop, scope }) {\n const focusedIndex = context.get(\"focusedIndex\");\n if (!prop(\"selectOnFocus\") || focusedIndex === -1) return;\n raf(() => {\n getInputElAtIndex(scope, focusedIndex)?.select();\n });\n },\n invokeOnComplete({ computed, prop }) {\n if (!computed(\"isValueComplete\")) return;\n prop(\"onValueComplete\")?.({\n value: computed(\"_value\"),\n valueAsString: computed(\"valueAsString\")\n });\n },\n invokeOnInvalid({ context, event, prop }) {\n prop(\"onValueInvalid\")?.({\n value: event.value,\n index: context.get(\"focusedIndex\")\n });\n },\n clearFocusedIndex({ context }) {\n context.set(\"focusedIndex\", -1);\n },\n setFocusedIndex({ context, event }) {\n context.set(\"focusedIndex\", event.index);\n },\n setValue({ context, event }) {\n const value = fill(event.value, context.get(\"count\"));\n context.set(\"value\", value);\n },\n setFocusedValue({ context, event, computed, flush }) {\n const focusedValue = computed(\"focusedValue\");\n const focusedIndex = context.get(\"focusedIndex\");\n const value = getNextValue(focusedValue, event.value);\n flush(() => {\n context.set(\"value\", setValueAtIndex(computed(\"_value\"), focusedIndex, value));\n });\n },\n revertInputValue({ context, computed, scope }) {\n const inputEl = getInputElAtIndex(scope, context.get(\"focusedIndex\"));\n setInputValue(inputEl, computed(\"focusedValue\"));\n },\n syncInputValue({ context, event, scope }) {\n const value = context.get(\"value\");\n const inputEl = getInputElAtIndex(scope, event.index);\n setInputValue(inputEl, value[event.index]);\n },\n syncInputElements({ context, scope }) {\n const inputEls = getInputEls(scope);\n const value = context.get(\"value\");\n inputEls.forEach((inputEl, index) => {\n setInputValue(inputEl, value[index]);\n });\n },\n setPastedValue({ context, event, computed, flush }) {\n raf(() => {\n const valueAsString = computed(\"valueAsString\");\n const focusedIndex = context.get(\"focusedIndex\");\n const valueLength = computed(\"valueLength\");\n const filledValueLength = computed(\"filledValueLength\");\n const startIndex = Math.min(focusedIndex, filledValueLength);\n const left = startIndex > 0 ? valueAsString.substring(0, focusedIndex) : \"\";\n const right = event.value.substring(0, valueLength - startIndex);\n const value = fill(`${left}${right}`.split(\"\"), valueLength);\n flush(() => {\n context.set(\"value\", value);\n });\n });\n },\n setValueAtIndex({ context, event, computed }) {\n const nextValue = getNextValue(computed(\"focusedValue\"), event.value);\n context.set(\"value\", setValueAtIndex(computed(\"_value\"), event.index, nextValue));\n },\n clearValue({ context }) {\n const nextValue = Array.from({ length: context.get(\"count\") }).fill(\"\");\n context.set(\"value\", nextValue);\n },\n clearFocusedValue({ context, computed }) {\n const focusedIndex = context.get(\"focusedIndex\");\n if (focusedIndex === -1) return;\n context.set(\"value\", setValueAtIndex(computed(\"_value\"), focusedIndex, \"\"));\n },\n setFocusIndexToFirst({ context }) {\n context.set(\"focusedIndex\", 0);\n },\n setNextFocusedIndex({ context, computed }) {\n context.set(\"focusedIndex\", Math.min(context.get(\"focusedIndex\") + 1, computed(\"valueLength\") - 1));\n },\n setPrevFocusedIndex({ context }) {\n context.set(\"focusedIndex\", Math.max(context.get(\"focusedIndex\") - 1, 0));\n },\n setLastValueFocusIndex({ context, computed }) {\n raf(() => {\n context.set(\"focusedIndex\", Math.min(computed(\"filledValueLength\"), computed(\"valueLength\") - 1));\n });\n },\n blurFocusedInputIfNeeded({ context, prop, scope }) {\n if (!prop(\"blurOnComplete\")) return;\n raf(() => {\n getInputElAtIndex(scope, context.get(\"focusedIndex\"))?.blur();\n });\n },\n requestFormSubmit({ computed, prop, scope }) {\n if (!prop(\"name\") || !computed(\"isValueComplete\")) return;\n const inputEl = getHiddenInputEl(scope);\n inputEl?.form?.requestSubmit();\n }\n }\n }\n});\nfunction getNextValue(current, next) {\n let nextValue = next;\n if (current[0] === next[0]) nextValue = next[1];\n else if (current[0] === next[1]) nextValue = next[0];\n return nextValue.split(\"\")[nextValue.length - 1];\n}\nfunction fill(value, count) {\n return Array.from({ length: count }).fill(\"\").map((v, i) => value[i] || v);\n}\nvar props = createProps()([\n \"autoFocus\",\n \"blurOnComplete\",\n \"count\",\n \"defaultValue\",\n \"dir\",\n \"disabled\",\n \"form\",\n \"getRootNode\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"mask\",\n \"name\",\n \"onValueChange\",\n \"onValueComplete\",\n \"onValueInvalid\",\n \"otp\",\n \"pattern\",\n \"placeholder\",\n \"readOnly\",\n \"required\",\n \"selectOnFocus\",\n \"translations\",\n \"type\",\n \"value\"\n]);\nvar splitProps = createSplitProps(props);\n\nexport { anatomy, connect, machine, props, splitProps };\n"],"names":["anatomy","createAnatomy","parts","getRootId","ctx","getInputId","id","getHiddenInputId","getLabelId","getControlId","getRootEl","getInputEls","selector","queryAll","getInputElAtIndex","index","getFirstInputEl","getHiddenInputEl","setInputValue","inputEl","value","REGEX","isValidType","type","isValidValue","pattern","connect","service","normalize","send","context","computed","prop","scope","complete","invalid","translations","focusedIndex","focus","_","i","invariant","dataAttr","event","visuallyHiddenStyle","props2","inputType","ariaAttr","getBeforeInputValue","evt","getNativeEvent","isComposingEvent","isModifierKey","exec","getEventKey","target","isHTMLElement","choose","createMachine","setup","machine","fill","length","bindable","isEqual","v","action","track","dispatchInputValueEvent","inputEls","raf","flush","focusedValue","getNextValue","setValueAtIndex","valueAsString","valueLength","filledValueLength","startIndex","left","right","nextValue","current","next","count","createProps"],"mappings":"kGAOG,IAACA,EAAUC,EAAa,cAAC,UAAU,EAAE,MAAM,OAAQ,QAAS,QAAS,SAAS,EAC7EC,EAAQF,EAAQ,MAAO,EACvBG,EAAaC,GAAQA,EAAI,KAAK,MAAQ,aAAaA,EAAI,EAAE,GACzDC,EAAa,CAACD,EAAKE,IAAOF,EAAI,KAAK,QAAQE,CAAE,GAAK,aAAaF,EAAI,EAAE,IAAIE,CAAE,GAC3EC,EAAoBH,GAAQA,EAAI,KAAK,aAAe,aAAaA,EAAI,EAAE,UACvEI,EAAcJ,GAAQA,EAAI,KAAK,OAAS,aAAaA,EAAI,EAAE,SAC3DK,EAAgBL,GAAQA,EAAI,KAAK,SAAW,aAAaA,EAAI,EAAE,WAC/DM,EAAaN,GAAQA,EAAI,QAAQD,EAAUC,CAAG,CAAC,EAC/CO,EAAeP,GAAQ,CAEzB,MAAMQ,EAAW,sBADD,I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G,OACnCd,EAAiBgB,CAAK,GAC7B,MAAM,cAAe,CACtC,CACA,CACA,CACA,CAAC,EACD,SAASwC,EAAaS,EAASC,EAAM,CACnC,IAAIF,EAAYE,EAChB,OAAID,EAAQ,CAAC,IAAMC,EAAK,CAAC,EAAGF,EAAYE,EAAK,CAAC,EACrCD,EAAQ,CAAC,IAAMC,EAAK,CAAC,IAAGF,EAAYE,EAAK,CAAC,GAC5CF,EAAU,MAAM,EAAE,EAAEA,EAAU,OAAS,CAAC,CACjD,CACA,SAASpB,EAAKzC,EAAOgE,EAAO,CAC1B,OAAO,MAAM,KAAK,CAAE,OAAQA,CAAK,CAAE,EAAE,KAAK,EAAE,EAAE,IAAI,CAACnB,EAAGzB,IAAMpB,EAAMoB,CAAC,GAAKyB,CAAC,CAC3E,CACYoB,EAAAA,cAAc,CACxB,YACA,iBACA,QACA,eACA,MACA,WACA,OACA,cACA,KACA,MACA,UACA,OACA,OACA,gBACA,kBACA,iBACA,MACA,UACA,cACA,WACA,WACA,gBACA,eACA,OACA,OACF,CAAC","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var le=e=>Math.max(0,Math.min(1,e)),Ge=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]),z=(...e)=>t=>e.reduce((n,r)=>r(n),t),A=()=>{},O=e=>typeof e=="object"&&e!==null,Ze=2147483647,Ye=e=>e?"":void 0,Je=e=>e?"true":void 0,Qe=1,et=9,tt=11,y=e=>O(e)&&e.nodeType===Qe&&typeof e.nodeName=="string",Y=e=>O(e)&&e.nodeType===et,nt=e=>O(e)&&e===e.window,ge=e=>y(e)?e.localName||"":"#document";function rt(e){return["html","body","#document"].includes(ge(e))}var ot=e=>O(e)&&e.nodeType!==void 0,P=e=>ot(e)&&e.nodeType===tt&&"host"in e,it=e=>y(e)&&e.localName==="input",st=e=>!!e?.matches("a[href]"),at=e=>y(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1,ct=/(textarea|select)/;function ye(e){if(e==null||!y(e))return!1;try{return it(e)&&e.selectionStart!=null||ct.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function J(e,t){if(!e||!t||!y(e)||!y(t))return!1;const n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&P(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function I(e){return Y(e)?e:nt(e)?e.document:e?.ownerDocument??document}function ut(e){return I(e).documentElement}function v(e){return P(e)?v(e.host):Y(e)?e.defaultView??window:y(e)?e.ownerDocument?.defaultView??window:window}function he(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}function lt(e){if(ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||P(e)&&e.host||ut(e);return P(t)?t.host:t}var H=new WeakMap;function ft(e){return H.has(e)||H.set(e,v(e).getComputedStyle(e)),H.get(e)}function dt(e,t){const{type:n,quality:r=.92,background:o}=t;if(!e)throw new Error("[zag-js > getDataUrl]: Could not find the svg element");const i=v(e),s=i.document,a=e.getBoundingClientRect(),c=e.cloneNode(!0);c.hasAttribute("viewBox")||c.setAttribute("viewBox",`0 0 ${a.width} ${a.height}`);const d=`<?xml version="1.0" standalone="no"?>\r
|
|
2
|
+
`+new i.XMLSerializer().serializeToString(c),p="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(d);if(n==="image/svg+xml")return Promise.resolve(p).then(k=>(c.remove(),k));const l=i.devicePixelRatio||1,f=s.createElement("canvas"),h=new i.Image;h.src=p,f.width=a.width*l,f.height=a.height*l;const V=f.getContext("2d");return(n==="image/jpeg"||o)&&(V.fillStyle=o||"white",V.fillRect(0,0,f.width,f.height)),new Promise(k=>{h.onload=()=>{V?.drawImage(h,0,0,f.width,f.height),k(f.toDataURL(n,r)),c.remove()}})}var K=()=>typeof document<"u";function pt(){return navigator.userAgentData?.platform??navigator.platform}function mt(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var Q=e=>K()&&e.test(pt()),ve=e=>K()&&e.test(mt()),gt=e=>K()&&e.test(navigator.vendor),yt=()=>K()&&!!navigator.maxTouchPoints,ht=()=>Q(/^iPhone/i),vt=()=>Q(/^iPad/i)||B()&&navigator.maxTouchPoints>1,j=()=>ht()||vt(),ee=()=>B()||j(),B=()=>Q(/^Mac/i),bt=()=>ee()&>(/apple/i),Et=()=>ve(/Firefox/i),wt=()=>ve(/Android/i);function At(e){const{selectionStart:t,selectionEnd:n,value:r}=e.currentTarget;return r.slice(0,t)+e.data+r.slice(n)}function Tt(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function te(e){return Tt(e)?.[0]??e.target}var St=e=>J(e.currentTarget,te(e));function kt(e){const t=e.currentTarget;if(!t)return!1;const n=ee();if(n&&!e.metaKey||!n&&!e.ctrlKey)return!1;const r=t.localName;return r==="a"||r==="button"&&t.type==="submit"||r==="input"&&t.type==="submit"}function xt(e){const t=e.currentTarget;if(!t)return!1;const n=t.localName;return e.altKey?n==="a"||n==="button"&&t.type==="submit"||n==="input"&&t.type==="submit":!1}function Pt(e){return be(e).isComposing||e.keyCode===229}function It(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}function Nt(e){return e.mozInputSource===0&&e.isTrusted?!0:wt()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var Vt=e=>e.button===0,Mt=e=>e.button===2||B()&&e.ctrlKey&&e.button===0,Dt=e=>e.ctrlKey||e.altKey||e.metaKey,Lt=e=>"touches"in e&&e.touches.length>0,Ct={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},fe={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Rt(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let o=e.key;return o=Ct[o]??o,n==="rtl"&&r==="horizontal"&&o in fe&&(o=fe[o]),o}function be(e){return e.nativeEvent??e}var Ft=new Set(["PageUp","PageDown"]),Ot=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function Kt(e){return e.ctrlKey||e.metaKey?.1:Ft.has(e.key)||e.shiftKey&&Ot.has(e.key)?10:1}function ne(e,t="client"){const n=Lt(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var m=(e,t,n,r)=>{const o=typeof e=="function"?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};function Ee(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,o=v(e)[n].prototype;return Object.getOwnPropertyDescriptor(o,r)??{}}function jt(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function we(e,t,n="value"){if(!e)return;const r=jt(e);r&&Ee(e,{type:r,property:n}).set?.call(e,t),e.setAttribute(n,t)}function Ae(e,t){if(!e)return;Ee(e,{type:"HTMLInputElement",property:"checked"}).set?.call(e,t),t?e.setAttribute("checked",""):e.removeAttribute("checked")}function Bt(e,t){const{value:n,bubbles:r=!0}=t;if(!e)return;const o=v(e);e instanceof o.HTMLInputElement&&(we(e,`${n}`),e.dispatchEvent(new o.Event("input",{bubbles:r})))}function qt(e,t){const{checked:n,bubbles:r=!0}=t;if(!e)return;const o=v(e);e instanceof o.HTMLInputElement&&(Ae(e,n),e.dispatchEvent(new o.Event("click",{bubbles:r})))}function $t(e){return _t(e)?e.form:e.closest("form")}function _t(e){return e.matches("textarea, input, select, button")}function Ut(e,t){if(!e)return;const n=$t(e),r=o=>{o.defaultPrevented||t()};return n?.addEventListener("reset",r,{passive:!0}),()=>n?.removeEventListener("reset",r)}function Wt(e,t){const n=e?.closest("fieldset");if(!n)return;t(n.disabled);const r=v(n),o=new r.MutationObserver(()=>t(n.disabled));return o.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>o.disconnect()}function zt(e,t){if(!e)return;const{onFieldsetDisabledChange:n,onFormReset:r}=t,o=[Ut(e,r),Wt(e,n)];return()=>o.forEach(i=>i?.())}var Te=e=>y(e)&&e.tagName==="IFRAME",Ht=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),Xt=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,re="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Se=(e,t=!1)=>{if(!e)return[];const n=Array.from(e.querySelectorAll(re));(t==!0||t=="if-empty"&&n.length===0)&&y(e)&&R(e)&&n.unshift(e);const o=n.filter(R);return o.forEach((i,s)=>{if(Te(i)&&i.contentDocument){const a=i.contentDocument.body;o.splice(s,1,...Se(a))}}),o};function R(e){return!e||e.closest("[inert]")?!1:e.matches(re)&&at(e)}function N(e,t){if(!e)return[];const n=Array.from(e.querySelectorAll(re)),r=n.filter(X);return t&&X(e)&&r.unshift(e),r.forEach((o,i)=>{if(Te(o)&&o.contentDocument){const s=o.contentDocument.body,a=N(s);r.splice(i,1,...a)}}),!r.length&&t?n:r}function X(e){return e!=null&&e.tabIndex>0?!0:R(e)&&!Xt(e)}function ke(e,t){const n=N(e,t),r=n[0]||null,o=n[n.length-1]||null;return[r,o]}function Gt(e,t){const n=N(e),r=e?.ownerDocument||document,o=t??r.activeElement;if(!o)return null;const i=n.indexOf(o);return n[i+1]||null}function Zt(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||ye(e))&&!Ht(e)?0:e.tabIndex}function Yt(e){const{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let i=null;if(i||(i=typeof n=="function"?n():n),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){const s=N(t);i=r?s.filter(r)[0]:s[0]}return i||t||void 0}function Jt(e){const t=e.currentTarget;if(!t)return!1;const[n,r]=ke(t),o=t.ownerDocument||document;return!(o.activeElement===n&&e.shiftKey||o.activeElement===r&&!e.shiftKey||!n&&!r)}function xe(e){const t=new Set;function n(r){const o=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(o))}return n(()=>n(e)),function(){t.forEach(o=>o())}}function S(e){let t;const n=globalThis.requestAnimationFrame(()=>{t=e()});return()=>{globalThis.cancelAnimationFrame(n),t?.()}}function Qt(e,t,n){const r=S(()=>{e.removeEventListener(t,o,!0),n()}),o=()=>{r(),n()};return e.addEventListener(t,o,{once:!0,capture:!0}),r}function en(e,t){if(!e)return;const{attributes:n,callback:r}=t,o=e.ownerDocument.defaultView||window,i=new o.MutationObserver(s=>{for(const a of s)a.type==="attributes"&&a.attributeName&&n.includes(a.attributeName)&&r(a)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function tn(e,t){const{defer:n}=t,r=n?S:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(en(i,t))})),()=>{o.forEach(i=>i?.())}}function nn(e,t){const{callback:n}=t;if(!e)return;const r=e.ownerDocument.defaultView||window,o=new r.MutationObserver(n);return o.observe(e,{childList:!0,subtree:!0}),()=>o.disconnect()}function rn(e,t){const{defer:n}=t,r=n?S:i=>i(),o=[];return o.push(r(()=>{const i=typeof e=="function"?e():e;o.push(nn(i,t))})),()=>{o.forEach(i=>i?.())}}function on(e){const t=()=>e.click();Et()?Qt(e,"keyup",t):queueMicrotask(t)}function oe(e){const t=lt(e);return rt(t)?I(t).body:y(t)&&ie(t)?t:oe(t)}function Pe(e,t=[]){const n=oe(e),r=n===e.ownerDocument.body,o=v(n);return r?t.concat(o,o.visualViewport||[],ie(n)?n:[]):t.concat(n,Pe(n,[]))}var sn=/auto|scroll|overlay|hidden|clip/;function ie(e){const t=v(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return sn.test(n+o+r)&&!["inline","contents"].includes(i)}function an(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function cn(e,t){const{rootEl:n,...r}=t||{};!e||!n||!ie(n)||!an(n)||e.scrollIntoView(r)}function un(e,t){const{left:n,top:r,width:o,height:i}=t.getBoundingClientRect(),s={x:e.x-n,y:e.y-r},a={x:le(s.x/o),y:le(s.y/i)};function c(u={}){const{dir:d="ltr",orientation:p="horizontal",inverted:l}=u,f=typeof l=="object"?l.x:l,h=typeof l=="object"?l.y:l;return p==="horizontal"?d==="rtl"||f?1-a.x:a.x:h?1-a.y:a.y}return{offset:s,percent:a,getPercentValue:c}}function ln(e,t){const n=e.body,r="pointerLockElement"in e||"mozPointerLockElement"in e,o=()=>!!e.pointerLockElement;function i(){}function s(c){o(),console.error("PointerLock error occurred:",c),e.exitPointerLock()}if(!r)return;try{n.requestPointerLock()}catch{}const a=[m(e,"pointerlockchange",i,!1),m(e,"pointerlockerror",s,!1)];return()=>{a.forEach(c=>c()),e.exitPointerLock()}}var T="default",G="",D=new WeakMap;function fn(e={}){const{target:t,doc:n}=e,r=n??document,o=r.documentElement;return j()?(T==="default"&&(G=o.style.webkitUserSelect,o.style.webkitUserSelect="none"),T="disabled"):t&&(D.set(t,t.style.userSelect),t.style.userSelect="none"),()=>dn({target:t,doc:r})}function dn(e={}){const{target:t,doc:n}=e,o=(n??document).documentElement;if(j()){if(T!=="disabled")return;T="restoring",setTimeout(()=>{xe(()=>{T==="restoring"&&(o.style.webkitUserSelect==="none"&&(o.style.webkitUserSelect=G||""),G="",T="default")})},300)}else if(t&&D.has(t)){const i=D.get(t);t.style.userSelect==="none"&&(t.style.userSelect=i??""),t.getAttribute("style")===""&&t.removeAttribute("style"),D.delete(t)}}function Ie(e={}){const{defer:t,target:n,...r}=e,o=t?S:s=>s(),i=[];return i.push(o(()=>{const s=typeof n=="function"?n():n;i.push(fn({...r,target:s}))})),()=>{i.forEach(s=>s?.())}}function pn(e,t){const{onPointerMove:n,onPointerUp:r}=t,i=[m(e,"pointermove",s=>{const a=ne(s),c=Math.sqrt(a.x**2+a.y**2),u=s.pointerType==="touch"?10:5;if(!(c<u)){if(s.pointerType==="mouse"&&s.button===0){r();return}n({point:a,event:s})}},!1),m(e,"pointerup",r,!1),m(e,"pointercancel",r,!1),m(e,"contextmenu",r,!1),Ie({doc:e})];return()=>{i.forEach(s=>s())}}function mn(e){const{pointerNode:t,keyboardNode:n=t,onPress:r,onPressStart:o,onPressEnd:i,isValidKey:s=g=>g.key==="Enter"}=e;if(!t)return A;const a=v(t),c=I(t);let u=A,d=A,p=A;const l=g=>({point:ne(g),event:g});function f(g){o?.(l(g))}function h(g){i?.(l(g))}const k=m(t,"pointerdown",g=>{d();const _=m(a,"pointerup",E=>{const W=te(E);J(t,W)?r?.(l(E)):i?.(l(E))},{passive:!r,once:!0}),U=m(a,"pointercancel",h,{passive:!i,once:!0});d=z(_,U),c.activeElement===n&&g.pointerType==="mouse"&&g.preventDefault(),f(g)},{passive:!o}),Ue=m(n,"focus",We);u=z(k,Ue);function We(){const g=E=>{if(!s(E))return;const W=He=>{if(!s(He))return;const Xe=new a.PointerEvent("pointerup"),ue=l(Xe);r?.(ue),i?.(ue)};d(),d=m(n,"keyup",W);const ze=new a.PointerEvent("pointerdown");f(ze)},ce=()=>{const E=new a.PointerEvent("pointercancel");h(E)},_=m(n,"keydown",g),U=m(n,"blur",ce);p=z(_,U)}return()=>{u(),d(),p()}}function gn(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:o}=t,i=e?.ownerDocument||document,s=i.body;function a(c){if(c.key!=="Tab")return;let u=null;const[d,p]=ke(e,!0),l=Gt(s,n),f=!d&&!p;c.shiftKey&&l===i.activeElement?(o?.(),u=p):c.shiftKey&&(i.activeElement===d||f)?u=n:!c.shiftKey&&i.activeElement===n?(o?.(),u=d):!c.shiftKey&&(i.activeElement===p||f)&&(u=l),u&&(c.preventDefault(),typeof r=="function"?r(u):u.focus())}return m(i,"keydown",a,!0)}function yn(e,t){const{defer:n,triggerElement:r,...o}=t,i=n?S:a=>a(),s=[];return s.push(i(()=>{const a=typeof e=="function"?e():e,c=typeof r=="function"?r():r;s.push(gn(a,{triggerElement:c,...o}))})),()=>{s.forEach(a=>a?.())}}function hn(e,t){return Array.from(e?.querySelectorAll(t)??[])}function vn(e,t){return e?.querySelector(t)??null}var se=e=>e.id;function Ne(e,t,n=se){return e.find(r=>n(r)===t)}function ae(e,t,n=se){const r=Ne(e,t,n);return r?e.indexOf(r):-1}function bn(e,t,n=!0){let r=ae(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function En(e,t,n=!0){let r=ae(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}function wn(e,t){const{onEntry:n,measure:r,box:o="border-box"}=t,i=(Array.isArray(e)?e:[e]).filter(y),s=v(i[0]),a=u=>{const d=i.map(p=>r(p));n({rects:d,entries:u})};a([]);const c=new s.ResizeObserver(a);return i.forEach(u=>c.observe(u,{box:o})),()=>c.disconnect()}var An=e=>e.split("").map(t=>{const n=t.charCodeAt(0);return n>0&&n<128?t:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),Tn=e=>An(e.dataset?.valuetext??e.textContent??""),Sn=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function kn(e,t,n,r=se){const o=n?ae(e,n,r):-1;let i=n?Ge(e,o):e;return t.length===1&&(i=i.filter(a=>r(a)!==n)),i.find(a=>Sn(Tn(a),t))}function xn(e,t){if(!e)return A;const n=Object.keys(t).reduce((r,o)=>(r[o]=e.style.getPropertyValue(o),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function Pn(e,t,n){if(!e)return A;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function In(e,t){const{state:n,activeId:r,key:o,timeout:i=350,itemToId:s}=t,a=n.keysSoFar+o,u=a.length>1&&Array.from(a).every(h=>h===a[0])?a[0]:a;let d=e.slice();const p=kn(d,u,r,s);function l(){clearTimeout(n.timer),n.timer=-1}function f(h){n.keysSoFar=h,l(),h!==""&&(n.timer=+setTimeout(()=>{f(""),l()},i))}return f(a),p}var Nn=Object.assign(In,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:Vn});function Vn(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Mn={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},Dn=1e3/60;function Ln(e,t){const n=e();if(y(n)&&n.isConnected)return t(n),()=>{};{const r=setInterval(()=>{const o=e();y(o)&&o.isConnected&&(t(o),clearInterval(r))},Dn);return()=>clearInterval(r)}}function Cn(e,t){const n=[];return e?.forEach(r=>{const o=Ln(r,t);n.push(o)}),()=>{n.forEach(r=>r())}}function Rn(e){return e?Array.isArray(e)?e:[e]:[]}var Fn=e=>Array.from(Array(e).keys()),On=e=>e[0],Kn=e=>e[e.length-1],jn=(e,t)=>e.indexOf(t)!==-1,Ve=(e,...t)=>e.concat(t),Me=(e,...t)=>e.filter(n=>!t.includes(n)),Bn=(e,t)=>jn(e,t)?Me(e,t):Ve(e,t);function De(e,t,n={}){const{step:r=1,loop:o=!0}=n,i=t+r,s=e.length,a=s-1;return t===-1?r>0?0:a:i<0?o?a:0:i>=s?o?0:t>s?s:t:i}function qn(e,t,n={}){return e[De(e,t,n)]}function $n(e,t,n={}){const{step:r=1,loop:o=!0}=n;return De(e,t,{step:-r,loop:o})}function _n(e,t,n={}){return e[$n(e,t,n)]}function Le(e){return e.reduce((t,n)=>Array.isArray(n)?t.concat(Le(n)):t.concat(n),[])}var de=e=>e?.constructor.name==="Array",Un=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!q(e[n],t[n]))return!1;return!0},q=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(de(e)&&de(t))return Un(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let o=0;o<r;o++)if(!Reflect.has(e,n[o]))return!1;for(let o=0;o<r;o++){const i=n[o];if(!q(e[i],t[i]))return!1}return!0},Wn=e=>Array.isArray(e),zn=e=>e!=null&&typeof e=="object",Hn=e=>zn(e)&&!Wn(e),Xn=e=>typeof e=="number"&&!Number.isNaN(e),L=e=>typeof e=="string",Gn=e=>typeof e=="function",Zn=e=>e==null,Yn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Jn=Function.prototype.toString;Jn.call(Object);var Qn=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,er=e=>e(),tr=()=>{},Ce=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})},nr=(()=>{let e=0;return()=>(e++,e.toString(36))})(),Re=(e,t)=>{try{return e()}catch(n){return n instanceof Error&&Error.captureStackTrace?.(n,Re),t?.()}},{floor:Z,abs:F,round:$,min:rr,max:or,pow:ir,sign:sr}=Math,x=e=>Number.isNaN(e),b=e=>x(e)?0:e,ar=(e,t)=>(e%t+t)%t,cr=(e,t)=>(e%t+t)%t,ur=(e,t,n)=>e===0?n:t[e-1],lr=(e,t,n)=>e===t.length-1?n:t[e+1],fr=(e,t)=>b(e)>=t,dr=(e,t)=>b(e)<=t,pr=(e,t,n)=>b(e)>=t&&b(e)<=n,mr=(e,t,n)=>$((b(e)-t)/n)*n+t,Fe=(e,t,n)=>rr(or(b(e),t),n),gr=(e,t,n)=>(b(e)-t)/(n-t),yr=(e,t,n,r)=>Fe(mr(e*(n-t)+t,t,r),t,n),M=(e,t)=>{let n=e,r=t.toString(),o=r.indexOf("."),i=o>=0?r.length-o:0;if(i>0){let s=ir(10,i);n=$(n*s)/s}return n},hr=(e,t)=>typeof t=="number"?Z(e*t+.5)/t:$(e),Oe=(e,t,n,r)=>{t=Number(t),n=Number(n);let o=(e-(x(t)?0:t))%r,i=M(F(o)*2>=r?e+sr(o)*(r-F(o)):e-o,r);return x(t)?!x(n)&&i>n&&(i=t+Z(M((n-t)/r,r))*r):i<t?i=t:!x(n)&&i>n&&(i=t+Z(M((n-t)/r,r))*r),M(i,r)},Ke=(e,t,n)=>e[t]===n?e:[...e.slice(0,t),n,...e.slice(t+1)];function je(e,t){const n=ur(e,t.values,t.min),r=lr(e,t.values,t.max);let o=t.values.slice();return function(s){let a=Oe(s,n,r,t.step);return o=Ke(o,e,s),o[e]=a,o}}function vr(e,t){const n=t.values[e]+t.step;return je(e,t)(n)}function br(e,t){const n=t.values[e]-t.step;return je(e,t)(n)}var Er=(e,t)=>{let n=e.findIndex(i=>t-i<0);if(n===0)return n;if(n===-1)return e.length-1;let r=e[n-1],o=e[n];return F(r-t)<F(o-t)?n-1:n},wr=(e,t,n,r)=>e.map((o,i)=>({min:i===0?t:e[i-1]+r,max:i===e.length-1?n:e[i+1]-r,value:o})),Ar=(e,t)=>{const[n,r]=e,[o,i]=t;return s=>n===r||o===i?o:o+(i-o)/(r-n)*(s-n)},Tr=(e,t=0,n=10)=>{const r=Math.pow(n,t);return $(e*r)/r},pe=e=>{if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n},Be=(e,t,n)=>{let r=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){const o=10**Math.max(pe(e),pe(n));e=Math.round(e*o),n=Math.round(n*o),r=t==="+"?e+n:e-n,r/=o}return r},Sr=(e,t)=>Be(b(e),"+",t),kr=(e,t)=>Be(b(e),"-",t),xr=e=>e!=null?`${e}px`:void 0;function qe(e){if(!Pr(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=qe(o))}return n}var Pr=e=>e&&typeof e=="object"&&e.constructor===Object;function Ir(e,t){const n={};for(const r of t){const o=e[r];o!==void 0&&(n[r]=o)}return n}function Nr(e,t){const n=performance.now();let r;function o(i){r=requestAnimationFrame(o),i-n>=t&&e()}return r=requestAnimationFrame(o),()=>cancelAnimationFrame(r)}function Vr(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function Mr(...e){const t=e.length===1?e[0]:e[1];if((e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production")throw new Error(t)}function Dr(e,t){if(e==null)throw new Error(t())}function Lr(e,t,n){let r=[];for(const o of t)e[o]==null&&r.push(o);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var Cr=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),Rr=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,me=e=>{const t={};let n;for(;n=Rr.exec(e);)t[n[1]]=n[2];return t},Fr=(e,t)=>{if(L(e)){if(L(t))return`${e};${t}`;e=me(e)}else L(t)&&(t=me(t));return Object.assign({},e??{},t??{})};function Or(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=Ce(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=Cr(t[r],n[r]);continue}if(r==="style"){t[r]=Fr(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function Kr(e,t,n){let r=[],o;return i=>{const s=e(i);return(s.length!==r.length||s.some((c,u)=>!q(r[u],c)))&&(r=s,o=t(...s)),o}}function $e(){return{and:(...e)=>function(n){return e.every(r=>n.guard(r))},or:(...e)=>function(n){return e.some(r=>n.guard(r))},not:e=>function(n){return!n.guard(e)}}}function jr(e){return e}function Br(){return{guards:$e(),createMachine:e=>e,choose:e=>function({choose:n}){return n(e)?.actions}}}var _e=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(_e||{}),qr="__init__";function $r(e){const t=()=>e.getRootNode?.()??document,n=()=>I(t()),r=()=>n().defaultView??window,o=()=>he(t());return{...e,getRootNode:t,getDoc:n,getWin:r,getActiveElement:o,isActiveElement:a=>a===o(),getById:a=>t().getElementById(a)}}var C=(e,t=[])=>({parts:(...n)=>{if(_r(t))return C(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>C(e,[...t,...n]),rename:n=>C(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${w(e)}"][data-part="${w(r)}"]`,`& [data-scope="${w(e)}"][data-part="${w(r)}"]`].join(", "),attrs:{"data-scope":w(e),"data-part":w(r)}}}),{})}),w=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),_r=e=>e.length===0;exports.INIT_STATE=qr;exports.MAX_Z_INDEX=Ze;exports.MachineStatus=_e;exports.add=Ve;exports.addDomEvent=m;exports.addOrRemove=Bn;exports.ariaAttr=Je;exports.callAll=Ce;exports.clampValue=Fe;exports.clickIfLink=on;exports.compact=qe;exports.contains=J;exports.createAnatomy=C;exports.createGuards=$e;exports.createMachine=jr;exports.createScope=$r;exports.dataAttr=Ye;exports.decrementValue=kr;exports.disableTextSelection=Ie;exports.dispatchInputCheckedEvent=qt;exports.dispatchInputValueEvent=Bt;exports.ensure=Dr;exports.ensureProps=Lr;exports.first=On;exports.flatArray=Le;exports.fromLength=Fn;exports.getActiveElement=he;exports.getBeforeInputValue=At;exports.getByTypeahead=Nn;exports.getClosestValueIndex=Er;exports.getComputedStyle=ft;exports.getDataUrl=dt;exports.getDocument=I;exports.getEventKey=Rt;exports.getEventPoint=ne;exports.getEventStep=Kt;exports.getEventTarget=te;exports.getFocusables=Se;exports.getInitialFocus=Yt;exports.getNativeEvent=be;exports.getNearestOverflowAncestor=oe;exports.getNextStepValue=vr;exports.getOverflowAncestors=Pe;exports.getPercentValue=yr;exports.getPreviousStepValue=br;exports.getRelativePoint=un;exports.getTabIndex=Zt;exports.getTabbables=N;exports.getValuePercent=gr;exports.getValueRanges=wr;exports.getValueTransformer=Ar;exports.getWindow=v;exports.hasProp=Yn;exports.identity=er;exports.incrementValue=Sr;exports.invariant=Mr;exports.isAnchorElement=st;exports.isApple=ee;exports.isComposingEvent=Pt;exports.isContextMenuEvent=Mt;exports.isDocument=Y;exports.isDownloadingEvent=xt;exports.isEditableElement=ye;exports.isEqual=q;exports.isFocusable=R;exports.isFunction=Gn;exports.isHTMLElement=y;exports.isIos=j;exports.isLeftClick=Vt;exports.isMac=B;exports.isModifierKey=Dt;exports.isNull=Zn;exports.isNumber=Xn;exports.isObject=Hn;exports.isOpeningInNewTab=kt;exports.isPrintableKey=It;exports.isSafari=bt;exports.isSelfTarget=St;exports.isShadowRoot=P;exports.isString=L;exports.isTabbable=X;exports.isTouchDevice=yt;exports.isValidTabEvent=Jt;exports.isValueAtMax=fr;exports.isValueAtMin=dr;exports.isValueWithinRange=pr;exports.isVirtualClick=Nt;exports.itemById=Ne;exports.last=Kn;exports.memo=Kr;exports.mergeProps=Or;exports.mod=ar;exports.next=qn;exports.nextById=bn;exports.nextTick=xe;exports.noop=tr;exports.observeAttributes=tn;exports.observeChildren=rn;exports.pick=Ir;exports.prev=_n;exports.prevById=En;exports.proxyTabFocus=yn;exports.query=vn;exports.queryAll=hn;exports.raf=S;exports.remove=Me;exports.requestPointerLock=ln;exports.roundToDpr=hr;exports.runIfFn=Qn;exports.scrollIntoView=cn;exports.setElementChecked=Ae;exports.setElementValue=we;exports.setRafTimeout=Nr;exports.setStyle=xn;exports.setStyleProperty=Pn;exports.setValueAtIndex=Ke;exports.setup=Br;exports.snapValueToStep=Oe;exports.toArray=Rn;exports.toFixedNumber=Tr;exports.toPx=xr;exports.trackElementRect=wn;exports.trackFormControl=zt;exports.trackPointerMove=pn;exports.trackPress=mn;exports.tryCatch=Re;exports.uuid=nr;exports.visuallyHiddenStyle=Mn;exports.waitForElements=Cn;exports.warn=Vr;exports.wrap=cr;
|
|
3
|
+
//# sourceMappingURL=index-CZ42b9rT.js.map
|