@12-apps/ui 6.93.2 → 6.95.0
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/NATIVE.md +1 -1
- package/components-catalog.md +7 -0
- package/dist/_internal/components/data-display/Avatar/Avatar.js +2 -2
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +1 -1
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +1 -1
- package/dist/_internal/components/data-display/Carousel/Carousel.js +3 -3
- package/dist/_internal/components/data-display/Chart/SpecChart.js +3 -3
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +27 -27
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +36 -36
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +1 -1
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +3 -3
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +2 -2
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +2 -2
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +2 -2
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +10 -10
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +25 -25
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +9 -9
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +8 -8
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +2 -2
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +2 -2
- package/dist/_internal/components/data-display/DayRuler/DayRuler.js +3 -3
- package/dist/_internal/components/data-display/HoverCard/HoverCard.js +1 -1
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +5 -5
- package/dist/_internal/components/data-display/Lightbox/LightboxControls.js +2 -2
- package/dist/_internal/components/data-display/Lightbox/LightboxOverlay.js +3 -3
- package/dist/_internal/components/data-display/Lightbox/LightboxThumbnails.js +2 -2
- package/dist/_internal/components/data-display/RegionMap/RegionMap.js +2 -2
- package/dist/_internal/components/data-display/ScheduleGrid/ScheduleGrid.js +1 -1
- package/dist/_internal/components/data-display/Sheet/Sheet.body.js +2 -2
- package/dist/_internal/components/data-display/Sheet/Sheet.hooks.js +2 -2
- package/dist/_internal/components/data-display/Sheet/Sheet.js +5 -5
- package/dist/_internal/components/data-display/Sheet/Sheet.parts.js +1 -1
- package/dist/_internal/components/data-display/Table/Table.js +3 -3
- package/dist/_internal/components/data-display/index.js +39 -39
- package/dist/_internal/components/feedback/StackedModal/StackedModal.hooks.js +2 -2
- package/dist/_internal/components/feedback/StackedModal/StackedModal.js +4 -4
- package/dist/_internal/components/feedback/StackedModal/modal-stack.js +3 -1
- package/dist/_internal/components/feedback/TutorialOverlay/TutorialOverlay.js +2 -2
- package/dist/_internal/components/feedback/UsableModal/UsableModal.js +11 -0
- package/dist/_internal/components/feedback/UsableModal/UsableModal.js.map +1 -0
- package/dist/_internal/components/feedback/UsableModal/UsableModal.modal.js +87 -0
- package/dist/_internal/components/feedback/UsableModal/UsableModal.modal.js.map +1 -0
- package/dist/_internal/components/feedback/UsableModal/UsableModal.sheet.js +91 -0
- package/dist/_internal/components/feedback/UsableModal/UsableModal.sheet.js.map +1 -0
- package/dist/_internal/components/feedback/UsableModal/UsableModal.types.js +1 -0
- package/dist/_internal/components/feedback/UsableModal/UsableModal.types.js.map +1 -0
- package/dist/_internal/components/feedback/UsableModal/has-footer.js +8 -0
- package/dist/_internal/components/feedback/UsableModal/has-footer.js.map +1 -0
- package/dist/_internal/components/feedback/UsableModal/recover-chunk.js +10 -0
- package/dist/_internal/components/feedback/UsableModal/recover-chunk.js.map +1 -0
- package/dist/_internal/components/feedback/index.js +9 -9
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.hooks.js +3 -3
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.js +5 -5
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocompleteField.js +2 -2
- package/dist/_internal/components/form/CategorySelect/CategorySelect.js +2 -2
- package/dist/_internal/components/form/CepField/CepField.js +3 -3
- package/dist/_internal/components/form/CodeEditor/CodeEditor.js +2 -2
- package/dist/_internal/components/form/Command/Command.js +2 -2
- package/dist/_internal/components/form/Input/Input.factory.js +1 -1
- package/dist/_internal/components/form/Input/Input.js +2 -2
- package/dist/_internal/components/form/Menubar/Menubar.js +2 -2
- package/dist/_internal/components/form/NumberField/NumberField.js +3 -3
- package/dist/_internal/components/form/UploadButton/UploadButton.js +2 -2
- package/dist/_internal/components/form/index.js +48 -48
- package/dist/_internal/components/form/total-form/Fields/CategoryField.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/CepField.js +4 -4
- package/dist/_internal/components/form/total-form/Fields/TextField.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/index.js +15 -15
- package/dist/_internal/components/index.js +130 -130
- package/dist/_internal/components/layout/SettingCard/SettingGroup.js +3 -3
- package/dist/_internal/components/layout/SettingCard/SettingToggle.js +3 -3
- package/dist/_internal/components/layout/SettingsLayout/SettingsLayout.js +3 -3
- package/dist/_internal/components/layout/SettingsLayout/SettingsPanel.js +2 -2
- package/dist/_internal/components/layout/index.js +17 -17
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +6 -6
- package/dist/_internal/components/navigation/NavigationMenu/NavigationMegaSection.js +2 -2
- package/dist/_internal/components/navigation/NavigationMenu/NavigationMenu.js +4 -4
- package/dist/_internal/components/navigation/NavigationMenu/NavigationStandardBody.js +2 -2
- package/dist/_internal/components/navigation/SectionNav/SectionNav.js +3 -3
- package/dist/_internal/components/navigation/index.js +19 -19
- package/dist/_internal/components/utility/index.js +4 -4
- package/dist/_internal/user-avatar/user-avatar.js +3 -3
- package/dist/charts.js +11 -11
- package/dist/{chunk-NQDOKJLI.js → chunk-2365CQJU.js} +2 -2
- package/dist/{chunk-4E2RQOSQ.js → chunk-24G3BWKD.js} +2 -2
- package/dist/{chunk-XE33EZVS.js → chunk-2SBQ47RI.js} +5 -5
- package/dist/{chunk-HWZETMO4.js → chunk-37SNQQ7P.js} +3 -3
- package/dist/{chunk-I4DG3PP4.js → chunk-43EFQ3DU.js} +2 -2
- package/dist/{chunk-2L6TANRY.js → chunk-4RF4BALN.js} +3 -3
- package/dist/{chunk-X6D5JEUV.js → chunk-4RSFYS2V.js} +6 -6
- package/dist/{chunk-LYVTJLCF.js → chunk-56JF5PZK.js} +4 -4
- package/dist/{chunk-7WE432RQ.js → chunk-5HXVXW22.js} +5 -5
- package/dist/{chunk-N3GLX64O.js → chunk-5I75WRXT.js} +4 -4
- package/dist/{chunk-BP3ZKIPE.js → chunk-64UNVW6D.js} +4 -4
- package/dist/{chunk-NQ6P7O7C.js → chunk-6AKDAQSS.js} +2 -2
- package/dist/{chunk-PGJIWCQR.js → chunk-6EZQLNPK.js} +4 -4
- package/dist/{chunk-EE6DJPB7.js → chunk-6HXNFNOB.js} +4 -4
- package/dist/{chunk-4QTPERAY.js → chunk-6RW4WNGS.js} +4 -4
- package/dist/{chunk-GBB23QLL.js → chunk-6ZAKPYWX.js} +4 -4
- package/dist/{chunk-CWXX5JR3.js → chunk-75GAQL2Q.js} +5 -5
- package/dist/{chunk-JZRSHDNY.js → chunk-77FQFWA3.js} +6 -3
- package/dist/chunk-77FQFWA3.js.map +1 -0
- package/dist/{chunk-LY5I3ZSV.js → chunk-A2YLFKQU.js} +4 -4
- package/dist/{chunk-6DGNMASB.js → chunk-ALREWFRX.js} +4 -4
- package/dist/{chunk-FXECKKPW.js → chunk-ASBFGGJB.js} +6 -1
- package/dist/chunk-ASBFGGJB.js.map +1 -0
- package/dist/{chunk-F2UP5ZF4.js → chunk-BMC5KGH2.js} +4 -4
- package/dist/{chunk-BR3WBTTQ.js → chunk-BRFL7OWI.js} +7 -7
- package/dist/chunk-BTMBQIED.js +7 -0
- package/dist/chunk-BTMBQIED.js.map +1 -0
- package/dist/{chunk-UIIHUWOV.js → chunk-C7IFBYIJ.js} +7 -7
- package/dist/{chunk-FKS2PNJF.js → chunk-CSD6SWBZ.js} +6 -6
- package/dist/{chunk-6LGKJVOA.js → chunk-E2UOEI7N.js} +2 -2
- package/dist/{chunk-K2VDRODL.js → chunk-E4NFH77Z.js} +4 -4
- package/dist/{chunk-VM4UYCD4.js → chunk-FTYOCFTV.js} +3 -3
- package/dist/{chunk-JVQ56E3U.js → chunk-FWTVIRZZ.js} +6 -6
- package/dist/{chunk-3IX2TP4I.js → chunk-GB7NTXL2.js} +2 -2
- package/dist/chunk-IQDPMLDM.js +39 -0
- package/dist/chunk-IQDPMLDM.js.map +1 -0
- package/dist/{chunk-TSMF7K37.js → chunk-J4UA744J.js} +9 -2
- package/dist/chunk-J4UA744J.js.map +1 -0
- package/dist/chunk-J55SDNCE.js +53 -0
- package/dist/chunk-J55SDNCE.js.map +1 -0
- package/dist/{chunk-4J62V5OE.js → chunk-JIEVKHOH.js} +6 -6
- package/dist/{chunk-MKNW4FRR.js → chunk-JOQGKXR5.js} +5 -5
- package/dist/{chunk-E5OBAS3U.js → chunk-JQGDKWFH.js} +4 -2
- package/dist/chunk-JQGDKWFH.js.map +1 -0
- package/dist/{chunk-ASEHJIIV.js → chunk-KHDKG7XB.js} +3 -3
- package/dist/{chunk-TSID4257.js → chunk-KMMFN24G.js} +4 -4
- package/dist/{chunk-YGWLMTPB.js → chunk-KXVWH3JM.js} +2 -2
- package/dist/{chunk-LKWXU6NH.js → chunk-LV6AD6XC.js} +2 -2
- package/dist/{chunk-WQO5WONV.js → chunk-MWXZXCVX.js} +4 -4
- package/dist/{chunk-PNZH6CDD.js → chunk-NI3MC742.js} +4 -4
- package/dist/{chunk-BZYLTGOE.js → chunk-OKDKKBLI.js} +4 -4
- package/dist/{chunk-AJ6KFHEE.js → chunk-PJDAZG65.js} +2 -2
- package/dist/{chunk-NASLJO2R.js → chunk-QSZYQZZP.js} +3 -2
- package/dist/chunk-QSZYQZZP.js.map +1 -0
- package/dist/{chunk-ALMGYCHY.js → chunk-RLQVJXGW.js} +2 -2
- package/dist/{chunk-FPNVOB52.js → chunk-RNIJL54W.js} +4 -4
- package/dist/{chunk-2M3W6ACW.js → chunk-S46LGAQ2.js} +4 -4
- package/dist/{chunk-6N2U67KF.js → chunk-T3KVZTO3.js} +4 -4
- package/dist/{chunk-GY53SDVL.js → chunk-U2SAW6DH.js} +4 -4
- package/dist/{chunk-GXGHEOWC.js → chunk-USHVG4UQ.js} +2 -2
- package/dist/{chunk-2GDPZ53K.js → chunk-UTWEHMAP.js} +2 -2
- package/dist/{chunk-P772HCHI.js → chunk-W676GY42.js} +4 -4
- package/dist/{chunk-4JNC5AEF.js → chunk-WGKBZ7DN.js} +2 -2
- package/dist/{chunk-T2G4LDU5.js → chunk-WLLUARTC.js} +2 -2
- package/dist/{chunk-SI5SKX52.js → chunk-WW3F7DCX.js} +2 -2
- package/dist/{chunk-UOKXYV3U.js → chunk-XALDXR3F.js} +2 -2
- package/dist/{chunk-ZM6FJCWS.js → chunk-XNAI7QGU.js} +4 -4
- package/dist/{chunk-LZ5PGB7U.js → chunk-XRC6SF4N.js} +21 -13
- package/dist/chunk-XRC6SF4N.js.map +1 -0
- package/dist/{chunk-JXK53XJW.js → chunk-YOLLISEY.js} +9 -9
- package/dist/{chunk-FKUVFPQZ.js → chunk-Z6QFIRD7.js} +4 -4
- package/dist/{chunk-RHVJ3L4U.js → chunk-ZJY7OK6H.js} +2 -2
- package/dist/{chunk-LABIUXDM.js → chunk-ZYXXAWDF.js} +2 -2
- package/dist/data-display/Avatar.js +2 -2
- package/dist/data-display/CardKit.js +1 -1
- package/dist/data-display/Carousel.js +3 -3
- package/dist/data-display/Chart.js +11 -11
- package/dist/data-display/DataViews.js +44 -44
- package/dist/data-display/DayRuler.js +3 -3
- package/dist/data-display/HoverCard.js +1 -1
- package/dist/data-display/Lightbox.js +5 -5
- package/dist/data-display/RegionMap.js +2 -2
- package/dist/data-display/ScheduleGrid.js +5 -5
- package/dist/data-display/Sheet.js +5 -5
- package/dist/data-display/Table.js +3 -3
- package/dist/feedback/ConfirmAction.js +3 -3
- package/dist/feedback/StackedModal.js +4 -4
- package/dist/feedback/TutorialOverlay.js +2 -2
- package/dist/feedback/UsableModal.js +9 -0
- package/dist/feedback/UsableModal.js.map +1 -0
- package/dist/form/AddressAutocomplete.js +5 -5
- package/dist/form/CategorySelect.js +2 -2
- package/dist/form/CepField.js +3 -3
- package/dist/form/CodeEditor.js +2 -2
- package/dist/form/Command.js +2 -2
- package/dist/form/Input/outlined.js +2 -2
- package/dist/form/Input.js +2 -2
- package/dist/form/Menubar.js +2 -2
- package/dist/form/NumberField.js +3 -3
- package/dist/form/UploadButton.js +2 -2
- package/dist/form/total-form.js +13 -13
- package/dist/layout/ContentToolbar.js +3 -3
- package/dist/layout/SettingCard.js +7 -7
- package/dist/layout/SettingsLayout.js +3 -3
- package/dist/locales.js +4 -4
- package/dist/navigation/AppHeader.js +8 -8
- package/dist/navigation/NavigationMenu.js +4 -4
- package/dist/navigation/SectionNav.js +3 -3
- package/dist/pt-BR.js +5 -5
- package/dist/types/components/data-display/Sheet/Sheet.body.d.ts +2 -0
- package/dist/types/components/data-display/Sheet/Sheet.body.d.ts.map +1 -1
- package/dist/types/components/data-display/Sheet/Sheet.d.ts.map +1 -1
- package/dist/types/components/data-display/Sheet/Sheet.parts.d.ts.map +1 -1
- package/dist/types/components/data-display/Sheet/Sheet.types.d.ts +14 -0
- package/dist/types/components/data-display/Sheet/Sheet.types.d.ts.map +1 -1
- package/dist/types/components/feedback/StackedModal/StackedModal.hooks.d.ts.map +1 -1
- package/dist/types/components/feedback/StackedModal/modal-stack.d.ts +6 -0
- package/dist/types/components/feedback/StackedModal/modal-stack.d.ts.map +1 -1
- package/dist/types/components/feedback/UsableModal/UsableModal.d.ts +20 -0
- package/dist/types/components/feedback/UsableModal/UsableModal.d.ts.map +1 -0
- package/dist/types/components/feedback/UsableModal/UsableModal.modal.d.ts +11 -0
- package/dist/types/components/feedback/UsableModal/UsableModal.modal.d.ts.map +1 -0
- package/dist/types/components/feedback/UsableModal/UsableModal.sheet.d.ts +17 -0
- package/dist/types/components/feedback/UsableModal/UsableModal.sheet.d.ts.map +1 -0
- package/dist/types/components/feedback/UsableModal/UsableModal.types.d.ts +35 -0
- package/dist/types/components/feedback/UsableModal/UsableModal.types.d.ts.map +1 -0
- package/dist/types/components/feedback/UsableModal/has-footer.d.ts +4 -0
- package/dist/types/components/feedback/UsableModal/has-footer.d.ts.map +1 -0
- package/dist/types/components/feedback/UsableModal/index.d.ts +3 -0
- package/dist/types/components/feedback/UsableModal/index.d.ts.map +1 -0
- package/dist/types/components/feedback/UsableModal/recover-chunk.d.ts +24 -0
- package/dist/types/components/feedback/UsableModal/recover-chunk.d.ts.map +1 -0
- package/dist/types/components/form/Input/Input.factory.d.ts.map +1 -1
- package/dist/types/components/form/Input/Input.types.d.ts +3 -2
- package/dist/types/components/form/Input/Input.types.d.ts.map +1 -1
- package/dist/user-avatar.js +3 -3
- package/package.json +5 -1
- package/src/components/data-display/Sheet/Sheet.body.tsx +4 -0
- package/src/components/data-display/Sheet/Sheet.md +5 -0
- package/src/components/data-display/Sheet/Sheet.parts.tsx +2 -1
- package/src/components/data-display/Sheet/Sheet.tsx +29 -9
- package/src/components/data-display/Sheet/Sheet.types.ts +14 -0
- package/src/components/feedback/StackedModal/StackedModal.hooks.ts +16 -0
- package/src/components/feedback/StackedModal/modal-stack.tsx +12 -2
- package/src/components/feedback/UsableModal/UsableModal.md +95 -0
- package/src/components/feedback/UsableModal/UsableModal.modal.tsx +76 -0
- package/src/components/feedback/UsableModal/UsableModal.sheet.tsx +65 -0
- package/src/components/feedback/UsableModal/UsableModal.tsx +92 -0
- package/src/components/feedback/UsableModal/UsableModal.types.ts +38 -0
- package/src/components/feedback/UsableModal/has-footer.ts +4 -0
- package/src/components/feedback/UsableModal/index.ts +2 -0
- package/src/components/feedback/UsableModal/recover-chunk.ts +61 -0
- package/src/components/form/Input/Input.factory.tsx +12 -0
- package/src/components/form/Input/Input.types.ts +3 -2
- package/dist/chunk-E5OBAS3U.js.map +0 -1
- package/dist/chunk-FXECKKPW.js.map +0 -1
- package/dist/chunk-JZRSHDNY.js.map +0 -1
- package/dist/chunk-LZ5PGB7U.js.map +0 -1
- package/dist/chunk-NASLJO2R.js.map +0 -1
- package/dist/chunk-TSMF7K37.js.map +0 -1
- /package/dist/{chunk-NQDOKJLI.js.map → chunk-2365CQJU.js.map} +0 -0
- /package/dist/{chunk-4E2RQOSQ.js.map → chunk-24G3BWKD.js.map} +0 -0
- /package/dist/{chunk-XE33EZVS.js.map → chunk-2SBQ47RI.js.map} +0 -0
- /package/dist/{chunk-HWZETMO4.js.map → chunk-37SNQQ7P.js.map} +0 -0
- /package/dist/{chunk-I4DG3PP4.js.map → chunk-43EFQ3DU.js.map} +0 -0
- /package/dist/{chunk-2L6TANRY.js.map → chunk-4RF4BALN.js.map} +0 -0
- /package/dist/{chunk-X6D5JEUV.js.map → chunk-4RSFYS2V.js.map} +0 -0
- /package/dist/{chunk-LYVTJLCF.js.map → chunk-56JF5PZK.js.map} +0 -0
- /package/dist/{chunk-7WE432RQ.js.map → chunk-5HXVXW22.js.map} +0 -0
- /package/dist/{chunk-N3GLX64O.js.map → chunk-5I75WRXT.js.map} +0 -0
- /package/dist/{chunk-BP3ZKIPE.js.map → chunk-64UNVW6D.js.map} +0 -0
- /package/dist/{chunk-NQ6P7O7C.js.map → chunk-6AKDAQSS.js.map} +0 -0
- /package/dist/{chunk-PGJIWCQR.js.map → chunk-6EZQLNPK.js.map} +0 -0
- /package/dist/{chunk-EE6DJPB7.js.map → chunk-6HXNFNOB.js.map} +0 -0
- /package/dist/{chunk-4QTPERAY.js.map → chunk-6RW4WNGS.js.map} +0 -0
- /package/dist/{chunk-GBB23QLL.js.map → chunk-6ZAKPYWX.js.map} +0 -0
- /package/dist/{chunk-CWXX5JR3.js.map → chunk-75GAQL2Q.js.map} +0 -0
- /package/dist/{chunk-LY5I3ZSV.js.map → chunk-A2YLFKQU.js.map} +0 -0
- /package/dist/{chunk-6DGNMASB.js.map → chunk-ALREWFRX.js.map} +0 -0
- /package/dist/{chunk-F2UP5ZF4.js.map → chunk-BMC5KGH2.js.map} +0 -0
- /package/dist/{chunk-BR3WBTTQ.js.map → chunk-BRFL7OWI.js.map} +0 -0
- /package/dist/{chunk-UIIHUWOV.js.map → chunk-C7IFBYIJ.js.map} +0 -0
- /package/dist/{chunk-FKS2PNJF.js.map → chunk-CSD6SWBZ.js.map} +0 -0
- /package/dist/{chunk-6LGKJVOA.js.map → chunk-E2UOEI7N.js.map} +0 -0
- /package/dist/{chunk-K2VDRODL.js.map → chunk-E4NFH77Z.js.map} +0 -0
- /package/dist/{chunk-VM4UYCD4.js.map → chunk-FTYOCFTV.js.map} +0 -0
- /package/dist/{chunk-JVQ56E3U.js.map → chunk-FWTVIRZZ.js.map} +0 -0
- /package/dist/{chunk-3IX2TP4I.js.map → chunk-GB7NTXL2.js.map} +0 -0
- /package/dist/{chunk-4J62V5OE.js.map → chunk-JIEVKHOH.js.map} +0 -0
- /package/dist/{chunk-MKNW4FRR.js.map → chunk-JOQGKXR5.js.map} +0 -0
- /package/dist/{chunk-ASEHJIIV.js.map → chunk-KHDKG7XB.js.map} +0 -0
- /package/dist/{chunk-TSID4257.js.map → chunk-KMMFN24G.js.map} +0 -0
- /package/dist/{chunk-YGWLMTPB.js.map → chunk-KXVWH3JM.js.map} +0 -0
- /package/dist/{chunk-LKWXU6NH.js.map → chunk-LV6AD6XC.js.map} +0 -0
- /package/dist/{chunk-WQO5WONV.js.map → chunk-MWXZXCVX.js.map} +0 -0
- /package/dist/{chunk-PNZH6CDD.js.map → chunk-NI3MC742.js.map} +0 -0
- /package/dist/{chunk-BZYLTGOE.js.map → chunk-OKDKKBLI.js.map} +0 -0
- /package/dist/{chunk-AJ6KFHEE.js.map → chunk-PJDAZG65.js.map} +0 -0
- /package/dist/{chunk-ALMGYCHY.js.map → chunk-RLQVJXGW.js.map} +0 -0
- /package/dist/{chunk-FPNVOB52.js.map → chunk-RNIJL54W.js.map} +0 -0
- /package/dist/{chunk-2M3W6ACW.js.map → chunk-S46LGAQ2.js.map} +0 -0
- /package/dist/{chunk-6N2U67KF.js.map → chunk-T3KVZTO3.js.map} +0 -0
- /package/dist/{chunk-GY53SDVL.js.map → chunk-U2SAW6DH.js.map} +0 -0
- /package/dist/{chunk-GXGHEOWC.js.map → chunk-USHVG4UQ.js.map} +0 -0
- /package/dist/{chunk-2GDPZ53K.js.map → chunk-UTWEHMAP.js.map} +0 -0
- /package/dist/{chunk-P772HCHI.js.map → chunk-W676GY42.js.map} +0 -0
- /package/dist/{chunk-4JNC5AEF.js.map → chunk-WGKBZ7DN.js.map} +0 -0
- /package/dist/{chunk-T2G4LDU5.js.map → chunk-WLLUARTC.js.map} +0 -0
- /package/dist/{chunk-SI5SKX52.js.map → chunk-WW3F7DCX.js.map} +0 -0
- /package/dist/{chunk-UOKXYV3U.js.map → chunk-XALDXR3F.js.map} +0 -0
- /package/dist/{chunk-ZM6FJCWS.js.map → chunk-XNAI7QGU.js.map} +0 -0
- /package/dist/{chunk-JXK53XJW.js.map → chunk-YOLLISEY.js.map} +0 -0
- /package/dist/{chunk-FKUVFPQZ.js.map → chunk-Z6QFIRD7.js.map} +0 -0
- /package/dist/{chunk-RHVJ3L4U.js.map → chunk-ZJY7OK6H.js.map} +0 -0
- /package/dist/{chunk-LABIUXDM.js.map → chunk-ZYXXAWDF.js.map} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Remembers, for this tab, WHEN a reload was last spent on a missing chunk. */
|
|
4
|
+
const RELOADED_KEY = '12-apps-ui:usable-modal-chunk-reload';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* How long a reload counts as spent. Inside it, a chunk still missing after the
|
|
8
|
+
* reload is not a deploy but a broken build: render nothing rather than loop.
|
|
9
|
+
* Past it, a missing chunk is the NEXT deploy — a tab open for days meets one a
|
|
10
|
+
* day — and earns its own reload; a flag kept for the tab's life would leave
|
|
11
|
+
* the modal silently dead after the second deploy.
|
|
12
|
+
*/
|
|
13
|
+
export const RELOAD_SPENT_MS = 5 * 60 * 1000;
|
|
14
|
+
|
|
15
|
+
type Module<P> = { default: ComponentType<P> };
|
|
16
|
+
|
|
17
|
+
/** Renders nothing: what a surface becomes when its chunk cannot be had at all. */
|
|
18
|
+
const Nothing = (): null => null;
|
|
19
|
+
|
|
20
|
+
function readReloaded(): boolean {
|
|
21
|
+
try {
|
|
22
|
+
const at = Number(window.sessionStorage.getItem(RELOADED_KEY));
|
|
23
|
+
return at > 0 && Date.now() - at < RELOAD_SPENT_MS;
|
|
24
|
+
} catch {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function writeReloaded(value: boolean): void {
|
|
30
|
+
try {
|
|
31
|
+
if (value) window.sessionStorage.setItem(RELOADED_KEY, String(Date.now()));
|
|
32
|
+
else window.sessionStorage.removeItem(RELOADED_KEY);
|
|
33
|
+
} catch {
|
|
34
|
+
// Storage refused (private mode, quota): the reload guard is lost, not the modal.
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A lazy loader that survives a deploy. Every deploy replaces a host's hashed
|
|
40
|
+
* chunks, so a tab opened before it asks for a file that is gone. The import is
|
|
41
|
+
* tried twice; then the page reloads ONCE onto the current build (the same
|
|
42
|
+
* answer as a host's own route loader); if that already happened in this tab
|
|
43
|
+
* in the last `RELOAD_SPENT_MS`,
|
|
44
|
+
* the modal renders nothing rather than handing the failure to the host's
|
|
45
|
+
* error boundary and losing the whole page for opening a modal.
|
|
46
|
+
*/
|
|
47
|
+
export function recoverChunk<P>(load: () => Promise<Module<P>>): () => Promise<Module<P>> {
|
|
48
|
+
return async () => {
|
|
49
|
+
try {
|
|
50
|
+
const loaded = await load().catch(() => load());
|
|
51
|
+
writeReloaded(false);
|
|
52
|
+
return loaded;
|
|
53
|
+
} catch {
|
|
54
|
+
if (typeof window === 'undefined' || readReloaded()) return { default: Nothing };
|
|
55
|
+
writeReloaded(true);
|
|
56
|
+
window.location.reload();
|
|
57
|
+
// The page is going away; nothing should render in the meantime.
|
|
58
|
+
return new Promise<Module<P>>(() => undefined);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -126,6 +126,14 @@ function inputAriaOf(a: {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* A top-level `inputMode`, for the `<input>` (FUT-1440). Left with the rest it
|
|
131
|
+
* landed on the text field's root `<div>`, where it raised no keypad at all.
|
|
132
|
+
*/
|
|
133
|
+
function keyboardOf(inputMode: InputProps['inputMode']): Pick<InputProps, 'inputMode'> {
|
|
134
|
+
return inputMode === undefined ? {} : { inputMode };
|
|
135
|
+
}
|
|
136
|
+
|
|
129
137
|
/** The render function `createInput` hands `forwardRef`, over a given styled field. */
|
|
130
138
|
function inputRenderer(
|
|
131
139
|
StyledTextField: ReturnType<typeof styledField>,
|
|
@@ -150,6 +158,7 @@ function inputRenderer(
|
|
|
150
158
|
'aria-label': ariaLabel,
|
|
151
159
|
'aria-describedby': ariaDescribedBy,
|
|
152
160
|
'aria-busy': ariaBusy,
|
|
161
|
+
inputMode,
|
|
153
162
|
inputProps,
|
|
154
163
|
...rest
|
|
155
164
|
},
|
|
@@ -183,9 +192,12 @@ function inputRenderer(
|
|
|
183
192
|
* disagreed with the DOM. The reports search box and the block-title
|
|
184
193
|
* inputs were both named in source and anonymous to a screen reader.
|
|
185
194
|
* `aria-describedby` and `aria-busy` are the same case: `inputAriaOf`.
|
|
195
|
+
* So is a top-level `inputMode` (FUT-1440, `keyboardOf`); a caller's
|
|
196
|
+
* `inputProps.inputMode` still wins.
|
|
186
197
|
*/
|
|
187
198
|
inputProps={{
|
|
188
199
|
'data-testid': dataTestId,
|
|
200
|
+
...keyboardOf(inputMode),
|
|
189
201
|
...inputProps,
|
|
190
202
|
...inputAriaOf({ id, helperText, label: ariaLabel, describedBy: ariaDescribedBy, busy: ariaBusy }),
|
|
191
203
|
}}
|
|
@@ -34,8 +34,9 @@ export interface InputProps
|
|
|
34
34
|
InputLabelProps?: Partial<MuiInputLabelProps>;
|
|
35
35
|
/**
|
|
36
36
|
* Attributes for the `<input>` element itself. Anything else this component
|
|
37
|
-
* does not recognise lands on the text field's ROOT `<div>`, where
|
|
38
|
-
* `
|
|
37
|
+
* does not recognise lands on the text field's ROOT `<div>`, where `pattern`,
|
|
38
|
+
* `role` and `aria-value*` do nothing. A top-level `inputMode` is routed to
|
|
39
|
+
* the `<input>` (FUT-1440); one given here wins over it. Merged, not
|
|
39
40
|
* spread over: the field's own `data-testid` stays the default a caller can
|
|
40
41
|
* override, and the ARIA it builds from `aria-label` / `aria-describedby` /
|
|
41
42
|
* `aria-busy` still lands last.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/Sheet/Sheet.body.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport CircularProgress from '@mui/material/CircularProgress/index.js';\nimport React from 'react';\n\nimport { SheetContent, SheetFooter, SheetHeader } from './Sheet.parts';\nimport type { SheetProps } from './Sheet.types';\nimport { sxRem } from '../../../tokens/relative';\nimport { muiColor } from '../../../tokens/scales';\n\nexport interface SheetBodyProps extends Pick<\n SheetProps,\n | 'title'\n | 'description'\n | 'showCloseButton'\n | 'closeLabel'\n | 'showHandle'\n | 'header'\n | 'footer'\n | 'loading'\n | 'color'\n | 'children'\n | 'onClick'\n | 'onFocus'\n | 'onBlur'\n> {\n testId: string;\n isDragging: boolean;\n isVerticalSheet: boolean;\n isDraggableVariant: boolean;\n onClose: () => void;\n onDragStart: (e: React.MouseEvent | React.TouchEvent) => void;\n}\n\n/**\n * The header earns its place if it would show anything at all — a grab handle,\n * either piece of text, the close button, or caller-supplied content.\n */\nconst needsHeader = (props: SheetBodyProps) =>\n Boolean(\n props.showHandle ||\n props.title ||\n props.description ||\n props.showCloseButton ||\n props.header,\n );\n\n/** The centred spinner shown in place of the children while `loading`. */\nconst SheetLoading: React.FC<Pick<SheetBodyProps, 'color'>> = ({ color }) => (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: sxRem(200),\n }}\n >\n <CircularProgress color={color === undefined ? undefined : muiColor(color, 'inherit')} />\n </Box>\n);\n\n/**\n * What the sheet contains, independent of which drawer is carrying it. The\n * swipeable and plain branches render exactly this — they differ only in the\n * MUI component and its swipe props, so the contents are built once.\n */\nexport const SheetBody: React.FC<SheetBodyProps> = (props) => {\n const {\n title,\n description,\n showCloseButton,\n closeLabel,\n showHandle,\n header,\n footer,\n loading,\n color,\n children,\n onClick,\n onFocus,\n onBlur,\n testId,\n isDragging,\n isVerticalSheet,\n isDraggableVariant,\n onClose,\n onDragStart,\n } = props;\n\n return (\n <Box\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n data-testid={testId}\n sx={{\n // A vertical sheet's panel is a column whose height is its CONTENT, up\n // to the `size` ceiling — so this fills what the panel has rather than\n // asking for a percentage of it, and `minHeight: 0` is what lets it\n // shrink past its content so `SheetContent` scrolls instead of the\n // panel overflowing. A side sheet's panel is full-height already.\n ...(isVerticalSheet ? { flex: '1 1 auto', minHeight: 0 } : { height: '100%' }),\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n userSelect: isDragging ? 'none' : 'auto',\n }}\n >\n {needsHeader(props) && (\n <SheetHeader\n title={title}\n description={description}\n showCloseButton={showCloseButton}\n closeLabel={closeLabel}\n onClose={onClose}\n showHandle={showHandle && isVerticalSheet}\n isDraggable={isDraggableVariant && isVerticalSheet}\n onDragStart={onDragStart}\n dataTestId={`${testId}-header`}\n >\n {header}\n </SheetHeader>\n )}\n\n <SheetContent padded dataTestId={`${testId}-content`}>\n {loading ? <SheetLoading color={color} /> : children}\n </SheetContent>\n\n {footer && (\n <SheetFooter sticky divider dataTestId={`${testId}-footer`}>\n {footer}\n </SheetFooter>\n )}\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAO,SAAS;AAChB,OAAO,sBAAsB;AAuDzB,cAiCA,YAjCA;AAnBJ,IAAM,cAAc,CAAC,UACnB;AAAA,EACE,MAAM,cACN,MAAM,SACN,MAAM,eACN,MAAM,mBACN,MAAM;AACR;AAGF,IAAM,eAAwD,CAAC,EAAE,MAAM,MACrE;AAAA,EAAC;AAAA;AAAA,IACC,IAAI;AAAA,MACF,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,YAAY;AAAA,MACZ,WAAW,MAAM,GAAG;AAAA,IACtB;AAAA,IAEA,8BAAC,oBAAiB,OAAO,UAAU,SAAY,SAAY,SAAS,OAAO,SAAS,GAAG;AAAA;AACzF;AAQK,IAAM,YAAsC,CAAC,UAAU;AAC5D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMF,GAAI,kBAAkB,EAAE,MAAM,YAAY,WAAW,EAAE,IAAI,EAAE,QAAQ,OAAO;AAAA,QAC5E,SAAS;AAAA,QACT,eAAe;AAAA,QACf,UAAU;AAAA,QACV,YAAY,aAAa,SAAS;AAAA,MACpC;AAAA,MAEC;AAAA,oBAAY,KAAK,KAChB;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,YAAY,cAAc;AAAA,YAC1B,aAAa,sBAAsB;AAAA,YACnC;AAAA,YACA,YAAY,GAAG,MAAM;AAAA,YAEpB;AAAA;AAAA,QACH;AAAA,QAGF,oBAAC,gBAAa,QAAM,MAAC,YAAY,GAAG,MAAM,YACvC,oBAAU,oBAAC,gBAAa,OAAc,IAAK,UAC9C;AAAA,QAEC,UACC,oBAAC,eAAY,QAAM,MAAC,SAAO,MAAC,YAAY,GAAG,MAAM,WAC9C,kBACH;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/form/Input/Input.factory.tsx"],"sourcesContent":["import CircularProgress from '@mui/material/CircularProgress/index.js';\nimport InputAdornment from '@mui/material/InputAdornment/index.js';\nimport { styled, useTheme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { INPUT_LOADING } from './Input.metrics';\nimport type { TextFieldSlimComponent } from './text-field-slim.factory';\n\nimport {\n filledStyles,\n floatingLabelStyles,\n glowStyles,\n inputBaseStyles,\n inputRadiusStyles,\n muiVariantFor,\n outlinedStyles,\n pulseStyles,\n SIZE_MAP,\n} from './Input.styles';\nimport type { InputProps } from './Input.types';\nimport { splitTestId } from '../../../platform/test-id';\nimport { fieldControlStyles } from '../../../tokens/field-height';\nimport { rem } from '../../../tokens/relative';\nimport type { SizeValue } from '../../../tokens/vocabulary';\n\n/**\n * The field `Input` renders, styled, over whichever text field it is given.\n *\n * Always a `TextFieldSlim`, never MUI's `TextField` — see `text-field-slim.tsx`.\n * MUI's own `TextField` imports `Select` unconditionally, and through it `Menu`,\n * `Popover`, `Modal` and seven more component modules, so every screen with one\n * text box shipped a dropdown it can never render. Same composition, same DOM,\n * same prop routing; the select branch is the only thing missing.\n */\nfunction styledField(TextField: TextFieldSlimComponent) {\n return styled(TextField, {\n shouldForwardProp: (prop) =>\n !['customVariant', 'fieldSize', 'floating', 'glow', 'pulse', 'loading'].includes(prop as string),\n })<{\n customVariant?: InputProps['variant'];\n fieldSize: SizeValue;\n floating?: boolean;\n glow?: boolean;\n pulse?: boolean;\n loading?: boolean;\n }>(({ theme, customVariant, fieldSize, floating, glow, pulse, loading }) => ({\n position: 'relative',\n // The theme's field height for this size (outlined family, one line).\n ...fieldControlStyles(theme, fieldSize),\n opacity: loading ? INPUT_LOADING.opacity : 1,\n\n ...(glow ? glowStyles(theme) : {}),\n ...(pulse ? pulseStyles(theme, fieldSize) : {}),\n ...(floating ? floatingLabelStyles(theme) : {}),\n\n '& .MuiInputBase-root': {\n transition: 'all 0.3s ease',\n ...inputRadiusStyles(theme, customVariant),\n ...inputBaseStyles(theme, customVariant),\n },\n\n '& .MuiOutlinedInput-root': outlinedStyles(theme),\n '& .MuiFilledInput-root': filledStyles(theme),\n }));\n}\n\n/** Only one adornment shows at a time: the spinner replaces the caller's while loading. */\nconst EndAdornment: React.FC<{ loading: boolean; endAdornment?: React.ReactNode }> = ({\n loading,\n endAdornment,\n}) => {\n const theme = useTheme();\n if (loading) {\n return (\n <InputAdornment position=\"end\">\n <CircularProgress size={rem(theme, INPUT_LOADING.spinnerSize)} />\n </InputAdornment>\n );\n }\n\n if (!endAdornment) return null;\n\n return <InputAdornment position=\"end\">{endAdornment}</InputAdornment>;\n};\n\n/** While loading the field is inert: no clicks, and disabled to assistive tech. */\nconst interactionProps = (\n loading: boolean,\n onClick: InputProps['onClick'],\n disabled?: boolean,\n) => ({\n disabled: loading || disabled,\n onClick: loading ? undefined : onClick,\n});\n\n/**\n * The ARIA that describes the field has to sit on the `<input>`: the text\n * field puts every attribute it does not recognise on its root `FormControl`,\n * a `<div>` with no role, where a screen reader never reads it.\n *\n * `aria-label` has ridden `inputProps` since FUT-755. `aria-describedby` and\n * `aria-busy` fell through to the div until FUT-2619, so CepField's input\n * pointed at nothing while its lookup status lived in a live region beside it.\n *\n * `inputProps` are spread onto the `<input>` AFTER the `aria-describedby` MUI\n * writes for helper text, so a caller's ids REPLACE the helper text's: MUI's\n * `TextField` on its own keeps only one of the two. This joins both, helper\n * text first. The helper id is MUI's `<id>-helper-text` (the parity test pins\n * that spelling), which is why the field's id is fixed here rather than left\n * to the text field.\n */\nfunction inputAriaOf(a: {\n id: string;\n helperText: React.ReactNode;\n label?: string;\n describedBy?: string;\n busy?: InputProps['aria-busy'];\n}): Record<string, unknown> {\n const describedBy = [a.helperText ? `${a.id}-helper-text` : undefined, a.describedBy]\n .filter(Boolean)\n .join(' ');\n return {\n ...(a.label === undefined ? {} : { 'aria-label': a.label }),\n ...(a.describedBy === undefined ? {} : { 'aria-describedby': describedBy }),\n ...(a.busy === undefined ? {} : { 'aria-busy': a.busy }),\n };\n}\n\n/** The render function `createInput` hands `forwardRef`, over a given styled field. */\nfunction inputRenderer(\n StyledTextField: ReturnType<typeof styledField>,\n): React.ForwardRefRenderFunction<HTMLInputElement, InputProps> {\n return (\n {\n variant = 'outlined',\n size = 'md',\n label,\n error,\n helperText,\n startAdornment,\n endAdornment,\n fullWidth = true,\n floating = false,\n glow = false,\n pulse = false,\n loading = false,\n onClick,\n onFocus,\n onBlur,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n 'aria-busy': ariaBusy,\n inputProps,\n ...rest\n },\n ref,\n ) => {\n const { testId: dataTestId, rest: props } = splitTestId(rest);\n const generatedId = React.useId();\n const id = props.id ?? generatedId;\n return (\n <StyledTextField\n ref={ref}\n variant={muiVariantFor(variant)}\n customVariant={variant}\n fieldSize={size}\n floating={floating}\n glow={glow}\n pulse={pulse}\n loading={loading}\n label={label}\n error={error}\n helperText={helperText}\n fullWidth={fullWidth}\n {...interactionProps(loading, onClick, props.disabled)}\n onFocus={onFocus}\n onBlur={onBlur}\n /*\n * `aria-label` has to ride `inputProps` to reach the `<input>` (FUT-755).\n * Spread with the rest it lands on the FormControl DIV that the text\n * field renders as its root, which carries no role — so the field kept\n * no accessible name, and a source grep saying \"this input is labelled\"\n * disagreed with the DOM. The reports search box and the block-title\n * inputs were both named in source and anonymous to a screen reader.\n * `aria-describedby` and `aria-busy` are the same case: `inputAriaOf`.\n */\n inputProps={{\n 'data-testid': dataTestId,\n ...inputProps,\n ...inputAriaOf({ id, helperText, label: ariaLabel, describedBy: ariaDescribedBy, busy: ariaBusy }),\n }}\n InputProps={{\n startAdornment: startAdornment && (\n <InputAdornment position=\"start\">{startAdornment}</InputAdornment>\n ),\n endAdornment: <EndAdornment loading={loading} endAdornment={endAdornment} />,\n }}\n {...SIZE_MAP[size]}\n {...props}\n id={id}\n />\n );\n };\n}\n\n/** The `Input` component every entry exports. */\nexport type InputComponent<P extends InputProps = InputProps> = React.ForwardRefExoticComponent<\n P & React.RefAttributes<HTMLInputElement>\n>;\n\n/**\n * `Input` over a given text field (FUT-1054). The generic entry passes the\n * field that renders any MUI variant; `./outlined` passes one that only ever\n * imports `OutlinedInput`. Everything else — styles, adornments, the ARIA\n * routing — is this one body, so the two cannot drift.\n */\nexport function createInput(TextField: TextFieldSlimComponent): InputComponent {\n const Input = React.forwardRef<HTMLInputElement, InputProps>(inputRenderer(styledField(TextField)));\n Input.displayName = 'Input';\n return Input;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,sBAAsB;AAC7B,OAAO,oBAAoB;AAC3B,SAAS,QAAQ,gBAAgB;AACjC,OAAO,WAAW;AAwEV;AAzCR,SAAS,YAAY,WAAmC;AACtD,SAAO,OAAO,WAAW;AAAA,IACvB,mBAAmB,CAAC,SA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;AAAA,QAChB,GAAG;AAAA,QACJ;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAaO,SAAS,YAAY,WAAmD;AAC7E,QAAM,QAAQ,MAAM,WAAyC,cAAc,YAAY,SAAS,CAAC,CAAC;AAClG,QAAM,cAAc;AACpB,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/feedback/StackedModal/modal-stack.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { MODAL_STACK_BASE_Z_INDEX, MODAL_STACK_Z_INDEX_STEP } from '../../../tokens/layers';\nimport type { ModalInfo, ModalPanelRole, ModalStackContextValue } from './StackedModal.types';\n\n/**\n * MUI Dialog default z-index; each panel in the stack sits 10 above the last.\n *\n * Imported rather than declared here: anything that portals out of a panel has\n * to clear this ladder, so the numbers are shared with the token that tells it\n * how — see `tokens/layers`.\n */\nconst BASE_Z_INDEX = MODAL_STACK_BASE_Z_INDEX;\nconst Z_INDEX_STEP = MODAL_STACK_Z_INDEX_STEP;\n\nconst noop = (): void => {\n /** do nothing */\n};\n\nconst ModalStackContext = createContext<ModalStackContextValue>({\n stack: [],\n pushModal: noop,\n popModal: noop,\n clearStack: noop,\n currentDepth: 0,\n isModalInStack: () => false,\n getModalRole: () => null,\n});\n\nexport const useModalStack = (): ModalStackContextValue => {\n const context = useContext(ModalStackContext);\n if (!context) {\n throw new Error('useModalStack must be used within a ModalStackProvider');\n }\n return context;\n};\n\n/** Top of the stack drives the view; the one behind it recedes; the rest are hidden. */\nconst roleAt = (index: number, depth: number): ModalPanelRole => {\n if (index === depth - 1) return 'primary';\n if (index === depth - 2) return 'secondary';\n return 'background';\n};\n\n/** Re-derive every role from stack position — the one place roles are assigned. */\nconst withRoles = (stack: ModalInfo[]): ModalInfo[] =>\n stack.map((modal, index) => ({ ...modal, role: roleAt(index, stack.length) }));\n\n/**\n * Locks body scroll while any modal is open, restoring whatever the page had\n * before. Owned by the provider rather than each modal, so nested panels can't\n * fight over the same style.\n */\nconst useBodyScrollLock = (locked: boolean): void => {\n const originalOverflow = useRef<string>('');\n\n useEffect(() => {\n const restore = (): void => {\n if (!originalOverflow.current) return;\n document.body.style.overflow = originalOverflow.current;\n originalOverflow.current = '';\n };\n\n if (locked) {\n if (!originalOverflow.current) {\n originalOverflow.current = document.body.style.overflow || '';\n }\n document.body.style.overflow = 'hidden';\n } else {\n restore();\n }\n\n return restore;\n }, [locked]);\n};\n\nexport const ModalStackProvider: FC<{ children: ReactNode }> = ({ children }) => {\n const [stack, setStack] = useState<ModalInfo[]>([]);\n\n useBodyScrollLock(stack.length > 0);\n\n const pushModal = useCallback((modalId: string) => {\n setStack((prev) => {\n if (prev.some((m) => m.id === modalId)) return prev;\n const entry: ModalInfo = {\n id: modalId,\n zIndex: BASE_Z_INDEX + prev.length * Z_INDEX_STEP,\n role: 'primary',\n };\n return withRoles([...prev, entry]);\n });\n }, []);\n\n const popModal = useCallback((modalId?: string) => {\n setStack((prev) =>\n withRoles(modalId ? prev.filter((m) => m.id !== modalId) : prev.slice(0, -1)),\n );\n }, []);\n\n const clearStack = useCallback(() => setStack([]), []);\n\n const isModalInStack = useCallback(\n (modalId: string) => stack.some((m) => m.id === modalId),\n [stack],\n );\n\n const getModalRole = useCallback(\n (modalId: string) => stack.find((m) => m.id === modalId)?.role ?? null,\n [stack],\n );\n\n const value = useMemo(\n () => ({\n stack,\n pushModal,\n popModal,\n clearStack,\n currentDepth: stack.length,\n isModalInStack,\n getModalRole,\n }),\n [stack, pushModal, popModal, clearStack, isModalInStack, getModalRole],\n );\n\n return <ModalStackContext.Provider value={value}>{children}</ModalStackContext.Provider>;\n};\n"],"mappings":";;;;;;AACA,SAAS,eAAe,aAAa,YAAY,WAAW,SAAS,QAAQ,gBAAgB;AA2HpF;AAhHT,IAAM,eAAe;AACrB,IAAM,eAAe;AAErB,IAAM,OAAO,MAAY;AAEzB;AA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,KAAK,KAAK,CAAC,MAAM,EAAE,OAAO,OAAO,EAAG,QAAO;AAC/C,YAAM,QAAmB;AAAA,QACvB,IAAI;AAAA,QACJ,QAAQ,eAAe,KAAK,SAAS;AAAA,QACrC,MAAM;AAAA,MACR;AACA,aAAO,UAAU,CAAC,GAAG,MAAM,KAAK,CAAC;AAAA,IACnC,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,QAAM,WAAW,YAAY,CAAC,YAAqB;AACjD;AAAA,MAAS,CAAC,SACR,UAAU,UAAU,KAAK,OAAO,CAAC,MAAM,EAAE,OAAO,OAAO,IAAI,KAAK,MAAM,GAAG,EAAE,CAAC;AAAA,IAC9E;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,aAAa,YAAY,MAAM,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC;AAErD,QAAM,iBAAiB;AAAA,IACrB,CAAC,YAAoB,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,OAAO;AAAA,IACvD,CAAC,KAAK;AAAA,EACR;AAEA,QAAM,eAAe;AAAA,IACnB,CAAC,YAAoB,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,OAAO,GAAG,QAAQ;AAAA,IAClE,CAAC,KAAK;AAAA,EACR;AAEA,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAc,MAAM;AAAA,MACpB;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,OAAO,WAAW,UAAU,YAAY,gBAAgB,YAAY;AAAA,EACvE;AAEA,SAAO,oBAAC,kBAAkB,UAAlB,EAA2B,OAAe,UAAS;AAC7D;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/Sheet/Sheet.tsx"],"sourcesContent":["import Drawer from '@mui/material/Drawer/index.js';\nimport SwipeableDrawer from '@mui/material/SwipeableDrawer/index.js';\nimport { useTheme } from '@mui/material/styles/index.js';\nimport type { BackdropProps } from '@mui/material/Backdrop/index.js';\nimport React from 'react';\n\nimport { withDefaults } from '../../../utils/withDefaults';\n\nimport {\n DEFAULT_DRAG_RESISTANCE,\n DEFAULT_VELOCITY_THRESHOLD,\n SPRING_CONFIG,\n} from './Sheet.animations';\nimport { SheetBody } from './Sheet.body';\nimport { useSheetDrag, useSheetOpen } from './Sheet.hooks';\nimport { SheetOverlay } from './Sheet.parts';\nimport { panelSx } from './Sheet.styles';\nimport type { SheetProps } from './Sheet.types';\n\nexport { SheetContent, SheetFooter, SheetHeader, SheetOverlay } from './Sheet.parts';\n\nconst DEFAULTS = {\n open: false,\n position: 'bottom',\n variant: 'default',\n size: 'md',\n color: 'primary',\n glow: false,\n pulse: false,\n glass: false,\n gradient: false,\n loading: false,\n disabled: false,\n showOverlay: true,\n closeOnOverlayClick: true,\n closeOnEscape: true,\n showCloseButton: true,\n showHandle: true,\n swipeable: true,\n snapPoints: [0.25, 0.5, 0.75, 1],\n defaultSnapPoint: 0.5,\n minSnapPoint: 0,\n maxSnapPoint: 1,\n velocityThreshold: DEFAULT_VELOCITY_THRESHOLD,\n dragResistance: DEFAULT_DRAG_RESISTANCE,\n animationConfig: SPRING_CONFIG,\n persistent: false,\n fullHeight: false,\n rounded: true,\n elevation: 16,\n dataTestId: 'sheet',\n} satisfies Partial<SheetProps>;\n\n/**\n * The props with every defaulted key now guaranteed present. Without this the\n * component would need a `?? fallback` at each use site, and each of those is a\n * branch the complexity gate counts.\n */\ntype ResolvedSheetProps = SheetProps & Required<Pick<SheetProps, keyof typeof DEFAULTS>>;\n\n/**\n * The drawer's own backdrop, made invisible: it only CATCHES the tap.\n *\n * The visible veil is {@link SheetOverlay}, which knows about the `glass`\n * blur. But the drawer's modal root covers the whole viewport above that veil,\n * so with no backdrop at all a tap on the veil landed on the bare root, which\n * handles nothing — and no sheet ever closed on an outside tap. This one sits\n * under the panel, paints nothing, and hands the tap to the drawer's\n * `onClose('backdropClick')`, which the sheet routes through its own\n * `closeOnOverlayClick` / `persistent` rules.\n *\n * Defined at module scope: a component built inside a render is a new type on\n * every pass, which remounts the subtree it belongs to.\n */\nconst ClickCatcher = React.forwardRef<HTMLDivElement, BackdropProps & { 'data-testid'?: string }>(\n ({ onClick, 'data-testid': testId }, ref) => (\n <div\n ref={ref}\n aria-hidden\n onClick={onClick}\n data-testid={testId}\n style={{ position: 'fixed', inset: 0, backgroundColor: 'transparent' }}\n />\n ),\n) as React.ComponentType<BackdropProps>;\nClickCatcher.displayName = 'SheetClickCatcher';\n\n/**\n * Which way the sheet is anchored. Four flags rather than four repeated\n * comparisons, and the only thing the hooks and styles need to know about\n * `position` and `variant`.\n */\nconst orientationOf = ({ position, variant }: ResolvedSheetProps) => {\n const isBottomSheet = position === 'bottom';\n const isTopSheet = position === 'top';\n\n return {\n isBottomSheet,\n isTopSheet,\n isVerticalSheet: isBottomSheet || isTopSheet,\n isDraggableVariant: variant === 'draggable',\n };\n};\n\nexport const Sheet: React.FC<SheetProps> = (props) => {\n const resolved = withDefaults(props, DEFAULTS) as ResolvedSheetProps;\n const { position, variant, showOverlay, swipeable, className, dataTestId } = resolved;\n\n const theme = useTheme();\n const orientation = orientationOf(resolved);\n\n // Support both the dataTestId prop and a plain data-testid attribute.\n const testId = (resolved as { 'data-testid'?: string })['data-testid'] || dataTestId;\n\n const { sheetRef, currentHeight, isDragging, isAnimating, handleDragStart, resetToDefaultSnapPoint } =\n useSheetDrag({ ...resolved, ...orientation });\n\n const { isOpen, handleClose, handleOverlayClick, handleSwipeOpen } = useSheetOpen({\n ...resolved,\n ...orientation,\n resetToDefaultSnapPoint,\n });\n\n const drawerProps = {\n anchor: position,\n open: isOpen,\n className,\n ...(resolved.animated === false ? { transitionDuration: 0 } : {}),\n // A tap outside obeys `closeOnOverlayClick`. A swipe-to-dismiss (no\n // reason: SwipeableDrawer calls `onClose()` bare) closes. Escape is the\n // hook's own listener alone, which honours `closeOnEscape` — the modal's\n // is switched off below so the key never closes twice or past the flag.\n onClose: (_event?: object, reason?: 'backdropClick' | 'escapeKeyDown') =>\n reason === 'backdropClick' ? handleOverlayClick() : handleClose(),\n PaperProps: {\n ref: sheetRef,\n sx: panelSx({ ...resolved, ...orientation, theme, currentHeight, isDragging, isAnimating }),\n },\n ModalProps: {\n keepMounted: true,\n disableEscapeKeyDown: true,\n BackdropComponent: ClickCatcher,\n BackdropProps: { 'data-testid': testId ? `${testId}-click-catcher` : undefined } as Partial<BackdropProps>,\n },\n };\n\n const body = (\n <SheetBody\n {...resolved}\n {...orientation}\n testId={testId}\n isDragging={isDragging}\n onClose={handleClose}\n onDragStart={handleDragStart}\n />\n );\n\n // The draggable variant drives the panel's height itself; MUI's swipe handling\n // would be a second thing moving it.\n const isSwipeable = swipeable && !orientation.isDraggableVariant;\n\n return (\n <>\n {showOverlay && isOpen && (\n <SheetOverlay open={isOpen} onClick={handleOverlayClick} blur={variant === 'glass'} animated={resolved.animated} />\n )}\n\n {isSwipeable ? (\n <SwipeableDrawer\n {...drawerProps}\n onOpen={handleSwipeOpen}\n disableSwipeToOpen={false}\n swipeAreaWidth={20}\n >\n {body}\n </SwipeableDrawer>\n ) : (\n <Drawer {...drawerProps}>{body}</Drawer>\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,YAAY;AACnB,OAAO,qBAAqB;AAC5B,SAAS,gBAAgB;AAEzB,OAAO,WAAW;AAwEd,SAsFA,UAtFA,KAsFA,YAtFA;AAvDJ,IAAM,WAAW;AAAA,EACf,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,WAAW;AAA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AAA,IACN;AAAA,IACA,GAAI,SAAS,aAAa,QAAQ,EAAE,oBAAoB,EAAE,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAK/D,SAAS,CAAC,QAAiB,WACzB,WAAW,kBAAkB,mBAAmB,IAAI,YAAY;AAAA,IAClE,YAAY;AAAA,MACV,KAAK;AAAA,MACL,IAAI,QAAQ,EAAE,GAAG,UAAU,GAAG,aAAa,OAAO,eAAe,YAAY,YAAY,CAAC;AAAA,IAC5F;AAAA,IACA,YAAY;AAAA,MACV,aAAa;AAAA,MACb,sBAAsB;AAAA,MACtB,mBAAmB;AAAA,MACnB,eAAe,EAAE,eAAe,SAAS,GAAG,MAAM,mBAAmB,OAAU;AAAA,IACjF;AAAA,EACF;AAEA,QAAM,OACJ;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,aAAa;AAAA;AAAA,EACf;AAKF,QAAM,cAAc,aAAa,CAAC,YAAY;AAE9C,SACE,iCACG;AAAA,mBAAe,UACd,oBAAC,gBAAa,MAAM,QAAQ,SAAS,oBAAoB,MAAM,YAAY,SAAS,UAAU,SAAS,UAAU;AAAA,IAGlH,cACC;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,QAAQ;AAAA,QACR,oBAAoB;AAAA,QACpB,gBAAgB;AAAA,QAEf;AAAA;AAAA,IACH,IAEA,oBAAC,UAAQ,GAAG,aAAc,gBAAK;AAAA,KAEnC;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/Sheet/Sheet.parts.tsx"],"sourcesContent":["import CloseIcon from '@mui/icons-material/Close';\nimport Backdrop from '@mui/material/Backdrop/index.js';\nimport Box from '@mui/material/Box/index.js';\nimport Divider from '@mui/material/Divider/index.js';\nimport Fade from '@mui/material/Fade/index.js';\nimport IconButton from '@mui/material/IconButton/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport { alpha, useTheme } from '@mui/material/styles/index.js';\nimport type { Theme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { EN_US_UI_LABELS } from '../../../en-US.labels';\nimport { scrim, sheen } from '../../../tokens/ink';\nimport { rem, rems } from '../../../tokens/relative';\nimport { withDefaults } from '../../../utils/withDefaults';\n\nimport { shimmerAnimation } from './Sheet.animations';\nimport type {\n SheetContentProps,\n SheetFooterProps,\n SheetHeaderProps,\n SheetOverlayProps,\n} from './Sheet.types';\n\n/**\n * The grab handle's own styling. A draggable handle is deliberately larger and\n * tinted, so the affordance reads as draggable before the user tries it; a\n * decorative one stays a neutral bar.\n */\nconst handleSx = (theme: Theme, isDraggable: boolean) => ({\n width: rem(theme, isDraggable ? 48 : 32),\n height: rem(theme, isDraggable ? 6 : 4),\n backgroundColor: alpha(theme.palette.text.primary, 0.3),\n borderRadius: 3,\n transition: theme.transitions.create(['all'], {\n duration: theme.transitions.duration.short,\n easing: theme.transitions.easing.easeInOut,\n }),\n position: 'relative',\n overflow: 'hidden',\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n left: '-100%',\n width: '100%',\n height: '100%',\n background: `linear-gradient(\n 90deg,\n transparent,\n ${sheen(theme, 0.3)},\n transparent\n )`,\n animation: isDraggable ? `${shimmerAnimation(theme)} 2s infinite` : 'none',\n },\n ...(isDraggable && {\n backgroundColor: alpha(theme.palette.primary.main, 0.4),\n boxShadow: `${rems(theme, 0, 2, 4)} ${alpha(theme.palette.primary.main, 0.2)}`,\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n transform: 'scaleX(1.15) scaleY(1.2)',\n boxShadow: `${rems(theme, 0, 3, 6)} ${alpha(theme.palette.primary.main, 0.3)}`,\n },\n }),\n});\n\nconst SheetHandle: React.FC<{ isDraggable: boolean }> = ({ isDraggable }) => {\n const theme = useTheme();\n\n return (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n mb: 1,\n // The handle is decoration on a draggable header: the drag listeners sit\n // on the header itself, so letting the bar swallow the press would open\n // a dead zone in the middle of the grab target.\n pointerEvents: isDraggable ? 'none' : 'auto',\n }}\n >\n <Box sx={handleSx(theme, isDraggable)} />\n </Box>\n );\n};\n\nconst HEADER_DEFAULTS: Partial<SheetHeaderProps> = {\n closeLabel: EN_US_UI_LABELS.common.close,\n isDraggable: false,\n dataTestId: 'sheet-header',\n};\n\nexport const SheetHeader: React.FC<SheetHeaderProps> = (props) => {\n const {\n title,\n description,\n showCloseButton,\n closeLabel,\n onClose,\n showHandle,\n isDraggable,\n onDragStart,\n className,\n style,\n children,\n dataTestId,\n } = withDefaults(props, HEADER_DEFAULTS);\n\n return (\n <Box\n className={className}\n data-testid={dataTestId}\n sx={{\n p: 2,\n pb: showHandle ? 1 : 2,\n cursor: isDraggable ? 'grab' : 'auto',\n '&:active': isDraggable ? { cursor: 'grabbing' } : {},\n ...style,\n }}\n onMouseDown={isDraggable ? onDragStart : undefined}\n onTouchStart={isDraggable ? onDragStart : undefined}\n >\n {showHandle && <SheetHandle isDraggable={Boolean(isDraggable)} />}\n\n <Box sx={{ display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between' }}>\n <Box sx={{ flex: 1 }}>\n {title && (\n <Typography variant=\"h6\" sx={{ fontWeight: 600 }} data-testid={`${dataTestId}-title`}>\n {title}\n </Typography>\n )}\n {description && (\n <Typography variant=\"body2\" color=\"text.secondary\" sx={{ mt: 0.5 }}>\n {description}\n </Typography>\n )}\n {children}\n </Box>\n\n {showCloseButton && (\n <IconButton\n onClick={onClose}\n aria-label={closeLabel}\n size=\"small\"\n sx={{ ml: 1, mt: -0.5 }}\n data-testid={`${dataTestId}-close-button`}\n >\n <CloseIcon data-testid={`${dataTestId}-close-icon`} />\n </IconButton>\n )}\n </Box>\n </Box>\n );\n};\n\nconst CONTENT_DEFAULTS: Partial<SheetContentProps> = {\n padded: true,\n dataTestId: 'sheet-content',\n};\n\nexport const SheetContent: React.FC<SheetContentProps> = (props) => {\n const { children, className, style, padded, dataTestId } = withDefaults(props, CONTENT_DEFAULTS);\n\n return (\n <Box\n className={className}\n data-testid={dataTestId}\n // No `minHeight: 0` here, deliberately: a flex item's automatic minimum\n // size only applies while its main-axis `overflow` is `visible`, and this\n // one is `auto`, so it already shrinks. `SheetBody` above is the item that\n // needs it stated.\n sx={{ flex: 1, overflow: 'auto', p: padded ? 2 : 0, ...style }}\n >\n {children}\n </Box>\n );\n};\n\nconst FOOTER_DEFAULTS: Partial<SheetFooterProps> = {\n sticky: false,\n divider: false,\n dataTestId: 'sheet-footer',\n};\n\nexport const SheetFooter: React.FC<SheetFooterProps> = (props) => {\n const { children, className, style, sticky, divider, dataTestId } = withDefaults(\n props,\n FOOTER_DEFAULTS,\n );\n\n return (\n <>\n {divider && <Divider />}\n <Box\n className={className}\n data-testid={dataTestId}\n sx={{\n p: 2,\n position: sticky ? 'sticky' : 'relative',\n bottom: sticky ? 0 : 'auto',\n backgroundColor: 'background.paper',\n borderTop: sticky ? '1px solid' : 'none',\n borderColor: 'divider',\n ...style,\n }}\n >\n {children}\n </Box>\n </>\n );\n};\n\nconst OVERLAY_DEFAULTS: Partial<SheetOverlayProps> = {\n open: false,\n blur: false,\n};\n\nexport const SheetOverlay: React.FC<SheetOverlayProps> = (props) => {\n const { open, onClick, className, style, blur, animated } = withDefaults(props, OVERLAY_DEFAULTS);\n const theme = useTheme();\n const timeout = animated === false ? 0 : 300;\n\n return (\n <Fade in={open} timeout={timeout}>\n <Backdrop\n open={Boolean(open)}\n transitionDuration={timeout}\n onClick={onClick}\n className={className}\n sx={{\n // One below the drawer, under the panel. Inside a Sheet this veil is\n // VISUAL only: the drawer's invisible backdrop above it catches the\n // tap (`ClickCatcher` in Sheet.tsx). The onClick keeps it usable alone.\n zIndex: theme.zIndex.drawer - 1,\n backgroundColor: scrim(theme, blur ? 0.6 : 0.5),\n backdropFilter: blur ? `blur(${rem(theme, 8)}) saturate(180%)` : 'none',\n WebkitBackdropFil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UAC9B,QAAQ,SAAS,IAAI;AAAA,UACrB,iBAAiB;AAAA,UACjB,WAAW,SAAS,cAAc;AAAA,UAClC,aAAa;AAAA,UACb,GAAG;AAAA,QACL;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,IAAM,mBAA+C;AAAA,EACnD,MAAM;AAAA,EACN,MAAM;AACR;AAEO,IAAM,eAA4C,CAAC,UAAU;AAClE,QAAM,EAAE,MAAM,SAAS,WAAW,OAAO,MAAM,SAAS,IAAI,aAAa,OAAO,gBAAgB;AAChG,QAAM,QAAQ,SAAS;AACvB,QAAM,UAAU,aAAa,QAAQ,IAAI;AAEzC,SACE,oBAAC,QAAK,IAAI,MAAM,SACd;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,QAAQ,IAAI;AAAA,MAClB,oBAAoB;AAAA,MACpB;AAAA,MACA;AAAA,MACA,IAAI;AAAA;AAAA;AAAA;AAAA,QAIF,QAAQ,MAAM,OAAO,SAAS;AAAA,QAC9B,iBAAiB,MAAM,OAAO,OAAO,MAAM,GAAG;AAAA,QAC9C,gBAAgB,OAAO,QAAQ,IAAI,OAAO,CAAC,CAAC,qBAAqB;AAAA,QACjE,sBAAsB,OAAO,QAAQ,IAAI,OAAO,CAAC,CAAC,qBAAqB;AAAA,QACvE,GAAG;AAAA,MACL;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/feedback/StackedModal/StackedModal.hooks.ts"],"sourcesContent":["import { useTheme } from '@mui/material/styles/index.js';\nimport useMediaQuery from '@mui/material/useMediaQuery/index.js';\nimport type { RefObject } from 'react';\nimport { useEffect, useRef, useState } from 'react';\nimport { useModalStack } from './modal-stack';\nimport type { ModalPanelRole } from './StackedModal.types';\n\nconst FOCUSABLE = 'a[href], button, textarea, input, select, [tabindex]:not([tabindex=\"-1\"])';\n/** MUI Dialog's own default, used when the modal isn't registered in the stack yet. */\nconst FALLBACK_Z_INDEX = 1300;\n/** Matches the panel's slide duration, so role swaps animate rather than jump. */\nconst ROLE_TRANSITION_MS = 300;\n\n/** Keeps Tab cycling inside the open panel instead of escaping to the page behind. */\nconst useFocusTrap = (\n ref: RefObject<HTMLElement | null>,\n isActive: boolean,\n disabled?: boolean,\n): void => {\n useEffect(() => {\n if (!isActive || disabled || !ref.current) return;\n\n const element = ref.current;\n const focusable = element.querySelectorAll(FOCUSABLE);\n const first = focusable[0] as HTMLElement | undefined;\n const last = focusable[focusable.length - 1] as HTMLElement | undefined;\n\n window.setTimeout(() => first?.focus(), 100);\n\n const handleTabKey = (e: globalThis.KeyboardEvent): void => {\n if (e.key !== 'Tab') return;\n const atEdge = e.shiftKey ? first : last;\n if (document.activeElement !== atEdge) return;\n e.preventDefault();\n (e.shiftKey ? last : first)?.focus();\n };\n\n element.addEventListener('keydown', handleTabKey);\n return () => element.removeEventListener('keydown', handleTabKey);\n }, [ref, isActive, disabled]);\n};\n\n/** Closes the panel on Escape — only while it is the top one. */\nconst useEscapeToClose = (active: boolean, onClose: () => void): void => {\n useEffect(() => {\n if (!active) return;\n\n const handleEsc = (e: globalThis.KeyboardEvent): void => {\n if (e.key !== 'Escape') return;\n e.preventDefault();\n onClose();\n };\n\n window.addEventListener('keydown', handleEsc);\n return () => window.removeEventListener('keydown', handleEsc);\n }, [active, onClose]);\n};\n\n/** Holds the skeleton a beat past `loading` so the swap to content isn't a flash. */\nconst useSkeleton = (loading: boolean): boolean => {\n const [showSkeleton, setShowSkeleton] = useState(loading);\n\n useEffect(() => {\n if (loading) {\n setShowSkeleton(true);\n return;\n }\n const timer = window.setTimeout(() => setShowSkeleton(false), 200);\n return () => window.clearTimeout(timer);\n }, [loading]);\n\n return showSkeleton;\n};\n\n/** Registers the modal in the stack while open, and unregisters it after it slides out. */\nconst useStackRegistration = (open: boolean, modalId: string): void => {\n const { pushModal, popModal, isModalInStack } = useModalStack();\n const hasRegisteredRef = useRef(false);\n\n useEffect(() => {\n if (open && !hasRegisteredRef.current) {\n pushModal(modalId);\n hasRegisteredRef.current = true;\n } else if (!open) {\n hasRegisteredRef.current = false;\n }\n }, [open, modalId, pushModal]);\n\n useEffect(() => {\n if (open || !isModalInStack(modalId)) return;\n const timer = window.setTimeout(() => popModal(modalId), ROLE_TRANSITION_MS);\n return () => window.clearTimeout(timer);\n }, [open, modalId, popModal, isModalInStack]);\n};\n\ninterface PanelChromeOptions {\n open?: boolean;\n modalId: string;\n loading?: boolean;\n closeOnEsc?: boolean;\n closeOnClickOutside?: boolean;\n disableFocusTrap?: boolean;\n onClose: () => void;\n}\n\ninterface PanelChrome {\n dialogRef: RefObject<HTMLDivElement | null>;\n modalRole: ModalPanelRole;\n isAnimating: boolean;\n showSkeleton: boolean;\n zIndex: number;\n isMobile: boolean;\n canGoBack: boolean;\n /**\n * This panel is the bottom of the stack. Read from ITS position, not from the\n * depth: once a child opens, the depth says \"can go back\" for every panel,\n * the receding root included.\n */\n isRoot: boolean;\n handleBack: () => void;\n handleClose: (event: object, reason: 'backdropClick' | 'escapeKeyDown') => void;\n}\n\n/**\n * Everything the panel needs to render itself: its place in the stack, the\n * viewport it is on, and the handlers that dismiss it. Bundled into one hook so\n * the component stays a description of the markup.\n */\nexport const usePanelChrome = (options: PanelChromeOptions): PanelChrome => {\n const { open, modalId, loading, closeOnEsc, closeOnClickOutside, disableFocusTrap, onClose } =\n options;\n\n const dialogRef = useRef<HTMLDivElement>(null);\n const { currentDepth, stack } = useModalStack();\n const { modalRole, isAnimating } = useModalRole(Boolean(open), modalId);\n const showSkeleton = useSkeleton(Boolean(loading));\n const zIndex = usePanelZIndex(modalId, FALLBACK_Z_INDEX);\n\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('sm'));\n const isPrimary = modalRole === 'primary';\n const canGoBack = currentDepth > 1;\n // Not yet pushed (its first render) and something already below it: NOT the\n // root — so a child never renders a frame without its back arrow.\n const isRoot = (stack[0]?.id ?? modalId) === modalId;\n\n useFocusTrap(dialogRef, Boolean(open) && isPrimary, disableFocusTrap);\n useEscapeToClose(Boolean(open && closeOnEsc) && isPrimary, onClose);\n\n const { handleBack, handleClose } = useCloseHandlers({\n isPrimary,\n closeOnClickOutside,\n closeOnEsc,\n canGoBack,\n onClose,\n });\n\n return {\n dialogRef,\n modalRole,\n isAnimating,\n showSkeleton,\n zIndex,\n isMobile,\n canGoBack,\n isRoot,\n handleBack,\n handleClose,\n };\n};\n\ninterface CloseHandlerOptions {\n /** Only the top panel responds to a backdrop click or Escape. */\n isPrimary: boolean;\n closeOnClickOutside?: boolean;\n closeOnEsc?: boolean;\n /** Deeper than one panel, so the leading control goes back rather than closing. */\n canGoBack: boolean;\n onClose: () => void;\n}\n\n/** The panel's dismissal handlers, honouring which gestures the caller allows. */\nconst useCloseHandlers = ({\n isPrimary,\n closeOnClickOutside,\n closeOnEsc,\n canGoBack,\n onClose,\n}: CloseHandlerOptions): {\n handleBack: () => void;\n handleClose: (event: object, reason: 'backdropClick' | 'escapeKeyDown') => void;\n} => ({\n handleBack: () => {\n if (canGoBack) onClose();\n },\n handleClose: (_event, reason) => {\n if (!isPrimary) return;\n if (reason === 'backdropClick' && !closeOnClickOutside) return;\n if (reason === 'escapeKeyDown' && !closeOnEsc) return;\n onClose();\n },\n});\n\n/** The z-index this panel was assigned when it joined the stack. */\nconst usePanelZIndex = (modalId: string, fallback: number): number => {\n const { stack } = useModalStack();\n return stack.find((m) => m.id === modalId)?.zIndex ?? fallback;\n};\n\n/**\n * This modal's role in the stack, plus whether it is mid-transition between two\n * roles (which drives the expand/contract animation).\n */\nconst useModalRole = (\n open: boolean,\n modalId: string,\n): { modalRole: ModalPanelRole; isAnimating: boolean } => {\n const { stack } = useModalStack();\n const [modalRole, setModalRole] = useState<ModalPanelRole>('primary');\n const [isAnimating, setIsAnimating] = useState(false);\n\n useStackRegistration(open, modalId);\n\n useEffect(() => {\n if (!open) return;\n\n const newRole = stack.find((m) => m.id === modalId)?.role;\n if (!newRole || newRole === modalRole) return;\n\n setIsAnimating(true);\n setModalRole(newRole);\n const timer = window.setTimeout(() => setIsAnimating(false), ROLE_TRANSITION_MS);\n return () => window.clearTimeout(timer);\n }, [stack, modalId, open, modalRole]);\n\n return { modalRole, isAnimating };\n};\n"],"mappings":";;;;;AAAA,SAAS,gBAAgB;AACzB,OAAO,mBAAmB;AAE1B,SAAS,WAAW,QAAQ,gBAAgB;AAI5C,IAAM,YAAY;AAElB,IAAM,mBAAmB;AAEzB,IAAM,qBAAqB;AAG3B,IAAM,eAAe,CACnB,KACA,UACA,aACS;AACT,YAAU,MAAM;AACd,QAAI,CAAC,YAAY,YAAY,CAAC,IAAI,QAAS;AAE3C,UAAM,UAAU,IAAI;AACpB,UAAM,YAAY,QAAQ,iBAAiB,SAAS;AACpD,UAAM,QAAQ,UAAU,CAAC;AACzB,UAAM,OAAO,UAAU,UAAU,SAAS,CAAC;AAE3C,WAAO,WAAW,MAAM,OAAO,MAAM,GAAG,GAAG;AAE3C,UAAM,eAAe,CAAC,MAAsC;AAC1D,UAAI,EAAE,QAAQ,MAAO;AACrB,YAAM,SAAS,EAAE,WAAW,QAAQ;AACpC,UAAI,SAAS,kBAAkB,OAAQ;AACvC,QAAE,eAAe;AACjB,OAAC,EAAE,WAAW,OAAO,QAAQ,MAAM;AAAA,IACrC;AAEA,YAAQ,iBAAiB,WAAW,YAAY;AAChD,WAAO,MAAM,QAAQ,oBAAoB,WAAW,YAAY;AAAA,EAClE,GAAG,CAAC,KAAK,UAAU,QAAQ,CAAC;AAC9B;AAGA,IAAM,mBAAmB,CAAC,QAAiB,YAA8B;AACvE,YAAU,MAAM;AACd,QAAI,CAAC,OAAQ;AAEb,UAAM,YAAY,CAAC,MAAsC;AACvD,UAAI,EAAE,QAAQ,SAAU;AACxB,QAAE,eAAe;AACjB,cAAQ;AAAA,IACV;AAEA,WAAO,iBAAiB,WAAW,SAAS;AAC5C,WAAO,MAAM,OAAO,oBAAoB,WAAW,SAAS;AAAA,EAC9D,GAAG,CAA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;AAEX,UAAM,UAAU,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,OAAO,GAAG;AACrD,QAAI,CAAC,WAAW,YAAY,UAAW;AAEvC,mBAAe,IAAI;AACnB,iBAAa,OAAO;AACpB,UAAM,QAAQ,OAAO,WAAW,MAAM,eAAe,KAAK,GAAG,kBAAkB;AAC/E,WAAO,MAAM,OAAO,aAAa,KAAK;AAAA,EACxC,GAAG,CAAC,OAAO,SAAS,MAAM,SAAS,CAAC;AAEpC,SAAO,EAAE,WAAW,YAAY;AAClC;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|