@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,256 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Sand Theme for Primer React.
|
|
7
|
+
*
|
|
8
|
+
* Warm, pale desert neutrals with a terracotta-clay accent — a calm,
|
|
9
|
+
* editorial look inspired by Anthropic's book-like warmth. Uses a warm
|
|
10
|
+
* transitional serif type stack for a natural, printed feel.
|
|
11
|
+
* Theming is applied via **CSS custom-property overrides**.
|
|
12
|
+
*/
|
|
13
|
+
import { theme as primerTheme } from '@primer/react';
|
|
14
|
+
import { sandColors } from '../colors/sandColors';
|
|
15
|
+
import { buildThemeStyles } from '../css/createThemeCSSVars';
|
|
16
|
+
/* ── Light-mode colour definitions ───────────────────────────────────── */
|
|
17
|
+
const sandLight = {
|
|
18
|
+
canvas: {
|
|
19
|
+
default: sandColors.white,
|
|
20
|
+
subtle: '#F1EAD2',
|
|
21
|
+
},
|
|
22
|
+
fg: {
|
|
23
|
+
default: '#2B2118',
|
|
24
|
+
muted: sandColors.gray,
|
|
25
|
+
onEmphasis: '#FBF7EF',
|
|
26
|
+
},
|
|
27
|
+
accent: {
|
|
28
|
+
fg: sandColors.sandText,
|
|
29
|
+
emphasis: sandColors.sandText,
|
|
30
|
+
muted: sandColors.sandAccent,
|
|
31
|
+
subtle: sandColors.sandTint,
|
|
32
|
+
},
|
|
33
|
+
success: {
|
|
34
|
+
fg: '#3E6B47',
|
|
35
|
+
emphasis: '#3E6B47',
|
|
36
|
+
muted: '#5E8A5E',
|
|
37
|
+
subtle: '#E1EEE0',
|
|
38
|
+
},
|
|
39
|
+
attention: {
|
|
40
|
+
fg: sandColors.attentionBrand,
|
|
41
|
+
emphasis: sandColors.attentionBrand,
|
|
42
|
+
muted: sandColors.attentionAccent,
|
|
43
|
+
subtle: sandColors.attentionTint,
|
|
44
|
+
},
|
|
45
|
+
danger: {
|
|
46
|
+
fg: sandColors.dangerBrand,
|
|
47
|
+
emphasis: sandColors.dangerBrand,
|
|
48
|
+
muted: sandColors.dangerAccent,
|
|
49
|
+
subtle: sandColors.dangerTint,
|
|
50
|
+
},
|
|
51
|
+
severe: {
|
|
52
|
+
fg: sandColors.severeBrand,
|
|
53
|
+
emphasis: sandColors.severeBrand,
|
|
54
|
+
muted: sandColors.severeAccent,
|
|
55
|
+
subtle: sandColors.severeTint,
|
|
56
|
+
},
|
|
57
|
+
done: {
|
|
58
|
+
fg: sandColors.doneBrand,
|
|
59
|
+
emphasis: sandColors.doneBrand,
|
|
60
|
+
muted: sandColors.doneAccent,
|
|
61
|
+
subtle: sandColors.doneTint,
|
|
62
|
+
},
|
|
63
|
+
border: {
|
|
64
|
+
default: '#DBCDB4',
|
|
65
|
+
muted: '#E7DCC7',
|
|
66
|
+
},
|
|
67
|
+
btn: {
|
|
68
|
+
text: '#2B2118',
|
|
69
|
+
bg: '#FBF7EF',
|
|
70
|
+
border: '#D3C3A6',
|
|
71
|
+
hoverBg: sandColors.sandTint,
|
|
72
|
+
hoverBorder: sandColors.gray,
|
|
73
|
+
activeBg: sandColors.sandTint,
|
|
74
|
+
activeBorder: sandColors.gray,
|
|
75
|
+
selectedBg: '#FBF7EF',
|
|
76
|
+
counterBg: sandColors.gray,
|
|
77
|
+
primary: {
|
|
78
|
+
text: '#FBF7EF',
|
|
79
|
+
bg: sandColors.sandText,
|
|
80
|
+
border: sandColors.sandText,
|
|
81
|
+
hoverBg: sandColors.sandHover,
|
|
82
|
+
hoverBorder: sandColors.sandHover,
|
|
83
|
+
selectedBg: sandColors.sandHover,
|
|
84
|
+
disabledText: 'rgba(255, 255, 255, 0.8)',
|
|
85
|
+
disabledBg: '#D8C58A',
|
|
86
|
+
disabledBorder: '#D8C58A',
|
|
87
|
+
icon: '#FBF7EF',
|
|
88
|
+
counterBg: 'rgba(0, 0, 0, 0.2)',
|
|
89
|
+
},
|
|
90
|
+
outline: {
|
|
91
|
+
text: sandColors.sandText,
|
|
92
|
+
hoverText: '#FBF7EF',
|
|
93
|
+
hoverBg: sandColors.sandText,
|
|
94
|
+
hoverBorder: sandColors.sandText,
|
|
95
|
+
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
96
|
+
selectedText: '#FBF7EF',
|
|
97
|
+
selectedBg: sandColors.sandHover,
|
|
98
|
+
selectedBorder: sandColors.sandHover,
|
|
99
|
+
disabledText: sandColors.gray,
|
|
100
|
+
disabledBg: sandColors.sandTint,
|
|
101
|
+
disabledCounterBg: 'rgba(0, 0, 0, 0.05)',
|
|
102
|
+
counterBg: 'rgba(0, 0, 0, 0.05)',
|
|
103
|
+
counterFg: sandColors.sandText,
|
|
104
|
+
hoverCounterFg: '#FBF7EF',
|
|
105
|
+
disabledCounterFg: sandColors.gray,
|
|
106
|
+
},
|
|
107
|
+
danger: {
|
|
108
|
+
text: '#B42318',
|
|
109
|
+
hoverText: '#FBF7EF',
|
|
110
|
+
hoverBg: '#B42318',
|
|
111
|
+
hoverBorder: '#B42318',
|
|
112
|
+
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
113
|
+
selectedText: '#FBF7EF',
|
|
114
|
+
selectedBg: '#8E1B12',
|
|
115
|
+
selectedBorder: '#8E1B12',
|
|
116
|
+
disabledText: 'rgba(180, 35, 24, 0.5)',
|
|
117
|
+
disabledBg: sandColors.sandTint,
|
|
118
|
+
disabledCounterBg: 'rgba(180, 35, 24, 0.05)',
|
|
119
|
+
counterBg: 'rgba(180, 35, 24, 0.1)',
|
|
120
|
+
counterFg: '#B42318',
|
|
121
|
+
hoverCounterFg: '#FBF7EF',
|
|
122
|
+
disabledCounterFg: 'rgba(180, 35, 24, 0.5)',
|
|
123
|
+
icon: '#B42318',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
/* ── Dark-mode colour definitions ────────────────────────────────────── */
|
|
128
|
+
const sandDark = {
|
|
129
|
+
canvas: {
|
|
130
|
+
default: sandColors.black,
|
|
131
|
+
subtle: '#2A2118',
|
|
132
|
+
},
|
|
133
|
+
fg: {
|
|
134
|
+
default: '#EDE3D3',
|
|
135
|
+
muted: '#B7A793',
|
|
136
|
+
onEmphasis: '#FBF7EF',
|
|
137
|
+
},
|
|
138
|
+
accent: {
|
|
139
|
+
fg: sandColors.sandBright,
|
|
140
|
+
emphasis: '#8A6E10',
|
|
141
|
+
muted: sandColors.sandBrand,
|
|
142
|
+
subtle: '#33290F',
|
|
143
|
+
},
|
|
144
|
+
success: {
|
|
145
|
+
fg: '#7CB07E',
|
|
146
|
+
emphasis: '#3E6B47',
|
|
147
|
+
muted: '#5E8A5E',
|
|
148
|
+
subtle: '#16261A',
|
|
149
|
+
},
|
|
150
|
+
attention: {
|
|
151
|
+
fg: '#E7C24E',
|
|
152
|
+
emphasis: '#8A6D08',
|
|
153
|
+
muted: sandColors.attentionAccent,
|
|
154
|
+
subtle: '#2E2606',
|
|
155
|
+
},
|
|
156
|
+
danger: {
|
|
157
|
+
fg: '#F08A70',
|
|
158
|
+
emphasis: '#A8412A',
|
|
159
|
+
muted: sandColors.dangerAccent,
|
|
160
|
+
subtle: '#2E140E',
|
|
161
|
+
},
|
|
162
|
+
severe: {
|
|
163
|
+
fg: '#E6A566',
|
|
164
|
+
emphasis: '#A85E1E',
|
|
165
|
+
muted: sandColors.severeAccent,
|
|
166
|
+
subtle: '#2E1D0A',
|
|
167
|
+
},
|
|
168
|
+
done: {
|
|
169
|
+
fg: '#B09AD0',
|
|
170
|
+
emphasis: '#6A548F',
|
|
171
|
+
muted: sandColors.doneAccent,
|
|
172
|
+
subtle: '#1F1830',
|
|
173
|
+
},
|
|
174
|
+
btn: {
|
|
175
|
+
text: '#EDE3D3',
|
|
176
|
+
bg: '#2E2418',
|
|
177
|
+
border: 'rgba(237, 227, 211, 0.12)',
|
|
178
|
+
hoverBg: '#3A2E1E',
|
|
179
|
+
hoverBorder: '#B7A793',
|
|
180
|
+
activeBg: '#2E2418',
|
|
181
|
+
activeBorder: '#8A7A63',
|
|
182
|
+
selectedBg: '#241C12',
|
|
183
|
+
counterBg: '#3A2E1E',
|
|
184
|
+
primary: {
|
|
185
|
+
text: '#211A12',
|
|
186
|
+
bg: sandColors.sandBright,
|
|
187
|
+
border: 'rgba(237, 227, 211, 0.12)',
|
|
188
|
+
hoverBg: sandColors.sandAccent,
|
|
189
|
+
hoverBorder: 'rgba(237, 227, 211, 0.12)',
|
|
190
|
+
selectedBg: sandColors.sandAccent,
|
|
191
|
+
disabledText: 'rgba(33, 26, 18, 0.5)',
|
|
192
|
+
disabledBg: 'rgba(236, 217, 143, 0.35)',
|
|
193
|
+
disabledBorder: 'rgba(236, 217, 143, 0.2)',
|
|
194
|
+
icon: '#211A12',
|
|
195
|
+
counterBg: 'rgba(0, 0, 0, 0.2)',
|
|
196
|
+
},
|
|
197
|
+
outline: {
|
|
198
|
+
text: sandColors.sandBright,
|
|
199
|
+
hoverText: '#211A12',
|
|
200
|
+
hoverBg: sandColors.sandBright,
|
|
201
|
+
hoverBorder: sandColors.sandBright,
|
|
202
|
+
hoverCounterBg: 'rgba(0, 0, 0, 0.2)',
|
|
203
|
+
selectedText: '#211A12',
|
|
204
|
+
selectedBg: sandColors.sandAccent,
|
|
205
|
+
selectedBorder: sandColors.sandAccent,
|
|
206
|
+
disabledText: 'rgba(236, 217, 143, 0.5)',
|
|
207
|
+
disabledBg: 'rgba(236, 217, 143, 0.1)',
|
|
208
|
+
disabledCounterBg: 'rgba(236, 217, 143, 0.05)',
|
|
209
|
+
counterBg: 'rgba(236, 217, 143, 0.1)',
|
|
210
|
+
counterFg: sandColors.sandBright,
|
|
211
|
+
hoverCounterFg: '#211A12',
|
|
212
|
+
disabledCounterFg: 'rgba(236, 217, 143, 0.5)',
|
|
213
|
+
},
|
|
214
|
+
danger: {
|
|
215
|
+
text: '#f85149',
|
|
216
|
+
hoverText: '#FBF7EF',
|
|
217
|
+
hoverBg: '#da3633',
|
|
218
|
+
hoverBorder: '#f85149',
|
|
219
|
+
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
220
|
+
selectedText: '#FBF7EF',
|
|
221
|
+
selectedBg: '#b62324',
|
|
222
|
+
selectedBorder: '#ff7b72',
|
|
223
|
+
disabledText: 'rgba(248, 81, 73, 0.5)',
|
|
224
|
+
disabledBg: 'rgba(248, 81, 73, 0.1)',
|
|
225
|
+
disabledCounterBg: 'rgba(248, 81, 73, 0.05)',
|
|
226
|
+
counterBg: 'rgba(248, 81, 73, 0.1)',
|
|
227
|
+
counterFg: '#f85149',
|
|
228
|
+
hoverCounterFg: '#FBF7EF',
|
|
229
|
+
disabledCounterFg: 'rgba(248, 81, 73, 0.5)',
|
|
230
|
+
icon: '#f85149',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
/* ── Exports ─────────────────────────────────────────────────────────── */
|
|
235
|
+
/**
|
|
236
|
+
* The Primer theme object.
|
|
237
|
+
*
|
|
238
|
+
* Since theming is done entirely via CSS custom properties
|
|
239
|
+
* (see `sandThemeStyles`), this is just the unmodified default Primer
|
|
240
|
+
* theme kept for backward compatibility.
|
|
241
|
+
*/
|
|
242
|
+
export const sandTheme = primerTheme;
|
|
243
|
+
/**
|
|
244
|
+
* Warm humanist-serif font stack for the Sand aesthetic.
|
|
245
|
+
*
|
|
246
|
+
* Leads with Georgia — the most reliable warm transitional serif across
|
|
247
|
+
* macOS / Windows / Linux — so the intended editorial, book-like feel
|
|
248
|
+
* (Anthropic-style) renders consistently everywhere without web-font
|
|
249
|
+
* loading (same no-download approach as the Matrix monospace stack).
|
|
250
|
+
*/
|
|
251
|
+
const sandFontFamily = 'Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Cambria, serif';
|
|
252
|
+
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
253
|
+
export const sandThemeStyles = buildThemeStyles(sandLight, sandDark, {
|
|
254
|
+
fontFamily: sandFontFamily,
|
|
255
|
+
});
|
|
256
|
+
export default sandTheme;
|
|
@@ -15,6 +15,7 @@ import { buildThemeStyles } from '../css/createThemeCSSVars';
|
|
|
15
15
|
const spatialLight = {
|
|
16
16
|
canvas: {
|
|
17
17
|
default: spatialColors.white,
|
|
18
|
+
subtle: '#EEF1FA',
|
|
18
19
|
},
|
|
19
20
|
fg: {
|
|
20
21
|
default: '#1E1E3F',
|
|
@@ -25,11 +26,37 @@ const spatialLight = {
|
|
|
25
26
|
fg: spatialColors.indigoText,
|
|
26
27
|
emphasis: spatialColors.indigoBrand,
|
|
27
28
|
muted: spatialColors.indigoAccent,
|
|
29
|
+
subtle: spatialColors.indigoTint,
|
|
28
30
|
},
|
|
29
31
|
success: {
|
|
30
|
-
fg:
|
|
31
|
-
emphasis:
|
|
32
|
-
muted:
|
|
32
|
+
fg: '#1a7f37',
|
|
33
|
+
emphasis: '#2da44e',
|
|
34
|
+
muted: '#4ac26b',
|
|
35
|
+
subtle: '#dafbe1',
|
|
36
|
+
},
|
|
37
|
+
attention: {
|
|
38
|
+
fg: spatialColors.attentionBrand,
|
|
39
|
+
emphasis: spatialColors.attentionAccent,
|
|
40
|
+
muted: spatialColors.attentionBrand,
|
|
41
|
+
subtle: spatialColors.attentionTint,
|
|
42
|
+
},
|
|
43
|
+
danger: {
|
|
44
|
+
fg: spatialColors.dangerBrand,
|
|
45
|
+
emphasis: spatialColors.dangerBrand,
|
|
46
|
+
muted: spatialColors.dangerAccent,
|
|
47
|
+
subtle: spatialColors.dangerTint,
|
|
48
|
+
},
|
|
49
|
+
severe: {
|
|
50
|
+
fg: spatialColors.severeBrand,
|
|
51
|
+
emphasis: spatialColors.severeBrand,
|
|
52
|
+
muted: spatialColors.severeAccent,
|
|
53
|
+
subtle: spatialColors.severeTint,
|
|
54
|
+
},
|
|
55
|
+
done: {
|
|
56
|
+
fg: spatialColors.doneBrand,
|
|
57
|
+
emphasis: spatialColors.doneBrand,
|
|
58
|
+
muted: spatialColors.doneAccent,
|
|
59
|
+
subtle: spatialColors.doneTint,
|
|
33
60
|
},
|
|
34
61
|
btn: {
|
|
35
62
|
text: '#1E1E3F',
|
|
@@ -109,10 +136,34 @@ const spatialDark = {
|
|
|
109
136
|
subtle: '#1E1B4B',
|
|
110
137
|
},
|
|
111
138
|
success: {
|
|
112
|
-
fg:
|
|
113
|
-
emphasis:
|
|
114
|
-
muted:
|
|
115
|
-
subtle: '#
|
|
139
|
+
fg: '#3fb950',
|
|
140
|
+
emphasis: '#238636',
|
|
141
|
+
muted: '#2ea043',
|
|
142
|
+
subtle: '#0f2a18',
|
|
143
|
+
},
|
|
144
|
+
attention: {
|
|
145
|
+
fg: '#f2cc60',
|
|
146
|
+
emphasis: '#a36f00',
|
|
147
|
+
muted: spatialColors.attentionBrand,
|
|
148
|
+
subtle: '#332300',
|
|
149
|
+
},
|
|
150
|
+
danger: {
|
|
151
|
+
fg: '#ff9aa2',
|
|
152
|
+
emphasis: '#c93d45',
|
|
153
|
+
muted: spatialColors.dangerBrand,
|
|
154
|
+
subtle: '#34161b',
|
|
155
|
+
},
|
|
156
|
+
severe: {
|
|
157
|
+
fg: '#ffba84',
|
|
158
|
+
emphasis: '#bd6a2d',
|
|
159
|
+
muted: spatialColors.severeBrand,
|
|
160
|
+
subtle: '#321d08',
|
|
161
|
+
},
|
|
162
|
+
done: {
|
|
163
|
+
fg: '#c4b5fd',
|
|
164
|
+
emphasis: '#8b5cf6',
|
|
165
|
+
muted: spatialColors.doneBrand,
|
|
166
|
+
subtle: '#22194a',
|
|
116
167
|
},
|
|
117
168
|
btn: {
|
|
118
169
|
text: '#E0E7FF',
|