@banzamel/mineralui 2.4.3 → 2.5.1
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/README.md +1 -1
- package/dist/MAvatar-CvQuiGvT.cjs +2 -0
- package/dist/MAvatar-CvQuiGvT.cjs.map +1 -0
- package/dist/MAvatar-EkOBrEtS.js +73 -0
- package/dist/MAvatar-EkOBrEtS.js.map +1 -0
- package/dist/MButton-BxEky3xQ.cjs +2 -0
- package/dist/MButton-BxEky3xQ.cjs.map +1 -0
- package/dist/MButton-KELyyBw1.js +123 -0
- package/dist/MButton-KELyyBw1.js.map +1 -0
- package/dist/{MButtonGroup-BEJxXZ8u.js → MButtonGroup-DDnn8Wfy.js} +3 -3
- package/dist/{MButtonGroup-BEJxXZ8u.js.map → MButtonGroup-DDnn8Wfy.js.map} +1 -1
- package/dist/{MButtonGroup-DO1Tq3Za.cjs → MButtonGroup-Dz8Fm-oA.cjs} +2 -2
- package/dist/{MButtonGroup-DO1Tq3Za.cjs.map → MButtonGroup-Dz8Fm-oA.cjs.map} +1 -1
- package/dist/{MCard-P8OoswWM.cjs → MCard-Bqm4BjK_.cjs} +2 -2
- package/dist/MCard-Bqm4BjK_.cjs.map +1 -0
- package/dist/{MCard-BqSkGAgf.js → MCard-CqZYGaS2.js} +4 -4
- package/dist/MCard-CqZYGaS2.js.map +1 -0
- package/dist/MCheckbox-CaWgyUn5.js +72 -0
- package/dist/MCheckbox-CaWgyUn5.js.map +1 -0
- package/dist/MCheckbox-DpKJpnFF.cjs +2 -0
- package/dist/MCheckbox-DpKJpnFF.cjs.map +1 -0
- package/dist/{MConflictIllustration-znC7ijmP.js → MConflictIllustration-dwZS44ye.js} +1517 -1515
- package/dist/MConflictIllustration-dwZS44ye.js.map +1 -0
- package/dist/MConflictIllustration-vfHs-jad.cjs +2 -0
- package/dist/MConflictIllustration-vfHs-jad.cjs.map +1 -0
- package/dist/MDetailList-C3othNs3.js +127 -0
- package/dist/MDetailList-C3othNs3.js.map +1 -0
- package/dist/MDetailList-DkDHLdJ8.cjs +2 -0
- package/dist/MDetailList-DkDHLdJ8.cjs.map +1 -0
- package/dist/MDropdownMenu-C4-r7UZM.cjs +2 -0
- package/dist/MDropdownMenu-C4-r7UZM.cjs.map +1 -0
- package/dist/MDropdownMenu-Dvg9UsHB.js +219 -0
- package/dist/MDropdownMenu-Dvg9UsHB.js.map +1 -0
- package/dist/MGrid-CQqT8nHi.js +271 -0
- package/dist/MGrid-CQqT8nHi.js.map +1 -0
- package/dist/MGrid-tBsqShLG.cjs +2 -0
- package/dist/MGrid-tBsqShLG.cjs.map +1 -0
- package/dist/MHeading-DQSQ8c7L.js +21 -0
- package/dist/MHeading-DQSQ8c7L.js.map +1 -0
- package/dist/MHeading-DiGYs1FJ.cjs +2 -0
- package/dist/MHeading-DiGYs1FJ.cjs.map +1 -0
- package/dist/MInput-BeEGufZG.cjs +2 -0
- package/dist/MInput-BeEGufZG.cjs.map +1 -0
- package/dist/MInput-QnQV9L8U.js +190 -0
- package/dist/MInput-QnQV9L8U.js.map +1 -0
- package/dist/MInputCVC-CCNRAqHw.cjs +2 -0
- package/dist/MInputCVC-CCNRAqHw.cjs.map +1 -0
- package/dist/MInputCVC-IXIYZwex.js +410 -0
- package/dist/MInputCVC-IXIYZwex.js.map +1 -0
- package/dist/MInputSearch-BSIc6m2P.cjs +2 -0
- package/dist/MInputSearch-BSIc6m2P.cjs.map +1 -0
- package/dist/MInputSearch-CNuTAbYs.js +44 -0
- package/dist/MInputSearch-CNuTAbYs.js.map +1 -0
- package/dist/{MKbd-BR1GX5oK.cjs → MKbd-CnW3NUIu.cjs} +2 -2
- package/dist/{MKbd-BR1GX5oK.cjs.map → MKbd-CnW3NUIu.cjs.map} +1 -1
- package/dist/{MKbd-COb7oh_k.js → MKbd-DjfGyajR.js} +2 -2
- package/dist/{MKbd-COb7oh_k.js.map → MKbd-DjfGyajR.js.map} +1 -1
- package/dist/MLink-C6uwA6db.cjs +2 -0
- package/dist/MLink-C6uwA6db.cjs.map +1 -0
- package/dist/MLink-ixg0xFFI.js +31 -0
- package/dist/MLink-ixg0xFFI.js.map +1 -0
- package/dist/MLoader-CViA3zBo.js +44 -0
- package/dist/MLoader-CViA3zBo.js.map +1 -0
- package/dist/MLoader-DUOoOoNE.cjs +2 -0
- package/dist/MLoader-DUOoOoNE.cjs.map +1 -0
- package/dist/MPagination-BTGenxWW.js +122 -0
- package/dist/MPagination-BTGenxWW.js.map +1 -0
- package/dist/MPagination-DitmdtCc.cjs +2 -0
- package/dist/MPagination-DitmdtCc.cjs.map +1 -0
- package/dist/MPopover-CBDbUOW6.js +183 -0
- package/dist/MPopover-CBDbUOW6.js.map +1 -0
- package/dist/MPopover-ZeoU9hb5.cjs +2 -0
- package/dist/MPopover-ZeoU9hb5.cjs.map +1 -0
- package/dist/{MSimpleGrid-Ui8cI0ho.js → MSimpleGrid-C_QvLmck.js} +3 -3
- package/dist/MSimpleGrid-C_QvLmck.js.map +1 -0
- package/dist/MSimpleGrid-wgvjnxwM.cjs +2 -0
- package/dist/MSimpleGrid-wgvjnxwM.cjs.map +1 -0
- package/dist/{MSkeleton-Dhu-loDO.js → MSkeleton-BpcpBBJq.js} +12 -10
- package/dist/MSkeleton-BpcpBBJq.js.map +1 -0
- package/dist/MSkeleton-DuAN8Vcv.cjs +2 -0
- package/dist/MSkeleton-DuAN8Vcv.cjs.map +1 -0
- package/dist/MSlider-CLASUc2H.js +134 -0
- package/dist/MSlider-CLASUc2H.js.map +1 -0
- package/dist/MSlider-hONQBulE.cjs +2 -0
- package/dist/MSlider-hONQBulE.cjs.map +1 -0
- package/dist/MStack-BwAFeGGg.js +39 -0
- package/dist/MStack-BwAFeGGg.js.map +1 -0
- package/dist/MStack-CGII4A-q.cjs +2 -0
- package/dist/MStack-CGII4A-q.cjs.map +1 -0
- package/dist/MSubText-BeZk-fhz.js +17 -0
- package/dist/MSubText-BeZk-fhz.js.map +1 -0
- package/dist/MSubText-Dl1PfToZ.cjs +2 -0
- package/dist/MSubText-Dl1PfToZ.cjs.map +1 -0
- package/dist/MSurface-B_QnRLr5.js +74 -0
- package/dist/MSurface-B_QnRLr5.js.map +1 -0
- package/dist/MSurface-BrFo-JMJ.cjs +2 -0
- package/dist/MSurface-BrFo-JMJ.cjs.map +1 -0
- package/dist/MTag-BZrKN_DS.js +41 -0
- package/dist/MTag-BZrKN_DS.js.map +1 -0
- package/dist/MTag-DCE1vRJM.cjs +2 -0
- package/dist/MTag-DCE1vRJM.cjs.map +1 -0
- package/dist/MText-BUWQPoBM.js +45 -0
- package/dist/MText-BUWQPoBM.js.map +1 -0
- package/dist/MText-nsvLFsSv.cjs +2 -0
- package/dist/MText-nsvLFsSv.cjs.map +1 -0
- package/dist/MTooltip-BRSPJ3RY.js +100 -0
- package/dist/MTooltip-BRSPJ3RY.js.map +1 -0
- package/dist/MTooltip-Cj2Fxmzc.cjs +2 -0
- package/dist/MTooltip-Cj2Fxmzc.cjs.map +1 -0
- package/dist/MTreeView-BWCTlsU-.cjs +2 -0
- package/dist/MTreeView-BWCTlsU-.cjs.map +1 -0
- package/dist/MTreeView-CWcMwE-Z.js +554 -0
- package/dist/MTreeView-CWcMwE-Z.js.map +1 -0
- package/dist/calendar-2yhnCkGW.cjs +2 -0
- package/dist/calendar-2yhnCkGW.cjs.map +1 -0
- package/dist/calendar-DcNYDTVb.js +195 -0
- package/dist/calendar-DcNYDTVb.js.map +1 -0
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{calendarDates-M_Dawj0j.js → calendarDates-Bpw_G_QR.js} +30 -19
- package/dist/calendarDates-Bpw_G_QR.js.map +1 -0
- package/dist/calendarDates-Cg0nm69Y.cjs +2 -0
- package/dist/calendarDates-Cg0nm69Y.cjs.map +1 -0
- package/dist/cards-Bp886TRb.cjs +2 -0
- package/dist/cards-Bp886TRb.cjs.map +1 -0
- package/dist/cards-BvER6Gx0.js +1277 -0
- package/dist/cards-BvER6Gx0.js.map +1 -0
- package/dist/cards.cjs +1 -1
- package/dist/cards.js +2 -2
- package/dist/{cn-YER3QsV1.js → cn-CUSXNnjF.js} +1 -1
- package/dist/{cn-YER3QsV1.js.map → cn-CUSXNnjF.js.map} +1 -1
- package/dist/{cn-CU5TNITO.cjs → cn-DYFxgzi2.cjs} +1 -1
- package/dist/{cn-CU5TNITO.cjs.map → cn-DYFxgzi2.cjs.map} +1 -1
- package/dist/components/cards/MCardDaySchedule/MCardDaySchedule.d.ts +1 -1
- package/dist/components/cards/MCardDocumentTree/MCardDocumentTree.d.ts +1 -1
- package/dist/components/cards/MCardGrid/MCardGrid.d.ts +1 -1
- package/dist/components/cards/MCardPayment/MCardPayment.d.ts +1 -1
- package/dist/components/cards/MCardPayment/MCardPayment.types.d.ts +4 -0
- package/dist/components/cards/MCardPaymentMethod/MCardPaymentMethod.d.ts +1 -1
- package/dist/components/cards/MStatCard/MStatCard.d.ts +1 -1
- package/dist/components/controls/MCheckbox/MCheckbox.types.d.ts +6 -0
- package/dist/components/controls/MLoadMore/MLoadMore.d.ts +1 -1
- package/dist/components/controls/MSlider/MSlider.d.ts +1 -1
- package/dist/components/controls/MSlider/MSlider.types.d.ts +5 -0
- package/dist/components/data/MTreeView/MTreeView.d.ts +1 -1
- package/dist/components/data/MTreeView/MTreeView.types.d.ts +6 -0
- package/dist/components/data/MWeekGrid/MWeekGrid.d.ts +1 -1
- package/dist/components/data/MWeekGrid/MWeekGrid.types.d.ts +9 -3
- package/dist/components/display/MCodeBlock/MCodeBlock.d.ts +1 -1
- package/dist/components/dropdowns/MAutocomplete/MAutocomplete.d.ts +1 -1
- package/dist/components/dropdowns/MAutocomplete/MAutocomplete.types.d.ts +8 -2
- package/dist/components/dropdowns/MSelect/MSelect.d.ts +1 -1
- package/dist/components/dropdowns/shared/TimeColumnListbox.d.ts +20 -0
- package/dist/components/feedback/MAlert/MAlert.d.ts +1 -1
- package/dist/components/feedback/MBadge/MBadge.d.ts +1 -1
- package/dist/components/feedback/MBanner/MBanner.d.ts +1 -1
- package/dist/components/feedback/MLoader/MLoader.d.ts +1 -1
- package/dist/components/feedback/MSpinner/MSpinner.d.ts +1 -1
- package/dist/components/feedback/MTag/MTag.d.ts +1 -1
- package/dist/components/inputs/MInput/MInput.types.d.ts +6 -1
- package/dist/components/inputs/MInput/useFormatCaret.d.ts +8 -0
- package/dist/components/layout/MCanvasGrid/MCanvasGrid.types.d.ts +5 -0
- package/dist/components/layout/MContainer/MContainer.d.ts +1 -1
- package/dist/components/layout/MDivider/MDivider.d.ts +1 -1
- package/dist/components/layout/MFooter/MFooter.d.ts +1 -1
- package/dist/components/layout/MHeader/MHeader.d.ts +1 -1
- package/dist/components/layout/MInline/MInline.d.ts +1 -1
- package/dist/components/layout/MNavbar/MNavbar.d.ts +1 -1
- package/dist/components/layout/MNavbar/MNavbar.types.d.ts +2 -0
- package/dist/components/layout/MSection/MSection.d.ts +1 -1
- package/dist/components/layout/MStack/MStack.d.ts +1 -1
- package/dist/components/layout/MStickyPanel/MStickyPanel.types.d.ts +4 -0
- package/dist/components/layout/MSurface/MSurface.d.ts +1 -1
- package/dist/components/media/MAvatar/MAvatar.d.ts +1 -1
- package/dist/components/media/MAvatar/MAvatar.types.d.ts +10 -0
- package/dist/components/media/MCarousel/MCarousel.d.ts +1 -1
- package/dist/components/media/MImage/MImage.d.ts +1 -1
- package/dist/components/media/carouselA11y.d.ts +9 -0
- package/dist/components/overlays/MCommandPalette/MCommandPalette.d.ts +1 -1
- package/dist/components/overlays/MDropdownMenu/MDropdownMenu.d.ts +4 -2
- package/dist/components/overlays/MDropdownMenu/MDropdownMenu.types.d.ts +3 -1
- package/dist/components/overlays/MPopconfirm/MPopconfirm.d.ts +1 -1
- package/dist/components/overlays/scrollLock.d.ts +14 -0
- package/dist/components/primitives/MPopover/MPopover.d.ts +1 -1
- package/dist/components/primitives/MPopover/MPopover.types.d.ts +32 -1
- package/dist/components/primitives/MPopover/popoverStack.d.ts +6 -0
- package/dist/components/typography/MHeading/MHeading.d.ts +2 -3
- package/dist/components/typography/MSubText/MSubText.d.ts +1 -1
- package/dist/components/typography/MText/MText.d.ts +1 -1
- package/dist/controls-B4Dxaab4.js +491 -0
- package/dist/controls-B4Dxaab4.js.map +1 -0
- package/dist/controls-CyXEIOXD.cjs +2 -0
- package/dist/controls-CyXEIOXD.cjs.map +1 -0
- package/dist/controls.cjs +1 -1
- package/dist/controls.js +5 -5
- package/dist/creditCards-Bo2mrc53.cjs +2 -0
- package/dist/creditCards-Bo2mrc53.cjs.map +1 -0
- package/dist/{creditCards-D_iWmtG6.js → creditCards-DmDOyvcw.js} +20 -31
- package/dist/creditCards-DmDOyvcw.js.map +1 -0
- package/dist/data-BM3KG8oN.cjs +2 -0
- package/dist/data-BM3KG8oN.cjs.map +1 -0
- package/dist/data-qnR8OBmj.js +808 -0
- package/dist/data-qnR8OBmj.js.map +1 -0
- package/dist/data.cjs +1 -1
- package/dist/data.js +2 -2
- package/dist/{dateUtils-CUY6CRCf.js → dateUtils-B-ToNZq_.js} +5 -6
- package/dist/dateUtils-B-ToNZq_.js.map +1 -0
- package/dist/dateUtils-z2L7ZaxA.cjs +2 -0
- package/dist/dateUtils-z2L7ZaxA.cjs.map +1 -0
- package/dist/display-BLMOBofj.cjs +3 -0
- package/dist/display-BLMOBofj.cjs.map +1 -0
- package/dist/display-Dlb79lkA.js +968 -0
- package/dist/display-Dlb79lkA.js.map +1 -0
- package/dist/display.cjs +1 -1
- package/dist/display.js +2 -2
- package/dist/dropdowns-2_7VMEDo.js +2009 -0
- package/dist/dropdowns-2_7VMEDo.js.map +1 -0
- package/dist/dropdowns-DN7j8J-V.cjs +2 -0
- package/dist/dropdowns-DN7j8J-V.cjs.map +1 -0
- package/dist/dropdowns.cjs +1 -1
- package/dist/dropdowns.js +1 -1
- package/dist/feedback-CECayytY.js +335 -0
- package/dist/feedback-CECayytY.js.map +1 -0
- package/dist/feedback-paV8Ls-h.cjs +2 -0
- package/dist/feedback-paV8Ls-h.cjs.map +1 -0
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +5 -5
- package/dist/form-Br56h5EF.cjs +2 -0
- package/dist/form-Br56h5EF.cjs.map +1 -0
- package/dist/form-CJmMZgsH.js +165 -0
- package/dist/form-CJmMZgsH.js.map +1 -0
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{formatters-CNjg_h7-.cjs → formatters-CauWlsnM.cjs} +1 -1
- package/dist/{formatters-CNjg_h7-.cjs.map → formatters-CauWlsnM.cjs.map} +1 -1
- package/dist/{formatters-T0vvjMtB.js → formatters-Doqdu_w1.js} +1 -1
- package/dist/{formatters-T0vvjMtB.js.map → formatters-Doqdu_w1.js.map} +1 -1
- package/dist/frameworkTexts-CaqdiKHW.cjs +2 -0
- package/dist/frameworkTexts-CaqdiKHW.cjs.map +1 -0
- package/dist/frameworkTexts-o43FqY1A.js +505 -0
- package/dist/frameworkTexts-o43FqY1A.js.map +1 -0
- package/dist/i18n/MI18nProvider.d.ts +6 -1
- package/dist/i18n/frameworkTexts.d.ts +511 -0
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.js +2 -2
- package/dist/icons-Bp8bB9TP.cjs +2 -0
- package/dist/icons-Bp8bB9TP.cjs.map +1 -0
- package/dist/{icons-CBMl-kOM.js → icons-IqEBmGh3.js} +1223 -1220
- package/dist/icons-IqEBmGh3.js.map +1 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/illustrations.cjs +1 -1
- package/dist/illustrations.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +56 -56
- package/dist/inputs-C0BJzlA-.js +1923 -0
- package/dist/inputs-C0BJzlA-.js.map +1 -0
- package/dist/inputs-CvNBBLFA.cjs +2 -0
- package/dist/inputs-CvNBBLFA.cjs.map +1 -0
- package/dist/inputs.cjs +1 -1
- package/dist/inputs.js +4 -4
- package/dist/layout-BSFqGXLZ.js +1101 -0
- package/dist/layout-BSFqGXLZ.js.map +1 -0
- package/dist/layout-MKqvUkPv.cjs +2 -0
- package/dist/layout-MKqvUkPv.cjs.map +1 -0
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +6 -6
- package/dist/{layoutProps-Ck4VtGm9.cjs → layoutProps-B8y2XwHy.cjs} +1 -1
- package/dist/{layoutProps-Ck4VtGm9.cjs.map → layoutProps-B8y2XwHy.cjs.map} +1 -1
- package/dist/{layoutProps-Cl6d1KmH.js → layoutProps-CE5-ghKw.js} +1 -1
- package/dist/{layoutProps-Cl6d1KmH.js.map → layoutProps-CE5-ghKw.js.map} +1 -1
- package/dist/{licensing-f5KYVz7D.js → licensing-BKmoAdfr.js} +5 -4
- package/dist/licensing-BKmoAdfr.js.map +1 -0
- package/dist/licensing-DVgjkw-s.cjs +2 -0
- package/dist/licensing-DVgjkw-s.cjs.map +1 -0
- package/dist/media-fiasAbBv.js +485 -0
- package/dist/media-fiasAbBv.js.map +1 -0
- package/dist/media-tr1s386v.cjs +2 -0
- package/dist/media-tr1s386v.cjs.map +1 -0
- package/dist/media.cjs +1 -1
- package/dist/media.js +2 -2
- package/dist/overlays-Df-NpmkW.cjs +2 -0
- package/dist/overlays-Df-NpmkW.cjs.map +1 -0
- package/dist/overlays-W0WW3fn7.js +607 -0
- package/dist/overlays-W0WW3fn7.js.map +1 -0
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.js +3 -3
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.js +2 -2
- package/dist/radioGroupKeys-Bm-Qeh8G.js +28 -0
- package/dist/radioGroupKeys-Bm-Qeh8G.js.map +1 -0
- package/dist/radioGroupKeys-COL8uXbH.cjs +2 -0
- package/dist/radioGroupKeys-COL8uXbH.cjs.map +1 -0
- package/dist/{relativeTime-Cr-NVzij.js → relativeTime-BqCuaBqb.js} +1 -1
- package/dist/{relativeTime-Cr-NVzij.js.map → relativeTime-BqCuaBqb.js.map} +1 -1
- package/dist/{relativeTime-DgYBUaVm.cjs → relativeTime-DUbW4O44.cjs} +1 -1
- package/dist/{relativeTime-DgYBUaVm.cjs.map → relativeTime-DUbW4O44.cjs.map} +1 -1
- package/dist/scrollLock-C9P9o6wH.cjs +2 -0
- package/dist/scrollLock-C9P9o6wH.cjs.map +1 -0
- package/dist/scrollLock-D27VmgPV.js +14 -0
- package/dist/scrollLock-D27VmgPV.js.map +1 -0
- package/dist/style-runtime.cjs +1 -1
- package/dist/style-runtime.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/MThemeProvider.d.ts +18 -1
- package/dist/theme/index.d.ts +2 -2
- package/dist/{theme-DAOU1aPs.js → theme-B_juOenJ.js} +71 -61
- package/dist/theme-B_juOenJ.js.map +1 -0
- package/dist/theme-ByPZH0dh.cjs +2 -0
- package/dist/theme-ByPZH0dh.cjs.map +1 -0
- package/dist/theme.cjs +1 -1
- package/dist/theme.js +2 -2
- package/dist/{typography-C806GYT4.js → typography-DNcB8dOy.js} +3 -3
- package/dist/{typography-C806GYT4.js.map → typography-DNcB8dOy.js.map} +1 -1
- package/dist/{typography-4v01oNWx.cjs → typography-I7aeG8pH.cjs} +2 -2
- package/dist/{typography-4v01oNWx.cjs.map → typography-I7aeG8pH.cjs.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +6 -6
- package/dist/useGhostText-CKsb8Ufa.js +240 -0
- package/dist/useGhostText-CKsb8Ufa.js.map +1 -0
- package/dist/useGhostText-DO-tfxS0.cjs +2 -0
- package/dist/useGhostText-DO-tfxS0.cjs.map +1 -0
- package/dist/useModalLayer-CpOPSDbf.js +128 -0
- package/dist/useModalLayer-CpOPSDbf.js.map +1 -0
- package/dist/useModalLayer-Cyt93Prs.cjs +2 -0
- package/dist/useModalLayer-Cyt93Prs.cjs.map +1 -0
- package/dist/utils/calendarDates.d.ts +5 -0
- package/dist/utils/radioGroupKeys.d.ts +9 -0
- package/dist/utils/useDateGridNav.d.ts +39 -0
- package/dist/utils/useGhostText.d.ts +2 -1
- package/dist/utils/useKeyboardNav.d.ts +51 -5
- package/dist/utils/useModalLayer.d.ts +4 -0
- package/dist/utils/useRovingToolbar.d.ts +26 -0
- package/dist/utils/validationMessages.d.ts +15 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.entry.d.ts +3 -1
- package/dist/utils.js +11 -11
- package/dist/validationMessages-BFimXxlT.js +23 -0
- package/dist/validationMessages-BFimXxlT.js.map +1 -0
- package/dist/validationMessages-iHu7apWr.cjs +2 -0
- package/dist/validationMessages-iHu7apWr.cjs.map +1 -0
- package/dist/validators-SZmLxnir.cjs +2 -0
- package/dist/validators-SZmLxnir.cjs.map +1 -0
- package/dist/{validators-DVYOtFnw.js → validators-ULebNme2.js} +107 -106
- package/dist/validators-ULebNme2.js.map +1 -0
- package/package.json +1 -1
- package/dist/MAvatar-DHNB3829.cjs +0 -2
- package/dist/MAvatar-DHNB3829.cjs.map +0 -1
- package/dist/MAvatar-GeRL-CNO.js +0 -63
- package/dist/MAvatar-GeRL-CNO.js.map +0 -1
- package/dist/MButton-CEwo8lUB.js +0 -115
- package/dist/MButton-CEwo8lUB.js.map +0 -1
- package/dist/MButton-CnAr77Za.cjs +0 -2
- package/dist/MButton-CnAr77Za.cjs.map +0 -1
- package/dist/MCard-BqSkGAgf.js.map +0 -1
- package/dist/MCard-P8OoswWM.cjs.map +0 -1
- package/dist/MCheckbox-BxFBADcE.js +0 -59
- package/dist/MCheckbox-BxFBADcE.js.map +0 -1
- package/dist/MCheckbox-DozwF2ai.cjs +0 -2
- package/dist/MCheckbox-DozwF2ai.cjs.map +0 -1
- package/dist/MConflictIllustration-2QL-BHYv.cjs +0 -2
- package/dist/MConflictIllustration-2QL-BHYv.cjs.map +0 -1
- package/dist/MConflictIllustration-znC7ijmP.js.map +0 -1
- package/dist/MDetailList-CThQvoyf.cjs +0 -2
- package/dist/MDetailList-CThQvoyf.cjs.map +0 -1
- package/dist/MDetailList-Cx9H81xT.js +0 -98
- package/dist/MDetailList-Cx9H81xT.js.map +0 -1
- package/dist/MDropdownMenu-DnKcCyW6.cjs +0 -2
- package/dist/MDropdownMenu-DnKcCyW6.cjs.map +0 -1
- package/dist/MDropdownMenu-DxbKN7Ui.js +0 -172
- package/dist/MDropdownMenu-DxbKN7Ui.js.map +0 -1
- package/dist/MGrid-BkRSGN2t.cjs +0 -2
- package/dist/MGrid-BkRSGN2t.cjs.map +0 -1
- package/dist/MGrid-CIz-2i6X.js +0 -265
- package/dist/MGrid-CIz-2i6X.js.map +0 -1
- package/dist/MHeading-AYQ8_GFP.cjs +0 -2
- package/dist/MHeading-AYQ8_GFP.cjs.map +0 -1
- package/dist/MHeading-DcGxUMwC.js +0 -21
- package/dist/MHeading-DcGxUMwC.js.map +0 -1
- package/dist/MI18nProvider-CqAwaswx.cjs +0 -2
- package/dist/MI18nProvider-CqAwaswx.cjs.map +0 -1
- package/dist/MI18nProvider-VH14CI8u.js +0 -72
- package/dist/MI18nProvider-VH14CI8u.js.map +0 -1
- package/dist/MInput-BYj2BdUe.cjs +0 -2
- package/dist/MInput-BYj2BdUe.cjs.map +0 -1
- package/dist/MInput-nodE-CZF.js +0 -188
- package/dist/MInput-nodE-CZF.js.map +0 -1
- package/dist/MInputCVC-9XWryaTz.cjs +0 -2
- package/dist/MInputCVC-9XWryaTz.cjs.map +0 -1
- package/dist/MInputCVC-CrDTaUXm.js +0 -321
- package/dist/MInputCVC-CrDTaUXm.js.map +0 -1
- package/dist/MInputSearch-BMgCHjFk.js +0 -43
- package/dist/MInputSearch-BMgCHjFk.js.map +0 -1
- package/dist/MInputSearch-BiVI1jNc.cjs +0 -2
- package/dist/MInputSearch-BiVI1jNc.cjs.map +0 -1
- package/dist/MLink-CAl6N6_z.js +0 -31
- package/dist/MLink-CAl6N6_z.js.map +0 -1
- package/dist/MLink-Dk_ReE6i.cjs +0 -2
- package/dist/MLink-Dk_ReE6i.cjs.map +0 -1
- package/dist/MLoader-CYp0OJU_.js +0 -41
- package/dist/MLoader-CYp0OJU_.js.map +0 -1
- package/dist/MLoader-DvmFle31.cjs +0 -2
- package/dist/MLoader-DvmFle31.cjs.map +0 -1
- package/dist/MPagination-E7IixIeo.js +0 -113
- package/dist/MPagination-E7IixIeo.js.map +0 -1
- package/dist/MPagination-reDU9xTW.cjs +0 -2
- package/dist/MPagination-reDU9xTW.cjs.map +0 -1
- package/dist/MPopover-8gYD3Ogq.js +0 -118
- package/dist/MPopover-8gYD3Ogq.js.map +0 -1
- package/dist/MPopover-B3npyAkL.cjs +0 -2
- package/dist/MPopover-B3npyAkL.cjs.map +0 -1
- package/dist/MPortal-Ba2Sxset.js +0 -10
- package/dist/MPortal-Ba2Sxset.js.map +0 -1
- package/dist/MPortal-CuBXhhl_.cjs +0 -2
- package/dist/MPortal-CuBXhhl_.cjs.map +0 -1
- package/dist/MSimpleGrid-BchGYPMi.cjs +0 -2
- package/dist/MSimpleGrid-BchGYPMi.cjs.map +0 -1
- package/dist/MSimpleGrid-Ui8cI0ho.js.map +0 -1
- package/dist/MSkeleton-DPa_G_2X.cjs +0 -2
- package/dist/MSkeleton-DPa_G_2X.cjs.map +0 -1
- package/dist/MSkeleton-Dhu-loDO.js.map +0 -1
- package/dist/MSlider-BRjhyBSc.js +0 -75
- package/dist/MSlider-BRjhyBSc.js.map +0 -1
- package/dist/MSlider-w5214a-W.cjs +0 -2
- package/dist/MSlider-w5214a-W.cjs.map +0 -1
- package/dist/MStack-Dt-rWvg3.js +0 -39
- package/dist/MStack-Dt-rWvg3.js.map +0 -1
- package/dist/MStack-nc6Y_9K3.cjs +0 -2
- package/dist/MStack-nc6Y_9K3.cjs.map +0 -1
- package/dist/MSubText-B0tXiuAp.js +0 -17
- package/dist/MSubText-B0tXiuAp.js.map +0 -1
- package/dist/MSubText-C6v6Exa2.cjs +0 -2
- package/dist/MSubText-C6v6Exa2.cjs.map +0 -1
- package/dist/MSurface-BjE-mL1L.cjs +0 -2
- package/dist/MSurface-BjE-mL1L.cjs.map +0 -1
- package/dist/MSurface-CpDJCdb5.js +0 -74
- package/dist/MSurface-CpDJCdb5.js.map +0 -1
- package/dist/MTag-BgOxiahL.cjs +0 -2
- package/dist/MTag-BgOxiahL.cjs.map +0 -1
- package/dist/MTag-cw3cIGHX.js +0 -41
- package/dist/MTag-cw3cIGHX.js.map +0 -1
- package/dist/MText-BDI4mdw8.cjs +0 -2
- package/dist/MText-BDI4mdw8.cjs.map +0 -1
- package/dist/MText-DhbAjtUE.js +0 -45
- package/dist/MText-DhbAjtUE.js.map +0 -1
- package/dist/MTooltip-BAgHlv5I.cjs +0 -2
- package/dist/MTooltip-BAgHlv5I.cjs.map +0 -1
- package/dist/MTooltip-CJxvlkOX.js +0 -92
- package/dist/MTooltip-CJxvlkOX.js.map +0 -1
- package/dist/MTreeView-DsBnYQMT.js +0 -315
- package/dist/MTreeView-DsBnYQMT.js.map +0 -1
- package/dist/MTreeView-LiJ5o-zy.cjs +0 -2
- package/dist/MTreeView-LiJ5o-zy.cjs.map +0 -1
- package/dist/calendar-Bq6NMNnS.js +0 -193
- package/dist/calendar-Bq6NMNnS.js.map +0 -1
- package/dist/calendar-C57BH8Nd.cjs +0 -2
- package/dist/calendar-C57BH8Nd.cjs.map +0 -1
- package/dist/calendarDates-M_Dawj0j.js.map +0 -1
- package/dist/calendarDates-qm047RW2.cjs +0 -2
- package/dist/calendarDates-qm047RW2.cjs.map +0 -1
- package/dist/cards-D4xJVd4q.js +0 -1227
- package/dist/cards-D4xJVd4q.js.map +0 -1
- package/dist/cards-Du6dbZSQ.cjs +0 -2
- package/dist/cards-Du6dbZSQ.cjs.map +0 -1
- package/dist/controls-BKoc_yel.js +0 -475
- package/dist/controls-BKoc_yel.js.map +0 -1
- package/dist/controls-Ck-PMt__.cjs +0 -2
- package/dist/controls-Ck-PMt__.cjs.map +0 -1
- package/dist/creditCards-D_HwRUBz.cjs +0 -2
- package/dist/creditCards-D_HwRUBz.cjs.map +0 -1
- package/dist/creditCards-D_iWmtG6.js.map +0 -1
- package/dist/data-CdQximqm.js +0 -689
- package/dist/data-CdQximqm.js.map +0 -1
- package/dist/data-PS4ygCyj.cjs +0 -2
- package/dist/data-PS4ygCyj.cjs.map +0 -1
- package/dist/dateUtils-CUY6CRCf.js.map +0 -1
- package/dist/dateUtils-Dq1vaA-D.cjs +0 -2
- package/dist/dateUtils-Dq1vaA-D.cjs.map +0 -1
- package/dist/display-YC1fVpXA.js +0 -782
- package/dist/display-YC1fVpXA.js.map +0 -1
- package/dist/display-slIo1bQI.cjs +0 -3
- package/dist/display-slIo1bQI.cjs.map +0 -1
- package/dist/dropdowns-DFbUoZ8Q.cjs +0 -2
- package/dist/dropdowns-DFbUoZ8Q.cjs.map +0 -1
- package/dist/dropdowns-nW3MY5XG.js +0 -1715
- package/dist/dropdowns-nW3MY5XG.js.map +0 -1
- package/dist/feedback-6MNb2Xyk.cjs +0 -2
- package/dist/feedback-6MNb2Xyk.cjs.map +0 -1
- package/dist/feedback-CPwJaQHY.js +0 -259
- package/dist/feedback-CPwJaQHY.js.map +0 -1
- package/dist/form-CMsZo6Dm.cjs +0 -2
- package/dist/form-CMsZo6Dm.cjs.map +0 -1
- package/dist/form-WU6DcQGD.js +0 -164
- package/dist/form-WU6DcQGD.js.map +0 -1
- package/dist/frameworkTexts-BSXUtXOp.cjs +0 -2
- package/dist/frameworkTexts-BSXUtXOp.cjs.map +0 -1
- package/dist/frameworkTexts-DP5RUl19.js +0 -131
- package/dist/frameworkTexts-DP5RUl19.js.map +0 -1
- package/dist/icons-CBMl-kOM.js.map +0 -1
- package/dist/icons-D3n9-919.cjs +0 -2
- package/dist/icons-D3n9-919.cjs.map +0 -1
- package/dist/inputs-B7rGMLMr.js +0 -1753
- package/dist/inputs-B7rGMLMr.js.map +0 -1
- package/dist/inputs-BiN62hgH.cjs +0 -2
- package/dist/inputs-BiN62hgH.cjs.map +0 -1
- package/dist/layout-BMggJ_qO.cjs +0 -2
- package/dist/layout-BMggJ_qO.cjs.map +0 -1
- package/dist/layout-DBYHyCTr.js +0 -883
- package/dist/layout-DBYHyCTr.js.map +0 -1
- package/dist/licensing-Be3g-PJt.cjs +0 -2
- package/dist/licensing-Be3g-PJt.cjs.map +0 -1
- package/dist/licensing-f5KYVz7D.js.map +0 -1
- package/dist/media-BPzMgzqE.js +0 -405
- package/dist/media-BPzMgzqE.js.map +0 -1
- package/dist/media-D63hxCAJ.cjs +0 -2
- package/dist/media-D63hxCAJ.cjs.map +0 -1
- package/dist/overlays-CCeYD6hT.js +0 -555
- package/dist/overlays-CCeYD6hT.js.map +0 -1
- package/dist/overlays-CsRN5OG8.cjs +0 -2
- package/dist/overlays-CsRN5OG8.cjs.map +0 -1
- package/dist/popoverStack--0r2oJCD.js +0 -44
- package/dist/popoverStack--0r2oJCD.js.map +0 -1
- package/dist/popoverStack-BmMk-VZJ.cjs +0 -2
- package/dist/popoverStack-BmMk-VZJ.cjs.map +0 -1
- package/dist/theme-CJuqObWL.cjs +0 -2
- package/dist/theme-CJuqObWL.cjs.map +0 -1
- package/dist/theme-DAOU1aPs.js.map +0 -1
- package/dist/useGhostText-DG0bzcao.js +0 -68
- package/dist/useGhostText-DG0bzcao.js.map +0 -1
- package/dist/useGhostText-mibV4s1-.cjs +0 -2
- package/dist/useGhostText-mibV4s1-.cjs.map +0 -1
- package/dist/useKeyboardNav-CCUoRMgm.cjs +0 -2
- package/dist/useKeyboardNav-CCUoRMgm.cjs.map +0 -1
- package/dist/useKeyboardNav-iEXOdEMB.js +0 -43
- package/dist/useKeyboardNav-iEXOdEMB.js.map +0 -1
- package/dist/useModalLayer-Bf4TcEz-.js +0 -58
- package/dist/useModalLayer-Bf4TcEz-.js.map +0 -1
- package/dist/useModalLayer-DxYhhgRO.cjs +0 -2
- package/dist/useModalLayer-DxYhhgRO.cjs.map +0 -1
- package/dist/validators-B6yWdsu2.cjs +0 -2
- package/dist/validators-B6yWdsu2.cjs.map +0 -1
- package/dist/validators-DVYOtFnw.js.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { C as e } from "./frameworkTexts-o43FqY1A.js";
|
|
2
|
+
import { t } from "./cn-CUSXNnjF.js";
|
|
3
|
+
import { t as n } from "./MText-BUWQPoBM.js";
|
|
4
|
+
import { r } from "./MButton-KELyyBw1.js";
|
|
5
|
+
import { t as i } from "./MStack-BwAFeGGg.js";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/feedback/MLoader/MLoader.tsx
|
|
8
|
+
var s = {
|
|
9
|
+
xs: "xs",
|
|
10
|
+
sm: "sm",
|
|
11
|
+
md: "md",
|
|
12
|
+
lg: "lg",
|
|
13
|
+
xl: "xl"
|
|
14
|
+
};
|
|
15
|
+
function c({ color: c = "primary", size: l = "lg", label: u, center: d = !0, minHeight: f = "40vh", className: p, style: m, ...h }) {
|
|
16
|
+
let g = e(), _ = u ?? g.label, v = {
|
|
17
|
+
minHeight: typeof f == "number" ? `${f}px` : f,
|
|
18
|
+
...m
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ a("div", {
|
|
21
|
+
className: t("loader", d && "center", p),
|
|
22
|
+
style: v,
|
|
23
|
+
role: "status",
|
|
24
|
+
...h,
|
|
25
|
+
children: /* @__PURE__ */ o(i, {
|
|
26
|
+
align: "center",
|
|
27
|
+
children: [/* @__PURE__ */ a(r, {
|
|
28
|
+
size: l,
|
|
29
|
+
color: c,
|
|
30
|
+
label: _,
|
|
31
|
+
"aria-hidden": "true"
|
|
32
|
+
}), /* @__PURE__ */ a(n, {
|
|
33
|
+
tone: "muted",
|
|
34
|
+
align: "center",
|
|
35
|
+
size: typeof l == "number" ? void 0 : s[l],
|
|
36
|
+
children: _
|
|
37
|
+
})]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { c as t };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=MLoader-CViA3zBo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MLoader-CViA3zBo.js","names":[],"sources":["../src/components/feedback/MLoader/MLoader.tsx"],"sourcesContent":["import type {CSSProperties} from 'react'\nimport type {MSize} from '../../../theme'\nimport {MSpinner} from '../MSpinner'\nimport {MStack} from '../../layout'\nimport {MText} from '../../typography'\nimport {cn} from '../../../utils/cn'\nimport type {MLoaderProps} from './MLoader.types'\nimport './MLoader.css'\nimport {useMSpinnerTexts} from '../../../i18n/frameworkTexts'\n\nconst TEXT_SIZE: Record<MSize, MSize> = {xs: 'xs', sm: 'sm', md: 'md', lg: 'lg', xl: 'xl'}\n\n// Keep loading feedback minimal so apps can reuse it without card or alert chrome.\nexport function MLoader({\n color = 'primary',\n size = 'lg',\n label: labelProp,\n center = true,\n minHeight = '40vh',\n className,\n style,\n ...rest\n}: MLoaderProps) {\n const texts = useMSpinnerTexts()\n const label = labelProp ?? texts.label\n const inlineStyle: CSSProperties = {\n minHeight: typeof minHeight === 'number' ? `${minHeight}px` : minHeight,\n ...style,\n }\n\n return (\n // The host is the single status region; the spinner is decorative so the label is read once.\n <div className={cn('loader', center && 'center', className)} style={inlineStyle} role=\"status\" {...rest}>\n <MStack align={'center'}>\n <MSpinner size={size} color={color} label={label} aria-hidden=\"true\" />\n <MText tone={'muted'} align={'center'} size={typeof size === 'number' ? undefined : TEXT_SIZE[size]}>\n {label}\n </MText>\n </MStack>\n </div>\n )\n}\n"],"mappings":";;;;;;;AAUA,IAAM,IAAkC;CAAC,IAAI;CAAM,IAAI;CAAM,IAAI;CAAM,IAAI;CAAM,IAAI;CAAK;AAG1F,SAAgB,EAAQ,EACpB,WAAQ,WACR,UAAO,MACP,OAAO,GACP,YAAS,IACT,eAAY,QACZ,cACA,UACA,GAAG,KACU;CACb,IAAM,IAAQ,GAAkB,EAC1B,IAAQ,KAAa,EAAM,OAC3B,IAA6B;EAC/B,WAAW,OAAO,KAAc,WAAW,GAAG,EAAU,MAAM;EAC9D,GAAG;EACN;AAED,QAEI,kBAAC,OAAD;EAAK,WAAW,EAAG,UAAU,KAAU,UAAU,EAAU;EAAE,OAAO;EAAa,MAAK;EAAS,GAAI;YAC/F,kBAAC,GAAD;GAAQ,OAAO;aAAf,CACI,kBAAC,GAAD;IAAgB;IAAa;IAAc;IAAO,eAAY;IAAS,CAAA,EACvE,kBAAC,GAAD;IAAO,MAAM;IAAS,OAAO;IAAU,MAAM,OAAO,KAAS,WAAW,KAAA,IAAY,EAAU;cACzF;IACG,CAAA,CACH;;EACP,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./frameworkTexts-CaqdiKHW.cjs`),t=require(`./cn-DYFxgzi2.cjs`),n=require(`./MText-nsvLFsSv.cjs`),r=require(`./MButton-BxEky3xQ.cjs`),i=require(`./MStack-CGII4A-q.cjs`);require(`./core-w629c4ND.cjs`);let a=require(`react/jsx-runtime`);var o={xs:`xs`,sm:`sm`,md:`md`,lg:`lg`,xl:`xl`};function s({color:s=`primary`,size:c=`lg`,label:l,center:u=!0,minHeight:d=`40vh`,className:f,style:p,...m}){let h=e.C(),g=l??h.label,_={minHeight:typeof d==`number`?`${d}px`:d,...p};return(0,a.jsx)(`div`,{className:t.t(`loader`,u&&`center`,f),style:_,role:`status`,...m,children:(0,a.jsxs)(i.t,{align:`center`,children:[(0,a.jsx)(r.r,{size:c,color:s,label:g,"aria-hidden":`true`}),(0,a.jsx)(n.t,{tone:`muted`,align:`center`,size:typeof c==`number`?void 0:o[c],children:g})]})})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
|
2
|
+
//# sourceMappingURL=MLoader-DUOoOoNE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MLoader-DUOoOoNE.cjs","names":[],"sources":["../src/components/feedback/MLoader/MLoader.tsx"],"sourcesContent":["import type {CSSProperties} from 'react'\nimport type {MSize} from '../../../theme'\nimport {MSpinner} from '../MSpinner'\nimport {MStack} from '../../layout'\nimport {MText} from '../../typography'\nimport {cn} from '../../../utils/cn'\nimport type {MLoaderProps} from './MLoader.types'\nimport './MLoader.css'\nimport {useMSpinnerTexts} from '../../../i18n/frameworkTexts'\n\nconst TEXT_SIZE: Record<MSize, MSize> = {xs: 'xs', sm: 'sm', md: 'md', lg: 'lg', xl: 'xl'}\n\n// Keep loading feedback minimal so apps can reuse it without card or alert chrome.\nexport function MLoader({\n color = 'primary',\n size = 'lg',\n label: labelProp,\n center = true,\n minHeight = '40vh',\n className,\n style,\n ...rest\n}: MLoaderProps) {\n const texts = useMSpinnerTexts()\n const label = labelProp ?? texts.label\n const inlineStyle: CSSProperties = {\n minHeight: typeof minHeight === 'number' ? `${minHeight}px` : minHeight,\n ...style,\n }\n\n return (\n // The host is the single status region; the spinner is decorative so the label is read once.\n <div className={cn('loader', center && 'center', className)} style={inlineStyle} role=\"status\" {...rest}>\n <MStack align={'center'}>\n <MSpinner size={size} color={color} label={label} aria-hidden=\"true\" />\n <MText tone={'muted'} align={'center'} size={typeof size === 'number' ? undefined : TEXT_SIZE[size]}>\n {label}\n </MText>\n </MStack>\n </div>\n )\n}\n"],"mappings":"2PAUA,IAAM,EAAkC,CAAC,GAAI,KAAM,GAAI,KAAM,GAAI,KAAM,GAAI,KAAM,GAAI,KAAK,CAG1F,SAAgB,EAAQ,CACpB,QAAQ,UACR,OAAO,KACP,MAAO,EACP,SAAS,GACT,YAAY,OACZ,YACA,QACA,GAAG,GACU,CACb,IAAM,EAAQ,EAAA,GAAkB,CAC1B,EAAQ,GAAa,EAAM,MAC3B,EAA6B,CAC/B,UAAW,OAAO,GAAc,SAAW,GAAG,EAAU,IAAM,EAC9D,GAAG,EACN,CAED,OAEI,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,EAAG,SAAU,GAAU,SAAU,EAAU,CAAE,MAAO,EAAa,KAAK,SAAS,GAAI,YAC/F,EAAA,EAAA,MAAC,EAAA,EAAD,CAAQ,MAAO,kBAAf,EACI,EAAA,EAAA,KAAC,EAAA,EAAD,CAAgB,OAAa,QAAc,QAAO,cAAY,OAAS,CAAA,EACvE,EAAA,EAAA,KAAC,EAAA,EAAD,CAAO,KAAM,QAAS,MAAO,SAAU,KAAM,OAAO,GAAS,SAAW,IAAA,GAAY,EAAU,YACzF,EACG,CAAA,CACH,GACP,CAAA"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { m as e, t } from "./frameworkTexts-o43FqY1A.js";
|
|
2
|
+
import { Ji as n, qi as r } from "./icons-IqEBmGh3.js";
|
|
3
|
+
import { t as i } from "./cn-CUSXNnjF.js";
|
|
4
|
+
import { t as a } from "./MButton-KELyyBw1.js";
|
|
5
|
+
import { useMemo as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/layout/MPagination/MPagination.tsx
|
|
8
|
+
function l(e, t) {
|
|
9
|
+
let n = [];
|
|
10
|
+
for (let r = e; r <= t; r++) n.push(r);
|
|
11
|
+
return n;
|
|
12
|
+
}
|
|
13
|
+
function u(e, t, n, r) {
|
|
14
|
+
if (e <= r * 2 + n * 2 + 3) return l(1, e);
|
|
15
|
+
let i = Math.max(t - n, r + 2), a = Math.min(t + n, e - r - 1), o = i > r + 2, s = a < e - r - 1, c = l(1, r), u = l(e - r + 1, e);
|
|
16
|
+
if (!o && s) return [
|
|
17
|
+
...l(1, n * 2 + r + 2),
|
|
18
|
+
"dots",
|
|
19
|
+
...u
|
|
20
|
+
];
|
|
21
|
+
if (o && !s) {
|
|
22
|
+
let t = n * 2 + r + 2;
|
|
23
|
+
return [
|
|
24
|
+
...c,
|
|
25
|
+
"dots",
|
|
26
|
+
...l(e - t + 1, e)
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
return [
|
|
30
|
+
...c,
|
|
31
|
+
"dots",
|
|
32
|
+
...l(i, a),
|
|
33
|
+
"dots",
|
|
34
|
+
...u
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
function d({ total: l, page: d, pageSize: f = 10, onChange: p, siblings: m = 1, boundaries: h = 1, variant: g = "numbered", className: _, ...v }) {
|
|
38
|
+
let y = e(), b = Math.max(1, Math.ceil(l / f)), x = Math.min(Math.max(1, d), b), S = o(() => u(b, x, m, h), [
|
|
39
|
+
b,
|
|
40
|
+
x,
|
|
41
|
+
m,
|
|
42
|
+
h
|
|
43
|
+
]);
|
|
44
|
+
return g === "simple" ? /* @__PURE__ */ c("nav", {
|
|
45
|
+
"aria-label": y.paginationLabel,
|
|
46
|
+
className: i("pagination", _),
|
|
47
|
+
...v,
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ s(a, {
|
|
50
|
+
variant: "outlined",
|
|
51
|
+
size: "sm",
|
|
52
|
+
iconOnly: !0,
|
|
53
|
+
"aria-label": y.previousPage,
|
|
54
|
+
disabled: x <= 1,
|
|
55
|
+
onClick: () => p(x - 1),
|
|
56
|
+
className: "nav",
|
|
57
|
+
children: /* @__PURE__ */ s(n, {})
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ c("span", {
|
|
60
|
+
className: "info",
|
|
61
|
+
"aria-live": "polite",
|
|
62
|
+
children: [
|
|
63
|
+
x,
|
|
64
|
+
" / ",
|
|
65
|
+
b
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ s(a, {
|
|
69
|
+
variant: "outlined",
|
|
70
|
+
size: "sm",
|
|
71
|
+
iconOnly: !0,
|
|
72
|
+
"aria-label": y.nextPage,
|
|
73
|
+
disabled: x >= b,
|
|
74
|
+
onClick: () => p(x + 1),
|
|
75
|
+
className: "nav",
|
|
76
|
+
children: /* @__PURE__ */ s(r, {})
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
}) : /* @__PURE__ */ c("nav", {
|
|
80
|
+
"aria-label": y.paginationLabel,
|
|
81
|
+
className: i("pagination", _),
|
|
82
|
+
...v,
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ s(a, {
|
|
85
|
+
variant: "outlined",
|
|
86
|
+
size: "sm",
|
|
87
|
+
iconOnly: !0,
|
|
88
|
+
"aria-label": y.previousPage,
|
|
89
|
+
disabled: x <= 1,
|
|
90
|
+
onClick: () => p(x - 1),
|
|
91
|
+
className: "nav",
|
|
92
|
+
children: /* @__PURE__ */ s(n, {})
|
|
93
|
+
}),
|
|
94
|
+
S.map((e, n) => e === "dots" ? /* @__PURE__ */ s("span", {
|
|
95
|
+
className: "dots",
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
children: "…"
|
|
98
|
+
}, `dots-${n}`) : /* @__PURE__ */ s("button", {
|
|
99
|
+
type: "button",
|
|
100
|
+
className: i("btn", e === x && "active"),
|
|
101
|
+
"aria-label": t(y.pageNumber, { page: e }),
|
|
102
|
+
"aria-current": e === x ? "page" : void 0,
|
|
103
|
+
onClick: () => p(e),
|
|
104
|
+
children: e
|
|
105
|
+
}, e)),
|
|
106
|
+
/* @__PURE__ */ s(a, {
|
|
107
|
+
variant: "outlined",
|
|
108
|
+
size: "sm",
|
|
109
|
+
iconOnly: !0,
|
|
110
|
+
"aria-label": y.nextPage,
|
|
111
|
+
disabled: x >= b,
|
|
112
|
+
onClick: () => p(x + 1),
|
|
113
|
+
className: "nav",
|
|
114
|
+
children: /* @__PURE__ */ s(r, {})
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { d as t };
|
|
121
|
+
|
|
122
|
+
//# sourceMappingURL=MPagination-BTGenxWW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MPagination-BTGenxWW.js","names":[],"sources":["../src/components/layout/MPagination/MPagination.tsx"],"sourcesContent":["import {useMemo} from 'react'\nimport {cn} from '../../../utils/cn'\nimport {MButton} from '../../controls'\nimport {MChevronLeftIcon, MChevronRightIcon} from '../../../icons'\nimport type {MPaginationProps} from './MPagination.types'\nimport {formatMText, useMLayoutTexts} from '../../../i18n/frameworkTexts'\nimport './MPagination.css'\n\nfunction range(start: number, end: number): number[] {\n const result: number[] = []\n for (let i = start; i <= end; i++) result.push(i)\n return result\n}\n\nfunction buildPages(totalPages: number, page: number, siblings: number, boundaries: number): (number | 'dots')[] {\n if (totalPages <= boundaries * 2 + siblings * 2 + 3) {\n return range(1, totalPages)\n }\n\n const leftBound = Math.max(page - siblings, boundaries + 2)\n const rightBound = Math.min(page + siblings, totalPages - boundaries - 1)\n\n const showLeftDots = leftBound > boundaries + 2\n const showRightDots = rightBound < totalPages - boundaries - 1\n\n const leftEdge = range(1, boundaries)\n const rightEdge = range(totalPages - boundaries + 1, totalPages)\n\n if (!showLeftDots && showRightDots) {\n const leftCount = siblings * 2 + boundaries + 2\n return [...range(1, leftCount), 'dots', ...rightEdge]\n }\n\n if (showLeftDots && !showRightDots) {\n const rightCount = siblings * 2 + boundaries + 2\n return [...leftEdge, 'dots', ...range(totalPages - rightCount + 1, totalPages)]\n }\n\n return [...leftEdge, 'dots', ...range(leftBound, rightBound), 'dots', ...rightEdge]\n}\n\nexport function MPagination({\n total,\n page,\n pageSize = 10,\n onChange,\n siblings = 1,\n boundaries = 1,\n variant = 'numbered',\n className,\n ...rest\n}: MPaginationProps) {\n const texts = useMLayoutTexts()\n const totalPages = Math.max(1, Math.ceil(total / pageSize))\n const currentPage = Math.min(Math.max(1, page), totalPages)\n\n const pages = useMemo(\n () => buildPages(totalPages, currentPage, siblings, boundaries),\n [totalPages, currentPage, siblings, boundaries]\n )\n\n if (variant === 'simple') {\n return (\n <nav aria-label={texts.paginationLabel} className={cn('pagination', className)} {...rest}>\n <MButton\n variant=\"outlined\"\n size=\"sm\"\n iconOnly\n aria-label={texts.previousPage}\n disabled={currentPage <= 1}\n onClick={() => onChange(currentPage - 1)}\n className=\"nav\"\n >\n <MChevronLeftIcon />\n </MButton>\n <span className=\"info\" aria-live=\"polite\">\n {currentPage} / {totalPages}\n </span>\n <MButton\n variant=\"outlined\"\n size=\"sm\"\n iconOnly\n aria-label={texts.nextPage}\n disabled={currentPage >= totalPages}\n onClick={() => onChange(currentPage + 1)}\n className=\"nav\"\n >\n <MChevronRightIcon />\n </MButton>\n </nav>\n )\n }\n\n return (\n <nav aria-label={texts.paginationLabel} className={cn('pagination', className)} {...rest}>\n <MButton\n variant=\"outlined\"\n size=\"sm\"\n iconOnly\n aria-label={texts.previousPage}\n disabled={currentPage <= 1}\n onClick={() => onChange(currentPage - 1)}\n className=\"nav\"\n >\n <MChevronLeftIcon />\n </MButton>\n {pages.map((p, i) =>\n p === 'dots' ? (\n <span key={`dots-${i}`} className=\"dots\" aria-hidden=\"true\">\n …\n </span>\n ) : (\n <button\n key={p}\n type=\"button\"\n className={cn('btn', p === currentPage && 'active')}\n aria-label={formatMText(texts.pageNumber, {page: p})}\n aria-current={p === currentPage ? 'page' : undefined}\n onClick={() => onChange(p)}\n >\n {p}\n </button>\n )\n )}\n <MButton\n variant=\"outlined\"\n size=\"sm\"\n iconOnly\n aria-label={texts.nextPage}\n disabled={currentPage >= totalPages}\n onClick={() => onChange(currentPage + 1)}\n className=\"nav\"\n >\n <MChevronRightIcon />\n </MButton>\n </nav>\n )\n}\n"],"mappings":";;;;;;;AAQA,SAAS,EAAM,GAAe,GAAuB;CACjD,IAAM,IAAmB,EAAE;AAC3B,MAAK,IAAI,IAAI,GAAO,KAAK,GAAK,IAAK,GAAO,KAAK,EAAE;AACjD,QAAO;;AAGX,SAAS,EAAW,GAAoB,GAAc,GAAkB,GAAyC;AAC7G,KAAI,KAAc,IAAa,IAAI,IAAW,IAAI,EAC9C,QAAO,EAAM,GAAG,EAAW;CAG/B,IAAM,IAAY,KAAK,IAAI,IAAO,GAAU,IAAa,EAAE,EACrD,IAAa,KAAK,IAAI,IAAO,GAAU,IAAa,IAAa,EAAE,EAEnE,IAAe,IAAY,IAAa,GACxC,IAAgB,IAAa,IAAa,IAAa,GAEvD,IAAW,EAAM,GAAG,EAAW,EAC/B,IAAY,EAAM,IAAa,IAAa,GAAG,EAAW;AAEhE,KAAI,CAAC,KAAgB,EAEjB,QAAO;EAAC,GAA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,EAAU;EAAE,GAAI;YAApF;GACI,kBAAC,GAAD;IACI,SAAQ;IACR,MAAK;IACL,UAAA;IACA,cAAY,EAAM;IAClB,UAAU,KAAe;IACzB,eAAe,EAAS,IAAc,EAAE;IACxC,WAAU;cAEV,kBAAC,GAAD,EAAoB,CAAA;IACd,CAAA;GACT,EAAM,KAAK,GAAG,MACX,MAAM,SACF,kBAAC,QAAD;IAAwB,WAAU;IAAO,eAAY;cAAO;IAErD,EAFI,QAAQ,IAEZ,GAEP,kBAAC,UAAD;IAEI,MAAK;IACL,WAAW,EAAG,OAAO,MAAM,KAAe,SAAS;IACnD,cAAY,EAAY,EAAM,YAAY,EAAC,MAAM,GAAE,CAAC;IACpD,gBAAc,MAAM,IAAc,SAAS,KAAA;IAC3C,eAAe,EAAS,EAAE;cAEzB;IACI,EARA,EAQA,CAEhB;GACD,kBAAC,GAAD;IACI,SAAQ;IACR,MAAK;IACL,UAAA;IACA,cAAY,EAAM;IAClB,UAAU,KAAe;IACzB,eAAe,EAAS,IAAc,EAAE;IACxC,WAAU;cAEV,kBAAC,GAAD,EAAqB,CAAA;IACf,CAAA;GACR"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./frameworkTexts-CaqdiKHW.cjs`),t=require(`./icons-Bp8bB9TP.cjs`),n=require(`./cn-DYFxgzi2.cjs`),r=require(`./MButton-BxEky3xQ.cjs`);require(`./core-w629c4ND.cjs`);let i=require(`react`),a=require(`react/jsx-runtime`);function o(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function s(e,t,n,r){if(e<=r*2+n*2+3)return o(1,e);let i=Math.max(t-n,r+2),a=Math.min(t+n,e-r-1),s=i>r+2,c=a<e-r-1,l=o(1,r),u=o(e-r+1,e);if(!s&&c)return[...o(1,n*2+r+2),`dots`,...u];if(s&&!c){let t=n*2+r+2;return[...l,`dots`,...o(e-t+1,e)]}return[...l,`dots`,...o(i,a),`dots`,...u]}function c({total:o,page:c,pageSize:l=10,onChange:u,siblings:d=1,boundaries:f=1,variant:p=`numbered`,className:m,...h}){let g=e.m(),_=Math.max(1,Math.ceil(o/l)),v=Math.min(Math.max(1,c),_),y=(0,i.useMemo)(()=>s(_,v,d,f),[_,v,d,f]);return p===`simple`?(0,a.jsxs)(`nav`,{"aria-label":g.paginationLabel,className:n.t(`pagination`,m),...h,children:[(0,a.jsx)(r.t,{variant:`outlined`,size:`sm`,iconOnly:!0,"aria-label":g.previousPage,disabled:v<=1,onClick:()=>u(v-1),className:`nav`,children:(0,a.jsx)(t.Ji,{})}),(0,a.jsxs)(`span`,{className:`info`,"aria-live":`polite`,children:[v,` / `,_]}),(0,a.jsx)(r.t,{variant:`outlined`,size:`sm`,iconOnly:!0,"aria-label":g.nextPage,disabled:v>=_,onClick:()=>u(v+1),className:`nav`,children:(0,a.jsx)(t.qi,{})})]}):(0,a.jsxs)(`nav`,{"aria-label":g.paginationLabel,className:n.t(`pagination`,m),...h,children:[(0,a.jsx)(r.t,{variant:`outlined`,size:`sm`,iconOnly:!0,"aria-label":g.previousPage,disabled:v<=1,onClick:()=>u(v-1),className:`nav`,children:(0,a.jsx)(t.Ji,{})}),y.map((t,r)=>t===`dots`?(0,a.jsx)(`span`,{className:`dots`,"aria-hidden":`true`,children:`…`},`dots-${r}`):(0,a.jsx)(`button`,{type:`button`,className:n.t(`btn`,t===v&&`active`),"aria-label":e.t(g.pageNumber,{page:t}),"aria-current":t===v?`page`:void 0,onClick:()=>u(t),children:t},t)),(0,a.jsx)(r.t,{variant:`outlined`,size:`sm`,iconOnly:!0,"aria-label":g.nextPage,disabled:v>=_,onClick:()=>u(v+1),className:`nav`,children:(0,a.jsx)(t.qi,{})})]})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
2
|
+
//# sourceMappingURL=MPagination-DitmdtCc.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MPagination-DitmdtCc.cjs","names":[],"sources":["../src/components/layout/MPagination/MPagination.tsx"],"sourcesContent":["import {useMemo} from 'react'\nimport {cn} from '../../../utils/cn'\nimport {MButton} from '../../controls'\nimport {MChevronLeftIcon, MChevronRightIcon} from '../../../icons'\nimport type {MPaginationProps} from './MPagination.types'\nimport {formatMText, useMLayoutTexts} from '../../../i18n/frameworkTexts'\nimport './MPagination.css'\n\nfunction range(start: number, end: number): number[] {\n const result: number[] = []\n for (let i = start; i <= end; i++) result.push(i)\n return result\n}\n\nfunction buildPages(totalPages: number, page: number, siblings: number, boundaries: number): (number | 'dots')[] {\n if (totalPages <= boundaries * 2 + siblings * 2 + 3) {\n return range(1, totalPages)\n }\n\n const leftBound = Math.max(page - siblings, boundaries + 2)\n const rightBound = Math.min(page + siblings, totalPages - boundaries - 1)\n\n const showLeftDots = leftBound > boundaries + 2\n const showRightDots = rightBound < totalPages - boundaries - 1\n\n const leftEdge = range(1, boundaries)\n const rightEdge = range(totalPages - boundaries + 1, totalPages)\n\n if (!showLeftDots && showRightDots) {\n const leftCount = siblings * 2 + boundaries + 2\n return [...range(1, leftCount), 'dots', ...rightEdge]\n }\n\n if (showLeftDots && !showRightDots) {\n const rightCount = siblings * 2 + boundaries + 2\n return [...leftEdge, 'dots', ...range(totalPages - rightCount + 1, totalPages)]\n }\n\n return [...leftEdge, 'dots', ...range(leftBound, rightBound), 'dots', ...rightEdge]\n}\n\nexport function MPagination({\n total,\n page,\n pageSize = 10,\n onChange,\n siblings = 1,\n boundaries = 1,\n variant = 'numbered',\n className,\n ...rest\n}: MPaginationProps) {\n const texts = useMLayoutTexts()\n const totalPages = Math.max(1, Math.ceil(total / pageSize))\n const currentPage = Math.min(Math.max(1, page), totalPages)\n\n const pages = useMemo(\n () => buildPages(totalPages, currentPage, siblings, boundaries),\n [totalPages, currentPage, siblings, boundaries]\n )\n\n if (variant === 'simple') {\n return (\n <nav aria-label={texts.paginationLabel} className={cn('pagination', className)} {...rest}>\n <MButton\n variant=\"outlined\"\n size=\"sm\"\n iconOnly\n aria-label={texts.previousPage}\n disabled={currentPage <= 1}\n onClick={() => onChange(currentPage - 1)}\n className=\"nav\"\n >\n <MChevronLeftIcon />\n </MButton>\n <span className=\"info\" aria-live=\"polite\">\n {currentPage} / {totalPages}\n </span>\n <MButton\n variant=\"outlined\"\n size=\"sm\"\n iconOnly\n aria-label={texts.nextPage}\n disabled={currentPage >= totalPages}\n onClick={() => onChange(currentPage + 1)}\n className=\"nav\"\n >\n <MChevronRightIcon />\n </MButton>\n </nav>\n )\n }\n\n return (\n <nav aria-label={texts.paginationLabel} className={cn('pagination', className)} {...rest}>\n <MButton\n variant=\"outlined\"\n size=\"sm\"\n iconOnly\n aria-label={texts.previousPage}\n disabled={currentPage <= 1}\n onClick={() => onChange(currentPage - 1)}\n className=\"nav\"\n >\n <MChevronLeftIcon />\n </MButton>\n {pages.map((p, i) =>\n p === 'dots' ? (\n <span key={`dots-${i}`} className=\"dots\" aria-hidden=\"true\">\n …\n </span>\n ) : (\n <button\n key={p}\n type=\"button\"\n className={cn('btn', p === currentPage && 'active')}\n aria-label={formatMText(texts.pageNumber, {page: p})}\n aria-current={p === currentPage ? 'page' : undefined}\n onClick={() => onChange(p)}\n >\n {p}\n </button>\n )\n )}\n <MButton\n variant=\"outlined\"\n size=\"sm\"\n iconOnly\n aria-label={texts.nextPage}\n disabled={currentPage >= totalPages}\n onClick={() => onChange(currentPage + 1)}\n className=\"nav\"\n >\n <MChevronRightIcon />\n </MButton>\n </nav>\n )\n}\n"],"mappings":"2OAQA,SAAS,EAAM,EAAe,EAAuB,CACjD,IAAM,EAAmB,EAAE,CAC3B,IAAK,IAAI,EAAI,EAAO,GAAK,EAAK,IAAK,EAAO,KAAK,EAAE,CACjD,OAAO,EAGX,SAAS,EAAW,EAAoB,EAAc,EAAkB,EAAyC,CAC7G,GAAI,GAAc,EAAa,EAAI,EAAW,EAAI,EAC9C,OAAO,EAAM,EAAG,EAAW,CAG/B,IAAM,EAAY,KAAK,IAAI,EAAO,EAAU,EAAa,EAAE,CACrD,EAAa,KA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|
+
import { a as t, c as n, i as r, n as i, o as a, s as o, t as s } from "./useModalLayer-CpOPSDbf.js";
|
|
3
|
+
import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
4
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/primitives/MPopover/MPopover.tsx
|
|
6
|
+
function p(e) {
|
|
7
|
+
if (!e || !e.isConnected) return !1;
|
|
8
|
+
let t = e.tabIndex >= 0 && !e.hasAttribute("disabled") ? e : i(e)[0] ?? s(e)[0] ?? null;
|
|
9
|
+
return t ? (t.focus({ preventScroll: !0 }), t.ownerDocument.activeElement === t) : !1;
|
|
10
|
+
}
|
|
11
|
+
function m() {
|
|
12
|
+
let e = document.activeElement;
|
|
13
|
+
return !e || e === document.body || !e.isConnected;
|
|
14
|
+
}
|
|
15
|
+
function h({ open: s, anchorRef: h, onClose: g, placement: _ = "bottom-start", matchWidth: v = !1, offset: y = 4, zIndex: b, children: x, className: S, style: C, role: w = "listbox", "aria-label": T, "aria-labelledby": E, "aria-describedby": D, id: O, initialFocus: k, restoreFocus: A = !0, closeOnTabOut: j = !1 }) {
|
|
16
|
+
let M = u(null), N = u(!1), P = u(!1), F = u(!1), I = u(!1), L = u(A);
|
|
17
|
+
l(() => {
|
|
18
|
+
L.current = A;
|
|
19
|
+
}, [A]);
|
|
20
|
+
let R = u(null);
|
|
21
|
+
R.current === null && (R.current = a());
|
|
22
|
+
let z = R.current, [B, V] = d(null), [H, U] = d(!1), [W, G] = d(null), K = c(() => {
|
|
23
|
+
if (b !== void 0) {
|
|
24
|
+
G(b);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let e = h.current;
|
|
28
|
+
if (!e || typeof window > "u") {
|
|
29
|
+
G(null);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
let t = e.closest(".drawer-backdrop, .modal-backdrop, .sheet-backdrop, .sidebar.mobile-open, .popover");
|
|
33
|
+
if (!t) {
|
|
34
|
+
G(null);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
let n = window.getComputedStyle(t).zIndex, r = Number.parseInt(n, 10);
|
|
38
|
+
G(Number.isFinite(r) ? r + 1 : null);
|
|
39
|
+
}, [h, b]), q = c(() => {
|
|
40
|
+
if (!h.current || !M.current) return;
|
|
41
|
+
let e = h.current.getBoundingClientRect(), t = M.current, n = {
|
|
42
|
+
width: t.offsetWidth,
|
|
43
|
+
height: Math.max(t.offsetHeight, t.scrollHeight + t.offsetHeight - t.clientHeight)
|
|
44
|
+
}, r = {
|
|
45
|
+
width: window.innerWidth,
|
|
46
|
+
height: window.innerHeight
|
|
47
|
+
}, i = _.startsWith("top"), a = _.startsWith("right"), o = _.startsWith("left"), s = a || o, c = _.endsWith("end"), l, u, d;
|
|
48
|
+
if (s) {
|
|
49
|
+
let t = r.width - e.right - y, i = e.left - y, o = a ? t < n.width && i > t : i < n.width && t > i;
|
|
50
|
+
U(o), u = (a ? !o : o) ? e.right + y + window.scrollX : e.left - n.width - y + window.scrollX, l = c ? e.bottom - n.height + window.scrollY : e.top + window.scrollY, l = Math.min(l, window.scrollY + r.height - n.height - 8), n.height > r.height - 16 && (d = Math.max(r.height - 16, 0), l = window.scrollY + 8);
|
|
51
|
+
} else {
|
|
52
|
+
let t = r.height - e.bottom - y, a = e.top - y, o = i ? a < n.height && t > a : t < n.height && a > t;
|
|
53
|
+
U(o);
|
|
54
|
+
let s = i ? !o : o, f = s ? a : t, p = n.height;
|
|
55
|
+
n.height > f && (d = Math.max(f - 8, 0), p = d), l = s ? e.top - p - y + window.scrollY : e.bottom + y + window.scrollY, u = c ? e.right - n.width + window.scrollX : e.left + window.scrollX;
|
|
56
|
+
}
|
|
57
|
+
u = Math.max(8, Math.min(u, r.width - n.width - 8)), l = Math.max(8 + window.scrollY, l), V({
|
|
58
|
+
top: l,
|
|
59
|
+
left: u,
|
|
60
|
+
width: v ? e.width : void 0,
|
|
61
|
+
maxHeight: d
|
|
62
|
+
});
|
|
63
|
+
}, [
|
|
64
|
+
h,
|
|
65
|
+
_,
|
|
66
|
+
y,
|
|
67
|
+
v
|
|
68
|
+
]);
|
|
69
|
+
l(() => {
|
|
70
|
+
if (!s) {
|
|
71
|
+
V(null), G(null);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
K(), requestAnimationFrame(q);
|
|
75
|
+
let e = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => q());
|
|
76
|
+
return e && M.current && e.observe(M.current), document.addEventListener("scroll", q, {
|
|
77
|
+
capture: !0,
|
|
78
|
+
passive: !0
|
|
79
|
+
}), window.addEventListener("resize", q, { passive: !0 }), () => {
|
|
80
|
+
e?.disconnect(), document.removeEventListener("scroll", q, { capture: !0 }), window.removeEventListener("resize", q);
|
|
81
|
+
};
|
|
82
|
+
}, [
|
|
83
|
+
s,
|
|
84
|
+
K,
|
|
85
|
+
q
|
|
86
|
+
]), l(() => {
|
|
87
|
+
if (!s) return;
|
|
88
|
+
let e = (e) => {
|
|
89
|
+
e.key !== "Escape" || e.defaultPrevented || t(z) && (e.preventDefault(), g());
|
|
90
|
+
};
|
|
91
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
92
|
+
}, [
|
|
93
|
+
s,
|
|
94
|
+
g,
|
|
95
|
+
z
|
|
96
|
+
]), l(() => {
|
|
97
|
+
if (!s || !B || !k || I.current) return;
|
|
98
|
+
I.current = !0;
|
|
99
|
+
let e = M.current;
|
|
100
|
+
if (!e) return;
|
|
101
|
+
let t = null;
|
|
102
|
+
k === "first" ? t = i(e)[0] ?? null : k !== "container" && (t = k.current), t ||= (e.hasAttribute("tabindex") || e.setAttribute("tabindex", "-1"), e), t.focus({ preventScroll: !0 });
|
|
103
|
+
}, [
|
|
104
|
+
s,
|
|
105
|
+
B,
|
|
106
|
+
k
|
|
107
|
+
]), l(() => {
|
|
108
|
+
if (s) {
|
|
109
|
+
F.current = !0, P.current = !1, I.current = !1;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!F.current) return;
|
|
113
|
+
F.current = !1;
|
|
114
|
+
let e = N.current;
|
|
115
|
+
N.current = !1, !(!L.current || !e || P.current || !m()) && p(h.current);
|
|
116
|
+
}, [s, h]), l(() => () => {
|
|
117
|
+
!F.current || !N.current || !L.current || P.current || !m() || p(h.current);
|
|
118
|
+
}, [h]), l(() => {
|
|
119
|
+
if (s) return o({
|
|
120
|
+
id: z,
|
|
121
|
+
getPopoverEl: () => M.current,
|
|
122
|
+
getAnchorEl: () => h.current
|
|
123
|
+
});
|
|
124
|
+
}, [
|
|
125
|
+
s,
|
|
126
|
+
z,
|
|
127
|
+
h
|
|
128
|
+
]), l(() => {
|
|
129
|
+
if (!s) return;
|
|
130
|
+
let e = (e) => {
|
|
131
|
+
let t = e.target;
|
|
132
|
+
M.current?.contains(t) || h.current?.contains(t) || r(z, t) || (P.current = !0, g());
|
|
133
|
+
};
|
|
134
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
135
|
+
}, [
|
|
136
|
+
s,
|
|
137
|
+
g,
|
|
138
|
+
h,
|
|
139
|
+
z
|
|
140
|
+
]);
|
|
141
|
+
let J = (e) => {
|
|
142
|
+
M.current?.contains(e.target) && (N.current = !0);
|
|
143
|
+
}, Y = (e) => {
|
|
144
|
+
let t = e.relatedTarget;
|
|
145
|
+
t && !M.current?.contains(t) && (N.current = !1);
|
|
146
|
+
}, X = (e) => {
|
|
147
|
+
if (!j || e.key !== "Tab" || e.defaultPrevented) return;
|
|
148
|
+
let t = M.current;
|
|
149
|
+
if (!t || !t.contains(e.target)) return;
|
|
150
|
+
let n = i(t), r = document.activeElement;
|
|
151
|
+
(n.length === 0 || (e.shiftKey ? r === n[0] || r === t : r === n[n.length - 1])) && (N.current = !1, p(h.current) && e.shiftKey && e.preventDefault(), g());
|
|
152
|
+
};
|
|
153
|
+
return s ? /* @__PURE__ */ f(n, { children: /* @__PURE__ */ f("div", {
|
|
154
|
+
ref: M,
|
|
155
|
+
className: e("popover", H ? "flipped" : "normal", S),
|
|
156
|
+
style: {
|
|
157
|
+
position: "absolute",
|
|
158
|
+
top: B?.top ?? 0,
|
|
159
|
+
left: B?.left ?? 0,
|
|
160
|
+
width: B?.width,
|
|
161
|
+
...B?.maxHeight === void 0 ? null : {
|
|
162
|
+
maxHeight: B.maxHeight,
|
|
163
|
+
overflowY: "auto"
|
|
164
|
+
},
|
|
165
|
+
zIndex: W ?? void 0,
|
|
166
|
+
visibility: B ? "visible" : "hidden",
|
|
167
|
+
...C
|
|
168
|
+
},
|
|
169
|
+
id: O,
|
|
170
|
+
role: w ?? void 0,
|
|
171
|
+
onFocus: J,
|
|
172
|
+
onBlur: Y,
|
|
173
|
+
onKeyDown: X,
|
|
174
|
+
"aria-label": T,
|
|
175
|
+
"aria-labelledby": E,
|
|
176
|
+
"aria-describedby": D,
|
|
177
|
+
children: x
|
|
178
|
+
}) }) : null;
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
export { h as t };
|
|
182
|
+
|
|
183
|
+
//# sourceMappingURL=MPopover-CBDbUOW6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MPopover-CBDbUOW6.js","names":[],"sources":["../src/components/primitives/MPopover/MPopover.tsx"],"sourcesContent":["import {useState, useEffect, useRef, useCallback} from 'react'\nimport type {FocusEvent as ReactFocusEvent, KeyboardEvent as ReactKeyboardEvent} from 'react'\nimport {MPortal} from '../MPortal'\nimport {cn} from '../../../utils/cn'\nimport {getFocusable, getTabbable} from '../../../utils/useModalLayer'\nimport {isInsideDescendantPopover, isTopPopover, nextPopoverId, registerPopover} from './popoverStack'\nimport type {MPopoverProps} from './MPopover.types'\nimport './MPopover.css'\n\n// Focus the anchor itself when it is focusable, otherwise the first focusable element inside it.\nfunction focusAnchor(anchor: HTMLElement | null): boolean {\n if (!anchor || !anchor.isConnected) return false\n const target =\n anchor.tabIndex >= 0 && !anchor.hasAttribute('disabled')\n ? anchor\n : (getTabbable(anchor)[0] ?? getFocusable(anchor)[0] ?? null)\n if (!target) return false\n target.focus({preventScroll: true})\n return target.ownerDocument.activeElement === target\n}\n\nfunction focusIsLost(): boolean {\n const active = document.activeElement\n return !active || active === document.body || !active.isConnected\n}\n\n// Position floating content relative to an anchor with viewport-aware flipping.\nexport function MPopover({\n open,\n anchorRef,\n onClose,\n placement = 'bottom-start',\n matchWidth = false,\n offset = 4,\n zIndex,\n children,\n className,\n style,\n role = 'listbox',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n id,\n initialFocus,\n restoreFocus = true,\n closeOnTabOut = false,\n}: MPopoverProps) {\n const popoverRef = useRef<HTMLDivElement>(null)\n // Focus bookkeeping for returning focus to the anchor (APG: focus goes back to the invoker).\n const focusInsideRef = useRef(false)\n const pointerCloseRef = useRef(false)\n const wasOpenRef = useRef(false)\n const initialFocusDoneRef = useRef(false)\n const restoreFocusRef = useRef(restoreFocus)\n useEffect(() => {\n restoreFocusRef.current = restoreFocus\n }, [restoreFocus])\n const popoverIdRef = useRef<number>(null)\n if (popoverIdRef.current === null) popoverIdRef.current = nextPopoverId()\n const popoverId = popoverIdRef.current\n const [position, setPosition] = useState<{\n top: number\n left: number\n width?: number\n maxHeight?: number\n } | null>(null)\n const [flipped, setFlipped] = useState(false)\n const [layerZ, setLayerZ] = useState<number | string | null>(null)\n\n // Lift popovers above drawers, modals and mobile sidebars when the anchor sits inside them.\n const updateLayer = useCallback(() => {\n if (zIndex !== undefined) {\n setLayerZ(zIndex)\n return\n }\n\n const anchor = anchorRef.current\n if (!anchor || typeof window === 'undefined') {\n setLayerZ(null)\n return\n }\n\n const layerHost = anchor.closest(\n '.drawer-backdrop, .modal-backdrop, .sheet-backdrop, .sidebar.mobile-open, .popover'\n )\n if (!layerHost) {\n setLayerZ(null)\n return\n }\n\n const computedZ = window.getComputedStyle(layerHost).zIndex\n const parsedZ = Number.parseInt(computedZ, 10)\n setLayerZ(Number.isFinite(parsedZ) ? parsedZ + 1 : null)\n }, [anchorRef, zIndex])\n\n // Recalculate popover position whenever layout or viewport constraints change.\n const updatePosition = useCallback(() => {\n if (!anchorRef.current || !popoverRef.current) return\n\n const anchor = anchorRef.current.getBoundingClientRect()\n // Layout size, not getBoundingClientRect: the open animation scales the popover, and\n // measuring mid-animation under-reports its height by ~5 % (enough to overflow the\n // viewport after a flip / shift).\n // scrollHeight (plus borders) keeps the NATURAL height measurable once a max-height\n // below caps the box, so re-measuring never oscillates between capped and uncapped.\n const element = popoverRef.current\n const popover = {\n width: element.offsetWidth,\n height: Math.max(element.offsetHeight, element.scrollHeight + element.offsetHeight - element.clientHeight),\n }\n const viewport = {\n width: window.innerWidth,\n height: window.innerHeight,\n }\n\n const isTop = placement.startsWith('top')\n const isRight = placement.startsWith('right')\n const isLeft = placement.startsWith('left')\n const isHorizontal = isRight || isLeft\n const isEnd = placement.endsWith('end')\n\n let top: number\n let left: number\n let maxHeight: number | undefined\n\n if (isHorizontal) {\n // Horizontal placement: position to the right or left of the anchor\n const spaceRight = viewport.width - anchor.right - offset\n const spaceLeft = anchor.left - offset\n const shouldFlip = isRight\n ? spaceRight < popover.width && spaceLeft > spaceRight\n : spaceLeft < popover.width && spaceRight > spaceLeft\n\n setFlipped(shouldFlip)\n\n const showOnRight = isRight ? !shouldFlip : shouldFlip\n\n if (showOnRight) {\n left = anchor.right + offset + window.scrollX\n } else {\n left = anchor.left - popover.width - offset + window.scrollX\n }\n\n if (isEnd) {\n top = anchor.bottom - popover.height + window.scrollY\n } else {\n top = anchor.top + window.scrollY\n }\n\n // Shift along the anchor edge so a side popover near the bottom of the viewport\n // slides up instead of running off-screen (the top clamp below wins when it is\n // taller than the viewport).\n top = Math.min(top, window.scrollY + viewport.height - popover.height - 8)\n\n // Taller than the viewport: cap it and let it scroll instead of running off-screen.\n if (popover.height > viewport.height - 16) {\n maxHeight = Math.max(viewport.height - 16, 0)\n top = window.scrollY + 8\n }\n } else {\n // Vertical placement: position above or below the anchor\n const spaceBelow = viewport.height - anchor.bottom - offset\n const spaceAbove = anchor.top - offset\n const shouldFlip = isTop\n ? spaceAbove < popover.height && spaceBelow > spaceAbove\n : spaceBelow < popover.height && spaceAbove > spaceBelow\n\n setFlipped(shouldFlip)\n\n const showOnTop = isTop ? !shouldFlip : shouldFlip\n\n // Fits on neither side: the flip above already picked the side with more room,\n // so cap the height to that side and scroll, instead of clamping `top` and\n // covering the anchor (the field the user is typing into).\n const room = showOnTop ? spaceAbove : spaceBelow\n let height = popover.height\n if (popover.height > room) {\n maxHeight = Math.max(room - 8, 0)\n height = maxHeight\n }\n\n if (showOnTop) {\n top = anchor.top - height - offset + window.scrollY\n } else {\n top = anchor.bottom + offset + window.scrollY\n }\n\n if (isEnd) {\n left = anchor.right - popover.width + window.scrollX\n } else {\n left = anchor.left + window.scrollX\n }\n }\n\n // Clamp to viewport\n left = Math.max(8, Math.min(left, viewport.width - popover.width - 8))\n top = Math.max(8 + window.scrollY, top)\n\n setPosition({\n top,\n left,\n width: matchWidth ? anchor.width : undefined,\n maxHeight,\n })\n }, [anchorRef, placement, offset, matchWidth])\n\n useEffect(() => {\n if (!open) {\n setPosition(null)\n setLayerZ(null)\n return\n }\n\n updateLayer()\n // Wait one frame so the rendered popover can be measured accurately.\n requestAnimationFrame(updatePosition)\n\n // Content that grows after opening (images, expanded lists) must re-run the\n // flip / shift, or the popover drifts past the viewport edge.\n const resizeObserver = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => updatePosition())\n if (resizeObserver && popoverRef.current) {\n resizeObserver.observe(popoverRef.current)\n }\n\n // `scroll` does not bubble, so a window listener only ever sees the\n // document scrolling. Anchors living inside a scrollable ancestor — an\n // app shell with a scrolling main region, MStickyPanel, an overflowing\n // card — would leave the popover stranded at its opening coordinates\n // while the anchor moved away underneath it. Scroll events do capture,\n // so a capture-phase listener on the document catches scrolling from\n // ANY container, including the document itself.\n document.addEventListener('scroll', updatePosition, {capture: true, passive: true})\n window.addEventListener('resize', updatePosition, {passive: true})\n return () => {\n resizeObserver?.disconnect()\n document.removeEventListener('scroll', updatePosition, {capture: true})\n window.removeEventListener('resize', updatePosition)\n }\n }, [open, updateLayer, updatePosition])\n\n // Escape closes only the top layer: a nested popover (or a widget inside that already\n // consumed the key with preventDefault) closes first, its parent on the next press.\n useEffect(() => {\n if (!open) return\n const handleKey = (e: KeyboardEvent) => {\n if (e.key !== 'Escape' || e.defaultPrevented) return\n if (!isTopPopover(popoverId)) return\n e.preventDefault()\n onClose()\n }\n document.addEventListener('keydown', handleKey)\n return () => document.removeEventListener('keydown', handleKey)\n }, [open, onClose, popoverId])\n\n // Move focus into the layer once it is positioned (a `visibility: hidden` box cannot take focus).\n useEffect(() => {\n if (!open || !position || !initialFocus || initialFocusDoneRef.current) return\n initialFocusDoneRef.current = true\n const container = popoverRef.current\n if (!container) return\n\n let target: HTMLElement | null = null\n if (initialFocus === 'first') target = getTabbable(container)[0] ?? null\n else if (initialFocus !== 'container') target = initialFocus.current\n if (!target) {\n if (!container.hasAttribute('tabindex')) container.setAttribute('tabindex', '-1')\n target = container\n }\n target.focus({preventScroll: true})\n }, [open, position, initialFocus])\n\n // Return focus to the anchor when the layer closes while it held focus, unless the\n // user dismissed it by pressing somewhere else (that click owns focus now).\n useEffect(() => {\n if (open) {\n wasOpenRef.current = true\n pointerCloseRef.current = false\n initialFocusDoneRef.current = false\n return\n }\n if (!wasOpenRef.current) return\n wasOpenRef.current = false\n const hadFocus = focusInsideRef.current\n focusInsideRef.current = false\n if (!restoreFocusRef.current || !hadFocus || pointerCloseRef.current || !focusIsLost()) return\n focusAnchor(anchorRef.current)\n }, [open, anchorRef])\n\n // Same when the whole component unmounts while open.\n useEffect(\n () => () => {\n if (!wasOpenRef.current || !focusInsideRef.current || !restoreFocusRef.current) return\n if (pointerCloseRef.current || !focusIsLost()) return\n focusAnchor(anchorRef.current)\n },\n [anchorRef]\n )\n\n // Publish this instance while it is open so nested popovers can be related\n // back to it — see popoverStack.ts for why the DOM alone cannot answer this.\n useEffect(() => {\n if (!open) return\n return registerPopover({\n id: popoverId,\n getPopoverEl: () => popoverRef.current,\n getAnchorEl: () => anchorRef.current,\n })\n }, [open, popoverId, anchorRef])\n\n // Close when the user interacts outside both the popover and its anchor.\n useEffect(() => {\n if (!open) return\n const handleClick = (e: MouseEvent) => {\n const target = e.target as Node\n\n if (popoverRef.current?.contains(target) || anchorRef.current?.contains(target)) {\n return\n }\n\n // A popover nested inside this one is portaled to `document.body`,\n // so it fails the `contains` checks above even though the click\n // belongs to this popover's own subtree. Closing here would unmount\n // that child between mousedown and mouseup and swallow its click.\n if (isInsideDescendantPopover(popoverId, target)) {\n return\n }\n\n pointerCloseRef.current = true\n onClose()\n }\n document.addEventListener('mousedown', handleClick)\n return () => document.removeEventListener('mousedown', handleClick)\n }, [open, onClose, anchorRef, popoverId])\n\n const handleFocus = (e: ReactFocusEvent<HTMLDivElement>) => {\n if (popoverRef.current?.contains(e.target as Node)) focusInsideRef.current = true\n }\n\n const handleBlur = (e: ReactFocusEvent<HTMLDivElement>) => {\n const next = e.relatedTarget as Node | null\n if (next && !popoverRef.current?.contains(next)) focusInsideRef.current = false\n }\n\n // Optional Tab-out: leaving the layer with Tab closes it and continues from the anchor.\n const handleKeyDown = (e: ReactKeyboardEvent<HTMLDivElement>) => {\n if (!closeOnTabOut || e.key !== 'Tab' || e.defaultPrevented) return\n const container = popoverRef.current\n if (!container || !container.contains(e.target as Node)) return\n\n const focusable = getTabbable(container)\n const active = document.activeElement\n const leaving =\n focusable.length === 0 ||\n (e.shiftKey ? active === focusable[0] || active === container : active === focusable[focusable.length - 1])\n if (!leaving) return\n\n focusInsideRef.current = false\n // Forward Tab: focus the anchor and let the browser move on from there.\n // Shift+Tab: land on the anchor itself.\n if (focusAnchor(anchorRef.current) && e.shiftKey) e.preventDefault()\n onClose()\n }\n\n if (!open) return null\n\n return (\n <MPortal>\n <div\n ref={popoverRef}\n className={cn('popover', flipped ? 'flipped' : 'normal', className)}\n style={{\n position: 'absolute',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n width: position?.width,\n ...(position?.maxHeight !== undefined\n ? {maxHeight: position.maxHeight, overflowY: 'auto' as const}\n : null),\n zIndex: layerZ ?? undefined,\n visibility: position ? 'visible' : 'hidden',\n ...style,\n }}\n id={id}\n role={role ?? undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n >\n {children}\n </div>\n </MPortal>\n )\n}\n"],"mappings":";;;;;AAUA,SAAS,EAAY,GAAqC;AACtD,KAAI,CAAC,KAAU,CAAC,EAAO,YAAa,QAAO;CAC3C,IAAM,IACF,EAAO,YAAY,KAAK,CAAC,EAAO,aAAa,WAAW,GAClD,IACC,EAAY,EAAO,CAAC,MAAM,EAAa,EAAO,CAAC,MAAM;AAGhE,QAFK,KACL,EAAO,MAAM,EAAC,eAAe,IAAK,CAAC,EAC5B,EAAO,cAAc,kBAAkB,KAF1B;;AAKxB,SAAS,IAAuB;CAC5B,IAAM,IAAS,SAAS;AACxB,QAAO,CAAC,KAAU,MAAW,SAAS,QAAQ,CAAC,EAAO;;AAI1D,SAAgB,EAAS,EACrB,SACA,cACA,YACA,eAAY,gBACZ,gBAAa,IACb,YAAS,GACT,WACA,aACA,cACA,UACA,UAAO,WACP,cAAc,GACd,mBAAmB,GACnB,oBAAoB,GACpB,OACA,iBACA,kBAAe,IACf,mBAAgB,MACF;CACd,IAAM,IAAa,EAAuB,KAAK,EAEzC,IAAiB,EAAO,GAAM,EAC9B,IAAkB,EAAO,GAAM,EAC/B,IAAa,EAAO,GAAM,EAC1B,IAAsB,EAAO,GAAM,EACnC,IAAkB,EAAO,EAAa;AAC5C,SAAgB;AACZ,IAAgB,UAAU;IAC3B,CAAC,EAAa,CAAC;CAClB,IAAM,IAAe,EAAe,KAAK;AACzC,CAAI,EAAa,YAAY,SAAM,EAAa,UAAU,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EAAE,WAAW,MAAW,EAAU,MAAM,MAAW,IAAY,MAAW,EAAU,EAAU,SAAS,SAG5G,EAAe,UAAU,IAGrB,EAAY,EAAU,QAAQ,IAAI,EAAE,YAAU,EAAE,gBAAgB,EACpE,GAAS;;AAKb,QAFK,IAGD,kBAAC,GAAD,EAAA,UACI,kBAAC,OAAD;EACI,KAAK;EACL,WAAW,EAAG,WAAW,IAAU,YAAY,UAAU,EAAU;EACnE,OAAO;GACH,UAAU;GACV,KAAK,GAAU,OAAO;GACtB,MAAM,GAAU,QAAQ;GACxB,OAAO,GAAU;GACjB,GAAI,GAAU,cAAc,KAAA,IAEtB,OADA;IAAC,WAAW,EAAS;IAAW,WAAW;IAAgB;GAEjE,QAAQ,KAAU,KAAA;GAClB,YAAY,IAAW,YAAY;GACnC,GAAG;GACN;EACG;EACJ,MAAM,KAAQ,KAAA;EACd,SAAS;EACT,QAAQ;EACR,WAAW;EACX,cAAY;EACZ,mBAAiB;EACjB,oBAAkB;EAEjB;EACC,CAAA,EACA,CAAA,GA9BI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./cn-DYFxgzi2.cjs`),t=require(`./useModalLayer-Cyt93Prs.cjs`);require(`./core-w629c4ND.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`);function i(e){if(!e||!e.isConnected)return!1;let n=e.tabIndex>=0&&!e.hasAttribute(`disabled`)?e:t.n(e)[0]??t.t(e)[0]??null;return n?(n.focus({preventScroll:!0}),n.ownerDocument.activeElement===n):!1}function a(){let e=document.activeElement;return!e||e===document.body||!e.isConnected}function o({open:o,anchorRef:s,onClose:c,placement:l=`bottom-start`,matchWidth:u=!1,offset:d=4,zIndex:f,children:p,className:m,style:h,role:g=`listbox`,"aria-label":_,"aria-labelledby":v,"aria-describedby":y,id:b,initialFocus:x,restoreFocus:S=!0,closeOnTabOut:C=!1}){let w=(0,n.useRef)(null),T=(0,n.useRef)(!1),E=(0,n.useRef)(!1),D=(0,n.useRef)(!1),O=(0,n.useRef)(!1),k=(0,n.useRef)(S);(0,n.useEffect)(()=>{k.current=S},[S]);let A=(0,n.useRef)(null);A.current===null&&(A.current=t.o());let j=A.current,[M,N]=(0,n.useState)(null),[P,F]=(0,n.useState)(!1),[I,L]=(0,n.useState)(null),R=(0,n.useCallback)(()=>{if(f!==void 0){L(f);return}let e=s.current;if(!e||typeof window>`u`){L(null);return}let t=e.closest(`.drawer-backdrop, .modal-backdrop, .sheet-backdrop, .sidebar.mobile-open, .popover`);if(!t){L(null);return}let n=window.getComputedStyle(t).zIndex,r=Number.parseInt(n,10);L(Number.isFinite(r)?r+1:null)},[s,f]),z=(0,n.useCallback)(()=>{if(!s.current||!w.current)return;let e=s.current.getBoundingClientRect(),t=w.current,n={width:t.offsetWidth,height:Math.max(t.offsetHeight,t.scrollHeight+t.offsetHeight-t.clientHeight)},r={width:window.innerWidth,height:window.innerHeight},i=l.startsWith(`top`),a=l.startsWith(`right`),o=l.startsWith(`left`),c=a||o,f=l.endsWith(`end`),p,m,h;if(c){let t=r.width-e.right-d,i=e.left-d,o=a?t<n.width&&i>t:i<n.width&&t>i;F(o),m=(a?!o:o)?e.right+d+window.scrollX:e.left-n.width-d+window.scrollX,p=f?e.bottom-n.height+window.scrollY:e.top+window.scrollY,p=Math.min(p,window.scrollY+r.height-n.height-8),n.height>r.height-16&&(h=Math.max(r.height-16,0),p=window.scrollY+8)}else{let t=r.height-e.bottom-d,a=e.top-d,o=i?a<n.height&&t>a:t<n.height&&a>t;F(o);let s=i?!o:o,c=s?a:t,l=n.height;n.height>c&&(h=Math.max(c-8,0),l=h),p=s?e.top-l-d+window.scrollY:e.bottom+d+window.scrollY,m=f?e.right-n.width+window.scrollX:e.left+window.scrollX}m=Math.max(8,Math.min(m,r.width-n.width-8)),p=Math.max(8+window.scrollY,p),N({top:p,left:m,width:u?e.width:void 0,maxHeight:h})},[s,l,d,u]);(0,n.useEffect)(()=>{if(!o){N(null),L(null);return}R(),requestAnimationFrame(z);let e=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>z());return e&&w.current&&e.observe(w.current),document.addEventListener(`scroll`,z,{capture:!0,passive:!0}),window.addEventListener(`resize`,z,{passive:!0}),()=>{e?.disconnect(),document.removeEventListener(`scroll`,z,{capture:!0}),window.removeEventListener(`resize`,z)}},[o,R,z]),(0,n.useEffect)(()=>{if(!o)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||t.a(j)&&(e.preventDefault(),c())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[o,c,j]),(0,n.useEffect)(()=>{if(!o||!M||!x||O.current)return;O.current=!0;let e=w.current;if(!e)return;let n=null;x===`first`?n=t.n(e)[0]??null:x!==`container`&&(n=x.current),n||=(e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`-1`),e),n.focus({preventScroll:!0})},[o,M,x]),(0,n.useEffect)(()=>{if(o){D.current=!0,E.current=!1,O.current=!1;return}if(!D.current)return;D.current=!1;let e=T.current;T.current=!1,!(!k.current||!e||E.current||!a())&&i(s.current)},[o,s]),(0,n.useEffect)(()=>()=>{!D.current||!T.current||!k.current||E.current||!a()||i(s.current)},[s]),(0,n.useEffect)(()=>{if(o)return t.s({id:j,getPopoverEl:()=>w.current,getAnchorEl:()=>s.current})},[o,j,s]),(0,n.useEffect)(()=>{if(!o)return;let e=e=>{let n=e.target;w.current?.contains(n)||s.current?.contains(n)||t.i(j,n)||(E.current=!0,c())};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o,c,s,j]);let B=e=>{w.current?.contains(e.target)&&(T.current=!0)},V=e=>{let t=e.relatedTarget;t&&!w.current?.contains(t)&&(T.current=!1)},H=e=>{if(!C||e.key!==`Tab`||e.defaultPrevented)return;let n=w.current;if(!n||!n.contains(e.target))return;let r=t.n(n),a=document.activeElement;(r.length===0||(e.shiftKey?a===r[0]||a===n:a===r[r.length-1]))&&(T.current=!1,i(s.current)&&e.shiftKey&&e.preventDefault(),c())};return o?(0,r.jsx)(t.c,{children:(0,r.jsx)(`div`,{ref:w,className:e.t(`popover`,P?`flipped`:`normal`,m),style:{position:`absolute`,top:M?.top??0,left:M?.left??0,width:M?.width,...M?.maxHeight===void 0?null:{maxHeight:M.maxHeight,overflowY:`auto`},zIndex:I??void 0,visibility:M?`visible`:`hidden`,...h},id:b,role:g??void 0,onFocus:B,onBlur:V,onKeyDown:H,"aria-label":_,"aria-labelledby":v,"aria-describedby":y,children:p})}):null}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
2
|
+
//# sourceMappingURL=MPopover-ZeoU9hb5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MPopover-ZeoU9hb5.cjs","names":[],"sources":["../src/components/primitives/MPopover/MPopover.tsx"],"sourcesContent":["import {useState, useEffect, useRef, useCallback} from 'react'\nimport type {FocusEvent as ReactFocusEvent, KeyboardEvent as ReactKeyboardEvent} from 'react'\nimport {MPortal} from '../MPortal'\nimport {cn} from '../../../utils/cn'\nimport {getFocusable, getTabbable} from '../../../utils/useModalLayer'\nimport {isInsideDescendantPopover, isTopPopover, nextPopoverId, registerPopover} from './popoverStack'\nimport type {MPopoverProps} from './MPopover.types'\nimport './MPopover.css'\n\n// Focus the anchor itself when it is focusable, otherwise the first focusable element inside it.\nfunction focusAnchor(anchor: HTMLElement | null): boolean {\n if (!anchor || !anchor.isConnected) return false\n const target =\n anchor.tabIndex >= 0 && !anchor.hasAttribute('disabled')\n ? anchor\n : (getTabbable(anchor)[0] ?? getFocusable(anchor)[0] ?? null)\n if (!target) return false\n target.focus({preventScroll: true})\n return target.ownerDocument.activeElement === target\n}\n\nfunction focusIsLost(): boolean {\n const active = document.activeElement\n return !active || active === document.body || !active.isConnected\n}\n\n// Position floating content relative to an anchor with viewport-aware flipping.\nexport function MPopover({\n open,\n anchorRef,\n onClose,\n placement = 'bottom-start',\n matchWidth = false,\n offset = 4,\n zIndex,\n children,\n className,\n style,\n role = 'listbox',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n id,\n initialFocus,\n restoreFocus = true,\n closeOnTabOut = false,\n}: MPopoverProps) {\n const popoverRef = useRef<HTMLDivElement>(null)\n // Focus bookkeeping for returning focus to the anchor (APG: focus goes back to the invoker).\n const focusInsideRef = useRef(false)\n const pointerCloseRef = useRef(false)\n const wasOpenRef = useRef(false)\n const initialFocusDoneRef = useRef(false)\n const restoreFocusRef = useRef(restoreFocus)\n useEffect(() => {\n restoreFocusRef.current = restoreFocus\n }, [restoreFocus])\n const popoverIdRef = useRef<number>(null)\n if (popoverIdRef.current === null) popoverIdRef.current = nextPopoverId()\n const popoverId = popoverIdRef.current\n const [position, setPosition] = useState<{\n top: number\n left: number\n width?: number\n maxHeight?: number\n } | null>(null)\n const [flipped, setFlipped] = useState(false)\n const [layerZ, setLayerZ] = useState<number | string | null>(null)\n\n // Lift popovers above drawers, modals and mobile sidebars when the anchor sits inside them.\n const updateLayer = useCallback(() => {\n if (zIndex !== undefined) {\n setLayerZ(zIndex)\n return\n }\n\n const anchor = anchorRef.current\n if (!anchor || typeof window === 'undefined') {\n setLayerZ(null)\n return\n }\n\n const layerHost = anchor.closest(\n '.drawer-backdrop, .modal-backdrop, .sheet-backdrop, .sidebar.mobile-open, .popover'\n )\n if (!layerHost) {\n setLayerZ(null)\n return\n }\n\n const computedZ = window.getComputedStyle(layerHost).zIndex\n const parsedZ = Number.parseInt(computedZ, 10)\n setLayerZ(Number.isFinite(parsedZ) ? parsedZ + 1 : null)\n }, [anchorRef, zIndex])\n\n // Recalculate popover position whenever layout or viewport constraints change.\n const updatePosition = useCallback(() => {\n if (!anchorRef.current || !popoverRef.current) return\n\n const anchor = anchorRef.current.getBoundingClientRect()\n // Layout size, not getBoundingClientRect: the open animation scales the popover, and\n // measuring mid-animation under-reports its height by ~5 % (enough to overflow the\n // viewport after a flip / shift).\n // scrollHeight (plus borders) keeps the NATURAL height measurable once a max-height\n // below caps the box, so re-measuring never oscillates between capped and uncapped.\n const element = popoverRef.current\n const popover = {\n width: element.offsetWidth,\n height: Math.max(element.offsetHeight, element.scrollHeight + element.offsetHeight - element.clientHeight),\n }\n const viewport = {\n width: window.innerWidth,\n height: window.innerHeight,\n }\n\n const isTop = placement.startsWith('top')\n const isRight = placement.startsWith('right')\n const isLeft = placement.startsWith('left')\n const isHorizontal = isRight || isLeft\n const isEnd = placement.endsWith('end')\n\n let top: number\n let left: number\n let maxHeight: number | undefined\n\n if (isHorizontal) {\n // Horizontal placement: position to the right or left of the anchor\n const spaceRight = viewport.width - anchor.right - offset\n const spaceLeft = anchor.left - offset\n const shouldFlip = isRight\n ? spaceRight < popover.width && spaceLeft > spaceRight\n : spaceLeft < popover.width && spaceRight > spaceLeft\n\n setFlipped(shouldFlip)\n\n const showOnRight = isRight ? !shouldFlip : shouldFlip\n\n if (showOnRight) {\n left = anchor.right + offset + window.scrollX\n } else {\n left = anchor.left - popover.width - offset + window.scrollX\n }\n\n if (isEnd) {\n top = anchor.bottom - popover.height + window.scrollY\n } else {\n top = anchor.top + window.scrollY\n }\n\n // Shift along the anchor edge so a side popover near the bottom of the viewport\n // slides up instead of running off-screen (the top clamp below wins when it is\n // taller than the viewport).\n top = Math.min(top, window.scrollY + viewport.height - popover.height - 8)\n\n // Taller than the viewport: cap it and let it scroll instead of running off-screen.\n if (popover.height > viewport.height - 16) {\n maxHeight = Math.max(viewport.height - 16, 0)\n top = window.scrollY + 8\n }\n } else {\n // Vertical placement: position above or below the anchor\n const spaceBelow = viewport.height - anchor.bottom - offset\n const spaceAbove = anchor.top - offset\n const shouldFlip = isTop\n ? spaceAbove < popover.height && spaceBelow > spaceAbove\n : spaceBelow < popover.height && spaceAbove > spaceBelow\n\n setFlipped(shouldFlip)\n\n const showOnTop = isTop ? !shouldFlip : shouldFlip\n\n // Fits on neither side: the flip above already picked the side with more room,\n // so cap the height to that side and scroll, instead of clamping `top` and\n // covering the anchor (the field the user is typing into).\n const room = showOnTop ? spaceAbove : spaceBelow\n let height = popover.height\n if (popover.height > room) {\n maxHeight = Math.max(room - 8, 0)\n height = maxHeight\n }\n\n if (showOnTop) {\n top = anchor.top - height - offset + window.scrollY\n } else {\n top = anchor.bottom + offset + window.scrollY\n }\n\n if (isEnd) {\n left = anchor.right - popover.width + window.scrollX\n } else {\n left = anchor.left + window.scrollX\n }\n }\n\n // Clamp to viewport\n left = Math.max(8, Math.min(left, viewport.width - popover.width - 8))\n top = Math.max(8 + window.scrollY, top)\n\n setPosition({\n top,\n left,\n width: matchWidth ? anchor.width : undefined,\n maxHeight,\n })\n }, [anchorRef, placement, offset, matchWidth])\n\n useEffect(() => {\n if (!open) {\n setPosition(null)\n setLayerZ(null)\n return\n }\n\n updateLayer()\n // Wait one frame so the rendered popover can be measured accurately.\n requestAnimationFrame(updatePosition)\n\n // Content that grows after opening (images, expanded lists) must re-run the\n // flip / shift, or the popover drifts past the viewport edge.\n const resizeObserver = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => updatePosition())\n if (resizeObserver && popoverRef.current) {\n resizeObserver.observe(popoverRef.current)\n }\n\n // `scroll` does not bubble, so a window listener only ever sees the\n // document scrolling. Anchors living inside a scrollable ancestor — an\n // app shell with a scrolling main region, MStickyPanel, an overflowing\n // card — would leave the popover stranded at its opening coordinates\n // while the anchor moved away underneath it. Scroll events do capture,\n // so a capture-phase listener on the document catches scrolling from\n // ANY container, including the document itself.\n document.addEventListener('scroll', updatePosition, {capture: true, passive: true})\n window.addEventListener('resize', updatePosition, {passive: true})\n return () => {\n resizeObserver?.disconnect()\n document.removeEventListener('scroll', updatePosition, {capture: true})\n window.removeEventListener('resize', updatePosition)\n }\n }, [open, updateLayer, updatePosition])\n\n // Escape closes only the top layer: a nested popover (or a widget inside that already\n // consumed the key with preventDefault) closes first, its parent on the next press.\n useEffect(() => {\n if (!open) return\n const handleKey = (e: KeyboardEvent) => {\n if (e.key !== 'Escape' || e.defaultPrevented) return\n if (!isTopPopover(popoverId)) return\n e.preventDefault()\n onClose()\n }\n document.addEventListener('keydown', handleKey)\n return () => document.removeEventListener('keydown', handleKey)\n }, [open, onClose, popoverId])\n\n // Move focus into the layer once it is positioned (a `visibility: hidden` box cannot take focus).\n useEffect(() => {\n if (!open || !position || !initialFocus || initialFocusDoneRef.current) return\n initialFocusDoneRef.current = true\n const container = popoverRef.current\n if (!container) return\n\n let target: HTMLElement | null = null\n if (initialFocus === 'first') target = getTabbable(container)[0] ?? null\n else if (initialFocus !== 'container') target = initialFocus.current\n if (!target) {\n if (!container.hasAttribute('tabindex')) container.setAttribute('tabindex', '-1')\n target = container\n }\n target.focus({preventScroll: true})\n }, [open, position, initialFocus])\n\n // Return focus to the anchor when the layer closes while it held focus, unless the\n // user dismissed it by pressing somewhere else (that click owns focus now).\n useEffect(() => {\n if (open) {\n wasOpenRef.current = true\n pointerCloseRef.current = false\n initialFocusDoneRef.current = false\n return\n }\n if (!wasOpenRef.current) return\n wasOpenRef.current = false\n const hadFocus = focusInsideRef.current\n focusInsideRef.current = false\n if (!restoreFocusRef.current || !hadFocus || pointerCloseRef.current || !focusIsLost()) return\n focusAnchor(anchorRef.current)\n }, [open, anchorRef])\n\n // Same when the whole component unmounts while open.\n useEffect(\n () => () => {\n if (!wasOpenRef.current || !focusInsideRef.current || !restoreFocusRef.current) return\n if (pointerCloseRef.current || !focusIsLost()) return\n focusAnchor(anchorRef.current)\n },\n [anchorRef]\n )\n\n // Publish this instance while it is open so nested popovers can be related\n // back to it — see popoverStack.ts for why the DOM alone cannot answer this.\n useEffect(() => {\n if (!open) return\n return registerPopover({\n id: popoverId,\n getPopoverEl: () => popoverRef.current,\n getAnchorEl: () => anchorRef.current,\n })\n }, [open, popoverId, anchorRef])\n\n // Close when the user interacts outside both the popover and its anchor.\n useEffect(() => {\n if (!open) return\n const handleClick = (e: MouseEvent) => {\n const target = e.target as Node\n\n if (popoverRef.current?.contains(target) || anchorRef.current?.contains(target)) {\n return\n }\n\n // A popover nested inside this one is portaled to `document.body`,\n // so it fails the `contains` checks above even though the click\n // belongs to this popover's own subtree. Closing here would unmount\n // that child between mousedown and mouseup and swallow its click.\n if (isInsideDescendantPopover(popoverId, target)) {\n return\n }\n\n pointerCloseRef.current = true\n onClose()\n }\n document.addEventListener('mousedown', handleClick)\n return () => document.removeEventListener('mousedown', handleClick)\n }, [open, onClose, anchorRef, popoverId])\n\n const handleFocus = (e: ReactFocusEvent<HTMLDivElement>) => {\n if (popoverRef.current?.contains(e.target as Node)) focusInsideRef.current = true\n }\n\n const handleBlur = (e: ReactFocusEvent<HTMLDivElement>) => {\n const next = e.relatedTarget as Node | null\n if (next && !popoverRef.current?.contains(next)) focusInsideRef.current = false\n }\n\n // Optional Tab-out: leaving the layer with Tab closes it and continues from the anchor.\n const handleKeyDown = (e: ReactKeyboardEvent<HTMLDivElement>) => {\n if (!closeOnTabOut || e.key !== 'Tab' || e.defaultPrevented) return\n const container = popoverRef.current\n if (!container || !container.contains(e.target as Node)) return\n\n const focusable = getTabbable(container)\n const active = document.activeElement\n const leaving =\n focusable.length === 0 ||\n (e.shiftKey ? active === focusable[0] || active === container : active === focusable[focusable.length - 1])\n if (!leaving) return\n\n focusInsideRef.current = false\n // Forward Tab: focus the anchor and let the browser move on from there.\n // Shift+Tab: land on the anchor itself.\n if (focusAnchor(anchorRef.current) && e.shiftKey) e.preventDefault()\n onClose()\n }\n\n if (!open) return null\n\n return (\n <MPortal>\n <div\n ref={popoverRef}\n className={cn('popover', flipped ? 'flipped' : 'normal', className)}\n style={{\n position: 'absolute',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n width: position?.width,\n ...(position?.maxHeight !== undefined\n ? {maxHeight: position.maxHeight, overflowY: 'auto' as const}\n : null),\n zIndex: layerZ ?? undefined,\n visibility: position ? 'visible' : 'hidden',\n ...style,\n }}\n id={id}\n role={role ?? undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledB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Q,EAAI,EAAE,UAAU,EAAE,gBAAgB,CACpE,GAAS,GAKb,OAFK,GAGD,EAAA,EAAA,KAAC,EAAA,EAAD,CAAA,UACI,EAAA,EAAA,KAAC,MAAD,CACI,IAAK,EACL,UAAW,EAAA,EAAG,UAAW,EAAU,UAAY,SAAU,EAAU,CACnE,MAAO,CACH,SAAU,WACV,IAAK,GAAU,KAAO,EACtB,KAAM,GAAU,MAAQ,EACxB,MAAO,GAAU,MACjB,GAAI,GAAU,YAAc,IAAA,GAEtB,KADA,CAAC,UAAW,EAAS,UAAW,UAAW,OAAgB,CAEjE,OAAQ,GAAU,IAAA,GAClB,WAAY,EAAW,UAAY,SACnC,GAAG,EACN,CACG,KACJ,KAAM,GAAQ,IAAA,GACd,QAAS,EACT,OAAQ,EACR,UAAW,EACX,aAAY,EACZ,kBAAiB,EACjB,mBAAkB,EAEjB,WACC,CAAA,CACA,CAAA,CA9BI"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as e } from "./cn-
|
|
1
|
+
import { t as e } from "./cn-CUSXNnjF.js";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/layout/MSimpleGrid/MSimpleGrid.tsx
|
|
4
4
|
function n({ columns: n = 2, minItemWidth: r, className: i, style: a, children: o, ...s }) {
|
|
5
5
|
return /* @__PURE__ */ t("div", {
|
|
6
|
-
className: e("grid", `columns-${n}`, i),
|
|
6
|
+
className: e("grid", `columns-${n}`, r && "min-item-width", i),
|
|
7
7
|
style: {
|
|
8
8
|
...r ? { "--grid-min-item-width": r } : {},
|
|
9
9
|
...a
|
|
@@ -15,4 +15,4 @@ function n({ columns: n = 2, minItemWidth: r, className: i, style: a, children:
|
|
|
15
15
|
//#endregion
|
|
16
16
|
export { n as t };
|
|
17
17
|
|
|
18
|
-
//# sourceMappingURL=MSimpleGrid-
|
|
18
|
+
//# sourceMappingURL=MSimpleGrid-C_QvLmck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSimpleGrid-C_QvLmck.js","names":[],"sources":["../src/components/layout/MSimpleGrid/MSimpleGrid.tsx"],"sourcesContent":["import type {MSimpleGridProps} from './MSimpleGrid.types'\nimport {cn} from '../../../utils/cn'\nimport './MSimpleGrid.css'\n\n// Render a simple equal-column grid with a shared default spacing. With `minItemWidth`\n// the grid drops columns (never above `columns`) once items would get narrower than that.\nexport function MSimpleGrid({columns = 2, minItemWidth, className, style, children, ...rest}: MSimpleGridProps) {\n return (\n <div\n className={cn('grid', `columns-${columns}`, minItemWidth && 'min-item-width', className)}\n style={{\n ...(minItemWidth ? {'--grid-min-item-width': minItemWidth} : {}),\n ...style,\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n"],"mappings":";;;AAMA,SAAgB,EAAY,EAAC,aAAU,GAAG,iBAAc,cAAW,UAAO,aAAU,GAAG,KAAyB;AAC5G,QACI,kBAAC,OAAD;EACI,WAAW,EAAG,QAAQ,WAAW,KAAW,KAAgB,kBAAkB,EAAU;EACxF,OAAO;GACH,GAAI,IAAe,EAAC,yBAAyB,GAAa,GAAG,EAAE;GAC/D,GAAG;GACN;EACD,GAAI;EAEH;EACC,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./cn-DYFxgzi2.cjs`);require(`./core-w629c4ND.cjs`);let t=require(`react/jsx-runtime`);function n({columns:n=2,minItemWidth:r,className:i,style:a,children:o,...s}){return(0,t.jsx)(`div`,{className:e.t(`grid`,`columns-${n}`,r&&`min-item-width`,i),style:{...r?{"--grid-min-item-width":r}:{},...a},...s,children:o})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
2
|
+
//# sourceMappingURL=MSimpleGrid-wgvjnxwM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSimpleGrid-wgvjnxwM.cjs","names":[],"sources":["../src/components/layout/MSimpleGrid/MSimpleGrid.tsx"],"sourcesContent":["import type {MSimpleGridProps} from './MSimpleGrid.types'\nimport {cn} from '../../../utils/cn'\nimport './MSimpleGrid.css'\n\n// Render a simple equal-column grid with a shared default spacing. With `minItemWidth`\n// the grid drops columns (never above `columns`) once items would get narrower than that.\nexport function MSimpleGrid({columns = 2, minItemWidth, className, style, children, ...rest}: MSimpleGridProps) {\n return (\n <div\n className={cn('grid', `columns-${columns}`, minItemWidth && 'min-item-width', className)}\n style={{\n ...(minItemWidth ? {'--grid-min-item-width': minItemWidth} : {}),\n ...style,\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n"],"mappings":"uGAMA,SAAgB,EAAY,CAAC,UAAU,EAAG,eAAc,YAAW,QAAO,WAAU,GAAG,GAAyB,CAC5G,OACI,EAAA,EAAA,KAAC,MAAD,CACI,UAAW,EAAA,EAAG,OAAQ,WAAW,IAAW,GAAgB,iBAAkB,EAAU,CACxF,MAAO,CACH,GAAI,EAAe,CAAC,wBAAyB,EAAa,CAAG,EAAE,CAC/D,GAAG,EACN,CACD,GAAI,EAEH,WACC,CAAA"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { r as e } from "./theme-
|
|
2
|
-
import { t } from "./cn-
|
|
1
|
+
import { r as e } from "./theme-B_juOenJ.js";
|
|
2
|
+
import { t } from "./cn-CUSXNnjF.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/feedback/MBadge/MBadge.tsx
|
|
5
|
-
function i({ color: i = "primary", size: a = "md", hidden: o,
|
|
5
|
+
function i({ color: i = "primary", size: a = "md", hidden: o, hiddenAbove: s, pulsing: c = !1, rounded: l = !1, fullWidth: u = !1, icon: d, className: f, children: p, ...m }) {
|
|
6
6
|
return /* @__PURE__ */ r("span", {
|
|
7
|
-
className: t("badge", `color-${i}`, a,
|
|
8
|
-
...e(o),
|
|
9
|
-
...
|
|
10
|
-
children: [
|
|
7
|
+
className: t("badge", `color-${i}`, a, c && "pulsing", l && "rounded", u && "full-width", f),
|
|
8
|
+
...e(o, s),
|
|
9
|
+
...m,
|
|
10
|
+
children: [d && /* @__PURE__ */ n("span", {
|
|
11
11
|
className: "badge-icon",
|
|
12
|
-
children:
|
|
13
|
-
}),
|
|
12
|
+
children: d
|
|
13
|
+
}), p]
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
@@ -27,6 +27,7 @@ function o({ variant: e = "text", width: r, height: i, radius: o, lines: s = 3,
|
|
|
27
27
|
gap: c ?? void 0,
|
|
28
28
|
...d
|
|
29
29
|
},
|
|
30
|
+
"aria-hidden": "true",
|
|
30
31
|
...f,
|
|
31
32
|
children: Array.from({ length: s }, (e, r) => /* @__PURE__ */ n("div", {
|
|
32
33
|
className: t("skeleton", "text", p),
|
|
@@ -44,10 +45,11 @@ function o({ variant: e = "text", width: r, height: i, radius: o, lines: s = 3,
|
|
|
44
45
|
borderRadius: o ?? void 0,
|
|
45
46
|
...d
|
|
46
47
|
},
|
|
48
|
+
"aria-hidden": "true",
|
|
47
49
|
...f
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
//#endregion
|
|
51
53
|
export { i as n, o as t };
|
|
52
54
|
|
|
53
|
-
//# sourceMappingURL=MSkeleton-
|
|
55
|
+
//# sourceMappingURL=MSkeleton-BpcpBBJq.js.map
|