@12-apps/ui 6.97.1 → 6.98.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/components-catalog.md +1 -1
- package/dist/_internal/components/data-display/Alert/Alert.content.js +4 -2
- package/dist/_internal/components/data-display/Alert/Alert.ink.js +27 -0
- package/dist/_internal/components/data-display/Alert/Alert.js +5 -4
- package/dist/_internal/components/data-display/Alert/Alert.metrics.js +5 -1
- package/dist/_internal/components/data-display/Alert/Alert.styles.js +2 -2
- package/dist/_internal/components/data-display/AlertDialog/AlertDialog.js +3 -3
- package/dist/_internal/components/data-display/AlertDialog/AlertDialog.parts.js +2 -2
- package/dist/_internal/components/data-display/AsyncStateContainer/AsyncStateContainer.js +5 -5
- package/dist/_internal/components/data-display/Avatar/Avatar.js +5 -5
- package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
- package/dist/_internal/components/data-display/Banner/Banner.js +3 -3
- package/dist/_internal/components/data-display/Banner/Banner.styles.js +2 -2
- package/dist/_internal/components/data-display/CardKit/card-actions-context.js +7 -6
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +15 -14
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +8 -8
- package/dist/_internal/components/data-display/Carousel/Carousel.chrome.js +4 -4
- package/dist/_internal/components/data-display/Carousel/Carousel.js +6 -6
- package/dist/_internal/components/data-display/Carousel/Carousel.parts.js +3 -3
- package/dist/_internal/components/data-display/Chart/Chart.js +3 -3
- package/dist/_internal/components/data-display/Chart/SpecChart.js +7 -7
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +2 -2
- package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +51 -51
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +72 -71
- package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +3 -3
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +9 -9
- 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 +11 -11
- package/dist/_internal/components/data-display/DataViews/data-views-day-input.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +32 -32
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +48 -48
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +31 -31
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +29 -29
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +30 -30
- package/dist/_internal/components/data-display/DataViews/data-views-preset-chips.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-range-bounds.js +15 -15
- package/dist/_internal/components/data-display/DataViews/data-views-range-calendar.js +12 -12
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +18 -18
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +10 -10
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +22 -21
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +9 -9
- 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 +7 -7
- package/dist/_internal/components/data-display/DayRuler/DayRuler.parts.js +2 -2
- package/dist/_internal/components/data-display/EmptyState/EmptyState.js +2 -2
- package/dist/_internal/components/data-display/ErrorState/ErrorState.js +2 -2
- package/dist/_internal/components/data-display/FleetMap/FleetBody.js +10 -10
- package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +9 -9
- package/dist/_internal/components/data-display/FleetMap/FleetMap.fixtures.js +2 -2
- package/dist/_internal/components/data-display/FleetMap/FleetMap.js +12 -12
- package/dist/_internal/components/data-display/HoverCard/HoverCard.js +3 -3
- package/dist/_internal/components/data-display/LazyImage/LazyImage.js +2 -2
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +3 -3
- package/dist/_internal/components/data-display/LoadingState/LoadingState.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapControlBar.js +4 -4
- package/dist/_internal/components/data-display/MapPreview/MapLayers.js +6 -6
- package/dist/_internal/components/data-display/MapPreview/MapMarkers.js +4 -4
- package/dist/_internal/components/data-display/MapPreview/MapPreview.helpers.js +3 -3
- package/dist/_internal/components/data-display/MapPreview/MapPreview.js +8 -8
- package/dist/_internal/components/data-display/RegionMap/RegionMap.js +5 -5
- package/dist/_internal/components/data-display/RegionMap/RegionMapDrawing.js +2 -2
- package/dist/_internal/components/data-display/ScheduleGrid/ScheduleGrid.js +6 -6
- package/dist/_internal/components/data-display/ScheduleGrid/ScheduleGrid.labels.js +2 -2
- package/dist/_internal/components/data-display/SectionOnboarding/SectionOnboarding.js +4 -4
- package/dist/_internal/components/data-display/Sheet/Sheet.body.js +3 -3
- package/dist/_internal/components/data-display/Sheet/Sheet.hooks.js +2 -2
- package/dist/_internal/components/data-display/Sheet/Sheet.js +6 -6
- package/dist/_internal/components/data-display/Sheet/Sheet.parts.js +2 -2
- package/dist/_internal/components/data-display/Stepper/Stepper.js +2 -2
- package/dist/_internal/components/data-display/Table/Table.js +4 -4
- package/dist/_internal/components/data-display/Table/TableParts.hooks.js +2 -2
- package/dist/_internal/components/data-display/Table/TableParts.js +2 -2
- package/dist/_internal/components/data-display/Timeline/Timeline.js +2 -2
- package/dist/_internal/components/data-display/index.js +97 -93
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.js +5 -5
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.parts.js +4 -4
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +6 -6
- package/dist/_internal/components/feedback/ConfirmAction/with-confirmation.js +5 -5
- package/dist/_internal/components/feedback/Dialog/Dialog.js +2 -2
- package/dist/_internal/components/feedback/Modal/Modal.js +2 -2
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.js +6 -5
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.frame.js +3 -3
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.js +12 -11
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.overview.js +8 -7
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.parts.js +7 -6
- package/dist/_internal/components/feedback/Sonner/Sonner.js +2 -2
- package/dist/_internal/components/feedback/StackedModal/StackedModal.js +4 -4
- package/dist/_internal/components/feedback/StackedModal/StackedModal.parts.js +2 -2
- package/dist/_internal/components/feedback/Toast/Toast.js +2 -2
- package/dist/_internal/components/feedback/TutorialOverlay/TutorialOverlay.js +2 -2
- package/dist/_internal/components/feedback/UsableModal/UsableModal.js +1 -1
- package/dist/_internal/components/feedback/UsableModal/UsableModal.modal.js +4 -4
- package/dist/_internal/components/feedback/UsableModal/UsableModal.sheet.js +6 -6
- package/dist/_internal/components/feedback/index.js +30 -29
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.hooks.js +4 -4
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.js +7 -7
- package/dist/_internal/components/form/Autocomplete/Autocomplete.js +2 -2
- package/dist/_internal/components/form/Calendar/Calendar.band.js +1 -1
- package/dist/_internal/components/form/Calendar/Calendar.helpers.js +1 -1
- package/dist/_internal/components/form/Calendar/Calendar.hooks.js +1 -1
- package/dist/_internal/components/form/Calendar/Calendar.js +10 -10
- package/dist/_internal/components/form/Calendar/CalendarDay.js +2 -2
- package/dist/_internal/components/form/Calendar/CalendarDayCell.js +3 -3
- package/dist/_internal/components/form/Calendar/CalendarMonth.js +10 -6
- package/dist/_internal/components/form/Calendar/CalendarSelectorsMonth.js +6 -6
- package/dist/_internal/components/form/CategorySelect/CategoryPanel.js +2 -2
- package/dist/_internal/components/form/CategorySelect/CategorySelect.js +4 -4
- package/dist/_internal/components/form/CodeEditor/CodeEditor.js +3 -3
- package/dist/_internal/components/form/Command/Command.hooks.js +2 -2
- package/dist/_internal/components/form/Command/Command.js +4 -4
- package/dist/_internal/components/form/Command/Command.parts.js +2 -2
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.frame.js +22 -0
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.frame.js.map +1 -0
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.hooks.js +4 -4
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +20 -15
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.layout.js +13 -0
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.layout.js.map +1 -0
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.range.js +3 -3
- package/dist/_internal/components/form/DateRangePicker/DateRangePickerFields.js +4 -4
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.dom.js +2 -2
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.format.js +3 -3
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.hooks.js +4 -4
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.js +5 -5
- package/dist/_internal/components/form/index.js +37 -34
- package/dist/_internal/components/form/total-form/Fields/CategoryField.js +5 -5
- package/dist/_internal/components/form/total-form/Fields/index.js +6 -6
- package/dist/_internal/components/form/total-form/FormErrorSnackbar.js +3 -3
- package/dist/_internal/components/index.js +178 -172
- package/dist/_internal/components/layout/ContentToolbar/ColumnsMenu.js +2 -2
- package/dist/_internal/components/layout/ContentToolbar/FilterTrigger.js +3 -3
- package/dist/_internal/components/layout/ContentToolbar/MultiSelectDropdown.js +2 -2
- package/dist/_internal/components/layout/ContentToolbar/ViewSelector.js +2 -2
- package/dist/_internal/components/layout/Dashboard/Dashboard.js +2 -2
- package/dist/_internal/components/layout/Drawer/Drawer.js +2 -2
- package/dist/_internal/components/layout/SettingsLayout/SettingsLayout.js +2 -2
- package/dist/_internal/components/layout/TableFilter/TableFilter.js +2 -2
- package/dist/_internal/components/layout/index.js +9 -9
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +8 -8
- package/dist/_internal/components/navigation/AppHeader/AppHeader.identity.js +2 -2
- package/dist/_internal/components/navigation/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/_internal/components/navigation/NavigationMenu/NavigationMenu.js +3 -3
- package/dist/_internal/components/navigation/NavigationMenu/NavigationStandardBody.js +2 -2
- package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +4 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.js +5 -5
- package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +3 -3
- package/dist/_internal/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/_internal/components/navigation/index.js +18 -18
- package/dist/_internal/components/typography/Code/Code.js +2 -2
- package/dist/_internal/components/typography/index.js +2 -2
- package/dist/_internal/components/utility/AnimatedIcon/AnimatedIcon.js +2 -2
- package/dist/_internal/components/utility/InfiniteScroll/InfiniteScroll.js +3 -3
- package/dist/_internal/components/utility/InfiniteScroll/InfiniteScroll.parts.js +2 -2
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.helpers.js +2 -2
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.js +5 -5
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.parts.js +3 -3
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStepRow.js +4 -4
- package/dist/_internal/components/utility/index.js +8 -8
- package/dist/_internal/en-US.data-display.js +2 -2
- package/dist/_internal/en-US.labels.js +1 -1
- package/dist/_internal/pt-BR.data-display.js +2 -2
- package/dist/_internal/pt-BR.labels.js +1 -1
- package/dist/_internal/social-login-button/social-login-button.js +2 -2
- package/dist/_internal/user-avatar/user-avatar.js +6 -6
- package/dist/charts.js +17 -17
- package/dist/{chunk-UBVKMM3V.js → chunk-2A5GHOL3.js} +2 -2
- package/dist/{chunk-QIP37Y2C.js → chunk-2RC6EAGD.js} +2 -2
- package/dist/{chunk-YGLAGY74.js → chunk-332KWE5H.js} +2 -2
- package/dist/{chunk-HNEZWVDR.js → chunk-364NT46L.js} +3 -3
- package/dist/{chunk-RLTGD5WJ.js → chunk-3AKQHYTM.js} +4 -4
- package/dist/{chunk-5I75WRXT.js → chunk-3CXRHRGE.js} +7 -7
- package/dist/{chunk-G6NMSBSQ.js → chunk-3LD42RNV.js} +2 -2
- package/dist/{chunk-3BMG6VMB.js → chunk-3N2HWNKT.js} +2 -2
- package/dist/{chunk-MSJP2AEN.js → chunk-3N3W4TID.js} +2 -2
- package/dist/{chunk-H2UUMZQR.js → chunk-3PWDVJWD.js} +2 -1
- package/dist/chunk-3PWDVJWD.js.map +1 -0
- package/dist/{chunk-ZBUMGMWP.js → chunk-3R5MCSYO.js} +6 -6
- package/dist/{chunk-YNVTUQ5B.js → chunk-3V7OTBUZ.js} +2 -2
- package/dist/{chunk-LZNUBQ5I.js → chunk-4A454JZN.js} +2 -2
- package/dist/{chunk-TPMT3J32.js → chunk-4I2SDWSF.js} +2 -1
- package/dist/chunk-4I2SDWSF.js.map +1 -0
- package/dist/{chunk-RCTHCXS6.js → chunk-4N4M237A.js} +2 -2
- package/dist/{chunk-SW7JCF4Z.js → chunk-4P63RSSY.js} +2 -2
- package/dist/{chunk-7QKFMMWK.js → chunk-4W4C4Q46.js} +2 -2
- package/dist/{chunk-B32XH7NK.js → chunk-4WVUX7IU.js} +3 -3
- package/dist/{chunk-Z6QFIRD7.js → chunk-4X2TOMK6.js} +7 -7
- package/dist/{chunk-MYTV353T.js → chunk-4Y3QLISA.js} +2 -2
- package/dist/{chunk-IMYKJTVX.js → chunk-5J6LN2O7.js} +2 -2
- package/dist/{chunk-QWI7IPYJ.js → chunk-5V7IZBRY.js} +4 -4
- package/dist/{chunk-Y7BOP7VZ.js → chunk-67GTAPK6.js} +3 -3
- package/dist/{chunk-T77OVQEO.js → chunk-6D7CASMK.js} +2 -2
- package/dist/{chunk-YNZUYZ2O.js → chunk-6FGP7RMV.js} +2 -2
- package/dist/{chunk-YVDNCV2D.js → chunk-6RYSSNOO.js} +3 -3
- package/dist/{chunk-CPQJFHNZ.js → chunk-74IH3ZGD.js} +2 -2
- package/dist/{chunk-UQ5GJPVZ.js → chunk-76GAXLNC.js} +3 -3
- package/dist/{chunk-X4J576GR.js → chunk-7LFST3PW.js} +2 -2
- package/dist/{chunk-XCUHGPPZ.js → chunk-7MLT66DE.js} +2 -2
- package/dist/{chunk-EOIRU62W.js → chunk-7P544IWT.js} +3 -3
- package/dist/{chunk-XTYBJAZG.js → chunk-7TENMQNQ.js} +7 -7
- package/dist/{chunk-EB25XITI.js → chunk-A27J4CIZ.js} +10 -10
- package/dist/{chunk-2KSFBZ2H.js → chunk-ABZJNKR6.js} +2 -2
- package/dist/{chunk-GTE4TW3W.js → chunk-AESKKFA5.js} +6 -6
- package/dist/chunk-AG4F6NVT.js +1 -0
- package/dist/chunk-AG4F6NVT.js.map +1 -0
- package/dist/{chunk-6LOWZCH7.js → chunk-AHXQN4VL.js} +2 -2
- package/dist/{chunk-U2SAW6DH.js → chunk-B4OZU7J4.js} +7 -7
- package/dist/{chunk-DDGYTY4E.js → chunk-BIHZXB5P.js} +4 -4
- package/dist/{chunk-4QGMUHAU.js → chunk-BWNZVMBT.js} +2 -2
- package/dist/{chunk-CY4XIZNW.js → chunk-CAH5XNHT.js} +2 -2
- package/dist/{chunk-KILA7LCC.js → chunk-CFDWKQZT.js} +4 -4
- package/dist/{chunk-USHVG4UQ.js → chunk-CGLMWS7K.js} +4 -4
- package/dist/{chunk-EWFBDAB7.js → chunk-CKGRSCRT.js} +2 -2
- package/dist/{chunk-YOLLISEY.js → chunk-CRD2WCU7.js} +9 -9
- package/dist/{chunk-L5KPBMMF.js → chunk-CXL3TT3K.js} +2 -2
- package/dist/{chunk-KOGJBAFI.js → chunk-D3KLIC5N.js} +2 -2
- package/dist/{chunk-2SBQ47RI.js → chunk-D4JL5725.js} +3 -3
- package/dist/{chunk-NI3MC742.js → chunk-DBJLYURK.js} +2 -2
- package/dist/{chunk-75GAQL2Q.js → chunk-DKPELKGL.js} +12 -12
- package/dist/{chunk-NGXL4R54.js → chunk-E4MJA52O.js} +4 -4
- package/dist/{chunk-QSOCOXVL.js → chunk-EASEJDBQ.js} +13 -8
- package/dist/chunk-EASEJDBQ.js.map +1 -0
- package/dist/{chunk-5HXVXW22.js → chunk-EGBQR5GH.js} +5 -5
- package/dist/{chunk-FTYOCFTV.js → chunk-EGYJUJMR.js} +2 -2
- package/dist/{chunk-7XSCEHGA.js → chunk-EOQ6EKTS.js} +7 -7
- package/dist/{chunk-6AKDAQSS.js → chunk-ERAMSYPR.js} +2 -2
- package/dist/{chunk-WYRH6OSN.js → chunk-F5EH5BJN.js} +2 -2
- package/dist/{chunk-HBRBIPNF.js → chunk-F7JRQ2EI.js} +6 -6
- package/dist/chunk-F7JRQ2EI.js.map +1 -0
- package/dist/{chunk-QCYQL3ST.js → chunk-FJLPVPRG.js} +2 -2
- package/dist/{chunk-MAHY7PK3.js → chunk-FQMLTCXT.js} +4 -4
- package/dist/{chunk-TMINUTQQ.js → chunk-FRQGZIYU.js} +2 -2
- package/dist/{chunk-LV6AD6XC.js → chunk-FT3LJZWZ.js} +2 -2
- package/dist/{chunk-IS3L67TF.js → chunk-FW5GTAUY.js} +6 -6
- package/dist/{chunk-VMTOLAZ5.js → chunk-FZZMNKVF.js} +5 -5
- package/dist/{chunk-FGZIEZEP.js → chunk-G6TKWNF2.js} +4 -4
- package/dist/{chunk-I6IFUFLW.js → chunk-G7MHDZTL.js} +2 -2
- package/dist/{chunk-KES3HNSU.js → chunk-GB2DQOZ7.js} +2 -2
- package/dist/{chunk-7HZ36QDH.js → chunk-GDWU7WF4.js} +9 -3
- package/dist/chunk-GDWU7WF4.js.map +1 -0
- package/dist/{chunk-W3IFJA35.js → chunk-GFYDOH7D.js} +3 -3
- package/dist/{chunk-M2M4IDFU.js → chunk-GXYOBTOY.js} +2 -2
- package/dist/{chunk-OLHAUGVQ.js → chunk-GZQQSTKR.js} +2 -2
- package/dist/{chunk-N2J24TJ3.js → chunk-HAWOS4SF.js} +2 -2
- package/dist/{chunk-S2VZUBM7.js → chunk-HCTHY66U.js} +6 -6
- package/dist/{chunk-ABVIMFSD.js → chunk-HG52QQ2L.js} +2 -2
- package/dist/{chunk-AMLHEKSV.js → chunk-HI7JPDD6.js} +5 -5
- package/dist/{chunk-F5OERPU4.js → chunk-HOWAMSUY.js} +6 -6
- package/dist/{chunk-3TZUZXY5.js → chunk-HTXYBKLK.js} +2 -2
- package/dist/{chunk-WW3F7DCX.js → chunk-IFOHCY4O.js} +2 -2
- package/dist/{chunk-S46LGAQ2.js → chunk-IJVBLU25.js} +2 -2
- package/dist/{chunk-ARGVUTTL.js → chunk-IPVGWENM.js} +2 -2
- package/dist/{chunk-MPWA55CF.js → chunk-IXXB7CTR.js} +9 -5
- package/dist/chunk-IXXB7CTR.js.map +1 -0
- package/dist/{chunk-MWXZXCVX.js → chunk-J43PARXM.js} +6 -6
- package/dist/{chunk-UYKIUUWP.js → chunk-JJTJ7DCV.js} +2 -2
- package/dist/{chunk-HQCZT6TO.js → chunk-JVOEVTCZ.js} +5 -5
- package/dist/{chunk-RZ3P4X2I.js → chunk-K62L5JFC.js} +25 -4
- package/dist/chunk-K62L5JFC.js.map +1 -0
- package/dist/{chunk-2365CQJU.js → chunk-KAQDWEG6.js} +2 -2
- package/dist/{chunk-TB5CRHTF.js → chunk-KEPLO2AB.js} +2 -2
- package/dist/chunk-KNW63H63.js +263 -0
- package/dist/chunk-KNW63H63.js.map +1 -0
- package/dist/{chunk-PVIQDBUN.js → chunk-KUQ4XHVV.js} +2 -2
- package/dist/{chunk-DAFFZED3.js → chunk-KWBMM6MJ.js} +2 -2
- package/dist/{chunk-QPCHABOZ.js → chunk-L5YGVLPH.js} +8 -4
- package/dist/chunk-L5YGVLPH.js.map +1 -0
- package/dist/{chunk-JJYECKEL.js → chunk-LFECE4R7.js} +2 -2
- package/dist/{chunk-LXIPBHNJ.js → chunk-LKTJ26ST.js} +2 -2
- package/dist/chunk-LNZJJFZQ.js +41 -0
- package/dist/chunk-LNZJJFZQ.js.map +1 -0
- package/dist/{chunk-56JF5PZK.js → chunk-LYVTJLCF.js} +4 -4
- package/dist/{chunk-EYFDIUVR.js → chunk-M4G4LRQK.js} +2 -2
- package/dist/{chunk-TJUWSQYQ.js → chunk-MDU5Q2HW.js} +3 -2
- package/dist/{chunk-TJUWSQYQ.js.map → chunk-MDU5Q2HW.js.map} +1 -1
- package/dist/{chunk-KMMFN24G.js → chunk-MKHNLRVX.js} +4 -4
- package/dist/{chunk-4IG73U2X.js → chunk-MSPLIRBH.js} +2 -2
- package/dist/{chunk-55MYYWOV.js → chunk-O4UXH7BM.js} +7 -7
- package/dist/{chunk-DYHOBKPU.js → chunk-OA6T2ME3.js} +5 -5
- package/dist/{chunk-VNMD6BA4.js → chunk-OFRQMFWD.js} +3 -3
- package/dist/{chunk-LTJC7TGB.js → chunk-OHA2PAAA.js} +2 -2
- package/dist/{chunk-6D5AMANO.js → chunk-OV5NM4FY.js} +2 -2
- package/dist/{chunk-ZANWHTXH.js → chunk-OVJV2ZN7.js} +2 -2
- package/dist/{chunk-SKQPUAMK.js → chunk-PDWQJFMK.js} +6 -6
- package/dist/{chunk-6EZQLNPK.js → chunk-PGJIWCQR.js} +4 -4
- package/dist/{chunk-FRAFGRRD.js → chunk-PIELY4BJ.js} +1 -1
- package/dist/{chunk-BQBEN44R.js → chunk-PNAKRHRT.js} +2 -2
- package/dist/{chunk-3Z6JX7UN.js → chunk-PZJEF232.js} +2 -2
- package/dist/{chunk-6ATXOJVQ.js → chunk-QADTI63U.js} +4 -4
- package/dist/chunk-QAF76E6U.js +43 -0
- package/dist/chunk-QAF76E6U.js.map +1 -0
- package/dist/{chunk-4RF4BALN.js → chunk-R775ISK6.js} +4 -4
- package/dist/{chunk-YBAK2WN5.js → chunk-RFMQBIE6.js} +4 -4
- package/dist/{chunk-NQCTANF3.js → chunk-RKAX37F4.js} +14 -7
- package/dist/chunk-RKAX37F4.js.map +1 -0
- package/dist/{chunk-43EFQ3DU.js → chunk-RVBLOR32.js} +2 -2
- package/dist/{chunk-XNAI7QGU.js → chunk-SA3KLZDZ.js} +5 -5
- package/dist/{chunk-CAOL4AIB.js → chunk-SARK3GHS.js} +2 -2
- package/dist/chunk-SIY64A6O.js +60 -0
- package/dist/chunk-SIY64A6O.js.map +1 -0
- package/dist/{chunk-CQOJUYTT.js → chunk-SOXO2VN3.js} +3 -3
- package/dist/{chunk-Z4ZFJ565.js → chunk-SRAIV6U6.js} +3 -3
- package/dist/{chunk-5ZY3IIIG.js → chunk-TBQR5VCN.js} +11 -1
- package/dist/chunk-TBQR5VCN.js.map +1 -0
- package/dist/{chunk-6PU5P7QT.js → chunk-TDXEWGY2.js} +2 -2
- package/dist/{chunk-SB2SEGR6.js → chunk-TIM4PXWN.js} +3 -3
- package/dist/{chunk-OGSTMHT6.js → chunk-TTBLQZVT.js} +3 -3
- package/dist/{chunk-VHE7UEG5.js → chunk-UC7DLGMP.js} +2 -2
- package/dist/{chunk-TI4FGQYV.js → chunk-UHLGJHTD.js} +2 -2
- package/dist/{chunk-TAHO2LCU.js → chunk-UIZIEU4X.js} +3 -3
- package/dist/{chunk-F7LBTMCA.js → chunk-ULC4SCFC.js} +2 -2
- package/dist/{chunk-FORQEHRQ.js → chunk-UXVWGNPG.js} +2 -2
- package/dist/{chunk-3ZRK3BRN.js → chunk-UXYCBPCE.js} +12 -6
- package/dist/chunk-UXYCBPCE.js.map +1 -0
- package/dist/{chunk-L6YTVXGN.js → chunk-VCYYL23C.js} +4 -2
- package/dist/{chunk-L6YTVXGN.js.map → chunk-VCYYL23C.js.map} +1 -1
- package/dist/{chunk-KF3Q3C3P.js → chunk-VGIBWJ72.js} +2 -2
- package/dist/{chunk-I54YFYBS.js → chunk-VMACQT3T.js} +3 -3
- package/dist/{chunk-XOXXG7Q5.js → chunk-VWKMN3ZZ.js} +3 -2
- package/dist/{chunk-XOXXG7Q5.js.map → chunk-VWKMN3ZZ.js.map} +1 -1
- package/dist/{chunk-EXEBN5ZP.js → chunk-W56KN53D.js} +8 -8
- package/dist/{chunk-KURE5R7Z.js → chunk-WGK7VNCO.js} +2 -2
- package/dist/{chunk-UIS3E72B.js → chunk-WK577LQL.js} +3 -3
- package/dist/{chunk-G3WG77QY.js → chunk-WN6LR4HX.js} +21 -6
- package/dist/chunk-WN6LR4HX.js.map +1 -0
- package/dist/{chunk-LLPPIO3K.js → chunk-WNTXHLVJ.js} +2 -2
- package/dist/{chunk-PEVBSNCD.js → chunk-WPRQPKLV.js} +2 -2
- package/dist/{chunk-C347NNZJ.js → chunk-WVCHMTPG.js} +2 -2
- package/dist/{chunk-CSD6SWBZ.js → chunk-WYNGH2WL.js} +6 -6
- package/dist/{chunk-4L54KUZV.js → chunk-X5GCAXZS.js} +38 -16
- package/dist/chunk-X5GCAXZS.js.map +1 -0
- package/dist/{chunk-PJDAZG65.js → chunk-XA5ES25V.js} +3 -3
- package/dist/{chunk-L5RS6QAT.js → chunk-YBF2WUGQ.js} +2 -2
- package/dist/{chunk-FWTVIRZZ.js → chunk-YLZXIR6B.js} +4 -4
- package/dist/{chunk-STOZ6JB5.js → chunk-YQMJJ7AL.js} +33 -16
- package/dist/chunk-YQMJJ7AL.js.map +1 -0
- package/dist/{chunk-JOQGKXR5.js → chunk-Z2J4MRTF.js} +4 -4
- package/dist/{chunk-I4K5JMS4.js → chunk-ZDLC4BN4.js} +4 -2
- package/dist/chunk-ZDLC4BN4.js.map +1 -0
- package/dist/{chunk-TE6HAWDM.js → chunk-ZP2GPRNQ.js} +2 -2
- package/dist/{chunk-3PQL2EN5.js → chunk-ZW7Q3IRL.js} +6 -6
- package/dist/{chunk-M5Y42AZ4.js → chunk-ZX4ORMBC.js} +2 -2
- package/dist/data-display/Alert.js +9 -5
- package/dist/data-display/AlertDialog.js +3 -3
- package/dist/data-display/AsyncStateContainer.js +5 -5
- package/dist/data-display/Avatar.js +5 -5
- package/dist/data-display/Banner.js +3 -3
- package/dist/data-display/CardKit.js +19 -18
- package/dist/data-display/Carousel.js +6 -6
- package/dist/data-display/Chart.js +17 -17
- package/dist/data-display/DataGrid.js +2 -2
- package/dist/data-display/DataViews.js +78 -77
- package/dist/data-display/DayRuler.js +11 -11
- package/dist/data-display/EmptyState.js +2 -2
- package/dist/data-display/ErrorState.js +2 -2
- package/dist/data-display/FleetMap.js +12 -12
- package/dist/data-display/HoverCard.js +3 -3
- package/dist/data-display/LazyImage.js +2 -2
- package/dist/data-display/Lightbox.js +3 -3
- package/dist/data-display/LoadingState.js +2 -2
- package/dist/data-display/MapPreview.js +8 -8
- package/dist/data-display/RegionMap.js +5 -5
- package/dist/data-display/ScheduleGrid.js +10 -10
- package/dist/data-display/SectionOnboarding.js +4 -4
- package/dist/data-display/Sheet.js +6 -6
- package/dist/data-display/Stepper.js +2 -2
- package/dist/data-display/Table.js +4 -4
- package/dist/data-display/Timeline.js +2 -2
- package/dist/en-US.js +2 -2
- package/dist/feedback/ConfirmAction.js +9 -9
- package/dist/feedback/Dialog.js +2 -2
- package/dist/feedback/Modal.js +2 -2
- package/dist/feedback/NotificationStatusNotice.js +6 -5
- package/dist/feedback/SequenceResolver.js +12 -11
- package/dist/feedback/Sonner.js +2 -2
- package/dist/feedback/StackedModal.js +4 -4
- package/dist/feedback/Toast.js +2 -2
- package/dist/feedback/TutorialOverlay.js +2 -2
- package/dist/feedback/UsableModal.js +1 -1
- package/dist/form/AddressAutocomplete.js +7 -7
- package/dist/form/Autocomplete.js +2 -2
- package/dist/form/Calendar.js +10 -10
- package/dist/form/CategorySelect.js +4 -4
- package/dist/form/CodeEditor.js +3 -3
- package/dist/form/Command.js +4 -4
- package/dist/form/DateRangePicker.js +20 -15
- package/dist/form/RichTextEditor.js +5 -5
- package/dist/form/total-form.js +9 -9
- package/dist/layout/ContentToolbar.js +6 -6
- package/dist/layout/Dashboard.js +2 -2
- package/dist/layout/Drawer.js +2 -2
- package/dist/layout/SettingsLayout.js +2 -2
- package/dist/layout/TableFilter.js +2 -2
- package/dist/locales.js +4 -4
- package/dist/native/chunks/{chunk-QHW7JEPZ.js → chunk-O76COY56.js} +3 -2
- package/dist/native/chunks/{chunk-QHW7JEPZ.js.map → chunk-O76COY56.js.map} +1 -1
- package/dist/native/chunks/{chunk-FXA5DLKR.js → chunk-UQ272RI2.js} +3 -3
- package/dist/native/chunks/{chunk-IN3XZ7EK.js → chunk-X65TVC3B.js} +2 -2
- package/dist/native/data-display/Alert.js +10 -0
- package/dist/native/data-display/Alert.js.map +1 -1
- package/dist/native/data-display/Avatar.js +1 -1
- package/dist/native/data-display/Badge.js +1 -1
- package/dist/native/data-display/Chip.js +1 -1
- package/dist/native/data-display/EmptyState.js +3 -3
- package/dist/native/data-display/ErrorState.js +2 -2
- package/dist/native/data-display/FleetMap.js +3 -3
- package/dist/native/data-display/LoadingState.js +1 -1
- package/dist/native/feedback/Dialog.js +1 -1
- package/dist/native/form/Button.js +2 -2
- package/dist/native/form/Checkbox.js +1 -1
- package/dist/native/form/Input.js +1 -1
- package/dist/native/form/Switch.js +1 -1
- package/dist/navigation/AppHeader.js +10 -10
- package/dist/navigation/Breadcrumbs.js +2 -2
- package/dist/navigation/NavigationMenu.js +3 -3
- package/dist/navigation/SectionNav.js +5 -5
- package/dist/navigation/Tabs.js +1 -1
- package/dist/pt-BR.js +2 -2
- package/dist/social-login-button.js +2 -2
- package/dist/types/components/data-display/Alert/Alert.content.d.ts.map +1 -1
- package/dist/types/components/data-display/Alert/Alert.d.ts.map +1 -1
- package/dist/types/components/data-display/Alert/Alert.ink.d.ts +65 -0
- package/dist/types/components/data-display/Alert/Alert.ink.d.ts.map +1 -0
- package/dist/types/components/data-display/Alert/Alert.metrics.d.ts +73 -5
- package/dist/types/components/data-display/Alert/Alert.metrics.d.ts.map +1 -1
- package/dist/types/components/data-display/Alert/index.d.ts +1 -0
- package/dist/types/components/data-display/Alert/index.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-day-input.d.ts +3 -1
- package/dist/types/components/data-display/DataViews/data-views-day-input.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/Calendar.band.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/Calendar.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/Calendar.helpers.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/Calendar.hooks.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/Calendar.types.d.ts +24 -1
- package/dist/types/components/form/Calendar/Calendar.types.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/CalendarDay.d.ts +6 -0
- package/dist/types/components/form/Calendar/CalendarDay.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/CalendarDayCell.d.ts +11 -1
- package/dist/types/components/form/Calendar/CalendarDayCell.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/CalendarMonth.d.ts +22 -0
- package/dist/types/components/form/Calendar/CalendarMonth.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/index.d.ts +1 -1
- package/dist/types/components/form/Calendar/index.d.ts.map +1 -1
- package/dist/types/components/form/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/types/components/form/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/types/components/form/DateRangePicker/DateRangePicker.frame.d.ts +93 -0
- package/dist/types/components/form/DateRangePicker/DateRangePicker.frame.d.ts.map +1 -0
- package/dist/types/components/form/DateRangePicker/DateRangePicker.hooks.d.ts +1 -1
- package/dist/types/components/form/DateRangePicker/DateRangePicker.hooks.d.ts.map +1 -1
- package/dist/types/components/form/DateRangePicker/DateRangePicker.layout.d.ts +27 -0
- package/dist/types/components/form/DateRangePicker/DateRangePicker.layout.d.ts.map +1 -0
- package/dist/types/components/form/DateRangePicker/DateRangePicker.range.d.ts +8 -2
- package/dist/types/components/form/DateRangePicker/DateRangePicker.range.d.ts.map +1 -1
- package/dist/types/components/form/DateRangePicker/DateRangePicker.types.d.ts +90 -1
- package/dist/types/components/form/DateRangePicker/DateRangePicker.types.d.ts.map +1 -1
- package/dist/types/components/form/DateRangePicker/DateRangePickerFields.d.ts +7 -1
- package/dist/types/components/form/DateRangePicker/DateRangePickerFields.d.ts.map +1 -1
- package/dist/types/components/navigation/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/components/navigation/Tabs/Tabs.types.d.ts +18 -3
- package/dist/types/components/navigation/Tabs/Tabs.types.d.ts.map +1 -1
- package/dist/types/copy/labels.d.ts +6 -0
- package/dist/types/copy/labels.d.ts.map +1 -1
- package/dist/types/en-US.labels.d.ts.map +1 -1
- package/dist/types/pt-BR.labels.d.ts.map +1 -1
- package/dist/types-native/components/data-display/Alert/Alert.metrics.d.ts +73 -5
- package/dist/types-native/components/data-display/Alert/Alert.metrics.d.ts.map +1 -1
- package/dist/types-native/copy/labels.d.ts +6 -0
- package/dist/types-native/copy/labels.d.ts.map +1 -1
- package/dist/types-native/en-US.labels.d.ts.map +1 -1
- package/dist/typography/Code.js +2 -2
- package/dist/user-avatar.js +6 -6
- package/dist/utility/AnimatedIcon.js +2 -2
- package/dist/utility/InfiniteScroll.js +3 -3
- package/dist/utility/WorkflowStep.js +5 -5
- package/package.json +1 -1
- package/src/components/data-display/Alert/Alert.content.tsx +16 -1
- package/src/components/data-display/Alert/Alert.ink.ts +106 -0
- package/src/components/data-display/Alert/Alert.md +40 -0
- package/src/components/data-display/Alert/Alert.metrics.ts +57 -5
- package/src/components/data-display/Alert/Alert.tsx +18 -7
- package/src/components/data-display/Alert/index.ts +1 -0
- package/src/components/data-display/DataViews/data-views-day-input.tsx +4 -0
- package/src/components/form/Calendar/Calendar.band.ts +3 -0
- package/src/components/form/Calendar/Calendar.helpers.ts +2 -0
- package/src/components/form/Calendar/Calendar.hooks.ts +4 -2
- package/src/components/form/Calendar/Calendar.md +12 -1
- package/src/components/form/Calendar/Calendar.tsx +30 -10
- package/src/components/form/Calendar/Calendar.types.ts +27 -1
- package/src/components/form/Calendar/CalendarDay.tsx +85 -13
- package/src/components/form/Calendar/CalendarDayCell.tsx +17 -1
- package/src/components/form/Calendar/CalendarMonth.tsx +40 -4
- package/src/components/form/Calendar/CalendarSelectorsMonth.tsx +2 -2
- package/src/components/form/Calendar/index.ts +1 -0
- package/src/components/form/DateRangePicker/DateRangePicker.frame.ts +92 -0
- package/src/components/form/DateRangePicker/DateRangePicker.hooks.ts +43 -1
- package/src/components/form/DateRangePicker/DateRangePicker.layout.ts +69 -0
- package/src/components/form/DateRangePicker/DateRangePicker.md +77 -2
- package/src/components/form/DateRangePicker/DateRangePicker.range.ts +10 -2
- package/src/components/form/DateRangePicker/DateRangePicker.tsx +177 -57
- package/src/components/form/DateRangePicker/DateRangePicker.types.ts +88 -1
- package/src/components/form/DateRangePicker/DateRangePickerFields.tsx +13 -2
- package/src/components/navigation/Tabs/Tabs.md +22 -1
- package/src/components/navigation/Tabs/Tabs.tsx +25 -9
- package/src/components/navigation/Tabs/Tabs.types.ts +18 -2
- package/src/copy/labels.ts +6 -0
- package/src/en-US.labels.ts +1 -0
- package/src/pt-BR.labels.ts +1 -0
- package/dist/chunk-3CSKB57B.js +0 -184
- package/dist/chunk-3CSKB57B.js.map +0 -1
- package/dist/chunk-3ZRK3BRN.js.map +0 -1
- package/dist/chunk-4L54KUZV.js.map +0 -1
- package/dist/chunk-5ZY3IIIG.js.map +0 -1
- package/dist/chunk-7HZ36QDH.js.map +0 -1
- package/dist/chunk-G3WG77QY.js.map +0 -1
- package/dist/chunk-H2UUMZQR.js.map +0 -1
- package/dist/chunk-HBRBIPNF.js.map +0 -1
- package/dist/chunk-I4K5JMS4.js.map +0 -1
- package/dist/chunk-MPWA55CF.js.map +0 -1
- package/dist/chunk-NQCTANF3.js.map +0 -1
- package/dist/chunk-NUGT7LMR.js +0 -1
- package/dist/chunk-QPCHABOZ.js.map +0 -1
- package/dist/chunk-QSOCOXVL.js.map +0 -1
- package/dist/chunk-RZ3P4X2I.js.map +0 -1
- package/dist/chunk-STOZ6JB5.js.map +0 -1
- package/dist/chunk-TPMT3J32.js.map +0 -1
- /package/dist/{chunk-NUGT7LMR.js.map → _internal/components/data-display/Alert/Alert.ink.js.map} +0 -0
- /package/dist/{chunk-UBVKMM3V.js.map → chunk-2A5GHOL3.js.map} +0 -0
- /package/dist/{chunk-QIP37Y2C.js.map → chunk-2RC6EAGD.js.map} +0 -0
- /package/dist/{chunk-YGLAGY74.js.map → chunk-332KWE5H.js.map} +0 -0
- /package/dist/{chunk-HNEZWVDR.js.map → chunk-364NT46L.js.map} +0 -0
- /package/dist/{chunk-RLTGD5WJ.js.map → chunk-3AKQHYTM.js.map} +0 -0
- /package/dist/{chunk-5I75WRXT.js.map → chunk-3CXRHRGE.js.map} +0 -0
- /package/dist/{chunk-G6NMSBSQ.js.map → chunk-3LD42RNV.js.map} +0 -0
- /package/dist/{chunk-3BMG6VMB.js.map → chunk-3N2HWNKT.js.map} +0 -0
- /package/dist/{chunk-MSJP2AEN.js.map → chunk-3N3W4TID.js.map} +0 -0
- /package/dist/{chunk-ZBUMGMWP.js.map → chunk-3R5MCSYO.js.map} +0 -0
- /package/dist/{chunk-YNVTUQ5B.js.map → chunk-3V7OTBUZ.js.map} +0 -0
- /package/dist/{chunk-LZNUBQ5I.js.map → chunk-4A454JZN.js.map} +0 -0
- /package/dist/{chunk-RCTHCXS6.js.map → chunk-4N4M237A.js.map} +0 -0
- /package/dist/{chunk-SW7JCF4Z.js.map → chunk-4P63RSSY.js.map} +0 -0
- /package/dist/{chunk-7QKFMMWK.js.map → chunk-4W4C4Q46.js.map} +0 -0
- /package/dist/{chunk-B32XH7NK.js.map → chunk-4WVUX7IU.js.map} +0 -0
- /package/dist/{chunk-Z6QFIRD7.js.map → chunk-4X2TOMK6.js.map} +0 -0
- /package/dist/{chunk-MYTV353T.js.map → chunk-4Y3QLISA.js.map} +0 -0
- /package/dist/{chunk-IMYKJTVX.js.map → chunk-5J6LN2O7.js.map} +0 -0
- /package/dist/{chunk-QWI7IPYJ.js.map → chunk-5V7IZBRY.js.map} +0 -0
- /package/dist/{chunk-Y7BOP7VZ.js.map → chunk-67GTAPK6.js.map} +0 -0
- /package/dist/{chunk-T77OVQEO.js.map → chunk-6D7CASMK.js.map} +0 -0
- /package/dist/{chunk-YNZUYZ2O.js.map → chunk-6FGP7RMV.js.map} +0 -0
- /package/dist/{chunk-YVDNCV2D.js.map → chunk-6RYSSNOO.js.map} +0 -0
- /package/dist/{chunk-CPQJFHNZ.js.map → chunk-74IH3ZGD.js.map} +0 -0
- /package/dist/{chunk-UQ5GJPVZ.js.map → chunk-76GAXLNC.js.map} +0 -0
- /package/dist/{chunk-X4J576GR.js.map → chunk-7LFST3PW.js.map} +0 -0
- /package/dist/{chunk-XCUHGPPZ.js.map → chunk-7MLT66DE.js.map} +0 -0
- /package/dist/{chunk-EOIRU62W.js.map → chunk-7P544IWT.js.map} +0 -0
- /package/dist/{chunk-XTYBJAZG.js.map → chunk-7TENMQNQ.js.map} +0 -0
- /package/dist/{chunk-EB25XITI.js.map → chunk-A27J4CIZ.js.map} +0 -0
- /package/dist/{chunk-2KSFBZ2H.js.map → chunk-ABZJNKR6.js.map} +0 -0
- /package/dist/{chunk-GTE4TW3W.js.map → chunk-AESKKFA5.js.map} +0 -0
- /package/dist/{chunk-6LOWZCH7.js.map → chunk-AHXQN4VL.js.map} +0 -0
- /package/dist/{chunk-U2SAW6DH.js.map → chunk-B4OZU7J4.js.map} +0 -0
- /package/dist/{chunk-DDGYTY4E.js.map → chunk-BIHZXB5P.js.map} +0 -0
- /package/dist/{chunk-4QGMUHAU.js.map → chunk-BWNZVMBT.js.map} +0 -0
- /package/dist/{chunk-CY4XIZNW.js.map → chunk-CAH5XNHT.js.map} +0 -0
- /package/dist/{chunk-KILA7LCC.js.map → chunk-CFDWKQZT.js.map} +0 -0
- /package/dist/{chunk-USHVG4UQ.js.map → chunk-CGLMWS7K.js.map} +0 -0
- /package/dist/{chunk-EWFBDAB7.js.map → chunk-CKGRSCRT.js.map} +0 -0
- /package/dist/{chunk-YOLLISEY.js.map → chunk-CRD2WCU7.js.map} +0 -0
- /package/dist/{chunk-L5KPBMMF.js.map → chunk-CXL3TT3K.js.map} +0 -0
- /package/dist/{chunk-KOGJBAFI.js.map → chunk-D3KLIC5N.js.map} +0 -0
- /package/dist/{chunk-2SBQ47RI.js.map → chunk-D4JL5725.js.map} +0 -0
- /package/dist/{chunk-NI3MC742.js.map → chunk-DBJLYURK.js.map} +0 -0
- /package/dist/{chunk-75GAQL2Q.js.map → chunk-DKPELKGL.js.map} +0 -0
- /package/dist/{chunk-NGXL4R54.js.map → chunk-E4MJA52O.js.map} +0 -0
- /package/dist/{chunk-5HXVXW22.js.map → chunk-EGBQR5GH.js.map} +0 -0
- /package/dist/{chunk-FTYOCFTV.js.map → chunk-EGYJUJMR.js.map} +0 -0
- /package/dist/{chunk-7XSCEHGA.js.map → chunk-EOQ6EKTS.js.map} +0 -0
- /package/dist/{chunk-6AKDAQSS.js.map → chunk-ERAMSYPR.js.map} +0 -0
- /package/dist/{chunk-WYRH6OSN.js.map → chunk-F5EH5BJN.js.map} +0 -0
- /package/dist/{chunk-QCYQL3ST.js.map → chunk-FJLPVPRG.js.map} +0 -0
- /package/dist/{chunk-MAHY7PK3.js.map → chunk-FQMLTCXT.js.map} +0 -0
- /package/dist/{chunk-TMINUTQQ.js.map → chunk-FRQGZIYU.js.map} +0 -0
- /package/dist/{chunk-LV6AD6XC.js.map → chunk-FT3LJZWZ.js.map} +0 -0
- /package/dist/{chunk-IS3L67TF.js.map → chunk-FW5GTAUY.js.map} +0 -0
- /package/dist/{chunk-VMTOLAZ5.js.map → chunk-FZZMNKVF.js.map} +0 -0
- /package/dist/{chunk-FGZIEZEP.js.map → chunk-G6TKWNF2.js.map} +0 -0
- /package/dist/{chunk-I6IFUFLW.js.map → chunk-G7MHDZTL.js.map} +0 -0
- /package/dist/{chunk-KES3HNSU.js.map → chunk-GB2DQOZ7.js.map} +0 -0
- /package/dist/{chunk-W3IFJA35.js.map → chunk-GFYDOH7D.js.map} +0 -0
- /package/dist/{chunk-M2M4IDFU.js.map → chunk-GXYOBTOY.js.map} +0 -0
- /package/dist/{chunk-OLHAUGVQ.js.map → chunk-GZQQSTKR.js.map} +0 -0
- /package/dist/{chunk-N2J24TJ3.js.map → chunk-HAWOS4SF.js.map} +0 -0
- /package/dist/{chunk-S2VZUBM7.js.map → chunk-HCTHY66U.js.map} +0 -0
- /package/dist/{chunk-ABVIMFSD.js.map → chunk-HG52QQ2L.js.map} +0 -0
- /package/dist/{chunk-AMLHEKSV.js.map → chunk-HI7JPDD6.js.map} +0 -0
- /package/dist/{chunk-F5OERPU4.js.map → chunk-HOWAMSUY.js.map} +0 -0
- /package/dist/{chunk-3TZUZXY5.js.map → chunk-HTXYBKLK.js.map} +0 -0
- /package/dist/{chunk-WW3F7DCX.js.map → chunk-IFOHCY4O.js.map} +0 -0
- /package/dist/{chunk-S46LGAQ2.js.map → chunk-IJVBLU25.js.map} +0 -0
- /package/dist/{chunk-ARGVUTTL.js.map → chunk-IPVGWENM.js.map} +0 -0
- /package/dist/{chunk-MWXZXCVX.js.map → chunk-J43PARXM.js.map} +0 -0
- /package/dist/{chunk-UYKIUUWP.js.map → chunk-JJTJ7DCV.js.map} +0 -0
- /package/dist/{chunk-HQCZT6TO.js.map → chunk-JVOEVTCZ.js.map} +0 -0
- /package/dist/{chunk-2365CQJU.js.map → chunk-KAQDWEG6.js.map} +0 -0
- /package/dist/{chunk-TB5CRHTF.js.map → chunk-KEPLO2AB.js.map} +0 -0
- /package/dist/{chunk-PVIQDBUN.js.map → chunk-KUQ4XHVV.js.map} +0 -0
- /package/dist/{chunk-DAFFZED3.js.map → chunk-KWBMM6MJ.js.map} +0 -0
- /package/dist/{chunk-JJYECKEL.js.map → chunk-LFECE4R7.js.map} +0 -0
- /package/dist/{chunk-LXIPBHNJ.js.map → chunk-LKTJ26ST.js.map} +0 -0
- /package/dist/{chunk-56JF5PZK.js.map → chunk-LYVTJLCF.js.map} +0 -0
- /package/dist/{chunk-EYFDIUVR.js.map → chunk-M4G4LRQK.js.map} +0 -0
- /package/dist/{chunk-KMMFN24G.js.map → chunk-MKHNLRVX.js.map} +0 -0
- /package/dist/{chunk-4IG73U2X.js.map → chunk-MSPLIRBH.js.map} +0 -0
- /package/dist/{chunk-55MYYWOV.js.map → chunk-O4UXH7BM.js.map} +0 -0
- /package/dist/{chunk-DYHOBKPU.js.map → chunk-OA6T2ME3.js.map} +0 -0
- /package/dist/{chunk-VNMD6BA4.js.map → chunk-OFRQMFWD.js.map} +0 -0
- /package/dist/{chunk-LTJC7TGB.js.map → chunk-OHA2PAAA.js.map} +0 -0
- /package/dist/{chunk-6D5AMANO.js.map → chunk-OV5NM4FY.js.map} +0 -0
- /package/dist/{chunk-ZANWHTXH.js.map → chunk-OVJV2ZN7.js.map} +0 -0
- /package/dist/{chunk-SKQPUAMK.js.map → chunk-PDWQJFMK.js.map} +0 -0
- /package/dist/{chunk-6EZQLNPK.js.map → chunk-PGJIWCQR.js.map} +0 -0
- /package/dist/{chunk-FRAFGRRD.js.map → chunk-PIELY4BJ.js.map} +0 -0
- /package/dist/{chunk-BQBEN44R.js.map → chunk-PNAKRHRT.js.map} +0 -0
- /package/dist/{chunk-3Z6JX7UN.js.map → chunk-PZJEF232.js.map} +0 -0
- /package/dist/{chunk-6ATXOJVQ.js.map → chunk-QADTI63U.js.map} +0 -0
- /package/dist/{chunk-4RF4BALN.js.map → chunk-R775ISK6.js.map} +0 -0
- /package/dist/{chunk-YBAK2WN5.js.map → chunk-RFMQBIE6.js.map} +0 -0
- /package/dist/{chunk-43EFQ3DU.js.map → chunk-RVBLOR32.js.map} +0 -0
- /package/dist/{chunk-XNAI7QGU.js.map → chunk-SA3KLZDZ.js.map} +0 -0
- /package/dist/{chunk-CAOL4AIB.js.map → chunk-SARK3GHS.js.map} +0 -0
- /package/dist/{chunk-CQOJUYTT.js.map → chunk-SOXO2VN3.js.map} +0 -0
- /package/dist/{chunk-Z4ZFJ565.js.map → chunk-SRAIV6U6.js.map} +0 -0
- /package/dist/{chunk-6PU5P7QT.js.map → chunk-TDXEWGY2.js.map} +0 -0
- /package/dist/{chunk-SB2SEGR6.js.map → chunk-TIM4PXWN.js.map} +0 -0
- /package/dist/{chunk-OGSTMHT6.js.map → chunk-TTBLQZVT.js.map} +0 -0
- /package/dist/{chunk-VHE7UEG5.js.map → chunk-UC7DLGMP.js.map} +0 -0
- /package/dist/{chunk-TI4FGQYV.js.map → chunk-UHLGJHTD.js.map} +0 -0
- /package/dist/{chunk-TAHO2LCU.js.map → chunk-UIZIEU4X.js.map} +0 -0
- /package/dist/{chunk-F7LBTMCA.js.map → chunk-ULC4SCFC.js.map} +0 -0
- /package/dist/{chunk-FORQEHRQ.js.map → chunk-UXVWGNPG.js.map} +0 -0
- /package/dist/{chunk-KF3Q3C3P.js.map → chunk-VGIBWJ72.js.map} +0 -0
- /package/dist/{chunk-I54YFYBS.js.map → chunk-VMACQT3T.js.map} +0 -0
- /package/dist/{chunk-EXEBN5ZP.js.map → chunk-W56KN53D.js.map} +0 -0
- /package/dist/{chunk-KURE5R7Z.js.map → chunk-WGK7VNCO.js.map} +0 -0
- /package/dist/{chunk-UIS3E72B.js.map → chunk-WK577LQL.js.map} +0 -0
- /package/dist/{chunk-LLPPIO3K.js.map → chunk-WNTXHLVJ.js.map} +0 -0
- /package/dist/{chunk-PEVBSNCD.js.map → chunk-WPRQPKLV.js.map} +0 -0
- /package/dist/{chunk-C347NNZJ.js.map → chunk-WVCHMTPG.js.map} +0 -0
- /package/dist/{chunk-CSD6SWBZ.js.map → chunk-WYNGH2WL.js.map} +0 -0
- /package/dist/{chunk-PJDAZG65.js.map → chunk-XA5ES25V.js.map} +0 -0
- /package/dist/{chunk-L5RS6QAT.js.map → chunk-YBF2WUGQ.js.map} +0 -0
- /package/dist/{chunk-FWTVIRZZ.js.map → chunk-YLZXIR6B.js.map} +0 -0
- /package/dist/{chunk-JOQGKXR5.js.map → chunk-Z2J4MRTF.js.map} +0 -0
- /package/dist/{chunk-TE6HAWDM.js.map → chunk-ZP2GPRNQ.js.map} +0 -0
- /package/dist/{chunk-3PQL2EN5.js.map → chunk-ZW7Q3IRL.js.map} +0 -0
- /package/dist/{chunk-M5Y42AZ4.js.map → chunk-ZX4ORMBC.js.map} +0 -0
- /package/dist/native/chunks/{chunk-FXA5DLKR.js.map → chunk-UQ272RI2.js.map} +0 -0
- /package/dist/native/chunks/{chunk-IN3XZ7EK.js.map → chunk-X65TVC3B.js.map} +0 -0
|
@@ -20,6 +20,10 @@ const COLUMN_SIZE = sxRem(304 / 7);
|
|
|
20
20
|
/** 304/7 wide to 40 tall: the day's face is a 40 design px circle at full size. */
|
|
21
21
|
const CELL_RATIO = '38 / 35';
|
|
22
22
|
|
|
23
|
+
/** Emotion's documented flag for a positional selector known safe here. */
|
|
24
|
+
const NTH_CHILD_IS_SAFE =
|
|
25
|
+
' /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */';
|
|
26
|
+
|
|
23
27
|
interface DayState extends DayRenderArgs {
|
|
24
28
|
outside: boolean;
|
|
25
29
|
focused: boolean;
|
|
@@ -66,9 +70,15 @@ const inDirection = (band: Exclude<DayBand, 'none'>, theme: Theme): Exclude<DayB
|
|
|
66
70
|
const faceBackgroundFor = (day: DayRenderArgs): ((theme: Theme) => string) | string =>
|
|
67
71
|
isEndpoint(day) ? endpointFill : 'transparent';
|
|
68
72
|
|
|
69
|
-
const colorFor = (day: DayRenderArgs, visible: boolean): string => {
|
|
73
|
+
const colorFor = (day: DayRenderArgs, visible: boolean, locked: boolean): string => {
|
|
70
74
|
if (isEndpoint(day)) return 'primary.contrastText';
|
|
71
|
-
|
|
75
|
+
// On a calendar shown LOCKED (`navigationDisabled`, a disabled picker) every
|
|
76
|
+
// day is disabled, and the ones inside the range are the value the grid
|
|
77
|
+
// states: on the band the disabled ink was 1.56:1, so they take the secondary
|
|
78
|
+
// ink (FUT-4482, review round 9). A live range CAN span a blocked day (a
|
|
79
|
+
// host's `isDateDisabled`: Sundays, holidays); that day keeps the disabled
|
|
80
|
+
// ink, so it still reads as the one that cannot be picked.
|
|
81
|
+
if (day.disabled) return locked && day.inRange ? 'text.secondary' : 'text.disabled';
|
|
72
82
|
// Outside days that are switched off still occupy the grid, they just have
|
|
73
83
|
// nothing to show.
|
|
74
84
|
if (!visible) return 'transparent';
|
|
@@ -85,13 +95,59 @@ const hoverBackgroundFor = (day: DayRenderArgs): ((theme: Theme) => string) | st
|
|
|
85
95
|
// is a half-round cap on a cell as tall as it is wide.
|
|
86
96
|
const BAND_RADIUS = '50%';
|
|
87
97
|
|
|
98
|
+
const capRadius = (side: 'start' | 'end', fill: boolean) => {
|
|
99
|
+
const radius = fill ? FILL_CAP_RADIUS : BAND_RADIUS;
|
|
100
|
+
return side === 'start'
|
|
101
|
+
? { borderStartStartRadius: radius, borderEndStartRadius: radius }
|
|
102
|
+
: { borderStartEndRadius: radius, borderEndEndRadius: radius };
|
|
103
|
+
};
|
|
104
|
+
|
|
88
105
|
/**
|
|
89
106
|
* One cell: the band, painted on the button across its whole column, and the
|
|
90
107
|
* day's round face, a `::before` circle behind the number. The face is a
|
|
91
108
|
* pseudo-element so the button's own content stays the bare day number a host's
|
|
92
109
|
* tests query (`getByText('27')` is the cell, as it always was).
|
|
93
110
|
*/
|
|
94
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Today's ring, opt-in (`todayIndicator="ring"`): a hairline-and-a-half inset
|
|
113
|
+
* on the face, in the primary colour. An endpoint is already filled with that
|
|
114
|
+
* colour, so it carries none.
|
|
115
|
+
*/
|
|
116
|
+
const todayRingFor = (day: DayRenderArgs, ring: boolean): ((theme: Theme) => string) | undefined =>
|
|
117
|
+
ring && day.today && !isEndpoint(day)
|
|
118
|
+
? // A disabled today keeps its ring in the disabled ink, like its number:
|
|
119
|
+
// a primary ring on a dead grid reads as the one live day (round 6).
|
|
120
|
+
(theme: Theme) =>
|
|
121
|
+
`inset 0 0 0 ${rem(theme, 1.5)} ${day.disabled ? theme.palette.text.disabled : theme.palette.primary.main}`
|
|
122
|
+
: undefined;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* A filling calendar's cell (`fullWidth`): the whole column wide, so a range's
|
|
126
|
+
* band runs unbroken however far the columns spread, and exactly as tall as the
|
|
127
|
+
* 40 design px face — the face is as tall as the cell, so it keeps its size
|
|
128
|
+
* while only the spacing grows. A row's end caps round at half that height
|
|
129
|
+
* (the radius clamps on a smaller cell) rather than half a wide cell's width.
|
|
130
|
+
*/
|
|
131
|
+
const FILL_CELL_HEIGHT = sxRem(40);
|
|
132
|
+
const FILL_CAP_RADIUS = sxRem(20);
|
|
133
|
+
|
|
134
|
+
// A filling cell is 40 tall at every width, never a ratio of its column: a
|
|
135
|
+
// tap target under 600 wide is 40 design px each way, and a ratio made a 36px
|
|
136
|
+
// column 33 tall at 320 (FUT-4156, round 3). The frame gives the columns their
|
|
137
|
+
// 40 (`DateRangePicker.frame`).
|
|
138
|
+
const cellSize = (fill: boolean) =>
|
|
139
|
+
fill
|
|
140
|
+
? { width: '100%', maxWidth: '100%', height: FILL_CELL_HEIGHT, justifySelf: 'stretch' }
|
|
141
|
+
: { width: COLUMN_SIZE, maxWidth: '100%', aspectRatio: CELL_RATIO, justifySelf: 'stretch' };
|
|
142
|
+
|
|
143
|
+
const dayCellSx = (
|
|
144
|
+
day: DayRenderArgs,
|
|
145
|
+
band: DayBand,
|
|
146
|
+
visible: boolean,
|
|
147
|
+
ring: boolean,
|
|
148
|
+
fill: boolean,
|
|
149
|
+
locked: boolean,
|
|
150
|
+
): SxProps<Theme> => ({
|
|
95
151
|
position: 'relative',
|
|
96
152
|
isolation: 'isolate',
|
|
97
153
|
display: 'flex',
|
|
@@ -101,24 +157,27 @@ const dayCellSx = (day: DayRenderArgs, band: DayBand, visible: boolean): SxProps
|
|
|
101
157
|
// now that the seven columns carry no gap between them; `maxWidth` and the
|
|
102
158
|
// column's `minmax(0, 1fr)` let it give way below that, and the ratio keeps
|
|
103
159
|
// it 40 tall at full size and shrinking with it.
|
|
104
|
-
|
|
105
|
-
maxWidth: '100%',
|
|
106
|
-
aspectRatio: CELL_RATIO,
|
|
107
|
-
justifySelf: 'stretch',
|
|
160
|
+
...cellSize(fill),
|
|
108
161
|
boxSizing: 'border-box',
|
|
109
162
|
padding: 0,
|
|
110
163
|
border: 'none',
|
|
111
164
|
background: 'none',
|
|
112
165
|
backgroundImage: band === 'none' ? 'none' : (theme: Theme) => BAND_IMAGE[inDirection(band, theme)](bandColor(theme)),
|
|
113
166
|
cursor: day.disabled ? 'not-allowed' : 'pointer',
|
|
114
|
-
color: colorFor(day, visible),
|
|
167
|
+
color: colorFor(day, visible, locked),
|
|
115
168
|
opacity: !day.inCurrentMonth && visible ? 0.5 : 1,
|
|
116
169
|
fontWeight: day.today || isEndpoint(day) ? 'bold' : 'normal',
|
|
117
170
|
// `nth-child`, counting every cell of the week: a hidden outside day is an
|
|
118
171
|
// inert `span` placeholder (FUT-4144), and `nth-of-type` counted only the
|
|
119
172
|
// buttons, so the caps landed mid-week in a month with hidden outside days.
|
|
120
|
-
|
|
121
|
-
|
|
173
|
+
//
|
|
174
|
+
// Emotion warns on `:nth-child` in development, because a server render can
|
|
175
|
+
// put its style tag between the cells and shift the count. The calendar is
|
|
176
|
+
// never server-rendered into that position, and every screen that showed one
|
|
177
|
+
// printed the warning as a console error (FUT-4156), so the selectors carry
|
|
178
|
+
// Emotion's own opt-out flag.
|
|
179
|
+
[`&:nth-child(7n + 1)${NTH_CHILD_IS_SAFE}`]: capRadius('start', fill),
|
|
180
|
+
[`&:nth-child(7n)${NTH_CHILD_IS_SAFE}`]: capRadius('end', fill),
|
|
122
181
|
'&::before': {
|
|
123
182
|
content: '""',
|
|
124
183
|
position: 'absolute',
|
|
@@ -131,12 +190,14 @@ const dayCellSx = (day: DayRenderArgs, band: DayBand, visible: boolean): SxProps
|
|
|
131
190
|
maxWidth: '100%',
|
|
132
191
|
borderRadius: '50%',
|
|
133
192
|
backgroundColor: faceBackgroundFor(day),
|
|
193
|
+
boxShadow: todayRingFor(day, ring),
|
|
134
194
|
},
|
|
135
195
|
'&:hover::before': {
|
|
136
196
|
backgroundColor: hoverBackgroundFor(day),
|
|
137
197
|
},
|
|
138
198
|
'&:focus': { outline: 'none' },
|
|
139
|
-
|
|
199
|
+
// Keyboard focus only: a tapped day is already marked by what the tap did.
|
|
200
|
+
'&:focus-visible::before': {
|
|
140
201
|
outline: (theme: Theme) => `${rem(theme, 2)} solid`,
|
|
141
202
|
outlineColor: 'primary.main',
|
|
142
203
|
outlineOffset: sxRem(1),
|
|
@@ -158,6 +219,12 @@ export interface CalendarDayProps {
|
|
|
158
219
|
band: DayBand;
|
|
159
220
|
focused: boolean;
|
|
160
221
|
showOutsideDays: boolean;
|
|
222
|
+
/** Ring today's face (`todayIndicator="ring"`). */
|
|
223
|
+
todayRing?: boolean;
|
|
224
|
+
/** Fill the column (`CalendarProps.fullWidth`). */
|
|
225
|
+
fullWidth?: boolean;
|
|
226
|
+
/** The whole calendar is shown locked (`CalendarProps.navigationDisabled`). */
|
|
227
|
+
locked?: boolean;
|
|
161
228
|
dayClassName?: (args: DayRenderArgs) => string;
|
|
162
229
|
onSelect: (date: Date) => void;
|
|
163
230
|
onHover: (date: Date) => void;
|
|
@@ -170,6 +237,9 @@ export const CalendarDay: FC<CalendarDayProps> = ({
|
|
|
170
237
|
band,
|
|
171
238
|
focused,
|
|
172
239
|
showOutsideDays,
|
|
240
|
+
todayRing = false,
|
|
241
|
+
fullWidth,
|
|
242
|
+
locked,
|
|
173
243
|
dayClassName,
|
|
174
244
|
onSelect,
|
|
175
245
|
onHover,
|
|
@@ -187,7 +257,7 @@ export const CalendarDay: FC<CalendarDayProps> = ({
|
|
|
187
257
|
component="span"
|
|
188
258
|
aria-hidden="true"
|
|
189
259
|
data-testid="calendar-outside-placeholder"
|
|
190
|
-
sx={
|
|
260
|
+
sx={cellSize(fullWidth === true)}
|
|
191
261
|
/>
|
|
192
262
|
);
|
|
193
263
|
}
|
|
@@ -195,6 +265,8 @@ export const CalendarDay: FC<CalendarDayProps> = ({
|
|
|
195
265
|
return (
|
|
196
266
|
<Box
|
|
197
267
|
component="button"
|
|
268
|
+
// A day picks; it never submits the form a calendar sits in (FUT-4156).
|
|
269
|
+
type="button"
|
|
198
270
|
role="gridcell"
|
|
199
271
|
tabIndex={focused ? 0 : -1}
|
|
200
272
|
aria-selected={day.selected}
|
|
@@ -207,7 +279,7 @@ export const CalendarDay: FC<CalendarDayProps> = ({
|
|
|
207
279
|
onClick={() => onSelect(day.date)}
|
|
208
280
|
onMouseEnter={() => onHover(day.date)}
|
|
209
281
|
onMouseLeave={onHoverEnd}
|
|
210
|
-
sx={dayCellSx(day, band, visible)}
|
|
282
|
+
sx={dayCellSx(day, band, visible, todayRing, fullWidth === true, locked === true)}
|
|
211
283
|
>
|
|
212
284
|
{day.selected && (
|
|
213
285
|
<Box component="span" data-testid="calendar-selected-date" sx={{ display: 'none' }} />
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { bandFor } from './Calendar.band';
|
|
5
5
|
import { isSameDay } from './Calendar.dates';
|
|
6
6
|
import { buildDayArgs } from './Calendar.selection';
|
|
7
|
-
import type { CalendarProps, DateRange, MonthMatrixDay, SelectionMode } from './Calendar.types';
|
|
7
|
+
import type { CalendarProps, CalendarTodayIndicator, DateRange, MonthMatrixDay, SelectionMode } from './Calendar.types';
|
|
8
8
|
import { CalendarDay } from './CalendarDay';
|
|
9
9
|
|
|
10
10
|
// Everything a cell needs that is the same for every cell in the calendar.
|
|
@@ -18,6 +18,16 @@ export interface DayCellContext {
|
|
|
18
18
|
focusedDate: Date;
|
|
19
19
|
today: Date;
|
|
20
20
|
showOutsideDays: boolean;
|
|
21
|
+
/** How today is marked (`CalendarProps.todayIndicator`). */
|
|
22
|
+
todayIndicator: CalendarTodayIndicator;
|
|
23
|
+
/** Spread the columns across the width (`CalendarProps.fullWidth`). */
|
|
24
|
+
fullWidth: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The whole calendar is shown locked (`CalendarProps.navigationDisabled`,
|
|
27
|
+
* which a disabled `DateRangePicker` sets): its in-range days keep the
|
|
28
|
+
* secondary ink. A live calendar's blocked days keep the disabled ink.
|
|
29
|
+
*/
|
|
30
|
+
locked: boolean;
|
|
21
31
|
isDisabled: (date: Date) => boolean;
|
|
22
32
|
renderDay?: CalendarProps['renderDay'];
|
|
23
33
|
dayClassName?: CalendarProps['dayClassName'];
|
|
@@ -30,6 +40,9 @@ export const CalendarDayCell: FC<DayCellContext & { day: MonthMatrixDay }> = ({
|
|
|
30
40
|
day,
|
|
31
41
|
focusedDate,
|
|
32
42
|
showOutsideDays,
|
|
43
|
+
todayIndicator,
|
|
44
|
+
fullWidth,
|
|
45
|
+
locked,
|
|
33
46
|
renderDay,
|
|
34
47
|
dayClassName,
|
|
35
48
|
onSelect,
|
|
@@ -49,6 +62,9 @@ export const CalendarDayCell: FC<DayCellContext & { day: MonthMatrixDay }> = ({
|
|
|
49
62
|
band={bandFor({ args, ...context })}
|
|
50
63
|
focused={isSameDay(args.date, focusedDate)}
|
|
51
64
|
showOutsideDays={showOutsideDays}
|
|
65
|
+
todayRing={todayIndicator === 'ring'}
|
|
66
|
+
fullWidth={fullWidth}
|
|
67
|
+
locked={locked}
|
|
52
68
|
dayClassName={dayClassName}
|
|
53
69
|
onSelect={onSelect}
|
|
54
70
|
onHover={onHover}
|
|
@@ -45,6 +45,34 @@ export const MONTH_SX = {
|
|
|
45
45
|
maxWidth: sxRem(304),
|
|
46
46
|
} as const;
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* A filling month (`fullWidth`) drops the 304 ceiling and takes its share of
|
|
50
|
+
* the row; its columns spread, its day faces do not grow (`CalendarDay`).
|
|
51
|
+
*/
|
|
52
|
+
export const monthSx = (fullWidth: boolean) => (fullWidth ? FILL_MONTH_SX : MONTH_SX);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The basis as a theme function: interpolated into a string, `sxRem` is a
|
|
56
|
+
* function and the whole `flex` value is dropped as invalid CSS. A filling
|
|
57
|
+
* month's cells have no intrinsic width to fall back on, so it must grow.
|
|
58
|
+
*/
|
|
59
|
+
const FILL_MONTH_SX = {
|
|
60
|
+
flex: (theme: Theme) => `1 1 ${rem(theme, 280)}`,
|
|
61
|
+
minWidth: 0,
|
|
62
|
+
maxWidth: 'none',
|
|
63
|
+
} as const;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The caption as a title: its first letter upper-cased in the calendar's own
|
|
67
|
+
* language ("novembro de 2026" → "Novembro de 2026"), as a heading reads in
|
|
68
|
+
* pt-BR; `Intl` writes month names lower-case there. The caption only — the
|
|
69
|
+
* grid's name and a day's name keep `Intl`'s words, which a sentence quotes.
|
|
70
|
+
*/
|
|
71
|
+
export const captionOf = (monthName: string, locale: string): string => {
|
|
72
|
+
const [first = '', ...rest] = [...monthName];
|
|
73
|
+
return `${first.toLocaleUpperCase(locale)}${rest.join('')}`;
|
|
74
|
+
};
|
|
75
|
+
|
|
48
76
|
/** The two arrows' accessible names; an icon alone names nothing. */
|
|
49
77
|
export type MonthArrowLabels = Pick<CalendarLabels, 'previousMonth' | 'nextMonth'>;
|
|
50
78
|
|
|
@@ -55,9 +83,10 @@ const MonthNavHeader: FC<{
|
|
|
55
83
|
showPrevious: boolean;
|
|
56
84
|
showNext: boolean;
|
|
57
85
|
labels?: MonthArrowLabels;
|
|
86
|
+
disabled: boolean;
|
|
58
87
|
onPreviousMonth: () => void;
|
|
59
88
|
onNextMonth: () => void;
|
|
60
|
-
}> = ({ title, showPrevious, showNext, labels, onPreviousMonth, onNextMonth }) => (
|
|
89
|
+
}> = ({ title, showPrevious, showNext, labels, disabled, onPreviousMonth, onNextMonth }) => (
|
|
61
90
|
<Box
|
|
62
91
|
sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 2 }}
|
|
63
92
|
data-testid="calendar-header"
|
|
@@ -65,6 +94,7 @@ const MonthNavHeader: FC<{
|
|
|
65
94
|
{showPrevious && (
|
|
66
95
|
<IconButton
|
|
67
96
|
onClick={onPreviousMonth}
|
|
97
|
+
disabled={disabled}
|
|
68
98
|
size="small"
|
|
69
99
|
aria-label={labels?.previousMonth}
|
|
70
100
|
data-testid="calendar-prev-month"
|
|
@@ -84,6 +114,7 @@ const MonthNavHeader: FC<{
|
|
|
84
114
|
{showNext && (
|
|
85
115
|
<IconButton
|
|
86
116
|
onClick={onNextMonth}
|
|
117
|
+
disabled={disabled}
|
|
87
118
|
size="small"
|
|
88
119
|
aria-label={labels?.nextMonth}
|
|
89
120
|
data-testid="calendar-next-month"
|
|
@@ -156,6 +187,8 @@ export interface CalendarMonthProps {
|
|
|
156
187
|
renderHeader?: CalendarProps['renderHeader'];
|
|
157
188
|
/** The arrows' accessible names. */
|
|
158
189
|
labels?: MonthArrowLabels;
|
|
190
|
+
/** `CalendarProps.navigationDisabled`. */
|
|
191
|
+
navigationDisabled?: boolean;
|
|
159
192
|
onPreviousMonth: () => void;
|
|
160
193
|
onNextMonth: () => void;
|
|
161
194
|
dayContext: DayCellContext;
|
|
@@ -169,12 +202,14 @@ export const CalendarMonth: FC<CalendarMonthProps> = ({
|
|
|
169
202
|
weekdayNames,
|
|
170
203
|
renderHeader,
|
|
171
204
|
labels,
|
|
205
|
+
navigationDisabled = false,
|
|
172
206
|
onPreviousMonth,
|
|
173
207
|
onNextMonth,
|
|
174
208
|
dayContext,
|
|
175
209
|
}) => {
|
|
176
|
-
const
|
|
177
|
-
|
|
210
|
+
const title = renderHeader
|
|
211
|
+
? renderHeader({ month: matrix.month, year: matrix.year })
|
|
212
|
+
: captionOf(getMonthName(matrix.month, matrix.year, locale), locale);
|
|
178
213
|
|
|
179
214
|
return (
|
|
180
215
|
/* The month is addressable by its position, because in a multi-month
|
|
@@ -182,12 +217,13 @@ export const CalendarMonth: FC<CalendarMonthProps> = ({
|
|
|
182
217
|
January's 5th and February's. Without a per-month hook a test can only
|
|
183
218
|
reach a day positionally, which is exactly what the flakiness gate
|
|
184
219
|
refuses. Additive: `calendar-grid` below is unchanged. */
|
|
185
|
-
<Box sx={
|
|
220
|
+
<Box sx={monthSx(dayContext.fullWidth)} data-testid={`calendar-month-${monthIndex}`}>
|
|
186
221
|
<MonthNavHeader
|
|
187
222
|
title={title}
|
|
188
223
|
showPrevious={monthIndex === 0}
|
|
189
224
|
showNext={monthIndex === monthsToShow - 1}
|
|
190
225
|
labels={labels}
|
|
226
|
+
disabled={navigationDisabled}
|
|
191
227
|
onPreviousMonth={onPreviousMonth}
|
|
192
228
|
onNextMonth={onNextMonth}
|
|
193
229
|
/>
|
|
@@ -10,7 +10,7 @@ import type { MonthMatrix } from './Calendar.types';
|
|
|
10
10
|
import type { DateBounds } from './Calendar.views';
|
|
11
11
|
import { MONTH_INDEXES, canShiftMonth, isMonthOutOfBounds, isYearOutOfBounds, yearOptions } from './Calendar.views';
|
|
12
12
|
import type { DayCellContext } from './CalendarDayCell';
|
|
13
|
-
import {
|
|
13
|
+
import { MonthDays, monthSx } from './CalendarMonth';
|
|
14
14
|
import type { PickerOption } from './CalendarPickerGrid';
|
|
15
15
|
import { CalendarPickerGrid } from './CalendarPickerGrid';
|
|
16
16
|
import { CalendarSelectorsCaption } from './CalendarSelectorsCaption';
|
|
@@ -82,7 +82,7 @@ export const CalendarSelectorsMonth: FC<CalendarSelectorsMonthProps> = ({
|
|
|
82
82
|
const picking = picker.view !== 'days';
|
|
83
83
|
|
|
84
84
|
return (
|
|
85
|
-
<Box sx={
|
|
85
|
+
<Box sx={monthSx(dayContext.fullWidth)} data-testid="calendar-month-0">
|
|
86
86
|
<CalendarSelectorsCaption
|
|
87
87
|
monthText={getMonthLabel(matrix.month, locale, 'long')}
|
|
88
88
|
monthNames={MONTH_INDEXES.map((index) => getMonthLabel(index, locale, 'long'))}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The months' frame in the in-page (`beside`) layout, and the fields' column
|
|
3
|
+
* beside it: how wide each is, with and without `fullWidth`. Kept out of the
|
|
4
|
+
* component so that file stays a layout of parts.
|
|
5
|
+
*/
|
|
6
|
+
import type { Theme } from '@mui/material/styles/index.js';
|
|
7
|
+
|
|
8
|
+
import { rem, sxRem } from '../../../tokens/relative';
|
|
9
|
+
import { surfaces } from '../../../tokens/surfaces';
|
|
10
|
+
import { CARD_RADIUS_UNITS } from '../../layout/Card/Card.metrics';
|
|
11
|
+
|
|
12
|
+
import { framedMonthsWidth } from './DateRangePicker.layout';
|
|
13
|
+
|
|
14
|
+
export const CALENDAR_CLASS = 'date-range-picker__calendar';
|
|
15
|
+
|
|
16
|
+
// `Calendar` renders its own `Paper` with 24px of padding. Nested in this one
|
|
17
|
+
// that reads as a box inside a box, so the inner frame is flattened here
|
|
18
|
+
// through the className hook the component exposes for exactly this.
|
|
19
|
+
export const FLAT_CALENDAR = {
|
|
20
|
+
[`& .${CALENDAR_CLASS}`]: {
|
|
21
|
+
p: 0,
|
|
22
|
+
boxShadow: 'none',
|
|
23
|
+
backgroundColor: 'transparent',
|
|
24
|
+
backgroundImage: 'none',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The months' own frame in the `beside` layout: the picker is part of a page
|
|
30
|
+
* there, so the frame holds the calendar alone and the fields sit on the page
|
|
31
|
+
* beside or under it, as the form's other fields do.
|
|
32
|
+
*/
|
|
33
|
+
const BESIDE_FRAME_SX = {
|
|
34
|
+
p: 2,
|
|
35
|
+
maxWidth: '100%',
|
|
36
|
+
minWidth: 0,
|
|
37
|
+
// A card on the page, as the prototype draws it: the RAISED surface role
|
|
38
|
+
// (`background.paper` unless the host states one — a host whose paper is its
|
|
39
|
+
// page ground states a lighter card there) and the default `Card`'s radius,
|
|
40
|
+
// not a Paper's 4px (FUT-4156, round 3). In-page only: the popover keeps its own.
|
|
41
|
+
bgcolor: (theme: Theme) => surfaces(theme).raised,
|
|
42
|
+
borderRadius: (theme: Theme) => theme.spacing(CARD_RADIUS_UNITS.md),
|
|
43
|
+
...FLAT_CALENDAR,
|
|
44
|
+
} as const;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Under the fields' row the frame is as wide as its months and centred: a
|
|
48
|
+
* frame stretched across the page around one month left a third of itself
|
|
49
|
+
* blank (FUT-4156, 600 and 900 wide).
|
|
50
|
+
*/
|
|
51
|
+
const BELOW_FRAME_SX = {
|
|
52
|
+
...BESIDE_FRAME_SX,
|
|
53
|
+
alignSelf: 'center',
|
|
54
|
+
width: 'fit-content',
|
|
55
|
+
} as const;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* `fullWidth`: the frame's edges are the picker's. Under the fields it spans
|
|
59
|
+
* the picker; beside them it takes the row the fields' column leaves, and the
|
|
60
|
+
* months spread across it (FUT-4156: a fitted frame left blank bands of 10 to
|
|
61
|
+
* 77px each side at 390, 600 and 900 wide).
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* Under the fields the frame gives up its side padding before its columns
|
|
65
|
+
* drop under 40 design px: seven 40px columns and the hairlines need 282, so
|
|
66
|
+
* the padding is what is left of the row past that, never more than its 16
|
|
67
|
+
* (FUT-4156, round 3: at 320 wide the columns were 36). `100%` is the row's
|
|
68
|
+
* width — padding percentages read the containing block.
|
|
69
|
+
*/
|
|
70
|
+
export const FILL_COLUMN_MIN = 40;
|
|
71
|
+
const sidePadding = (theme: Theme): string =>
|
|
72
|
+
`clamp(0px, calc((100% - ${rem(theme, 7 * FILL_COLUMN_MIN + 2)}) / 2), ${theme.spacing(2)})`;
|
|
73
|
+
const FILL_BELOW_FRAME_SX = { ...BESIDE_FRAME_SX, alignSelf: 'stretch', px: sidePadding } as const;
|
|
74
|
+
// Never narrower than its months at their full size: the fields' column gives
|
|
75
|
+
// way first, down to the room `besideLayout` chose this placement with.
|
|
76
|
+
const fillBesideFrameSx = (months: number) =>
|
|
77
|
+
({ ...BESIDE_FRAME_SX, flex: '1 1 auto', minWidth: sxRem(framedMonthsWidth(months)) }) as const;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The fields' column beside a filling frame stops at 320 design px: at 1920
|
|
81
|
+
* wide it ran to 694 for a ten-character date, with the room under it blank.
|
|
82
|
+
*/
|
|
83
|
+
const FILL_FIELDS_COLUMN = { flex: '0 1 auto', width: sxRem(320), minWidth: 0 } as const;
|
|
84
|
+
|
|
85
|
+
export const frameSx = (sideBySide: boolean, fill: boolean, months: number) => {
|
|
86
|
+
if (fill) return sideBySide ? fillBesideFrameSx(months) : FILL_BELOW_FRAME_SX;
|
|
87
|
+
return sideBySide ? { ...BESIDE_FRAME_SX, flex: '0 0 auto' } : BELOW_FRAME_SX;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const fieldsColumnSx = (sideBySide: boolean, fill: boolean) =>
|
|
91
|
+
fill && sideBySide ? FILL_FIELDS_COLUMN : { flex: 1, minWidth: 0 };
|
|
92
|
+
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the component so that file is a layout and this one is the behaviour — the
|
|
4
4
|
* same split `Calendar.hooks.ts` uses next door.
|
|
5
5
|
*/
|
|
6
|
-
import { useId, useMemo, useState } from 'react';
|
|
6
|
+
import { useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { toDayString, todayIn } from './DateRangePicker.dates';
|
|
9
9
|
import {
|
|
@@ -19,6 +19,42 @@ import type {
|
|
|
19
19
|
UseDateRangePickerArgs,
|
|
20
20
|
} from './DateRangePicker.types';
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Whether `value` is what the picker last handed out — or that tap's draft
|
|
24
|
+
* carried on by the consumer: every bound the tap chose kept, a bound it left
|
|
25
|
+
* open filled in (a consumer that keeps an end the tap would have dropped).
|
|
26
|
+
* Either way the grid under the pointer must not move, nor lose its focus.
|
|
27
|
+
*/
|
|
28
|
+
function cameFromPicker(value: DateRangeDraft, emitted: DateRangeDraft | null): boolean {
|
|
29
|
+
if (emitted === null) return false;
|
|
30
|
+
const kept = (bound: 'from' | 'to'): boolean => emitted[bound] === null || emitted[bound] === value[bound];
|
|
31
|
+
return kept('from') && kept('to');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Bump the view nonce when the value moves and the picker did not move it —
|
|
36
|
+
* a consumer's own field committed a day. Skips the mount and the picker's own
|
|
37
|
+
* emissions, so a click in the grid never remounts the grid under it. An
|
|
38
|
+
* emission is read once: the change after it is the consumer's own.
|
|
39
|
+
*/
|
|
40
|
+
function useFollowValue(
|
|
41
|
+
enabled: boolean,
|
|
42
|
+
value: DateRangeDraft,
|
|
43
|
+
lastEmitted: { current: DateRangeDraft | null },
|
|
44
|
+
setViewNonce: (update: (nonce: number) => number) => void,
|
|
45
|
+
): void {
|
|
46
|
+
const previous = useRef(value);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const before = previous.current;
|
|
49
|
+
previous.current = value;
|
|
50
|
+
if (!enabled || (before.from === value.from && before.to === value.to)) return;
|
|
51
|
+
const emitted = lastEmitted.current;
|
|
52
|
+
lastEmitted.current = null;
|
|
53
|
+
if (cameFromPicker(value, emitted)) return;
|
|
54
|
+
setViewNonce((nonce) => nonce + 1);
|
|
55
|
+
}, [enabled, value, lastEmitted, setViewNonce]);
|
|
56
|
+
}
|
|
57
|
+
|
|
22
58
|
export function useDateRangePicker({
|
|
23
59
|
value,
|
|
24
60
|
onChange,
|
|
@@ -28,6 +64,7 @@ export function useDateRangePicker({
|
|
|
28
64
|
weekStartsOn,
|
|
29
65
|
quickRanges,
|
|
30
66
|
messages,
|
|
67
|
+
followValue = false,
|
|
31
68
|
}: UseDateRangePickerArgs): DateRangePickerState {
|
|
32
69
|
const statusId = useId();
|
|
33
70
|
// `Calendar` reads which month to open on from the range it is handed, and
|
|
@@ -44,12 +81,17 @@ export function useDateRangePicker({
|
|
|
44
81
|
[quickRanges, today, weekStartsOn, maxRangeDays],
|
|
45
82
|
);
|
|
46
83
|
const status = useMemo(() => resolveDayRange(value, maxRangeDays), [value, maxRangeDays]);
|
|
84
|
+
// What the picker itself last handed out: a value equal to it came FROM here
|
|
85
|
+
// (a click in the grid), and must not move the grid under the pointer.
|
|
86
|
+
const lastEmitted = useRef<DateRangeDraft | null>(null);
|
|
87
|
+
useFollowValue(followValue, value, lastEmitted, setViewNonce);
|
|
47
88
|
|
|
48
89
|
const emit = (
|
|
49
90
|
next: DateRangeDraft,
|
|
50
91
|
source: DateRangeChangeMeta['source'],
|
|
51
92
|
quickRangeId?: string,
|
|
52
93
|
): void => {
|
|
94
|
+
lastEmitted.current = next;
|
|
53
95
|
onChange(next, {
|
|
54
96
|
source,
|
|
55
97
|
...(quickRangeId ? { quickRangeId } : {}),
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the typed half goes when the consumer asked for it BESIDE the months
|
|
3
|
+
* (`fieldsPlacement="beside"`), and how many months fit with it.
|
|
4
|
+
*
|
|
5
|
+
* Decided from the PICKER's own width, never the viewport's: the same form sits
|
|
6
|
+
* full width on a computer and in a 3/5 column beside a preview on the same
|
|
7
|
+
* computer, and only its own box knows which. The numbers are the design px the
|
|
8
|
+
* month grid is built to (`MONTH_SX` in `CalendarMonth`: 304 wide, 24 apart).
|
|
9
|
+
*/
|
|
10
|
+
import type { Theme } from '@mui/material/styles/index.js';
|
|
11
|
+
import { useLayoutEffect, useState, type RefObject } from 'react';
|
|
12
|
+
|
|
13
|
+
import { remPx } from '../../../tokens/relative';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The design px the layout is computed from, rendered through the theme
|
|
17
|
+
* (`remPx`) so a density that shrinks the grid shrinks the thresholds with it.
|
|
18
|
+
* Framed months: the grid's intrinsic 304 a month and 24 between two
|
|
19
|
+
* (`MONTH_SX`), plus the frame's 16px padding a side and its hairline. The
|
|
20
|
+
* column beside: the `gap: 4` to the frame and the 220 a `dd/mm/aaaa` field
|
|
21
|
+
* and its label read well in.
|
|
22
|
+
*/
|
|
23
|
+
const FRAMED_MONTHS: Readonly<Record<number, number>> = { 1: 338, 2: 666 };
|
|
24
|
+
const BESIDE_COLUMN = 252;
|
|
25
|
+
|
|
26
|
+
export type FieldsPlacement = 'beside' | 'below';
|
|
27
|
+
|
|
28
|
+
/** The design px a frame around `months` month grids needs (see FRAMED_MONTHS). */
|
|
29
|
+
export function framedMonthsWidth(months: number): number {
|
|
30
|
+
return FRAMED_MONTHS[months] ?? (FRAMED_MONTHS[2]! * months) / 2;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The layout for a picker `width` px wide asking for `requested` months, in
|
|
35
|
+
* order of preference: every month requested with the fields beside, then
|
|
36
|
+
* under them, then one month beside, then one under. A picker not measured yet
|
|
37
|
+
* (no `ResizeObserver`, a server render) keeps the default layout.
|
|
38
|
+
*/
|
|
39
|
+
export function besideLayout(
|
|
40
|
+
width: number | null,
|
|
41
|
+
requested: number,
|
|
42
|
+
theme: Theme,
|
|
43
|
+
): { months: number; placement: FieldsPlacement } {
|
|
44
|
+
if (width === null) return { months: requested, placement: 'below' };
|
|
45
|
+
const framed = (months: number): number => remPx(theme, framedMonthsWidth(months));
|
|
46
|
+
const beside = remPx(theme, BESIDE_COLUMN);
|
|
47
|
+
const counts = requested > 1 ? [requested, 1] : [requested];
|
|
48
|
+
for (const months of counts) {
|
|
49
|
+
if (width >= framed(months) + beside) return { months, placement: 'beside' };
|
|
50
|
+
if (width >= framed(months)) return { months, placement: 'below' };
|
|
51
|
+
}
|
|
52
|
+
return { months: 1, placement: 'below' };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The element's content width, kept current; null until measured or when disabled. */
|
|
56
|
+
export function useMeasuredWidth(ref: RefObject<HTMLElement | null>, enabled: boolean): number | null {
|
|
57
|
+
const [width, setWidth] = useState<number | null>(null);
|
|
58
|
+
useLayoutEffect(() => {
|
|
59
|
+
const element = ref.current;
|
|
60
|
+
if (!enabled || element === null || typeof ResizeObserver === 'undefined') return undefined;
|
|
61
|
+
const observer = new ResizeObserver((entries) => {
|
|
62
|
+
const measured = entries[0]?.contentRect.width;
|
|
63
|
+
if (measured) setWidth(Math.round(measured));
|
|
64
|
+
});
|
|
65
|
+
observer.observe(element);
|
|
66
|
+
return () => observer.disconnect();
|
|
67
|
+
}, [ref, enabled]);
|
|
68
|
+
return width;
|
|
69
|
+
}
|