@datalayer/primer-addons 1.0.18 → 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 +2 -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/index.d.ts +6 -0
- package/lib/components/index.js +6 -0
- package/lib/components/logo/DatalayerLogo.js +49 -1
- package/lib/components/side-overlay/SideOverlay.js +1 -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/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 +56 -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/utils/Helper.d.ts +1 -1
- package/lib/utils/Portals.d.ts +0 -1
- package/lib/utils/Portals.js +0 -1
- package/package.json +9 -5
- package/lib/App.d.ts +0 -13
- package/lib/App.js +0 -25
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Ivory Color System – Soft, warm off-white neutrals.
|
|
7
|
+
*
|
|
8
|
+
* Anchored on the light-ivory base #E6D2B5 (R:230 G:210 B:181): a calm,
|
|
9
|
+
* refined, and welcoming palette paired with a deep warm taupe for
|
|
10
|
+
* accessible text. Gentle and editorial, with a hospitable, paper-like
|
|
11
|
+
* warmth. WCAG AA/AAA for text & buttons.
|
|
12
|
+
*/
|
|
13
|
+
export const ivoryColors = {
|
|
14
|
+
// Core Neutrals — warm, soft
|
|
15
|
+
black: '#211C15', // Warm espresso — primary dark background
|
|
16
|
+
gray: '#6F6353', // Warm taupe — secondary text
|
|
17
|
+
white: '#FBF6EC', // Soft ivory — primary light background
|
|
18
|
+
// Ivory palette (Brand) — anchored on the base #E6D2B5
|
|
19
|
+
ivoryBase: '#E6D2B5', // Base color — light ivory
|
|
20
|
+
ivoryBrand: '#E6D2B5', // Brand / swatch — light ivory
|
|
21
|
+
ivoryAccent: '#D8C09B', // Deeper ivory — charts, highlights on dark surfaces
|
|
22
|
+
ivoryText: '#6B5A3E', // Deep warm taupe — accessible buttons & text on ivory (AA+)
|
|
23
|
+
ivoryTint: '#F3E9D6', // Pale ivory — soft background for callouts
|
|
24
|
+
ivoryBright: '#EFDFC2', // Bright ivory — highlights on dark backgrounds
|
|
25
|
+
ivoryHover: '#52442D', // Dark taupe — primary button hover
|
|
26
|
+
// Semantic roles — kept warm & refined
|
|
27
|
+
attentionBrand: '#8A7320',
|
|
28
|
+
attentionAccent: '#CBAA35',
|
|
29
|
+
attentionTint: '#F4ECCD',
|
|
30
|
+
dangerBrand: '#A34632',
|
|
31
|
+
dangerAccent: '#CE6047',
|
|
32
|
+
dangerTint: '#F5DFD8',
|
|
33
|
+
severeBrand: '#9C6221',
|
|
34
|
+
severeAccent: '#CE8637',
|
|
35
|
+
severeTint: '#F4E6D2',
|
|
36
|
+
doneBrand: '#6A5591',
|
|
37
|
+
doneAccent: '#8B72B2',
|
|
38
|
+
doneTint: '#EAE3F3',
|
|
39
|
+
// Bright / vivid colours for SVG illustrations (warm, luminous)
|
|
40
|
+
brightGlow: '#E6D2B5', // Ivory glow — primary glow (the base)
|
|
41
|
+
brightPop: '#D8B27E', // Warm tan — contrasting accent
|
|
42
|
+
brightSpark: '#EFDFC2', // Bright ivory — sparkle / tertiary
|
|
43
|
+
brightBlaze: '#DD7048', // Soft terracotta — warm accent
|
|
44
|
+
brightSurge: '#98A783', // Sage — cool accent
|
|
45
|
+
// Warm vivid colours — amber & gold accents
|
|
46
|
+
brightFlame: '#E0912F', // Amber — warm energy
|
|
47
|
+
brightGold: '#EACF6A', // Soft gold — highlight
|
|
48
|
+
// Vivid brights for light backgrounds — deeper for contrast on ivory
|
|
49
|
+
brightLightGlow: '#6B5A3E', // Deep taupe
|
|
50
|
+
brightLightPop: '#9C6626', // Deep amber-tan
|
|
51
|
+
brightLightSpark: '#8A7320', // Deep gold
|
|
52
|
+
brightLightBlaze: '#AB4229', // Deep terracotta
|
|
53
|
+
brightLightSurge: '#5C6C4C', // Deep sage
|
|
54
|
+
brightLightFlame: '#9C6221', // Deep amber
|
|
55
|
+
brightLightGold: '#836A18', // Deep gold
|
|
56
|
+
};
|
|
@@ -12,6 +12,18 @@ export declare const lovelyColors: {
|
|
|
12
12
|
roseTint: string;
|
|
13
13
|
roseBright: string;
|
|
14
14
|
roseHover: 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 lovelyColors = {
|
|
|
18
18
|
roseTint: '#FDF2F8', // Soft background for callouts
|
|
19
19
|
roseBright: '#F472B6', // Highlights & glow on dark
|
|
20
20
|
roseHover: '#831843', // Primary button hover
|
|
21
|
+
// Semantic roles
|
|
22
|
+
attentionBrand: '#B7791F',
|
|
23
|
+
attentionAccent: '#F6AD55',
|
|
24
|
+
attentionTint: '#FFF5E6',
|
|
25
|
+
dangerBrand: '#D61F69',
|
|
26
|
+
dangerAccent: '#FF5C8A',
|
|
27
|
+
dangerTint: '#FFE6EF',
|
|
28
|
+
severeBrand: '#C05621',
|
|
29
|
+
severeAccent: '#ED8936',
|
|
30
|
+
severeTint: '#FFF1E8',
|
|
31
|
+
doneBrand: '#805AD5',
|
|
32
|
+
doneAccent: '#B794F4',
|
|
33
|
+
doneTint: '#F3E8FF',
|
|
21
34
|
// Bright / vivid colours for SVG illustrations (OpenAI-blog style)
|
|
22
35
|
brightGlow: '#FF4081', // Hot pink — primary glow
|
|
23
36
|
brightPop: '#FF6E40', // Vivid coral — contrasting accent
|
|
@@ -17,6 +17,18 @@ export declare const matrixColors: {
|
|
|
17
17
|
greenGlow: string;
|
|
18
18
|
greenHover: string;
|
|
19
19
|
greenTerminal: string;
|
|
20
|
+
attentionBrand: string;
|
|
21
|
+
attentionAccent: string;
|
|
22
|
+
attentionTint: string;
|
|
23
|
+
dangerBrand: string;
|
|
24
|
+
dangerAccent: string;
|
|
25
|
+
dangerTint: string;
|
|
26
|
+
severeBrand: string;
|
|
27
|
+
severeAccent: string;
|
|
28
|
+
severeTint: string;
|
|
29
|
+
doneBrand: string;
|
|
30
|
+
doneAccent: string;
|
|
31
|
+
doneTint: string;
|
|
20
32
|
brightGlow: string;
|
|
21
33
|
brightPop: string;
|
|
22
34
|
brightSpark: string;
|
|
@@ -23,6 +23,19 @@ export const matrixColors = {
|
|
|
23
23
|
greenGlow: '#39FF14', // Neon phosphor glow — brightest accent on dark
|
|
24
24
|
greenHover: '#0E6655', // Datalayer hover — primary button hover
|
|
25
25
|
greenTerminal: '#003B00', // Deep terminal — dark mode subtle/canvas
|
|
26
|
+
// Semantic roles
|
|
27
|
+
attentionBrand: '#A78E00',
|
|
28
|
+
attentionAccent: '#FFEA00',
|
|
29
|
+
attentionTint: '#3A3400',
|
|
30
|
+
dangerBrand: '#C62828',
|
|
31
|
+
dangerAccent: '#FF1744',
|
|
32
|
+
dangerTint: '#3A0F16',
|
|
33
|
+
severeBrand: '#C75B12',
|
|
34
|
+
severeAccent: '#FF8A00',
|
|
35
|
+
severeTint: '#332000',
|
|
36
|
+
doneBrand: '#008B8B',
|
|
37
|
+
doneAccent: '#00E5FF',
|
|
38
|
+
doneTint: '#042A2E',
|
|
26
39
|
// Bright / vivid colours for SVG illustrations (OpenAI-blog style)
|
|
27
40
|
brightGlow: '#39FF14', // Neon green — primary glow (re-stated for palette API)
|
|
28
41
|
brightPop: '#00FF88', // Phosphor cyan — contrasting accent
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sand Color System – Warm golden desert neutrals.
|
|
3
|
+
*
|
|
4
|
+
* Anchored on the golden-wheat base #E2CA76: sun-bleached dunes paired
|
|
5
|
+
* with deep ochre for accessible text. A calm, editorial, earthy feel
|
|
6
|
+
* with an Anthropic-like book warmth. WCAG AA/AAA for text & buttons.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sandColors: {
|
|
9
|
+
black: string;
|
|
10
|
+
gray: string;
|
|
11
|
+
white: string;
|
|
12
|
+
sandBase: string;
|
|
13
|
+
sandBrand: string;
|
|
14
|
+
sandAccent: string;
|
|
15
|
+
sandText: string;
|
|
16
|
+
sandTint: string;
|
|
17
|
+
sandBright: string;
|
|
18
|
+
sandHover: 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
|
+
* 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,11 +33,33 @@
|
|
|
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,
|
|
@@ -68,6 +90,30 @@ export function colorDefsToCSS(defs) {
|
|
|
68
90
|
'--bgColor-success-muted': defs.success.subtle ?? defs.success.muted,
|
|
69
91
|
'--borderColor-success-emphasis': defs.success.emphasis,
|
|
70
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,
|
|
71
117
|
/* ── Border (generic) ────────────────────────────────────────── */
|
|
72
118
|
'--borderColor-default': defs.border?.default ?? defs.btn.border,
|
|
73
119
|
'--borderColor-muted': defs.border?.muted ?? defs.btn.border,
|
|
@@ -173,6 +219,13 @@ export function colorDefsToCSS(defs) {
|
|
|
173
219
|
'--control-transparent-bgColor-selected': defs.btn.selectedBg,
|
|
174
220
|
'--control-transparent-borderColor-hover': 'transparent',
|
|
175
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,
|
|
176
229
|
/* ── Menu ────────────────────────────────────────────────────── */
|
|
177
230
|
'--menu-bgColor-active': defs.btn.hoverBg,
|
|
178
231
|
/* ── Legacy / compat aliases ─────────────────────────────────── */
|
|
@@ -226,7 +279,7 @@ export function buildThemeStyles(light, dark, options) {
|
|
|
226
279
|
color: light.fg.default,
|
|
227
280
|
fontSize: 'var(--text-body-size-medium)',
|
|
228
281
|
...(options?.fontFamily ? { fontFamily: options.fontFamily } : {}),
|
|
229
|
-
...colorDefsToCSS(light),
|
|
282
|
+
...colorDefsToCSS(light, 'light'),
|
|
230
283
|
...fontVars,
|
|
231
284
|
},
|
|
232
285
|
dark: {
|
|
@@ -234,7 +287,7 @@ export function buildThemeStyles(light, dark, options) {
|
|
|
234
287
|
color: dark.fg.default,
|
|
235
288
|
fontSize: 'var(--text-body-size-medium)',
|
|
236
289
|
...(options?.fontFamily ? { fontFamily: options.fontFamily } : {}),
|
|
237
|
-
...colorDefsToCSS(dark),
|
|
290
|
+
...colorDefsToCSS(dark, 'dark'),
|
|
238
291
|
...fontVars,
|
|
239
292
|
},
|
|
240
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';
|