@aglyn/shared-ui-theme 1.20.3 → 1.22.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/shared-ui-theme",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/shared-data-types": "1.
|
|
29
|
-
"@aglyn/shared-util-tools": "1.
|
|
30
|
-
"@aglyn/shared-util-vendor": "1.
|
|
28
|
+
"@aglyn/shared-data-types": "1.22.0",
|
|
29
|
+
"@aglyn/shared-util-tools": "1.22.0",
|
|
30
|
+
"@aglyn/shared-util-vendor": "1.22.0",
|
|
31
31
|
"@emotion/cache": "^11.14.0",
|
|
32
32
|
"@emotion/react": "11.14.0",
|
|
33
|
-
"@swc/helpers": "0.5.
|
|
33
|
+
"@swc/helpers": "0.5.24",
|
|
34
34
|
"js-cookie": "^3.0.8",
|
|
35
35
|
"jss": "^10.10.0",
|
|
36
36
|
"jss-rtl": "^0.3.0",
|
package/src/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/shared/ui/theme/src/lib/constants.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum FontFamily {\n ADOBE_ARABIC = '\"Adobe Arabic\"',\n APPLE_COLOR_EMOJI = '\"Apple Color Emoji\"',\n APPLE_GOTHIC = 'AppleGothic',\n APPLE_SYMBOLS = '\"Apple Symbols\"',\n APPLE_SYSTEM = '-apple-system',\n ARIAL = 'Arial',\n ARIAL_BLACK = '\"Arial Black\"',\n ARIAL_HEBREW = '\"Arial Hebrew\"',\n ARIAL_NARRWOW = '\"Arial Narrow\"',\n ARIAL_UNICODE_MS = '\"Arial Unicode MS\"',\n BLINK_MAC_SYSTEM_FONT = 'BlinkMacSystemFont',\n CENTURY_GOTHIC = '\"Century Gothic\"',\n CHALKBOARD = 'Chalkboard',\n CHALKBOARD_SE = '\"Chalkboard SE\"',\n COURIER = 'Courier',\n COURIER_NEW = '\"Courier New\"',\n DAMASCUS = 'Damascus',\n DARLESTON = 'Darleston',\n ELIANTO = 'Elianto',\n FIRA_CODE = '\"Fira Code\"',\n FONT_AWESOME = 'FontAwesome',\n FONT_AWESOME_5_BRANDS = '\"Font Awesome 5 Brands\"',\n FONT_AWESOME_5_FREE = '\"Font Awesome 5 Free\"',\n FRUTIGER_NEUE_LT = '\"Frutiger Neue LT\"',\n FRUTIGER_NEUE_LT_PRO = '\"Frutiger Neue LT Pro\"',\n FUTURA = 'Futura',\n HELVETICA = 'Helvetica',\n HELVETICA_NEUE = '\"Helvetica Neue\"',\n MONOSPACED = 'Monospaced',\n MYRIAD_ARABIC = '\"Myriad Arabic\"',\n MYRIAD_HEBREW = '\"Myriad Hebrew\"',\n MYRIAD_PRO = '\"Myriad Pro\"',\n PT_MONO = '\"PT Mono\"',\n PT_SANS = '\"PT Sans\"',\n PT_SANS_CAPTION = '\"PT Sans Caption\"',\n PT_SANS_NARROW = '\"PT Sans Narrown\"',\n PT_SERIF = '\"PT Serif\"',\n PT_SERIF_CAPTION = '\"PT Serif Caption\"',\n RALEWAY = 'Raleway',\n ROBOTO = 'Roboto',\n ROBOTO_FLEX = '\"Roboto Flex\"',\n ROBOTO_CONDENSED = '\"Roboto Condensed\"',\n ROCKWELL = 'Rockwell',\n SANS_SERIF = 'sans-serif',\n SEGOE_UI = '\"Segoe UI\"',\n SEGOE_UI_EMOJI = '\"Segoe UI Emoji\"',\n SEGOE_UI_SYMBOL = '\"Segoe UI Symbol\"',\n SF_PRO = '\"SF Pro\"',\n SF_PRO_DISPLAY = '\"SF Pro Display\"',\n SF_PRO_TEXT = '\"SF Pro Text\"',\n SOURCE_SANS_PRO = '\"Source Sans Pro\"',\n TIMES_NEW_ROMAN = '\"Times New Roman\"',\n VERDANA = 'Verdana',\n}\n\n/** Roboto Flex's size-matched stand-in; declared in `util/roboto-flex.ts`. */\nexport const ROBOTO_FLEX_FALLBACK = '\"Roboto Flex Fallback\"'\n\nexport const buildFontFamilyList = (fontFamily = FontFamily.ROBOTO_FLEX) =>\n [\n fontFamily,\n FontFamily.APPLE_SYSTEM,\n FontFamily.BLINK_MAC_SYSTEM_FONT,\n FontFamily.SEGOE_UI,\n FontFamily.HELVETICA_NEUE,\n FontFamily.ARIAL,\n FontFamily.SANS_SERIF,\n FontFamily.APPLE_COLOR_EMOJI,\n FontFamily.SEGOE_UI_EMOJI,\n FontFamily.SEGOE_UI_SYMBOL,\n ].filter(Boolean)\n"],"names":["FontFamily","ROBOTO_FLEX_FALLBACK","buildFontFamilyList","fontFamily","filter","Boolean"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAO,IAAA,AAAKA
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/ui/theme/src/lib/constants.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum FontFamily {\n ADOBE_ARABIC = '\"Adobe Arabic\"',\n APPLE_COLOR_EMOJI = '\"Apple Color Emoji\"',\n APPLE_GOTHIC = 'AppleGothic',\n APPLE_SYMBOLS = '\"Apple Symbols\"',\n APPLE_SYSTEM = '-apple-system',\n ARIAL = 'Arial',\n ARIAL_BLACK = '\"Arial Black\"',\n ARIAL_HEBREW = '\"Arial Hebrew\"',\n ARIAL_NARRWOW = '\"Arial Narrow\"',\n ARIAL_UNICODE_MS = '\"Arial Unicode MS\"',\n BLINK_MAC_SYSTEM_FONT = 'BlinkMacSystemFont',\n CENTURY_GOTHIC = '\"Century Gothic\"',\n CHALKBOARD = 'Chalkboard',\n CHALKBOARD_SE = '\"Chalkboard SE\"',\n COURIER = 'Courier',\n COURIER_NEW = '\"Courier New\"',\n DAMASCUS = 'Damascus',\n DARLESTON = 'Darleston',\n ELIANTO = 'Elianto',\n FIRA_CODE = '\"Fira Code\"',\n FONT_AWESOME = 'FontAwesome',\n FONT_AWESOME_5_BRANDS = '\"Font Awesome 5 Brands\"',\n FONT_AWESOME_5_FREE = '\"Font Awesome 5 Free\"',\n FRUTIGER_NEUE_LT = '\"Frutiger Neue LT\"',\n FRUTIGER_NEUE_LT_PRO = '\"Frutiger Neue LT Pro\"',\n FUTURA = 'Futura',\n HELVETICA = 'Helvetica',\n HELVETICA_NEUE = '\"Helvetica Neue\"',\n MONOSPACED = 'Monospaced',\n MYRIAD_ARABIC = '\"Myriad Arabic\"',\n MYRIAD_HEBREW = '\"Myriad Hebrew\"',\n MYRIAD_PRO = '\"Myriad Pro\"',\n PT_MONO = '\"PT Mono\"',\n PT_SANS = '\"PT Sans\"',\n PT_SANS_CAPTION = '\"PT Sans Caption\"',\n PT_SANS_NARROW = '\"PT Sans Narrown\"',\n PT_SERIF = '\"PT Serif\"',\n PT_SERIF_CAPTION = '\"PT Serif Caption\"',\n RALEWAY = 'Raleway',\n ROBOTO = 'Roboto',\n ROBOTO_FLEX = '\"Roboto Flex\"',\n ROBOTO_CONDENSED = '\"Roboto Condensed\"',\n ROCKWELL = 'Rockwell',\n SANS_SERIF = 'sans-serif',\n SEGOE_UI = '\"Segoe UI\"',\n SEGOE_UI_EMOJI = '\"Segoe UI Emoji\"',\n SEGOE_UI_SYMBOL = '\"Segoe UI Symbol\"',\n SF_PRO = '\"SF Pro\"',\n SF_PRO_DISPLAY = '\"SF Pro Display\"',\n SF_PRO_TEXT = '\"SF Pro Text\"',\n SOURCE_SANS_PRO = '\"Source Sans Pro\"',\n TIMES_NEW_ROMAN = '\"Times New Roman\"',\n VERDANA = 'Verdana',\n}\n\n/** Roboto Flex's size-matched stand-in; declared in `util/roboto-flex.ts`. */\nexport const ROBOTO_FLEX_FALLBACK = '\"Roboto Flex Fallback\"'\n\nexport const buildFontFamilyList = (fontFamily = FontFamily.ROBOTO_FLEX) =>\n [\n fontFamily,\n FontFamily.APPLE_SYSTEM,\n FontFamily.BLINK_MAC_SYSTEM_FONT,\n FontFamily.SEGOE_UI,\n FontFamily.HELVETICA_NEUE,\n FontFamily.ARIAL,\n FontFamily.SANS_SERIF,\n FontFamily.APPLE_COLOR_EMOJI,\n FontFamily.SEGOE_UI_EMOJI,\n FontFamily.SEGOE_UI_SYMBOL,\n ].filter(Boolean)\n"],"names":["FontFamily","ROBOTO_FLEX_FALLBACK","buildFontFamilyList","fontFamily","filter","Boolean"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAO,IAAA,AAAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAsDX;AAED,4EAA4E,GAC5E,OAAO,MAAMC,uBAAuB,yBAAwB;AAE5D,OAAO,MAAMC,sBAAsB,CAACC,4BAAmC,GACrE;QACEA;;;;;;;;;;KAUD,CAACC,MAAM,CAACC,SAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/shared/ui/theme/src/lib/util/create-responsive-theme.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2024 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CssVarsThemeOptions,\n extendTheme as muiExtendTheme,\n} from '@mui/material/styles'\nimport {\n alpha,\n createTheme,\n darken,\n getContrastRatio,\n lighten,\n type PaletteColor,\n type PaletteOptions,\n responsiveFontSizes,\n type Theme,\n type ThemeOptions,\n} from '../../vendor/mui'\nimport {\n ACCENT_HOVER_FILL,\n ACCENT_HOVER_TEXT,\n hoverFillShade,\n inkOnFill,\n} from './accent-text'\nimport {\n accessibleShade,\n contrastRatio,\n meetsContrast,\n type ShadeDirection,\n} from './accessible-shade'\nimport { addPalettePathColorVariants } from './palette-path-colors'\n\nenum ContrastText {\n LIGHT = 'rgba(0, 0, 0, 0.87)',\n DARK = '#FFFFFF',\n}\n\ntype TonalOffset = number | { light?: number; dark?: number }\n\nfunction resolveTonalOffsets(tonalOffset: TonalOffset | undefined) {\n const offsetObj = typeof tonalOffset === 'number' ? undefined : tonalOffset\n const offsetNum = typeof tonalOffset === 'number' ? tonalOffset : undefined\n return {\n light: offsetObj?.light ?? offsetNum ?? 0.2,\n dark: offsetObj?.dark ?? (offsetNum ?? 0.2) * 1.5,\n }\n}\n\nfunction getContrastTextColor(background: string, contrastThreshold: number) {\n return getContrastRatio(background, ContrastText.DARK) >= (contrastThreshold ?? 3)\n ? ContrastText.DARK\n : ContrastText.LIGHT\n}\nfunction addShade(paletteColor: PaletteColor, shade: string, variant: string | undefined, tonalOffset: TonalOffset) {\n // Custom palette colors (tertiary, surface) are optional in host themes.\n if (!paletteColor?.main) return\n const { light: tonalOffsetLight, dark: tonalOffsetDark } =\n resolveTonalOffsets(tonalOffset)\n const indexed = paletteColor as unknown as Record<string, string>\n\n if (!indexed[shade]) {\n // eslint-disable-next-line no-prototype-builtins\n if (paletteColor.hasOwnProperty(variant)) {\n indexed[shade] = indexed[variant]\n } else if (shade === 'light') {\n paletteColor.light = lighten(paletteColor.main, tonalOffsetLight)\n } else if (shade === 'dark') {\n paletteColor.dark = darken(paletteColor.main, tonalOffsetDark)\n } else if (shade === 'contrastText') {\n paletteColor.contrastText = getContrastTextColor(\n paletteColor.main,\n tonalOffsetDark,\n )\n }\n }\n}\nfunction addShadeVariants(paletteColor: PaletteColor, tonalOffset?: TonalOffset) {\n addShade(paletteColor, 'dark', undefined, tonalOffset)\n addShade(paletteColor, 'light', undefined, tonalOffset)\n addShade(paletteColor, 'contrastText', undefined, tonalOffset)\n}\n\n/**\n * Colour families whose shades act as FOREGROUNDS — the `dark` slot carries\n * \"accessible accent text\" (AGL-1293 put the marketing brand blue there), so\n * its derivation must clear AA against the scheme's real backgrounds.\n *\n * `surface` is deliberately absent: its `light`/`dark` are surface STEPS\n * (panel fills, borders — see the designer's box styler), and walking them to\n * text contrast would repaint layout chrome, not fix any text.\n */\nconst FOREGROUND_COLOR_KEYS = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'error',\n 'warning',\n 'info',\n 'success',\n] as const\n\n/** `contrastText` IS a text pairing wherever it lives, so `surface` joins here. */\nconst CONTRAST_TEXT_COLOR_KEYS = [...FOREGROUND_COLOR_KEYS, 'surface'] as const\n\n/**\n * Post-`createTheme` pass making DERIVED shades scheme- and AA-aware\n * (AGL-1297). Fixed tonal offsets derive `dark = darken(main, 0.3)` no\n * matter the scheme, which (a) misses 4.5:1 on real off-white surfaces and\n * (b) points the wrong way entirely in dark mode, where the accessible\n * direction for a foreground shade is LIGHTER.\n *\n * Invariants:\n * - Only slots ABSENT from the caller's `palette` input are ever touched;\n * an explicitly authored shade passes through byte-identical (the\n * marketing host's hand-set `primary.dark` values depend on this).\n * - A derived value that already clears 4.5:1 against both\n * `background.default` and `background.paper` is kept byte-identical, so\n * themes that were fine yesterday do not shift.\n * - A failing derived `dark` is re-seeded at the tonal offset from `main`\n * in the scheme's foreground direction (darken in light, lighten in\n * dark), then walked in HSL lightness until it clears the bar.\n * - A light-scheme `light` is a background TINT — its ramp direction points\n * away from the text bar by design — so it keeps the tonal derivation.\n * In dark schemes `light` is foreground-capable and gets the same walk.\n * - Derived `contrastText` keeps the threshold choice unless that pairing\n * is below 4.5:1 against `main`; then it walks toward the pole with more\n * contrast headroom.\n */\nfunction ensureAccessibleShades(\n theme: Theme,\n inputPalette: PaletteOptions | undefined,\n) {\n const { palette } = theme\n const backgrounds = [\n palette.background?.default,\n palette.background?.paper,\n ].filter((background): background is string => typeof background === 'string')\n if (!backgrounds.length) return\n const mode: 'light' | 'dark' = palette.mode === 'dark' ? 'dark' : 'light'\n const foregroundDirection: ShadeDirection =\n mode === 'dark' ? 'lighten' : 'darken'\n const tonalOffsetDark = resolveTonalOffsets(palette.tonalOffset).dark\n const providedColors = inputPalette as\n | Record<string, unknown>\n | undefined\n\n for (const key of CONTRAST_TEXT_COLOR_KEYS) {\n const color = (palette as unknown as Record<string, PaletteColor>)[key]\n if (!color || typeof color.main !== 'string') continue\n const provided = providedColors?.[key]\n // A ColorPartial ramp (`{ 50…900 }`) is an author-owned scale — MUI maps\n // its shades straight across, so nothing in it counts as derived.\n if (provided && typeof provided === 'object' && !('main' in provided)) {\n continue\n }\n // Read with brackets, not dots: these keys come from an index signature,\n // and `json-editor` compiles this file under\n // `noPropertyAccessFromIndexSignature` (paths resolve to source, so a\n // consumer's flags check its dependencies). Dot access reds that build\n // while this project's own stays green — AGL-1323.\n const explicit = (provided ?? {}) as Record<string, unknown>\n const isForeground = (FOREGROUND_COLOR_KEYS as readonly string[]).includes(\n key,\n )\n\n try {\n if (\n isForeground &&\n !explicit['dark'] &&\n typeof color.dark === 'string' &&\n !meetsContrast(color.dark, backgrounds)\n ) {\n const seed =\n mode === 'dark' ? lighten(color.main, tonalOffsetDark) : color.dark\n color.dark = accessibleShade(seed, backgrounds, foregroundDirection)\n }\n if (\n isForeground &&\n mode === 'dark' &&\n !explicit['light'] &&\n typeof color.light === 'string' &&\n !meetsContrast(color.light, backgrounds)\n ) {\n color.light = accessibleShade(color.light, backgrounds, 'lighten')\n }\n if (\n !explicit['contrastText'] &&\n typeof color.contrastText === 'string' &&\n !meetsContrast(color.contrastText, [color.main])\n ) {\n const textDirection: ShadeDirection =\n contrastRatio('#fff', color.main) >= contrastRatio('#000', color.main)\n ? 'lighten'\n : 'darken'\n color.contrastText = accessibleShade(\n color.contrastText,\n [color.main],\n textDirection,\n )\n }\n } catch {\n // Unparseable colour (CSS variable, color-mix()): leave the derived\n // value alone rather than failing theme creation.\n }\n }\n}\n\n/**\n * Post-`createTheme` pass giving every palette color a defined HOVER\n * (AGL-3465): `palette[color].hover`, the fill ({@link ACCENT_HOVER_FILL}),\n * and `palette[color].hoverText`, the label ({@link ACCENT_HOVER_TEXT}).\n * The `MuiButton` and `MuiFab` overrides read both.\n *\n * - **The fill.** MUI fills a hovered contained Button and Fab with\n * `palette[color].dark`, which this theme uses as the accent-as-TEXT\n * shade: lighter than `main` in a dark scheme, so a white label on it\n * sinks to ~2:1. Every entry with a string `main` and `contrastText` gets\n * one — the built-in accents, `tertiary`, `surface`, and any custom color\n * a palette adds — so a color a component can be asked to wear always has\n * a hover that carries its own ink at AA.\n * - **The label.** A hovered text or outlined Button keeps `dark` as its\n * label and lays `main` at `action.hoverOpacity` under it. Foreground\n * colors get `dark` walked in the scheme's foreground direction until it\n * clears AA on that wash over both `background.default` and\n * `background.paper`; it stays `dark`, byte-identical, wherever `dark`\n * already does. `surface` gets none: its `dark` is a surface step, not\n * text, so it has no label to protect.\n *\n * A slot the caller authored passes through untouched.\n */\nfunction ensureHoverShades(\n theme: Theme,\n inputPalette: PaletteOptions | undefined,\n) {\n const palette = theme.palette as unknown as Record<string, unknown>\n const providedColors = inputPalette as Record<string, unknown> | undefined\n const tonalOffsetDark = resolveTonalOffsets(theme.palette.tonalOffset).dark\n const foregroundDirection: ShadeDirection =\n theme.palette.mode === 'dark' ? 'lighten' : 'darken'\n const backgrounds = [\n theme.palette.background?.default,\n theme.palette.background?.paper,\n ].filter((background): background is string => typeof background === 'string')\n const hoverOpacity = theme.palette.action?.hoverOpacity ?? 0\n\n for (const [key, value] of Object.entries(palette)) {\n if (!value || typeof value !== 'object') continue\n const color = value as Record<string, unknown>\n const { main, dark, contrastText } = color\n if (typeof main !== 'string' || typeof contrastText !== 'string') continue\n const provided = (providedColors?.[key] ?? {}) as Record<string, unknown>\n try {\n if (typeof provided[ACCENT_HOVER_FILL] !== 'string') {\n color[ACCENT_HOVER_FILL] = hoverFillShade(\n {\n main,\n contrastText,\n dark: typeof dark === 'string' ? dark : undefined,\n },\n tonalOffsetDark,\n )\n }\n if (\n typeof provided[ACCENT_HOVER_TEXT] !== 'string' &&\n (FOREGROUND_COLOR_KEYS as readonly string[]).includes(key) &&\n typeof dark === 'string' &&\n backgrounds.length\n ) {\n const wash = alpha(main, hoverOpacity)\n color[ACCENT_HOVER_TEXT] = accessibleShade(\n dark,\n backgrounds.map((background) => inkOnFill(wash, background)),\n foregroundDirection,\n )\n }\n } catch {\n // Unparseable colour (CSS variable, color-mix()): no slot, so the\n // component overrides fall back to MUI's own hover for this color.\n }\n }\n}\n\n/**\n * MUI's own default `responsiveFontSizes` variant list, spelled out because\n * passing `variants` replaces it rather than extending it.\n */\nconst RAMPED_MUI_VARIANTS = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n 'caption',\n 'button',\n 'overline',\n] as const\n\n/**\n * The brand's custom display rungs, which MUI cannot know about.\n *\n * Only variants whose size genuinely needs to shrink belong here. `lede`,\n * `bodyCompact` and `micro` are body-scale text that reads the same at every\n * width and are deliberately absent.\n */\nconst RAMPED_DISPLAY_VARIANTS = ['displayXl'] as const\n\nexport type CreateResponsiveThemeOptions = {\n themeOptions?: ThemeOptions\n responsiveFontSizesOptions?: Parameters<typeof responsiveFontSizes>[1]\n}\n\n/**\n * START EXAMPLE – OVERRIDE DEFAULT PROPS ↓\n * ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄\n * ```typescript\n * const theme = createMuiTheme({\n * props: {\n * // Name of the component ⚛️\n * MuiButtonBase: {\n * // The default props to change\n * disableRipple: true, // No more ripple, on the whole application 💣!\n * },\n * },\n * })\n * ```\n * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n * END EXAMPLE – OVERRIDE DEFAULT PROPS ↑\n *\n * START EXAMPLE – OVERRIDE DEFAULT STYLES ↓\n * ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄\n * ```typescript\n * const theme = createMuiTheme({\n * overrides: {\n * // Style sheet name ⚛️\n * MuiButton: {\n * // Name of the rule\n * text: {\n * // Some CSS\n * color: 'white',\n * },\n * },\n * MuiCssBaseline: {\n * '@global': {\n * html: {\n * WebkitFontSmoothing: 'auto',\n * },\n * },\n * },\n * },\n * })\n * ```\n * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n * END EXAMPLE – OVERRIDE DEFAULT STYLES ↑\n *\n * @param {ThemeOptions} options\n * @returns {Theme}\n */\nexport function createResponsiveTheme(\n options: CreateResponsiveThemeOptions,\n): Theme {\n const { themeOptions, responsiveFontSizesOptions } = options\n let theme = createTheme(themeOptions)\n addShadeVariants(theme.palette.tertiary, theme.palette.tonalOffset)\n addShadeVariants(theme.palette.surface, theme.palette.tonalOffset)\n // `tint` is deliberately absent from BOTH shade passes (AGL-1244). It is a\n // group of string leaves rather than a PaletteColor — no `main` to ramp\n // from, no `contrastText` to pair — so `addShadeVariants` would no-op and\n // `ensureAccessibleShades` (which keys off `CONTRAST_TEXT_COLOR_KEYS`) never\n // sees it. Both correct: a 90%-desaturated wash is authored, not derived,\n // and walking it to a text-contrast bar would repaint the fill.\n // Scheme- and AA-aware repair of DERIVED shades only (AGL-1297); explicit\n // palette values pass through byte-identical.\n ensureAccessibleShades(theme, themeOptions?.palette)\n // After the shade repair, because both hover slots start from `dark` and\n // have to see the value that ships.\n ensureHoverShades(theme, themeOptions?.palette)\n // Last of the palette passes, so the shades they add are paths too.\n addPalettePathColorVariants(theme)\n\n theme = responsiveFontSizes(theme, {\n // Override to include `xs` and `xl` - default: ['sm', 'md', 'lg']\n breakpoints: ['xs', 'sm', 'md', 'lg', 'xl'],\n // MUI only ramps the variants it ships, so a CUSTOM display variant would\n // keep its desktop size on a phone — `displayXl` at 72px on a 375px\n // screen. Passing `variants` REPLACES MUI's default list, so the defaults\n // are spelled out here and ours appended; drop one and that variant\n // silently stops scaling.\n variants: [...RAMPED_MUI_VARIANTS, ...RAMPED_DISPLAY_VARIANTS],\n ...responsiveFontSizesOptions,\n })\n\n return theme\n}\n\nexport function createResponsiveCssVarTheme(\n light: Theme,\n dark: Theme,\n options?: CssVarsThemeOptions,\n) {\n const { palette: lightPalette, ...lightTheme } = light\n const { palette: darkPalette } = dark\n\n return muiExtendTheme({\n ...lightTheme,\n // Allow setMode() to work by driving the color scheme via a CSS class on\n // <html> instead of the OS-level @media query (the default 'media' selector\n // makes setMode() a no-op because media queries can't be overridden in JS).\n colorSchemeSelector: 'class',\n ...options,\n colorSchemes: {\n ...options?.colorSchemes,\n light: { palette: lightPalette, ...((options?.colorSchemes?.light ?? {}) as object) },\n dark: { palette: darkPalette, ...((options?.colorSchemes?.dark ?? {}) as object) },\n },\n })\n}\n\nexport default createResponsiveTheme\n"],"names":["extendTheme","muiExtendTheme","alpha","createTheme","darken","getContrastRatio","lighten","responsiveFontSizes","ACCENT_HOVER_FILL","ACCENT_HOVER_TEXT","hoverFillShade","inkOnFill","accessibleShade","contrastRatio","meetsContrast","addPalettePathColorVariants","ContrastText","resolveTonalOffsets","tonalOffset","offsetObj","undefined","offsetNum","light","dark","getContrastTextColor","background","contrastThreshold","addShade","paletteColor","shade","variant","main","tonalOffsetLight","tonalOffsetDark","indexed","hasOwnProperty","contrastText","addShadeVariants","FOREGROUND_COLOR_KEYS","CONTRAST_TEXT_COLOR_KEYS","ensureAccessibleShades","theme","inputPalette","palette","backgrounds","default","paper","filter","length","mode","foregroundDirection","providedColors","key","color","provided","explicit","isForeground","includes","seed","textDirection","ensureHoverShades","hoverOpacity","action","value","Object","entries","wash","map","RAMPED_MUI_VARIANTS","RAMPED_DISPLAY_VARIANTS","createResponsiveTheme","options","themeOptions","responsiveFontSizesOptions","tertiary","surface","breakpoints","variants","createResponsiveCssVarTheme","lightPalette","lightTheme","darkPalette","colorSchemeSelector","colorSchemes"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAEEA,eAAeC,cAAc,QACxB,uBAAsB;AAC7B,SACEC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,gBAAgB,EAChBC,OAAO,EAGPC,mBAAmB,QAGd,sBAAkB;AACzB,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,cAAc,EACdC,SAAS,QACJ,mBAAe;AACtB,SACEC,eAAe,EACfC,aAAa,EACbC,aAAa,QAER,wBAAoB;AAC3B,SAASC,2BAA2B,QAAQ,2BAAuB;AAEnE,IAAA,AAAKC,sCAAAA;;;WAAAA;EAAAA;AAOL,SAASC,oBAAoBC,WAAoC;QAItDC;IAHT,MAAMA,YAAY,OAAOD,gBAAgB,WAAWE,YAAYF;IAChE,MAAMG,YAAY,OAAOH,gBAAgB,WAAWA,cAAcE;IAClE,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hD,IAAI,oBAAI,CAAC;;;AAGzE;AAEA,eAAe+C,sBAAqB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/ui/theme/src/lib/util/create-responsive-theme.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2024 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CssVarsThemeOptions,\n extendTheme as muiExtendTheme,\n} from '@mui/material/styles'\nimport {\n alpha,\n createTheme,\n darken,\n getContrastRatio,\n lighten,\n type PaletteColor,\n type PaletteOptions,\n responsiveFontSizes,\n type Theme,\n type ThemeOptions,\n} from '../../vendor/mui'\nimport {\n ACCENT_HOVER_FILL,\n ACCENT_HOVER_TEXT,\n hoverFillShade,\n inkOnFill,\n} from './accent-text'\nimport {\n accessibleShade,\n contrastRatio,\n meetsContrast,\n type ShadeDirection,\n} from './accessible-shade'\nimport { addPalettePathColorVariants } from './palette-path-colors'\n\nenum ContrastText {\n LIGHT = 'rgba(0, 0, 0, 0.87)',\n DARK = '#FFFFFF',\n}\n\ntype TonalOffset = number | { light?: number; dark?: number }\n\nfunction resolveTonalOffsets(tonalOffset: TonalOffset | undefined) {\n const offsetObj = typeof tonalOffset === 'number' ? undefined : tonalOffset\n const offsetNum = typeof tonalOffset === 'number' ? tonalOffset : undefined\n return {\n light: offsetObj?.light ?? offsetNum ?? 0.2,\n dark: offsetObj?.dark ?? (offsetNum ?? 0.2) * 1.5,\n }\n}\n\nfunction getContrastTextColor(background: string, contrastThreshold: number) {\n return getContrastRatio(background, ContrastText.DARK) >= (contrastThreshold ?? 3)\n ? ContrastText.DARK\n : ContrastText.LIGHT\n}\nfunction addShade(paletteColor: PaletteColor, shade: string, variant: string | undefined, tonalOffset: TonalOffset) {\n // Custom palette colors (tertiary, surface) are optional in host themes.\n if (!paletteColor?.main) return\n const { light: tonalOffsetLight, dark: tonalOffsetDark } =\n resolveTonalOffsets(tonalOffset)\n const indexed = paletteColor as unknown as Record<string, string>\n\n if (!indexed[shade]) {\n // eslint-disable-next-line no-prototype-builtins\n if (paletteColor.hasOwnProperty(variant)) {\n indexed[shade] = indexed[variant]\n } else if (shade === 'light') {\n paletteColor.light = lighten(paletteColor.main, tonalOffsetLight)\n } else if (shade === 'dark') {\n paletteColor.dark = darken(paletteColor.main, tonalOffsetDark)\n } else if (shade === 'contrastText') {\n paletteColor.contrastText = getContrastTextColor(\n paletteColor.main,\n tonalOffsetDark,\n )\n }\n }\n}\nfunction addShadeVariants(paletteColor: PaletteColor, tonalOffset?: TonalOffset) {\n addShade(paletteColor, 'dark', undefined, tonalOffset)\n addShade(paletteColor, 'light', undefined, tonalOffset)\n addShade(paletteColor, 'contrastText', undefined, tonalOffset)\n}\n\n/**\n * Colour families whose shades act as FOREGROUNDS — the `dark` slot carries\n * \"accessible accent text\" (AGL-1293 put the marketing brand blue there), so\n * its derivation must clear AA against the scheme's real backgrounds.\n *\n * `surface` is deliberately absent: its `light`/`dark` are surface STEPS\n * (panel fills, borders — see the designer's box styler), and walking them to\n * text contrast would repaint layout chrome, not fix any text.\n */\nconst FOREGROUND_COLOR_KEYS = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'error',\n 'warning',\n 'info',\n 'success',\n] as const\n\n/** `contrastText` IS a text pairing wherever it lives, so `surface` joins here. */\nconst CONTRAST_TEXT_COLOR_KEYS = [...FOREGROUND_COLOR_KEYS, 'surface'] as const\n\n/**\n * Post-`createTheme` pass making DERIVED shades scheme- and AA-aware\n * (AGL-1297). Fixed tonal offsets derive `dark = darken(main, 0.3)` no\n * matter the scheme, which (a) misses 4.5:1 on real off-white surfaces and\n * (b) points the wrong way entirely in dark mode, where the accessible\n * direction for a foreground shade is LIGHTER.\n *\n * Invariants:\n * - Only slots ABSENT from the caller's `palette` input are ever touched;\n * an explicitly authored shade passes through byte-identical (the\n * marketing host's hand-set `primary.dark` values depend on this).\n * - A derived value that already clears 4.5:1 against both\n * `background.default` and `background.paper` is kept byte-identical, so\n * themes that were fine yesterday do not shift.\n * - A failing derived `dark` is re-seeded at the tonal offset from `main`\n * in the scheme's foreground direction (darken in light, lighten in\n * dark), then walked in HSL lightness until it clears the bar.\n * - A light-scheme `light` is a background TINT — its ramp direction points\n * away from the text bar by design — so it keeps the tonal derivation.\n * In dark schemes `light` is foreground-capable and gets the same walk.\n * - Derived `contrastText` keeps the threshold choice unless that pairing\n * is below 4.5:1 against `main`; then it walks toward the pole with more\n * contrast headroom.\n */\nfunction ensureAccessibleShades(\n theme: Theme,\n inputPalette: PaletteOptions | undefined,\n) {\n const { palette } = theme\n const backgrounds = [\n palette.background?.default,\n palette.background?.paper,\n ].filter((background): background is string => typeof background === 'string')\n if (!backgrounds.length) return\n const mode: 'light' | 'dark' = palette.mode === 'dark' ? 'dark' : 'light'\n const foregroundDirection: ShadeDirection =\n mode === 'dark' ? 'lighten' : 'darken'\n const tonalOffsetDark = resolveTonalOffsets(palette.tonalOffset).dark\n const providedColors = inputPalette as\n | Record<string, unknown>\n | undefined\n\n for (const key of CONTRAST_TEXT_COLOR_KEYS) {\n const color = (palette as unknown as Record<string, PaletteColor>)[key]\n if (!color || typeof color.main !== 'string') continue\n const provided = providedColors?.[key]\n // A ColorPartial ramp (`{ 50…900 }`) is an author-owned scale — MUI maps\n // its shades straight across, so nothing in it counts as derived.\n if (provided && typeof provided === 'object' && !('main' in provided)) {\n continue\n }\n // Read with brackets, not dots: these keys come from an index signature,\n // and `json-editor` compiles this file under\n // `noPropertyAccessFromIndexSignature` (paths resolve to source, so a\n // consumer's flags check its dependencies). Dot access reds that build\n // while this project's own stays green — AGL-1323.\n const explicit = (provided ?? {}) as Record<string, unknown>\n const isForeground = (FOREGROUND_COLOR_KEYS as readonly string[]).includes(\n key,\n )\n\n try {\n if (\n isForeground &&\n !explicit['dark'] &&\n typeof color.dark === 'string' &&\n !meetsContrast(color.dark, backgrounds)\n ) {\n const seed =\n mode === 'dark' ? lighten(color.main, tonalOffsetDark) : color.dark\n color.dark = accessibleShade(seed, backgrounds, foregroundDirection)\n }\n if (\n isForeground &&\n mode === 'dark' &&\n !explicit['light'] &&\n typeof color.light === 'string' &&\n !meetsContrast(color.light, backgrounds)\n ) {\n color.light = accessibleShade(color.light, backgrounds, 'lighten')\n }\n if (\n !explicit['contrastText'] &&\n typeof color.contrastText === 'string' &&\n !meetsContrast(color.contrastText, [color.main])\n ) {\n const textDirection: ShadeDirection =\n contrastRatio('#fff', color.main) >= contrastRatio('#000', color.main)\n ? 'lighten'\n : 'darken'\n color.contrastText = accessibleShade(\n color.contrastText,\n [color.main],\n textDirection,\n )\n }\n } catch {\n // Unparseable colour (CSS variable, color-mix()): leave the derived\n // value alone rather than failing theme creation.\n }\n }\n}\n\n/**\n * Post-`createTheme` pass giving every palette color a defined HOVER\n * (AGL-3465): `palette[color].hover`, the fill ({@link ACCENT_HOVER_FILL}),\n * and `palette[color].hoverText`, the label ({@link ACCENT_HOVER_TEXT}).\n * The `MuiButton` and `MuiFab` overrides read both.\n *\n * - **The fill.** MUI fills a hovered contained Button and Fab with\n * `palette[color].dark`, which this theme uses as the accent-as-TEXT\n * shade: lighter than `main` in a dark scheme, so a white label on it\n * sinks to ~2:1. Every entry with a string `main` and `contrastText` gets\n * one — the built-in accents, `tertiary`, `surface`, and any custom color\n * a palette adds — so a color a component can be asked to wear always has\n * a hover that carries its own ink at AA.\n * - **The label.** A hovered text or outlined Button keeps `dark` as its\n * label and lays `main` at `action.hoverOpacity` under it. Foreground\n * colors get `dark` walked in the scheme's foreground direction until it\n * clears AA on that wash over both `background.default` and\n * `background.paper`; it stays `dark`, byte-identical, wherever `dark`\n * already does. `surface` gets none: its `dark` is a surface step, not\n * text, so it has no label to protect.\n *\n * A slot the caller authored passes through untouched.\n */\nfunction ensureHoverShades(\n theme: Theme,\n inputPalette: PaletteOptions | undefined,\n) {\n const palette = theme.palette as unknown as Record<string, unknown>\n const providedColors = inputPalette as Record<string, unknown> | undefined\n const tonalOffsetDark = resolveTonalOffsets(theme.palette.tonalOffset).dark\n const foregroundDirection: ShadeDirection =\n theme.palette.mode === 'dark' ? 'lighten' : 'darken'\n const backgrounds = [\n theme.palette.background?.default,\n theme.palette.background?.paper,\n ].filter((background): background is string => typeof background === 'string')\n const hoverOpacity = theme.palette.action?.hoverOpacity ?? 0\n\n for (const [key, value] of Object.entries(palette)) {\n if (!value || typeof value !== 'object') continue\n const color = value as Record<string, unknown>\n const { main, dark, contrastText } = color\n if (typeof main !== 'string' || typeof contrastText !== 'string') continue\n const provided = (providedColors?.[key] ?? {}) as Record<string, unknown>\n try {\n if (typeof provided[ACCENT_HOVER_FILL] !== 'string') {\n color[ACCENT_HOVER_FILL] = hoverFillShade(\n {\n main,\n contrastText,\n dark: typeof dark === 'string' ? dark : undefined,\n },\n tonalOffsetDark,\n )\n }\n if (\n typeof provided[ACCENT_HOVER_TEXT] !== 'string' &&\n (FOREGROUND_COLOR_KEYS as readonly string[]).includes(key) &&\n typeof dark === 'string' &&\n backgrounds.length\n ) {\n const wash = alpha(main, hoverOpacity)\n color[ACCENT_HOVER_TEXT] = accessibleShade(\n dark,\n backgrounds.map((background) => inkOnFill(wash, background)),\n foregroundDirection,\n )\n }\n } catch {\n // Unparseable colour (CSS variable, color-mix()): no slot, so the\n // component overrides fall back to MUI's own hover for this color.\n }\n }\n}\n\n/**\n * MUI's own default `responsiveFontSizes` variant list, spelled out because\n * passing `variants` replaces it rather than extending it.\n */\nconst RAMPED_MUI_VARIANTS = [\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'subtitle1',\n 'subtitle2',\n 'body1',\n 'body2',\n 'caption',\n 'button',\n 'overline',\n] as const\n\n/**\n * The brand's custom display rungs, which MUI cannot know about.\n *\n * Only variants whose size genuinely needs to shrink belong here. `lede`,\n * `bodyCompact` and `micro` are body-scale text that reads the same at every\n * width and are deliberately absent.\n */\nconst RAMPED_DISPLAY_VARIANTS = ['displayXl'] as const\n\nexport type CreateResponsiveThemeOptions = {\n themeOptions?: ThemeOptions\n responsiveFontSizesOptions?: Parameters<typeof responsiveFontSizes>[1]\n}\n\n/**\n * START EXAMPLE – OVERRIDE DEFAULT PROPS ↓\n * ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄\n * ```typescript\n * const theme = createMuiTheme({\n * props: {\n * // Name of the component ⚛️\n * MuiButtonBase: {\n * // The default props to change\n * disableRipple: true, // No more ripple, on the whole application 💣!\n * },\n * },\n * })\n * ```\n * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n * END EXAMPLE – OVERRIDE DEFAULT PROPS ↑\n *\n * START EXAMPLE – OVERRIDE DEFAULT STYLES ↓\n * ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄\n * ```typescript\n * const theme = createMuiTheme({\n * overrides: {\n * // Style sheet name ⚛️\n * MuiButton: {\n * // Name of the rule\n * text: {\n * // Some CSS\n * color: 'white',\n * },\n * },\n * MuiCssBaseline: {\n * '@global': {\n * html: {\n * WebkitFontSmoothing: 'auto',\n * },\n * },\n * },\n * },\n * })\n * ```\n * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n * END EXAMPLE – OVERRIDE DEFAULT STYLES ↑\n *\n * @param {ThemeOptions} options\n * @returns {Theme}\n */\nexport function createResponsiveTheme(\n options: CreateResponsiveThemeOptions,\n): Theme {\n const { themeOptions, responsiveFontSizesOptions } = options\n let theme = createTheme(themeOptions)\n addShadeVariants(theme.palette.tertiary, theme.palette.tonalOffset)\n addShadeVariants(theme.palette.surface, theme.palette.tonalOffset)\n // `tint` is deliberately absent from BOTH shade passes (AGL-1244). It is a\n // group of string leaves rather than a PaletteColor — no `main` to ramp\n // from, no `contrastText` to pair — so `addShadeVariants` would no-op and\n // `ensureAccessibleShades` (which keys off `CONTRAST_TEXT_COLOR_KEYS`) never\n // sees it. Both correct: a 90%-desaturated wash is authored, not derived,\n // and walking it to a text-contrast bar would repaint the fill.\n // Scheme- and AA-aware repair of DERIVED shades only (AGL-1297); explicit\n // palette values pass through byte-identical.\n ensureAccessibleShades(theme, themeOptions?.palette)\n // After the shade repair, because both hover slots start from `dark` and\n // have to see the value that ships.\n ensureHoverShades(theme, themeOptions?.palette)\n // Last of the palette passes, so the shades they add are paths too.\n addPalettePathColorVariants(theme)\n\n theme = responsiveFontSizes(theme, {\n // Override to include `xs` and `xl` - default: ['sm', 'md', 'lg']\n breakpoints: ['xs', 'sm', 'md', 'lg', 'xl'],\n // MUI only ramps the variants it ships, so a CUSTOM display variant would\n // keep its desktop size on a phone — `displayXl` at 72px on a 375px\n // screen. Passing `variants` REPLACES MUI's default list, so the defaults\n // are spelled out here and ours appended; drop one and that variant\n // silently stops scaling.\n variants: [...RAMPED_MUI_VARIANTS, ...RAMPED_DISPLAY_VARIANTS],\n ...responsiveFontSizesOptions,\n })\n\n return theme\n}\n\nexport function createResponsiveCssVarTheme(\n light: Theme,\n dark: Theme,\n options?: CssVarsThemeOptions,\n) {\n const { palette: lightPalette, ...lightTheme } = light\n const { palette: darkPalette } = dark\n\n return muiExtendTheme({\n ...lightTheme,\n // Allow setMode() to work by driving the color scheme via a CSS class on\n // <html> instead of the OS-level @media query (the default 'media' selector\n // makes setMode() a no-op because media queries can't be overridden in JS).\n colorSchemeSelector: 'class',\n ...options,\n colorSchemes: {\n ...options?.colorSchemes,\n light: { palette: lightPalette, ...((options?.colorSchemes?.light ?? {}) as object) },\n dark: { palette: darkPalette, ...((options?.colorSchemes?.dark ?? {}) as object) },\n },\n })\n}\n\nexport default createResponsiveTheme\n"],"names":["extendTheme","muiExtendTheme","alpha","createTheme","darken","getContrastRatio","lighten","responsiveFontSizes","ACCENT_HOVER_FILL","ACCENT_HOVER_TEXT","hoverFillShade","inkOnFill","accessibleShade","contrastRatio","meetsContrast","addPalettePathColorVariants","ContrastText","resolveTonalOffsets","tonalOffset","offsetObj","undefined","offsetNum","light","dark","getContrastTextColor","background","contrastThreshold","addShade","paletteColor","shade","variant","main","tonalOffsetLight","tonalOffsetDark","indexed","hasOwnProperty","contrastText","addShadeVariants","FOREGROUND_COLOR_KEYS","CONTRAST_TEXT_COLOR_KEYS","ensureAccessibleShades","theme","inputPalette","palette","backgrounds","default","paper","filter","length","mode","foregroundDirection","providedColors","key","color","provided","explicit","isForeground","includes","seed","textDirection","ensureHoverShades","hoverOpacity","action","value","Object","entries","wash","map","RAMPED_MUI_VARIANTS","RAMPED_DISPLAY_VARIANTS","createResponsiveTheme","options","themeOptions","responsiveFontSizesOptions","tertiary","surface","breakpoints","variants","createResponsiveCssVarTheme","lightPalette","lightTheme","darkPalette","colorSchemeSelector","colorSchemes"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAEEA,eAAeC,cAAc,QACxB,uBAAsB;AAC7B,SACEC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,gBAAgB,EAChBC,OAAO,EAGPC,mBAAmB,QAGd,sBAAkB;AACzB,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,cAAc,EACdC,SAAS,QACJ,mBAAe;AACtB,SACEC,eAAe,EACfC,aAAa,EACbC,aAAa,QAER,wBAAoB;AAC3B,SAASC,2BAA2B,QAAQ,2BAAuB;AAEnE,IAAA,AAAKC;;;;EAAAA;AAOL,SAASC,oBAAoBC,WAAoC;QAItDC;IAHT,MAAMA,YAAY,OAAOD,gBAAgB,WAAWE,YAAYF;IAChE,MAAMG,YAAY,O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