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
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure theme resolution — normalization, layer processing, derived values and
|
|
3
|
+
* theme creation. Shared by startup configuration, runtime accent changes and
|
|
4
|
+
* previews so every consumer sees the same colors for the same input.
|
|
5
|
+
*
|
|
6
|
+
* Precedence, identical for both schemes:
|
|
7
|
+
*
|
|
8
|
+
* default tokens → shared → schemes[scheme]
|
|
9
|
+
* → generated selected accent → selected accent explicit overrides
|
|
10
|
+
*
|
|
11
|
+
* This module must stay free of registry, provider, Unistyles and renderer
|
|
12
|
+
* imports so `createTerraThemes` works without any native configuration.
|
|
13
|
+
*/
|
|
14
|
+
import { type ContrastDiagnostic } from "../utils/accent-generator";
|
|
15
|
+
import { type ThemeSource } from "./theme.js";
|
|
16
|
+
import type { AccentSchemeInput, CreateTerraThemesOptions, ElevationKey, Scheme, TerraTheme, TerraThemeInput, TerraThemeOverride, ThemeColor } from "./types.js";
|
|
17
|
+
/**
|
|
18
|
+
* A theme mid-resolution: its source form plus provenance for every elevation
|
|
19
|
+
* level whose `shadowColor` a layer pinned explicitly. Default shadow colors are
|
|
20
|
+
* derived, never pinned, so a later `color.shadow` override still moves them.
|
|
21
|
+
*/
|
|
22
|
+
export interface ThemeLayerState {
|
|
23
|
+
readonly source: ThemeSource;
|
|
24
|
+
readonly pinnedShadowColors: Readonly<Partial<Record<ElevationKey, string>>>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Applies one override layer onto `state` and returns the next state. Every
|
|
28
|
+
* layer — shared, scheme, generated accent, accent overrides, or a full accent
|
|
29
|
+
* patch — goes through here, so they all follow the same rules:
|
|
30
|
+
* - deprecated names are normalized within the layer (canonical wins);
|
|
31
|
+
* - `undefined`/`null` leaves are no override; arrays replace; objects merge;
|
|
32
|
+
* - `spacing.base` / `radius.base` regenerate their scale, then that layer's
|
|
33
|
+
* explicit steps win over the regenerated values;
|
|
34
|
+
* - `elevation.<level>.shadowColor` pins that level (a later pin replaces an
|
|
35
|
+
* earlier one); other elevation fields merge normally.
|
|
36
|
+
* Inputs are never mutated.
|
|
37
|
+
*/
|
|
38
|
+
export declare function applyThemeLayer(state: ThemeLayerState, override?: TerraThemeOverride): ThemeLayerState;
|
|
39
|
+
export type NormalizedAccentScheme = {
|
|
40
|
+
readonly kind: "none";
|
|
41
|
+
} | {
|
|
42
|
+
readonly kind: "seed";
|
|
43
|
+
readonly seed: string;
|
|
44
|
+
readonly overrides?: Partial<ThemeColor>;
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: "patch";
|
|
47
|
+
readonly patch: TerraThemeOverride;
|
|
48
|
+
};
|
|
49
|
+
interface NormalizedAccentEntry {
|
|
50
|
+
readonly light: NormalizedAccentScheme;
|
|
51
|
+
readonly dark: NormalizedAccentScheme;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A validated, immutable theme configuration. `base` is the fully layered
|
|
55
|
+
* `defaults → shared → scheme` state per scheme; every accent selection is
|
|
56
|
+
* re-resolved from it rather than from a previously resolved accent.
|
|
57
|
+
*/
|
|
58
|
+
export interface NormalizedThemeConfig {
|
|
59
|
+
readonly accentNames: readonly string[];
|
|
60
|
+
readonly defaultAccent: string | null;
|
|
61
|
+
/** @internal Immutable `defaults → shared → scheme` state per scheme. */
|
|
62
|
+
readonly base: Readonly<Record<Scheme, ThemeLayerState>>;
|
|
63
|
+
/** @internal Per-accent, per-scheme normalized inputs. */
|
|
64
|
+
readonly accents: Readonly<Record<string, NormalizedAccentEntry>>;
|
|
65
|
+
}
|
|
66
|
+
export declare function normalizeAccentScheme(input: AccentSchemeInput | undefined, path: string): NormalizedAccentScheme;
|
|
67
|
+
/**
|
|
68
|
+
* Validates a theme input and pre-computes the immutable per-scheme base
|
|
69
|
+
* (`defaults → shared → scheme`). Throws {@link TerraConfigError} for invalid
|
|
70
|
+
* input — before any state exists to mutate. Never mutates `input` or the
|
|
71
|
+
* exported defaults.
|
|
72
|
+
*/
|
|
73
|
+
export declare function normalizeThemeInput(input?: TerraThemeInput): NormalizedThemeConfig;
|
|
74
|
+
export interface ResolvedThemes {
|
|
75
|
+
themes: Record<Scheme, TerraTheme>;
|
|
76
|
+
/** Final-colour contrast pairs that fail or cannot be evaluated, across both schemes. */
|
|
77
|
+
diagnostics: ContrastDiagnostic[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Resolves both schemes for `accent` from the config's immutable base. `null`
|
|
81
|
+
* selects the base themes; an unknown name throws {@link TerraConfigError}.
|
|
82
|
+
* Returned themes are freshly built and independently owned.
|
|
83
|
+
*/
|
|
84
|
+
export declare function resolveThemes(config: NormalizedThemeConfig, accent: string | null): ResolvedThemes;
|
|
85
|
+
/** Resolves one scheme without generating and finalizing the other. */
|
|
86
|
+
export declare function resolveThemeScheme(config: NormalizedThemeConfig, scheme: Scheme, accent: string | null): {
|
|
87
|
+
theme: TerraTheme;
|
|
88
|
+
diagnostics: ContrastDiagnostic[];
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Pure theme creation — no Unistyles configuration or registry involved.
|
|
92
|
+
* `options.accent` omitted → the input's `defaultAccent`; `null` → the base
|
|
93
|
+
* themes. Invalid input and unknown accents throw {@link TerraConfigError}.
|
|
94
|
+
* In development, contrast diagnostics are reported once each via
|
|
95
|
+
* `console.warn`; requested colors are never altered.
|
|
96
|
+
*/
|
|
97
|
+
export declare function createTerraThemes(input?: TerraThemeInput, options?: CreateTerraThemesOptions): Record<Scheme, TerraTheme>;
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=resolve-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../../../src/theme/resolve-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAGL,KAAK,kBAAkB,EAMxB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,YAAS,CAAC;AACjB,OAAO,KAAK,EAEV,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,MAAM,EACN,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,UAAU,EACX,MAAM,YAAS,CAAC;AAajB;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CAC9E;AAsBD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,CAAC,EAAE,kBAAkB,GAAG,eAAe,CAuCtG;AAID,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;CAAE,GAC1F;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAEnE,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;CACvC;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;IACzD,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC;CACnE;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,IAAI,EAAE,MAAM,GACX,sBAAsB,CAoDxB;AAmBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,GAAE,eAAoB,GAAG,qBAAqB,CAyCtF;AAID,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,yFAAyF;IACzF,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC;AA+DD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,CAYlG;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAG1D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAQ5B"}
|
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
import type { Scheme } from "./types.js";
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import type { Scheme, ThemeMode } from "./types.js";
|
|
2
|
+
export type { ThemeSelection } from "./selection-store.js";
|
|
3
|
+
export { getThemeSelection, subscribeThemeSelection } from "./selection-store.js";
|
|
4
|
+
/**
|
|
5
|
+
* Apply a registered accent (`null` restores the base themes) by updating both
|
|
6
|
+
* registered themes. An unknown name warns in development and changes nothing.
|
|
7
|
+
*
|
|
8
|
+
* If the native update fails part-way (see `updateThemes` in the adapter), the
|
|
9
|
+
* error propagates and the previous selection stays published; calling
|
|
10
|
+
* `applyAccent(getCurrentAccent() ?? null)` rewrites both themes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function applyAccent(name: string | null): void;
|
|
13
|
+
/** The applied accent name, or `undefined` for the base themes. */
|
|
4
14
|
export declare const getCurrentAccent: () => string | undefined;
|
|
5
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Choose how the active scheme is selected: `system` follows the OS appearance;
|
|
17
|
+
* `light` / `dark` pin a scheme until the next call.
|
|
18
|
+
*/
|
|
19
|
+
export declare function setThemeMode(mode: ThemeMode): void;
|
|
20
|
+
/** The current theme mode. A system appearance change does not change it. */
|
|
21
|
+
export declare const getThemeMode: () => ThemeMode;
|
|
22
|
+
/**
|
|
23
|
+
* Pin the active color scheme, disabling adaptive (system) theming.
|
|
24
|
+
* Compatibility wrapper for `setThemeMode(scheme)`; use `setThemeMode("system")`
|
|
25
|
+
* to return to the OS preference.
|
|
26
|
+
*/
|
|
6
27
|
export declare function applyScheme(scheme: Scheme): void;
|
|
7
28
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/theme/runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/theme/runtime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAGjD,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAmB,CAAC;AAE/E;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAarD;AAED,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,QAAO,MAAM,GAAG,SAAuC,CAAC;AAErF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAGlD;AAED,6EAA6E;AAC7E,eAAO,MAAM,YAAY,QAAO,SAAqC,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Resolves both axes of `theme.layout.screen.margin` for the current runtime
|
|
9
|
-
* breakpoint in one call — nearly every consumer needs both axes, so this
|
|
10
|
-
* saves calling `resolveBreakpointValue` twice. Call inside a
|
|
11
|
-
* `StyleSheet.create` factory (passing `rt.breakpoint`) so the result stays
|
|
12
|
-
* reactive to breakpoint changes; outside one, use {@link useScreenMargin}.
|
|
13
|
-
*/
|
|
14
|
-
export declare function resolveScreenMargin(theme: TerraTheme, breakpoint: keyof UnistylesBreakpoints | undefined): ResolvedScreenMargin;
|
|
1
|
+
import type { ResolvedScreenPadding } from "./screen-padding.js";
|
|
2
|
+
import { resolveScreenPadding } from "./screen-padding.js";
|
|
3
|
+
/** @deprecated Use ResolvedScreenPadding. */
|
|
4
|
+
export type ResolvedScreenMargin = ResolvedScreenPadding;
|
|
5
|
+
/** @deprecated Use resolveScreenPadding. */
|
|
6
|
+
export declare const resolveScreenMargin: typeof resolveScreenPadding;
|
|
15
7
|
//# sourceMappingURL=screen-margin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-margin.d.ts","sourceRoot":"","sources":["../../../../src/theme/screen-margin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"screen-margin.d.ts","sourceRoot":"","sources":["../../../../src/theme/screen-margin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAkB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAkB,CAAC;AAExD,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AACzD,4CAA4C;AAC5C,eAAO,MAAM,mBAAmB,6BAAuB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { UnistylesBreakpoints } from "react-native-unistyles";
|
|
2
|
+
import type { TerraTheme } from "./types.js";
|
|
3
|
+
export interface ResolvedScreenPadding {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolves both axes of `theme.layout.screen.padding` for the current runtime
|
|
9
|
+
* breakpoint in one call — nearly every consumer needs both axes, so this
|
|
10
|
+
* saves calling `resolveBreakpointValue` twice. Call inside a
|
|
11
|
+
* `StyleSheet.create` factory (passing `rt.breakpoint`) so the result stays
|
|
12
|
+
* reactive to breakpoint changes; outside one, use {@link useScreenPadding}.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveScreenPadding(theme: TerraTheme, breakpoint: keyof UnistylesBreakpoints | undefined): ResolvedScreenPadding;
|
|
15
|
+
//# sourceMappingURL=screen-padding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-padding.d.ts","sourceRoot":"","sources":["../../../../src/theme/screen-padding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAE1C,MAAM,WAAW,qBAAqB;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,MAAM,oBAAoB,GAAG,SAAS,GACjD,qBAAqB,CAKvB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal runtime state shared by `registry.ts` (installation) and
|
|
3
|
+
* `runtime.ts` (selection commands). Lives in its own module so neither of
|
|
4
|
+
* those has to import the other.
|
|
5
|
+
*
|
|
6
|
+
* Holds two things, both private to `theme/`:
|
|
7
|
+
* - the installed {@link NormalizedThemeConfig} — immutable; every accent
|
|
8
|
+
* selection is re-resolved from it, never layered on a previous result;
|
|
9
|
+
* - the selection snapshot (`accent`, `mode`) behind a `useSyncExternalStore`
|
|
10
|
+
* compatible subscribe/get pair. The snapshot object keeps its identity until
|
|
11
|
+
* a value actually changes, so subscribers only re-render on real changes.
|
|
12
|
+
*
|
|
13
|
+
* Nothing here touches Unistyles. Callers publish *after* native work succeeds.
|
|
14
|
+
*/
|
|
15
|
+
import { type NormalizedThemeConfig } from "./resolve-config.js";
|
|
16
|
+
import type { ThemeMode } from "./types.js";
|
|
17
|
+
/** @internal Read-only handle on the installed config. */
|
|
18
|
+
export declare const getInstalledConfig: () => NormalizedThemeConfig;
|
|
19
|
+
/** @internal Replaces the installed config; only `registry.ts` should call this. */
|
|
20
|
+
export declare function setInstalledConfig(config: NormalizedThemeConfig): void;
|
|
21
|
+
/** The current runtime selection: which accent is applied and how the scheme is chosen. */
|
|
22
|
+
export interface ThemeSelection {
|
|
23
|
+
/** Applied accent name, or `undefined` for the base themes. */
|
|
24
|
+
readonly accent: string | undefined;
|
|
25
|
+
/** `system` follows the OS appearance; `light` / `dark` pin a scheme. */
|
|
26
|
+
readonly mode: ThemeMode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Current selection snapshot. Stable identity: the same object is returned
|
|
30
|
+
* until {@link publishThemeSelection} commits a real change, which makes it a
|
|
31
|
+
* valid `getSnapshot` for `useSyncExternalStore`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getThemeSelection: () => ThemeSelection;
|
|
34
|
+
/** Subscribe to selection changes. Returns the unsubscribe function. */
|
|
35
|
+
export declare function subscribeThemeSelection(listener: () => void): () => void;
|
|
36
|
+
/**
|
|
37
|
+
* @internal Commits a (partial) selection change and notifies subscribers.
|
|
38
|
+
* A no-op — same snapshot identity, no notification — when nothing changed.
|
|
39
|
+
*/
|
|
40
|
+
export declare function publishThemeSelection(next: Partial<ThemeSelection>): void;
|
|
41
|
+
//# sourceMappingURL=selection-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-store.d.ts","sourceRoot":"","sources":["../../../../src/theme/selection-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,qBAAqB,EAAuB,MAAM,qBAAkB,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAUzC,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,QAAO,qBAAwC,CAAC;AAE/E,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAEtE;AAID,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAMD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAO,cAA2B,CAAC;AAEjE,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAKxE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CASzE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RadiusKey, SpacingKey, TerraTheme } from "./types.js";
|
|
1
|
+
import type { CanonicalThemeColor, ElevationKey, ElevationScale, ElevationStyle, LayoutTokens, OpacityTokens, RadiusKey, Scheme, ScreenPaddingTokens, SpacingKey, TerraColorRegistry, TerraTheme, Typography } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Default base corner radius (dp) — the `lg` (×1) step — taken from the
|
|
4
4
|
* `radius.base` primitive. The rest of the scale is derived from it via
|
|
@@ -37,6 +37,59 @@ export declare const RADIUS_MULTIPLIERS: Record<Exclude<RadiusKey, "none" | "ful
|
|
|
37
37
|
* their exact (possibly fractional) dp; `none`/`full` are constant.
|
|
38
38
|
*/
|
|
39
39
|
export declare function buildRadiusScale(base?: number): Record<RadiusKey, number>;
|
|
40
|
+
/** Elevation levels as authored: everything except the per-scheme `shadowColor`. */
|
|
41
|
+
export type ThemeSourceElevation = Record<ElevationKey, Omit<ElevationStyle, "shadowColor">>;
|
|
42
|
+
/**
|
|
43
|
+
* The pre-finalization ("source") form of a theme — what the resolver layers
|
|
44
|
+
* overrides onto. It differs from {@link TerraTheme} only in what is DERIVED at
|
|
45
|
+
* the final boundary instead of authored:
|
|
46
|
+
* - `color` holds canonical (and app-declared custom) keys only; deprecated
|
|
47
|
+
* aliases are materialized by {@link finalizeThemeSource}.
|
|
48
|
+
* - `elevation` levels carry no `shadowColor`; it is derived from `color.shadow`
|
|
49
|
+
* (unless explicitly pinned) at finalization.
|
|
50
|
+
* - `layout.screen` has no `margin` alias; it mirrors `padding` at finalization.
|
|
51
|
+
*/
|
|
52
|
+
export interface ThemeSource {
|
|
53
|
+
color: CanonicalThemeColor & TerraColorRegistry;
|
|
54
|
+
spacing: Record<SpacingKey, number>;
|
|
55
|
+
radius: Record<RadiusKey, number>;
|
|
56
|
+
typography: Typography;
|
|
57
|
+
elevation: ThemeSourceElevation;
|
|
58
|
+
opacity: OpacityTokens;
|
|
59
|
+
layout: {
|
|
60
|
+
screen: {
|
|
61
|
+
padding: ScreenPaddingTokens;
|
|
62
|
+
};
|
|
63
|
+
header: LayoutTokens["header"];
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Structural deep clone for token data (plain objects, arrays and primitives —
|
|
68
|
+
* the theme never carries functions or class instances). Used so every source
|
|
69
|
+
* and every finalized theme is independently owned.
|
|
70
|
+
*/
|
|
71
|
+
export declare function cloneTokenTree<T>(value: T): T;
|
|
72
|
+
/**
|
|
73
|
+
* Builds the built-in default theme for `scheme` in its source form (see
|
|
74
|
+
* {@link ThemeSource}). Returns a FRESH object on every call, so callers may
|
|
75
|
+
* layer onto or mutate it without affecting the exported defaults or later
|
|
76
|
+
* calls. This is the immutable starting point of the resolution pipeline:
|
|
77
|
+
* `defaults → shared → scheme → accent`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function createDefaultThemeSource(scheme: Scheme): ThemeSource;
|
|
80
|
+
/**
|
|
81
|
+
* Resolves each elevation level's `shadowColor`: an explicitly pinned
|
|
82
|
+
* per-level color wins, otherwise the theme's `color.shadow` token is used —
|
|
83
|
+
* rather than authoring it redundantly on every level in `light.ts` / `dark.ts`.
|
|
84
|
+
*/
|
|
85
|
+
export declare function resolveElevationScale(elevation: ThemeSourceElevation, shadowColor: string, pinnedShadowColors?: Partial<Record<ElevationKey, string>>): ElevationScale;
|
|
86
|
+
/**
|
|
87
|
+
* Turns a {@link ThemeSource} into a complete, independently owned
|
|
88
|
+
* {@link TerraTheme}: derives elevation shadow colors (honouring pinned levels)
|
|
89
|
+
* and materializes every compatibility alias. Neither `source` nor the returned
|
|
90
|
+
* theme share object references with each other.
|
|
91
|
+
*/
|
|
92
|
+
export declare function finalizeThemeSource(source: ThemeSource, pinnedShadowColors?: Partial<Record<ElevationKey, string>>): TerraTheme;
|
|
40
93
|
export declare const defaultLightTheme: TerraTheme;
|
|
41
94
|
export declare const defaultDarkTheme: TerraTheme;
|
|
42
95
|
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/theme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,MAAM,EACN,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,UAAU,EACX,MAAM,YAAS,CAAC;AA+FjB;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAmB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,EAkBpC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAoB,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAA6B,GAAG,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAMjG;AAID;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,MAAM,CAQlF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAA4B,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAM9F;AAOD,oFAAoF;AACpF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;AAE7F;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;IAChD,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAClC,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,oBAAoB,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE;QACN,MAAM,EAAE;YAAE,OAAO,EAAE,mBAAmB,CAAA;SAAE,CAAC;QACzC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;KAChC,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAY7C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAWpE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,oBAAoB,EAC/B,WAAW,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,GACzD,cAAc,CAMhB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,GACzD,UAAU,CAWZ;AAED,eAAO,MAAM,iBAAiB,EAAE,UAAmE,CAAC;AAEpG,eAAO,MAAM,gBAAgB,EAAE,UAAkE,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime list of the built-in canonical colour keys.
|
|
3
|
+
*
|
|
4
|
+
* `CanonicalThemeColor` (types.ts) is the authoritative schema, but it is a
|
|
5
|
+
* type and cannot be iterated at runtime. This object mirrors it key-for-key
|
|
6
|
+
* so the raw-data validator can check `light.ts` / `dark.ts` against the real
|
|
7
|
+
* schema instead of a hand-maintained regex. The `satisfies` clause makes the
|
|
8
|
+
* mirror self-checking: a key missing here fails on the `Record<…>`
|
|
9
|
+
* requirement, and a key that is not in `CanonicalThemeColor` fails the
|
|
10
|
+
* excess-property check.
|
|
11
|
+
*
|
|
12
|
+
* Type-only import — this file stays free of runtime imports like the other
|
|
13
|
+
* token data.
|
|
14
|
+
*/
|
|
15
|
+
import type { CanonicalThemeColor } from "../types.js";
|
|
16
|
+
declare const CANONICAL_COLOR_KEY_MAP: {
|
|
17
|
+
readonly "surface.canvas": true;
|
|
18
|
+
readonly "surface.default": true;
|
|
19
|
+
readonly "surface.raised": true;
|
|
20
|
+
readonly "surface.sunken": true;
|
|
21
|
+
readonly "text.primary": true;
|
|
22
|
+
readonly "text.secondary": true;
|
|
23
|
+
readonly "text.tertiary": true;
|
|
24
|
+
readonly "text.disabled": true;
|
|
25
|
+
readonly "text.inverse": true;
|
|
26
|
+
readonly "text.link": true;
|
|
27
|
+
readonly "border.subtle": true;
|
|
28
|
+
readonly "border.default": true;
|
|
29
|
+
readonly "border.strong": true;
|
|
30
|
+
readonly "focus.ring": true;
|
|
31
|
+
readonly backdrop: true;
|
|
32
|
+
readonly shadow: true;
|
|
33
|
+
readonly "accent.text": true;
|
|
34
|
+
readonly "accent.border": true;
|
|
35
|
+
readonly "accent.solid.bg": true;
|
|
36
|
+
readonly "accent.solid.bg.hover": true;
|
|
37
|
+
readonly "accent.solid.bg.pressed": true;
|
|
38
|
+
readonly "accent.solid.bg.disabled": true;
|
|
39
|
+
readonly "accent.solid.fg": true;
|
|
40
|
+
readonly "accent.soft.bg": true;
|
|
41
|
+
readonly "accent.soft.bg.hover": true;
|
|
42
|
+
readonly "accent.soft.bg.pressed": true;
|
|
43
|
+
readonly "accent.soft.bg.disabled": true;
|
|
44
|
+
readonly "accent.soft.fg": true;
|
|
45
|
+
readonly "neutral.solid.bg": true;
|
|
46
|
+
readonly "neutral.solid.fg": true;
|
|
47
|
+
readonly "neutral.soft.bg": true;
|
|
48
|
+
readonly "neutral.soft.bg.hover": true;
|
|
49
|
+
readonly "neutral.soft.bg.pressed": true;
|
|
50
|
+
readonly "neutral.soft.bg.disabled": true;
|
|
51
|
+
readonly "neutral.soft.fg": true;
|
|
52
|
+
readonly "success.text": true;
|
|
53
|
+
readonly "success.solid.bg": true;
|
|
54
|
+
readonly "success.solid.fg": true;
|
|
55
|
+
readonly "success.solid.border": true;
|
|
56
|
+
readonly "success.soft.bg": true;
|
|
57
|
+
readonly "success.soft.fg": true;
|
|
58
|
+
readonly "success.soft.border": true;
|
|
59
|
+
readonly "warning.text": true;
|
|
60
|
+
readonly "warning.solid.bg": true;
|
|
61
|
+
readonly "warning.solid.fg": true;
|
|
62
|
+
readonly "warning.solid.border": true;
|
|
63
|
+
readonly "warning.soft.bg": true;
|
|
64
|
+
readonly "warning.soft.fg": true;
|
|
65
|
+
readonly "warning.soft.border": true;
|
|
66
|
+
readonly "danger.text": true;
|
|
67
|
+
readonly "danger.solid.bg": true;
|
|
68
|
+
readonly "danger.solid.fg": true;
|
|
69
|
+
readonly "danger.solid.border": true;
|
|
70
|
+
readonly "danger.soft.bg": true;
|
|
71
|
+
readonly "danger.soft.fg": true;
|
|
72
|
+
readonly "danger.soft.border": true;
|
|
73
|
+
readonly "info.text": true;
|
|
74
|
+
readonly "info.solid.bg": true;
|
|
75
|
+
readonly "info.solid.fg": true;
|
|
76
|
+
readonly "info.solid.border": true;
|
|
77
|
+
readonly "info.soft.bg": true;
|
|
78
|
+
readonly "info.soft.fg": true;
|
|
79
|
+
readonly "info.soft.border": true;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Every built-in canonical colour key (without the `color.` category prefix
|
|
83
|
+
* used by the raw token files). Exhaustive and extra-free by construction —
|
|
84
|
+
* see {@link CANONICAL_COLOR_KEY_MAP}.
|
|
85
|
+
*/
|
|
86
|
+
export declare const CANONICAL_COLOR_KEYS: readonly (keyof CanonicalThemeColor)[];
|
|
87
|
+
/** Type-level guard that the map's literal keys and the schema's keys are the same set. */
|
|
88
|
+
type MissingCanonicalKey = Exclude<keyof CanonicalThemeColor, keyof typeof CANONICAL_COLOR_KEY_MAP>;
|
|
89
|
+
type ExtraCanonicalKey = Exclude<keyof typeof CANONICAL_COLOR_KEY_MAP, keyof CanonicalThemeColor>;
|
|
90
|
+
export type CanonicalColorKeysAreExhaustive = [MissingCanonicalKey, ExtraCanonicalKey] extends [never, never] ? true : {
|
|
91
|
+
missing: MissingCanonicalKey;
|
|
92
|
+
extra: ExtraCanonicalKey;
|
|
93
|
+
};
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=canonical-color-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical-color-keys.d.ts","sourceRoot":"","sources":["../../../../../src/theme/tokens/canonical-color-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAU,CAAC;AAEpD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0E+B,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,MAAM,mBAAmB,CAAC,EAErC,CAAC;AAEnC,2FAA2F;AAC3F,KAAK,mBAAmB,GAAG,OAAO,CAAC,MAAM,mBAAmB,EAAE,MAAM,OAAO,uBAAuB,CAAC,CAAC;AACpG,KAAK,iBAAiB,GAAG,OAAO,CAAC,MAAM,OAAO,uBAAuB,EAAE,MAAM,mBAAmB,CAAC,CAAC;AAClG,MAAM,MAAM,+BAA+B,GAAG,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GACzG,IAAI,GACJ;IAAE,OAAO,EAAE,mBAAmB,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,CAAC"}
|
|
@@ -1,77 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dark
|
|
3
|
-
*
|
|
4
|
-
* Convention: [category].[context].[property?].[variant].[state]
|
|
5
|
-
*
|
|
6
|
-
* GENERATED-STYLE SOURCE: intended to be replaced by the Figma / design-sync export.
|
|
2
|
+
* Dark semantic colors. See docs/design-tokens.md for naming and references.
|
|
3
|
+
* Generated-style source; naming and contrast updates await the next design-sync export.
|
|
7
4
|
*/
|
|
8
5
|
export declare const dark: {
|
|
9
|
-
"color.
|
|
10
|
-
"color.shadow": string;
|
|
6
|
+
"color.surface.canvas": string;
|
|
11
7
|
"color.surface.default": string;
|
|
12
8
|
"color.surface.raised": string;
|
|
13
9
|
"color.surface.sunken": string;
|
|
14
|
-
"color.
|
|
15
|
-
"color.
|
|
16
|
-
"color.
|
|
17
|
-
"color.text.default": string;
|
|
18
|
-
"color.text.muted": string;
|
|
19
|
-
"color.text.subtle": string;
|
|
10
|
+
"color.text.primary": string;
|
|
11
|
+
"color.text.secondary": string;
|
|
12
|
+
"color.text.tertiary": string;
|
|
20
13
|
"color.text.disabled": string;
|
|
21
14
|
"color.text.inverse": string;
|
|
22
15
|
"color.text.link": string;
|
|
23
|
-
"color.text.accent": string;
|
|
24
|
-
"color.text.on-accent": string;
|
|
25
|
-
"color.text.on-accent-subtle": string;
|
|
26
16
|
"color.border.subtle": string;
|
|
27
17
|
"color.border.default": string;
|
|
28
18
|
"color.border.strong": string;
|
|
29
|
-
"color.
|
|
30
|
-
"color.
|
|
31
|
-
"color.
|
|
32
|
-
"color.
|
|
33
|
-
"color.
|
|
34
|
-
"color.
|
|
35
|
-
"color.
|
|
36
|
-
"color.
|
|
37
|
-
"color.
|
|
38
|
-
"color.
|
|
39
|
-
"color.
|
|
40
|
-
"color.
|
|
41
|
-
"color.
|
|
42
|
-
"color.
|
|
43
|
-
"color.
|
|
44
|
-
"color.
|
|
45
|
-
"color.
|
|
46
|
-
"color.
|
|
47
|
-
"color.
|
|
48
|
-
"color.
|
|
49
|
-
"color.
|
|
50
|
-
"color.
|
|
51
|
-
"color.
|
|
52
|
-
"color.
|
|
53
|
-
"color.
|
|
54
|
-
"color.
|
|
55
|
-
"color.
|
|
56
|
-
"color.
|
|
57
|
-
"color.
|
|
58
|
-
"color.
|
|
59
|
-
"color.
|
|
60
|
-
"color.
|
|
61
|
-
"color.
|
|
62
|
-
"color.
|
|
63
|
-
"color.
|
|
64
|
-
"color.
|
|
65
|
-
"color.
|
|
66
|
-
"color.
|
|
67
|
-
"color.
|
|
68
|
-
"color.
|
|
69
|
-
"color.
|
|
70
|
-
"color.
|
|
71
|
-
"color.
|
|
72
|
-
"color.
|
|
73
|
-
"color.
|
|
74
|
-
"color.
|
|
75
|
-
"color.
|
|
19
|
+
"color.focus.ring": string;
|
|
20
|
+
"color.backdrop": string;
|
|
21
|
+
"color.shadow": string;
|
|
22
|
+
"color.accent.text": string;
|
|
23
|
+
"color.accent.border": string;
|
|
24
|
+
"color.accent.solid.bg": string;
|
|
25
|
+
"color.accent.solid.bg.hover": string;
|
|
26
|
+
"color.accent.solid.bg.pressed": string;
|
|
27
|
+
"color.accent.solid.bg.disabled": string;
|
|
28
|
+
"color.accent.solid.fg": string;
|
|
29
|
+
"color.accent.soft.bg": string;
|
|
30
|
+
"color.accent.soft.bg.hover": string;
|
|
31
|
+
"color.accent.soft.bg.pressed": string;
|
|
32
|
+
"color.accent.soft.bg.disabled": string;
|
|
33
|
+
"color.accent.soft.fg": string;
|
|
34
|
+
"color.neutral.solid.bg": string;
|
|
35
|
+
"color.neutral.solid.fg": string;
|
|
36
|
+
"color.neutral.soft.bg": string;
|
|
37
|
+
"color.neutral.soft.bg.hover": string;
|
|
38
|
+
"color.neutral.soft.bg.pressed": string;
|
|
39
|
+
"color.neutral.soft.bg.disabled": string;
|
|
40
|
+
"color.neutral.soft.fg": string;
|
|
41
|
+
"color.success.text": string;
|
|
42
|
+
"color.success.solid.bg": string;
|
|
43
|
+
"color.success.solid.fg": string;
|
|
44
|
+
"color.success.solid.border": string;
|
|
45
|
+
"color.success.soft.bg": string;
|
|
46
|
+
"color.success.soft.fg": string;
|
|
47
|
+
"color.success.soft.border": string;
|
|
48
|
+
"color.warning.text": string;
|
|
49
|
+
"color.warning.solid.bg": string;
|
|
50
|
+
"color.warning.solid.fg": string;
|
|
51
|
+
"color.warning.solid.border": string;
|
|
52
|
+
"color.warning.soft.bg": string;
|
|
53
|
+
"color.warning.soft.fg": string;
|
|
54
|
+
"color.warning.soft.border": string;
|
|
55
|
+
"color.danger.text": string;
|
|
56
|
+
"color.danger.solid.bg": string;
|
|
57
|
+
"color.danger.solid.fg": string;
|
|
58
|
+
"color.danger.solid.border": string;
|
|
59
|
+
"color.danger.soft.bg": string;
|
|
60
|
+
"color.danger.soft.fg": string;
|
|
61
|
+
"color.danger.soft.border": string;
|
|
62
|
+
"color.info.text": string;
|
|
63
|
+
"color.info.solid.bg": string;
|
|
64
|
+
"color.info.solid.fg": string;
|
|
65
|
+
"color.info.solid.border": string;
|
|
66
|
+
"color.info.soft.bg": string;
|
|
67
|
+
"color.info.soft.fg": string;
|
|
68
|
+
"color.info.soft.border": string;
|
|
76
69
|
};
|
|
77
70
|
//# sourceMappingURL=dark.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../../../src/theme/tokens/dark.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../../../src/theme/tokens/dark.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGhB,CAAC"}
|