@datalayer/primer-addons 1.0.40 → 1.0.42
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 -8
- package/lib/components/date-picker/TimeColumns.d.ts +5 -0
- package/lib/components/date-picker/TimeColumns.js +44 -3
- package/lib/components/logo/DatalayerLogo.js +18 -1
- package/lib/components/toolbar/ToolbarButton.d.ts +2 -2
- package/lib/components/toolbar/ToolbarButton.js +23 -21
- package/lib/components/toolbar/ToolbarDropdown.js +3 -1
- package/lib/theme/colors/index.d.ts +1 -0
- package/lib/theme/colors/index.js +3 -0
- package/lib/theme/colors/vscodeColors.d.ts +280 -0
- package/lib/theme/colors/vscodeColors.js +129 -0
- package/lib/theme/css/primerBaseVars.js +59 -0
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.js +1 -0
- package/lib/theme/palettes/ColorPalette.js +41 -1
- package/lib/theme/themeRegistry.js +2 -0
- package/lib/theme/themeTokens.d.ts +1 -1
- package/lib/theme/themeTokens.js +61 -1
- package/lib/theme/themes/vscodeEditorsCss.d.ts +12 -0
- package/lib/theme/themes/vscodeEditorsCss.js +239 -0
- package/lib/theme/themes/vscodeTheme.d.ts +1085 -0
- package/lib/theme/themes/vscodeTheme.js +17 -0
- package/lib/theme/themes/vscodeThemeStyles.d.ts +7 -0
- package/lib/theme/themes/vscodeThemeStyles.js +246 -0
- package/lib/utils/Portals.d.ts +0 -13
- package/lib/utils/Portals.js +22 -0
- package/package.json +3 -2
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The editor colours the theme reads, with their Light Modern and Dark
|
|
7
|
+
* Modern values (VS Code's own defaults) as the fallbacks outside VS Code.
|
|
8
|
+
*/
|
|
9
|
+
export const vscodeVars = {
|
|
10
|
+
editorBackground: { variable: 'editor-background', light: '#FFFFFF', dark: '#1F1F1F' },
|
|
11
|
+
editorForeground: { variable: 'editor-foreground', light: '#3B3B3B', dark: '#CCCCCC' },
|
|
12
|
+
foreground: { variable: 'foreground', light: '#3B3B3B', dark: '#CCCCCC' },
|
|
13
|
+
descriptionForeground: { variable: 'descriptionForeground', light: '#3B3B3BB3', dark: '#9D9D9D' },
|
|
14
|
+
disabledForeground: { variable: 'disabledForeground', light: '#3B3B3B80', dark: '#CCCCCC80' },
|
|
15
|
+
sideBarBackground: { variable: 'sideBar-background', light: '#F8F8F8', dark: '#181818' },
|
|
16
|
+
editorWidgetBackground: { variable: 'editorWidget-background', light: '#F8F8F8', dark: '#202020' },
|
|
17
|
+
editorWidgetBorder: { variable: 'editorWidget-border', light: '#E5E5E5', dark: '#313131' },
|
|
18
|
+
panelBorder: { variable: 'panel-border', light: '#E5E5E5', dark: '#2B2B2B' },
|
|
19
|
+
widgetShadow: { variable: 'widget-shadow', light: '#00000029', dark: '#0000005C' },
|
|
20
|
+
focusBorder: { variable: 'focusBorder', light: '#005FB8', dark: '#0078D4' },
|
|
21
|
+
textLinkForeground: { variable: 'textLink-foreground', light: '#005FB8', dark: '#4DAAFC' },
|
|
22
|
+
buttonBackground: { variable: 'button-background', light: '#005FB8', dark: '#0078D4' },
|
|
23
|
+
buttonForeground: { variable: 'button-foreground', light: '#FFFFFF', dark: '#FFFFFF' },
|
|
24
|
+
buttonHoverBackground: { variable: 'button-hoverBackground', light: '#0258A8', dark: '#026EC1' },
|
|
25
|
+
buttonBorder: { variable: 'button-border', light: '#0000001A', dark: '#FFFFFF12' },
|
|
26
|
+
buttonSecondaryBackground: { variable: 'button-secondaryBackground', light: '#E5E5E5', dark: '#313131' },
|
|
27
|
+
buttonSecondaryForeground: { variable: 'button-secondaryForeground', light: '#3B3B3B', dark: '#CCCCCC' },
|
|
28
|
+
buttonSecondaryHoverBackground: { variable: 'button-secondaryHoverBackground', light: '#CCCCCC', dark: '#3C3C3C' },
|
|
29
|
+
inputBackground: { variable: 'input-background', light: '#FFFFFF', dark: '#313131' },
|
|
30
|
+
inputForeground: { variable: 'input-foreground', light: '#3B3B3B', dark: '#CCCCCC' },
|
|
31
|
+
inputBorder: { variable: 'input-border', light: '#CECECE', dark: '#3C3C3C' },
|
|
32
|
+
inputPlaceholderForeground: { variable: 'input-placeholderForeground', light: '#767676', dark: '#989898' },
|
|
33
|
+
listHoverBackground: { variable: 'list-hoverBackground', light: '#F2F2F2', dark: '#2A2D2E' },
|
|
34
|
+
listActiveSelectionBackground: { variable: 'list-activeSelectionBackground', light: '#E8E8E8', dark: '#04395E' },
|
|
35
|
+
errorForeground: { variable: 'errorForeground', light: '#F85149', dark: '#F85149' },
|
|
36
|
+
editorWarningForeground: { variable: 'editorWarning-foreground', light: '#BF8803', dark: '#CCA700' },
|
|
37
|
+
editorInfoForeground: { variable: 'editorInfo-foreground', light: '#1A85FF', dark: '#3794FF' },
|
|
38
|
+
testingIconPassed: { variable: 'testing-iconPassed', light: '#388A34', dark: '#73C991' },
|
|
39
|
+
terminalAnsiBlue: { variable: 'terminal-ansiBlue', light: '#0451A5', dark: '#2472C8' },
|
|
40
|
+
terminalAnsiGreen: { variable: 'terminal-ansiGreen', light: '#107C10', dark: '#0DBC79' },
|
|
41
|
+
terminalAnsiMagenta: { variable: 'terminal-ansiMagenta', light: '#BC05BC', dark: '#BC3FBC' },
|
|
42
|
+
terminalAnsiYellow: { variable: 'terminal-ansiYellow', light: '#949800', dark: '#E5E510' },
|
|
43
|
+
terminalAnsiRed: { variable: 'terminal-ansiRed', light: '#CD3131', dark: '#CD3131' },
|
|
44
|
+
terminalAnsiCyan: { variable: 'terminal-ansiCyan', light: '#0598BC', dark: '#11A8CD' },
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* An editor colour as the theme writes it: the live variable, its
|
|
48
|
+
* mode's default when the page is not a VS Code webview.
|
|
49
|
+
*
|
|
50
|
+
* @param name - The colour.
|
|
51
|
+
* @param mode - Which default to fall back on.
|
|
52
|
+
*
|
|
53
|
+
* @returns `var(--vscode-<variable>, <fallback>)`.
|
|
54
|
+
*/
|
|
55
|
+
export function vscodeVar(name, mode) {
|
|
56
|
+
const color = vscodeVars[name];
|
|
57
|
+
return `var(--vscode-${color.variable}, ${color[mode]})`;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* An editor colour at a fraction of its opacity, for the muted surfaces
|
|
61
|
+
* (a banner's tint, a chip's background): the live colour mixed with
|
|
62
|
+
* transparency, which keeps following the editor's theme.
|
|
63
|
+
*
|
|
64
|
+
* @param name - The colour.
|
|
65
|
+
* @param mode - Which default to fall back on.
|
|
66
|
+
* @param percent - How much of the colour, 0 to 100.
|
|
67
|
+
*
|
|
68
|
+
* @returns A `color-mix()` of the colour and transparent.
|
|
69
|
+
*/
|
|
70
|
+
export function vscodeTint(name, mode, percent) {
|
|
71
|
+
return `color-mix(in srgb, ${vscodeVar(name, mode)} ${percent}%, transparent)`;
|
|
72
|
+
}
|
|
73
|
+
/** The editor's sans-serif, when the page is not a VS Code webview. */
|
|
74
|
+
const vscodeSystemFont = 'system-ui, "Ubuntu", "Droid Sans", -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", sans-serif';
|
|
75
|
+
/** The editor's UI font: VS Code's, else what VS Code picks on each OS. */
|
|
76
|
+
export const vscodeFontFamily = `var(--vscode-font-family, ${vscodeSystemFont})`;
|
|
77
|
+
/** The editor's code font. */
|
|
78
|
+
export const vscodeMonoFontFamily = 'var(--vscode-editor-font-family, "Droid Sans Mono", "monospace", monospace)';
|
|
79
|
+
/** The editor's UI font size (13px by default). */
|
|
80
|
+
export const vscodeFontSize = 'var(--vscode-font-size, 13px)';
|
|
81
|
+
/**
|
|
82
|
+
* The VS Code colours as literal values — Dark Modern's — under the keys the
|
|
83
|
+
* other colour systems share, for the swatch, the avatars and the
|
|
84
|
+
* illustrations, which need a colour rather than a reference.
|
|
85
|
+
*/
|
|
86
|
+
export const vscodeColors = {
|
|
87
|
+
// Core Neutrals — Dark Modern
|
|
88
|
+
black: vscodeVars.editorBackground.dark, // #1F1F1F — editor background
|
|
89
|
+
gray: vscodeVars.descriptionForeground.dark, // #9D9D9D — secondary text
|
|
90
|
+
white: vscodeVars.editorBackground.light, // #FFFFFF — Light Modern background
|
|
91
|
+
// VS Code palette (Brand) — the product's blue
|
|
92
|
+
vscodeBase: '#0078D4', // Base color — the button, the focus ring
|
|
93
|
+
vscodeBrand: '#0078D4', // Brand / swatch
|
|
94
|
+
vscodeAccent: '#4DAAFC', // Links on dark surfaces
|
|
95
|
+
vscodeText: '#005FB8', // Accessible text and buttons on white
|
|
96
|
+
vscodeTint: '#E8F1FB', // Pale blue — callouts on light surfaces
|
|
97
|
+
vscodeBright: '#4DAAFC', // Highlights on dark backgrounds
|
|
98
|
+
vscodeHover: '#026EC1', // Primary button hover
|
|
99
|
+
// Semantic roles — the editor's
|
|
100
|
+
attentionBrand: vscodeVars.editorWarningForeground.light,
|
|
101
|
+
attentionAccent: vscodeVars.editorWarningForeground.dark,
|
|
102
|
+
attentionTint: '#FFF4CE',
|
|
103
|
+
dangerBrand: vscodeVars.errorForeground.light,
|
|
104
|
+
dangerAccent: vscodeVars.errorForeground.dark,
|
|
105
|
+
dangerTint: '#FDE7E6',
|
|
106
|
+
severeBrand: '#BC4C00',
|
|
107
|
+
severeAccent: '#DB6D28',
|
|
108
|
+
severeTint: '#FFE9D9',
|
|
109
|
+
doneBrand: vscodeVars.terminalAnsiMagenta.light,
|
|
110
|
+
doneAccent: vscodeVars.terminalAnsiMagenta.dark,
|
|
111
|
+
doneTint: '#F5E1F5',
|
|
112
|
+
// Bright / vivid colours for SVG illustrations — the terminal's ANSI colours
|
|
113
|
+
brightGlow: '#4DAAFC', // Link blue — primary glow
|
|
114
|
+
brightPop: '#0DBC79', // ANSI green — contrasting accent
|
|
115
|
+
brightSpark: '#11A8CD', // ANSI cyan — sparkle
|
|
116
|
+
brightBlaze: '#F14C4C', // ANSI bright red — warm accent
|
|
117
|
+
brightSurge: '#2472C8', // ANSI blue — cool accent
|
|
118
|
+
brightFlame: '#E5E510', // ANSI yellow — warm energy
|
|
119
|
+
brightGold: '#FFCC00', // Gold — highlight
|
|
120
|
+
// Vivid brights for light backgrounds — deeper for contrast on white
|
|
121
|
+
brightLightGlow: '#005FB8', // Deep blue
|
|
122
|
+
brightLightPop: '#107C10', // Deep green
|
|
123
|
+
brightLightSpark: '#0598BC', // Deep cyan
|
|
124
|
+
brightLightBlaze: '#CD3131', // Deep red
|
|
125
|
+
brightLightSurge: '#0451A5', // Deep blue
|
|
126
|
+
brightLightFlame: '#949800', // Deep yellow
|
|
127
|
+
brightLightGold: '#9A7B00', // Deep gold
|
|
128
|
+
};
|
|
129
|
+
export default vscodeColors;
|
|
@@ -22,6 +22,63 @@ const radii = {
|
|
|
22
22
|
'--borderRadius-full': '9999px',
|
|
23
23
|
};
|
|
24
24
|
/** The open and closed states are success and danger, as in Primer. */
|
|
25
|
+
/*
|
|
26
|
+
* The sizes Primer's controls read from `@primer/primitives`' size and
|
|
27
|
+
* border sheets (`--base-size-*`, `--borderWidth-*`, the control sizes),
|
|
28
|
+
* for a page that loads no primitives sheet — a VS Code webview, a page of
|
|
29
|
+
* Primer components alone: without them a text input has no border and a
|
|
30
|
+
* button no height, their shorthands being invalid. The values are the
|
|
31
|
+
* primitives' own.
|
|
32
|
+
*/
|
|
33
|
+
const sizes = {
|
|
34
|
+
'--base-size-2': '0.125rem',
|
|
35
|
+
'--base-size-4': '0.25rem',
|
|
36
|
+
'--base-size-6': '0.375rem',
|
|
37
|
+
'--base-size-8': '0.5rem',
|
|
38
|
+
'--base-size-12': '0.75rem',
|
|
39
|
+
'--base-size-16': '1rem',
|
|
40
|
+
'--base-size-20': '1.25rem',
|
|
41
|
+
'--base-size-24': '1.5rem',
|
|
42
|
+
'--base-size-28': '1.75rem',
|
|
43
|
+
'--base-size-32': '2rem',
|
|
44
|
+
'--base-size-36': '2.25rem',
|
|
45
|
+
'--base-size-40': '2.5rem',
|
|
46
|
+
'--base-size-44': '2.75rem',
|
|
47
|
+
'--base-size-48': '3rem',
|
|
48
|
+
'--base-size-64': '4rem',
|
|
49
|
+
'--base-size-80': '5rem',
|
|
50
|
+
'--base-size-96': '6rem',
|
|
51
|
+
'--base-size-112': '7rem',
|
|
52
|
+
'--base-size-128': '8rem',
|
|
53
|
+
'--borderWidth-thin': '0.0625rem',
|
|
54
|
+
'--borderWidth-default': 'var(--borderWidth-thin)',
|
|
55
|
+
'--borderWidth-thick': '0.125rem',
|
|
56
|
+
'--borderWidth-thicker': '0.25rem',
|
|
57
|
+
'--boxShadow-thin': 'inset 0 0 0 var(--borderWidth-thin)',
|
|
58
|
+
'--stack-gap-condensed': '0.5rem',
|
|
59
|
+
'--control-xsmall-size': '1.5rem',
|
|
60
|
+
'--control-xsmall-paddingBlock': '0.125rem',
|
|
61
|
+
'--control-xsmall-paddingInline-condensed': '0.25rem',
|
|
62
|
+
'--control-xsmall-paddingInline-normal': '0.5rem',
|
|
63
|
+
'--control-xsmall-paddingInline-spacious': '0.75rem',
|
|
64
|
+
'--control-small-size': '1.75rem',
|
|
65
|
+
'--control-small-paddingBlock': '0.25rem',
|
|
66
|
+
'--control-small-paddingInline-condensed': '0.5rem',
|
|
67
|
+
'--control-small-paddingInline-normal': '0.75rem',
|
|
68
|
+
'--control-medium-size': '2rem',
|
|
69
|
+
'--control-medium-paddingBlock': '0.375rem',
|
|
70
|
+
'--control-medium-paddingInline-condensed': '0.5rem',
|
|
71
|
+
'--control-medium-paddingInline-normal': '0.75rem',
|
|
72
|
+
'--control-medium-paddingInline-spacious': '1rem',
|
|
73
|
+
'--control-large-size': '2.5rem',
|
|
74
|
+
'--control-large-paddingBlock': '0.625rem',
|
|
75
|
+
'--control-large-paddingInline-normal': '0.75rem',
|
|
76
|
+
'--control-large-paddingInline-spacious': '1rem',
|
|
77
|
+
'--control-xlarge-size': '3rem',
|
|
78
|
+
'--control-xlarge-paddingBlock': '0.875rem',
|
|
79
|
+
'--control-xlarge-paddingInline-normal': '0.75rem',
|
|
80
|
+
'--control-xlarge-paddingInline-spacious': '1rem',
|
|
81
|
+
};
|
|
25
82
|
const states = {
|
|
26
83
|
'--fgColor-open': 'var(--fgColor-success)',
|
|
27
84
|
'--bgColor-open-emphasis': 'var(--bgColor-success-emphasis)',
|
|
@@ -34,6 +91,7 @@ const states = {
|
|
|
34
91
|
};
|
|
35
92
|
export const primerBaseVars = {
|
|
36
93
|
light: {
|
|
94
|
+
...sizes,
|
|
37
95
|
...radii,
|
|
38
96
|
...states,
|
|
39
97
|
'--bgColor-emphasis': '#25292e',
|
|
@@ -52,6 +110,7 @@ export const primerBaseVars = {
|
|
|
52
110
|
'--shadow-floating-xlarge': '0px 0px 0px 1px #d1d9e0, 0px 56px 112px 0px #25292e52',
|
|
53
111
|
},
|
|
54
112
|
dark: {
|
|
113
|
+
...sizes,
|
|
55
114
|
...radii,
|
|
56
115
|
...states,
|
|
57
116
|
'--bgColor-emphasis': '#3d444d',
|
package/lib/theme/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './themes/sandTheme';
|
|
|
14
14
|
export * from './themes/ivoryTheme';
|
|
15
15
|
export * from './themes/sunTheme';
|
|
16
16
|
export * from './themes/loopTheme';
|
|
17
|
+
export * from './themes/vscodeTheme';
|
|
17
18
|
export * from './themes-brand/spatialBrandTheme';
|
|
18
19
|
export * from './themeRegistry';
|
|
19
20
|
export * from './portableTheme';
|
package/lib/theme/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export * from './themes/sandTheme';
|
|
|
18
18
|
export * from './themes/ivoryTheme';
|
|
19
19
|
export * from './themes/sunTheme';
|
|
20
20
|
export * from './themes/loopTheme';
|
|
21
|
+
export * from './themes/vscodeTheme';
|
|
21
22
|
export * from './themes-brand/spatialBrandTheme';
|
|
22
23
|
export * from './themeRegistry';
|
|
23
24
|
export * from './portableTheme';
|
|
@@ -7,7 +7,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
* Shared palette types, theme-aware colour resolution, and reusable
|
|
8
8
|
* gradient / grid definitions.
|
|
9
9
|
*/
|
|
10
|
-
import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, loopColors, } from '../colors';
|
|
10
|
+
import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, loopColors, vscodeColors, } from '../colors';
|
|
11
11
|
import { getBrightPalette, } from '../themeRegistry';
|
|
12
12
|
import { useThemeStore } from '../useThemeStore';
|
|
13
13
|
const dlBrightDark = getBrightPalette('datalayer');
|
|
@@ -28,6 +28,8 @@ const suBrightDark = getBrightPalette('sun');
|
|
|
28
28
|
const suBrightLight = getBrightPalette('sun', 'light');
|
|
29
29
|
const loBrightDark = getBrightPalette('loop');
|
|
30
30
|
const loBrightLight = getBrightPalette('loop', 'light');
|
|
31
|
+
const vsBrightDark = getBrightPalette('vscode');
|
|
32
|
+
const vsBrightLight = getBrightPalette('vscode', 'light');
|
|
31
33
|
const palettes = {
|
|
32
34
|
datalayer: {
|
|
33
35
|
light: {
|
|
@@ -371,6 +373,44 @@ const palettes = {
|
|
|
371
373
|
isLight: false,
|
|
372
374
|
},
|
|
373
375
|
},
|
|
376
|
+
vscode: {
|
|
377
|
+
light: {
|
|
378
|
+
bg: vscodeColors.white,
|
|
379
|
+
bgPanel: '#F8F8F8',
|
|
380
|
+
bgAlt: '#F2F2F2',
|
|
381
|
+
primary: vscodeColors.vscodeText,
|
|
382
|
+
secondary: vscodeColors.vscodeBrand,
|
|
383
|
+
accent: vscodeColors.vscodeText,
|
|
384
|
+
glow: vsBrightLight.glow,
|
|
385
|
+
pop: vsBrightLight.pop,
|
|
386
|
+
spark: vsBrightLight.spark,
|
|
387
|
+
blaze: vsBrightLight.blaze,
|
|
388
|
+
surge: vsBrightLight.surge,
|
|
389
|
+
flame: vsBrightLight.flame,
|
|
390
|
+
gold: vsBrightLight.gold,
|
|
391
|
+
textLight: '#3B3B3B',
|
|
392
|
+
textMuted: '#767676',
|
|
393
|
+
isLight: true,
|
|
394
|
+
},
|
|
395
|
+
dark: {
|
|
396
|
+
bg: vscodeColors.black,
|
|
397
|
+
bgPanel: '#202020',
|
|
398
|
+
bgAlt: '#181818',
|
|
399
|
+
primary: vscodeColors.vscodeAccent,
|
|
400
|
+
secondary: vscodeColors.vscodeBrand,
|
|
401
|
+
accent: vscodeColors.vscodeAccent,
|
|
402
|
+
glow: vsBrightDark.glow,
|
|
403
|
+
pop: vsBrightDark.pop,
|
|
404
|
+
spark: vsBrightDark.spark,
|
|
405
|
+
blaze: vsBrightDark.blaze,
|
|
406
|
+
surge: vsBrightDark.surge,
|
|
407
|
+
flame: vsBrightDark.flame,
|
|
408
|
+
gold: vsBrightDark.gold,
|
|
409
|
+
textLight: '#CCCCCC',
|
|
410
|
+
textMuted: vscodeColors.gray,
|
|
411
|
+
isLight: false,
|
|
412
|
+
},
|
|
413
|
+
},
|
|
374
414
|
};
|
|
375
415
|
export function getColorPalette(theme = 'datalayer', colorMode = 'auto') {
|
|
376
416
|
const mode = colorMode === 'auto'
|
|
@@ -17,6 +17,7 @@ import { sandTheme } from './themes/sandTheme';
|
|
|
17
17
|
import { ivoryTheme } from './themes/ivoryTheme';
|
|
18
18
|
import { sunTheme } from './themes/sunTheme';
|
|
19
19
|
import { loopTheme } from './themes/loopTheme';
|
|
20
|
+
import { vscodeTheme } from './themes/vscodeTheme';
|
|
20
21
|
import { avatarColorsOf, brightPaletteOf, themeTokens, } from './themeTokens';
|
|
21
22
|
export { avatarColorsOf, brightPaletteOf, getCardGradient, getThemeTokens, themeTokens, themeVariants, } from './themeTokens';
|
|
22
23
|
const primerThemes = {
|
|
@@ -29,6 +30,7 @@ const primerThemes = {
|
|
|
29
30
|
ivory: ivoryTheme,
|
|
30
31
|
sun: sunTheme,
|
|
31
32
|
loop: loopTheme,
|
|
33
|
+
vscode: vscodeTheme,
|
|
32
34
|
};
|
|
33
35
|
export const themeConfigs = Object.fromEntries(Object.keys(themeTokens).map(variant => [
|
|
34
36
|
variant,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { type ColorMode } from './DatalayerBrandThemeProvider';
|
|
8
8
|
import { type ThemeStyles } from './css/createThemeCSSVars';
|
|
9
9
|
/** Available theme variants. */
|
|
10
|
-
export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth' | 'sand' | 'ivory' | 'sun' | 'loop';
|
|
10
|
+
export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth' | 'sand' | 'ivory' | 'sun' | 'loop' | 'vscode';
|
|
11
11
|
/** A pair of colours for a two-stop gradient. */
|
|
12
12
|
export interface GradientPair {
|
|
13
13
|
/** Start colour (brighter / brand). */
|
package/lib/theme/themeTokens.js
CHANGED
|
@@ -11,6 +11,7 @@ import { sandThemeStyles } from './themes/sandThemeStyles';
|
|
|
11
11
|
import { ivoryThemeStyles } from './themes/ivoryThemeStyles';
|
|
12
12
|
import { sunThemeStyles } from './themes/sunThemeStyles';
|
|
13
13
|
import { loopThemeStyles } from './themes/loopThemeStyles';
|
|
14
|
+
import { vscodeThemeStyles } from './themes/vscodeThemeStyles';
|
|
14
15
|
import { datalayerColors } from './colors/datalayerColors';
|
|
15
16
|
import { spatialColors } from './colors/spatialColors';
|
|
16
17
|
import { lovelyColors } from './colors/lovelyColors';
|
|
@@ -20,6 +21,7 @@ import { sandColors } from './colors/sandColors';
|
|
|
20
21
|
import { ivoryColors } from './colors/ivoryColors';
|
|
21
22
|
import { sunColors } from './colors/sunColors';
|
|
22
23
|
import { loopColors } from './colors/loopColors';
|
|
24
|
+
import { vscodeColors } from './colors/vscodeColors';
|
|
23
25
|
/* ─── Registry ────────────────────────────────────────────────────────── */
|
|
24
26
|
export const themeTokens = {
|
|
25
27
|
datalayer: {
|
|
@@ -302,9 +304,51 @@ export const themeTokens = {
|
|
|
302
304
|
gold: loopColors.brightLightGold, // #8A6A00 — deep sun
|
|
303
305
|
},
|
|
304
306
|
},
|
|
307
|
+
vscode: {
|
|
308
|
+
label: 'VS Code',
|
|
309
|
+
description: 'The editor’s own colours: in a Visual Studio Code webview it follows the colour theme in use, and changes with it; elsewhere, Dark Modern and Light Modern.',
|
|
310
|
+
brandColor: vscodeColors.vscodeBrand,
|
|
311
|
+
defaultColorMode: 'auto',
|
|
312
|
+
themeStyles: vscodeThemeStyles,
|
|
313
|
+
cardGradient: {
|
|
314
|
+
light: { from: vscodeColors.vscodeText, to: vscodeColors.brightLightSurge }, // #005FB8 → #0451A5
|
|
315
|
+
dark: { from: vscodeColors.vscodeAccent, to: vscodeColors.vscodeBrand }, // #4DAAFC → #0078D4
|
|
316
|
+
},
|
|
317
|
+
brightPalette: {
|
|
318
|
+
glow: vscodeColors.brightGlow, // #4DAAFC — link blue
|
|
319
|
+
onGlow: '#1F1F1F', // dark text on the light blue
|
|
320
|
+
pop: vscodeColors.brightPop, // #0DBC79 — ANSI green
|
|
321
|
+
spark: vscodeColors.brightSpark, // #11A8CD — ANSI cyan
|
|
322
|
+
blaze: vscodeColors.brightBlaze, // #F14C4C — ANSI bright red
|
|
323
|
+
surge: vscodeColors.brightSurge, // #2472C8 — ANSI blue
|
|
324
|
+
flame: vscodeColors.brightFlame, // #E5E510 — ANSI yellow
|
|
325
|
+
gold: vscodeColors.brightGold, // #FFCC00 — gold
|
|
326
|
+
},
|
|
327
|
+
brightPaletteLight: {
|
|
328
|
+
glow: vscodeColors.brightLightGlow, // #005FB8 — deep blue
|
|
329
|
+
onGlow: '#ffffff', // white text on deep blue
|
|
330
|
+
pop: vscodeColors.brightLightPop, // #107C10 — deep green
|
|
331
|
+
spark: vscodeColors.brightLightSpark, // #0598BC — deep cyan
|
|
332
|
+
blaze: vscodeColors.brightLightBlaze, // #CD3131 — deep red
|
|
333
|
+
surge: vscodeColors.brightLightSurge, // #0451A5 — deep blue
|
|
334
|
+
flame: vscodeColors.brightLightFlame, // #949800 — deep yellow
|
|
335
|
+
gold: vscodeColors.brightLightGold, // #9A7B00 — deep gold
|
|
336
|
+
},
|
|
337
|
+
},
|
|
305
338
|
};
|
|
306
339
|
/** All available theme variants in display order. */
|
|
307
|
-
export const themeVariants = [
|
|
340
|
+
export const themeVariants = [
|
|
341
|
+
'datalayer',
|
|
342
|
+
'spatial',
|
|
343
|
+
'lovely',
|
|
344
|
+
'matrix',
|
|
345
|
+
'earth',
|
|
346
|
+
'sand',
|
|
347
|
+
'ivory',
|
|
348
|
+
'sun',
|
|
349
|
+
'loop',
|
|
350
|
+
'vscode',
|
|
351
|
+
];
|
|
308
352
|
/** Look up a theme's tokens by variant name. */
|
|
309
353
|
export function getThemeTokens(variant) {
|
|
310
354
|
return themeTokens[variant];
|
|
@@ -483,6 +527,22 @@ const avatarColorPalettes = {
|
|
|
483
527
|
loopColors.brightGold, // #F8D469 — sun
|
|
484
528
|
],
|
|
485
529
|
},
|
|
530
|
+
vscode: {
|
|
531
|
+
light: [
|
|
532
|
+
vscodeColors.brightLightGlow, // #005FB8 — deep blue
|
|
533
|
+
vscodeColors.brightLightPop, // #107C10 — deep green
|
|
534
|
+
vscodeColors.brightLightSpark, // #0598BC — deep cyan
|
|
535
|
+
vscodeColors.brightLightBlaze, // #CD3131 — deep red
|
|
536
|
+
vscodeColors.gray, // #9D9D9D — neutral
|
|
537
|
+
],
|
|
538
|
+
dark: [
|
|
539
|
+
vscodeColors.brightGlow, // #4DAAFC — link blue
|
|
540
|
+
vscodeColors.brightPop, // #0DBC79 — ANSI green
|
|
541
|
+
vscodeColors.brightSpark, // #11A8CD — ANSI cyan
|
|
542
|
+
vscodeColors.brightBlaze, // #F14C4C — ANSI bright red
|
|
543
|
+
vscodeColors.brightFlame, // #E5E510 — ANSI yellow
|
|
544
|
+
],
|
|
545
|
+
},
|
|
486
546
|
};
|
|
487
547
|
/**
|
|
488
548
|
* The 5-colour avatar palette of a theme for a resolved colour mode, for the
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The VS Code theme's face for the editors a page may hold: JupyterLab's
|
|
3
|
+
* variables, a notebook's cells and CodeMirror, and Excalidraw's, each read
|
|
4
|
+
* from the editor's own `--vscode-*` colours. Part of the theme's stylesheet
|
|
5
|
+
* (`ThemeStyles.css`), scoped to the theme's element: a page without a
|
|
6
|
+
* notebook pays nothing but a few unused rules.
|
|
7
|
+
*
|
|
8
|
+
* The `!important`s stand against JupyterLab's and CodeMirror's own
|
|
9
|
+
* stylesheets, which set these on their elements.
|
|
10
|
+
*/
|
|
11
|
+
/** The JupyterLab, CodeMirror and Excalidraw rules of the VS Code theme. */
|
|
12
|
+
export declare const vscodeEditorsCss = "\n:scope {\n /* JupyterLab's variables, each the editor's colour */\n --jp-layout-color0: var(--vscode-editor-background);\n --jp-layout-color1: var(--vscode-sideBar-background);\n --jp-layout-color2: var(--vscode-editorWidget-background);\n --jp-layout-color3: var(--vscode-input-background);\n --jp-layout-color4: var(--vscode-dropdown-background);\n\n --jp-ui-font-color0: var(--vscode-editor-foreground);\n --jp-ui-font-color1: var(--vscode-foreground);\n --jp-ui-font-color2: var(--vscode-descriptionForeground);\n --jp-ui-font-color3: var(--vscode-disabledForeground);\n\n --jp-border-color0: var(--vscode-panel-border);\n --jp-border-color1: var(--vscode-editorWidget-border);\n --jp-border-color2: var(--vscode-input-border);\n\n --jp-brand-color1: var(--vscode-button-background);\n --jp-accent-color1: var(--vscode-focusBorder);\n\n --jp-error-color1: var(--vscode-errorForeground);\n --jp-warn-color1: var(--vscode-editorWarning-foreground);\n --jp-success-color1: var(--vscode-terminal-ansiGreen);\n --jp-info-color1: var(--vscode-editorInfo-foreground);\n\n /* The editor */\n --jp-editor-background: var(--vscode-editor-background);\n --jp-editor-foreground: var(--vscode-editor-foreground);\n --jp-editor-border-color: var(--vscode-editorWidget-border);\n --jp-editor-selected-background: var(--vscode-editor-selectionBackground);\n\n /* A cell */\n --jp-cell-editor-background: var(--vscode-notebook-cellEditorBackground, var(--vscode-editor-background));\n --jp-cell-editor-border-color: var(--vscode-notebook-cellBorderColor, var(--vscode-editorWidget-border));\n\n /* Input and output */\n --jp-input-background: var(--vscode-input-background);\n --jp-input-foreground: var(--vscode-input-foreground);\n --jp-input-border: var(--vscode-input-border);\n\n /* Lists */\n --jp-list-hover-background: var(--vscode-list-hoverBackground);\n --jp-list-selected-background: var(--vscode-list-activeSelectionBackground);\n}\n\n/* No black gap: the notebook and its frame wear the editor's background */\n:scope #notebook-editor,\n:scope .dla-Jupyter-Notebook,\n:scope .jp-Notebook {\n background-color: var(--vscode-editor-background) !important;\n}\n\n/* CodeMirror's editor */\n:scope .cm-editor,\n:scope .cm-content {\n background-color: var(--vscode-notebook-cellEditorBackground, var(--vscode-editor-background)) !important;\n}\n\n/* A notebook's cells */\n:scope .jp-Cell {\n background-color: var(--vscode-editor-background) !important;\n}\n\n:scope .jp-InputArea-editor {\n background-color: var(--vscode-notebook-cellEditorBackground, var(--vscode-editor-background)) !important;\n}\n\n/* The toolbar */\n:scope .jp-Toolbar {\n background-color: var(--vscode-editorWidget-background) !important;\n border-bottom: 1px solid var(--vscode-panel-border) !important;\n}\n\n/* The sidebar */\n:scope .jp-SideBar {\n background-color: var(--vscode-sideBar-background) !important;\n border-color: var(--vscode-panel-border) !important;\n}\n\n/* Every widget inside a cell, the cell sidebar's included */\n:scope .jp-Cell .lm-Widget {\n background-color: var(--vscode-editor-background) !important;\n}\n\n:scope .dla-CellSidebar-Container {\n background-color: var(--vscode-editor-background) !important;\n color: var(--vscode-editor-foreground) !important;\n}\n\n:scope .dla-CellSidebar-Container * {\n background-color: inherit !important;\n}\n\n:scope .dla-CellSidebar-Container button {\n background-color: transparent !important;\n color: var(--vscode-editor-foreground) !important;\n border: none !important;\n}\n\n:scope .dla-CellSidebar-Container button:hover {\n background-color: var(--vscode-list-hoverBackground) !important;\n}\n\n/* CodeMirror's selection: its layer, and ::selection on every token */\n:scope .cm-selectionBackground,\n:scope .cm-editor .cm-selectionBackground,\n:scope .cm-editor > .cm-scroller > .cm-selectionLayer .cm-selectionBackground,\n:scope .cm-editor.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground {\n background: var(--vscode-editor-selectionBackground) !important;\n}\n\n:scope .cm-editor .cm-line ::selection,\n:scope .cm-editor .cm-line > *::selection,\n:scope .cm-editor .cm-line span::selection,\n:scope .cm-editor .cm-content ::selection,\n:scope .cm-editor .cm-activeLine ::selection,\n:scope .cm-editor *::selection {\n background: var(--vscode-editor-selectionBackground) !important;\n background-color: var(--vscode-editor-selectionBackground) !important;\n}\n\n/* Excalidraw, dark */\n:scope .ExcalidrawModal__row .excalidraw.theme--dark {\n --color-primary: var(--vscode-button-background, #0e639c);\n --color-primary-darker: var(--vscode-button-hoverBackground, #1177bb);\n --color-primary-darkest: var(--vscode-button-hoverBackground, #0a5285);\n --color-primary-hover: var(--vscode-button-hoverBackground, #1177bb);\n --color-primary-light: var(--vscode-list-activeSelectionBackground, #094771);\n --color-surface-primary: var(--vscode-editor-background, #1e1e1e);\n --default-bg-color: var(--vscode-editor-background, #1e1e1e);\n --color-on-surface: var(--vscode-editor-foreground, #d4d4d4);\n --text-primary-color: var(--vscode-editor-foreground, #d4d4d4);\n --popup-text-color: var(--vscode-editor-foreground, #d4d4d4);\n --color-surface-primary-container: var(--vscode-list-activeSelectionBackground, #094771);\n --color-on-primary-container: var(--vscode-list-activeSelectionForeground, #ffffff);\n --color-brand-hover: var(--vscode-button-hoverBackground, #1177bb);\n --color-brand-active: var(--vscode-focusBorder, #007fd4);\n --color-icon-white: #ffffff;\n --island-bg-color: var(--vscode-editorWidget-background, #252526);\n --sidebar-bg-color: var(--vscode-sideBar-background, #252526);\n --popup-bg-color: var(--vscode-editorWidget-background, #252526);\n --popup-secondary-bg-color: var(--vscode-dropdown-background, #3c3c3c);\n --color-surface-high: var(--vscode-editorWidget-background, #2e2d39);\n --color-surface-mid: var(--vscode-sideBar-background, #252526);\n --color-surface-low: var(--vscode-editor-background, #1e1e1e);\n --color-surface-lowest: var(--vscode-editor-background, #1e1e1e);\n --button-gray-1: var(--vscode-button-secondaryBackground, #3a3d41);\n --button-gray-2: var(--vscode-button-secondaryHoverBackground, #45494e);\n --button-gray-3: var(--vscode-button-secondaryHoverBackground, #45494e);\n --button-hover-bg: var(--vscode-list-hoverBackground, #2a2d2e);\n --button-active-bg: var(--vscode-list-activeSelectionBackground, #094771);\n --button-color: var(--vscode-button-foreground, #ffffff);\n --button-hover-color: var(--vscode-button-foreground, #ffffff);\n --button-bg: var(--vscode-button-background, #0e639c);\n --input-bg-color: var(--vscode-input-background, #3c3c3c);\n --input-border-color: var(--vscode-input-border, #3c3c3c);\n --input-hover-bg-color: var(--vscode-list-hoverBackground, #2a2d2e);\n --default-border-color: var(--vscode-panel-border, #3c3c3c);\n --color-border-outline: var(--vscode-editorWidget-border, #454545);\n --color-border-outline-variant: var(--vscode-panel-border, #3c3c3c);\n --sidebar-border-color: var(--vscode-panel-border, #3c3c3c);\n --dialog-border-color: var(--vscode-editorWidget-border, #454545);\n --focus-highlight-color: var(--vscode-focusBorder, #007fd4);\n --select-highlight-color: var(--vscode-editor-selectionBackground, #264f78);\n --color-selection: var(--vscode-editor-selectionBackground, #264f78);\n --button-active-border: var(--vscode-focusBorder, #007fd4);\n --link-color: var(--vscode-textLink-foreground, #3794ff);\n --scrollbar-thumb: var(--vscode-scrollbarSlider-background, rgba(121, 121, 121, 0.4));\n --scrollbar-thumb-hover: var(--vscode-scrollbarSlider-hoverBackground, rgba(100, 100, 100, 0.7));\n --icon-fill-color: var(--vscode-icon-foreground, #c5c5c5);\n}\n\n/* Excalidraw, light */\n:scope .ExcalidrawModal__row .excalidraw.theme--light {\n --color-primary: var(--vscode-button-background, #007acc);\n --color-primary-darker: var(--vscode-button-hoverBackground, #005a9e);\n --color-primary-darkest: var(--vscode-button-hoverBackground, #004578);\n --color-primary-hover: var(--vscode-button-hoverBackground, #005a9e);\n --color-primary-light: var(--vscode-list-activeSelectionBackground, #0060c0);\n --color-surface-primary: var(--vscode-editor-background, #ffffff);\n --default-bg-color: var(--vscode-editor-background, #ffffff);\n --color-on-surface: var(--vscode-editor-foreground, #000000);\n --text-primary-color: var(--vscode-editor-foreground, #000000);\n --popup-text-color: var(--vscode-editor-foreground, #000000);\n --color-surface-primary-container: var(--vscode-list-activeSelectionBackground, #0060c0);\n --color-on-primary-container: var(--vscode-list-activeSelectionForeground, #ffffff);\n --color-brand-hover: var(--vscode-button-hoverBackground, #005a9e);\n --color-brand-active: var(--vscode-focusBorder, #0090f1);\n --color-icon-white: #ffffff;\n --island-bg-color: var(--vscode-editorWidget-background, #f3f3f3);\n --sidebar-bg-color: var(--vscode-sideBar-background, #f3f3f3);\n --popup-bg-color: var(--vscode-editorWidget-background, #f3f3f3);\n --popup-secondary-bg-color: var(--vscode-dropdown-background, #ffffff);\n --color-surface-high: var(--vscode-editorWidget-background, #f1f0ff);\n --color-surface-mid: var(--vscode-sideBar-background, #f3f3f3);\n --color-surface-low: var(--vscode-editor-background, #ffffff);\n --color-surface-lowest: var(--vscode-editor-background, #ffffff);\n --button-gray-1: var(--vscode-button-secondaryBackground, #e1e1e1);\n --button-gray-2: var(--vscode-button-secondaryHoverBackground, #d0d0d0);\n --button-gray-3: var(--vscode-button-secondaryHoverBackground, #d0d0d0);\n --button-hover-bg: var(--vscode-list-hoverBackground, #f0f0f0);\n --button-active-bg: var(--vscode-list-activeSelectionBackground, #0060c0);\n --button-color: var(--vscode-button-foreground, #ffffff);\n --button-hover-color: var(--vscode-button-foreground, #ffffff);\n --button-bg: var(--vscode-button-background, #007acc);\n --input-bg-color: var(--vscode-input-background, #ffffff);\n --input-border-color: var(--vscode-input-border, #cecece);\n --input-hover-bg-color: var(--vscode-list-hoverBackground, #f0f0f0);\n --default-border-color: var(--vscode-panel-border, #e0e0e0);\n --color-border-outline: var(--vscode-editorWidget-border, #c8c8c8);\n --color-border-outline-variant: var(--vscode-panel-border, #e0e0e0);\n --sidebar-border-color: var(--vscode-panel-border, #e0e0e0);\n --dialog-border-color: var(--vscode-editorWidget-border, #c8c8c8);\n --focus-highlight-color: var(--vscode-focusBorder, #0090f1);\n --select-highlight-color: var(--vscode-editor-selectionBackground, #add6ff);\n --color-selection: var(--vscode-editor-selectionBackground, #add6ff);\n --button-active-border: var(--vscode-focusBorder, #0090f1);\n --link-color: var(--vscode-textLink-foreground, #006ab1);\n --scrollbar-thumb: var(--vscode-scrollbarSlider-background, rgba(100, 100, 100, 0.4));\n --scrollbar-thumb-hover: var(--vscode-scrollbarSlider-hoverBackground, rgba(100, 100, 100, 0.7));\n --icon-fill-color: var(--vscode-icon-foreground, #424242);\n}\n";
|