@vellira-ui/tokens 2.98.6 → 2.99.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/css/tokens.css +171 -213
- package/dist/dark/components/contextMenu.d.ts +13 -3
- package/dist/dark/components/contextMenu.d.ts.map +1 -1
- package/dist/dark/components/contextMenu.js +0 -2
- package/dist/dark/components/dropdown.d.ts +20 -10
- package/dist/dark/components/dropdown.d.ts.map +1 -1
- package/dist/dark/components/dropdown.js +6 -5
- package/dist/dark/components/input.d.ts +1 -1
- package/dist/dark/components/input.js +4 -4
- package/dist/dark/components/modal.d.ts +16 -7
- package/dist/dark/components/modal.d.ts.map +1 -1
- package/dist/dark/components/modal.js +1 -3
- package/dist/dark/components/popover.d.ts +5 -25
- package/dist/dark/components/popover.d.ts.map +1 -1
- package/dist/dark/components/popover.js +0 -4
- package/dist/dark/components/radio.js +1 -1
- package/dist/dark/components/select.d.ts +9 -2
- package/dist/dark/components/select.d.ts.map +1 -1
- package/dist/dark/components/select.js +5 -5
- package/dist/dark/components/tooltip.d.ts.map +1 -1
- package/dist/dark/components/tooltip.js +0 -2
- package/dist/dark/semantic/action.d.ts +2 -2
- package/dist/dark/semantic/action.js +2 -2
- package/dist/dark/semantic/border.d.ts +1 -1
- package/dist/dark/semantic/border.js +1 -1
- package/dist/dark/semantic/control.js +1 -1
- package/dist/dark/semantic/focus.d.ts +1 -1
- package/dist/dark/semantic/focus.js +1 -1
- package/dist/dark/semantic/icons.d.ts +2 -2
- package/dist/dark/semantic/icons.js +2 -2
- package/dist/dark/semantic/index.d.ts +0 -1
- package/dist/dark/semantic/index.d.ts.map +1 -1
- package/dist/dark/semantic/index.js +0 -1
- package/dist/dark/semantic/overlay.d.ts +2 -2
- package/dist/dark/semantic/overlay.js +2 -2
- package/dist/dark/semantic/status.d.ts +6 -6
- package/dist/dark/semantic/status.js +6 -6
- package/dist/dark/semantic/surface.d.ts +1 -1
- package/dist/dark/semantic/surface.js +1 -1
- package/dist/dark/semantic/text.d.ts +2 -2
- package/dist/dark/semantic/text.js +2 -2
- package/dist/factories/componentFocusRing.d.ts +15 -0
- package/dist/factories/componentFocusRing.d.ts.map +1 -0
- package/dist/factories/componentFocusRing.js +7 -0
- package/dist/factories/createContextMenuTokens.d.ts +50 -18
- package/dist/factories/createContextMenuTokens.d.ts.map +1 -1
- package/dist/factories/createContextMenuTokens.js +6 -5
- package/dist/factories/createModalTokens.d.ts +41 -21
- package/dist/factories/createModalTokens.d.ts.map +1 -1
- package/dist/factories/createModalTokens.js +8 -9
- package/dist/factories/createPopoverTokens.d.ts +12 -20
- package/dist/factories/createPopoverTokens.d.ts.map +1 -1
- package/dist/factories/createPopoverTokens.js +5 -9
- package/dist/factories/createTooltipTokens.d.ts +4 -7
- package/dist/factories/createTooltipTokens.d.ts.map +1 -1
- package/dist/factories/createTooltipTokens.js +4 -4
- package/dist/generated/token-types.d.ts +7 -6
- package/dist/generated/token-types.d.ts.map +1 -1
- package/dist/generated/token-types.js +176 -248
- package/dist/highContrast/components/contextMenu.d.ts +13 -3
- package/dist/highContrast/components/contextMenu.d.ts.map +1 -1
- package/dist/highContrast/components/contextMenu.js +0 -2
- package/dist/highContrast/components/dropdown.d.ts +19 -9
- package/dist/highContrast/components/dropdown.d.ts.map +1 -1
- package/dist/highContrast/components/dropdown.js +6 -5
- package/dist/highContrast/components/input.d.ts +4 -4
- package/dist/highContrast/components/input.js +4 -4
- package/dist/highContrast/components/modal.d.ts +16 -7
- package/dist/highContrast/components/modal.d.ts.map +1 -1
- package/dist/highContrast/components/modal.js +0 -2
- package/dist/highContrast/components/popover.d.ts +5 -25
- package/dist/highContrast/components/popover.d.ts.map +1 -1
- package/dist/highContrast/components/popover.js +0 -4
- package/dist/highContrast/components/radio.js +1 -1
- package/dist/highContrast/components/select.d.ts +10 -3
- package/dist/highContrast/components/select.d.ts.map +1 -1
- package/dist/highContrast/components/select.js +5 -5
- package/dist/highContrast/components/tooltip.d.ts.map +1 -1
- package/dist/highContrast/components/tooltip.js +0 -2
- package/dist/highContrast/semantic/action.d.ts +2 -2
- package/dist/highContrast/semantic/action.js +2 -2
- package/dist/highContrast/semantic/border.d.ts +1 -1
- package/dist/highContrast/semantic/border.js +1 -1
- package/dist/highContrast/semantic/focus.d.ts +1 -1
- package/dist/highContrast/semantic/focus.js +1 -1
- package/dist/highContrast/semantic/icons.d.ts +4 -4
- package/dist/highContrast/semantic/icons.js +4 -4
- package/dist/highContrast/semantic/index.d.ts +0 -1
- package/dist/highContrast/semantic/index.d.ts.map +1 -1
- package/dist/highContrast/semantic/index.js +0 -1
- package/dist/highContrast/semantic/overlay.d.ts +2 -2
- package/dist/highContrast/semantic/overlay.js +2 -2
- package/dist/highContrast/semantic/status.d.ts +4 -4
- package/dist/highContrast/semantic/status.js +4 -4
- package/dist/highContrast/semantic/surface.d.ts +1 -1
- package/dist/highContrast/semantic/surface.js +1 -1
- package/dist/light/components/contextMenu.d.ts +13 -3
- package/dist/light/components/contextMenu.d.ts.map +1 -1
- package/dist/light/components/contextMenu.js +0 -2
- package/dist/light/components/dropdown.d.ts +19 -9
- package/dist/light/components/dropdown.d.ts.map +1 -1
- package/dist/light/components/dropdown.js +6 -5
- package/dist/light/components/input.js +4 -4
- package/dist/light/components/modal.d.ts +16 -7
- package/dist/light/components/modal.d.ts.map +1 -1
- package/dist/light/components/modal.js +0 -2
- package/dist/light/components/popover.d.ts +5 -25
- package/dist/light/components/popover.d.ts.map +1 -1
- package/dist/light/components/popover.js +0 -4
- package/dist/light/components/radio.js +1 -1
- package/dist/light/components/select.d.ts +9 -2
- package/dist/light/components/select.d.ts.map +1 -1
- package/dist/light/components/select.js +5 -5
- package/dist/light/components/tooltip.d.ts.map +1 -1
- package/dist/light/components/tooltip.js +0 -2
- package/dist/light/semantic/action.d.ts +2 -2
- package/dist/light/semantic/action.js +2 -2
- package/dist/light/semantic/border.d.ts +1 -1
- package/dist/light/semantic/border.js +1 -1
- package/dist/light/semantic/focus.d.ts +1 -1
- package/dist/light/semantic/focus.js +1 -1
- package/dist/light/semantic/icons.d.ts +2 -2
- package/dist/light/semantic/icons.js +2 -2
- package/dist/light/semantic/index.d.ts +0 -1
- package/dist/light/semantic/index.d.ts.map +1 -1
- package/dist/light/semantic/index.js +0 -1
- package/dist/light/semantic/menu.js +1 -1
- package/dist/light/semantic/overlay.d.ts +2 -2
- package/dist/light/semantic/overlay.js +2 -2
- package/dist/light/semantic/status.d.ts +4 -4
- package/dist/light/semantic/status.js +4 -4
- package/dist/light/semantic/surface.d.ts +1 -1
- package/dist/light/semantic/surface.js +1 -1
- package/dist/platform-output/component-token-intents.d.ts +71 -0
- package/dist/platform-output/component-token-intents.d.ts.map +1 -0
- package/dist/platform-output/component-token-intents.js +110 -0
- package/dist/platform-output/component-token-web-compatibility.d.ts +32 -0
- package/dist/platform-output/component-token-web-compatibility.d.ts.map +1 -0
- package/dist/platform-output/component-token-web-compatibility.js +40 -0
- package/dist/preservation/token-migrations.d.ts +208 -13
- package/dist/preservation/token-migrations.d.ts.map +1 -1
- package/dist/preservation/token-migrations.js +332 -30
- package/dist/token-architecture.d.ts +56 -10
- package/dist/token-architecture.d.ts.map +1 -1
- package/dist/token-architecture.js +129 -20
- package/package.json +1 -1
- package/dist/dark/semantic/navigation.d.ts +0 -34
- package/dist/dark/semantic/navigation.d.ts.map +0 -1
- package/dist/dark/semantic/navigation.js +0 -37
- package/dist/highContrast/semantic/navigation.d.ts +0 -34
- package/dist/highContrast/semantic/navigation.d.ts.map +0 -1
- package/dist/highContrast/semantic/navigation.js +0 -36
- package/dist/light/semantic/navigation.d.ts +0 -34
- package/dist/light/semantic/navigation.d.ts.map +0 -1
- package/dist/light/semantic/navigation.js +0 -37
|
@@ -5,11 +5,11 @@ export declare const overlay: {
|
|
|
5
5
|
readonly fg: "#3D3754";
|
|
6
6
|
readonly border: "#E4DDF4";
|
|
7
7
|
};
|
|
8
|
-
readonly
|
|
8
|
+
readonly floating: {
|
|
9
9
|
readonly bg: "#FFFFFF";
|
|
10
10
|
readonly border: "#E4DDF4";
|
|
11
11
|
};
|
|
12
|
-
readonly
|
|
12
|
+
readonly dialog: {
|
|
13
13
|
readonly bg: "#FFFFFF";
|
|
14
14
|
readonly border: "#E4DDF4";
|
|
15
15
|
};
|
|
@@ -9,11 +9,11 @@ export const overlay = {
|
|
|
9
9
|
fg: colors.vellira[700],
|
|
10
10
|
border: border.muted,
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
floating: {
|
|
13
13
|
bg: surface.elevated,
|
|
14
14
|
border: border.muted,
|
|
15
15
|
},
|
|
16
|
-
|
|
16
|
+
dialog: {
|
|
17
17
|
bg: surface.elevated,
|
|
18
18
|
border: border.muted,
|
|
19
19
|
},
|
|
@@ -4,28 +4,28 @@ export declare const status: {
|
|
|
4
4
|
readonly bg: "#F0FDFA";
|
|
5
5
|
readonly border: "#0F766E";
|
|
6
6
|
readonly ring: "#14B8A6";
|
|
7
|
-
readonly
|
|
7
|
+
readonly emphasisFg: "#115E59";
|
|
8
8
|
};
|
|
9
9
|
readonly error: {
|
|
10
10
|
readonly fg: "#BE123C";
|
|
11
11
|
readonly bg: "#FFE4E6";
|
|
12
12
|
readonly border: "#E11D48";
|
|
13
13
|
readonly ring: "#F43F5E";
|
|
14
|
-
readonly
|
|
14
|
+
readonly emphasisFg: "#9F1239";
|
|
15
15
|
};
|
|
16
16
|
readonly warning: {
|
|
17
17
|
readonly fg: "#B45309";
|
|
18
18
|
readonly bg: "#FFFBEB";
|
|
19
19
|
readonly border: "#B45309";
|
|
20
20
|
readonly ring: "#F59E0B";
|
|
21
|
-
readonly
|
|
21
|
+
readonly emphasisFg: "#92400E";
|
|
22
22
|
};
|
|
23
23
|
readonly info: {
|
|
24
24
|
readonly fg: "#0C4A6E";
|
|
25
25
|
readonly bg: "#F0F9FF";
|
|
26
26
|
readonly border: "#0369A1";
|
|
27
27
|
readonly ring: "#0369A1";
|
|
28
|
-
readonly
|
|
28
|
+
readonly emphasisFg: "#082F49";
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -5,27 +5,27 @@ export const status = {
|
|
|
5
5
|
bg: colors.success[50],
|
|
6
6
|
border: colors.success[700],
|
|
7
7
|
ring: colors.success[500],
|
|
8
|
-
|
|
8
|
+
emphasisFg: colors.success[800],
|
|
9
9
|
},
|
|
10
10
|
error: {
|
|
11
11
|
fg: colors.error[700],
|
|
12
12
|
bg: colors.error[100],
|
|
13
13
|
border: colors.error[600],
|
|
14
14
|
ring: colors.error[500],
|
|
15
|
-
|
|
15
|
+
emphasisFg: colors.error[800],
|
|
16
16
|
},
|
|
17
17
|
warning: {
|
|
18
18
|
fg: colors.warning[700],
|
|
19
19
|
bg: colors.warning[50],
|
|
20
20
|
border: colors.warning[700],
|
|
21
21
|
ring: colors.warning[500],
|
|
22
|
-
|
|
22
|
+
emphasisFg: colors.warning[800],
|
|
23
23
|
},
|
|
24
24
|
info: {
|
|
25
25
|
fg: colors.info[700],
|
|
26
26
|
bg: colors.info[50],
|
|
27
27
|
border: colors.info[500],
|
|
28
28
|
ring: colors.info[500],
|
|
29
|
-
|
|
29
|
+
emphasisFg: colors.info[800],
|
|
30
30
|
},
|
|
31
31
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const surface: {
|
|
2
2
|
readonly canvas: "#FAF8FF";
|
|
3
3
|
readonly default: "#FAF8FF";
|
|
4
|
+
readonly panel: "#FFFFFF";
|
|
4
5
|
readonly muted: "#F4F1FB";
|
|
5
6
|
readonly subtle: "#FDFCFF";
|
|
6
7
|
readonly elevated: "#FFFFFF";
|
|
7
|
-
readonly background: "#FFFFFF";
|
|
8
8
|
readonly hover: "#F4F1FB";
|
|
9
9
|
readonly active: "#EEE8FA";
|
|
10
10
|
readonly pressed: "#E4DDF4";
|
|
@@ -3,10 +3,10 @@ import { withAlpha } from '../../utils/color.js';
|
|
|
3
3
|
export const surface = {
|
|
4
4
|
canvas: colors.vellira[50],
|
|
5
5
|
default: colors.vellira[50],
|
|
6
|
+
panel: colors.mono[50],
|
|
6
7
|
muted: colors.vellira[100],
|
|
7
8
|
subtle: colors.vellira[25],
|
|
8
9
|
elevated: colors.mono[50],
|
|
9
|
-
background: colors.mono[50],
|
|
10
10
|
hover: colors.vellira[100],
|
|
11
11
|
active: colors.vellira[150],
|
|
12
12
|
pressed: colors.vellira[200],
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export declare const componentShadowLevels: readonly ["sm", "md", "lg", "xl"];
|
|
2
|
+
export type ComponentShadowLevel = (typeof componentShadowLevels)[number];
|
|
3
|
+
export type ComponentElevationShadowIntent = Readonly<{
|
|
4
|
+
kind: 'shadow';
|
|
5
|
+
role: 'elevation';
|
|
6
|
+
level: ComponentShadowLevel;
|
|
7
|
+
}>;
|
|
8
|
+
export type ComponentFocusRingShadowIntent = Readonly<{
|
|
9
|
+
kind: 'shadow';
|
|
10
|
+
role: 'focus-ring';
|
|
11
|
+
}>;
|
|
12
|
+
export type ComponentNoShadowIntent = Readonly<{
|
|
13
|
+
kind: 'shadow';
|
|
14
|
+
role: 'none';
|
|
15
|
+
}>;
|
|
16
|
+
export type ComponentShadowIntent = ComponentElevationShadowIntent | ComponentFocusRingShadowIntent | ComponentNoShadowIntent;
|
|
17
|
+
export type ComponentViewportHeightIntent = Readonly<{
|
|
18
|
+
kind: 'viewport-height';
|
|
19
|
+
ratio: number;
|
|
20
|
+
}>;
|
|
21
|
+
export type ComponentPlatformIntent = ComponentShadowIntent | ComponentViewportHeightIntent;
|
|
22
|
+
export type ReactNativeShadowOutput = Readonly<{
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
blur: number;
|
|
26
|
+
color: string;
|
|
27
|
+
opacity: number;
|
|
28
|
+
elevation: number;
|
|
29
|
+
}>;
|
|
30
|
+
export type ComponentPlatformOutputSources = Readonly<{
|
|
31
|
+
web: {
|
|
32
|
+
shadow: Readonly<Record<ComponentShadowLevel, string>>;
|
|
33
|
+
focusRingShadow: string;
|
|
34
|
+
};
|
|
35
|
+
reactNative: {
|
|
36
|
+
shadow: Readonly<Record<ComponentShadowLevel, ReactNativeShadowOutput>>;
|
|
37
|
+
};
|
|
38
|
+
}>;
|
|
39
|
+
type ComponentOutputThemeSources = Readonly<{
|
|
40
|
+
semantic: {
|
|
41
|
+
focus: {
|
|
42
|
+
ring: {
|
|
43
|
+
shadow: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
shadow: Readonly<Record<ComponentShadowLevel, string>>;
|
|
47
|
+
};
|
|
48
|
+
tokens: {
|
|
49
|
+
shadows: Readonly<Record<'sm' | 'md' | 'lg', ReactNativeShadowOutput>>;
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
52
|
+
type WebAdaptedIntent<T> = T extends ComponentPlatformIntent ? string : never;
|
|
53
|
+
type ReactNativeAdaptedIntent<T> = T extends ComponentElevationShadowIntent ? ReactNativeShadowOutput : T extends ComponentFocusRingShadowIntent | ComponentNoShadowIntent ? null : T extends ComponentViewportHeightIntent ? string : never;
|
|
54
|
+
export type WebComponentTokens<T> = T extends ComponentPlatformIntent ? WebAdaptedIntent<T> : T extends readonly (infer TEntry)[] ? readonly WebComponentTokens<TEntry>[] : T extends object ? {
|
|
55
|
+
readonly [K in keyof T]: WebComponentTokens<T[K]>;
|
|
56
|
+
} : T;
|
|
57
|
+
export type ReactNativeComponentTokens<T> = T extends ComponentPlatformIntent ? ReactNativeAdaptedIntent<T> : T extends readonly (infer TEntry)[] ? readonly ReactNativeComponentTokens<TEntry>[] : T extends object ? {
|
|
58
|
+
readonly [K in keyof T]: ReactNativeComponentTokens<T[K]>;
|
|
59
|
+
} : T;
|
|
60
|
+
export declare function createComponentShadowIntent(level: ComponentShadowLevel): ComponentElevationShadowIntent;
|
|
61
|
+
export declare function createComponentFocusRingShadowIntent(): ComponentFocusRingShadowIntent;
|
|
62
|
+
export declare function createComponentNoShadowIntent(): ComponentNoShadowIntent;
|
|
63
|
+
export declare function createComponentViewportHeightIntent(ratio: number): ComponentViewportHeightIntent;
|
|
64
|
+
export declare function isComponentPlatformIntent(value: unknown): value is ComponentPlatformIntent;
|
|
65
|
+
export declare function createComponentPlatformOutputSources(theme: ComponentOutputThemeSources): ComponentPlatformOutputSources;
|
|
66
|
+
export declare function resolveComponentIntentForWeb(intent: ComponentPlatformIntent, sources: ComponentPlatformOutputSources): string;
|
|
67
|
+
export declare function resolveComponentIntentForReactNative(intent: ComponentPlatformIntent, sources: ComponentPlatformOutputSources): string | ReactNativeShadowOutput | null;
|
|
68
|
+
export declare function adaptComponentTokensForWeb<T>(components: T, sources: ComponentPlatformOutputSources): WebComponentTokens<T>;
|
|
69
|
+
export declare function adaptComponentTokensForReactNative<T>(components: T, sources: ComponentPlatformOutputSources): ReactNativeComponentTokens<T>;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=component-token-intents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-token-intents.d.ts","sourceRoot":"","sources":["../../src/platform-output/component-token-intents.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,mCAAoC,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,8BAA8B,GAAG,QAAQ,CAAC;IACpD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,oBAAoB,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,QAAQ,CAAC;IACpD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MA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,CA4BlC;AAED,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,2BAA2B,GACjC,8BAA8B,CAsBhC;AASD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,8BAA8B,GACtC,MAAM,CAQR;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,8BAA8B,GACtC,MAAM,GAAG,uBAAuB,GAAG,IAAI,CAOzC;AA0BD,wBAAgB,0BAA0B,CAAC,CAAC,EAC1C,UAAU,EAAE,CAAC,EACb,OAAO,EAAE,8BAA8B,GACtC,kBAAkB,CAAC,CAAC,CAAC,CAIvB;AAED,wBAAgB,kCAAkC,CAAC,CAAC,EAClD,UAAU,EAAE,CAAC,EACb,OAAO,EAAE,8BAA8B,GACtC,0BAA0B,CAAC,CAAC,CAAC,CAI/B"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export const componentShadowLevels = ['sm', 'md', 'lg', 'xl'];
|
|
2
|
+
export function createComponentShadowIntent(level) {
|
|
3
|
+
return { kind: 'shadow', role: 'elevation', level };
|
|
4
|
+
}
|
|
5
|
+
export function createComponentFocusRingShadowIntent() {
|
|
6
|
+
return { kind: 'shadow', role: 'focus-ring' };
|
|
7
|
+
}
|
|
8
|
+
export function createComponentNoShadowIntent() {
|
|
9
|
+
return { kind: 'shadow', role: 'none' };
|
|
10
|
+
}
|
|
11
|
+
export function createComponentViewportHeightIntent(ratio) {
|
|
12
|
+
if (!Number.isFinite(ratio) || ratio <= 0 || ratio > 1) {
|
|
13
|
+
throw new Error(`Component viewport-height ratio must be finite and within (0, 1], received ${ratio}.`);
|
|
14
|
+
}
|
|
15
|
+
return { kind: 'viewport-height', ratio };
|
|
16
|
+
}
|
|
17
|
+
function hasExactKeys(candidate, expectedKeys) {
|
|
18
|
+
const actualKeys = Object.keys(candidate);
|
|
19
|
+
return (actualKeys.length === expectedKeys.length &&
|
|
20
|
+
actualKeys.every((key) => expectedKeys.includes(key)));
|
|
21
|
+
}
|
|
22
|
+
export function isComponentPlatformIntent(value) {
|
|
23
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const candidate = value;
|
|
27
|
+
if (candidate.kind === 'shadow') {
|
|
28
|
+
if (candidate.role === 'focus-ring' || candidate.role === 'none') {
|
|
29
|
+
return hasExactKeys(candidate, ['kind', 'role']);
|
|
30
|
+
}
|
|
31
|
+
return (candidate.role === 'elevation' &&
|
|
32
|
+
hasExactKeys(candidate, ['kind', 'role', 'level']) &&
|
|
33
|
+
typeof candidate.level === 'string' &&
|
|
34
|
+
componentShadowLevels.includes(candidate.level));
|
|
35
|
+
}
|
|
36
|
+
return (candidate.kind === 'viewport-height' &&
|
|
37
|
+
hasExactKeys(candidate, ['kind', 'ratio']) &&
|
|
38
|
+
typeof candidate.ratio === 'number' &&
|
|
39
|
+
Number.isFinite(candidate.ratio) &&
|
|
40
|
+
candidate.ratio > 0 &&
|
|
41
|
+
candidate.ratio <= 1);
|
|
42
|
+
}
|
|
43
|
+
export function createComponentPlatformOutputSources(theme) {
|
|
44
|
+
return {
|
|
45
|
+
web: {
|
|
46
|
+
shadow: {
|
|
47
|
+
sm: theme.semantic.shadow.sm,
|
|
48
|
+
md: theme.semantic.shadow.md,
|
|
49
|
+
lg: theme.semantic.shadow.lg,
|
|
50
|
+
xl: theme.semantic.shadow.xl,
|
|
51
|
+
},
|
|
52
|
+
focusRingShadow: theme.semantic.focus.ring.shadow,
|
|
53
|
+
},
|
|
54
|
+
reactNative: {
|
|
55
|
+
shadow: {
|
|
56
|
+
sm: theme.tokens.shadows.sm,
|
|
57
|
+
md: theme.tokens.shadows.md,
|
|
58
|
+
lg: theme.tokens.shadows.lg,
|
|
59
|
+
// Preserve current native Modal output. #885 owns the later authority
|
|
60
|
+
// decision for whether an independent structured xl shadow is needed.
|
|
61
|
+
xl: theme.tokens.shadows.lg,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function formatPercentage(ratio) {
|
|
67
|
+
const percentage = ratio * 100;
|
|
68
|
+
return Number.isInteger(percentage)
|
|
69
|
+
? String(percentage)
|
|
70
|
+
: String(Number(percentage.toFixed(4)));
|
|
71
|
+
}
|
|
72
|
+
export function resolveComponentIntentForWeb(intent, sources) {
|
|
73
|
+
if (intent.kind === 'viewport-height') {
|
|
74
|
+
return `${formatPercentage(intent.ratio)}vh`;
|
|
75
|
+
}
|
|
76
|
+
if (intent.role === 'focus-ring')
|
|
77
|
+
return sources.web.focusRingShadow;
|
|
78
|
+
if (intent.role === 'none')
|
|
79
|
+
return 'none';
|
|
80
|
+
return sources.web.shadow[intent.level];
|
|
81
|
+
}
|
|
82
|
+
export function resolveComponentIntentForReactNative(intent, sources) {
|
|
83
|
+
if (intent.kind === 'viewport-height') {
|
|
84
|
+
return `${formatPercentage(intent.ratio)}%`;
|
|
85
|
+
}
|
|
86
|
+
if (intent.role === 'focus-ring' || intent.role === 'none')
|
|
87
|
+
return null;
|
|
88
|
+
return sources.reactNative.shadow[intent.level];
|
|
89
|
+
}
|
|
90
|
+
function adaptComponentTokenTree(value, resolveIntent) {
|
|
91
|
+
if (isComponentPlatformIntent(value)) {
|
|
92
|
+
return resolveIntent(value);
|
|
93
|
+
}
|
|
94
|
+
if (Array.isArray(value)) {
|
|
95
|
+
return value.map((entry) => adaptComponentTokenTree(entry, resolveIntent));
|
|
96
|
+
}
|
|
97
|
+
if (typeof value === 'object' && value !== null) {
|
|
98
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
99
|
+
key,
|
|
100
|
+
adaptComponentTokenTree(entry, resolveIntent),
|
|
101
|
+
]));
|
|
102
|
+
}
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
export function adaptComponentTokensForWeb(components, sources) {
|
|
106
|
+
return adaptComponentTokenTree(components, (intent) => resolveComponentIntentForWeb(intent, sources));
|
|
107
|
+
}
|
|
108
|
+
export function adaptComponentTokensForReactNative(components, sources) {
|
|
109
|
+
return adaptComponentTokenTree(components, (intent) => resolveComponentIntentForReactNative(intent, sources));
|
|
110
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy Web output identities retained by #884 only for compatibility.
|
|
3
|
+
*
|
|
4
|
+
* These paths are not canonical component tokens. They exist after the
|
|
5
|
+
* renderer-neutral component boundary and are intentionally revisited by #889.
|
|
6
|
+
*/
|
|
7
|
+
export declare const componentTokenWebCompatibilityAliases: readonly [{
|
|
8
|
+
readonly path: "components.modal.content.nativeMaxHeight";
|
|
9
|
+
readonly variable: "--modal-content-native-max-height";
|
|
10
|
+
}, {
|
|
11
|
+
readonly path: "components.popover.content.shadow.web";
|
|
12
|
+
readonly variable: "--popover-content-shadow-web";
|
|
13
|
+
}, {
|
|
14
|
+
readonly path: "components.popover.content.shadow.native.x";
|
|
15
|
+
readonly variable: "--popover-content-shadow-native-x";
|
|
16
|
+
}, {
|
|
17
|
+
readonly path: "components.popover.content.shadow.native.y";
|
|
18
|
+
readonly variable: "--popover-content-shadow-native-y";
|
|
19
|
+
}, {
|
|
20
|
+
readonly path: "components.popover.content.shadow.native.blur";
|
|
21
|
+
readonly variable: "--popover-content-shadow-native-blur";
|
|
22
|
+
}, {
|
|
23
|
+
readonly path: "components.popover.content.shadow.native.color";
|
|
24
|
+
readonly variable: "--popover-content-shadow-native-color";
|
|
25
|
+
}, {
|
|
26
|
+
readonly path: "components.popover.content.shadow.native.opacity";
|
|
27
|
+
readonly variable: "--popover-content-shadow-native-opacity";
|
|
28
|
+
}, {
|
|
29
|
+
readonly path: "components.popover.content.shadow.native.elevation";
|
|
30
|
+
readonly variable: "--popover-content-shadow-native-elevation";
|
|
31
|
+
}];
|
|
32
|
+
//# sourceMappingURL=component-token-web-compatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-token-web-compatibility.d.ts","sourceRoot":"","sources":["../../src/platform-output/component-token-web-compatibility.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;EAiCxC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy Web output identities retained by #884 only for compatibility.
|
|
3
|
+
*
|
|
4
|
+
* These paths are not canonical component tokens. They exist after the
|
|
5
|
+
* renderer-neutral component boundary and are intentionally revisited by #889.
|
|
6
|
+
*/
|
|
7
|
+
export const componentTokenWebCompatibilityAliases = [
|
|
8
|
+
{
|
|
9
|
+
path: 'components.modal.content.nativeMaxHeight',
|
|
10
|
+
variable: '--modal-content-native-max-height',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
path: 'components.popover.content.shadow.web',
|
|
14
|
+
variable: '--popover-content-shadow-web',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: 'components.popover.content.shadow.native.x',
|
|
18
|
+
variable: '--popover-content-shadow-native-x',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: 'components.popover.content.shadow.native.y',
|
|
22
|
+
variable: '--popover-content-shadow-native-y',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
path: 'components.popover.content.shadow.native.blur',
|
|
26
|
+
variable: '--popover-content-shadow-native-blur',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
path: 'components.popover.content.shadow.native.color',
|
|
30
|
+
variable: '--popover-content-shadow-native-color',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
path: 'components.popover.content.shadow.native.opacity',
|
|
34
|
+
variable: '--popover-content-shadow-native-opacity',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: 'components.popover.content.shadow.native.elevation',
|
|
38
|
+
variable: '--popover-content-shadow-native-elevation',
|
|
39
|
+
},
|
|
40
|
+
];
|