react-native-terra-ui 0.7.2 → 0.8.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/CHANGELOG.md +34 -0
- package/README.md +1 -1
- package/lib/module/components/avatar/Avatar.js +20 -20
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/button/Button.js +11 -11
- package/lib/module/components/button/Button.js.map +1 -1
- package/lib/module/components/chip/Chip.js +32 -32
- package/lib/module/components/chip/Chip.js.map +1 -1
- package/lib/module/components/empty-state/EmptyState.js +3 -3
- package/lib/module/components/empty-state/EmptyState.js.map +1 -1
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +30 -32
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
- package/lib/module/components/header/variants/TitleHeader/index.js +26 -18
- package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
- package/lib/module/components/icon/Icon.js +3 -3
- package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +2 -2
- package/lib/module/components/screen/Screen.js +63 -34
- package/lib/module/components/screen/Screen.js.map +1 -1
- package/lib/module/components/screen/ScreenContext.js +28 -9
- package/lib/module/components/screen/ScreenContext.js.map +1 -1
- package/lib/module/components/screen/ScreenFlatList.js +4 -162
- package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
- package/lib/module/components/screen/ScreenList.js +81 -97
- package/lib/module/components/screen/ScreenList.js.map +1 -1
- package/lib/module/components/screen/ScreenScrollView.js +64 -115
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
- package/lib/module/components/screen/hooks/use-screen-ref.js +18 -0
- package/lib/module/components/screen/hooks/use-screen-ref.js.map +1 -0
- package/lib/module/components/screen/hooks/use-screen-scroll-handler.js +19 -0
- package/lib/module/components/screen/hooks/use-screen-scroll-handler.js.map +1 -0
- package/lib/module/components/screen/index.js.map +1 -1
- package/lib/module/components/screen/parts/ScreenFrame.js +47 -0
- package/lib/module/components/screen/parts/ScreenFrame.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenHeaderAppearance.js +43 -0
- package/lib/module/components/screen/parts/ScreenHeaderAppearance.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenPlaceholder.js +11 -13
- package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -1
- package/lib/module/components/screen/parts/ScreenSafeArea.android.js +27 -0
- package/lib/module/components/screen/parts/ScreenSafeArea.android.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenSafeArea.js +26 -0
- package/lib/module/components/screen/parts/ScreenSafeArea.js.map +1 -0
- package/lib/module/components/screen/utils.js +18 -9
- package/lib/module/components/screen/utils.js.map +1 -1
- package/lib/module/components/spinner/Spinner.js +2 -2
- package/lib/module/components/text/Text.js +1 -1
- package/lib/module/components/toast/Toast.js +13 -13
- package/lib/module/components/toast/Toast.js.map +1 -1
- package/lib/module/components/toolbar/Toolbar.js +2 -2
- package/lib/module/context/ThemeProvider.js +22 -39
- package/lib/module/context/ThemeProvider.js.map +1 -1
- package/lib/module/context/index.js +1 -1
- package/lib/module/context/index.js.map +1 -1
- package/lib/module/theme/breakpoints.js +1 -1
- package/lib/module/theme/define-config.js +21 -0
- package/lib/module/theme/define-config.js.map +1 -0
- package/lib/module/theme/diagnostics.js +13 -0
- package/lib/module/theme/diagnostics.js.map +1 -0
- package/lib/module/theme/errors.js +15 -0
- package/lib/module/theme/errors.js.map +1 -0
- package/lib/module/theme/index.js +7 -1
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/legacy-tokens.js +119 -0
- package/lib/module/theme/legacy-tokens.js.map +1 -0
- package/lib/module/theme/registry.js +122 -130
- package/lib/module/theme/registry.js.map +1 -1
- package/lib/module/theme/resolve-config.js +346 -0
- package/lib/module/theme/resolve-config.js.map +1 -0
- package/lib/module/theme/runtime.js +57 -12
- package/lib/module/theme/runtime.js.map +1 -1
- package/lib/module/theme/screen-margin.js +6 -14
- package/lib/module/theme/screen-margin.js.map +1 -1
- package/lib/module/theme/screen-padding.js +17 -0
- package/lib/module/theme/screen-padding.js.map +1 -0
- package/lib/module/theme/selection-store.js +75 -0
- package/lib/module/theme/selection-store.js.map +1 -0
- package/lib/module/theme/theme.js +81 -36
- package/lib/module/theme/theme.js.map +1 -1
- package/lib/module/theme/tokens/canonical-color-keys.js +102 -0
- package/lib/module/theme/tokens/canonical-color-keys.js.map +1 -0
- package/lib/module/theme/tokens/dark.js +72 -88
- package/lib/module/theme/tokens/dark.js.map +1 -1
- package/lib/module/theme/tokens/light.js +69 -83
- package/lib/module/theme/tokens/light.js.map +1 -1
- package/lib/module/theme/tokens/primitives.js +14 -14
- package/lib/module/theme/tokens/primitives.js.map +1 -1
- package/lib/module/theme/tokens/validate.js +238 -0
- package/lib/module/theme/tokens/validate.js.map +1 -0
- package/lib/module/theme/unistyles-adapter.js +77 -0
- package/lib/module/theme/unistyles-adapter.js.map +1 -0
- package/lib/module/utils/accent-generator.js +476 -0
- package/lib/module/utils/accent-generator.js.map +1 -0
- package/lib/module/utils/accent-utils.js +52 -35
- package/lib/module/utils/accent-utils.js.map +1 -1
- package/lib/module/utils/color-utils.js +224 -7
- package/lib/module/utils/color-utils.js.map +1 -1
- package/lib/module/utils/deep-merge.js +1 -1
- package/lib/module/utils/deep-merge.js.map +1 -1
- package/lib/module/utils/resolve-theme-color.js +2 -2
- package/lib/typescript/src/components/chip/types.d.ts +1 -1
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts +1 -1
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +6 -5
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +11 -5
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/Icon.d.ts +2 -2
- package/lib/typescript/src/components/screen/Screen.d.ts +45 -16
- package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenContext.d.ts +42 -26
- package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +5 -46
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenList.d.ts +62 -50
- package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +18 -58
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts +5 -0
- package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts +53 -0
- package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/index.d.ts +2 -2
- package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts +6 -0
- package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts +21 -0
- package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +6 -8
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts +7 -0
- package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts +6 -0
- package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/types.d.ts +27 -32
- package/lib/typescript/src/components/screen/types.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/utils.d.ts +9 -8
- package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/text/Text.d.ts +1 -1
- package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/toolbar/Toolbar.d.ts +2 -2
- package/lib/typescript/src/context/ThemeProvider.d.ts +29 -12
- package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/context/index.d.ts +1 -1
- package/lib/typescript/src/context/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/breakpoints.d.ts +1 -1
- package/lib/typescript/src/theme/define-config.d.ts +23 -0
- package/lib/typescript/src/theme/define-config.d.ts.map +1 -0
- package/lib/typescript/src/theme/diagnostics.d.ts +4 -0
- package/lib/typescript/src/theme/diagnostics.d.ts.map +1 -0
- package/lib/typescript/src/theme/errors.d.ts +10 -0
- package/lib/typescript/src/theme/errors.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +10 -2
- package/lib/typescript/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/legacy-tokens.d.ts +187 -0
- package/lib/typescript/src/theme/legacy-tokens.d.ts.map +1 -0
- package/lib/typescript/src/theme/registry.d.ts +12 -17
- package/lib/typescript/src/theme/registry.d.ts.map +1 -1
- package/lib/typescript/src/theme/resolve-config.d.ts +99 -0
- package/lib/typescript/src/theme/resolve-config.d.ts.map +1 -0
- package/lib/typescript/src/theme/runtime.d.ts +25 -4
- package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
- package/lib/typescript/src/theme/screen-margin.d.ts +6 -14
- package/lib/typescript/src/theme/screen-margin.d.ts.map +1 -1
- package/lib/typescript/src/theme/screen-padding.d.ts +15 -0
- package/lib/typescript/src/theme/screen-padding.d.ts.map +1 -0
- package/lib/typescript/src/theme/selection-store.d.ts +41 -0
- package/lib/typescript/src/theme/selection-store.d.ts.map +1 -0
- package/lib/typescript/src/theme/theme.d.ts +54 -1
- package/lib/typescript/src/theme/theme.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts +95 -0
- package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens/dark.d.ts +56 -63
- package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/light.d.ts +56 -71
- package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/primitives.d.ts +11 -10
- package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/validate.d.ts +34 -0
- package/lib/typescript/src/theme/tokens/validate.d.ts.map +1 -0
- package/lib/typescript/src/theme/types.d.ts +166 -86
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/lib/typescript/src/theme/unistyles-adapter.d.ts +33 -0
- package/lib/typescript/src/theme/unistyles-adapter.d.ts.map +1 -0
- package/lib/typescript/src/utils/accent-generator.d.ts +103 -0
- package/lib/typescript/src/utils/accent-generator.d.ts.map +1 -0
- package/lib/typescript/src/utils/accent-utils.d.ts +15 -2
- package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
- package/lib/typescript/src/utils/color-utils.d.ts +59 -2
- package/lib/typescript/src/utils/color-utils.d.ts.map +1 -1
- package/lib/typescript/src/utils/deep-merge.d.ts +1 -0
- package/lib/typescript/src/utils/deep-merge.d.ts.map +1 -1
- package/lib/typescript/src/utils/resolve-theme-color.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/avatar/Avatar.tsx +20 -20
- package/src/components/button/Button.tsx +11 -11
- package/src/components/chip/Chip.tsx +32 -32
- package/src/components/chip/types.ts +1 -1
- package/src/components/empty-state/EmptyState.tsx +4 -4
- package/src/components/header/variants/LargeTitleHeader/index.tsx +31 -30
- package/src/components/header/variants/TitleHeader/index.tsx +33 -22
- package/src/components/icon/Icon.tsx +4 -4
- package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +2 -2
- package/src/components/screen/Screen.tsx +89 -43
- package/src/components/screen/ScreenContext.tsx +48 -28
- package/src/components/screen/ScreenFlatList.tsx +5 -191
- package/src/components/screen/ScreenList.tsx +197 -175
- package/src/components/screen/ScreenScrollView.tsx +92 -167
- package/src/components/screen/hooks/use-screen-ref.ts +24 -0
- package/src/components/screen/hooks/use-screen-scroll-handler.ts +31 -0
- package/src/components/screen/index.ts +8 -2
- package/src/components/screen/parts/ScreenFrame.tsx +49 -0
- package/src/components/screen/parts/ScreenHeaderAppearance.tsx +52 -0
- package/src/components/screen/parts/ScreenPlaceholder.tsx +16 -16
- package/src/components/screen/parts/ScreenSafeArea.android.tsx +22 -0
- package/src/components/screen/parts/ScreenSafeArea.tsx +20 -0
- package/src/components/screen/types.ts +29 -32
- package/src/components/screen/utils.ts +24 -11
- package/src/components/spinner/Spinner.tsx +2 -2
- package/src/components/text/Text.tsx +2 -2
- package/src/components/toast/Toast.tsx +13 -13
- package/src/components/toolbar/Toolbar.tsx +4 -4
- package/src/context/ThemeProvider.tsx +47 -51
- package/src/context/index.ts +1 -1
- package/src/theme/breakpoints.ts +1 -1
- package/src/theme/define-config.ts +27 -0
- package/src/theme/diagnostics.ts +11 -0
- package/src/theme/errors.ts +14 -0
- package/src/theme/index.ts +40 -1
- package/src/theme/legacy-tokens.ts +227 -0
- package/src/theme/registry.ts +119 -137
- package/src/theme/resolve-config.ts +406 -0
- package/src/theme/runtime.ts +52 -14
- package/src/theme/screen-margin.ts +6 -25
- package/src/theme/screen-padding.ts +26 -0
- package/src/theme/selection-store.ts +76 -0
- package/src/theme/theme.ts +104 -39
- package/src/theme/tokens/canonical-color-keys.ts +107 -0
- package/src/theme/tokens/dark.ts +91 -98
- package/src/theme/tokens/light.ts +88 -93
- package/src/theme/tokens/primitives.ts +14 -14
- package/src/theme/tokens/validate.ts +271 -0
- package/src/theme/types.ts +184 -95
- package/src/theme/unistyles-adapter.ts +75 -0
- package/src/utils/accent-generator.ts +530 -0
- package/src/utils/accent-utils.ts +66 -39
- package/src/utils/color-utils.ts +225 -8
- package/src/utils/deep-merge.ts +1 -1
- package/src/utils/resolve-theme-color.ts +2 -2
- package/lib/module/components/screen/parts/BottomSafeArea.js +0 -62
- package/lib/module/components/screen/parts/BottomSafeArea.js.map +0 -1
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts +0 -30
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +0 -1
- package/src/components/screen/parts/BottomSafeArea.tsx +0 -59
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { unflatten } from "../utils/unflatten.js";
|
|
4
|
+
import { withLegacyTokens } from "./legacy-tokens.js";
|
|
4
5
|
import { dark } from "./tokens/dark.js";
|
|
5
6
|
import { light } from "./tokens/light.js";
|
|
6
7
|
import { primitives } from "./tokens/primitives.js";
|
|
@@ -55,8 +56,8 @@ function resolveRefs(flat, source) {
|
|
|
55
56
|
* each key, leaving a flat map per category.
|
|
56
57
|
*
|
|
57
58
|
* Example:
|
|
58
|
-
* { 'color.surface.default': '#fff', 'color.
|
|
59
|
-
* → { color: { 'surface.default': '#fff', '
|
|
59
|
+
* { 'color.surface.default': '#fff', 'color.accent.solid.bg': '#009966' }
|
|
60
|
+
* → { color: { 'surface.default': '#fff', 'accent.solid.bg': '#009966' } }
|
|
60
61
|
*/
|
|
61
62
|
function flattenByCategory(tokens) {
|
|
62
63
|
const out = {};
|
|
@@ -80,7 +81,7 @@ function flattenByCategory(tokens) {
|
|
|
80
81
|
* spacing BASE are authored here (`radius.base`, `spacing.base`); the full
|
|
81
82
|
* scales are derived via {@link buildRadiusScale} / {@link buildSpacingScale}.
|
|
82
83
|
* `elevation` excludes `shadowColor`, which is layered on per-scheme from each
|
|
83
|
-
* theme's `color.shadow` token (see {@link
|
|
84
|
+
* theme's `color.shadow` token (see {@link resolveElevationScale}).
|
|
84
85
|
*/
|
|
85
86
|
const prim = unflatten(primitives);
|
|
86
87
|
|
|
@@ -155,48 +156,92 @@ const defaultRadius = buildRadiusScale();
|
|
|
155
156
|
const lightByCategory = flattenByCategory(resolveRefs(light, primitives));
|
|
156
157
|
const darkByCategory = flattenByCategory(resolveRefs(dark, primitives));
|
|
157
158
|
|
|
159
|
+
/** Elevation levels as authored: everything except the per-scheme `shadowColor`. */
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The pre-finalization ("source") form of a theme — what the resolver layers
|
|
163
|
+
* overrides onto. It differs from {@link TerraTheme} only in what is DERIVED at
|
|
164
|
+
* the final boundary instead of authored:
|
|
165
|
+
* - `color` holds canonical (and app-declared custom) keys only; deprecated
|
|
166
|
+
* aliases are materialized by {@link finalizeThemeSource}.
|
|
167
|
+
* - `elevation` levels carry no `shadowColor`; it is derived from `color.shadow`
|
|
168
|
+
* (unless explicitly pinned) at finalization.
|
|
169
|
+
* - `layout.screen` has no `margin` alias; it mirrors `padding` at finalization.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Structural deep clone for token data (plain objects, arrays and primitives —
|
|
174
|
+
* the theme never carries functions or class instances). Used so every source
|
|
175
|
+
* and every finalized theme is independently owned.
|
|
176
|
+
*/
|
|
177
|
+
export function cloneTokenTree(value) {
|
|
178
|
+
if (Array.isArray(value)) {
|
|
179
|
+
return value.map(item => cloneTokenTree(item));
|
|
180
|
+
}
|
|
181
|
+
if (typeof value === "object" && value !== null) {
|
|
182
|
+
const out = {};
|
|
183
|
+
for (const [key, item] of Object.entries(value)) {
|
|
184
|
+
out[key] = cloneTokenTree(item);
|
|
185
|
+
}
|
|
186
|
+
return out;
|
|
187
|
+
}
|
|
188
|
+
return value;
|
|
189
|
+
}
|
|
190
|
+
|
|
158
191
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
192
|
+
* Builds the built-in default theme for `scheme` in its source form (see
|
|
193
|
+
* {@link ThemeSource}). Returns a FRESH object on every call, so callers may
|
|
194
|
+
* layer onto or mutate it without affecting the exported defaults or later
|
|
195
|
+
* calls. This is the immutable starting point of the resolution pipeline:
|
|
196
|
+
* `defaults → shared → scheme → accent`.
|
|
162
197
|
*/
|
|
163
|
-
function
|
|
198
|
+
export function createDefaultThemeSource(scheme) {
|
|
199
|
+
const byCategory = scheme === "light" ? lightByCategory : darkByCategory;
|
|
200
|
+
return cloneTokenTree({
|
|
201
|
+
color: byCategory.color,
|
|
202
|
+
elevation: prim.elevation,
|
|
203
|
+
spacing: defaultSpacing,
|
|
204
|
+
radius: defaultRadius,
|
|
205
|
+
typography: prim.typography,
|
|
206
|
+
opacity: prim.opacity,
|
|
207
|
+
layout: prim.layout
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Resolves each elevation level's `shadowColor`: an explicitly pinned
|
|
213
|
+
* per-level color wins, otherwise the theme's `color.shadow` token is used —
|
|
214
|
+
* rather than authoring it redundantly on every level in `light.ts` / `dark.ts`.
|
|
215
|
+
*/
|
|
216
|
+
export function resolveElevationScale(elevation, shadowColor, pinnedShadowColors) {
|
|
164
217
|
const out = {};
|
|
165
218
|
for (const key of Object.keys(elevation)) {
|
|
166
219
|
out[key] = {
|
|
167
220
|
...elevation[key],
|
|
168
|
-
shadowColor
|
|
221
|
+
shadowColor: pinnedShadowColors?.[key] ?? shadowColor
|
|
169
222
|
};
|
|
170
223
|
}
|
|
171
224
|
return out;
|
|
172
225
|
}
|
|
173
226
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
export const defaultDarkTheme =
|
|
194
|
-
color: darkTokens.color,
|
|
195
|
-
elevation: darkTokens.elevation,
|
|
196
|
-
spacing: defaultSpacing,
|
|
197
|
-
radius: defaultRadius,
|
|
198
|
-
typography: prim.typography,
|
|
199
|
-
opacity: prim.opacity,
|
|
200
|
-
layout: prim.layout
|
|
201
|
-
};
|
|
227
|
+
/**
|
|
228
|
+
* Turns a {@link ThemeSource} into a complete, independently owned
|
|
229
|
+
* {@link TerraTheme}: derives elevation shadow colors (honouring pinned levels)
|
|
230
|
+
* and materializes every compatibility alias. Neither `source` nor the returned
|
|
231
|
+
* theme share object references with each other.
|
|
232
|
+
*/
|
|
233
|
+
export function finalizeThemeSource(source, pinnedShadowColors) {
|
|
234
|
+
const fresh = cloneTokenTree(source);
|
|
235
|
+
return withLegacyTokens({
|
|
236
|
+
color: fresh.color,
|
|
237
|
+
elevation: resolveElevationScale(fresh.elevation, fresh.color.shadow, pinnedShadowColors),
|
|
238
|
+
spacing: fresh.spacing,
|
|
239
|
+
radius: fresh.radius,
|
|
240
|
+
typography: fresh.typography,
|
|
241
|
+
opacity: fresh.opacity,
|
|
242
|
+
layout: fresh.layout
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
export const defaultLightTheme = finalizeThemeSource(createDefaultThemeSource("light"));
|
|
246
|
+
export const defaultDarkTheme = finalizeThemeSource(createDefaultThemeSource("dark"));
|
|
202
247
|
//# sourceMappingURL=theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["unflatten","dark","light","primitives","ALPHA_REF_PATTERN","HEX6_PATTERN","percentToHexAlpha","percent","byte","Math","round","toString","padStart","resolveRefs","flat","source","out","k","v","Object","entries","alphaMatch","match","refKey","percentStr","base","Number","test","startsWith","endsWith","slice","flattenByCategory","tokens","key","value","sep","indexOf","cat","rest","undefined","prim","DEFAULT_RADIUS_BASE","radius","SPACING_KEYS","DEFAULT_SPACING_BASE","spacing","buildSpacingScale","scale","defaultSpacing","RADIUS_MULTIPLIERS","xs","sm","md","lg","xl","buildRadiusScale","none","full","keys","defaultRadius","lightByCategory","darkByCategory","
|
|
1
|
+
{"version":3,"names":["unflatten","withLegacyTokens","dark","light","primitives","ALPHA_REF_PATTERN","HEX6_PATTERN","percentToHexAlpha","percent","byte","Math","round","toString","padStart","resolveRefs","flat","source","out","k","v","Object","entries","alphaMatch","match","refKey","percentStr","base","Number","test","startsWith","endsWith","slice","flattenByCategory","tokens","key","value","sep","indexOf","cat","rest","undefined","prim","DEFAULT_RADIUS_BASE","radius","SPACING_KEYS","DEFAULT_SPACING_BASE","spacing","buildSpacingScale","scale","defaultSpacing","RADIUS_MULTIPLIERS","xs","sm","md","lg","xl","buildRadiusScale","none","full","keys","defaultRadius","lightByCategory","darkByCategory","cloneTokenTree","Array","isArray","map","item","createDefaultThemeSource","scheme","byCategory","color","elevation","typography","opacity","layout","resolveElevationScale","shadowColor","pinnedShadowColors","finalizeThemeSource","fresh","shadow","defaultLightTheme","defaultDarkTheme"],"sourceRoot":"../../../src","sources":["theme/theme.ts"],"mappings":";;AAAA,SAASA,SAAS;AAClB,SAASC,gBAAgB;AACzB,SAASC,IAAI;AACb,SAASC,KAAK;AACd,SAASC,UAAU;AAiBnB;AACA;AACA,MAAMC,iBAAiB,GAAG,2BAA2B;AACrD;AACA,MAAMC,YAAY,GAAG,iBAAiB;;AAEtC;AACA;AACA;AACA,SAASC,iBAAiBA,CAACC,OAAe,EAAU;EAClD,MAAMC,IAAI,GAAGC,IAAI,CAACC,KAAK,CAAEH,OAAO,GAAG,GAAG,GAAI,GAAG,CAAC;EAC9C,OAAOC,IAAI,CAACG,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,WAAWA,CAClBC,IAA6B,EAC7BC,MAA+B,EACN;EACzB,MAAMC,GAA4B,GAAG,CAAC,CAAC;EACvC,KAAK,MAAM,CAACC,CAAC,EAAEC,CAAC,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,IAAI,CAAC,EAAE;IACzC,IAAI,O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pC,OAAOf,gBAAgB,CAAC;IACtBsE,KAAK,EAAES,KAAK,CAACT,KAAK;IAClBC,SAAS,EAAEI,qBAAqB,CAACI,KAAK,CAACR,SAAS,EAAEQ,KAAK,CAACT,KAAK,CAACU,MAAM,EAAEH,kBAAkB,CAAC;IACzFhC,OAAO,EAAEkC,KAAK,CAAClC,OAAO;IACtBH,MAAM,EAAEqC,KAAK,CAACrC,MAAM;IACpB8B,UAAU,EAAEO,KAAK,CAACP,UAAU;IAC5BC,OAAO,EAAEM,KAAK,CAACN,OAAO;IACtBC,MAAM,EAAEK,KAAK,CAACL;EAChB,CAAC,CAAC;AACJ;AAEA,OAAO,MAAMO,iBAA6B,GAAGH,mBAAmB,CAACX,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAEnG,OAAO,MAAMe,gBAA4B,GAAGJ,mBAAmB,CAACX,wBAAwB,CAAC,MAAM,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Runtime list of the built-in canonical colour keys.
|
|
5
|
+
*
|
|
6
|
+
* `CanonicalThemeColor` (types.ts) is the authoritative schema, but it is a
|
|
7
|
+
* type and cannot be iterated at runtime. This object mirrors it key-for-key
|
|
8
|
+
* so the raw-data validator can check `light.ts` / `dark.ts` against the real
|
|
9
|
+
* schema instead of a hand-maintained regex. The `satisfies` clause makes the
|
|
10
|
+
* mirror self-checking: a key missing here fails on the `Record<…>`
|
|
11
|
+
* requirement, and a key that is not in `CanonicalThemeColor` fails the
|
|
12
|
+
* excess-property check.
|
|
13
|
+
*
|
|
14
|
+
* Type-only import — this file stays free of runtime imports like the other
|
|
15
|
+
* token data.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const CANONICAL_COLOR_KEY_MAP = {
|
|
19
|
+
// surfaces
|
|
20
|
+
"surface.canvas": true,
|
|
21
|
+
"surface.default": true,
|
|
22
|
+
"surface.raised": true,
|
|
23
|
+
"surface.sunken": true,
|
|
24
|
+
// text / icons
|
|
25
|
+
"text.primary": true,
|
|
26
|
+
"text.secondary": true,
|
|
27
|
+
"text.tertiary": true,
|
|
28
|
+
"text.disabled": true,
|
|
29
|
+
"text.inverse": true,
|
|
30
|
+
"text.link": true,
|
|
31
|
+
// borders and focus
|
|
32
|
+
"border.subtle": true,
|
|
33
|
+
"border.default": true,
|
|
34
|
+
"border.strong": true,
|
|
35
|
+
"focus.ring": true,
|
|
36
|
+
// effects
|
|
37
|
+
backdrop: true,
|
|
38
|
+
shadow: true,
|
|
39
|
+
// accent
|
|
40
|
+
"accent.text": true,
|
|
41
|
+
"accent.border": true,
|
|
42
|
+
"accent.solid.bg": true,
|
|
43
|
+
"accent.solid.bg.hover": true,
|
|
44
|
+
"accent.solid.bg.pressed": true,
|
|
45
|
+
"accent.solid.bg.disabled": true,
|
|
46
|
+
"accent.solid.fg": true,
|
|
47
|
+
"accent.soft.bg": true,
|
|
48
|
+
"accent.soft.bg.hover": true,
|
|
49
|
+
"accent.soft.bg.pressed": true,
|
|
50
|
+
"accent.soft.bg.disabled": true,
|
|
51
|
+
"accent.soft.fg": true,
|
|
52
|
+
// neutral
|
|
53
|
+
"neutral.solid.bg": true,
|
|
54
|
+
"neutral.solid.fg": true,
|
|
55
|
+
"neutral.soft.bg": true,
|
|
56
|
+
"neutral.soft.bg.hover": true,
|
|
57
|
+
"neutral.soft.bg.pressed": true,
|
|
58
|
+
"neutral.soft.bg.disabled": true,
|
|
59
|
+
"neutral.soft.fg": true,
|
|
60
|
+
// status — success
|
|
61
|
+
"success.text": true,
|
|
62
|
+
"success.solid.bg": true,
|
|
63
|
+
"success.solid.fg": true,
|
|
64
|
+
"success.solid.border": true,
|
|
65
|
+
"success.soft.bg": true,
|
|
66
|
+
"success.soft.fg": true,
|
|
67
|
+
"success.soft.border": true,
|
|
68
|
+
// status — warning
|
|
69
|
+
"warning.text": true,
|
|
70
|
+
"warning.solid.bg": true,
|
|
71
|
+
"warning.solid.fg": true,
|
|
72
|
+
"warning.solid.border": true,
|
|
73
|
+
"warning.soft.bg": true,
|
|
74
|
+
"warning.soft.fg": true,
|
|
75
|
+
"warning.soft.border": true,
|
|
76
|
+
// status — danger
|
|
77
|
+
"danger.text": true,
|
|
78
|
+
"danger.solid.bg": true,
|
|
79
|
+
"danger.solid.fg": true,
|
|
80
|
+
"danger.solid.border": true,
|
|
81
|
+
"danger.soft.bg": true,
|
|
82
|
+
"danger.soft.fg": true,
|
|
83
|
+
"danger.soft.border": true,
|
|
84
|
+
// status — info
|
|
85
|
+
"info.text": true,
|
|
86
|
+
"info.solid.bg": true,
|
|
87
|
+
"info.solid.fg": true,
|
|
88
|
+
"info.solid.border": true,
|
|
89
|
+
"info.soft.bg": true,
|
|
90
|
+
"info.soft.fg": true,
|
|
91
|
+
"info.soft.border": true
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Every built-in canonical colour key (without the `color.` category prefix
|
|
96
|
+
* used by the raw token files). Exhaustive and extra-free by construction —
|
|
97
|
+
* see {@link CANONICAL_COLOR_KEY_MAP}.
|
|
98
|
+
*/
|
|
99
|
+
export const CANONICAL_COLOR_KEYS = Object.keys(CANONICAL_COLOR_KEY_MAP);
|
|
100
|
+
|
|
101
|
+
/** Type-level guard that the map's literal keys and the schema's keys are the same set. */
|
|
102
|
+
//# sourceMappingURL=canonical-color-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CANONICAL_COLOR_KEY_MAP","backdrop","shadow","CANONICAL_COLOR_KEYS","Object","keys"],"sourceRoot":"../../../../src","sources":["theme/tokens/canonical-color-keys.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,MAAMA,uBAAuB,GAAG;EAC9B;EACA,gBAAgB,EAAE,IAAI;EACtB,iBAAiB,EAAE,IAAI;EACvB,gBAAgB,EAAE,IAAI;EAC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C3B;EACA,aAAa,EAAE,IAAI;EACnB,iBAAiB,EAAE,IAAI;EACvB,iBAAiB,EAAE,IAAI;EACvB,qBAAqB,EAAE,IAAI;EAC3B,gBAAgB,EAAE,IAAI;EACtB,gBAAgB,EAAE,IAAI;EACtB,oBAAoB,EAAE,IAAI;EAC1B;EACA,WAAW,EAAE,IAAI;EACjB,eAAe,EAAE,IAAI;EACrB,eAAe,EAAE,IAAI;EACrB,mBAAmB,EAAE,IAAI;EACzB,cAAc,EAAE,IAAI;EACpB,cAAc,EAAE,IAAI;EACpB,kBAAkB,EAAE;AACtB,CAA4D;;AAE5D;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAA4D,GAAGC,MAAM,CAACC,IAAI,CACrFL,uBACF,CAAkC;;AAElC","ignoreList":[]}
|
|
@@ -1,100 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Dark
|
|
5
|
-
*
|
|
6
|
-
* Convention: [category].[context].[property?].[variant].[state]
|
|
7
|
-
*
|
|
8
|
-
* GENERATED-STYLE SOURCE: intended to be replaced by the Figma / design-sync export.
|
|
4
|
+
* Dark semantic colors. See docs/design-tokens.md for naming and references.
|
|
5
|
+
* Generated-style source; naming and contrast updates await the next design-sync export.
|
|
9
6
|
*/
|
|
10
7
|
export const dark = {
|
|
11
|
-
//
|
|
12
|
-
"color.
|
|
13
|
-
|
|
14
|
-
"color.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"color.
|
|
18
|
-
|
|
19
|
-
"color.
|
|
20
|
-
"color.
|
|
21
|
-
"color.surface.accent.subtle": "{palette.emerald.950}",
|
|
22
|
-
// ── color: text / icons (fg implied — no property segment) ──────────────
|
|
23
|
-
"color.text.default": "{palette.neutral.50}",
|
|
24
|
-
// Off-ramp hexes (like light's) rather than neutral.400/500/600: the ramp
|
|
25
|
-
// steps are tuned for dark text on white, and reused as light text they land
|
|
26
|
-
// too dim. Set so `subtle` clears AA 4.5:1 on `surface.raised` — the lightest
|
|
27
|
-
// surface, so the worst case — which keeps the muted/subtle/disabled spacing
|
|
28
|
-
// proportional to light's.
|
|
29
|
-
"color.text.muted": "#b8b8be",
|
|
30
|
-
"color.text.subtle": "#8d8d96",
|
|
8
|
+
// Surfaces
|
|
9
|
+
"color.surface.canvas": "#080a0d",
|
|
10
|
+
"color.surface.default": "#14191f",
|
|
11
|
+
"color.surface.raised": "#1f262e",
|
|
12
|
+
"color.surface.sunken": "#0f1318",
|
|
13
|
+
// Text
|
|
14
|
+
"color.text.primary": "{palette.neutral.50}",
|
|
15
|
+
// Custom grays preserve supporting-text emphasis on dark surfaces.
|
|
16
|
+
"color.text.secondary": "#b8b8be",
|
|
17
|
+
"color.text.tertiary": "#8d8d96",
|
|
31
18
|
"color.text.disabled": "#606069",
|
|
32
19
|
"color.text.inverse": "{palette.neutral.950}",
|
|
33
20
|
"color.text.link": "{palette.blue.300}",
|
|
34
|
-
|
|
35
|
-
"color.text.on-accent": "{palette.neutral.950}",
|
|
36
|
-
"color.text.on-accent-subtle": "{palette.emerald.300}",
|
|
37
|
-
// ── color: borders (border-color implied — no property segment) ──────────
|
|
21
|
+
// Borders and focus
|
|
38
22
|
"color.border.subtle": "{palette.neutral.800}",
|
|
39
23
|
"color.border.default": "{palette.neutral.700}",
|
|
40
|
-
"color.border.strong": "{palette.neutral.
|
|
41
|
-
"color.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"color.
|
|
45
|
-
|
|
46
|
-
"color.
|
|
47
|
-
"color.
|
|
48
|
-
"color.
|
|
49
|
-
"color.
|
|
50
|
-
"color.
|
|
51
|
-
"color.
|
|
52
|
-
"color.
|
|
53
|
-
"color.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"color.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"color.
|
|
66
|
-
"color.
|
|
67
|
-
|
|
68
|
-
"color.
|
|
69
|
-
"color.
|
|
70
|
-
|
|
71
|
-
"color.
|
|
72
|
-
"color.
|
|
73
|
-
"color.
|
|
74
|
-
"color.
|
|
75
|
-
|
|
76
|
-
"color.
|
|
77
|
-
"color.
|
|
78
|
-
"color.
|
|
79
|
-
"color.
|
|
80
|
-
"color.
|
|
81
|
-
"color.
|
|
82
|
-
"color.
|
|
83
|
-
|
|
84
|
-
"color.
|
|
85
|
-
"color.
|
|
86
|
-
"color.
|
|
87
|
-
"color.
|
|
88
|
-
"color.
|
|
89
|
-
"color.
|
|
90
|
-
"color.
|
|
91
|
-
|
|
92
|
-
"color.
|
|
93
|
-
"color.
|
|
94
|
-
"color.
|
|
95
|
-
"color.
|
|
96
|
-
"color.
|
|
97
|
-
"color.
|
|
98
|
-
"color.
|
|
24
|
+
"color.border.strong": "{palette.neutral.500}",
|
|
25
|
+
"color.focus.ring": "{palette.blue.400}",
|
|
26
|
+
// Effects
|
|
27
|
+
"color.backdrop": "rgba(0, 0, 0, 0.72)",
|
|
28
|
+
"color.shadow": "{palette.black}",
|
|
29
|
+
// Accent
|
|
30
|
+
"color.accent.text": "{palette.emerald.400}",
|
|
31
|
+
"color.accent.border": "{palette.emerald.500}",
|
|
32
|
+
"color.accent.solid.bg": "{palette.emerald.500}",
|
|
33
|
+
"color.accent.solid.bg.hover": "{palette.emerald.400}",
|
|
34
|
+
"color.accent.solid.bg.pressed": "{palette.emerald.300}",
|
|
35
|
+
"color.accent.solid.bg.disabled": "{palette.slate.700}",
|
|
36
|
+
"color.accent.solid.fg": "{palette.slate.950}",
|
|
37
|
+
"color.accent.soft.bg": "{palette.emerald.950}",
|
|
38
|
+
"color.accent.soft.bg.hover": "{palette.emerald.900}",
|
|
39
|
+
"color.accent.soft.bg.pressed": "{palette.emerald.800}",
|
|
40
|
+
"color.accent.soft.bg.disabled": "{palette.neutral.900}",
|
|
41
|
+
"color.accent.soft.fg": "{palette.emerald.300}",
|
|
42
|
+
// Neutral
|
|
43
|
+
"color.neutral.solid.bg": "{palette.neutral.600}",
|
|
44
|
+
"color.neutral.solid.fg": "{palette.neutral.50}",
|
|
45
|
+
// Translucent fills keep soft controls distinct from surrounding surfaces.
|
|
46
|
+
"color.neutral.soft.bg": "{palette.neutral.400}/25",
|
|
47
|
+
"color.neutral.soft.bg.hover": "{palette.neutral.400}/35",
|
|
48
|
+
"color.neutral.soft.bg.pressed": "{palette.neutral.400}/45",
|
|
49
|
+
"color.neutral.soft.bg.disabled": "{palette.neutral.900}",
|
|
50
|
+
"color.neutral.soft.fg": "{palette.neutral.200}",
|
|
51
|
+
// Success
|
|
52
|
+
"color.success.text": "{palette.green.400}",
|
|
53
|
+
"color.success.solid.bg": "{palette.green.500}",
|
|
54
|
+
"color.success.solid.fg": "{palette.slate.950}",
|
|
55
|
+
"color.success.solid.border": "{palette.green.700}",
|
|
56
|
+
"color.success.soft.bg": "{palette.green.950}",
|
|
57
|
+
"color.success.soft.fg": "{palette.green.300}",
|
|
58
|
+
"color.success.soft.border": "{palette.green.800}",
|
|
59
|
+
// Warning — Atlassian Orange300 text and solid, Orange1000 soft.
|
|
60
|
+
"color.warning.text": "#fbc828",
|
|
61
|
+
"color.warning.solid.bg": "#fbc828",
|
|
62
|
+
"color.warning.solid.fg": "#1f1f21",
|
|
63
|
+
"color.warning.solid.border": "#f68909",
|
|
64
|
+
"color.warning.soft.bg": "#3a2c1f",
|
|
65
|
+
"color.warning.soft.fg": "#fbc828",
|
|
66
|
+
"color.warning.soft.border": "#f68909",
|
|
67
|
+
// Danger
|
|
68
|
+
"color.danger.text": "{palette.red.400}",
|
|
69
|
+
"color.danger.solid.bg": "{palette.red.400}",
|
|
70
|
+
"color.danger.solid.fg": "{palette.slate.950}",
|
|
71
|
+
"color.danger.solid.border": "{palette.red.800}",
|
|
72
|
+
"color.danger.soft.bg": "{palette.red.950}",
|
|
73
|
+
"color.danger.soft.fg": "{palette.red.300}",
|
|
74
|
+
"color.danger.soft.border": "{palette.red.800}",
|
|
75
|
+
// Info
|
|
76
|
+
"color.info.text": "{palette.sky.400}",
|
|
77
|
+
"color.info.solid.bg": "{palette.sky.500}",
|
|
78
|
+
"color.info.solid.fg": "{palette.slate.950}",
|
|
79
|
+
"color.info.solid.border": "{palette.sky.800}",
|
|
80
|
+
"color.info.soft.bg": "{palette.sky.950}",
|
|
81
|
+
"color.info.soft.fg": "{palette.sky.300}",
|
|
82
|
+
"color.info.soft.border": "{palette.sky.800}"
|
|
99
83
|
};
|
|
100
84
|
//# sourceMappingURL=dark.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dark"],"sourceRoot":"../../../../src","sources":["theme/tokens/dark.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["dark"],"sourceRoot":"../../../../src","sources":["theme/tokens/dark.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAO,MAAMA,IAAI,GAAG;EAClB;EACA,sBAAsB,EAAE,SAAS;EACjC,uBAAuB,EAAE,SAAS;EAClC,sBAAsB,EAAE,SAAS;EACjC,sBAAsB,EAAE,SAAS;EAEjC;EACA,oBAAoB,EAAE,sBAAsB;EAC5C;EACA,sBAAsB,EAAE,SAAS;EACjC,qBAAqB,EAAE,SAAS;EAChC,qBAAqB,EAAE,SAAS;EAChC,oBAAoB,EAAE,uBAAuB;EAC7C,iBAAiB,EAAE,oBAAoB;EAEvC;EACA,qBAAqB,EAAE,uBAAuB;EAC9C,sBAAsB,EAAE,uBAAuB;EAC/C,qBAAqB,EAAE,uBAAuB;EAC9C,kBAAkB,EAAE,oBAAoB;EAExC;EACA,gBAAgB,EAAE,qBAAqB;EACvC,cAAc,EAAE,iBAAiB;EAEjC;EACA,mBAAmB,EAAE,uBAAuB;EAC5C,qBAAqB,EAAE,uBAAuB;EAE9C,uBAAuB,EAAE,uBAAuB;EAChD,6BAA6B,EAAE,uBAAuB;EACtD,+BAA+B,EAAE,uBAAuB;EACxD,gCAAgC,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