@12-apps/ui 6.17.1 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NATIVE.md +94 -0
- package/components-catalog.md +23 -0
- package/components-guidelines.md +16 -1
- package/dist/_internal/components/data-display/AsyncStateContainer/AsyncStateContainer.js +3 -3
- package/dist/_internal/components/data-display/CardKit/CardKebab.js +10 -4
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +10 -4
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +10 -4
- package/dist/_internal/components/data-display/Carousel/Carousel.chrome.js +9 -4
- package/dist/_internal/components/data-display/Carousel/Carousel.js +11 -6
- package/dist/_internal/components/data-display/Carousel/Carousel.parts.js +8 -3
- package/dist/_internal/components/data-display/Carousel/Carousel.styles.js +8 -3
- package/dist/_internal/components/data-display/Chart/Chart.js +11 -6
- package/dist/_internal/components/data-display/Chart/SpecChart.js +12 -7
- package/dist/_internal/components/data-display/Chart/chart-context.js +9 -4
- package/dist/_internal/components/data-display/Chart/chart-internals.js +8 -3
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +10 -5
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +1 -1
- package/dist/_internal/components/data-display/DataViews/DataViewsBoard.js +8 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +49 -42
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +69 -62
- package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +12 -5
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +16 -9
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +16 -9
- package/dist/_internal/components/data-display/DataViews/base-card.js +8 -2
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +10 -4
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +9 -3
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +13 -7
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +9 -9
- package/dist/_internal/components/data-display/DataViews/data-views-columns-tab.js +8 -2
- package/dist/_internal/components/data-display/DataViews/data-views-columns.js +11 -5
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +15 -8
- package/dist/_internal/components/data-display/DataViews/data-views-display-tabs.js +8 -2
- package/dist/_internal/components/data-display/DataViews/data-views-empty.js +12 -5
- package/dist/_internal/components/data-display/DataViews/data-views-export.js +12 -5
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +11 -11
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +16 -9
- package/dist/_internal/components/data-display/DataViews/data-views-grid-helpers.js +10 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +46 -39
- package/dist/_internal/components/data-display/DataViews/data-views-header-row.js +8 -2
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +23 -16
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +8 -2
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +13 -6
- package/dist/_internal/components/data-display/DataViews/data-views-pagination.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-select-all-strip.js +12 -5
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +19 -12
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +21 -14
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +18 -11
- package/dist/_internal/components/data-display/DataViews/data-views-view-nav.js +12 -5
- package/dist/_internal/components/data-display/DataViews/save-view-preview.js +8 -2
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +12 -6
- package/dist/_internal/components/data-display/DataViews/use-saved-views-controller.js +2 -2
- package/dist/_internal/components/data-display/DescriptionItem/DescriptionItem.js +8 -2
- package/dist/_internal/components/data-display/InteractiveTooltip/InteractiveTooltip.js +2 -2
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +3 -3
- package/dist/_internal/components/data-display/Sheet/Sheet.body.js +8 -3
- package/dist/_internal/components/data-display/Sheet/Sheet.hooks.js +2 -2
- package/dist/_internal/components/data-display/Sheet/Sheet.js +12 -7
- package/dist/_internal/components/data-display/Sheet/Sheet.styles.js +8 -3
- package/dist/_internal/components/data-display/index.js +68 -61
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +10 -4
- package/dist/_internal/components/feedback/TutorialOverlay/TutorialOverlay.js +2 -2
- package/dist/_internal/components/feedback/index.js +27 -21
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.hooks.js +4 -4
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.js +6 -6
- package/dist/_internal/components/form/Button/Button.base.js +1 -0
- package/dist/_internal/components/form/Button/Button.base.js.map +1 -0
- package/dist/_internal/components/form/Button/Button.helpers.js +1 -1
- package/dist/_internal/components/form/Button/Button.js +9 -3
- package/dist/_internal/components/form/Button/Button.metrics.js +47 -0
- package/dist/_internal/components/form/Button/Button.metrics.js.map +1 -0
- package/dist/_internal/components/form/Button/Button.styles.js +6 -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 +8 -8
- package/dist/_internal/components/form/CepField/CepField.js +3 -3
- package/dist/_internal/components/form/CodeEditor/CodeEditor.js +1 -1
- package/dist/_internal/components/form/Command/Command.js +9 -4
- package/dist/_internal/components/form/Command/Command.styles.js +8 -3
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +9 -9
- package/dist/_internal/components/form/Input/Input.js +2 -2
- package/dist/_internal/components/form/Label/Label.js +9 -4
- package/dist/_internal/components/form/Label/Label.styles.js +8 -3
- package/dist/_internal/components/form/Menubar/Menubar.item.js +9 -4
- package/dist/_internal/components/form/Menubar/Menubar.js +12 -7
- package/dist/_internal/components/form/Menubar/Menubar.styles.js +8 -3
- package/dist/_internal/components/form/Menubar/Menubar.toolbar.js +10 -5
- package/dist/_internal/components/form/RichTextEditor/RichTextEditor.js +2 -2
- package/dist/_internal/components/form/index.js +94 -87
- package/dist/_internal/components/form/total-form/Fields/CategoryField.js +9 -9
- package/dist/_internal/components/form/total-form/Fields/CepField.js +4 -4
- package/dist/_internal/components/form/total-form/Fields/TextField.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/index.js +21 -21
- package/dist/_internal/components/form/total-form/SubmitButton.js +10 -4
- package/dist/_internal/components/index.js +260 -252
- package/dist/_internal/components/layout/Box/Box.base.js +8 -0
- package/dist/_internal/components/layout/Box/Box.base.js.map +1 -0
- package/dist/_internal/components/layout/Box/Box.js +22 -0
- package/dist/_internal/components/layout/Box/Box.js.map +1 -0
- package/dist/_internal/components/layout/Box/Box.types.js +8 -0
- package/dist/_internal/components/layout/Box/Box.types.js.map +1 -0
- package/dist/_internal/components/layout/Box/box-layout.js +11 -0
- package/dist/_internal/components/layout/Box/box-layout.js.map +1 -0
- package/dist/_internal/components/layout/SettingsLayout/SettingsLayout.js +2 -2
- package/dist/_internal/components/layout/Stack/Stack.base.js +1 -0
- package/dist/_internal/components/layout/Stack/Stack.base.js.map +1 -0
- package/dist/_internal/components/layout/Stack/Stack.js +22 -0
- package/dist/_internal/components/layout/Stack/Stack.js.map +1 -0
- package/dist/_internal/components/layout/Stack/Stack.types.js +1 -0
- package/dist/_internal/components/layout/Stack/Stack.types.js.map +1 -0
- package/dist/_internal/components/layout/Stack/with-dividers.js +8 -0
- package/dist/_internal/components/layout/Stack/with-dividers.js.map +1 -0
- package/dist/_internal/components/layout/index.js +19 -19
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +18 -11
- package/dist/_internal/components/navigation/AppHeader/AppHeader.identity.js +8 -3
- 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/Pagination/Pagination.js +2 -2
- package/dist/_internal/components/navigation/index.js +38 -31
- package/dist/_internal/components/typography/Heading/Heading.js +4 -3
- package/dist/_internal/components/typography/Heading/Heading.styles.js +3 -2
- package/dist/_internal/components/typography/Text/Text.base.js +1 -0
- package/dist/_internal/components/typography/Text/Text.base.js.map +1 -0
- package/dist/_internal/components/typography/Text/Text.js +7 -1
- package/dist/_internal/components/typography/Text/Text.metrics.js +34 -0
- package/dist/_internal/components/typography/Text/Text.metrics.js.map +1 -0
- package/dist/_internal/components/typography/index.js +13 -7
- package/dist/_internal/components/utility/InstallPrompt/InstallPrompt.js +2 -2
- package/dist/_internal/components/utility/index.js +26 -26
- package/dist/_internal/icons/Icon.js +21 -0
- package/dist/_internal/icons/Icon.js.map +1 -0
- package/dist/_internal/icons/Icon.types.js +10 -0
- package/dist/_internal/icons/Icon.types.js.map +1 -0
- package/dist/_internal/icons/icon-color.js +10 -0
- package/dist/_internal/icons/icon-color.js.map +1 -0
- package/dist/_internal/icons/paths.generated.js +10 -0
- package/dist/_internal/icons/paths.generated.js.map +1 -0
- package/dist/_internal/platform/test-id.js +12 -0
- package/dist/_internal/platform/test-id.js.map +1 -0
- package/dist/_internal/provider/UiProvider.js +17 -0
- package/dist/_internal/provider/UiProvider.js.map +1 -0
- package/dist/_internal/provider/UiProvider.types.js +8 -0
- package/dist/_internal/provider/UiProvider.types.js.map +1 -0
- package/dist/_internal/provider/mui-bridge.js +17 -0
- package/dist/_internal/provider/mui-bridge.js.map +1 -0
- package/dist/_internal/provider/ui-theme-context.js +9 -0
- package/dist/_internal/provider/ui-theme-context.js.map +1 -0
- package/dist/_internal/provider/use-ui-theme.js +16 -0
- package/dist/_internal/provider/use-ui-theme.js.map +1 -0
- package/dist/_internal/social-login-button/social-login-button.js +15 -8
- package/dist/_internal/tokens/color.js +26 -0
- package/dist/_internal/tokens/color.js.map +1 -0
- package/dist/_internal/tokens/css-units.js +10 -0
- package/dist/_internal/tokens/css-units.js.map +1 -0
- package/dist/_internal/tokens/heading-scale.js +10 -0
- package/dist/_internal/tokens/heading-scale.js.map +1 -0
- package/dist/_internal/tokens/theme.js +33 -0
- package/dist/_internal/tokens/theme.js.map +1 -0
- package/dist/_internal/tokens/typography.js +5 -3
- package/dist/_internal/tokens/vocabulary.js +22 -0
- package/dist/_internal/tokens/vocabulary.js.map +1 -0
- package/dist/_internal/user-avatar/user-avatar.js +12 -5
- package/dist/charts.js +12 -7
- package/dist/{chunk-IAQFQNBL.js → chunk-24BUCMQA.js} +15 -9
- package/dist/chunk-24BUCMQA.js.map +1 -0
- package/dist/{chunk-GFBNUWT5.js → chunk-2EKALM6P.js} +6 -6
- package/dist/{chunk-VRHBJXZ7.js → chunk-2PCOC3PT.js} +62 -42
- package/dist/chunk-2PCOC3PT.js.map +1 -0
- package/dist/{chunk-ISW5K72V.js → chunk-2ZRZTGWP.js} +5 -5
- package/dist/{chunk-EB4BTKKY.js → chunk-3AFUWDYS.js} +4 -4
- package/dist/{chunk-HR7YTBR7.js → chunk-3AOOI2NR.js} +4 -4
- package/dist/{chunk-PKJKA4CU.js → chunk-3ZFORMNT.js} +4 -4
- package/dist/{chunk-WME2F2YY.js → chunk-4EJSUL62.js} +3 -3
- package/dist/{chunk-WMALDOF5.js → chunk-4G3FGCWX.js} +4 -4
- package/dist/chunk-4GGH6ZQ7.js +14 -0
- package/dist/chunk-4GGH6ZQ7.js.map +1 -0
- package/dist/{chunk-2PPWKCMW.js → chunk-4N4ENTF7.js} +2 -2
- package/dist/{chunk-6CBYPMYQ.js → chunk-4R2CDZOQ.js} +4 -4
- package/dist/{chunk-FJHNNSD3.js → chunk-4WK2RTVY.js} +5 -5
- package/dist/{chunk-6U7NA74A.js → chunk-5HOJSVQH.js} +2 -2
- package/dist/{chunk-2XGM5PDA.js → chunk-624TFFLJ.js} +5 -3
- package/dist/{chunk-2XGM5PDA.js.map → chunk-624TFFLJ.js.map} +1 -1
- package/dist/{chunk-GCJLMX63.js → chunk-67LDIJQZ.js} +2 -2
- package/dist/chunk-6JAIFIPW.js +111 -0
- package/dist/chunk-6JAIFIPW.js.map +1 -0
- package/dist/{chunk-X4X4CVWJ.js → chunk-6JZE4IIN.js} +2 -2
- package/dist/{chunk-OAXAF4VY.js → chunk-74KMXBG3.js} +9 -9
- package/dist/{chunk-ZDWU52DJ.js → chunk-7AR2R7TV.js} +4 -4
- package/dist/{chunk-B6IURHSZ.js → chunk-7DNQHMDO.js} +4 -4
- package/dist/{chunk-G7CFUI4I.js → chunk-7EESF76V.js} +2 -2
- package/dist/chunk-7JXLGOM2.js +25 -0
- package/dist/chunk-7JXLGOM2.js.map +1 -0
- package/dist/{chunk-AX7UFG2U.js → chunk-7RZ4WOQW.js} +3 -3
- package/dist/chunk-7V6ZRQYW.js +90 -0
- package/dist/chunk-7V6ZRQYW.js.map +1 -0
- package/dist/chunk-7ZPUN7TV.js +29 -0
- package/dist/chunk-7ZPUN7TV.js.map +1 -0
- package/dist/chunk-AG66JBNH.js +21 -0
- package/dist/chunk-AG66JBNH.js.map +1 -0
- package/dist/{chunk-VOOPGAQO.js → chunk-B7BZAIHL.js} +2 -2
- package/dist/{chunk-FWCUELBU.js → chunk-BILE3A7F.js} +2 -2
- package/dist/{chunk-XSKVBGCZ.js → chunk-BLBOYCOV.js} +6 -6
- package/dist/{chunk-4Y65Q3CR.js → chunk-C52BELLW.js} +3 -3
- package/dist/{chunk-QCIWROKG.js → chunk-CGQI4XE5.js} +5 -3
- package/dist/{chunk-QCIWROKG.js.map → chunk-CGQI4XE5.js.map} +1 -1
- package/dist/{chunk-RP3W6IQO.js → chunk-CPNSVIIB.js} +5 -5
- package/dist/{chunk-T4SM36XC.js → chunk-D7FJ2GAD.js} +2 -2
- package/dist/{chunk-SCGVB7DS.js → chunk-DOADQW7I.js} +2 -2
- package/dist/{chunk-RIAIJTEW.js → chunk-DOMEYGTN.js} +2 -2
- package/dist/{chunk-7HPPUO2A.js → chunk-DQHC5P64.js} +3 -3
- package/dist/{chunk-W2UTDN4T.js → chunk-DWZ7FLA7.js} +4 -4
- package/dist/{chunk-24LW52EU.js → chunk-DX527XPL.js} +2 -2
- package/dist/{chunk-A4YWFX5C.js → chunk-ENNW5SKT.js} +2 -2
- package/dist/{chunk-BPYPUEM5.js → chunk-EPNCYUQ7.js} +5 -5
- package/dist/{chunk-MUAVYVDJ.js → chunk-EW7ZNSWU.js} +5 -5
- package/dist/{chunk-DWUMMMLR.js → chunk-FOMK3WPG.js} +2 -2
- package/dist/{chunk-RQ4EQ5FJ.js → chunk-FP4R47TM.js} +2 -2
- package/dist/{chunk-7CA6GVBO.js → chunk-FZXKH2ZT.js} +3 -7
- package/dist/chunk-FZXKH2ZT.js.map +1 -0
- package/dist/{chunk-SHQWIDD5.js → chunk-GJQYM3PM.js} +4 -4
- package/dist/{chunk-WEH5TCPE.js → chunk-GSTRPZS4.js} +8 -8
- package/dist/chunk-H2EQVMU3.js +49 -0
- package/dist/chunk-H2EQVMU3.js.map +1 -0
- package/dist/{chunk-WC3W36AM.js → chunk-HOJL2GKW.js} +4 -4
- package/dist/{chunk-PMFW55F5.js → chunk-HSAH5QUQ.js} +5 -5
- package/dist/{chunk-A3KY6NUA.js → chunk-IH4CX43Q.js} +2 -2
- package/dist/{chunk-HEDOL2RV.js → chunk-IJIT5HQP.js} +3 -3
- package/dist/{chunk-VR5HDUBK.js → chunk-IPS55KWK.js} +2 -2
- package/dist/chunk-ITGG5OKP.js +86 -0
- package/dist/chunk-ITGG5OKP.js.map +1 -0
- package/dist/{chunk-ELYLG4F7.js → chunk-J54WH74M.js} +4 -4
- package/dist/chunk-J6UFAMIC.js +19 -0
- package/dist/chunk-J6UFAMIC.js.map +1 -0
- package/dist/{chunk-5ZOJLYD2.js → chunk-JE6RZ5L6.js} +4 -4
- package/dist/{chunk-NYUGX76C.js → chunk-JT6TERQL.js} +20 -17
- package/dist/chunk-JT6TERQL.js.map +1 -0
- package/dist/chunk-KLREH4X6.js +16 -0
- package/dist/chunk-KLREH4X6.js.map +1 -0
- package/dist/{chunk-EY4LPLIR.js → chunk-KQ74QU55.js} +3 -3
- package/dist/{chunk-XULTDO56.js → chunk-KT6HWAEN.js} +2 -2
- package/dist/{chunk-COSJTD6Z.js → chunk-KZSKI2R3.js} +2 -2
- package/dist/{chunk-DQIQKIEA.js → chunk-L5ZZJ4XE.js} +3 -3
- package/dist/{chunk-SFAP5EH5.js → chunk-LUMF63BM.js} +4 -4
- package/dist/{chunk-6RFL7HGI.js → chunk-LZRURORY.js} +4 -4
- package/dist/{chunk-KXNWDXR7.js → chunk-M2K7BPHX.js} +2 -2
- package/dist/{chunk-WLDK74RR.js → chunk-MSUSZLRE.js} +2 -2
- package/dist/{chunk-WPR2HS5B.js → chunk-MUVJD26L.js} +8 -8
- package/dist/{chunk-VVXRIPV5.js → chunk-MY5VNNSP.js} +9 -9
- package/dist/{chunk-JPDKRGYI.js → chunk-MZQTHSLN.js} +3 -3
- package/dist/{chunk-FF55LRSV.js → chunk-NETZMGQP.js} +2 -2
- package/dist/{chunk-3QGRQNTP.js → chunk-NFAKRI4S.js} +6 -6
- package/dist/{chunk-KSF7TLXH.js → chunk-NHSMLVNC.js} +6 -6
- package/dist/chunk-NQN5Z36J.js +182 -0
- package/dist/chunk-NQN5Z36J.js.map +1 -0
- package/dist/{chunk-HQJ75HHI.js → chunk-NYLXHOMR.js} +2 -2
- package/dist/chunk-OCUVKI63.js +35 -0
- package/dist/chunk-OCUVKI63.js.map +1 -0
- package/dist/{chunk-CXA6UNFF.js → chunk-OH3YGJT5.js} +7 -7
- package/dist/{chunk-REMK55JI.js → chunk-OLZTGVBT.js} +4 -4
- package/dist/{chunk-M3RIC6JI.js → chunk-OQXOYHIV.js} +4 -4
- package/dist/{chunk-3LO5JWTC.js → chunk-P5YYVDAD.js} +3 -3
- package/dist/{chunk-6TYSEAAT.js → chunk-PC5FFEIY.js} +4 -4
- package/dist/{chunk-SLYZMJEL.js → chunk-PHCSPHDH.js} +3 -3
- package/dist/{chunk-TCAB2ERD.js → chunk-PNYXXLPU.js} +2 -2
- package/dist/chunk-PT6TCWIW.js +13 -0
- package/dist/chunk-PT6TCWIW.js.map +1 -0
- package/dist/{chunk-IPE5FFFD.js → chunk-PUBPZOQJ.js} +2 -2
- package/dist/chunk-QLWBQQW7.js +18 -0
- package/dist/chunk-QLWBQQW7.js.map +1 -0
- package/dist/{chunk-6HNEEJES.js → chunk-QRX5BYUQ.js} +4 -4
- package/dist/chunk-QWBQVQRG.js +18 -0
- package/dist/chunk-QWBQVQRG.js.map +1 -0
- package/dist/{chunk-5QXSPLWU.js → chunk-R6SSXEK2.js} +2 -2
- package/dist/chunk-RLC46NIW.js +47 -0
- package/dist/chunk-RLC46NIW.js.map +1 -0
- package/dist/{chunk-NR3J7VQL.js → chunk-RNCQ5KHQ.js} +2 -2
- package/dist/chunk-RTSK5OZT.js +15 -0
- package/dist/chunk-RTSK5OZT.js.map +1 -0
- package/dist/{chunk-7FOOLP5H.js → chunk-RXSGHPCR.js} +4 -4
- package/dist/{chunk-Z56IO7OV.js → chunk-RXVPUW7V.js} +2 -2
- package/dist/{chunk-5SYD23V4.js → chunk-SKZHOWTS.js} +4 -4
- package/dist/{chunk-FWL2N2KH.js → chunk-SX3V2DLV.js} +2 -2
- package/dist/{chunk-AUYC5K5K.js → chunk-TAMIZE4Q.js} +1 -1
- package/dist/chunk-TAMIZE4Q.js.map +1 -0
- package/dist/{chunk-3GOX75ZM.js → chunk-TF4TPLF2.js} +2 -2
- package/dist/{chunk-3DQP6OPC.js → chunk-THBT56JE.js} +2 -2
- package/dist/{chunk-CBPQJAHX.js → chunk-U7RULTSH.js} +3 -3
- package/dist/{chunk-RRX6ZTNX.js → chunk-UEJQQVP2.js} +4 -4
- package/dist/{chunk-ES2RN7YV.js → chunk-UQHJQ26Y.js} +2 -2
- package/dist/chunk-V3PLFYKO.js +34 -0
- package/dist/chunk-V3PLFYKO.js.map +1 -0
- package/dist/chunk-V5IOLAIS.js +22 -0
- package/dist/chunk-V5IOLAIS.js.map +1 -0
- package/dist/{chunk-WR6F6J43.js → chunk-V662PA6T.js} +6 -6
- package/dist/{chunk-VJKRJYZL.js → chunk-VEFDL77X.js} +2 -2
- package/dist/{chunk-GT7C6TSM.js → chunk-VNEEXUWA.js} +3 -3
- package/dist/{chunk-N34YHFZW.js → chunk-W2YNUUVJ.js} +2 -2
- package/dist/{chunk-N4WANJI3.js → chunk-WBVHRLIS.js} +4 -4
- package/dist/{chunk-MHFJBNDP.js → chunk-WO52KYSU.js} +8 -8
- package/dist/{chunk-CLNTJM3F.js → chunk-WUPVHIMD.js} +2 -2
- package/dist/{chunk-ZBOFBRZC.js → chunk-WX7VWW3W.js} +2 -2
- package/dist/{chunk-SRMWCN5D.js → chunk-X5BHPSAC.js} +5 -5
- package/dist/chunk-X5D3PTWI.js +58 -0
- package/dist/chunk-X5D3PTWI.js.map +1 -0
- package/dist/{chunk-MD6T7MDT.js → chunk-XKMFIH27.js} +12 -12
- package/dist/{chunk-T53L42XW.js → chunk-XSJWN3WH.js} +7 -7
- package/dist/{chunk-AVU6KU27.js → chunk-XXDXW6TX.js} +2 -2
- package/dist/chunk-XZTRZ3HO.js +7 -0
- package/dist/chunk-XZTRZ3HO.js.map +1 -0
- package/dist/chunk-YMRI5QKG.js +134 -0
- package/dist/chunk-YMRI5QKG.js.map +1 -0
- package/dist/{chunk-45OIUWGO.js → chunk-YNQGXSDD.js} +5 -5
- package/dist/{chunk-5VVM2PPV.js → chunk-ZEBJT5JZ.js} +3 -3
- package/dist/{chunk-DJORMYOV.js → chunk-ZU3SWR4I.js} +2 -2
- package/dist/data-display/AsyncStateContainer.js +3 -3
- package/dist/data-display/CardKit.js +14 -8
- package/dist/data-display/Carousel.js +11 -6
- package/dist/data-display/Chart.js +12 -7
- package/dist/data-display/DataGrid.js +1 -1
- package/dist/data-display/DataViews.js +78 -71
- package/dist/data-display/DescriptionItem.js +8 -2
- package/dist/data-display/InteractiveTooltip.js +2 -2
- package/dist/data-display/Lightbox.js +3 -3
- package/dist/data-display/Sheet.js +12 -7
- package/dist/en-US.js +8 -8
- package/dist/feedback/ConfirmAction.js +12 -6
- package/dist/feedback/TutorialOverlay.js +2 -2
- package/dist/form/AddressAutocomplete.js +6 -6
- package/dist/form/Button.js +9 -3
- package/dist/form/Calendar.js +6 -6
- package/dist/form/CategorySelect.js +10 -10
- package/dist/form/CepField.js +3 -3
- package/dist/form/CodeEditor.js +1 -1
- package/dist/form/Command.js +9 -4
- package/dist/form/DateRangePicker.js +9 -9
- package/dist/form/Input.js +2 -2
- package/dist/form/Label.js +9 -4
- package/dist/form/Menubar.js +12 -7
- package/dist/form/RichTextEditor.js +2 -2
- package/dist/form/total-form.js +34 -28
- package/dist/icons.js +31 -0
- package/dist/icons.js.map +1 -0
- package/dist/layout/Box.js +23 -0
- package/dist/layout/Box.js.map +1 -0
- package/dist/layout/SettingsLayout.js +2 -2
- package/dist/layout/Stack.js +22 -0
- package/dist/layout/Stack.js.map +1 -0
- package/dist/locales.js +25 -25
- package/dist/native/chunks/chunk-5WLOVHKK.js +29 -0
- package/dist/native/chunks/chunk-5WLOVHKK.js.map +1 -0
- package/dist/native/chunks/chunk-L2UUNK2M.js +316 -0
- package/dist/native/chunks/chunk-L2UUNK2M.js.map +1 -0
- package/dist/native/chunks/chunk-M4DTJDWU.js +18 -0
- package/dist/native/chunks/chunk-M4DTJDWU.js.map +1 -0
- package/dist/native/chunks/chunk-QZ233LRH.js +136 -0
- package/dist/native/chunks/chunk-QZ233LRH.js.map +1 -0
- package/dist/native/chunks/chunk-VGBKUL6D.js +21 -0
- package/dist/native/chunks/chunk-VGBKUL6D.js.map +1 -0
- package/dist/native/form/Button.js +321 -0
- package/dist/native/form/Button.js.map +1 -0
- package/dist/native/icons.js +108 -0
- package/dist/native/icons.js.map +1 -0
- package/dist/native/layout/Box.js +12 -0
- package/dist/native/layout/Box.js.map +1 -0
- package/dist/native/layout/Stack.js +30 -0
- package/dist/native/layout/Stack.js.map +1 -0
- package/dist/native/provider.js +26 -0
- package/dist/native/provider.js.map +1 -0
- package/dist/native/tokens.js +65 -0
- package/dist/native/tokens.js.map +1 -0
- package/dist/native/typography/Text.js +131 -0
- package/dist/native/typography/Text.js.map +1 -0
- package/dist/navigation/AppHeader.js +19 -12
- package/dist/navigation/CommandPalette.js +3 -3
- package/dist/navigation/NavigationMenu.js +5 -5
- package/dist/navigation/Pagination.js +2 -2
- package/dist/provider.js +26 -0
- package/dist/provider.js.map +1 -0
- package/dist/pt-BR.js +8 -8
- package/dist/social-login-button.js +15 -8
- package/dist/tokens.js +59 -6
- package/dist/types/components/form/Button/Button.base.d.ts +65 -0
- package/dist/types/components/form/Button/Button.base.d.ts.map +1 -0
- package/dist/types/components/form/Button/Button.d.ts.map +1 -1
- package/dist/types/components/form/Button/Button.helpers.d.ts +7 -3
- package/dist/types/components/form/Button/Button.helpers.d.ts.map +1 -1
- package/dist/types/components/form/Button/Button.metrics.d.ts +52 -0
- package/dist/types/components/form/Button/Button.metrics.d.ts.map +1 -0
- package/dist/types/components/form/Button/Button.styles.d.ts.map +1 -1
- package/dist/types/components/form/Button/Button.types.d.ts +3 -46
- package/dist/types/components/form/Button/Button.types.d.ts.map +1 -1
- package/dist/types/components/form/Button/index.d.ts +1 -1
- package/dist/types/components/form/Button/index.d.ts.map +1 -1
- package/dist/types/components/layout/Box/Box.base.d.ts +60 -0
- package/dist/types/components/layout/Box/Box.base.d.ts.map +1 -0
- package/dist/types/components/layout/Box/Box.d.ts +10 -0
- package/dist/types/components/layout/Box/Box.d.ts.map +1 -0
- package/dist/types/components/layout/Box/Box.types.d.ts +11 -0
- package/dist/types/components/layout/Box/Box.types.d.ts.map +1 -0
- package/dist/types/components/layout/Box/box-layout.d.ts +42 -0
- package/dist/types/components/layout/Box/box-layout.d.ts.map +1 -0
- package/dist/types/components/layout/Box/index.d.ts +5 -0
- package/dist/types/components/layout/Box/index.d.ts.map +1 -0
- package/dist/types/components/layout/Stack/Stack.base.d.ts +13 -0
- package/dist/types/components/layout/Stack/Stack.base.d.ts.map +1 -0
- package/dist/types/components/layout/Stack/Stack.d.ts +4 -0
- package/dist/types/components/layout/Stack/Stack.d.ts.map +1 -0
- package/dist/types/components/layout/Stack/Stack.types.d.ts +5 -0
- package/dist/types/components/layout/Stack/Stack.types.d.ts.map +1 -0
- package/dist/types/components/layout/Stack/index.d.ts +3 -0
- package/dist/types/components/layout/Stack/index.d.ts.map +1 -0
- package/dist/types/components/layout/Stack/with-dividers.d.ts +4 -0
- package/dist/types/components/layout/Stack/with-dividers.d.ts.map +1 -0
- package/dist/types/components/typography/Text/Text.base.d.ts +23 -0
- package/dist/types/components/typography/Text/Text.base.d.ts.map +1 -0
- package/dist/types/components/typography/Text/Text.d.ts.map +1 -1
- package/dist/types/components/typography/Text/Text.metrics.d.ts +29 -0
- package/dist/types/components/typography/Text/Text.metrics.d.ts.map +1 -0
- package/dist/types/components/typography/Text/Text.types.d.ts +3 -11
- package/dist/types/components/typography/Text/Text.types.d.ts.map +1 -1
- package/dist/types/components/typography/Text/index.d.ts +1 -1
- package/dist/types/components/typography/Text/index.d.ts.map +1 -1
- package/dist/types/icons/Icon.d.ts +13 -0
- package/dist/types/icons/Icon.d.ts.map +1 -0
- package/dist/types/icons/Icon.types.d.ts +30 -0
- package/dist/types/icons/Icon.types.d.ts.map +1 -0
- package/dist/types/icons/icon-color.d.ts +10 -0
- package/dist/types/icons/icon-color.d.ts.map +1 -0
- package/dist/types/icons/index.d.ts +6 -0
- package/dist/types/icons/index.d.ts.map +1 -0
- package/dist/types/icons/paths.generated.d.ts +43 -0
- package/dist/types/icons/paths.generated.d.ts.map +1 -0
- package/dist/types/platform/test-id.d.ts +21 -0
- package/dist/types/platform/test-id.d.ts.map +1 -0
- package/dist/types/provider/UiProvider.d.ts +15 -0
- package/dist/types/provider/UiProvider.d.ts.map +1 -0
- package/dist/types/provider/UiProvider.types.d.ts +17 -0
- package/dist/types/provider/UiProvider.types.d.ts.map +1 -0
- package/dist/types/provider/index.d.ts +5 -0
- package/dist/types/provider/index.d.ts.map +1 -0
- package/dist/types/provider/mui-bridge.d.ts +7 -0
- package/dist/types/provider/mui-bridge.d.ts.map +1 -0
- package/dist/types/provider/ui-theme-context.d.ts +12 -0
- package/dist/types/provider/ui-theme-context.d.ts.map +1 -0
- package/dist/types/provider/use-ui-theme.d.ts +11 -0
- package/dist/types/provider/use-ui-theme.d.ts.map +1 -0
- package/dist/types/tokens/color.d.ts +44 -0
- package/dist/types/tokens/color.d.ts.map +1 -0
- package/dist/types/tokens/css-units.d.ts +14 -0
- package/dist/types/tokens/css-units.d.ts.map +1 -0
- package/dist/types/tokens/heading-scale.d.ts +65 -0
- package/dist/types/tokens/heading-scale.d.ts.map +1 -0
- package/dist/types/tokens/scales.d.ts +9 -114
- package/dist/types/tokens/scales.d.ts.map +1 -1
- package/dist/types/tokens/theme.d.ts +166 -0
- package/dist/types/tokens/theme.d.ts.map +1 -0
- package/dist/types/tokens/typography.d.ts +6 -62
- package/dist/types/tokens/typography.d.ts.map +1 -1
- package/dist/types/tokens/vocabulary.d.ts +117 -0
- package/dist/types/tokens/vocabulary.d.ts.map +1 -0
- package/dist/types-native/components/form/Button/Button.base.d.ts +65 -0
- package/dist/types-native/components/form/Button/Button.base.d.ts.map +1 -0
- package/dist/types-native/components/form/Button/Button.helpers.d.ts +10 -0
- package/dist/types-native/components/form/Button/Button.helpers.d.ts.map +1 -0
- package/dist/types-native/components/form/Button/Button.metrics.d.ts +52 -0
- package/dist/types-native/components/form/Button/Button.metrics.d.ts.map +1 -0
- package/dist/types-native/components/form/Button/Button.native.d.ts +10 -0
- package/dist/types-native/components/form/Button/Button.native.d.ts.map +1 -0
- package/dist/types-native/components/form/Button/Button.types.native.d.ts +17 -0
- package/dist/types-native/components/form/Button/Button.types.native.d.ts.map +1 -0
- package/dist/types-native/components/form/Button/index.native.d.ts +3 -0
- package/dist/types-native/components/form/Button/index.native.d.ts.map +1 -0
- package/dist/types-native/components/layout/Box/Box.base.d.ts +60 -0
- package/dist/types-native/components/layout/Box/Box.base.d.ts.map +1 -0
- package/dist/types-native/components/layout/Box/Box.native.d.ts +7 -0
- package/dist/types-native/components/layout/Box/Box.native.d.ts.map +1 -0
- package/dist/types-native/components/layout/Box/Box.types.native.d.ts +9 -0
- package/dist/types-native/components/layout/Box/Box.types.native.d.ts.map +1 -0
- package/dist/types-native/components/layout/Box/box-layout.d.ts +42 -0
- package/dist/types-native/components/layout/Box/box-layout.d.ts.map +1 -0
- package/dist/types-native/components/layout/Box/index.native.d.ts +5 -0
- package/dist/types-native/components/layout/Box/index.native.d.ts.map +1 -0
- package/dist/types-native/components/layout/Stack/Stack.base.d.ts +13 -0
- package/dist/types-native/components/layout/Stack/Stack.base.d.ts.map +1 -0
- package/dist/types-native/components/layout/Stack/Stack.native.d.ts +4 -0
- package/dist/types-native/components/layout/Stack/Stack.native.d.ts.map +1 -0
- package/dist/types-native/components/layout/Stack/Stack.types.native.d.ts +5 -0
- package/dist/types-native/components/layout/Stack/Stack.types.native.d.ts.map +1 -0
- package/dist/types-native/components/layout/Stack/index.native.d.ts +3 -0
- package/dist/types-native/components/layout/Stack/index.native.d.ts.map +1 -0
- package/dist/types-native/components/layout/Stack/with-dividers.d.ts +4 -0
- package/dist/types-native/components/layout/Stack/with-dividers.d.ts.map +1 -0
- package/dist/types-native/components/typography/Text/Text.base.d.ts +23 -0
- package/dist/types-native/components/typography/Text/Text.base.d.ts.map +1 -0
- package/dist/types-native/components/typography/Text/Text.metrics.d.ts +29 -0
- package/dist/types-native/components/typography/Text/Text.metrics.d.ts.map +1 -0
- package/dist/types-native/components/typography/Text/Text.native.d.ts +25 -0
- package/dist/types-native/components/typography/Text/Text.native.d.ts.map +1 -0
- package/dist/types-native/components/typography/Text/Text.types.native.d.ts +8 -0
- package/dist/types-native/components/typography/Text/Text.types.native.d.ts.map +1 -0
- package/dist/types-native/components/typography/Text/index.native.d.ts +3 -0
- package/dist/types-native/components/typography/Text/index.native.d.ts.map +1 -0
- package/dist/types-native/icons/Icon.native.d.ts +15 -0
- package/dist/types-native/icons/Icon.native.d.ts.map +1 -0
- package/dist/types-native/icons/Icon.types.d.ts +30 -0
- package/dist/types-native/icons/Icon.types.d.ts.map +1 -0
- package/dist/types-native/icons/icon-color.d.ts +10 -0
- package/dist/types-native/icons/icon-color.d.ts.map +1 -0
- package/dist/types-native/icons/index.native.d.ts +6 -0
- package/dist/types-native/icons/index.native.d.ts.map +1 -0
- package/dist/types-native/icons/paths.generated.d.ts +43 -0
- package/dist/types-native/icons/paths.generated.d.ts.map +1 -0
- package/dist/types-native/platform/test-id.d.ts +21 -0
- package/dist/types-native/platform/test-id.d.ts.map +1 -0
- package/dist/types-native/provider/UiProvider.native.d.ts +8 -0
- package/dist/types-native/provider/UiProvider.native.d.ts.map +1 -0
- package/dist/types-native/provider/UiProvider.types.d.ts +17 -0
- package/dist/types-native/provider/UiProvider.types.d.ts.map +1 -0
- package/dist/types-native/provider/index.native.d.ts +4 -0
- package/dist/types-native/provider/index.native.d.ts.map +1 -0
- package/dist/types-native/provider/ui-theme-context.d.ts +12 -0
- package/dist/types-native/provider/ui-theme-context.d.ts.map +1 -0
- package/dist/types-native/provider/use-ui-theme.native.d.ts +4 -0
- package/dist/types-native/provider/use-ui-theme.native.d.ts.map +1 -0
- package/dist/types-native/tokens/color.d.ts +44 -0
- package/dist/types-native/tokens/color.d.ts.map +1 -0
- package/dist/types-native/tokens/css-units.d.ts +14 -0
- package/dist/types-native/tokens/css-units.d.ts.map +1 -0
- package/dist/types-native/tokens/heading-scale.d.ts +65 -0
- package/dist/types-native/tokens/heading-scale.d.ts.map +1 -0
- package/dist/types-native/tokens/index.native.d.ts +10 -0
- package/dist/types-native/tokens/index.native.d.ts.map +1 -0
- package/dist/types-native/tokens/theme.d.ts +166 -0
- package/dist/types-native/tokens/theme.d.ts.map +1 -0
- package/dist/types-native/tokens/vocabulary.d.ts +117 -0
- package/dist/types-native/tokens/vocabulary.d.ts.map +1 -0
- package/dist/typography/Heading.js +4 -3
- package/dist/typography/Text.js +7 -1
- package/dist/user-avatar.js +12 -5
- package/dist/utility/InstallPrompt.js +2 -2
- package/package.json +79 -7
- package/src/components/form/Button/Button.base.ts +80 -0
- package/src/components/form/Button/Button.helpers.ts +12 -7
- package/src/components/form/Button/Button.metrics.ts +101 -0
- package/src/components/form/Button/Button.native.tsx +339 -0
- package/src/components/form/Button/Button.styles.ts +16 -16
- package/src/components/form/Button/Button.tsx +8 -5
- package/src/components/form/Button/Button.types.native.ts +27 -0
- package/src/components/form/Button/Button.types.ts +8 -58
- package/src/components/form/Button/index.native.ts +2 -0
- package/src/components/form/Button/index.ts +1 -1
- package/src/components/layout/Box/Box.base.ts +69 -0
- package/src/components/layout/Box/Box.md +46 -0
- package/src/components/layout/Box/Box.native.tsx +22 -0
- package/src/components/layout/Box/Box.tsx +56 -0
- package/src/components/layout/Box/Box.types.native.ts +21 -0
- package/src/components/layout/Box/Box.types.ts +22 -0
- package/src/components/layout/Box/box-layout.ts +144 -0
- package/src/components/layout/Box/index.native.ts +14 -0
- package/src/components/layout/Box/index.ts +14 -0
- package/src/components/layout/Stack/Stack.base.ts +14 -0
- package/src/components/layout/Stack/Stack.md +19 -0
- package/src/components/layout/Stack/Stack.native.tsx +16 -0
- package/src/components/layout/Stack/Stack.tsx +15 -0
- package/src/components/layout/Stack/Stack.types.native.ts +6 -0
- package/src/components/layout/Stack/Stack.types.ts +6 -0
- package/src/components/layout/Stack/index.native.ts +2 -0
- package/src/components/layout/Stack/index.ts +2 -0
- package/src/components/layout/Stack/with-dividers.ts +15 -0
- package/src/components/typography/Text/Text.base.ts +25 -0
- package/src/components/typography/Text/Text.metrics.ts +30 -0
- package/src/components/typography/Text/Text.native.tsx +149 -0
- package/src/components/typography/Text/Text.tsx +45 -27
- package/src/components/typography/Text/Text.types.native.ts +11 -0
- package/src/components/typography/Text/Text.types.ts +7 -12
- package/src/components/typography/Text/index.native.ts +2 -0
- package/src/components/typography/Text/index.ts +1 -1
- package/src/icons/Icon.md +28 -0
- package/src/icons/Icon.native.tsx +44 -0
- package/src/icons/Icon.tsx +47 -0
- package/src/icons/Icon.types.ts +40 -0
- package/src/icons/glyphs.json +39 -0
- package/src/icons/icon-color.ts +20 -0
- package/src/icons/index.native.ts +5 -0
- package/src/icons/index.ts +5 -0
- package/src/icons/paths.generated.ts +51 -0
- package/src/platform/test-id.ts +34 -0
- package/src/provider/UiProvider.native.tsx +13 -0
- package/src/provider/UiProvider.tsx +22 -0
- package/src/provider/UiProvider.types.ts +20 -0
- package/src/provider/index.native.ts +3 -0
- package/src/provider/index.ts +4 -0
- package/src/provider/mui-bridge.ts +141 -0
- package/src/provider/ui-theme-context.ts +13 -0
- package/src/provider/use-ui-theme.native.ts +9 -0
- package/src/provider/use-ui-theme.ts +18 -0
- package/src/tokens/color.ts +163 -0
- package/src/tokens/css-units.ts +28 -0
- package/src/tokens/heading-scale.ts +87 -0
- package/src/tokens/index.native.ts +9 -0
- package/src/tokens/scales.ts +11 -186
- package/src/tokens/theme.ts +334 -0
- package/src/tokens/typography.ts +6 -83
- package/src/tokens/vocabulary.ts +189 -0
- package/dist/chunk-7CA6GVBO.js.map +0 -1
- package/dist/chunk-AUYC5K5K.js.map +0 -1
- package/dist/chunk-I6PZVHIT.js +0 -46
- package/dist/chunk-I6PZVHIT.js.map +0 -1
- package/dist/chunk-IAQFQNBL.js.map +0 -1
- package/dist/chunk-NYUGX76C.js.map +0 -1
- package/dist/chunk-VRHBJXZ7.js.map +0 -1
- /package/dist/{chunk-GFBNUWT5.js.map → chunk-2EKALM6P.js.map} +0 -0
- /package/dist/{chunk-ISW5K72V.js.map → chunk-2ZRZTGWP.js.map} +0 -0
- /package/dist/{chunk-EB4BTKKY.js.map → chunk-3AFUWDYS.js.map} +0 -0
- /package/dist/{chunk-HR7YTBR7.js.map → chunk-3AOOI2NR.js.map} +0 -0
- /package/dist/{chunk-PKJKA4CU.js.map → chunk-3ZFORMNT.js.map} +0 -0
- /package/dist/{chunk-WME2F2YY.js.map → chunk-4EJSUL62.js.map} +0 -0
- /package/dist/{chunk-WMALDOF5.js.map → chunk-4G3FGCWX.js.map} +0 -0
- /package/dist/{chunk-2PPWKCMW.js.map → chunk-4N4ENTF7.js.map} +0 -0
- /package/dist/{chunk-6CBYPMYQ.js.map → chunk-4R2CDZOQ.js.map} +0 -0
- /package/dist/{chunk-FJHNNSD3.js.map → chunk-4WK2RTVY.js.map} +0 -0
- /package/dist/{chunk-6U7NA74A.js.map → chunk-5HOJSVQH.js.map} +0 -0
- /package/dist/{chunk-GCJLMX63.js.map → chunk-67LDIJQZ.js.map} +0 -0
- /package/dist/{chunk-X4X4CVWJ.js.map → chunk-6JZE4IIN.js.map} +0 -0
- /package/dist/{chunk-OAXAF4VY.js.map → chunk-74KMXBG3.js.map} +0 -0
- /package/dist/{chunk-ZDWU52DJ.js.map → chunk-7AR2R7TV.js.map} +0 -0
- /package/dist/{chunk-B6IURHSZ.js.map → chunk-7DNQHMDO.js.map} +0 -0
- /package/dist/{chunk-G7CFUI4I.js.map → chunk-7EESF76V.js.map} +0 -0
- /package/dist/{chunk-AX7UFG2U.js.map → chunk-7RZ4WOQW.js.map} +0 -0
- /package/dist/{chunk-VOOPGAQO.js.map → chunk-B7BZAIHL.js.map} +0 -0
- /package/dist/{chunk-FWCUELBU.js.map → chunk-BILE3A7F.js.map} +0 -0
- /package/dist/{chunk-XSKVBGCZ.js.map → chunk-BLBOYCOV.js.map} +0 -0
- /package/dist/{chunk-4Y65Q3CR.js.map → chunk-C52BELLW.js.map} +0 -0
- /package/dist/{chunk-RP3W6IQO.js.map → chunk-CPNSVIIB.js.map} +0 -0
- /package/dist/{chunk-T4SM36XC.js.map → chunk-D7FJ2GAD.js.map} +0 -0
- /package/dist/{chunk-SCGVB7DS.js.map → chunk-DOADQW7I.js.map} +0 -0
- /package/dist/{chunk-RIAIJTEW.js.map → chunk-DOMEYGTN.js.map} +0 -0
- /package/dist/{chunk-7HPPUO2A.js.map → chunk-DQHC5P64.js.map} +0 -0
- /package/dist/{chunk-W2UTDN4T.js.map → chunk-DWZ7FLA7.js.map} +0 -0
- /package/dist/{chunk-24LW52EU.js.map → chunk-DX527XPL.js.map} +0 -0
- /package/dist/{chunk-A4YWFX5C.js.map → chunk-ENNW5SKT.js.map} +0 -0
- /package/dist/{chunk-BPYPUEM5.js.map → chunk-EPNCYUQ7.js.map} +0 -0
- /package/dist/{chunk-MUAVYVDJ.js.map → chunk-EW7ZNSWU.js.map} +0 -0
- /package/dist/{chunk-DWUMMMLR.js.map → chunk-FOMK3WPG.js.map} +0 -0
- /package/dist/{chunk-RQ4EQ5FJ.js.map → chunk-FP4R47TM.js.map} +0 -0
- /package/dist/{chunk-SHQWIDD5.js.map → chunk-GJQYM3PM.js.map} +0 -0
- /package/dist/{chunk-WEH5TCPE.js.map → chunk-GSTRPZS4.js.map} +0 -0
- /package/dist/{chunk-WC3W36AM.js.map → chunk-HOJL2GKW.js.map} +0 -0
- /package/dist/{chunk-PMFW55F5.js.map → chunk-HSAH5QUQ.js.map} +0 -0
- /package/dist/{chunk-A3KY6NUA.js.map → chunk-IH4CX43Q.js.map} +0 -0
- /package/dist/{chunk-HEDOL2RV.js.map → chunk-IJIT5HQP.js.map} +0 -0
- /package/dist/{chunk-VR5HDUBK.js.map → chunk-IPS55KWK.js.map} +0 -0
- /package/dist/{chunk-ELYLG4F7.js.map → chunk-J54WH74M.js.map} +0 -0
- /package/dist/{chunk-5ZOJLYD2.js.map → chunk-JE6RZ5L6.js.map} +0 -0
- /package/dist/{chunk-EY4LPLIR.js.map → chunk-KQ74QU55.js.map} +0 -0
- /package/dist/{chunk-XULTDO56.js.map → chunk-KT6HWAEN.js.map} +0 -0
- /package/dist/{chunk-COSJTD6Z.js.map → chunk-KZSKI2R3.js.map} +0 -0
- /package/dist/{chunk-DQIQKIEA.js.map → chunk-L5ZZJ4XE.js.map} +0 -0
- /package/dist/{chunk-SFAP5EH5.js.map → chunk-LUMF63BM.js.map} +0 -0
- /package/dist/{chunk-6RFL7HGI.js.map → chunk-LZRURORY.js.map} +0 -0
- /package/dist/{chunk-KXNWDXR7.js.map → chunk-M2K7BPHX.js.map} +0 -0
- /package/dist/{chunk-WLDK74RR.js.map → chunk-MSUSZLRE.js.map} +0 -0
- /package/dist/{chunk-WPR2HS5B.js.map → chunk-MUVJD26L.js.map} +0 -0
- /package/dist/{chunk-VVXRIPV5.js.map → chunk-MY5VNNSP.js.map} +0 -0
- /package/dist/{chunk-JPDKRGYI.js.map → chunk-MZQTHSLN.js.map} +0 -0
- /package/dist/{chunk-FF55LRSV.js.map → chunk-NETZMGQP.js.map} +0 -0
- /package/dist/{chunk-3QGRQNTP.js.map → chunk-NFAKRI4S.js.map} +0 -0
- /package/dist/{chunk-KSF7TLXH.js.map → chunk-NHSMLVNC.js.map} +0 -0
- /package/dist/{chunk-HQJ75HHI.js.map → chunk-NYLXHOMR.js.map} +0 -0
- /package/dist/{chunk-CXA6UNFF.js.map → chunk-OH3YGJT5.js.map} +0 -0
- /package/dist/{chunk-REMK55JI.js.map → chunk-OLZTGVBT.js.map} +0 -0
- /package/dist/{chunk-M3RIC6JI.js.map → chunk-OQXOYHIV.js.map} +0 -0
- /package/dist/{chunk-3LO5JWTC.js.map → chunk-P5YYVDAD.js.map} +0 -0
- /package/dist/{chunk-6TYSEAAT.js.map → chunk-PC5FFEIY.js.map} +0 -0
- /package/dist/{chunk-SLYZMJEL.js.map → chunk-PHCSPHDH.js.map} +0 -0
- /package/dist/{chunk-TCAB2ERD.js.map → chunk-PNYXXLPU.js.map} +0 -0
- /package/dist/{chunk-IPE5FFFD.js.map → chunk-PUBPZOQJ.js.map} +0 -0
- /package/dist/{chunk-6HNEEJES.js.map → chunk-QRX5BYUQ.js.map} +0 -0
- /package/dist/{chunk-5QXSPLWU.js.map → chunk-R6SSXEK2.js.map} +0 -0
- /package/dist/{chunk-NR3J7VQL.js.map → chunk-RNCQ5KHQ.js.map} +0 -0
- /package/dist/{chunk-7FOOLP5H.js.map → chunk-RXSGHPCR.js.map} +0 -0
- /package/dist/{chunk-Z56IO7OV.js.map → chunk-RXVPUW7V.js.map} +0 -0
- /package/dist/{chunk-5SYD23V4.js.map → chunk-SKZHOWTS.js.map} +0 -0
- /package/dist/{chunk-FWL2N2KH.js.map → chunk-SX3V2DLV.js.map} +0 -0
- /package/dist/{chunk-3GOX75ZM.js.map → chunk-TF4TPLF2.js.map} +0 -0
- /package/dist/{chunk-3DQP6OPC.js.map → chunk-THBT56JE.js.map} +0 -0
- /package/dist/{chunk-CBPQJAHX.js.map → chunk-U7RULTSH.js.map} +0 -0
- /package/dist/{chunk-RRX6ZTNX.js.map → chunk-UEJQQVP2.js.map} +0 -0
- /package/dist/{chunk-ES2RN7YV.js.map → chunk-UQHJQ26Y.js.map} +0 -0
- /package/dist/{chunk-WR6F6J43.js.map → chunk-V662PA6T.js.map} +0 -0
- /package/dist/{chunk-VJKRJYZL.js.map → chunk-VEFDL77X.js.map} +0 -0
- /package/dist/{chunk-GT7C6TSM.js.map → chunk-VNEEXUWA.js.map} +0 -0
- /package/dist/{chunk-N34YHFZW.js.map → chunk-W2YNUUVJ.js.map} +0 -0
- /package/dist/{chunk-N4WANJI3.js.map → chunk-WBVHRLIS.js.map} +0 -0
- /package/dist/{chunk-MHFJBNDP.js.map → chunk-WO52KYSU.js.map} +0 -0
- /package/dist/{chunk-CLNTJM3F.js.map → chunk-WUPVHIMD.js.map} +0 -0
- /package/dist/{chunk-ZBOFBRZC.js.map → chunk-WX7VWW3W.js.map} +0 -0
- /package/dist/{chunk-SRMWCN5D.js.map → chunk-X5BHPSAC.js.map} +0 -0
- /package/dist/{chunk-MD6T7MDT.js.map → chunk-XKMFIH27.js.map} +0 -0
- /package/dist/{chunk-T53L42XW.js.map → chunk-XSJWN3WH.js.map} +0 -0
- /package/dist/{chunk-AVU6KU27.js.map → chunk-XXDXW6TX.js.map} +0 -0
- /package/dist/{chunk-45OIUWGO.js.map → chunk-YNQGXSDD.js.map} +0 -0
- /package/dist/{chunk-5VVM2PPV.js.map → chunk-ZEBJT5JZ.js.map} +0 -0
- /package/dist/{chunk-DJORMYOV.js.map → chunk-ZU3SWR4I.js.map} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { PaletteColor, Theme, ThemeOptions } from '@mui/material/styles/index.js';
|
|
2
|
+
|
|
3
|
+
import { cssLengthToPx, cssTrackingToEm } from '../tokens/css-units';
|
|
4
|
+
import { accentFor } from '../tokens/scales';
|
|
5
|
+
import {
|
|
6
|
+
FONT_WEIGHTS,
|
|
7
|
+
TYPE_SIZES,
|
|
8
|
+
WEB_FONT_FAMILY,
|
|
9
|
+
WEB_MONOSPACE_FONT_FAMILY,
|
|
10
|
+
type UiHeadingStep,
|
|
11
|
+
type UiPaletteColor,
|
|
12
|
+
type UiTheme,
|
|
13
|
+
} from '../tokens/theme';
|
|
14
|
+
import { HEADING_LEVELS, headingMetrics, type HeadingLevel } from '../tokens/typography';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* THE TWO DIRECTIONS BETWEEN MUI'S THEME AND OURS. Web only.
|
|
18
|
+
*
|
|
19
|
+
* `uiThemeFromMui` is how a web component — or a shared style resolver such
|
|
20
|
+
* as `box-layout.ts` — reads the host's MUI theme in the neutral shape the
|
|
21
|
+
* native renderer reads natively. `muiThemeOptionsFrom` is the reverse, for
|
|
22
|
+
* a host that has a `UiTheme` and no MUI theme yet: `UiProvider` on the web is
|
|
23
|
+
* a MUI `ThemeProvider` fed by it.
|
|
24
|
+
*
|
|
25
|
+
* Both are field-by-field on purpose. A spread would carry MUI's extra keys
|
|
26
|
+
* across and the native side would silently depend on one.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const slot = (color: PaletteColor): UiPaletteColor => ({
|
|
30
|
+
main: color.main,
|
|
31
|
+
light: color.light,
|
|
32
|
+
dark: color.dark,
|
|
33
|
+
contrastText: color.contrastText,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
function headingSteps(theme: Theme): Record<HeadingLevel, UiHeadingStep> {
|
|
37
|
+
return Object.fromEntries(
|
|
38
|
+
HEADING_LEVELS.map((level) => {
|
|
39
|
+
const metrics = headingMetrics(theme, level);
|
|
40
|
+
return [
|
|
41
|
+
level,
|
|
42
|
+
{
|
|
43
|
+
fontSize: cssLengthToPx(metrics.fontSize, 16),
|
|
44
|
+
lineHeight: metrics.lineHeight,
|
|
45
|
+
letterSpacing: cssTrackingToEm(metrics.letterSpacing),
|
|
46
|
+
normalWeight: metrics.normalWeight,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
}),
|
|
50
|
+
) as Record<HeadingLevel, UiHeadingStep>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The host's MUI theme in the shape the native renderer reads. */
|
|
54
|
+
export function uiThemeFromMui(theme: Theme): UiTheme {
|
|
55
|
+
const { palette } = theme;
|
|
56
|
+
const unit = cssLengthToPx(theme.spacing(1), 8);
|
|
57
|
+
const md = cssLengthToPx(theme.shape.borderRadius, 4);
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
mode: palette.mode,
|
|
61
|
+
palette: {
|
|
62
|
+
mode: palette.mode,
|
|
63
|
+
primary: slot(palette.primary),
|
|
64
|
+
secondary: slot(palette.secondary),
|
|
65
|
+
success: slot(palette.success),
|
|
66
|
+
warning: slot(palette.warning),
|
|
67
|
+
info: slot(palette.info),
|
|
68
|
+
danger: slot(palette.error),
|
|
69
|
+
neutral: accentFor(theme, 'neutral'),
|
|
70
|
+
text: {
|
|
71
|
+
primary: palette.text.primary,
|
|
72
|
+
secondary: palette.text.secondary,
|
|
73
|
+
disabled: palette.text.disabled,
|
|
74
|
+
},
|
|
75
|
+
background: { default: palette.background.default, paper: palette.background.paper },
|
|
76
|
+
divider: palette.divider,
|
|
77
|
+
action: {
|
|
78
|
+
active: palette.action.active,
|
|
79
|
+
hover: palette.action.hover,
|
|
80
|
+
selected: palette.action.selected,
|
|
81
|
+
disabled: palette.action.disabled,
|
|
82
|
+
disabledBackground: palette.action.disabledBackground,
|
|
83
|
+
focus: palette.action.focus,
|
|
84
|
+
},
|
|
85
|
+
grey: {
|
|
86
|
+
50: palette.grey[50],
|
|
87
|
+
100: palette.grey[100],
|
|
88
|
+
200: palette.grey[200],
|
|
89
|
+
300: palette.grey[300],
|
|
90
|
+
400: palette.grey[400],
|
|
91
|
+
500: palette.grey[500],
|
|
92
|
+
600: palette.grey[600],
|
|
93
|
+
700: palette.grey[700],
|
|
94
|
+
800: palette.grey[800],
|
|
95
|
+
900: palette.grey[900],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
spacing: (units: number) => units * unit,
|
|
99
|
+
spacingUnit: unit,
|
|
100
|
+
radius: { sm: md / 2, md, lg: md * 2, xl: md * 4, full: 9999 },
|
|
101
|
+
typography: {
|
|
102
|
+
fontFamily: theme.typography.fontFamily ?? WEB_FONT_FAMILY,
|
|
103
|
+
monospaceFontFamily: WEB_MONOSPACE_FONT_FAMILY,
|
|
104
|
+
sizes: TYPE_SIZES,
|
|
105
|
+
weights: FONT_WEIGHTS,
|
|
106
|
+
heading: headingSteps(theme),
|
|
107
|
+
},
|
|
108
|
+
zIndex: {
|
|
109
|
+
appBar: theme.zIndex.appBar,
|
|
110
|
+
drawer: theme.zIndex.drawer,
|
|
111
|
+
modal: theme.zIndex.modal,
|
|
112
|
+
snackbar: theme.zIndex.snackbar,
|
|
113
|
+
tooltip: theme.zIndex.tooltip,
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** A `UiTheme` as the options MUI's `createTheme` builds the same palette from. */
|
|
119
|
+
export function muiThemeOptionsFrom(ui: UiTheme): ThemeOptions {
|
|
120
|
+
const { palette } = ui;
|
|
121
|
+
return {
|
|
122
|
+
palette: {
|
|
123
|
+
mode: palette.mode,
|
|
124
|
+
primary: { ...palette.primary },
|
|
125
|
+
secondary: { ...palette.secondary },
|
|
126
|
+
success: { ...palette.success },
|
|
127
|
+
warning: { ...palette.warning },
|
|
128
|
+
info: { ...palette.info },
|
|
129
|
+
error: { ...palette.danger },
|
|
130
|
+
text: { ...palette.text },
|
|
131
|
+
background: { ...palette.background },
|
|
132
|
+
divider: palette.divider,
|
|
133
|
+
action: { ...palette.action },
|
|
134
|
+
grey: { ...palette.grey },
|
|
135
|
+
},
|
|
136
|
+
shape: { borderRadius: ui.radius.md },
|
|
137
|
+
spacing: ui.spacingUnit,
|
|
138
|
+
typography: { fontFamily: ui.typography.fontFamily ?? WEB_FONT_FAMILY },
|
|
139
|
+
zIndex: { ...ui.zIndex },
|
|
140
|
+
};
|
|
141
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { UiTheme } from '../tokens/theme';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The native renderer's theme channel.
|
|
7
|
+
*
|
|
8
|
+
* Only the native files read it. On the web the theme every component paints
|
|
9
|
+
* from is MUI's, reached through emotion's own context, and `use-ui-theme.ts`
|
|
10
|
+
* derives a `UiTheme` view of it — so there is exactly one source of truth per
|
|
11
|
+
* renderer rather than two that can disagree.
|
|
12
|
+
*/
|
|
13
|
+
export const UiThemeContext = React.createContext<UiTheme | null>(null);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { UiThemeContext } from './ui-theme-context';
|
|
4
|
+
import { DEFAULT_UI_THEME, type UiTheme } from '../tokens/theme';
|
|
5
|
+
|
|
6
|
+
/** The theme the nearest `UiProvider` set, or the package default without one. */
|
|
7
|
+
export function useUiTheme(): UiTheme {
|
|
8
|
+
return React.useContext(UiThemeContext) ?? DEFAULT_UI_THEME;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useTheme } from '@mui/material/styles/index.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
import { uiThemeFromMui } from './mui-bridge';
|
|
5
|
+
import type { UiTheme } from '../tokens/theme';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The web reading of the theme: MUI's, as a `UiTheme`.
|
|
9
|
+
*
|
|
10
|
+
* Derived rather than provided on purpose. A host that already mounts its own
|
|
11
|
+
* `ThemeProvider` (every origin app does, through `@12-apps/app-shell`) gets
|
|
12
|
+
* the same numbers a MUI-styled sibling paints with, and nothing has to be
|
|
13
|
+
* mounted twice or kept in step.
|
|
14
|
+
*/
|
|
15
|
+
export function useUiTheme(): UiTheme {
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
return React.useMemo(() => uiThemeFromMui(theme), [theme]);
|
|
18
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* COLOUR ARITHMETIC WITH NO RENDERER BEHIND IT.
|
|
3
|
+
*
|
|
4
|
+
* Every shade the web components paint comes out of MUI's colour manipulator:
|
|
5
|
+
* `lighten(main, 0.2)` is a palette's `light`, `darken(main, 0.3)` its `dark`,
|
|
6
|
+
* `alpha(main, 0.1)` the hover wash on an outline button. A native component
|
|
7
|
+
* that wants the SAME pixel has to run the SAME arithmetic, and it cannot
|
|
8
|
+
* import it — `@mui/material/styles` drags emotion and the DOM in behind it.
|
|
9
|
+
*
|
|
10
|
+
* So the arithmetic lives here, once, with nothing behind it. It is a faithful
|
|
11
|
+
* port of `@mui/system/colorManipulator` (MIT), down to the truncation:
|
|
12
|
+
* `lighten('#6366F1', 0.2)` is `rgb(130, 132, 243)` on both sides because both
|
|
13
|
+
* TRUNCATE 132.6 rather than round it. A port that rounded would be one pixel
|
|
14
|
+
* of tint away from the web on every button, forever, and nothing would flag it.
|
|
15
|
+
*
|
|
16
|
+
* `color()` space strings are deliberately unsupported: nothing in this package
|
|
17
|
+
* emits one, and a smaller surface is a smaller thing to keep identical.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export type ColorFormat = 'rgb' | 'rgba' | 'hsl' | 'hsla';
|
|
21
|
+
|
|
22
|
+
export interface DecomposedColor {
|
|
23
|
+
type: ColorFormat;
|
|
24
|
+
values: number[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const FORMATS: readonly ColorFormat[] = ['rgb', 'rgba', 'hsl', 'hsla'];
|
|
28
|
+
|
|
29
|
+
const clamp = (value: number, min = 0, max = 1): number => Math.min(Math.max(min, value), max);
|
|
30
|
+
|
|
31
|
+
/** `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa` to its `rgb()` / `rgba()` string. */
|
|
32
|
+
export function hexToRgb(color: string): string {
|
|
33
|
+
const hex = color.slice(1);
|
|
34
|
+
const pair = new RegExp(`.{1,${hex.length >= 6 ? 2 : 1}}`, 'g');
|
|
35
|
+
let channels: string[] | null = hex.match(pair);
|
|
36
|
+
if (channels && channels[0]?.length === 1) {
|
|
37
|
+
channels = channels.map((channel) => channel + channel);
|
|
38
|
+
}
|
|
39
|
+
if (!channels) return '';
|
|
40
|
+
|
|
41
|
+
const parts = channels.map((channel, index) =>
|
|
42
|
+
index < 3 ? parseInt(channel, 16) : Math.round((parseInt(channel, 16) / 255) * 1000) / 1000,
|
|
43
|
+
);
|
|
44
|
+
return `rgb${channels.length === 4 ? 'a' : ''}(${parts.join(', ')})`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Any supported colour string to its type and numeric channels. */
|
|
48
|
+
export function decomposeColor(color: string): DecomposedColor {
|
|
49
|
+
if (color.charAt(0) === '#') {
|
|
50
|
+
return decomposeColor(hexToRgb(color));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const marker = color.indexOf('(');
|
|
54
|
+
const type = color.substring(0, marker) as ColorFormat;
|
|
55
|
+
if (!FORMATS.includes(type)) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
`@12-apps/ui: unsupported colour "${color}". Use #nnn, #nnnnnn, rgb(), rgba(), hsl() or hsla().`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const values = color
|
|
62
|
+
.substring(marker + 1, color.length - 1)
|
|
63
|
+
.split(',')
|
|
64
|
+
.map((value) => parseFloat(value));
|
|
65
|
+
|
|
66
|
+
return { type, values };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** The inverse of {@link decomposeColor}, with MUI's channel truncation. */
|
|
70
|
+
export function recomposeColor({ type, values }: DecomposedColor): string {
|
|
71
|
+
const parts: Array<number | string> = type.startsWith('rgb')
|
|
72
|
+
? values.map((value, index) => (index < 3 ? Math.trunc(value) : value))
|
|
73
|
+
: [values[0] ?? 0, `${values[1] ?? 0}%`, `${values[2] ?? 0}%`, ...values.slice(3)];
|
|
74
|
+
|
|
75
|
+
return `${type}(${parts.join(', ')})`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** An `hsl()` / `hsla()` string to its `rgb()` / `rgba()` equivalent. */
|
|
79
|
+
export function hslToRgb(color: string): string {
|
|
80
|
+
const { type, values } = decomposeColor(color);
|
|
81
|
+
const h = values[0] ?? 0;
|
|
82
|
+
const s = (values[1] ?? 0) / 100;
|
|
83
|
+
const l = (values[2] ?? 0) / 100;
|
|
84
|
+
const a = s * Math.min(l, 1 - l);
|
|
85
|
+
const f = (n: number, k = (n + h / 30) % 12): number =>
|
|
86
|
+
l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
87
|
+
|
|
88
|
+
const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
|
|
89
|
+
if (type === 'hsla') {
|
|
90
|
+
return recomposeColor({ type: 'rgba', values: [...rgb, values[3] ?? 1] });
|
|
91
|
+
}
|
|
92
|
+
return recomposeColor({ type: 'rgb', values: rgb });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Relative luminance (WCAG 2.0), to three decimals like MUI. */
|
|
96
|
+
export function getLuminance(color: string): number {
|
|
97
|
+
const decomposed = decomposeColor(color);
|
|
98
|
+
const channels = decomposed.type.startsWith('hsl')
|
|
99
|
+
? decomposeColor(hslToRgb(color)).values
|
|
100
|
+
: decomposed.values;
|
|
101
|
+
|
|
102
|
+
const [r, g, b] = channels.slice(0, 3).map((value) => {
|
|
103
|
+
const c = value / 255;
|
|
104
|
+
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return Number((0.2126 * (r ?? 0) + 0.7152 * (g ?? 0) + 0.0722 * (b ?? 0)).toFixed(3));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** WCAG contrast ratio between two colours, 1 to 21. */
|
|
111
|
+
export function getContrastRatio(foreground: string, background: string): number {
|
|
112
|
+
const lumA = getLuminance(foreground);
|
|
113
|
+
const lumB = getLuminance(background);
|
|
114
|
+
return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** The colour with its alpha channel set to `value` (0 to 1). */
|
|
118
|
+
export function alpha(color: string, value: number): string {
|
|
119
|
+
const decomposed = decomposeColor(color);
|
|
120
|
+
const type: ColorFormat = decomposed.type.endsWith('a')
|
|
121
|
+
? decomposed.type
|
|
122
|
+
: (`${decomposed.type}a` as ColorFormat);
|
|
123
|
+
const values = decomposed.values.slice(0, 3);
|
|
124
|
+
values[3] = clamp(value);
|
|
125
|
+
return recomposeColor({ type, values });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** The colour moved `coefficient` (0 to 1) of the way towards black. */
|
|
129
|
+
export function darken(color: string, coefficient: number): string {
|
|
130
|
+
const decomposed = decomposeColor(color);
|
|
131
|
+
const amount = clamp(coefficient);
|
|
132
|
+
const values = [...decomposed.values];
|
|
133
|
+
|
|
134
|
+
if (decomposed.type.startsWith('hsl')) {
|
|
135
|
+
values[2] = (values[2] ?? 0) * (1 - amount);
|
|
136
|
+
} else {
|
|
137
|
+
for (let index = 0; index < 3; index += 1) {
|
|
138
|
+
values[index] = (values[index] ?? 0) * (1 - amount);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return recomposeColor({ type: decomposed.type, values });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** The colour moved `coefficient` (0 to 1) of the way towards white. */
|
|
145
|
+
export function lighten(color: string, coefficient: number): string {
|
|
146
|
+
const decomposed = decomposeColor(color);
|
|
147
|
+
const amount = clamp(coefficient);
|
|
148
|
+
const values = [...decomposed.values];
|
|
149
|
+
|
|
150
|
+
if (decomposed.type.startsWith('hsl')) {
|
|
151
|
+
values[2] = (values[2] ?? 0) + (100 - (values[2] ?? 0)) * amount;
|
|
152
|
+
} else {
|
|
153
|
+
for (let index = 0; index < 3; index += 1) {
|
|
154
|
+
values[index] = (values[index] ?? 0) + (255 - (values[index] ?? 0)) * amount;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return recomposeColor({ type: decomposed.type, values });
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Darken a light colour or lighten a dark one, by `coefficient`. */
|
|
161
|
+
export function emphasize(color: string, coefficient = 0.15): string {
|
|
162
|
+
return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
|
|
163
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE ONE READER OF CSS LENGTHS.
|
|
3
|
+
*
|
|
4
|
+
* `HEADING_SCALE` and a host's MUI overrides speak CSS — `'2rem'`, `'-0.02em'`
|
|
5
|
+
* — and both `tokens/theme.ts` and `provider/mui-bridge.ts` need them as
|
|
6
|
+
* numbers. Two private parsers drifted (one multiplied `em` by 16, one did
|
|
7
|
+
* not), so there is one, here, with the rule spelled out: a length becomes px
|
|
8
|
+
* against a 16px root, a tracking value becomes em.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const ROOT_PX = 16;
|
|
12
|
+
|
|
13
|
+
/** `'1.5rem'` → 24, `'1.5em'` → 24, `'20px'` → 20, `20` → 20, unparseable → `fallback`. */
|
|
14
|
+
export function cssLengthToPx(value: string | number | undefined, fallback: number): number {
|
|
15
|
+
if (typeof value === 'number') return value;
|
|
16
|
+
if (value === undefined) return fallback;
|
|
17
|
+
const parsed = Number.parseFloat(value);
|
|
18
|
+
if (Number.isNaN(parsed)) return fallback;
|
|
19
|
+
return value.endsWith('rem') || value.endsWith('em') ? parsed * ROOT_PX : parsed;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** `'-0.02em'` → -0.02, `'0.5px'` → 0.5 / 16, `undefined` → `undefined` ("normal"). */
|
|
23
|
+
export function cssTrackingToEm(value: string | undefined): number | undefined {
|
|
24
|
+
if (value === undefined) return undefined;
|
|
25
|
+
const parsed = Number.parseFloat(value);
|
|
26
|
+
if (Number.isNaN(parsed)) return undefined;
|
|
27
|
+
return value.endsWith('px') ? parsed / ROOT_PX : parsed;
|
|
28
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* THE THIRD VOCABULARY: the type scale.
|
|
4
|
+
*
|
|
5
|
+
* `scales.ts` opens by saying the package had both halves of every argument at
|
|
6
|
+
* once until the size and colour vocabularies were declared in one place and
|
|
7
|
+
* every component derived from them. The type scale was the one that never got
|
|
8
|
+
* that treatment — it lived as a private `LEVELS` table inside
|
|
9
|
+
* `Heading.styles.ts`, which is exactly the shape that file exists to refuse.
|
|
10
|
+
*
|
|
11
|
+
* Two things follow from it being private, and the second is the expensive one.
|
|
12
|
+
*
|
|
13
|
+
* **It could not be re-themed.** `Heading` read `theme.typography.h1.fontFamily`
|
|
14
|
+
* from the theme and then ignored the theme for every other metric, so a host
|
|
15
|
+
* calling `createTheme({ typography: { h1: { fontSize: '2rem' } } })` changed
|
|
16
|
+
* `<Typography variant="h1">` and left `<Heading level="h1">` at 48px. A design
|
|
17
|
+
* system whose type scale cannot be set by the design is not a system.
|
|
18
|
+
*
|
|
19
|
+
* **And the numbers were a landing page's.** `h1` at 3rem and `h2` at 2.5rem are
|
|
20
|
+
* hero metrics. Dropped into an operations console they put a 48px title
|
|
21
|
+
* directly above 14px body copy — a 3.4x jump with nothing in between — so
|
|
22
|
+
* product teams stopped reaching for the component. Measured in one consuming
|
|
23
|
+
* repo: `<Heading>` appeared four times in the entire codebase while raw
|
|
24
|
+
* `fontSize` appeared in dozens of files. The component was not disliked, it was
|
|
25
|
+
* unusable at app scale, and every host paid for that in hand-rolled CSS.
|
|
26
|
+
*
|
|
27
|
+
* So the defaults below are an APP scale, and `display` keeps the hero size for
|
|
28
|
+
* the screens that actually want one. A marketing page asks for `display`; a
|
|
29
|
+
* console asks for `h1` and gets something it can put on a page.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A step on the scale.
|
|
34
|
+
*
|
|
35
|
+
* `display` is a SIZE, not a rank — see `Heading`, which renders it as `h1` so
|
|
36
|
+
* the document still gets exactly one level-one heading.
|
|
37
|
+
*/
|
|
38
|
+
export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'display';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The runtime list, declared beside the union for the reason `SIZE_VALUES`
|
|
42
|
+
* gives: a story's `argTypes.options` spelled by hand drifts from the type, and
|
|
43
|
+
* the direction it drifts is "documents less than the component accepts".
|
|
44
|
+
*/
|
|
45
|
+
export const HEADING_LEVELS = [
|
|
46
|
+
'display',
|
|
47
|
+
'h1',
|
|
48
|
+
'h2',
|
|
49
|
+
'h3',
|
|
50
|
+
'h4',
|
|
51
|
+
'h5',
|
|
52
|
+
'h6',
|
|
53
|
+
] as const satisfies readonly HeadingLevel[];
|
|
54
|
+
|
|
55
|
+
/** Everything one step of the scale decides. */
|
|
56
|
+
export interface HeadingMetrics {
|
|
57
|
+
fontSize: string;
|
|
58
|
+
lineHeight: number;
|
|
59
|
+
letterSpacing?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The weight this step carries when the caller asks for `normal`. A heading's
|
|
62
|
+
* "normal" is not body text's 400 — it is the weight the step is meant to
|
|
63
|
+
* carry, which gets heavier as the step gets larger.
|
|
64
|
+
*/
|
|
65
|
+
normalWeight: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The house default, in CODE rather than in a component.
|
|
70
|
+
*
|
|
71
|
+
* ~1.15x per step from a 1rem `h6`, which keeps six distinguishable ranks inside
|
|
72
|
+
* the range an application actually uses. The old table ran 1.125rem → 4rem and
|
|
73
|
+
* spent its top three steps above anything a product screen wants.
|
|
74
|
+
*/
|
|
75
|
+
export const HEADING_SCALE: Record<HeadingLevel, HeadingMetrics> = {
|
|
76
|
+
// The hero size the old `h1` was really offering, under the name that says so.
|
|
77
|
+
display: { fontSize: '3rem', lineHeight: 1.05, letterSpacing: '-0.03em', normalWeight: 800 },
|
|
78
|
+
h1: { fontSize: '2rem', lineHeight: 1.2, letterSpacing: '-0.02em', normalWeight: 700 },
|
|
79
|
+
h2: { fontSize: '1.75rem', lineHeight: 1.25, letterSpacing: '-0.015em', normalWeight: 700 },
|
|
80
|
+
h3: { fontSize: '1.5rem', lineHeight: 1.3, letterSpacing: '-0.01em', normalWeight: 600 },
|
|
81
|
+
h4: { fontSize: '1.25rem', lineHeight: 1.35, letterSpacing: '-0.005em', normalWeight: 600 },
|
|
82
|
+
h5: { fontSize: '1.125rem', lineHeight: 1.4, normalWeight: 600 },
|
|
83
|
+
h6: { fontSize: '1rem', lineHeight: 1.5, normalWeight: 600 },
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** A host's overrides: any subset of the steps, any subset of each step's metrics. */
|
|
87
|
+
export type HeadingScaleOverrides = Partial<Record<HeadingLevel, Partial<HeadingMetrics>>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@12-apps/ui/tokens` on React Native: the vocabulary, the type scale, the
|
|
3
|
+
* theme and the colour arithmetic. NOT `accentFor` or `headingMetrics`, which
|
|
4
|
+
* read a MUI `Theme` and belong to the web build — a native component reads
|
|
5
|
+
* `useUiTheme()` from `@12-apps/ui/provider` instead.
|
|
6
|
+
*/
|
|
7
|
+
export * from './vocabulary';
|
|
8
|
+
export * from './theme';
|
|
9
|
+
export * from './color';
|
package/src/tokens/scales.ts
CHANGED
|
@@ -1,195 +1,20 @@
|
|
|
1
1
|
import type { Theme } from '@mui/material/styles/index.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* THE TWO VOCABULARIES EVERY COMPONENT SPEAKS.
|
|
5
|
-
*
|
|
6
|
-
* Before this file the package had both halves of every argument at once: 26
|
|
7
|
-
* components sized themselves `xs|sm|md|lg|xl` and four used MUI's
|
|
8
|
-
* `small|medium|large`; 14 coloured themselves `danger|neutral` and 15 used
|
|
9
|
-
* MUI's `error`. Nothing enforced either, because most of these props were
|
|
10
|
-
* spelled out as inline unions and a couple were plain `string`.
|
|
11
|
-
*
|
|
12
|
-
* That is not a tidiness problem. A caller learns the vocabulary from whichever
|
|
13
|
-
* component they used first, and the wrong half is not rejected — it reaches MUI
|
|
14
|
-
* as an unknown value and silently falls back. `Chip` shipped with `color?:
|
|
15
|
-
* string` and MUI's `small|medium`, so `color="danger"` rendered grey and
|
|
16
|
-
* `size="sm"` rendered medium; twelve live call sites were doing exactly that,
|
|
17
|
-
* and every test passed because they all asserted on text.
|
|
18
|
-
*
|
|
19
|
-
* So the vocabulary is declared once, here, and components derive from it.
|
|
20
|
-
*
|
|
21
|
-
* DERIVE, DON'T COPY — AND TAKE THE WHOLE VOCABULARY. Every size prop is
|
|
22
|
-
* `SizeValue` and every colour prop is `ColorValue`, with no `Extract` and no
|
|
23
|
-
* `Exclude`. Handing a component a slice was tried and undone: it is the same
|
|
24
|
-
* fragmentation wearing the canonical type's name, and it leaves a caller having
|
|
25
|
-
* to remember which components accept `xs` and which accept `info`. Where the
|
|
26
|
-
* underlying widget draws fewer steps than five, that is a rendering detail and
|
|
27
|
-
* belongs at the MUI boundary below — not in the prop's type.
|
|
28
|
-
*
|
|
29
|
-
* A component whose size or colour is not this concept at all keeps its own type
|
|
30
|
-
* — `Scrollbar`'s `thin|medium|thick` is a track width, `Sheet`'s `full` is a
|
|
31
|
-
* viewport fraction, `LazyImage`'s size is pixels. Forcing those into the scale
|
|
32
|
-
* would be consistency for its own sake.
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The house size scale.
|
|
37
|
-
*
|
|
38
|
-
* Abbreviated, because that is what 26 of the 30 components with a real size
|
|
39
|
-
* already used and what every caller has been taught to write.
|
|
40
|
-
*
|
|
41
|
-
* Declared as the array and the type together so the two cannot disagree. The
|
|
42
|
-
* runtime list is what Storybook `argTypes.options` and the demo grids iterate;
|
|
43
|
-
* spelled by hand in each story it drifts, and it had — twelve colour lists
|
|
44
|
-
* omitted `info`, so the control that documents the vocabulary offered a
|
|
45
|
-
* component less than the component accepted.
|
|
46
|
-
*/
|
|
47
|
-
/**
|
|
48
|
-
* The type scale is the THIRD vocabulary, and it lives in `./typography.ts`
|
|
49
|
-
* because it is metrics rather than a prop union. Re-exported here so
|
|
50
|
-
* `@12-apps/ui/tokens` stays the one import path for "what words does this
|
|
51
|
-
* package speak" — a second entry point is how a vocabulary gets missed.
|
|
52
|
-
*/
|
|
53
|
-
export {
|
|
54
|
-
HEADING_LEVELS,
|
|
55
|
-
HEADING_SCALE,
|
|
56
|
-
headingMetrics,
|
|
57
|
-
type HeadingLevel,
|
|
58
|
-
type HeadingMetrics,
|
|
59
|
-
type HeadingScaleOverrides,
|
|
60
|
-
} from './typography';
|
|
61
|
-
|
|
62
|
-
export type SizeValue = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
63
|
-
|
|
64
|
-
export const SIZE_VALUES = ['xs', 'sm', 'md', 'lg', 'xl'] as const satisfies readonly SizeValue[];
|
|
3
|
+
import type { ColorValue, MuiColor } from './vocabulary';
|
|
65
4
|
|
|
66
5
|
/**
|
|
67
|
-
* The
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* meet first and therefore the one that taught the vocabulary — so it is the one
|
|
72
|
-
* the rest of the package follows.
|
|
73
|
-
*
|
|
74
|
-
* Components that hand these to MUI translate at the boundary (`danger` →
|
|
75
|
-
* `error`, `neutral` → `default` or `inherit` depending on what the underlying
|
|
76
|
-
* component calls its unaccented state). The translation must be a real mapping
|
|
77
|
-
* and never a cast: a cast is precisely what let `danger` through untouched and
|
|
78
|
-
* had MUI fall back to grey.
|
|
79
|
-
*
|
|
80
|
-
* Array and type declared together, for the reason given on {@link SIZE_VALUES}.
|
|
6
|
+
* `@12-apps/ui/tokens` keeps its whole surface here. The vocabulary itself —
|
|
7
|
+
* the size and colour unions and their runtime lists — lives in
|
|
8
|
+
* `./vocabulary`, which imports nothing, so the native renderer can read it
|
|
9
|
+
* without this file's MUI `Theme` import following it into `dist/types-native`.
|
|
81
10
|
*/
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
| 'danger'
|
|
89
|
-
| 'neutral';
|
|
90
|
-
|
|
91
|
-
export const COLOR_VALUES = [
|
|
92
|
-
'primary',
|
|
93
|
-
'secondary',
|
|
94
|
-
'success',
|
|
95
|
-
'warning',
|
|
96
|
-
'info',
|
|
97
|
-
'danger',
|
|
98
|
-
'neutral',
|
|
99
|
-
] as const satisfies readonly ColorValue[];
|
|
100
|
-
|
|
101
|
-
/* ── Array and union, pinned to each other ────────────────────────────────── */
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* The arrays above are written out rather than derived, because deriving the
|
|
105
|
-
* union from the array (`(typeof COLOR_VALUES)[number]`) costs the alias its
|
|
106
|
-
* name: TypeScript resolves the indexed access eagerly, and every error in the
|
|
107
|
-
* package stops saying `not assignable to type 'ColorValue'` and starts dumping
|
|
108
|
-
* seven string literals. In a package whose entire purpose is teaching this
|
|
109
|
-
* vocabulary, the name in the error message is worth keeping.
|
|
110
|
-
*
|
|
111
|
-
* Writing both means they could disagree, so both directions are checked here.
|
|
112
|
-
* `satisfies` above catches an entry that is not a member. These catch the other
|
|
113
|
-
* half — a member missing from the array — which `satisfies` cannot see and
|
|
114
|
-
* which is the direction that actually bit: twelve story control lists offered
|
|
115
|
-
* six colours for a vocabulary of seven, so `info` was undocumented everywhere.
|
|
116
|
-
*
|
|
117
|
-
* A gap makes the assignment below fail, and the error names the missing member.
|
|
118
|
-
*/
|
|
119
|
-
type Missing<Union extends string, Listed extends string> = Exclude<Union, Listed>;
|
|
120
|
-
|
|
121
|
-
const _allSizesListed: Missing<SizeValue, (typeof SIZE_VALUES)[number]> extends never
|
|
122
|
-
? true
|
|
123
|
-
: never = true;
|
|
124
|
-
|
|
125
|
-
const _allColorsListed: Missing<ColorValue, (typeof COLOR_VALUES)[number]> extends never
|
|
126
|
-
? true
|
|
127
|
-
: never = true;
|
|
128
|
-
|
|
129
|
-
void _allSizesListed;
|
|
130
|
-
void _allColorsListed;
|
|
11
|
+
export * from './vocabulary';
|
|
12
|
+
export { headingMetrics } from './typography';
|
|
13
|
+
// The renderer-neutral theme and the colour arithmetic behind it, so a web
|
|
14
|
+
// host can build a `UiTheme` from the same module path a native one does.
|
|
15
|
+
export * from './theme';
|
|
16
|
+
export * from './color';
|
|
131
17
|
|
|
132
|
-
/* ── The MUI boundary ─────────────────────────────────────────────────────── */
|
|
133
|
-
|
|
134
|
-
/** What MUI calls a size. Three entries against our five. */
|
|
135
|
-
export type MuiSize = 'small' | 'medium' | 'large';
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* The house scale collapsed onto MUI's three.
|
|
139
|
-
*
|
|
140
|
-
* Five onto three loses information, and it loses it at the ends on purpose:
|
|
141
|
-
* `xs`/`sm` both draw small and `lg`/`xl` both draw large, because MUI has no
|
|
142
|
-
* fourth and fifth step to give them. A component that genuinely needs five
|
|
143
|
-
* distinct sizes styles them itself rather than routing through here — this is
|
|
144
|
-
* for the ones that just forward the prop.
|
|
145
|
-
*/
|
|
146
|
-
export const muiSize = (size: SizeValue): MuiSize => {
|
|
147
|
-
if (size === 'xs' || size === 'sm') return 'small';
|
|
148
|
-
return size === 'md' ? 'medium' : 'large';
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
/** What MUI calls a semantic colour on most components. */
|
|
152
|
-
export type MuiColor = 'primary' | 'secondary' | 'success' | 'warning' | 'info' | 'error';
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* The house vocabulary translated for MUI, with the caller naming its neutral.
|
|
156
|
-
*
|
|
157
|
-
* `neutral` is the awkward one: MUI spells the unaccented state `default` on a
|
|
158
|
-
* chip, `inherit` on a button and an icon button, and `grey` in the palette. So
|
|
159
|
-
* the caller passes the word its own MUI component uses rather than this
|
|
160
|
-
* pretending there is one answer.
|
|
161
|
-
*
|
|
162
|
-
* A MAPPING, NEVER A CAST. The cast is what let `danger` reach MUI untouched and
|
|
163
|
-
* silently fall back to grey.
|
|
164
|
-
*/
|
|
165
|
-
export function muiColor<N extends string>(color: ColorValue, neutralAs: N): MuiColor | N {
|
|
166
|
-
if (color === 'danger') return 'error';
|
|
167
|
-
return color === 'neutral' ? neutralAs : color;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* The house vocabulary as a `theme.palette` key.
|
|
172
|
-
*
|
|
173
|
-
* Separate from {@link muiColor} because the palette has no `default` and no
|
|
174
|
-
* `inherit` — an unaccented colour there is `grey`.
|
|
175
|
-
*/
|
|
176
|
-
export type PaletteKey = MuiColor | 'grey';
|
|
177
|
-
|
|
178
|
-
export const paletteKey = (color: ColorValue): PaletteKey =>
|
|
179
|
-
color === 'danger' ? 'error' : color === 'neutral' ? 'grey' : color;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* A `ColorValue` resolved to a four-stop accent from the theme.
|
|
183
|
-
*
|
|
184
|
-
* `paletteKey` is not enough on its own for anything that reads `.main`: MUI's
|
|
185
|
-
* palette has no neutral `PaletteColor`, and `palette.grey` is a 50–900 ramp
|
|
186
|
-
* with no `main`, `light`, `dark` or `contrastText` on it at all. So `neutral`
|
|
187
|
-
* is resolved from the ramp here, once, instead of every component discovering
|
|
188
|
-
* the same hole and branching around it.
|
|
189
|
-
*
|
|
190
|
-
* Typed against the theme structurally so this file does not drag in MUI's
|
|
191
|
-
* `Theme` and become a dependency of everything that imports a token.
|
|
192
|
-
*/
|
|
193
18
|
export interface Accent {
|
|
194
19
|
main: string;
|
|
195
20
|
light: string;
|