@aglyn/shared-ui-theme 1.0.0-beta.221 → 1.0.0-beta.223
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 +4 -3
- package/package.json +4 -4
- package/src/lib/console.theme.js +40 -1
- package/src/lib/console.theme.js.map +1 -1
- package/src/lib/util/accent-text.d.ts +72 -1
- package/src/lib/util/accent-text.js +121 -4
- package/src/lib/util/accent-text.js.map +1 -1
- package/src/lib/util/create-responsive-theme.js +64 -1
- package/src/lib/util/create-responsive-theme.js.map +1 -1
- package/src/lib/util/self-hosted-fonts.d.ts +96 -0
- package/src/lib/util/self-hosted-fonts.js +169 -0
- package/src/lib/util/self-hosted-fonts.js.map +1 -0
- package/src/vendor/mui.d.ts +25 -0
- package/src/vendor/mui.js.map +1 -1
package/README.md
CHANGED
|
@@ -14,13 +14,14 @@ Peer dependencies: `react`, `@mui/material`, `@mui/system`, `@mui/utils`, `@mui/
|
|
|
14
14
|
|
|
15
15
|
From the root entry:
|
|
16
16
|
|
|
17
|
-
- **Theme factory.** `createResponsiveTheme({ themeOptions, responsiveFontSizesOptions? })` runs `createTheme`, derives shades for the extra palette colors, repairs derived shades that miss AA contrast, and applies `responsiveFontSizes` across every breakpoint. `createResponsiveCssVarTheme(light, dark, options?)` combines two themes into one CSS-variables theme switched by class.
|
|
18
|
-
- **MUI module augmentation.** Importing the package extends MUI's types with the palette additions these themes use (`tertiary`, `surface`, `tint`), extra typography variants such as `displayXl`, and the matching component `color` overrides. It also re-exports a selection of MUI types and helpers (`Theme`, `ThemeOptions`, `SxProps`, `darkScrollbar`, `visuallyHidden`).
|
|
17
|
+
- **Theme factory.** `createResponsiveTheme({ themeOptions, responsiveFontSizesOptions? })` runs `createTheme`, derives shades for the extra palette colors, repairs derived shades that miss AA contrast, derives each palette color's hover shades (`hover`, the fill a hovered contained Button or Fab takes under its own `contrastText`, and `hoverText`, the hovered text/outlined label), and applies `responsiveFontSizes` across every breakpoint. `createResponsiveCssVarTheme(light, dark, options?)` combines two themes into one CSS-variables theme switched by class.
|
|
18
|
+
- **MUI module augmentation.** Importing the package extends MUI's types with the palette additions these themes use (`tertiary`, `surface`, `tint`, and `hover` / `hoverText` on every palette color), extra typography variants such as `displayXl`, and the matching component `color` overrides. It also re-exports a selection of MUI types and helpers (`Theme`, `ThemeOptions`, `SxProps`, `darkScrollbar`, `visuallyHidden`).
|
|
19
19
|
- **Default themes.** `consoleThemeLight` / `consoleThemeDark` / `consoleThemeCssVar` / `getConsoleTheme(mode)` and `tenantThemeLight` / `tenantThemeDark`, with their `ThemeOptions` (`consoleOptions`, `tenantOptions` and the dark variants). `siteFallbackTheme(host, scheme)` and `siteBaseOptions(host, scheme)` pick between them for a host.
|
|
20
20
|
- **Host theme.** A `HostTheme` (the type lives in `@aglyn/shared-data-types`) is a site's theme customization as plain data. `hostThemeToThemeOptions(theme, scheme)` converts it to `ThemeOptions`; `sanitizeHostTheme`, `mergeThemeOptions`, `hasHostTheme` and `getGoogleFontsUrl` support it. `HostThemeProvider` renders children under it, taking `theme`, a required `fallback` theme or `[light, dark]` pair, `baseOptions`, and `initialMode` / `initialDeviceMode` so a server render can choose the scheme before hydration.
|
|
21
|
+
- **Self-hosted fonts.** `util/self-hosted-fonts` reads a Google Fonts CSS2 stylesheet into `@font-face` rules (`parseGoogleFontFaces`), writes them back with every file on the site's own `/api/fonts` route (`selfHostedFontFaceCss`), and picks the one or two faces worth preloading (`selfHostedFontPreloads`). The tenant fetches and serves; this half is pure.
|
|
21
22
|
- **Light/dark mode.** `createWithThemeProvider({ theme })` returns a higher-order component that provides the theme and mode state; `useThemeMode()` reads and toggles it. The choice is stored in the `theme-color-mode` cookie (`COOKIE_THEME_KEY`).
|
|
22
23
|
- **Emotion.** `createEmotionCache`, `CacheProvider`, `createLayeredEmotionCache`, `createWithEmotionClientCache`, and the constants `EMOTION_CACHE_KEY`, `APP_EMOTION_CACHE_OPTIONS`, `MUI_CSS_LAYER_NAME`.
|
|
23
|
-
- **Contrast.** `contrastRatio`, `relativeLuminance`, `meetsContrast`, `accessibleShade`, `accentTextColor`, `accentFillColor`, `auditPaletteContrast`, with `AA_TEXT_CONTRAST` (4.5) and `AA_NON_TEXT_CONTRAST` (3).
|
|
24
|
+
- **Contrast.** `contrastRatio`, `relativeLuminance`, `meetsContrast`, `accessibleShade`, `accentTextColor`, `accentFillColor`, `accentHoverFillColor`, `accentHoverTextColor`, `hoverFillShade`, `inkContrast`, `auditPaletteContrast`, with `AA_TEXT_CONTRAST` (4.5) and `AA_NON_TEXT_CONTRAST` (3).
|
|
24
25
|
- **Small helpers.** `mergeSxProps` / `useMergeSxProps`, `generateComponentClassKeys`, `FontFamily`, `buildFontFamilyList`.
|
|
25
26
|
|
|
26
27
|
By subpath only: `util/theme-editor-fields` and `util/theme-editor-defaults` (the field vocabulary and readers/writers a theme editor uses over a `HostTheme`), `util/theme-mode-cookie`, `util/color-scheme-hint` and `util/scheme-route-segment` (server-side resolution of the visitor's scheme).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/shared-ui-theme",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.223",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/shared-data-types": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-util-tools": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-util-vendor": "1.0.0-beta.
|
|
28
|
+
"@aglyn/shared-data-types": "1.0.0-beta.223",
|
|
29
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.223",
|
|
30
|
+
"@aglyn/shared-util-vendor": "1.0.0-beta.223",
|
|
31
31
|
"@emotion/cache": "^11.14.0",
|
|
32
32
|
"@emotion/react": "11.14.0",
|
|
33
33
|
"@swc/helpers": "0.5.23",
|
package/src/lib/console.theme.js
CHANGED
|
@@ -16,7 +16,7 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/ import { lightBlue } from "@mui/material/colors";
|
|
18
18
|
import { buildFontFamilyList } from "./constants.js";
|
|
19
|
-
import { accentTextColor } from "./util/accent-text.js";
|
|
19
|
+
import { accentHoverFillColor, accentHoverTextColor, accentTextColor } from "./util/accent-text.js";
|
|
20
20
|
import createResponsiveTheme, { createResponsiveCssVarTheme } from "./util/create-responsive-theme.js";
|
|
21
21
|
const colorScheme = {
|
|
22
22
|
light: {
|
|
@@ -287,11 +287,25 @@ const baseOptions = {
|
|
|
287
287
|
// and `--variant-containedBg` are left on `main`: a border and a
|
|
288
288
|
// fill owe 3:1, and the brand belongs there.
|
|
289
289
|
//
|
|
290
|
+
// Hover, every variant (AGL-3465). MUI's contained hover sets
|
|
291
|
+
// `--variant-containedBg` to `palette[color].dark` — the accent-text
|
|
292
|
+
// shade, LIGHTER than `main` in a dark scheme, so a white label
|
|
293
|
+
// sinks to ~2:1 under the pointer. It takes the hover fill
|
|
294
|
+
// (`palette[color].hover`) instead, which carries `contrastText` at
|
|
295
|
+
// AA in both schemes. Text and outlined labels take `hoverText`,
|
|
296
|
+
// the accent-text shade that still clears AA once MUI's hover wash
|
|
297
|
+
// is under it. Same media query and selector as MUI's rule, emitted
|
|
298
|
+
// after it, so these win on a pointer device and a touch screen
|
|
299
|
+
// keeps MUI's reset. `inherit` has no palette entry and keeps MUI's
|
|
300
|
+
// grey hover.
|
|
301
|
+
//
|
|
290
302
|
// Resolved per instance rather than baked, because `components` are
|
|
291
303
|
// evaluated ONCE against the root theme — a literal read here would
|
|
292
304
|
// freeze the light-scheme hex into dark mode.
|
|
293
305
|
root: ({ theme, ownerState })=>{
|
|
294
306
|
const accent = accentTextColor(theme, ownerState == null ? void 0 : ownerState.color);
|
|
307
|
+
const hoverFill = accentHoverFillColor(theme, ownerState == null ? void 0 : ownerState.color);
|
|
308
|
+
const hoverText = accentHoverTextColor(theme, ownerState == null ? void 0 : ownerState.color);
|
|
295
309
|
return _extends({
|
|
296
310
|
'&a[disabled], &.disabled': {
|
|
297
311
|
pointerEvents: 'none',
|
|
@@ -301,6 +315,15 @@ const baseOptions = {
|
|
|
301
315
|
}, accent && {
|
|
302
316
|
'--variant-textColor': accent,
|
|
303
317
|
'--variant-outlinedColor': accent
|
|
318
|
+
}, (hoverFill || hoverText) && {
|
|
319
|
+
'@media (hover: hover)': {
|
|
320
|
+
'&:hover': _extends({}, hoverFill && {
|
|
321
|
+
'--variant-containedBg': hoverFill
|
|
322
|
+
}, hoverText && {
|
|
323
|
+
'--variant-textColor': hoverText,
|
|
324
|
+
'--variant-outlinedColor': hoverText
|
|
325
|
+
})
|
|
326
|
+
}
|
|
304
327
|
});
|
|
305
328
|
}
|
|
306
329
|
}
|
|
@@ -336,6 +359,22 @@ const baseOptions = {
|
|
|
336
359
|
MuiFab: {
|
|
337
360
|
defaultProps: {
|
|
338
361
|
color: 'primary'
|
|
362
|
+
},
|
|
363
|
+
styleOverrides: {
|
|
364
|
+
// The Fab fills its hover with `palette[color].dark` too, under the
|
|
365
|
+
// same `contrastText` — so it takes the hover fill for the reason
|
|
366
|
+
// `MuiButton` does. Gated to pointer devices, which leaves MUI's own
|
|
367
|
+
// `(hover: none)` reset to `main` in charge on a touch screen.
|
|
368
|
+
root: ({ theme, ownerState })=>{
|
|
369
|
+
const hoverFill = accentHoverFillColor(theme, ownerState == null ? void 0 : ownerState.color);
|
|
370
|
+
return hoverFill ? {
|
|
371
|
+
'@media (hover: hover)': {
|
|
372
|
+
'&:hover': {
|
|
373
|
+
backgroundColor: hoverFill
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
} : {};
|
|
377
|
+
}
|
|
339
378
|
}
|
|
340
379
|
},
|
|
341
380
|
MuiIconButton: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/shared/ui/theme/src/lib/console.theme.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 { lightBlue } from '@mui/material/colors'\nimport type { PaletteOptions, Theme, ThemeOptions } from '../vendor/mui'\nimport { buildFontFamilyList } from './constants'\nimport { accentTextColor } from './util/accent-text'\nimport createResponsiveTheme, {\n createResponsiveCssVarTheme,\n} from './util/create-responsive-theme'\n\nexport type ColorVariant = 'light' | 'dark'\nexport type BackgroundRecord = PaletteOptions['background']\nexport type OrdinalIdentifier<K extends string = ''> =\n 'primary' | 'secondary' | 'tertiary'\nexport type OrdinalRecord<T extends OrdinalIdentifier = OrdinalIdentifier> =\n Pick<PaletteOptions, T>\nexport type PrimaryRecord = OrdinalRecord<'primary'>['primary']\nexport type SecondaryRecord = OrdinalRecord<'secondary'>['secondary']\nexport type TertiaryRecord = OrdinalRecord<'tertiary'>['tertiary']\nexport type ActionIdentifier = 'svgBackground' | 'svgFilled' | 'svgStroke'\nexport type ActionRecord = Pick<PaletteOptions, ActionIdentifier>\n\nconst colorScheme = {\n light: {\n // Palette rotated 2026-08-03 (AGL-1186): the blue accent that every\n // component was already opting into is now `primary`, so nothing has to\n // opt out of a primary that was really a surface tone. Whole colour\n // objects moved, so each keeps the contrastText it shipped with.\n primary: {\n main: '#00b0ff',\n // The accent rendered AS TEXT — `ACCENT_TEXT_SHADE` in\n // `util/accent-text.ts`. Links and the labels of text and outlined\n // buttons read this slot; `main` keeps painting fills, borders and\n // indicators, which owe 3:1 rather than 4.5:1. The brand blue is\n // 2.43:1 on white, so as normal-size text it needs the deeper shade:\n // this one measures 4.95:1 on paper and 4.54:1 on the page.\n dark: '#0077ad',\n contrastText: '#FFFFFF',\n },\n secondary: {\n main: '#e040fb',\n // Same slot, same role. Authored rather than left to derivation so the\n // value every link resolves to is readable in this file: 6.11:1 on\n // paper, 5.61:1 on the page.\n dark: '#9d2db0',\n contrastText: '#FFFFFF',\n },\n tertiary: {\n main: '#404C5C',\n contrastText: '#FFFFFF',\n },\n surface: {\n main: `#F8F9FA`,\n contrastText: '#000000',\n },\n // Pale accent washes used as tile/panel FILLS (AGL-1244). Each member is\n // named after the accent whose icon sits on it — the mega-menu's blue\n // tiles pair `tint.primary` with a `primary.dark` glyph — so the pairing\n // is legible from the token names alone. These were the last raw hexes on\n // the marketing nav; they are not `primary.light` (`#33BFFF`) and never\n // were, which is why the slot had to be named rather than borrowed.\n tint: {\n primary: '#E6F5FF',\n secondary: '#FBE6FE',\n tertiary: '#EEF0F2',\n },\n // MUI's own outlined-input border weight, promoted to a token so a field\n // drawn outside MUI can match one drawn by it (see `PaletteOptions`).\n inputOutline: 'rgba(0, 0, 0, 0.23)',\n background: {\n default: '#F5F5F5',\n paper: '#FFFFFF',\n },\n info: {\n // The deepest blue of this hue that still carries a WHITE label at the\n // 4.5:1 AA text bar (4.56:1). A lighter info takes every filled\n // variant sub-AA, and flipping its ink to dark makes an informational\n // surface read as a warning.\n main: '#1878cd',\n contrastText: '#FFFFFF',\n },\n error: {\n // The deepest red of this hue that keeps a white label at AA (4.51:1).\n // An error surface is a destructive-action affordance, so the fill\n // carries the contrast and the ink stays white.\n main: '#e32c27',\n contrastText: '#FFFFFF',\n },\n success: {\n main: '#4CAF50',\n contrastText: '#000000DE',\n },\n warning: {\n main: '#FFAB40',\n contrastText: '#000000DE',\n },\n grey: {\n 50: '#FAFAFA',\n 100: '#F5F5F5',\n 200: '#EEEEEE',\n 300: '#E0E0E0',\n 400: '#BDBDBD',\n 500: '#9E9E9E',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#D5D5D5',\n A200: '#AAAAAA',\n A400: '#303030',\n A700: '#616161',\n },\n svgBackground: {\n main: '#FAFAFA',\n hover: '#FAFAFA',\n active: '#FAFAFA',\n focus: '#FAFAFA',\n },\n svgFilled: {\n main: '#9E9E9E',\n hover: lightBlue['400'],\n active: lightBlue['400'],\n focus: lightBlue['400'],\n },\n svgStroke: {\n main: '#FFFFFF',\n hover: '#FFFFFF',\n active: '#FFFFFF',\n focus: '#FFFFFF',\n },\n },\n dark: {\n primary: {\n main: '#00b0ff',\n // The accent-as-text slot, LIGHTER than `main` here and deliberately\n // so. MUI derives `dark` as `darken(main, 0.3)` in both schemes — it\n // cannot see that the ground flipped — which lands `#007bb2` at 3.67:1\n // on this page. Every `dark` shade in this scheme is therefore\n // authored, and each is the value `ensureAccessibleShades` computes by\n // walking the accent LIGHTER until it clears 4.5:1 against both\n // `background.default` and `background.paper`. 9.02:1 / 6.62:1.\n dark: '#4dc8ff',\n contrastText: '#FFFFFF',\n },\n secondary: {\n main: '#e040fb',\n // 7.04:1 on the page, 5.17:1 on a raised panel. The brand magenta\n // itself is 3.78:1 on paper, so it cannot be the text shade here.\n dark: '#e979fc',\n contrastText: '#FFFFFF',\n },\n // Dark takes a LIFTED slate, not the brand `#404C5C`: that scores 1.38\n // against this scheme's page and would just move the old invisibility\n // bug from primary to tertiary. `#7C8CA3` measures 5.02 vs page and\n // 3.63 vs a raised panel, and needs dark ink rather than white (6.14\n // against black, 3.42 against white).\n tertiary: {\n main: '#7C8CA3',\n // 7.73:1 / 5.68:1 — `main` itself is 2.78:1 on the page.\n dark: '#a3afbf',\n contrastText: '#000000DE',\n },\n surface: {\n // Held at 1.17:1 from the page even though that is flat for an\n // elevation step. This token is also the panel the besigner draws its\n // hierarchy depth cues on, and lifting it toward the page pushes the\n // active guide — `secondary.main` on this fill — from 4.41:1 down to\n // 3.89:1. Trading a legible cue for a slightly clearer edge is the\n // wrong way round; the depth cues are what someone actually reads.\n main: `#202934`,\n contrastText: '#FFFFFF',\n },\n // The hand-curated dark counterparts the 15 tinted tiles carried in their\n // `@scheme dark` slices before the token existed (AGL-1244). Carrying the\n // exact values here is what lets those slices be DELETED without dark mode\n // shifting: a literal needs a slice, a token flips on its own.\n tint: {\n // Tile FILLS, so the bar is separation from the page rather than a\n // WCAG text ratio: below ~1.5:1 a tinted tile has no visible edge. The\n // originals sat at 1.13–1.25:1 and disappeared. White ink clears 11:1\n // on all three.\n primary: '#193d55',\n // Magenta cannot reach 1.5:1 without turning purple-grey, so this one\n // stops at 1.44:1 and the tile carries an `inputOutline` border in\n // dark instead of pushing the hue further.\n secondary: '#571e61',\n tertiary: '#333b44',\n },\n inputOutline: 'rgba(255, 255, 255, 0.23)',\n background: {\n default: '#161c21',\n paper: '#2a3440',\n },\n info: {\n main: '#1878cd',\n // 6.22:1 / 4.57:1.\n dark: '#5da1dc',\n contrastText: '#FFFFFF',\n },\n error: {\n main: '#e32c27',\n // 6.18:1 / 4.54:1.\n dark: '#ed7876',\n contrastText: '#FFFFFF',\n },\n success: {\n main: '#4CAF50',\n // 8.56:1 / 6.29:1.\n dark: '#82c785',\n contrastText: '#000000DE',\n },\n warning: {\n main: '#FFAB40',\n // 10.98:1 / 8.07:1.\n dark: '#ffc479',\n contrastText: '#000000DE',\n },\n grey: {\n 50: '#FAFAFA',\n 100: '#F5F5F5',\n 200: '#EEEEEE',\n 300: '#E0E0E0',\n 400: '#BDBDBD',\n 500: '#9E9E9E',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#D5D5D5',\n A200: '#AAAAAA',\n A400: '#303030',\n A700: '#616161',\n },\n svgBackground: {\n main: '#FAFAFA',\n hover: '#FAFAFA',\n active: '#FAFAFA',\n focus: '#FAFAFA',\n },\n svgFilled: {\n main: '#9E9E9E',\n hover: lightBlue['A100'],\n active: lightBlue['A100'],\n focus: lightBlue['A100'],\n },\n svgStroke: {\n main: '#FFFFFF',\n hover: '#FFFFFF',\n active: '#FFFFFF',\n focus: '#FFFFFF',\n },\n },\n}\n\nconst shadowKeyUmbraOpacity = 0.2\nconst shadowKeyPenumbraOpacity = 0.14\nconst shadowAmbientShadowOpacity = 0.12\n\nfunction createShadowInset(...px: number[]) {\n return [\n `inset ${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`,\n `inset ${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`,\n `inset ${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`,\n ].join(',')\n}\n\nconst baseOptions: ThemeOptions = {\n components: {\n MuiAppBar: {\n defaultProps: {\n enableColorOnDark: true,\n },\n },\n MuiAvatar: {\n styleOverrides: {\n root: {\n width: 32,\n height: 32,\n },\n },\n },\n MuiButton: {\n defaultProps: {\n color: 'primary',\n },\n styleOverrides: {\n // MUI's own variants set `--variant-textColor` and\n // `--variant-outlinedColor` to `palette[color].main`, which paints\n // the brand color as normal-size text — `#00b0ff` at 2.43:1 on\n // white. Both vars move to the accent-text shade\n // (`palette[color].dark`, scheme-aware). `--variant-outlinedBorder`\n // and `--variant-containedBg` are left on `main`: a border and a\n // fill owe 3:1, and the brand belongs there.\n //\n // Resolved per instance rather than baked, because `components` are\n // evaluated ONCE against the root theme — a literal read here would\n // freeze the light-scheme hex into dark mode.\n root: ({ theme, ownerState }) => {\n const accent = accentTextColor(theme, ownerState?.color)\n return {\n '&a[disabled], &.disabled': {\n pointerEvents: 'none',\n textDecoration: 'none',\n filter: 'grayscale(1) opacity(0.65)',\n },\n ...(accent && {\n '--variant-textColor': accent,\n '--variant-outlinedColor': accent,\n }),\n }\n },\n },\n },\n /**\n * Room for a floated label at the top of a dialog (AGL-703).\n *\n * MUI zeroes a DialogContent's top padding when it follows a DialogTitle\n * — `.MuiDialogTitle-root + .MuiDialogContent-root` — and the content box\n * scrolls (`overflow-y: auto`). So the first field's shrunk outlined\n * label, which sits ABOVE its own border, is clipped by the scroll\n * container. It shows on any dialog whose first control has a value on\n * open: the New author dialog's `Type` select had its label shaved in\n * half.\n *\n * Twenty-seven dialogs tried to fix this themselves with\n * `sx={{ pt: 1 }}`, and NONE of them worked: MUI's rule is two classes\n * and `sx` is one, so the adjacent-sibling selector wins on specificity\n * every time. Matching that selector here is what makes the fix apply —\n * which is why it belongs in the theme rather than at any call site.\n *\n * 12px: the shrunk label rises ~9px above the input's top edge, plus a\n * little air so it does not sit ON the dialog title.\n */\n MuiDialogContent: {\n styleOverrides: {\n root: ({ theme }: any) => ({\n '.MuiDialogTitle-root + &': {\n paddingTop: theme.spacing(1.5),\n },\n }),\n },\n },\n MuiFab: {\n defaultProps: {\n color: 'primary',\n },\n },\n MuiIconButton: {\n defaultProps: {\n color: 'primary',\n },\n // color: 'inherit', // Default color to inherit\n styleOverrides: {\n root: ({ theme }) => ({\n padding: theme.spacing(1),\n }),\n },\n variants: [\n {\n props: { variant: 'outlined' } as any, // @TODO ⚠️ fix typing\n style: ({ theme }) => ({\n border: `1px solid`,\n borderColor: `inherit`,\n }),\n },\n ],\n },\n MuiLink: {\n defaultProps: {\n color: 'primary',\n },\n styleOverrides: {\n // A Link is text by definition, so `color=\"primary\"` resolving to\n // `palette.primary.main` is always measured against the wrong bar.\n // Only the PaletteColor keys are rewritten — `inherit`,\n // `textPrimary`, `textSecondary` and `textDisabled` return undefined\n // from `accentTextColor` and keep MUI's own resolution.\n root: ({ theme, ownerState }) => {\n const accent = accentTextColor(theme, ownerState?.color)\n return {\n '&[disabled], &.disabled': {\n pointerEvents: 'none',\n textDecoration: 'none',\n filter: 'grayscale(1) opacity(0.65)',\n },\n ...(accent && { color: accent }),\n }\n },\n },\n },\n // MuiMenu: {},\n // No accent defaults live here any more (AGL-1186). Tabs, checkboxes,\n // radios, switches, sliders, progress and badges each briefly carried\n // `color: 'secondary'` to escape a `primary` that was a surface tone.\n // Now that `primary` IS the accent they render correctly on MUI's own\n // default, and a per-component default is exactly what the rotation\n // exists to remove.\n //\n // That includes the `MuiTabs` default AGL-1181 records as its fix: it\n // was removed here deliberately, not reverted. The rotation fixed the\n // root cause the default was papering over, so a reader who finds\n // nothing at that issue's write-up is looking at the right file.\n MuiToolbar: {\n styleOverrides: {\n // Honour `disableGutters` (AGL-1230). This override targets the ROOT\n // slot, and `disableGutters` only drops the `gutters` slot — so the\n // padding survived the prop, app-wide, and the prop silently did\n // nothing at ≥sm. It cost the marketing nav a 24px offset against the\n // page container at every width below the container's clamp.\n root: ({ theme, ownerState }) =>\n ownerState?.disableGutters\n ? {}\n : {\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n },\n },\n },\n // The tertiary indicator (AGL-3411). MUI styles Tabs' indicator for\n // `primary` and `secondary` only, so `indicatorColor=\"tertiary\"` — which\n // the palette and the Tabs element's picker both offer — drew MUI's\n // primary. Resolved per render so it follows the scheme.\n MuiTabs: {\n variants: [\n {\n props: { indicatorColor: 'tertiary' } as any, // augmentation widens this\n style: ({ theme }: any) => ({\n '& .MuiTabs-indicator': {\n backgroundColor: (theme.vars || theme).palette.tertiary.main,\n },\n }),\n },\n ],\n },\n MuiTooltip: {\n defaultProps: {\n arrow: true,\n },\n },\n },\n // mixins: {},\n shadowsInset: [\n 'none',\n createShadowInset(0, 2, 1, -1, 0, 1, 1, -0, 0, 1, 3, -0),\n createShadowInset(0, 3, 1, -2, 0, 2, 2, -0, 0, 1, 5, -0),\n createShadowInset(0, 3, 3, -2, 0, 3, 4, -0, 0, 1, 8, -0),\n createShadowInset(0, 2, 4, -1, 0, 4, 5, -0, 0, 1, 10, -0),\n createShadowInset(0, 3, 5, -1, 0, 5, 8, -0, 0, 1, 14, -0),\n createShadowInset(0, 3, 5, -1, 0, 6, 10, -0, 0, 1, 18, -0),\n createShadowInset(0, 4, 5, -2, 0, 7, 10, -1, 0, 2, 16, -1),\n createShadowInset(0, 5, 5, -3, 0, 8, 10, -1, 0, 3, 14, -2),\n createShadowInset(0, 5, 6, -3, 0, 9, 12, -1, 0, 3, 16, -2),\n createShadowInset(0, 6, 6, -3, 0, 10, 14, -1, 0, 4, 18, -3),\n createShadowInset(0, 6, 7, -4, 0, 11, 15, -1, 0, 4, 20, -3),\n createShadowInset(0, 7, 8, -4, 0, 12, 17, -2, 0, 5, 22, -4),\n createShadowInset(0, 7, 8, -4, 0, 13, 19, -2, 0, 5, 24, -4),\n createShadowInset(0, 7, 9, -4, 0, 14, 21, -2, 0, 5, 26, -4),\n createShadowInset(0, 8, 9, -5, 0, 15, 22, -2, 0, 6, 28, -5),\n createShadowInset(0, 8, 10, -5, 0, 16, 24, -2, 0, 6, 30, -5),\n createShadowInset(0, 8, 11, -5, 0, 17, 26, -2, 0, 6, 32, -5),\n createShadowInset(0, 9, 11, -5, 0, 18, 28, -2, 0, 7, 34, -6),\n createShadowInset(0, 9, 12, -6, 0, 19, 29, -2, 0, 7, 36, -6),\n createShadowInset(0, 10, 13, -6, 0, 20, 31, -3, 0, 8, 38, -7),\n createShadowInset(0, 10, 13, -6, 0, 21, 33, -3, 0, 8, 40, -7),\n createShadowInset(0, 10, 14, -6, 0, 22, 35, -3, 0, 8, 42, -7),\n createShadowInset(0, 11, 14, -7, 0, 23, 36, -3, 0, 9, 44, -8),\n createShadowInset(0, 11, 15, -7, 0, 24, 38, -3, 0, 9, 46, -8),\n ],\n shape: {\n borderRadius: 4,\n appIconBorderRadius: `17.544%`,\n },\n spacing: 8,\n typography: {\n fontFamily: buildFontFamilyList().join(','),\n // The brand's named weights, beyond MUI's four.\n //\n // MUI ships Light 300 / Regular 400 / Medium 500 / Bold 700, and the\n // brand type ramp uses three more: Black for heroes, ExtraBold for H2,\n // SemiBold below Bold. Without these tokens, reaching 600/800/900 means\n // typing a raw number, which pins an element to a weight instead of to\n // the brand and leaves it behind when the ramp moves.\n //\n // They are ADDITIVE — `createTypography` deep-merges unknown keys\n // through its `...other`, so nothing MUI defines changes. And they are\n // reachable the same way the built-ins are: `@mui/system`'s `style()`\n // retries a miss as `${prop}${capitalize(value)}`, so `fontWeight:\n // 'extraBold'` resolves to `typography.fontWeightExtraBold`. The\n // besigner's weight picker discovers them off the theme rather than\n // from a list, so they appear in the panel without another edit.\n //\n // Roboto Flex is a variable face covering 100–1000, so every rung here\n // renders as a real weight rather than a synthesised one.\n fontWeightSemiBold: 600,\n fontWeightExtraBold: 800,\n fontWeightBlack: 900,\n // The brand's display ramp, so `variant=\"h1\"` / `\"h2\"` MEANS the brand.\n // MUI's defaults are Light 300 at 96px/60px — a display face for a\n // Material app, and nothing like the brand's Black heroes and ExtraBold\n // H2. Left at the defaults, every heading on a built page needs a\n // hand-written `fontSize` and `fontWeight` to look right, and the ones\n // that miss render as a Material display face nobody chose while the\n // markup still says Heading 2.\n //\n // Scoped deliberately to h1 and h2. They have ZERO `variant=\"hN\"` usages\n // in the console and one in the tenant app, so this restyles no product\n // surface — it only changes what a SITE gets when it asks for a heading,\n // which is exactly the thing that should follow the brand. h3–h6 carry\n // 95 usages between them and are left on MUI's scale; `overline` has 19\n // and is left alone for the same reason.\n //\n // `responsiveFontSizes` runs over these afterwards (xs→xl), so these are\n // the DESKTOP end of a ramp that scales itself down — 56px/40px here\n // land near the 34px/30px the mobile frames show.\n // The rung ABOVE h1. h1 is the brand's 56px display size and\n // stays that; a hero drawn at 72px had nothing to ask for, so every one\n // hand-wrote `fontSize: '72px'` — and that literal then LOST to h1's own\n // `responsiveFontSizes` ramp on wide viewports, silently rendering 56px.\n // Listed in `RAMPED_DISPLAY_VARIANTS` so it scales down like the rest of\n // the ramp rather than staying 72px on a phone.\n displayXl: {\n fontSize: '4.5rem',\n fontWeight: 900,\n lineHeight: 1.04,\n letterSpacing: '-0.028em',\n },\n h1: {\n fontSize: '3.5rem',\n fontWeight: 900,\n lineHeight: 1.05,\n letterSpacing: '-0.025em',\n },\n h2: {\n fontSize: '2.5rem',\n fontWeight: 800,\n lineHeight: 1.15,\n letterSpacing: '-0.02em',\n },\n // h3 has to come DOWN with them, or the ramp inverts. Retuning h1/h2 to\n // the brand (56/40px) while h3 kept MUI's 48px left a Heading 3 LARGER\n // than a Heading 2 — visible the moment the theme preview listed the\n // variants in size order. h3 carries zero `variant=\"h3\"` usages, the same\n // as h1 and h2, so this restyles no product surface; h4-h6 keep MUI's\n // scale because 95 usages ride on them.\n h3: {\n fontSize: '2.25rem',\n fontWeight: 700,\n lineHeight: 1.2,\n letterSpacing: '-0.015em',\n },\n // The three text rungs the brand uses that MUI's scale has no name for.\n // MUI runs 16 / 14 / 12 (`body1` / `body2` / `caption`); the brand's\n // pages want 17, 13 and 11, and with no token to ask for they write the\n // pixels instead. One marketing page alone can carry 286 such literals —\n // 165 of them the same 11px metadata line — each pinned to a size rather\n // than to the scale.\n //\n // Full variant objects rather than bare sizes, so one pick brings the\n // line height with it: `variant=\"micro\"` or, where the element's own\n // variant must stay, `fontSize: 'micro.fontSize'` — the token path the\n // Font Size picker already offers for `h4.fontSize`.\n //\n // Named for the job, not the number, so the name survives a retune: a\n // lede stays the lede if the brand moves it to 18px.\n lede: {\n fontSize: '1.0625rem',\n fontWeight: 400,\n lineHeight: 1.6,\n },\n bodyCompact: {\n fontSize: '0.8125rem',\n fontWeight: 400,\n lineHeight: 1.5,\n },\n micro: {\n fontSize: '0.6875rem',\n fontWeight: 400,\n lineHeight: 1.6,\n },\n },\n zIndex: {\n max: 2147483647,\n min: -2147483648,\n },\n}\n\nexport const consoleOptions: ThemeOptions = {\n ...baseOptions,\n palette: {\n mode: 'light',\n ...colorScheme.light,\n },\n}\nexport const consoleOptionsDark: ThemeOptions = {\n ...baseOptions,\n palette: {\n mode: 'dark',\n ...colorScheme.dark,\n },\n}\n\nexport const consoleThemeLight: Theme = createResponsiveTheme({\n themeOptions: { ...consoleOptions },\n})\nexport const consoleThemeDark: Theme = createResponsiveTheme({\n themeOptions: { ...consoleOptionsDark },\n})\n\nexport const consoleThemeCssVar = createResponsiveCssVarTheme(\n consoleThemeLight,\n consoleThemeDark,\n)\n\nexport const getConsoleTheme = (mode: 'light' | 'dark' = 'light') => {\n const theme = {\n light: consoleThemeLight,\n dark: consoleThemeDark,\n }\n return theme[mode]\n}\nexport const getConsoleMetaThemeColor = (mode: 'light' | 'dark' = 'light') => {\n const themeColor = {\n light: consoleThemeLight.palette.secondary.main,\n dark: consoleThemeDark.palette.primary.main,\n }\n return themeColor[mode]\n}\nexport default consoleThemeLight\n"],"names":["lightBlue","buildFontFamilyList","accentTextColor","createResponsiveTheme","createResponsiveCssVarTheme","colorScheme","light","primary","main","dark","contrastText","secondary","tertiary","surface","tint","inputOutline","background","default","paper","info","error","success","warning","grey","A100","A200","A400","A700","svgBackground","hover","active","focus","svgFilled","svgStroke","shadowKeyUmbraOpacity","shadowKeyPenumbraOpacity","shadowAmbientShadowOpacity","createShadowInset","px","join","baseOptions","components","MuiAppBar","defaultProps","enableColorOnDark","MuiAvatar","styleOverrides","root","width","height","MuiButton","color","theme","ownerState","accent","pointerEvents","textDecoration","filter","MuiDialogContent","paddingTop","spacing","MuiFab","MuiIconButton","padding","variants","props","variant","style","border","borderColor","MuiLink","MuiToolbar","disableGutters","breakpoints","up","paddingLeft","paddingRight","MuiTabs","indicatorColor","backgroundColor","vars","palette","MuiTooltip","arrow","shadowsInset","shape","borderRadius","appIconBorderRadius","typography","fontFamily","fontWeightSemiBold","fontWeightExtraBold","fontWeightBlack","displayXl","fontSize","fontWeight","lineHeight","letterSpacing","h1","h2","h3","lede","bodyCompact","micro","zIndex","max","min","consoleOptions","mode","consoleOptionsDark","consoleThemeLight","themeOptions","consoleThemeDark","consoleThemeCssVar","getConsoleTheme","getConsoleMetaThemeColor","themeColor"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,SAAS,QAAQ,uBAAsB;AAEhD,SAASC,mBAAmB,QAAQ,iBAAa;AACjD,SAASC,e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eAAeE,kBAAiB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/ui/theme/src/lib/console.theme.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 { lightBlue } from '@mui/material/colors'\nimport type { PaletteOptions, Theme, ThemeOptions } from '../vendor/mui'\nimport { buildFontFamilyList } from './constants'\nimport {\n accentHoverFillColor,\n accentHoverTextColor,\n accentTextColor,\n} from './util/accent-text'\nimport createResponsiveTheme, {\n createResponsiveCssVarTheme,\n} from './util/create-responsive-theme'\n\nexport type ColorVariant = 'light' | 'dark'\nexport type BackgroundRecord = PaletteOptions['background']\nexport type OrdinalIdentifier<K extends string = ''> =\n 'primary' | 'secondary' | 'tertiary'\nexport type OrdinalRecord<T extends OrdinalIdentifier = OrdinalIdentifier> =\n Pick<PaletteOptions, T>\nexport type PrimaryRecord = OrdinalRecord<'primary'>['primary']\nexport type SecondaryRecord = OrdinalRecord<'secondary'>['secondary']\nexport type TertiaryRecord = OrdinalRecord<'tertiary'>['tertiary']\nexport type ActionIdentifier = 'svgBackground' | 'svgFilled' | 'svgStroke'\nexport type ActionRecord = Pick<PaletteOptions, ActionIdentifier>\n\nconst colorScheme = {\n light: {\n // Palette rotated 2026-08-03 (AGL-1186): the blue accent that every\n // component was already opting into is now `primary`, so nothing has to\n // opt out of a primary that was really a surface tone. Whole colour\n // objects moved, so each keeps the contrastText it shipped with.\n primary: {\n main: '#00b0ff',\n // The accent rendered AS TEXT — `ACCENT_TEXT_SHADE` in\n // `util/accent-text.ts`. Links and the labels of text and outlined\n // buttons read this slot; `main` keeps painting fills, borders and\n // indicators, which owe 3:1 rather than 4.5:1. The brand blue is\n // 2.43:1 on white, so as normal-size text it needs the deeper shade:\n // this one measures 4.95:1 on paper and 4.54:1 on the page.\n dark: '#0077ad',\n contrastText: '#FFFFFF',\n },\n secondary: {\n main: '#e040fb',\n // Same slot, same role. Authored rather than left to derivation so the\n // value every link resolves to is readable in this file: 6.11:1 on\n // paper, 5.61:1 on the page.\n dark: '#9d2db0',\n contrastText: '#FFFFFF',\n },\n tertiary: {\n main: '#404C5C',\n contrastText: '#FFFFFF',\n },\n surface: {\n main: `#F8F9FA`,\n contrastText: '#000000',\n },\n // Pale accent washes used as tile/panel FILLS (AGL-1244). Each member is\n // named after the accent whose icon sits on it — the mega-menu's blue\n // tiles pair `tint.primary` with a `primary.dark` glyph — so the pairing\n // is legible from the token names alone. These were the last raw hexes on\n // the marketing nav; they are not `primary.light` (`#33BFFF`) and never\n // were, which is why the slot had to be named rather than borrowed.\n tint: {\n primary: '#E6F5FF',\n secondary: '#FBE6FE',\n tertiary: '#EEF0F2',\n },\n // MUI's own outlined-input border weight, promoted to a token so a field\n // drawn outside MUI can match one drawn by it (see `PaletteOptions`).\n inputOutline: 'rgba(0, 0, 0, 0.23)',\n background: {\n default: '#F5F5F5',\n paper: '#FFFFFF',\n },\n info: {\n // The deepest blue of this hue that still carries a WHITE label at the\n // 4.5:1 AA text bar (4.56:1). A lighter info takes every filled\n // variant sub-AA, and flipping its ink to dark makes an informational\n // surface read as a warning.\n main: '#1878cd',\n contrastText: '#FFFFFF',\n },\n error: {\n // The deepest red of this hue that keeps a white label at AA (4.51:1).\n // An error surface is a destructive-action affordance, so the fill\n // carries the contrast and the ink stays white.\n main: '#e32c27',\n contrastText: '#FFFFFF',\n },\n success: {\n main: '#4CAF50',\n contrastText: '#000000DE',\n },\n warning: {\n main: '#FFAB40',\n contrastText: '#000000DE',\n },\n grey: {\n 50: '#FAFAFA',\n 100: '#F5F5F5',\n 200: '#EEEEEE',\n 300: '#E0E0E0',\n 400: '#BDBDBD',\n 500: '#9E9E9E',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#D5D5D5',\n A200: '#AAAAAA',\n A400: '#303030',\n A700: '#616161',\n },\n svgBackground: {\n main: '#FAFAFA',\n hover: '#FAFAFA',\n active: '#FAFAFA',\n focus: '#FAFAFA',\n },\n svgFilled: {\n main: '#9E9E9E',\n hover: lightBlue['400'],\n active: lightBlue['400'],\n focus: lightBlue['400'],\n },\n svgStroke: {\n main: '#FFFFFF',\n hover: '#FFFFFF',\n active: '#FFFFFF',\n focus: '#FFFFFF',\n },\n },\n dark: {\n primary: {\n main: '#00b0ff',\n // The accent-as-text slot, LIGHTER than `main` here and deliberately\n // so. MUI derives `dark` as `darken(main, 0.3)` in both schemes — it\n // cannot see that the ground flipped — which lands `#007bb2` at 3.67:1\n // on this page. Every `dark` shade in this scheme is therefore\n // authored, and each is the value `ensureAccessibleShades` computes by\n // walking the accent LIGHTER until it clears 4.5:1 against both\n // `background.default` and `background.paper`. 9.02:1 / 6.62:1.\n dark: '#4dc8ff',\n contrastText: '#FFFFFF',\n },\n secondary: {\n main: '#e040fb',\n // 7.04:1 on the page, 5.17:1 on a raised panel. The brand magenta\n // itself is 3.78:1 on paper, so it cannot be the text shade here.\n dark: '#e979fc',\n contrastText: '#FFFFFF',\n },\n // Dark takes a LIFTED slate, not the brand `#404C5C`: that scores 1.38\n // against this scheme's page and would just move the old invisibility\n // bug from primary to tertiary. `#7C8CA3` measures 5.02 vs page and\n // 3.63 vs a raised panel, and needs dark ink rather than white (6.14\n // against black, 3.42 against white).\n tertiary: {\n main: '#7C8CA3',\n // 7.73:1 / 5.68:1 — `main` itself is 2.78:1 on the page.\n dark: '#a3afbf',\n contrastText: '#000000DE',\n },\n surface: {\n // Held at 1.17:1 from the page even though that is flat for an\n // elevation step. This token is also the panel the besigner draws its\n // hierarchy depth cues on, and lifting it toward the page pushes the\n // active guide — `secondary.main` on this fill — from 4.41:1 down to\n // 3.89:1. Trading a legible cue for a slightly clearer edge is the\n // wrong way round; the depth cues are what someone actually reads.\n main: `#202934`,\n contrastText: '#FFFFFF',\n },\n // The hand-curated dark counterparts the 15 tinted tiles carried in their\n // `@scheme dark` slices before the token existed (AGL-1244). Carrying the\n // exact values here is what lets those slices be DELETED without dark mode\n // shifting: a literal needs a slice, a token flips on its own.\n tint: {\n // Tile FILLS, so the bar is separation from the page rather than a\n // WCAG text ratio: below ~1.5:1 a tinted tile has no visible edge. The\n // originals sat at 1.13–1.25:1 and disappeared. White ink clears 11:1\n // on all three.\n primary: '#193d55',\n // Magenta cannot reach 1.5:1 without turning purple-grey, so this one\n // stops at 1.44:1 and the tile carries an `inputOutline` border in\n // dark instead of pushing the hue further.\n secondary: '#571e61',\n tertiary: '#333b44',\n },\n inputOutline: 'rgba(255, 255, 255, 0.23)',\n background: {\n default: '#161c21',\n paper: '#2a3440',\n },\n info: {\n main: '#1878cd',\n // 6.22:1 / 4.57:1.\n dark: '#5da1dc',\n contrastText: '#FFFFFF',\n },\n error: {\n main: '#e32c27',\n // 6.18:1 / 4.54:1.\n dark: '#ed7876',\n contrastText: '#FFFFFF',\n },\n success: {\n main: '#4CAF50',\n // 8.56:1 / 6.29:1.\n dark: '#82c785',\n contrastText: '#000000DE',\n },\n warning: {\n main: '#FFAB40',\n // 10.98:1 / 8.07:1.\n dark: '#ffc479',\n contrastText: '#000000DE',\n },\n grey: {\n 50: '#FAFAFA',\n 100: '#F5F5F5',\n 200: '#EEEEEE',\n 300: '#E0E0E0',\n 400: '#BDBDBD',\n 500: '#9E9E9E',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#D5D5D5',\n A200: '#AAAAAA',\n A400: '#303030',\n A700: '#616161',\n },\n svgBackground: {\n main: '#FAFAFA',\n hover: '#FAFAFA',\n active: '#FAFAFA',\n focus: '#FAFAFA',\n },\n svgFilled: {\n main: '#9E9E9E',\n hover: lightBlue['A100'],\n active: lightBlue['A100'],\n focus: lightBlue['A100'],\n },\n svgStroke: {\n main: '#FFFFFF',\n hover: '#FFFFFF',\n active: '#FFFFFF',\n focus: '#FFFFFF',\n },\n },\n}\n\nconst shadowKeyUmbraOpacity = 0.2\nconst shadowKeyPenumbraOpacity = 0.14\nconst shadowAmbientShadowOpacity = 0.12\n\nfunction createShadowInset(...px: number[]) {\n return [\n `inset ${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`,\n `inset ${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`,\n `inset ${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`,\n ].join(',')\n}\n\nconst baseOptions: ThemeOptions = {\n components: {\n MuiAppBar: {\n defaultProps: {\n enableColorOnDark: true,\n },\n },\n MuiAvatar: {\n styleOverrides: {\n root: {\n width: 32,\n height: 32,\n },\n },\n },\n MuiButton: {\n defaultProps: {\n color: 'primary',\n },\n styleOverrides: {\n // MUI's own variants set `--variant-textColor` and\n // `--variant-outlinedColor` to `palette[color].main`, which paints\n // the brand color as normal-size text — `#00b0ff` at 2.43:1 on\n // white. Both vars move to the accent-text shade\n // (`palette[color].dark`, scheme-aware). `--variant-outlinedBorder`\n // and `--variant-containedBg` are left on `main`: a border and a\n // fill owe 3:1, and the brand belongs there.\n //\n // Hover, every variant (AGL-3465). MUI's contained hover sets\n // `--variant-containedBg` to `palette[color].dark` — the accent-text\n // shade, LIGHTER than `main` in a dark scheme, so a white label\n // sinks to ~2:1 under the pointer. It takes the hover fill\n // (`palette[color].hover`) instead, which carries `contrastText` at\n // AA in both schemes. Text and outlined labels take `hoverText`,\n // the accent-text shade that still clears AA once MUI's hover wash\n // is under it. Same media query and selector as MUI's rule, emitted\n // after it, so these win on a pointer device and a touch screen\n // keeps MUI's reset. `inherit` has no palette entry and keeps MUI's\n // grey hover.\n //\n // Resolved per instance rather than baked, because `components` are\n // evaluated ONCE against the root theme — a literal read here would\n // freeze the light-scheme hex into dark mode.\n root: ({ theme, ownerState }) => {\n const accent = accentTextColor(theme, ownerState?.color)\n const hoverFill = accentHoverFillColor(theme, ownerState?.color)\n const hoverText = accentHoverTextColor(theme, ownerState?.color)\n return {\n '&a[disabled], &.disabled': {\n pointerEvents: 'none',\n textDecoration: 'none',\n filter: 'grayscale(1) opacity(0.65)',\n },\n ...(accent && {\n '--variant-textColor': accent,\n '--variant-outlinedColor': accent,\n }),\n ...((hoverFill || hoverText) && {\n '@media (hover: hover)': {\n '&:hover': {\n ...(hoverFill && { '--variant-containedBg': hoverFill }),\n ...(hoverText && {\n '--variant-textColor': hoverText,\n '--variant-outlinedColor': hoverText,\n }),\n },\n },\n }),\n }\n },\n },\n },\n /**\n * Room for a floated label at the top of a dialog (AGL-703).\n *\n * MUI zeroes a DialogContent's top padding when it follows a DialogTitle\n * — `.MuiDialogTitle-root + .MuiDialogContent-root` — and the content box\n * scrolls (`overflow-y: auto`). So the first field's shrunk outlined\n * label, which sits ABOVE its own border, is clipped by the scroll\n * container. It shows on any dialog whose first control has a value on\n * open: the New author dialog's `Type` select had its label shaved in\n * half.\n *\n * Twenty-seven dialogs tried to fix this themselves with\n * `sx={{ pt: 1 }}`, and NONE of them worked: MUI's rule is two classes\n * and `sx` is one, so the adjacent-sibling selector wins on specificity\n * every time. Matching that selector here is what makes the fix apply —\n * which is why it belongs in the theme rather than at any call site.\n *\n * 12px: the shrunk label rises ~9px above the input's top edge, plus a\n * little air so it does not sit ON the dialog title.\n */\n MuiDialogContent: {\n styleOverrides: {\n root: ({ theme }: any) => ({\n '.MuiDialogTitle-root + &': {\n paddingTop: theme.spacing(1.5),\n },\n }),\n },\n },\n MuiFab: {\n defaultProps: {\n color: 'primary',\n },\n styleOverrides: {\n // The Fab fills its hover with `palette[color].dark` too, under the\n // same `contrastText` — so it takes the hover fill for the reason\n // `MuiButton` does. Gated to pointer devices, which leaves MUI's own\n // `(hover: none)` reset to `main` in charge on a touch screen.\n root: ({ theme, ownerState }) => {\n const hoverFill = accentHoverFillColor(theme, ownerState?.color)\n return hoverFill\n ? {\n '@media (hover: hover)': {\n '&:hover': { backgroundColor: hoverFill },\n },\n }\n : {}\n },\n },\n },\n MuiIconButton: {\n defaultProps: {\n color: 'primary',\n },\n // color: 'inherit', // Default color to inherit\n styleOverrides: {\n root: ({ theme }) => ({\n padding: theme.spacing(1),\n }),\n },\n variants: [\n {\n props: { variant: 'outlined' } as any, // @TODO ⚠️ fix typing\n style: ({ theme }) => ({\n border: `1px solid`,\n borderColor: `inherit`,\n }),\n },\n ],\n },\n MuiLink: {\n defaultProps: {\n color: 'primary',\n },\n styleOverrides: {\n // A Link is text by definition, so `color=\"primary\"` resolving to\n // `palette.primary.main` is always measured against the wrong bar.\n // Only the PaletteColor keys are rewritten — `inherit`,\n // `textPrimary`, `textSecondary` and `textDisabled` return undefined\n // from `accentTextColor` and keep MUI's own resolution.\n root: ({ theme, ownerState }) => {\n const accent = accentTextColor(theme, ownerState?.color)\n return {\n '&[disabled], &.disabled': {\n pointerEvents: 'none',\n textDecoration: 'none',\n filter: 'grayscale(1) opacity(0.65)',\n },\n ...(accent && { color: accent }),\n }\n },\n },\n },\n // MuiMenu: {},\n // No accent defaults live here any more (AGL-1186). Tabs, checkboxes,\n // radios, switches, sliders, progress and badges each briefly carried\n // `color: 'secondary'` to escape a `primary` that was a surface tone.\n // Now that `primary` IS the accent they render correctly on MUI's own\n // default, and a per-component default is exactly what the rotation\n // exists to remove.\n //\n // That includes the `MuiTabs` default AGL-1181 records as its fix: it\n // was removed here deliberately, not reverted. The rotation fixed the\n // root cause the default was papering over, so a reader who finds\n // nothing at that issue's write-up is looking at the right file.\n MuiToolbar: {\n styleOverrides: {\n // Honour `disableGutters` (AGL-1230). This override targets the ROOT\n // slot, and `disableGutters` only drops the `gutters` slot — so the\n // padding survived the prop, app-wide, and the prop silently did\n // nothing at ≥sm. It cost the marketing nav a 24px offset against the\n // page container at every width below the container's clamp.\n root: ({ theme, ownerState }) =>\n ownerState?.disableGutters\n ? {}\n : {\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n },\n },\n },\n // The tertiary indicator (AGL-3411). MUI styles Tabs' indicator for\n // `primary` and `secondary` only, so `indicatorColor=\"tertiary\"` — which\n // the palette and the Tabs element's picker both offer — drew MUI's\n // primary. Resolved per render so it follows the scheme.\n MuiTabs: {\n variants: [\n {\n props: { indicatorColor: 'tertiary' } as any, // augmentation widens this\n style: ({ theme }: any) => ({\n '& .MuiTabs-indicator': {\n backgroundColor: (theme.vars || theme).palette.tertiary.main,\n },\n }),\n },\n ],\n },\n MuiTooltip: {\n defaultProps: {\n arrow: true,\n },\n },\n },\n // mixins: {},\n shadowsInset: [\n 'none',\n createShadowInset(0, 2, 1, -1, 0, 1, 1, -0, 0, 1, 3, -0),\n createShadowInset(0, 3, 1, -2, 0, 2, 2, -0, 0, 1, 5, -0),\n createShadowInset(0, 3, 3, -2, 0, 3, 4, -0, 0, 1, 8, -0),\n createShadowInset(0, 2, 4, -1, 0, 4, 5, -0, 0, 1, 10, -0),\n createShadowInset(0, 3, 5, -1, 0, 5, 8, -0, 0, 1, 14, -0),\n createShadowInset(0, 3, 5, -1, 0, 6, 10, -0, 0, 1, 18, -0),\n createShadowInset(0, 4, 5, -2, 0, 7, 10, -1, 0, 2, 16, -1),\n createShadowInset(0, 5, 5, -3, 0, 8, 10, -1, 0, 3, 14, -2),\n createShadowInset(0, 5, 6, -3, 0, 9, 12, -1, 0, 3, 16, -2),\n createShadowInset(0, 6, 6, -3, 0, 10, 14, -1, 0, 4, 18, -3),\n createShadowInset(0, 6, 7, -4, 0, 11, 15, -1, 0, 4, 20, -3),\n createShadowInset(0, 7, 8, -4, 0, 12, 17, -2, 0, 5, 22, -4),\n createShadowInset(0, 7, 8, -4, 0, 13, 19, -2, 0, 5, 24, -4),\n createShadowInset(0, 7, 9, -4, 0, 14, 21, -2, 0, 5, 26, -4),\n createShadowInset(0, 8, 9, -5, 0, 15, 22, -2, 0, 6, 28, -5),\n createShadowInset(0, 8, 10, -5, 0, 16, 24, -2, 0, 6, 30, -5),\n createShadowInset(0, 8, 11, -5, 0, 17, 26, -2, 0, 6, 32, -5),\n createShadowInset(0, 9, 11, -5, 0, 18, 28, -2, 0, 7, 34, -6),\n createShadowInset(0, 9, 12, -6, 0, 19, 29, -2, 0, 7, 36, -6),\n createShadowInset(0, 10, 13, -6, 0, 20, 31, -3, 0, 8, 38, -7),\n createShadowInset(0, 10, 13, -6, 0, 21, 33, -3, 0, 8, 40, -7),\n createShadowInset(0, 10, 14, -6, 0, 22, 35, -3, 0, 8, 42, -7),\n createShadowInset(0, 11, 14, -7, 0, 23, 36, -3, 0, 9, 44, -8),\n createShadowInset(0, 11, 15, -7, 0, 24, 38, -3, 0, 9, 46, -8),\n ],\n shape: {\n borderRadius: 4,\n appIconBorderRadius: `17.544%`,\n },\n spacing: 8,\n typography: {\n fontFamily: buildFontFamilyList().join(','),\n // The brand's named weights, beyond MUI's four.\n //\n // MUI ships Light 300 / Regular 400 / Medium 500 / Bold 700, and the\n // brand type ramp uses three more: Black for heroes, ExtraBold for H2,\n // SemiBold below Bold. Without these tokens, reaching 600/800/900 means\n // typing a raw number, which pins an element to a weight instead of to\n // the brand and leaves it behind when the ramp moves.\n //\n // They are ADDITIVE — `createTypography` deep-merges unknown keys\n // through its `...other`, so nothing MUI defines changes. And they are\n // reachable the same way the built-ins are: `@mui/system`'s `style()`\n // retries a miss as `${prop}${capitalize(value)}`, so `fontWeight:\n // 'extraBold'` resolves to `typography.fontWeightExtraBold`. The\n // besigner's weight picker discovers them off the theme rather than\n // from a list, so they appear in the panel without another edit.\n //\n // Roboto Flex is a variable face covering 100–1000, so every rung here\n // renders as a real weight rather than a synthesised one.\n fontWeightSemiBold: 600,\n fontWeightExtraBold: 800,\n fontWeightBlack: 900,\n // The brand's display ramp, so `variant=\"h1\"` / `\"h2\"` MEANS the brand.\n // MUI's defaults are Light 300 at 96px/60px — a display face for a\n // Material app, and nothing like the brand's Black heroes and ExtraBold\n // H2. Left at the defaults, every heading on a built page needs a\n // hand-written `fontSize` and `fontWeight` to look right, and the ones\n // that miss render as a Material display face nobody chose while the\n // markup still says Heading 2.\n //\n // Scoped deliberately to h1 and h2. They have ZERO `variant=\"hN\"` usages\n // in the console and one in the tenant app, so this restyles no product\n // surface — it only changes what a SITE gets when it asks for a heading,\n // which is exactly the thing that should follow the brand. h3–h6 carry\n // 95 usages between them and are left on MUI's scale; `overline` has 19\n // and is left alone for the same reason.\n //\n // `responsiveFontSizes` runs over these afterwards (xs→xl), so these are\n // the DESKTOP end of a ramp that scales itself down — 56px/40px here\n // land near the 34px/30px the mobile frames show.\n // The rung ABOVE h1. h1 is the brand's 56px display size and\n // stays that; a hero drawn at 72px had nothing to ask for, so every one\n // hand-wrote `fontSize: '72px'` — and that literal then LOST to h1's own\n // `responsiveFontSizes` ramp on wide viewports, silently rendering 56px.\n // Listed in `RAMPED_DISPLAY_VARIANTS` so it scales down like the rest of\n // the ramp rather than staying 72px on a phone.\n displayXl: {\n fontSize: '4.5rem',\n fontWeight: 900,\n lineHeight: 1.04,\n letterSpacing: '-0.028em',\n },\n h1: {\n fontSize: '3.5rem',\n fontWeight: 900,\n lineHeight: 1.05,\n letterSpacing: '-0.025em',\n },\n h2: {\n fontSize: '2.5rem',\n fontWeight: 800,\n lineHeight: 1.15,\n letterSpacing: '-0.02em',\n },\n // h3 has to come DOWN with them, or the ramp inverts. Retuning h1/h2 to\n // the brand (56/40px) while h3 kept MUI's 48px left a Heading 3 LARGER\n // than a Heading 2 — visible the moment the theme preview listed the\n // variants in size order. h3 carries zero `variant=\"h3\"` usages, the same\n // as h1 and h2, so this restyles no product surface; h4-h6 keep MUI's\n // scale because 95 usages ride on them.\n h3: {\n fontSize: '2.25rem',\n fontWeight: 700,\n lineHeight: 1.2,\n letterSpacing: '-0.015em',\n },\n // The three text rungs the brand uses that MUI's scale has no name for.\n // MUI runs 16 / 14 / 12 (`body1` / `body2` / `caption`); the brand's\n // pages want 17, 13 and 11, and with no token to ask for they write the\n // pixels instead. One marketing page alone can carry 286 such literals —\n // 165 of them the same 11px metadata line — each pinned to a size rather\n // than to the scale.\n //\n // Full variant objects rather than bare sizes, so one pick brings the\n // line height with it: `variant=\"micro\"` or, where the element's own\n // variant must stay, `fontSize: 'micro.fontSize'` — the token path the\n // Font Size picker already offers for `h4.fontSize`.\n //\n // Named for the job, not the number, so the name survives a retune: a\n // lede stays the lede if the brand moves it to 18px.\n lede: {\n fontSize: '1.0625rem',\n fontWeight: 400,\n lineHeight: 1.6,\n },\n bodyCompact: {\n fontSize: '0.8125rem',\n fontWeight: 400,\n lineHeight: 1.5,\n },\n micro: {\n fontSize: '0.6875rem',\n fontWeight: 400,\n lineHeight: 1.6,\n },\n },\n zIndex: {\n max: 2147483647,\n min: -2147483648,\n },\n}\n\nexport const consoleOptions: ThemeOptions = {\n ...baseOptions,\n palette: {\n mode: 'light',\n ...colorScheme.light,\n },\n}\nexport const consoleOptionsDark: ThemeOptions = {\n ...baseOptions,\n palette: {\n mode: 'dark',\n ...colorScheme.dark,\n },\n}\n\nexport const consoleThemeLight: Theme = createResponsiveTheme({\n themeOptions: { ...consoleOptions },\n})\nexport const consoleThemeDark: Theme = createResponsiveTheme({\n themeOptions: { ...consoleOptionsDark },\n})\n\nexport const consoleThemeCssVar = createResponsiveCssVarTheme(\n consoleThemeLight,\n consoleThemeDark,\n)\n\nexport const getConsoleTheme = (mode: 'light' | 'dark' = 'light') => {\n const theme = {\n light: consoleThemeLight,\n dark: consoleThemeDark,\n }\n return theme[mode]\n}\nexport const getConsoleMetaThemeColor = (mode: 'light' | 'dark' = 'light') => {\n const themeColor = {\n light: consoleThemeLight.palette.secondary.main,\n dark: consoleThemeDark.palette.primary.main,\n }\n return themeColor[mode]\n}\nexport default consoleThemeLight\n"],"names":["lightBlue","buildFontFamilyList","accentHoverFillColor","accentHoverTextColor","accentTextColor","createResponsiveTheme","createResponsiveCssVarTheme","colorScheme","light","primary","main","dark","contrastText","secondary","tertiary","surface","tint","inputOutline","background","default","paper","info","error","success","warning","grey","A100","A200","A400","A700","svgBackground","hover","active","focus","svgFilled","svgStroke","shadowKeyUmbraOpacity","shadowKeyPenumbraOpacity","shadowAmbientShadowOpacity","createShadowInset","px","join","baseOptions","components","MuiAppBar","defaultProps","enableColorOnDark","MuiAvatar","styleOverrides","root","width","height","MuiButton","color","theme","ownerState","accent","hoverFill","hoverText","pointerEvents","textDecoration","filter","MuiDialogContent","paddingTop","spacing","MuiFab","backgroundColor","MuiIconButton","padding","variants","props","variant","style","border","borderColor","MuiLink","MuiToolbar","disableGutters","breakpoints","up","paddingLeft","paddingRight","MuiTabs","indicatorColor","vars","palette","MuiTooltip","arrow","shadowsInset","shape","borderRadius","appIconBorderRadius","typography","fontFamily","fontWeightSemiBold","fontWeightExtraBold","fontWeightBlack","displayXl","fontSize","fontWeight","lineHeight","letterSpacing","h1","h2","h3","lede","bodyCompact","micro","zIndex","max","min","consoleOptions","mode","consoleOptionsDark","consoleThemeLight","themeOptions","consoleThemeDark","consoleThemeCssVar","getConsoleTheme","getConsoleMetaThemeColor","themeColor"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,SAAS,QAAQ,uBAAsB;AAEhD,SAASC,mBAAmB,QAAQ,iBAAa;AACjD,SACEC,oBAAoB,EACpBC,oBAAoB,EACpBC,eAAe,QACV,wBAAoB;AAC3B,OAAOC,yBACLC,2BAA2B,QACtB,oCAAgC;AAcvC,MAAMC,cAAc;IAClBC,OAAO;QACL,oEAAoE;QACpE,wEAAwE;QACxE,oEAAoE;QACpE,iEAAiE;QACjEC,SAAS;YACPC,MAAM;YACN,uDAAuD;YACvD,mEAAmE;YACnE,mEAAmE;YACnE,iEAAiE;YACjE,qEAAqE;YACrE,4DAA4D;YAC5DC,MAAM;YACNC,cAAc;QAChB;QAC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AC3D8G,cAAc,aAAKF;AACrB,GAAE;AAEF,OAAO,MAAMI,qBAAqB/G,4BAChC4G,mBACAE,kBACD;AAED,OAAO,MAAME,kBAAkB,CAACN,OAAyB,OAAO;IAC9D,MAAM1D,QAAQ;QACZ9C,OAAO0G;QACPvG,MAAMyG;IACR;IACA,OAAO9D,KAAK,CAAC0D,KAAK;AACpB,EAAC;AACD,OAAO,MAAMO,2BAA2B,CAACP,OAAyB,OAAO;IACvE,MAAMQ,aAAa;QACjBhH,OAAO0G,kBAAkB7B,OAAO,CAACxE,SAAS,CAACH,IAAI;QAC/CC,MAAMyG,iBAAiB/B,OAAO,CAAC5E,OAAO,CAACC,IAAI;IAC7C;IACA,OAAO8G,UAAU,CAACR,KAAK;AACzB,EAAC;AACD,eAAeE,kBAAiB"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import type
|
|
17
|
+
import { type Palette, type PaletteColor, type Theme } from '../../vendor/mui';
|
|
18
18
|
/**
|
|
19
19
|
* The palette slot that carries "this accent, rendered AS TEXT on the
|
|
20
20
|
* scheme's own surfaces" (AGL-1293 / AGL-1297).
|
|
@@ -58,6 +58,77 @@ export declare const AA_NON_TEXT_CONTRAST = 3;
|
|
|
58
58
|
* `undefined`.
|
|
59
59
|
*/
|
|
60
60
|
export declare function accentTextColor(theme: Theme | undefined, color: string | undefined): string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The palette slot that carries "this accent's FILL under the pointer": the
|
|
63
|
+
* background a contained Button or a Fab takes on hover, painted under the
|
|
64
|
+
* accent's own `contrastText` (AGL-3465).
|
|
65
|
+
*
|
|
66
|
+
* MUI paints that hover with `palette[color].dark`, and `dark` here is
|
|
67
|
+
* {@link ACCENT_TEXT_SHADE} — chosen to be READ ON the page, so it is LIGHTER
|
|
68
|
+
* than `main` in a dark scheme. A white label on the console's dark-scheme
|
|
69
|
+
* `primary.dark` measures 1.91:1; on the tenant default's `#5e9fe0`,
|
|
70
|
+
* 2.80:1. The fill and the text shade answer different questions, so they
|
|
71
|
+
* get different slots, and `createResponsiveTheme` derives this one for
|
|
72
|
+
* every palette color with a `contrastText` — see {@link hoverFillShade}.
|
|
73
|
+
*/
|
|
74
|
+
export declare const ACCENT_HOVER_FILL: "hover";
|
|
75
|
+
/**
|
|
76
|
+
* The hover fill for `color`, as a value safe to hand to a `styleOverrides`
|
|
77
|
+
* root — the counterpart of {@link accentTextColor}, and resolved the same
|
|
78
|
+
* way: a `var()` on a CSS-vars theme so it follows the scheme, a literal on
|
|
79
|
+
* a single-mode theme. Wired into `MuiButton`'s contained hover and
|
|
80
|
+
* `MuiFab`'s hover in `console.theme.ts`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function accentHoverFillColor(theme: Theme | undefined, color: string | undefined): string | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The palette slot that carries "this accent as TEXT, on its own hover
|
|
85
|
+
* wash": the label of a hovered text or outlined Button (AGL-3465).
|
|
86
|
+
*
|
|
87
|
+
* MUI hovers those two variants by laying `main` at
|
|
88
|
+
* `palette.action.hoverOpacity` over whatever they sit on, and leaves the
|
|
89
|
+
* label on {@link ACCENT_TEXT_SHADE}. That shade is held to 4.5:1 against
|
|
90
|
+
* the bare page and paper, so one sitting near the bar drops under it the
|
|
91
|
+
* moment the wash lands — the console's light-scheme `primary.dark` goes
|
|
92
|
+
* from 4.54:1 to 4.37:1 on the page. This slot is the same shade walked on
|
|
93
|
+
* until it clears the washed surfaces too, and equals `dark` wherever `dark`
|
|
94
|
+
* already does.
|
|
95
|
+
*/
|
|
96
|
+
export declare const ACCENT_HOVER_TEXT: "hoverText";
|
|
97
|
+
/**
|
|
98
|
+
* The hovered text/outlined label for `color`, resolved like
|
|
99
|
+
* {@link accentTextColor}. Wired into `MuiButton`'s hover in
|
|
100
|
+
* `console.theme.ts`.
|
|
101
|
+
*/
|
|
102
|
+
export declare function accentHoverTextColor(theme: Theme | undefined, color: string | undefined): string | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* `ink` as it actually renders on `fill`. A `contrastText` such as
|
|
105
|
+
* `#000000DE` is translucent, so the color a reader sees is the blend; the
|
|
106
|
+
* contrast of that blend is the honest number.
|
|
107
|
+
*/
|
|
108
|
+
export declare function inkOnFill(ink: string, fill: string): string;
|
|
109
|
+
/** Contrast of `ink` rendered on `fill`, alpha included. */
|
|
110
|
+
export declare function inkContrast(ink: string, fill: string): number;
|
|
111
|
+
/**
|
|
112
|
+
* The hover fill of one palette color: a shade of `main` that visibly
|
|
113
|
+
* differs from it and still carries `contrastText` at `minContrast`.
|
|
114
|
+
*
|
|
115
|
+
* In order:
|
|
116
|
+
* 1. `dark`, when it already does both. That is MUI's own hover, and every
|
|
117
|
+
* palette whose hover was legible keeps it byte-identical.
|
|
118
|
+
* 2. Otherwise `main` stepped by `tonalOffset` AWAY from the ink — darker
|
|
119
|
+
* under a light label, lighter under a dark one — then walked further
|
|
120
|
+
* the same way until the ink clears the bar. Away from the ink is the
|
|
121
|
+
* one direction in which every step raises the ratio.
|
|
122
|
+
* 3. If that step is too small to see — a fill already at the pole the ink
|
|
123
|
+
* is not, like white under black — `main` stepped TOWARD the ink, as long
|
|
124
|
+
* as the ink still clears the bar there.
|
|
125
|
+
*
|
|
126
|
+
* Throws on an unparseable color; the theme pass that calls it leaves such
|
|
127
|
+
* a palette color without the slot.
|
|
128
|
+
*/
|
|
129
|
+
export declare function hoverFillShade(color: Pick<PaletteColor, 'main' | 'contrastText'> & {
|
|
130
|
+
dark?: string;
|
|
131
|
+
}, tonalOffset?: number, minContrast?: number): string;
|
|
61
132
|
/**
|
|
62
133
|
* The accent shade a FILLED surface can paint under the accent's own ink —
|
|
63
134
|
* the counterpart to {@link accentTextColor}, and a different value for a
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
1
2
|
/**
|
|
2
3
|
* @license
|
|
3
4
|
* Copyright 2026 Aglyn LLC
|
|
@@ -13,8 +14,8 @@
|
|
|
13
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
15
|
* See the License for the specific language governing permissions and
|
|
15
16
|
* limitations under the License.
|
|
16
|
-
*/ import {
|
|
17
|
-
import { AA_TEXT_CONTRAST, accessibleShade, contrastRatio } from "./accessible-shade.js";
|
|
17
|
+
*/ import { darken, decomposeColor, hslToRgb, lighten, rgbToHex } from "../../vendor/mui.js";
|
|
18
|
+
import { AA_TEXT_CONTRAST, accessibleShade, contrastRatio, relativeLuminance } from "./accessible-shade.js";
|
|
18
19
|
/**
|
|
19
20
|
* The palette slot that carries "this accent, rendered AS TEXT on the
|
|
20
21
|
* scheme's own surfaces" (AGL-1293 / AGL-1297).
|
|
@@ -55,6 +56,15 @@ import { AA_TEXT_CONTRAST, accessibleShade, contrastRatio } from "./accessible-s
|
|
|
55
56
|
* PaletteColor shape (`'inherit'`, `'textPrimary'`, `undefined`) returns
|
|
56
57
|
* `undefined`.
|
|
57
58
|
*/ export function accentTextColor(theme, color) {
|
|
59
|
+
return paletteSlot(theme, color, ACCENT_TEXT_SHADE);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* One slot of one palette color, as a value safe to hand to a
|
|
63
|
+
* `styleOverrides` root: a `var(--mui-palette-…)` reference on a CSS-vars
|
|
64
|
+
* theme, a literal on a single-mode theme. `undefined` for anything without
|
|
65
|
+
* a PaletteColor shape (`'inherit'`, `'textPrimary'`, `undefined`) or a
|
|
66
|
+
* palette that lacks the slot.
|
|
67
|
+
*/ function paletteSlot(theme, color, slot) {
|
|
58
68
|
var _theme_vars;
|
|
59
69
|
var _source_palette;
|
|
60
70
|
if (!theme || !color) return undefined;
|
|
@@ -63,8 +73,115 @@ import { AA_TEXT_CONTRAST, accessibleShade, contrastRatio } from "./accessible-s
|
|
|
63
73
|
const source = (_theme_vars = theme.vars) != null ? _theme_vars : theme;
|
|
64
74
|
const paletteColor = source == null ? void 0 : (_source_palette = source.palette) == null ? void 0 : _source_palette[color];
|
|
65
75
|
if (!paletteColor || typeof paletteColor !== 'object') return undefined;
|
|
66
|
-
const
|
|
67
|
-
return typeof
|
|
76
|
+
const value = paletteColor[slot];
|
|
77
|
+
return typeof value === 'string' ? value : undefined;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The palette slot that carries "this accent's FILL under the pointer": the
|
|
81
|
+
* background a contained Button or a Fab takes on hover, painted under the
|
|
82
|
+
* accent's own `contrastText` (AGL-3465).
|
|
83
|
+
*
|
|
84
|
+
* MUI paints that hover with `palette[color].dark`, and `dark` here is
|
|
85
|
+
* {@link ACCENT_TEXT_SHADE} — chosen to be READ ON the page, so it is LIGHTER
|
|
86
|
+
* than `main` in a dark scheme. A white label on the console's dark-scheme
|
|
87
|
+
* `primary.dark` measures 1.91:1; on the tenant default's `#5e9fe0`,
|
|
88
|
+
* 2.80:1. The fill and the text shade answer different questions, so they
|
|
89
|
+
* get different slots, and `createResponsiveTheme` derives this one for
|
|
90
|
+
* every palette color with a `contrastText` — see {@link hoverFillShade}.
|
|
91
|
+
*/ export const ACCENT_HOVER_FILL = 'hover';
|
|
92
|
+
/**
|
|
93
|
+
* The hover fill for `color`, as a value safe to hand to a `styleOverrides`
|
|
94
|
+
* root — the counterpart of {@link accentTextColor}, and resolved the same
|
|
95
|
+
* way: a `var()` on a CSS-vars theme so it follows the scheme, a literal on
|
|
96
|
+
* a single-mode theme. Wired into `MuiButton`'s contained hover and
|
|
97
|
+
* `MuiFab`'s hover in `console.theme.ts`.
|
|
98
|
+
*/ export function accentHoverFillColor(theme, color) {
|
|
99
|
+
return paletteSlot(theme, color, ACCENT_HOVER_FILL);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The palette slot that carries "this accent as TEXT, on its own hover
|
|
103
|
+
* wash": the label of a hovered text or outlined Button (AGL-3465).
|
|
104
|
+
*
|
|
105
|
+
* MUI hovers those two variants by laying `main` at
|
|
106
|
+
* `palette.action.hoverOpacity` over whatever they sit on, and leaves the
|
|
107
|
+
* label on {@link ACCENT_TEXT_SHADE}. That shade is held to 4.5:1 against
|
|
108
|
+
* the bare page and paper, so one sitting near the bar drops under it the
|
|
109
|
+
* moment the wash lands — the console's light-scheme `primary.dark` goes
|
|
110
|
+
* from 4.54:1 to 4.37:1 on the page. This slot is the same shade walked on
|
|
111
|
+
* until it clears the washed surfaces too, and equals `dark` wherever `dark`
|
|
112
|
+
* already does.
|
|
113
|
+
*/ export const ACCENT_HOVER_TEXT = 'hoverText';
|
|
114
|
+
/**
|
|
115
|
+
* The hovered text/outlined label for `color`, resolved like
|
|
116
|
+
* {@link accentTextColor}. Wired into `MuiButton`'s hover in
|
|
117
|
+
* `console.theme.ts`.
|
|
118
|
+
*/ export function accentHoverTextColor(theme, color) {
|
|
119
|
+
return paletteSlot(theme, color, ACCENT_HOVER_TEXT);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The smallest contrast ratio between a fill and its hover shade that still
|
|
123
|
+
* reads as a change. Below it the pointer gets no feedback at all — the
|
|
124
|
+
* failure a near-white fill hits when it is lightened.
|
|
125
|
+
*/ const MIN_HOVER_STEP = 1.1;
|
|
126
|
+
/**
|
|
127
|
+
* `ink` as it actually renders on `fill`. A `contrastText` such as
|
|
128
|
+
* `#000000DE` is translucent, so the color a reader sees is the blend; the
|
|
129
|
+
* contrast of that blend is the honest number.
|
|
130
|
+
*/ export function inkOnFill(ink, fill) {
|
|
131
|
+
var _foreground_values_;
|
|
132
|
+
const foreground = rgbChannels(ink);
|
|
133
|
+
const alpha = foreground.type.endsWith('a') ? (_foreground_values_ = foreground.values[3]) != null ? _foreground_values_ : 1 : 1;
|
|
134
|
+
if (alpha >= 1) return ink;
|
|
135
|
+
const background = rgbChannels(fill);
|
|
136
|
+
const channels = [
|
|
137
|
+
0,
|
|
138
|
+
1,
|
|
139
|
+
2
|
|
140
|
+
].map((index)=>Math.round(foreground.values[index] * alpha + background.values[index] * (1 - alpha)));
|
|
141
|
+
return `rgb(${channels.join(', ')})`;
|
|
142
|
+
}
|
|
143
|
+
/** A color decomposed into 0–255 RGB channels, whatever notation it came in. */ function rgbChannels(color) {
|
|
144
|
+
const decomposed = decomposeColor(color);
|
|
145
|
+
return decomposed.type.startsWith('hsl') ? decomposeColor(hslToRgb(color)) : decomposed;
|
|
146
|
+
}
|
|
147
|
+
/** Contrast of `ink` rendered on `fill`, alpha included. */ export function inkContrast(ink, fill) {
|
|
148
|
+
return contrastRatio(inkOnFill(ink, fill), fill);
|
|
149
|
+
}
|
|
150
|
+
/** How far each further step of the hover-fill walk moves the fill. */ const HOVER_WALK_STEP = 0.1;
|
|
151
|
+
/**
|
|
152
|
+
* The hover fill of one palette color: a shade of `main` that visibly
|
|
153
|
+
* differs from it and still carries `contrastText` at `minContrast`.
|
|
154
|
+
*
|
|
155
|
+
* In order:
|
|
156
|
+
* 1. `dark`, when it already does both. That is MUI's own hover, and every
|
|
157
|
+
* palette whose hover was legible keeps it byte-identical.
|
|
158
|
+
* 2. Otherwise `main` stepped by `tonalOffset` AWAY from the ink — darker
|
|
159
|
+
* under a light label, lighter under a dark one — then walked further
|
|
160
|
+
* the same way until the ink clears the bar. Away from the ink is the
|
|
161
|
+
* one direction in which every step raises the ratio.
|
|
162
|
+
* 3. If that step is too small to see — a fill already at the pole the ink
|
|
163
|
+
* is not, like white under black — `main` stepped TOWARD the ink, as long
|
|
164
|
+
* as the ink still clears the bar there.
|
|
165
|
+
*
|
|
166
|
+
* Throws on an unparseable color; the theme pass that calls it leaves such
|
|
167
|
+
* a palette color without the slot.
|
|
168
|
+
*/ export function hoverFillShade(color, tonalOffset = 0.3, minContrast = AA_TEXT_CONTRAST) {
|
|
169
|
+
const { main, dark, contrastText: ink } = color;
|
|
170
|
+
const visible = (fill)=>contrastRatio(main, fill) >= MIN_HOVER_STEP;
|
|
171
|
+
const legible = (fill)=>inkContrast(ink, fill) >= minContrast;
|
|
172
|
+
if (typeof dark === 'string' && visible(dark) && legible(dark)) return dark;
|
|
173
|
+
const away = relativeLuminance(inkOnFill(ink, main)) > relativeLuminance(main) ? 'darken' : 'lighten';
|
|
174
|
+
const shift = (fill, direction, amount)=>rgbToHex(direction === 'darken' ? darken(fill, amount) : lighten(fill, amount));
|
|
175
|
+
let awayFill = shift(main, away, tonalOffset);
|
|
176
|
+
while(!legible(awayFill)){
|
|
177
|
+
const next = shift(awayFill, away, HOVER_WALK_STEP);
|
|
178
|
+
// At the pole: nothing further exists in this direction.
|
|
179
|
+
if (next === awayFill) break;
|
|
180
|
+
awayFill = next;
|
|
181
|
+
}
|
|
182
|
+
if (visible(awayFill)) return awayFill;
|
|
183
|
+
const towardFill = shift(main, away === 'darken' ? 'lighten' : 'darken', tonalOffset);
|
|
184
|
+
return legible(towardFill) ? towardFill : awayFill;
|
|
68
185
|
}
|
|
69
186
|
/**
|
|
70
187
|
* The accent shade a FILLED surface can paint under the accent's own ink —
|