@datalayer/primer-addons 1.0.36 → 1.0.38
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/README.md +19 -1
- package/lib/components/appearance/AppearanceControls.js +5 -0
- package/lib/reactor/index.d.ts +1 -1
- package/lib/reactor/index.js +1 -1
- package/lib/reactor/page-layout/PageLayout.d.ts +6 -0
- package/lib/reactor/page-layout/PageLayout.js +26 -0
- package/lib/theme/DatalayerThemeProvider.js +5 -2
- package/lib/theme/css/createThemeCSSVars.d.ts +5 -0
- package/lib/theme/css/createThemeCSSVars.js +2 -0
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.js +1 -0
- package/lib/theme/loopEyes.d.ts +84 -0
- package/lib/theme/loopEyes.js +82 -0
- package/lib/theme/portable.d.ts +16 -0
- package/lib/theme/portable.js +20 -0
- package/lib/theme/portableTheme.d.ts +1 -1
- package/lib/theme/portableTheme.js +2 -2
- package/lib/theme/themeRegistry.d.ts +3 -75
- package/lib/theme/themeRegistry.js +38 -509
- package/lib/theme/themeTokens.d.ts +101 -0
- package/lib/theme/themeTokens.js +494 -0
- package/lib/theme/themes/datalayerTheme.d.ts +2 -9
- package/lib/theme/themes/datalayerTheme.js +8 -236
- package/lib/theme/themes/datalayerThemeStyles.d.ts +2 -0
- package/lib/theme/themes/datalayerThemeStyles.js +234 -0
- package/lib/theme/themes/earthTheme.d.ts +2 -9
- package/lib/theme/themes/earthTheme.js +8 -235
- package/lib/theme/themes/earthThemeStyles.d.ts +2 -0
- package/lib/theme/themes/earthThemeStyles.js +233 -0
- package/lib/theme/themes/ivoryTheme.d.ts +2 -9
- package/lib/theme/themes/ivoryTheme.js +8 -249
- package/lib/theme/themes/ivoryThemeStyles.d.ts +2 -0
- package/lib/theme/themes/ivoryThemeStyles.js +247 -0
- package/lib/theme/themes/loopTheme.d.ts +13 -144
- package/lib/theme/themes/loopTheme.js +20 -517
- package/lib/theme/themes/loopThemeStyles.d.ts +135 -0
- package/lib/theme/themes/loopThemeStyles.js +521 -0
- package/lib/theme/themes/lovelyTheme.d.ts +2 -9
- package/lib/theme/themes/lovelyTheme.js +8 -231
- package/lib/theme/themes/lovelyThemeStyles.d.ts +2 -0
- package/lib/theme/themes/lovelyThemeStyles.js +229 -0
- package/lib/theme/themes/matrixTheme.d.ts +2 -9
- package/lib/theme/themes/matrixTheme.js +8 -237
- package/lib/theme/themes/matrixThemeStyles.d.ts +2 -0
- package/lib/theme/themes/matrixThemeStyles.js +235 -0
- package/lib/theme/themes/sandTheme.d.ts +2 -9
- package/lib/theme/themes/sandTheme.js +8 -248
- package/lib/theme/themes/sandThemeStyles.d.ts +2 -0
- package/lib/theme/themes/sandThemeStyles.js +246 -0
- package/lib/theme/themes/spatialTheme.d.ts +2 -9
- package/lib/theme/themes/spatialTheme.js +8 -231
- package/lib/theme/themes/spatialThemeStyles.d.ts +2 -0
- package/lib/theme/themes/spatialThemeStyles.js +229 -0
- package/lib/theme/themes/sunTheme.d.ts +2 -9
- package/lib/theme/themes/sunTheme.js +8 -249
- package/lib/theme/themes/sunThemeStyles.d.ts +2 -0
- package/lib/theme/themes/sunThemeStyles.js +247 -0
- package/lib/utils/Portals.d.ts +7 -0
- package/lib/utils/Portals.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The themes as data: labels, colour modes, CSS-variable styles, gradients
|
|
3
|
+
* and palettes, with no dependency on Primer React, the DOM or React. What a
|
|
4
|
+
* native app or a build script reads. `themeRegistry` adds the Primer theme
|
|
5
|
+
* object and the browser-aware helpers on top.
|
|
6
|
+
*/
|
|
7
|
+
import { type ColorMode } from './DatalayerBrandThemeProvider';
|
|
8
|
+
import { type ThemeStyles } from './css/createThemeCSSVars';
|
|
9
|
+
/** Available theme variants. */
|
|
10
|
+
export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth' | 'sand' | 'ivory' | 'sun' | 'loop';
|
|
11
|
+
/** A pair of colours for a two-stop gradient. */
|
|
12
|
+
export interface GradientPair {
|
|
13
|
+
/** Start colour (brighter / brand). */
|
|
14
|
+
from: string;
|
|
15
|
+
/** End colour (deeper / hover). */
|
|
16
|
+
to: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Vivid colour triplet for SVG illustrations.
|
|
20
|
+
*
|
|
21
|
+
* Inspired by OpenAI's blog — ultra-saturated, luminous hues designed
|
|
22
|
+
* to glow and pop against both light and dark backgrounds.
|
|
23
|
+
*/
|
|
24
|
+
export interface BrightPalette {
|
|
25
|
+
/** Primary vivid accent — the "star" glow colour. */
|
|
26
|
+
glow: string;
|
|
27
|
+
/** Optimal text colour for content rendered on a `glow` background. */
|
|
28
|
+
onGlow: string;
|
|
29
|
+
/** Contrasting vivid colour — analogous/complement. */
|
|
30
|
+
pop: string;
|
|
31
|
+
/** Third vivid colour — sparkle / small highlights. */
|
|
32
|
+
spark: string;
|
|
33
|
+
/** Vivid red / warm accent — energy, urgency, warmth. */
|
|
34
|
+
blaze: string;
|
|
35
|
+
/** Vivid blue / cool accent — depth, trust, electricity. */
|
|
36
|
+
surge: string;
|
|
37
|
+
/** Vivid orange — warm energy, fire, dynamism. */
|
|
38
|
+
flame: string;
|
|
39
|
+
/** Vivid yellow / gold — highlights, attention, optimism. */
|
|
40
|
+
gold: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A theme as data: display metadata and CSS custom property overrides per
|
|
44
|
+
* color mode. `ThemeConfig` (in `themeRegistry`) adds the Primer theme object.
|
|
45
|
+
*/
|
|
46
|
+
export interface ThemeTokens {
|
|
47
|
+
/** Human-readable name for UI display. */
|
|
48
|
+
label: string;
|
|
49
|
+
/** Short description of the theme. */
|
|
50
|
+
description: string;
|
|
51
|
+
/** Brand color for the theme — used for colored swatch buttons. */
|
|
52
|
+
brandColor: string;
|
|
53
|
+
/** Recommended default color mode for this theme. */
|
|
54
|
+
defaultColorMode: ColorMode;
|
|
55
|
+
/**
|
|
56
|
+
* Per-mode CSS-property overrides for `<DatalayerThemeProvider themeStyles={…}>`,
|
|
57
|
+
* and the theme's own scoped stylesheet when it has one (`ThemeStyles.css`).
|
|
58
|
+
*/
|
|
59
|
+
themeStyles: ThemeStyles;
|
|
60
|
+
/**
|
|
61
|
+
* Per-mode gradient pair for card backgrounds, banners, and other
|
|
62
|
+
* decorative surfaces that need a themed two-colour gradient.
|
|
63
|
+
*/
|
|
64
|
+
cardGradient: {
|
|
65
|
+
light: GradientPair;
|
|
66
|
+
dark: GradientPair;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Vivid colour triplet for SVG illustrations — ultra-saturated,
|
|
70
|
+
* luminous hues that glow and pop on dark backgrounds (OpenAI-blog style).
|
|
71
|
+
*/
|
|
72
|
+
brightPalette: BrightPalette;
|
|
73
|
+
/**
|
|
74
|
+
* Deeper / richer bright palette for light backgrounds.
|
|
75
|
+
* Same hue families as `brightPalette` but with higher contrast on
|
|
76
|
+
* light surfaces so illustrations don't appear faded.
|
|
77
|
+
*/
|
|
78
|
+
brightPaletteLight: BrightPalette;
|
|
79
|
+
}
|
|
80
|
+
export declare const themeTokens: Record<ThemeVariant, ThemeTokens>;
|
|
81
|
+
/** All available theme variants in display order. */
|
|
82
|
+
export declare const themeVariants: ThemeVariant[];
|
|
83
|
+
/** Look up a theme's tokens by variant name. */
|
|
84
|
+
export declare function getThemeTokens(variant: ThemeVariant): ThemeTokens;
|
|
85
|
+
/**
|
|
86
|
+
* Resolve the card gradient for a given theme variant and colour mode.
|
|
87
|
+
* Falls back to `datalayer` / `light` when values are missing.
|
|
88
|
+
*/
|
|
89
|
+
export declare function getCardGradient(variant?: ThemeVariant, colorMode?: 'light' | 'dark' | 'auto'): GradientPair;
|
|
90
|
+
/**
|
|
91
|
+
* The bright (vivid) palette of a theme for a resolved colour mode: the
|
|
92
|
+
* light-background palette in light mode, the neon one in dark mode.
|
|
93
|
+
* `getBrightPalette` (in `themeRegistry`) also resolves `'auto'` from the OS.
|
|
94
|
+
*/
|
|
95
|
+
export declare function brightPaletteOf(variant: ThemeVariant, mode: 'light' | 'dark'): BrightPalette;
|
|
96
|
+
/**
|
|
97
|
+
* The 5-colour avatar palette of a theme for a resolved colour mode, for the
|
|
98
|
+
* `boring-avatars` library's `colors` prop. `getAvatarColors` (in
|
|
99
|
+
* `themeRegistry`) also resolves `'auto'` from the OS.
|
|
100
|
+
*/
|
|
101
|
+
export declare function avatarColorsOf(variant: ThemeVariant, mode: 'light' | 'dark'): string[];
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { datalayerThemeStyles } from './themes/datalayerThemeStyles';
|
|
6
|
+
import { spatialThemeStyles } from './themes/spatialThemeStyles';
|
|
7
|
+
import { lovelyThemeStyles } from './themes/lovelyThemeStyles';
|
|
8
|
+
import { matrixThemeStyles } from './themes/matrixThemeStyles';
|
|
9
|
+
import { earthThemeStyles } from './themes/earthThemeStyles';
|
|
10
|
+
import { sandThemeStyles } from './themes/sandThemeStyles';
|
|
11
|
+
import { ivoryThemeStyles } from './themes/ivoryThemeStyles';
|
|
12
|
+
import { sunThemeStyles } from './themes/sunThemeStyles';
|
|
13
|
+
import { loopThemeStyles } from './themes/loopThemeStyles';
|
|
14
|
+
import { datalayerColors } from './colors/datalayerColors';
|
|
15
|
+
import { spatialColors } from './colors/spatialColors';
|
|
16
|
+
import { lovelyColors } from './colors/lovelyColors';
|
|
17
|
+
import { matrixColors } from './colors/matrixColors';
|
|
18
|
+
import { earthColors } from './colors/earthColors';
|
|
19
|
+
import { sandColors } from './colors/sandColors';
|
|
20
|
+
import { ivoryColors } from './colors/ivoryColors';
|
|
21
|
+
import { sunColors } from './colors/sunColors';
|
|
22
|
+
import { loopColors } from './colors/loopColors';
|
|
23
|
+
/* ─── Registry ────────────────────────────────────────────────────────── */
|
|
24
|
+
export const themeTokens = {
|
|
25
|
+
datalayer: {
|
|
26
|
+
label: 'Datalayer',
|
|
27
|
+
description: 'Default green palette — the classic Datalayer look.',
|
|
28
|
+
brandColor: datalayerColors.greenBrand,
|
|
29
|
+
defaultColorMode: 'auto',
|
|
30
|
+
themeStyles: datalayerThemeStyles,
|
|
31
|
+
cardGradient: {
|
|
32
|
+
light: { from: datalayerColors.greenBrand, to: datalayerColors.greenText }, // #16A085 → #117A65
|
|
33
|
+
dark: { from: datalayerColors.greenAccent, to: datalayerColors.greenBrand }, // #1ABC9C → #16A085
|
|
34
|
+
},
|
|
35
|
+
brightPalette: {
|
|
36
|
+
glow: datalayerColors.brightGlow, // #00D68F — vivid emerald
|
|
37
|
+
onGlow: '#1b1f24', // dark text on bright green
|
|
38
|
+
pop: datalayerColors.brightPop, // #00E5FF — electric cyan
|
|
39
|
+
spark: datalayerColors.brightSpark, // #76FF03 — lime neon
|
|
40
|
+
blaze: datalayerColors.brightBlaze, // #FF1744 — vivid red
|
|
41
|
+
surge: datalayerColors.brightSurge, // #2979FF — electric blue
|
|
42
|
+
flame: datalayerColors.brightFlame, // #FF6D00 — vivid orange
|
|
43
|
+
gold: datalayerColors.brightGold, // #FFD600 — vivid yellow
|
|
44
|
+
},
|
|
45
|
+
brightPaletteLight: {
|
|
46
|
+
glow: datalayerColors.brightLightGlow, // #00BFA5 — vivid aqua-green
|
|
47
|
+
onGlow: '#1b1f24', // dark text on aqua-green
|
|
48
|
+
pop: datalayerColors.brightLightPop, // #00B0FF — vivid sky blue
|
|
49
|
+
spark: datalayerColors.brightLightSpark, // #64DD17 — vivid chartreuse
|
|
50
|
+
blaze: datalayerColors.brightLightBlaze, // #FF1744 — vivid red
|
|
51
|
+
surge: datalayerColors.brightLightSurge, // #2979FF — electric blue
|
|
52
|
+
flame: datalayerColors.brightLightFlame, // #FF6D00 — vivid orange
|
|
53
|
+
gold: datalayerColors.brightLightGold, // #FFAB00 — vivid amber
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
spatial: {
|
|
57
|
+
label: 'Spatial',
|
|
58
|
+
description: 'Cosmic indigo & deep blues — inspired by space.',
|
|
59
|
+
brandColor: spatialColors.indigoBrand,
|
|
60
|
+
defaultColorMode: 'auto',
|
|
61
|
+
themeStyles: spatialThemeStyles,
|
|
62
|
+
cardGradient: {
|
|
63
|
+
light: { from: spatialColors.indigoBrand, to: spatialColors.indigoText }, // #4F46E5 → #3730A3
|
|
64
|
+
dark: { from: spatialColors.indigoAccent, to: spatialColors.indigoBrand }, // #6366F1 → #4F46E5
|
|
65
|
+
},
|
|
66
|
+
brightPalette: {
|
|
67
|
+
glow: spatialColors.brightGlow, // #7C4DFF — electric violet
|
|
68
|
+
onGlow: '#ffffff', // white text on violet
|
|
69
|
+
pop: spatialColors.brightPop, // #448AFF — neon blue
|
|
70
|
+
spark: spatialColors.brightSpark, // #E040FB — vivid magenta
|
|
71
|
+
blaze: spatialColors.brightBlaze, // #FF5252 — neon red
|
|
72
|
+
surge: spatialColors.brightSurge, // #00B0FF — deep sky blue
|
|
73
|
+
flame: spatialColors.brightFlame, // #FF9100 — amber orange
|
|
74
|
+
gold: spatialColors.brightGold, // #FFEA00 — electric yellow
|
|
75
|
+
},
|
|
76
|
+
brightPaletteLight: {
|
|
77
|
+
glow: spatialColors.brightLightGlow, // #7C4DFF — electric violet
|
|
78
|
+
onGlow: '#ffffff', // white text on violet
|
|
79
|
+
pop: spatialColors.brightLightPop, // #448AFF — neon blue
|
|
80
|
+
spark: spatialColors.brightLightSpark, // #D500F9 — vivid purple
|
|
81
|
+
blaze: spatialColors.brightLightBlaze, // #FF5252 — neon red
|
|
82
|
+
surge: spatialColors.brightLightSurge, // #00B0FF — vivid sky blue
|
|
83
|
+
flame: spatialColors.brightLightFlame, // #FF9100 — vivid amber orange
|
|
84
|
+
gold: spatialColors.brightLightGold, // #FFC400 — vivid gold
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
lovely: {
|
|
88
|
+
label: 'Lovely',
|
|
89
|
+
description: 'Warm rose & magenta — soft and inviting.',
|
|
90
|
+
brandColor: lovelyColors.roseBrand,
|
|
91
|
+
defaultColorMode: 'auto',
|
|
92
|
+
themeStyles: lovelyThemeStyles,
|
|
93
|
+
cardGradient: {
|
|
94
|
+
light: { from: lovelyColors.roseBrand, to: lovelyColors.roseText }, // #DB2777 → #9D174D
|
|
95
|
+
dark: { from: lovelyColors.roseAccent, to: lovelyColors.roseBrand }, // #EC4899 → #DB2777
|
|
96
|
+
},
|
|
97
|
+
brightPalette: {
|
|
98
|
+
glow: lovelyColors.brightGlow, // #FF4081 — hot pink
|
|
99
|
+
onGlow: '#ffffff', // white text on hot pink
|
|
100
|
+
pop: lovelyColors.brightPop, // #FF6E40 — vivid coral
|
|
101
|
+
spark: lovelyColors.brightSpark, // #EA80FC — electric fuchsia
|
|
102
|
+
blaze: lovelyColors.brightBlaze, // #FF1744 — vivid crimson
|
|
103
|
+
surge: lovelyColors.brightSurge, // #536DFE — indigo blue
|
|
104
|
+
flame: lovelyColors.brightFlame, // #FF6E40 — coral orange
|
|
105
|
+
gold: lovelyColors.brightGold, // #FFD740 — amber gold
|
|
106
|
+
},
|
|
107
|
+
brightPaletteLight: {
|
|
108
|
+
glow: lovelyColors.brightLightGlow, // #FF4081 — hot pink
|
|
109
|
+
onGlow: '#ffffff', // white text on hot pink
|
|
110
|
+
pop: lovelyColors.brightLightPop, // #FF6E40 — vivid coral
|
|
111
|
+
spark: lovelyColors.brightLightSpark, // #EA80FC — electric fuchsia
|
|
112
|
+
blaze: lovelyColors.brightLightBlaze, // #FF1744 — vivid crimson
|
|
113
|
+
surge: lovelyColors.brightLightSurge, // #536DFE — vivid indigo
|
|
114
|
+
flame: lovelyColors.brightLightFlame, // #FF6E40 — vivid coral orange
|
|
115
|
+
gold: lovelyColors.brightLightGold, // #FFD740 — vivid amber gold
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
matrix: {
|
|
119
|
+
label: 'Matrix',
|
|
120
|
+
description: 'Phosphor green on black — CRT terminal aesthetic.',
|
|
121
|
+
brandColor: matrixColors.greenPhosphor,
|
|
122
|
+
defaultColorMode: 'dark',
|
|
123
|
+
themeStyles: matrixThemeStyles,
|
|
124
|
+
cardGradient: {
|
|
125
|
+
light: { from: matrixColors.greenBrand, to: matrixColors.greenText }, // #16A085 → #117A65
|
|
126
|
+
dark: { from: matrixColors.greenGlow, to: matrixColors.greenHover }, // #39FF14 → #0E6655
|
|
127
|
+
},
|
|
128
|
+
brightPalette: {
|
|
129
|
+
glow: matrixColors.brightGlow, // #39FF14 — neon green
|
|
130
|
+
onGlow: '#1b1f24', // dark text on neon green
|
|
131
|
+
pop: matrixColors.brightPop, // #00FF88 — phosphor cyan
|
|
132
|
+
spark: matrixColors.brightSpark, // #CCFF00 — acid lime
|
|
133
|
+
blaze: matrixColors.brightBlaze, // #FF0040 — matrix red pill
|
|
134
|
+
surge: matrixColors.brightSurge, // #00E5FF — electric blue
|
|
135
|
+
flame: matrixColors.brightFlame, // #FF6D00 — electric orange
|
|
136
|
+
gold: matrixColors.brightGold, // #FFEA00 — glitch yellow
|
|
137
|
+
},
|
|
138
|
+
brightPaletteLight: {
|
|
139
|
+
glow: matrixColors.brightLightGlow, // #00E676 — vivid green
|
|
140
|
+
onGlow: '#1b1f24', // dark text on vivid green
|
|
141
|
+
pop: matrixColors.brightLightPop, // #1DE9B6 — vivid teal-mint
|
|
142
|
+
spark: matrixColors.brightLightSpark, // #AEEA00 — vivid lime
|
|
143
|
+
blaze: matrixColors.brightLightBlaze, // #FF1744 — vivid red
|
|
144
|
+
surge: matrixColors.brightLightSurge, // #00B0FF — vivid sky blue
|
|
145
|
+
flame: matrixColors.brightLightFlame, // #FF6D00 — vivid orange
|
|
146
|
+
gold: matrixColors.brightLightGold, // #FFAB00 — vivid amber
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
earth: {
|
|
150
|
+
label: 'Earth',
|
|
151
|
+
description: 'Ocean blues, forest greens & golden sun — the Blue Planet.',
|
|
152
|
+
brandColor: earthColors.oceanBrand,
|
|
153
|
+
defaultColorMode: 'auto',
|
|
154
|
+
themeStyles: earthThemeStyles,
|
|
155
|
+
cardGradient: {
|
|
156
|
+
light: { from: earthColors.oceanBrand, to: earthColors.oceanText }, // #0369A1 → #075985
|
|
157
|
+
dark: { from: earthColors.oceanAccent, to: earthColors.oceanBrand }, // #0EA5E9 → #0369A1
|
|
158
|
+
},
|
|
159
|
+
brightPalette: {
|
|
160
|
+
glow: earthColors.brightGlow, // #0EA5E9 — vivid ocean blue
|
|
161
|
+
onGlow: '#ffffff', // white text on ocean blue
|
|
162
|
+
pop: earthColors.brightPop, // #22C55E — vivid green
|
|
163
|
+
spark: earthColors.brightSpark, // #EAB308 — vivid gold
|
|
164
|
+
blaze: earthColors.brightBlaze, // #EF4444 — vivid red
|
|
165
|
+
surge: earthColors.brightSurge, // #3B82F6 — deep blue
|
|
166
|
+
flame: earthColors.brightFlame, // #F59E0B — amber gold
|
|
167
|
+
gold: earthColors.brightGold, // #FACC15 — sunflower
|
|
168
|
+
},
|
|
169
|
+
brightPaletteLight: {
|
|
170
|
+
glow: earthColors.brightLightGlow, // #0284C7 — deep ocean blue
|
|
171
|
+
onGlow: '#ffffff', // white text on deep ocean
|
|
172
|
+
pop: earthColors.brightLightPop, // #16A34A — vivid forest green
|
|
173
|
+
spark: earthColors.brightLightSpark, // #CA8A04 — deep golden sun
|
|
174
|
+
blaze: earthColors.brightLightBlaze, // #DC2626 — deep red
|
|
175
|
+
surge: earthColors.brightLightSurge, // #2563EB — deep ocean blue
|
|
176
|
+
flame: earthColors.brightLightFlame, // #D97706 — deep amber
|
|
177
|
+
gold: earthColors.brightLightGold, // #A16207 — deep gold
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
sand: {
|
|
181
|
+
label: 'Sand',
|
|
182
|
+
description: 'Warm, pale desert neutrals with a golden accent — calm & editorial.',
|
|
183
|
+
brandColor: sandColors.sandBrand,
|
|
184
|
+
defaultColorMode: 'light',
|
|
185
|
+
themeStyles: sandThemeStyles,
|
|
186
|
+
cardGradient: {
|
|
187
|
+
light: { from: sandColors.sandBrand, to: sandColors.sandText }, // #B07A4E → #8A5A34
|
|
188
|
+
dark: { from: sandColors.sandAccent, to: sandColors.sandBrand }, // #C99A6B → #B07A4E
|
|
189
|
+
},
|
|
190
|
+
brightPalette: {
|
|
191
|
+
glow: sandColors.brightGlow, // #E0A15C — warm sand glow
|
|
192
|
+
onGlow: '#211A12', // dark text on warm sand
|
|
193
|
+
pop: sandColors.brightPop, // #D98A5A — clay
|
|
194
|
+
spark: sandColors.brightSpark, // #E7C24E — wheat gold
|
|
195
|
+
blaze: sandColors.brightBlaze, // #E06A45 — terracotta
|
|
196
|
+
surge: sandColors.brightSurge, // #8FA98A — sage
|
|
197
|
+
flame: sandColors.brightFlame, // #E68A34 — amber
|
|
198
|
+
gold: sandColors.brightGold, // #EBCB5E — golden wheat
|
|
199
|
+
},
|
|
200
|
+
brightPaletteLight: {
|
|
201
|
+
glow: sandColors.brightLightGlow, // #8A5A34 — deep clay
|
|
202
|
+
onGlow: '#ffffff', // white text on deep clay
|
|
203
|
+
pop: sandColors.brightLightPop, // #A9633B — deep terracotta-clay
|
|
204
|
+
spark: sandColors.brightLightSpark, // #B08A16 — deep wheat gold
|
|
205
|
+
blaze: sandColors.brightLightBlaze, // #B0432A — deep terracotta
|
|
206
|
+
surge: sandColors.brightLightSurge, // #5E7A5A — deep sage
|
|
207
|
+
flame: sandColors.brightLightFlame, // #B0661E — deep amber
|
|
208
|
+
gold: sandColors.brightLightGold, // #997B1A — deep gold
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
ivory: {
|
|
212
|
+
label: 'Ivory',
|
|
213
|
+
description: 'Soft, warm off-white that creates a calm, refined, and welcoming feeling.',
|
|
214
|
+
brandColor: ivoryColors.ivoryBrand,
|
|
215
|
+
defaultColorMode: 'light',
|
|
216
|
+
themeStyles: ivoryThemeStyles,
|
|
217
|
+
cardGradient: {
|
|
218
|
+
light: { from: ivoryColors.ivoryBrand, to: ivoryColors.ivoryText }, // #E6D2B5 → #6B5A3E
|
|
219
|
+
dark: { from: ivoryColors.ivoryAccent, to: ivoryColors.ivoryBrand }, // #D8C09B → #E6D2B5
|
|
220
|
+
},
|
|
221
|
+
brightPalette: {
|
|
222
|
+
glow: ivoryColors.brightGlow, // #E6D2B5 — ivory glow
|
|
223
|
+
onGlow: '#211A12', // dark text on warm ivory
|
|
224
|
+
pop: ivoryColors.brightPop, // #D8B27E — warm tan
|
|
225
|
+
spark: ivoryColors.brightSpark, // #EFDFC2 — bright ivory
|
|
226
|
+
blaze: ivoryColors.brightBlaze, // #DD7048 — soft terracotta
|
|
227
|
+
surge: ivoryColors.brightSurge, // #98A783 — sage
|
|
228
|
+
flame: ivoryColors.brightFlame, // #E0912F — amber
|
|
229
|
+
gold: ivoryColors.brightGold, // #EACF6A — soft gold
|
|
230
|
+
},
|
|
231
|
+
brightPaletteLight: {
|
|
232
|
+
glow: ivoryColors.brightLightGlow, // #6B5A3E — deep taupe
|
|
233
|
+
onGlow: '#ffffff', // white text on deep taupe
|
|
234
|
+
pop: ivoryColors.brightLightPop, // #9C6626 — deep amber-tan
|
|
235
|
+
spark: ivoryColors.brightLightSpark, // #8A7320 — deep gold
|
|
236
|
+
blaze: ivoryColors.brightLightBlaze, // #AB4229 — deep terracotta
|
|
237
|
+
surge: ivoryColors.brightLightSurge, // #5C6C4C — deep sage
|
|
238
|
+
flame: ivoryColors.brightLightFlame, // #9C6221 — deep amber
|
|
239
|
+
gold: ivoryColors.brightLightGold, // #836A18 — deep gold
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
sun: {
|
|
243
|
+
label: 'Sun',
|
|
244
|
+
description: 'Warm, radiant theme inspired by golden light, bringing energy, optimism, and a welcoming atmosphere.',
|
|
245
|
+
brandColor: sunColors.sunBrand,
|
|
246
|
+
defaultColorMode: 'light',
|
|
247
|
+
themeStyles: sunThemeStyles,
|
|
248
|
+
cardGradient: {
|
|
249
|
+
light: { from: sunColors.sunBrand, to: sunColors.sunText }, // #FFC107 → #8A5300
|
|
250
|
+
dark: { from: sunColors.sunAccent, to: sunColors.sunBrand }, // #F0A800 → #FFC107
|
|
251
|
+
},
|
|
252
|
+
brightPalette: {
|
|
253
|
+
glow: sunColors.brightGlow, // #FFC107 — amber glow
|
|
254
|
+
onGlow: '#211A08', // dark text on radiant amber
|
|
255
|
+
pop: sunColors.brightPop, // #FF9F1C — vivid orange-amber
|
|
256
|
+
spark: sunColors.brightSpark, // #FFD54A — bright sun
|
|
257
|
+
blaze: sunColors.brightBlaze, // #FF6B35 — coral-orange
|
|
258
|
+
surge: sunColors.brightSurge, // #4FB0C6 — sky blue
|
|
259
|
+
flame: sunColors.brightFlame, // #FF8500 — amber flame
|
|
260
|
+
gold: sunColors.brightGold, // #FFD700 — gold
|
|
261
|
+
},
|
|
262
|
+
brightPaletteLight: {
|
|
263
|
+
glow: sunColors.brightLightGlow, // #8A5300 — deep amber-brown
|
|
264
|
+
onGlow: '#ffffff', // white text on deep amber
|
|
265
|
+
pop: sunColors.brightLightPop, // #B8560F — deep orange-amber
|
|
266
|
+
spark: sunColors.brightLightSpark, // #9A7B00 — deep gold
|
|
267
|
+
blaze: sunColors.brightLightBlaze, // #B23A1E — deep coral
|
|
268
|
+
surge: sunColors.brightLightSurge, // #2A7C8E — deep sky-teal
|
|
269
|
+
flame: sunColors.brightLightFlame, // #A85D0C — deep amber
|
|
270
|
+
gold: sunColors.brightLightGold, // #8A6E00 — deep gold
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
loop: {
|
|
274
|
+
label: 'Loop',
|
|
275
|
+
description: 'Very clean: one soft accent, neutral everything else. The look of an application built in LOOP.',
|
|
276
|
+
brandColor: loopColors.loopBrand,
|
|
277
|
+
defaultColorMode: 'light',
|
|
278
|
+
themeStyles: loopThemeStyles,
|
|
279
|
+
// The theme has no gradient on a surface: both stops are the accent.
|
|
280
|
+
cardGradient: {
|
|
281
|
+
light: { from: loopColors.loopBrand, to: loopColors.loopBrand }, // #7ADBB8, flat
|
|
282
|
+
dark: { from: loopColors.loopBrand, to: loopColors.loopBrand }, // #7ADBB8, flat
|
|
283
|
+
},
|
|
284
|
+
brightPalette: {
|
|
285
|
+
glow: loopColors.brightGlow, // #7ADBB8 — green, the accent
|
|
286
|
+
onGlow: loopColors.loopOn, // dark text on the accent
|
|
287
|
+
pop: loopColors.brightPop, // #8CCBF9 — sky
|
|
288
|
+
spark: loopColors.brightSpark, // #BEDC55 — lime
|
|
289
|
+
blaze: loopColors.brightBlaze, // #F6A5C1 — rose
|
|
290
|
+
surge: loopColors.brightSurge, // #C0AEF6 — violet
|
|
291
|
+
flame: loopColors.brightFlame, // #F4A261 — soft orange
|
|
292
|
+
gold: loopColors.brightGold, // #F8D469 — sun
|
|
293
|
+
},
|
|
294
|
+
brightPaletteLight: {
|
|
295
|
+
glow: loopColors.brightLightGlow, // #0F6B4F — deep green
|
|
296
|
+
onGlow: '#ffffff', // white text on deep green
|
|
297
|
+
pop: loopColors.brightLightPop, // #1F6FB0 — deep sky
|
|
298
|
+
spark: loopColors.brightLightSpark, // #5F7A00 — deep lime
|
|
299
|
+
blaze: loopColors.brightLightBlaze, // #B83A6B — deep rose
|
|
300
|
+
surge: loopColors.brightLightSurge, // #6B53C9 — deep violet
|
|
301
|
+
flame: loopColors.brightLightFlame, // #B4571A — deep orange
|
|
302
|
+
gold: loopColors.brightLightGold, // #8A6A00 — deep sun
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
};
|
|
306
|
+
/** All available theme variants in display order. */
|
|
307
|
+
export const themeVariants = ['datalayer', 'spatial', 'lovely', 'matrix', 'earth', 'sand', 'ivory', 'sun', 'loop'];
|
|
308
|
+
/** Look up a theme's tokens by variant name. */
|
|
309
|
+
export function getThemeTokens(variant) {
|
|
310
|
+
return themeTokens[variant];
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Resolve the card gradient for a given theme variant and colour mode.
|
|
314
|
+
* Falls back to `datalayer` / `light` when values are missing.
|
|
315
|
+
*/
|
|
316
|
+
export function getCardGradient(variant = 'datalayer', colorMode = 'light') {
|
|
317
|
+
const mode = colorMode === 'auto' ? 'light' : colorMode;
|
|
318
|
+
return themeTokens[variant]?.cardGradient?.[mode] ?? themeTokens.datalayer.cardGradient.light;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* The bright (vivid) palette of a theme for a resolved colour mode: the
|
|
322
|
+
* light-background palette in light mode, the neon one in dark mode.
|
|
323
|
+
* `getBrightPalette` (in `themeRegistry`) also resolves `'auto'` from the OS.
|
|
324
|
+
*/
|
|
325
|
+
export function brightPaletteOf(variant, mode) {
|
|
326
|
+
const cfg = themeTokens[variant] ?? themeTokens.datalayer;
|
|
327
|
+
return mode === 'light' ? (cfg.brightPaletteLight ?? cfg.brightPalette) : cfg.brightPalette;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Avatar colour palettes per theme × colour mode.
|
|
331
|
+
*
|
|
332
|
+
* Each palette is a 5-colour array tuned for the `boring-avatars` library.
|
|
333
|
+
* The colours are picked from each theme's brand + bright palette so the
|
|
334
|
+
* avatar always feels native to the current theme.
|
|
335
|
+
*
|
|
336
|
+
* - **Light mode** uses the deeper / accessible colour variants so the
|
|
337
|
+
* avatar is legible on light backgrounds.
|
|
338
|
+
* - **Dark mode** uses the brighter / glowing variants so the avatar
|
|
339
|
+
* pops against dark surfaces.
|
|
340
|
+
*/
|
|
341
|
+
const avatarColorPalettes = {
|
|
342
|
+
datalayer: {
|
|
343
|
+
light: [
|
|
344
|
+
datalayerColors.greenText, // #117A65 — deep green
|
|
345
|
+
datalayerColors.greenBrand, // #16A085 — brand green
|
|
346
|
+
datalayerColors.brightLightPop, // #00B0FF — sky blue
|
|
347
|
+
datalayerColors.brightLightGold, // #FFAB00 — amber
|
|
348
|
+
datalayerColors.gray, // #59595C — neutral
|
|
349
|
+
],
|
|
350
|
+
dark: [
|
|
351
|
+
datalayerColors.greenAccent, // #1ABC9C — bright teal
|
|
352
|
+
datalayerColors.greenBright, // #2ECC71 — bright green
|
|
353
|
+
datalayerColors.brightPop, // #00E5FF — electric cyan
|
|
354
|
+
datalayerColors.brightGold, // #FFD600 — vivid yellow
|
|
355
|
+
datalayerColors.brightFlame, // #FF6D00 — vivid orange
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
spatial: {
|
|
359
|
+
light: [
|
|
360
|
+
spatialColors.indigoText, // #3730A3 — deep indigo
|
|
361
|
+
spatialColors.indigoBrand, // #4F46E5 — brand indigo
|
|
362
|
+
spatialColors.brightLightSpark, // #D500F9 — vivid purple
|
|
363
|
+
spatialColors.brightLightGold, // #FFC400 — vivid gold
|
|
364
|
+
spatialColors.gray, // #8892B0 — nebula gray
|
|
365
|
+
],
|
|
366
|
+
dark: [
|
|
367
|
+
spatialColors.indigoAccent, // #6366F1 — bright indigo
|
|
368
|
+
spatialColors.indigoBright, // #818CF8 — light indigo
|
|
369
|
+
spatialColors.brightPop, // #448AFF — neon blue
|
|
370
|
+
spatialColors.brightSpark, // #E040FB — vivid magenta
|
|
371
|
+
spatialColors.brightGold, // #FFEA00 — electric yellow
|
|
372
|
+
],
|
|
373
|
+
},
|
|
374
|
+
lovely: {
|
|
375
|
+
light: [
|
|
376
|
+
lovelyColors.roseText, // #9D174D — deep rose
|
|
377
|
+
lovelyColors.roseBrand, // #DB2777 — brand pink
|
|
378
|
+
lovelyColors.brightLightSurge, // #536DFE — vivid indigo
|
|
379
|
+
lovelyColors.brightLightGold, // #FFD740 — amber gold
|
|
380
|
+
lovelyColors.gray, // #9D7A8F — mauve gray
|
|
381
|
+
],
|
|
382
|
+
dark: [
|
|
383
|
+
lovelyColors.roseAccent, // #EC4899 — bright pink
|
|
384
|
+
lovelyColors.roseBright, // #F472B6 — light pink
|
|
385
|
+
lovelyColors.brightPop, // #FF6E40 — vivid coral
|
|
386
|
+
lovelyColors.brightSpark, // #EA80FC — electric fuchsia
|
|
387
|
+
lovelyColors.brightGold, // #FFD740 — amber gold
|
|
388
|
+
],
|
|
389
|
+
},
|
|
390
|
+
matrix: {
|
|
391
|
+
light: [
|
|
392
|
+
matrixColors.greenText, // #117A65 — deep green
|
|
393
|
+
matrixColors.greenBrand, // #16A085 — brand green
|
|
394
|
+
matrixColors.brightLightPop, // #1DE9B6 — vivid teal
|
|
395
|
+
matrixColors.brightLightGold, // #FFAB00 — vivid amber
|
|
396
|
+
matrixColors.gray, // #4A7856 — dim green-gray
|
|
397
|
+
],
|
|
398
|
+
dark: [
|
|
399
|
+
matrixColors.greenPhosphor, // #00FF41 — Matrix green
|
|
400
|
+
matrixColors.greenGlow, // #39FF14 — neon phosphor
|
|
401
|
+
matrixColors.brightPop, // #00FF88 — phosphor cyan
|
|
402
|
+
matrixColors.brightSpark, // #CCFF00 — acid lime
|
|
403
|
+
matrixColors.brightSurge, // #00E5FF — electric blue
|
|
404
|
+
],
|
|
405
|
+
},
|
|
406
|
+
earth: {
|
|
407
|
+
light: [
|
|
408
|
+
earthColors.oceanText, // #075985 — deep ocean blue
|
|
409
|
+
earthColors.oceanBrand, // #0369A1 — brand ocean
|
|
410
|
+
earthColors.brightLightPop, // #16A34A — vivid forest green
|
|
411
|
+
earthColors.brightLightSpark, // #CA8A04 — deep golden sun
|
|
412
|
+
earthColors.gray, // #5B6B7A — slate
|
|
413
|
+
],
|
|
414
|
+
dark: [
|
|
415
|
+
earthColors.oceanAccent, // #0EA5E9 — bright sky blue
|
|
416
|
+
earthColors.oceanBright, // #38BDF8 — vivid sky blue
|
|
417
|
+
earthColors.brightPop, // #22C55E — vivid green
|
|
418
|
+
earthColors.brightSpark, // #EAB308 — vivid gold
|
|
419
|
+
earthColors.brightFlame, // #F59E0B — amber gold
|
|
420
|
+
],
|
|
421
|
+
},
|
|
422
|
+
sand: {
|
|
423
|
+
light: [
|
|
424
|
+
sandColors.sandText, // #8A5A34 — deep clay
|
|
425
|
+
sandColors.sandBrand, // #B07A4E — camel dune
|
|
426
|
+
sandColors.brightLightPop, // #A9633B — deep terracotta-clay
|
|
427
|
+
sandColors.brightLightGold, // #997B1A — deep gold
|
|
428
|
+
sandColors.gray, // #6B5D4F — taupe
|
|
429
|
+
],
|
|
430
|
+
dark: [
|
|
431
|
+
sandColors.sandAccent, // #C99A6B — light tan
|
|
432
|
+
sandColors.sandBright, // #D9B589 — bright sand
|
|
433
|
+
sandColors.brightPop, // #D98A5A — clay
|
|
434
|
+
sandColors.brightSpark, // #E7C24E — wheat gold
|
|
435
|
+
sandColors.brightFlame, // #E68A34 — amber
|
|
436
|
+
],
|
|
437
|
+
},
|
|
438
|
+
ivory: {
|
|
439
|
+
light: [
|
|
440
|
+
ivoryColors.ivoryText, // #6B5A3E — deep taupe
|
|
441
|
+
ivoryColors.ivoryBrand, // #E6D2B5 — light ivory
|
|
442
|
+
ivoryColors.brightLightPop, // #9C6626 — deep amber-tan
|
|
443
|
+
ivoryColors.brightLightGold, // #836A18 — deep gold
|
|
444
|
+
ivoryColors.gray, // #6F6353 — warm taupe
|
|
445
|
+
],
|
|
446
|
+
dark: [
|
|
447
|
+
ivoryColors.ivoryAccent, // #D8C09B — deeper ivory
|
|
448
|
+
ivoryColors.ivoryBright, // #EFDFC2 — bright ivory
|
|
449
|
+
ivoryColors.brightPop, // #D8B27E — warm tan
|
|
450
|
+
ivoryColors.brightSpark, // #EFDFC2 — bright ivory
|
|
451
|
+
ivoryColors.brightFlame, // #E0912F — amber
|
|
452
|
+
],
|
|
453
|
+
},
|
|
454
|
+
sun: {
|
|
455
|
+
light: [
|
|
456
|
+
sunColors.sunText, // #8A5300 — deep amber-brown
|
|
457
|
+
sunColors.sunBrand, // #FFC107 — radiant amber
|
|
458
|
+
sunColors.brightLightPop, // #B8560F — deep orange-amber
|
|
459
|
+
sunColors.brightLightBlaze, // #B23A1E — deep coral
|
|
460
|
+
sunColors.gray, // #7A6A3A — amber-taupe
|
|
461
|
+
],
|
|
462
|
+
dark: [
|
|
463
|
+
sunColors.sunAccent, // #F0A800 — deep amber
|
|
464
|
+
sunColors.sunBright, // #FFD54A — bright sun
|
|
465
|
+
sunColors.brightPop, // #FF9F1C — vivid orange-amber
|
|
466
|
+
sunColors.brightBlaze, // #FF6B35 — coral-orange
|
|
467
|
+
sunColors.brightSurge, // #4FB0C6 — sky blue
|
|
468
|
+
],
|
|
469
|
+
},
|
|
470
|
+
loop: {
|
|
471
|
+
light: [
|
|
472
|
+
loopColors.brightLightGlow, // #0F6B4F — deep green
|
|
473
|
+
loopColors.brightLightPop, // #1F6FB0 — deep sky
|
|
474
|
+
loopColors.brightLightBlaze, // #B83A6B — deep rose
|
|
475
|
+
loopColors.brightLightSurge, // #6B53C9 — deep violet
|
|
476
|
+
loopColors.gray, // #6A6A66 — neutral gray
|
|
477
|
+
],
|
|
478
|
+
dark: [
|
|
479
|
+
loopColors.loopBrand, // #7ADBB8 — green
|
|
480
|
+
loopColors.brightPop, // #8CCBF9 — sky
|
|
481
|
+
loopColors.brightBlaze, // #F6A5C1 — rose
|
|
482
|
+
loopColors.brightSurge, // #C0AEF6 — violet
|
|
483
|
+
loopColors.brightGold, // #F8D469 — sun
|
|
484
|
+
],
|
|
485
|
+
},
|
|
486
|
+
};
|
|
487
|
+
/**
|
|
488
|
+
* The 5-colour avatar palette of a theme for a resolved colour mode, for the
|
|
489
|
+
* `boring-avatars` library's `colors` prop. `getAvatarColors` (in
|
|
490
|
+
* `themeRegistry`) also resolves `'auto'` from the OS.
|
|
491
|
+
*/
|
|
492
|
+
export function avatarColorsOf(variant, mode) {
|
|
493
|
+
return avatarColorPalettes[variant]?.[mode] ?? avatarColorPalettes.datalayer.light;
|
|
494
|
+
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Since theming is now done entirely via CSS custom properties
|
|
5
|
-
* (see `datalayerThemeStyles`), this is just the unmodified
|
|
6
|
-
* default Primer theme kept for backward compatibility.
|
|
7
|
-
*/
|
|
1
|
+
export * from './datalayerThemeStyles';
|
|
2
|
+
/** The Primer theme object: Primer's default. */
|
|
8
3
|
export declare const datalayerTheme: {
|
|
9
4
|
animation: {
|
|
10
5
|
easeOutCubic: string;
|
|
@@ -1086,6 +1081,4 @@ export declare const datalayerTheme: {
|
|
|
1086
1081
|
}>;
|
|
1087
1082
|
}>;
|
|
1088
1083
|
};
|
|
1089
|
-
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
1090
|
-
export declare const datalayerThemeStyles: import("../css/createThemeCSSVars").ThemeStyles;
|
|
1091
1084
|
export default datalayerTheme;
|