@hjmds/design-contracts 1.13.1 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agreement.d.ts +7 -1
- package/dist/agreement.d.ts.map +1 -1
- package/dist/agreement.js +14 -3
- package/dist/agreement.js.map +1 -1
- package/dist/behaviors.d.ts +1 -1
- package/dist/catalog.d.ts +4 -0
- package/dist/catalog.d.ts.map +1 -1
- package/dist/content-transition.d.ts +17 -0
- package/dist/content-transition.d.ts.map +1 -1
- package/dist/content-transition.js +21 -0
- package/dist/content-transition.js.map +1 -1
- package/dist/date-entry.d.ts +71 -0
- package/dist/date-entry.d.ts.map +1 -0
- package/dist/date-entry.js +78 -0
- package/dist/date-entry.js.map +1 -0
- package/dist/design-profile-layout.d.ts +11 -0
- package/dist/design-profile-layout.d.ts.map +1 -0
- package/dist/design-profile-layout.js +18 -0
- package/dist/design-profile-layout.js.map +1 -0
- package/dist/design-profile.d.ts +89 -0
- package/dist/design-profile.d.ts.map +1 -0
- package/dist/design-profile.js +262 -0
- package/dist/design-profile.js.map +1 -0
- package/dist/design-system-provider.d.ts +6 -0
- package/dist/design-system-provider.d.ts.map +1 -1
- package/dist/design-system-provider.js +4 -2
- package/dist/design-system-provider.js.map +1 -1
- package/dist/document-resource.d.ts +104 -0
- package/dist/document-resource.d.ts.map +1 -0
- package/dist/document-resource.js +77 -0
- package/dist/document-resource.js.map +1 -0
- package/dist/effect-surface.d.ts +6 -1
- package/dist/effect-surface.d.ts.map +1 -1
- package/dist/effect-surface.js +5 -2
- package/dist/effect-surface.js.map +1 -1
- package/dist/field-group.d.ts +47 -0
- package/dist/field-group.d.ts.map +1 -0
- package/dist/field-group.js +92 -0
- package/dist/field-group.js.map +1 -0
- package/dist/gooey-navigation.d.ts +19 -1
- package/dist/gooey-navigation.d.ts.map +1 -1
- package/dist/gooey-navigation.js +37 -2
- package/dist/gooey-navigation.js.map +1 -1
- package/dist/image.d.ts +17 -0
- package/dist/image.d.ts.map +1 -1
- package/dist/image.js +19 -0
- package/dist/image.js.map +1 -1
- package/dist/internal/effect-noise.d.ts +2 -0
- package/dist/internal/effect-noise.d.ts.map +1 -0
- package/dist/internal/effect-noise.js +4 -0
- package/dist/internal/effect-noise.js.map +1 -0
- package/dist/palette-contrast.d.ts +6 -0
- package/dist/palette-contrast.d.ts.map +1 -1
- package/dist/palette-contrast.js +17 -0
- package/dist/palette-contrast.js.map +1 -1
- package/dist/progressive-blur.d.ts +32 -0
- package/dist/progressive-blur.d.ts.map +1 -0
- package/dist/progressive-blur.js +28 -0
- package/dist/progressive-blur.js.map +1 -0
- package/dist/reference-controls.d.ts +32 -0
- package/dist/reference-controls.d.ts.map +1 -0
- package/dist/reference-controls.js +28 -0
- package/dist/reference-controls.js.map +1 -0
- package/dist/screen-patterns.d.ts +16 -1
- package/dist/screen-patterns.d.ts.map +1 -1
- package/dist/screen-patterns.js +4 -0
- package/dist/screen-patterns.js.map +1 -1
- package/dist/scroll-progress.d.ts +7 -1
- package/dist/scroll-progress.d.ts.map +1 -1
- package/dist/scroll-progress.js +21 -2
- package/dist/scroll-progress.js.map +1 -1
- package/dist/text-annotation.d.ts +43 -0
- package/dist/text-annotation.d.ts.map +1 -0
- package/dist/text-annotation.js +137 -0
- package/dist/text-annotation.js.map +1 -0
- package/dist/toast-liquid.d.ts +3 -1
- package/dist/toast-liquid.d.ts.map +1 -1
- package/dist/toast-liquid.js +6 -2
- package/dist/toast-liquid.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/agreement.md +14 -0
- package/docs/asset.md +7 -0
- package/docs/brand-boundary.md +14 -5
- package/docs/code-block.md +12 -1
- package/docs/collapsible.md +6 -0
- package/docs/design-profile.md +263 -0
- package/docs/design-system-provider.md +7 -0
- package/docs/dialog.md +20 -1
- package/docs/effect-surface.md +19 -3
- package/docs/generated/component-maturity.md +1 -1
- package/docs/generated/renderer-evidence.json +3 -3
- package/docs/generated/renderer-evidence.md +1 -1
- package/docs/generated/showcase-manifest.json +1 -1
- package/docs/gooey-navigation.md +37 -6
- package/docs/heading.md +15 -0
- package/docs/image.md +17 -0
- package/docs/optional-adapters.md +25 -0
- package/docs/popover.md +15 -0
- package/docs/rating.md +6 -1
- package/docs/reference-controls.md +40 -0
- package/docs/task-list.md +15 -1
- package/docs/text-annotation.md +85 -0
- package/docs/theming.md +18 -5
- package/docs/usage/README.md +23 -1
- package/docs/usage/components/activity-heatmap.md +3 -1
- package/docs/usage/components/agreement.md +15 -3
- package/docs/usage/components/alert-dialog.md +16 -1
- package/docs/usage/components/asset.md +9 -2
- package/docs/usage/components/avatar.md +33 -1
- package/docs/usage/components/badge.md +3 -1
- package/docs/usage/components/bottom-cta.md +3 -1
- package/docs/usage/components/bottom-navigation.md +5 -1
- package/docs/usage/components/button.md +7 -1
- package/docs/usage/components/calendar.md +3 -1
- package/docs/usage/components/card.md +26 -3
- package/docs/usage/components/carousel.md +10 -1
- package/docs/usage/components/chat-message.md +11 -1
- package/docs/usage/components/chip.md +5 -0
- package/docs/usage/components/code-block.md +14 -2
- package/docs/usage/components/collapsible.md +10 -2
- package/docs/usage/components/combobox.md +12 -1
- package/docs/usage/components/command-palette.md +11 -6
- package/docs/usage/components/content-transition.md +29 -5
- package/docs/usage/components/context-menu.md +7 -1
- package/docs/usage/components/date-picker.md +3 -1
- package/docs/usage/components/design-system-provider.md +7 -5
- package/docs/usage/components/dialog.md +70 -1
- package/docs/usage/components/effect-surface.md +4 -2
- package/docs/usage/components/empty-state.md +10 -2
- package/docs/usage/components/field.md +26 -1
- package/docs/usage/components/form.md +13 -3
- package/docs/usage/components/heading.md +7 -1
- package/docs/usage/components/image-comparison.md +82 -0
- package/docs/usage/components/image.md +83 -2
- package/docs/usage/components/keyboard-avoiding.md +6 -1
- package/docs/usage/components/link.md +3 -1
- package/docs/usage/components/list-row.md +5 -1
- package/docs/usage/components/list.md +8 -1
- package/docs/usage/components/load-more.md +3 -1
- package/docs/usage/components/mentions.md +3 -1
- package/docs/usage/components/menu.md +3 -1
- package/docs/usage/components/menubar.md +7 -1
- package/docs/usage/components/message-composer.md +16 -5
- package/docs/usage/components/notice.md +9 -0
- package/docs/usage/components/number-field.md +3 -1
- package/docs/usage/components/onboarding-screen.md +16 -9
- package/docs/usage/components/overview-screen.md +73 -0
- package/docs/usage/components/password-field.md +5 -1
- package/docs/usage/components/popover.md +14 -1
- package/docs/usage/components/progress.md +28 -0
- package/docs/usage/components/progressive-blur.md +113 -0
- package/docs/usage/components/rating.md +74 -0
- package/docs/usage/components/saved-items-screen.md +3 -1
- package/docs/usage/components/screen-layout.md +9 -1
- package/docs/usage/components/search-field.md +13 -1
- package/docs/usage/components/search-screen.md +5 -0
- package/docs/usage/components/segmented-control.md +17 -0
- package/docs/usage/components/select.md +9 -0
- package/docs/usage/components/sheet.md +14 -1
- package/docs/usage/components/skeleton.md +9 -0
- package/docs/usage/components/slider.md +3 -1
- package/docs/usage/components/statistic.md +14 -1
- package/docs/usage/components/surface.md +8 -1
- package/docs/usage/components/tabs.md +11 -2
- package/docs/usage/components/tag.md +3 -1
- package/docs/usage/components/tags-input.md +11 -1
- package/docs/usage/components/text-area.md +3 -1
- package/docs/usage/components/text-transition.md +8 -2
- package/docs/usage/components/text.md +3 -1
- package/docs/usage/components/toast.md +23 -1
- package/docs/usage/components/top-bar.md +3 -1
- package/docs/usage/components/upload-item.md +3 -1
- package/docs/usage/compositions/action-feedback.md +77 -0
- package/docs/usage/compositions/adaptive-content.md +81 -0
- package/docs/usage/compositions/command-records.md +106 -0
- package/docs/usage/compositions/content-transition-comparison.md +108 -0
- package/docs/usage/compositions/context-toolbar.md +85 -0
- package/docs/usage/compositions/date-entry.md +108 -0
- package/docs/usage/compositions/date-time-selection.md +110 -0
- package/docs/usage/compositions/design-profile-comparison.md +114 -0
- package/docs/usage/compositions/document-resource.md +124 -0
- package/docs/usage/compositions/field-group.md +104 -0
- package/docs/usage/compositions/illustrated-outcome.md +91 -0
- package/docs/usage/compositions/live-list.md +104 -0
- package/docs/usage/compositions/optional-adapters.md +1 -1
- package/docs/usage/compositions/origin-dialog.md +108 -0
- package/docs/usage/compositions/selection-motion.md +73 -0
- package/docs/usage/compositions/texture-comparison.md +86 -0
- package/docs/usage/compositions/upload-recovery.md +80 -0
- package/docs/usage/compositions/video-dialog.md +100 -0
- package/docs/usage/screens/flow-onboarding.md +5 -3
- package/docs/usage/screens/product-bento.md +117 -0
- package/docs/usage/tokens/color.md +9 -2
- package/docs/usage/tokens/elevation-opacity.md +8 -1
- package/docs/usage/tokens/motion.md +10 -1
- package/docs/usage/tokens/radius.md +8 -1
- package/docs/usage/tokens/typography.md +15 -1
- package/package.json +49 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type ResolvedTheme, type ThemeColors } from "./colors.js";
|
|
2
|
+
import { radius, typography, heading, shadow, type FontWeightValue } from "./foundations.js";
|
|
3
|
+
import { type EffectSurfaceDescriptor } from "./effect-surface.js";
|
|
4
|
+
import type { ContentTransitionPreset } from "./content-transition.js";
|
|
5
|
+
/** A product chooses one portable profile; the renderer owns each host translation.
|
|
6
|
+
* Keep business state/callbacks outside it so a visual change cannot replace a draft.
|
|
7
|
+
* See docs/design-profile.md for the staged renderer integration and coverage limits. */
|
|
8
|
+
export type HjmDesignPreset = "neutral" | "retro" | "paper" | "forest" | "minimal" | "editorial" | "brutalist" | "glass" | "aurora" | "terminal" | "clay";
|
|
9
|
+
type RadiusTokens = Readonly<Record<keyof typeof radius, number>>;
|
|
10
|
+
type TypeToken = Readonly<{
|
|
11
|
+
fontSize: number;
|
|
12
|
+
lineHeight: number;
|
|
13
|
+
fontWeight: FontWeightValue;
|
|
14
|
+
}>;
|
|
15
|
+
type TypographyTokens = Readonly<Record<keyof typeof typography, TypeToken>>;
|
|
16
|
+
type HeadingTokens = Readonly<Record<keyof typeof heading, TypeToken>>;
|
|
17
|
+
type ShadowToken = Readonly<{
|
|
18
|
+
color: string;
|
|
19
|
+
opacity: number;
|
|
20
|
+
radius: number;
|
|
21
|
+
offsetY: number;
|
|
22
|
+
}>;
|
|
23
|
+
type ShadowTokens = Readonly<Record<keyof typeof shadow, ShadowToken>>;
|
|
24
|
+
type SurfaceMaterial = Readonly<{
|
|
25
|
+
/** Host-relative strength; Web maps 1 to 32px, Native host calibrates its own blur. */
|
|
26
|
+
blurStrength: number;
|
|
27
|
+
/** Requested semantic fill; the renderer raises opacity when background contrast requires it. */
|
|
28
|
+
fillOpacity: number;
|
|
29
|
+
insetShadows: readonly Readonly<ShadowToken & {
|
|
30
|
+
offsetX: number;
|
|
31
|
+
}>[];
|
|
32
|
+
}>;
|
|
33
|
+
type Palette = Readonly<Record<ResolvedTheme, Readonly<ThemeColors>>>;
|
|
34
|
+
export type HjmDesignProfile = Readonly<{
|
|
35
|
+
id: string;
|
|
36
|
+
palette: Palette;
|
|
37
|
+
tokens: Readonly<{
|
|
38
|
+
radius: RadiusTokens;
|
|
39
|
+
fontFamily: Readonly<{
|
|
40
|
+
ui: readonly string[];
|
|
41
|
+
code: readonly string[];
|
|
42
|
+
}>;
|
|
43
|
+
typography: TypographyTokens;
|
|
44
|
+
heading: HeadingTokens;
|
|
45
|
+
shadow: ShadowTokens;
|
|
46
|
+
}>;
|
|
47
|
+
material: Readonly<Record<"canvas" | "card", EffectSurfaceDescriptor | null> & {
|
|
48
|
+
surface?: SurfaceMaterial | null;
|
|
49
|
+
}>;
|
|
50
|
+
interactions: Readonly<{
|
|
51
|
+
contentTransition: ContentTransitionPreset;
|
|
52
|
+
selectionMotion: "none" | "slide";
|
|
53
|
+
}>;
|
|
54
|
+
compositions: Readonly<{
|
|
55
|
+
collection: "rows" | "cards" | "grid";
|
|
56
|
+
toolbar: "inline" | "collapsible";
|
|
57
|
+
}>;
|
|
58
|
+
screens: Readonly<{
|
|
59
|
+
overview: "dashboard" | "editorial" | "landscape";
|
|
60
|
+
}>;
|
|
61
|
+
}>;
|
|
62
|
+
/** A custom app profile is data, not a mutable global registry or renderer import.
|
|
63
|
+
* Partial records inherit the selected preset independently in light and dark. */
|
|
64
|
+
export type HjmDesignProfileInput = Readonly<{
|
|
65
|
+
extends?: HjmDesignPreset;
|
|
66
|
+
id?: string;
|
|
67
|
+
palette?: Readonly<Partial<Record<ResolvedTheme, Readonly<Partial<ThemeColors>>>>>;
|
|
68
|
+
tokens?: Readonly<{
|
|
69
|
+
radius?: Readonly<Partial<RadiusTokens>>;
|
|
70
|
+
fontFamily?: Readonly<Partial<HjmDesignProfile["tokens"]["fontFamily"]>>;
|
|
71
|
+
typography?: Readonly<Partial<Record<keyof typeof typography, Partial<TypeToken>>>>;
|
|
72
|
+
heading?: Readonly<Partial<Record<keyof typeof heading, Partial<TypeToken>>>>;
|
|
73
|
+
shadow?: Readonly<Partial<Record<keyof typeof shadow, Partial<ShadowToken>>>>;
|
|
74
|
+
}>;
|
|
75
|
+
material?: Readonly<Partial<Pick<HjmDesignProfile["material"], "canvas" | "card">> & {
|
|
76
|
+
surface?: Partial<SurfaceMaterial> | null;
|
|
77
|
+
}>;
|
|
78
|
+
interactions?: Readonly<Partial<HjmDesignProfile["interactions"]>>;
|
|
79
|
+
compositions?: Readonly<Partial<HjmDesignProfile["compositions"]>>;
|
|
80
|
+
screens?: Readonly<Partial<HjmDesignProfile["screens"]>>;
|
|
81
|
+
}>;
|
|
82
|
+
export declare const hjmDesignPresets: Readonly<Record<HjmDesignPreset, HjmDesignProfile>>;
|
|
83
|
+
export declare function defineHjmDesignProfile(input?: HjmDesignProfileInput): HjmDesignProfile;
|
|
84
|
+
/** Resolve the readable fill against black/white backdrop extremes using the
|
|
85
|
+
* final product palette, including brandPalette overrides. Blur is decorative:
|
|
86
|
+
* it cannot be used as evidence of text contrast over arbitrary app content. */
|
|
87
|
+
export declare function resolveDesignProfileSurfaceMaterial(profile: HjmDesignProfile | undefined, palette: Readonly<ThemeColors>): SurfaceMaterial | null;
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=design-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AO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACpI,YAAY,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACnE,YAAY,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;CAC1D,CAAC,CAAC;AAyNH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAY/E,CAAC;AAEH,wBAAgB,sBAAsB,CAAC,KAAK,GAAE,qBAA0B,GAAG,gBAAgB,CAI1F;AAED;;gFAEgF;AAChF,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,eAAe,GAAG,IAAI,CAOjJ"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { THEMES } from "./colors.js";
|
|
2
|
+
import { radius, fontFamily, typography, heading, shadow, fontWeight } from "./foundations.js";
|
|
3
|
+
import { checkPaletteContrast, resolveSurfaceFillOpacity } from "./palette-contrast.js";
|
|
4
|
+
import { resolveEffectSurface } from "./effect-surface.js";
|
|
5
|
+
const neutral = {
|
|
6
|
+
id: "neutral", palette: THEMES,
|
|
7
|
+
tokens: { radius, fontFamily, typography, heading, shadow },
|
|
8
|
+
material: { canvas: null, card: null, surface: null },
|
|
9
|
+
interactions: { contentTransition: "fade", selectionMotion: "none" },
|
|
10
|
+
compositions: { collection: "rows", toolbar: "inline" },
|
|
11
|
+
screens: { overview: "dashboard" },
|
|
12
|
+
};
|
|
13
|
+
/** Profiles deliberately differ in interaction and arrangement, not just hue.
|
|
14
|
+
* No font asset is bundled or implied: custom font loading remains product-owned. */
|
|
15
|
+
const presetInputs = {
|
|
16
|
+
retro: {
|
|
17
|
+
id: "retro",
|
|
18
|
+
palette: {
|
|
19
|
+
light: { bg: "#fff8e8", surface: "#fffdf5", surfaceAlt: "#eee0c5", surfaceAccent: "#f6d4a0", border: "#d1bd96", borderControl: "#75604b", primary: "#973c20", contentBrand: "#80321a", text: "#2c2119", textBody: "#413123", textMuted: "#594637", textSub: "#695646", textWeak: "#857461" },
|
|
20
|
+
dark: { bg: "#211a16", surface: "#2d241d", surfaceAlt: "#3b3025", surfaceAccent: "#5e3827", border: "#807260", borderControl: "#b7a387", primary: "#af5437", contentBrand: "#ffc38b", text: "#fff5e1", textBody: "#ead8bb", textMuted: "#d5c1a3", textSub: "#bea88b", textWeak: "#a18e74" },
|
|
21
|
+
},
|
|
22
|
+
tokens: { radius: { sm: 2, md: 4, lg: 6, xl: 8 } },
|
|
23
|
+
material: { canvas: { layers: ["noise"], intensity: 0.08, active: false, seed: "retro" } },
|
|
24
|
+
interactions: { contentTransition: "slide", selectionMotion: "none" },
|
|
25
|
+
compositions: { collection: "grid", toolbar: "inline" },
|
|
26
|
+
screens: { overview: "dashboard" },
|
|
27
|
+
},
|
|
28
|
+
paper: {
|
|
29
|
+
id: "paper",
|
|
30
|
+
palette: {
|
|
31
|
+
light: { bg: "#f9f5ed", surface: "#fffdf8", surfaceAlt: "#eee8dc", surfaceAccent: "#e7dac8", border: "#d6cabb", borderControl: "#776b5c", primary: "#665039", contentBrand: "#58432e", text: "#28231c", textBody: "#40382d", textMuted: "#5b5145", textSub: "#6e6253", textWeak: "#887b69" },
|
|
32
|
+
dark: { bg: "#1b1916", surface: "#27231e", surfaceAlt: "#332d25", surfaceAccent: "#4f4132", border: "#847561", borderControl: "#b8a68c", primary: "#83684c", contentBrand: "#e3bf91", text: "#f8f0e1", textBody: "#e5d9c4", textMuted: "#d0c0a6", textSub: "#b8a78d", textWeak: "#a18e72" },
|
|
33
|
+
},
|
|
34
|
+
tokens: { radius: { sm: 4, md: 6, lg: 8, xl: 12 } },
|
|
35
|
+
material: { canvas: { layers: ["grain"], intensity: 0.06, active: false, seed: "paper" } },
|
|
36
|
+
interactions: { contentTransition: "fade", selectionMotion: "none" },
|
|
37
|
+
compositions: { collection: "rows", toolbar: "collapsible" },
|
|
38
|
+
screens: { overview: "editorial" },
|
|
39
|
+
},
|
|
40
|
+
forest: {
|
|
41
|
+
id: "forest",
|
|
42
|
+
palette: {
|
|
43
|
+
light: { bg: "#f2f7ef", surface: "#fbfdf8", surfaceAlt: "#e0ebda", surfaceAccent: "#d5e8c9", border: "#bdcdb5", borderControl: "#65765c", primary: "#285c35", contentBrand: "#23512d", text: "#1d2b1b", textBody: "#30422c", textMuted: "#485c41", textSub: "#5c6e54", textWeak: "#7b8b71" },
|
|
44
|
+
dark: { bg: "#111c15", surface: "#1b2a1e", surfaceAlt: "#293a2a", surfaceAccent: "#304d32", border: "#6b816a", borderControl: "#95ac8d", primary: "#477c54", contentBrand: "#a8d994", text: "#eff7e9", textBody: "#d8e9cf", textMuted: "#bdd4b3", textSub: "#a1bd94", textWeak: "#87a17b" },
|
|
45
|
+
},
|
|
46
|
+
tokens: { radius: { sm: 10, md: 16, lg: 24, xl: 32 } },
|
|
47
|
+
material: { canvas: { layers: ["mesh", "glow"], intensity: 0.1, active: false, seed: "forest" } },
|
|
48
|
+
interactions: { contentTransition: "rise", selectionMotion: "slide" },
|
|
49
|
+
compositions: { collection: "cards", toolbar: "collapsible" },
|
|
50
|
+
screens: { overview: "landscape" },
|
|
51
|
+
},
|
|
52
|
+
minimal: {
|
|
53
|
+
id: "minimal",
|
|
54
|
+
palette: { light: { primary: "#404040", contentBrand: "#333333", surfaceAccent: "#eeeeee" }, dark: { primary: "#727272", contentBrand: "#dddddd", surfaceAccent: "#303030" } },
|
|
55
|
+
tokens: { radius: { sm: 4, md: 8, lg: 12, xl: 16 }, shadow: { raised: { opacity: 0 }, floating: { opacity: 0.08 } } },
|
|
56
|
+
interactions: { contentTransition: "fade", selectionMotion: "none" },
|
|
57
|
+
compositions: { collection: "rows", toolbar: "inline" }, screens: { overview: "dashboard" },
|
|
58
|
+
},
|
|
59
|
+
editorial: {
|
|
60
|
+
id: "editorial",
|
|
61
|
+
palette: { light: { primary: "#59435f", contentBrand: "#513a57", surfaceAccent: "#eee4f0" }, dark: { primary: "#846b8e", contentBrand: "#ead0f2", surfaceAccent: "#392a3e" } },
|
|
62
|
+
tokens: { radius: { sm: 0, md: 2, lg: 4, xl: 8 }, typography: { heading: { fontSize: 28, lineHeight: 38, fontWeight: fontWeight.medium }, body: { lineHeight: 24 } }, heading: { level1: { fontSize: 44, lineHeight: 54, fontWeight: fontWeight.medium }, level2: { fontSize: 34, lineHeight: 44, fontWeight: fontWeight.medium } } },
|
|
63
|
+
interactions: { contentTransition: "rise", selectionMotion: "none" },
|
|
64
|
+
compositions: { collection: "rows", toolbar: "collapsible" }, screens: { overview: "editorial" },
|
|
65
|
+
},
|
|
66
|
+
brutalist: {
|
|
67
|
+
id: "brutalist",
|
|
68
|
+
palette: { light: { primary: "#171717", contentBrand: "#171717", surfaceAccent: "#e8ed91", border: "#171717" }, dark: { primary: "#727272", contentBrand: "#f0f3a3", surfaceAccent: "#393a1c", border: "#cccccc" } },
|
|
69
|
+
tokens: { radius: { sm: 0, md: 0, lg: 0, xl: 0 }, shadow: { raised: { radius: 0, offsetY: 4, opacity: 0.25 }, floating: { radius: 0, offsetY: 6, opacity: 0.3 } }, typography: { heading: { fontSize: 30, lineHeight: 38, fontWeight: fontWeight.heavy } }, heading: { level1: { fontSize: 48, lineHeight: 56 }, level2: { fontSize: 38, lineHeight: 46 } } },
|
|
70
|
+
interactions: { contentTransition: "slide", selectionMotion: "none" },
|
|
71
|
+
compositions: { collection: "cards", toolbar: "inline" }, screens: { overview: "editorial" },
|
|
72
|
+
},
|
|
73
|
+
glass: {
|
|
74
|
+
id: "glass",
|
|
75
|
+
palette: {
|
|
76
|
+
// contrast rules; the neutral weak/subtle tiers required an opaque fill.
|
|
77
|
+
light: { primary: "#435e91", contentBrand: "#354c78", surfaceAccent: "#e4ecf7", textSub: "#5b6879", textWeak: "#748292" }, dark: { primary: "#5673a3", contentBrand: "#c1d8ff", surfaceAccent: "#233654" }
|
|
78
|
+
},
|
|
79
|
+
tokens: { radius: { sm: 12, md: 18, lg: 26, xl: 36 }, shadow: { floating: { radius: 24, opacity: 0.12, offsetY: 8 } } },
|
|
80
|
+
material: { canvas: { layers: ["mesh"], intensity: 0.16, active: false, seed: "glass" }, card: { layers: ["glow"], intensity: 0.06, active: false, seed: "glass-card" }, surface: { blurStrength: 0.75, fillOpacity: 0.88, insetShadows: [] } },
|
|
81
|
+
interactions: { contentTransition: "fade", selectionMotion: "slide" },
|
|
82
|
+
compositions: { collection: "cards", toolbar: "inline" }, screens: { overview: "landscape" },
|
|
83
|
+
},
|
|
84
|
+
aurora: {
|
|
85
|
+
id: "aurora",
|
|
86
|
+
palette: { light: { primary: "#62409b", contentBrand: "#58388b", surfaceAccent: "#ece2fa" }, dark: { primary: "#8161b1", contentBrand: "#dbc3ff", surfaceAccent: "#392651" } },
|
|
87
|
+
tokens: { radius: { sm: 8, md: 14, lg: 22, xl: 30 } },
|
|
88
|
+
material: { canvas: { layers: ["mesh", "glow"], intensity: 0.2, active: true, period: 30, seed: "aurora" } },
|
|
89
|
+
interactions: { contentTransition: "scale", selectionMotion: "slide" },
|
|
90
|
+
compositions: { collection: "grid", toolbar: "collapsible" }, screens: { overview: "landscape" },
|
|
91
|
+
},
|
|
92
|
+
terminal: {
|
|
93
|
+
id: "terminal",
|
|
94
|
+
palette: { light: { primary: "#235837", contentBrand: "#245435", surfaceAccent: "#deefdf" }, dark: { primary: "#467f54", contentBrand: "#95e2a6", surfaceAccent: "#203b28" } },
|
|
95
|
+
tokens: { radius: { sm: 2, md: 4, lg: 6, xl: 8 }, fontFamily: { ui: fontFamily.code }, shadow: { raised: { opacity: 0 }, floating: { radius: 0, offsetY: 0, opacity: 0 } } },
|
|
96
|
+
interactions: { contentTransition: "fade", selectionMotion: "none" },
|
|
97
|
+
compositions: { collection: "rows", toolbar: "collapsible" }, screens: { overview: "dashboard" },
|
|
98
|
+
},
|
|
99
|
+
clay: {
|
|
100
|
+
id: "clay",
|
|
101
|
+
palette: { light: { primary: "#904663", contentBrand: "#803b57", surfaceAccent: "#f7e1eb" }, dark: { primary: "#a25e7d", contentBrand: "#f1bed4", surfaceAccent: "#482b3a" } },
|
|
102
|
+
tokens: { radius: { sm: 14, md: 22, lg: 32, xl: 44 }, shadow: { raised: { radius: 16, offsetY: 6, opacity: 0.12 }, floating: { radius: 28, offsetY: 12, opacity: 0.18 } } },
|
|
103
|
+
material: { card: { layers: ["grain"], intensity: 0.04, active: false, seed: "clay" }, surface: { blurStrength: 0, fillOpacity: 1, insetShadows: [
|
|
104
|
+
{ color: "#ffffff", opacity: 0.22, radius: 10, offsetX: 3, offsetY: 4 },
|
|
105
|
+
{ color: "#000000", opacity: 0.12, radius: 12, offsetX: -3, offsetY: -4 },
|
|
106
|
+
] } },
|
|
107
|
+
interactions: { contentTransition: "scale", selectionMotion: "slide" },
|
|
108
|
+
compositions: { collection: "cards", toolbar: "collapsible" }, screens: { overview: "dashboard" },
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
function freeze(value) {
|
|
112
|
+
if (value !== null && typeof value === "object") {
|
|
113
|
+
for (const item of Object.values(value))
|
|
114
|
+
freeze(item);
|
|
115
|
+
Object.freeze(value);
|
|
116
|
+
}
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
function choose(value, allowed, field) {
|
|
120
|
+
if (!allowed.includes(value))
|
|
121
|
+
throw new TypeError(`Unsupported design profile ${field}`);
|
|
122
|
+
}
|
|
123
|
+
function merge(base, input) {
|
|
124
|
+
for (const role of Object.keys(input.material ?? {})) {
|
|
125
|
+
if (!["canvas", "card", "surface"].includes(role))
|
|
126
|
+
throw new TypeError("Unsupported design profile material role");
|
|
127
|
+
}
|
|
128
|
+
const requestedSurface = input.material?.surface;
|
|
129
|
+
if (requestedSurface !== undefined && requestedSurface !== null && (typeof requestedSurface !== "object" || Array.isArray(requestedSurface)))
|
|
130
|
+
throw new TypeError("Invalid design profile surface material");
|
|
131
|
+
for (const key of Object.keys(requestedSurface ?? {})) {
|
|
132
|
+
if (!["blurStrength", "fillOpacity", "insetShadows"].includes(key))
|
|
133
|
+
throw new TypeError("Unsupported design profile surface material field");
|
|
134
|
+
}
|
|
135
|
+
const palette = {
|
|
136
|
+
light: { ...base.palette.light, ...input.palette?.light },
|
|
137
|
+
dark: { ...base.palette.dark, ...input.palette?.dark },
|
|
138
|
+
};
|
|
139
|
+
// fromEntries loses fixed keys; iteration over the complete base preserves every role.
|
|
140
|
+
const type = Object.fromEntries(Object.entries(base.tokens.typography).map(([key, value]) => [key, { ...value, ...input.tokens?.typography?.[key] }]));
|
|
141
|
+
// Display levels need their own roles: deriving them from body text would erase
|
|
142
|
+
// the hierarchy. Keep the original level3–5 typography aliases, with explicit
|
|
143
|
+
// heading overrides last, and preserve inherited heading values on empty input.
|
|
144
|
+
const aliases = { level3: "heading", level4: "titleLarge", level5: "title" };
|
|
145
|
+
for (const key of Object.keys(input.tokens?.heading ?? {})) {
|
|
146
|
+
if (!Object.prototype.hasOwnProperty.call(heading, key))
|
|
147
|
+
throw new TypeError("Unsupported design profile heading level");
|
|
148
|
+
}
|
|
149
|
+
const headings = Object.fromEntries(Object.entries(base.tokens.heading).map(([key, value]) => {
|
|
150
|
+
const level = key;
|
|
151
|
+
const alias = level in aliases ? aliases[level] : undefined;
|
|
152
|
+
return [level, { ...value, ...(alias ? input.tokens?.typography?.[alias] : undefined), ...input.tokens?.heading?.[level] }];
|
|
153
|
+
}));
|
|
154
|
+
// The complete base shadow record has the same key-preservation guarantee.
|
|
155
|
+
const elevation = Object.fromEntries(Object.entries(base.tokens.shadow).map(([key, value]) => [key, { ...value, ...input.tokens?.shadow?.[key] }]));
|
|
156
|
+
const profile = {
|
|
157
|
+
id: input.id ?? base.id, palette,
|
|
158
|
+
tokens: {
|
|
159
|
+
radius: { ...base.tokens.radius, ...input.tokens?.radius },
|
|
160
|
+
// Copy caller-owned arrays: freezing the resolved profile must never freeze app input.
|
|
161
|
+
fontFamily: { ui: [...(input.tokens?.fontFamily?.ui ?? base.tokens.fontFamily.ui)], code: [...(input.tokens?.fontFamily?.code ?? base.tokens.fontFamily.code)] },
|
|
162
|
+
typography: type, heading: headings, shadow: elevation,
|
|
163
|
+
},
|
|
164
|
+
material: { ...base.material, ...input.material, surface: input.material?.surface === null ? null
|
|
165
|
+
: input.material?.surface === undefined ? base.material.surface ?? null
|
|
166
|
+
: { blurStrength: 0, fillOpacity: 1, insetShadows: [], ...base.material.surface, ...input.material.surface } },
|
|
167
|
+
interactions: { ...base.interactions, ...input.interactions },
|
|
168
|
+
compositions: { ...base.compositions, ...input.compositions },
|
|
169
|
+
screens: { ...base.screens, ...input.screens },
|
|
170
|
+
};
|
|
171
|
+
if (!profile.id.trim())
|
|
172
|
+
throw new TypeError("Design profile id must not be empty");
|
|
173
|
+
for (const mode of ["light", "dark"]) {
|
|
174
|
+
for (const [key, value] of Object.entries(palette[mode])) {
|
|
175
|
+
if (!(key in THEMES[mode]) || !/^#[0-9a-f]{6}$/i.test(value))
|
|
176
|
+
throw new TypeError(`Invalid design profile palette ${mode}.${key}`);
|
|
177
|
+
}
|
|
178
|
+
if (checkPaletteContrast(palette[mode]).length)
|
|
179
|
+
throw new RangeError(`Design profile ${mode} palette fails required contrast pairs`);
|
|
180
|
+
}
|
|
181
|
+
for (const [key, value] of Object.entries(profile.tokens.radius)) {
|
|
182
|
+
if (!(key in radius) || !Number.isFinite(value) || value < 0 || value > 999)
|
|
183
|
+
throw new RangeError("Invalid design profile radius");
|
|
184
|
+
}
|
|
185
|
+
// Circles/pills retain their semantic geometry; product corners apply to other roles.
|
|
186
|
+
if (profile.tokens.radius.full !== radius.full)
|
|
187
|
+
throw new RangeError("Design profile must preserve full radius");
|
|
188
|
+
for (const value of [...Object.values(type), ...Object.values(headings)]) {
|
|
189
|
+
if (!Number.isFinite(value.fontSize) || value.fontSize < 11 || value.fontSize > 96 || !Number.isFinite(value.lineHeight) || value.lineHeight < value.fontSize || value.lineHeight > 144)
|
|
190
|
+
throw new RangeError("Invalid design profile typography");
|
|
191
|
+
choose(value.fontWeight, ["400", "500", "600", "700", "800"], "fontWeight");
|
|
192
|
+
}
|
|
193
|
+
for (const families of Object.values(profile.tokens.fontFamily)) {
|
|
194
|
+
if (!families.length || families.some(family => !family.trim()))
|
|
195
|
+
throw new TypeError("Design profile font families must not be empty");
|
|
196
|
+
}
|
|
197
|
+
for (const token of Object.values(elevation)) {
|
|
198
|
+
if (!/^#[0-9a-f]{6}$/i.test(token.color) || !Number.isFinite(token.opacity) || token.opacity < 0 || token.opacity > 1 || !Number.isFinite(token.radius) || token.radius < 0 || token.radius > 96 || !Number.isFinite(token.offsetY) || Math.abs(token.offsetY) > 96)
|
|
199
|
+
throw new RangeError("Invalid design profile shadow");
|
|
200
|
+
}
|
|
201
|
+
const surface = profile.material.surface;
|
|
202
|
+
if (surface) {
|
|
203
|
+
// Keep a readable semantic fill rather than copying a low-alpha reference card.
|
|
204
|
+
// Native can fail to supply blur and must always retain its opaque fallback.
|
|
205
|
+
if (!Number.isFinite(surface.blurStrength) || surface.blurStrength < 0 || surface.blurStrength > 1 || !Number.isFinite(surface.fillOpacity) || surface.fillOpacity < 0.85 || surface.fillOpacity > 1)
|
|
206
|
+
throw new RangeError("Invalid design profile surface material");
|
|
207
|
+
if (!Array.isArray(surface.insetShadows) || surface.insetShadows.length > 2)
|
|
208
|
+
throw new RangeError("Invalid design profile inset shadows");
|
|
209
|
+
for (const token of surface.insetShadows) {
|
|
210
|
+
if (!/^#[0-9a-f]{6}$/i.test(token.color) || !Number.isFinite(token.opacity) || token.opacity < 0 || token.opacity > 1 || !Number.isFinite(token.radius) || token.radius < 0 || token.radius > 96 || !Number.isFinite(token.offsetY) || Math.abs(token.offsetY) > 96 || !Number.isFinite(token.offsetX) || Math.abs(token.offsetX) > 96)
|
|
211
|
+
throw new RangeError("Invalid design profile inset shadow");
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const effects = Object.fromEntries(["canvas", "card"].map(role => {
|
|
215
|
+
const descriptor = profile.material[role];
|
|
216
|
+
if (descriptor === null)
|
|
217
|
+
return [role, null];
|
|
218
|
+
resolveEffectSurface(descriptor);
|
|
219
|
+
// Deep-copy material data as well: a preset resolver must not own caller state.
|
|
220
|
+
return [role, { ...descriptor, ...(descriptor.layers ? { layers: [...descriptor.layers] } : {}), ...(descriptor.colors ? { colors: descriptor.colors.map(color => ({ ...color })) } : {}) }];
|
|
221
|
+
}));
|
|
222
|
+
const material = { ...effects, surface: surface ? { ...surface, insetShadows: surface.insetShadows.map(token => ({ ...token })) } : null };
|
|
223
|
+
choose(profile.interactions.contentTransition, ["fade", "rise", "slide", "scale"], "contentTransition");
|
|
224
|
+
choose(profile.interactions.selectionMotion, ["none", "slide"], "selectionMotion");
|
|
225
|
+
choose(profile.compositions.collection, ["rows", "cards", "grid"], "collection");
|
|
226
|
+
choose(profile.compositions.toolbar, ["inline", "collapsible"], "toolbar");
|
|
227
|
+
choose(profile.screens.overview, ["dashboard", "editorial", "landscape"], "overview");
|
|
228
|
+
return freeze({ ...profile, material });
|
|
229
|
+
}
|
|
230
|
+
export const hjmDesignPresets = freeze({
|
|
231
|
+
neutral: merge(neutral, {}),
|
|
232
|
+
retro: merge(neutral, presetInputs.retro),
|
|
233
|
+
paper: merge(neutral, presetInputs.paper),
|
|
234
|
+
forest: merge(neutral, presetInputs.forest),
|
|
235
|
+
minimal: merge(neutral, presetInputs.minimal),
|
|
236
|
+
editorial: merge(neutral, presetInputs.editorial),
|
|
237
|
+
brutalist: merge(neutral, presetInputs.brutalist),
|
|
238
|
+
glass: merge(neutral, presetInputs.glass),
|
|
239
|
+
aurora: merge(neutral, presetInputs.aurora),
|
|
240
|
+
terminal: merge(neutral, presetInputs.terminal),
|
|
241
|
+
clay: merge(neutral, presetInputs.clay),
|
|
242
|
+
});
|
|
243
|
+
export function defineHjmDesignProfile(input = {}) {
|
|
244
|
+
const base = hjmDesignPresets[input.extends ?? "neutral"];
|
|
245
|
+
if (!base)
|
|
246
|
+
throw new TypeError("Unknown HJM design preset");
|
|
247
|
+
return merge(base, input);
|
|
248
|
+
}
|
|
249
|
+
/** Resolve the readable fill against black/white backdrop extremes using the
|
|
250
|
+
* final product palette, including brandPalette overrides. Blur is decorative:
|
|
251
|
+
* it cannot be used as evidence of text contrast over arbitrary app content. */
|
|
252
|
+
export function resolveDesignProfileSurfaceMaterial(profile, palette) {
|
|
253
|
+
const material = profile?.material.surface;
|
|
254
|
+
if (!material)
|
|
255
|
+
return null;
|
|
256
|
+
// Transparency requires a real backdrop effect. Plain/clay surfaces stay solid
|
|
257
|
+
// on both hosts instead of becoming tint-only imitations of a glass material.
|
|
258
|
+
if (!material.blurStrength)
|
|
259
|
+
return { ...material, fillOpacity: 1 };
|
|
260
|
+
return { ...material, fillOpacity: resolveSurfaceFillOpacity(material.fillOpacity, palette) };
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=design-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-profile.js","sourceRoot":"","sources":["../src/design-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwC,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACrH,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAgC,MAAM,qBAAqB,CAAC;AA8DzF,MAAM,OAAO,GAAqB;IAChC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM;IAC9B,MAAM,EAAE,EAAE,MA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,CAAC;IACzC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC;IAC/C,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC;CACxC,CAAC,CAAC;AAEH,MAAM,UAAU,sBAAsB,CAAC,QAA+B,EAAE;IACtE,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,IAAI,SAAS,CAAC,CAAC;IAC1D,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,SAAS,CAAC,2BAA2B,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED;;gFAEgF;AAChF,MAAM,UAAU,mCAAmC,CAAC,OAAqC,EAAE,OAA8B;IACvH,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3C,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,+EAA+E;IAC/E,8EAA8E;IAC9E,IAAI,CAAC,QAAQ,CAAC,YAAY;QAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;IACnE,OAAO,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,yBAAyB,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;AAChG,CAAC","sourcesContent":["import { THEMES, type ResolvedTheme, type ThemeColors } from \"./colors.js\";\nimport { radius, fontFamily, typography, heading, shadow, fontWeight, type FontWeightValue } from \"./foundations.js\";\nimport { checkPaletteContrast, resolveSurfaceFillOpacity } from \"./palette-contrast.js\";\nimport { resolveEffectSurface, type EffectSurfaceDescriptor } from \"./effect-surface.js\";\nimport type { ContentTransitionPreset } from \"./content-transition.js\";\n\n/** A product chooses one portable profile; the renderer owns each host translation.\n * Keep business state/callbacks outside it so a visual change cannot replace a draft.\n * See docs/design-profile.md for the staged renderer integration and coverage limits. */\nexport type HjmDesignPreset = \"neutral\" | \"retro\" | \"paper\" | \"forest\" | \"minimal\" | \"editorial\" | \"brutalist\" | \"glass\" | \"aurora\" | \"terminal\" | \"clay\";\ntype RadiusTokens = Readonly<Record<keyof typeof radius, number>>;\ntype TypeToken = Readonly<{ fontSize: number; lineHeight: number; fontWeight: FontWeightValue }>;\ntype TypographyTokens = Readonly<Record<keyof typeof typography, TypeToken>>;\ntype HeadingTokens = Readonly<Record<keyof typeof heading, TypeToken>>;\ntype ShadowToken = Readonly<{ color: string; opacity: number; radius: number; offsetY: number }>;\ntype ShadowTokens = Readonly<Record<keyof typeof shadow, ShadowToken>>;\ntype SurfaceMaterial = Readonly<{\n /** Host-relative strength; Web maps 1 to 32px, Native host calibrates its own blur. */\n blurStrength: number;\n /** Requested semantic fill; the renderer raises opacity when background contrast requires it. */\n fillOpacity: number;\n insetShadows: readonly Readonly<ShadowToken & { offsetX: number }>[];\n}>;\ntype Palette = Readonly<Record<ResolvedTheme, Readonly<ThemeColors>>>;\nexport type HjmDesignProfile = Readonly<{\n id: string;\n palette: Palette;\n tokens: Readonly<{\n radius: RadiusTokens;\n fontFamily: Readonly<{ ui: readonly string[]; code: readonly string[] }>;\n typography: TypographyTokens;\n heading: HeadingTokens;\n shadow: ShadowTokens;\n }>;\n material: Readonly<Record<\"canvas\" | \"card\", EffectSurfaceDescriptor | null> & { surface?: SurfaceMaterial | null }>;\n interactions: Readonly<{\n contentTransition: ContentTransitionPreset;\n selectionMotion: \"none\" | \"slide\";\n }>;\n compositions: Readonly<{\n collection: \"rows\" | \"cards\" | \"grid\";\n toolbar: \"inline\" | \"collapsible\";\n }>;\n screens: Readonly<{ overview: \"dashboard\" | \"editorial\" | \"landscape\" }>;\n}>;\n\n/** A custom app profile is data, not a mutable global registry or renderer import.\n * Partial records inherit the selected preset independently in light and dark. */\nexport type HjmDesignProfileInput = Readonly<{\n extends?: HjmDesignPreset;\n id?: string;\n palette?: Readonly<Partial<Record<ResolvedTheme, Readonly<Partial<ThemeColors>>>>>;\n tokens?: Readonly<{\n radius?: Readonly<Partial<RadiusTokens>>;\n fontFamily?: Readonly<Partial<HjmDesignProfile[\"tokens\"][\"fontFamily\"]>>;\n typography?: Readonly<Partial<Record<keyof typeof typography, Partial<TypeToken>>>>;\n heading?: Readonly<Partial<Record<keyof typeof heading, Partial<TypeToken>>>>;\n shadow?: Readonly<Partial<Record<keyof typeof shadow, Partial<ShadowToken>>>>;\n }>;\n material?: Readonly<Partial<Pick<HjmDesignProfile[\"material\"], \"canvas\" | \"card\">> & { surface?: Partial<SurfaceMaterial> | null }>;\n interactions?: Readonly<Partial<HjmDesignProfile[\"interactions\"]>>;\n compositions?: Readonly<Partial<HjmDesignProfile[\"compositions\"]>>;\n screens?: Readonly<Partial<HjmDesignProfile[\"screens\"]>>;\n}>;\n\nconst neutral: HjmDesignProfile = {\n id: \"neutral\", palette: THEMES,\n tokens: { radius, fontFamily, typography, heading, shadow },\n material: { canvas: null, card: null, surface: null },\n interactions: { contentTransition: \"fade\", selectionMotion: \"none\" },\n compositions: { collection: \"rows\", toolbar: \"inline\" },\n screens: { overview: \"dashboard\" },\n};\n\n/** Profiles deliberately differ in interaction and arrangement, not just hue.\n * No font asset is bundled or implied: custom font loading remains product-owned. */\nconst presetInputs: Readonly<Record<Exclude<HjmDesignPreset, \"neutral\">, HjmDesignProfileInput>> = {\n retro: {\n id: \"retro\",\n palette: {\n light: { bg: \"#fff8e8\", surface: \"#fffdf5\", surfaceAlt: \"#eee0c5\", surfaceAccent: \"#f6d4a0\", border: \"#d1bd96\", borderControl: \"#75604b\", primary: \"#973c20\", contentBrand: \"#80321a\", text: \"#2c2119\", textBody: \"#413123\", textMuted: \"#594637\", textSub: \"#695646\", textWeak: \"#857461\" },\n dark: { bg: \"#211a16\", surface: \"#2d241d\", surfaceAlt: \"#3b3025\", surfaceAccent: \"#5e3827\", border: \"#807260\", borderControl: \"#b7a387\", primary: \"#af5437\", contentBrand: \"#ffc38b\", text: \"#fff5e1\", textBody: \"#ead8bb\", textMuted: \"#d5c1a3\", textSub: \"#bea88b\", textWeak: \"#a18e74\" },\n },\n tokens: { radius: { sm: 2, md: 4, lg: 6, xl: 8 } },\n material: { canvas: { layers: [\"noise\"], intensity: 0.08, active: false, seed: \"retro\" } },\n interactions: { contentTransition: \"slide\", selectionMotion: \"none\" },\n compositions: { collection: \"grid\", toolbar: \"inline\" },\n screens: { overview: \"dashboard\" },\n },\n paper: {\n id: \"paper\",\n palette: {\n light: { bg: \"#f9f5ed\", surface: \"#fffdf8\", surfaceAlt: \"#eee8dc\", surfaceAccent: \"#e7dac8\", border: \"#d6cabb\", borderControl: \"#776b5c\", primary: \"#665039\", contentBrand: \"#58432e\", text: \"#28231c\", textBody: \"#40382d\", textMuted: \"#5b5145\", textSub: \"#6e6253\", textWeak: \"#887b69\" },\n dark: { bg: \"#1b1916\", surface: \"#27231e\", surfaceAlt: \"#332d25\", surfaceAccent: \"#4f4132\", border: \"#847561\", borderControl: \"#b8a68c\", primary: \"#83684c\", contentBrand: \"#e3bf91\", text: \"#f8f0e1\", textBody: \"#e5d9c4\", textMuted: \"#d0c0a6\", textSub: \"#b8a78d\", textWeak: \"#a18e72\" },\n },\n tokens: { radius: { sm: 4, md: 6, lg: 8, xl: 12 } },\n material: { canvas: { layers: [\"grain\"], intensity: 0.06, active: false, seed: \"paper\" } },\n interactions: { contentTransition: \"fade\", selectionMotion: \"none\" },\n compositions: { collection: \"rows\", toolbar: \"collapsible\" },\n screens: { overview: \"editorial\" },\n },\n forest: {\n id: \"forest\",\n palette: {\n light: { bg: \"#f2f7ef\", surface: \"#fbfdf8\", surfaceAlt: \"#e0ebda\", surfaceAccent: \"#d5e8c9\", border: \"#bdcdb5\", borderControl: \"#65765c\", primary: \"#285c35\", contentBrand: \"#23512d\", text: \"#1d2b1b\", textBody: \"#30422c\", textMuted: \"#485c41\", textSub: \"#5c6e54\", textWeak: \"#7b8b71\" },\n dark: { bg: \"#111c15\", surface: \"#1b2a1e\", surfaceAlt: \"#293a2a\", surfaceAccent: \"#304d32\", border: \"#6b816a\", borderControl: \"#95ac8d\", primary: \"#477c54\", contentBrand: \"#a8d994\", text: \"#eff7e9\", textBody: \"#d8e9cf\", textMuted: \"#bdd4b3\", textSub: \"#a1bd94\", textWeak: \"#87a17b\" },\n },\n tokens: { radius: { sm: 10, md: 16, lg: 24, xl: 32 } },\n material: { canvas: { layers: [\"mesh\", \"glow\"], intensity: 0.1, active: false, seed: \"forest\" } },\n interactions: { contentTransition: \"rise\", selectionMotion: \"slide\" },\n compositions: { collection: \"cards\", toolbar: \"collapsible\" },\n screens: { overview: \"landscape\" },\n },\n minimal: {\n id: \"minimal\",\n palette: { light: { primary: \"#404040\", contentBrand: \"#333333\", surfaceAccent: \"#eeeeee\" }, dark: { primary: \"#727272\", contentBrand: \"#dddddd\", surfaceAccent: \"#303030\" } },\n tokens: { radius: { sm: 4, md: 8, lg: 12, xl: 16 }, shadow: { raised: { opacity: 0 }, floating: { opacity: 0.08 } } },\n\n interactions: { contentTransition: \"fade\", selectionMotion: \"none\" },\n compositions: { collection: \"rows\", toolbar: \"inline\" }, screens: { overview: \"dashboard\" },\n },\n editorial: {\n id: \"editorial\",\n palette: { light: { primary: \"#59435f\", contentBrand: \"#513a57\", surfaceAccent: \"#eee4f0\" }, dark: { primary: \"#846b8e\", contentBrand: \"#ead0f2\", surfaceAccent: \"#392a3e\" } },\n tokens: { radius: { sm: 0, md: 2, lg: 4, xl: 8 }, typography: { heading: { fontSize: 28, lineHeight: 38, fontWeight: fontWeight.medium }, body: { lineHeight: 24 } }, heading: { level1: { fontSize: 44, lineHeight: 54, fontWeight: fontWeight.medium }, level2: { fontSize: 34, lineHeight: 44, fontWeight: fontWeight.medium } } },\n\n interactions: { contentTransition: \"rise\", selectionMotion: \"none\" },\n compositions: { collection: \"rows\", toolbar: \"collapsible\" }, screens: { overview: \"editorial\" },\n },\n brutalist: {\n id: \"brutalist\",\n palette: { light: { primary: \"#171717\", contentBrand: \"#171717\", surfaceAccent: \"#e8ed91\", border: \"#171717\" }, dark: { primary: \"#727272\", contentBrand: \"#f0f3a3\", surfaceAccent: \"#393a1c\", border: \"#cccccc\" } },\n tokens: { radius: { sm: 0, md: 0, lg: 0, xl: 0 }, shadow: { raised: { radius: 0, offsetY: 4, opacity: 0.25 }, floating: { radius: 0, offsetY: 6, opacity: 0.3 } }, typography: { heading: { fontSize: 30, lineHeight: 38, fontWeight: fontWeight.heavy } }, heading: { level1: { fontSize: 48, lineHeight: 56 }, level2: { fontSize: 38, lineHeight: 46 } } },\n\n interactions: { contentTransition: \"slide\", selectionMotion: \"none\" },\n compositions: { collection: \"cards\", toolbar: \"inline\" }, screens: { overview: \"editorial\" },\n },\n glass: {\n id: \"glass\",\n palette: { // Stronger ink tiers keep glass visibly translucent under the existing\n // contrast rules; the neutral weak/subtle tiers required an opaque fill.\n light: { primary: \"#435e91\", contentBrand: \"#354c78\", surfaceAccent: \"#e4ecf7\", textSub: \"#5b6879\", textWeak: \"#748292\" }, dark: { primary: \"#5673a3\", contentBrand: \"#c1d8ff\", surfaceAccent: \"#233654\" } },\n tokens: { radius: { sm: 12, md: 18, lg: 26, xl: 36 }, shadow: { floating: { radius: 24, opacity: 0.12, offsetY: 8 } } },\n material: { canvas: { layers: [\"mesh\"], intensity: 0.16, active: false, seed: \"glass\" }, card: { layers: [\"glow\"], intensity: 0.06, active: false, seed: \"glass-card\" }, surface: { blurStrength: 0.75, fillOpacity: 0.88, insetShadows: [] } },\n interactions: { contentTransition: \"fade\", selectionMotion: \"slide\" },\n compositions: { collection: \"cards\", toolbar: \"inline\" }, screens: { overview: \"landscape\" },\n },\n aurora: {\n id: \"aurora\",\n palette: { light: { primary: \"#62409b\", contentBrand: \"#58388b\", surfaceAccent: \"#ece2fa\" }, dark: { primary: \"#8161b1\", contentBrand: \"#dbc3ff\", surfaceAccent: \"#392651\" } },\n tokens: { radius: { sm: 8, md: 14, lg: 22, xl: 30 } },\n material: { canvas: { layers: [\"mesh\", \"glow\"], intensity: 0.2, active: true, period: 30, seed: \"aurora\" } },\n interactions: { contentTransition: \"scale\", selectionMotion: \"slide\" },\n compositions: { collection: \"grid\", toolbar: \"collapsible\" }, screens: { overview: \"landscape\" },\n },\n terminal: {\n id: \"terminal\",\n palette: { light: { primary: \"#235837\", contentBrand: \"#245435\", surfaceAccent: \"#deefdf\" }, dark: { primary: \"#467f54\", contentBrand: \"#95e2a6\", surfaceAccent: \"#203b28\" } },\n tokens: { radius: { sm: 2, md: 4, lg: 6, xl: 8 }, fontFamily: { ui: fontFamily.code }, shadow: { raised: { opacity: 0 }, floating: { radius: 0, offsetY: 0, opacity: 0 } } },\n\n interactions: { contentTransition: \"fade\", selectionMotion: \"none\" },\n compositions: { collection: \"rows\", toolbar: \"collapsible\" }, screens: { overview: \"dashboard\" },\n },\n clay: {\n id: \"clay\",\n palette: { light: { primary: \"#904663\", contentBrand: \"#803b57\", surfaceAccent: \"#f7e1eb\" }, dark: { primary: \"#a25e7d\", contentBrand: \"#f1bed4\", surfaceAccent: \"#482b3a\" } },\n tokens: { radius: { sm: 14, md: 22, lg: 32, xl: 44 }, shadow: { raised: { radius: 16, offsetY: 6, opacity: 0.12 }, floating: { radius: 28, offsetY: 12, opacity: 0.18 } } },\n material: { card: { layers: [\"grain\"], intensity: 0.04, active: false, seed: \"clay\" }, surface: { blurStrength: 0, fillOpacity: 1, insetShadows: [\n { color: \"#ffffff\", opacity: 0.22, radius: 10, offsetX: 3, offsetY: 4 },\n { color: \"#000000\", opacity: 0.12, radius: 12, offsetX: -3, offsetY: -4 },\n ] } },\n interactions: { contentTransition: \"scale\", selectionMotion: \"slide\" },\n compositions: { collection: \"cards\", toolbar: \"collapsible\" }, screens: { overview: \"dashboard\" },\n },\n};\n\nfunction freeze<T>(value: T): T {\n if (value !== null && typeof value === \"object\") {\n for (const item of Object.values(value)) freeze(item);\n Object.freeze(value);\n }\n return value;\n}\n\nfunction choose<T extends string>(value: T, allowed: readonly T[], field: string): void {\n if (!allowed.includes(value)) throw new TypeError(`Unsupported design profile ${field}`);\n}\n\nfunction merge(base: HjmDesignProfile, input: HjmDesignProfileInput): HjmDesignProfile {\n for (const role of Object.keys(input.material ?? {})) {\n if (![\"canvas\", \"card\", \"surface\"].includes(role)) throw new TypeError(\"Unsupported design profile material role\");\n }\n const requestedSurface = input.material?.surface;\n if (requestedSurface !== undefined && requestedSurface !== null && (typeof requestedSurface !== \"object\" || Array.isArray(requestedSurface))) throw new TypeError(\"Invalid design profile surface material\");\n for (const key of Object.keys(requestedSurface ?? {})) {\n if (![\"blurStrength\", \"fillOpacity\", \"insetShadows\"].includes(key)) throw new TypeError(\"Unsupported design profile surface material field\");\n }\n const palette = {\n light: { ...base.palette.light, ...input.palette?.light },\n dark: { ...base.palette.dark, ...input.palette?.dark },\n };\n // fromEntries loses fixed keys; iteration over the complete base preserves every role.\n const type = Object.fromEntries(Object.entries(base.tokens.typography).map(([key, value]) => [key, { ...value, ...input.tokens?.typography?.[key as keyof TypographyTokens] }])) as unknown as TypographyTokens;\n // Display levels need their own roles: deriving them from body text would erase\n // the hierarchy. Keep the original level3–5 typography aliases, with explicit\n // heading overrides last, and preserve inherited heading values on empty input.\n const aliases = { level3: \"heading\", level4: \"titleLarge\", level5: \"title\" } as const;\n for (const key of Object.keys(input.tokens?.heading ?? {})) {\n if (!Object.prototype.hasOwnProperty.call(heading, key)) throw new TypeError(\"Unsupported design profile heading level\");\n }\n const headings = Object.fromEntries(Object.entries(base.tokens.heading).map(([key, value]) => {\n const level = key as keyof HeadingTokens;\n const alias = level in aliases ? aliases[level as keyof typeof aliases] : undefined;\n return [level, { ...value, ...(alias ? input.tokens?.typography?.[alias] : undefined), ...input.tokens?.heading?.[level] }];\n })) as unknown as HeadingTokens;\n // The complete base shadow record has the same key-preservation guarantee.\n const elevation = Object.fromEntries(Object.entries(base.tokens.shadow).map(([key, value]) => [key, { ...value, ...input.tokens?.shadow?.[key as keyof ShadowTokens] }])) as unknown as ShadowTokens;\n const profile: HjmDesignProfile = {\n id: input.id ?? base.id, palette,\n tokens: {\n radius: { ...base.tokens.radius, ...input.tokens?.radius },\n // Copy caller-owned arrays: freezing the resolved profile must never freeze app input.\n fontFamily: { ui: [...(input.tokens?.fontFamily?.ui ?? base.tokens.fontFamily.ui)], code: [...(input.tokens?.fontFamily?.code ?? base.tokens.fontFamily.code)] },\n typography: type, heading: headings, shadow: elevation,\n },\n material: { ...base.material, ...input.material, surface: input.material?.surface === null ? null\n : input.material?.surface === undefined ? base.material.surface ?? null\n : { blurStrength: 0, fillOpacity: 1, insetShadows: [], ...base.material.surface, ...input.material.surface } },\n interactions: { ...base.interactions, ...input.interactions },\n compositions: { ...base.compositions, ...input.compositions },\n screens: { ...base.screens, ...input.screens },\n };\n if (!profile.id.trim()) throw new TypeError(\"Design profile id must not be empty\");\n for (const mode of [\"light\", \"dark\"] as const) {\n for (const [key, value] of Object.entries(palette[mode])) {\n if (!(key in THEMES[mode]) || !/^#[0-9a-f]{6}$/i.test(value)) throw new TypeError(`Invalid design profile palette ${mode}.${key}`);\n }\n if (checkPaletteContrast(palette[mode]).length) throw new RangeError(`Design profile ${mode} palette fails required contrast pairs`);\n }\n for (const [key, value] of Object.entries(profile.tokens.radius)) {\n if (!(key in radius) || !Number.isFinite(value) || value < 0 || value > 999) throw new RangeError(\"Invalid design profile radius\");\n }\n // Circles/pills retain their semantic geometry; product corners apply to other roles.\n if (profile.tokens.radius.full !== radius.full) throw new RangeError(\"Design profile must preserve full radius\");\n for (const value of [...Object.values(type), ...Object.values(headings)]) {\n if (!Number.isFinite(value.fontSize) || value.fontSize < 11 || value.fontSize > 96 || !Number.isFinite(value.lineHeight) || value.lineHeight < value.fontSize || value.lineHeight > 144) throw new RangeError(\"Invalid design profile typography\");\n choose(value.fontWeight, [\"400\", \"500\", \"600\", \"700\", \"800\"], \"fontWeight\");\n }\n for (const families of Object.values(profile.tokens.fontFamily)) {\n if (!families.length || families.some(family => !family.trim())) throw new TypeError(\"Design profile font families must not be empty\");\n }\n for (const token of Object.values(elevation)) {\n if (!/^#[0-9a-f]{6}$/i.test(token.color) || !Number.isFinite(token.opacity) || token.opacity < 0 || token.opacity > 1 || !Number.isFinite(token.radius) || token.radius < 0 || token.radius > 96 || !Number.isFinite(token.offsetY) || Math.abs(token.offsetY) > 96) throw new RangeError(\"Invalid design profile shadow\");\n }\n const surface = profile.material.surface;\n if (surface) {\n // Keep a readable semantic fill rather than copying a low-alpha reference card.\n // Native can fail to supply blur and must always retain its opaque fallback.\n if (!Number.isFinite(surface.blurStrength) || surface.blurStrength < 0 || surface.blurStrength > 1 || !Number.isFinite(surface.fillOpacity) || surface.fillOpacity < 0.85 || surface.fillOpacity > 1) throw new RangeError(\"Invalid design profile surface material\");\n if (!Array.isArray(surface.insetShadows) || surface.insetShadows.length > 2) throw new RangeError(\"Invalid design profile inset shadows\");\n for (const token of surface.insetShadows) {\n if (!/^#[0-9a-f]{6}$/i.test(token.color) || !Number.isFinite(token.opacity) || token.opacity < 0 || token.opacity > 1 || !Number.isFinite(token.radius) || token.radius < 0 || token.radius > 96 || !Number.isFinite(token.offsetY) || Math.abs(token.offsetY) > 96 || !Number.isFinite(token.offsetX) || Math.abs(token.offsetX) > 96) throw new RangeError(\"Invalid design profile inset shadow\");\n }\n }\n const effects = Object.fromEntries(([\"canvas\", \"card\"] as const).map(role => {\n const descriptor = profile.material[role];\n if (descriptor === null) return [role, null];\n resolveEffectSurface(descriptor);\n // Deep-copy material data as well: a preset resolver must not own caller state.\n return [role, { ...descriptor, ...(descriptor.layers ? { layers: [...descriptor.layers] } : {}), ...(descriptor.colors ? { colors: descriptor.colors.map(color => ({ ...color })) } : {}) }];\n })) as Pick<HjmDesignProfile[\"material\"], \"canvas\" | \"card\">;\n const material = { ...effects, surface: surface ? { ...surface, insetShadows: surface.insetShadows.map(token => ({ ...token })) } : null };\n choose(profile.interactions.contentTransition, [\"fade\", \"rise\", \"slide\", \"scale\"], \"contentTransition\");\n choose(profile.interactions.selectionMotion, [\"none\", \"slide\"], \"selectionMotion\");\n choose(profile.compositions.collection, [\"rows\", \"cards\", \"grid\"], \"collection\");\n choose(profile.compositions.toolbar, [\"inline\", \"collapsible\"], \"toolbar\");\n choose(profile.screens.overview, [\"dashboard\", \"editorial\", \"landscape\"], \"overview\");\n return freeze({ ...profile, material });\n}\n\nexport const hjmDesignPresets: Readonly<Record<HjmDesignPreset, HjmDesignProfile>> = freeze({\n neutral: merge(neutral, {}),\n retro: merge(neutral, presetInputs.retro),\n paper: merge(neutral, presetInputs.paper),\n forest: merge(neutral, presetInputs.forest),\n minimal: merge(neutral, presetInputs.minimal),\n editorial: merge(neutral, presetInputs.editorial),\n brutalist: merge(neutral, presetInputs.brutalist),\n glass: merge(neutral, presetInputs.glass),\n aurora: merge(neutral, presetInputs.aurora),\n terminal: merge(neutral, presetInputs.terminal),\n clay: merge(neutral, presetInputs.clay),\n});\n\nexport function defineHjmDesignProfile(input: HjmDesignProfileInput = {}): HjmDesignProfile {\n const base = hjmDesignPresets[input.extends ?? \"neutral\"];\n if (!base) throw new TypeError(\"Unknown HJM design preset\");\n return merge(base, input);\n}\n\n/** Resolve the readable fill against black/white backdrop extremes using the\n * final product palette, including brandPalette overrides. Blur is decorative:\n * it cannot be used as evidence of text contrast over arbitrary app content. */\nexport function resolveDesignProfileSurfaceMaterial(profile: HjmDesignProfile | undefined, palette: Readonly<ThemeColors>): SurfaceMaterial | null {\n const material = profile?.material.surface;\n if (!material) return null;\n // Transparency requires a real backdrop effect. Plain/clay surfaces stay solid\n // on both hosts instead of becoming tint-only imitations of a glass material.\n if (!material.blurStrength) return { ...material, fillOpacity: 1 };\n return { ...material, fillOpacity: resolveSurfaceFillOpacity(material.fillOpacity, palette) };\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HjmDesignProfile } from "./design-profile.js";
|
|
1
2
|
import type { ColorReferencePalette } from "./color-references.js";
|
|
2
3
|
import { type ResolvedTheme, type ThemeColors, type ThemePreference } from "./colors.js";
|
|
3
4
|
/**
|
|
@@ -99,6 +100,9 @@ export type ResolveDesignSystemEnvironmentOptions = Readonly<{
|
|
|
99
100
|
* keys are replaced; the rest keep the HJM defaults.
|
|
100
101
|
*/
|
|
101
102
|
brandPalette?: Readonly<Partial<Record<ResolvedTheme, Readonly<Partial<ThemeColors>>>>>;
|
|
103
|
+
/** Use defineHjmDesignProfile once at the product boundary; importing its registry
|
|
104
|
+
* here at runtime would force every granular component to bundle all reference packs. */
|
|
105
|
+
designProfile?: HjmDesignProfile;
|
|
102
106
|
/** A nested renderer inherits the already-resolved parent before consulting OS defaults. */
|
|
103
107
|
parent?: ResolvedDesignSystemEnvironment;
|
|
104
108
|
}>;
|
|
@@ -106,6 +110,8 @@ export type DesignSystemProviderValue = Readonly<{
|
|
|
106
110
|
environment: ResolvedDesignSystemEnvironment;
|
|
107
111
|
/** Palette consumed directly by `resolveColorReference`. */
|
|
108
112
|
palette: ColorReferencePalette;
|
|
113
|
+
/** Optional to preserve existing pre-resolved provider values. */
|
|
114
|
+
designProfile?: HjmDesignProfile;
|
|
109
115
|
}>;
|
|
110
116
|
/**
|
|
111
117
|
* Runtime boundary for the resolved palette a renderer receives, including one
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-system-provider.d.ts","sourceRoot":"","sources":["../src/design-system-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,KAAK,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAA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AC5F,MAAM,CAAC,EAAE,+BAA+B,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC/C,WAAW,EAAE,+BAA+B,CAAC;IAC7C,4DAA4D;IAC5D,OAAO,EAAE,qBAAqB,CAAC;IAC/B,kEAAkE;IAClE,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAClC,CAAC,CAAC;AAyBH;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,yBAAyB,GAC/B,IAAI,CAuBN;AA4BD,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,4BAA4B,GAClC,IAAI,CAyBN;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,WAAW,EAAE,+BAA+B,GAC3C,IAAI,CAWN;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,4BAA4B,EACnC,OAAO,EAAE,qCAAqC,GAC7C,+BAA+B,CA8CjC;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,4BAA4B,EACnC,OAAO,EAAE,qCAAqC,GAC7C,yBAAyB,CAiB3B"}
|
|
@@ -186,12 +186,14 @@ export function resolveDesignSystemEnvironment(input, options) {
|
|
|
186
186
|
export function resolveDesignSystemProviderValue(input, options) {
|
|
187
187
|
const environment = resolveDesignSystemEnvironment(input, options);
|
|
188
188
|
const brandOverride = options.brandPalette?.[environment.theme];
|
|
189
|
+
const basePalette = options.designProfile?.palette[environment.theme] ?? THEMES[environment.theme];
|
|
189
190
|
const value = {
|
|
190
191
|
environment,
|
|
192
|
+
...(options.designProfile === undefined ? {} : { designProfile: options.designProfile }),
|
|
191
193
|
palette: {
|
|
192
194
|
theme: brandOverride === undefined
|
|
193
|
-
?
|
|
194
|
-
: { ...
|
|
195
|
+
? basePalette
|
|
196
|
+
: { ...basePalette, ...brandOverride },
|
|
195
197
|
statusAccents: ACCENTS[environment.theme],
|
|
196
198
|
statusAccentFills: accentFill,
|
|
197
199
|
},
|