@datalayer/primer-addons 1.0.17 → 1.0.19
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/lib/components/appearance/AppearanceControls.d.ts +3 -2
- package/lib/components/appearance/AppearanceControls.js +71 -3
- package/lib/components/appearance/AppearanceMenu.d.ts +30 -0
- package/lib/components/appearance/AppearanceMenu.js +15 -0
- package/lib/components/appearance/ColorModeCircle.d.ts +28 -0
- package/lib/components/appearance/ColorModeCircle.js +132 -0
- package/lib/components/appearance/ThemeCircle.d.ts +21 -0
- package/lib/components/appearance/ThemeCircle.js +46 -0
- package/lib/components/appearance/ThemePreviewCard.d.ts +12 -0
- package/lib/components/appearance/ThemePreviewCard.js +83 -0
- package/lib/components/appearance/index.d.ts +4 -0
- package/lib/components/appearance/index.js +4 -0
- package/lib/components/box/Box.d.ts +1 -1
- package/lib/components/closeable-flash/CloseableFlash.js +58 -1
- package/lib/components/color/ColorSwatch.d.ts +23 -0
- package/lib/components/color/ColorSwatch.js +62 -0
- package/lib/components/color/index.d.ts +1 -0
- package/lib/components/color/index.js +5 -0
- package/lib/components/content-loader/ContentLoader.js +4 -2
- package/lib/components/icons/CircleIcon.js +6 -4
- package/lib/components/index.d.ts +7 -1
- package/lib/components/index.js +7 -1
- package/lib/components/logo/AI2.d.ts +20 -0
- package/lib/components/logo/AI2.js +23 -0
- package/lib/components/logo/DI.d.ts +19 -0
- package/lib/components/logo/DI.js +20 -0
- package/lib/components/logo/DatalayerLogo.js +49 -1
- package/lib/components/logo/index.d.ts +2 -0
- package/lib/components/logo/index.js +2 -0
- package/lib/components/{overlay/Overlay.d.ts → side-overlay/SideOverlay.d.ts} +3 -3
- package/lib/components/{overlay/Overlay.js → side-overlay/SideOverlay.js} +16 -16
- package/lib/components/side-overlay/SideOverlay.stories.d.ts +16 -0
- package/lib/components/{overlay/Overlay.stories.js → side-overlay/SideOverlay.stories.js} +13 -13
- package/lib/components/slider/Slider.js +2 -1
- package/lib/components/sliding-panel/SlidingPanel.d.ts +19 -0
- package/lib/components/sliding-panel/SlidingPanel.js +217 -0
- package/lib/components/sliding-panel/SlidingPanel.stories.d.ts +16 -0
- package/lib/components/sliding-panel/SlidingPanel.stories.js +68 -0
- package/lib/components/toolbar/FloatingToolbar.js +2 -2
- package/lib/theme/colors/datalayerColors.d.ts +12 -0
- package/lib/theme/colors/datalayerColors.js +13 -0
- package/lib/theme/colors/earthColors.d.ts +12 -0
- package/lib/theme/colors/earthColors.js +13 -0
- package/lib/theme/colors/index.d.ts +3 -0
- package/lib/theme/colors/index.js +9 -0
- package/lib/theme/colors/ivoryColors.d.ts +46 -0
- package/lib/theme/colors/ivoryColors.js +56 -0
- package/lib/theme/colors/lovelyColors.d.ts +12 -0
- package/lib/theme/colors/lovelyColors.js +13 -0
- package/lib/theme/colors/matrixColors.d.ts +12 -0
- package/lib/theme/colors/matrixColors.js +13 -0
- package/lib/theme/colors/sandColors.d.ts +45 -0
- package/lib/theme/colors/sandColors.js +55 -0
- package/lib/theme/colors/spatialColors.d.ts +12 -0
- package/lib/theme/colors/spatialColors.js +13 -0
- package/lib/theme/colors/sunColors.d.ts +45 -0
- package/lib/theme/colors/sunColors.js +55 -0
- package/lib/theme/css/createThemeCSSVars.d.ts +25 -1
- package/lib/theme/css/createThemeCSSVars.js +63 -3
- package/lib/theme/index.d.ts +3 -0
- package/lib/theme/index.js +3 -0
- package/lib/theme/palettes/ColorPalette.js +121 -1
- package/lib/theme/themeRegistry.d.ts +1 -1
- package/lib/theme/themeRegistry.js +151 -1
- package/lib/theme/themes/datalayerTheme.js +58 -7
- package/lib/theme/themes/earthTheme.js +50 -0
- package/lib/theme/themes/ivoryTheme.d.ts +1091 -0
- package/lib/theme/themes/ivoryTheme.js +257 -0
- package/lib/theme/themes/lovelyTheme.js +58 -7
- package/lib/theme/themes/matrixTheme.js +57 -8
- package/lib/theme/themes/sandTheme.d.ts +1091 -0
- package/lib/theme/themes/sandTheme.js +256 -0
- package/lib/theme/themes/spatialTheme.js +58 -7
- package/lib/theme/themes/sunTheme.d.ts +1091 -0
- package/lib/theme/themes/sunTheme.js +257 -0
- package/lib/theme/useThemeStore.d.ts +5 -3
- package/lib/theme/useThemeStore.js +78 -9
- package/lib/utils/Helper.d.ts +1 -1
- package/lib/utils/Portals.d.ts +0 -1
- package/lib/utils/Portals.js +0 -1
- package/package.json +14 -8
- package/lib/App.d.ts +0 -13
- package/lib/App.js +0 -25
- package/lib/components/overlay/Overlay.stories.d.ts +0 -16
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Sand Color System – Warm golden desert neutrals.
|
|
7
|
+
*
|
|
8
|
+
* Anchored on the golden-wheat base #E2CA76: sun-bleached dunes paired
|
|
9
|
+
* with deep ochre for accessible text. A calm, editorial, earthy feel
|
|
10
|
+
* with an Anthropic-like book warmth. WCAG AA/AAA for text & buttons.
|
|
11
|
+
*/
|
|
12
|
+
export const sandColors = {
|
|
13
|
+
// Core Neutrals — warm, earthy
|
|
14
|
+
black: '#201B0E', // Warm dark olive-brown — primary dark background
|
|
15
|
+
gray: '#6E6142', // Khaki taupe — secondary text
|
|
16
|
+
white: '#F7F1DF', // Wheat cream — primary light background
|
|
17
|
+
// Sand / Wheat palette (Brand) — anchored on the base #E2CA76
|
|
18
|
+
sandBase: '#E2CA76', // Base color — golden wheat sand
|
|
19
|
+
sandBrand: '#E2CA76', // Brand / swatch — golden wheat
|
|
20
|
+
sandAccent: '#D4B85E', // Mid wheat — charts, highlights on dark surfaces
|
|
21
|
+
sandText: '#7A5E12', // Deep ochre — accessible buttons & text on cream (AA+)
|
|
22
|
+
sandTint: '#F2E7C2', // Pale wheat — soft background for callouts
|
|
23
|
+
sandBright: '#ECD98F', // Bright wheat — highlights on dark backgrounds
|
|
24
|
+
sandHover: '#5C4710', // Dark ochre — primary button hover
|
|
25
|
+
// Semantic roles — kept warm & earthy
|
|
26
|
+
attentionBrand: '#977E13',
|
|
27
|
+
attentionAccent: '#D9B21E',
|
|
28
|
+
attentionTint: '#F5EBC4',
|
|
29
|
+
dangerBrand: '#A8412A',
|
|
30
|
+
dangerAccent: '#D65C3F',
|
|
31
|
+
dangerTint: '#F6DDD3',
|
|
32
|
+
severeBrand: '#A5651A',
|
|
33
|
+
severeAccent: '#D98A2E',
|
|
34
|
+
severeTint: '#F6E5CC',
|
|
35
|
+
doneBrand: '#6A548F',
|
|
36
|
+
doneAccent: '#8A6FB0',
|
|
37
|
+
doneTint: '#E9E2F2',
|
|
38
|
+
// Bright / vivid colours for SVG illustrations (warm, luminous)
|
|
39
|
+
brightGlow: '#E2CA76', // Golden sand glow — primary glow (the base)
|
|
40
|
+
brightPop: '#D9A85A', // Amber clay — contrasting accent
|
|
41
|
+
brightSpark: '#ECD98F', // Bright wheat — sparkle / tertiary
|
|
42
|
+
brightBlaze: '#E0703F', // Terracotta — warm accent
|
|
43
|
+
brightSurge: '#93A97F', // Olive-sage — cool accent (desert scrub)
|
|
44
|
+
// Warm vivid colours — amber & gold accents
|
|
45
|
+
brightFlame: '#E69430', // Amber — warm energy
|
|
46
|
+
brightGold: '#F0D45E', // Golden — highlight
|
|
47
|
+
// Vivid brights for light backgrounds — deeper for contrast on cream
|
|
48
|
+
brightLightGlow: '#7A5E12', // Deep ochre
|
|
49
|
+
brightLightPop: '#A5661E', // Deep amber
|
|
50
|
+
brightLightSpark: '#977E13', // Deep wheat gold
|
|
51
|
+
brightLightBlaze: '#B0432A', // Deep terracotta
|
|
52
|
+
brightLightSurge: '#5E7050', // Deep olive
|
|
53
|
+
brightLightFlame: '#A5651A', // Deep amber
|
|
54
|
+
brightLightGold: '#8A6E10', // Deep gold
|
|
55
|
+
};
|
|
@@ -12,6 +12,18 @@ export declare const spatialColors: {
|
|
|
12
12
|
indigoTint: string;
|
|
13
13
|
indigoBright: string;
|
|
14
14
|
indigoHover: string;
|
|
15
|
+
attentionBrand: string;
|
|
16
|
+
attentionAccent: string;
|
|
17
|
+
attentionTint: string;
|
|
18
|
+
dangerBrand: string;
|
|
19
|
+
dangerAccent: string;
|
|
20
|
+
dangerTint: string;
|
|
21
|
+
severeBrand: string;
|
|
22
|
+
severeAccent: string;
|
|
23
|
+
severeTint: string;
|
|
24
|
+
doneBrand: string;
|
|
25
|
+
doneAccent: string;
|
|
26
|
+
doneTint: string;
|
|
15
27
|
brightGlow: string;
|
|
16
28
|
brightPop: string;
|
|
17
29
|
brightSpark: string;
|
|
@@ -18,6 +18,19 @@ export const spatialColors = {
|
|
|
18
18
|
indigoTint: '#EEF2FF', // Soft background for callouts
|
|
19
19
|
indigoBright: '#818CF8', // Highlights & glow on dark
|
|
20
20
|
indigoHover: '#312E81', // Primary button hover
|
|
21
|
+
// Semantic roles
|
|
22
|
+
attentionBrand: '#C58A00',
|
|
23
|
+
attentionAccent: '#F2C94C',
|
|
24
|
+
attentionTint: '#FFF4CC',
|
|
25
|
+
dangerBrand: '#E5484D',
|
|
26
|
+
dangerAccent: '#FF7A7F',
|
|
27
|
+
dangerTint: '#FFE3E6',
|
|
28
|
+
severeBrand: '#C96A1B',
|
|
29
|
+
severeAccent: '#F4A259',
|
|
30
|
+
severeTint: '#FFF1E6',
|
|
31
|
+
doneBrand: '#7C4DFF',
|
|
32
|
+
doneAccent: '#A78BFA',
|
|
33
|
+
doneTint: '#EEE8FF',
|
|
21
34
|
// Bright / vivid colours for SVG illustrations (OpenAI-blog style)
|
|
22
35
|
brightGlow: '#7C4DFF', // Electric violet — primary glow
|
|
23
36
|
brightPop: '#448AFF', // Neon blue — contrasting accent
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sun Color System – Warm, radiant golden light.
|
|
3
|
+
*
|
|
4
|
+
* Anchored on the vivid amber base #FFC107 (R:255 G:193 B:7): energetic,
|
|
5
|
+
* optimistic, and welcoming, paired with a deep amber-brown for
|
|
6
|
+
* accessible text. Sunlit and luminous. WCAG AA/AAA for text & buttons.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sunColors: {
|
|
9
|
+
black: string;
|
|
10
|
+
gray: string;
|
|
11
|
+
white: string;
|
|
12
|
+
sunBase: string;
|
|
13
|
+
sunBrand: string;
|
|
14
|
+
sunAccent: string;
|
|
15
|
+
sunText: string;
|
|
16
|
+
sunTint: string;
|
|
17
|
+
sunBright: string;
|
|
18
|
+
sunHover: string;
|
|
19
|
+
attentionBrand: string;
|
|
20
|
+
attentionAccent: string;
|
|
21
|
+
attentionTint: string;
|
|
22
|
+
dangerBrand: string;
|
|
23
|
+
dangerAccent: string;
|
|
24
|
+
dangerTint: string;
|
|
25
|
+
severeBrand: string;
|
|
26
|
+
severeAccent: string;
|
|
27
|
+
severeTint: string;
|
|
28
|
+
doneBrand: string;
|
|
29
|
+
doneAccent: string;
|
|
30
|
+
doneTint: string;
|
|
31
|
+
brightGlow: string;
|
|
32
|
+
brightPop: string;
|
|
33
|
+
brightSpark: string;
|
|
34
|
+
brightBlaze: string;
|
|
35
|
+
brightSurge: string;
|
|
36
|
+
brightFlame: string;
|
|
37
|
+
brightGold: string;
|
|
38
|
+
brightLightGlow: string;
|
|
39
|
+
brightLightPop: string;
|
|
40
|
+
brightLightSpark: string;
|
|
41
|
+
brightLightBlaze: string;
|
|
42
|
+
brightLightSurge: string;
|
|
43
|
+
brightLightFlame: string;
|
|
44
|
+
brightLightGold: string;
|
|
45
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Sun Color System – Warm, radiant golden light.
|
|
7
|
+
*
|
|
8
|
+
* Anchored on the vivid amber base #FFC107 (R:255 G:193 B:7): energetic,
|
|
9
|
+
* optimistic, and welcoming, paired with a deep amber-brown for
|
|
10
|
+
* accessible text. Sunlit and luminous. WCAG AA/AAA for text & buttons.
|
|
11
|
+
*/
|
|
12
|
+
export const sunColors = {
|
|
13
|
+
// Core Neutrals — warm, sunlit
|
|
14
|
+
black: '#1F1904', // Deep amber-brown — primary dark background
|
|
15
|
+
gray: '#7A6A3A', // Warm amber-taupe — secondary text
|
|
16
|
+
white: '#FFF9EC', // Sunlit off-white — primary light background
|
|
17
|
+
// Sun palette (Brand) — anchored on the base #FFC107
|
|
18
|
+
sunBase: '#FFC107', // Base color — radiant amber
|
|
19
|
+
sunBrand: '#FFC107', // Brand / swatch — radiant amber
|
|
20
|
+
sunAccent: '#F0A800', // Deep amber — charts, highlights on dark surfaces
|
|
21
|
+
sunText: '#8A5300', // Deep amber-brown — accessible buttons & text on cream (AA+)
|
|
22
|
+
sunTint: '#FFF1C6', // Pale sun — soft background for callouts
|
|
23
|
+
sunBright: '#FFD54A', // Bright sun — highlights on dark backgrounds
|
|
24
|
+
sunHover: '#6E4200', // Dark amber — primary button hover
|
|
25
|
+
// Semantic roles — kept warm & radiant
|
|
26
|
+
attentionBrand: '#9A7B00',
|
|
27
|
+
attentionAccent: '#E0B400',
|
|
28
|
+
attentionTint: '#FFF0BE',
|
|
29
|
+
dangerBrand: '#B23A1E',
|
|
30
|
+
dangerAccent: '#DE5A38',
|
|
31
|
+
dangerTint: '#FADFD5',
|
|
32
|
+
severeBrand: '#A85D0C',
|
|
33
|
+
severeAccent: '#E08421',
|
|
34
|
+
severeTint: '#FCE6CC',
|
|
35
|
+
doneBrand: '#6A4E9E',
|
|
36
|
+
doneAccent: '#8B72B8',
|
|
37
|
+
doneTint: '#EAE3F5',
|
|
38
|
+
// Bright / vivid colours for SVG illustrations (radiant, luminous)
|
|
39
|
+
brightGlow: '#FFC107', // Amber glow — primary glow (the base)
|
|
40
|
+
brightPop: '#FF9F1C', // Vivid orange-amber — contrasting accent
|
|
41
|
+
brightSpark: '#FFD54A', // Bright sun — sparkle / tertiary
|
|
42
|
+
brightBlaze: '#FF6B35', // Warm coral-orange — warm accent
|
|
43
|
+
brightSurge: '#4FB0C6', // Sky blue — cool accent (radiant sky)
|
|
44
|
+
// Warm vivid colours — amber & gold accents
|
|
45
|
+
brightFlame: '#FF8500', // Amber flame — warm energy
|
|
46
|
+
brightGold: '#FFD700', // Gold — highlight
|
|
47
|
+
// Vivid brights for light backgrounds — deeper for contrast on cream
|
|
48
|
+
brightLightGlow: '#8A5300', // Deep amber-brown
|
|
49
|
+
brightLightPop: '#B8560F', // Deep orange-amber
|
|
50
|
+
brightLightSpark: '#9A7B00', // Deep gold
|
|
51
|
+
brightLightBlaze: '#B23A1E', // Deep coral
|
|
52
|
+
brightLightSurge: '#2A7C8E', // Deep sky-teal
|
|
53
|
+
brightLightFlame: '#A85D0C', // Deep amber
|
|
54
|
+
brightLightGold: '#8A6E00', // Deep gold
|
|
55
|
+
};
|
|
@@ -31,6 +31,30 @@ export interface ThemeColorDefs {
|
|
|
31
31
|
muted: string;
|
|
32
32
|
subtle?: string;
|
|
33
33
|
};
|
|
34
|
+
attention?: {
|
|
35
|
+
fg: string;
|
|
36
|
+
emphasis: string;
|
|
37
|
+
muted: string;
|
|
38
|
+
subtle?: string;
|
|
39
|
+
};
|
|
40
|
+
danger?: {
|
|
41
|
+
fg: string;
|
|
42
|
+
emphasis: string;
|
|
43
|
+
muted: string;
|
|
44
|
+
subtle?: string;
|
|
45
|
+
};
|
|
46
|
+
severe?: {
|
|
47
|
+
fg: string;
|
|
48
|
+
emphasis: string;
|
|
49
|
+
muted: string;
|
|
50
|
+
subtle?: string;
|
|
51
|
+
};
|
|
52
|
+
done?: {
|
|
53
|
+
fg: string;
|
|
54
|
+
emphasis: string;
|
|
55
|
+
muted: string;
|
|
56
|
+
subtle?: string;
|
|
57
|
+
};
|
|
34
58
|
border?: {
|
|
35
59
|
default: string;
|
|
36
60
|
muted: string;
|
|
@@ -125,7 +149,7 @@ export interface ThemeColorDefs {
|
|
|
125
149
|
* | Legacy aliases | `--color-btn-primary-bg` |
|
|
126
150
|
* | Brand (custom) | `--brand-color-canvas-default` |
|
|
127
151
|
*/
|
|
128
|
-
export declare function colorDefsToCSS(defs: ThemeColorDefs): CSSProperties;
|
|
152
|
+
export declare function colorDefsToCSS(defs: ThemeColorDefs, mode?: 'light' | 'dark'): CSSProperties;
|
|
129
153
|
/** Light + dark CSS-property pairs for the `themeStyles` prop. */
|
|
130
154
|
export interface ThemeStyles {
|
|
131
155
|
light: CSSProperties;
|
|
@@ -33,16 +33,45 @@
|
|
|
33
33
|
* | Legacy aliases | `--color-btn-primary-bg` |
|
|
34
34
|
* | Brand (custom) | `--brand-color-canvas-default` |
|
|
35
35
|
*/
|
|
36
|
-
export function colorDefsToCSS(defs) {
|
|
36
|
+
export function colorDefsToCSS(defs, mode = 'light') {
|
|
37
37
|
const optional = {};
|
|
38
38
|
if (defs.canvas.subtle) {
|
|
39
39
|
optional['--bgColor-muted'] = defs.canvas.subtle;
|
|
40
40
|
}
|
|
41
|
+
/* ── Semantic role fallbacks ─────────────────────────────────────
|
|
42
|
+
* Themes may override `attention` / `danger` / `severe` / `done`,
|
|
43
|
+
* but when they don't we supply sensible, mode-aware defaults so the
|
|
44
|
+
* full Primer semantic palette is always defined (apps do not load
|
|
45
|
+
* @primer/primitives CSS). */
|
|
46
|
+
const roleFallbacks = mode === 'dark'
|
|
47
|
+
? {
|
|
48
|
+
attention: { fg: '#d29922', emphasis: '#9e6a03', muted: '#bb8009', subtle: '#341a00' },
|
|
49
|
+
danger: { fg: '#f85149', emphasis: '#da3633', muted: '#b62324', subtle: '#25171c' },
|
|
50
|
+
severe: { fg: '#db6d28', emphasis: '#bd561d', muted: '#9e5122', subtle: '#2a1801' },
|
|
51
|
+
done: { fg: '#a371f7', emphasis: '#8957e5', muted: '#6e40c9', subtle: '#221530' },
|
|
52
|
+
}
|
|
53
|
+
: {
|
|
54
|
+
attention: { fg: '#9a6700', emphasis: '#bf8700', muted: '#d4a72c', subtle: '#fff8c5' },
|
|
55
|
+
danger: { fg: '#cf222e', emphasis: '#cf222e', muted: '#ff8182', subtle: '#ffebe9' },
|
|
56
|
+
severe: { fg: '#bc4c00', emphasis: '#bc4c00', muted: '#fdaa7f', subtle: '#fff1e5' },
|
|
57
|
+
done: { fg: '#8250df', emphasis: '#8250df', muted: '#d8b9ff', subtle: '#fbefff' },
|
|
58
|
+
};
|
|
59
|
+
const attention = defs.attention ?? roleFallbacks.attention;
|
|
60
|
+
const danger = defs.danger ?? roleFallbacks.danger;
|
|
61
|
+
const severe = defs.severe ?? roleFallbacks.severe;
|
|
62
|
+
const done = defs.done ?? roleFallbacks.done;
|
|
41
63
|
return {
|
|
42
64
|
/* ── Canvas / Background ─────────────────────────────────────── */
|
|
43
65
|
'--bgColor-default': defs.canvas.default,
|
|
44
66
|
'--bgColor-inset': defs.canvas.default,
|
|
45
67
|
...optional,
|
|
68
|
+
/* ── Overlay (portaled surfaces: menus, dialogs, popovers) ────
|
|
69
|
+
* Primer's <Overlay> paints its surface with `var(--overlay-bgColor)`,
|
|
70
|
+
* which normally ships in @primer/primitives. Apps using this theme do
|
|
71
|
+
* NOT load primitives CSS, so define the overlay tokens here to avoid
|
|
72
|
+
* transparent overlay panels. */
|
|
73
|
+
'--overlay-bgColor': defs.canvas.default,
|
|
74
|
+
'--overlay-backdrop-bgColor': 'rgba(0, 0, 0, 0.5)',
|
|
46
75
|
/* ── Foreground / Text ───────────────────────────────────────── */
|
|
47
76
|
'--fgColor-default': defs.fg.default,
|
|
48
77
|
'--fgColor-muted': defs.fg.muted,
|
|
@@ -61,6 +90,30 @@ export function colorDefsToCSS(defs) {
|
|
|
61
90
|
'--bgColor-success-muted': defs.success.subtle ?? defs.success.muted,
|
|
62
91
|
'--borderColor-success-emphasis': defs.success.emphasis,
|
|
63
92
|
'--borderColor-success-muted': defs.success.muted,
|
|
93
|
+
/* ── Attention (amber) ───────────────────────────────────────── */
|
|
94
|
+
'--fgColor-attention': attention.fg,
|
|
95
|
+
'--bgColor-attention-emphasis': attention.emphasis,
|
|
96
|
+
'--bgColor-attention-muted': attention.subtle ?? attention.muted,
|
|
97
|
+
'--borderColor-attention-emphasis': attention.emphasis,
|
|
98
|
+
'--borderColor-attention-muted': attention.muted,
|
|
99
|
+
/* ── Danger (red) ────────────────────────────────────────────── */
|
|
100
|
+
'--fgColor-danger': danger.fg,
|
|
101
|
+
'--bgColor-danger-emphasis': danger.emphasis,
|
|
102
|
+
'--bgColor-danger-muted': danger.subtle ?? danger.muted,
|
|
103
|
+
'--borderColor-danger-emphasis': danger.emphasis,
|
|
104
|
+
'--borderColor-danger-muted': danger.muted,
|
|
105
|
+
/* ── Severe (orange) ─────────────────────────────────────────── */
|
|
106
|
+
'--fgColor-severe': severe.fg,
|
|
107
|
+
'--bgColor-severe-emphasis': severe.emphasis,
|
|
108
|
+
'--bgColor-severe-muted': severe.subtle ?? severe.muted,
|
|
109
|
+
'--borderColor-severe-emphasis': severe.emphasis,
|
|
110
|
+
'--borderColor-severe-muted': severe.muted,
|
|
111
|
+
/* ── Done (purple) ───────────────────────────────────────────── */
|
|
112
|
+
'--fgColor-done': done.fg,
|
|
113
|
+
'--bgColor-done-emphasis': done.emphasis,
|
|
114
|
+
'--bgColor-done-muted': done.subtle ?? done.muted,
|
|
115
|
+
'--borderColor-done-emphasis': done.emphasis,
|
|
116
|
+
'--borderColor-done-muted': done.muted,
|
|
64
117
|
/* ── Border (generic) ────────────────────────────────────────── */
|
|
65
118
|
'--borderColor-default': defs.border?.default ?? defs.btn.border,
|
|
66
119
|
'--borderColor-muted': defs.border?.muted ?? defs.btn.border,
|
|
@@ -166,6 +219,13 @@ export function colorDefsToCSS(defs) {
|
|
|
166
219
|
'--control-transparent-bgColor-selected': defs.btn.selectedBg,
|
|
167
220
|
'--control-transparent-borderColor-hover': 'transparent',
|
|
168
221
|
'--control-transparent-borderColor-active': 'transparent',
|
|
222
|
+
/* ── Disabled controls / fields ─────────────────────────────── */
|
|
223
|
+
'--control-bgColor-disabled': defs.canvas.subtle ?? defs.btn.bg,
|
|
224
|
+
'--control-borderColor-disabled': defs.border?.default ?? defs.btn.border,
|
|
225
|
+
'--control-fgColor-disabled': defs.fg.muted,
|
|
226
|
+
'--fgColor-disabled': defs.fg.muted,
|
|
227
|
+
'--color-input-disabled-bg': defs.canvas.subtle ?? defs.btn.bg,
|
|
228
|
+
'--color-primer-fg-disabled': defs.fg.muted,
|
|
169
229
|
/* ── Menu ────────────────────────────────────────────────────── */
|
|
170
230
|
'--menu-bgColor-active': defs.btn.hoverBg,
|
|
171
231
|
/* ── Legacy / compat aliases ─────────────────────────────────── */
|
|
@@ -219,7 +279,7 @@ export function buildThemeStyles(light, dark, options) {
|
|
|
219
279
|
color: light.fg.default,
|
|
220
280
|
fontSize: 'var(--text-body-size-medium)',
|
|
221
281
|
...(options?.fontFamily ? { fontFamily: options.fontFamily } : {}),
|
|
222
|
-
...colorDefsToCSS(light),
|
|
282
|
+
...colorDefsToCSS(light, 'light'),
|
|
223
283
|
...fontVars,
|
|
224
284
|
},
|
|
225
285
|
dark: {
|
|
@@ -227,7 +287,7 @@ export function buildThemeStyles(light, dark, options) {
|
|
|
227
287
|
color: dark.fg.default,
|
|
228
288
|
fontSize: 'var(--text-body-size-medium)',
|
|
229
289
|
...(options?.fontFamily ? { fontFamily: options.fontFamily } : {}),
|
|
230
|
-
...colorDefsToCSS(dark),
|
|
290
|
+
...colorDefsToCSS(dark, 'dark'),
|
|
231
291
|
...fontVars,
|
|
232
292
|
},
|
|
233
293
|
};
|
package/lib/theme/index.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export * from './themes/spatialTheme';
|
|
|
8
8
|
export * from './themes/lovelyTheme';
|
|
9
9
|
export * from './themes/matrixTheme';
|
|
10
10
|
export * from './themes/earthTheme';
|
|
11
|
+
export * from './themes/sandTheme';
|
|
12
|
+
export * from './themes/ivoryTheme';
|
|
13
|
+
export * from './themes/sunTheme';
|
|
11
14
|
export * from './themes-brand/spatialBrandTheme';
|
|
12
15
|
export * from './themeRegistry';
|
|
13
16
|
export * from './palettes';
|
package/lib/theme/index.js
CHANGED
|
@@ -12,6 +12,9 @@ export * from './themes/spatialTheme';
|
|
|
12
12
|
export * from './themes/lovelyTheme';
|
|
13
13
|
export * from './themes/matrixTheme';
|
|
14
14
|
export * from './themes/earthTheme';
|
|
15
|
+
export * from './themes/sandTheme';
|
|
16
|
+
export * from './themes/ivoryTheme';
|
|
17
|
+
export * from './themes/sunTheme';
|
|
15
18
|
export * from './themes-brand/spatialBrandTheme';
|
|
16
19
|
export * from './themeRegistry';
|
|
17
20
|
export * from './palettes';
|
|
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
* Shared palette types, theme-aware colour resolution, and reusable
|
|
9
9
|
* gradient / grid definitions.
|
|
10
10
|
*/
|
|
11
|
-
import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, } from '../colors';
|
|
11
|
+
import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, } from '../colors';
|
|
12
12
|
import { getBrightPalette, } from '../themeRegistry';
|
|
13
13
|
import { useThemeStore } from '../useThemeStore';
|
|
14
14
|
const dlBrightDark = getBrightPalette('datalayer');
|
|
@@ -21,6 +21,12 @@ const mxBrightDark = getBrightPalette('matrix');
|
|
|
21
21
|
const mxBrightLight = getBrightPalette('matrix', 'light');
|
|
22
22
|
const eaBrightDark = getBrightPalette('earth');
|
|
23
23
|
const eaBrightLight = getBrightPalette('earth', 'light');
|
|
24
|
+
const saBrightDark = getBrightPalette('sand');
|
|
25
|
+
const saBrightLight = getBrightPalette('sand', 'light');
|
|
26
|
+
const ivBrightDark = getBrightPalette('ivory');
|
|
27
|
+
const ivBrightLight = getBrightPalette('ivory', 'light');
|
|
28
|
+
const suBrightDark = getBrightPalette('sun');
|
|
29
|
+
const suBrightLight = getBrightPalette('sun', 'light');
|
|
24
30
|
const palettes = {
|
|
25
31
|
datalayer: {
|
|
26
32
|
light: {
|
|
@@ -212,6 +218,120 @@ const palettes = {
|
|
|
212
218
|
isLight: false,
|
|
213
219
|
},
|
|
214
220
|
},
|
|
221
|
+
sand: {
|
|
222
|
+
light: {
|
|
223
|
+
bg: '#FBF7EF',
|
|
224
|
+
bgPanel: '#ffffff',
|
|
225
|
+
bgAlt: sandColors.sandTint,
|
|
226
|
+
primary: sandColors.sandBrand,
|
|
227
|
+
secondary: sandColors.sandText,
|
|
228
|
+
accent: sandColors.sandAccent,
|
|
229
|
+
glow: saBrightLight.glow,
|
|
230
|
+
pop: saBrightLight.pop,
|
|
231
|
+
spark: saBrightLight.spark,
|
|
232
|
+
blaze: saBrightLight.blaze,
|
|
233
|
+
surge: saBrightLight.surge,
|
|
234
|
+
flame: saBrightLight.flame,
|
|
235
|
+
gold: saBrightLight.gold,
|
|
236
|
+
textLight: '#2B2118',
|
|
237
|
+
textMuted: sandColors.gray,
|
|
238
|
+
isLight: true,
|
|
239
|
+
},
|
|
240
|
+
dark: {
|
|
241
|
+
bg: sandColors.black,
|
|
242
|
+
bgPanel: '#2A2118',
|
|
243
|
+
bgAlt: '#33281A',
|
|
244
|
+
primary: sandColors.sandAccent,
|
|
245
|
+
secondary: sandColors.sandBrand,
|
|
246
|
+
accent: sandColors.sandBright,
|
|
247
|
+
glow: saBrightDark.glow,
|
|
248
|
+
pop: saBrightDark.pop,
|
|
249
|
+
spark: saBrightDark.spark,
|
|
250
|
+
blaze: saBrightDark.blaze,
|
|
251
|
+
surge: saBrightDark.surge,
|
|
252
|
+
flame: saBrightDark.flame,
|
|
253
|
+
gold: saBrightDark.gold,
|
|
254
|
+
textLight: '#EDE3D3',
|
|
255
|
+
textMuted: '#B7A793',
|
|
256
|
+
isLight: false,
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
ivory: {
|
|
260
|
+
light: {
|
|
261
|
+
bg: '#FBF6EC',
|
|
262
|
+
bgPanel: '#ffffff',
|
|
263
|
+
bgAlt: ivoryColors.ivoryTint,
|
|
264
|
+
primary: ivoryColors.ivoryBrand,
|
|
265
|
+
secondary: ivoryColors.ivoryText,
|
|
266
|
+
accent: ivoryColors.ivoryAccent,
|
|
267
|
+
glow: ivBrightLight.glow,
|
|
268
|
+
pop: ivBrightLight.pop,
|
|
269
|
+
spark: ivBrightLight.spark,
|
|
270
|
+
blaze: ivBrightLight.blaze,
|
|
271
|
+
surge: ivBrightLight.surge,
|
|
272
|
+
flame: ivBrightLight.flame,
|
|
273
|
+
gold: ivBrightLight.gold,
|
|
274
|
+
textLight: '#2C2318',
|
|
275
|
+
textMuted: ivoryColors.gray,
|
|
276
|
+
isLight: true,
|
|
277
|
+
},
|
|
278
|
+
dark: {
|
|
279
|
+
bg: ivoryColors.black,
|
|
280
|
+
bgPanel: '#2A2219',
|
|
281
|
+
bgAlt: '#33291B',
|
|
282
|
+
primary: ivoryColors.ivoryAccent,
|
|
283
|
+
secondary: ivoryColors.ivoryBrand,
|
|
284
|
+
accent: ivoryColors.ivoryBright,
|
|
285
|
+
glow: ivBrightDark.glow,
|
|
286
|
+
pop: ivBrightDark.pop,
|
|
287
|
+
spark: ivBrightDark.spark,
|
|
288
|
+
blaze: ivBrightDark.blaze,
|
|
289
|
+
surge: ivBrightDark.surge,
|
|
290
|
+
flame: ivBrightDark.flame,
|
|
291
|
+
gold: ivBrightDark.gold,
|
|
292
|
+
textLight: '#EFE6D6',
|
|
293
|
+
textMuted: '#BBAC97',
|
|
294
|
+
isLight: false,
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
sun: {
|
|
298
|
+
light: {
|
|
299
|
+
bg: '#FFF9EC',
|
|
300
|
+
bgPanel: '#ffffff',
|
|
301
|
+
bgAlt: sunColors.sunTint,
|
|
302
|
+
primary: sunColors.sunBrand,
|
|
303
|
+
secondary: sunColors.sunText,
|
|
304
|
+
accent: sunColors.sunAccent,
|
|
305
|
+
glow: suBrightLight.glow,
|
|
306
|
+
pop: suBrightLight.pop,
|
|
307
|
+
spark: suBrightLight.spark,
|
|
308
|
+
blaze: suBrightLight.blaze,
|
|
309
|
+
surge: suBrightLight.surge,
|
|
310
|
+
flame: suBrightLight.flame,
|
|
311
|
+
gold: suBrightLight.gold,
|
|
312
|
+
textLight: '#2A2210',
|
|
313
|
+
textMuted: sunColors.gray,
|
|
314
|
+
isLight: true,
|
|
315
|
+
},
|
|
316
|
+
dark: {
|
|
317
|
+
bg: sunColors.black,
|
|
318
|
+
bgPanel: '#2A2109',
|
|
319
|
+
bgAlt: '#33290C',
|
|
320
|
+
primary: sunColors.sunAccent,
|
|
321
|
+
secondary: sunColors.sunBrand,
|
|
322
|
+
accent: sunColors.sunBright,
|
|
323
|
+
glow: suBrightDark.glow,
|
|
324
|
+
pop: suBrightDark.pop,
|
|
325
|
+
spark: suBrightDark.spark,
|
|
326
|
+
blaze: suBrightDark.blaze,
|
|
327
|
+
surge: suBrightDark.surge,
|
|
328
|
+
flame: suBrightDark.flame,
|
|
329
|
+
gold: suBrightDark.gold,
|
|
330
|
+
textLight: '#F3E9CF',
|
|
331
|
+
textMuted: '#BEAC82',
|
|
332
|
+
isLight: false,
|
|
333
|
+
},
|
|
334
|
+
},
|
|
215
335
|
};
|
|
216
336
|
export function getColorPalette(theme = 'datalayer', colorMode = 'auto') {
|
|
217
337
|
const mode = colorMode === 'auto'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
2
|
import { type ColorMode } from './DatalayerBrandThemeProvider';
|
|
3
3
|
/** Available theme variants. */
|
|
4
|
-
export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth';
|
|
4
|
+
export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth' | 'sand' | 'ivory' | 'sun';
|
|
5
5
|
/** A pair of colours for a two-stop gradient. */
|
|
6
6
|
export interface GradientPair {
|
|
7
7
|
/** Start colour (brighter / brand). */
|