@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/ui/theme/src/lib/util/self-hosted-fonts.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 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 type { HostTheme } from '@aglyn/shared-data-types'\n\n/**\n * A theme's Google fonts, served from the site's own origin (AGL-3485).\n *\n * A published page loaded its theme font as a `<link rel=\"stylesheet\">` to\n * `fonts.googleapis.com`: a render-blocking request to a third origin, then a\n * second connection to `fonts.gstatic.com` for the files it names — about\n * 800 ms before first paint on the page Lighthouse measured. Nothing about a\n * theme font needs either round trip at view time. The stylesheet is a short\n * list of `@font-face` rules that changes only when the theme does, and the\n * files are versioned in their own paths (`/s/inter/v18/…woff2`), so neither\n * changes under a URL.\n *\n * So the server fetches the stylesheet once, keeps the rules, and inlines them\n * in the page with each `src` pointing at {@link SELF_HOSTED_FONT_ROUTE} on the\n * site's own origin, which serves the file with a year-long `immutable`\n * policy. The one or two faces the first screen paints with are preloaded.\n * Nothing on the page asks Google for anything, which also means a visitor's\n * address is no longer handed to Google by every page view.\n *\n * This module is the pure half: reading Google's stylesheet, writing the\n * rules back, and choosing the faces to preload. The fetching and the file\n * route live with the tenant (`libs/tenant/runtime/.../self-hosted-fonts.ts`).\n *\n * The rules are REBUILT from validated fields rather than echoed, so the\n * inlined CSS can only ever contain a family name the theme chose, a style, a\n * weight, a unicode range and a path on our own route.\n */\n\n/** Where a site serves its theme's font files from. */\nexport const SELF_HOSTED_FONT_ROUTE = '/api/fonts'\n\n/** The origin Google serves font files from. */\nexport const GOOGLE_FONT_FILE_ORIGIN = 'https://fonts.gstatic.com'\n\n/**\n * A font file's path on {@link GOOGLE_FONT_FILE_ORIGIN} below `/s/`, as the\n * route accepts it: `{family}/v{n}/{file}.woff2`. Anything else is refused,\n * so the route can never be used to fetch an arbitrary URL.\n */\nconst FONT_FILE_PATH = /^[a-z0-9]+\\/v\\d{1,4}\\/[A-Za-z0-9_-]{1,200}\\.woff2$/\n\n/** One `@font-face` rule from Google's stylesheet. */\nexport interface GoogleFontFace {\n family: string\n style: 'normal' | 'italic'\n /** A weight (`400`) or, for a variable font, a range (`100 900`). */\n weight: string\n /** Google's subset comment above the rule (`latin`, `latin-ext`, …). */\n subset?: string\n /** The file's path below `/s/` on Google's origin. */\n path: string\n unicodeRange?: string\n}\n\n/** Whether a path is one {@link SELF_HOSTED_FONT_ROUTE} will serve. */\nexport function isSelfHostedFontPath(path: string): boolean {\n return FONT_FILE_PATH.test(path)\n}\n\n/** The site-relative URL a face's file is served from. */\nexport function selfHostedFontUrl(path: string): string {\n return `${SELF_HOSTED_FONT_ROUTE}/${path}`\n}\n\n/** Google's own URL for a self-hosted path. */\nexport function googleFontFileUrl(path: string): string {\n return `${GOOGLE_FONT_FILE_ORIGIN}/s/${path}`\n}\n\nconst FACE_BLOCK = /(?:\\/\\*\\s*([a-z0-9-]+)\\s*\\*\\/\\s*)?@font-face\\s*\\{([^}]*)\\}/g\nconst FAMILY = /font-family:\\s*'([^']{1,80})'/\nconst STYLE = /font-style:\\s*(normal|italic)/\nconst WEIGHT = /font-weight:\\s*(\\d{3}(?:\\s+\\d{3})?)/\nconst SRC = /src:\\s*url\\((https:\\/\\/fonts\\.gstatic\\.com\\/s\\/[^)\\s]+)\\)\\s*format\\('woff2'\\)/\nconst RANGE = /unicode-range:\\s*([U+0-9A-Fa-f?,\\s-]{1,4000});/\n\n/**\n * Reads the `@font-face` rules out of a Google Fonts CSS2 stylesheet fetched\n * with a browser that accepts WOFF2. A rule that is not exactly the shape\n * Google writes — a missing field, a file off Google's origin, a path the\n * route would refuse — is dropped, never repaired.\n */\nexport function parseGoogleFontFaces(css: string): GoogleFontFace[] {\n const faces: GoogleFontFace[] = []\n for (const match of css.matchAll(FACE_BLOCK)) {\n const [, subset, body] = match\n const family = FAMILY.exec(body)?.[1]\n const style = STYLE.exec(body)?.[1] as GoogleFontFace['style'] | undefined\n const weight = WEIGHT.exec(body)?.[1]\n const url = SRC.exec(body)?.[1]\n if (!family || !style || !weight || !url) continue\n const path = url.slice(`${GOOGLE_FONT_FILE_ORIGIN}/s/`.length)\n if (!isSelfHostedFontPath(path)) continue\n const unicodeRange = RANGE.exec(body)?.[1]?.trim()\n faces.push({\n family,\n style,\n weight: weight.replace(/\\s+/g, ' '),\n ...(subset ? { subset } : {}),\n path,\n ...(unicodeRange ? { unicodeRange } : {}),\n })\n }\n return faces\n}\n\n/** A family name as it may appear quoted in CSS. */\nfunction cssFamily(family: string): string {\n return `'${family.replace(/['\\\\\\n\\r]/g, '')}'`\n}\n\n/**\n * The faces as `@font-face` rules on the site's own route, every one\n * `font-display: swap` so text paints in the fallback while a file loads.\n *\n * Every subset Google declared is kept, each with its `unicode-range`: a\n * browser downloads a subset only when the page uses a character in it, so\n * the Cyrillic file costs an English page nothing, and a Polish or Greek page\n * keeps its typeface. Only the Latin faces are preloaded.\n */\nexport function selfHostedFontFaceCss(faces: readonly GoogleFontFace[]): string {\n return faces\n .map((face) =>\n [\n '@font-face{',\n `font-family:${cssFamily(face.family)};`,\n `font-style:${face.style};`,\n `font-weight:${face.weight};`,\n 'font-display:swap;',\n `src:url(${selfHostedFontUrl(face.path)}) format('woff2');`,\n face.unicodeRange ? `unicode-range:${face.unicodeRange};` : '',\n '}',\n ].join(''),\n )\n .join('')\n}\n\n/** The first family named in a CSS `font-family` stack. */\nfunction firstFamily(stack: unknown): string | undefined {\n if (typeof stack !== 'string') return undefined\n const first = stack.split(',')[0]?.trim().replace(/^['\"]|['\"]$/g, '')\n return first || undefined\n}\n\n/** How far a face is from a wanted weight; 0 when its range covers it. */\nfunction weightDistance(face: GoogleFontFace, wanted: number): number {\n const [low, high = low] = face.weight.split(' ').map(Number)\n if (wanted >= low && wanted <= high) return 0\n return Math.min(Math.abs(wanted - low), Math.abs(wanted - high))\n}\n\n/** The Latin, upright face of `family` closest to `weight`. */\nfunction latinFace(\n faces: readonly GoogleFontFace[],\n family: string | undefined,\n weight: number,\n): GoogleFontFace | undefined {\n if (!family) return undefined\n const wanted = family.toLowerCase()\n const candidates = faces.filter(\n (face) =>\n face.family.toLowerCase() === wanted &&\n face.style === 'normal' &&\n (face.subset === undefined || face.subset === 'latin'),\n )\n return candidates.sort(\n (a, b) => weightDistance(a, weight) - weightDistance(b, weight),\n )[0]\n}\n\n/**\n * The paths of the one or two faces the first screen paints with: the body\n * text's face, and the headline's when it is a different file. Those are the\n * fonts the largest text on the page — usually the LCP element — waits for,\n * so they are worth starting with the document; every other face is fetched\n * when the page first uses it.\n *\n * The body face is the theme's `fontFamily` (else the first Google font it\n * loads) at `body1`'s weight, 400 by default; the headline face is `h1`'s\n * family and weight, 700 by default. A variable font serves every weight\n * from one file, which is then preloaded once.\n */\nexport function selfHostedFontPreloads(\n theme: Pick<HostTheme, 'fonts' | 'typography'> | undefined,\n faces: readonly GoogleFontFace[],\n): string[] {\n const typography = theme?.typography\n const variants = typography?.variants\n const fallback = theme?.fonts?.find(\n (font) => (font.source ?? 'google') === 'google',\n )?.family\n const bodyFamily = firstFamily(typography?.fontFamily) ?? fallback\n const body = latinFace(faces, bodyFamily, variants?.body1?.fontWeight ?? 400)\n const heading = latinFace(\n faces,\n firstFamily(variants?.h1?.fontFamily) ?? bodyFamily,\n variants?.h1?.fontWeight ?? 700,\n )\n const paths = [body, heading]\n .filter((face): face is GoogleFontFace => Boolean(face))\n .map((face) => selfHostedFontUrl(face.path))\n return [...new Set(paths)]\n}\n"],"names":["SELF_HOSTED_FONT_ROUTE","GOOGLE_FONT_FILE_ORIGIN","FONT_FILE_PATH","isSelfHostedFontPath","path","test","selfHostedFontUrl","googleFontFileUrl","FACE_BLOCK","FAMILY","STYLE","WEIGHT","SRC","RANGE","parseGoogleFontFaces","css","faces","match","matchAll","subset","body","family","exec","style","weight","url","slice","length","unicodeRange","trim","push","replace","cssFamily","selfHostedFontFaceCss","map","face","join","firstFamily","stack","undefined","first","split","weightDistance","wanted","low","high","Number","Math","min","abs","latinFace","toLowerCase","candidates","filter","sort","a","b","selfHostedFontPreloads","theme","variants","typography","fallback","fonts","find","font","source","bodyFamily","fontFamily","body1","fontWeight","heading","h1","paths","Boolean","Set"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GAED,qDAAqD,GACrD,OAAO,MAAMA,yBAAyB,aAAY;AAElD,8CAA8C,GAC9C,OAAO,MAAMC,0BAA0B,4BAA2B;AAElE;;;;CAIC,GACD,MAAMC,iBAAiB;AAevB,qEAAqE,GACrE,OAAO,SAASC,qBAAqBC,IAAY;IAC/C,OAAOF,eAAeG,IAAI,CAACD;AAC7B;AAEA,wDAAwD,GACxD,OAAO,SAASE,kBAAkBF,IAAY;IAC5C,OAAO,GAAGJ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iCsC,QAAQtC,OACjDD,GAAG,CAAC,CAACC,OAAS7B,kBAAkB6B,KAAK/B,IAAI;IAC5C,OAAO;WAAI,IAAIsE,IAAIF;KAAO;AAC5B"}
|
package/src/vendor/mui.d.ts
CHANGED
|
@@ -136,6 +136,31 @@ declare module '@mui/material/styles' {
|
|
|
136
136
|
secondary: string;
|
|
137
137
|
tertiary: string;
|
|
138
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* A color's two HOVER shades (AGL-3465), read by the `MuiButton` and
|
|
141
|
+
* `MuiFab` overrides — `ACCENT_HOVER_FILL` and `ACCENT_HOVER_TEXT` in
|
|
142
|
+
* `util/accent-text.ts`.
|
|
143
|
+
*
|
|
144
|
+
* - `hover` — the fill a contained Button or a Fab takes on hover,
|
|
145
|
+
* carrying `contrastText` at AA. Not `dark`: that slot is the accent
|
|
146
|
+
* rendered as TEXT, lighter than `main` in a dark scheme, and a light
|
|
147
|
+
* label on it disappears.
|
|
148
|
+
* - `hoverText` — the label of a hovered text or outlined Button: `dark`,
|
|
149
|
+
* walked until it clears AA on MUI's hover wash as well as on the bare
|
|
150
|
+
* page and paper.
|
|
151
|
+
*
|
|
152
|
+
* `createResponsiveTheme` derives both, which is why they are optional on
|
|
153
|
+
* each side: a theme built with plain `createTheme` has neither, and an
|
|
154
|
+
* author may set one.
|
|
155
|
+
*/
|
|
156
|
+
interface PaletteColor {
|
|
157
|
+
hover?: string;
|
|
158
|
+
hoverText?: string;
|
|
159
|
+
}
|
|
160
|
+
interface SimplePaletteColorOptions {
|
|
161
|
+
hover?: string;
|
|
162
|
+
hoverText?: string;
|
|
163
|
+
}
|
|
139
164
|
/**
|
|
140
165
|
* START EXAMPLE – MODULE AUGMENTATION ↓
|
|
141
166
|
* ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄
|
package/src/vendor/mui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/shared/ui/theme/src/vendor/mui.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 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 type { Theme as MuiTheme } from '@mui/material/styles'\nimport type {\n Color as MuiColor,\n CssVarsTheme,\n CSSProperties,\n Shadows,\n} from '@mui/material/styles'\n// import type { ExtraColorOptions } from '@mui/material/styles/createPalette'\n// import type { WithStyles } from '@mui/styles'\n// import type { ClassKeyInferable } from '@mui/styles/withStyles'\nimport type { ColorPropOverrides, IActionStates } from '../lib/theme.types'\n// import type {ContainerTypeMap} from '@mui/material/Container'\n\n// _____ _______ ____ ____ ___ ____ _____ ____\n// / _ \\ \\ / / ____| _ \\| _ \\|_ _| _ \\| ____/ ___|\n// | | | \\ \\ / /| _| | |_) | |_) || || | | | _| \\___ \\\n// | |_| |\\ V / | |___| _ <| _ < | || |_| | |___ ___) |\n// \\___/ \\_/ |_____|_| \\_\\_| \\_\\___|____/|_____|____/\n\ndeclare module '@mui/material/Button' {\n interface ButtonPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/ButtonGroup' {\n interface ButtonGroupPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Container' {\n interface ContainerOwnProps {\n variant?: 'vertical' | 'horizontal' | 'boxed'\n }\n}\n/**\n * `<Typography variant=\"lede\">` and its two siblings (AGL-1308).\n *\n * The `TypographyVariants` augmentation further down puts the three variants\n * on the THEME; this is what lets a component ASK for one. Declaring the theme\n * side alone is the half-fix that compiles the theme and then rejects every\n * use of it — the same trap `TypographyVariantsOptions` without\n * `TypographyVariants` sets, one level up.\n */\ndeclare module '@mui/material/Typography' {\n interface TypographyPropsVariantOverrides {\n lede: true\n bodyCompact: true\n micro: true\n displayXl: true\n }\n}\ndeclare module '@mui/material/ToggleButtonGroup' {\n interface ToggleButtonGroupPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Fab' {\n interface FabPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/SvgIcon' {\n interface SvgIconPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/AppBar' {\n interface AppBarPropsColorOverrides extends ColorPropOverrides {\n surface: true\n }\n}\ndeclare module '@mui/material/Chip' {\n interface ChipPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/IconButton' {\n // Was `AppBarPropsColorOverrides` — a copy-paste from the block above, so\n // this augmented nothing and IconButton never accepted `tertiary`.\n interface IconButtonPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Tabs' {\n interface TabsPropsIndicatorColorOverrides extends ColorPropOverrides {}\n}\n// Tertiary everywhere primary and secondary are (AGL-3411). Each of these\n// already renders any palette color with a `main` — MUI builds their color\n// styles from the palette's entries — so tertiary worked at runtime and was\n// only refused by the types.\ndeclare module '@mui/material/Checkbox' {\n interface CheckboxPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Radio' {\n interface RadioPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Switch' {\n interface SwitchPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Slider' {\n interface SliderPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Badge' {\n interface BadgePropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/CircularProgress' {\n interface CircularProgressPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/LinearProgress' {\n interface LinearProgressPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Pagination' {\n interface PaginationPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/PaginationItem' {\n interface PaginationItemPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/system' {\n interface Shape {\n appIconBorderRadius: number | string\n }\n}\ndeclare module '@mui/material/styles' {\n type ExtraColor = Palette['primary']\n type ExtraColorOptions = PaletteOptions['primary']\n\n /**\n * Pale accent washes used as SURFACES (AGL-1244) — `tint.primary`,\n * `tint.secondary`, `tint.tertiary`.\n *\n * A group of string leaves like `background` and `text`, NOT a\n * `PaletteColor`: there is no ramp to walk and no `contrastText`, because a\n * tint is never a component `color` — the ink on it is the accent token the\n * tile's icon already uses. That is also why `tint` is absent from\n * `ColorPropOverrides`: `<Button color=\"tint\">` would have no foreground to\n * pair with and must stay a type error.\n */\n interface PaletteTint {\n primary: string\n secondary: string\n tertiary: string\n }\n\n /**\n * START EXAMPLE – MODULE AUGMENTATION ↓\n * ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄\n * ```typescript\n * // Add new property ↓\n * declare module '@mui/material/styles' {\n * interface Theme {\n * status: {\n * danger: React.CSSProperties['color'],\n * }\n * }\n * interface ThemeOptions {\n * status: {\n * danger: React.CSSProperties['color']\n * }\n * }\n * }\n * const theme = createMuiTheme({\n * status: {\n * danger: '#e53e3e',\n * },\n * })\n *\n * // Add to existing property (e.g., palette, typography) ↓\n * declare module \"@mui/material/styles\" {\n * interface Palette {\n * neutral: Palette['primary']\n * }\n * interface PaletteOptions {\n * neutral: PaletteOptions['primary']\n * }\n * }\n * const theme = createMuiTheme({\n * palette: {\n * neutral: {\n * main: '#5c6ac4',\n * },\n * },\n * })\n * ```\n * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n * END EXAMPLE – MODULE AUGMENTATION ↑\n */\n\n /**\n * The resting border of an outlined input.\n *\n * A token because MUI has none: `OutlinedInput` hardcodes\n * `rgba(0, 0, 0, 0.23)` / `rgba(255, 255, 255, 0.23)` inside its own\n * styles, so there is nothing on the theme to read. Anything that has to\n * draw an input BESIDE a MUI one — Stripe Elements, which paints its fields\n * inside a cross-origin iframe from an `appearance` object we hand it — can\n * otherwise only match by copying those literals, and the copy silently\n * stops matching the first time the scheme moves.\n *\n * Deliberately NOT `divider` (`rgba(0, 0, 0, 0.12)`): half the weight, so a\n * field drawn with it reads as a different, lighter control sitting next to\n * ours — which is precisely the mismatch this token exists to prevent.\n *\n * A string leaf like `background` and `text`, not a `PaletteColor`: there is\n * no ramp and no `contrastText`, because nothing is ever drawn ON it.\n */\n interface PaletteOptions {\n background?: PaletteOptions['background']\n tertiary?: ExtraColorOptions\n surface?: ExtraColorOptions\n tint?: Partial<PaletteTint>\n inputOutline?: string\n svgBackground?: IActionStates\n svgFilled?: IActionStates\n svgStroke?: IActionStates\n text?: PaletteOptions['text']\n }\n\n interface TypeBackground {}\n\n interface Palette {\n background: Palette['background']\n tertiary: ExtraColor\n surface: ExtraColor\n inputOutline: string\n tint: PaletteTint\n svgBackground: IActionStates\n svgFilled: IActionStates\n svgStroke: IActionStates\n text: Palette['text']\n }\n\n /**\n * The brand's extra rungs on the font-weight scale (AGL-1308).\n *\n * MUI ships four — `fontWeightLight/Regular/Medium/Bold` — and the brand\n * adds three above them: 600, 800 and 900, all real weights because Roboto\n * Flex is a variable face covering 100–1000. Declaring them here is what\n * makes `createTheme({ typography: { fontWeightSemiBold: 600 } })` compile;\n * without the augmentation `TypographyVariantsOptions` is a closed shape and\n * the theme itself does not typecheck.\n *\n * They are reachable the way the built-ins are: `@mui/system`'s `style()`\n * retries a miss as `${prop}${capitalize(value)}`, so `fontWeight: 'black'`\n * resolves to `typography.fontWeightBlack`.\n *\n * BOTH interfaces, and that is not belt-and-braces. `TypographyVariantsOptions`\n * is what `createTheme` ACCEPTS and `TypographyVariants` is what the resolved\n * `theme.typography` HANDS BACK — augmenting only the first compiles the\n * theme and then fails every reader, which is the shape this was in.\n *\n * Optional on the options side, required on the resolved side: an override\n * may omit it (MUI merges the default in), a reader may not have to check.\n *\n * ## And the SCALE variants\n *\n * `displayXl` is the rung ABOVE `h1`. The brand's display ramp tops out at\n * h1's 56px, so a marketing hero drawn at 72px had no token to ask for and\n * hand-wrote the pixels — which then lost to the variant's own responsive\n * ramp. One rung, not two: h1 already IS the 56px display size, and a\n * second name for it would leave two tokens to keep in step.\n *\n * `lede`, `bodyCompact` and `micro` — 17px, 13px and 11px with their line\n * heights — exist because the built pages kept reaching for those sizes and,\n * with nothing to ask for, wrote the pixels: /press alone carried 286 such\n * literals. Full variant objects rather than bare sizes, so one pick brings\n * the line height with it. Named for the JOB rather than the number, so the\n * name survives a retune: a lede stays the lede if the brand moves it to\n * 18px. `@mui/material/Typography` is augmented separately, above, so a\n * component can ASK for one.\n *\n * ⚑ Declared in THIS file rather than beside the values in\n * `console.theme.ts`, because module augmentation belongs with the rest of\n * the vendor augmentations — and putting it here is what let it be added\n * without touching a file another session was editing at the time.\n */\n interface TypographyVariantsOptions {\n fontWeightSemiBold?: number\n fontWeightExtraBold?: number\n fontWeightBlack?: number\n lede?: CSSProperties\n bodyCompact?: CSSProperties\n micro?: CSSProperties\n displayXl?: CSSProperties\n }\n\n interface TypographyVariants {\n fontWeightSemiBold: number\n fontWeightExtraBold: number\n fontWeightBlack: number\n lede: CSSProperties\n bodyCompact: CSSProperties\n micro: CSSProperties\n displayXl: CSSProperties\n }\n\n interface ZIndex {\n max: number\n min: number\n }\n\n interface Mixins {\n menuArrow: CSSProperties\n }\n\n interface ThemeOptions {\n shadowsInset?: Shadows\n }\n\n interface Theme {\n palette: Palette\n shadowsInset: Shadows\n }\n\n interface Theme {\n // CssVarsTheme['vars'] supplies the members MUI requires on vars (font,\n // opacity, overlays, …); the Omit layers our theme augmentations on top.\n vars: CssVarsTheme['vars'] &\n Omit<\n Theme,\n 'typography' | 'mixins' | 'breakpoints' | 'direction' | 'transitions' | 'vars'\n >\n }\n\n interface DefaultTheme extends Theme {}\n\n // type ExtendPropsOfWithStyles<\n // P extends { classes?: ClassNameMap<string> },\n // StylesType extends ClassKeyInferable<any, any>,\n // IncludeTheme extends boolean | undefined = false\n // > = P & WithStyles<StylesType, IncludeTheme>\n}\n\ndeclare module '@mui/styles' {\n interface DefaultTheme extends MuiTheme {}\n}\n\n// _______ ______ ___ ____ _____ ____\n// | ____\\ \\/ / _ \\ / _ \\| _ \\_ _/ ___|\n// | _| \\ /| |_) | | | | |_) || | \\___ \\\n// | |___ / \\| __/| |_| | _ < | | ___) |\n// |_____/_/\\_\\_| \\___/|_| \\_\\|_| |____/\n\nexport type { Overwrite } from '@mui/types'\n\nexport {\n type ShapeOptions,\n type Spacing,\n type SpacingOptions,\n type MuiStyledOptions,\n type SxProps,\n type BoxProps,\n} from '@mui/system'\n\nexport { darkScrollbar } from '@mui/material'\nexport { visuallyHidden } from '@mui/utils'\n\nexport {\n type Breakpoint,\n type BreakpointOverrides,\n type Breakpoints,\n type BreakpointsOptions,\n type ClassNameMap,\n type ColorFormat,\n type ColorObject,\n type ComponentsOverrides,\n type ComponentsProps,\n type ComponentsPropsList,\n type ComponentsVariants,\n type CreateMUIStyled,\n type CSSObject,\n type Direction,\n type Duration,\n type Easing,\n // type ExtendPropsOfWithStyles,\n type Palette,\n type PaletteColor,\n type PaletteColorOptions,\n type PaletteOptions,\n type SimplePaletteColorOptions,\n type StyledComponentProps,\n type Theme,\n type ThemedProps,\n type ThemeOptions,\n type ThemeWithProps,\n type Transitions,\n type TransitionsOptions,\n type TypographyStyle,\n type TypographyVariant,\n type TypographyVariants,\n type TypographyVariantsOptions,\n alpha,\n createTheme,\n darken,\n decomposeColor,\n easing,\n emphasize,\n getContrastRatio,\n getLuminance,\n hexToRgb,\n hslToRgb,\n lighten,\n recomposeColor,\n responsiveFontSizes,\n rgbToHex,\n styled,\n StyledEngineProvider,\n ThemeProvider,\n useTheme,\n useThemeProps,\n experimental_sx as sx,\n getInitColorSchemeScript,\n} from '@mui/material/styles'\n\nexport type ColorPartial = Partial<MuiColor>\nexport {\n type CommonColors,\n type TypeBackground,\n type TypeText,\n type Shadows,\n} from '@mui/material/styles'\n\n// export { type ClassKeyInferable, type CreateCSSProperties } from '@mui/styles/withStyles'\n\nexport { type Shape } from '@mui/system'\n\n// The VALUE half of this block is NOT re-exported (AGL-2682). `getThemeProps`,\n// `jssPreset`, `StylesContext`, `StylesProvider`, `useThemeVariants`,\n// `withThemeCreator`, `makeStyles`, `withStyles` and `createStyles` had no\n// reader anywhere in the repo, and a value re-export is a RUNTIME edge: it put\n// `@mui/styles` — MUI v4's deprecated JSS engine, and the `jss` tree under it —\n// inside the reachable set of every file that takes anything at all from this\n// barrel, which on the tenant is every published customer page. The one real\n// consumer of any of them, `shared-ui-jsx`'s `sandbox-frame.tsx`, imports\n// `jssPreset` and `StylesProvider` from `@mui/styles` directly; that is the\n// pattern to copy if a value is needed again.\n//\n// The types stay exactly as they were. `export type` is erased at compile time\n// and carries no edge, so nothing a consumer writes has to change.\nexport type {\n BaseCreateCSSProperties,\n BaseCSSProperties,\n CSSProperties,\n ServerStyleSheets,\n StyledProps,\n StyleRules,\n StyleRulesCallback,\n Styles,\n StylesOptions,\n StylesProviderProps,\n ThemedComponentProps,\n ThemeOfStyles,\n ThemeProviderProps,\n WithStyles,\n WithStylesOptions,\n WithTheme,\n WithThemeCreatorOption,\n} from '@mui/styles'\n"],"names":["darkScrollbar","visuallyHidden","alpha","createTheme","darken","decomposeColor","easing","emphasize","getContrastRatio","getLuminance","hexToRgb","hslToRgb","lighten","recomposeColor","responsiveFontSizes","rgbToHex","styled","StyledEngineProvider","ThemeProvider","useTheme","useThemeProps","experimental_sx","sx","getInitColorSchemeScript"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAqVD,SAASA,aAAa,QAAQ,gBAAe;AAC7C,SAASC,cAAc,QAAQ,aAAY;AAE3C,SAkCEC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,cAAc,EACdC,MAAM,EACNC,SAAS,EACTC,gBAAgB,EAChBC,YAAY,EACZC,QAAQ,EACRC,QAAQ,EACRC,OAAO,EACPC,cAAc,EACdC,mBAAmB,EACnBC,QAAQ,EACRC,MAAM,EACNC,oBAAoB,EACpBC,aAAa,EACbC,QAAQ,EACRC,aAAa,EACbC,mBAAmBC,EAAE,EACrBC,wBAAwB,QACnB,uBAAsB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/ui/theme/src/vendor/mui.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 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 type { Theme as MuiTheme } from '@mui/material/styles'\nimport type {\n Color as MuiColor,\n CssVarsTheme,\n CSSProperties,\n Shadows,\n} from '@mui/material/styles'\n// import type { ExtraColorOptions } from '@mui/material/styles/createPalette'\n// import type { WithStyles } from '@mui/styles'\n// import type { ClassKeyInferable } from '@mui/styles/withStyles'\nimport type { ColorPropOverrides, IActionStates } from '../lib/theme.types'\n// import type {ContainerTypeMap} from '@mui/material/Container'\n\n// _____ _______ ____ ____ ___ ____ _____ ____\n// / _ \\ \\ / / ____| _ \\| _ \\|_ _| _ \\| ____/ ___|\n// | | | \\ \\ / /| _| | |_) | |_) || || | | | _| \\___ \\\n// | |_| |\\ V / | |___| _ <| _ < | || |_| | |___ ___) |\n// \\___/ \\_/ |_____|_| \\_\\_| \\_\\___|____/|_____|____/\n\ndeclare module '@mui/material/Button' {\n interface ButtonPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/ButtonGroup' {\n interface ButtonGroupPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Container' {\n interface ContainerOwnProps {\n variant?: 'vertical' | 'horizontal' | 'boxed'\n }\n}\n/**\n * `<Typography variant=\"lede\">` and its two siblings (AGL-1308).\n *\n * The `TypographyVariants` augmentation further down puts the three variants\n * on the THEME; this is what lets a component ASK for one. Declaring the theme\n * side alone is the half-fix that compiles the theme and then rejects every\n * use of it — the same trap `TypographyVariantsOptions` without\n * `TypographyVariants` sets, one level up.\n */\ndeclare module '@mui/material/Typography' {\n interface TypographyPropsVariantOverrides {\n lede: true\n bodyCompact: true\n micro: true\n displayXl: true\n }\n}\ndeclare module '@mui/material/ToggleButtonGroup' {\n interface ToggleButtonGroupPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Fab' {\n interface FabPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/SvgIcon' {\n interface SvgIconPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/AppBar' {\n interface AppBarPropsColorOverrides extends ColorPropOverrides {\n surface: true\n }\n}\ndeclare module '@mui/material/Chip' {\n interface ChipPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/IconButton' {\n // Was `AppBarPropsColorOverrides` — a copy-paste from the block above, so\n // this augmented nothing and IconButton never accepted `tertiary`.\n interface IconButtonPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Tabs' {\n interface TabsPropsIndicatorColorOverrides extends ColorPropOverrides {}\n}\n// Tertiary everywhere primary and secondary are (AGL-3411). Each of these\n// already renders any palette color with a `main` — MUI builds their color\n// styles from the palette's entries — so tertiary worked at runtime and was\n// only refused by the types.\ndeclare module '@mui/material/Checkbox' {\n interface CheckboxPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Radio' {\n interface RadioPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Switch' {\n interface SwitchPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Slider' {\n interface SliderPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Badge' {\n interface BadgePropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/CircularProgress' {\n interface CircularProgressPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/LinearProgress' {\n interface LinearProgressPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/Pagination' {\n interface PaginationPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/material/PaginationItem' {\n interface PaginationItemPropsColorOverrides extends ColorPropOverrides {}\n}\ndeclare module '@mui/system' {\n interface Shape {\n appIconBorderRadius: number | string\n }\n}\ndeclare module '@mui/material/styles' {\n type ExtraColor = Palette['primary']\n type ExtraColorOptions = PaletteOptions['primary']\n\n /**\n * Pale accent washes used as SURFACES (AGL-1244) — `tint.primary`,\n * `tint.secondary`, `tint.tertiary`.\n *\n * A group of string leaves like `background` and `text`, NOT a\n * `PaletteColor`: there is no ramp to walk and no `contrastText`, because a\n * tint is never a component `color` — the ink on it is the accent token the\n * tile's icon already uses. That is also why `tint` is absent from\n * `ColorPropOverrides`: `<Button color=\"tint\">` would have no foreground to\n * pair with and must stay a type error.\n */\n interface PaletteTint {\n primary: string\n secondary: string\n tertiary: string\n }\n\n /**\n * A color's two HOVER shades (AGL-3465), read by the `MuiButton` and\n * `MuiFab` overrides — `ACCENT_HOVER_FILL` and `ACCENT_HOVER_TEXT` in\n * `util/accent-text.ts`.\n *\n * - `hover` — the fill a contained Button or a Fab takes on hover,\n * carrying `contrastText` at AA. Not `dark`: that slot is the accent\n * rendered as TEXT, lighter than `main` in a dark scheme, and a light\n * label on it disappears.\n * - `hoverText` — the label of a hovered text or outlined Button: `dark`,\n * walked until it clears AA on MUI's hover wash as well as on the bare\n * page and paper.\n *\n * `createResponsiveTheme` derives both, which is why they are optional on\n * each side: a theme built with plain `createTheme` has neither, and an\n * author may set one.\n */\n interface PaletteColor {\n hover?: string\n hoverText?: string\n }\n interface SimplePaletteColorOptions {\n hover?: string\n hoverText?: string\n }\n\n /**\n * START EXAMPLE – MODULE AUGMENTATION ↓\n * ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄\n * ```typescript\n * // Add new property ↓\n * declare module '@mui/material/styles' {\n * interface Theme {\n * status: {\n * danger: React.CSSProperties['color'],\n * }\n * }\n * interface ThemeOptions {\n * status: {\n * danger: React.CSSProperties['color']\n * }\n * }\n * }\n * const theme = createMuiTheme({\n * status: {\n * danger: '#e53e3e',\n * },\n * })\n *\n * // Add to existing property (e.g., palette, typography) ↓\n * declare module \"@mui/material/styles\" {\n * interface Palette {\n * neutral: Palette['primary']\n * }\n * interface PaletteOptions {\n * neutral: PaletteOptions['primary']\n * }\n * }\n * const theme = createMuiTheme({\n * palette: {\n * neutral: {\n * main: '#5c6ac4',\n * },\n * },\n * })\n * ```\n * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n * END EXAMPLE – MODULE AUGMENTATION ↑\n */\n\n /**\n * The resting border of an outlined input.\n *\n * A token because MUI has none: `OutlinedInput` hardcodes\n * `rgba(0, 0, 0, 0.23)` / `rgba(255, 255, 255, 0.23)` inside its own\n * styles, so there is nothing on the theme to read. Anything that has to\n * draw an input BESIDE a MUI one — Stripe Elements, which paints its fields\n * inside a cross-origin iframe from an `appearance` object we hand it — can\n * otherwise only match by copying those literals, and the copy silently\n * stops matching the first time the scheme moves.\n *\n * Deliberately NOT `divider` (`rgba(0, 0, 0, 0.12)`): half the weight, so a\n * field drawn with it reads as a different, lighter control sitting next to\n * ours — which is precisely the mismatch this token exists to prevent.\n *\n * A string leaf like `background` and `text`, not a `PaletteColor`: there is\n * no ramp and no `contrastText`, because nothing is ever drawn ON it.\n */\n interface PaletteOptions {\n background?: PaletteOptions['background']\n tertiary?: ExtraColorOptions\n surface?: ExtraColorOptions\n tint?: Partial<PaletteTint>\n inputOutline?: string\n svgBackground?: IActionStates\n svgFilled?: IActionStates\n svgStroke?: IActionStates\n text?: PaletteOptions['text']\n }\n\n interface TypeBackground {}\n\n interface Palette {\n background: Palette['background']\n tertiary: ExtraColor\n surface: ExtraColor\n inputOutline: string\n tint: PaletteTint\n svgBackground: IActionStates\n svgFilled: IActionStates\n svgStroke: IActionStates\n text: Palette['text']\n }\n\n /**\n * The brand's extra rungs on the font-weight scale (AGL-1308).\n *\n * MUI ships four — `fontWeightLight/Regular/Medium/Bold` — and the brand\n * adds three above them: 600, 800 and 900, all real weights because Roboto\n * Flex is a variable face covering 100–1000. Declaring them here is what\n * makes `createTheme({ typography: { fontWeightSemiBold: 600 } })` compile;\n * without the augmentation `TypographyVariantsOptions` is a closed shape and\n * the theme itself does not typecheck.\n *\n * They are reachable the way the built-ins are: `@mui/system`'s `style()`\n * retries a miss as `${prop}${capitalize(value)}`, so `fontWeight: 'black'`\n * resolves to `typography.fontWeightBlack`.\n *\n * BOTH interfaces, and that is not belt-and-braces. `TypographyVariantsOptions`\n * is what `createTheme` ACCEPTS and `TypographyVariants` is what the resolved\n * `theme.typography` HANDS BACK — augmenting only the first compiles the\n * theme and then fails every reader, which is the shape this was in.\n *\n * Optional on the options side, required on the resolved side: an override\n * may omit it (MUI merges the default in), a reader may not have to check.\n *\n * ## And the SCALE variants\n *\n * `displayXl` is the rung ABOVE `h1`. The brand's display ramp tops out at\n * h1's 56px, so a marketing hero drawn at 72px had no token to ask for and\n * hand-wrote the pixels — which then lost to the variant's own responsive\n * ramp. One rung, not two: h1 already IS the 56px display size, and a\n * second name for it would leave two tokens to keep in step.\n *\n * `lede`, `bodyCompact` and `micro` — 17px, 13px and 11px with their line\n * heights — exist because the built pages kept reaching for those sizes and,\n * with nothing to ask for, wrote the pixels: /press alone carried 286 such\n * literals. Full variant objects rather than bare sizes, so one pick brings\n * the line height with it. Named for the JOB rather than the number, so the\n * name survives a retune: a lede stays the lede if the brand moves it to\n * 18px. `@mui/material/Typography` is augmented separately, above, so a\n * component can ASK for one.\n *\n * ⚑ Declared in THIS file rather than beside the values in\n * `console.theme.ts`, because module augmentation belongs with the rest of\n * the vendor augmentations — and putting it here is what let it be added\n * without touching a file another session was editing at the time.\n */\n interface TypographyVariantsOptions {\n fontWeightSemiBold?: number\n fontWeightExtraBold?: number\n fontWeightBlack?: number\n lede?: CSSProperties\n bodyCompact?: CSSProperties\n micro?: CSSProperties\n displayXl?: CSSProperties\n }\n\n interface TypographyVariants {\n fontWeightSemiBold: number\n fontWeightExtraBold: number\n fontWeightBlack: number\n lede: CSSProperties\n bodyCompact: CSSProperties\n micro: CSSProperties\n displayXl: CSSProperties\n }\n\n interface ZIndex {\n max: number\n min: number\n }\n\n interface Mixins {\n menuArrow: CSSProperties\n }\n\n interface ThemeOptions {\n shadowsInset?: Shadows\n }\n\n interface Theme {\n palette: Palette\n shadowsInset: Shadows\n }\n\n interface Theme {\n // CssVarsTheme['vars'] supplies the members MUI requires on vars (font,\n // opacity, overlays, …); the Omit layers our theme augmentations on top.\n vars: CssVarsTheme['vars'] &\n Omit<\n Theme,\n 'typography' | 'mixins' | 'breakpoints' | 'direction' | 'transitions' | 'vars'\n >\n }\n\n interface DefaultTheme extends Theme {}\n\n // type ExtendPropsOfWithStyles<\n // P extends { classes?: ClassNameMap<string> },\n // StylesType extends ClassKeyInferable<any, any>,\n // IncludeTheme extends boolean | undefined = false\n // > = P & WithStyles<StylesType, IncludeTheme>\n}\n\ndeclare module '@mui/styles' {\n interface DefaultTheme extends MuiTheme {}\n}\n\n// _______ ______ ___ ____ _____ ____\n// | ____\\ \\/ / _ \\ / _ \\| _ \\_ _/ ___|\n// | _| \\ /| |_) | | | | |_) || | \\___ \\\n// | |___ / \\| __/| |_| | _ < | | ___) |\n// |_____/_/\\_\\_| \\___/|_| \\_\\|_| |____/\n\nexport type { Overwrite } from '@mui/types'\n\nexport {\n type ShapeOptions,\n type Spacing,\n type SpacingOptions,\n type MuiStyledOptions,\n type SxProps,\n type BoxProps,\n} from '@mui/system'\n\nexport { darkScrollbar } from '@mui/material'\nexport { visuallyHidden } from '@mui/utils'\n\nexport {\n type Breakpoint,\n type BreakpointOverrides,\n type Breakpoints,\n type BreakpointsOptions,\n type ClassNameMap,\n type ColorFormat,\n type ColorObject,\n type ComponentsOverrides,\n type ComponentsProps,\n type ComponentsPropsList,\n type ComponentsVariants,\n type CreateMUIStyled,\n type CSSObject,\n type Direction,\n type Duration,\n type Easing,\n // type ExtendPropsOfWithStyles,\n type Palette,\n type PaletteColor,\n type PaletteColorOptions,\n type PaletteOptions,\n type SimplePaletteColorOptions,\n type StyledComponentProps,\n type Theme,\n type ThemedProps,\n type ThemeOptions,\n type ThemeWithProps,\n type Transitions,\n type TransitionsOptions,\n type TypographyStyle,\n type TypographyVariant,\n type TypographyVariants,\n type TypographyVariantsOptions,\n alpha,\n createTheme,\n darken,\n decomposeColor,\n easing,\n emphasize,\n getContrastRatio,\n getLuminance,\n hexToRgb,\n hslToRgb,\n lighten,\n recomposeColor,\n responsiveFontSizes,\n rgbToHex,\n styled,\n StyledEngineProvider,\n ThemeProvider,\n useTheme,\n useThemeProps,\n experimental_sx as sx,\n getInitColorSchemeScript,\n} from '@mui/material/styles'\n\nexport type ColorPartial = Partial<MuiColor>\nexport {\n type CommonColors,\n type TypeBackground,\n type TypeText,\n type Shadows,\n} from '@mui/material/styles'\n\n// export { type ClassKeyInferable, type CreateCSSProperties } from '@mui/styles/withStyles'\n\nexport { type Shape } from '@mui/system'\n\n// The VALUE half of this block is NOT re-exported (AGL-2682). `getThemeProps`,\n// `jssPreset`, `StylesContext`, `StylesProvider`, `useThemeVariants`,\n// `withThemeCreator`, `makeStyles`, `withStyles` and `createStyles` had no\n// reader anywhere in the repo, and a value re-export is a RUNTIME edge: it put\n// `@mui/styles` — MUI v4's deprecated JSS engine, and the `jss` tree under it —\n// inside the reachable set of every file that takes anything at all from this\n// barrel, which on the tenant is every published customer page. The one real\n// consumer of any of them, `shared-ui-jsx`'s `sandbox-frame.tsx`, imports\n// `jssPreset` and `StylesProvider` from `@mui/styles` directly; that is the\n// pattern to copy if a value is needed again.\n//\n// The types stay exactly as they were. `export type` is erased at compile time\n// and carries no edge, so nothing a consumer writes has to change.\nexport type {\n BaseCreateCSSProperties,\n BaseCSSProperties,\n CSSProperties,\n ServerStyleSheets,\n StyledProps,\n StyleRules,\n StyleRulesCallback,\n Styles,\n StylesOptions,\n StylesProviderProps,\n ThemedComponentProps,\n ThemeOfStyles,\n ThemeProviderProps,\n WithStyles,\n WithStylesOptions,\n WithTheme,\n WithThemeCreatorOption,\n} from '@mui/styles'\n"],"names":["darkScrollbar","visuallyHidden","alpha","createTheme","darken","decomposeColor","easing","emphasize","getContrastRatio","getLuminance","hexToRgb","hslToRgb","lighten","recomposeColor","responsiveFontSizes","rgbToHex","styled","StyledEngineProvider","ThemeProvider","useTheme","useThemeProps","experimental_sx","sx","getInitColorSchemeScript"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GA+WD,SAASA,aAAa,QAAQ,gBAAe;AAC7C,SAASC,cAAc,QAAQ,aAAY;AAE3C,SAkCEC,KAAK,EACLC,WAAW,EACXC,MAAM,EACNC,cAAc,EACdC,MAAM,EACNC,SAAS,EACTC,gBAAgB,EAChBC,YAAY,EACZC,QAAQ,EACRC,QAAQ,EACRC,OAAO,EACPC,cAAc,EACdC,mBAAmB,EACnBC,QAAQ,EACRC,MAAM,EACNC,oBAAoB,EACpBC,aAAa,EACbC,QAAQ,EACRC,aAAa,EACbC,mBAAmBC,EAAE,EACrBC,wBAAwB,QACnB,uBAAsB"}
|