@apollion-dsi/core 5.6.0 → 5.8.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/README.md +60 -87
- package/lib/chunks/Notification.group-SKYIVPR6.esm.js +1 -0
- package/lib/chunks/{chunk-5SQH2W2J.esm.js → chunk-23T5Y5P7.esm.js} +1 -1
- package/lib/chunks/chunk-2XKW4UZB.esm.js +1 -0
- package/lib/chunks/chunk-2XTVIQMG.esm.js +1 -0
- package/lib/chunks/chunk-3BR5YHOT.esm.js +2 -0
- package/lib/chunks/chunk-3EL7GLYZ.esm.js +5 -0
- package/lib/chunks/{chunk-BMGVQBTB.esm.js → chunk-3TVX6V2P.esm.js} +1 -1
- package/lib/chunks/{chunk-MS7WJXDX.esm.js → chunk-3XGXC5CQ.esm.js} +1 -1
- package/lib/chunks/chunk-4MDTGKID.esm.js +1 -0
- package/lib/chunks/{chunk-7AFAO7ZS.esm.js → chunk-4ZHLV35P.esm.js} +1 -1
- package/lib/chunks/chunk-5HBSIYOZ.esm.js +1 -0
- package/lib/chunks/chunk-5OE3KRLX.esm.js +1 -0
- package/lib/chunks/chunk-6AF7EOSR.esm.js +1 -0
- package/lib/chunks/chunk-6KLI7VMF.esm.js +1 -0
- package/lib/chunks/{chunk-CZJF4EVQ.esm.js → chunk-6SQEKMOW.esm.js} +1 -1
- package/lib/chunks/{chunk-SJ3MPBVM.esm.js → chunk-6VRD7OZA.esm.js} +1 -1
- package/lib/chunks/chunk-6XX3UO2Y.esm.js +1 -0
- package/lib/chunks/chunk-7L77BJCX.esm.js +1 -0
- package/lib/chunks/chunk-7X5XCVTL.esm.js +1 -0
- package/lib/chunks/{chunk-BVKAXW2H.esm.js → chunk-AFFGRIAY.esm.js} +1 -1
- package/lib/chunks/{chunk-HMITYQV5.esm.js → chunk-ALR3UKST.esm.js} +1 -1
- package/lib/chunks/chunk-AXUWC2WH.esm.js +1 -0
- package/lib/chunks/{chunk-7EGX7BMB.esm.js → chunk-BERIBF3O.esm.js} +1 -1
- package/lib/chunks/chunk-BFABFZI7.esm.js +1 -0
- package/lib/chunks/{chunk-4VEUQE23.esm.js → chunk-BHK35QDU.esm.js} +1 -1
- package/lib/chunks/chunk-BULFULCF.esm.js +1 -0
- package/lib/chunks/{chunk-OHOMOBIV.esm.js → chunk-C7IUAX6C.esm.js} +5 -5
- package/lib/chunks/chunk-CCONLRLQ.esm.js +1 -0
- package/lib/chunks/chunk-CEVSZEYI.esm.js +1 -0
- package/lib/chunks/{chunk-D2T4FF27.esm.js → chunk-CV375N2M.esm.js} +1 -1
- package/lib/chunks/chunk-DHBTYTRE.esm.js +35 -0
- package/lib/chunks/chunk-EXO45TTW.esm.js +1 -0
- package/lib/chunks/chunk-FBBAYMRG.esm.js +1 -0
- package/lib/chunks/{chunk-FPUV6SIF.esm.js → chunk-FOHYQDXP.esm.js} +5 -5
- package/lib/chunks/chunk-GNQ43LWP.esm.js +1 -0
- package/lib/chunks/chunk-HATBJ5OR.esm.js +1 -0
- package/lib/chunks/chunk-HEZGD5NN.esm.js +1 -0
- package/lib/chunks/chunk-HO47XRST.esm.js +44 -0
- package/lib/chunks/chunk-HPM5AX5Z.esm.js +1 -0
- package/lib/chunks/chunk-I6HAFAKY.esm.js +1 -0
- package/lib/chunks/chunk-I6YTT57W.esm.js +3 -0
- package/lib/chunks/chunk-IA234JY2.esm.js +0 -0
- package/lib/chunks/chunk-IEECNFBV.esm.js +1 -0
- package/lib/chunks/chunk-IN3Y5P5T.esm.js +1 -0
- package/lib/chunks/chunk-IPANNHV3.esm.js +1 -0
- package/lib/chunks/chunk-IRZ4UB35.esm.js +1 -0
- package/lib/chunks/chunk-JQ66DKSQ.esm.js +1 -0
- package/lib/chunks/chunk-KK7GK3UF.esm.js +1 -0
- package/lib/chunks/{chunk-HRMJR6TD.esm.js → chunk-KMJC5FWJ.esm.js} +1 -1
- package/lib/chunks/{chunk-RZGNPPLN.esm.js → chunk-KSXQYRLN.esm.js} +1 -1
- package/lib/chunks/chunk-KY5NBHOI.esm.js +1 -0
- package/lib/chunks/chunk-L3UIDQAU.esm.js +1 -0
- package/lib/chunks/chunk-MUI7DBJO.esm.js +1 -0
- package/lib/chunks/chunk-MZ4K54LF.esm.js +1 -0
- package/lib/chunks/chunk-N6TVSSCE.esm.js +1 -0
- package/lib/chunks/chunk-NBQ34TTP.esm.js +4 -0
- package/lib/chunks/{chunk-TD4RVB2L.esm.js → chunk-NFEJI3EH.esm.js} +1 -1
- package/lib/chunks/chunk-NOZL56LA.esm.js +1 -0
- package/lib/chunks/chunk-NZ67MJX5.esm.js +1 -0
- package/lib/chunks/chunk-O57P24BI.esm.js +1 -0
- package/lib/chunks/chunk-OKKST6EP.esm.js +1 -0
- package/lib/chunks/{chunk-WNCECFZT.esm.js → chunk-OX3EZSSO.esm.js} +1 -1
- package/lib/chunks/chunk-P7RR4ZHS.esm.js +1 -0
- package/lib/chunks/chunk-PESCONAO.esm.js +1 -0
- package/lib/chunks/chunk-PFLBU7HG.esm.js +1 -0
- package/lib/chunks/chunk-PJQ3IZE7.esm.js +0 -0
- package/lib/chunks/chunk-PMQG6OAY.esm.js +1 -0
- package/lib/chunks/chunk-PNMHDQZ7.esm.js +1 -0
- package/lib/chunks/chunk-PUP76STF.esm.js +1 -0
- package/lib/chunks/chunk-Q4VSZJEJ.esm.js +1 -0
- package/lib/chunks/chunk-Q5ET2AY3.esm.js +1 -0
- package/lib/chunks/chunk-QG4MACPR.esm.js +1 -0
- package/lib/chunks/{chunk-XGE6OOEJ.esm.js → chunk-QJNYQOV7.esm.js} +1 -1
- package/lib/chunks/chunk-QYL6LECA.esm.js +1 -0
- package/lib/chunks/{chunk-CQK4PCNH.esm.js → chunk-RFZK5IQO.esm.js} +1 -1
- package/lib/chunks/chunk-RLDFMPSZ.esm.js +1 -0
- package/lib/chunks/chunk-RNL7RFJK.esm.js +1 -0
- package/lib/chunks/chunk-SEOZMJYW.esm.js +1 -0
- package/lib/chunks/chunk-STSRIPD6.esm.js +1 -0
- package/lib/chunks/chunk-SUY3U4J4.esm.js +1 -0
- package/lib/chunks/chunk-SXG6EM4R.esm.js +1 -0
- package/lib/chunks/chunk-TFOUOFFD.esm.js +1 -0
- package/lib/chunks/chunk-TLIKQFOT.esm.js +1 -0
- package/lib/chunks/chunk-U525YXTZ.esm.js +1 -0
- package/lib/chunks/chunk-UBIEAIXU.esm.js +1 -0
- package/lib/chunks/{chunk-MJUAYHOW.esm.js → chunk-UDVZGRJB.esm.js} +1 -1
- package/lib/chunks/chunk-UIZHH3IZ.esm.js +1 -0
- package/lib/chunks/{chunk-WU5LSQM6.esm.js → chunk-UO3HO2ZN.esm.js} +1 -1
- package/lib/chunks/chunk-VAH2Y2S5.esm.js +1 -0
- package/lib/chunks/chunk-VKFJFOLE.esm.js +1 -0
- package/lib/chunks/{chunk-XBLZJLBQ.esm.js → chunk-VLK46DIP.esm.js} +1 -1
- package/lib/chunks/chunk-VROT2JQQ.esm.js +1 -0
- package/lib/chunks/chunk-WESPISDY.esm.js +1 -0
- package/lib/chunks/chunk-WHG3FSD6.esm.js +1 -0
- package/lib/chunks/chunk-WI3WPCW3.esm.js +1 -0
- package/lib/chunks/chunk-WTUWJW2K.esm.js +39 -0
- package/lib/chunks/chunk-XBHJSNUP.esm.js +1 -0
- package/lib/chunks/{chunk-YKIFYIC5.esm.js → chunk-XKF6L4GH.esm.js} +1 -1
- package/lib/chunks/{chunk-2CVIS37T.esm.js → chunk-XQJ4DROM.esm.js} +1 -1
- package/lib/chunks/chunk-XVPUSCK5.esm.js +1 -0
- package/lib/chunks/chunk-YC44Q5HI.esm.js +1 -0
- package/lib/chunks/chunk-YJHYFCT7.esm.js +1 -0
- package/lib/chunks/{chunk-OWMRURZT.esm.js → chunk-YZQXTNVA.esm.js} +1 -1
- package/lib/chunks/chunk-Z7GJDO5T.esm.js +0 -0
- package/lib/containers/Base/index.esm.js +1 -1
- package/lib/containers/Card/Card.d.ts +27 -13
- package/lib/containers/Card/Card.interface.d.ts +20 -8
- package/lib/containers/Card/Card.style.d.ts +28 -0
- package/lib/containers/Card/index.esm.js +1 -1
- package/lib/containers/Content/index.esm.js +1 -1
- package/lib/containers/Flex/index.esm.js +1 -1
- package/lib/containers/Grid/Grid.interface.d.ts +39 -4
- package/lib/containers/Grid/index.esm.js +1 -1
- package/lib/containers/Motion/Motion.style.d.ts +180 -24
- package/lib/containers/Motion/index.esm.js +1 -1
- package/lib/containers/Notification/Notification.interface.d.ts +8 -0
- package/lib/containers/Notification/Notification.style.d.ts +720 -96
- package/lib/containers/Notification/index.esm.js +1 -1
- package/lib/containers/Paper/Paper.style.d.ts +6 -5
- package/lib/containers/Paper/index.esm.js +1 -1
- package/lib/containers/Scroll/Scroll.d.ts +3 -3
- package/lib/containers/Scroll/Scroll.helpers.d.ts +17 -14
- package/lib/containers/Scroll/Scroll.style.d.ts +2 -2
- package/lib/containers/Scroll/index.esm.js +1 -1
- package/lib/containers/index.esm.js +1 -1
- package/lib/dataDisplay/DataTable/DataTable.helpers.d.ts +0 -14
- package/lib/dataDisplay/DataTable/DataTable.style.d.ts +30 -8
- package/lib/dataDisplay/DataTable/index.esm.js +1 -1
- package/lib/dataDisplay/DescriptionList/DescriptionList.interface.d.ts +8 -0
- package/lib/dataDisplay/DescriptionList/index.esm.js +1 -1
- package/lib/dataDisplay/Meter/index.esm.js +1 -1
- package/lib/dataDisplay/Steps/Steps.d.ts +46 -0
- package/lib/dataDisplay/Steps/Steps.interface.d.ts +99 -0
- package/lib/dataDisplay/Steps/Steps.style.d.ts +84 -0
- package/lib/dataDisplay/Steps/index.d.ts +10 -0
- package/lib/dataDisplay/Steps/index.esm.js +1 -0
- package/lib/dataDisplay/Table/Table/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableBody/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableCell/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableCheckboxCell/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableEmpty/TableEmpty.style.d.ts +5 -5
- package/lib/dataDisplay/Table/TableEmpty/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableFooter/TableFooter.style.d.ts +1 -1
- package/lib/dataDisplay/Table/TableFooter/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableHeader/TableHeader.style.d.ts +1 -1
- package/lib/dataDisplay/Table/TableHeader/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableHeaderCell/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableHeaderCheckboxCell/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TablePagination/index.esm.js +1 -1
- package/lib/dataDisplay/Table/TableRow/index.esm.js +1 -1
- package/lib/dataDisplay/Table/index.esm.js +1 -1
- package/lib/dataDisplay/Tabs/Tabs.style.d.ts +4 -4
- package/lib/dataDisplay/Tabs/index.esm.js +1 -1
- package/lib/dataDisplay/index.d.ts +1 -0
- package/lib/dataDisplay/index.esm.js +1 -1
- package/lib/elements/Avatar/index.esm.js +1 -1
- package/lib/elements/Button/Button.interface.d.ts +8 -4
- package/lib/elements/Button/Button.style.d.ts +11 -1
- package/lib/elements/Button/index.esm.js +1 -1
- package/lib/elements/Calendar/index.esm.js +1 -1
- package/lib/elements/Divider/Divider.d.ts +25 -0
- package/lib/elements/Divider/Divider.interface.d.ts +63 -0
- package/lib/elements/Divider/Divider.style.d.ts +49 -0
- package/lib/elements/Divider/index.d.ts +10 -0
- package/lib/elements/Divider/index.esm.js +1 -0
- package/lib/elements/Dropdown/index.esm.js +1 -1
- package/lib/elements/Icon/index.esm.js +1 -1
- package/lib/elements/IconButton/IconButton.style.d.ts +49 -8
- package/lib/elements/IconButton/index.esm.js +1 -1
- package/lib/elements/IconText/IconText.d.ts +22 -0
- package/lib/elements/IconText/IconText.interface.d.ts +46 -0
- package/lib/elements/IconText/IconText.style.d.ts +25 -0
- package/lib/elements/IconText/index.d.ts +10 -0
- package/lib/elements/IconText/index.esm.js +1 -0
- package/lib/elements/Image/index.esm.js +1 -1
- package/lib/elements/Label/index.esm.js +1 -1
- package/lib/elements/Link/Link.style.d.ts +12 -8
- package/lib/elements/Link/index.esm.js +1 -1
- package/lib/elements/List/List.d.ts +2 -1
- package/lib/elements/List/List.interface.d.ts +9 -0
- package/lib/elements/List/List.style.d.ts +1 -1
- package/lib/elements/List/index.esm.js +1 -1
- package/lib/elements/Modal/Modal.style.d.ts +726 -16433
- package/lib/elements/Modal/index.esm.js +1 -1
- package/lib/elements/Popover/index.esm.js +1 -1
- package/lib/elements/ProgressBar/index.esm.js +1 -1
- package/lib/elements/Spinner/Spinner.d.ts +10 -4
- package/lib/elements/Spinner/Spinner.interface.d.ts +23 -2
- package/lib/elements/Spinner/Spinner.style.d.ts +36 -0
- package/lib/elements/Spinner/index.esm.js +1 -1
- package/lib/elements/Svg/Svg.style.d.ts +1 -1
- package/lib/elements/Svg/index.esm.js +1 -1
- package/lib/elements/Text/Text.interface.d.ts +12 -0
- package/lib/elements/Text/Text.props.d.ts +46 -17
- package/lib/elements/Text/Text.style.d.ts +24 -0
- package/lib/elements/Text/index.esm.js +1 -1
- package/lib/elements/Text/useTickFlash.d.ts +11 -0
- package/lib/elements/Tooltip/index.esm.js +1 -1
- package/lib/elements/index.d.ts +2 -0
- package/lib/elements/index.esm.js +1 -1
- package/lib/factory/BackgroundFactory/index.esm.js +1 -1
- package/lib/factory/ColorFactory/index.esm.js +1 -1
- package/lib/factory/ContainerFactory/ContainerFactory.d.ts +4 -3
- package/lib/factory/ContainerFactory/ContainerFactory.interface.d.ts +22 -2
- package/lib/factory/ContainerFactory/index.esm.js +1 -1
- package/lib/factory/ContainerQueryFactory/ContainerQueryFactory.d.ts +25 -0
- package/lib/factory/ContainerQueryFactory/ContainerQueryFactory.interface.d.ts +35 -0
- package/lib/factory/ContainerQueryFactory/index.d.ts +8 -0
- package/lib/factory/ContainerQueryFactory/index.esm.js +1 -0
- package/lib/factory/DeepFactory/DeepFactory.d.ts +4 -0
- package/lib/factory/DeepFactory/index.esm.js +1 -1
- package/lib/factory/FlexFactory/FlexFactory.d.ts +15 -3
- package/lib/factory/FlexFactory/FlexFactory.interface.d.ts +17 -2
- package/lib/factory/FlexFactory/index.esm.js +1 -1
- package/lib/factory/ResponsiveFactory/index.esm.js +1 -1
- package/lib/factory/System/System.interface.d.ts +2 -1
- package/lib/factory/System/index.esm.js +1 -1
- package/lib/factory/index.d.ts +1 -0
- package/lib/factory/index.esm.js +1 -1
- package/lib/form/Checkbox/Checkbox.d.ts +1 -1
- package/lib/form/Checkbox/Checkbox.interface.d.ts +12 -1
- package/lib/form/Checkbox/Checkbox.style.d.ts +22 -8
- package/lib/form/Checkbox/index.esm.js +1 -1
- package/lib/form/Field/Field.style.d.ts +5 -2
- package/lib/form/Field/index.esm.js +1 -1
- package/lib/form/FieldGroup/index.esm.js +1 -1
- package/lib/form/Form/index.esm.js +1 -1
- package/lib/form/Input/Input.style.d.ts +10 -10
- package/lib/form/Input/index.esm.js +1 -1
- package/lib/form/InputCurrency/InputCurrency.d.ts +10 -0
- package/lib/form/InputCurrency/InputCurrency.interface.d.ts +36 -0
- package/lib/form/InputCurrency/InputCurrency.style.d.ts +48 -0
- package/lib/form/InputCurrency/index.esm.js +1 -1
- package/lib/form/InputDate/index.esm.js +1 -1
- package/lib/form/InputMask/index.esm.js +1 -1
- package/lib/form/InputRange/InputRange.style.d.ts +8 -8
- package/lib/form/InputRange/index.esm.js +1 -1
- package/lib/form/InputSelect/index.esm.js +1 -1
- package/lib/form/Option/Option.d.ts +31 -0
- package/lib/form/Option/Option.interface.d.ts +62 -0
- package/lib/form/Option/Option.style.d.ts +38 -0
- package/lib/form/Option/index.d.ts +10 -0
- package/lib/form/Option/index.esm.js +1 -0
- package/lib/form/Radio/Radio.d.ts +1 -1
- package/lib/form/Radio/Radio.interface.d.ts +13 -2
- package/lib/form/Radio/Radio.style.d.ts +8 -6
- package/lib/form/Radio/index.esm.js +1 -1
- package/lib/form/Select/index.esm.js +1 -1
- package/lib/form/Switch/Switch.d.ts +1 -1
- package/lib/form/Switch/Switch.interface.d.ts +12 -1
- package/lib/form/Switch/Switch.style.d.ts +4 -2
- package/lib/form/Switch/index.esm.js +1 -1
- package/lib/form/TextArea/TextArea.style.d.ts +4 -4
- package/lib/form/TextArea/index.esm.js +1 -1
- package/lib/form/UploadCard/UploadCard.style.d.ts +19 -11
- package/lib/form/UploadCard/index.esm.js +1 -1
- package/lib/form/index.d.ts +1 -0
- package/lib/form/index.esm.js +1 -1
- package/lib/hooks/index.esm.js +1 -1
- package/lib/hooks/useMediaQuery/index.esm.js +1 -1
- package/lib/hooks/useMediaQuery/useMediaQuery.d.ts +7 -5
- package/lib/hooks/useMediaQuery/useMediaQuery.helpers.d.ts +12 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/lib/layouts/DefaultLayout/DefaultLayout.d.ts +3 -1
- package/lib/layouts/DefaultLayout/DefaultLayout.style.d.ts +2 -2
- package/lib/layouts/DefaultLayout/index.esm.js +1 -1
- package/lib/layouts/SideBarLayout/SideBarLayout.d.ts +7 -3
- package/lib/layouts/SideBarLayout/SideBarLayout.props.d.ts +3 -2
- package/lib/layouts/SideBarLayout/SideBarLayout.style.d.ts +2 -2
- package/lib/layouts/SideBarLayout/index.esm.js +1 -1
- package/lib/layouts/index.esm.js +1 -1
- package/lib/scenario/CircleComponent/index.esm.js +1 -1
- package/lib/scenario/RectComponent/index.esm.js +1 -1
- package/lib/scenario/index.esm.js +1 -1
- package/lib/skeleton/ComposedSkeleton/ComposedSkeleton.d.ts +1 -1
- package/lib/skeleton/ComposedSkeleton/ComposedSkeleton.interface.d.ts +1 -1
- package/lib/skeleton/ComposedSkeleton/index.esm.js +1 -1
- package/lib/skeleton/TextPreset/index.esm.js +1 -1
- package/lib/skeleton/index.esm.js +1 -1
- package/lib/themes/Animation/Animation.interface.d.ts +6 -0
- package/lib/themes/Animation/index.esm.js +1 -1
- package/lib/themes/Colors/Colors.helpers.d.ts +77 -0
- package/lib/themes/Colors/Colors.interface.d.ts +101 -2
- package/lib/themes/Colors/Colors.ladder.d.ts +98 -0
- package/lib/themes/Colors/index.d.ts +2 -0
- package/lib/themes/Colors/index.esm.js +1 -1
- package/lib/themes/Component/Component.interface.d.ts +19 -1
- package/lib/themes/Component/index.d.ts +1 -1
- package/lib/themes/Component/index.esm.js +1 -1
- package/lib/themes/Deep/index.esm.js +1 -1
- package/lib/themes/Depth/Depth.props.d.ts +14 -0
- package/lib/themes/Depth/index.esm.js +1 -1
- package/lib/themes/Font/Font.interface.d.ts +8 -0
- package/lib/themes/Font/Font.props.d.ts +9 -2
- package/lib/themes/Font/index.esm.js +1 -1
- package/lib/themes/Foundation/Foundation.interface.d.ts +27 -0
- package/lib/themes/Foundation/index.esm.js +1 -1
- package/lib/themes/GlobalStyle/GlobalStyle.d.ts +20 -2
- package/lib/themes/GlobalStyle/index.d.ts +5 -1
- package/lib/themes/GlobalStyle/index.esm.js +1 -1
- package/lib/themes/Ground/Ground.d.ts +28 -0
- package/lib/themes/Ground/Ground.helpers.d.ts +60 -0
- package/lib/themes/Ground/index.d.ts +7 -0
- package/lib/themes/Ground/index.esm.js +1 -0
- package/lib/themes/Layout/Layout.interface.d.ts +33 -0
- package/lib/themes/Layout/Layout.props.d.ts +18 -0
- package/lib/themes/Layout/index.d.ts +8 -0
- package/lib/themes/Layout/index.esm.js +1 -0
- package/lib/themes/Mode/Mode.helpers.d.ts +64 -0
- package/lib/themes/Mode/Mode.interface.d.ts +54 -0
- package/lib/themes/Mode/ModeScript.d.ts +14 -0
- package/lib/themes/Mode/index.d.ts +9 -0
- package/lib/themes/Mode/index.esm.js +1 -0
- package/lib/themes/Semantic/Semantic.helpers.d.ts +9 -2
- package/lib/themes/Semantic/Semantic.interface.d.ts +28 -0
- package/lib/themes/Semantic/index.esm.js +1 -1
- package/lib/themes/Surface/index.esm.js +1 -1
- package/lib/themes/ThemeProvider/ThemeProvider.d.ts +10 -4
- package/lib/themes/ThemeProvider/ThemeProvider.interface.d.ts +129 -10
- package/lib/themes/ThemeProvider/ThemeProvider.modes.d.ts +52 -0
- package/lib/themes/ThemeProvider/index.esm.js +1 -1
- package/lib/themes/index.d.ts +2 -0
- package/lib/themes/index.esm.js +1 -1
- package/lib/utils/components/Breakpoints/Breakpoints.d.ts +7 -5
- package/lib/utils/components/Breakpoints/Breakpoints.interface.d.ts +11 -7
- package/lib/utils/components/Breakpoints/index.esm.js +1 -1
- package/lib/utils/components/index.esm.js +1 -1
- package/lib/vendors/Culori/apca.d.ts +24 -0
- package/lib/vendors/Culori/index.d.ts +1 -0
- package/lib/vendors/StyledComponents/component.d.ts +3 -2
- package/lib/vendors/StyledComponents/index.d.ts +1 -1
- package/package.json +44 -3
- package/lib/chunks/Notification.group-GB62BMAL.esm.js +0 -1
- package/lib/chunks/chunk-2CW4G3UR.esm.js +0 -1
- package/lib/chunks/chunk-2R6XFFSQ.esm.js +0 -1
- package/lib/chunks/chunk-2WED4EVR.esm.js +0 -43
- package/lib/chunks/chunk-34QOWBI6.esm.js +0 -1
- package/lib/chunks/chunk-3EOSES4S.esm.js +0 -1
- package/lib/chunks/chunk-452VAAGY.esm.js +0 -1
- package/lib/chunks/chunk-4BMWIGG4.esm.js +0 -1
- package/lib/chunks/chunk-4V7LOS5Z.esm.js +0 -1
- package/lib/chunks/chunk-56NEPHUH.esm.js +0 -1
- package/lib/chunks/chunk-5HENHW73.esm.js +0 -1
- package/lib/chunks/chunk-5MWVBWXW.esm.js +0 -1
- package/lib/chunks/chunk-5NE62M4R.esm.js +0 -1
- package/lib/chunks/chunk-6N52NFPT.esm.js +0 -1
- package/lib/chunks/chunk-6OXVRDS2.esm.js +0 -1
- package/lib/chunks/chunk-6X6WKZ3Y.esm.js +0 -1
- package/lib/chunks/chunk-73MPQ5OY.esm.js +0 -1
- package/lib/chunks/chunk-A6Z2M2XU.esm.js +0 -1
- package/lib/chunks/chunk-APD22JEO.esm.js +0 -1
- package/lib/chunks/chunk-AYZYOY57.esm.js +0 -1
- package/lib/chunks/chunk-BC24WDTC.esm.js +0 -1
- package/lib/chunks/chunk-BRXIFPWB.esm.js +0 -1
- package/lib/chunks/chunk-CLDPV7NK.esm.js +0 -1
- package/lib/chunks/chunk-CZAUFZ45.esm.js +0 -1
- package/lib/chunks/chunk-DLVRDZRA.esm.js +0 -35
- package/lib/chunks/chunk-E3MSXQXV.esm.js +0 -1
- package/lib/chunks/chunk-EJ3VKFOX.esm.js +0 -1
- package/lib/chunks/chunk-G4IUG32B.esm.js +0 -1
- package/lib/chunks/chunk-I46TFDIX.esm.js +0 -3
- package/lib/chunks/chunk-IE4YNQFD.esm.js +0 -1
- package/lib/chunks/chunk-IWMEDT6U.esm.js +0 -1
- package/lib/chunks/chunk-K2BKOGDX.esm.js +0 -1
- package/lib/chunks/chunk-KASRN4X5.esm.js +0 -1
- package/lib/chunks/chunk-KHEBUAB4.esm.js +0 -1
- package/lib/chunks/chunk-KI5W6U4K.esm.js +0 -1
- package/lib/chunks/chunk-KYIPVR2T.esm.js +0 -1
- package/lib/chunks/chunk-LATE6DIA.esm.js +0 -1
- package/lib/chunks/chunk-LTTG3NIJ.esm.js +0 -1
- package/lib/chunks/chunk-M32CTX5Z.esm.js +0 -1
- package/lib/chunks/chunk-M33BYGAO.esm.js +0 -1
- package/lib/chunks/chunk-MBYC37CX.esm.js +0 -1
- package/lib/chunks/chunk-MLIU6MRT.esm.js +0 -1
- package/lib/chunks/chunk-NI6YLGUA.esm.js +0 -1
- package/lib/chunks/chunk-NQBO2D7L.esm.js +0 -1
- package/lib/chunks/chunk-NYDXZB2D.esm.js +0 -1
- package/lib/chunks/chunk-OUHMU5PP.esm.js +0 -1
- package/lib/chunks/chunk-OZIEVLUR.esm.js +0 -1
- package/lib/chunks/chunk-P5PWDVWO.esm.js +0 -1
- package/lib/chunks/chunk-ROSLCQXL.esm.js +0 -1
- package/lib/chunks/chunk-RU6QRCR7.esm.js +0 -1
- package/lib/chunks/chunk-RUKCBNDS.esm.js +0 -1
- package/lib/chunks/chunk-RZDVS7AY.esm.js +0 -1
- package/lib/chunks/chunk-T6ZB656A.esm.js +0 -1
- package/lib/chunks/chunk-TISQZ6PQ.esm.js +0 -1
- package/lib/chunks/chunk-TLBV5OUM.esm.js +0 -1
- package/lib/chunks/chunk-TQJTHPA3.esm.js +0 -1
- package/lib/chunks/chunk-TUALAE4W.esm.js +0 -1
- package/lib/chunks/chunk-UHMYTFMU.esm.js +0 -1
- package/lib/chunks/chunk-UNM6DHPD.esm.js +0 -1
- package/lib/chunks/chunk-VAJGIZNP.esm.js +0 -1
- package/lib/chunks/chunk-VHXSTTRG.esm.js +0 -5
- package/lib/chunks/chunk-WGTBX72G.esm.js +0 -1
- package/lib/chunks/chunk-YRBM4WYM.esm.js +0 -1
- package/lib/chunks/chunk-ZLFQHCLE.esm.js +0 -1
- package/lib/chunks/chunk-ZZFLBPSO.esm.js +0 -39
- /package/lib/chunks/{chunk-5OKRFXLL.esm.js → chunk-4L2KOZIQ.esm.js} +0 -0
- /package/lib/chunks/{chunk-KL3ATH64.esm.js → chunk-EBOJSNZ5.esm.js} +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Theme } from '../ThemeProvider/ThemeProvider.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Ground channel (APOLLION-DARK-MODE-ENGINE, decision D7 — ADR-024 §ground).
|
|
4
|
+
*
|
|
5
|
+
* Every painted ground (`bgColor`, `<Ground>`, the page canvas) emits a set
|
|
6
|
+
* of CSS custom properties computed **in JS against the ground's literal**
|
|
7
|
+
* — in both modes (`light-dark()` pairs): the neutral ink hierarchy, the
|
|
8
|
+
* readable accent inks, the black/white contrast ink and the ink-alpha
|
|
9
|
+
* edges. Inks consume `var(--apollion-on-ground-…)` with a canvas-resolved
|
|
10
|
+
* fallback, so the CSS cascade resolves "the nearest painted ancestor" for
|
|
11
|
+
* free — no React context, no wrappers, works for consumer containers too.
|
|
12
|
+
*
|
|
13
|
+
* Contract: every value is AA (4.5) over the ground it was computed for
|
|
14
|
+
* (disabled excepted); `auditGroundVars` asserts it in tests.
|
|
15
|
+
*/
|
|
16
|
+
/** Prefix of every ground custom property. */
|
|
17
|
+
export declare const GROUND_VAR_PREFIX = "--apollion-on-ground";
|
|
18
|
+
/** Neutral ink roles published per ground. */
|
|
19
|
+
export declare const GROUND_INK_ROLES: readonly ["primary", "secondary", "muted", "disabled"];
|
|
20
|
+
export type GroundInkRole = (typeof GROUND_INK_ROLES)[number];
|
|
21
|
+
/** Token the root ground (page canvas) is computed from. */
|
|
22
|
+
export declare const ROOT_GROUND_TOKEN = "surface.canvas";
|
|
23
|
+
/** Builds a ground custom-property name: `groundVar('ink', 'primary')` → `--apollion-on-ground-ink-primary`. */
|
|
24
|
+
export declare function groundVar(...path: Array<string | number>): string;
|
|
25
|
+
/** `var(--apollion-on-ground-…, fallback)` reference. */
|
|
26
|
+
export declare function groundVarRef(fallback: string, ...path: Array<string | number>): string;
|
|
27
|
+
/**
|
|
28
|
+
* Maps an ink token to its ground-relative custom property path, or `null`
|
|
29
|
+
* when the token is not ground-relative (fills, borders, raw colors):
|
|
30
|
+
* - `ink.<role>` → `ink-<role>`
|
|
31
|
+
* - `<palette>` (base) → `tx-<palette>` (readable accent over the ground)
|
|
32
|
+
* - `neutral.<120..180>` → `neutral-<index>` (text side of the ramp)
|
|
33
|
+
*/
|
|
34
|
+
export declare function groundInkPath(token: string): string[] | null;
|
|
35
|
+
/**
|
|
36
|
+
* A translucent ground (`wash.*`, `rgba(…, 0.2)`, `transparent`) composites
|
|
37
|
+
* over whatever is behind it — its inks are the PARENT ground's inks. Such
|
|
38
|
+
* grounds must not publish the channel (the cascade keeps the ancestor's).
|
|
39
|
+
*/
|
|
40
|
+
export declare function isOpaqueGround(literalGround: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The ground custom properties for `ground` (a `theme.colors` dot-path token
|
|
43
|
+
* or a runtime CSS color), each side computed on the matching literal table
|
|
44
|
+
* and paired with `light-dark()`. Pure; memoize at the call site if hot.
|
|
45
|
+
*/
|
|
46
|
+
export declare function groundVars(theme: Theme, ground: string): Record<string, string>;
|
|
47
|
+
/** One failing pair found by {@link auditGroundVars}. */
|
|
48
|
+
export interface GroundAuditFailure {
|
|
49
|
+
ground: string;
|
|
50
|
+
mode: 'light' | 'dark';
|
|
51
|
+
variable: string;
|
|
52
|
+
ink: string;
|
|
53
|
+
ratio: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Test helper (D7 guarantee): for every ground token, computes the ground
|
|
57
|
+
* inks on both literal tables and reports every pair under the floor.
|
|
58
|
+
* `disabled` and `edge-*` are WCAG-exempt (non-text / disabled) and skipped.
|
|
59
|
+
*/
|
|
60
|
+
export declare function auditGroundVars(theme: Theme, grounds: readonly string[], minRatio?: number): GroundAuditFailure[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public barrel for the `Ground` module — the ground channel (D7, ADR-024):
|
|
3
|
+
* every painted ground publishes `--apollion-on-ground-*` custom properties
|
|
4
|
+
* computed against its own literal, in both modes.
|
|
5
|
+
*/
|
|
6
|
+
export * from './Ground.helpers';
|
|
7
|
+
export * from './Ground';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as j}from"../../chunks/chunk-HPM5AX5Z.esm.js";import{a,b,c,d,e,f,g,h,i}from"../../chunks/chunk-JQ66DKSQ.esm.js";import"../../chunks/chunk-YC44Q5HI.esm.js";import"../../chunks/chunk-BFABFZI7.esm.js";import"../../chunks/chunk-U525YXTZ.esm.js";import"../../chunks/chunk-STSRIPD6.esm.js";import"../../chunks/chunk-XVPUSCK5.esm.js";import"../../chunks/chunk-BV6GHAF7.esm.js";import"../../chunks/chunk-G5Z7USXC.esm.js";import"../../chunks/chunk-AXUWC2WH.esm.js";import"../../chunks/chunk-GZONWSRB.esm.js";export{b as GROUND_INK_ROLES,a as GROUND_VAR_PREFIX,j as Ground,c as ROOT_GROUND_TOKEN,i as auditGroundVars,f as groundInkPath,d as groundVar,e as groundVarRef,h as groundVars,g as isOpaqueGround};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container-size keys of the `theme.containerSizes` scale (ADR-025).
|
|
3
|
+
*
|
|
4
|
+
* A SEPARATE scale from the viewport breakpoints on purpose: slot widths are
|
|
5
|
+
* not viewport widths — reusing `breakpoints.values` would be a category
|
|
6
|
+
* error (a 480px slot is generous inside a 1280px page and cramped as a
|
|
7
|
+
* whole phone screen).
|
|
8
|
+
*/
|
|
9
|
+
export type ContainerSizeTypes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
|
+
/** Input shape of the container-size scale. */
|
|
11
|
+
export interface ContainerSizesInput {
|
|
12
|
+
unit: 'px';
|
|
13
|
+
values: Record<ContainerSizeTypes, number>;
|
|
14
|
+
}
|
|
15
|
+
/** Resolved `theme.containerSizes` surface. */
|
|
16
|
+
export interface ContainerSizesInterface {
|
|
17
|
+
unit: 'px';
|
|
18
|
+
values: Record<ContainerSizeTypes, number>;
|
|
19
|
+
/** `@container (min-width: <value>px)` prelude for the given key — the
|
|
20
|
+
* container-relative sibling of `theme.breakpoints.up()`. Ascending,
|
|
21
|
+
* half-open bands, mobile-first: the base style IS the narrow-slot style. */
|
|
22
|
+
up: (key: ContainerSizeTypes) => string;
|
|
23
|
+
/** Raw width of a container-size key (number, in `unit`). */
|
|
24
|
+
width: (key: ContainerSizeTypes) => number;
|
|
25
|
+
}
|
|
26
|
+
/** Input shape of the page-layout constants. */
|
|
27
|
+
export interface LayoutInput {
|
|
28
|
+
/** Max width of the centered page shell (`pageShell` prop) — previously a
|
|
29
|
+
* magic `1366` literal inside `ContainerFactory` (ADR-025 §2.3). */
|
|
30
|
+
pageMaxWidth: number;
|
|
31
|
+
}
|
|
32
|
+
/** Resolved `theme.layout` surface. */
|
|
33
|
+
export type LayoutInterface = LayoutInput;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ContainerSizesInput, ContainerSizesInterface, LayoutInput, LayoutInterface } from './Layout.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Default container-size scale (ADR-025 §2.2). Calibrated in the S1 spike:
|
|
4
|
+
* `xs` fits a compact rail card, `sm` the classic sidebar widget, `md` a
|
|
5
|
+
* half-column panel, `lg` a comfortable article column, `xl` a wide feed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const defaultInputContainerSizes: ContainerSizesInput;
|
|
8
|
+
/** Default page-layout constants (ADR-025 §2.3). */
|
|
9
|
+
export declare const defaultInputLayout: LayoutInput;
|
|
10
|
+
/**
|
|
11
|
+
* Builds the `theme.containerSizes` surface — the container-relative sibling
|
|
12
|
+
* of `createBreakpoints`. Only `up()` exists: container queries in the DS are
|
|
13
|
+
* ascending `min-width` sets by contract (mobile-first; the base style is the
|
|
14
|
+
* narrow-slot style), so there is no `down()` to misuse.
|
|
15
|
+
*/
|
|
16
|
+
export declare const createContainerSizes: (input: ContainerSizesInput) => ContainerSizesInterface;
|
|
17
|
+
/** Builds the `theme.layout` surface. */
|
|
18
|
+
export declare const createLayout: (input: LayoutInput) => LayoutInterface;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public barrel for the `Layout` module.
|
|
3
|
+
*
|
|
4
|
+
* Any other file in the project should import from the barrel, never from
|
|
5
|
+
* internal paths like `./Layout.interface` or `./Layout.props`.
|
|
6
|
+
*/
|
|
7
|
+
export * from './Layout.interface';
|
|
8
|
+
export * from './Layout.props';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"../../chunks/chunk-YJHYFCT7.esm.js";import"../../chunks/chunk-GZONWSRB.esm.js";export{c as createContainerSizes,d as createLayout,a as defaultInputContainerSizes,b as defaultInputLayout};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { A11yMode, CookieAdapterOptions, ModeDocumentOptions, ModePreference, ModeScriptOptions, ModeStorage, PersistOption, ResolvedMode } from './Mode.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Mode engine primitives (APOLLION-DARK-MODE-ENGINE, ADR-024) — pure,
|
|
4
|
+
* dependency-free helpers shared by `ApollionProvider`, the pre-paint script
|
|
5
|
+
* and server-side recipes (importable from a Next.js `app/layout.tsx`).
|
|
6
|
+
*/
|
|
7
|
+
/** Default storage key of the mode preference; the a11y preset lives under `${key}-a11y`. */
|
|
8
|
+
export declare const MODE_STORAGE_KEY = "apollion-mode";
|
|
9
|
+
/** Default `<html>` attribute carrying the resolved mode. */
|
|
10
|
+
export declare const MODE_ATTRIBUTE = "data-apollion-mode";
|
|
11
|
+
/** Default `<html>` attribute carrying the a11y preset. */
|
|
12
|
+
export declare const A11Y_ATTRIBUTE = "data-apollion-a11y";
|
|
13
|
+
/** `prefers-color-scheme` query the engine follows for `'system'`. */
|
|
14
|
+
export declare const DARK_SCHEME_QUERY = "(prefers-color-scheme: dark)";
|
|
15
|
+
/** Storage key of the a11y preset for a given mode key. */
|
|
16
|
+
export declare function a11yStorageKey(storageKey?: string): string;
|
|
17
|
+
/** Type guard — a valid persisted/URL/cookie mode value. */
|
|
18
|
+
export declare function isModePreference(value: unknown): value is ModePreference;
|
|
19
|
+
/** Type guard — a valid a11y preset name. */
|
|
20
|
+
export declare function isA11yMode(value: unknown): value is Exclude<A11yMode, null>;
|
|
21
|
+
/** SSR-safe read of the OS preference (`false` without `window`/`matchMedia`). */
|
|
22
|
+
export declare function prefersDarkScheme(): boolean;
|
|
23
|
+
/** Resolves a preference into the mode that renders. */
|
|
24
|
+
export declare function resolveMode(preference: ModePreference, systemDark: boolean): ResolvedMode;
|
|
25
|
+
/** `localStorage`-backed adapter; silent on private mode / SSR. */
|
|
26
|
+
export declare function localStorageAdapter(): ModeStorage;
|
|
27
|
+
/** Parses a `Cookie` header / `document.cookie` string for one value. */
|
|
28
|
+
export declare function readCookieValue(cookieHeader: string | null | undefined, name: string): string | null;
|
|
29
|
+
/** `document.cookie`-backed adapter — the server can read the same cookie (`readModeFromCookie`). */
|
|
30
|
+
export declare function cookieAdapter(options?: CookieAdapterOptions): ModeStorage;
|
|
31
|
+
/** Maps the provider's `persist` prop to a storage adapter (`null` = off). */
|
|
32
|
+
export declare function resolveStorage(persist: PersistOption | undefined): ModeStorage | null;
|
|
33
|
+
/**
|
|
34
|
+
* Server-side read of the persisted mode preference from a `Cookie` header
|
|
35
|
+
* (App Router: `headers().get('cookie')`; Pages Router: `req.headers.cookie`).
|
|
36
|
+
* Invalid/missing → `null` (the caller falls back to `defaultMode`).
|
|
37
|
+
*/
|
|
38
|
+
export declare function readModeFromCookie(cookieHeader: string | null | undefined, name?: string): ModePreference | null;
|
|
39
|
+
/** Server-side read of the persisted a11y preset (see {@link readModeFromCookie}). */
|
|
40
|
+
export declare function readA11yFromCookie(cookieHeader: string | null | undefined, name?: string): A11yMode;
|
|
41
|
+
/**
|
|
42
|
+
* Writes the resolved mode + a11y preset on the document element
|
|
43
|
+
* (`data-apollion-mode`, `data-apollion-a11y`, `style.colorScheme`) so native
|
|
44
|
+
* controls, scrollbars and `light-dark()` follow the engine. No-op without an element.
|
|
45
|
+
*/
|
|
46
|
+
export declare function syncDocumentMode(element: HTMLElement | null | undefined, state: {
|
|
47
|
+
mode: ResolvedMode;
|
|
48
|
+
a11y: A11yMode;
|
|
49
|
+
}, options?: ModeDocumentOptions): void;
|
|
50
|
+
/** Removes what {@link syncDocumentMode} wrote (provider unmount). */
|
|
51
|
+
export declare function clearDocumentMode(element: HTMLElement | null | undefined, options?: ModeDocumentOptions): void;
|
|
52
|
+
/**
|
|
53
|
+
* Pre-paint inline script (no-flash): reads the persisted preference
|
|
54
|
+
* (localStorage or cookie), resolves `'system'` through `matchMedia`, and
|
|
55
|
+
* writes the same attributes the provider will write — before the first
|
|
56
|
+
* paint, outside React's tree (so hydration never sees a mismatch). Every
|
|
57
|
+
* option is JSON-escaped; the body is wrapped in `try/catch`.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <script dangerouslySetInnerHTML={{ __html: getModeScript({ persist: 'cookie' }) }} />
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function getModeScript(options?: ModeScriptOptions): string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AccessibilityPreset } from '../Colors/Colors.presets';
|
|
2
|
+
/**
|
|
3
|
+
* What the user asked for: a fixed mode or "follow the operating system".
|
|
4
|
+
* Persisted as-is (`'system'` stays `'system'`), resolved per render.
|
|
5
|
+
*/
|
|
6
|
+
export type ModePreference = 'light' | 'dark' | 'system';
|
|
7
|
+
/** What actually renders — the preference with `'system'` resolved. */
|
|
8
|
+
export type ResolvedMode = 'light' | 'dark';
|
|
9
|
+
/**
|
|
10
|
+
* Accessibility axis — orthogonal to the mode (decision D5): any preset
|
|
11
|
+
* composes with either polarity (`dark` + `colorblind`, `light` +
|
|
12
|
+
* `high-contrast`, …). `null` = the stock palette.
|
|
13
|
+
*/
|
|
14
|
+
export type A11yMode = AccessibilityPreset | null;
|
|
15
|
+
/**
|
|
16
|
+
* Minimal storage contract for the mode/a11y preferences. `write(key, null)`
|
|
17
|
+
* clears the entry. Implementations must never throw (private mode, SSR).
|
|
18
|
+
*/
|
|
19
|
+
export interface ModeStorage {
|
|
20
|
+
read(key: string): string | null;
|
|
21
|
+
write(key: string, value: string | null): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Persistence option of the provider: off, the two built-in adapters, or a
|
|
25
|
+
* custom {@link ModeStorage} (e.g. a server session).
|
|
26
|
+
*/
|
|
27
|
+
export type PersistOption = false | 'localStorage' | 'cookie' | ModeStorage;
|
|
28
|
+
/** Cookie adapter tuning (`cookieAdapter`). */
|
|
29
|
+
export interface CookieAdapterOptions {
|
|
30
|
+
/** Max-age in seconds. Default: one year. */
|
|
31
|
+
maxAge?: number;
|
|
32
|
+
/** Cookie path. Default `'/'`. */
|
|
33
|
+
path?: string;
|
|
34
|
+
/** SameSite policy. Default `'Lax'`. */
|
|
35
|
+
sameSite?: 'Lax' | 'Strict' | 'None';
|
|
36
|
+
/** Mark the cookie `Secure`. Default: `true` when `sameSite === 'None'`. */
|
|
37
|
+
secure?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Attribute names the engine writes on `<html>` (`syncDocumentMode`). */
|
|
40
|
+
export interface ModeDocumentOptions {
|
|
41
|
+
/** Resolved-mode attribute. Default `data-apollion-mode`. */
|
|
42
|
+
attribute?: string;
|
|
43
|
+
/** A11y-preset attribute. Default `data-apollion-a11y`. */
|
|
44
|
+
a11yAttribute?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Options of `getModeScript` — the pre-paint `<head>` script (no-flash). */
|
|
47
|
+
export interface ModeScriptOptions extends ModeDocumentOptions {
|
|
48
|
+
/** Storage key the provider persists under. Default `apollion-mode`. */
|
|
49
|
+
storageKey?: string;
|
|
50
|
+
/** Where the preference lives. Default `'localStorage'`. */
|
|
51
|
+
persist?: 'localStorage' | 'cookie';
|
|
52
|
+
/** Preference when nothing is stored. Default `'system'`. */
|
|
53
|
+
defaultMode?: ModePreference;
|
|
54
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ModeScriptOptions } from './Mode.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Pre-paint mode script as a `<head>` element — drop it before any stylesheet
|
|
5
|
+
* so the resolved mode (and the a11y preset) reach `<html>` before the first
|
|
6
|
+
* paint. Pair it with `ApollionProvider persist` using the same `storageKey`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* // Next.js App Router — app/layout.tsx
|
|
11
|
+
* <head><ApollionModeScript persist="cookie" /></head>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function ApollionModeScript(props: ModeScriptOptions): React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public barrel for the `Mode` module (APOLLION-DARK-MODE-ENGINE, ADR-024).
|
|
3
|
+
*
|
|
4
|
+
* Dependency-free: importable from server code (`app/layout.tsx`, loaders)
|
|
5
|
+
* for `readModeFromCookie` / `getModeScript`.
|
|
6
|
+
*/
|
|
7
|
+
export * from './Mode.interface';
|
|
8
|
+
export * from './Mode.helpers';
|
|
9
|
+
export * from './ModeScript';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"../../chunks/chunk-2XTVIQMG.esm.js";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r}from"../../chunks/chunk-TLIKQFOT.esm.js";import"../../chunks/chunk-GZONWSRB.esm.js";export{c as A11Y_ATTRIBUTE,s as ApollionModeScript,d as DARK_SCHEME_QUERY,b as MODE_ATTRIBUTE,a as MODE_STORAGE_KEY,e as a11yStorageKey,q as clearDocumentMode,l as cookieAdapter,r as getModeScript,g as isA11yMode,f as isModePreference,j as localStorageAdapter,h as prefersDarkScheme,o as readA11yFromCookie,k as readCookieValue,n as readModeFromCookie,i as resolveMode,m as resolveStorage,p as syncDocumentMode};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SemanticLayer } from './Semantic.interface';
|
|
2
|
-
import type { ColorsThemeInterface } from '../Colors/Colors.interface';
|
|
1
|
+
import type { SemanticColor, SemanticLayer } from './Semantic.interface';
|
|
2
|
+
import type { ColorsThemeInterface, LadderGroups } from '../Colors/Colors.interface';
|
|
3
3
|
import type { SpacingThemeInterface } from '../Spacing/Spacing.interface';
|
|
4
4
|
/**
|
|
5
5
|
* Subset of the structural `Theme` needed to derive the Semantic layer.
|
|
@@ -48,4 +48,11 @@ export interface CreateSemanticInput {
|
|
|
48
48
|
* @see ../../docs/adr/ADR-002-layered-theme-aliases-and-surface.md §3, §5, §9
|
|
49
49
|
* @see ../../docs/CONCEPTS.md §2 Layer Cake
|
|
50
50
|
*/
|
|
51
|
+
/**
|
|
52
|
+
* Surface-ladder slice of Semantic (ADR-023): `surface.*` pairs + `ink.*` +
|
|
53
|
+
* `edge.*`, read from the structural groups assembled by `createColors` (or
|
|
54
|
+
* from an explicit ladder — `invertForSurface` passes the opposite polarity's).
|
|
55
|
+
* Falls back to the anchors for degenerate inputs (jsdom-unreachable paths).
|
|
56
|
+
*/
|
|
57
|
+
export declare function ladderSemantic(colors: CreateSemanticInput['colors'], ladder?: Pick<LadderGroups, 'surface' | 'ink' | 'edge'>): Pick<SemanticColor, 'surface' | 'ink' | 'edge'>;
|
|
51
58
|
export declare function createSemantic(theme: CreateSemanticInput): SemanticLayer;
|
|
@@ -86,6 +86,31 @@ export interface SemanticColorBrand {
|
|
|
86
86
|
second: SemanticBrandTokens;
|
|
87
87
|
third: SemanticBrandTokens;
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Surface ladder as bg/text-on pairs (ADR-023). `txtOn` is `ink.primary`,
|
|
91
|
+
* AA over every ground of the ladder by construction. Maps to
|
|
92
|
+
* `theme.colors.surface.*` at the structural level.
|
|
93
|
+
*/
|
|
94
|
+
export interface SemanticColorSurface {
|
|
95
|
+
canvas: SemanticBgPair;
|
|
96
|
+
sunken: SemanticBgPair;
|
|
97
|
+
paper: SemanticBgPair;
|
|
98
|
+
raised: SemanticBgPair;
|
|
99
|
+
overlay: SemanticBgPair;
|
|
100
|
+
}
|
|
101
|
+
/** Neutral text hierarchy (ADR-023). Maps to `theme.colors.ink.*`. */
|
|
102
|
+
export interface SemanticColorInk {
|
|
103
|
+
primary: string;
|
|
104
|
+
secondary: string;
|
|
105
|
+
muted: string;
|
|
106
|
+
disabled: string;
|
|
107
|
+
}
|
|
108
|
+
/** Ink-alpha lines (ADR-023). Maps to `theme.colors.edge.*`. */
|
|
109
|
+
export interface SemanticColorEdge {
|
|
110
|
+
hairline: string;
|
|
111
|
+
border: string;
|
|
112
|
+
strong: string;
|
|
113
|
+
}
|
|
89
114
|
/**
|
|
90
115
|
* Color layer of Semantic.
|
|
91
116
|
*/
|
|
@@ -93,6 +118,9 @@ export interface SemanticColor {
|
|
|
93
118
|
feedback: SemanticColorFeedback;
|
|
94
119
|
interface: SemanticColorInterface;
|
|
95
120
|
brand: SemanticColorBrand;
|
|
121
|
+
surface: SemanticColorSurface;
|
|
122
|
+
ink: SemanticColorInk;
|
|
123
|
+
edge: SemanticColorEdge;
|
|
96
124
|
}
|
|
97
125
|
/**
|
|
98
126
|
* Spacing pre-resolved into a CSS string (`'8px'`, `'1rem'`, etc.), generated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../../chunks/chunk-IA234JY2.esm.js";import{b as a}from"../../chunks/chunk-6XX3UO2Y.esm.js";import"../../chunks/chunk-XVPUSCK5.esm.js";import"../../chunks/chunk-BV6GHAF7.esm.js";import"../../chunks/chunk-G5Z7USXC.esm.js";import"../../chunks/chunk-GZONWSRB.esm.js";export{a as createSemantic};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"../../chunks/chunk-
|
|
1
|
+
import{a as b}from"../../chunks/chunk-4ZHLV35P.esm.js";import{a}from"../../chunks/chunk-CCONLRLQ.esm.js";import"../../chunks/chunk-6XX3UO2Y.esm.js";import"../../chunks/chunk-PFLBU7HG.esm.js";import"../../chunks/chunk-STSRIPD6.esm.js";import"../../chunks/chunk-XVPUSCK5.esm.js";import"../../chunks/chunk-BV6GHAF7.esm.js";import"../../chunks/chunk-G5Z7USXC.esm.js";import"../../chunks/chunk-AXUWC2WH.esm.js";import"../../chunks/chunk-GZONWSRB.esm.js";export{b as SurfaceProvider,a as invertForSurface};
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ApollionProviderInterface, ApollionThemeContext } from './ThemeProvider.interface';
|
|
3
3
|
/**
|
|
4
|
-
* Reads the active theme and the
|
|
5
|
-
*
|
|
4
|
+
* Reads the active theme and the mode engine state, and drives both axes —
|
|
5
|
+
* `setMode` (light / dark / system) and `setA11y` (grayscale / high-contrast /
|
|
6
|
+
* colorblind / null) — from within any component under the `ApollionProvider`.
|
|
6
7
|
*
|
|
7
8
|
* @throws when used outside an `ApollionProvider`.
|
|
8
9
|
*
|
|
9
10
|
* @example
|
|
10
11
|
* ```tsx
|
|
11
|
-
* const {
|
|
12
|
-
* <Button text={`Mode: ${
|
|
12
|
+
* const { resolvedMode, setMode, a11y, setA11y } = useApollionTheme();
|
|
13
|
+
* <Button text={`Mode: ${resolvedMode}`} onClick={() => setMode(resolvedMode === 'dark' ? 'light' : 'dark')} />
|
|
13
14
|
* ```
|
|
14
15
|
*/
|
|
15
16
|
export declare function useApollionTheme(): ApollionThemeContext;
|
|
17
|
+
/**
|
|
18
|
+
* Optional variant of {@link useApollionTheme} — `null` outside a provider.
|
|
19
|
+
* Used by `GlobalStyle` and the ground context, which must also render without one.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useApollionThemeOptional(): ApollionThemeContext | null;
|
|
16
22
|
export declare const ApollionProvider: React.FC<ApollionProviderInterface>;
|
|
@@ -7,13 +7,25 @@ import { ComponentTokensInput, ComponentTokensLayer } from '../Component';
|
|
|
7
7
|
import { DeepThemeInterface } from '../Deep';
|
|
8
8
|
import { DepthThemeInterface } from '../Depth';
|
|
9
9
|
import type { Dimension } from '../Dimension';
|
|
10
|
-
import { FontInput, FontThemeInterface } from '../Font';
|
|
10
|
+
import { FontInput, FontThemeInterface, TypeWeight } from '../Font';
|
|
11
11
|
import { FoundationLayer } from '../Foundation';
|
|
12
|
+
import { ContainerSizesInput, ContainerSizesInterface, LayoutInput, LayoutInterface } from '../Layout';
|
|
13
|
+
import type { A11yMode, ModePreference, PersistOption, ResolvedMode } from '../Mode/Mode.interface';
|
|
12
14
|
import { SemanticLayer } from '../Semantic';
|
|
13
15
|
import { SpacingInput, SpacingThemeInterface } from '../Spacing';
|
|
14
16
|
import type { SurfaceMode } from '../Surface';
|
|
15
17
|
export interface ThemeInputsInterface {
|
|
16
18
|
breakpoints?: BreakpointInput;
|
|
19
|
+
/**
|
|
20
|
+
* Container-size scale for the `cq` channel (ADR-025) — a separate scale
|
|
21
|
+
* from the viewport breakpoints (slot widths are not viewport widths).
|
|
22
|
+
*/
|
|
23
|
+
containerSizes?: ContainerSizesInput;
|
|
24
|
+
/**
|
|
25
|
+
* Page-layout constants (ADR-025 §2.3) — e.g. `pageMaxWidth`, the cap the
|
|
26
|
+
* `pageShell` prop applies (previously a magic `1366`).
|
|
27
|
+
*/
|
|
28
|
+
layout?: LayoutInput;
|
|
17
29
|
spacing?: SpacingInput;
|
|
18
30
|
colors?: ColorsInput;
|
|
19
31
|
font?: FontInput;
|
|
@@ -27,6 +39,13 @@ export interface ThemeInputsInterface {
|
|
|
27
39
|
* @see ../Dimension/Dimension.props.ts (DIMENSION_MULTIPLIERS calibration)
|
|
28
40
|
*/
|
|
29
41
|
dimension?: Dimension;
|
|
42
|
+
/**
|
|
43
|
+
* Brand-level origin of the weight ladder (`light` / `regular` /
|
|
44
|
+
* `stronger`). Resolves `font.fontWeight` from a table instead of asking
|
|
45
|
+
* the consumer for raw 300/400/… numbers; `regular` is the stock ladder.
|
|
46
|
+
* Per-call-site `fontWeight` still overrides.
|
|
47
|
+
*/
|
|
48
|
+
typeWeight?: TypeWeight;
|
|
30
49
|
/**
|
|
31
50
|
* Component token tier overrides (ADR-020). Deep-merged over the
|
|
32
51
|
* defaults — override a single size of a single component without
|
|
@@ -42,6 +61,10 @@ export interface ThemeInputsInterface {
|
|
|
42
61
|
}
|
|
43
62
|
export type Theme = {
|
|
44
63
|
border: BorderInput;
|
|
64
|
+
/** Container-size scale + `up()` prelude helper for the `cq` channel (ADR-025). */
|
|
65
|
+
containerSizes: ContainerSizesInterface;
|
|
66
|
+
/** Page-layout constants (`pageMaxWidth`, ADR-025 §2.3). */
|
|
67
|
+
layout: LayoutInterface;
|
|
45
68
|
font: FontThemeInterface;
|
|
46
69
|
colors: ColorsThemeInterface;
|
|
47
70
|
breakpoints: BreakpointsInterface;
|
|
@@ -82,6 +105,17 @@ export type Theme = {
|
|
|
82
105
|
* @see ../../docs/adr/ADR-020-component-token-tier.md
|
|
83
106
|
*/
|
|
84
107
|
component: ComponentTokensLayer;
|
|
108
|
+
/**
|
|
109
|
+
* Mode bridge (ADR-024): the literal light/dark pair behind a projected
|
|
110
|
+
* theme. Present on every theme the `ApollionProvider` hands out — the
|
|
111
|
+
* styled tree gets `light-dark()` pairs, `useApollionTheme().theme` gets the
|
|
112
|
+
* literal of the resolved mode, both tagged with the pair. Engine math
|
|
113
|
+
* uses `forModes(theme, fn)` to compute on both tables.
|
|
114
|
+
*/
|
|
115
|
+
modes?: {
|
|
116
|
+
light: Theme;
|
|
117
|
+
dark: Theme;
|
|
118
|
+
};
|
|
85
119
|
};
|
|
86
120
|
export type ThemeMode = 'light' | 'dark';
|
|
87
121
|
export interface ApollionProviderInterface {
|
|
@@ -135,23 +169,86 @@ export interface ApollionProviderInterface {
|
|
|
135
169
|
*/
|
|
136
170
|
colors?: ColorsInput;
|
|
137
171
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
172
|
+
* Mode preference — **controlled**. `'system'` follows `prefers-color-scheme`
|
|
173
|
+
* (and reacts to runtime changes); `'light'`/`'dark'` pin the mode. When set,
|
|
174
|
+
* the provider ignores its internal state: the parent is the source of truth
|
|
175
|
+
* and `setMode` only fires `onModeChange`. Added in 5.7.0 (ADR-024).
|
|
176
|
+
*/
|
|
177
|
+
mode?: ModePreference;
|
|
178
|
+
/**
|
|
179
|
+
* Initial mode preference — **uncontrolled**. Restored from `persist` when a
|
|
180
|
+
* value is stored. `'system'` = follow the OS.
|
|
181
|
+
*
|
|
182
|
+
* @default 'light' (`'system'` when the legacy `useSystemPreference` is on)
|
|
183
|
+
*/
|
|
184
|
+
defaultMode?: ModePreference;
|
|
185
|
+
/**
|
|
186
|
+
* SSR contract: the mode the server rendered with (e.g. from
|
|
187
|
+
* `readModeFromCookie`). The first client render uses the same value —
|
|
188
|
+
* hydration never mismatches — and a `'system'` preference is corrected
|
|
189
|
+
* from `matchMedia` before paint. Without it the client resolves the OS
|
|
190
|
+
* preference on the first render (fine for client-only apps).
|
|
191
|
+
*/
|
|
192
|
+
initialMode?: ResolvedMode;
|
|
193
|
+
/** Fires on every `setMode` with the new **preference** (`'system'` stays `'system'`). */
|
|
194
|
+
onModeChange?: (mode: ModePreference) => void;
|
|
195
|
+
/**
|
|
196
|
+
* Persist the preferences (`mode` under `storageKey`, `a11y` under
|
|
197
|
+
* `` `${storageKey}-a11y` ``): `'localStorage'`, `'cookie'` (readable by the
|
|
198
|
+
* server via `readModeFromCookie`), or a custom `ModeStorage` adapter.
|
|
199
|
+
* Pair with `<ApollionModeScript />` for a no-flash first paint.
|
|
141
200
|
*
|
|
142
201
|
* @default false
|
|
143
202
|
*/
|
|
203
|
+
persist?: PersistOption;
|
|
204
|
+
/**
|
|
205
|
+
* Storage key of the mode preference.
|
|
206
|
+
*
|
|
207
|
+
* @default 'apollion-mode'
|
|
208
|
+
*/
|
|
209
|
+
storageKey?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Mirror the resolved mode + a11y preset on `<html>` (`data-apollion-mode`,
|
|
212
|
+
* `data-apollion-a11y`, `style.colorScheme`) so native controls, scrollbars
|
|
213
|
+
* and `light-dark()` follow the engine. Removed on unmount.
|
|
214
|
+
*
|
|
215
|
+
* @default true
|
|
216
|
+
*/
|
|
217
|
+
syncDocument?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Attribute name written by `syncDocument` for the resolved mode.
|
|
220
|
+
*
|
|
221
|
+
* @default 'data-apollion-mode'
|
|
222
|
+
*/
|
|
223
|
+
attribute?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Accessibility preset — **controlled**. Orthogonal to the mode (D5): the
|
|
226
|
+
* preset remaps the brand/feedback seeds (`accessibilityPalettes`) and the
|
|
227
|
+
* engine still derives light + dark from the result, so `dark` +
|
|
228
|
+
* `colorblind` is a first-class combination. Only applies with `colors`.
|
|
229
|
+
*/
|
|
230
|
+
a11y?: A11yMode;
|
|
231
|
+
/**
|
|
232
|
+
* Initial accessibility preset — **uncontrolled**. Restored from `persist`.
|
|
233
|
+
*
|
|
234
|
+
* @default null
|
|
235
|
+
*/
|
|
236
|
+
defaultA11y?: A11yMode;
|
|
237
|
+
/** Fires on every `setA11y`. */
|
|
238
|
+
onA11yChange?: (a11y: A11yMode) => void;
|
|
239
|
+
/**
|
|
240
|
+
* @deprecated since 5.7.0 — use `defaultMode="system"` (uncontrolled) or
|
|
241
|
+
* `mode="system"` (controlled). Still honored: `true` ≡ `defaultMode: 'system'`.
|
|
242
|
+
*/
|
|
144
243
|
useSystemPreference?: boolean;
|
|
145
244
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* parent (e.g. a navbar toggle / `next-themes`). `toggleTheme` then only
|
|
149
|
-
* fires `onThemeModeChange`, without mutating local state.
|
|
245
|
+
* @deprecated since 5.7.0 — use `mode` (a controlled preference that also
|
|
246
|
+
* accepts `'system'`). Still honored as a controlled `'light' | 'dark'`.
|
|
150
247
|
*/
|
|
151
248
|
themeMode?: ThemeMode;
|
|
152
249
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
250
|
+
* @deprecated since 5.7.0 — use `onModeChange`. Still fired by `setMode`/
|
|
251
|
+
* `toggleTheme` with the **resolved** mode.
|
|
155
252
|
*/
|
|
156
253
|
onThemeModeChange?: (mode: ThemeMode) => void;
|
|
157
254
|
/**
|
|
@@ -188,11 +285,33 @@ export interface ApollionProviderInterface {
|
|
|
188
285
|
* @see ../Dimension/Dimension.interface.ts
|
|
189
286
|
*/
|
|
190
287
|
dimension?: Dimension;
|
|
288
|
+
/**
|
|
289
|
+
* Brand-level origin of the weight ladder (`light` / `regular` /
|
|
290
|
+
* `stronger`). Convenience prop equivalent to `createTheme({ typeWeight })`;
|
|
291
|
+
* like `dimension`, it only applies when the provider builds the theme.
|
|
292
|
+
*
|
|
293
|
+
* @default 'regular' (stock ladder)
|
|
294
|
+
*/
|
|
295
|
+
typeWeight?: TypeWeight;
|
|
191
296
|
children?: React.ReactNode;
|
|
192
297
|
}
|
|
193
298
|
export interface ApollionThemeContext {
|
|
194
299
|
theme: Theme;
|
|
300
|
+
/** Current mode preference (`'system'` when following the OS). */
|
|
301
|
+
mode: ModePreference;
|
|
302
|
+
/** The mode that renders (preference with `'system'` resolved). */
|
|
303
|
+
resolvedMode: ResolvedMode;
|
|
304
|
+
/** Sets the preference; persists it when `persist` is on. */
|
|
305
|
+
setMode: (mode: ModePreference) => void;
|
|
306
|
+
/** Current accessibility preset (`null` = stock palette). */
|
|
307
|
+
a11y: A11yMode;
|
|
308
|
+
/** Sets the preset; persists it when `persist` is on. */
|
|
309
|
+
setA11y: (a11y: A11yMode) => void;
|
|
310
|
+
/** `<html>` attribute carrying the resolved mode (`syncDocument`). */
|
|
311
|
+
attribute: string;
|
|
312
|
+
/** @deprecated since 5.7.0 — alias of `resolvedMode`. */
|
|
195
313
|
themeMode: ThemeMode;
|
|
314
|
+
/** @deprecated since 5.7.0 — use `setMode`. Flips the resolved mode (or sets the given one). */
|
|
196
315
|
toggleTheme: (mode?: ThemeMode) => void;
|
|
197
316
|
}
|
|
198
317
|
export type WithTheme<P> = P & {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Theme } from './ThemeProvider.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Mode bridge (APOLLION-DARK-MODE-ENGINE, ADR-024 — spike
|
|
4
|
+
* `2026-08-22-css-var-mode-bridge`): the styled tree receives ONE theme whose
|
|
5
|
+
* color leaves are `light-dark(<light>, <dark>)` pairs, so a mode flip is a
|
|
6
|
+
* `color-scheme` change on `<html>` — zero React re-render, identical class
|
|
7
|
+
* hashes in both modes, SSR-deterministic. Literal tables stay reachable as
|
|
8
|
+
* `theme.modes.{light,dark}` for engine math ({@link forModes}).
|
|
9
|
+
*/
|
|
10
|
+
/** The literal light/dark pair behind a projected theme. */
|
|
11
|
+
export interface ThemePair {
|
|
12
|
+
light: Theme;
|
|
13
|
+
dark: Theme;
|
|
14
|
+
}
|
|
15
|
+
/** `light-dark(a, b)` — collapsed to the literal when both sides agree (brand stops, runtime colors). */
|
|
16
|
+
export declare function lightDark(light: string, dark: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Runs color math on the literal tables of a projected theme and returns the
|
|
19
|
+
* `light-dark()` pair of the results. On a single (un-projected) theme it is
|
|
20
|
+
* just `fn(theme)`. Use it anywhere a literal is parsed at render time
|
|
21
|
+
* (`getContrastColor`, `readableColor`, `HextoRgb`) — those cannot parse a
|
|
22
|
+
* `light-dark()` string.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* color: forModes(theme, (t) => t.colors.getContrastColor(t.colors('primary')));
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function forModes<T extends string | undefined>(theme: Theme, fn: (literal: Theme) => T): T;
|
|
30
|
+
/**
|
|
31
|
+
* Projects a literal light/dark pair into the single theme the styled tree
|
|
32
|
+
* consumes. Only mode-varying color subtrees are paired (`colors`,
|
|
33
|
+
* `semantic.color`, `foundation.{bg,text,edge}`, `depth`); dimension-driven
|
|
34
|
+
* subtrees (spacing, font, border, component tokens) are shared by
|
|
35
|
+
* construction and keep the light references. Pure: a new object, inputs
|
|
36
|
+
* untouched; `theme.modes` carries the pair.
|
|
37
|
+
*/
|
|
38
|
+
export declare function projectModes(pair: ThemePair): Theme;
|
|
39
|
+
/** A single literal theme tagged with its pair — what `useApollionTheme().theme` hands to JS consumers. */
|
|
40
|
+
export declare function withModes(theme: Theme, pair: ThemePair): Theme;
|
|
41
|
+
/**
|
|
42
|
+
* Clears the bridge tag so an un-paired (single) theme carries an OWN
|
|
43
|
+
* `modes: undefined` key. Required because styled-components merges nested
|
|
44
|
+
* `<ThemeProvider>` themes shallowly (`{ ...outerTheme, ...innerTheme }`):
|
|
45
|
+
* a single-theme `ApollionProvider` nested under a mode-paired one would
|
|
46
|
+
* otherwise INHERIT the outer provider's `modes`, and {@link forModes}-based
|
|
47
|
+
* render math (Button/Link inks) would compute contrast against the outer
|
|
48
|
+
* seeds instead of the inner theme's — the "dark ink on a custom bg" bug
|
|
49
|
+
* (ADR-024). Always returns a fresh object with `modes` present-as-undefined
|
|
50
|
+
* so the shallow merge shadows any inherited pair.
|
|
51
|
+
*/
|
|
52
|
+
export declare function withoutModes(theme: Theme): Theme;
|