react-native-terra-ui 0.1.1 → 0.2.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 +96 -0
- package/lib/module/components/avatar/Avatar.js +118 -35
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/box/Box.js +15 -2
- package/lib/module/components/box/Box.js.map +1 -1
- package/lib/module/components/box/utils.js +4 -1
- package/lib/module/components/box/utils.js.map +1 -1
- package/lib/module/components/button/Button.js +7 -14
- package/lib/module/components/button/Button.js.map +1 -1
- package/lib/module/components/chip/Chip.js +372 -0
- package/lib/module/components/chip/Chip.js.map +1 -0
- package/lib/module/components/chip/index.js +4 -0
- package/lib/module/components/chip/index.js.map +1 -0
- package/lib/module/components/chip/types.js +2 -0
- package/lib/module/components/chip/types.js.map +1 -0
- package/lib/module/components/chip/utils.js +36 -0
- package/lib/module/components/chip/utils.js.map +1 -0
- package/lib/module/components/empty-state/EmptyState.js +200 -0
- package/lib/module/components/empty-state/EmptyState.js.map +1 -0
- package/lib/module/components/empty-state/index.js +4 -0
- package/lib/module/components/empty-state/index.js.map +1 -0
- package/lib/module/components/empty-state/types.js +2 -0
- package/lib/module/components/empty-state/types.js.map +1 -0
- package/lib/module/components/header/header-buttons.js +31 -36
- package/lib/module/components/header/header-buttons.js.map +1 -1
- package/lib/module/components/header/index.js +1 -1
- package/lib/module/components/header/index.js.map +1 -1
- package/lib/module/components/header/parts/HeaderGradientOverlay.js +38 -0
- package/lib/module/components/header/parts/HeaderGradientOverlay.js.map +1 -0
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +69 -99
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
- package/lib/module/components/header/variants/TitleHeader/index.js +32 -63
- package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
- package/lib/module/components/icon/Icon.js +20 -8
- package/lib/module/components/icon/Icon.js.map +1 -1
- package/lib/module/components/image/Image.js +54 -0
- package/lib/module/components/image/Image.js.map +1 -0
- package/lib/module/components/image/index.js +4 -0
- package/lib/module/components/image/index.js.map +1 -0
- package/lib/module/components/image/types.js +4 -0
- package/lib/module/components/image/types.js.map +1 -0
- package/lib/module/components/index.js +4 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/portal/Portal.js +42 -0
- package/lib/module/components/portal/Portal.js.map +1 -0
- package/lib/module/components/portal/PortalContext.js +1 -16
- package/lib/module/components/portal/PortalContext.js.map +1 -1
- package/lib/module/components/portal/PortalHost.js +16 -14
- package/lib/module/components/portal/PortalHost.js.map +1 -1
- package/lib/module/components/portal/PortalProvider.js +51 -19
- package/lib/module/components/portal/PortalProvider.js.map +1 -1
- package/lib/module/components/portal/index.js +1 -1
- package/lib/module/components/portal/index.js.map +1 -1
- package/lib/module/components/screen/Screen.js +25 -28
- package/lib/module/components/screen/Screen.js.map +1 -1
- package/lib/module/components/screen/ScreenContext.js +7 -5
- package/lib/module/components/screen/ScreenContext.js.map +1 -1
- package/lib/module/components/screen/ScreenFlashList.js +144 -0
- package/lib/module/components/screen/ScreenFlashList.js.map +1 -0
- package/lib/module/components/screen/ScreenFlatList.js +88 -27
- package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
- package/lib/module/components/screen/ScreenScrollView.js +101 -34
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
- package/lib/module/components/screen/index.js +1 -0
- package/lib/module/components/screen/index.js.map +1 -1
- package/lib/module/components/screen/parts/BottomSafeArea.js +62 -0
- package/lib/module/components/screen/parts/BottomSafeArea.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenPlaceholder.js +50 -0
- package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -0
- package/lib/module/components/screen/types.js +4 -0
- package/lib/module/components/screen/types.js.map +1 -0
- package/lib/module/components/screen/utils.js +12 -9
- package/lib/module/components/screen/utils.js.map +1 -1
- package/lib/module/components/surface/Surface.js +16 -9
- package/lib/module/components/surface/Surface.js.map +1 -1
- package/lib/module/components/text/Text.js +23 -5
- package/lib/module/components/text/Text.js.map +1 -1
- package/lib/module/components/toast/Toast.js +8 -8
- package/lib/module/components/toast/Toast.js.map +1 -1
- package/lib/module/components/toolbar/Toolbar.js +268 -0
- package/lib/module/components/toolbar/Toolbar.js.map +1 -0
- package/lib/module/components/toolbar/index.js +4 -0
- package/lib/module/components/toolbar/index.js.map +1 -0
- package/lib/module/context/ThemeProvider.js +5 -2
- package/lib/module/context/ThemeProvider.js.map +1 -1
- package/lib/module/{components/icon/utils.js → theme/defaults/icons.js} +1 -1
- package/lib/module/theme/defaults/icons.js.map +1 -0
- package/lib/module/theme/defaults/image.js +30 -0
- package/lib/module/theme/defaults/image.js.map +1 -0
- package/lib/module/theme/index.js +1 -1
- package/lib/module/theme/{configure.js → registry.js} +21 -28
- package/lib/module/theme/registry.js.map +1 -0
- package/lib/module/theme/runtime.js +1 -1
- package/lib/module/theme/theme.js +91 -10
- package/lib/module/theme/theme.js.map +1 -1
- package/lib/module/theme/tokens/dark.js +59 -68
- package/lib/module/theme/tokens/dark.js.map +1 -1
- package/lib/module/theme/tokens/light.js +49 -67
- package/lib/module/theme/tokens/light.js.map +1 -1
- package/lib/module/theme/tokens/primitives.js +241 -20
- package/lib/module/theme/tokens/primitives.js.map +1 -1
- package/lib/module/utils/accent-utils.js +4 -4
- package/lib/module/utils/accent-utils.js.map +1 -1
- package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/avatar/types.d.ts +4 -4
- package/lib/typescript/src/components/avatar/types.d.ts.map +1 -1
- package/lib/typescript/src/components/box/Box.d.ts.map +1 -1
- package/lib/typescript/src/components/box/utils.d.ts +6 -1
- package/lib/typescript/src/components/box/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/button/Button.d.ts +1 -1
- package/lib/typescript/src/components/button/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/Chip.d.ts +24 -0
- package/lib/typescript/src/components/chip/Chip.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts +4 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/types.d.ts +8 -0
- package/lib/typescript/src/components/chip/types.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/utils.d.ts +8 -0
- package/lib/typescript/src/components/chip/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts +45 -0
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state/index.d.ts +4 -0
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state/types.d.ts +6 -0
- package/lib/typescript/src/components/empty-state/types.d.ts.map +1 -0
- package/lib/typescript/src/components/header/header-buttons.d.ts +27 -0
- package/lib/typescript/src/components/header/header-buttons.d.ts.map +1 -1
- package/lib/typescript/src/components/header/index.d.ts +1 -1
- package/lib/typescript/src/components/header/index.d.ts.map +1 -1
- package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts +7 -0
- package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +1 -1
- 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 +18 -7
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/Icon.d.ts.map +1 -1
- package/lib/typescript/src/components/image/Image.d.ts +16 -0
- package/lib/typescript/src/components/image/Image.d.ts.map +1 -0
- package/lib/typescript/src/components/image/index.d.ts +3 -0
- package/lib/typescript/src/components/image/index.d.ts.map +1 -0
- package/lib/typescript/src/components/image/types.d.ts +7 -0
- package/lib/typescript/src/components/image/types.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +4 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/Portal.d.ts +26 -0
- package/lib/typescript/src/components/portal/Portal.d.ts.map +1 -0
- package/lib/typescript/src/components/portal/PortalContext.d.ts +11 -14
- package/lib/typescript/src/components/portal/PortalContext.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/PortalHost.d.ts +9 -4
- package/lib/typescript/src/components/portal/PortalHost.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/PortalProvider.d.ts +3 -3
- package/lib/typescript/src/components/portal/PortalProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/index.d.ts +4 -2
- package/lib/typescript/src/components/portal/index.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/Screen.d.ts +18 -13
- package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenContext.d.ts +12 -9
- package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenFlashList.d.ts +43 -0
- package/lib/typescript/src/components/screen/ScreenFlashList.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +17 -7
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +51 -16
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/index.d.ts +3 -0
- package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts +30 -0
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +22 -0
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/types.d.ts +42 -0
- package/lib/typescript/src/components/screen/types.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/utils.d.ts +9 -9
- package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/surface/Surface.d.ts +7 -0
- package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -1
- package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/toolbar/Toolbar.d.ts +115 -0
- package/lib/typescript/src/components/toolbar/Toolbar.d.ts.map +1 -0
- package/lib/typescript/src/components/toolbar/index.d.ts +3 -0
- package/lib/typescript/src/components/toolbar/index.d.ts.map +1 -0
- package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/{components/icon/utils.d.ts → theme/defaults/icons.d.ts} +2 -2
- package/lib/typescript/src/theme/defaults/icons.d.ts.map +1 -0
- package/lib/typescript/src/theme/defaults/image.d.ts +4 -0
- package/lib/typescript/src/theme/defaults/image.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +1 -1
- package/lib/typescript/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/{configure.d.ts → registry.d.ts} +1 -1
- package/lib/typescript/src/theme/registry.d.ts.map +1 -0
- package/lib/typescript/src/theme/theme.d.ts +21 -1
- package/lib/typescript/src/theme/theme.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/dark.d.ts +41 -64
- package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/light.d.ts +44 -65
- package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/primitives.d.ts +228 -17
- package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
- package/lib/typescript/src/theme/types.d.ts +65 -35
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/package.json +24 -12
- package/skills/terra-ui/SKILL.md +193 -0
- package/skills/terra-ui/references/recipes.md +198 -0
- package/skills/terra-ui/references/troubleshooting.md +112 -0
- package/src/components/avatar/Avatar.tsx +128 -38
- package/src/components/avatar/types.ts +5 -5
- package/src/components/box/Box.tsx +13 -1
- package/src/components/box/utils.ts +10 -0
- package/src/components/button/Button.tsx +7 -15
- package/src/components/chip/Chip.tsx +444 -0
- package/src/components/chip/index.ts +3 -0
- package/src/components/chip/types.ts +15 -0
- package/src/components/chip/utils.ts +34 -0
- package/src/components/empty-state/EmptyState.tsx +209 -0
- package/src/components/empty-state/index.ts +3 -0
- package/src/components/empty-state/types.ts +5 -0
- package/src/components/header/header-buttons.tsx +33 -45
- package/src/components/header/index.ts +2 -0
- package/src/components/header/parts/HeaderGradientOverlay.tsx +29 -0
- package/src/components/header/variants/LargeTitleHeader/index.tsx +68 -102
- package/src/components/header/variants/TitleHeader/index.tsx +47 -56
- package/src/components/icon/Icon.tsx +20 -15
- package/src/components/image/Image.tsx +48 -0
- package/src/components/image/index.ts +2 -0
- package/src/components/image/types.ts +7 -0
- package/src/components/index.ts +4 -0
- package/src/components/portal/Portal.tsx +55 -0
- package/src/components/portal/PortalContext.tsx +14 -22
- package/src/components/portal/PortalHost.tsx +17 -10
- package/src/components/portal/PortalProvider.tsx +58 -21
- package/src/components/portal/index.ts +4 -2
- package/src/components/screen/Screen.tsx +45 -59
- package/src/components/screen/ScreenContext.tsx +19 -12
- package/src/components/screen/ScreenFlashList.tsx +196 -0
- package/src/components/screen/ScreenFlatList.tsx +100 -39
- package/src/components/screen/ScreenScrollView.tsx +114 -53
- package/src/components/screen/index.ts +3 -0
- package/src/components/screen/parts/BottomSafeArea.tsx +60 -0
- package/src/components/screen/parts/ScreenPlaceholder.tsx +55 -0
- package/src/components/screen/types.ts +43 -0
- package/src/components/screen/utils.ts +29 -15
- package/src/components/surface/Surface.tsx +17 -20
- package/src/components/text/Text.tsx +23 -5
- package/src/components/toast/Toast.tsx +8 -8
- package/src/components/toolbar/Toolbar.tsx +353 -0
- package/src/components/toolbar/index.ts +6 -0
- package/src/context/ThemeProvider.tsx +5 -4
- package/src/{components/icon/utils.tsx → theme/defaults/icons.tsx} +1 -1
- package/src/theme/defaults/image.tsx +34 -0
- package/src/theme/index.ts +1 -1
- package/src/theme/{configure.ts → registry.ts} +19 -34
- package/src/theme/runtime.ts +1 -1
- package/src/theme/theme.ts +127 -13
- package/src/theme/tokens/dark.ts +60 -69
- package/src/theme/tokens/light.ts +50 -68
- package/src/theme/tokens/primitives.ts +248 -20
- package/src/theme/types.ts +67 -35
- package/src/utils/accent-utils.ts +4 -4
- package/lib/module/components/icon/utils.js.map +0 -1
- package/lib/module/theme/configure.js.map +0 -1
- package/lib/typescript/src/components/icon/utils.d.ts.map +0 -1
- package/lib/typescript/src/theme/configure.d.ts.map +0 -1
|
@@ -4,14 +4,47 @@ import { unflatten } from "../utils/unflatten.js";
|
|
|
4
4
|
import { dark } from "./tokens/dark.js";
|
|
5
5
|
import { light } from "./tokens/light.js";
|
|
6
6
|
import { primitives } from "./tokens/primitives.js";
|
|
7
|
+
// Matches `{palette.key}/NN` — a palette reference with a trailing NN%
|
|
8
|
+
// opacity suffix (0-100), e.g. `{palette.amber.500}/15`.
|
|
9
|
+
const ALPHA_REF_PATTERN = /^\{([\w.]+)\}\/(\d{1,3})$/;
|
|
10
|
+
// Matches a bare `#rrggbb` hex color (the only shape palette primitives use).
|
|
11
|
+
const HEX6_PATTERN = /^#[0-9a-f]{6}$/i;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Converts a 0-100 percentage into a two-digit hex alpha byte, e.g. 15 -> '26'.
|
|
15
|
+
*/
|
|
16
|
+
function percentToHexAlpha(percent) {
|
|
17
|
+
const byte = Math.round(percent / 100 * 255);
|
|
18
|
+
return byte.toString(16).padStart(2, '0');
|
|
19
|
+
}
|
|
20
|
+
|
|
7
21
|
/**
|
|
8
22
|
* Resolves {palette.key} reference notation against a source flat-token map.
|
|
9
|
-
*
|
|
23
|
+
* Also resolves {palette.key}/NN, which appends an NN% opacity alpha byte to
|
|
24
|
+
* the referenced hex color (the referenced value must be a plain #rrggbb hex
|
|
25
|
+
* - `/NN` is not supported on raw hex/rgba literals). Non-reference values
|
|
26
|
+
* pass through unchanged; a reference that can't be resolved this way is
|
|
27
|
+
* left as-is.
|
|
10
28
|
*/
|
|
11
29
|
function resolveRefs(flat, source) {
|
|
12
30
|
const out = {};
|
|
13
31
|
for (const [k, v] of Object.entries(flat)) {
|
|
14
|
-
|
|
32
|
+
if (typeof v !== 'string') {
|
|
33
|
+
out[k] = v;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const alphaMatch = v.match(ALPHA_REF_PATTERN);
|
|
37
|
+
if (alphaMatch) {
|
|
38
|
+
// Both groups are guaranteed by ALPHA_REF_PATTERN when it matches;
|
|
39
|
+
// `noUncheckedIndexedAccess` just can't see that from a regex literal.
|
|
40
|
+
const refKey = alphaMatch[1];
|
|
41
|
+
const percentStr = alphaMatch[2];
|
|
42
|
+
const base = source[refKey];
|
|
43
|
+
const percent = Number(percentStr);
|
|
44
|
+
out[k] = typeof base === 'string' && HEX6_PATTERN.test(base) ? `${base}${percentToHexAlpha(percent)}` : v;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
out[k] = v.startsWith('{') && v.endsWith('}') ? source[v.slice(1, -1)] ?? v : v;
|
|
15
48
|
}
|
|
16
49
|
return out;
|
|
17
50
|
}
|
|
@@ -43,9 +76,11 @@ function flattenByCategory(tokens) {
|
|
|
43
76
|
* Scheme-agnostic primitives, rebuilt once from the flat token data. Shared by
|
|
44
77
|
* both default themes (matching the previous behavior where spacing / radius /
|
|
45
78
|
* typography were singleton constants). `palette` is present at runtime for
|
|
46
|
-
* Figma parity but is not part of {@link TerraTheme}. Only the radius BASE
|
|
47
|
-
* authored here (`radius.base`); the full
|
|
48
|
-
* {@link buildRadiusScale}.
|
|
79
|
+
* Figma parity but is not part of {@link TerraTheme}. Only the radius BASE and
|
|
80
|
+
* spacing BASE are authored here (`radius.base`, `spacing.base`); the full
|
|
81
|
+
* scales are derived via {@link buildRadiusScale} / {@link buildSpacingScale}.
|
|
82
|
+
* `elevation` excludes `shadowColor`, which is layered on per-scheme from each
|
|
83
|
+
* theme's `color.shadow` token (see {@link withShadowColor}).
|
|
49
84
|
*/
|
|
50
85
|
const prim = unflatten(primitives);
|
|
51
86
|
|
|
@@ -58,6 +93,36 @@ const prim = unflatten(primitives);
|
|
|
58
93
|
*/
|
|
59
94
|
export const DEFAULT_RADIUS_BASE = prim.radius.base;
|
|
60
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Every {@link SpacingKey} — its own numeric value IS the multiplier applied
|
|
98
|
+
* to the base unit (e.g. `'5'` → `5 × base`), so no separate multiplier table
|
|
99
|
+
* is needed the way {@link RADIUS_MULTIPLIERS} is for radius.
|
|
100
|
+
*/
|
|
101
|
+
export const SPACING_KEYS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '12', '14', '16', '20', '24', '32'];
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Default spacing base unit (dp) — taken from the `spacing.base` primitive.
|
|
105
|
+
* The rest of the scale is derived from it (each step's value is its key
|
|
106
|
+
* multiplied by this base); override at runtime with
|
|
107
|
+
* `configureTerraUI({ shared: { spacing: { base } } })`, or change the
|
|
108
|
+
* `spacing.base` token.
|
|
109
|
+
*/
|
|
110
|
+
export const DEFAULT_SPACING_BASE = prim.spacing.base;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Builds the full spacing scale from a single base value. Each step's value is
|
|
114
|
+
* its key multiplied by `base` — no outliers needed, since `'0'` naturally
|
|
115
|
+
* resolves to `0` for any base.
|
|
116
|
+
*/
|
|
117
|
+
export function buildSpacingScale(base = DEFAULT_SPACING_BASE) {
|
|
118
|
+
const scale = {};
|
|
119
|
+
for (const key of SPACING_KEYS) {
|
|
120
|
+
scale[key] = Number(key) * base;
|
|
121
|
+
}
|
|
122
|
+
return scale;
|
|
123
|
+
}
|
|
124
|
+
const defaultSpacing = buildSpacingScale();
|
|
125
|
+
|
|
61
126
|
/**
|
|
62
127
|
* Per-token multipliers applied to the base radius (DaisyUI-style). `none` (0)
|
|
63
128
|
* and `full` (9999) are fixed and not scaled.
|
|
@@ -90,20 +155,36 @@ const defaultRadius = buildRadiusScale();
|
|
|
90
155
|
const lightByCategory = flattenByCategory(resolveRefs(light, primitives));
|
|
91
156
|
const darkByCategory = flattenByCategory(resolveRefs(dark, primitives));
|
|
92
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Fills in each elevation level's `shadowColor` from the theme's `color.shadow`
|
|
160
|
+
* token, rather than authoring it redundantly on every level in `light.ts` /
|
|
161
|
+
* `dark.ts`.
|
|
162
|
+
*/
|
|
163
|
+
function withShadowColor(elevation, shadowColor) {
|
|
164
|
+
const out = {};
|
|
165
|
+
for (const key of Object.keys(elevation)) {
|
|
166
|
+
out[key] = {
|
|
167
|
+
...elevation[key],
|
|
168
|
+
shadowColor
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return out;
|
|
172
|
+
}
|
|
173
|
+
|
|
93
174
|
// color: flat map — accessed as theme.color['action.bg.primary.hover']
|
|
94
|
-
// elevation:
|
|
175
|
+
// elevation: shared shape from primitives, shadowColor layered on per scheme
|
|
95
176
|
const lightTokens = {
|
|
96
177
|
color: lightByCategory.color,
|
|
97
|
-
elevation:
|
|
178
|
+
elevation: withShadowColor(prim.elevation, lightByCategory.color.shadow)
|
|
98
179
|
};
|
|
99
180
|
const darkTokens = {
|
|
100
181
|
color: darkByCategory.color,
|
|
101
|
-
elevation:
|
|
182
|
+
elevation: withShadowColor(prim.elevation, darkByCategory.color.shadow)
|
|
102
183
|
};
|
|
103
184
|
export const defaultLightTheme = {
|
|
104
185
|
color: lightTokens.color,
|
|
105
186
|
elevation: lightTokens.elevation,
|
|
106
|
-
spacing:
|
|
187
|
+
spacing: defaultSpacing,
|
|
107
188
|
radius: defaultRadius,
|
|
108
189
|
typography: prim.typography,
|
|
109
190
|
opacity: prim.opacity,
|
|
@@ -112,7 +193,7 @@ export const defaultLightTheme = {
|
|
|
112
193
|
export const defaultDarkTheme = {
|
|
113
194
|
color: darkTokens.color,
|
|
114
195
|
elevation: darkTokens.elevation,
|
|
115
|
-
spacing:
|
|
196
|
+
spacing: defaultSpacing,
|
|
116
197
|
radius: defaultRadius,
|
|
117
198
|
typography: prim.typography,
|
|
118
199
|
opacity: prim.opacity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["unflatten","dark","light","primitives","resolveRefs","flat","source","out","k","v","Object","entries","startsWith","endsWith","slice","flattenByCategory","tokens","key","value","sep","indexOf","cat","rest","undefined","prim","DEFAULT_RADIUS_BASE","radius","
|
|
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","withShadowColor","elevation","shadowColor","lightTokens","color","shadow","darkTokens","defaultLightTheme","typography","opacity","layout","defaultDarkTheme"],"sourceRoot":"../../../src","sources":["theme/theme.ts"],"mappings":";;AAAA,SAASA,SAAS;AAElB,SAASC,IAAI;AACb,SAASC,KAAK;AACd,SAASC,UAAU;AAcnB;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;AAC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oB;IAC1D/C,GAAG,CAACiB,GAAG,CAAC,GAAG;MAAE,GAAG8B,SAAS,CAAC9B,GAAG,CAAC;MAAE+B;IAAY,CAAC;EAC/C;EACA,OAAOhD,GAAG;AACZ;;AAEA;AACA;AACA,MAAMiD,WAAW,GAAG;EAClBC,KAAK,EAAEN,eAAe,CAACM,KAA8B;EACrDH,SAAS,EAAED,eAAe,CACxBtB,IAAI,CAACuB,SAAS,EACbH,eAAe,CAACM,KAAK,CAA2BC,MACnD;AACF,CAAC;AACD,MAAMC,UAAU,GAAG;EACjBF,KAAK,EAAEL,cAAc,CAACK,KAA8B;EACpDH,SAAS,EAAED,eAAe,CACxBtB,IAAI,CAACuB,SAAS,EACbF,cAAc,CAACK,KAAK,CAA2BC,MAClD;AACF,CAAC;AAED,OAAO,MAAME,iBAA6B,GAAG;EAC3CH,KAAK,EAAED,WAAW,CAACC,KAAK;EACxBH,SAAS,EAAEE,WAAW,CAACF,SAAS;EAChClB,OAAO,EAAEG,cAAc;EACvBN,MAAM,EAAEiB,aAAa;EACrBW,UAAU,EAAE9B,IAAI,CAAC8B,UAAU;EAC3BC,OAAO,EAAE/B,IAAI,CAAC+B,OAAO;EACrBC,MAAM,EAAEhC,IAAI,CAACgC;AACf,CAAC;AAED,OAAO,MAAMC,gBAA4B,GAAG;EAC1CP,KAAK,EAAEE,UAAU,CAACF,KAAK;EACvBH,SAAS,EAAEK,UAAU,CAACL,SAAS;EAC/BlB,OAAO,EAAEG,cAAc;EACvBN,MAAM,EAAEiB,aAAa;EACrBW,UAAU,EAAE9B,IAAI,CAAC8B,UAAU;EAC3BC,OAAO,EAAE/B,IAAI,CAAC+B,OAAO;EACrBC,MAAM,EAAEhC,IAAI,CAACgC;AACf,CAAC","ignoreList":[]}
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
export const dark = {
|
|
11
11
|
// ── color: page background ────────────────────────────────────────────────
|
|
12
12
|
'color.background': '{palette.neutral.950}',
|
|
13
|
+
// ── color: shadow (used as elevation.*.shadowColor) ───────────────────────
|
|
14
|
+
'color.shadow': '#000000',
|
|
13
15
|
// ── color: surfaces (bg implied — no property segment) ──────────────────
|
|
14
16
|
'color.surface.default': '{palette.neutral.900}',
|
|
15
17
|
'color.surface.raised': '{palette.neutral.800}',
|
|
@@ -19,9 +21,14 @@ export const dark = {
|
|
|
19
21
|
'color.surface.accent.subtle': '{palette.emerald.950}',
|
|
20
22
|
// ── color: text / icons (fg implied — no property segment) ──────────────
|
|
21
23
|
'color.text.default': '{palette.neutral.50}',
|
|
22
|
-
'
|
|
23
|
-
|
|
24
|
-
|
|
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',
|
|
31
|
+
'color.text.disabled': '#606069',
|
|
25
32
|
'color.text.inverse': '{palette.neutral.950}',
|
|
26
33
|
'color.text.link': '{palette.blue.300}',
|
|
27
34
|
'color.text.accent': '{palette.emerald.400}',
|
|
@@ -39,71 +46,55 @@ export const dark = {
|
|
|
39
46
|
'color.action.bg.primary.active': '{palette.emerald.300}',
|
|
40
47
|
'color.action.bg.primary.disabled': '{palette.slate.700}',
|
|
41
48
|
'color.action.fg.primary': '{palette.slate.950}',
|
|
42
|
-
'color.action.bg.subtle': '{palette.emerald.950}',
|
|
43
|
-
'color.action.bg.subtle.hover': '{palette.emerald.900}',
|
|
44
|
-
'color.action.bg.subtle.active': '{palette.emerald.800}',
|
|
45
|
-
'color.action.bg.subtle.disabled': '{palette.neutral.900}',
|
|
46
|
-
'color.action.fg.subtle': '{palette.emerald.300}',
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
|
|
50
|
-
'color.action.bg.
|
|
51
|
-
'color.action.fg.
|
|
49
|
+
'color.action.bg.primary.subtle': '{palette.emerald.950}',
|
|
50
|
+
'color.action.bg.primary.subtle.hover': '{palette.emerald.900}',
|
|
51
|
+
'color.action.bg.primary.subtle.active': '{palette.emerald.800}',
|
|
52
|
+
'color.action.bg.primary.subtle.disabled': '{palette.neutral.900}',
|
|
53
|
+
'color.action.fg.primary.subtle': '{palette.emerald.300}',
|
|
54
|
+
// `secondary`'s resting fill/text — used by Avatar/Chip's `secondary` color
|
|
55
|
+
// and Button/Toast's neutral-emphasis look; sized for real separation
|
|
56
|
+
// against `color.background` (neutral.950).
|
|
57
|
+
'color.action.bg.secondary': '{palette.neutral.600}',
|
|
58
|
+
'color.action.fg.secondary': '{palette.neutral.50}',
|
|
59
|
+
// Translucent, like light's — and like the status schemes' `/30` fills above.
|
|
60
|
+
// As opaque neutral.800 this was exactly `surface.raised`, so a soft
|
|
61
|
+
// secondary Chip/Button vanished on a raised card (1.00:1), and its opaque
|
|
62
|
+
// neutral.700 hover was indistinguishable from the resting fill there. An
|
|
63
|
+
// overlay lightens whatever it sits on, so the fill separates on all three
|
|
64
|
+
// surfaces (1.49-1.59:1, matching the success/warning chips).
|
|
65
|
+
'color.action.bg.secondary.subtle': '{palette.neutral.400}/25',
|
|
66
|
+
'color.action.bg.secondary.subtle.hover': '{palette.neutral.400}/35',
|
|
67
|
+
'color.action.bg.secondary.subtle.active': '{palette.neutral.400}/45',
|
|
68
|
+
'color.action.bg.secondary.subtle.disabled': '{palette.neutral.900}',
|
|
69
|
+
'color.action.fg.secondary.subtle': '{palette.neutral.200}',
|
|
52
70
|
// ── color: status (bg + fg + border → property required) ────────────────
|
|
53
|
-
'color.status.
|
|
54
|
-
'color.status.
|
|
55
|
-
'color.status.
|
|
56
|
-
'color.status.
|
|
57
|
-
'color.status.
|
|
58
|
-
'color.status.
|
|
59
|
-
'color.status.
|
|
60
|
-
'color.status.
|
|
61
|
-
'color.status.
|
|
62
|
-
'color.status.
|
|
63
|
-
'color.status.
|
|
64
|
-
'color.status.
|
|
65
|
-
'color.status.
|
|
66
|
-
'color.status.
|
|
67
|
-
'color.status.
|
|
68
|
-
'color.status.
|
|
69
|
-
'color.status.
|
|
70
|
-
'color.status.
|
|
71
|
-
'color.status.
|
|
72
|
-
'color.status.
|
|
73
|
-
'color.status.
|
|
74
|
-
'color.status.
|
|
75
|
-
'color.status.
|
|
76
|
-
'color.status.
|
|
77
|
-
|
|
78
|
-
'
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
'elevation.none.shadowOffset.width': 0,
|
|
82
|
-
'elevation.none.shadowOffset.height': 0,
|
|
83
|
-
'elevation.none.elevation': 0,
|
|
84
|
-
'elevation.sm.shadowColor': '#000000',
|
|
85
|
-
'elevation.sm.shadowOpacity': 0.3,
|
|
86
|
-
'elevation.sm.shadowRadius': 2,
|
|
87
|
-
'elevation.sm.shadowOffset.width': 0,
|
|
88
|
-
'elevation.sm.shadowOffset.height': 1,
|
|
89
|
-
'elevation.sm.elevation': 1,
|
|
90
|
-
'elevation.md.shadowColor': '#000000',
|
|
91
|
-
'elevation.md.shadowOpacity': 0.4,
|
|
92
|
-
'elevation.md.shadowRadius': 6,
|
|
93
|
-
'elevation.md.shadowOffset.width': 0,
|
|
94
|
-
'elevation.md.shadowOffset.height': 2,
|
|
95
|
-
'elevation.md.elevation': 3,
|
|
96
|
-
'elevation.lg.shadowColor': '#000000',
|
|
97
|
-
'elevation.lg.shadowOpacity': 0.5,
|
|
98
|
-
'elevation.lg.shadowRadius': 12,
|
|
99
|
-
'elevation.lg.shadowOffset.width': 0,
|
|
100
|
-
'elevation.lg.shadowOffset.height': 4,
|
|
101
|
-
'elevation.lg.elevation': 6,
|
|
102
|
-
'elevation.xl.shadowColor': '#000000',
|
|
103
|
-
'elevation.xl.shadowOpacity': 0.6,
|
|
104
|
-
'elevation.xl.shadowRadius': 24,
|
|
105
|
-
'elevation.xl.shadowOffset.width': 0,
|
|
106
|
-
'elevation.xl.shadowOffset.height': 8,
|
|
107
|
-
'elevation.xl.elevation': 12
|
|
71
|
+
'color.status.success': '{palette.green.600}',
|
|
72
|
+
'color.status.success.bg': '{palette.green.600}',
|
|
73
|
+
'color.status.success.bg.subtle': '{palette.green.600}/30',
|
|
74
|
+
'color.status.success.border': '{palette.green.700}',
|
|
75
|
+
'color.status.success.border.subtle': '{palette.green.800}',
|
|
76
|
+
'color.status.success.fg': '{palette.white}',
|
|
77
|
+
'color.status.success.fg.subtle': '{palette.green.200}',
|
|
78
|
+
'color.status.warning': '{palette.yellow.600}',
|
|
79
|
+
'color.status.warning.bg': '{palette.yellow.600}',
|
|
80
|
+
'color.status.warning.bg.subtle': '{palette.yellow.600}/30',
|
|
81
|
+
'color.status.warning.border': '{palette.yellow.700}',
|
|
82
|
+
'color.status.warning.border.subtle': '{palette.yellow.800}',
|
|
83
|
+
'color.status.warning.fg': '{palette.white}',
|
|
84
|
+
'color.status.warning.fg.subtle': '{palette.yellow.200}',
|
|
85
|
+
'color.status.danger': '{palette.red.700}',
|
|
86
|
+
'color.status.danger.bg': '{palette.red.700}',
|
|
87
|
+
'color.status.danger.bg.subtle': '{palette.red.700}/30',
|
|
88
|
+
'color.status.danger.border': '{palette.red.800}',
|
|
89
|
+
'color.status.danger.border.subtle': '{palette.red.900}',
|
|
90
|
+
'color.status.danger.fg': '{palette.white}',
|
|
91
|
+
'color.status.danger.fg.subtle': '{palette.red.200}',
|
|
92
|
+
'color.status.info': '{palette.sky.500}',
|
|
93
|
+
'color.status.info.bg': '{palette.sky.500}',
|
|
94
|
+
'color.status.info.bg.subtle': '{palette.sky.950}',
|
|
95
|
+
'color.status.info.border': '{palette.sky.800}',
|
|
96
|
+
'color.status.info.border.subtle': '{palette.sky.900}',
|
|
97
|
+
'color.status.info.fg': '{palette.slate.950}',
|
|
98
|
+
'color.status.info.fg.subtle': '{palette.sky.200}'
|
|
108
99
|
};
|
|
109
100
|
//# sourceMappingURL=dark.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dark"],"sourceRoot":"../../../../src","sources":["theme/tokens/dark.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,IAAI,GAAG;EAClB;EACA,kBAAkB,EAAE,uBAAuB;EAE3C;EACA,uBAAuB,EAAE,uBAAuB;EAChD,sBAAsB,EAAE,uBAAuB;EAC/C,sBAAsB,EAAE,SAAS;EACjC,uBAAuB,EAAE,qBAAqB;EAC9C,sBAAsB,EAAE,uBAAuB;EAC/C,6BAA6B,EAAE,uBAAuB;EAEtD;EACA,oBAAoB,EAAE,sBAAsB;EAC5C,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"names":["dark"],"sourceRoot":"../../../../src","sources":["theme/tokens/dark.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,IAAI,GAAG;EAClB;EACA,kBAAkB,EAAE,uBAAuB;EAE3C;EACA,cAAc,EAAE,SAAS;EAEzB;EACA,uBAAuB,EAAE,uBAAuB;EAChD,sBAAsB,EAAE,uBAAuB;EAC/C,sBAAsB,EAAE,SAAS;EACjC,uBAAuB,EAAE,qBAAqB;EAC9C,sBAAsB,EAAE,uBAAuB;EAC/C,6BAA6B,EAAE,uBAAuB;EAEtD;EACA,oBAAoB,EAAE,sBAAsB;EAC5C;EACA;EACA;EACA;EACA;EACA,kBAAkB,EAAE,SAAS;EAC7B,mBAAmB,EAAE,SAAS;EAC9B,qBAAqB,EAAE,SAAS;EAChC,oBAAoB,EAAE,uBAAuB;EAC7C,iBAAiB,EAAE,oBAAoB;EACvC,mBAAmB,EAAE,uBAAuB;EAC5C,sBAAsB,EAAE,uBAAuB;EAC/C,6BAA6B,EAAE,uBAAuB;EAEtD;EACA,qBAAqB,EAAE,uBAAuB;EAC9C,sBAAsB,EAAE,uBAAuB;EAC/C,qBAAqB,EAAE,uBAAuB;EAC9C,oBAAoB,EAAE,oBAAoB;EAC1C,q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AAsB,EAAE,mBAAmB;EAC3C,6BAA6B,EAAE,mBAAmB;EAClD,0BAA0B,EAAE,mBAAmB;EAC/C,iCAAiC,EAAE,mBAAmB;EACtD,sBAAsB,EAAE,qBAAqB;EAC7C,6BAA6B,EAAE;AACjC,CAAC","ignoreList":[]}
|
|
@@ -8,14 +8,18 @@
|
|
|
8
8
|
* - property is required when a context carries multiple attributes (action, status)
|
|
9
9
|
*
|
|
10
10
|
* Values use {palette.key} reference notation, resolved against primitives at
|
|
11
|
-
* build time via resolveRefs() in theme.ts.
|
|
11
|
+
* build time via resolveRefs() in theme.ts. {palette.key}/NN resolves the
|
|
12
|
+
* referenced #rrggbb hex with an NN% opacity byte appended (e.g.
|
|
13
|
+
* {palette.amber.500}/15 -> '#fe9a0026'). Raw hex is used only where no
|
|
12
14
|
* palette step matches exactly.
|
|
13
15
|
*
|
|
14
16
|
* GENERATED-STYLE SOURCE: intended to be replaced by the Figma / design-sync export.
|
|
15
17
|
*/
|
|
16
18
|
export const light = {
|
|
17
19
|
// ── color: page background ────────────────────────────────────────────────
|
|
18
|
-
'color.background': '#
|
|
20
|
+
'color.background': '#fbfbfb',
|
|
21
|
+
// ── color: shadow (used as elevation.*.shadowColor) ───────────────────────
|
|
22
|
+
'color.shadow': '#000000',
|
|
19
23
|
// ── color: surfaces (bg implied — no property segment) ──────────────────
|
|
20
24
|
'color.surface.default': '{palette.white}',
|
|
21
25
|
'color.surface.raised': '{palette.white}',
|
|
@@ -45,71 +49,49 @@ export const light = {
|
|
|
45
49
|
'color.action.bg.primary.active': '{palette.emerald.800}',
|
|
46
50
|
'color.action.bg.primary.disabled': '{palette.slate.200}',
|
|
47
51
|
'color.action.fg.primary': '{palette.white}',
|
|
48
|
-
'color.action.bg.subtle': '{palette.emerald.100}',
|
|
49
|
-
'color.action.bg.subtle.hover': '{palette.emerald.200}',
|
|
50
|
-
'color.action.bg.subtle.active': '{palette.emerald.300}',
|
|
51
|
-
'color.action.bg.subtle.disabled': '{palette.slate.100}',
|
|
52
|
-
'color.action.fg.subtle': '{palette.emerald.700}',
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
|
|
56
|
-
'color.action.bg.
|
|
57
|
-
'color.action.fg.
|
|
52
|
+
'color.action.bg.primary.subtle': '{palette.emerald.100}',
|
|
53
|
+
'color.action.bg.primary.subtle.hover': '{palette.emerald.200}',
|
|
54
|
+
'color.action.bg.primary.subtle.active': '{palette.emerald.300}',
|
|
55
|
+
'color.action.bg.primary.subtle.disabled': '{palette.slate.100}',
|
|
56
|
+
'color.action.fg.primary.subtle': '{palette.emerald.700}',
|
|
57
|
+
// `secondary`'s resting fill/text — used by Avatar/Chip's `secondary` color
|
|
58
|
+
// and Button/Toast's neutral-emphasis look; sized for real separation
|
|
59
|
+
// against `color.background` (#f9f9fb), not just a tint.
|
|
60
|
+
'color.action.bg.secondary': '{palette.neutral.200}',
|
|
61
|
+
'color.action.fg.secondary': '{palette.neutral.900}',
|
|
62
|
+
'color.action.bg.secondary.subtle': '{palette.neutral.400}/15',
|
|
63
|
+
'color.action.bg.secondary.subtle.hover': '{palette.neutral.400}/25',
|
|
64
|
+
'color.action.bg.secondary.subtle.active': '{palette.neutral.400}/35',
|
|
65
|
+
'color.action.bg.secondary.subtle.disabled': '{palette.slate.100}',
|
|
66
|
+
'color.action.fg.secondary.subtle': '{palette.neutral.700}',
|
|
58
67
|
// ── color: status (bg + fg + border → property required) ────────────────
|
|
59
|
-
'color.status.
|
|
60
|
-
'color.status.
|
|
61
|
-
'color.status.
|
|
62
|
-
'color.status.
|
|
63
|
-
'color.status.
|
|
64
|
-
'color.status.
|
|
65
|
-
'color.status.
|
|
66
|
-
'color.status.
|
|
67
|
-
'color.status.
|
|
68
|
-
'color.status.
|
|
69
|
-
'color.status.
|
|
70
|
-
'color.status.
|
|
71
|
-
'color.status.
|
|
72
|
-
'color.status.
|
|
73
|
-
'color.status.
|
|
74
|
-
'color.status.
|
|
75
|
-
'color.status.
|
|
76
|
-
'color.status.
|
|
77
|
-
'color.status.
|
|
78
|
-
'color.status.
|
|
79
|
-
'color.status.
|
|
80
|
-
'color.status.
|
|
81
|
-
'color.status.
|
|
82
|
-
'color.status.
|
|
83
|
-
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
'elevation.none.shadowOffset.width': 0,
|
|
88
|
-
'elevation.none.shadowOffset.height': 0,
|
|
89
|
-
'elevation.none.elevation': 0,
|
|
90
|
-
'elevation.sm.shadowColor': '#000000',
|
|
91
|
-
'elevation.sm.shadowOpacity': 0.1,
|
|
92
|
-
'elevation.sm.shadowRadius': 3,
|
|
93
|
-
'elevation.sm.shadowOffset.width': 0,
|
|
94
|
-
'elevation.sm.shadowOffset.height': 1,
|
|
95
|
-
'elevation.sm.elevation': 1,
|
|
96
|
-
'elevation.md.shadowColor': '#000000',
|
|
97
|
-
'elevation.md.shadowOpacity': 0.12,
|
|
98
|
-
'elevation.md.shadowRadius': 8,
|
|
99
|
-
'elevation.md.shadowOffset.width': 0,
|
|
100
|
-
'elevation.md.shadowOffset.height': 2,
|
|
101
|
-
'elevation.md.elevation': 3,
|
|
102
|
-
'elevation.lg.shadowColor': '#000000',
|
|
103
|
-
'elevation.lg.shadowOpacity': 0.12,
|
|
104
|
-
'elevation.lg.shadowRadius': 12,
|
|
105
|
-
'elevation.lg.shadowOffset.width': 0,
|
|
106
|
-
'elevation.lg.shadowOffset.height': 4,
|
|
107
|
-
'elevation.lg.elevation': 6,
|
|
108
|
-
'elevation.xl.shadowColor': '#000000',
|
|
109
|
-
'elevation.xl.shadowOpacity': 0.16,
|
|
110
|
-
'elevation.xl.shadowRadius': 24,
|
|
111
|
-
'elevation.xl.shadowOffset.width': 0,
|
|
112
|
-
'elevation.xl.shadowOffset.height': 8,
|
|
113
|
-
'elevation.xl.elevation': 12
|
|
68
|
+
'color.status.success': '{palette.green.600}',
|
|
69
|
+
'color.status.success.bg': '{palette.green.600}',
|
|
70
|
+
'color.status.success.bg.subtle': '{palette.green.600}/20',
|
|
71
|
+
'color.status.success.border': '{palette.green.300}',
|
|
72
|
+
'color.status.success.border.subtle': '{palette.green.200}',
|
|
73
|
+
'color.status.success.fg': '{palette.white}',
|
|
74
|
+
'color.status.success.fg.subtle': '{palette.green.800}',
|
|
75
|
+
'color.status.warning': '{palette.yellow.500}',
|
|
76
|
+
'color.status.warning.bg': '{palette.yellow.500}',
|
|
77
|
+
'color.status.warning.bg.subtle': '{palette.yellow.500}/20',
|
|
78
|
+
'color.status.warning.border': '{palette.yellow.300}',
|
|
79
|
+
'color.status.warning.border.subtle': '{palette.yellow.200}',
|
|
80
|
+
'color.status.warning.fg': '{palette.slate.950}',
|
|
81
|
+
'color.status.warning.fg.subtle': '{palette.yellow.800}',
|
|
82
|
+
'color.status.danger': '{palette.red.400}',
|
|
83
|
+
'color.status.danger.bg': '{palette.red.400}',
|
|
84
|
+
'color.status.danger.bg.subtle': '{palette.red.500}/20',
|
|
85
|
+
'color.status.danger.border': '{palette.red.500}',
|
|
86
|
+
'color.status.danger.border.subtle': '{palette.red.200}',
|
|
87
|
+
'color.status.danger.fg': '{palette.white}',
|
|
88
|
+
'color.status.danger.fg.subtle': '{palette.red.800}',
|
|
89
|
+
'color.status.info': '{palette.sky.600}',
|
|
90
|
+
'color.status.info.bg': '{palette.sky.600}',
|
|
91
|
+
'color.status.info.bg.subtle': '{palette.sky.100}',
|
|
92
|
+
'color.status.info.border': '{palette.sky.300}',
|
|
93
|
+
'color.status.info.border.subtle': '{palette.sky.200}',
|
|
94
|
+
'color.status.info.fg': '{palette.white}',
|
|
95
|
+
'color.status.info.fg.subtle': '{palette.sky.800}'
|
|
114
96
|
};
|
|
115
97
|
//# sourceMappingURL=light.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["light"],"sourceRoot":"../../../../src","sources":["theme/tokens/light.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM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