feat: integrate latest HMDesign design system updates
This commit is contained in:
1 parent
99faec189e
commit
1c4e0bb9a1
209 files changed
+8845
-552
No files matched your search
@@ -42,8 +42,13 @@ export function isRuntimeTheme(theme: unknown): theme is import("./contract").Ru
|
||||
/** Atomic validation. Invalid documents release the previous override to host/default. */
|
||||
export function applyRuntimeTheme(root: HTMLElement, theme: unknown): boolean {
|
||||
if (!isRuntimeTheme(theme)) { resetRuntimeTheme(root); return false }
|
||||
const values = Object.entries(theme.tokens).map(([key, value]) =>
|
||||
const values: (readonly [string, string])[] = Object.entries(theme.tokens).map(([key, value]) =>
|
||||
[runtimeThemeContract[key as RuntimeThemeToken].property, value!] as const)
|
||||
// Reviewed Gray default comes from the existing palette. Retain custom cancel
|
||||
// overrides without changing the public token or the full Default preset.
|
||||
const cancel = theme.tokens["color.action.cancel"]
|
||||
if (cancel && cancel.toLowerCase() !== runtimeThemeContract["color.action.cancel"].defaultValue)
|
||||
values.push(["--hm-button-cancel-runtime-ink", cancel])
|
||||
resetRuntimeTheme(root)
|
||||
const scope = root.getAttribute("data-hm-theme")
|
||||
const properties = values.map(([property]) => ({
|
||||
|
||||
Reference in new issue
Block a user