@aglyn/shared-ui-theme 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +7 -0
- package/package.json +51 -0
- package/src/index.d.ts +34 -0
- package/src/index.js +50 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/host-theme-provider.d.ts +84 -0
- package/src/lib/components/host-theme-provider.js +146 -0
- package/src/lib/components/host-theme-provider.js.map +1 -0
- package/src/lib/components/theme-css-var-provider.d.ts +44 -0
- package/src/lib/components/theme-css-var-provider.js +79 -0
- package/src/lib/components/theme-css-var-provider.js.map +1 -0
- package/src/lib/console.theme.d.ts +34 -0
- package/src/lib/console.theme.js +598 -0
- package/src/lib/console.theme.js.map +1 -0
- package/src/lib/constants.d.ts +72 -0
- package/src/lib/constants.js +85 -0
- package/src/lib/constants.js.map +1 -0
- package/src/lib/hocs/create-with-emotion-client-cache.d.ts +30 -0
- package/src/lib/hocs/create-with-emotion-client-cache.js +53 -0
- package/src/lib/hocs/create-with-emotion-client-cache.js.map +1 -0
- package/src/lib/hocs/create-with-theme-provider.d.ts +86 -0
- package/src/lib/hocs/create-with-theme-provider.js +231 -0
- package/src/lib/hocs/create-with-theme-provider.js.map +1 -0
- package/src/lib/tenant.theme.d.ts +58 -0
- package/src/lib/tenant.theme.js +282 -0
- package/src/lib/tenant.theme.js.map +1 -0
- package/src/lib/theme.types.d.ts +26 -0
- package/src/lib/theme.types.js +18 -0
- package/src/lib/theme.types.js.map +1 -0
- package/src/lib/util/accent-text.d.ts +187 -0
- package/src/lib/util/accent-text.js +277 -0
- package/src/lib/util/accent-text.js.map +1 -0
- package/src/lib/util/accessible-shade.d.ts +61 -0
- package/src/lib/util/accessible-shade.js +117 -0
- package/src/lib/util/accessible-shade.js.map +1 -0
- package/src/lib/util/color-scheme-hint.d.ts +68 -0
- package/src/lib/util/color-scheme-hint.js +69 -0
- package/src/lib/util/color-scheme-hint.js.map +1 -0
- package/src/lib/util/create-responsive-theme.d.ts +71 -0
- package/src/lib/util/create-responsive-theme.js +287 -0
- package/src/lib/util/create-responsive-theme.js.map +1 -0
- package/src/lib/util/emotion-cache.d.ts +81 -0
- package/src/lib/util/emotion-cache.js +79 -0
- package/src/lib/util/emotion-cache.js.map +1 -0
- package/src/lib/util/generate-component-class-keys.d.ts +41 -0
- package/src/lib/util/generate-component-class-keys.js +53 -0
- package/src/lib/util/generate-component-class-keys.js.map +1 -0
- package/src/lib/util/host-theme.d.ts +92 -0
- package/src/lib/util/host-theme.js +340 -0
- package/src/lib/util/host-theme.js.map +1 -0
- package/src/lib/util/layered-emotion-cache.d.ts +78 -0
- package/src/lib/util/layered-emotion-cache.js +90 -0
- package/src/lib/util/layered-emotion-cache.js.map +1 -0
- package/src/lib/util/merge-sx-props.d.ts +22 -0
- package/src/lib/util/merge-sx-props.js +27 -0
- package/src/lib/util/merge-sx-props.js.map +1 -0
- package/src/lib/util/scheme-route-segment.d.ts +95 -0
- package/src/lib/util/scheme-route-segment.js +101 -0
- package/src/lib/util/scheme-route-segment.js.map +1 -0
- package/src/lib/util/theme-editor-defaults.d.ts +41 -0
- package/src/lib/util/theme-editor-defaults.js +49 -0
- package/src/lib/util/theme-editor-defaults.js.map +1 -0
- package/src/lib/util/theme-editor-fields.d.ts +315 -0
- package/src/lib/util/theme-editor-fields.js +714 -0
- package/src/lib/util/theme-editor-fields.js.map +1 -0
- package/src/lib/util/theme-mode-cookie.d.ts +48 -0
- package/src/lib/util/theme-mode-cookie.js +48 -0
- package/src/lib/util/theme-mode-cookie.js.map +1 -0
- package/src/vendor/emotion.d.ts +18 -0
- package/src/vendor/emotion.js +22 -0
- package/src/vendor/emotion.js.map +1 -0
- package/src/vendor/jss.d.ts +18 -0
- package/src/vendor/jss.js +20 -0
- package/src/vendor/jss.js.map +1 -0
- package/src/vendor/mui.d.ts +282 -0
- package/src/vendor/mui.js +20 -0
- package/src/vendor/mui.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/ui/theme/src/lib/util/theme-editor-fields.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 {\n HostTheme,\n HostThemeComponentOverride,\n HostThemeScheme,\n HostThemeSchemeColors,\n} from '@aglyn/shared-data-types'\nimport {\n HOST_THEME_COMPONENT_WHITELIST,\n type HostThemeComponentKey,\n} from './host-theme'\n\n/**\n * The host theme editor's field catalog (AGL-2938): every control the editor\n * renders, the range each one accepts, the token it writes, and the write\n * itself.\n *\n * It lives here rather than beside the editor because the editor is not the\n * only thing that changes a site's theme. Anything that proposes a theme\n * change has to offer exactly the controls the editor offers, with the same\n * bounds, and has to write each one the way the editor writes it. A copy of\n * this list anywhere else is a second answer to \"what can a theme hold\" that\n * drifts from the first the day a control is added, so the editor renders\n * from this module and every other writer reads it.\n *\n * Pure data and pure functions over `HostTheme`: no MUI, no React and no\n * brand theme. What a control resolves to when the site sets nothing is the\n * brand theme's business, in `theme-editor-defaults.ts`.\n *\n * Deliberately NOT re-exported from this library's index: the index reaches\n * every published page, and nothing a visitor renders needs the catalog.\n * Reach it as `@aglyn/shared-ui-theme/util/theme-editor-fields`.\n */\n\n/**\n * MUI's own toolbar breakpoint. `mixins.toolbar` has to carry this exact\n * query, because the rule it competes with is MUI's `@media (min-width:600px)\n * { min-height: 64px }` (AGL-1242).\n */\nexport const TOOLBAR_SM_MIN_WIDTH = 600\nexport const TOOLBAR_SM_QUERY = `@media (min-width:${TOOLBAR_SM_MIN_WIDTH}px)`\n/** MUI's stock Toolbar heights, shown when the host has set none. */\nexport const DEFAULT_TOOLBAR_XS = 56\nexport const DEFAULT_TOOLBAR_SM = 64\n/**\n * `createMixins` spreads `...mixins` AFTER its default, so anything we write\n * REPLACES the stock toolbar wholesale — including its short-landscape rule.\n * Carrying it forward keeps that behavior instead of dropping it silently.\n */\nexport const TOOLBAR_LANDSCAPE_QUERY = '@media (min-width:0px)'\nexport const TOOLBAR_LANDSCAPE_RULE = {\n '@media (orientation: landscape)': { minHeight: 48 },\n}\n\n/** Reads a px `minHeight` out of `mixins.toolbar` for one breakpoint. */\nexport function readToolbarHeight(theme: HostTheme, breakpoint: 'xs' | 'sm') {\n const toolbar = theme.mixins?.toolbar\n if (!toolbar) return undefined\n const raw =\n breakpoint === 'xs'\n ? toolbar.minHeight\n : (toolbar[TOOLBAR_SM_QUERY] as { minHeight?: unknown } | undefined)\n ?.minHeight\n const value = parseFloat(String(raw ?? ''))\n return Number.isFinite(value) ? value : undefined\n}\n\n/**\n * Builds a COMPLETE `mixins.toolbar`, in the order MUI emits it.\n *\n * Two things this exists to get right, both because `mixins.toolbar` replaces\n * MUI's default wholesale rather than merging into it (AGL-1242):\n *\n * - **Completeness.** Anything omitted is simply gone. Writing only a desktop\n * height left portrait phones with no `min-height` at all, so unset\n * breakpoints fall back to MUI's own 56 / 64.\n * - **Key order.** These land in one CSS rule, so the last matching\n * declaration wins. MUI emits the landscape clause BEFORE the sm height;\n * emitting it after makes a wide landscape window — i.e. every desktop —\n * 48px tall.\n */\nexport function buildToolbarMixin(xs: number | undefined, sm: number | undefined) {\n return {\n minHeight: `${xs ?? DEFAULT_TOOLBAR_XS}px`,\n [TOOLBAR_LANDSCAPE_QUERY]: TOOLBAR_LANDSCAPE_RULE,\n [TOOLBAR_SM_QUERY]: { minHeight: `${sm ?? DEFAULT_TOOLBAR_SM}px` },\n }\n}\n\n/**\n * Serializes the branches whose KEY ORDER changes what renders.\n *\n * `deepEqual` is order-INsensitive on purpose (AGL-56: Firestore hands the\n * palette back in a different key order than the editor builds it, and a\n * string compare left Save enabled forever), so on its own it cannot see a\n * reorder of `mixins.toolbar` — a change that really does alter the CSS.\n *\n * Deliberately narrow: only `mixins`. `components.*.styleOverrides` are CSS\n * objects too, but widening this would re-expose the AGL-56 failure for every\n * host with component overrides, and order-sensitivity has only actually been\n * demonstrated here.\n *\n * Firestore does NOT hand a map back in the order it was written, and it\n * hands different readers different orders (AGL-3146) — which is why what\n * renders is canonicalized in `hostThemeToThemeOptions` rather than trusted\n * from storage. A freshly-loaded document is still not dirty here, because\n * the draft is seeded from the loaded document itself: both sides of this\n * comparison carry whatever order THIS reader was given.\n */\nexport function orderSensitiveKey(theme: HostTheme): string {\n return JSON.stringify(theme.mixins ?? {})\n}\n\nexport type PaletteColorKey =\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'surface'\n | 'error'\n | 'warning'\n | 'info'\n | 'success'\n\nexport const PALETTE_COLOR_FIELDS: Array<{\n key: PaletteColorKey\n label: string\n}> = [\n { key: 'primary', label: 'Primary' },\n { key: 'secondary', label: 'Secondary' },\n { key: 'tertiary', label: 'Tertiary' },\n { key: 'surface', label: 'Surface' },\n { key: 'error', label: 'Error' },\n { key: 'warning', label: 'Warning' },\n { key: 'info', label: 'Info' },\n { key: 'success', label: 'Success' },\n]\n\nexport type SurfaceColorPath =\n | ['background', 'default']\n | ['background', 'paper']\n | ['text', 'primary']\n | ['text', 'secondary']\n | ['text', 'disabled']\n | ['tint', 'primary']\n | ['tint', 'secondary']\n | ['tint', 'tertiary']\n\nexport const SURFACE_COLOR_FIELDS: Array<{\n path: SurfaceColorPath\n label: string\n}> = [\n { path: ['background', 'default'], label: 'Background' },\n { path: ['background', 'paper'], label: 'Paper' },\n { path: ['text', 'primary'], label: 'Text' },\n { path: ['text', 'secondary'], label: 'Secondary text' },\n { path: ['text', 'disabled'], label: 'Disabled text' },\n]\n\n/**\n * Pale accent washes (AGL-1244).\n *\n * Separate from {@link PALETTE_COLOR_FIELDS} because a tint is a STRING LEAF,\n * not a `{ main }` record — the palette fields all write `main`, and a tint has\n * none. It rides the same `SurfaceColorPath` machinery as `background`/`text`\n * for exactly that reason, and is listed apart only so the editor can head it\n * \"Tints\" instead of filing it under \"Background & text\".\n */\nexport const TINT_COLOR_FIELDS: Array<{\n path: SurfaceColorPath\n label: string\n}> = [\n { path: ['tint', 'primary'], label: 'Primary tint' },\n { path: ['tint', 'secondary'], label: 'Secondary tint' },\n { path: ['tint', 'tertiary'], label: 'Tertiary tint' },\n]\n\n/** The one color leaf that is neither a palette color nor a member of a group. */\nexport const DIVIDER_COLOR_FIELD = { key: 'divider', label: 'Divider' } as const\n\n/** Curated Google Fonts choices for the font family selector. */\nexport const GOOGLE_FONT_OPTIONS: Array<{\n family: string\n category: 'sans-serif' | 'serif' | 'monospace' | 'display'\n weights: Array<number>\n}> = [\n { family: 'Inter', category: 'sans-serif', weights: [400, 500, 700] },\n { family: 'Roboto', category: 'sans-serif', weights: [400, 500, 700] },\n { family: 'Open Sans', category: 'sans-serif', weights: [400, 600, 700] },\n { family: 'Lato', category: 'sans-serif', weights: [400, 700] },\n { family: 'Montserrat', category: 'sans-serif', weights: [400, 500, 700] },\n { family: 'Poppins', category: 'sans-serif', weights: [400, 500, 700] },\n { family: 'Nunito', category: 'sans-serif', weights: [400, 600, 700] },\n { family: 'Work Sans', category: 'sans-serif', weights: [400, 500, 700] },\n { family: 'Raleway', category: 'sans-serif', weights: [400, 500, 700] },\n { family: 'Merriweather', category: 'serif', weights: [400, 700] },\n { family: 'Playfair Display', category: 'serif', weights: [400, 700] },\n { family: 'Lora', category: 'serif', weights: [400, 700] },\n { family: 'Source Serif 4', category: 'serif', weights: [400, 700] },\n { family: 'JetBrains Mono', category: 'monospace', weights: [400, 700] },\n { family: 'Bebas Neue', category: 'display', weights: [400] },\n]\n\nexport function fontFamilyStack(\n family: string,\n category: (typeof GOOGLE_FONT_OPTIONS)[number]['category'],\n) {\n const fallback = category === 'monospace' ? 'monospace' : category === 'serif' ? 'serif' : 'sans-serif'\n return `\"${family}\", ${fallback}`\n}\n\nexport function getSchemeColor(\n colors: HostThemeSchemeColors | undefined,\n path: SurfaceColorPath,\n): string | undefined {\n const [group, key] = path\n return (colors?.[group] as Record<string, string> | undefined)?.[key]\n}\n\n/* ------------------------------------------------------------------------ *\n * The controls, as one catalog\n * ------------------------------------------------------------------------ */\n\n/** The two color schemes the editor edits, in tab order. */\nexport const THEME_EDITOR_SCHEMES: readonly HostThemeScheme[] = ['light', 'dark']\n\n/**\n * Every color the editor edits per scheme, named the way a diff names it: a\n * palette key (`primary`), a group path joined with a dot\n * (`background.default`, `tint.primary`), or `divider`.\n */\nexport type ThemeColorToken =\n | PaletteColorKey\n | 'background.default'\n | 'background.paper'\n | 'text.primary'\n | 'text.secondary'\n | 'text.disabled'\n | 'tint.primary'\n | 'tint.secondary'\n | 'tint.tertiary'\n | 'divider'\n\n/** Where a color control sits in the editor's Color scheme card. */\nexport type ThemeColorGroup = 'palette' | 'surface' | 'tint' | 'divider'\n\n/** Every color field the editor renders, in the order it renders them. */\nexport const THEME_COLOR_FIELDS: ReadonlyArray<{\n token: ThemeColorToken\n label: string\n group: ThemeColorGroup\n}> = [\n ...PALETTE_COLOR_FIELDS.map(({ key, label }) => ({\n token: key,\n label,\n group: 'palette' as const,\n })),\n ...SURFACE_COLOR_FIELDS.map(({ path, label }) => ({\n token: path.join('.') as ThemeColorToken,\n label,\n group: 'surface' as const,\n })),\n ...TINT_COLOR_FIELDS.map(({ path, label }) => ({\n token: path.join('.') as ThemeColorToken,\n label,\n group: 'tint' as const,\n })),\n {\n token: DIVIDER_COLOR_FIELD.key,\n label: DIVIDER_COLOR_FIELD.label,\n group: 'divider' as const,\n },\n]\n\n/** Whether visitors get a dark scheme; absent from the document means `auto`. */\nexport type ThemeDarkSchemeValue = 'auto' | 'off'\n\nexport const DARK_SCHEME_FIELD = {\n label: 'Dark scheme',\n options: [\n { value: 'auto', label: 'Follows the visitor' },\n { value: 'off', label: 'Off — always light' },\n ],\n} as const\n\n/**\n * The font select's value for \"no font of the site's own\": the theme's\n * default stack, with nothing to load.\n */\nexport const SYSTEM_FONT_VALUE = '__system__'\n\nexport const FONT_FAMILY_FIELD = { label: 'Font family' } as const\n\n/** The corner radius slider, in px. */\nexport const BORDER_RADIUS_FIELD = {\n label: 'Border radius',\n min: 0,\n max: 24,\n step: 1,\n} as const\n\n/** The spacing unit MUI multiplies every `spacing(n)` by, in px. */\nexport const SPACING_FIELD = {\n label: 'Spacing unit (px)',\n min: 2,\n max: 16,\n step: 1,\n} as const\n\n/** The two nav heights, either side of MUI's toolbar breakpoint, in px. */\nexport const TOOLBAR_HEIGHT_FIELDS = {\n xs: { label: 'Nav height, mobile (px)', min: 40, max: 160, step: 1 },\n sm: { label: 'Nav height, desktop (px)', min: 40, max: 160, step: 1 },\n} as const\n\n/** The raw-JSON component overrides, limited to the sanitizer's whitelist. */\nexport const COMPONENT_OVERRIDES_FIELD = {\n label: 'Component overrides',\n components: HOST_THEME_COMPONENT_WHITELIST,\n} as const\n\n/**\n * The media queries a component override may scope a style to: either side\n * of MUI's own toolbar breakpoint, the one breakpoint the editor already\n * names. MUI's `down('sm')` stops a twentieth of a pixel short of it.\n */\nexport const THEME_EDITOR_MEDIA_QUERIES = {\n mobile: `@media (max-width:${TOOLBAR_SM_MIN_WIDTH - 0.05}px)`,\n desktop: TOOLBAR_SM_QUERY,\n} as const\n\nexport type ThemeEditorMedia = keyof typeof THEME_EDITOR_MEDIA_QUERIES\n\nexport type ThemeEditorControlId =\n | `color.${ThemeColorToken}`\n | 'darkScheme'\n | 'fontFamily'\n | 'borderRadius'\n | 'spacing'\n | 'navHeight.xs'\n | 'navHeight.sm'\n | 'components'\n\n/** One control the editor renders, described well enough to be offered elsewhere. */\nexport interface ThemeEditorControl {\n /** Stable id: what a diff row, a proposal and a spec name the control by. */\n id: ThemeEditorControlId\n /** The label the editor shows. */\n label: string\n kind: 'color' | 'select' | 'number' | 'json'\n /** Edited once per scheme, under the Light and Dark tabs. */\n perScheme: boolean\n /** A color control's token. */\n token?: ThemeColorToken\n /** A select's values, or the components a JSON control accepts. */\n options?: readonly string[]\n /** A number control's inclusive bounds and its step. */\n min?: number\n max?: number\n step?: number\n}\n\n/**\n * Every value-bearing control the editor renders, in the order it renders\n * them. The buttons that act on these values rather than hold one — Copy\n * from light, Reset to default, Discard, Save — are not controls: a reset is\n * a control set back to nothing, and a copy is every color control of one\n * scheme written from the other.\n */\nexport const THEME_EDITOR_CONTROLS: readonly ThemeEditorControl[] = [\n {\n id: 'darkScheme',\n label: DARK_SCHEME_FIELD.label,\n kind: 'select',\n perScheme: false,\n options: DARK_SCHEME_FIELD.options.map((option) => option.value),\n },\n ...THEME_COLOR_FIELDS.map(({ token, label }) => ({\n id: `color.${token}` as const,\n label,\n kind: 'color' as const,\n perScheme: true,\n token,\n })),\n {\n id: 'fontFamily',\n label: FONT_FAMILY_FIELD.label,\n kind: 'select',\n perScheme: false,\n options: [SYSTEM_FONT_VALUE, ...GOOGLE_FONT_OPTIONS.map((option) => option.family)],\n },\n {\n id: 'borderRadius',\n label: BORDER_RADIUS_FIELD.label,\n kind: 'number',\n perScheme: false,\n min: BORDER_RADIUS_FIELD.min,\n max: BORDER_RADIUS_FIELD.max,\n step: BORDER_RADIUS_FIELD.step,\n },\n {\n id: 'spacing',\n label: SPACING_FIELD.label,\n kind: 'number',\n perScheme: false,\n min: SPACING_FIELD.min,\n max: SPACING_FIELD.max,\n step: SPACING_FIELD.step,\n },\n {\n id: 'navHeight.xs',\n label: TOOLBAR_HEIGHT_FIELDS.xs.label,\n kind: 'number',\n perScheme: false,\n min: TOOLBAR_HEIGHT_FIELDS.xs.min,\n max: TOOLBAR_HEIGHT_FIELDS.xs.max,\n step: TOOLBAR_HEIGHT_FIELDS.xs.step,\n },\n {\n id: 'navHeight.sm',\n label: TOOLBAR_HEIGHT_FIELDS.sm.label,\n kind: 'number',\n perScheme: false,\n min: TOOLBAR_HEIGHT_FIELDS.sm.min,\n max: TOOLBAR_HEIGHT_FIELDS.sm.max,\n step: TOOLBAR_HEIGHT_FIELDS.sm.step,\n },\n {\n id: 'components',\n label: COMPONENT_OVERRIDES_FIELD.label,\n kind: 'json',\n perScheme: false,\n options: COMPONENT_OVERRIDES_FIELD.components,\n },\n]\n\n/** The catalog entry for a control id. */\nexport function themeEditorControl(id: ThemeEditorControlId): ThemeEditorControl {\n const control = THEME_EDITOR_CONTROLS.find((entry) => entry.id === id)\n if (!control) throw new Error(`unknown theme editor control ${id}`)\n return control\n}\n\n/* ------------------------------------------------------------------------ *\n * Reads and writes, exactly as the editor performs them\n * ------------------------------------------------------------------------ */\n\nfunction setSchemeValue(\n theme: HostTheme,\n scheme: HostThemeScheme,\n update: (colors: HostThemeSchemeColors) => HostThemeSchemeColors,\n): HostTheme {\n const colors = theme.colorSchemes?.[scheme] ?? {}\n return {\n ...theme,\n colorSchemes: { ...theme.colorSchemes, [scheme]: update(colors) },\n }\n}\n\n/** A color the site set for one scheme; `undefined` when the slot inherits. */\nexport function readThemeColor(\n theme: HostTheme | undefined,\n scheme: HostThemeScheme,\n token: ThemeColorToken,\n): string | undefined {\n const colors = theme?.colorSchemes?.[scheme]\n if (token === 'divider') return colors?.divider\n const [group, key] = token.split('.')\n if (!key) return colors?.[group as PaletteColorKey]?.main\n return getSchemeColor(colors, [group, key] as SurfaceColorPath)\n}\n\n/**\n * Sets one color for one scheme, or clears it with `undefined` so the slot\n * inherits again. A palette color writes `main` and keeps whatever else its\n * record carries, and clearing it drops the record; a group member that\n * leaves its group empty drops the group.\n */\nexport function writeThemeColor(\n theme: HostTheme,\n scheme: HostThemeScheme,\n token: ThemeColorToken,\n hex: string | undefined,\n): HostTheme {\n return setSchemeValue(theme, scheme, (colors) => {\n const next: HostThemeSchemeColors = { ...colors }\n if (token === 'divider') {\n if (hex) next.divider = hex\n else delete next.divider\n return next\n }\n const [group, key] = token.split('.')\n if (!key) {\n const paletteKey = group as PaletteColorKey\n if (hex) next[paletteKey] = { ...next[paletteKey], main: hex }\n else delete next[paletteKey]\n return next\n }\n const groupKey = group as 'background' | 'text' | 'tint'\n const groupValue = {\n ...(colors[groupKey] as Record<string, string> | undefined),\n }\n if (hex) groupValue[key] = hex\n else delete groupValue[key]\n const grouped = { ...next, [groupKey]: groupValue } as HostThemeSchemeColors\n if (!Object.keys(groupValue).length) delete grouped[groupKey]\n return grouped\n })\n}\n\n/** Replaces one scheme's colors with a copy of the other's. */\nexport function copyThemeSchemeColors(\n theme: HostTheme,\n from: HostThemeScheme,\n to: HostThemeScheme,\n): HostTheme {\n const source = theme.colorSchemes?.[from]\n if (!source) return theme\n return {\n ...theme,\n colorSchemes: {\n ...theme.colorSchemes,\n [to]: JSON.parse(JSON.stringify(source)),\n },\n }\n}\n\n/** The dark scheme switch as the select shows it. */\nexport function readDarkScheme(theme: HostTheme | undefined): ThemeDarkSchemeValue {\n return theme?.darkScheme === 'off' ? 'off' : 'auto'\n}\n\n/**\n * Absent means \"follows the visitor\"; only the opt-out is written, so the\n * saved document stays empty for the common case.\n */\nexport function writeDarkScheme(\n theme: HostTheme,\n value: ThemeDarkSchemeValue,\n): HostTheme {\n const next: HostTheme = { ...theme }\n if (value === 'off') next.darkScheme = 'off'\n else delete next.darkScheme\n return next\n}\n\n/** The font select's value: the site's font, or {@link SYSTEM_FONT_VALUE}. */\nexport function readFontFamily(theme: HostTheme | undefined): string {\n return theme?.fonts?.[0]?.family ?? SYSTEM_FONT_VALUE\n}\n\n/**\n * Picks a font from {@link GOOGLE_FONT_OPTIONS}, loading it and naming it as\n * the typography's stack, or {@link SYSTEM_FONT_VALUE} to go back to the\n * theme default. A family outside the curated list changes nothing.\n */\nexport function writeFontFamily(theme: HostTheme, value: string): HostTheme {\n if (value === SYSTEM_FONT_VALUE) {\n const next = { ...theme }\n delete next.fonts\n const typography = { ...next.typography }\n delete typography.fontFamily\n if (Object.keys(typography).length) next.typography = typography\n else delete next.typography\n return next\n }\n const option = GOOGLE_FONT_OPTIONS.find((entry) => entry.family === value)\n if (!option) return theme\n return {\n ...theme,\n fonts: [\n {\n family: option.family,\n weights: option.weights,\n source: 'google',\n },\n ],\n typography: {\n ...theme.typography,\n fontFamily: fontFamilyStack(option.family, option.category),\n },\n }\n}\n\n/** Sets the corner radius, or clears it with `undefined` so it inherits. */\nexport function writeBorderRadius(\n theme: HostTheme,\n value: number | undefined,\n): HostTheme {\n if (value !== undefined && Number.isFinite(value)) {\n return { ...theme, shape: { ...theme.shape, borderRadius: value } }\n }\n const next = { ...theme }\n const shape = { ...next.shape }\n delete shape.borderRadius\n if (Object.keys(shape).length) next.shape = shape\n else delete next.shape\n return next\n}\n\n/** Sets the spacing unit; anything but a positive number clears it. */\nexport function writeSpacing(theme: HostTheme, value: number | undefined): HostTheme {\n const next = { ...theme }\n if (value !== undefined && Number.isFinite(value) && value > 0) next.spacing = value\n else delete next.spacing\n return next\n}\n\n/**\n * Sets one nav height — anything but a positive number clears it — and\n * rebuilds the whole toolbar mixin around both, because `mixins.toolbar`\n * replaces MUI's default rather than merging into it (AGL-1242).\n */\nexport function writeToolbarHeight(\n theme: HostTheme,\n breakpoint: 'xs' | 'sm',\n value: number | undefined,\n): HostTheme {\n const valid = value !== undefined && Number.isFinite(value) && value > 0\n const edited = valid ? value : undefined\n const xs = breakpoint === 'xs' ? edited : readToolbarHeight(theme, 'xs')\n const sm = breakpoint === 'sm' ? edited : readToolbarHeight(theme, 'sm')\n const next = { ...theme }\n if (xs === undefined && sm === undefined) {\n delete next.mixins\n return next\n }\n next.mixins = { toolbar: buildToolbarMixin(xs, sm) }\n return next\n}\n\n/**\n * Drops the site's component overrides. With nothing stored the site renders\n * the brand's own component styles, which is what the editor's \"Reset to\n * theme defaults\" means.\n */\nexport function resetComponentOverrides(theme: HostTheme): HostTheme {\n const next = { ...theme }\n delete next.components\n return next\n}\n\n/** One leaf of a component override, as a writer names it. */\nexport interface ThemeComponentOverrideLeaf {\n component: HostThemeComponentKey\n /** `styleOverrides` styles a slot; `defaultProps` sets a prop's default. */\n target: 'styleOverrides' | 'defaultProps'\n /** The style slot (`root`, `contained`, `h1`); `null` for a default prop. */\n slot: string | null\n /** A camelCase CSS property, or the prop's name. */\n property: string\n /** Scopes a style to one side of the toolbar breakpoint; `null` for every width. */\n media: ThemeEditorMedia | null\n value: string | number | boolean\n}\n\n/**\n * Sets one leaf inside the site's component overrides and keeps every other\n * override the site has. The stored overrides are deep-merged over the\n * brand's own at render time, so naming one property changes that property\n * and inherits the rest of the component.\n */\nexport function writeComponentOverride(\n theme: HostTheme,\n leaf: ThemeComponentOverrideLeaf,\n): HostTheme {\n const components = { ...theme.components }\n const entry: HostThemeComponentOverride = { ...components[leaf.component] }\n if (leaf.target === 'defaultProps') {\n entry.defaultProps = { ...entry.defaultProps, [leaf.property]: leaf.value }\n } else {\n const slot = leaf.slot ?? 'root'\n const styles = { ...entry.styleOverrides }\n const slotStyles = { ...(styles[slot] as Record<string, unknown> | undefined) }\n if (leaf.media) {\n const query = THEME_EDITOR_MEDIA_QUERIES[leaf.media]\n slotStyles[query] = {\n ...(slotStyles[query] as Record<string, unknown> | undefined),\n [leaf.property]: leaf.value,\n }\n } else {\n slotStyles[leaf.property] = leaf.value\n }\n styles[slot] = slotStyles\n entry.styleOverrides = styles\n }\n components[leaf.component] = entry\n return { ...theme, components }\n}\n"],"names":["HOST_THEME_COMPONENT_WHITELIST","TOOLBAR_SM_MIN_WIDTH","TOOLBAR_SM_QUERY","DEFAULT_TOOLBAR_XS","DEFAULT_TOOLBAR_SM","TOOLBAR_LANDSCAPE_QUERY","TOOLBAR_LANDSCAPE_RULE","minHeight","readToolbarHeight","theme","breakpoint","toolbar","mixins","undefined","raw","value","parseFloat","String","Number","isFinite","buildToolbarMixin","xs","sm","orderSensitiveKey","JSON","stringify","PALETTE_COLOR_FIELDS","key","label","SURFACE_COLOR_FIELDS","path","TINT_COLOR_FIELDS","DIVIDER_COLOR_FIELD","GOOGLE_FONT_OPTIONS","family","category","weights","fontFamilyStack","fallback","getSchemeColor","colors","group","THEME_EDITOR_SCHEMES","THEME_COLOR_FIELDS","map","token","join","DARK_SCHEME_FIELD","options","SYSTEM_FONT_VALUE","FONT_FAMILY_FIELD","BORDER_RADIUS_FIELD","min","max","step","SPACING_FIELD","TOOLBAR_HEIGHT_FIELDS","COMPONENT_OVERRIDES_FIELD","components","THEME_EDITOR_MEDIA_QUERIES","mobile","desktop","THEME_EDITOR_CONTROLS","id","kind","perScheme","option","themeEditorControl","control","find","entry","Error","setSchemeValue","scheme","update","colorSchemes","readThemeColor","divider","split","main","writeThemeColor","hex","next","paletteKey","groupKey","groupValue","grouped","Object","keys","length","copyThemeSchemeColors","from","to","source","parse","readDarkScheme","darkScheme","writeDarkScheme","readFontFamily","fonts","writeFontFamily","typography","fontFamily","writeBorderRadius","shape","borderRadius","writeSpacing","spacing","writeToolbarHeight","valid","edited","resetComponentOverrides","writeComponentOverride","leaf","component","target","defaultProps","property","slot","styles","styleOverrides","slotStyles","media","query"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAQD,SACEA,8BAA8B,QAEzB,kBAAc;AAErB;;;;;;;;;;;;;;;;;;;;CAoBC,GAED;;;;CAIC,GACD,OAAO,MAAMC,uBAAuB,IAAG;AACvC,OAAO,MAAMC,mBAAmB,CAAC,kBAAkB,EAAED,qBAAqB,GAAG,CAAC,CAAA;AAC9E,mEAAmE,GACnE,OAAO,MAAME,qBAAqB,GAAE;AACpC,OAAO,MAAMC,qBAAqB,GAAE;AACpC;;;;CAIC,GACD,OAAO,MAAMC,0BAA0B,yBAAwB;AAC/D,OAAO,MAAMC,yBAAyB;IACpC,mCAAmC;QAAEC,WAAW;IAAG;AACrD,EAAC;AAED,uEAAuE,GACvE,OAAO,SAASC,kBAAkBC,KAAgB,EAAEC,UAAuB;QACzDD,eAKTE;IALP,MAAMA,WAAUF,gBAAAA,MAAMG,MAAM,qBAAZH,cAAcE,OAAO;IACrC,IAAI,CAACA,SAAS,OAAOE;IACrB,MAAMC,MACJJ,eA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QAAOL,aAAAA,KAAKK,IAAI,YAATL,aAAa;QAC1B,MAAMM,SAAS,aAAKjD,MAAMkD,cAAc;QACxC,MAAMC,aAAa,aAAMF,MAAM,CAACD,KAAK;QACrC,IAAIL,KAAKS,KAAK,EAAE;YACd,MAAMC,QAAQhE,0BAA0B,CAACsD,KAAKS,KAAK,CAAC;YACpDD,UAAU,CAACE,MAAM,GAAG,aACdF,UAAU,CAACE,MAAM;gBACrB,CAACV,KAAKI,QAAQ,CAAC,EAAEJ,KAAKlG,KAAK;;QAE/B,OAAO;YACL0G,UAAU,CAACR,KAAKI,QAAQ,CAAC,GAAGJ,KAAKlG,KAAK;QACxC;QACAwG,MAAM,CAACD,KAAK,GAAGG;QACfnD,MAAMkD,cAAc,GAAGD;IACzB;IACA7D,UAAU,CAACuD,KAAKC,SAAS,CAAC,GAAG5C;IAC7B,OAAO,aAAK7D;QAAOiD;;AACrB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { ThemeMode } from '../hocs/create-with-theme-provider';
|
|
18
|
+
/**
|
|
19
|
+
* The visitor's stored light/dark choice, read where there is no browser.
|
|
20
|
+
*
|
|
21
|
+
* The provider persists the choice with `js-cookie`, which reads
|
|
22
|
+
* `document.cookie` — a global that does not exist while a page renders on the
|
|
23
|
+
* server, so the provider's own reader answers "no choice" for every server
|
|
24
|
+
* render. A server layout has the request's cookies and can answer properly;
|
|
25
|
+
* this module is what it reads them with.
|
|
26
|
+
*
|
|
27
|
+
* Nothing here imports React, MUI or `js-cookie`, and the one import is a
|
|
28
|
+
* type, erased at compile time. That is deliberate: a Server Component may
|
|
29
|
+
* take this module without pulling the theme library's context providers into
|
|
30
|
+
* its graph, the same reason `util/emotion-cache` and `util/host-theme` are
|
|
31
|
+
* deep-imported rather than taken from the barrel.
|
|
32
|
+
*/
|
|
33
|
+
export declare const THEME_MODE_COOKIE = "theme-color-mode";
|
|
34
|
+
/**
|
|
35
|
+
* A stored cookie value as a theme mode.
|
|
36
|
+
*
|
|
37
|
+
* Only an explicit `light` or `dark` is a mode. Everything else — no cookie at
|
|
38
|
+
* all, and the `system` the switcher writes when a visitor picks "Device
|
|
39
|
+
* default" — is `null`, meaning "the visitor named no scheme, follow the
|
|
40
|
+
* device". `system` reads back as the absence of a choice rather than as a
|
|
41
|
+
* value because the device's preference is not knowable here: it lives in
|
|
42
|
+
* `prefers-color-scheme`, which only a browser can evaluate.
|
|
43
|
+
*
|
|
44
|
+
* This is the same grammar the browser-side reader in
|
|
45
|
+
* `create-with-theme-provider` applies to the same cookie, so a server render
|
|
46
|
+
* and the hydration that follows it resolve one value between them.
|
|
47
|
+
*/
|
|
48
|
+
export declare function parseThemeModeCookie(value: string | undefined | null): ThemeMode;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* The visitor's stored light/dark choice, read where there is no browser.
|
|
18
|
+
*
|
|
19
|
+
* The provider persists the choice with `js-cookie`, which reads
|
|
20
|
+
* `document.cookie` — a global that does not exist while a page renders on the
|
|
21
|
+
* server, so the provider's own reader answers "no choice" for every server
|
|
22
|
+
* render. A server layout has the request's cookies and can answer properly;
|
|
23
|
+
* this module is what it reads them with.
|
|
24
|
+
*
|
|
25
|
+
* Nothing here imports React, MUI or `js-cookie`, and the one import is a
|
|
26
|
+
* type, erased at compile time. That is deliberate: a Server Component may
|
|
27
|
+
* take this module without pulling the theme library's context providers into
|
|
28
|
+
* its graph, the same reason `util/emotion-cache` and `util/host-theme` are
|
|
29
|
+
* deep-imported rather than taken from the barrel.
|
|
30
|
+
*/ export const THEME_MODE_COOKIE = 'theme-color-mode';
|
|
31
|
+
/**
|
|
32
|
+
* A stored cookie value as a theme mode.
|
|
33
|
+
*
|
|
34
|
+
* Only an explicit `light` or `dark` is a mode. Everything else — no cookie at
|
|
35
|
+
* all, and the `system` the switcher writes when a visitor picks "Device
|
|
36
|
+
* default" — is `null`, meaning "the visitor named no scheme, follow the
|
|
37
|
+
* device". `system` reads back as the absence of a choice rather than as a
|
|
38
|
+
* value because the device's preference is not knowable here: it lives in
|
|
39
|
+
* `prefers-color-scheme`, which only a browser can evaluate.
|
|
40
|
+
*
|
|
41
|
+
* This is the same grammar the browser-side reader in
|
|
42
|
+
* `create-with-theme-provider` applies to the same cookie, so a server render
|
|
43
|
+
* and the hydration that follows it resolve one value between them.
|
|
44
|
+
*/ export function parseThemeModeCookie(value) {
|
|
45
|
+
return value === 'dark' || value === 'light' ? value : null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=theme-mode-cookie.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/ui/theme/src/lib/util/theme-mode-cookie.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 { ThemeMode } from '../hocs/create-with-theme-provider'\n\n/**\n * The visitor's stored light/dark choice, read where there is no browser.\n *\n * The provider persists the choice with `js-cookie`, which reads\n * `document.cookie` — a global that does not exist while a page renders on the\n * server, so the provider's own reader answers \"no choice\" for every server\n * render. A server layout has the request's cookies and can answer properly;\n * this module is what it reads them with.\n *\n * Nothing here imports React, MUI or `js-cookie`, and the one import is a\n * type, erased at compile time. That is deliberate: a Server Component may\n * take this module without pulling the theme library's context providers into\n * its graph, the same reason `util/emotion-cache` and `util/host-theme` are\n * deep-imported rather than taken from the barrel.\n */\nexport const THEME_MODE_COOKIE = 'theme-color-mode'\n\n/**\n * A stored cookie value as a theme mode.\n *\n * Only an explicit `light` or `dark` is a mode. Everything else — no cookie at\n * all, and the `system` the switcher writes when a visitor picks \"Device\n * default\" — is `null`, meaning \"the visitor named no scheme, follow the\n * device\". `system` reads back as the absence of a choice rather than as a\n * value because the device's preference is not knowable here: it lives in\n * `prefers-color-scheme`, which only a browser can evaluate.\n *\n * This is the same grammar the browser-side reader in\n * `create-with-theme-provider` applies to the same cookie, so a server render\n * and the hydration that follows it resolve one value between them.\n */\nexport function parseThemeModeCookie(\n value: string | undefined | null,\n): ThemeMode {\n return value === 'dark' || value === 'light' ? value : null\n}\n"],"names":["THEME_MODE_COOKIE","parseThemeModeCookie","value"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID;;;;;;;;;;;;;;CAcC,GACD,OAAO,MAAMA,oBAAoB,mBAAkB;AAEnD;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,qBACdC,KAAgC;IAEhC,OAAOA,UAAU,UAAUA,UAAU,UAAUA,QAAQ;AACzD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export { type EmotionCache, type Options as CreateEmotionCacheOptions, default as createEmotionCache, } from '@emotion/cache';
|
|
18
|
+
export { CacheProvider, withEmotionCache } from '@emotion/react';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ export { default as createEmotionCache } from "@emotion/cache";
|
|
17
|
+
export { CacheProvider, withEmotionCache } from "@emotion/react"; // AGL-1238: `@emotion/server/create-instance` is deliberately NOT re-exported
|
|
18
|
+
// here. This barrel reaches client bundles, and that package unconditionally
|
|
19
|
+
// imports stream shims whose vendored `is-generator-function` eval probe trips
|
|
20
|
+
// the enforcing CSP. Server-side consumers import it from the package directly.
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=emotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/ui/theme/src/vendor/emotion.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport {\n type EmotionCache,\n type Options as CreateEmotionCacheOptions,\n default as createEmotionCache,\n} from '@emotion/cache'\n\nexport { CacheProvider, withEmotionCache } from '@emotion/react'\n// AGL-1238: `@emotion/server/create-instance` is deliberately NOT re-exported\n// here. This barrel reaches client bundles, and that package unconditionally\n// imports stream shims whose vendored `is-generator-function` eval probe trips\n// the enforcing CSP. Server-side consumers import it from the package directly.\n"],"names":["default","createEmotionCache","CacheProvider","withEmotionCache"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAGEA,WAAWC,kBAAkB,QACxB,iBAAgB;AAEvB,SAASC,aAAa,EAAEC,gBAAgB,QAAQ,iBAAgB,CAChE,8EAA8E;CAC9E,6EAA6E;CAC7E,+EAA+E;CAC/E,gFAAgF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export * as JSS from 'jss';
|
|
18
|
+
export { default as jssRtl } from 'jss-rtl';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import * as _JSS from "jss";
|
|
17
|
+
export { _JSS as JSS };
|
|
18
|
+
export { default as jssRtl } from "jss-rtl";
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=jss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/ui/theme/src/vendor/jss.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * as JSS from 'jss'\nexport { default as jssRtl } from 'jss-rtl'\n"],"names":["JSS","default","jssRtl"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,sBAAqB,MAAK;AAA1B,SAAO,QAAKA,GAAG,GAAW;AAC1B,SAASC,WAAWC,MAAM,QAAQ,UAAS"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { Theme as MuiTheme } from '@mui/material/styles';
|
|
18
|
+
import type { Color as MuiColor, CssVarsTheme, CSSProperties, Shadows } from '@mui/material/styles';
|
|
19
|
+
import type { ColorPropOverrides, IActionStates } from '../lib/theme.types';
|
|
20
|
+
declare module '@mui/material/Button' {
|
|
21
|
+
interface ButtonPropsColorOverrides extends ColorPropOverrides {
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
declare module '@mui/material/ButtonGroup' {
|
|
25
|
+
interface ButtonGroupPropsColorOverrides extends ColorPropOverrides {
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
declare module '@mui/material/Container' {
|
|
29
|
+
interface ContainerOwnProps {
|
|
30
|
+
variant?: 'vertical' | 'horizontal' | 'boxed';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `<Typography variant="lede">` and its two siblings (AGL-1308).
|
|
35
|
+
*
|
|
36
|
+
* The `TypographyVariants` augmentation further down puts the three variants
|
|
37
|
+
* on the THEME; this is what lets a component ASK for one. Declaring the theme
|
|
38
|
+
* side alone is the half-fix that compiles the theme and then rejects every
|
|
39
|
+
* use of it — the same trap `TypographyVariantsOptions` without
|
|
40
|
+
* `TypographyVariants` sets, one level up.
|
|
41
|
+
*/
|
|
42
|
+
declare module '@mui/material/Typography' {
|
|
43
|
+
interface TypographyPropsVariantOverrides {
|
|
44
|
+
lede: true;
|
|
45
|
+
bodyCompact: true;
|
|
46
|
+
micro: true;
|
|
47
|
+
displayXl: true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
declare module '@mui/material/ToggleButtonGroup' {
|
|
51
|
+
interface ToggleButtonGroupPropsColorOverrides extends ColorPropOverrides {
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
declare module '@mui/material/Fab' {
|
|
55
|
+
interface FabPropsColorOverrides extends ColorPropOverrides {
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
declare module '@mui/material/SvgIcon' {
|
|
59
|
+
interface SvgIconPropsColorOverrides extends ColorPropOverrides {
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
declare module '@mui/material/AppBar' {
|
|
63
|
+
interface AppBarPropsColorOverrides extends ColorPropOverrides {
|
|
64
|
+
surface: true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
declare module '@mui/material/Chip' {
|
|
68
|
+
interface ChipPropsColorOverrides extends ColorPropOverrides {
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
declare module '@mui/material/IconButton' {
|
|
72
|
+
interface IconButtonPropsColorOverrides extends ColorPropOverrides {
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
declare module '@mui/material/Tabs' {
|
|
76
|
+
interface TabsPropsIndicatorColorOverrides extends ColorPropOverrides {
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
declare module '@mui/system' {
|
|
80
|
+
interface Shape {
|
|
81
|
+
appIconBorderRadius: number | string;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
declare module '@mui/material/styles' {
|
|
85
|
+
type ExtraColor = Palette['primary'];
|
|
86
|
+
type ExtraColorOptions = PaletteOptions['primary'];
|
|
87
|
+
/**
|
|
88
|
+
* Pale accent washes used as SURFACES (AGL-1244) — `tint.primary`,
|
|
89
|
+
* `tint.secondary`, `tint.tertiary`.
|
|
90
|
+
*
|
|
91
|
+
* A group of string leaves like `background` and `text`, NOT a
|
|
92
|
+
* `PaletteColor`: there is no ramp to walk and no `contrastText`, because a
|
|
93
|
+
* tint is never a component `color` — the ink on it is the accent token the
|
|
94
|
+
* tile's icon already uses. That is also why `tint` is absent from
|
|
95
|
+
* `ColorPropOverrides`: `<Button color="tint">` would have no foreground to
|
|
96
|
+
* pair with and must stay a type error.
|
|
97
|
+
*/
|
|
98
|
+
interface PaletteTint {
|
|
99
|
+
primary: string;
|
|
100
|
+
secondary: string;
|
|
101
|
+
tertiary: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* START EXAMPLE – MODULE AUGMENTATION ↓
|
|
105
|
+
* ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄
|
|
106
|
+
* ```typescript
|
|
107
|
+
* // Add new property ↓
|
|
108
|
+
* declare module '@mui/material/styles' {
|
|
109
|
+
* interface Theme {
|
|
110
|
+
* status: {
|
|
111
|
+
* danger: React.CSSProperties['color'],
|
|
112
|
+
* }
|
|
113
|
+
* }
|
|
114
|
+
* interface ThemeOptions {
|
|
115
|
+
* status: {
|
|
116
|
+
* danger: React.CSSProperties['color']
|
|
117
|
+
* }
|
|
118
|
+
* }
|
|
119
|
+
* }
|
|
120
|
+
* const theme = createMuiTheme({
|
|
121
|
+
* status: {
|
|
122
|
+
* danger: '#e53e3e',
|
|
123
|
+
* },
|
|
124
|
+
* })
|
|
125
|
+
*
|
|
126
|
+
* // Add to existing property (e.g., palette, typography) ↓
|
|
127
|
+
* declare module "@mui/material/styles" {
|
|
128
|
+
* interface Palette {
|
|
129
|
+
* neutral: Palette['primary']
|
|
130
|
+
* }
|
|
131
|
+
* interface PaletteOptions {
|
|
132
|
+
* neutral: PaletteOptions['primary']
|
|
133
|
+
* }
|
|
134
|
+
* }
|
|
135
|
+
* const theme = createMuiTheme({
|
|
136
|
+
* palette: {
|
|
137
|
+
* neutral: {
|
|
138
|
+
* main: '#5c6ac4',
|
|
139
|
+
* },
|
|
140
|
+
* },
|
|
141
|
+
* })
|
|
142
|
+
* ```
|
|
143
|
+
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
144
|
+
* END EXAMPLE – MODULE AUGMENTATION ↑
|
|
145
|
+
*/
|
|
146
|
+
/**
|
|
147
|
+
* The resting border of an outlined input.
|
|
148
|
+
*
|
|
149
|
+
* A token because MUI has none: `OutlinedInput` hardcodes
|
|
150
|
+
* `rgba(0, 0, 0, 0.23)` / `rgba(255, 255, 255, 0.23)` inside its own
|
|
151
|
+
* styles, so there is nothing on the theme to read. Anything that has to
|
|
152
|
+
* draw an input BESIDE a MUI one — Stripe Elements, which paints its fields
|
|
153
|
+
* inside a cross-origin iframe from an `appearance` object we hand it — can
|
|
154
|
+
* otherwise only match by copying those literals, and the copy silently
|
|
155
|
+
* stops matching the first time the scheme moves.
|
|
156
|
+
*
|
|
157
|
+
* Deliberately NOT `divider` (`rgba(0, 0, 0, 0.12)`): half the weight, so a
|
|
158
|
+
* field drawn with it reads as a different, lighter control sitting next to
|
|
159
|
+
* ours — which is precisely the mismatch this token exists to prevent.
|
|
160
|
+
*
|
|
161
|
+
* A string leaf like `background` and `text`, not a `PaletteColor`: there is
|
|
162
|
+
* no ramp and no `contrastText`, because nothing is ever drawn ON it.
|
|
163
|
+
*/
|
|
164
|
+
interface PaletteOptions {
|
|
165
|
+
background?: PaletteOptions['background'];
|
|
166
|
+
tertiary?: ExtraColorOptions;
|
|
167
|
+
surface?: ExtraColorOptions;
|
|
168
|
+
tint?: Partial<PaletteTint>;
|
|
169
|
+
inputOutline?: string;
|
|
170
|
+
svgBackground?: IActionStates;
|
|
171
|
+
svgFilled?: IActionStates;
|
|
172
|
+
svgStroke?: IActionStates;
|
|
173
|
+
text?: PaletteOptions['text'];
|
|
174
|
+
}
|
|
175
|
+
interface TypeBackground {
|
|
176
|
+
}
|
|
177
|
+
interface Palette {
|
|
178
|
+
background: Palette['background'];
|
|
179
|
+
tertiary: ExtraColor;
|
|
180
|
+
surface: ExtraColor;
|
|
181
|
+
inputOutline: string;
|
|
182
|
+
tint: PaletteTint;
|
|
183
|
+
svgBackground: IActionStates;
|
|
184
|
+
svgFilled: IActionStates;
|
|
185
|
+
svgStroke: IActionStates;
|
|
186
|
+
text: Palette['text'];
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The brand's extra rungs on the font-weight scale (AGL-1308).
|
|
190
|
+
*
|
|
191
|
+
* MUI ships four — `fontWeightLight/Regular/Medium/Bold` — and the brand
|
|
192
|
+
* adds three above them: 600, 800 and 900, all real weights because Roboto
|
|
193
|
+
* Flex is a variable face covering 100–1000. Declaring them here is what
|
|
194
|
+
* makes `createTheme({ typography: { fontWeightSemiBold: 600 } })` compile;
|
|
195
|
+
* without the augmentation `TypographyVariantsOptions` is a closed shape and
|
|
196
|
+
* the theme itself does not typecheck.
|
|
197
|
+
*
|
|
198
|
+
* They are reachable the way the built-ins are: `@mui/system`'s `style()`
|
|
199
|
+
* retries a miss as `${prop}${capitalize(value)}`, so `fontWeight: 'black'`
|
|
200
|
+
* resolves to `typography.fontWeightBlack`.
|
|
201
|
+
*
|
|
202
|
+
* BOTH interfaces, and that is not belt-and-braces. `TypographyVariantsOptions`
|
|
203
|
+
* is what `createTheme` ACCEPTS and `TypographyVariants` is what the resolved
|
|
204
|
+
* `theme.typography` HANDS BACK — augmenting only the first compiles the
|
|
205
|
+
* theme and then fails every reader, which is the shape this was in.
|
|
206
|
+
*
|
|
207
|
+
* Optional on the options side, required on the resolved side: an override
|
|
208
|
+
* may omit it (MUI merges the default in), a reader may not have to check.
|
|
209
|
+
*
|
|
210
|
+
* ## And the SCALE variants
|
|
211
|
+
*
|
|
212
|
+
* `displayXl` is the rung ABOVE `h1`. The brand's display ramp tops out at
|
|
213
|
+
* h1's 56px, so a marketing hero drawn at 72px had no token to ask for and
|
|
214
|
+
* hand-wrote the pixels — which then lost to the variant's own responsive
|
|
215
|
+
* ramp. One rung, not two: h1 already IS the 56px display size, and a
|
|
216
|
+
* second name for it would leave two tokens to keep in step.
|
|
217
|
+
*
|
|
218
|
+
* `lede`, `bodyCompact` and `micro` — 17px, 13px and 11px with their line
|
|
219
|
+
* heights — exist because the built pages kept reaching for those sizes and,
|
|
220
|
+
* with nothing to ask for, wrote the pixels: /press alone carried 286 such
|
|
221
|
+
* literals. Full variant objects rather than bare sizes, so one pick brings
|
|
222
|
+
* the line height with it. Named for the JOB rather than the number, so the
|
|
223
|
+
* name survives a retune: a lede stays the lede if the brand moves it to
|
|
224
|
+
* 18px. `@mui/material/Typography` is augmented separately, above, so a
|
|
225
|
+
* component can ASK for one.
|
|
226
|
+
*
|
|
227
|
+
* ⚑ Declared in THIS file rather than beside the values in
|
|
228
|
+
* `console.theme.ts`, because module augmentation belongs with the rest of
|
|
229
|
+
* the vendor augmentations — and putting it here is what let it be added
|
|
230
|
+
* without touching a file another session was editing at the time.
|
|
231
|
+
*/
|
|
232
|
+
interface TypographyVariantsOptions {
|
|
233
|
+
fontWeightSemiBold?: number;
|
|
234
|
+
fontWeightExtraBold?: number;
|
|
235
|
+
fontWeightBlack?: number;
|
|
236
|
+
lede?: CSSProperties;
|
|
237
|
+
bodyCompact?: CSSProperties;
|
|
238
|
+
micro?: CSSProperties;
|
|
239
|
+
displayXl?: CSSProperties;
|
|
240
|
+
}
|
|
241
|
+
interface TypographyVariants {
|
|
242
|
+
fontWeightSemiBold: number;
|
|
243
|
+
fontWeightExtraBold: number;
|
|
244
|
+
fontWeightBlack: number;
|
|
245
|
+
lede: CSSProperties;
|
|
246
|
+
bodyCompact: CSSProperties;
|
|
247
|
+
micro: CSSProperties;
|
|
248
|
+
displayXl: CSSProperties;
|
|
249
|
+
}
|
|
250
|
+
interface ZIndex {
|
|
251
|
+
max: number;
|
|
252
|
+
min: number;
|
|
253
|
+
}
|
|
254
|
+
interface Mixins {
|
|
255
|
+
menuArrow: CSSProperties;
|
|
256
|
+
}
|
|
257
|
+
interface ThemeOptions {
|
|
258
|
+
shadowsInset?: Shadows;
|
|
259
|
+
}
|
|
260
|
+
interface Theme {
|
|
261
|
+
palette: Palette;
|
|
262
|
+
shadowsInset: Shadows;
|
|
263
|
+
}
|
|
264
|
+
interface Theme {
|
|
265
|
+
vars: CssVarsTheme['vars'] & Omit<Theme, 'typography' | 'mixins' | 'breakpoints' | 'direction' | 'transitions' | 'vars'>;
|
|
266
|
+
}
|
|
267
|
+
interface DefaultTheme extends Theme {
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
declare module '@mui/styles' {
|
|
271
|
+
interface DefaultTheme extends MuiTheme {
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
export type { Overwrite } from '@mui/types';
|
|
275
|
+
export { type ShapeOptions, type Spacing, type SpacingOptions, type MuiStyledOptions, type SxProps, type BoxProps, } from '@mui/system';
|
|
276
|
+
export { darkScrollbar } from '@mui/material';
|
|
277
|
+
export { visuallyHidden } from '@mui/utils';
|
|
278
|
+
export { type Breakpoint, type BreakpointOverrides, type Breakpoints, type BreakpointsOptions, type ClassNameMap, type ColorFormat, type ColorObject, type ComponentsOverrides, type ComponentsProps, type ComponentsPropsList, type ComponentsVariants, type CreateMUIStyled, type CSSObject, type Direction, type Duration, type Easing, type Palette, type PaletteColor, type PaletteColorOptions, type PaletteOptions, type SimplePaletteColorOptions, type StyledComponentProps, type Theme, type ThemedProps, type ThemeOptions, type ThemeWithProps, type Transitions, type TransitionsOptions, type TypographyStyle, type TypographyVariant, type TypographyVariants, type TypographyVariantsOptions, alpha, createTheme, darken, decomposeColor, easing, emphasize, getContrastRatio, getLuminance, hexToRgb, hslToRgb, lighten, recomposeColor, responsiveFontSizes, rgbToHex, styled, StyledEngineProvider, ThemeProvider, useTheme, useThemeProps, experimental_sx as sx, getInitColorSchemeScript, } from '@mui/material/styles';
|
|
279
|
+
export type ColorPartial = Partial<MuiColor>;
|
|
280
|
+
export { type CommonColors, type TypeBackground, type TypeText, type Shadows, } from '@mui/material/styles';
|
|
281
|
+
export { type Shape } from '@mui/system';
|
|
282
|
+
export type { BaseCreateCSSProperties, BaseCSSProperties, CSSProperties, ServerStyleSheets, StyledProps, StyleRules, StyleRulesCallback, Styles, StylesOptions, StylesProviderProps, ThemedComponentProps, ThemeOfStyles, ThemeProviderProps, WithStyles, WithStylesOptions, WithTheme, WithThemeCreatorOption, } from '@mui/styles';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ export { darkScrollbar } from "@mui/material";
|
|
17
|
+
export { visuallyHidden } from "@mui/utils";
|
|
18
|
+
export { alpha, createTheme, darken, decomposeColor, easing, emphasize, getContrastRatio, getLuminance, hexToRgb, hslToRgb, lighten, recomposeColor, responsiveFontSizes, rgbToHex, styled, StyledEngineProvider, ThemeProvider, useTheme, useThemeProps, experimental_sx as sx, getInitColorSchemeScript } from "@mui/material/styles";
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=mui.js.map
|
|
@@ -0,0 +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}\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,GAsTD,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"}
|