@12-apps/ui 6.48.1 → 6.49.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/NATIVE.md +1 -1
- package/dist/_internal/components/data-display/AsyncStateContainer/AsyncStateContainer.js +6 -6
- package/dist/_internal/components/data-display/Avatar/Avatar.js +4 -4
- package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
- package/dist/_internal/components/data-display/Badge/Badge.js +8 -6
- package/dist/_internal/components/data-display/Badge/Badge.styles.js +6 -4
- package/dist/_internal/components/data-display/Badge/BadgeContent.js +7 -5
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +5 -5
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +5 -5
- package/dist/_internal/components/data-display/Carousel/Carousel.chrome.js +7 -5
- package/dist/_internal/components/data-display/Carousel/Carousel.js +10 -8
- package/dist/_internal/components/data-display/Carousel/Carousel.parts.js +6 -4
- package/dist/_internal/components/data-display/Carousel/Carousel.styles.js +6 -4
- package/dist/_internal/components/data-display/Chart/Chart.js +10 -8
- package/dist/_internal/components/data-display/Chart/SpecChart.js +13 -11
- package/dist/_internal/components/data-display/Chart/chart-context.js +7 -5
- package/dist/_internal/components/data-display/Chart/chart-internals.js +6 -4
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +9 -7
- package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +7 -5
- package/dist/_internal/components/data-display/DataGrid/DataGrid.model.js +5 -3
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +51 -49
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +68 -66
- package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +3 -3
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +7 -7
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +5 -5
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +9 -7
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +8 -6
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +12 -10
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +14 -14
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +8 -6
- package/dist/_internal/components/data-display/DataViews/data-views-display-tabs.js +6 -4
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +17 -17
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +11 -9
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +46 -44
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +20 -20
- package/dist/_internal/components/data-display/DataViews/data-views-layout-context.js +5 -3
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +17 -17
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +18 -18
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +6 -4
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +15 -13
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +15 -15
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +14 -12
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +7 -5
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +4 -4
- package/dist/_internal/components/data-display/DataViews/use-saved-views-controller.js +2 -2
- package/dist/_internal/components/data-display/EmptyState/EmptyState.js +2 -2
- package/dist/_internal/components/data-display/FleetMap/FleetBody.js +13 -13
- package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +8 -8
- package/dist/_internal/components/data-display/FleetMap/FleetMap.js +22 -20
- package/dist/_internal/components/data-display/FleetMap/FleetRoster.js +4 -4
- package/dist/_internal/components/data-display/InteractiveTooltip/InteractiveTooltip.js +2 -2
- package/dist/_internal/components/data-display/LazyImage/LazyImage.js +3 -3
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +6 -6
- package/dist/_internal/components/data-display/LoadingState/LoadingState.js +3 -3
- package/dist/_internal/components/data-display/MapPreview/MapLayers.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.js +7 -7
- package/dist/_internal/components/data-display/Progress/Progress.js +2 -2
- package/dist/_internal/components/data-display/SectionOnboarding/SectionOnboarding.js +3 -3
- package/dist/_internal/components/data-display/Sheet/Sheet.body.js +5 -3
- package/dist/_internal/components/data-display/Sheet/Sheet.js +9 -7
- package/dist/_internal/components/data-display/Sheet/Sheet.styles.js +6 -4
- package/dist/_internal/components/data-display/StatCard/StatCard.js +3 -3
- package/dist/_internal/components/data-display/Table/Table.js +8 -6
- package/dist/_internal/components/data-display/index.js +71 -69
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.js +2 -2
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +3 -3
- package/dist/_internal/components/feedback/ConfirmAction/with-confirmation.js +2 -2
- package/dist/_internal/components/feedback/Dialog/Dialog.js +2 -2
- package/dist/_internal/components/feedback/index.js +8 -8
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.hooks.js +2 -2
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.js +7 -7
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocompleteField.js +2 -2
- package/dist/_internal/components/form/Autocomplete/Autocomplete.js +1 -1
- package/dist/_internal/components/form/Calendar/Calendar.hooks.js +2 -2
- package/dist/_internal/components/form/Calendar/Calendar.js +6 -6
- package/dist/_internal/components/form/Calendar/CalendarDayCell.js +2 -2
- package/dist/_internal/components/form/Calendar/CalendarMonth.js +3 -3
- package/dist/_internal/components/form/CategorySelect/CategoryPanel.js +5 -5
- package/dist/_internal/components/form/CategorySelect/CategoryPanelList.js +3 -3
- package/dist/_internal/components/form/CategorySelect/CategoryRows.js +2 -2
- package/dist/_internal/components/form/CategorySelect/CategorySelect.js +9 -9
- package/dist/_internal/components/form/CodeEditor/CodeEditor.js +3 -3
- package/dist/_internal/components/form/Command/Command.js +7 -5
- package/dist/_internal/components/form/Command/Command.styles.js +6 -4
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +9 -9
- package/dist/_internal/components/form/Label/Label.js +7 -5
- package/dist/_internal/components/form/Label/Label.styles.js +6 -4
- package/dist/_internal/components/form/Menubar/Menubar.item.js +7 -5
- package/dist/_internal/components/form/Menubar/Menubar.js +10 -8
- package/dist/_internal/components/form/Menubar/Menubar.styles.js +6 -4
- package/dist/_internal/components/form/Menubar/Menubar.toolbar.js +8 -6
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/_internal/components/form/Switch/Switch.js +2 -2
- package/dist/_internal/components/form/index.js +38 -36
- package/dist/_internal/components/form/total-form/Fields/CategoryField.js +10 -10
- package/dist/_internal/components/form/total-form/Fields/index.js +16 -16
- package/dist/_internal/components/index.js +164 -162
- package/dist/_internal/components/layout/Box/Box.js +8 -6
- package/dist/_internal/components/layout/ScrollArea/ScrollArea.js +3 -3
- package/dist/_internal/components/layout/SettingCard/SettingCard.js +11 -9
- package/dist/_internal/components/layout/SettingCard/SettingCard.parts.js +10 -8
- package/dist/_internal/components/layout/SettingCard/SettingGrid.js +11 -9
- package/dist/_internal/components/layout/SettingCard/SettingGroup.js +16 -14
- package/dist/_internal/components/layout/SettingCard/SettingSwitch.js +14 -12
- package/dist/_internal/components/layout/SettingCard/SettingToggle.js +16 -14
- package/dist/_internal/components/layout/SettingsLayout/SettingsLayout.js +4 -4
- package/dist/_internal/components/layout/SettingsLayout/SettingsPanel.js +3 -3
- package/dist/_internal/components/layout/SettingsLayout/SettingsSectionChips.js +2 -2
- package/dist/_internal/components/layout/Skeleton/Skeleton.js +2 -2
- package/dist/_internal/components/layout/Stack/Stack.js +9 -7
- package/dist/_internal/components/layout/index.js +36 -34
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +12 -10
- package/dist/_internal/components/navigation/AppHeader/AppHeader.identity.js +6 -4
- package/dist/_internal/components/navigation/CommandPalette/CommandPalette.js +3 -3
- package/dist/_internal/components/navigation/NavigationMenu/NavigationMegaSection.js +3 -3
- package/dist/_internal/components/navigation/NavigationMenu/NavigationMenu.js +5 -5
- package/dist/_internal/components/navigation/NavigationMenu/NavigationMenuItem.js +2 -2
- package/dist/_internal/components/navigation/NavigationMenu/NavigationStandardBody.js +3 -3
- package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +12 -10
- package/dist/_internal/components/navigation/SectionNav/SectionNav.js +14 -12
- package/dist/_internal/components/navigation/SectionNav/SectionNav.parts.js +9 -7
- package/dist/_internal/components/navigation/SectionNav/SectionNav.primary.js +10 -8
- package/dist/_internal/components/navigation/SectionNav/SectionNav.rail.js +10 -8
- package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +10 -8
- package/dist/_internal/components/navigation/SectionNav/__stories__/fixtures.js +5 -3
- package/dist/_internal/components/navigation/SectionNav/__stories__/fixtures.js.map +1 -1
- package/dist/_internal/components/navigation/Tabs/Tabs.js +2 -2
- package/dist/_internal/components/navigation/index.js +37 -35
- package/dist/_internal/components/utility/InstallPrompt/InstallPrompt.js +3 -3
- package/dist/_internal/components/utility/InstallPrompt/usePwaInstall.js +2 -2
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.helpers.js +5 -3
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.js +5 -3
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.parts.js +5 -3
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStepRow.js +5 -3
- package/dist/_internal/components/utility/index.js +9 -7
- package/dist/_internal/icons/Icon.js +9 -7
- package/dist/_internal/provider/UiProvider.js +7 -5
- package/dist/_internal/provider/mui-bridge.js +6 -4
- package/dist/_internal/provider/use-ui-theme.js +7 -5
- package/dist/_internal/test-utils/must.js +13 -0
- package/dist/_internal/test-utils/must.js.map +1 -0
- package/dist/_internal/tokens/density-overrides.js +20 -4
- package/dist/_internal/tokens/density-overrides.navigation.js +19 -0
- package/dist/_internal/tokens/density-overrides.navigation.js.map +1 -0
- package/dist/_internal/tokens/density-overrides.selection.js +11 -0
- package/dist/_internal/tokens/density-overrides.selection.js.map +1 -0
- package/dist/_internal/tokens/density.js +4 -2
- package/dist/_internal/user-avatar/user-avatar.js +5 -5
- package/dist/charts.js +16 -14
- package/dist/{chunk-4A7PSQB5.js → chunk-2H5SYAJW.js} +3 -3
- package/dist/{chunk-BIDPJNCG.js → chunk-2LQU7DRI.js} +25 -9
- package/dist/chunk-2LQU7DRI.js.map +1 -0
- package/dist/{chunk-XFAXRMWY.js → chunk-2OEFIGH7.js} +4 -4
- package/dist/{chunk-TMOC2XUE.js → chunk-2UPWKLHQ.js} +21 -5
- package/dist/chunk-2UPWKLHQ.js.map +1 -0
- package/dist/{chunk-2YKTB2IZ.js → chunk-32JMSHEA.js} +2 -2
- package/dist/{chunk-HR7YTBR7.js → chunk-3AOOI2NR.js} +4 -4
- package/dist/{chunk-QFJ3JXXP.js → chunk-3IPPMWUA.js} +1 -1
- package/dist/{chunk-QFJ3JXXP.js.map → chunk-3IPPMWUA.js.map} +1 -1
- package/dist/{chunk-KYQ4OORF.js → chunk-3LB4ZIZS.js} +6 -6
- package/dist/{chunk-2NYVMLFQ.js → chunk-3MJHHPRW.js} +2 -2
- package/dist/{chunk-P2OQ4IGP.js → chunk-3PURWPNX.js} +2 -2
- package/dist/{chunk-NLYNRE7L.js → chunk-3RUCLKAK.js} +4 -4
- package/dist/{chunk-FS7UVKEE.js → chunk-42GG3BPF.js} +4 -4
- package/dist/{chunk-CGL7R37P.js → chunk-43Q6CVPB.js} +4 -4
- package/dist/{chunk-G6II7SVX.js → chunk-44USLRMT.js} +4 -4
- package/dist/{chunk-4WCDMCIS.js → chunk-4CHYMTBT.js} +4 -4
- package/dist/{chunk-5D52CMNX.js → chunk-4ELI2MM3.js} +2 -52
- package/dist/chunk-4ELI2MM3.js.map +1 -0
- package/dist/{chunk-HISEWACT.js → chunk-4GRUNQNB.js} +2 -2
- package/dist/{chunk-HN3PZTUK.js → chunk-4MKVGSHX.js} +5 -5
- package/dist/{chunk-E4GTZ26X.js → chunk-4YL3TQ6C.js} +5 -5
- package/dist/{chunk-5OX6KZIZ.js → chunk-52MYWALU.js} +2 -2
- package/dist/{chunk-5OEC546C.js → chunk-54HTXJJ2.js} +2 -2
- package/dist/{chunk-NRI2TZDS.js → chunk-5FHPZOYK.js} +2 -2
- package/dist/{chunk-JAHWFJCW.js → chunk-5JCGBCFJ.js} +5 -5
- package/dist/{chunk-LTJDZIYR.js → chunk-66XTP3IT.js} +7 -7
- package/dist/{chunk-LHTEAPYG.js → chunk-6JGATEOF.js} +5 -5
- package/dist/{chunk-CMLIWUBW.js → chunk-6PPHALM3.js} +4 -4
- package/dist/{chunk-6KLDYVRY.js → chunk-77BKKPCI.js} +2 -2
- package/dist/{chunk-AG3DY5TH.js → chunk-ADSA76T7.js} +2 -2
- package/dist/{chunk-25OI5W6Y.js → chunk-AH4XGLE2.js} +2 -2
- package/dist/{chunk-CACBJ4CR.js → chunk-AJAPP56P.js} +2 -2
- package/dist/{chunk-CGBUWNNQ.js → chunk-ALOUJ3CE.js} +9 -9
- package/dist/{chunk-GMC3F43L.js → chunk-AMSNWV7V.js} +3 -3
- package/dist/{chunk-MWPXKZ7O.js → chunk-AY5MY7HJ.js} +6 -6
- package/dist/{chunk-E32YPPF5.js → chunk-B4Y6W3OU.js} +2 -2
- package/dist/{chunk-2K2B5QM2.js → chunk-BEGTLELZ.js} +5 -5
- package/dist/{chunk-QMSCRKR6.js → chunk-C7GYSLPO.js} +2 -2
- package/dist/{chunk-MQ277OLB.js → chunk-CM2Q7IH3.js} +5 -5
- package/dist/{chunk-UG636FEL.js → chunk-CMFJQH6A.js} +4 -4
- package/dist/{chunk-FQT4C5R4.js → chunk-CZBCOMOX.js} +12 -12
- package/dist/{chunk-DSDNGTH6.js → chunk-DH6SL3SY.js} +6 -6
- package/dist/{chunk-4CBM7JNK.js → chunk-DLDL6P6G.js} +2 -2
- package/dist/{chunk-PP7CDKO4.js → chunk-DLS5CUI3.js} +2 -2
- package/dist/{chunk-ZVJSY2OV.js → chunk-EF5XUS44.js} +4 -4
- package/dist/{chunk-WDAEYLT5.js → chunk-EONMVYVY.js} +2 -2
- package/dist/{chunk-6PU3JYVY.js → chunk-F3AYISXT.js} +4 -4
- package/dist/{chunk-H5XKBPKK.js → chunk-FJZHHARA.js} +2 -2
- package/dist/{chunk-EWVJJ32N.js → chunk-FRAW3ICP.js} +4 -4
- package/dist/{chunk-ST36ZSAN.js → chunk-FRIUYEXD.js} +2 -2
- package/dist/{chunk-IGGXKT5B.js → chunk-G2WERTWZ.js} +2 -2
- package/dist/{chunk-JYLOCXMV.js → chunk-GI63FQEJ.js} +4 -4
- package/dist/{chunk-FVKBP3UX.js → chunk-GLKQT2DS.js} +2 -2
- package/dist/{chunk-UILH4OAZ.js → chunk-GPHURU2K.js} +9 -9
- package/dist/{chunk-MEYKNJNI.js → chunk-GT6HPOS2.js} +8 -8
- package/dist/{chunk-5NFQKL7C.js → chunk-H6K3AP42.js} +6 -6
- package/dist/{chunk-VOG5IVQW.js → chunk-H6N7XXUB.js} +2 -2
- package/dist/{chunk-KESGVMHW.js → chunk-H6OBK5QP.js} +3 -3
- package/dist/{chunk-ZL3GCUKC.js → chunk-HI3VE276.js} +2 -2
- package/dist/{chunk-YXU45AVO.js → chunk-HKBJZX3C.js} +11 -11
- package/dist/{chunk-YRACC6BB.js → chunk-HRNDWD25.js} +4 -4
- package/dist/{chunk-JE6RZ5L6.js → chunk-IABE56TG.js} +2 -2
- package/dist/{chunk-3CDU7DLD.js → chunk-IKXS2YVQ.js} +2 -2
- package/dist/{chunk-BU6TCB76.js → chunk-INCTNS4X.js} +2 -2
- package/dist/{chunk-2ZRZTGWP.js → chunk-ISW5K72V.js} +5 -5
- package/dist/{chunk-EKWH4LGM.js → chunk-J5YNQZLQ.js} +2 -2
- package/dist/{chunk-AEJ3FFNE.js → chunk-JJIEJI4C.js} +5 -5
- package/dist/{chunk-OBID7SOG.js → chunk-JNAULEYH.js} +3 -3
- package/dist/{chunk-UJOFRJLX.js → chunk-JSGVYOMN.js} +3 -3
- package/dist/{chunk-ZRIWMIHK.js → chunk-JVOV5WAJ.js} +6 -6
- package/dist/chunk-K3YHXOWZ.js +126 -0
- package/dist/chunk-K3YHXOWZ.js.map +1 -0
- package/dist/{chunk-ZCXVTFYQ.js → chunk-KG64HV34.js} +2 -2
- package/dist/{chunk-CO4MSWTV.js → chunk-LCWGNDTH.js} +4 -4
- package/dist/{chunk-THCDUP6Q.js → chunk-LGCRL7DK.js} +9 -9
- package/dist/{chunk-BPOVRMVS.js → chunk-LXEQR6EI.js} +7 -7
- package/dist/{chunk-WAD5VL6B.js → chunk-LZQQ4JXY.js} +8 -8
- package/dist/{chunk-FWPFCK4D.js → chunk-NDHDBOUH.js} +4 -4
- package/dist/{chunk-6MN5KOVM.js → chunk-NHMFBUBK.js} +2 -2
- package/dist/{chunk-RZPYKTOG.js → chunk-NLGJXSGM.js} +2 -2
- package/dist/{chunk-N4HHFYPB.js → chunk-NND4UTWS.js} +2 -2
- package/dist/{chunk-2LSJTQIL.js → chunk-NPPJ3IJP.js} +2 -2
- package/dist/{chunk-EMEXXAQI.js → chunk-NYFGFELX.js} +7 -7
- package/dist/{chunk-H7DVH6KD.js → chunk-ODY3PINC.js} +7 -7
- package/dist/{chunk-Q2LQVYXY.js → chunk-OL2BEJZR.js} +2 -2
- package/dist/{chunk-KTX7XME6.js → chunk-PAICZOL5.js} +4 -4
- package/dist/{chunk-VU63PDWW.js → chunk-PGV2FLE3.js} +3 -3
- package/dist/{chunk-SAJ5H5VC.js → chunk-POIKHQHR.js} +4 -4
- package/dist/{chunk-JWJ77IMK.js → chunk-POTI6A42.js} +10 -10
- package/dist/{chunk-IKZSQKOE.js → chunk-PTXHQ2CI.js} +3 -3
- package/dist/{chunk-IV7G7NK3.js → chunk-PZKWFRGS.js} +7 -7
- package/dist/{chunk-GOWBYHYW.js → chunk-R6SBP5M5.js} +4 -4
- package/dist/{chunk-RIAZPGHT.js → chunk-RAEG4MA4.js} +2 -2
- package/dist/{chunk-WU2KXA6I.js → chunk-RHKT2XW2.js} +3 -3
- package/dist/{chunk-F56VOHFW.js → chunk-RJTVUM5E.js} +2 -2
- package/dist/{chunk-J44PPGBF.js → chunk-RX7J6VRI.js} +2 -2
- package/dist/{chunk-I2STNAIQ.js → chunk-RYWX6LK4.js} +2 -2
- package/dist/{chunk-HGRC635A.js → chunk-RZ4SBSLP.js} +2 -2
- package/dist/{chunk-5GMHJ7Y5.js → chunk-S2GDYA6R.js} +5 -5
- package/dist/{chunk-S22XIXLL.js → chunk-SA2ERYVV.js} +5 -5
- package/dist/{chunk-6VKHS2BB.js → chunk-SDBNXZ2S.js} +2 -2
- package/dist/{chunk-KQS4ZJGS.js → chunk-SHAEK26Y.js} +4 -4
- package/dist/{chunk-YTIUFMRM.js → chunk-SQD4LGVK.js} +6 -6
- package/dist/{chunk-PIUQYYOM.js → chunk-TBDAH7WC.js} +2 -2
- package/dist/{chunk-IHO2O44S.js → chunk-TE3XYCX7.js} +5 -5
- package/dist/{chunk-6DMUVVON.js → chunk-TJ7NQG7E.js} +4 -4
- package/dist/{chunk-FIF4RQ4S.js → chunk-TMW7RBW7.js} +2 -2
- package/dist/{chunk-Y6C4MYZE.js → chunk-TNQDSTIA.js} +7 -7
- package/dist/{chunk-DWG5SEGW.js → chunk-TOMCXNAO.js} +2 -2
- package/dist/{chunk-NLEO5YI4.js → chunk-TPVSHO75.js} +7 -7
- package/dist/{chunk-MLQYIJTO.js → chunk-U6W2RY3Z.js} +5 -5
- package/dist/{chunk-XNTDEQEB.js → chunk-UD3WDCWD.js} +6 -6
- package/dist/{chunk-ACU7LEFG.js → chunk-UDTA7YWD.js} +2 -2
- package/dist/{chunk-WSYPM3SR.js → chunk-UI5O6J6R.js} +4 -4
- package/dist/{chunk-JQ6HDXKA.js → chunk-VFLNP2ZZ.js} +4 -4
- package/dist/{chunk-7PUSFB3T.js → chunk-W34CCOUM.js} +2 -2
- package/dist/{chunk-WDQRQIT7.js → chunk-WCVVM66J.js} +2 -2
- package/dist/{chunk-NM2FLCPV.js → chunk-WGUY7EIB.js} +5 -5
- package/dist/{chunk-QJK7BNH3.js → chunk-WHCNGWD2.js} +3 -3
- package/dist/{chunk-F3Q4CMRB.js → chunk-WICZ3ZN2.js} +4 -4
- package/dist/{chunk-JUKA4NY5.js → chunk-WMYLF7I2.js} +7 -7
- package/dist/{chunk-KN7C6R6L.js → chunk-XIWKN7DO.js} +17 -17
- package/dist/chunk-XK77FY42.js +59 -0
- package/dist/chunk-XK77FY42.js.map +1 -0
- package/dist/{chunk-43UFSKEK.js → chunk-XO4ZUHVH.js} +3 -3
- package/dist/{chunk-R53ZOW4B.js → chunk-XP522FFM.js} +3 -3
- package/dist/{chunk-WGNLG2W2.js → chunk-XRGJVS4P.js} +2 -2
- package/dist/{chunk-FPKVHR5L.js → chunk-XRUW7DMH.js} +2 -2
- package/dist/{chunk-QOLIBVGS.js → chunk-YGYQC7MT.js} +4 -4
- package/dist/{chunk-LB27LKG3.js → chunk-YTVXT5TD.js} +6 -6
- package/dist/{chunk-AQC67NQZ.js → chunk-Z4DKVLYG.js} +8 -8
- package/dist/{chunk-U4QUDFPJ.js → chunk-Z4O3F6KU.js} +4 -4
- package/dist/{chunk-3WAAL3KN.js → chunk-Z56F6M3G.js} +7 -7
- package/dist/{chunk-CKAVTWXP.js → chunk-ZGWEFOW6.js} +4 -4
- package/dist/{chunk-WC3W36AM.js → chunk-ZOUWHGV3.js} +4 -4
- package/dist/data-display/AsyncStateContainer.js +6 -6
- package/dist/data-display/Avatar.js +4 -4
- package/dist/data-display/Badge.js +8 -6
- package/dist/data-display/CardKit.js +9 -9
- package/dist/data-display/Carousel.js +10 -8
- package/dist/data-display/Chart.js +16 -14
- package/dist/data-display/DataGrid.js +7 -5
- package/dist/data-display/DataViews.js +84 -82
- package/dist/data-display/EmptyState.js +2 -2
- package/dist/data-display/FleetMap.js +22 -20
- package/dist/data-display/InteractiveTooltip.js +2 -2
- package/dist/data-display/LazyImage.js +3 -3
- package/dist/data-display/Lightbox.js +6 -6
- package/dist/data-display/LoadingState.js +3 -3
- package/dist/data-display/MapPreview.js +7 -7
- package/dist/data-display/Progress.js +2 -2
- package/dist/data-display/SectionOnboarding.js +3 -3
- package/dist/data-display/Sheet.js +9 -7
- package/dist/data-display/StatCard.js +3 -3
- package/dist/data-display/Table.js +8 -6
- package/dist/feedback/ConfirmAction.js +6 -6
- package/dist/feedback/Dialog.js +2 -2
- package/dist/form/AddressAutocomplete.js +7 -7
- package/dist/form/Autocomplete.js +1 -1
- package/dist/form/Calendar.js +6 -6
- package/dist/form/CategorySelect.js +9 -9
- package/dist/form/CodeEditor.js +3 -3
- package/dist/form/Command.js +7 -5
- package/dist/form/DateRangePicker.js +9 -9
- package/dist/form/Label.js +7 -5
- package/dist/form/Menubar.js +10 -8
- package/dist/form/RichTextEditor.js +2 -2
- package/dist/form/Switch.js +2 -2
- package/dist/form/total-form.js +20 -20
- package/dist/icons.js +9 -7
- package/dist/layout/Box.js +8 -6
- package/dist/layout/ContentToolbar.js +10 -10
- package/dist/layout/ScrollArea.js +3 -3
- package/dist/layout/SettingCard.js +21 -19
- package/dist/layout/SettingsLayout.js +4 -4
- package/dist/layout/Skeleton.js +2 -2
- package/dist/layout/Stack.js +9 -7
- package/dist/navigation/AppHeader.js +19 -17
- package/dist/navigation/CommandPalette.js +3 -3
- package/dist/navigation/NavigationMenu.js +5 -5
- package/dist/navigation/SectionNav.js +14 -12
- package/dist/navigation/Tabs.js +2 -2
- package/dist/provider.js +8 -6
- package/dist/tokens.js +21 -5
- package/dist/types/provider/mui-bridge.d.ts.map +1 -1
- package/dist/types/test-utils/must.d.ts +12 -0
- package/dist/types/test-utils/must.d.ts.map +1 -0
- package/dist/types/tokens/density-overrides.d.ts +2 -14
- package/dist/types/tokens/density-overrides.d.ts.map +1 -1
- package/dist/types/tokens/density-overrides.navigation.d.ts +17 -0
- package/dist/types/tokens/density-overrides.navigation.d.ts.map +1 -0
- package/dist/types/tokens/density-overrides.selection.d.ts +16 -0
- package/dist/types/tokens/density-overrides.selection.d.ts.map +1 -0
- package/dist/types/tokens/density.d.ts +18 -11
- package/dist/types/tokens/density.d.ts.map +1 -1
- package/dist/types/tokens/scales.d.ts +1 -1
- package/dist/types/tokens/scales.d.ts.map +1 -1
- package/dist/user-avatar.js +5 -5
- package/dist/utility/InstallPrompt.js +4 -4
- package/dist/utility/WorkflowStep.js +5 -3
- package/package.json +1 -1
- package/src/provider/mui-bridge.ts +15 -3
- package/src/test-utils/must.ts +16 -0
- package/src/tokens/density-overrides.navigation.ts +226 -0
- package/src/tokens/density-overrides.selection.ts +210 -0
- package/src/tokens/density-overrides.ts +15 -208
- package/src/tokens/density.ts +30 -11
- package/src/tokens/scales.ts +10 -3
- package/dist/chunk-5D52CMNX.js.map +0 -1
- package/dist/chunk-BIDPJNCG.js.map +0 -1
- package/dist/chunk-TMOC2XUE.js.map +0 -1
- /package/dist/{chunk-4A7PSQB5.js.map → chunk-2H5SYAJW.js.map} +0 -0
- /package/dist/{chunk-XFAXRMWY.js.map → chunk-2OEFIGH7.js.map} +0 -0
- /package/dist/{chunk-2YKTB2IZ.js.map → chunk-32JMSHEA.js.map} +0 -0
- /package/dist/{chunk-HR7YTBR7.js.map → chunk-3AOOI2NR.js.map} +0 -0
- /package/dist/{chunk-KYQ4OORF.js.map → chunk-3LB4ZIZS.js.map} +0 -0
- /package/dist/{chunk-2NYVMLFQ.js.map → chunk-3MJHHPRW.js.map} +0 -0
- /package/dist/{chunk-P2OQ4IGP.js.map → chunk-3PURWPNX.js.map} +0 -0
- /package/dist/{chunk-NLYNRE7L.js.map → chunk-3RUCLKAK.js.map} +0 -0
- /package/dist/{chunk-FS7UVKEE.js.map → chunk-42GG3BPF.js.map} +0 -0
- /package/dist/{chunk-CGL7R37P.js.map → chunk-43Q6CVPB.js.map} +0 -0
- /package/dist/{chunk-G6II7SVX.js.map → chunk-44USLRMT.js.map} +0 -0
- /package/dist/{chunk-4WCDMCIS.js.map → chunk-4CHYMTBT.js.map} +0 -0
- /package/dist/{chunk-HISEWACT.js.map → chunk-4GRUNQNB.js.map} +0 -0
- /package/dist/{chunk-HN3PZTUK.js.map → chunk-4MKVGSHX.js.map} +0 -0
- /package/dist/{chunk-E4GTZ26X.js.map → chunk-4YL3TQ6C.js.map} +0 -0
- /package/dist/{chunk-5OX6KZIZ.js.map → chunk-52MYWALU.js.map} +0 -0
- /package/dist/{chunk-5OEC546C.js.map → chunk-54HTXJJ2.js.map} +0 -0
- /package/dist/{chunk-NRI2TZDS.js.map → chunk-5FHPZOYK.js.map} +0 -0
- /package/dist/{chunk-JAHWFJCW.js.map → chunk-5JCGBCFJ.js.map} +0 -0
- /package/dist/{chunk-LTJDZIYR.js.map → chunk-66XTP3IT.js.map} +0 -0
- /package/dist/{chunk-LHTEAPYG.js.map → chunk-6JGATEOF.js.map} +0 -0
- /package/dist/{chunk-CMLIWUBW.js.map → chunk-6PPHALM3.js.map} +0 -0
- /package/dist/{chunk-6KLDYVRY.js.map → chunk-77BKKPCI.js.map} +0 -0
- /package/dist/{chunk-AG3DY5TH.js.map → chunk-ADSA76T7.js.map} +0 -0
- /package/dist/{chunk-25OI5W6Y.js.map → chunk-AH4XGLE2.js.map} +0 -0
- /package/dist/{chunk-CACBJ4CR.js.map → chunk-AJAPP56P.js.map} +0 -0
- /package/dist/{chunk-CGBUWNNQ.js.map → chunk-ALOUJ3CE.js.map} +0 -0
- /package/dist/{chunk-GMC3F43L.js.map → chunk-AMSNWV7V.js.map} +0 -0
- /package/dist/{chunk-MWPXKZ7O.js.map → chunk-AY5MY7HJ.js.map} +0 -0
- /package/dist/{chunk-E32YPPF5.js.map → chunk-B4Y6W3OU.js.map} +0 -0
- /package/dist/{chunk-2K2B5QM2.js.map → chunk-BEGTLELZ.js.map} +0 -0
- /package/dist/{chunk-QMSCRKR6.js.map → chunk-C7GYSLPO.js.map} +0 -0
- /package/dist/{chunk-MQ277OLB.js.map → chunk-CM2Q7IH3.js.map} +0 -0
- /package/dist/{chunk-UG636FEL.js.map → chunk-CMFJQH6A.js.map} +0 -0
- /package/dist/{chunk-FQT4C5R4.js.map → chunk-CZBCOMOX.js.map} +0 -0
- /package/dist/{chunk-DSDNGTH6.js.map → chunk-DH6SL3SY.js.map} +0 -0
- /package/dist/{chunk-4CBM7JNK.js.map → chunk-DLDL6P6G.js.map} +0 -0
- /package/dist/{chunk-PP7CDKO4.js.map → chunk-DLS5CUI3.js.map} +0 -0
- /package/dist/{chunk-ZVJSY2OV.js.map → chunk-EF5XUS44.js.map} +0 -0
- /package/dist/{chunk-WDAEYLT5.js.map → chunk-EONMVYVY.js.map} +0 -0
- /package/dist/{chunk-6PU3JYVY.js.map → chunk-F3AYISXT.js.map} +0 -0
- /package/dist/{chunk-H5XKBPKK.js.map → chunk-FJZHHARA.js.map} +0 -0
- /package/dist/{chunk-EWVJJ32N.js.map → chunk-FRAW3ICP.js.map} +0 -0
- /package/dist/{chunk-ST36ZSAN.js.map → chunk-FRIUYEXD.js.map} +0 -0
- /package/dist/{chunk-IGGXKT5B.js.map → chunk-G2WERTWZ.js.map} +0 -0
- /package/dist/{chunk-JYLOCXMV.js.map → chunk-GI63FQEJ.js.map} +0 -0
- /package/dist/{chunk-FVKBP3UX.js.map → chunk-GLKQT2DS.js.map} +0 -0
- /package/dist/{chunk-UILH4OAZ.js.map → chunk-GPHURU2K.js.map} +0 -0
- /package/dist/{chunk-MEYKNJNI.js.map → chunk-GT6HPOS2.js.map} +0 -0
- /package/dist/{chunk-5NFQKL7C.js.map → chunk-H6K3AP42.js.map} +0 -0
- /package/dist/{chunk-VOG5IVQW.js.map → chunk-H6N7XXUB.js.map} +0 -0
- /package/dist/{chunk-KESGVMHW.js.map → chunk-H6OBK5QP.js.map} +0 -0
- /package/dist/{chunk-ZL3GCUKC.js.map → chunk-HI3VE276.js.map} +0 -0
- /package/dist/{chunk-YXU45AVO.js.map → chunk-HKBJZX3C.js.map} +0 -0
- /package/dist/{chunk-YRACC6BB.js.map → chunk-HRNDWD25.js.map} +0 -0
- /package/dist/{chunk-JE6RZ5L6.js.map → chunk-IABE56TG.js.map} +0 -0
- /package/dist/{chunk-3CDU7DLD.js.map → chunk-IKXS2YVQ.js.map} +0 -0
- /package/dist/{chunk-BU6TCB76.js.map → chunk-INCTNS4X.js.map} +0 -0
- /package/dist/{chunk-2ZRZTGWP.js.map → chunk-ISW5K72V.js.map} +0 -0
- /package/dist/{chunk-EKWH4LGM.js.map → chunk-J5YNQZLQ.js.map} +0 -0
- /package/dist/{chunk-AEJ3FFNE.js.map → chunk-JJIEJI4C.js.map} +0 -0
- /package/dist/{chunk-OBID7SOG.js.map → chunk-JNAULEYH.js.map} +0 -0
- /package/dist/{chunk-UJOFRJLX.js.map → chunk-JSGVYOMN.js.map} +0 -0
- /package/dist/{chunk-ZRIWMIHK.js.map → chunk-JVOV5WAJ.js.map} +0 -0
- /package/dist/{chunk-ZCXVTFYQ.js.map → chunk-KG64HV34.js.map} +0 -0
- /package/dist/{chunk-CO4MSWTV.js.map → chunk-LCWGNDTH.js.map} +0 -0
- /package/dist/{chunk-THCDUP6Q.js.map → chunk-LGCRL7DK.js.map} +0 -0
- /package/dist/{chunk-BPOVRMVS.js.map → chunk-LXEQR6EI.js.map} +0 -0
- /package/dist/{chunk-WAD5VL6B.js.map → chunk-LZQQ4JXY.js.map} +0 -0
- /package/dist/{chunk-FWPFCK4D.js.map → chunk-NDHDBOUH.js.map} +0 -0
- /package/dist/{chunk-6MN5KOVM.js.map → chunk-NHMFBUBK.js.map} +0 -0
- /package/dist/{chunk-RZPYKTOG.js.map → chunk-NLGJXSGM.js.map} +0 -0
- /package/dist/{chunk-N4HHFYPB.js.map → chunk-NND4UTWS.js.map} +0 -0
- /package/dist/{chunk-2LSJTQIL.js.map → chunk-NPPJ3IJP.js.map} +0 -0
- /package/dist/{chunk-EMEXXAQI.js.map → chunk-NYFGFELX.js.map} +0 -0
- /package/dist/{chunk-H7DVH6KD.js.map → chunk-ODY3PINC.js.map} +0 -0
- /package/dist/{chunk-Q2LQVYXY.js.map → chunk-OL2BEJZR.js.map} +0 -0
- /package/dist/{chunk-KTX7XME6.js.map → chunk-PAICZOL5.js.map} +0 -0
- /package/dist/{chunk-VU63PDWW.js.map → chunk-PGV2FLE3.js.map} +0 -0
- /package/dist/{chunk-SAJ5H5VC.js.map → chunk-POIKHQHR.js.map} +0 -0
- /package/dist/{chunk-JWJ77IMK.js.map → chunk-POTI6A42.js.map} +0 -0
- /package/dist/{chunk-IKZSQKOE.js.map → chunk-PTXHQ2CI.js.map} +0 -0
- /package/dist/{chunk-IV7G7NK3.js.map → chunk-PZKWFRGS.js.map} +0 -0
- /package/dist/{chunk-GOWBYHYW.js.map → chunk-R6SBP5M5.js.map} +0 -0
- /package/dist/{chunk-RIAZPGHT.js.map → chunk-RAEG4MA4.js.map} +0 -0
- /package/dist/{chunk-WU2KXA6I.js.map → chunk-RHKT2XW2.js.map} +0 -0
- /package/dist/{chunk-F56VOHFW.js.map → chunk-RJTVUM5E.js.map} +0 -0
- /package/dist/{chunk-J44PPGBF.js.map → chunk-RX7J6VRI.js.map} +0 -0
- /package/dist/{chunk-I2STNAIQ.js.map → chunk-RYWX6LK4.js.map} +0 -0
- /package/dist/{chunk-HGRC635A.js.map → chunk-RZ4SBSLP.js.map} +0 -0
- /package/dist/{chunk-5GMHJ7Y5.js.map → chunk-S2GDYA6R.js.map} +0 -0
- /package/dist/{chunk-S22XIXLL.js.map → chunk-SA2ERYVV.js.map} +0 -0
- /package/dist/{chunk-6VKHS2BB.js.map → chunk-SDBNXZ2S.js.map} +0 -0
- /package/dist/{chunk-KQS4ZJGS.js.map → chunk-SHAEK26Y.js.map} +0 -0
- /package/dist/{chunk-YTIUFMRM.js.map → chunk-SQD4LGVK.js.map} +0 -0
- /package/dist/{chunk-PIUQYYOM.js.map → chunk-TBDAH7WC.js.map} +0 -0
- /package/dist/{chunk-IHO2O44S.js.map → chunk-TE3XYCX7.js.map} +0 -0
- /package/dist/{chunk-6DMUVVON.js.map → chunk-TJ7NQG7E.js.map} +0 -0
- /package/dist/{chunk-FIF4RQ4S.js.map → chunk-TMW7RBW7.js.map} +0 -0
- /package/dist/{chunk-Y6C4MYZE.js.map → chunk-TNQDSTIA.js.map} +0 -0
- /package/dist/{chunk-DWG5SEGW.js.map → chunk-TOMCXNAO.js.map} +0 -0
- /package/dist/{chunk-NLEO5YI4.js.map → chunk-TPVSHO75.js.map} +0 -0
- /package/dist/{chunk-MLQYIJTO.js.map → chunk-U6W2RY3Z.js.map} +0 -0
- /package/dist/{chunk-XNTDEQEB.js.map → chunk-UD3WDCWD.js.map} +0 -0
- /package/dist/{chunk-ACU7LEFG.js.map → chunk-UDTA7YWD.js.map} +0 -0
- /package/dist/{chunk-WSYPM3SR.js.map → chunk-UI5O6J6R.js.map} +0 -0
- /package/dist/{chunk-JQ6HDXKA.js.map → chunk-VFLNP2ZZ.js.map} +0 -0
- /package/dist/{chunk-7PUSFB3T.js.map → chunk-W34CCOUM.js.map} +0 -0
- /package/dist/{chunk-WDQRQIT7.js.map → chunk-WCVVM66J.js.map} +0 -0
- /package/dist/{chunk-NM2FLCPV.js.map → chunk-WGUY7EIB.js.map} +0 -0
- /package/dist/{chunk-QJK7BNH3.js.map → chunk-WHCNGWD2.js.map} +0 -0
- /package/dist/{chunk-F3Q4CMRB.js.map → chunk-WICZ3ZN2.js.map} +0 -0
- /package/dist/{chunk-JUKA4NY5.js.map → chunk-WMYLF7I2.js.map} +0 -0
- /package/dist/{chunk-KN7C6R6L.js.map → chunk-XIWKN7DO.js.map} +0 -0
- /package/dist/{chunk-43UFSKEK.js.map → chunk-XO4ZUHVH.js.map} +0 -0
- /package/dist/{chunk-R53ZOW4B.js.map → chunk-XP522FFM.js.map} +0 -0
- /package/dist/{chunk-WGNLG2W2.js.map → chunk-XRGJVS4P.js.map} +0 -0
- /package/dist/{chunk-FPKVHR5L.js.map → chunk-XRUW7DMH.js.map} +0 -0
- /package/dist/{chunk-QOLIBVGS.js.map → chunk-YGYQC7MT.js.map} +0 -0
- /package/dist/{chunk-LB27LKG3.js.map → chunk-YTVXT5TD.js.map} +0 -0
- /package/dist/{chunk-AQC67NQZ.js.map → chunk-Z4DKVLYG.js.map} +0 -0
- /package/dist/{chunk-U4QUDFPJ.js.map → chunk-Z4O3F6KU.js.map} +0 -0
- /package/dist/{chunk-3WAAL3KN.js.map → chunk-Z56F6M3G.js.map} +0 -0
- /package/dist/{chunk-CKAVTWXP.js.map → chunk-ZGWEFOW6.js.map} +0 -0
- /package/dist/{chunk-WC3W36AM.js.map → chunk-ZOUWHGV3.js.map} +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { tableCellClasses } from '@mui/material/TableCell/index.js';
|
|
2
|
+
import type { Components, CSSObject, Theme } from '@mui/material/styles/index.js';
|
|
3
|
+
|
|
4
|
+
import { rem, rems } from './relative';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TOGGLEBUTTON / TAB / TABLECELL / PAGINATIONITEM / SLIDER GEOMETRY,
|
|
8
|
+
* DENSITY-AWARE (FUT-2768).
|
|
9
|
+
*
|
|
10
|
+
* The remainder of the fixed-px geometry the density audit catalogued, none
|
|
11
|
+
* of it hard-coded in `@12-apps/ui`'s own source. Verified against the
|
|
12
|
+
* installed `@mui/material@6.5.0` source; each goes through the SAME
|
|
13
|
+
* per-size/per-slot `overridesResolver` key MUI itself resolves
|
|
14
|
+
* (`iconButtonDensityOverrides`/`chipDensityOverrides`'s own mechanism), so a
|
|
15
|
+
* theme value composes with MUI's baked-in `variants` instead of replacing
|
|
16
|
+
* them outright:
|
|
17
|
+
*
|
|
18
|
+
* - `ToggleButton`: `padding: 11/7/15` at medium(root)/small/large — same
|
|
19
|
+
* `root`/`sizeSmall`/`sizeLarge` shape as `iconButtonDensityOverrides`.
|
|
20
|
+
* - `Tab`: `minHeight: 48`, `padding: '12px 16px'` on the root (via `rems()`).
|
|
21
|
+
* The icon+label combo (`minHeight: 72`, `paddingTop`/`Bottom: 9`) is a
|
|
22
|
+
* SEPARATE MUI variant, exposed as the `labelIcon` key.
|
|
23
|
+
* - `TableCell`: `padding: 16` on the root, `'6px 16px'` at small, nested
|
|
24
|
+
* inside it `'0 12px 0 16px'` on the small+checkbox combo — all gated on
|
|
25
|
+
* `ownerState.padding === 'normal'` (MUI's default): `checkbox`/`none` are
|
|
26
|
+
* separate variants with their OWN unscaled padding (`'0 0 0 4px'`/`0`) an
|
|
27
|
+
* unconditional rule clobbered at every size but small (FUT-2861 review —
|
|
28
|
+
* the SAME Lesson-1 clobber the ellipsis fix above avoids, missed here).
|
|
29
|
+
* `@12-apps/ui`'s own `Table` (FUT-2769) wins regardless (two classes deep
|
|
30
|
+
* under its styled root); this reaches a BARE `<TableCell>`.
|
|
31
|
+
* - `PaginationItem`: `minWidth/height: 32/26/40` at medium(root)/small/large.
|
|
32
|
+
* The ellipsis shares the SAME slot and `minWidth` but has NO `height` of
|
|
33
|
+
* its own (`'auto'`), gated on `ownerState.type` being neither
|
|
34
|
+
* `'start-ellipsis'` nor `'end-ellipsis'` — skipping it would force a
|
|
35
|
+
* height onto the ellipsis (Lesson 1).
|
|
36
|
+
* - `Slider`: rail `height: 4/2` at `orientation="horizontal"`/`size="small"`
|
|
37
|
+
* — gated on `ownerState.orientation` since the SAME key answers for either
|
|
38
|
+
* axis (MUI sets `height` horizontal / `width` vertical, leaving the other
|
|
39
|
+
* `'100%'`). Thumb `20×20`/`12×12` needs no gate. `@12-apps/ui`'s own
|
|
40
|
+
* `Slider` already sets rail/thumb size through `rem()` and never forwards
|
|
41
|
+
* `size` — a no-op THERE, reaches a BARE `<Slider>`. The thumb's ring and
|
|
42
|
+
* the value-label offset were checked and left OUT — that story's own doc.
|
|
43
|
+
*
|
|
44
|
+
* `Avatar` is NOT in this file: `@12-apps/ui`'s own `Avatar` wraps `MuiAvatar`
|
|
45
|
+
* in a `StyledAvatar` that ALREADY sets `width`/`height` through
|
|
46
|
+
* `rem(theme, boxPx(size))` (`40` at `md`) — higher specificity than any
|
|
47
|
+
* `MuiAvatar.styleOverrides.root`, dead code here, so it ships none.
|
|
48
|
+
*
|
|
49
|
+
* Geometry-neutral at `normal`; each slot a MODULE-LEVEL function, as above.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
const toggleButtonRootPadding = ({ theme }: { theme: Theme }): CSSObject => ({ padding: rem(theme, 11) });
|
|
53
|
+
const toggleButtonSmallPadding = ({ theme }: { theme: Theme }): CSSObject => ({ padding: rem(theme, 7) });
|
|
54
|
+
const toggleButtonLargePadding = ({ theme }: { theme: Theme }): CSSObject => ({ padding: rem(theme, 15) });
|
|
55
|
+
|
|
56
|
+
/** `MuiToggleButton`'s own padding, at every size MUI has. */
|
|
57
|
+
export function toggleButtonDensityOverrides(): Components<Theme> {
|
|
58
|
+
return {
|
|
59
|
+
MuiToggleButton: {
|
|
60
|
+
styleOverrides: {
|
|
61
|
+
root: toggleButtonRootPadding,
|
|
62
|
+
sizeSmall: toggleButtonSmallPadding,
|
|
63
|
+
sizeLarge: toggleButtonLargePadding,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const tabRootGeometry = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
70
|
+
minHeight: rem(theme, 48),
|
|
71
|
+
padding: rems(theme, 12, 16),
|
|
72
|
+
});
|
|
73
|
+
const tabLabelIconGeometry = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
74
|
+
minHeight: rem(theme, 72),
|
|
75
|
+
paddingTop: rem(theme, 9),
|
|
76
|
+
paddingBottom: rem(theme, 9),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/** `MuiTab`'s own root height/padding, and the icon+label combo's taller box. */
|
|
80
|
+
export function tabDensityOverrides(): Components<Theme> {
|
|
81
|
+
return {
|
|
82
|
+
MuiTab: {
|
|
83
|
+
styleOverrides: {
|
|
84
|
+
root: tabRootGeometry,
|
|
85
|
+
labelIcon: tabLabelIconGeometry,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
interface TableCellOwnerStateForOverrides {
|
|
92
|
+
padding?: 'normal' | 'checkbox' | 'none';
|
|
93
|
+
}
|
|
94
|
+
type TableCellStyleFn = (props: { theme: Theme; ownerState?: TableCellOwnerStateForOverrides }) => CSSObject;
|
|
95
|
+
const isDefaultTableCellPadding = (padding: TableCellOwnerStateForOverrides['padding']): boolean =>
|
|
96
|
+
padding === undefined || padding === 'normal';
|
|
97
|
+
|
|
98
|
+
const tableCellRootPadding: TableCellStyleFn = ({ theme, ownerState }) =>
|
|
99
|
+
isDefaultTableCellPadding(ownerState?.padding) ? { padding: rem(theme, 16) } : {};
|
|
100
|
+
|
|
101
|
+
const tableCellSmallPadding: TableCellStyleFn = ({ theme, ownerState }) => {
|
|
102
|
+
const style: CSSObject = {
|
|
103
|
+
[`&.${tableCellClasses.paddingCheckbox}`]: { padding: rems(theme, 0, 12, 0, 16) },
|
|
104
|
+
};
|
|
105
|
+
if (isDefaultTableCellPadding(ownerState?.padding)) style.padding = rems(theme, 6, 16);
|
|
106
|
+
return style;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** Reaches a BARE `<TableCell>` only — module doc comment above. */
|
|
110
|
+
export function tableCellDensityOverrides(): Components<Theme> {
|
|
111
|
+
return {
|
|
112
|
+
MuiTableCell: {
|
|
113
|
+
styleOverrides: {
|
|
114
|
+
root: tableCellRootPadding,
|
|
115
|
+
sizeSmall: tableCellSmallPadding,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** The `ownerState` field that tells the ellipsis item apart from a real button. */
|
|
122
|
+
interface PaginationItemOwnerStateForOverrides {
|
|
123
|
+
type?: 'page' | 'first' | 'last' | 'start-ellipsis' | 'end-ellipsis' | 'previous' | 'next';
|
|
124
|
+
}
|
|
125
|
+
type PaginationItemStyleFn = (props: {
|
|
126
|
+
theme: Theme;
|
|
127
|
+
ownerState?: PaginationItemOwnerStateForOverrides;
|
|
128
|
+
}) => CSSObject;
|
|
129
|
+
|
|
130
|
+
const isPaginationEllipsis = (type: PaginationItemOwnerStateForOverrides['type']): boolean =>
|
|
131
|
+
type === 'start-ellipsis' || type === 'end-ellipsis';
|
|
132
|
+
|
|
133
|
+
/** `minWidth` always; `height` only off the ellipsis, which has none of its own. */
|
|
134
|
+
function paginationItemGeometryAt(px: number): PaginationItemStyleFn {
|
|
135
|
+
return ({ theme, ownerState }) => {
|
|
136
|
+
const style: CSSObject = { minWidth: rem(theme, px) };
|
|
137
|
+
if (!isPaginationEllipsis(ownerState?.type)) style.height = rem(theme, px);
|
|
138
|
+
return style;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
const paginationItemRootGeometry = paginationItemGeometryAt(32);
|
|
142
|
+
const paginationItemSmallGeometry = paginationItemGeometryAt(26);
|
|
143
|
+
const paginationItemLargeGeometry = paginationItemGeometryAt(40);
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* `MuiPaginationItem`'s own `minWidth`/`height`, at every size MUI has —
|
|
147
|
+
* `height` skipped on the ellipsis item, which has none of its own (`auto`).
|
|
148
|
+
*/
|
|
149
|
+
export function paginationItemDensityOverrides(): Components<Theme> {
|
|
150
|
+
return {
|
|
151
|
+
MuiPaginationItem: {
|
|
152
|
+
styleOverrides: {
|
|
153
|
+
root: paginationItemRootGeometry,
|
|
154
|
+
sizeSmall: paginationItemSmallGeometry,
|
|
155
|
+
sizeLarge: paginationItemLargeGeometry,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** The `ownerState` field that tells which axis the rail's `height`/`4` reads as. */
|
|
162
|
+
interface SliderOwnerStateForOverrides {
|
|
163
|
+
orientation?: 'horizontal' | 'vertical';
|
|
164
|
+
}
|
|
165
|
+
type SliderStyleFn = (props: { theme: Theme; ownerState?: SliderOwnerStateForOverrides }) => CSSObject;
|
|
166
|
+
|
|
167
|
+
/** The rail's `4`/`2` reads as `height` for a horizontal slider, `width` for a vertical one. */
|
|
168
|
+
function sliderRailAxisAt(px: number): SliderStyleFn {
|
|
169
|
+
return ({ theme, ownerState }) =>
|
|
170
|
+
ownerState?.orientation === 'vertical' ? { width: rem(theme, px) } : { height: rem(theme, px) };
|
|
171
|
+
}
|
|
172
|
+
const sliderRootGeometry = sliderRailAxisAt(4);
|
|
173
|
+
const sliderSmallGeometry = sliderRailAxisAt(2);
|
|
174
|
+
const sliderThumbGeometry = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
175
|
+
width: rem(theme, 20),
|
|
176
|
+
height: rem(theme, 20),
|
|
177
|
+
});
|
|
178
|
+
const sliderThumbSmallGeometry = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
179
|
+
width: rem(theme, 12),
|
|
180
|
+
height: rem(theme, 12),
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
/** `MuiSlider`'s own rail thickness (root/sizeSmall) and thumb box (thumb/thumbSizeSmall). */
|
|
184
|
+
export function sliderDensityOverrides(): Components<Theme> {
|
|
185
|
+
return {
|
|
186
|
+
MuiSlider: {
|
|
187
|
+
styleOverrides: {
|
|
188
|
+
root: sliderRootGeometry,
|
|
189
|
+
sizeSmall: sliderSmallGeometry,
|
|
190
|
+
thumb: sliderThumbGeometry,
|
|
191
|
+
thumbSizeSmall: sliderThumbSmallGeometry,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* `MuiTabs`' own indicator thickness (`height: 2` horizontal, `width: 2`
|
|
199
|
+
* vertical) — one short of `Tab` in the ticket's own literal list, added
|
|
200
|
+
* after a FUT-2767-review pass over state/orientation-gated literals; same
|
|
201
|
+
* orientation gate as the Slider rail. `@12-apps/ui`'s own `Tabs` draws its
|
|
202
|
+
* OWN 3px indicator through `rem()` already, blocking THIS override there —
|
|
203
|
+
* `tabDensityOverrides` reaches `Tab.root`'s `minHeight` instead (both
|
|
204
|
+
* measured in `density-wrapper-reach.test.stories.tsx`).
|
|
205
|
+
*/
|
|
206
|
+
interface TabsIndicatorOwnerStateForOverrides {
|
|
207
|
+
orientation?: 'horizontal' | 'vertical';
|
|
208
|
+
}
|
|
209
|
+
type TabsIndicatorStyleFn = (props: {
|
|
210
|
+
theme: Theme;
|
|
211
|
+
ownerState?: TabsIndicatorOwnerStateForOverrides;
|
|
212
|
+
}) => CSSObject;
|
|
213
|
+
|
|
214
|
+
const tabsIndicatorAxisAt: TabsIndicatorStyleFn = ({ theme, ownerState }) =>
|
|
215
|
+
ownerState?.orientation === 'vertical' ? { width: rem(theme, 2) } : { height: rem(theme, 2) };
|
|
216
|
+
|
|
217
|
+
/** `MuiTabs`' own indicator thickness, by orientation. */
|
|
218
|
+
export function tabsIndicatorDensityOverrides(): Components<Theme> {
|
|
219
|
+
return {
|
|
220
|
+
MuiTabs: {
|
|
221
|
+
styleOverrides: {
|
|
222
|
+
indicator: tabsIndicatorAxisAt,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { switchClasses } from '@mui/material/Switch/index.js';
|
|
2
|
+
import type { Components, CSSObject, Theme } from '@mui/material/styles/index.js';
|
|
3
|
+
|
|
4
|
+
import { rem, rems } from './relative';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* CHECKBOX / RADIO / SWITCH GEOMETRY, DENSITY-AWARE (FUT-2767).
|
|
8
|
+
*
|
|
9
|
+
* `Checkbox`/`Radio`/`Switch` are MUI's own components, unwrapped — but
|
|
10
|
+
* **only two of the three `@12-apps/ui` wrappers actually forward their
|
|
11
|
+
* geometry to MUI**, corrected here after an earlier revision of this doc
|
|
12
|
+
* comment claimed all three did.
|
|
13
|
+
*
|
|
14
|
+
* - `Checkbox.tsx`'s `StyledCheckbox` and `RadioGroup.variants.tsx`'s
|
|
15
|
+
* `DefaultRadios` (the ONLY variant rendering a raw `<Radio>` — `cards`/
|
|
16
|
+
* `buttons`/`segments` draw custom controls, outside this ticket) set NO
|
|
17
|
+
* `padding` of their own, so `checkboxRadioDensityOverrides()` reaches
|
|
18
|
+
* both directly — confirmed by a real render, same computed padding as
|
|
19
|
+
* raw `MuiCheckbox`/`MuiRadio` at both densities
|
|
20
|
+
* (`density-overrides.test.stories.tsx`'s `ui-checkbox`/`ui-radio-group`).
|
|
21
|
+
* - `Switch.styles.ts`'s `switchSx` is DIFFERENT: it draws root/switchBase/
|
|
22
|
+
* thumb geometry itself, per instance, from its own `SWITCH_SIZES` table
|
|
23
|
+
* (`Switch.metrics.ts`), every number already through `rem(theme, px)`.
|
|
24
|
+
* `Switch.parts.tsx`'s `StyledSwitch = styled(MuiSwitch, {...})(...)`
|
|
25
|
+
* composes these as an OUTER wrapper class whose nested `& .MuiSwitch-
|
|
26
|
+
* switchBase`/`& .MuiSwitch-thumb` selectors are a TWO-class compound —
|
|
27
|
+
* higher specificity than this file's `MuiSwitch.styleOverrides.
|
|
28
|
+
* switchBase`/`thumb`, which compose onto a single-class generated class.
|
|
29
|
+
* `switchDensityOverrides()` therefore has **NO effect on `@12-apps/ui`'s
|
|
30
|
+
* own `<Switch>`** — it only reaches a raw `@mui/material/Switch` consumer
|
|
31
|
+
* (a host's own `Table.tsx` density-toggle column, say). Not a gap:
|
|
32
|
+
* `switchSx` already reacts to `theme.typography.fontSize` on its own —
|
|
33
|
+
* including the CHECKED thumb's own travel distance, computed as
|
|
34
|
+
* `rem(theme, width - thumbSize - padding * 2)` from the SAME per-instance
|
|
35
|
+
* geometry, so it moves consistently with no help from this file.
|
|
36
|
+
* Confirmed by measurement, both sizes, both states, both densities
|
|
37
|
+
* (`ui-switch-*` cases); documented at `Switch.md`'s "Density" section.
|
|
38
|
+
*
|
|
39
|
+
* **The ticket's open question — does a `MuiSwitchBase` theme override reach
|
|
40
|
+
* `Checkbox`/`Radio` at all? — is NO, verified two ways.** `Checkbox`/`Radio`
|
|
41
|
+
* both render through `internal/SwitchBase.js`'s `SwitchBaseRoot`, which is
|
|
42
|
+
* `styled(ButtonBase, { name: 'MuiSwitchBase' })({ padding: 9, ... })` — with
|
|
43
|
+
* NO `slot` key. `@mui/system`'s `createStyled.js` computes
|
|
44
|
+
* `overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(slot))`,
|
|
45
|
+
* and `defaultOverridesResolver` (`if (!slot) return null`) returns `null`
|
|
46
|
+
* for an absent slot; the styled call itself then only pushes its
|
|
47
|
+
* `styleThemeOverrides` expression `if (componentName && overridesResolver)`
|
|
48
|
+
* — `null` is falsy, so for THIS styled call `theme.components.MuiSwitchBase
|
|
49
|
+
* .styleOverrides` is never read at all. (`variants` is a SEPARATE check,
|
|
50
|
+
* gated on `skipVariantsResolver` rather than `overridesResolver`, which is
|
|
51
|
+
* why the ticket's own two-part specificity proof for Chip's label — probing
|
|
52
|
+
* with `variants` — does not transfer here; `styleOverrides` is what dies.)
|
|
53
|
+
* A render-level probe confirms it: a theme with `components.MuiSwitchBase
|
|
54
|
+
* .styleOverrides.root = { padding: '999px' }`, rendering `<Switch />`,
|
|
55
|
+
* `<Checkbox />` and `<Radio />` through it, leaves EVERY ONE of `.MuiSwitch-
|
|
56
|
+
* switchBase`, `.MuiCheckbox-root` and `.MuiRadio-root` at their unthemed
|
|
57
|
+
* padding (`9px`/`4px` — see below), never `999px`. The Decision's own
|
|
58
|
+
* suggested `MuiSwitchBase` route is therefore the ticket's documented
|
|
59
|
+
* fallback in disguise: this file skips straight to duplicating the override
|
|
60
|
+
* under `MuiCheckbox` and `MuiRadio`, each independently confirmed LIVE by
|
|
61
|
+
* the same probe (`components.MuiCheckbox.styleOverrides.root.padding` DOES
|
|
62
|
+
* reach `.MuiCheckbox-root`, and the same for `MuiRadio`).
|
|
63
|
+
*
|
|
64
|
+
* - `Checkbox`/`Radio` (`internal/SwitchBase.js`, `Checkbox.js`, `Radio.js`):
|
|
65
|
+
* `padding: 9` — constant across `size="small"`/`"medium"` today (neither
|
|
66
|
+
* `CheckboxRoot` nor `RadioRoot` carries a size-conditional padding rule),
|
|
67
|
+
* so ONE `root` override, no `sizeSmall`/`sizeMedium` split, covers both
|
|
68
|
+
* sizes without disturbing the glyph-driven size difference FUT-2585 left
|
|
69
|
+
* alone.
|
|
70
|
+
* - `Switch` (`Switch.js`): root (the track) `width: 34+12*2`, `height:
|
|
71
|
+
* 14+12*2`, `padding: 12` (medium); `switchBase` (the thumb's absolutely-
|
|
72
|
+
* positioned wrapper) — its OWN literal is NOT the `12` the ticket's
|
|
73
|
+
* Decision sketch names (that `12` is `SwitchRoot`'s own padding, a
|
|
74
|
+
* DIFFERENT slot); `switchBase` inherits `internal/SwitchBase.js`'s generic
|
|
75
|
+
* `padding: 9` unmodified at medium (`SwitchSwitchBase`'s own styles never
|
|
76
|
+
* set `padding`), confirmed by the same render probe with NO theme
|
|
77
|
+
* override at all (`.MuiSwitch-switchBase` computed padding: `9px`). This
|
|
78
|
+
* file overrides `MuiSwitch.styleOverrides.switchBase` (a LIVE key —
|
|
79
|
+
* `SwitchSwitchBase = styled(SwitchBase, { name: 'MuiSwitch', slot:
|
|
80
|
+
* 'SwitchBase', ... })` DOES pass a `slot`) with `rem(theme, 9)`, the
|
|
81
|
+
* MEASURED default, not the ticket's `12` — using `12` here would move
|
|
82
|
+
* today's real 9px to 12px at `density: 'normal'`, failing the Done-when's
|
|
83
|
+
* own pixel-identical requirement, so the number is corrected against the
|
|
84
|
+
* probe rather than the sketch. `thumb`: `20×20`, unconditional.
|
|
85
|
+
* - `Switch` `size="small"` (`:82-100`, a `variants` entry on `SwitchRoot`
|
|
86
|
+
* itself): root `width: 40`, `height: 24`, `padding: 7`; a NESTED `&
|
|
87
|
+
* .${switchClasses.switchBase}` selector sets `padding: 4` (not 9); a
|
|
88
|
+
* NESTED `& .${switchClasses.thumb}` selector sets `20×20` down to
|
|
89
|
+
* `16×16`. Both nested rules are baked into `SwitchRoot`'s OWN generated
|
|
90
|
+
* class at TWO-class specificity (the size-small instance's unique class,
|
|
91
|
+
* plus `.MuiSwitch-switchBase`/`.MuiSwitch-thumb`) — exactly the Chip
|
|
92
|
+
* outlined-label shape this file already has above, and the SAME failure
|
|
93
|
+
* mode Lesson 1 warns about: a FLAT `styleOverrides.switchBase`/`thumb`
|
|
94
|
+
* (one class) cannot out-specificity it, so at `size="small"` it would
|
|
95
|
+
* silently keep rendering MUI's unthemed `4px`/`16×16` at every density,
|
|
96
|
+
* the click target and thumb staying full-size while the track around them
|
|
97
|
+
* shrank. Fixed the same way: `sizeSmall`'s OWN nested `& .${switchClasses
|
|
98
|
+
* .switchBase}` / `& .${switchClasses.thumb}` rules, read through
|
|
99
|
+
* `switchClasses` (not a hand-typed selector string) for the same
|
|
100
|
+
* `ClassNameGenerator.configure` reason `chipClasses` is above, inserted
|
|
101
|
+
* as part of the SAME `sizeSmall` override object so they land AFTER
|
|
102
|
+
* `SwitchRoot`'s own baked-in small variant in the generated class's CSS
|
|
103
|
+
* text (later wins at matching two-class specificity) rather than trying
|
|
104
|
+
* to out-specificity it from a different slot.
|
|
105
|
+
*
|
|
106
|
+
* **The checked thumb's own travel distance is a FOURTH literal, found only
|
|
107
|
+
* on adversarial review of the PR this doc comment first shipped in.**
|
|
108
|
+
* `SwitchSwitchBase`'s base style bakes in `&.Mui-checked { transform:
|
|
109
|
+
* translateX(20px) }` (medium), and `SwitchRoot`'s `size: 'small'` variant
|
|
110
|
+
* nests the same at `16px` — both bare, never run through `pxToRem`, so at
|
|
111
|
+
* `density: 'compact'` the checked thumb kept travelling the FULL, unscaled
|
|
112
|
+
* distance while the track around it shrank ×0.9 — a visible overshoot.
|
|
113
|
+
* `switchSwitchBasePadding`/`switchSizeSmall` each now carry their own
|
|
114
|
+
* `&.${switchClasses.checked}` rule (`translateX(rem(theme, 20))`/`rem(theme,
|
|
115
|
+
* 16)`), composed onto the SAME generated class, in the SAME position
|
|
116
|
+
* `padding` already occupies — so it wins by the identical mechanism, not a
|
|
117
|
+
* new one. Proven at the pixel level, both sizes/densities: `switch-md-
|
|
118
|
+
* checked`/`switch-sm-checked` measure the thumb's final position against
|
|
119
|
+
* the track's own edge, not just the transform string.
|
|
120
|
+
*
|
|
121
|
+
* At `density: 'normal'` every number above computes back to the literal it
|
|
122
|
+
* replaces (`rem(theme, 9)` is `0.5625rem`, `9px` at the 16px root — no
|
|
123
|
+
* visible change), the same geometry-neutral guarantee `iconButtonDensity
|
|
124
|
+
* Overrides`/`chipDensityOverrides` give above. The same non-default-
|
|
125
|
+
* `fontSize` caveat those two give applies here unchanged: `rem()` only ever
|
|
126
|
+
* reads `theme.typography.fontSize`, so a host adopting
|
|
127
|
+
* `checkboxRadioDensityOverrides`/`switchDensityOverrides` standalone moves
|
|
128
|
+
* every number here by that one coefficient, same as everything else `rem()`
|
|
129
|
+
* touches.
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
const checkboxRadioRootPadding = ({ theme }: { theme: Theme }): CSSObject => ({ padding: rem(theme, 9) });
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* `MuiCheckbox`/`MuiRadio`'s own padding — duplicated under both component
|
|
136
|
+
* keys, the ticket's own documented fallback, since `MuiSwitchBase` cannot
|
|
137
|
+
* reach either (see the module doc comment above). One module-level function
|
|
138
|
+
* shared by both keys, and by `checkboxRadioDensityOverrides()`'s own two
|
|
139
|
+
* calls across the two theme-build paths, for the same identity reason the
|
|
140
|
+
* rest of this file's slots are module-level.
|
|
141
|
+
*/
|
|
142
|
+
export function checkboxRadioDensityOverrides(): Components<Theme> {
|
|
143
|
+
return {
|
|
144
|
+
MuiCheckbox: { styleOverrides: { root: checkboxRadioRootPadding } },
|
|
145
|
+
MuiRadio: { styleOverrides: { root: checkboxRadioRootPadding } },
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const switchRootGeometry = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
150
|
+
width: rems(theme, 34 + 12 * 2),
|
|
151
|
+
height: rems(theme, 14 + 12 * 2),
|
|
152
|
+
padding: rem(theme, 12),
|
|
153
|
+
});
|
|
154
|
+
const switchSwitchBasePadding = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
155
|
+
padding: rem(theme, 9),
|
|
156
|
+
// FUT-2767 (adversarial-review fix) — `SwitchSwitchBase`'s OWN base style
|
|
157
|
+
// (`Switch.js`, medium) bakes in `&.Mui-checked { transform:
|
|
158
|
+
// translateX(20px) }`, a bare literal never run through `pxToRem` — at
|
|
159
|
+
// `density: 'compact'` the track/padding/thumb above all shrink ×0.9 but
|
|
160
|
+
// this offset stayed at a full 20px, so the checked thumb overshot the now-
|
|
161
|
+
// smaller track. Composed onto the SAME generated class as that base style,
|
|
162
|
+
// AFTER it (`createStyled` composes `styleThemeOverrides` after a slot's
|
|
163
|
+
// own base/variants — see the module doc comment), so this nested rule
|
|
164
|
+
// wins at the SAME (two-class, `.<hash>.Mui-checked`) specificity, the same
|
|
165
|
+
// mechanism this function's own `padding` line already relies on.
|
|
166
|
+
[`&.${switchClasses.checked}`]: { transform: `translateX(${rem(theme, 20)})` },
|
|
167
|
+
});
|
|
168
|
+
const switchThumbSize = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
169
|
+
width: rem(theme, 20),
|
|
170
|
+
height: rem(theme, 20),
|
|
171
|
+
});
|
|
172
|
+
const switchSizeSmall = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
173
|
+
width: rem(theme, 40),
|
|
174
|
+
height: rem(theme, 24),
|
|
175
|
+
padding: rem(theme, 7),
|
|
176
|
+
// Higher (two-class) specificity than the flat `switchBase`/`thumb`
|
|
177
|
+
// overrides above, inserted as part of THIS SAME generated class — see the
|
|
178
|
+
// module doc comment for why a flat override cannot reach these at
|
|
179
|
+
// `size="small"` on its own.
|
|
180
|
+
[`& .${switchClasses.switchBase}`]: {
|
|
181
|
+
padding: rem(theme, 4),
|
|
182
|
+
// Same overshoot as medium's, at `size="small"`'s OWN literal
|
|
183
|
+
// (`SwitchRoot`'s baked-in `size: 'small'` variant, `Switch.js`:
|
|
184
|
+
// `translateX(16px)`). Nested one level deeper so the compiled selector
|
|
185
|
+
// is `.<root-hash> .MuiSwitch-switchBase.Mui-checked` — the same THREE-
|
|
186
|
+
// class descendant compound MUI's own baked-in small variant uses for
|
|
187
|
+
// this rule, composed after it in the same generated class, so it wins
|
|
188
|
+
// at matching specificity the same way the sibling `padding: rem(theme,
|
|
189
|
+
// 4)` line above already does.
|
|
190
|
+
[`&.${switchClasses.checked}`]: { transform: `translateX(${rem(theme, 16)})` },
|
|
191
|
+
},
|
|
192
|
+
[`& .${switchClasses.thumb}`]: { width: rem(theme, 16), height: rem(theme, 16) },
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* `MuiSwitch`'s own track (root), thumb wrapper (switchBase) and thumb
|
|
197
|
+
* (thumb) geometry, at both sizes MUI has.
|
|
198
|
+
*/
|
|
199
|
+
export function switchDensityOverrides(): Components<Theme> {
|
|
200
|
+
return {
|
|
201
|
+
MuiSwitch: {
|
|
202
|
+
styleOverrides: {
|
|
203
|
+
root: switchRootGeometry,
|
|
204
|
+
switchBase: switchSwitchBasePadding,
|
|
205
|
+
thumb: switchThumbSize,
|
|
206
|
+
sizeSmall: switchSizeSmall,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { chipClasses } from '@mui/material/Chip/index.js';
|
|
2
|
-
import { switchClasses } from '@mui/material/Switch/index.js';
|
|
3
2
|
import type { Components, CSSObject, Theme } from '@mui/material/styles/index.js';
|
|
4
3
|
|
|
5
|
-
import { rem
|
|
4
|
+
import { rem } from './relative';
|
|
5
|
+
|
|
6
|
+
// Re-exported so every existing import site (`./density`, `./scales`,
|
|
7
|
+
// `../provider/mui-bridge`) keeps resolving `from './density-overrides'`
|
|
8
|
+
// unchanged — the split below is purely a file-layout move to stay under
|
|
9
|
+
// the 400-line `quality:complexity` cap, not a public-API change.
|
|
10
|
+
export {
|
|
11
|
+
toggleButtonDensityOverrides,
|
|
12
|
+
tabDensityOverrides,
|
|
13
|
+
tabsIndicatorDensityOverrides,
|
|
14
|
+
tableCellDensityOverrides,
|
|
15
|
+
paginationItemDensityOverrides,
|
|
16
|
+
sliderDensityOverrides,
|
|
17
|
+
} from './density-overrides.navigation';
|
|
18
|
+
export { checkboxRadioDensityOverrides, switchDensityOverrides } from './density-overrides.selection';
|
|
6
19
|
|
|
7
20
|
/** The `ownerState` fields `MuiChip`'s two styled slots (root, label) both receive. */
|
|
8
21
|
interface ChipOwnerStateForOverrides {
|
|
@@ -176,209 +189,3 @@ export function chipDensityOverrides(): Components<Theme> {
|
|
|
176
189
|
},
|
|
177
190
|
};
|
|
178
191
|
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* CHECKBOX / RADIO / SWITCH GEOMETRY, DENSITY-AWARE (FUT-2767).
|
|
182
|
-
*
|
|
183
|
-
* `Checkbox`/`Radio`/`Switch` are MUI's own components, unwrapped — but
|
|
184
|
-
* **only two of the three `@12-apps/ui` wrappers actually forward their
|
|
185
|
-
* geometry to MUI**, corrected here after an earlier revision of this doc
|
|
186
|
-
* comment claimed all three did.
|
|
187
|
-
*
|
|
188
|
-
* - `Checkbox.tsx`'s `StyledCheckbox` and `RadioGroup.variants.tsx`'s
|
|
189
|
-
* `DefaultRadios` (the ONLY variant rendering a raw `<Radio>` — `cards`/
|
|
190
|
-
* `buttons`/`segments` draw custom controls, outside this ticket) set NO
|
|
191
|
-
* `padding` of their own, so `checkboxRadioDensityOverrides()` reaches
|
|
192
|
-
* both directly — confirmed by a real render, same computed padding as
|
|
193
|
-
* raw `MuiCheckbox`/`MuiRadio` at both densities
|
|
194
|
-
* (`density-overrides.test.stories.tsx`'s `ui-checkbox`/`ui-radio-group`).
|
|
195
|
-
* - `Switch.styles.ts`'s `switchSx` is DIFFERENT: it draws root/switchBase/
|
|
196
|
-
* thumb geometry itself, per instance, from its own `SWITCH_SIZES` table
|
|
197
|
-
* (`Switch.metrics.ts`), every number already through `rem(theme, px)`.
|
|
198
|
-
* `Switch.parts.tsx`'s `StyledSwitch = styled(MuiSwitch, {...})(...)`
|
|
199
|
-
* composes these as an OUTER wrapper class whose nested `& .MuiSwitch-
|
|
200
|
-
* switchBase`/`& .MuiSwitch-thumb` selectors are a TWO-class compound —
|
|
201
|
-
* higher specificity than this file's `MuiSwitch.styleOverrides.
|
|
202
|
-
* switchBase`/`thumb`, which compose onto a single-class generated class.
|
|
203
|
-
* `switchDensityOverrides()` therefore has **NO effect on `@12-apps/ui`'s
|
|
204
|
-
* own `<Switch>`** — it only reaches a raw `@mui/material/Switch` consumer
|
|
205
|
-
* (a host's own `Table.tsx` density-toggle column, say). Not a gap:
|
|
206
|
-
* `switchSx` already reacts to `theme.typography.fontSize` on its own —
|
|
207
|
-
* including the CHECKED thumb's own travel distance, computed as
|
|
208
|
-
* `rem(theme, width - thumbSize - padding * 2)` from the SAME per-instance
|
|
209
|
-
* geometry, so it moves consistently with no help from this file.
|
|
210
|
-
* Confirmed by measurement, both sizes, both states, both densities
|
|
211
|
-
* (`ui-switch-*` cases); documented at `Switch.md`'s "Density" section.
|
|
212
|
-
*
|
|
213
|
-
* **The ticket's open question — does a `MuiSwitchBase` theme override reach
|
|
214
|
-
* `Checkbox`/`Radio` at all? — is NO, verified two ways.** `Checkbox`/`Radio`
|
|
215
|
-
* both render through `internal/SwitchBase.js`'s `SwitchBaseRoot`, which is
|
|
216
|
-
* `styled(ButtonBase, { name: 'MuiSwitchBase' })({ padding: 9, ... })` — with
|
|
217
|
-
* NO `slot` key. `@mui/system`'s `createStyled.js` computes
|
|
218
|
-
* `overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(slot))`,
|
|
219
|
-
* and `defaultOverridesResolver` (`if (!slot) return null`) returns `null`
|
|
220
|
-
* for an absent slot; the styled call itself then only pushes its
|
|
221
|
-
* `styleThemeOverrides` expression `if (componentName && overridesResolver)`
|
|
222
|
-
* — `null` is falsy, so for THIS styled call `theme.components.MuiSwitchBase
|
|
223
|
-
* .styleOverrides` is never read at all. (`variants` is a SEPARATE check,
|
|
224
|
-
* gated on `skipVariantsResolver` rather than `overridesResolver`, which is
|
|
225
|
-
* why the ticket's own two-part specificity proof for Chip's label — probing
|
|
226
|
-
* with `variants` — does not transfer here; `styleOverrides` is what dies.)
|
|
227
|
-
* A render-level probe confirms it: a theme with `components.MuiSwitchBase
|
|
228
|
-
* .styleOverrides.root = { padding: '999px' }`, rendering `<Switch />`,
|
|
229
|
-
* `<Checkbox />` and `<Radio />` through it, leaves EVERY ONE of `.MuiSwitch-
|
|
230
|
-
* switchBase`, `.MuiCheckbox-root` and `.MuiRadio-root` at their unthemed
|
|
231
|
-
* padding (`9px`/`4px` — see below), never `999px`. The Decision's own
|
|
232
|
-
* suggested `MuiSwitchBase` route is therefore the ticket's documented
|
|
233
|
-
* fallback in disguise: this file skips straight to duplicating the override
|
|
234
|
-
* under `MuiCheckbox` and `MuiRadio`, each independently confirmed LIVE by
|
|
235
|
-
* the same probe (`components.MuiCheckbox.styleOverrides.root.padding` DOES
|
|
236
|
-
* reach `.MuiCheckbox-root`, and the same for `MuiRadio`).
|
|
237
|
-
*
|
|
238
|
-
* - `Checkbox`/`Radio` (`internal/SwitchBase.js`, `Checkbox.js`, `Radio.js`):
|
|
239
|
-
* `padding: 9` — constant across `size="small"`/`"medium"` today (neither
|
|
240
|
-
* `CheckboxRoot` nor `RadioRoot` carries a size-conditional padding rule),
|
|
241
|
-
* so ONE `root` override, no `sizeSmall`/`sizeMedium` split, covers both
|
|
242
|
-
* sizes without disturbing the glyph-driven size difference FUT-2585 left
|
|
243
|
-
* alone.
|
|
244
|
-
* - `Switch` (`Switch.js`): root (the track) `width: 34+12*2`, `height:
|
|
245
|
-
* 14+12*2`, `padding: 12` (medium); `switchBase` (the thumb's absolutely-
|
|
246
|
-
* positioned wrapper) — its OWN literal is NOT the `12` the ticket's
|
|
247
|
-
* Decision sketch names (that `12` is `SwitchRoot`'s own padding, a
|
|
248
|
-
* DIFFERENT slot); `switchBase` inherits `internal/SwitchBase.js`'s generic
|
|
249
|
-
* `padding: 9` unmodified at medium (`SwitchSwitchBase`'s own styles never
|
|
250
|
-
* set `padding`), confirmed by the same render probe with NO theme
|
|
251
|
-
* override at all (`.MuiSwitch-switchBase` computed padding: `9px`). This
|
|
252
|
-
* file overrides `MuiSwitch.styleOverrides.switchBase` (a LIVE key —
|
|
253
|
-
* `SwitchSwitchBase = styled(SwitchBase, { name: 'MuiSwitch', slot:
|
|
254
|
-
* 'SwitchBase', ... })` DOES pass a `slot`) with `rem(theme, 9)`, the
|
|
255
|
-
* MEASURED default, not the ticket's `12` — using `12` here would move
|
|
256
|
-
* today's real 9px to 12px at `density: 'normal'`, failing the Done-when's
|
|
257
|
-
* own pixel-identical requirement, so the number is corrected against the
|
|
258
|
-
* probe rather than the sketch. `thumb`: `20×20`, unconditional.
|
|
259
|
-
* - `Switch` `size="small"` (`:82-100`, a `variants` entry on `SwitchRoot`
|
|
260
|
-
* itself): root `width: 40`, `height: 24`, `padding: 7`; a NESTED `&
|
|
261
|
-
* .${switchClasses.switchBase}` selector sets `padding: 4` (not 9); a
|
|
262
|
-
* NESTED `& .${switchClasses.thumb}` selector sets `20×20` down to
|
|
263
|
-
* `16×16`. Both nested rules are baked into `SwitchRoot`'s OWN generated
|
|
264
|
-
* class at TWO-class specificity (the size-small instance's unique class,
|
|
265
|
-
* plus `.MuiSwitch-switchBase`/`.MuiSwitch-thumb`) — exactly the Chip
|
|
266
|
-
* outlined-label shape this file already has above, and the SAME failure
|
|
267
|
-
* mode Lesson 1 warns about: a FLAT `styleOverrides.switchBase`/`thumb`
|
|
268
|
-
* (one class) cannot out-specificity it, so at `size="small"` it would
|
|
269
|
-
* silently keep rendering MUI's unthemed `4px`/`16×16` at every density,
|
|
270
|
-
* the click target and thumb staying full-size while the track around them
|
|
271
|
-
* shrank. Fixed the same way: `sizeSmall`'s OWN nested `& .${switchClasses
|
|
272
|
-
* .switchBase}` / `& .${switchClasses.thumb}` rules, read through
|
|
273
|
-
* `switchClasses` (not a hand-typed selector string) for the same
|
|
274
|
-
* `ClassNameGenerator.configure` reason `chipClasses` is above, inserted
|
|
275
|
-
* as part of the SAME `sizeSmall` override object so they land AFTER
|
|
276
|
-
* `SwitchRoot`'s own baked-in small variant in the generated class's CSS
|
|
277
|
-
* text (later wins at matching two-class specificity) rather than trying
|
|
278
|
-
* to out-specificity it from a different slot.
|
|
279
|
-
*
|
|
280
|
-
* **The checked thumb's own travel distance is a FOURTH literal, found only
|
|
281
|
-
* on adversarial review of the PR this doc comment first shipped in.**
|
|
282
|
-
* `SwitchSwitchBase`'s base style bakes in `&.Mui-checked { transform:
|
|
283
|
-
* translateX(20px) }` (medium), and `SwitchRoot`'s `size: 'small'` variant
|
|
284
|
-
* nests the same at `16px` — both bare, never run through `pxToRem`, so at
|
|
285
|
-
* `density: 'compact'` the checked thumb kept travelling the FULL, unscaled
|
|
286
|
-
* distance while the track around it shrank ×0.9 — a visible overshoot.
|
|
287
|
-
* `switchSwitchBasePadding`/`switchSizeSmall` each now carry their own
|
|
288
|
-
* `&.${switchClasses.checked}` rule (`translateX(rem(theme, 20))`/`rem(theme,
|
|
289
|
-
* 16)`), composed onto the SAME generated class, in the SAME position
|
|
290
|
-
* `padding` already occupies — so it wins by the identical mechanism, not a
|
|
291
|
-
* new one. Proven at the pixel level, both sizes/densities: `switch-md-
|
|
292
|
-
* checked`/`switch-sm-checked` measure the thumb's final position against
|
|
293
|
-
* the track's own edge, not just the transform string.
|
|
294
|
-
*
|
|
295
|
-
* At `density: 'normal'` every number above computes back to the literal it
|
|
296
|
-
* replaces (`rem(theme, 9)` is `0.5625rem`, `9px` at the 16px root — no
|
|
297
|
-
* visible change), the same geometry-neutral guarantee `iconButtonDensity
|
|
298
|
-
* Overrides`/`chipDensityOverrides` give above. The same non-default-
|
|
299
|
-
* `fontSize` caveat those two give applies here unchanged: `rem()` only ever
|
|
300
|
-
* reads `theme.typography.fontSize`, so a host adopting
|
|
301
|
-
* `checkboxRadioDensityOverrides`/`switchDensityOverrides` standalone moves
|
|
302
|
-
* every number here by that one coefficient, same as everything else `rem()`
|
|
303
|
-
* touches.
|
|
304
|
-
*/
|
|
305
|
-
|
|
306
|
-
const checkboxRadioRootPadding = ({ theme }: { theme: Theme }): CSSObject => ({ padding: rem(theme, 9) });
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* `MuiCheckbox`/`MuiRadio`'s own padding — duplicated under both component
|
|
310
|
-
* keys, the ticket's own documented fallback, since `MuiSwitchBase` cannot
|
|
311
|
-
* reach either (see the module doc comment above). One module-level function
|
|
312
|
-
* shared by both keys, and by `checkboxRadioDensityOverrides()`'s own two
|
|
313
|
-
* calls across the two theme-build paths, for the same identity reason the
|
|
314
|
-
* rest of this file's slots are module-level.
|
|
315
|
-
*/
|
|
316
|
-
export function checkboxRadioDensityOverrides(): Components<Theme> {
|
|
317
|
-
return {
|
|
318
|
-
MuiCheckbox: { styleOverrides: { root: checkboxRadioRootPadding } },
|
|
319
|
-
MuiRadio: { styleOverrides: { root: checkboxRadioRootPadding } },
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
const switchRootGeometry = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
324
|
-
width: rems(theme, 34 + 12 * 2),
|
|
325
|
-
height: rems(theme, 14 + 12 * 2),
|
|
326
|
-
padding: rem(theme, 12),
|
|
327
|
-
});
|
|
328
|
-
const switchSwitchBasePadding = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
329
|
-
padding: rem(theme, 9),
|
|
330
|
-
// FUT-2767 (adversarial-review fix) — `SwitchSwitchBase`'s OWN base style
|
|
331
|
-
// (`Switch.js`, medium) bakes in `&.Mui-checked { transform:
|
|
332
|
-
// translateX(20px) }`, a bare literal never run through `pxToRem` — at
|
|
333
|
-
// `density: 'compact'` the track/padding/thumb above all shrink ×0.9 but
|
|
334
|
-
// this offset stayed at a full 20px, so the checked thumb overshot the now-
|
|
335
|
-
// smaller track. Composed onto the SAME generated class as that base style,
|
|
336
|
-
// AFTER it (`createStyled` composes `styleThemeOverrides` after a slot's
|
|
337
|
-
// own base/variants — see the module doc comment), so this nested rule
|
|
338
|
-
// wins at the SAME (two-class, `.<hash>.Mui-checked`) specificity, the same
|
|
339
|
-
// mechanism this function's own `padding` line already relies on.
|
|
340
|
-
[`&.${switchClasses.checked}`]: { transform: `translateX(${rem(theme, 20)})` },
|
|
341
|
-
});
|
|
342
|
-
const switchThumbSize = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
343
|
-
width: rem(theme, 20),
|
|
344
|
-
height: rem(theme, 20),
|
|
345
|
-
});
|
|
346
|
-
const switchSizeSmall = ({ theme }: { theme: Theme }): CSSObject => ({
|
|
347
|
-
width: rem(theme, 40),
|
|
348
|
-
height: rem(theme, 24),
|
|
349
|
-
padding: rem(theme, 7),
|
|
350
|
-
// Higher (two-class) specificity than the flat `switchBase`/`thumb`
|
|
351
|
-
// overrides above, inserted as part of THIS SAME generated class — see the
|
|
352
|
-
// module doc comment for why a flat override cannot reach these at
|
|
353
|
-
// `size="small"` on its own.
|
|
354
|
-
[`& .${switchClasses.switchBase}`]: {
|
|
355
|
-
padding: rem(theme, 4),
|
|
356
|
-
// Same overshoot as medium's, at `size="small"`'s OWN literal
|
|
357
|
-
// (`SwitchRoot`'s baked-in `size: 'small'` variant, `Switch.js`:
|
|
358
|
-
// `translateX(16px)`). Nested one level deeper so the compiled selector
|
|
359
|
-
// is `.<root-hash> .MuiSwitch-switchBase.Mui-checked` — the same THREE-
|
|
360
|
-
// class descendant compound MUI's own baked-in small variant uses for
|
|
361
|
-
// this rule, composed after it in the same generated class, so it wins
|
|
362
|
-
// at matching specificity the same way the sibling `padding: rem(theme,
|
|
363
|
-
// 4)` line above already does.
|
|
364
|
-
[`&.${switchClasses.checked}`]: { transform: `translateX(${rem(theme, 16)})` },
|
|
365
|
-
},
|
|
366
|
-
[`& .${switchClasses.thumb}`]: { width: rem(theme, 16), height: rem(theme, 16) },
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* `MuiSwitch`'s own track (root), thumb wrapper (switchBase) and thumb
|
|
371
|
-
* (thumb) geometry, at both sizes MUI has.
|
|
372
|
-
*/
|
|
373
|
-
export function switchDensityOverrides(): Components<Theme> {
|
|
374
|
-
return {
|
|
375
|
-
MuiSwitch: {
|
|
376
|
-
styleOverrides: {
|
|
377
|
-
root: switchRootGeometry,
|
|
378
|
-
switchBase: switchSwitchBasePadding,
|
|
379
|
-
thumb: switchThumbSize,
|
|
380
|
-
sizeSmall: switchSizeSmall,
|
|
381
|
-
},
|
|
382
|
-
},
|
|
383
|
-
};
|
|
384
|
-
}
|