@12-apps/ui 6.26.0 → 6.27.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/dist/_internal/components/data-display/Alert/Alert.js +4 -4
- package/dist/_internal/components/data-display/Alert/Alert.metrics.js +2 -2
- package/dist/_internal/components/data-display/Alert/Alert.styles.js +3 -3
- package/dist/_internal/components/data-display/Avatar/Avatar.js +3 -3
- package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
- package/dist/_internal/components/data-display/Badge/Badge.animations.js +3 -3
- package/dist/_internal/components/data-display/Badge/Badge.js +7 -7
- package/dist/_internal/components/data-display/Badge/Badge.metrics.js +2 -2
- package/dist/_internal/components/data-display/Badge/Badge.styles.js +5 -5
- package/dist/_internal/components/data-display/Badge/Badge.variants.js +3 -3
- package/dist/_internal/components/data-display/Badge/BadgeContent.js +6 -6
- package/dist/_internal/components/data-display/Banner/Banner.js +4 -4
- package/dist/_internal/components/data-display/Banner/Banner.styles.js +3 -3
- package/dist/_internal/components/data-display/CardKit/CardKebab.js +4 -4
- package/dist/_internal/components/data-display/CardKit/card-actions-context.js +5 -5
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +9 -9
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +4 -4
- package/dist/_internal/components/data-display/Carousel/Carousel.chrome.js +1 -1
- package/dist/_internal/components/data-display/Carousel/Carousel.js +1 -1
- package/dist/_internal/components/data-display/Carousel/Carousel.parts.js +1 -1
- package/dist/_internal/components/data-display/Carousel/Carousel.styles.js +1 -1
- package/dist/_internal/components/data-display/Chart/Chart.js +5 -5
- package/dist/_internal/components/data-display/Chart/SpecChart.js +6 -6
- package/dist/_internal/components/data-display/Chart/chart-context.js +3 -3
- package/dist/_internal/components/data-display/Chart/chart-internals.js +1 -1
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +4 -4
- package/dist/_internal/components/data-display/DataViews/DataViewsBoard.js +4 -4
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +37 -37
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +54 -53
- package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +6 -6
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +7 -7
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +12 -11
- package/dist/_internal/components/data-display/DataViews/base-card.js +9 -9
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +12 -12
- package/dist/_internal/components/data-display/DataViews/base-list-card-gutters.js +3 -3
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +8 -8
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +16 -16
- package/dist/_internal/components/data-display/DataViews/card-surface.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-columns-tab.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-columns.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +11 -11
- package/dist/_internal/components/data-display/DataViews/data-views-display-tabs.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-empty.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-export.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +12 -12
- package/dist/_internal/components/data-display/DataViews/data-views-grid-helpers.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +34 -34
- package/dist/_internal/components/data-display/DataViews/data-views-header-row.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +13 -13
- package/dist/_internal/components/data-display/DataViews/data-views-layout-context.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-select-all-strip.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +15 -15
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +18 -17
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +14 -14
- package/dist/_internal/components/data-display/DataViews/data-views-view-nav.js +6 -6
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +3 -3
- package/dist/_internal/components/data-display/DataViews/save-view-preview.js +4 -4
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +7 -7
- package/dist/_internal/components/data-display/DataViews/use-saved-views-controller.js +2 -2
- package/dist/_internal/components/data-display/DescriptionItem/DescriptionItem.js +4 -4
- package/dist/_internal/components/data-display/FleetMap/FleetBody.js +11 -11
- package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +8 -8
- package/dist/_internal/components/data-display/FleetMap/FleetMap.js +13 -13
- package/dist/_internal/components/data-display/FleetMap/FleetRoster.js +2 -2
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +1 -1
- package/dist/_internal/components/data-display/MapPreview/MapDecorations.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.hooks.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.js +7 -7
- package/dist/_internal/components/data-display/MapPreview/MapTiles.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/StaticMapView.js +4 -4
- package/dist/_internal/components/data-display/MapPreview/useMapPreview.js +3 -3
- package/dist/_internal/components/data-display/Progress/Progress.js +4 -4
- package/dist/_internal/components/data-display/Progress/Progress.metrics.js +2 -2
- package/dist/_internal/components/data-display/Progress/Progress.styles.js +3 -3
- package/dist/_internal/components/data-display/Sheet/Sheet.body.js +1 -1
- package/dist/_internal/components/data-display/Sheet/Sheet.js +4 -4
- package/dist/_internal/components/data-display/Sheet/Sheet.styles.js +1 -1
- package/dist/_internal/components/data-display/Table/Table.js +2 -2
- package/dist/_internal/components/data-display/index.js +43 -43
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +4 -4
- package/dist/_internal/components/feedback/index.js +4 -4
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.hooks.js +2 -2
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.js +5 -5
- package/dist/_internal/components/form/Autocomplete/Autocomplete.js +2 -2
- package/dist/_internal/components/form/Button/Button.js +3 -3
- package/dist/_internal/components/form/Button/Button.styles.js +2 -2
- package/dist/_internal/components/form/Calendar/Calendar.hooks.js +2 -2
- package/dist/_internal/components/form/Calendar/Calendar.js +3 -3
- package/dist/_internal/components/form/CategorySelect/CategoryPanel.js +1 -1
- package/dist/_internal/components/form/CategorySelect/CategorySelect.js +4 -4
- package/dist/_internal/components/form/Checkbox/Checkbox.js +2 -2
- package/dist/_internal/components/form/Command/Command.js +4 -4
- package/dist/_internal/components/form/Command/Command.styles.js +1 -1
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +5 -5
- package/dist/_internal/components/form/Label/Label.js +1 -1
- package/dist/_internal/components/form/Label/Label.styles.js +1 -1
- package/dist/_internal/components/form/Menubar/Menubar.item.js +1 -1
- package/dist/_internal/components/form/Menubar/Menubar.js +1 -1
- package/dist/_internal/components/form/Menubar/Menubar.styles.js +1 -1
- package/dist/_internal/components/form/Menubar/Menubar.toolbar.js +1 -1
- package/dist/_internal/components/form/PhoneInput/PhoneInput.hooks.js +2 -2
- package/dist/_internal/components/form/PhoneInput/PhoneInput.js +3 -3
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/_internal/components/form/Switch/Switch.ids.js +8 -0
- package/dist/_internal/components/form/Switch/Switch.ids.js.map +1 -0
- package/dist/_internal/components/form/Switch/Switch.js +6 -5
- package/dist/_internal/components/form/Switch/Switch.metrics.js +5 -1
- package/dist/_internal/components/form/Switch/Switch.parts.js +6 -8
- package/dist/_internal/components/form/Switch/Switch.styles.js +5 -3
- package/dist/_internal/components/form/index.js +34 -33
- 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/SubmitButton.js +4 -4
- package/dist/_internal/components/index.js +83 -82
- package/dist/_internal/components/layout/Box/Box.js +4 -4
- package/dist/_internal/components/layout/Stack/Stack.js +5 -5
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +7 -7
- package/dist/_internal/components/navigation/AppHeader/AppHeader.identity.js +1 -1
- package/dist/_internal/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/_internal/components/navigation/index.js +8 -8
- package/dist/_internal/components/typography/Heading/Heading.js +4 -4
- package/dist/_internal/components/typography/Heading/Heading.metrics.js +2 -2
- package/dist/_internal/components/typography/Heading/Heading.styles.js +3 -3
- package/dist/_internal/components/typography/Paragraph/Paragraph.js +2 -2
- package/dist/_internal/components/typography/Text/Text.js +3 -3
- package/dist/_internal/components/typography/Text/Text.metrics.js +2 -2
- package/dist/_internal/components/typography/index.js +7 -7
- package/dist/_internal/icons/Icon.js +4 -4
- package/dist/_internal/provider/UiProvider.js +3 -3
- package/dist/_internal/provider/mui-bridge.js +2 -2
- package/dist/_internal/provider/use-ui-theme.js +3 -3
- package/dist/_internal/social-login-button/social-login-button.js +9 -9
- package/dist/_internal/tokens/theme.js +3 -1
- package/dist/_internal/user-avatar/user-avatar.js +8 -8
- package/dist/charts.js +6 -6
- package/dist/{chunk-2GI7ANEL.js → chunk-22X7TT6Z.js} +4 -4
- package/dist/{chunk-WR5JFDQ5.js → chunk-27BL3DNT.js} +8 -8
- package/dist/{chunk-E55CJV65.js → chunk-2KVQIGVE.js} +2 -2
- package/dist/{chunk-BB2OUERT.js → chunk-2LSCK45B.js} +7 -4
- package/dist/chunk-2LSCK45B.js.map +1 -0
- package/dist/{chunk-W3FAKT3D.js → chunk-2SWQ6HIK.js} +4 -4
- package/dist/{chunk-ISW5K72V.js → chunk-2ZRZTGWP.js} +5 -5
- package/dist/{chunk-I5SBTNV2.js → chunk-3GB6KWHH.js} +2 -2
- package/dist/{chunk-ZEG2LNBY.js → chunk-3PJLT5FX.js} +2 -2
- package/dist/{chunk-CXLAJZSE.js → chunk-3VZT2FAI.js} +3 -3
- package/dist/{chunk-MLCFODJO.js → chunk-3W2IS5RH.js} +5 -1
- package/dist/{chunk-MLCFODJO.js.map → chunk-3W2IS5RH.js.map} +1 -1
- package/dist/{chunk-PFDM2OIP.js → chunk-45OHGD2B.js} +4 -4
- package/dist/{chunk-BH5BXLGI.js → chunk-4A2Q22HO.js} +3 -3
- package/dist/{chunk-46UPILLK.js → chunk-4ETQRBZC.js} +4 -4
- package/dist/{chunk-TWY5FOBY.js → chunk-5QUSX3TC.js} +5 -5
- package/dist/{chunk-AVGTTWTE.js → chunk-65DLYC4S.js} +4 -4
- package/dist/{chunk-TVPPA4RD.js → chunk-65METCKT.js} +16 -16
- package/dist/{chunk-OQFSYMHJ.js → chunk-67ALTEWH.js} +2 -2
- package/dist/{chunk-OGGHD64H.js → chunk-6SK3MTYJ.js} +2 -2
- package/dist/{chunk-OE2ZVL67.js → chunk-6VHCSPKK.js} +3 -3
- package/dist/{chunk-WAPJ2DL3.js → chunk-72T5PAW7.js} +4 -4
- package/dist/{chunk-SLVQ33AN.js → chunk-77DF5LKI.js} +2 -2
- package/dist/{chunk-7KWBGMQC.js → chunk-77OXG6DH.js} +5 -5
- package/dist/{chunk-Y3KRUT7O.js → chunk-7AIHK2XM.js} +2 -2
- package/dist/{chunk-MHV5Y5MR.js → chunk-7KEGJH3Q.js} +3 -3
- package/dist/{chunk-KMXAPYU2.js → chunk-7NEUPEV5.js} +2 -2
- package/dist/{chunk-67L7HMEP.js → chunk-7Z2AQEC5.js} +2 -2
- package/dist/{chunk-PQECNGDE.js → chunk-AGYGNNOM.js} +2 -2
- package/dist/{chunk-ZTF5C2GA.js → chunk-B5SW7I5W.js} +2 -2
- package/dist/{chunk-TXHJX2NG.js → chunk-BGYLL467.js} +4 -4
- package/dist/{chunk-R7R3LOKW.js → chunk-CA7TA36R.js} +2 -2
- package/dist/{chunk-FPFUXRD2.js → chunk-CKJI7JO5.js} +2 -2
- package/dist/{chunk-HMV4QMXS.js → chunk-CMN26J5Y.js} +4 -4
- package/dist/{chunk-KVEHH4SA.js → chunk-DB2MAYPK.js} +2 -2
- package/dist/{chunk-2ECT4IY2.js → chunk-DIHVWBQV.js} +36 -17
- package/dist/chunk-DIHVWBQV.js.map +1 -0
- package/dist/{chunk-V4FKHLEB.js → chunk-DTIB5KWP.js} +3 -3
- package/dist/{chunk-MESRKY67.js → chunk-DW6GBMLQ.js} +3 -3
- package/dist/{chunk-JO6BBSGY.js → chunk-DWJBOR47.js} +3 -3
- package/dist/{chunk-YW5T6KZ5.js → chunk-DYESJJ3Q.js} +9 -9
- package/dist/{chunk-TZDDL3DR.js → chunk-ECMJ5VPW.js} +2 -2
- package/dist/{chunk-OH3YGJT5.js → chunk-EMNGIYH6.js} +5 -5
- package/dist/{chunk-CZJLWCEG.js → chunk-EPNCYUQ7.js} +4 -4
- package/dist/{chunk-JZXWCEH5.js → chunk-EQA4VQEO.js} +2 -2
- package/dist/{chunk-3N6EK6K5.js → chunk-ERX4XIYC.js} +2 -2
- package/dist/{chunk-TTLI6PF7.js → chunk-FF3R67WD.js} +5 -5
- package/dist/{chunk-4Y6SPFKW.js → chunk-FOF2RAVQ.js} +4 -4
- package/dist/{chunk-KLREH4X6.js → chunk-G2JPUHEJ.js} +2 -2
- package/dist/{chunk-BBC4KT5G.js → chunk-G76H5PEM.js} +20 -2
- package/dist/chunk-G76H5PEM.js.map +1 -0
- package/dist/{chunk-4J5EN4FQ.js → chunk-GBX5ACPF.js} +5 -5
- package/dist/{chunk-ZZMZF7PZ.js → chunk-GQJ4NCZ6.js} +3 -3
- package/dist/{chunk-IPVYEPXO.js → chunk-GSTRPZS4.js} +5 -5
- package/dist/{chunk-HFXTAEYY.js → chunk-GTLJYAEG.js} +2 -2
- package/dist/{chunk-M4LFDGI6.js → chunk-GYQT47YZ.js} +2 -2
- package/dist/{chunk-JSH3HFDQ.js → chunk-H3BQFEN5.js} +2 -2
- package/dist/{chunk-OV4WREMW.js → chunk-HKB5C2KY.js} +7 -7
- package/dist/{chunk-BLBOYCOV.js → chunk-HKV4MQ2W.js} +5 -5
- package/dist/{chunk-4MGFUPQT.js → chunk-HOJL2GKW.js} +4 -4
- package/dist/{chunk-HR7YTBR7.js → chunk-IASDP44E.js} +4 -4
- package/dist/{chunk-YMRI5QKG.js → chunk-IV5QQLCS.js} +2 -2
- package/dist/{chunk-JUHUKZGU.js → chunk-JD3D6Y4U.js} +2 -2
- package/dist/{chunk-FR67FG2U.js → chunk-JFRKBSWI.js} +35 -25
- package/dist/chunk-JFRKBSWI.js.map +1 -0
- package/dist/{chunk-AXTLFK4T.js → chunk-KAV63FBG.js} +2 -2
- package/dist/{chunk-2PBGVMM2.js → chunk-KOFO6QZY.js} +2 -2
- package/dist/{chunk-RP5FK3SO.js → chunk-L7LCSZ3H.js} +3 -3
- package/dist/{chunk-MNXVXW4T.js → chunk-L7S6N67X.js} +2 -2
- package/dist/{chunk-JXPHU3K5.js → chunk-LGJ2H4AH.js} +5 -5
- package/dist/{chunk-W4YWU7LQ.js → chunk-LO2B7FDQ.js} +2 -2
- package/dist/{chunk-PWR7K5OP.js → chunk-LV4UTYAD.js} +2 -2
- package/dist/{chunk-OG2FP6SE.js → chunk-M4NFXC5R.js} +4 -4
- package/dist/{chunk-ZPIMPOHV.js → chunk-M7E66OSC.js} +4 -4
- package/dist/{chunk-OGGPQVIG.js → chunk-MDTSMJ7C.js} +3 -3
- package/dist/{chunk-YDI6IJ6F.js → chunk-MI2MVH3I.js} +4 -4
- package/dist/{chunk-UIZH4DAE.js → chunk-MQPT254A.js} +4 -4
- package/dist/{chunk-EWT3WMVY.js → chunk-MYH7VISV.js} +5 -5
- package/dist/{chunk-7NSX7A5H.js → chunk-N5PY7IXI.js} +3 -3
- package/dist/{chunk-BHIGHSXA.js → chunk-NNXZ5RK5.js} +4 -4
- package/dist/{chunk-EQ7PWGBN.js → chunk-O7HLQTB7.js} +3 -3
- package/dist/{chunk-DW5FRWRQ.js → chunk-OAWEUKUC.js} +2 -2
- package/dist/{chunk-O4VCZTK4.js → chunk-OGHW7RQC.js} +2 -2
- package/dist/{chunk-XR6WBW23.js → chunk-OVGASVPW.js} +2 -2
- package/dist/{chunk-HEBQS7QP.js → chunk-OXYR2HVK.js} +3 -3
- package/dist/{chunk-TNVO2DTB.js → chunk-P7FQUGED.js} +5 -5
- package/dist/{chunk-343TTIHD.js → chunk-PENJBKPH.js} +3 -3
- package/dist/{chunk-2RQINU5T.js → chunk-PKFFJAQ6.js} +2 -2
- package/dist/{chunk-M4LQRQFL.js → chunk-PW2WLDX3.js} +2 -2
- package/dist/{chunk-WRDPWEIC.js → chunk-Q3GSDSK2.js} +6 -6
- package/dist/{chunk-VNTOBLIB.js → chunk-Q3OFOOO7.js} +2 -2
- package/dist/{chunk-GGI7GM5O.js → chunk-QE2C35TO.js} +4 -4
- package/dist/{chunk-NQN5Z36J.js → chunk-QLI7ES7Z.js} +10 -1
- package/dist/chunk-QLI7ES7Z.js.map +1 -0
- package/dist/{chunk-CT5K725B.js → chunk-QQLGSMGE.js} +2 -2
- package/dist/{chunk-7MN6I5NK.js → chunk-QXFPTRHB.js} +3 -3
- package/dist/{chunk-CZPU5TW3.js → chunk-RFZU5BTG.js} +2 -2
- package/dist/{chunk-JB67KPGM.js → chunk-RRO2EOJB.js} +4 -4
- package/dist/{chunk-MZQTHSLN.js → chunk-S7HRED4D.js} +2 -2
- package/dist/{chunk-NYEA7JAI.js → chunk-SC72DRTX.js} +6 -6
- package/dist/{chunk-JWW2Z3RH.js → chunk-SMZBGHR2.js} +7 -7
- package/dist/{chunk-EZSEAYYT.js → chunk-SSWZHR46.js} +5 -5
- package/dist/{chunk-NA7MIEG6.js → chunk-SZETT7QV.js} +2 -2
- package/dist/chunk-SZS7VZJN.js +25 -0
- package/dist/chunk-SZS7VZJN.js.map +1 -0
- package/dist/{chunk-2HPP6RVC.js → chunk-TQOPF7LD.js} +2 -2
- package/dist/{chunk-OLVZ6TOV.js → chunk-TUO47RL2.js} +4 -4
- package/dist/{chunk-N5IVVLTH.js → chunk-UG76BO5K.js} +79 -19
- package/dist/chunk-UG76BO5K.js.map +1 -0
- package/dist/{chunk-4IVDVZZ2.js → chunk-UGL6SJN6.js} +3 -3
- package/dist/{chunk-QJRDDVZ2.js → chunk-V5P5Q6HM.js} +3 -3
- package/dist/{chunk-73NJCGQG.js → chunk-VIK3HAUQ.js} +2 -2
- package/dist/{chunk-7LCXGJN5.js → chunk-VK4ULJFH.js} +2 -2
- package/dist/{chunk-QYNCPS5W.js → chunk-WBKWIFXA.js} +6 -6
- package/dist/{chunk-X4Z62ZQY.js → chunk-WETAIIKC.js} +2 -2
- package/dist/{chunk-GMTM6EN7.js → chunk-WKF54CCK.js} +7 -7
- package/dist/{chunk-KT6HWAEN.js → chunk-WZUNBSS7.js} +2 -2
- package/dist/{chunk-Y2B3I3IH.js → chunk-X5RDHO6G.js} +2 -2
- package/dist/{chunk-TXKZEKJN.js → chunk-XNOSTV5F.js} +2 -2
- package/dist/{chunk-7JXLGOM2.js → chunk-Y55ILY2F.js} +3 -3
- package/dist/{chunk-HI2OFZSZ.js → chunk-YPILHGEO.js} +2 -2
- package/dist/{chunk-V3PLFYKO.js → chunk-ZAJO2B75.js} +2 -2
- package/dist/data-display/Alert.js +4 -4
- package/dist/data-display/Avatar.js +3 -3
- package/dist/data-display/Badge.js +7 -7
- package/dist/data-display/Banner.js +4 -4
- package/dist/data-display/CardKit.js +13 -13
- package/dist/data-display/Carousel.js +1 -1
- package/dist/data-display/Chart.js +6 -6
- package/dist/data-display/DataViews.js +68 -67
- package/dist/data-display/DescriptionItem.js +4 -4
- package/dist/data-display/FleetMap.js +13 -13
- package/dist/data-display/Lightbox.js +1 -1
- package/dist/data-display/MapPreview.js +7 -7
- package/dist/data-display/Progress.js +4 -4
- package/dist/data-display/Sheet.js +4 -4
- package/dist/data-display/Table.js +2 -2
- package/dist/feedback/ConfirmAction.js +4 -4
- package/dist/form/AddressAutocomplete.js +5 -5
- package/dist/form/Autocomplete.js +2 -2
- package/dist/form/Button.js +3 -3
- package/dist/form/Calendar.js +3 -3
- package/dist/form/CategorySelect.js +4 -4
- package/dist/form/Checkbox.js +2 -2
- package/dist/form/Command.js +4 -4
- package/dist/form/DateRangePicker.js +10 -10
- package/dist/form/Label.js +1 -1
- package/dist/form/Menubar.js +1 -1
- package/dist/form/PhoneInput.js +3 -3
- package/dist/form/RichTextEditor.js +2 -2
- package/dist/form/Switch.js +6 -5
- package/dist/form/total-form.js +10 -10
- package/dist/icons.js +4 -4
- package/dist/layout/Box.js +4 -4
- package/dist/layout/Stack.js +5 -5
- package/dist/native/chunks/{chunk-2R2R35C5.js → chunk-2SBTJSQE.js} +5 -5
- package/dist/native/chunks/{chunk-WL5LXVCK.js → chunk-6L4UZBQP.js} +3 -3
- package/dist/native/chunks/{chunk-LEMMXZFN.js → chunk-MP3UDWTT.js} +10 -1
- package/dist/native/chunks/{chunk-LEMMXZFN.js.map → chunk-MP3UDWTT.js.map} +1 -1
- package/dist/native/chunks/{chunk-GW7TQ7HO.js → chunk-QEQZ5AF6.js} +3 -3
- package/dist/native/chunks/{chunk-7LTVGW23.js → chunk-UII3IFLP.js} +2 -2
- package/dist/native/chunks/{chunk-75JQYVDZ.js → chunk-UYREIOEM.js} +2 -2
- package/dist/native/chunks/{chunk-GWGIWQO7.js → chunk-XI7HTAVN.js} +2 -2
- package/dist/native/chunks/{chunk-QYUD3S6F.js → chunk-ZOP7UAZK.js} +2 -2
- package/dist/native/data-display/Alert.js +3 -3
- package/dist/native/data-display/Avatar.js +3 -3
- package/dist/native/data-display/Badge.js +3 -3
- package/dist/native/data-display/Chip.js +3 -3
- package/dist/native/data-display/EmptyState.js +5 -5
- package/dist/native/data-display/ErrorState.js +4 -4
- package/dist/native/data-display/FleetMap.js +6 -6
- package/dist/native/data-display/LoadingState.js +2 -2
- package/dist/native/data-display/Progress.js +2 -2
- package/dist/native/feedback/Dialog.js +3 -3
- package/dist/native/form/Button.js +3 -3
- package/dist/native/form/Checkbox.js +3 -3
- package/dist/native/form/Input.js +3 -3
- package/dist/native/form/Select.js +4 -4
- package/dist/native/form/Switch.js +26 -8
- package/dist/native/form/Switch.js.map +1 -1
- package/dist/native/icons.js +3 -3
- package/dist/native/layout/Box.js +3 -3
- package/dist/native/layout/Card.js +2 -2
- package/dist/native/layout/Container.js +2 -2
- package/dist/native/layout/Skeleton.js +3 -3
- package/dist/native/layout/Spacer.js +2 -2
- package/dist/native/layout/Stack.js +3 -3
- package/dist/native/provider.js +2 -2
- package/dist/native/tokens.js +3 -1
- package/dist/native/typography/Heading.js +2 -2
- package/dist/native/typography/Paragraph.js +2 -2
- package/dist/native/typography/Text.js +2 -2
- package/dist/navigation/AppHeader.js +7 -7
- package/dist/navigation/Tabs.js +1 -1
- package/dist/provider.js +4 -4
- package/dist/social-login-button.js +9 -9
- package/dist/tokens.js +3 -1
- package/dist/types/components/form/Button/Button.styles.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.ids.d.ts +42 -0
- package/dist/types/components/form/Switch/Switch.ids.d.ts.map +1 -0
- package/dist/types/components/form/Switch/Switch.metrics.d.ts +19 -0
- package/dist/types/components/form/Switch/Switch.metrics.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.parts.d.ts +31 -11
- package/dist/types/components/form/Switch/Switch.parts.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.styles.d.ts +6 -0
- package/dist/types/components/form/Switch/Switch.styles.d.ts.map +1 -1
- package/dist/types/components/navigation/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/tokens/theme.d.ts +38 -0
- package/dist/types/tokens/theme.d.ts.map +1 -1
- package/dist/types-native/components/form/Switch/Switch.look.native.d.ts +26 -2
- package/dist/types-native/components/form/Switch/Switch.look.native.d.ts.map +1 -1
- package/dist/types-native/components/form/Switch/Switch.metrics.d.ts +19 -0
- package/dist/types-native/components/form/Switch/Switch.metrics.d.ts.map +1 -1
- package/dist/types-native/components/form/Switch/Switch.native.d.ts.map +1 -1
- package/dist/types-native/tokens/theme.d.ts +38 -0
- package/dist/types-native/tokens/theme.d.ts.map +1 -1
- package/dist/typography/Heading.js +4 -4
- package/dist/typography/Paragraph.js +2 -2
- package/dist/typography/Text.js +3 -3
- package/dist/user-avatar.js +8 -8
- package/package.json +1 -1
- package/src/components/form/Button/Button.md +8 -0
- package/src/components/form/Button/Button.styles.ts +24 -3
- package/src/components/form/Switch/Switch.ids.ts +63 -0
- package/src/components/form/Switch/Switch.look.native.ts +45 -2
- package/src/components/form/Switch/Switch.md +34 -9
- package/src/components/form/Switch/Switch.metrics.ts +21 -0
- package/src/components/form/Switch/Switch.native.tsx +19 -6
- package/src/components/form/Switch/Switch.parts.tsx +150 -17
- package/src/components/form/Switch/Switch.styles.ts +59 -6
- package/src/components/form/Switch/Switch.tsx +32 -30
- package/src/components/navigation/Tabs/Tabs.tsx +46 -1
- package/src/tokens/theme.ts +50 -0
- package/dist/chunk-2ECT4IY2.js.map +0 -1
- package/dist/chunk-BB2OUERT.js.map +0 -1
- package/dist/chunk-BBC4KT5G.js.map +0 -1
- package/dist/chunk-FR67FG2U.js.map +0 -1
- package/dist/chunk-N5IVVLTH.js.map +0 -1
- package/dist/chunk-NQN5Z36J.js.map +0 -1
- /package/dist/{chunk-2GI7ANEL.js.map → chunk-22X7TT6Z.js.map} +0 -0
- /package/dist/{chunk-WR5JFDQ5.js.map → chunk-27BL3DNT.js.map} +0 -0
- /package/dist/{chunk-E55CJV65.js.map → chunk-2KVQIGVE.js.map} +0 -0
- /package/dist/{chunk-W3FAKT3D.js.map → chunk-2SWQ6HIK.js.map} +0 -0
- /package/dist/{chunk-ISW5K72V.js.map → chunk-2ZRZTGWP.js.map} +0 -0
- /package/dist/{chunk-I5SBTNV2.js.map → chunk-3GB6KWHH.js.map} +0 -0
- /package/dist/{chunk-ZEG2LNBY.js.map → chunk-3PJLT5FX.js.map} +0 -0
- /package/dist/{chunk-CXLAJZSE.js.map → chunk-3VZT2FAI.js.map} +0 -0
- /package/dist/{chunk-PFDM2OIP.js.map → chunk-45OHGD2B.js.map} +0 -0
- /package/dist/{chunk-BH5BXLGI.js.map → chunk-4A2Q22HO.js.map} +0 -0
- /package/dist/{chunk-46UPILLK.js.map → chunk-4ETQRBZC.js.map} +0 -0
- /package/dist/{chunk-TWY5FOBY.js.map → chunk-5QUSX3TC.js.map} +0 -0
- /package/dist/{chunk-AVGTTWTE.js.map → chunk-65DLYC4S.js.map} +0 -0
- /package/dist/{chunk-TVPPA4RD.js.map → chunk-65METCKT.js.map} +0 -0
- /package/dist/{chunk-OQFSYMHJ.js.map → chunk-67ALTEWH.js.map} +0 -0
- /package/dist/{chunk-OGGHD64H.js.map → chunk-6SK3MTYJ.js.map} +0 -0
- /package/dist/{chunk-OE2ZVL67.js.map → chunk-6VHCSPKK.js.map} +0 -0
- /package/dist/{chunk-WAPJ2DL3.js.map → chunk-72T5PAW7.js.map} +0 -0
- /package/dist/{chunk-SLVQ33AN.js.map → chunk-77DF5LKI.js.map} +0 -0
- /package/dist/{chunk-7KWBGMQC.js.map → chunk-77OXG6DH.js.map} +0 -0
- /package/dist/{chunk-Y3KRUT7O.js.map → chunk-7AIHK2XM.js.map} +0 -0
- /package/dist/{chunk-MHV5Y5MR.js.map → chunk-7KEGJH3Q.js.map} +0 -0
- /package/dist/{chunk-KMXAPYU2.js.map → chunk-7NEUPEV5.js.map} +0 -0
- /package/dist/{chunk-67L7HMEP.js.map → chunk-7Z2AQEC5.js.map} +0 -0
- /package/dist/{chunk-PQECNGDE.js.map → chunk-AGYGNNOM.js.map} +0 -0
- /package/dist/{chunk-ZTF5C2GA.js.map → chunk-B5SW7I5W.js.map} +0 -0
- /package/dist/{chunk-TXHJX2NG.js.map → chunk-BGYLL467.js.map} +0 -0
- /package/dist/{chunk-R7R3LOKW.js.map → chunk-CA7TA36R.js.map} +0 -0
- /package/dist/{chunk-FPFUXRD2.js.map → chunk-CKJI7JO5.js.map} +0 -0
- /package/dist/{chunk-HMV4QMXS.js.map → chunk-CMN26J5Y.js.map} +0 -0
- /package/dist/{chunk-KVEHH4SA.js.map → chunk-DB2MAYPK.js.map} +0 -0
- /package/dist/{chunk-V4FKHLEB.js.map → chunk-DTIB5KWP.js.map} +0 -0
- /package/dist/{chunk-MESRKY67.js.map → chunk-DW6GBMLQ.js.map} +0 -0
- /package/dist/{chunk-JO6BBSGY.js.map → chunk-DWJBOR47.js.map} +0 -0
- /package/dist/{chunk-YW5T6KZ5.js.map → chunk-DYESJJ3Q.js.map} +0 -0
- /package/dist/{chunk-TZDDL3DR.js.map → chunk-ECMJ5VPW.js.map} +0 -0
- /package/dist/{chunk-OH3YGJT5.js.map → chunk-EMNGIYH6.js.map} +0 -0
- /package/dist/{chunk-CZJLWCEG.js.map → chunk-EPNCYUQ7.js.map} +0 -0
- /package/dist/{chunk-JZXWCEH5.js.map → chunk-EQA4VQEO.js.map} +0 -0
- /package/dist/{chunk-3N6EK6K5.js.map → chunk-ERX4XIYC.js.map} +0 -0
- /package/dist/{chunk-TTLI6PF7.js.map → chunk-FF3R67WD.js.map} +0 -0
- /package/dist/{chunk-4Y6SPFKW.js.map → chunk-FOF2RAVQ.js.map} +0 -0
- /package/dist/{chunk-KLREH4X6.js.map → chunk-G2JPUHEJ.js.map} +0 -0
- /package/dist/{chunk-4J5EN4FQ.js.map → chunk-GBX5ACPF.js.map} +0 -0
- /package/dist/{chunk-ZZMZF7PZ.js.map → chunk-GQJ4NCZ6.js.map} +0 -0
- /package/dist/{chunk-IPVYEPXO.js.map → chunk-GSTRPZS4.js.map} +0 -0
- /package/dist/{chunk-HFXTAEYY.js.map → chunk-GTLJYAEG.js.map} +0 -0
- /package/dist/{chunk-M4LFDGI6.js.map → chunk-GYQT47YZ.js.map} +0 -0
- /package/dist/{chunk-JSH3HFDQ.js.map → chunk-H3BQFEN5.js.map} +0 -0
- /package/dist/{chunk-OV4WREMW.js.map → chunk-HKB5C2KY.js.map} +0 -0
- /package/dist/{chunk-BLBOYCOV.js.map → chunk-HKV4MQ2W.js.map} +0 -0
- /package/dist/{chunk-4MGFUPQT.js.map → chunk-HOJL2GKW.js.map} +0 -0
- /package/dist/{chunk-HR7YTBR7.js.map → chunk-IASDP44E.js.map} +0 -0
- /package/dist/{chunk-YMRI5QKG.js.map → chunk-IV5QQLCS.js.map} +0 -0
- /package/dist/{chunk-JUHUKZGU.js.map → chunk-JD3D6Y4U.js.map} +0 -0
- /package/dist/{chunk-AXTLFK4T.js.map → chunk-KAV63FBG.js.map} +0 -0
- /package/dist/{chunk-2PBGVMM2.js.map → chunk-KOFO6QZY.js.map} +0 -0
- /package/dist/{chunk-RP5FK3SO.js.map → chunk-L7LCSZ3H.js.map} +0 -0
- /package/dist/{chunk-MNXVXW4T.js.map → chunk-L7S6N67X.js.map} +0 -0
- /package/dist/{chunk-JXPHU3K5.js.map → chunk-LGJ2H4AH.js.map} +0 -0
- /package/dist/{chunk-W4YWU7LQ.js.map → chunk-LO2B7FDQ.js.map} +0 -0
- /package/dist/{chunk-PWR7K5OP.js.map → chunk-LV4UTYAD.js.map} +0 -0
- /package/dist/{chunk-OG2FP6SE.js.map → chunk-M4NFXC5R.js.map} +0 -0
- /package/dist/{chunk-ZPIMPOHV.js.map → chunk-M7E66OSC.js.map} +0 -0
- /package/dist/{chunk-OGGPQVIG.js.map → chunk-MDTSMJ7C.js.map} +0 -0
- /package/dist/{chunk-YDI6IJ6F.js.map → chunk-MI2MVH3I.js.map} +0 -0
- /package/dist/{chunk-UIZH4DAE.js.map → chunk-MQPT254A.js.map} +0 -0
- /package/dist/{chunk-EWT3WMVY.js.map → chunk-MYH7VISV.js.map} +0 -0
- /package/dist/{chunk-7NSX7A5H.js.map → chunk-N5PY7IXI.js.map} +0 -0
- /package/dist/{chunk-BHIGHSXA.js.map → chunk-NNXZ5RK5.js.map} +0 -0
- /package/dist/{chunk-EQ7PWGBN.js.map → chunk-O7HLQTB7.js.map} +0 -0
- /package/dist/{chunk-DW5FRWRQ.js.map → chunk-OAWEUKUC.js.map} +0 -0
- /package/dist/{chunk-O4VCZTK4.js.map → chunk-OGHW7RQC.js.map} +0 -0
- /package/dist/{chunk-XR6WBW23.js.map → chunk-OVGASVPW.js.map} +0 -0
- /package/dist/{chunk-HEBQS7QP.js.map → chunk-OXYR2HVK.js.map} +0 -0
- /package/dist/{chunk-TNVO2DTB.js.map → chunk-P7FQUGED.js.map} +0 -0
- /package/dist/{chunk-343TTIHD.js.map → chunk-PENJBKPH.js.map} +0 -0
- /package/dist/{chunk-2RQINU5T.js.map → chunk-PKFFJAQ6.js.map} +0 -0
- /package/dist/{chunk-M4LQRQFL.js.map → chunk-PW2WLDX3.js.map} +0 -0
- /package/dist/{chunk-WRDPWEIC.js.map → chunk-Q3GSDSK2.js.map} +0 -0
- /package/dist/{chunk-VNTOBLIB.js.map → chunk-Q3OFOOO7.js.map} +0 -0
- /package/dist/{chunk-GGI7GM5O.js.map → chunk-QE2C35TO.js.map} +0 -0
- /package/dist/{chunk-CT5K725B.js.map → chunk-QQLGSMGE.js.map} +0 -0
- /package/dist/{chunk-7MN6I5NK.js.map → chunk-QXFPTRHB.js.map} +0 -0
- /package/dist/{chunk-CZPU5TW3.js.map → chunk-RFZU5BTG.js.map} +0 -0
- /package/dist/{chunk-JB67KPGM.js.map → chunk-RRO2EOJB.js.map} +0 -0
- /package/dist/{chunk-MZQTHSLN.js.map → chunk-S7HRED4D.js.map} +0 -0
- /package/dist/{chunk-NYEA7JAI.js.map → chunk-SC72DRTX.js.map} +0 -0
- /package/dist/{chunk-JWW2Z3RH.js.map → chunk-SMZBGHR2.js.map} +0 -0
- /package/dist/{chunk-EZSEAYYT.js.map → chunk-SSWZHR46.js.map} +0 -0
- /package/dist/{chunk-NA7MIEG6.js.map → chunk-SZETT7QV.js.map} +0 -0
- /package/dist/{chunk-2HPP6RVC.js.map → chunk-TQOPF7LD.js.map} +0 -0
- /package/dist/{chunk-OLVZ6TOV.js.map → chunk-TUO47RL2.js.map} +0 -0
- /package/dist/{chunk-4IVDVZZ2.js.map → chunk-UGL6SJN6.js.map} +0 -0
- /package/dist/{chunk-QJRDDVZ2.js.map → chunk-V5P5Q6HM.js.map} +0 -0
- /package/dist/{chunk-73NJCGQG.js.map → chunk-VIK3HAUQ.js.map} +0 -0
- /package/dist/{chunk-7LCXGJN5.js.map → chunk-VK4ULJFH.js.map} +0 -0
- /package/dist/{chunk-QYNCPS5W.js.map → chunk-WBKWIFXA.js.map} +0 -0
- /package/dist/{chunk-X4Z62ZQY.js.map → chunk-WETAIIKC.js.map} +0 -0
- /package/dist/{chunk-GMTM6EN7.js.map → chunk-WKF54CCK.js.map} +0 -0
- /package/dist/{chunk-KT6HWAEN.js.map → chunk-WZUNBSS7.js.map} +0 -0
- /package/dist/{chunk-Y2B3I3IH.js.map → chunk-X5RDHO6G.js.map} +0 -0
- /package/dist/{chunk-TXKZEKJN.js.map → chunk-XNOSTV5F.js.map} +0 -0
- /package/dist/{chunk-7JXLGOM2.js.map → chunk-Y55ILY2F.js.map} +0 -0
- /package/dist/{chunk-HI2OFZSZ.js.map → chunk-YPILHGEO.js.map} +0 -0
- /package/dist/{chunk-V3PLFYKO.js.map → chunk-ZAJO2B75.js.map} +0 -0
- /package/dist/native/chunks/{chunk-2R2R35C5.js.map → chunk-2SBTJSQE.js.map} +0 -0
- /package/dist/native/chunks/{chunk-WL5LXVCK.js.map → chunk-6L4UZBQP.js.map} +0 -0
- /package/dist/native/chunks/{chunk-GW7TQ7HO.js.map → chunk-QEQZ5AF6.js.map} +0 -0
- /package/dist/native/chunks/{chunk-7LTVGW23.js.map → chunk-UII3IFLP.js.map} +0 -0
- /package/dist/native/chunks/{chunk-75JQYVDZ.js.map → chunk-UYREIOEM.js.map} +0 -0
- /package/dist/native/chunks/{chunk-GWGIWQO7.js.map → chunk-XI7HTAVN.js.map} +0 -0
- /package/dist/native/chunks/{chunk-QYUD3S6F.js.map → chunk-ZOP7UAZK.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAOjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAmBlD,eAAO,MAAM,MAAM,oGAyEjB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/** The ids the DOM `Switch` wires its label and its two descriptions with. */
|
|
3
|
+
export interface SwitchIds {
|
|
4
|
+
/** The input's id. Always set — the label has to have something to point at. */
|
|
5
|
+
inputId: string;
|
|
6
|
+
descriptionId?: string;
|
|
7
|
+
helperId?: string;
|
|
8
|
+
/** Everything that DESCRIBES the control, the caller's own included. */
|
|
9
|
+
describedBy?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SwitchIdSource {
|
|
12
|
+
/** `useId()`'s value, passed in so this stays a pure function. */
|
|
13
|
+
generated: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
helperText?: ReactNode;
|
|
18
|
+
callerDescribedBy?: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Derive every id one `Switch` needs, in one place (FUT-1905).
|
|
22
|
+
*
|
|
23
|
+
* The precedence is the point: an id the caller spelled — as `inputProps.id` or
|
|
24
|
+
* as `id` — wins, because a consumer that chose one is usually pointing its own
|
|
25
|
+
* `<label>` or a test at it. Only when there is none does the generated one
|
|
26
|
+
* apply, and it comes from `useId` rather than from the test id: two call sites
|
|
27
|
+
* sharing a `dataTestId` would otherwise share a `for`, and the second label
|
|
28
|
+
* would toggle the first control.
|
|
29
|
+
*
|
|
30
|
+
* `describedBy` APPENDS rather than replaces. The description and the helper
|
|
31
|
+
* line are the component's own, but a consumer that passed `aria-describedby`
|
|
32
|
+
* meant it, and dropping it to make room would trade one silent omission for
|
|
33
|
+
* another.
|
|
34
|
+
*
|
|
35
|
+
* It has TWO spellings and both count — top-level and inside `inputProps` —
|
|
36
|
+
* because that is a consumer's choice of spelling, not a choice of meaning.
|
|
37
|
+
* Reading only the first is how this shipped for one round: a caller writing
|
|
38
|
+
* `inputProps={{ 'aria-describedby': … }}` had it silently dropped, which is the
|
|
39
|
+
* omission the paragraph above says it must not trade for.
|
|
40
|
+
*/
|
|
41
|
+
export declare function switchIds({ generated, id, inputProps, description, helperText, callerDescribedBy, }: SwitchIdSource): SwitchIds;
|
|
42
|
+
//# sourceMappingURL=Switch.ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.ids.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IACnD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,EAAE,EACF,UAAU,EACV,WAAW,EACX,UAAU,EACV,iBAAiB,GAClB,EAAE,cAAc,GAAG,SAAS,CAY5B"}
|
|
@@ -159,6 +159,14 @@ export declare const LABEL_GAP_UNITS: {
|
|
|
159
159
|
readonly beside: 2;
|
|
160
160
|
readonly stacked: 1;
|
|
161
161
|
};
|
|
162
|
+
/**
|
|
163
|
+
* The minimum height of a touch target, in px (FUT-1905).
|
|
164
|
+
*
|
|
165
|
+
* No entry in {@link SWITCH_SIZES} reaches it — `xl`, the largest, is 34px tall
|
|
166
|
+
* and `md` is 26 — so a consumer cannot buy a legal target by passing a bigger
|
|
167
|
+
* `size`. The label is what clears it: see `SwitchLabel` in `Switch.parts.tsx`.
|
|
168
|
+
*/
|
|
169
|
+
export declare const TAP_TARGET_MIN = 40;
|
|
162
170
|
/**
|
|
163
171
|
* `neutral`'s three greys, and the literals the web falls back to for a theme
|
|
164
172
|
* whose grey ramp omits a step. Same three steps `Button` draws its neutral
|
|
@@ -175,6 +183,17 @@ export declare const NEUTRAL_FALLBACK: {
|
|
|
175
183
|
readonly light: "#9e9e9e";
|
|
176
184
|
};
|
|
177
185
|
export declare const NEUTRAL_CONTRAST = "#fff";
|
|
186
|
+
/**
|
|
187
|
+
* The RESTING thumb — the knob while the switch is off (FUT-1924).
|
|
188
|
+
*
|
|
189
|
+
* It stays white, and the reason is worth stating because the checked thumb no
|
|
190
|
+
* longer is: the resting track is `theme.palette.action.disabled` washed over
|
|
191
|
+
* the page, which no tenant picks, and a white knob on it is the conventional
|
|
192
|
+
* look in both modes. The CHECKED track is `palette.main`, a colour the tenant
|
|
193
|
+
* does pick, and that is where a stated white was a defect. See `checkedInk`
|
|
194
|
+
* in `Switch.styles.ts` and its native twin.
|
|
195
|
+
*/
|
|
196
|
+
export declare const RESTING_THUMB = "#fff";
|
|
178
197
|
/** Hover: the thumb lifts a shade and takes a halo of the hue. */
|
|
179
198
|
export declare const SWITCH_HOVER: {
|
|
180
199
|
readonly thumbScale: 1.05;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;;;;;;;GAWG;AAEH,oEAAoE;AACpE,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,cAAc,CAM1D,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEpE,eAAO,MAAM,MAAM,GAAI,UAAU,MAAM,KAAG,UAKzC,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,UAAU,GAAI,MAAM,SAAS,GAAG,SAAS,EAAE,QAAQ,MAAM,EAAE,SAAS,MAAM,KAAG,cAGzF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAKnF,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAKvE,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MA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,CAAC;AAChG,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAEvC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,kEAAkE;AAClE,eAAO,MAAM,YAAY;;;;;CAAoE,CAAC;AAE9F,wDAAwD;AACxD,eAAO,MAAM,iBAAiB;;;CAAoC,CAAC;AAEnE,uEAAuE;AACvE,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,KAAG,MAAyB,CAAC;AAE/D,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,GAAI,SAAS,aAAa,GAAG,SAAS,EAAE,SAAS,MAAM,EAAE,UAAU,MAAM,KAAG,OACtD,CAAC"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SwitchFlags } from './Switch.styles';
|
|
3
3
|
import type { SwitchProps } from './Switch.types';
|
|
4
|
-
/**
|
|
5
|
-
* A plain wrapper over the styled row. Exporting the styled component itself
|
|
6
|
-
* needs a @mui/system reference tsc calls unportable (TS2742).
|
|
7
|
-
*/
|
|
8
|
-
export declare const LabelContainer: React.FC<{
|
|
9
|
-
labelPosition?: string;
|
|
10
|
-
error?: boolean;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}>;
|
|
13
4
|
export interface SwitchIconProps {
|
|
14
5
|
icon: React.ReactNode;
|
|
15
6
|
/** True when this icon is the one the current state should show. */
|
|
@@ -17,6 +8,8 @@ export interface SwitchIconProps {
|
|
|
17
8
|
animated: boolean;
|
|
18
9
|
size: string;
|
|
19
10
|
side: 'on' | 'off';
|
|
11
|
+
/** The ink for the ON icon, which sits on the brand-filled track (FUT-1924). */
|
|
12
|
+
onInk: string;
|
|
20
13
|
}
|
|
21
14
|
/**
|
|
22
15
|
* One of the two icons overlaid on the track. The on icon slides to the left
|
|
@@ -33,19 +26,46 @@ export interface SwitchControlProps extends SwitchFlags {
|
|
|
33
26
|
size: string;
|
|
34
27
|
dataTestId?: string;
|
|
35
28
|
switchRef?: React.Ref<HTMLButtonElement>;
|
|
29
|
+
/** The id the label points at — always set, so the input always has one. */
|
|
30
|
+
inputId: string;
|
|
31
|
+
/** The caller's own `inputProps`, merged rather than spread over (FUT-1905). */
|
|
32
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
33
|
+
/** The description's id, appended to whatever the caller described it by. */
|
|
34
|
+
describedBy?: string;
|
|
36
35
|
rest: Record<string, unknown>;
|
|
37
36
|
}
|
|
38
37
|
/** The control itself: the track, and the two icons that may sit over it. */
|
|
39
38
|
export declare const SwitchControl: React.FC<SwitchControlProps>;
|
|
39
|
+
/**
|
|
40
|
+
* The helper line, which is where a validation message lands — so it is
|
|
41
|
+
* `aria-describedby`'d like the description (FUT-1905).
|
|
42
|
+
*
|
|
43
|
+
* It carried no `id` and nothing pointed at it, which means an `error` state
|
|
44
|
+
* announced as "checkbox, checked" and nothing else: the one sentence saying
|
|
45
|
+
* WHY was on screen and outside the accessibility tree.
|
|
46
|
+
*/
|
|
40
47
|
export declare const SwitchHelper: React.FC<{
|
|
41
48
|
helperText?: React.ReactNode;
|
|
42
49
|
error?: boolean;
|
|
43
50
|
dataTestId?: string;
|
|
51
|
+
id?: string;
|
|
44
52
|
}>;
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The control and its label in one row, or the control alone.
|
|
55
|
+
*
|
|
56
|
+
* Lives here rather than inline in `Switch.tsx` because the two branches only
|
|
57
|
+
* differ in what surrounds the control — and the component that assembles them
|
|
58
|
+
* was long enough that the wiring got hard to see between them.
|
|
59
|
+
*/
|
|
60
|
+
export declare const SwitchRow: React.FC<{
|
|
61
|
+
label?: React.ReactNode;
|
|
47
62
|
description?: React.ReactNode;
|
|
63
|
+
labelPosition?: string;
|
|
48
64
|
error?: boolean;
|
|
49
65
|
dataTestId?: string;
|
|
66
|
+
htmlFor: string;
|
|
67
|
+
descriptionId?: string;
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
control: React.ReactNode;
|
|
50
70
|
}>;
|
|
51
71
|
//# sourceMappingURL=Switch.parts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.parts.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.parts.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.parts.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.parts.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAwDlD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,oEAAoE;IACpE,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC;IACnB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6BhD,CAAC;AAEF,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb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18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* The same checked-track ink, for the two ICONS the control overlays on the
|
|
21
|
+
* track — which are drawn as components rather than styles, so they cannot
|
|
22
|
+
* reach {@link checkedInk} directly.
|
|
23
|
+
*/
|
|
24
|
+
export declare const onTrackInk: (theme: Theme, flags: SwitchFlags) => string;
|
|
19
25
|
export declare const switchSx: (theme: Theme, flags: SwitchFlags) => CSSObject;
|
|
20
26
|
//# sourceMappingURL=Switch.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAyCtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAiDxE,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAgPD;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,EAAE,OAAO,WAAW,KAAG,MACe,CAAC;AAE9E,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,EAAE,OAAO,WAAW,KAAG,SAc3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/Tabs/Tabs.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAW,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../src/components/navigation/Tabs/Tabs.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAW,SAAS,EAAE,MAAM,cAAc,CAAC;AA2PvD,eAAO,MAAM,IAAI,+FA+ChB,CAAC"}
|
|
@@ -143,6 +143,44 @@ export declare const DEFAULT_BRAND: Record<UiThemeMode, {
|
|
|
143
143
|
* palette's `text.primary`, which is what made it easy to read backwards.)
|
|
144
144
|
*/
|
|
145
145
|
export declare function contrastText(background: string): string;
|
|
146
|
+
/**
|
|
147
|
+
* The ink that reads on EVERY one of these fills (FUT-1924).
|
|
148
|
+
*
|
|
149
|
+
* {@link contrastText} answers for one fill, which is all MUI's `augmentColor`
|
|
150
|
+
* ever needs: a solid button is a single flat colour. Two components paint the
|
|
151
|
+
* label over something that is not one colour — `Button`'s `gradient` variant
|
|
152
|
+
* runs between two stops, and `Switch`'s thumb travels the whole length of a
|
|
153
|
+
* checked track — and both of them stated `#fff` outright instead, which is
|
|
154
|
+
* white-on-pale the moment a white-labelled host hands the library a pale
|
|
155
|
+
* brand. Audited across the library, those two were the only places a hardcoded
|
|
156
|
+
* white sat over a surface the TENANT chooses.
|
|
157
|
+
*
|
|
158
|
+
* **This deliberately does not follow `contrastText`'s rule.** MUI's is a
|
|
159
|
+
* threshold that PREFERS white — white wherever white clears 3:1 — which is a
|
|
160
|
+
* brand-feel decision, and it is kept for every existing caller so nothing
|
|
161
|
+
* already legible moves. Here the fills can disagree: over MUI's own success
|
|
162
|
+
* pair white is 2.78:1 on `#4caf50` and dark ink 2.66:1 on `#1b5e20`, so
|
|
163
|
+
* neither meets any threshold and asking whether one does is the wrong
|
|
164
|
+
* question. The answer is whichever ink has the better WORST case across the
|
|
165
|
+
* fills — which is also not what either fill says on its own, since
|
|
166
|
+
* `contrastText('#4caf50')` is dark ink.
|
|
167
|
+
*
|
|
168
|
+
* A gradient wide enough that neither ink clears 4.5:1 anywhere is a palette
|
|
169
|
+
* problem this cannot fix — it returns the less bad ink and does not pretend
|
|
170
|
+
* otherwise.
|
|
171
|
+
*
|
|
172
|
+
* `Math.min` is the claim, and it is worth knowing that no test can prove it
|
|
173
|
+
* against `Math.max` today: the two candidate inks sit at opposite ends of the
|
|
174
|
+
* luminance range, so ranking them by their best fill and by their worst gives
|
|
175
|
+
* the same winner for every possible pair (checked exhaustively). Worst case is
|
|
176
|
+
* still what this MEANS, and the moment a third ink or one that is not an
|
|
177
|
+
* extreme is offered, the two stop agreeing.
|
|
178
|
+
*
|
|
179
|
+
* `fallback` is returned when a fill cannot be decomposed: {@link getContrastRatio}
|
|
180
|
+
* throws on a format it does not know, and a throw inside an emotion style
|
|
181
|
+
* function takes the render down with it.
|
|
182
|
+
*/
|
|
183
|
+
export declare function inkOver(fills: readonly string[], fallback: string): string;
|
|
146
184
|
/**
|
|
147
185
|
* MUI's `augmentColor` for a custom colour: derive whatever shade the seed
|
|
148
186
|
* left out. `light` is one tonal offset up, `dark` one and a half down.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/tokens/theme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB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|
34
34
|
export declare function trackStyle(theme: UiTheme, paint: SwitchPaint, palette: SwitchPalette, geometry: SwitchGeometry, look: SwitchLook, state: SwitchState): ViewStyle;
|
|
35
|
-
/**
|
|
36
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The ink on the CHECKED track — the thumb, and the `on` wording (FUT-1924).
|
|
37
|
+
*
|
|
38
|
+
* Both halves of the component had a stated `#fff` here, and the checked track
|
|
39
|
+
* is the one surface a tenant chooses: a pale brand got a white knob on a pale
|
|
40
|
+
* bar, which reads as OFF while it is on.
|
|
41
|
+
*
|
|
42
|
+
* **The fills are THIS renderer's, not the web's, and they differ.** The web
|
|
43
|
+
* paints a real three-stop gradient and hands `checkedInk` all three
|
|
44
|
+
* (`Switch.styles.ts`); React Native has no gradient without a dependency, so
|
|
45
|
+
* `trackStyle` shows `gradientFirstStop` — `palette.light`, FLAT — and
|
|
46
|
+
* `NATIVE-NOTES.md` records that as a known divergence. Passing the web's set
|
|
47
|
+
* here would judge the ink against two fills native never draws, and the two
|
|
48
|
+
* renderers then disagree on the same palette: measured on `#00897b`, the web
|
|
49
|
+
* answers white and this answered dark ink, because `main` and `dark` were in
|
|
50
|
+
* the list and only `light` is on screen.
|
|
51
|
+
*
|
|
52
|
+
* So the gradient case is ONE fill, which is the one it paints.
|
|
53
|
+
*/
|
|
54
|
+
export declare function checkedInk(paint: SwitchPaint, palette: SwitchPalette): string;
|
|
55
|
+
/**
|
|
56
|
+
* The knob: round for iOS and the default, squarer for Android and Material.
|
|
57
|
+
* White while resting, the checked track's own ink once on — see
|
|
58
|
+
* {@link RESTING_THUMB} and {@link checkedInk}.
|
|
59
|
+
*/
|
|
60
|
+
export declare function thumbStyle(theme: UiTheme, paint: SwitchPaint, palette: SwitchPalette, geometry: SwitchGeometry, look: SwitchLook, state: SwitchState): ViewStyle;
|
|
37
61
|
/** MUI's `body2` at 500, in the error hue when the row is in error. */
|
|
38
62
|
export declare function labelTextStyle(theme: UiTheme, error: boolean): TextStyle;
|
|
39
63
|
/** MUI's `caption`, 4px under the label. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.look.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.look.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"Switch.look.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.look.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAmBL,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,GAAG,aAAa,CAgB9E;AAED,4DAA4D;AAC5D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AACjF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,WAAW,GACjB,SAAS,CA4BX;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAI7E;AA2BD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,WAAW,GACjB,SAAS,CAmBX;AAED,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAQxE;AAED,4CAA4C;AAC5C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAQ9E;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAQzE"}
|
|
@@ -159,6 +159,14 @@ export declare const LABEL_GAP_UNITS: {
|
|
|
159
159
|
readonly beside: 2;
|
|
160
160
|
readonly stacked: 1;
|
|
161
161
|
};
|
|
162
|
+
/**
|
|
163
|
+
* The minimum height of a touch target, in px (FUT-1905).
|
|
164
|
+
*
|
|
165
|
+
* No entry in {@link SWITCH_SIZES} reaches it — `xl`, the largest, is 34px tall
|
|
166
|
+
* and `md` is 26 — so a consumer cannot buy a legal target by passing a bigger
|
|
167
|
+
* `size`. The label is what clears it: see `SwitchLabel` in `Switch.parts.tsx`.
|
|
168
|
+
*/
|
|
169
|
+
export declare const TAP_TARGET_MIN = 40;
|
|
162
170
|
/**
|
|
163
171
|
* `neutral`'s three greys, and the literals the web falls back to for a theme
|
|
164
172
|
* whose grey ramp omits a step. Same three steps `Button` draws its neutral
|
|
@@ -175,6 +183,17 @@ export declare const NEUTRAL_FALLBACK: {
|
|
|
175
183
|
readonly light: "#9e9e9e";
|
|
176
184
|
};
|
|
177
185
|
export declare const NEUTRAL_CONTRAST = "#fff";
|
|
186
|
+
/**
|
|
187
|
+
* The RESTING thumb — the knob while the switch is off (FUT-1924).
|
|
188
|
+
*
|
|
189
|
+
* It stays white, and the reason is worth stating because the checked thumb no
|
|
190
|
+
* longer is: the resting track is `theme.palette.action.disabled` washed over
|
|
191
|
+
* the page, which no tenant picks, and a white knob on it is the conventional
|
|
192
|
+
* look in both modes. The CHECKED track is `palette.main`, a colour the tenant
|
|
193
|
+
* does pick, and that is where a stated white was a defect. See `checkedInk`
|
|
194
|
+
* in `Switch.styles.ts` and its native twin.
|
|
195
|
+
*/
|
|
196
|
+
export declare const RESTING_THUMB = "#fff";
|
|
178
197
|
/** Hover: the thumb lifts a shade and takes a halo of the hue. */
|
|
179
198
|
export declare const SWITCH_HOVER: {
|
|
180
199
|
readonly thumbScale: 1.05;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;;;;;;;GAWG;AAEH,oEAAoE;AACpE,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY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EAAqE;AACrE,eAAO,MAAM,cAAc;;;;CAAwD,CAAC;AAEpF,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAA8C,CAAC;AACvG,oEAAoE;AACpE,eAAO,MAAM,WAAW;;;CAA0C,CAAC;AAEnE,uFAAuF;AACvF,eAAO,MAAM,WAAW;;;;CAA4D,CAAC;AAErF,sFAAsF;AACtF,eAAO,MAAM,YAAY;;;;CAA+D,CAAC;AACzF,eAAO,MAAM,kBAAkB;;;;CAAmE,CAAC;AACnG,eAAO,MAAM,aAAa;;;;CAAiE,CAAC;AAE5F,6EAA6E;AAC7E,eAAO,MAAM,eAAe;;;CAAqC,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;CAAgD,CAAC;AAC1E,eAAO,MAAM,gBAAgB;;;;CAAkE,CAAC;AAChG,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAEvC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,kEAAkE;AAClE,eAAO,MAAM,YAAY;;;;;CAAoE,CAAC;AAE9F,wDAAwD;AACxD,eAAO,MAAM,iBAAiB;;;CAAoC,CAAC;AAEnE,uEAAuE;AACvE,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,KAAG,MAAyB,CAAC;AAE/D,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,GAAI,SAAS,aAAa,GAAG,SAAS,EAAE,SAAS,MAAM,EAAE,UAAU,MAAM,KAAG,OACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAQL,IAAI,EACJ,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/Switch/Switch.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAQL,IAAI,EACJ,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AA4QtB;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM;;;;;;;8BA4DjB,CAAC"}
|
|
@@ -143,6 +143,44 @@ export declare const DEFAULT_BRAND: Record<UiThemeMode, {
|
|
|
143
143
|
* palette's `text.primary`, which is what made it easy to read backwards.)
|
|
144
144
|
*/
|
|
145
145
|
export declare function contrastText(background: string): string;
|
|
146
|
+
/**
|
|
147
|
+
* The ink that reads on EVERY one of these fills (FUT-1924).
|
|
148
|
+
*
|
|
149
|
+
* {@link contrastText} answers for one fill, which is all MUI's `augmentColor`
|
|
150
|
+
* ever needs: a solid button is a single flat colour. Two components paint the
|
|
151
|
+
* label over something that is not one colour — `Button`'s `gradient` variant
|
|
152
|
+
* runs between two stops, and `Switch`'s thumb travels the whole length of a
|
|
153
|
+
* checked track — and both of them stated `#fff` outright instead, which is
|
|
154
|
+
* white-on-pale the moment a white-labelled host hands the library a pale
|
|
155
|
+
* brand. Audited across the library, those two were the only places a hardcoded
|
|
156
|
+
* white sat over a surface the TENANT chooses.
|
|
157
|
+
*
|
|
158
|
+
* **This deliberately does not follow `contrastText`'s rule.** MUI's is a
|
|
159
|
+
* threshold that PREFERS white — white wherever white clears 3:1 — which is a
|
|
160
|
+
* brand-feel decision, and it is kept for every existing caller so nothing
|
|
161
|
+
* already legible moves. Here the fills can disagree: over MUI's own success
|
|
162
|
+
* pair white is 2.78:1 on `#4caf50` and dark ink 2.66:1 on `#1b5e20`, so
|
|
163
|
+
* neither meets any threshold and asking whether one does is the wrong
|
|
164
|
+
* question. The answer is whichever ink has the better WORST case across the
|
|
165
|
+
* fills — which is also not what either fill says on its own, since
|
|
166
|
+
* `contrastText('#4caf50')` is dark ink.
|
|
167
|
+
*
|
|
168
|
+
* A gradient wide enough that neither ink clears 4.5:1 anywhere is a palette
|
|
169
|
+
* problem this cannot fix — it returns the less bad ink and does not pretend
|
|
170
|
+
* otherwise.
|
|
171
|
+
*
|
|
172
|
+
* `Math.min` is the claim, and it is worth knowing that no test can prove it
|
|
173
|
+
* against `Math.max` today: the two candidate inks sit at opposite ends of the
|
|
174
|
+
* luminance range, so ranking them by their best fill and by their worst gives
|
|
175
|
+
* the same winner for every possible pair (checked exhaustively). Worst case is
|
|
176
|
+
* still what this MEANS, and the moment a third ink or one that is not an
|
|
177
|
+
* extreme is offered, the two stop agreeing.
|
|
178
|
+
*
|
|
179
|
+
* `fallback` is returned when a fill cannot be decomposed: {@link getContrastRatio}
|
|
180
|
+
* throws on a format it does not know, and a throw inside an emotion style
|
|
181
|
+
* function takes the render down with it.
|
|
182
|
+
*/
|
|
183
|
+
export declare function inkOver(fills: readonly string[], fallback: string): string;
|
|
146
184
|
/**
|
|
147
185
|
* MUI's `augmentColor` for a custom colour: derive whatever shade the seed
|
|
148
186
|
* left out. `light` is one tonal offset up, `dark` one and a half down.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/tokens/theme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AA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;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAW1E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,cAAc,CAYhE;AAQD,yFAAyF;AACzF,eAAO,MAAM,OAAO,EAAE,cAKrB,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,UAAU,CAMpD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAMrD,CAAC;AAgBF,eAAO,MAAM,eAAe,qDAA+C,CAAC;AAC5E,eAAO,MAAM,yBAAyB,+DAA2D,CAAC;AAElG;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAsCnE;AAED,wDAAwD;AACxD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3G,eAAO,MAAM,gBAAgB,EAAE,OAAyB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../chunk-6GP2DOOO.js";
|
|
2
2
|
import {
|
|
3
3
|
Heading
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-DW6GBMLQ.js";
|
|
5
|
+
import "../chunk-LV4UTYAD.js";
|
|
6
|
+
import "../chunk-ERX4XIYC.js";
|
|
7
7
|
import "../chunk-TYJR4GOF.js";
|
|
8
8
|
import "../chunk-PT6TCWIW.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-QLI7ES7Z.js";
|
|
10
10
|
import "../chunk-AG66JBNH.js";
|
|
11
11
|
import "../chunk-6JAIFIPW.js";
|
|
12
12
|
import "../chunk-FZXKH2ZT.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Paragraph
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-GTLJYAEG.js";
|
|
4
4
|
import "../chunk-QKLGH3RZ.js";
|
|
5
5
|
import "../chunk-TYJR4GOF.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-QLI7ES7Z.js";
|
|
7
7
|
import "../chunk-AG66JBNH.js";
|
|
8
8
|
import "../chunk-6JAIFIPW.js";
|
|
9
9
|
import "../chunk-FZXKH2ZT.js";
|
package/dist/typography/Text.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-VUHLNYAE.js";
|
|
2
2
|
import {
|
|
3
3
|
Text
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-PENJBKPH.js";
|
|
5
|
+
import "../chunk-ZAJO2B75.js";
|
|
6
6
|
import "../chunk-TYJR4GOF.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-QLI7ES7Z.js";
|
|
8
8
|
import "../chunk-AG66JBNH.js";
|
|
9
9
|
import "../chunk-6JAIFIPW.js";
|
|
10
10
|
import "../chunk-FZXKH2ZT.js";
|
package/dist/user-avatar.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UserAvatar,
|
|
3
3
|
UserMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QE2C35TO.js";
|
|
5
5
|
import "./chunk-UDQSIRAP.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-JD3D6Y4U.js";
|
|
7
|
+
import "./chunk-SZETT7QV.js";
|
|
8
8
|
import "./chunk-XRMZMBE3.js";
|
|
9
9
|
import "./chunk-FAITHWIO.js";
|
|
10
10
|
import "./chunk-3ZVUNSFF.js";
|
|
@@ -15,15 +15,15 @@ import "./chunk-BEBLRL5D.js";
|
|
|
15
15
|
import "./chunk-6Q6T3FW5.js";
|
|
16
16
|
import "./chunk-FKUYRQSP.js";
|
|
17
17
|
import "./chunk-BA4RHQ3B.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-77DF5LKI.js";
|
|
19
|
+
import "./chunk-2LSCK45B.js";
|
|
20
20
|
import "./chunk-5LQ7PKMW.js";
|
|
21
21
|
import "./chunk-TAMIZE4Q.js";
|
|
22
22
|
import "./chunk-73BEVJCS.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-PENJBKPH.js";
|
|
24
|
+
import "./chunk-ZAJO2B75.js";
|
|
25
25
|
import "./chunk-TYJR4GOF.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-QLI7ES7Z.js";
|
|
27
27
|
import "./chunk-AG66JBNH.js";
|
|
28
28
|
import "./chunk-6JAIFIPW.js";
|
|
29
29
|
import "./chunk-FZXKH2ZT.js";
|
package/package.json
CHANGED
|
@@ -151,6 +151,14 @@ Gradient background with smooth color transitions.
|
|
|
151
151
|
<Button variant="gradient">Gradient Button</Button>
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
+
Its label takes the ink the palette implies, judged across BOTH ends of the
|
|
155
|
+
gradient rather than against `main` — `primary` runs `primary.main →
|
|
156
|
+
secondary.main`, and an ink that reads on the first says nothing about the
|
|
157
|
+
second. So a pale brand gets dark ink here exactly as it does on `solid`, and
|
|
158
|
+
a palette whose two ends disagree gets whichever ink survives the worse of
|
|
159
|
+
them. It used to be a stated `#fff`, which made this the one button in the
|
|
160
|
+
library a pale-branded store could not read.
|
|
161
|
+
|
|
154
162
|
## Accessibility
|
|
155
163
|
|
|
156
164
|
The Button component follows WCAG 2.1 AA guidelines:
|
|
@@ -2,7 +2,7 @@ import { alpha, darken, keyframes, lighten } from '@mui/material/styles/index.js
|
|
|
2
2
|
import type { CSSObject, Theme } from '@mui/material/styles/index.js';
|
|
3
3
|
|
|
4
4
|
import { BUTTON_SIZES, ICON_ONLY_PADDING as ICON_ONLY_PADDING_PX } from './Button.metrics';
|
|
5
|
-
import { px } from '../../../tokens/theme';
|
|
5
|
+
import { inkOver, px } from '../../../tokens/theme';
|
|
6
6
|
|
|
7
7
|
// Define pulse animation globally
|
|
8
8
|
const pulseAnimation = keyframes`
|
|
@@ -141,11 +141,32 @@ const GRADIENT_PAIRS: Record<string, (theme: Theme) => [string, string]> = {
|
|
|
141
141
|
danger: (theme) => [theme.palette.error.light, theme.palette.error.dark],
|
|
142
142
|
};
|
|
143
143
|
|
|
144
|
+
const gradientStops = (theme: Theme, color: string, palette: ColorPalette): [string, string] =>
|
|
145
|
+
GRADIENT_PAIRS[color]?.(theme) ?? [palette.main, palette.dark];
|
|
146
|
+
|
|
144
147
|
const gradientFor = (theme: Theme, color: string, palette: ColorPalette): string => {
|
|
145
|
-
const [from, to] =
|
|
148
|
+
const [from, to] = gradientStops(theme, color, palette);
|
|
146
149
|
return `linear-gradient(135deg, ${from} 0%, ${to} 100%)`;
|
|
147
150
|
};
|
|
148
151
|
|
|
152
|
+
/**
|
|
153
|
+
* The label colour for `gradient`, which used to be `#fff` outright (FUT-1924).
|
|
154
|
+
*
|
|
155
|
+
* Every other filled variant reads `palette.contrastText`, derived from `main`
|
|
156
|
+
* — so a white-labelled host handing the library a pale brand got dark ink on
|
|
157
|
+
* its solid buttons and white ink on its gradient one. That store had exactly
|
|
158
|
+
* one button in the library whose label it could not read, in LIGHT mode,
|
|
159
|
+
* before dark mode existed anywhere.
|
|
160
|
+
*
|
|
161
|
+
* `contrastText` is still not the right thing to read, and that is why this
|
|
162
|
+
* goes through {@link inkOver}: a gradient is TWO fills, the named pairs run
|
|
163
|
+
* light-to-dark, and an ink chosen against `main` says nothing about the end
|
|
164
|
+
* the gradient actually reaches. Both stops go in, and the ink has to survive
|
|
165
|
+
* the worse of them.
|
|
166
|
+
*/
|
|
167
|
+
const gradientInk = (theme: Theme, color: string, palette: ColorPalette): string =>
|
|
168
|
+
inkOver(gradientStops(theme, color, palette), palette.contrastText || '#fff');
|
|
169
|
+
|
|
149
170
|
/**
|
|
150
171
|
* The label colour for the two variants that paint no background of their own.
|
|
151
172
|
*
|
|
@@ -218,7 +239,7 @@ const VARIANT_STYLES: Record<
|
|
|
218
239
|
}),
|
|
219
240
|
gradient: (theme, palette, color) => ({
|
|
220
241
|
background: gradientFor(theme, color, palette),
|
|
221
|
-
color:
|
|
242
|
+
color: gradientInk(theme, color, palette),
|
|
222
243
|
'&:hover': {
|
|
223
244
|
filter: 'brightness(1.1)',
|
|
224
245
|
transform: 'translateY(-2px)',
|