@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
|
@@ -1,257 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2023-
|
|
2
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Theming is applied via **CSS custom-property overrides**.
|
|
6
|
+
* The sun theme for Primer React: its styles, from `./sunThemeStyles`,
|
|
7
|
+
* and the Primer theme object. Theming is done through CSS custom
|
|
8
|
+
* properties, so the object is Primer's unmodified default, kept for
|
|
9
|
+
* `<ThemeProvider theme={…}>`. Code that needs the tokens without Primer
|
|
10
|
+
* React (a native app) imports the styles module instead.
|
|
12
11
|
*/
|
|
13
12
|
import { theme as primerTheme } from '@primer/react';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/* ── Light-mode colour definitions ───────────────────────────────────── */
|
|
17
|
-
const sunLight = {
|
|
18
|
-
canvas: {
|
|
19
|
-
default: sunColors.white,
|
|
20
|
-
subtle: '#FFF3D6',
|
|
21
|
-
},
|
|
22
|
-
fg: {
|
|
23
|
-
default: '#2A2210',
|
|
24
|
-
muted: sunColors.gray,
|
|
25
|
-
onEmphasis: '#FFFBF0',
|
|
26
|
-
},
|
|
27
|
-
accent: {
|
|
28
|
-
fg: sunColors.sunText,
|
|
29
|
-
emphasis: sunColors.sunText,
|
|
30
|
-
muted: sunColors.sunAccent,
|
|
31
|
-
subtle: sunColors.sunTint,
|
|
32
|
-
},
|
|
33
|
-
success: {
|
|
34
|
-
fg: '#3E6B47',
|
|
35
|
-
emphasis: '#3E6B47',
|
|
36
|
-
muted: '#5E8A5E',
|
|
37
|
-
subtle: '#E1EEE0',
|
|
38
|
-
},
|
|
39
|
-
attention: {
|
|
40
|
-
fg: sunColors.attentionBrand,
|
|
41
|
-
emphasis: sunColors.attentionBrand,
|
|
42
|
-
muted: sunColors.attentionAccent,
|
|
43
|
-
subtle: sunColors.attentionTint,
|
|
44
|
-
},
|
|
45
|
-
danger: {
|
|
46
|
-
fg: sunColors.dangerBrand,
|
|
47
|
-
emphasis: sunColors.dangerBrand,
|
|
48
|
-
muted: sunColors.dangerAccent,
|
|
49
|
-
subtle: sunColors.dangerTint,
|
|
50
|
-
},
|
|
51
|
-
severe: {
|
|
52
|
-
fg: sunColors.severeBrand,
|
|
53
|
-
emphasis: sunColors.severeBrand,
|
|
54
|
-
muted: sunColors.severeAccent,
|
|
55
|
-
subtle: sunColors.severeTint,
|
|
56
|
-
},
|
|
57
|
-
done: {
|
|
58
|
-
fg: sunColors.doneBrand,
|
|
59
|
-
emphasis: sunColors.doneBrand,
|
|
60
|
-
muted: sunColors.doneAccent,
|
|
61
|
-
subtle: sunColors.doneTint,
|
|
62
|
-
},
|
|
63
|
-
border: {
|
|
64
|
-
default: '#F0E2BE',
|
|
65
|
-
muted: '#F6ECCF',
|
|
66
|
-
},
|
|
67
|
-
btn: {
|
|
68
|
-
text: '#2A2210',
|
|
69
|
-
bg: '#FFFCF3',
|
|
70
|
-
border: '#EEDCB2',
|
|
71
|
-
hoverBg: sunColors.sunTint,
|
|
72
|
-
hoverBorder: sunColors.gray,
|
|
73
|
-
activeBg: sunColors.sunTint,
|
|
74
|
-
activeBorder: sunColors.gray,
|
|
75
|
-
selectedBg: '#FFFCF3',
|
|
76
|
-
counterBg: sunColors.gray,
|
|
77
|
-
primary: {
|
|
78
|
-
text: '#FFFBF0',
|
|
79
|
-
bg: sunColors.sunText,
|
|
80
|
-
border: sunColors.sunText,
|
|
81
|
-
hoverBg: sunColors.sunHover,
|
|
82
|
-
hoverBorder: sunColors.sunHover,
|
|
83
|
-
selectedBg: sunColors.sunHover,
|
|
84
|
-
disabledText: 'rgba(255, 255, 255, 0.8)',
|
|
85
|
-
disabledBg: '#E0BE73',
|
|
86
|
-
disabledBorder: '#E0BE73',
|
|
87
|
-
icon: '#FFFBF0',
|
|
88
|
-
counterBg: 'rgba(0, 0, 0, 0.2)',
|
|
89
|
-
},
|
|
90
|
-
outline: {
|
|
91
|
-
text: sunColors.sunText,
|
|
92
|
-
hoverText: '#FFFBF0',
|
|
93
|
-
hoverBg: sunColors.sunText,
|
|
94
|
-
hoverBorder: sunColors.sunText,
|
|
95
|
-
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
96
|
-
selectedText: '#FFFBF0',
|
|
97
|
-
selectedBg: sunColors.sunHover,
|
|
98
|
-
selectedBorder: sunColors.sunHover,
|
|
99
|
-
disabledText: sunColors.gray,
|
|
100
|
-
disabledBg: sunColors.sunTint,
|
|
101
|
-
disabledCounterBg: 'rgba(0, 0, 0, 0.05)',
|
|
102
|
-
counterBg: 'rgba(0, 0, 0, 0.05)',
|
|
103
|
-
counterFg: sunColors.sunText,
|
|
104
|
-
hoverCounterFg: '#FFFBF0',
|
|
105
|
-
disabledCounterFg: sunColors.gray,
|
|
106
|
-
},
|
|
107
|
-
danger: {
|
|
108
|
-
text: '#B42318',
|
|
109
|
-
hoverText: '#FFFBF0',
|
|
110
|
-
hoverBg: '#B42318',
|
|
111
|
-
hoverBorder: '#B42318',
|
|
112
|
-
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
113
|
-
selectedText: '#FFFBF0',
|
|
114
|
-
selectedBg: '#8E1B12',
|
|
115
|
-
selectedBorder: '#8E1B12',
|
|
116
|
-
disabledText: 'rgba(180, 35, 24, 0.5)',
|
|
117
|
-
disabledBg: sunColors.sunTint,
|
|
118
|
-
disabledCounterBg: 'rgba(180, 35, 24, 0.05)',
|
|
119
|
-
counterBg: 'rgba(180, 35, 24, 0.1)',
|
|
120
|
-
counterFg: '#B42318',
|
|
121
|
-
hoverCounterFg: '#FFFBF0',
|
|
122
|
-
disabledCounterFg: 'rgba(180, 35, 24, 0.5)',
|
|
123
|
-
icon: '#B42318',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
/* ── Dark-mode colour definitions ────────────────────────────────────── */
|
|
128
|
-
const sunDark = {
|
|
129
|
-
canvas: {
|
|
130
|
-
default: sunColors.black,
|
|
131
|
-
subtle: '#2A2109',
|
|
132
|
-
},
|
|
133
|
-
fg: {
|
|
134
|
-
default: '#F3E9CF',
|
|
135
|
-
muted: '#BEAC82',
|
|
136
|
-
onEmphasis: '#FFFBF0',
|
|
137
|
-
},
|
|
138
|
-
accent: {
|
|
139
|
-
fg: sunColors.sunBright,
|
|
140
|
-
emphasis: '#8A6E00',
|
|
141
|
-
muted: sunColors.sunBrand,
|
|
142
|
-
subtle: '#33290C',
|
|
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: sunColors.attentionAccent,
|
|
154
|
-
subtle: '#2E2606',
|
|
155
|
-
},
|
|
156
|
-
danger: {
|
|
157
|
-
fg: '#F08A70',
|
|
158
|
-
emphasis: '#B23A1E',
|
|
159
|
-
muted: sunColors.dangerAccent,
|
|
160
|
-
subtle: '#2E140E',
|
|
161
|
-
},
|
|
162
|
-
severe: {
|
|
163
|
-
fg: '#E6A566',
|
|
164
|
-
emphasis: '#A85D0C',
|
|
165
|
-
muted: sunColors.severeAccent,
|
|
166
|
-
subtle: '#2E1D0A',
|
|
167
|
-
},
|
|
168
|
-
done: {
|
|
169
|
-
fg: '#B09AD0',
|
|
170
|
-
emphasis: '#6A4E9E',
|
|
171
|
-
muted: sunColors.doneAccent,
|
|
172
|
-
subtle: '#1F1830',
|
|
173
|
-
},
|
|
174
|
-
btn: {
|
|
175
|
-
text: '#F3E9CF',
|
|
176
|
-
bg: '#2E2509',
|
|
177
|
-
border: 'rgba(243, 233, 207, 0.12)',
|
|
178
|
-
hoverBg: '#3A2F0D',
|
|
179
|
-
hoverBorder: '#BEAC82',
|
|
180
|
-
activeBg: '#2E2509',
|
|
181
|
-
activeBorder: '#8C7C4A',
|
|
182
|
-
selectedBg: '#241D07',
|
|
183
|
-
counterBg: '#3A2F0D',
|
|
184
|
-
primary: {
|
|
185
|
-
text: '#211A08',
|
|
186
|
-
bg: sunColors.sunBright,
|
|
187
|
-
border: 'rgba(243, 233, 207, 0.12)',
|
|
188
|
-
hoverBg: sunColors.sunAccent,
|
|
189
|
-
hoverBorder: 'rgba(243, 233, 207, 0.12)',
|
|
190
|
-
selectedBg: sunColors.sunAccent,
|
|
191
|
-
disabledText: 'rgba(33, 26, 8, 0.5)',
|
|
192
|
-
disabledBg: 'rgba(255, 213, 74, 0.35)',
|
|
193
|
-
disabledBorder: 'rgba(255, 213, 74, 0.2)',
|
|
194
|
-
icon: '#211A08',
|
|
195
|
-
counterBg: 'rgba(0, 0, 0, 0.2)',
|
|
196
|
-
},
|
|
197
|
-
outline: {
|
|
198
|
-
text: sunColors.sunBright,
|
|
199
|
-
hoverText: '#211A08',
|
|
200
|
-
hoverBg: sunColors.sunBright,
|
|
201
|
-
hoverBorder: sunColors.sunBright,
|
|
202
|
-
hoverCounterBg: 'rgba(0, 0, 0, 0.2)',
|
|
203
|
-
selectedText: '#211A08',
|
|
204
|
-
selectedBg: sunColors.sunAccent,
|
|
205
|
-
selectedBorder: sunColors.sunAccent,
|
|
206
|
-
disabledText: 'rgba(255, 213, 74, 0.5)',
|
|
207
|
-
disabledBg: 'rgba(255, 213, 74, 0.1)',
|
|
208
|
-
disabledCounterBg: 'rgba(255, 213, 74, 0.05)',
|
|
209
|
-
counterBg: 'rgba(255, 213, 74, 0.1)',
|
|
210
|
-
counterFg: sunColors.sunBright,
|
|
211
|
-
hoverCounterFg: '#211A08',
|
|
212
|
-
disabledCounterFg: 'rgba(255, 213, 74, 0.5)',
|
|
213
|
-
},
|
|
214
|
-
danger: {
|
|
215
|
-
text: '#f85149',
|
|
216
|
-
hoverText: '#FFFBF0',
|
|
217
|
-
hoverBg: '#da3633',
|
|
218
|
-
hoverBorder: '#f85149',
|
|
219
|
-
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
220
|
-
selectedText: '#FFFBF0',
|
|
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: '#FFFBF0',
|
|
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 `sunThemeStyles`), this is just the unmodified default Primer
|
|
240
|
-
* theme kept for backward compatibility.
|
|
241
|
-
*/
|
|
13
|
+
export * from './sunThemeStyles';
|
|
14
|
+
/** The Primer theme object: Primer's default. */
|
|
242
15
|
export const sunTheme = primerTheme;
|
|
243
|
-
/**
|
|
244
|
-
* Friendly humanist-sans font stack for the Sun aesthetic.
|
|
245
|
-
*
|
|
246
|
-
* Leads with warm geometric-humanist sans-serifs (Avenir / Segoe UI /
|
|
247
|
-
* Ubuntu / Cantarell) for an approachable, optimistic feel, with
|
|
248
|
-
* cross-platform fallbacks across macOS / Windows / Linux so it renders
|
|
249
|
-
* consistently everywhere without web-font loading (same no-download
|
|
250
|
-
* approach as the Matrix monospace stack).
|
|
251
|
-
*/
|
|
252
|
-
const sunFontFamily = '"Avenir Next", Avenir, "Segoe UI", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif';
|
|
253
|
-
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
254
|
-
export const sunThemeStyles = buildThemeStyles(sunLight, sunDark, {
|
|
255
|
-
fontFamily: sunFontFamily,
|
|
256
|
-
});
|
|
257
16
|
export default sunTheme;
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Sun Theme for Primer React.
|
|
7
|
+
*
|
|
8
|
+
* Warm, radiant golden light with a deep amber accent — energetic,
|
|
9
|
+
* optimistic, and welcoming. Uses a friendly humanist-sans type stack
|
|
10
|
+
* for an approachable, cheerful feel.
|
|
11
|
+
* Theming is applied via **CSS custom-property overrides**.
|
|
12
|
+
*/
|
|
13
|
+
import { sunColors } from '../colors/sunColors';
|
|
14
|
+
import { buildThemeStyles } from '../css/createThemeCSSVars';
|
|
15
|
+
/* ── Light-mode colour definitions ───────────────────────────────────── */
|
|
16
|
+
const sunLight = {
|
|
17
|
+
canvas: {
|
|
18
|
+
default: sunColors.white,
|
|
19
|
+
subtle: '#FFF3D6',
|
|
20
|
+
},
|
|
21
|
+
fg: {
|
|
22
|
+
default: '#2A2210',
|
|
23
|
+
muted: sunColors.gray,
|
|
24
|
+
onEmphasis: '#FFFBF0',
|
|
25
|
+
},
|
|
26
|
+
accent: {
|
|
27
|
+
fg: sunColors.sunText,
|
|
28
|
+
emphasis: sunColors.sunText,
|
|
29
|
+
muted: sunColors.sunAccent,
|
|
30
|
+
subtle: sunColors.sunTint,
|
|
31
|
+
},
|
|
32
|
+
success: {
|
|
33
|
+
fg: '#3E6B47',
|
|
34
|
+
emphasis: '#3E6B47',
|
|
35
|
+
muted: '#5E8A5E',
|
|
36
|
+
subtle: '#E1EEE0',
|
|
37
|
+
},
|
|
38
|
+
attention: {
|
|
39
|
+
fg: sunColors.attentionBrand,
|
|
40
|
+
emphasis: sunColors.attentionBrand,
|
|
41
|
+
muted: sunColors.attentionAccent,
|
|
42
|
+
subtle: sunColors.attentionTint,
|
|
43
|
+
},
|
|
44
|
+
danger: {
|
|
45
|
+
fg: sunColors.dangerBrand,
|
|
46
|
+
emphasis: sunColors.dangerBrand,
|
|
47
|
+
muted: sunColors.dangerAccent,
|
|
48
|
+
subtle: sunColors.dangerTint,
|
|
49
|
+
},
|
|
50
|
+
severe: {
|
|
51
|
+
fg: sunColors.severeBrand,
|
|
52
|
+
emphasis: sunColors.severeBrand,
|
|
53
|
+
muted: sunColors.severeAccent,
|
|
54
|
+
subtle: sunColors.severeTint,
|
|
55
|
+
},
|
|
56
|
+
done: {
|
|
57
|
+
fg: sunColors.doneBrand,
|
|
58
|
+
emphasis: sunColors.doneBrand,
|
|
59
|
+
muted: sunColors.doneAccent,
|
|
60
|
+
subtle: sunColors.doneTint,
|
|
61
|
+
},
|
|
62
|
+
border: {
|
|
63
|
+
default: '#F0E2BE',
|
|
64
|
+
muted: '#F6ECCF',
|
|
65
|
+
},
|
|
66
|
+
btn: {
|
|
67
|
+
text: '#2A2210',
|
|
68
|
+
bg: '#FFFCF3',
|
|
69
|
+
border: '#EEDCB2',
|
|
70
|
+
hoverBg: sunColors.sunTint,
|
|
71
|
+
hoverBorder: sunColors.gray,
|
|
72
|
+
activeBg: sunColors.sunTint,
|
|
73
|
+
activeBorder: sunColors.gray,
|
|
74
|
+
selectedBg: '#FFFCF3',
|
|
75
|
+
counterBg: sunColors.gray,
|
|
76
|
+
primary: {
|
|
77
|
+
text: '#FFFBF0',
|
|
78
|
+
bg: sunColors.sunText,
|
|
79
|
+
border: sunColors.sunText,
|
|
80
|
+
hoverBg: sunColors.sunHover,
|
|
81
|
+
hoverBorder: sunColors.sunHover,
|
|
82
|
+
selectedBg: sunColors.sunHover,
|
|
83
|
+
disabledText: 'rgba(255, 255, 255, 0.8)',
|
|
84
|
+
disabledBg: '#E0BE73',
|
|
85
|
+
disabledBorder: '#E0BE73',
|
|
86
|
+
icon: '#FFFBF0',
|
|
87
|
+
counterBg: 'rgba(0, 0, 0, 0.2)',
|
|
88
|
+
},
|
|
89
|
+
outline: {
|
|
90
|
+
text: sunColors.sunText,
|
|
91
|
+
hoverText: '#FFFBF0',
|
|
92
|
+
hoverBg: sunColors.sunText,
|
|
93
|
+
hoverBorder: sunColors.sunText,
|
|
94
|
+
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
95
|
+
selectedText: '#FFFBF0',
|
|
96
|
+
selectedBg: sunColors.sunHover,
|
|
97
|
+
selectedBorder: sunColors.sunHover,
|
|
98
|
+
disabledText: sunColors.gray,
|
|
99
|
+
disabledBg: sunColors.sunTint,
|
|
100
|
+
disabledCounterBg: 'rgba(0, 0, 0, 0.05)',
|
|
101
|
+
counterBg: 'rgba(0, 0, 0, 0.05)',
|
|
102
|
+
counterFg: sunColors.sunText,
|
|
103
|
+
hoverCounterFg: '#FFFBF0',
|
|
104
|
+
disabledCounterFg: sunColors.gray,
|
|
105
|
+
},
|
|
106
|
+
danger: {
|
|
107
|
+
text: '#B42318',
|
|
108
|
+
hoverText: '#FFFBF0',
|
|
109
|
+
hoverBg: '#B42318',
|
|
110
|
+
hoverBorder: '#B42318',
|
|
111
|
+
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
112
|
+
selectedText: '#FFFBF0',
|
|
113
|
+
selectedBg: '#8E1B12',
|
|
114
|
+
selectedBorder: '#8E1B12',
|
|
115
|
+
disabledText: 'rgba(180, 35, 24, 0.5)',
|
|
116
|
+
disabledBg: sunColors.sunTint,
|
|
117
|
+
disabledCounterBg: 'rgba(180, 35, 24, 0.05)',
|
|
118
|
+
counterBg: 'rgba(180, 35, 24, 0.1)',
|
|
119
|
+
counterFg: '#B42318',
|
|
120
|
+
hoverCounterFg: '#FFFBF0',
|
|
121
|
+
disabledCounterFg: 'rgba(180, 35, 24, 0.5)',
|
|
122
|
+
icon: '#B42318',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
/* ── Dark-mode colour definitions ────────────────────────────────────── */
|
|
127
|
+
const sunDark = {
|
|
128
|
+
canvas: {
|
|
129
|
+
default: sunColors.black,
|
|
130
|
+
subtle: '#2A2109',
|
|
131
|
+
},
|
|
132
|
+
fg: {
|
|
133
|
+
default: '#F3E9CF',
|
|
134
|
+
muted: '#BEAC82',
|
|
135
|
+
onEmphasis: '#FFFBF0',
|
|
136
|
+
},
|
|
137
|
+
accent: {
|
|
138
|
+
fg: sunColors.sunBright,
|
|
139
|
+
emphasis: '#8A6E00',
|
|
140
|
+
muted: sunColors.sunBrand,
|
|
141
|
+
subtle: '#33290C',
|
|
142
|
+
},
|
|
143
|
+
success: {
|
|
144
|
+
fg: '#7CB07E',
|
|
145
|
+
emphasis: '#3E6B47',
|
|
146
|
+
muted: '#5E8A5E',
|
|
147
|
+
subtle: '#16261A',
|
|
148
|
+
},
|
|
149
|
+
attention: {
|
|
150
|
+
fg: '#E7C24E',
|
|
151
|
+
emphasis: '#8A6D08',
|
|
152
|
+
muted: sunColors.attentionAccent,
|
|
153
|
+
subtle: '#2E2606',
|
|
154
|
+
},
|
|
155
|
+
danger: {
|
|
156
|
+
fg: '#F08A70',
|
|
157
|
+
emphasis: '#B23A1E',
|
|
158
|
+
muted: sunColors.dangerAccent,
|
|
159
|
+
subtle: '#2E140E',
|
|
160
|
+
},
|
|
161
|
+
severe: {
|
|
162
|
+
fg: '#E6A566',
|
|
163
|
+
emphasis: '#A85D0C',
|
|
164
|
+
muted: sunColors.severeAccent,
|
|
165
|
+
subtle: '#2E1D0A',
|
|
166
|
+
},
|
|
167
|
+
done: {
|
|
168
|
+
fg: '#B09AD0',
|
|
169
|
+
emphasis: '#6A4E9E',
|
|
170
|
+
muted: sunColors.doneAccent,
|
|
171
|
+
subtle: '#1F1830',
|
|
172
|
+
},
|
|
173
|
+
btn: {
|
|
174
|
+
text: '#F3E9CF',
|
|
175
|
+
bg: '#2E2509',
|
|
176
|
+
border: 'rgba(243, 233, 207, 0.12)',
|
|
177
|
+
hoverBg: '#3A2F0D',
|
|
178
|
+
hoverBorder: '#BEAC82',
|
|
179
|
+
activeBg: '#2E2509',
|
|
180
|
+
activeBorder: '#8C7C4A',
|
|
181
|
+
selectedBg: '#241D07',
|
|
182
|
+
counterBg: '#3A2F0D',
|
|
183
|
+
primary: {
|
|
184
|
+
text: '#211A08',
|
|
185
|
+
bg: sunColors.sunBright,
|
|
186
|
+
border: 'rgba(243, 233, 207, 0.12)',
|
|
187
|
+
hoverBg: sunColors.sunAccent,
|
|
188
|
+
hoverBorder: 'rgba(243, 233, 207, 0.12)',
|
|
189
|
+
selectedBg: sunColors.sunAccent,
|
|
190
|
+
disabledText: 'rgba(33, 26, 8, 0.5)',
|
|
191
|
+
disabledBg: 'rgba(255, 213, 74, 0.35)',
|
|
192
|
+
disabledBorder: 'rgba(255, 213, 74, 0.2)',
|
|
193
|
+
icon: '#211A08',
|
|
194
|
+
counterBg: 'rgba(0, 0, 0, 0.2)',
|
|
195
|
+
},
|
|
196
|
+
outline: {
|
|
197
|
+
text: sunColors.sunBright,
|
|
198
|
+
hoverText: '#211A08',
|
|
199
|
+
hoverBg: sunColors.sunBright,
|
|
200
|
+
hoverBorder: sunColors.sunBright,
|
|
201
|
+
hoverCounterBg: 'rgba(0, 0, 0, 0.2)',
|
|
202
|
+
selectedText: '#211A08',
|
|
203
|
+
selectedBg: sunColors.sunAccent,
|
|
204
|
+
selectedBorder: sunColors.sunAccent,
|
|
205
|
+
disabledText: 'rgba(255, 213, 74, 0.5)',
|
|
206
|
+
disabledBg: 'rgba(255, 213, 74, 0.1)',
|
|
207
|
+
disabledCounterBg: 'rgba(255, 213, 74, 0.05)',
|
|
208
|
+
counterBg: 'rgba(255, 213, 74, 0.1)',
|
|
209
|
+
counterFg: sunColors.sunBright,
|
|
210
|
+
hoverCounterFg: '#211A08',
|
|
211
|
+
disabledCounterFg: 'rgba(255, 213, 74, 0.5)',
|
|
212
|
+
},
|
|
213
|
+
danger: {
|
|
214
|
+
text: '#f85149',
|
|
215
|
+
hoverText: '#FFFBF0',
|
|
216
|
+
hoverBg: '#da3633',
|
|
217
|
+
hoverBorder: '#f85149',
|
|
218
|
+
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
219
|
+
selectedText: '#FFFBF0',
|
|
220
|
+
selectedBg: '#b62324',
|
|
221
|
+
selectedBorder: '#ff7b72',
|
|
222
|
+
disabledText: 'rgba(248, 81, 73, 0.5)',
|
|
223
|
+
disabledBg: 'rgba(248, 81, 73, 0.1)',
|
|
224
|
+
disabledCounterBg: 'rgba(248, 81, 73, 0.05)',
|
|
225
|
+
counterBg: 'rgba(248, 81, 73, 0.1)',
|
|
226
|
+
counterFg: '#f85149',
|
|
227
|
+
hoverCounterFg: '#FFFBF0',
|
|
228
|
+
disabledCounterFg: 'rgba(248, 81, 73, 0.5)',
|
|
229
|
+
icon: '#f85149',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
/* ── Exports ─────────────────────────────────────────────────────────── */
|
|
234
|
+
/**
|
|
235
|
+
* Friendly humanist-sans font stack for the Sun aesthetic.
|
|
236
|
+
*
|
|
237
|
+
* Leads with warm geometric-humanist sans-serifs (Avenir / Segoe UI /
|
|
238
|
+
* Ubuntu / Cantarell) for an approachable, optimistic feel, with
|
|
239
|
+
* cross-platform fallbacks across macOS / Windows / Linux so it renders
|
|
240
|
+
* consistently everywhere without web-font loading (same no-download
|
|
241
|
+
* approach as the Matrix monospace stack).
|
|
242
|
+
*/
|
|
243
|
+
const sunFontFamily = '"Avenir Next", Avenir, "Segoe UI", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif';
|
|
244
|
+
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
245
|
+
export const sunThemeStyles = buildThemeStyles(sunLight, sunDark, {
|
|
246
|
+
fontFamily: sunFontFamily,
|
|
247
|
+
});
|
package/lib/utils/Portals.d.ts
CHANGED
|
@@ -46,6 +46,13 @@ export declare function syncPortalThemeStyles(styles: CSSProperties): void;
|
|
|
46
46
|
* it stops — at the element of any provider nested inside.
|
|
47
47
|
*/
|
|
48
48
|
export declare const THEME_SCOPE_ATTRIBUTE = "data-datalayer-theme-scope";
|
|
49
|
+
/**
|
|
50
|
+
* The attribute an application puts on its own outer Primer `BaseStyles`
|
|
51
|
+
* when it wraps everything in Primer's provider above a Datalayer one: that
|
|
52
|
+
* element is the application's, not a host page's (LOOP T-13), so the
|
|
53
|
+
* provider inside it still themes the page's portal root.
|
|
54
|
+
*/
|
|
55
|
+
export declare const APP_ROOT_ATTRIBUTE = "data-datalayer-app-root";
|
|
49
56
|
/** The attribute on the `<style>` element a provider injects, its value the provider's scope. */
|
|
50
57
|
export declare const THEME_STYLESHEET_ATTRIBUTE = "data-datalayer-theme-stylesheet";
|
|
51
58
|
/** The selector of a provider's own element, from its scope. */
|
package/lib/utils/Portals.js
CHANGED
|
@@ -195,6 +195,13 @@ export function syncPortalThemeStyles(styles) {
|
|
|
195
195
|
* it stops — at the element of any provider nested inside.
|
|
196
196
|
*/
|
|
197
197
|
export const THEME_SCOPE_ATTRIBUTE = 'data-datalayer-theme-scope';
|
|
198
|
+
/**
|
|
199
|
+
* The attribute an application puts on its own outer Primer `BaseStyles`
|
|
200
|
+
* when it wraps everything in Primer's provider above a Datalayer one: that
|
|
201
|
+
* element is the application's, not a host page's (LOOP T-13), so the
|
|
202
|
+
* provider inside it still themes the page's portal root.
|
|
203
|
+
*/
|
|
204
|
+
export const APP_ROOT_ATTRIBUTE = 'data-datalayer-app-root';
|
|
198
205
|
/** The attribute on the `<style>` element a provider injects, its value the provider's scope. */
|
|
199
206
|
export const THEME_STYLESHEET_ATTRIBUTE = 'data-datalayer-theme-stylesheet';
|
|
200
207
|
/** The selector of a provider's own element, from its scope. */
|