@chipmobilesdk/rn-theme 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +111 -0
- package/README.md +3 -1
- package/lib/commonjs/color/categorical.js +35 -0
- package/lib/commonjs/color/categorical.js.map +1 -0
- package/lib/commonjs/color/contrast.js +199 -0
- package/lib/commonjs/color/contrast.js.map +1 -0
- package/lib/commonjs/color/parse.js +110 -0
- package/lib/commonjs/color/parse.js.map +1 -0
- package/lib/commonjs/color/roles.js +235 -0
- package/lib/commonjs/color/roles.js.map +1 -0
- package/lib/commonjs/index.js +94 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/integration/navigationTheme.js +43 -0
- package/lib/commonjs/integration/navigationTheme.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/presets/byTone.js +28 -0
- package/lib/commonjs/presets/byTone.js.map +1 -0
- package/lib/commonjs/presets/layout.js +67 -0
- package/lib/commonjs/presets/layout.js.map +1 -0
- package/lib/commonjs/presets/themePresets.js +115 -0
- package/lib/commonjs/presets/themePresets.js.map +1 -0
- package/lib/commonjs/theme/buildThemes.js +211 -0
- package/lib/commonjs/theme/buildThemes.js.map +1 -0
- package/lib/commonjs/theme/errors.js +49 -0
- package/lib/commonjs/theme/errors.js.map +1 -0
- package/lib/commonjs/theme/overrides.js +125 -0
- package/lib/commonjs/theme/overrides.js.map +1 -0
- package/lib/commonjs/theme/validateThemeConfig.js +157 -0
- package/lib/commonjs/theme/validateThemeConfig.js.map +1 -0
- package/lib/commonjs/tokens/defaults.js +132 -0
- package/lib/commonjs/tokens/defaults.js.map +1 -0
- package/lib/commonjs/tokens/typography.js +136 -0
- package/lib/commonjs/tokens/typography.js.map +1 -0
- package/lib/commonjs/types/brand.js +2 -0
- package/lib/commonjs/types/brand.js.map +1 -0
- package/lib/commonjs/types/colors.js +2 -0
- package/lib/commonjs/types/colors.js.map +1 -0
- package/lib/commonjs/types/index.js +2 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/theme.js +6 -0
- package/lib/commonjs/types/theme.js.map +1 -0
- package/lib/commonjs/types/tokens.js +2 -0
- package/lib/commonjs/types/tokens.js.map +1 -0
- package/lib/commonjs/types/typography.js +2 -0
- package/lib/commonjs/types/typography.js.map +1 -0
- package/lib/commonjs/unistyles/createUnistylesConfig.js +113 -0
- package/lib/commonjs/unistyles/createUnistylesConfig.js.map +1 -0
- package/lib/commonjs/unistyles/themeMode.js +39 -0
- package/lib/commonjs/unistyles/themeMode.js.map +1 -0
- package/lib/commonjs/vendor/mcu/LICENSE +191 -0
- package/lib/commonjs/vendor/mcu/hct/cam16.js +362 -0
- package/lib/commonjs/vendor/mcu/hct/cam16.js.map +1 -0
- package/lib/commonjs/vendor/mcu/hct/hct.js +183 -0
- package/lib/commonjs/vendor/mcu/hct/hct.js.map +1 -0
- package/lib/commonjs/vendor/mcu/hct/hct_solver.js +401 -0
- package/lib/commonjs/vendor/mcu/hct/hct_solver.js.map +1 -0
- package/lib/commonjs/vendor/mcu/hct/viewing_conditions.js +116 -0
- package/lib/commonjs/vendor/mcu/hct/viewing_conditions.js.map +1 -0
- package/lib/commonjs/vendor/mcu/index.js +27 -0
- package/lib/commonjs/vendor/mcu/index.js.map +1 -0
- package/lib/commonjs/vendor/mcu/palettes/tonal_palette.js +177 -0
- package/lib/commonjs/vendor/mcu/palettes/tonal_palette.js.map +1 -0
- package/lib/commonjs/vendor/mcu/utils/color_utils.js +298 -0
- package/lib/commonjs/vendor/mcu/utils/color_utils.js.map +1 -0
- package/lib/commonjs/vendor/mcu/utils/math_utils.js +158 -0
- package/lib/commonjs/vendor/mcu/utils/math_utils.js.map +1 -0
- package/lib/module/color/categorical.js +31 -0
- package/lib/module/color/categorical.js.map +1 -0
- package/lib/module/color/contrast.js +194 -0
- package/lib/module/color/contrast.js.map +1 -0
- package/lib/module/color/parse.js +101 -0
- package/lib/module/color/parse.js.map +1 -0
- package/lib/module/color/roles.js +229 -0
- package/lib/module/color/roles.js.map +1 -0
- package/lib/module/index.js +23 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/integration/navigationTheme.js +39 -0
- package/lib/module/integration/navigationTheme.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/presets/byTone.js +24 -0
- package/lib/module/presets/byTone.js.map +1 -0
- package/lib/module/presets/layout.js +63 -0
- package/lib/module/presets/layout.js.map +1 -0
- package/lib/module/presets/themePresets.js +110 -0
- package/lib/module/presets/themePresets.js.map +1 -0
- package/lib/module/theme/buildThemes.js +208 -0
- package/lib/module/theme/buildThemes.js.map +1 -0
- package/lib/module/theme/errors.js +43 -0
- package/lib/module/theme/errors.js.map +1 -0
- package/lib/module/theme/overrides.js +119 -0
- package/lib/module/theme/overrides.js.map +1 -0
- package/lib/module/theme/validateThemeConfig.js +152 -0
- package/lib/module/theme/validateThemeConfig.js.map +1 -0
- package/lib/module/tokens/defaults.js +120 -0
- package/lib/module/tokens/defaults.js.map +1 -0
- package/lib/module/tokens/typography.js +129 -0
- package/lib/module/tokens/typography.js.map +1 -0
- package/lib/module/types/brand.js +2 -0
- package/lib/module/types/brand.js.map +1 -0
- package/lib/module/types/colors.js +2 -0
- package/lib/module/types/colors.js.map +1 -0
- package/lib/module/types/index.js +2 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/theme.js +4 -0
- package/lib/module/types/theme.js.map +1 -0
- package/lib/module/types/tokens.js +2 -0
- package/lib/module/types/tokens.js.map +1 -0
- package/lib/module/types/typography.js +2 -0
- package/lib/module/types/typography.js.map +1 -0
- package/lib/module/unistyles/createUnistylesConfig.js +109 -0
- package/lib/module/unistyles/createUnistylesConfig.js.map +1 -0
- package/lib/module/unistyles/themeMode.js +36 -0
- package/lib/module/unistyles/themeMode.js.map +1 -0
- package/lib/module/vendor/mcu/LICENSE +191 -0
- package/lib/module/vendor/mcu/hct/cam16.js +356 -0
- package/lib/module/vendor/mcu/hct/cam16.js.map +1 -0
- package/lib/module/vendor/mcu/hct/hct.js +178 -0
- package/lib/module/vendor/mcu/hct/hct.js.map +1 -0
- package/lib/module/vendor/mcu/hct/hct_solver.js +396 -0
- package/lib/module/vendor/mcu/hct/hct_solver.js.map +1 -0
- package/lib/module/vendor/mcu/hct/viewing_conditions.js +110 -0
- package/lib/module/vendor/mcu/hct/viewing_conditions.js.map +1 -0
- package/lib/module/vendor/mcu/index.js +8 -0
- package/lib/module/vendor/mcu/index.js.map +1 -0
- package/lib/module/vendor/mcu/palettes/tonal_palette.js +172 -0
- package/lib/module/vendor/mcu/palettes/tonal_palette.js.map +1 -0
- package/lib/module/vendor/mcu/utils/color_utils.js +277 -0
- package/lib/module/vendor/mcu/utils/color_utils.js.map +1 -0
- package/lib/module/vendor/mcu/utils/math_utils.js +146 -0
- package/lib/module/vendor/mcu/utils/math_utils.js.map +1 -0
- package/lib/typescript/commonjs/color/categorical.d.ts +7 -0
- package/lib/typescript/commonjs/color/categorical.d.ts.map +1 -0
- package/lib/typescript/commonjs/color/contrast.d.ts +26 -0
- package/lib/typescript/commonjs/color/contrast.d.ts.map +1 -0
- package/lib/typescript/commonjs/color/parse.d.ts +25 -0
- package/lib/typescript/commonjs/color/parse.d.ts.map +1 -0
- package/lib/typescript/commonjs/color/roles.d.ts +26 -0
- package/lib/typescript/commonjs/color/roles.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +18 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/integration/navigationTheme.d.ts +30 -0
- package/lib/typescript/commonjs/integration/navigationTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/presets/byTone.d.ts +19 -0
- package/lib/typescript/commonjs/presets/byTone.d.ts.map +1 -0
- package/lib/typescript/commonjs/presets/layout.d.ts +63 -0
- package/lib/typescript/commonjs/presets/layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/presets/themePresets.d.ts +11 -0
- package/lib/typescript/commonjs/presets/themePresets.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/buildThemes.d.ts +18 -0
- package/lib/typescript/commonjs/theme/buildThemes.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/errors.d.ts +23 -0
- package/lib/typescript/commonjs/theme/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/overrides.d.ts +11 -0
- package/lib/typescript/commonjs/theme/overrides.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/validateThemeConfig.d.ts +6 -0
- package/lib/typescript/commonjs/theme/validateThemeConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/tokens/defaults.d.ts +23 -0
- package/lib/typescript/commonjs/tokens/defaults.d.ts.map +1 -0
- package/lib/typescript/commonjs/tokens/typography.d.ts +14 -0
- package/lib/typescript/commonjs/tokens/typography.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/brand.d.ts +21 -0
- package/lib/typescript/commonjs/types/brand.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/colors.d.ts +76 -0
- package/lib/typescript/commonjs/types/colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/index.d.ts +6 -0
- package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/theme.d.ts +140 -0
- package/lib/typescript/commonjs/types/theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/tokens.d.ts +79 -0
- package/lib/typescript/commonjs/types/tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/typography.d.ts +53 -0
- package/lib/typescript/commonjs/types/typography.d.ts.map +1 -0
- package/lib/typescript/commonjs/unistyles/createUnistylesConfig.d.ts +52 -0
- package/lib/typescript/commonjs/unistyles/createUnistylesConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/unistyles/themeMode.d.ts +13 -0
- package/lib/typescript/commonjs/unistyles/themeMode.d.ts.map +1 -0
- package/lib/typescript/commonjs/vendor/mcu/hct/cam16.d.ts +132 -0
- package/lib/typescript/commonjs/vendor/mcu/hct/cam16.d.ts.map +1 -0
- package/lib/typescript/commonjs/vendor/mcu/hct/hct.d.ts +93 -0
- package/lib/typescript/commonjs/vendor/mcu/hct/hct.d.ts.map +1 -0
- package/lib/typescript/commonjs/vendor/mcu/hct/hct_solver.d.ts +147 -0
- package/lib/typescript/commonjs/vendor/mcu/hct/hct_solver.d.ts.map +1 -0
- package/lib/typescript/commonjs/vendor/mcu/hct/viewing_conditions.d.ts +75 -0
- package/lib/typescript/commonjs/vendor/mcu/hct/viewing_conditions.d.ts.map +1 -0
- package/lib/typescript/commonjs/vendor/mcu/index.d.ts +4 -0
- package/lib/typescript/commonjs/vendor/mcu/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/vendor/mcu/palettes/tonal_palette.d.ts +56 -0
- package/lib/typescript/commonjs/vendor/mcu/palettes/tonal_palette.d.ts.map +1 -0
- package/lib/typescript/commonjs/vendor/mcu/utils/color_utils.d.ts +129 -0
- package/lib/typescript/commonjs/vendor/mcu/utils/color_utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/vendor/mcu/utils/math_utils.d.ts +83 -0
- package/lib/typescript/commonjs/vendor/mcu/utils/math_utils.d.ts.map +1 -0
- package/lib/typescript/module/color/categorical.d.ts +7 -0
- package/lib/typescript/module/color/categorical.d.ts.map +1 -0
- package/lib/typescript/module/color/contrast.d.ts +26 -0
- package/lib/typescript/module/color/contrast.d.ts.map +1 -0
- package/lib/typescript/module/color/parse.d.ts +25 -0
- package/lib/typescript/module/color/parse.d.ts.map +1 -0
- package/lib/typescript/module/color/roles.d.ts +26 -0
- package/lib/typescript/module/color/roles.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +18 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/integration/navigationTheme.d.ts +30 -0
- package/lib/typescript/module/integration/navigationTheme.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/presets/byTone.d.ts +19 -0
- package/lib/typescript/module/presets/byTone.d.ts.map +1 -0
- package/lib/typescript/module/presets/layout.d.ts +63 -0
- package/lib/typescript/module/presets/layout.d.ts.map +1 -0
- package/lib/typescript/module/presets/themePresets.d.ts +11 -0
- package/lib/typescript/module/presets/themePresets.d.ts.map +1 -0
- package/lib/typescript/module/theme/buildThemes.d.ts +18 -0
- package/lib/typescript/module/theme/buildThemes.d.ts.map +1 -0
- package/lib/typescript/module/theme/errors.d.ts +23 -0
- package/lib/typescript/module/theme/errors.d.ts.map +1 -0
- package/lib/typescript/module/theme/overrides.d.ts +11 -0
- package/lib/typescript/module/theme/overrides.d.ts.map +1 -0
- package/lib/typescript/module/theme/validateThemeConfig.d.ts +6 -0
- package/lib/typescript/module/theme/validateThemeConfig.d.ts.map +1 -0
- package/lib/typescript/module/tokens/defaults.d.ts +23 -0
- package/lib/typescript/module/tokens/defaults.d.ts.map +1 -0
- package/lib/typescript/module/tokens/typography.d.ts +14 -0
- package/lib/typescript/module/tokens/typography.d.ts.map +1 -0
- package/lib/typescript/module/types/brand.d.ts +21 -0
- package/lib/typescript/module/types/brand.d.ts.map +1 -0
- package/lib/typescript/module/types/colors.d.ts +76 -0
- package/lib/typescript/module/types/colors.d.ts.map +1 -0
- package/lib/typescript/module/types/index.d.ts +6 -0
- package/lib/typescript/module/types/index.d.ts.map +1 -0
- package/lib/typescript/module/types/theme.d.ts +140 -0
- package/lib/typescript/module/types/theme.d.ts.map +1 -0
- package/lib/typescript/module/types/tokens.d.ts +79 -0
- package/lib/typescript/module/types/tokens.d.ts.map +1 -0
- package/lib/typescript/module/types/typography.d.ts +53 -0
- package/lib/typescript/module/types/typography.d.ts.map +1 -0
- package/lib/typescript/module/unistyles/createUnistylesConfig.d.ts +52 -0
- package/lib/typescript/module/unistyles/createUnistylesConfig.d.ts.map +1 -0
- package/lib/typescript/module/unistyles/themeMode.d.ts +13 -0
- package/lib/typescript/module/unistyles/themeMode.d.ts.map +1 -0
- package/lib/typescript/module/vendor/mcu/hct/cam16.d.ts +132 -0
- package/lib/typescript/module/vendor/mcu/hct/cam16.d.ts.map +1 -0
- package/lib/typescript/module/vendor/mcu/hct/hct.d.ts +93 -0
- package/lib/typescript/module/vendor/mcu/hct/hct.d.ts.map +1 -0
- package/lib/typescript/module/vendor/mcu/hct/hct_solver.d.ts +147 -0
- package/lib/typescript/module/vendor/mcu/hct/hct_solver.d.ts.map +1 -0
- package/lib/typescript/module/vendor/mcu/hct/viewing_conditions.d.ts +75 -0
- package/lib/typescript/module/vendor/mcu/hct/viewing_conditions.d.ts.map +1 -0
- package/lib/typescript/module/vendor/mcu/index.d.ts +4 -0
- package/lib/typescript/module/vendor/mcu/index.d.ts.map +1 -0
- package/lib/typescript/module/vendor/mcu/palettes/tonal_palette.d.ts +56 -0
- package/lib/typescript/module/vendor/mcu/palettes/tonal_palette.d.ts.map +1 -0
- package/lib/typescript/module/vendor/mcu/utils/color_utils.d.ts +129 -0
- package/lib/typescript/module/vendor/mcu/utils/color_utils.d.ts.map +1 -0
- package/lib/typescript/module/vendor/mcu/utils/math_utils.d.ts +83 -0
- package/lib/typescript/module/vendor/mcu/utils/math_utils.d.ts.map +1 -0
- package/package.json +40 -16
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Hct, TonalPalette } from "../vendor/mcu/index.js";
|
|
4
|
+
import { DEFAULT_OPACITY } from "../tokens/defaults.js";
|
|
5
|
+
import { argbFromColor, hexFromArgb, withAlpha } from "./parse.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 0.2.x light semantic colours, kept as default seeds so their hues carry over.
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_SEEDS = {
|
|
11
|
+
error: '#B3261E',
|
|
12
|
+
success: '#2E7D32',
|
|
13
|
+
warning: '#E65100',
|
|
14
|
+
info: '#0277BD'
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Neutral chroma when no neutral seed is given (Material 3 uses 4–8). */
|
|
18
|
+
const NEUTRAL_CHROMA = 4;
|
|
19
|
+
const NEUTRAL_VARIANT_CHROMA = 8;
|
|
20
|
+
/** Upper bound for a supplied neutral seed, so surfaces never turn into a brand colour. */
|
|
21
|
+
const MAX_NEUTRAL_SEED_CHROMA = 16;
|
|
22
|
+
const NEUTRAL_VARIANT_EXTRA_CHROMA = 4;
|
|
23
|
+
|
|
24
|
+
/** Material 3 opacities applied to `onSurface` and the scrim. */
|
|
25
|
+
/** The same figure as `opacity.disabledContent`, from its one definition (THM-07). */
|
|
26
|
+
export const DISABLED_CONTENT_OPACITY = DEFAULT_OPACITY.disabledContent;
|
|
27
|
+
const SCRIM_OPACITY = 0.32;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Tones per role (plan D-3). Contrast depends only on tone, so these pairs
|
|
31
|
+
* hold for every hue and chroma.
|
|
32
|
+
*/
|
|
33
|
+
const TONES = {
|
|
34
|
+
light: {
|
|
35
|
+
role: 40,
|
|
36
|
+
onRole: 100,
|
|
37
|
+
container: 90,
|
|
38
|
+
onContainer: 10,
|
|
39
|
+
toneBorder: 50,
|
|
40
|
+
background: 98,
|
|
41
|
+
onBackground: 10,
|
|
42
|
+
surfaceVariant: 90,
|
|
43
|
+
onSurfaceVariant: 30,
|
|
44
|
+
surfaceContainerLowest: 100,
|
|
45
|
+
surfaceContainerLow: 96,
|
|
46
|
+
surfaceContainer: 94,
|
|
47
|
+
surfaceContainerHigh: 92,
|
|
48
|
+
surfaceContainerHighest: 90,
|
|
49
|
+
inverseSurface: 20,
|
|
50
|
+
inverseOnSurface: 95,
|
|
51
|
+
inversePrimary: 80,
|
|
52
|
+
outline: 50,
|
|
53
|
+
outlineVariant: 80
|
|
54
|
+
},
|
|
55
|
+
dark: {
|
|
56
|
+
role: 80,
|
|
57
|
+
onRole: 20,
|
|
58
|
+
container: 30,
|
|
59
|
+
onContainer: 90,
|
|
60
|
+
toneBorder: 60,
|
|
61
|
+
background: 6,
|
|
62
|
+
onBackground: 90,
|
|
63
|
+
surfaceVariant: 30,
|
|
64
|
+
onSurfaceVariant: 80,
|
|
65
|
+
surfaceContainerLowest: 4,
|
|
66
|
+
surfaceContainerLow: 10,
|
|
67
|
+
surfaceContainer: 12,
|
|
68
|
+
surfaceContainerHigh: 17,
|
|
69
|
+
surfaceContainerHighest: 22,
|
|
70
|
+
inverseSurface: 90,
|
|
71
|
+
inverseOnSurface: 20,
|
|
72
|
+
inversePrimary: 40,
|
|
73
|
+
outline: 60,
|
|
74
|
+
outlineVariant: 30
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const BLACK_TONE = 0;
|
|
78
|
+
const KEY_TONE = 50;
|
|
79
|
+
/** Keeps the colour's hue and chroma (plan D-2). */
|
|
80
|
+
function paletteOf(color) {
|
|
81
|
+
return TonalPalette.fromInt(argbFromColor(color));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Same tones as `TonalPalette.fromHueAndChroma`, without its key-colour search:
|
|
86
|
+
* a palette's tones depend only on hue and chroma, and these neutral chromas
|
|
87
|
+
* fit the gamut at tone 50, so no search is needed (spec FR-4).
|
|
88
|
+
*/
|
|
89
|
+
function paletteFromHueAndChroma(hue, chroma) {
|
|
90
|
+
return TonalPalette.fromHct(Hct.from(hue, chroma, KEY_TONE));
|
|
91
|
+
}
|
|
92
|
+
function neutralPalettes(input) {
|
|
93
|
+
if (input.seeds?.neutral != null) {
|
|
94
|
+
const seed = Hct.fromInt(argbFromColor(input.seeds.neutral));
|
|
95
|
+
const chroma = Math.min(seed.chroma, MAX_NEUTRAL_SEED_CHROMA);
|
|
96
|
+
return {
|
|
97
|
+
neutral: paletteFromHueAndChroma(seed.hue, chroma),
|
|
98
|
+
neutralVariant: paletteFromHueAndChroma(seed.hue, chroma + NEUTRAL_VARIANT_EXTRA_CHROMA)
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const hue = Hct.fromInt(argbFromColor(input.brandColors.primary)).hue;
|
|
102
|
+
return {
|
|
103
|
+
neutral: paletteFromHueAndChroma(hue, NEUTRAL_CHROMA),
|
|
104
|
+
neutralVariant: paletteFromHueAndChroma(hue, NEUTRAL_VARIANT_CHROMA)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export function buildPalettes(input) {
|
|
108
|
+
const seeds = {
|
|
109
|
+
...DEFAULT_SEEDS,
|
|
110
|
+
...input.seeds
|
|
111
|
+
};
|
|
112
|
+
const custom = {};
|
|
113
|
+
for (const [name, color] of Object.entries(input.tones ?? {})) {
|
|
114
|
+
custom[name] = paletteOf(color);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
accent: {
|
|
118
|
+
primary: paletteOf(input.brandColors.primary),
|
|
119
|
+
secondary: paletteOf(input.brandColors.secondary),
|
|
120
|
+
tertiary: paletteOf(input.brandColors.tertiary),
|
|
121
|
+
error: paletteOf(seeds.error),
|
|
122
|
+
success: paletteOf(seeds.success),
|
|
123
|
+
warning: paletteOf(seeds.warning),
|
|
124
|
+
info: paletteOf(seeds.info)
|
|
125
|
+
},
|
|
126
|
+
...neutralPalettes(input),
|
|
127
|
+
custom
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function hex(palette, tone) {
|
|
131
|
+
return hexFromArgb(palette.tone(tone));
|
|
132
|
+
}
|
|
133
|
+
export function buildColorRoles(palettes, scheme) {
|
|
134
|
+
const t = TONES[scheme];
|
|
135
|
+
const {
|
|
136
|
+
neutral,
|
|
137
|
+
neutralVariant
|
|
138
|
+
} = palettes;
|
|
139
|
+
const accent = palette => ({
|
|
140
|
+
role: hex(palette, t.role),
|
|
141
|
+
onRole: hex(palette, t.onRole),
|
|
142
|
+
container: hex(palette, t.container),
|
|
143
|
+
onContainer: hex(palette, t.onContainer)
|
|
144
|
+
});
|
|
145
|
+
const [primary, secondary, tertiary, error, success, warning, info] = ['primary', 'secondary', 'tertiary', 'error', 'success', 'warning', 'info'].map(name => accent(palettes.accent[name]));
|
|
146
|
+
const onSurface = hex(neutral, t.onBackground);
|
|
147
|
+
return {
|
|
148
|
+
primary: primary.role,
|
|
149
|
+
onPrimary: primary.onRole,
|
|
150
|
+
primaryContainer: primary.container,
|
|
151
|
+
onPrimaryContainer: primary.onContainer,
|
|
152
|
+
secondary: secondary.role,
|
|
153
|
+
onSecondary: secondary.onRole,
|
|
154
|
+
secondaryContainer: secondary.container,
|
|
155
|
+
onSecondaryContainer: secondary.onContainer,
|
|
156
|
+
tertiary: tertiary.role,
|
|
157
|
+
onTertiary: tertiary.onRole,
|
|
158
|
+
tertiaryContainer: tertiary.container,
|
|
159
|
+
onTertiaryContainer: tertiary.onContainer,
|
|
160
|
+
error: error.role,
|
|
161
|
+
onError: error.onRole,
|
|
162
|
+
errorContainer: error.container,
|
|
163
|
+
onErrorContainer: error.onContainer,
|
|
164
|
+
success: success.role,
|
|
165
|
+
onSuccess: success.onRole,
|
|
166
|
+
successContainer: success.container,
|
|
167
|
+
onSuccessContainer: success.onContainer,
|
|
168
|
+
warning: warning.role,
|
|
169
|
+
onWarning: warning.onRole,
|
|
170
|
+
warningContainer: warning.container,
|
|
171
|
+
onWarningContainer: warning.onContainer,
|
|
172
|
+
info: info.role,
|
|
173
|
+
onInfo: info.onRole,
|
|
174
|
+
infoContainer: info.container,
|
|
175
|
+
onInfoContainer: info.onContainer,
|
|
176
|
+
background: hex(neutral, t.background),
|
|
177
|
+
onBackground: onSurface,
|
|
178
|
+
surface: hex(neutral, t.background),
|
|
179
|
+
onSurface,
|
|
180
|
+
surfaceVariant: hex(neutralVariant, t.surfaceVariant),
|
|
181
|
+
onSurfaceVariant: hex(neutralVariant, t.onSurfaceVariant),
|
|
182
|
+
surfaceContainerLowest: hex(neutral, t.surfaceContainerLowest),
|
|
183
|
+
surfaceContainerLow: hex(neutral, t.surfaceContainerLow),
|
|
184
|
+
surfaceContainer: hex(neutral, t.surfaceContainer),
|
|
185
|
+
surfaceContainerHigh: hex(neutral, t.surfaceContainerHigh),
|
|
186
|
+
surfaceContainerHighest: hex(neutral, t.surfaceContainerHighest),
|
|
187
|
+
inverseSurface: hex(neutral, t.inverseSurface),
|
|
188
|
+
inverseOnSurface: hex(neutral, t.inverseOnSurface),
|
|
189
|
+
inversePrimary: hex(palettes.accent.primary, t.inversePrimary),
|
|
190
|
+
outline: hex(neutralVariant, t.outline),
|
|
191
|
+
outlineVariant: hex(neutralVariant, t.outlineVariant),
|
|
192
|
+
scrim: withAlpha(hex(neutral, BLACK_TONE), SCRIM_OPACITY),
|
|
193
|
+
shadow: hex(neutral, BLACK_TONE),
|
|
194
|
+
disabled: withAlpha(onSurface, DISABLED_CONTENT_OPACITY)
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function accentTone(palette, scheme) {
|
|
198
|
+
const t = TONES[scheme];
|
|
199
|
+
return {
|
|
200
|
+
fg: hex(palette, t.role),
|
|
201
|
+
container: hex(palette, t.container),
|
|
202
|
+
onContainer: hex(palette, t.onContainer),
|
|
203
|
+
border: hex(palette, t.toneBorder),
|
|
204
|
+
fill: hex(palette, t.role),
|
|
205
|
+
onFill: hex(palette, t.onRole)
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
export function buildTones(palettes, color, scheme) {
|
|
209
|
+
const tones = {
|
|
210
|
+
neutral: {
|
|
211
|
+
fg: color.onSurface,
|
|
212
|
+
container: color.surfaceContainerHigh,
|
|
213
|
+
onContainer: color.onSurface,
|
|
214
|
+
border: color.outline,
|
|
215
|
+
fill: color.inverseSurface,
|
|
216
|
+
onFill: color.inverseOnSurface
|
|
217
|
+
},
|
|
218
|
+
primary: accentTone(palettes.accent.primary, scheme),
|
|
219
|
+
info: accentTone(palettes.accent.info, scheme),
|
|
220
|
+
success: accentTone(palettes.accent.success, scheme),
|
|
221
|
+
warning: accentTone(palettes.accent.warning, scheme),
|
|
222
|
+
error: accentTone(palettes.accent.error, scheme)
|
|
223
|
+
};
|
|
224
|
+
for (const [name, palette] of Object.entries(palettes.custom)) {
|
|
225
|
+
tones[name] = accentTone(palette, scheme);
|
|
226
|
+
}
|
|
227
|
+
return tones;
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Hct","TonalPalette","DEFAULT_OPACITY","argbFromColor","hexFromArgb","withAlpha","DEFAULT_SEEDS","error","success","warning","info","NEUTRAL_CHROMA","NEUTRAL_VARIANT_CHROMA","MAX_NEUTRAL_SEED_CHROMA","NEUTRAL_VARIANT_EXTRA_CHROMA","DISABLED_CONTENT_OPACITY","disabledContent","SCRIM_OPACITY","TONES","light","role","onRole","container","onContainer","toneBorder","background","onBackground","surfaceVariant","onSurfaceVariant","surfaceContainerLowest","surfaceContainerLow","surfaceContainer","surfaceContainerHigh","surfaceContainerHighest","inverseSurface","inverseOnSurface","inversePrimary","outline","outlineVariant","dark","BLACK_TONE","KEY_TONE","paletteOf","color","fromInt","paletteFromHueAndChroma","hue","chroma","fromHct","from","neutralPalettes","input","seeds","neutral","seed","Math","min","neutralVariant","brandColors","primary","buildPalettes","custom","name","Object","entries","tones","accent","secondary","tertiary","hex","palette","tone","buildColorRoles","palettes","scheme","t","map","onSurface","onPrimary","primaryContainer","onPrimaryContainer","onSecondary","secondaryContainer","onSecondaryContainer","onTertiary","tertiaryContainer","onTertiaryContainer","onError","errorContainer","onErrorContainer","onSuccess","successContainer","onSuccessContainer","onWarning","warningContainer","onWarningContainer","onInfo","infoContainer","onInfoContainer","surface","scrim","shadow","disabled","accentTone","fg","border","fill","onFill","buildTones"],"sourceRoot":"../../../src","sources":["color/roles.ts"],"mappings":";;AAAA,SAASA,GAAG,EAAEC,YAAY,QAAQ,wBAAe;AASjD,SAASC,eAAe,QAAQ,uBAAoB;AACpD,SAASC,aAAa,EAAEC,WAAW,EAAEC,SAAS,QAAQ,YAAS;;AAE/D;AACA;AACA;AACA,OAAO,MAAMC,aAAoD,GAAG;EACnEC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAA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,UAAU,CAACjC,OAAO,EAAEI,MAAM,CAAC;EAC1C;EAEA,OAAOT,KAAK;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// ─── Theme building ─────────────────────────────────────────────────────────
|
|
4
|
+
export { buildThemes } from "./theme/buildThemes.js";
|
|
5
|
+
export { ThemeConfigError, ThemeContrastError } from "./theme/errors.js";
|
|
6
|
+
// ─── Unistyles ──────────────────────────────────────────────────────────────
|
|
7
|
+
export { createUnistylesConfig } from "./unistyles/createUnistylesConfig.js";
|
|
8
|
+
export { applyThemeMode } from "./unistyles/themeMode.js";
|
|
9
|
+
export { DEFAULT_BREAKPOINTS } from "./tokens/defaults.js";
|
|
10
|
+
|
|
11
|
+
// ─── Colour utilities ───────────────────────────────────────────────────────
|
|
12
|
+
export { auditTheme, contrastRatio } from "./color/contrast.js";
|
|
13
|
+
export { withAlpha } from "./color/parse.js";
|
|
14
|
+
|
|
15
|
+
// ─── Style presets ──────────────────────────────────────────────────────────
|
|
16
|
+
export { layout, presets } from "./presets/layout.js";
|
|
17
|
+
export { byTone } from "./presets/byTone.js";
|
|
18
|
+
|
|
19
|
+
// ─── Integrations ───────────────────────────────────────────────────────────
|
|
20
|
+
export { toNavigationTheme } from "./integration/navigationTheme.js";
|
|
21
|
+
|
|
22
|
+
// ─── Types ──────────────────────────────────────────────────────────────────
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["buildThemes","ThemeConfigError","ThemeContrastError","createUnistylesConfig","applyThemeMode","DEFAULT_BREAKPOINTS","auditTheme","contrastRatio","withAlpha","layout","presets","byTone","toNavigationTheme"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,SAASA,WAAW,QAAQ,wBAAqB;AAEjD,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,mBAAgB;AAGrE;AACA,SAASC,qBAAqB,QAAQ,sCAAmC;AAEzE,SAASC,cAAc,QAAQ,0BAAuB;AAEtD,SAASC,mBAAmB,QAAQ,sBAAmB;;AAEvD;AACA,SAASC,UAAU,EAAEC,aAAa,QAAQ,qBAAkB;AAE5D,SAASC,SAAS,QAAQ,kBAAe;;AAEzC;AACA,SAASC,MAAM,EAAEC,OAAO,QAAQ,qBAAkB;AAClD,SAASC,MAAM,QAAQ,qBAAkB;;AAEzC;AACA,SAASC,iBAAiB,QAAQ,kCAA+B;;AAGjE","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The theme shape React Navigation expects, declared here so the package needs
|
|
5
|
+
* no navigation dependency (spec AC-9.3).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export function toNavigationTheme(theme, scheme) {
|
|
9
|
+
const {
|
|
10
|
+
color,
|
|
11
|
+
font
|
|
12
|
+
} = theme;
|
|
13
|
+
return {
|
|
14
|
+
dark: scheme === 'dark',
|
|
15
|
+
colors: {
|
|
16
|
+
primary: color.primary,
|
|
17
|
+
background: color.background,
|
|
18
|
+
card: color.surfaceContainer,
|
|
19
|
+
text: color.onSurface,
|
|
20
|
+
border: color.outlineVariant,
|
|
21
|
+
notification: color.error
|
|
22
|
+
},
|
|
23
|
+
fonts: {
|
|
24
|
+
regular: {
|
|
25
|
+
...font.regular
|
|
26
|
+
},
|
|
27
|
+
medium: {
|
|
28
|
+
...font.medium
|
|
29
|
+
},
|
|
30
|
+
bold: {
|
|
31
|
+
...font.bold
|
|
32
|
+
},
|
|
33
|
+
heavy: {
|
|
34
|
+
...font.heavy
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=navigationTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toNavigationTheme","theme","scheme","color","font","dark","colors","primary","background","card","surfaceContainer","text","onSurface","border","outlineVariant","notification","error","fonts","regular","medium","bold","heavy"],"sourceRoot":"../../../src","sources":["integration/navigationTheme.ts"],"mappings":";;AAGA;AACA;AACA;AACA;;AAwBA,OAAO,SAASA,iBAAiBA,CAACC,KAAuB,EAAEC,MAAmB,EAAmB;EAChG,MAAM;IAAEC,KAAK;IAAEC;EAAK,CAAC,GAAGH,KAAK;EAE7B,OAAO;IACNI,IAAI,EAAEH,MAAM,KAAK,MAAM;IACvBI,MAAM,EAAE;MACPC,OAAO,EAAEJ,KAAK,CAACI,OAAO;MACtBC,UAAU,EAAEL,KAAK,CAACK,UAAU;MAC5BC,IAAI,EAAEN,KAAK,CAACO,gBAAgB;MAC5BC,IAAI,EAAER,KAAK,CAACS,SAAS;MACrBC,MAAM,EAAEV,KAAK,CAACW,cAAc;MAC5BC,YAAY,EAAEZ,KAAK,CAACa;IACrB,CAAC;IACDC,KAAK,EAAE;MACNC,OAAO,EAAE;QAAE,GAAGd,IAAI,CAACc;MAAQ,CAAC;MAC5BC,MAAM,EAAE;QAAE,GAAGf,IAAI,CAACe;MAAO,CAAC;MAC1BC,IAAI,EAAE;QAAE,GAAGhB,IAAI,CAACgB;MAAK,CAAC;MACtBC,KAAK,EAAE;QAAE,GAAGjB,IAAI,CAACiB;MAAM;IACxB;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Builds a variant map with one entry per tone of the theme.
|
|
5
|
+
*
|
|
6
|
+
* Call it inline under a literal `variants` key, with the stylesheet's own
|
|
7
|
+
* `theme` argument:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* toneText: { variants: { tone: byTone(theme, t => ({ color: t.onContainer })) } },
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The Unistyles Babel plugin reads dependencies statically: a variants object
|
|
14
|
+
* built elsewhere, or a `theme` read through an alias, hides them and the
|
|
15
|
+
* style stops updating on theme or variant changes.
|
|
16
|
+
*/
|
|
17
|
+
export function byTone(theme, build) {
|
|
18
|
+
const result = {};
|
|
19
|
+
for (const name of Object.keys(theme.tone)) {
|
|
20
|
+
result[name] = build(theme.tone[name], name);
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=byTone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["byTone","theme","build","result","name","Object","keys","tone"],"sourceRoot":"../../../src","sources":["presets/byTone.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,MAAMA,CACrBC,KAAa,EACbC,KAAwE,EACxB;EAChD,MAAMC,MAAM,GAAG,CAAC,CAAkD;EAElE,KAAK,MAAMC,IAAI,IAAIC,MAAM,CAACC,IAAI,CAACL,KAAK,CAACM,IAAI,CAAC,EAA0C;IACnFJ,MAAM,CAACC,IAAI,CAAC,GAAGF,KAAK,CAACD,KAAK,CAACM,IAAI,CAACH,IAAI,CAAC,EAAEA,IAAI,CAAC;EAC7C;EAEA,OAAOD,MAAM;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Theme-independent flex presets. Spread them inside `StyleSheet.create` or
|
|
5
|
+
* put them in a style array; styles built only from these carry no theme
|
|
6
|
+
* dependency, so Unistyles never recalculates them on a theme change.
|
|
7
|
+
*/
|
|
8
|
+
export const layout = {
|
|
9
|
+
row: {
|
|
10
|
+
flexDirection: 'row'
|
|
11
|
+
},
|
|
12
|
+
column: {
|
|
13
|
+
flexDirection: 'column'
|
|
14
|
+
},
|
|
15
|
+
rowCenter: {
|
|
16
|
+
flexDirection: 'row',
|
|
17
|
+
alignItems: 'center'
|
|
18
|
+
},
|
|
19
|
+
rowBetween: {
|
|
20
|
+
flexDirection: 'row',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'space-between'
|
|
23
|
+
},
|
|
24
|
+
center: {
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center'
|
|
27
|
+
},
|
|
28
|
+
fill: {
|
|
29
|
+
flex: 1
|
|
30
|
+
},
|
|
31
|
+
wrap: {
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
flexWrap: 'wrap'
|
|
34
|
+
},
|
|
35
|
+
absoluteFill: {
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
top: 0,
|
|
38
|
+
right: 0,
|
|
39
|
+
bottom: 0,
|
|
40
|
+
left: 0
|
|
41
|
+
},
|
|
42
|
+
selfStart: {
|
|
43
|
+
alignSelf: 'flex-start'
|
|
44
|
+
},
|
|
45
|
+
selfCenter: {
|
|
46
|
+
alignSelf: 'center'
|
|
47
|
+
},
|
|
48
|
+
selfEnd: {
|
|
49
|
+
alignSelf: 'flex-end'
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
// Annotated rather than `as const`: a readonly `fontVariant` tuple fails
|
|
53
|
+
// React Native's `TextStyle` and degrades inference of sibling styles (spec AC-3.7).
|
|
54
|
+
export const presets = {
|
|
55
|
+
glyphAlign: {
|
|
56
|
+
includeFontPadding: false,
|
|
57
|
+
textAlignVertical: 'center'
|
|
58
|
+
},
|
|
59
|
+
tabularNums: {
|
|
60
|
+
fontVariant: ['tabular-nums']
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["layout","row","flexDirection","column","rowCenter","alignItems","rowBetween","justifyContent","center","fill","flex","wrap","flexWrap","absoluteFill","position","top","right","bottom","left","selfStart","alignSelf","selfCenter","selfEnd","presets","glyphAlign","includeFontPadding","textAlignVertical","tabularNums","fontVariant"],"sourceRoot":"../../../src","sources":["presets/layout.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,MAAM,GAAG;EACrBC,GAAG,EAAE;IAAEC,aAAa,EAAE;EAAM,CAAC;EAC7BC,MAAM,EAAE;IAAED,aAAa,EAAE;EAAS,CAAC;EACnCE,SAAS,EAAE;IAAEF,aAAa,EAAE,KAAK;IAAEG,UAAU,EAAE;EAAS,CAAC;EACzDC,UAAU,EAAE;IAAEJ,aAAa,EAAE,KAAK;IAAEG,UAAU,EAAE,QAAQ;IAAEE,cAAc,EAAE;EAAgB,CAAC;EAC3FC,MAAM,EAAE;IAAEH,UAAU,EAAE,QAAQ;IAAEE,cAAc,EAAE;EAAS,CAAC;EAC1DE,IAAI,EAAE;IAAEC,IAAI,EAAE;EAAE,CAAC;EACjBC,IAAI,EAAE;IAAET,aAAa,EAAE,KAAK;IAAEU,QAAQ,EAAE;EAAO,CAAC;EAChDC,YAAY,EAAE;IAAEC,QAAQ,EAAE,UAAU;IAAEC,GAAG,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE,CAAC;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC5EC,SAAS,EAAE;IAAEC,SAAS,EAAE;EAAa,CAAC;EACtCC,UAAU,EAAE;IAAED,SAAS,EAAE;EAAS,CAAC;EACnCE,OAAO,EAAE;IAAEF,SAAS,EAAE;EAAW;AAClC,CAA8C;AAa9C;AACA;AACA,OAAO,MAAMG,OAA0B,GAAG;EACzCC,UAAU,EAAE;IAAEC,kBAAkB,EAAE,KAAK;IAAEC,iBAAiB,EAAE;EAAS,CAAC;EACtEC,WAAW,EAAE;IAAEC,WAAW,EAAE,CAAC,cAAc;EAAE;AAC9C,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const PRESET_KEYS = ['text', 'stack', 'inline', 'border', 'box'];
|
|
4
|
+
function textPreset(token, color) {
|
|
5
|
+
return {
|
|
6
|
+
...token,
|
|
7
|
+
color
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function buildText({
|
|
11
|
+
typography
|
|
12
|
+
}, color) {
|
|
13
|
+
return {
|
|
14
|
+
body: textPreset(typography.body, color.onSurface),
|
|
15
|
+
bodyMuted: textPreset(typography.body, color.onSurfaceVariant),
|
|
16
|
+
label: textPreset(typography.label, color.onSurface),
|
|
17
|
+
labelMuted: textPreset(typography.label, color.onSurfaceVariant),
|
|
18
|
+
caption: textPreset(typography.caption, color.onSurfaceVariant),
|
|
19
|
+
title: textPreset(typography.title, color.onSurface),
|
|
20
|
+
headline: textPreset(typography.headline, color.onSurface),
|
|
21
|
+
disabled: textPreset(typography.body, color.disabled)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function bySpacing(spacing, build) {
|
|
25
|
+
const result = {};
|
|
26
|
+
for (const key of Object.keys(spacing)) {
|
|
27
|
+
result[key] = build(spacing[key]);
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
function buildBorder({
|
|
32
|
+
borderWidth,
|
|
33
|
+
color
|
|
34
|
+
}) {
|
|
35
|
+
return {
|
|
36
|
+
hairline: {
|
|
37
|
+
borderWidth: borderWidth.hairline,
|
|
38
|
+
borderColor: color.outlineVariant
|
|
39
|
+
},
|
|
40
|
+
top: {
|
|
41
|
+
borderTopWidth: borderWidth.thin,
|
|
42
|
+
borderTopColor: color.outlineVariant
|
|
43
|
+
},
|
|
44
|
+
bottom: {
|
|
45
|
+
borderBottomWidth: borderWidth.thin,
|
|
46
|
+
borderBottomColor: color.outlineVariant
|
|
47
|
+
},
|
|
48
|
+
all: {
|
|
49
|
+
borderWidth: borderWidth.thin,
|
|
50
|
+
borderColor: color.outline
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function buildBox({
|
|
55
|
+
borderWidth,
|
|
56
|
+
color,
|
|
57
|
+
radius,
|
|
58
|
+
spacing,
|
|
59
|
+
size
|
|
60
|
+
}) {
|
|
61
|
+
return {
|
|
62
|
+
outlined: {
|
|
63
|
+
borderWidth: borderWidth.thin,
|
|
64
|
+
borderColor: color.outline,
|
|
65
|
+
borderRadius: radius.md,
|
|
66
|
+
padding: spacing.sm,
|
|
67
|
+
gap: spacing.xs
|
|
68
|
+
},
|
|
69
|
+
card: {
|
|
70
|
+
backgroundColor: color.surfaceContainerLow,
|
|
71
|
+
borderRadius: radius.lg,
|
|
72
|
+
padding: spacing.md,
|
|
73
|
+
gap: spacing.sm
|
|
74
|
+
},
|
|
75
|
+
sheet: {
|
|
76
|
+
backgroundColor: color.surfaceContainerLow,
|
|
77
|
+
borderTopLeftRadius: radius.xl,
|
|
78
|
+
borderTopRightRadius: radius.xl,
|
|
79
|
+
padding: spacing.md,
|
|
80
|
+
gap: spacing.md
|
|
81
|
+
},
|
|
82
|
+
touchTarget: {
|
|
83
|
+
minWidth: size.touchTarget,
|
|
84
|
+
minHeight: size.touchTarget,
|
|
85
|
+
justifyContent: 'center'
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Token-reading presets, built from the theme's final (overridden) tokens so
|
|
92
|
+
* they follow every override — e.g. `radius.md = 0` reaches `box.outlined`.
|
|
93
|
+
*/
|
|
94
|
+
export function buildPresets(tokens) {
|
|
95
|
+
return {
|
|
96
|
+
text: buildText(tokens, tokens.color),
|
|
97
|
+
stack: bySpacing(tokens.spacing, gap => ({
|
|
98
|
+
flexDirection: 'column',
|
|
99
|
+
gap
|
|
100
|
+
})),
|
|
101
|
+
inline: bySpacing(tokens.spacing, gap => ({
|
|
102
|
+
flexDirection: 'row',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
gap
|
|
105
|
+
})),
|
|
106
|
+
border: buildBorder(tokens),
|
|
107
|
+
box: buildBox(tokens)
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=themePresets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PRESET_KEYS","textPreset","token","color","buildText","typography","body","onSurface","bodyMuted","onSurfaceVariant","label","labelMuted","caption","title","headline","disabled","bySpacing","spacing","build","result","key","Object","keys","buildBorder","borderWidth","hairline","borderColor","outlineVariant","top","borderTopWidth","thin","borderTopColor","bottom","borderBottomWidth","borderBottomColor","all","outline","buildBox","radius","size","outlined","borderRadius","md","padding","sm","gap","xs","card","backgroundColor","surfaceContainerLow","lg","sheet","borderTopLeftRadius","xl","borderTopRightRadius","touchTarget","minWidth","minHeight","justifyContent","buildPresets","tokens","text","stack","flexDirection","inline","alignItems","border","box"],"sourceRoot":"../../../src","sources":["presets/themePresets.ts"],"mappings":";;AAgBA,OAAO,MAAMA,WAAiC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC;AAE7F,SAASC,UAAUA,CAACC,KAAsB,EAAEC,KAAa,EAAc;EACtE,OAAO;IAAE,GAAGD,KAAK;IAAEC;EAAM,CAAC;AAC3B;AAEA,SAASC,SAASA,CAAC;EAAEC;AAAwB,CAAC,EAAEF,KAAiB,EAAe;EAC/E,OAAO;IACNG,IAAI,EAAEL,UAAU,CAACI,UAAU,CAACC,IAAI,EAAEH,KAAK,CAACI,SAAS,CAAC;IAClDC,SAAS,EAAEP,UAAU,CAACI,UAAU,CAACC,IAAI,EAAEH,KAAK,CAACM,gBAAgB,CAAC;IAC9DC,KAAK,EAAET,UAAU,CAACI,UAAU,CAACK,KAAK,EAAEP,KAAK,CAACI,SAAS,CAAC;IACpDI,UAAU,EAAEV,UAAU,CAACI,UAAU,CAACK,KAAK,EAAEP,KAAK,CAACM,gBAAgB,CAAC;IAChEG,OAAO,EAAEX,UAAU,CAACI,UAAU,CAACO,OAAO,EAAET,KAAK,CAACM,gBAAgB,CAAC;IAC/DI,KAAK,EAAEZ,UAAU,CAACI,UAAU,CAACQ,K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