@datalayer/primer-addons 1.0.40 → 1.0.41

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 CHANGED
@@ -14,16 +14,27 @@ This project has been [shared in a discussion](https://github.com/primer/react/d
14
14
 
15
15
  ## Current Addons
16
16
 
17
- - [ ] Backdrop
18
- - [ ] Brand Header
19
- - [ ] Brand Header Lines
20
- - [ ] Brand Footer
21
- - [x] Content Loader
17
+ - [x] Appearance controls, menus, theme previews and collaborator palettes
18
+ - [x] Box
19
+ - [x] Calendar Picker
22
20
  - [x] Card
23
- - [x] Closable Flash
24
- - [ ] Masonry Box
21
+ - [x] Closeable Flash
22
+ - [x] Color Swatch and Color Picker
23
+ - [x] Content Loader
24
+ - [x] Date Picker
25
+ - [x] Entity Avatar
26
+ - [x] Hover Card
27
+ - [x] Datalayer logos and text marks
28
+ - [x] Sheet
29
+ - [x] Side Overlay
25
30
  - [x] Slider
26
- - [x] Toolbar
31
+ - [x] Sliding Panel
32
+ - [x] Toolbar and Floating Toolbar
33
+
34
+ The components use the active theme's semantic tokens rather than fixed
35
+ visual values. For example, toolbar icon buttons and dropdown triggers read
36
+ `--theme-radius-control`: they retain the regular Primer corner in the default
37
+ themes and become fully rounded controls in `loop`.
27
38
 
28
39
  ## Reactor Plugins
29
40
 
@@ -1,5 +1,10 @@
1
1
  /** `7` → `07`. Two digits, always, because a column of ragged numbers reads badly. */
2
2
  export declare const pad: (value: number) => string;
3
+ /** Read a freely typed 24-hour time without letting `Date` roll it over. */
4
+ export declare function parseTime(text: string): {
5
+ hour: number;
6
+ minute: number;
7
+ } | null;
3
8
  export interface TimeColumnsProps {
4
9
  /** The hour shown as chosen, 0–23. */
5
10
  hour: number;
@@ -19,10 +19,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  *
20
20
  * @module components/date-picker/TimeColumns
21
21
  */
22
- import { useEffect, useRef } from "react";
23
- import { ActionList, Box, Text } from "@primer/react";
22
+ import { useEffect, useRef, useState } from "react";
23
+ import { ActionList, Box, Text, TextInput } from "@primer/react";
24
24
  /** `7` → `07`. Two digits, always, because a column of ragged numbers reads badly. */
25
25
  export const pad = (value) => `${value}`.padStart(2, "0");
26
+ /** Read a freely typed 24-hour time without letting `Date` roll it over. */
27
+ export function parseTime(text) {
28
+ const match = /^(\d{1,2}):(\d{2})$/.exec(text.trim());
29
+ if (!match) {
30
+ return null;
31
+ }
32
+ const hour = Number(match[1]);
33
+ const minute = Number(match[2]);
34
+ return hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59
35
+ ? { hour, minute }
36
+ : null;
37
+ }
26
38
  const HOURS = Array.from({ length: 24 }, (_, index) => index);
27
39
  function Column({ label, ariaLabel, values, selected, onPick, disabled, }) {
28
40
  const scroller = useRef(null);
@@ -65,6 +77,28 @@ function Column({ label, ariaLabel, values, selected, onPick, disabled, }) {
65
77
  * them.
66
78
  */
67
79
  export function TimeColumns({ hour, minute, step = 5, onChange, disabled, labelPrefix, }) {
80
+ const selectedText = `${pad(hour)}:${pad(minute)}`;
81
+ const [text, setText] = useState(selectedText);
82
+ const typing = useRef(false);
83
+ useEffect(() => {
84
+ if (!typing.current) {
85
+ setText(selectedText);
86
+ }
87
+ }, [selectedText]);
88
+ const pick = (nextHour, nextMinute) => {
89
+ typing.current = false;
90
+ setText(`${pad(nextHour)}:${pad(nextMinute)}`);
91
+ onChange(nextHour, nextMinute);
92
+ };
93
+ const commitText = (nextText) => {
94
+ typing.current = false;
95
+ const parsed = parseTime(nextText);
96
+ if (!parsed) {
97
+ setText(selectedText);
98
+ return;
99
+ }
100
+ pick(parsed.hour, parsed.minute);
101
+ };
68
102
  const every = Math.min(60, Math.max(1, Math.floor(step) || 1));
69
103
  const minutes = Array.from({ length: Math.ceil(60 / every) }, (_, index) => index * every);
70
104
  // A minute the step does not land on — 17:07 read back from a stored value —
@@ -83,6 +117,13 @@ export function TimeColumns({ hour, minute, step = 5, onChange, disabled, labelP
83
117
  fontSize: 1,
84
118
  fontWeight: "bold",
85
119
  fontVariantNumeric: "tabular-nums",
86
- }, children: [pad(hour), ":", pad(minute)] })] }), _jsxs(Box, { sx: { display: "flex", gap: 2 }, children: [_jsx(Column, { label: "Hour", ariaLabel: labelPrefix ? `${labelPrefix}, hour` : "Hour", values: HOURS, selected: hour, disabled: disabled, onPick: (next) => onChange(next, minute) }), _jsx(Column, { label: "Minute", ariaLabel: labelPrefix ? `${labelPrefix}, minute` : "Minute", values: shown, selected: minute, disabled: disabled, onPick: (next) => onChange(hour, next) })] })] }));
120
+ }, children: [pad(hour), ":", pad(minute)] })] }), _jsxs(Box, { sx: { display: "flex", gap: 2 }, children: [_jsx(Column, { label: "Hour", ariaLabel: labelPrefix ? `${labelPrefix}, hour` : "Hour", values: HOURS, selected: hour, disabled: disabled, onPick: (next) => pick(next, minute) }), _jsx(Column, { label: "Minute", ariaLabel: labelPrefix ? `${labelPrefix}, minute` : "Minute", values: shown, selected: minute, disabled: disabled, onPick: (next) => pick(hour, next) })] }), _jsx(TextInput, { "aria-label": labelPrefix ? `${labelPrefix}, type a time` : "Type a time", value: text, placeholder: "HH:mm", disabled: disabled, inputMode: "numeric", sx: { mt: 2, width: "100%", fontFamily: "mono" }, onChange: (event) => {
121
+ typing.current = true;
122
+ setText(event.target.value);
123
+ }, onBlur: (event) => commitText(event.target.value), onKeyDown: (event) => {
124
+ if (event.key === "Enter") {
125
+ commitText(event.target.value);
126
+ }
127
+ } })] }));
87
128
  }
88
129
  export default TimeColumns;
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
6
  import { forwardRef, useId } from 'react';
7
- import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, loopColors, } from '../../theme';
7
+ import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, loopColors, vscodeColors, } from '../../theme';
8
8
  /**
9
9
  * Gradient pattern derived from the original brand logo SVG:
10
10
  * - Left bars: accent → brand (bright → mid)
@@ -158,6 +158,23 @@ export const THEME_LOGO_COLORS = {
158
158
  secondaryGradient: [loopColors.inkDark, loopColors.inkDark],
159
159
  },
160
160
  },
161
+ vscode: {
162
+ // The editor's blue, flat: VS Code draws no gradient.
163
+ light: {
164
+ primary: vscodeColors.vscodeText,
165
+ secondary: '#3B3B3B',
166
+ textColor: '#767676',
167
+ primaryGradient: [vscodeColors.vscodeText, vscodeColors.vscodeText],
168
+ secondaryGradient: ['#3B3B3B', '#3B3B3B'],
169
+ },
170
+ dark: {
171
+ primary: vscodeColors.vscodeAccent,
172
+ secondary: '#CCCCCC',
173
+ textColor: vscodeColors.gray,
174
+ primaryGradient: [vscodeColors.vscodeAccent, vscodeColors.vscodeAccent],
175
+ secondaryGradient: ['#CCCCCC', '#CCCCCC'],
176
+ },
177
+ },
161
178
  };
162
179
  export function getLogoColors(variant = 'datalayer', colorMode = 'light') {
163
180
  const mode = colorMode === 'auto' ? 'light' : colorMode;
@@ -1,8 +1,8 @@
1
- import type { ToolbarButtonItem } from './types';
1
+ import type { ToolbarButtonItem } from "./types";
2
2
  export interface ToolbarButtonProps {
3
3
  item: ToolbarButtonItem;
4
4
  /** Size variant: 'small' for floating toolbar, 'medium' for fixed toolbar */
5
- size?: 'small' | 'medium';
5
+ size?: "small" | "medium";
6
6
  /** Print `ariaLabel` beside the icon — see the module doc. Off by default. */
7
7
  showLabel?: boolean;
8
8
  }
@@ -27,9 +27,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
27
  *
28
28
  * @module components/toolbar/ToolbarButton
29
29
  */
30
- import { isValidElement, useState } from 'react';
31
- import { Tooltip } from '@primer/react';
32
- export function ToolbarButton({ item, size = 'medium', showLabel = false, }) {
30
+ import { isValidElement, useState } from "react";
31
+ import { Tooltip } from "@primer/react";
32
+ export function ToolbarButton({ item, size = "medium", showLabel = false, }) {
33
33
  const { ariaLabel, title, icon, label, isActive, onClick, disabled } = item;
34
34
  // Resolve icon → React element.
35
35
  // Octicon components use React.forwardRef, which returns an *object*
@@ -48,9 +48,9 @@ export function ToolbarButton({ item, size = 'medium', showLabel = false, }) {
48
48
  }
49
49
  else if (label) {
50
50
  // Fallback: render text label (e.g. "x₂" for subscript)
51
- iconElement = _jsx("span", { style: { fontSize: 12, fontWeight: 600, lineHeight: 1 }, children: label });
51
+ iconElement = (_jsx("span", { style: { fontSize: 12, fontWeight: 600, lineHeight: 1 }, children: label }));
52
52
  }
53
- const btnSize = size === 'small' ? 28 : 32;
53
+ const btnSize = size === "small" ? 28 : 32;
54
54
  // Only when there is a name to show, and only where it was asked for:
55
55
  // showLabel with no ariaLabel (should never happen — it is required on
56
56
  // the item — but this keeps a bare icon rather than an empty gap) falls
@@ -68,9 +68,9 @@ export function ToolbarButton({ item, size = 'medium', showLabel = false, }) {
68
68
  const [hovered, setHovered] = useState(false);
69
69
  const lit = hovered && !disabled;
70
70
  const button = (_jsxs("button", { type: "button", "aria-label": ariaLabel, "aria-disabled": disabled || undefined, onMouseDown: (e) => e.preventDefault(), onClick: disabled ? undefined : onClick, style: {
71
- display: 'inline-flex',
72
- alignItems: 'center',
73
- justifyContent: printLabel ? 'flex-start' : 'center',
71
+ display: "inline-flex",
72
+ alignItems: "center",
73
+ justifyContent: printLabel ? "flex-start" : "center",
74
74
  gap: printLabel ? 6 : 0,
75
75
  // No explicit `width` when labelled: sized to its own icon-plus-name
76
76
  // content, the same as `ToolbarDropdown`'s trigger — the two sit in
@@ -80,26 +80,28 @@ export function ToolbarButton({ item, size = 'medium', showLabel = false, }) {
80
80
  width: printLabel ? undefined : btnSize,
81
81
  minWidth: btnSize,
82
82
  height: btnSize,
83
- padding: printLabel ? '0 8px' : 0,
83
+ padding: printLabel ? "0 8px" : 0,
84
84
  margin: 0,
85
- border: 'none',
86
- borderRadius: 6,
87
- cursor: disabled ? 'not-allowed' : 'pointer',
85
+ border: "none",
86
+ // Follow the active theme: Loop makes controls pills, while every
87
+ // other theme supplies its own control radius through the same token.
88
+ borderRadius: "var(--theme-radius-control)",
89
+ cursor: disabled ? "not-allowed" : "pointer",
88
90
  background: lit
89
- ? 'var(--bgColor-neutral-muted, rgba(175,184,193,0.2))'
91
+ ? "var(--bgColor-neutral-muted, rgba(175,184,193,0.2))"
90
92
  : isActive
91
- ? 'var(--bgColor-accent-muted, rgba(9,105,218,0.1))'
92
- : 'transparent',
93
+ ? "var(--bgColor-accent-muted, rgba(9,105,218,0.1))"
94
+ : "transparent",
93
95
  color: lit
94
- ? 'var(--fgColor-default, #1f2328)'
96
+ ? "var(--fgColor-default, #1f2328)"
95
97
  : isActive
96
- ? 'var(--fgColor-accent, #0969da)'
97
- : 'var(--fgColor-muted, #656d76)',
98
+ ? "var(--fgColor-accent, #0969da)"
99
+ : "var(--fgColor-muted, #656d76)",
98
100
  opacity: disabled ? 0.5 : 1,
99
101
  lineHeight: 1,
100
- fontSize: size === 'small' ? 12 : 14,
101
- fontFamily: 'inherit',
102
- whiteSpace: 'nowrap',
102
+ fontSize: size === "small" ? 12 : 14,
103
+ fontFamily: "inherit",
104
+ whiteSpace: "nowrap",
103
105
  }, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [iconElement, printLabel && _jsx("span", { children: ariaLabel })] }));
104
106
  // No title: nothing to say, no wrapper to say it with.
105
107
  return title ? (_jsx(Tooltip, { text: title, direction: "s", children: button })) : (button);
@@ -71,7 +71,9 @@ export function ToolbarDropdown({ item, size = "medium", }) {
71
71
  padding: label ? "0 8px" : 0,
72
72
  margin: 0,
73
73
  border: "none",
74
- borderRadius: 6,
74
+ // Match ToolbarButton and every Primer control in the active
75
+ // theme instead of freezing the trigger at a 6px corner.
76
+ borderRadius: "var(--theme-radius-control)",
75
77
  cursor: disabled ? "not-allowed" : "pointer",
76
78
  /*
77
79
  Neutral while the menu is open, not accented.
@@ -7,6 +7,7 @@ export { sandColors } from './sandColors';
7
7
  export { ivoryColors } from './ivoryColors';
8
8
  export { sunColors } from './sunColors';
9
9
  export { loopColors } from './loopColors';
10
+ export { vscodeColors, vscodeVars, vscodeVar, vscodeTint, vscodeFontFamily, vscodeMonoFontFamily, vscodeFontSize, type VSCodeColor, type VSCodeVarName, } from './vscodeColors';
10
11
  export { themeAccents, themeAccentNames, themeAccentVars, themeAccentTints, themeStageGradient, themeTintVars, type ThemeAccent, type ThemeAccentName, } from './themeAccents';
11
12
  import type { ThemeVariant } from '../themeRegistry';
12
13
  /**
@@ -11,6 +11,7 @@ export { sandColors } from './sandColors';
11
11
  export { ivoryColors } from './ivoryColors';
12
12
  export { sunColors } from './sunColors';
13
13
  export { loopColors } from './loopColors';
14
+ export { vscodeColors, vscodeVars, vscodeVar, vscodeTint, vscodeFontFamily, vscodeMonoFontFamily, vscodeFontSize, } from './vscodeColors';
14
15
  export { themeAccents, themeAccentNames, themeAccentVars, themeAccentTints, themeStageGradient, themeTintVars, } from './themeAccents';
15
16
  import { datalayerColors } from './datalayerColors';
16
17
  import { spatialColors } from './spatialColors';
@@ -21,6 +22,7 @@ import { sandColors } from './sandColors';
21
22
  import { ivoryColors } from './ivoryColors';
22
23
  import { sunColors } from './sunColors';
23
24
  import { loopColors } from './loopColors';
25
+ import { vscodeColors } from './vscodeColors';
24
26
  /**
25
27
  * Themed color palettes — maps each `ThemeVariant` to its corresponding
26
28
  * color object so consumers can pick the right palette at runtime.
@@ -41,4 +43,5 @@ export const themedColors = {
41
43
  ivory: ivoryColors,
42
44
  sun: sunColors,
43
45
  loop: loopColors,
46
+ vscode: vscodeColors,
44
47
  };
@@ -0,0 +1,280 @@
1
+ /**
2
+ * VS Code Color System – the editor's own colours.
3
+ *
4
+ * Inside a Visual Studio Code webview the editor publishes its colour theme
5
+ * as `--vscode-*` custom properties on the page and rewrites them when the
6
+ * person picks another theme (Abyss, Dark Modern, Quiet Light…). The VS Code
7
+ * theme reads those variables, so the webview follows the editor at paint
8
+ * time, with no re-render: {@link vscodeVar} writes
9
+ * `var(--vscode-<name>, <fallback>)`, the fallback being VS Code's own
10
+ * *Dark Modern* or *Light Modern* value, which is what the theme looks like
11
+ * outside VS Code (the appearance menu on the web, a native app).
12
+ *
13
+ * `vscodeColors` holds the Dark Modern hexes under the keys the other colour
14
+ * systems have, for the consumers that need a literal colour: the swatch,
15
+ * the avatars, the illustrations.
16
+ */
17
+ /** One VS Code theme colour: its variable, and the value when it is not published. */
18
+ export interface VSCodeColor {
19
+ /** The `--vscode-*` variable, without the prefix (`editor-background`). */
20
+ variable: string;
21
+ /** VS Code's Light Modern value. */
22
+ light: string;
23
+ /** VS Code's Dark Modern value. */
24
+ dark: string;
25
+ }
26
+ /**
27
+ * The editor colours the theme reads, with their Light Modern and Dark
28
+ * Modern values (VS Code's own defaults) as the fallbacks outside VS Code.
29
+ */
30
+ export declare const vscodeVars: {
31
+ readonly editorBackground: {
32
+ readonly variable: "editor-background";
33
+ readonly light: "#FFFFFF";
34
+ readonly dark: "#1F1F1F";
35
+ };
36
+ readonly editorForeground: {
37
+ readonly variable: "editor-foreground";
38
+ readonly light: "#3B3B3B";
39
+ readonly dark: "#CCCCCC";
40
+ };
41
+ readonly foreground: {
42
+ readonly variable: "foreground";
43
+ readonly light: "#3B3B3B";
44
+ readonly dark: "#CCCCCC";
45
+ };
46
+ readonly descriptionForeground: {
47
+ readonly variable: "descriptionForeground";
48
+ readonly light: "#3B3B3BB3";
49
+ readonly dark: "#9D9D9D";
50
+ };
51
+ readonly disabledForeground: {
52
+ readonly variable: "disabledForeground";
53
+ readonly light: "#3B3B3B80";
54
+ readonly dark: "#CCCCCC80";
55
+ };
56
+ readonly sideBarBackground: {
57
+ readonly variable: "sideBar-background";
58
+ readonly light: "#F8F8F8";
59
+ readonly dark: "#181818";
60
+ };
61
+ readonly editorWidgetBackground: {
62
+ readonly variable: "editorWidget-background";
63
+ readonly light: "#F8F8F8";
64
+ readonly dark: "#202020";
65
+ };
66
+ readonly editorWidgetBorder: {
67
+ readonly variable: "editorWidget-border";
68
+ readonly light: "#E5E5E5";
69
+ readonly dark: "#313131";
70
+ };
71
+ readonly panelBorder: {
72
+ readonly variable: "panel-border";
73
+ readonly light: "#E5E5E5";
74
+ readonly dark: "#2B2B2B";
75
+ };
76
+ readonly widgetShadow: {
77
+ readonly variable: "widget-shadow";
78
+ readonly light: "#00000029";
79
+ readonly dark: "#0000005C";
80
+ };
81
+ readonly focusBorder: {
82
+ readonly variable: "focusBorder";
83
+ readonly light: "#005FB8";
84
+ readonly dark: "#0078D4";
85
+ };
86
+ readonly textLinkForeground: {
87
+ readonly variable: "textLink-foreground";
88
+ readonly light: "#005FB8";
89
+ readonly dark: "#4DAAFC";
90
+ };
91
+ readonly buttonBackground: {
92
+ readonly variable: "button-background";
93
+ readonly light: "#005FB8";
94
+ readonly dark: "#0078D4";
95
+ };
96
+ readonly buttonForeground: {
97
+ readonly variable: "button-foreground";
98
+ readonly light: "#FFFFFF";
99
+ readonly dark: "#FFFFFF";
100
+ };
101
+ readonly buttonHoverBackground: {
102
+ readonly variable: "button-hoverBackground";
103
+ readonly light: "#0258A8";
104
+ readonly dark: "#026EC1";
105
+ };
106
+ readonly buttonBorder: {
107
+ readonly variable: "button-border";
108
+ readonly light: "#0000001A";
109
+ readonly dark: "#FFFFFF12";
110
+ };
111
+ readonly buttonSecondaryBackground: {
112
+ readonly variable: "button-secondaryBackground";
113
+ readonly light: "#E5E5E5";
114
+ readonly dark: "#313131";
115
+ };
116
+ readonly buttonSecondaryForeground: {
117
+ readonly variable: "button-secondaryForeground";
118
+ readonly light: "#3B3B3B";
119
+ readonly dark: "#CCCCCC";
120
+ };
121
+ readonly buttonSecondaryHoverBackground: {
122
+ readonly variable: "button-secondaryHoverBackground";
123
+ readonly light: "#CCCCCC";
124
+ readonly dark: "#3C3C3C";
125
+ };
126
+ readonly inputBackground: {
127
+ readonly variable: "input-background";
128
+ readonly light: "#FFFFFF";
129
+ readonly dark: "#313131";
130
+ };
131
+ readonly inputForeground: {
132
+ readonly variable: "input-foreground";
133
+ readonly light: "#3B3B3B";
134
+ readonly dark: "#CCCCCC";
135
+ };
136
+ readonly inputBorder: {
137
+ readonly variable: "input-border";
138
+ readonly light: "#CECECE";
139
+ readonly dark: "#3C3C3C";
140
+ };
141
+ readonly inputPlaceholderForeground: {
142
+ readonly variable: "input-placeholderForeground";
143
+ readonly light: "#767676";
144
+ readonly dark: "#989898";
145
+ };
146
+ readonly listHoverBackground: {
147
+ readonly variable: "list-hoverBackground";
148
+ readonly light: "#F2F2F2";
149
+ readonly dark: "#2A2D2E";
150
+ };
151
+ readonly listActiveSelectionBackground: {
152
+ readonly variable: "list-activeSelectionBackground";
153
+ readonly light: "#E8E8E8";
154
+ readonly dark: "#04395E";
155
+ };
156
+ readonly errorForeground: {
157
+ readonly variable: "errorForeground";
158
+ readonly light: "#F85149";
159
+ readonly dark: "#F85149";
160
+ };
161
+ readonly editorWarningForeground: {
162
+ readonly variable: "editorWarning-foreground";
163
+ readonly light: "#BF8803";
164
+ readonly dark: "#CCA700";
165
+ };
166
+ readonly editorInfoForeground: {
167
+ readonly variable: "editorInfo-foreground";
168
+ readonly light: "#1A85FF";
169
+ readonly dark: "#3794FF";
170
+ };
171
+ readonly testingIconPassed: {
172
+ readonly variable: "testing-iconPassed";
173
+ readonly light: "#388A34";
174
+ readonly dark: "#73C991";
175
+ };
176
+ readonly terminalAnsiBlue: {
177
+ readonly variable: "terminal-ansiBlue";
178
+ readonly light: "#0451A5";
179
+ readonly dark: "#2472C8";
180
+ };
181
+ readonly terminalAnsiGreen: {
182
+ readonly variable: "terminal-ansiGreen";
183
+ readonly light: "#107C10";
184
+ readonly dark: "#0DBC79";
185
+ };
186
+ readonly terminalAnsiMagenta: {
187
+ readonly variable: "terminal-ansiMagenta";
188
+ readonly light: "#BC05BC";
189
+ readonly dark: "#BC3FBC";
190
+ };
191
+ readonly terminalAnsiYellow: {
192
+ readonly variable: "terminal-ansiYellow";
193
+ readonly light: "#949800";
194
+ readonly dark: "#E5E510";
195
+ };
196
+ readonly terminalAnsiRed: {
197
+ readonly variable: "terminal-ansiRed";
198
+ readonly light: "#CD3131";
199
+ readonly dark: "#CD3131";
200
+ };
201
+ readonly terminalAnsiCyan: {
202
+ readonly variable: "terminal-ansiCyan";
203
+ readonly light: "#0598BC";
204
+ readonly dark: "#11A8CD";
205
+ };
206
+ };
207
+ /** The names of the colours the theme reads. */
208
+ export type VSCodeVarName = keyof typeof vscodeVars;
209
+ /**
210
+ * An editor colour as the theme writes it: the live variable, its
211
+ * mode's default when the page is not a VS Code webview.
212
+ *
213
+ * @param name - The colour.
214
+ * @param mode - Which default to fall back on.
215
+ *
216
+ * @returns `var(--vscode-<variable>, <fallback>)`.
217
+ */
218
+ export declare function vscodeVar(name: VSCodeVarName, mode: 'light' | 'dark'): string;
219
+ /**
220
+ * An editor colour at a fraction of its opacity, for the muted surfaces
221
+ * (a banner's tint, a chip's background): the live colour mixed with
222
+ * transparency, which keeps following the editor's theme.
223
+ *
224
+ * @param name - The colour.
225
+ * @param mode - Which default to fall back on.
226
+ * @param percent - How much of the colour, 0 to 100.
227
+ *
228
+ * @returns A `color-mix()` of the colour and transparent.
229
+ */
230
+ export declare function vscodeTint(name: VSCodeVarName, mode: 'light' | 'dark', percent: number): string;
231
+ /** The editor's UI font: VS Code's, else what VS Code picks on each OS. */
232
+ export declare const vscodeFontFamily = "var(--vscode-font-family, system-ui, \"Ubuntu\", \"Droid Sans\", -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", sans-serif)";
233
+ /** The editor's code font. */
234
+ export declare const vscodeMonoFontFamily = "var(--vscode-editor-font-family, \"Droid Sans Mono\", \"monospace\", monospace)";
235
+ /** The editor's UI font size (13px by default). */
236
+ export declare const vscodeFontSize = "var(--vscode-font-size, 13px)";
237
+ /**
238
+ * The VS Code colours as literal values — Dark Modern's — under the keys the
239
+ * other colour systems share, for the swatch, the avatars and the
240
+ * illustrations, which need a colour rather than a reference.
241
+ */
242
+ export declare const vscodeColors: {
243
+ readonly black: "#1F1F1F";
244
+ readonly gray: "#9D9D9D";
245
+ readonly white: "#FFFFFF";
246
+ readonly vscodeBase: "#0078D4";
247
+ readonly vscodeBrand: "#0078D4";
248
+ readonly vscodeAccent: "#4DAAFC";
249
+ readonly vscodeText: "#005FB8";
250
+ readonly vscodeTint: "#E8F1FB";
251
+ readonly vscodeBright: "#4DAAFC";
252
+ readonly vscodeHover: "#026EC1";
253
+ readonly attentionBrand: "#BF8803";
254
+ readonly attentionAccent: "#CCA700";
255
+ readonly attentionTint: "#FFF4CE";
256
+ readonly dangerBrand: "#F85149";
257
+ readonly dangerAccent: "#F85149";
258
+ readonly dangerTint: "#FDE7E6";
259
+ readonly severeBrand: "#BC4C00";
260
+ readonly severeAccent: "#DB6D28";
261
+ readonly severeTint: "#FFE9D9";
262
+ readonly doneBrand: "#BC05BC";
263
+ readonly doneAccent: "#BC3FBC";
264
+ readonly doneTint: "#F5E1F5";
265
+ readonly brightGlow: "#4DAAFC";
266
+ readonly brightPop: "#0DBC79";
267
+ readonly brightSpark: "#11A8CD";
268
+ readonly brightBlaze: "#F14C4C";
269
+ readonly brightSurge: "#2472C8";
270
+ readonly brightFlame: "#E5E510";
271
+ readonly brightGold: "#FFCC00";
272
+ readonly brightLightGlow: "#005FB8";
273
+ readonly brightLightPop: "#107C10";
274
+ readonly brightLightSpark: "#0598BC";
275
+ readonly brightLightBlaze: "#CD3131";
276
+ readonly brightLightSurge: "#0451A5";
277
+ readonly brightLightFlame: "#949800";
278
+ readonly brightLightGold: "#9A7B00";
279
+ };
280
+ export default vscodeColors;