@vellira-ui/tokens 2.100.0 → 2.100.1
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/css.d.ts +1 -0
- package/dist/dark/semantic/focus.d.ts +1 -1
- package/dist/dark/semantic/focus.d.ts.map +1 -1
- package/dist/dark/semantic/focus.js +2 -1
- package/dist/dark/semantic/shadow.d.ts +5 -5
- package/dist/dark/semantic/shadow.d.ts.map +1 -1
- package/dist/dark/semantic/shadow.js +2 -7
- package/dist/dark/theme.d.ts +24 -24
- package/dist/effects/shadow-system.d.ts +181 -0
- package/dist/effects/shadow-system.d.ts.map +1 -0
- package/dist/effects/shadow-system.js +134 -0
- package/dist/highContrast/semantic/focus.d.ts +1 -1
- package/dist/highContrast/semantic/focus.d.ts.map +1 -1
- package/dist/highContrast/semantic/focus.js +2 -1
- package/dist/highContrast/semantic/shadow.d.ts +5 -5
- package/dist/highContrast/semantic/shadow.d.ts.map +1 -1
- package/dist/highContrast/semantic/shadow.js +2 -7
- package/dist/highContrast/theme.d.ts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/light/semantic/focus.d.ts +1 -1
- package/dist/light/semantic/focus.d.ts.map +1 -1
- package/dist/light/semantic/focus.js +2 -1
- package/dist/light/semantic/shadow.d.ts +5 -5
- package/dist/light/semantic/shadow.d.ts.map +1 -1
- package/dist/light/semantic/shadow.js +2 -7
- package/dist/light/theme.d.ts +24 -24
- package/dist/platform-output/component-token-intents.d.ts +4 -20
- package/dist/platform-output/component-token-intents.d.ts.map +1 -1
- package/dist/platform-output/component-token-intents.js +12 -12
- package/dist/token-architecture.d.ts +3 -3
- package/dist/token-architecture.d.ts.map +1 -1
- package/dist/token-architecture.js +7 -2
- package/dist/tokens/shadows.d.ts +24 -24
- package/dist/tokens/shadows.d.ts.map +1 -1
- package/dist/tokens/shadows.js +2 -27
- package/package.json +6 -2
package/css.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/dark/semantic/focus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/dark/semantic/focus.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { createFocusRingShadowToken } from '../../effects/shadow-system.js';
|
|
1
2
|
import { colors } from '../../primitives/colors.js';
|
|
2
3
|
export const focus = {
|
|
3
4
|
ring: {
|
|
4
5
|
color: colors.primary[300],
|
|
5
6
|
width: '2px',
|
|
6
|
-
shadow: '
|
|
7
|
+
shadow: createFocusRingShadowToken('dark'),
|
|
7
8
|
offsetColor: colors.vellira[950],
|
|
8
9
|
},
|
|
9
10
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const shadow: {
|
|
2
|
-
readonly sm:
|
|
3
|
-
readonly md:
|
|
4
|
-
readonly lg:
|
|
5
|
-
readonly xl:
|
|
6
|
-
readonly inset:
|
|
2
|
+
readonly sm: string;
|
|
3
|
+
readonly md: string;
|
|
4
|
+
readonly lg: string;
|
|
5
|
+
readonly xl: string;
|
|
6
|
+
readonly inset: string;
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=shadow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/dark/semantic/shadow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/dark/semantic/shadow.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;CAAqC,CAAC"}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
md: '0 4px 12px rgba(0, 0, 0, 0.22)',
|
|
4
|
-
lg: '0 12px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25)',
|
|
5
|
-
xl: '0 20px 60px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.3)',
|
|
6
|
-
inset: 'inset 0 1px 0 rgba(255, 255, 255, 0.06)',
|
|
7
|
-
};
|
|
1
|
+
import { createSemanticShadowTokens } from '../../effects/shadow-system.js';
|
|
2
|
+
export const shadow = createSemanticShadowTokens('dark');
|
package/dist/dark/theme.d.ts
CHANGED
|
@@ -152,30 +152,30 @@ export declare const darkTheme: {
|
|
|
152
152
|
readonly full: 999;
|
|
153
153
|
};
|
|
154
154
|
readonly shadows: {
|
|
155
|
-
readonly sm: {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
readonly md: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
readonly lg: {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
155
|
+
readonly sm: Readonly<{
|
|
156
|
+
x: number;
|
|
157
|
+
y: number;
|
|
158
|
+
blur: number;
|
|
159
|
+
color: string;
|
|
160
|
+
opacity: number;
|
|
161
|
+
elevation: number;
|
|
162
|
+
}>;
|
|
163
|
+
readonly md: Readonly<{
|
|
164
|
+
x: number;
|
|
165
|
+
y: number;
|
|
166
|
+
blur: number;
|
|
167
|
+
color: string;
|
|
168
|
+
opacity: number;
|
|
169
|
+
elevation: number;
|
|
170
|
+
}>;
|
|
171
|
+
readonly lg: Readonly<{
|
|
172
|
+
x: number;
|
|
173
|
+
y: number;
|
|
174
|
+
blur: number;
|
|
175
|
+
color: string;
|
|
176
|
+
opacity: number;
|
|
177
|
+
elevation: number;
|
|
178
|
+
}>;
|
|
179
179
|
};
|
|
180
180
|
readonly spacing: {
|
|
181
181
|
readonly 0: 0;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export declare const shadowThemeNames: readonly ["light", "dark", "high-contrast"];
|
|
2
|
+
export type ShadowThemeName = (typeof shadowThemeNames)[number];
|
|
3
|
+
export declare const elevationShadowLevels: readonly ["sm", "md", "lg", "xl"];
|
|
4
|
+
export type ElevationShadowLevel = (typeof elevationShadowLevels)[number];
|
|
5
|
+
export type ShadowLayer = Readonly<{
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
blur: number;
|
|
9
|
+
spread: number;
|
|
10
|
+
color: string;
|
|
11
|
+
opacity: number;
|
|
12
|
+
inset: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export type ShadowEffect = Readonly<{
|
|
15
|
+
layers: readonly ShadowLayer[];
|
|
16
|
+
}>;
|
|
17
|
+
export type ReactNativeShadowOutput = Readonly<{
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
blur: number;
|
|
21
|
+
color: string;
|
|
22
|
+
opacity: number;
|
|
23
|
+
elevation: number;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const canonicalShadowEffects: {
|
|
26
|
+
readonly elevation: {
|
|
27
|
+
readonly sm: {
|
|
28
|
+
readonly themes: {
|
|
29
|
+
readonly light: Readonly<{
|
|
30
|
+
layers: readonly ShadowLayer[];
|
|
31
|
+
}>;
|
|
32
|
+
readonly dark: Readonly<{
|
|
33
|
+
layers: readonly ShadowLayer[];
|
|
34
|
+
}>;
|
|
35
|
+
readonly 'high-contrast': Readonly<{
|
|
36
|
+
layers: readonly ShadowLayer[];
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
readonly reactNativeApproximation: {
|
|
40
|
+
readonly kind: "direct";
|
|
41
|
+
readonly output: Readonly<{
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
blur: number;
|
|
45
|
+
color: string;
|
|
46
|
+
opacity: number;
|
|
47
|
+
elevation: number;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly md: {
|
|
52
|
+
readonly themes: {
|
|
53
|
+
readonly light: Readonly<{
|
|
54
|
+
layers: readonly ShadowLayer[];
|
|
55
|
+
}>;
|
|
56
|
+
readonly dark: Readonly<{
|
|
57
|
+
layers: readonly ShadowLayer[];
|
|
58
|
+
}>;
|
|
59
|
+
readonly 'high-contrast': Readonly<{
|
|
60
|
+
layers: readonly ShadowLayer[];
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
readonly reactNativeApproximation: {
|
|
64
|
+
readonly kind: "direct";
|
|
65
|
+
readonly output: Readonly<{
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
blur: number;
|
|
69
|
+
color: string;
|
|
70
|
+
opacity: number;
|
|
71
|
+
elevation: number;
|
|
72
|
+
}>;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
readonly lg: {
|
|
76
|
+
readonly themes: {
|
|
77
|
+
readonly light: Readonly<{
|
|
78
|
+
layers: readonly ShadowLayer[];
|
|
79
|
+
}>;
|
|
80
|
+
readonly dark: Readonly<{
|
|
81
|
+
layers: readonly ShadowLayer[];
|
|
82
|
+
}>;
|
|
83
|
+
readonly 'high-contrast': Readonly<{
|
|
84
|
+
layers: readonly ShadowLayer[];
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
readonly reactNativeApproximation: {
|
|
88
|
+
readonly kind: "direct";
|
|
89
|
+
readonly output: Readonly<{
|
|
90
|
+
x: number;
|
|
91
|
+
y: number;
|
|
92
|
+
blur: number;
|
|
93
|
+
color: string;
|
|
94
|
+
opacity: number;
|
|
95
|
+
elevation: number;
|
|
96
|
+
}>;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
readonly xl: {
|
|
100
|
+
readonly themes: {
|
|
101
|
+
readonly light: Readonly<{
|
|
102
|
+
layers: readonly ShadowLayer[];
|
|
103
|
+
}>;
|
|
104
|
+
readonly dark: Readonly<{
|
|
105
|
+
layers: readonly ShadowLayer[];
|
|
106
|
+
}>;
|
|
107
|
+
readonly 'high-contrast': Readonly<{
|
|
108
|
+
layers: readonly ShadowLayer[];
|
|
109
|
+
}>;
|
|
110
|
+
};
|
|
111
|
+
readonly reactNativeApproximation: {
|
|
112
|
+
readonly kind: "reference";
|
|
113
|
+
readonly level: "lg";
|
|
114
|
+
readonly reason: "React Native preserves the pre-unification Modal output by approximating xl with lg.";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly inset: {
|
|
119
|
+
readonly themes: {
|
|
120
|
+
readonly light: Readonly<{
|
|
121
|
+
layers: readonly ShadowLayer[];
|
|
122
|
+
}>;
|
|
123
|
+
readonly dark: Readonly<{
|
|
124
|
+
layers: readonly ShadowLayer[];
|
|
125
|
+
}>;
|
|
126
|
+
readonly 'high-contrast': Readonly<{
|
|
127
|
+
layers: readonly ShadowLayer[];
|
|
128
|
+
}>;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
readonly focusRing: {
|
|
132
|
+
readonly themes: {
|
|
133
|
+
readonly light: Readonly<{
|
|
134
|
+
layers: readonly ShadowLayer[];
|
|
135
|
+
}>;
|
|
136
|
+
readonly dark: Readonly<{
|
|
137
|
+
layers: readonly ShadowLayer[];
|
|
138
|
+
}>;
|
|
139
|
+
readonly 'high-contrast': Readonly<{
|
|
140
|
+
layers: readonly ShadowLayer[];
|
|
141
|
+
}>;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
export declare function serializeShadowEffectForWeb(value: ShadowEffect): string;
|
|
146
|
+
export declare function createSemanticShadowTokens(themeName: ShadowThemeName): {
|
|
147
|
+
readonly sm: string;
|
|
148
|
+
readonly md: string;
|
|
149
|
+
readonly lg: string;
|
|
150
|
+
readonly xl: string;
|
|
151
|
+
readonly inset: string;
|
|
152
|
+
};
|
|
153
|
+
export declare function createFocusRingShadowToken(themeName: ShadowThemeName): string;
|
|
154
|
+
export declare function resolveReactNativeElevationShadow(level: ElevationShadowLevel): ReactNativeShadowOutput;
|
|
155
|
+
export declare function createReactNativeShadowTokens(): {
|
|
156
|
+
readonly sm: Readonly<{
|
|
157
|
+
x: number;
|
|
158
|
+
y: number;
|
|
159
|
+
blur: number;
|
|
160
|
+
color: string;
|
|
161
|
+
opacity: number;
|
|
162
|
+
elevation: number;
|
|
163
|
+
}>;
|
|
164
|
+
readonly md: Readonly<{
|
|
165
|
+
x: number;
|
|
166
|
+
y: number;
|
|
167
|
+
blur: number;
|
|
168
|
+
color: string;
|
|
169
|
+
opacity: number;
|
|
170
|
+
elevation: number;
|
|
171
|
+
}>;
|
|
172
|
+
readonly lg: Readonly<{
|
|
173
|
+
x: number;
|
|
174
|
+
y: number;
|
|
175
|
+
blur: number;
|
|
176
|
+
color: string;
|
|
177
|
+
opacity: number;
|
|
178
|
+
elevation: number;
|
|
179
|
+
}>;
|
|
180
|
+
};
|
|
181
|
+
//# sourceMappingURL=shadow-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadow-system.d.ts","sourceRoot":"","sources":["../../src/effects/shadow-system.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,6CAA8C,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,qBAAqB,mCAAoC,CAAC;AACvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,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,CAAC;AA2D5C,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAMvE;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,eAAe;;;;;;EAkBpE;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,CAI7E;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,oBAAoB,GAC1B,uBAAuB,CASzB;AAED,wBAAgB,6BAA6B;;WAxOxC,MAAM;WACN,MAAM;cACH,MAAM;eACL,MAAM;iBACJ,MAAM;mBACJ,MAAM;;;WALd,MAAM;WACN,MAAM;cACH,MAAM;eACL,MAAM;iBACJ,MAAM;mBACJ,MAAM;;;WALd,MAAM;WACN,MAAM;cACH,MAAM;eACL,MAAM;iBACJ,MAAM;mBACJ,MAAM;;EAyOlB"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { colors } from '../primitives/colors.js';
|
|
2
|
+
export const shadowThemeNames = ['light', 'dark', 'high-contrast'];
|
|
3
|
+
export const elevationShadowLevels = ['sm', 'md', 'lg', 'xl'];
|
|
4
|
+
const effect = (...layers) => ({ layers });
|
|
5
|
+
const layer = (x, y, blur, spread, color, opacity, inset = false) => ({ x, y, blur, spread, color, opacity, inset });
|
|
6
|
+
const nativeShadow = (x, y, blur, color, opacity, elevation) => ({ x, y, blur, color, opacity, elevation });
|
|
7
|
+
const nativeSm = nativeShadow(0, 1, 3, colors.mono[950], 0.04, 1);
|
|
8
|
+
const nativeMd = nativeShadow(0, 6, 16, colors.mono[950], 0.08, 4);
|
|
9
|
+
const nativeLg = nativeShadow(0, 12, 32, colors.mono[950], 0.1, 8);
|
|
10
|
+
export const canonicalShadowEffects = {
|
|
11
|
+
elevation: {
|
|
12
|
+
sm: {
|
|
13
|
+
themes: {
|
|
14
|
+
light: effect(layer(0, 1, 2, 0, colors.vellira[950], 0.08)),
|
|
15
|
+
dark: effect(layer(0, 1, 2, 0, colors.mono[950], 0.12)),
|
|
16
|
+
'high-contrast': effect(layer(0, 1, 2, 0, colors.mono[950], 0.5)),
|
|
17
|
+
},
|
|
18
|
+
reactNativeApproximation: { kind: 'direct', output: nativeSm },
|
|
19
|
+
},
|
|
20
|
+
md: {
|
|
21
|
+
themes: {
|
|
22
|
+
light: effect(layer(0, 4, 12, 0, colors.vellira[950], 0.12)),
|
|
23
|
+
dark: effect(layer(0, 4, 12, 0, colors.mono[950], 0.22)),
|
|
24
|
+
'high-contrast': effect(layer(0, 4, 12, 0, colors.mono[950], 0.6)),
|
|
25
|
+
},
|
|
26
|
+
reactNativeApproximation: { kind: 'direct', output: nativeMd },
|
|
27
|
+
},
|
|
28
|
+
lg: {
|
|
29
|
+
themes: {
|
|
30
|
+
light: effect(layer(0, 12, 40, 0, colors.vellira[950], 0.16), layer(0, 2, 8, 0, colors.vellira[950], 0.1)),
|
|
31
|
+
dark: effect(layer(0, 12, 40, 0, colors.mono[950], 0.35), layer(0, 2, 8, 0, colors.mono[950], 0.25)),
|
|
32
|
+
'high-contrast': effect(layer(0, 12, 40, 0, colors.mono[950], 0.7)),
|
|
33
|
+
},
|
|
34
|
+
reactNativeApproximation: { kind: 'direct', output: nativeLg },
|
|
35
|
+
},
|
|
36
|
+
xl: {
|
|
37
|
+
themes: {
|
|
38
|
+
light: effect(layer(0, 20, 60, 0, colors.vellira[950], 0.2), layer(0, 4, 16, 0, colors.vellira[950], 0.14)),
|
|
39
|
+
dark: effect(layer(0, 20, 60, 0, colors.mono[950], 0.45), layer(0, 4, 16, 0, colors.mono[950], 0.3)),
|
|
40
|
+
'high-contrast': effect(layer(0, 20, 60, 0, colors.mono[950], 0.8)),
|
|
41
|
+
},
|
|
42
|
+
reactNativeApproximation: {
|
|
43
|
+
kind: 'reference',
|
|
44
|
+
level: 'lg',
|
|
45
|
+
reason: 'React Native preserves the pre-unification Modal output by approximating xl with lg.',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
inset: {
|
|
50
|
+
themes: {
|
|
51
|
+
light: effect(layer(0, 1, 0, 0, colors.mono[50], 0.55, true)),
|
|
52
|
+
dark: effect(layer(0, 1, 0, 0, colors.mono[50], 0.06, true)),
|
|
53
|
+
'high-contrast': effect(layer(0, 1, 0, 0, colors.mono[50], 0.14, true)),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
focusRing: {
|
|
57
|
+
themes: {
|
|
58
|
+
light: effect(layer(0, 0, 8, 0, colors.primary[600], 0.14)),
|
|
59
|
+
dark: effect(layer(0, 0, 8, 0, colors.primary[300], 0.14)),
|
|
60
|
+
'high-contrast': effect(layer(0, 0, 0, 1, colors.mono[50], 0.28)),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
function parseHexColor(color) {
|
|
65
|
+
const match = color.match(/^#([0-9a-f]{6})$/i);
|
|
66
|
+
if (!match) {
|
|
67
|
+
throw new Error(`Shadow layer color must be a six-digit hex value, received ${color}.`);
|
|
68
|
+
}
|
|
69
|
+
const value = match[1];
|
|
70
|
+
return [
|
|
71
|
+
Number.parseInt(value.slice(0, 2), 16),
|
|
72
|
+
Number.parseInt(value.slice(2, 4), 16),
|
|
73
|
+
Number.parseInt(value.slice(4, 6), 16),
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
function formatLength(value) {
|
|
77
|
+
if (!Number.isFinite(value)) {
|
|
78
|
+
throw new Error(`Shadow length must be finite, received ${value}.`);
|
|
79
|
+
}
|
|
80
|
+
return value === 0 ? '0' : `${value}px`;
|
|
81
|
+
}
|
|
82
|
+
function serializeLayerForWeb(value) {
|
|
83
|
+
if (!Number.isFinite(value.blur) || value.blur < 0) {
|
|
84
|
+
throw new Error(`Shadow blur must be finite and non-negative, received ${value.blur}.`);
|
|
85
|
+
}
|
|
86
|
+
if (!Number.isFinite(value.opacity) ||
|
|
87
|
+
value.opacity < 0 ||
|
|
88
|
+
value.opacity > 1) {
|
|
89
|
+
throw new Error(`Shadow opacity must be finite and within [0, 1], received ${value.opacity}.`);
|
|
90
|
+
}
|
|
91
|
+
const [red, green, blue] = parseHexColor(value.color);
|
|
92
|
+
const lengths = [
|
|
93
|
+
formatLength(value.x),
|
|
94
|
+
formatLength(value.y),
|
|
95
|
+
formatLength(value.blur),
|
|
96
|
+
];
|
|
97
|
+
if (value.spread !== 0) {
|
|
98
|
+
lengths.push(formatLength(value.spread));
|
|
99
|
+
}
|
|
100
|
+
const color = `rgba(${red}, ${green}, ${blue}, ${value.opacity})`;
|
|
101
|
+
return `${value.inset ? 'inset ' : ''}${lengths.join(' ')} ${color}`;
|
|
102
|
+
}
|
|
103
|
+
export function serializeShadowEffectForWeb(value) {
|
|
104
|
+
if (value.layers.length === 0) {
|
|
105
|
+
throw new Error('Shadow effect must contain at least one layer.');
|
|
106
|
+
}
|
|
107
|
+
return value.layers.map(serializeLayerForWeb).join(', ');
|
|
108
|
+
}
|
|
109
|
+
export function createSemanticShadowTokens(themeName) {
|
|
110
|
+
return {
|
|
111
|
+
sm: serializeShadowEffectForWeb(canonicalShadowEffects.elevation.sm.themes[themeName]),
|
|
112
|
+
md: serializeShadowEffectForWeb(canonicalShadowEffects.elevation.md.themes[themeName]),
|
|
113
|
+
lg: serializeShadowEffectForWeb(canonicalShadowEffects.elevation.lg.themes[themeName]),
|
|
114
|
+
xl: serializeShadowEffectForWeb(canonicalShadowEffects.elevation.xl.themes[themeName]),
|
|
115
|
+
inset: serializeShadowEffectForWeb(canonicalShadowEffects.inset.themes[themeName]),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export function createFocusRingShadowToken(themeName) {
|
|
119
|
+
return serializeShadowEffectForWeb(canonicalShadowEffects.focusRing.themes[themeName]);
|
|
120
|
+
}
|
|
121
|
+
export function resolveReactNativeElevationShadow(level) {
|
|
122
|
+
const approximation = canonicalShadowEffects.elevation[level].reactNativeApproximation;
|
|
123
|
+
if (approximation.kind === 'direct') {
|
|
124
|
+
return approximation.output;
|
|
125
|
+
}
|
|
126
|
+
return resolveReactNativeElevationShadow(approximation.level);
|
|
127
|
+
}
|
|
128
|
+
export function createReactNativeShadowTokens() {
|
|
129
|
+
return {
|
|
130
|
+
sm: resolveReactNativeElevationShadow('sm'),
|
|
131
|
+
md: resolveReactNativeElevationShadow('md'),
|
|
132
|
+
lg: resolveReactNativeElevationShadow('lg'),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/highContrast/semantic/focus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/highContrast/semantic/focus.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { createFocusRingShadowToken } from '../../effects/shadow-system.js';
|
|
1
2
|
import { colors } from '../../primitives/colors.js';
|
|
2
3
|
export const focus = {
|
|
3
4
|
ring: {
|
|
4
5
|
color: colors.warning[300],
|
|
5
6
|
width: '2px',
|
|
6
|
-
shadow: '
|
|
7
|
+
shadow: createFocusRingShadowToken('high-contrast'),
|
|
7
8
|
offsetColor: colors.mono[950],
|
|
8
9
|
},
|
|
9
10
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const shadow: {
|
|
2
|
-
readonly sm:
|
|
3
|
-
readonly md:
|
|
4
|
-
readonly lg:
|
|
5
|
-
readonly xl:
|
|
6
|
-
readonly inset:
|
|
2
|
+
readonly sm: string;
|
|
3
|
+
readonly md: string;
|
|
4
|
+
readonly lg: string;
|
|
5
|
+
readonly xl: string;
|
|
6
|
+
readonly inset: string;
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=shadow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/highContrast/semantic/shadow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/highContrast/semantic/shadow.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;CAA8C,CAAC"}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
md: '0 4px 12px rgba(0, 0, 0, 0.6)',
|
|
4
|
-
lg: '0 12px 40px rgba(0, 0, 0, 0.7)',
|
|
5
|
-
xl: '0 20px 60px rgba(0, 0, 0, 0.8)',
|
|
6
|
-
inset: 'inset 0 1px 0 rgba(255, 255, 255, 0.14)',
|
|
7
|
-
};
|
|
1
|
+
import { createSemanticShadowTokens } from '../../effects/shadow-system.js';
|
|
2
|
+
export const shadow = createSemanticShadowTokens('high-contrast');
|
|
@@ -152,30 +152,30 @@ export declare const highContrastTheme: {
|
|
|
152
152
|
readonly full: 999;
|
|
153
153
|
};
|
|
154
154
|
readonly shadows: {
|
|
155
|
-
readonly sm: {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
readonly md: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
readonly lg: {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
155
|
+
readonly sm: Readonly<{
|
|
156
|
+
x: number;
|
|
157
|
+
y: number;
|
|
158
|
+
blur: number;
|
|
159
|
+
color: string;
|
|
160
|
+
opacity: number;
|
|
161
|
+
elevation: number;
|
|
162
|
+
}>;
|
|
163
|
+
readonly md: Readonly<{
|
|
164
|
+
x: number;
|
|
165
|
+
y: number;
|
|
166
|
+
blur: number;
|
|
167
|
+
color: string;
|
|
168
|
+
opacity: number;
|
|
169
|
+
elevation: number;
|
|
170
|
+
}>;
|
|
171
|
+
readonly lg: Readonly<{
|
|
172
|
+
x: number;
|
|
173
|
+
y: number;
|
|
174
|
+
blur: number;
|
|
175
|
+
color: string;
|
|
176
|
+
opacity: number;
|
|
177
|
+
elevation: number;
|
|
178
|
+
}>;
|
|
179
179
|
};
|
|
180
180
|
readonly spacing: {
|
|
181
181
|
readonly 0: 0;
|
package/dist/index.d.ts
CHANGED
|
@@ -22,30 +22,30 @@ export declare const theme: {
|
|
|
22
22
|
readonly full: 999;
|
|
23
23
|
};
|
|
24
24
|
readonly shadows: {
|
|
25
|
-
readonly sm: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
readonly md: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
readonly lg: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
25
|
+
readonly sm: Readonly<{
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
blur: number;
|
|
29
|
+
color: string;
|
|
30
|
+
opacity: number;
|
|
31
|
+
elevation: number;
|
|
32
|
+
}>;
|
|
33
|
+
readonly md: Readonly<{
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
blur: number;
|
|
37
|
+
color: string;
|
|
38
|
+
opacity: number;
|
|
39
|
+
elevation: number;
|
|
40
|
+
}>;
|
|
41
|
+
readonly lg: Readonly<{
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
blur: number;
|
|
45
|
+
color: string;
|
|
46
|
+
opacity: number;
|
|
47
|
+
elevation: number;
|
|
48
|
+
}>;
|
|
49
49
|
};
|
|
50
50
|
readonly spacing: {
|
|
51
51
|
readonly 0: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/light/semantic/focus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/light/semantic/focus.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { createFocusRingShadowToken } from '../../effects/shadow-system.js';
|
|
1
2
|
import { colors } from '../../primitives/colors.js';
|
|
2
3
|
export const focus = {
|
|
3
4
|
ring: {
|
|
4
5
|
color: colors.primary[700],
|
|
5
6
|
width: '2px',
|
|
6
|
-
shadow: '
|
|
7
|
+
shadow: createFocusRingShadowToken('light'),
|
|
7
8
|
offsetColor: colors.mono[50],
|
|
8
9
|
},
|
|
9
10
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const shadow: {
|
|
2
|
-
readonly sm:
|
|
3
|
-
readonly md:
|
|
4
|
-
readonly lg:
|
|
5
|
-
readonly xl:
|
|
6
|
-
readonly inset:
|
|
2
|
+
readonly sm: string;
|
|
3
|
+
readonly md: string;
|
|
4
|
+
readonly lg: string;
|
|
5
|
+
readonly xl: string;
|
|
6
|
+
readonly inset: string;
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=shadow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/light/semantic/shadow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/light/semantic/shadow.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;CAAsC,CAAC"}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
md: '0 4px 12px rgba(24, 21, 33, 0.12)',
|
|
4
|
-
lg: '0 12px 40px rgba(24, 21, 33, 0.16), 0 2px 8px rgba(24, 21, 33, 0.1)',
|
|
5
|
-
xl: '0 20px 60px rgba(24, 21, 33, 0.2), 0 4px 16px rgba(24, 21, 33, 0.14)',
|
|
6
|
-
inset: 'inset 0 1px 0 rgba(255, 255, 255, 0.55)',
|
|
7
|
-
};
|
|
1
|
+
import { createSemanticShadowTokens } from '../../effects/shadow-system.js';
|
|
2
|
+
export const shadow = createSemanticShadowTokens('light');
|
package/dist/light/theme.d.ts
CHANGED
|
@@ -152,30 +152,30 @@ export declare const lightTheme: {
|
|
|
152
152
|
readonly full: 999;
|
|
153
153
|
};
|
|
154
154
|
readonly shadows: {
|
|
155
|
-
readonly sm: {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
readonly md: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
readonly lg: {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
155
|
+
readonly sm: Readonly<{
|
|
156
|
+
x: number;
|
|
157
|
+
y: number;
|
|
158
|
+
blur: number;
|
|
159
|
+
color: string;
|
|
160
|
+
opacity: number;
|
|
161
|
+
elevation: number;
|
|
162
|
+
}>;
|
|
163
|
+
readonly md: Readonly<{
|
|
164
|
+
x: number;
|
|
165
|
+
y: number;
|
|
166
|
+
blur: number;
|
|
167
|
+
color: string;
|
|
168
|
+
opacity: number;
|
|
169
|
+
elevation: number;
|
|
170
|
+
}>;
|
|
171
|
+
readonly lg: Readonly<{
|
|
172
|
+
x: number;
|
|
173
|
+
y: number;
|
|
174
|
+
blur: number;
|
|
175
|
+
color: string;
|
|
176
|
+
opacity: number;
|
|
177
|
+
elevation: number;
|
|
178
|
+
}>;
|
|
179
179
|
};
|
|
180
180
|
readonly spacing: {
|
|
181
181
|
readonly 0: 0;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type ElevationShadowLevel, type ReactNativeShadowOutput as CanonicalReactNativeShadowOutput, type ShadowThemeName } from '../effects/shadow-system.js';
|
|
1
2
|
export declare const componentShadowLevels: readonly ["sm", "md", "lg", "xl"];
|
|
2
|
-
export type ComponentShadowLevel =
|
|
3
|
+
export type ComponentShadowLevel = ElevationShadowLevel;
|
|
3
4
|
export type ComponentElevationShadowIntent = Readonly<{
|
|
4
5
|
kind: 'shadow';
|
|
5
6
|
role: 'elevation';
|
|
@@ -19,14 +20,7 @@ export type ComponentViewportHeightIntent = Readonly<{
|
|
|
19
20
|
ratio: number;
|
|
20
21
|
}>;
|
|
21
22
|
export type ComponentPlatformIntent = ComponentShadowIntent | ComponentViewportHeightIntent;
|
|
22
|
-
export type ReactNativeShadowOutput =
|
|
23
|
-
x: number;
|
|
24
|
-
y: number;
|
|
25
|
-
blur: number;
|
|
26
|
-
color: string;
|
|
27
|
-
opacity: number;
|
|
28
|
-
elevation: number;
|
|
29
|
-
}>;
|
|
23
|
+
export type ReactNativeShadowOutput = CanonicalReactNativeShadowOutput;
|
|
30
24
|
export type ComponentPlatformOutputSources = Readonly<{
|
|
31
25
|
web: {
|
|
32
26
|
shadow: Readonly<Record<ComponentShadowLevel, string>>;
|
|
@@ -37,17 +31,7 @@ export type ComponentPlatformOutputSources = Readonly<{
|
|
|
37
31
|
};
|
|
38
32
|
}>;
|
|
39
33
|
type ComponentOutputThemeSources = Readonly<{
|
|
40
|
-
|
|
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
|
-
};
|
|
34
|
+
name: ShadowThemeName;
|
|
51
35
|
}>;
|
|
52
36
|
type WebAdaptedIntent<T> = T extends ComponentPlatformIntent ? string : never;
|
|
53
37
|
type ReactNativeAdaptedIntent<T> = T extends ComponentElevationShadowIntent ? ReactNativeShadowOutput : T extends ComponentFocusRingShadowIntent | ComponentNoShadowIntent ? null : T extends ComponentViewportHeightIntent ? string : never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-token-intents.d.ts","sourceRoot":"","sources":["../../src/platform-output/component-token-intents.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"component-token-intents.d.ts","sourceRoot":"","sources":["../../src/platform-output/component-token-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EAEzB,KAAK,uBAAuB,IAAI,gCAAgC,EAEhE,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,qBAAqB,mCAAwB,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAExD,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,MAAM,MAAM,qBAAqB,GAC7B,8BAA8B,GAC9B,8BAA8B,GAC9B,uBAAuB,CAAC;AAE5B,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IACnD,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,uBAAuB,G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AM,MAAM,CAAC,EAAE,GACjC,SAAS,0BAA0B,CAAC,MAAM,CAAC,EAAE,GAC7C,CAAC,SAAS,MAAM,GACd;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC7D,CAAC,CAAC;AAEV,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,oBAAoB,GAC1B,8BAA8B,CAEhC;AAED,wBAAgB,oCAAoC,IAAI,8BAA8B,CAErF;AAED,wBAAgB,6BAA6B,IAAI,uBAAuB,CAEvE;AAED,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,MAAM,GACZ,6BAA6B,CAQ/B;AAcD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,uBAAuB,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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { createFocusRingShadowToken, createSemanticShadowTokens, elevationShadowLevels, resolveReactNativeElevationShadow, } from '../effects/shadow-system.js';
|
|
2
|
+
export const componentShadowLevels = elevationShadowLevels;
|
|
2
3
|
export function createComponentShadowIntent(level) {
|
|
3
4
|
return { kind: 'shadow', role: 'elevation', level };
|
|
4
5
|
}
|
|
@@ -41,24 +42,23 @@ export function isComponentPlatformIntent(value) {
|
|
|
41
42
|
candidate.ratio <= 1);
|
|
42
43
|
}
|
|
43
44
|
export function createComponentPlatformOutputSources(theme) {
|
|
45
|
+
const shadow = createSemanticShadowTokens(theme.name);
|
|
44
46
|
return {
|
|
45
47
|
web: {
|
|
46
48
|
shadow: {
|
|
47
|
-
sm:
|
|
48
|
-
md:
|
|
49
|
-
lg:
|
|
50
|
-
xl:
|
|
49
|
+
sm: shadow.sm,
|
|
50
|
+
md: shadow.md,
|
|
51
|
+
lg: shadow.lg,
|
|
52
|
+
xl: shadow.xl,
|
|
51
53
|
},
|
|
52
|
-
focusRingShadow: theme.
|
|
54
|
+
focusRingShadow: createFocusRingShadowToken(theme.name),
|
|
53
55
|
},
|
|
54
56
|
reactNative: {
|
|
55
57
|
shadow: {
|
|
56
|
-
sm:
|
|
57
|
-
md:
|
|
58
|
-
lg:
|
|
59
|
-
|
|
60
|
-
// decision for whether an independent structured xl shadow is needed.
|
|
61
|
-
xl: theme.tokens.shadows.lg,
|
|
58
|
+
sm: resolveReactNativeElevationShadow('sm'),
|
|
59
|
+
md: resolveReactNativeElevationShadow('md'),
|
|
60
|
+
lg: resolveReactNativeElevationShadow('lg'),
|
|
61
|
+
xl: resolveReactNativeElevationShadow('xl'),
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
};
|
|
@@ -189,8 +189,8 @@ export declare const semanticVocabularyV1: {
|
|
|
189
189
|
readonly roles: readonly ["backdrop", "tooltip", "floating", "dialog"];
|
|
190
190
|
};
|
|
191
191
|
readonly shadow: {
|
|
192
|
-
readonly purpose: "Semantic
|
|
193
|
-
readonly roles: readonly ["sm", "md", "lg", "xl"];
|
|
192
|
+
readonly purpose: "Semantic shadow references derived from the canonical structured #885 authority; Web strings are renderer output, not authored design values.";
|
|
193
|
+
readonly roles: readonly ["sm", "md", "lg", "xl", "inset"];
|
|
194
194
|
};
|
|
195
195
|
};
|
|
196
196
|
export declare const canonicalTokenVocabulary: {
|
|
@@ -201,7 +201,7 @@ export declare const canonicalTokenVocabulary: {
|
|
|
201
201
|
readonly intent: readonly ["primary", "accent", "neutral", "success", "warning", "danger"];
|
|
202
202
|
readonly status: readonly ["success", "error", "warning", "info"];
|
|
203
203
|
};
|
|
204
|
-
export declare const canonicalSemanticRolePaths: readonly ["surface.canvas", "surface.default", "surface.panel", "surface.subtle", "surface.muted", "surface.elevated", "surface.hover", "surface.active", "surface.pressed", "surface.disabled", "surface.danger", "surface.inverse", "text.primary", "text.secondary", "text.muted", "text.subtle", "text.disabled", "text.brand", "text.interactive", "text.interactiveHover", "text.interactivePressed", "text.inverse", "icons.default", "icons.secondary", "icons.muted", "icons.subtle", "icons.disabled", "icons.interactive", "icons.brand", "icons.interactiveHover", "icons.success", "icons.danger", "icons.inverse", "border.subtle", "border.muted", "border.default", "border.strong", "border.elevated", "border.disabled", "border.interactive", "divider.muted", "divider.default", "divider.strong", "focus.ring.color", "focus.ring.width", "focus.ring.shadow", "focus.ring.offsetColor", "status.success.fg", "status.success.bg", "status.success.border", "status.success.ring", "status.success.emphasisFg", "status.error.fg", "status.error.bg", "status.error.border", "status.error.ring", "status.error.emphasisFg", "status.warning.fg", "status.warning.bg", "status.warning.border", "status.warning.ring", "status.warning.emphasisFg", "status.info.fg", "status.info.bg", "status.info.border", "status.info.ring", "status.info.emphasisFg", "overlay.backdrop", "overlay.tooltip.bg", "overlay.tooltip.fg", "overlay.tooltip.border", "overlay.floating.bg", "overlay.floating.border", "overlay.dialog.bg", "overlay.dialog.border"];
|
|
204
|
+
export declare const canonicalSemanticRolePaths: readonly ["surface.canvas", "surface.default", "surface.panel", "surface.subtle", "surface.muted", "surface.elevated", "surface.hover", "surface.active", "surface.pressed", "surface.disabled", "surface.danger", "surface.inverse", "text.primary", "text.secondary", "text.muted", "text.subtle", "text.disabled", "text.brand", "text.interactive", "text.interactiveHover", "text.interactivePressed", "text.inverse", "icons.default", "icons.secondary", "icons.muted", "icons.subtle", "icons.disabled", "icons.interactive", "icons.brand", "icons.interactiveHover", "icons.success", "icons.danger", "icons.inverse", "border.subtle", "border.muted", "border.default", "border.strong", "border.elevated", "border.disabled", "border.interactive", "divider.muted", "divider.default", "divider.strong", "focus.ring.color", "focus.ring.width", "focus.ring.shadow", "focus.ring.offsetColor", "status.success.fg", "status.success.bg", "status.success.border", "status.success.ring", "status.success.emphasisFg", "status.error.fg", "status.error.bg", "status.error.border", "status.error.ring", "status.error.emphasisFg", "status.warning.fg", "status.warning.bg", "status.warning.border", "status.warning.ring", "status.warning.emphasisFg", "status.info.fg", "status.info.bg", "status.info.border", "status.info.ring", "status.info.emphasisFg", "overlay.backdrop", "overlay.tooltip.bg", "overlay.tooltip.fg", "overlay.tooltip.border", "overlay.floating.bg", "overlay.floating.border", "overlay.dialog.bg", "overlay.dialog.border", "shadow.sm", "shadow.md", "shadow.lg", "shadow.xl", "shadow.inset"];
|
|
205
205
|
export declare const componentTokenFactoryModel: {
|
|
206
206
|
readonly canonicalName: "create<Component>Tokens";
|
|
207
207
|
readonly legacyPaletteName: "create<Component>Palette is retained when the component exposes intent palettes.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-architecture.d.ts","sourceRoot":"","sources":["../src/token-architecture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,uBAAuB,qGAO1B,CAAC;AAEX,eAAO,MAAM,qBAAqB,EAChC,wFAAiG,CAAC;AAEpG,eAAO,MAAM,eAAe,wLAelB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qC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B,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,cAAc,GAAG,IAAI,CAwCvB;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,cAAc,CAQhB;AAED,eAAO,MAAM,0BAA0B,qFAQ7B,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC/B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;EAiC3C,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwGvB,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;;;;;CA+C3B,CAAC;AAEX,eAAO,MAAM,0BAA0B,gjDAiF7B,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;CAS7B,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqG/B,CAAC;AAEX,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;EA+BjC,CAAC"}
|
|
@@ -388,8 +388,8 @@ export const semanticVocabularyV1 = {
|
|
|
388
388
|
roles: ['backdrop', 'tooltip', 'floating', 'dialog'],
|
|
389
389
|
},
|
|
390
390
|
shadow: {
|
|
391
|
-
purpose: 'Semantic
|
|
392
|
-
roles: ['sm', 'md', 'lg', 'xl'],
|
|
391
|
+
purpose: 'Semantic shadow references derived from the canonical structured #885 authority; Web strings are renderer output, not authored design values.',
|
|
392
|
+
roles: ['sm', 'md', 'lg', 'xl', 'inset'],
|
|
393
393
|
},
|
|
394
394
|
};
|
|
395
395
|
export const canonicalTokenVocabulary = {
|
|
@@ -516,6 +516,11 @@ export const canonicalSemanticRolePaths = [
|
|
|
516
516
|
'overlay.floating.border',
|
|
517
517
|
'overlay.dialog.bg',
|
|
518
518
|
'overlay.dialog.border',
|
|
519
|
+
'shadow.sm',
|
|
520
|
+
'shadow.md',
|
|
521
|
+
'shadow.lg',
|
|
522
|
+
'shadow.xl',
|
|
523
|
+
'shadow.inset',
|
|
519
524
|
];
|
|
520
525
|
export const componentTokenFactoryModel = {
|
|
521
526
|
canonicalName: 'create<Component>Tokens',
|
package/dist/tokens/shadows.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export declare const shadows: {
|
|
2
|
-
readonly sm: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
readonly md: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
readonly lg: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
2
|
+
readonly sm: Readonly<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
blur: number;
|
|
6
|
+
color: string;
|
|
7
|
+
opacity: number;
|
|
8
|
+
elevation: number;
|
|
9
|
+
}>;
|
|
10
|
+
readonly md: Readonly<{
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
blur: number;
|
|
14
|
+
color: string;
|
|
15
|
+
opacity: number;
|
|
16
|
+
elevation: number;
|
|
17
|
+
}>;
|
|
18
|
+
readonly lg: Readonly<{
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
blur: number;
|
|
22
|
+
color: string;
|
|
23
|
+
opacity: number;
|
|
24
|
+
elevation: number;
|
|
25
|
+
}>;
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=shadows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadows.d.ts","sourceRoot":"","sources":["../../src/tokens/shadows.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"shadows.d.ts","sourceRoot":"","sources":["../../src/tokens/shadows.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;CAAkC,CAAC"}
|
package/dist/tokens/shadows.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const shadows =
|
|
3
|
-
sm: {
|
|
4
|
-
x: 0,
|
|
5
|
-
y: 1,
|
|
6
|
-
blur: 3,
|
|
7
|
-
color: colors.mono[950],
|
|
8
|
-
opacity: 0.04,
|
|
9
|
-
elevation: 1,
|
|
10
|
-
},
|
|
11
|
-
md: {
|
|
12
|
-
x: 0,
|
|
13
|
-
y: 6,
|
|
14
|
-
blur: 16,
|
|
15
|
-
color: colors.mono[950],
|
|
16
|
-
opacity: 0.08,
|
|
17
|
-
elevation: 4,
|
|
18
|
-
},
|
|
19
|
-
lg: {
|
|
20
|
-
x: 0,
|
|
21
|
-
y: 12,
|
|
22
|
-
blur: 32,
|
|
23
|
-
color: colors.mono[950],
|
|
24
|
-
opacity: 0.1,
|
|
25
|
-
elevation: 8,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
1
|
+
import { createReactNativeShadowTokens } from '../effects/shadow-system.js';
|
|
2
|
+
export const shadows = createReactNativeShadowTokens();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vellira-ui/tokens",
|
|
3
|
-
"version": "2.100.
|
|
3
|
+
"version": "2.100.1",
|
|
4
4
|
"description": "Design tokens for Vellira Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vellira",
|
|
@@ -40,10 +40,14 @@
|
|
|
40
40
|
"types": "./dist/index.d.ts",
|
|
41
41
|
"import": "./dist/index.js"
|
|
42
42
|
},
|
|
43
|
-
"./css":
|
|
43
|
+
"./css": {
|
|
44
|
+
"types": "./css.d.ts",
|
|
45
|
+
"default": "./dist/css/tokens.css"
|
|
46
|
+
}
|
|
44
47
|
},
|
|
45
48
|
"files": [
|
|
46
49
|
"dist",
|
|
50
|
+
"css.d.ts",
|
|
47
51
|
"README.md",
|
|
48
52
|
"LICENSE"
|
|
49
53
|
],
|