@datalayer/primer-addons 1.0.46 → 1.0.48
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 +36 -0
- package/lib/components/hover-card/HoverCardDetails.js +1 -1
- package/lib/components/logo/DatalayerLogo.js +17 -1
- package/lib/components/toolbar/FloatingToolbar.js +4 -19
- package/lib/reactor/AppearancePlugin.d.ts +2 -0
- package/lib/reactor/AppearancePlugin.js +2 -0
- package/lib/theme/colors/index.d.ts +1 -0
- package/lib/theme/colors/index.js +3 -0
- package/lib/theme/colors/metalColors.d.ts +77 -0
- package/lib/theme/colors/metalColors.js +70 -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 +50 -0
- package/lib/theme/themes/metalTheme.d.ts +1083 -0
- package/lib/theme/themes/metalTheme.js +21 -0
- package/lib/theme/themes/metalThemeStyles.d.ts +25 -0
- package/lib/theme/themes/metalThemeStyles.js +333 -0
- package/package.json +1 -1
- package/style/fonts/GEIST-LICENSE +93 -0
- package/style/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
- package/style/fonts/geist-latin-wght-normal.woff2 +0 -0
- package/style/fonts/geist-mono-latin-wght-normal.woff2 +0 -0
- package/style/metal-face.css +42 -0
package/README.md
CHANGED
|
@@ -116,6 +116,42 @@ const config = getThemeConfig(app.interface.theme.variant);
|
|
|
116
116
|
|
|
117
117
|
The source: `src/theme/colors/themeAccents.ts`.
|
|
118
118
|
|
|
119
|
+
## The color palette
|
|
120
|
+
|
|
121
|
+
`useColorPalette()` returns one `ColorPalette` object, resolved for the current theme and color mode (a new one when either changes); `getColorPalette(theme, mode)` gives the same without a hook. It holds two categories of colors, and `isLight`, whether the mode is light. The [gallery](examples/gallery)'s *Color Palette* page shows both in whatever theme and mode the gallery wears.
|
|
122
|
+
|
|
123
|
+
- **Roles**, what each theme's own design uses, by role (`paletteRoleNames`, type `PaletteRoleName`): `bg`, `bgPanel`, `bgAlt`, `primary`, `secondary`, `accent`, `glow`, `pop`, `spark`, `blaze`, `surge`, `flame`, `gold`, `textLight`, `textMuted`. What a role is changes with the theme (`surge` is blue in one theme and sage in another). Use them for a page's own design.
|
|
124
|
+
- **Hues**, named colors a spec or a person picks, the same names in every theme (`hueNames`, type `HueName`): `red`, `orange`, `amber`, `yellow`, `lime`, `green`, `emerald`, `teal`, `cyan`, `sky`, `blue`, `indigo`, `violet`, `purple`, `fuchsia`, `pink`, `rose`, `slate`, `gray`, `stone`. A hue keeps its hue in every theme: deep on a light background, bright on a dark one. Use them for a color a spec or a person picks, such as an agent's color.
|
|
125
|
+
|
|
126
|
+
`paletteColorNames` lists both, roles first (type `PaletteColorName`).
|
|
127
|
+
|
|
128
|
+
Roles, for a page's own design:
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import { useColorPalette } from '@datalayer/primer-addons';
|
|
132
|
+
|
|
133
|
+
const palette = useColorPalette();
|
|
134
|
+
<Box style={{ background: palette.bgPanel, color: palette.textLight }}>
|
|
135
|
+
<Text style={{ color: palette.primary }}>Title</Text>
|
|
136
|
+
</Box>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Hues, for a color that is picked: a spec gives a palette name (an agent's `color: indigo`), or a hex where no name fits. `usePaletteColor()` returns a function that resolves it in the current theme and mode; `resolvePaletteColor(value, palette)` does the same with a palette in hand. A palette name gives its value, a hex is returned as is, and nothing or anything else is `undefined`, so the caller draws its own default. `isPaletteColorName` and `isHexColor` (`#RGB` or `#RRGGBB`) check a value first.
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
import { isHexColor, isPaletteColorName, resolvePaletteColor, usePaletteColor } from '@datalayer/primer-addons';
|
|
143
|
+
|
|
144
|
+
const colorOf = usePaletteColor();
|
|
145
|
+
const agentColor = colorOf(agent.color) ?? 'var(--fgColor-accent)';
|
|
146
|
+
// 'indigo' -> the theme's indigo, '#0969da' -> '#0969da', 'nope' -> undefined
|
|
147
|
+
|
|
148
|
+
resolvePaletteColor('teal', palette);
|
|
149
|
+
isPaletteColorName('rose'); // true
|
|
150
|
+
isHexColor('#abc'); // true
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The source: `src/theme/palettes/ColorPalette.tsx` and `src/theme/colors/hueColors.ts`.
|
|
154
|
+
|
|
119
155
|
## The `loop` theme
|
|
120
156
|
|
|
121
157
|
`loop` is one of the variants of the theme registry (`ThemeVariant`, `themeConfigs`), beside `datalayer`, `spatial`, `lovely`, `matrix`, `earth`, `sand`, `ivory` and `sun`: the look of an application built in LOOP — **one accent, neutral everything else**. A white (near-black in dark mode) canvas, a deep-grey ink, hairlines, soft shadows, round corners and one filled button in the accent. Success, attention and danger are kept for verdicts and rules only. The [gallery](examples/gallery) shows it on the *Theme Accents* page when the gallery wears it. Its accent is mint, `green` of the [theme accents](#theme-accents).
|
|
@@ -39,7 +39,7 @@ export function HoverCardDetails({ label, onClose, width = 880, closeLabel = 'Cl
|
|
|
39
39
|
: `${leaving ? 'dlaHoverCardVeilOut' : 'dlaHoverCardVeilIn'} ${HOVER_CARD_MOTION_MS}ms ease-out both`, sx: {
|
|
40
40
|
'@keyframes dlaHoverCardVeilIn': { from: { opacity: 0 }, to: { opacity: 1 } },
|
|
41
41
|
'@keyframes dlaHoverCardVeilOut': { from: { opacity: 1 }, to: { opacity: 0 } },
|
|
42
|
-
}, children: _jsxs(Card, { role: "dialog", "aria-modal": "true", "aria-label": label, onClick: (event) => event.stopPropagation(), shadow: "extraLarge", width: width, maxWidth: "100%", borderRadius: [0, '
|
|
42
|
+
}, children: _jsxs(Card, { role: "dialog", "aria-modal": "true", "aria-label": label, onClick: (event) => event.stopPropagation(), shadow: "extraLarge", width: width, maxWidth: "100%", borderRadius: [0, 'overlay'], overflow: "hidden", position: "relative", display: "block",
|
|
43
43
|
// Rises into place and sinks back out, at the hover card's speed: the
|
|
44
44
|
// third size arrives the way the second one did.
|
|
45
45
|
animation: reduced
|
|
@@ -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, vscodeColors, } from '../../theme';
|
|
7
|
+
import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, loopColors, metalColors, 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,22 @@ export const THEME_LOGO_COLORS = {
|
|
|
158
158
|
secondaryGradient: [loopColors.inkDark, loopColors.inkDark],
|
|
159
159
|
},
|
|
160
160
|
},
|
|
161
|
+
metal: {
|
|
162
|
+
light: {
|
|
163
|
+
primary: metalColors.steelFrom,
|
|
164
|
+
secondary: metalColors.ink,
|
|
165
|
+
textColor: metalColors.gray,
|
|
166
|
+
primaryGradient: [metalColors.steelFrom, metalColors.steelTo],
|
|
167
|
+
secondaryGradient: [metalColors.ink, metalColors.ink],
|
|
168
|
+
},
|
|
169
|
+
dark: {
|
|
170
|
+
primary: metalColors.metalBright,
|
|
171
|
+
secondary: metalColors.inkDark,
|
|
172
|
+
textColor: metalColors.grayDark,
|
|
173
|
+
primaryGradient: [metalColors.metalBright, metalColors.brightPop],
|
|
174
|
+
secondaryGradient: [metalColors.inkDark, metalColors.inkDark],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
161
177
|
vscode: {
|
|
162
178
|
// The editor's blue, flat: VS Code draws no gradient.
|
|
163
179
|
light: {
|
|
@@ -108,25 +108,10 @@ export function FloatingToolbar({ items, extraItems, anchorElement, isVisible, c
|
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
110
|
const container = portalContainer || anchorElement || document.body;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
px: 1,
|
|
116
|
-
py: '4px',
|
|
117
|
-
bg: 'var(--overlay-bgColor, var(--bgColor-default))',
|
|
118
|
-
border: '1px solid',
|
|
119
|
-
borderColor: 'var(--borderColor-muted, transparent)',
|
|
120
|
-
borderRadius: 2,
|
|
121
|
-
boxShadow: 'shadow.large',
|
|
122
|
-
position: 'absolute',
|
|
123
|
-
zIndex: 10,
|
|
124
|
-
top: '-10000px',
|
|
125
|
-
left: '-10000px',
|
|
126
|
-
opacity: 0,
|
|
127
|
-
transition: 'opacity 0.15s ease, transform 0.15s ease',
|
|
128
|
-
transform: 'translateY(-4px)',
|
|
129
|
-
}, children: _jsx(ToolbarRenderer, { items: allItems, disabled: disabled, size: "small" }) }));
|
|
111
|
+
// Drawn as this package's `Card` draws itself, from the theme's tokens
|
|
112
|
+
// only: the theme's card corner, Primer's overlay ground and hairline, and
|
|
113
|
+
// the floating shadow each colour mode sets for itself.
|
|
114
|
+
const toolbar = (_jsx(Box, { ref: floatingRef, className: className, role: "toolbar", "aria-label": ariaLabel, display: "flex", alignItems: "center", gap: "2px", px: 1, py: "4px", bg: "canvas.overlay", color: "fg.default", border: "1px solid", borderColor: "border.default", borderRadius: "overlay", boxShadow: "shadow.large", position: "absolute", zIndex: 10, top: "-10000px", left: "-10000px", opacity: 0, transition: "opacity 0.15s ease, transform 0.15s ease", transform: "translateY(-4px)", children: _jsx(ToolbarRenderer, { items: allItems, disabled: disabled, size: "small" }) }));
|
|
130
115
|
return createPortal(toolbar, container);
|
|
131
116
|
}
|
|
132
117
|
export default FloatingToolbar;
|
|
@@ -26,6 +26,8 @@ export type AppearancePluginConfig = {
|
|
|
26
26
|
* as in the public header: a person who chose dark keeps dark.
|
|
27
27
|
*/
|
|
28
28
|
applyThemeColorMode: boolean;
|
|
29
|
+
/** The most theme swatches on one line of the overlay. */
|
|
30
|
+
themesPerLine: number;
|
|
29
31
|
};
|
|
30
32
|
export declare const AppearancePlugin: import("@datalayer/reactor").ReactorPlugin<AppearancePluginConfig, unknown, ReactorReactOutput>;
|
|
31
33
|
export default AppearancePlugin;
|
|
@@ -42,6 +42,7 @@ export const AppearancePlugin = definePlugin({
|
|
|
42
42
|
placement: "bottom-end",
|
|
43
43
|
showThemePreviews: true,
|
|
44
44
|
applyThemeColorMode: false,
|
|
45
|
+
themesPerLine: 6,
|
|
45
46
|
},
|
|
46
47
|
build: ({ config }) => ({
|
|
47
48
|
components: [
|
|
@@ -55,6 +56,7 @@ export const AppearancePlugin = definePlugin({
|
|
|
55
56
|
hoverOverlayPlacement: config.placement,
|
|
56
57
|
showThemePreviews: config.showThemePreviews,
|
|
57
58
|
applyThemeColorMode: config.applyThemeColorMode,
|
|
59
|
+
themesPerLine: config.themesPerLine,
|
|
58
60
|
}),
|
|
59
61
|
},
|
|
60
62
|
],
|
|
@@ -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 { metalColors } from './metalColors';
|
|
10
11
|
export { vscodeColors, vscodeVars, vscodeVar, vscodeTint, vscodeFontFamily, vscodeMonoFontFamily, vscodeFontSize, type VSCodeColor, type VSCodeVarName, } from './vscodeColors';
|
|
11
12
|
export { themeAccents, themeAccentNames, themeAccentVars, themeAccentTints, themeStageGradient, themeTintVars, type ThemeAccent, type ThemeAccentName, } from './themeAccents';
|
|
12
13
|
export { hueNames, baseHueColors, hueColorsOf, type HueName, type HueColor, } from './hueColors';
|
|
@@ -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 { metalColors } from './metalColors';
|
|
14
15
|
export { vscodeColors, vscodeVars, vscodeVar, vscodeTint, vscodeFontFamily, vscodeMonoFontFamily, vscodeFontSize, } from './vscodeColors';
|
|
15
16
|
export { themeAccents, themeAccentNames, themeAccentVars, themeAccentTints, themeStageGradient, themeTintVars, } from './themeAccents';
|
|
16
17
|
export { hueNames, baseHueColors, hueColorsOf, } from './hueColors';
|
|
@@ -23,6 +24,7 @@ import { sandColors } from './sandColors';
|
|
|
23
24
|
import { ivoryColors } from './ivoryColors';
|
|
24
25
|
import { sunColors } from './sunColors';
|
|
25
26
|
import { loopColors } from './loopColors';
|
|
27
|
+
import { metalColors } from './metalColors';
|
|
26
28
|
import { vscodeColors } from './vscodeColors';
|
|
27
29
|
/**
|
|
28
30
|
* Themed color palettes — maps each `ThemeVariant` to its corresponding
|
|
@@ -44,5 +46,6 @@ export const themedColors = {
|
|
|
44
46
|
ivory: ivoryColors,
|
|
45
47
|
sun: sunColors,
|
|
46
48
|
loop: loopColors,
|
|
49
|
+
metal: metalColors,
|
|
47
50
|
vscode: vscodeColors,
|
|
48
51
|
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare const metalColors: {
|
|
2
|
+
black: string;
|
|
3
|
+
gray: string;
|
|
4
|
+
ink: string;
|
|
5
|
+
inkDark: string;
|
|
6
|
+
subtle: string;
|
|
7
|
+
subtleDark: string;
|
|
8
|
+
grayDark: string;
|
|
9
|
+
metalBrand: string;
|
|
10
|
+
metalOn: string;
|
|
11
|
+
metalHover: string;
|
|
12
|
+
metalActive: string;
|
|
13
|
+
metalText: string;
|
|
14
|
+
metalRing: string;
|
|
15
|
+
metalTint: string;
|
|
16
|
+
metalStage: string;
|
|
17
|
+
metalBright: string;
|
|
18
|
+
metalBrightHover: string;
|
|
19
|
+
metalOnDark: string;
|
|
20
|
+
metalStageDark: string;
|
|
21
|
+
metalTintDark: string;
|
|
22
|
+
line: string;
|
|
23
|
+
lineMuted: string;
|
|
24
|
+
controlLine: string;
|
|
25
|
+
lineDark: string;
|
|
26
|
+
lineMutedDark: string;
|
|
27
|
+
sageFrom: string;
|
|
28
|
+
sageTo: string;
|
|
29
|
+
steelFrom: string;
|
|
30
|
+
steelTo: string;
|
|
31
|
+
mauveFrom: string;
|
|
32
|
+
mauveTo: string;
|
|
33
|
+
clayFrom: string;
|
|
34
|
+
clayTo: string;
|
|
35
|
+
brightGlow: string;
|
|
36
|
+
brightPop: string;
|
|
37
|
+
brightSpark: string;
|
|
38
|
+
brightBlaze: string;
|
|
39
|
+
brightSurge: string;
|
|
40
|
+
brightFlame: string;
|
|
41
|
+
brightGold: string;
|
|
42
|
+
brightLightGlow: string;
|
|
43
|
+
brightLightPop: string;
|
|
44
|
+
brightLightSpark: string;
|
|
45
|
+
brightLightBlaze: string;
|
|
46
|
+
brightLightSurge: string;
|
|
47
|
+
brightLightFlame: string;
|
|
48
|
+
brightLightGold: string;
|
|
49
|
+
white: string;
|
|
50
|
+
loopBrand: string;
|
|
51
|
+
loopOn: string;
|
|
52
|
+
loopAccent: string;
|
|
53
|
+
loopBrandHover: string;
|
|
54
|
+
loopText: string;
|
|
55
|
+
loopRing: string;
|
|
56
|
+
loopTint: string;
|
|
57
|
+
loopStage: string;
|
|
58
|
+
loopBright: string;
|
|
59
|
+
loopHover: string;
|
|
60
|
+
loopStageDark: string;
|
|
61
|
+
loopTintDark: string;
|
|
62
|
+
successBrand: string;
|
|
63
|
+
successAccent: string;
|
|
64
|
+
successTint: string;
|
|
65
|
+
attentionBrand: string;
|
|
66
|
+
attentionAccent: string;
|
|
67
|
+
attentionTint: string;
|
|
68
|
+
dangerBrand: string;
|
|
69
|
+
dangerAccent: string;
|
|
70
|
+
dangerTint: string;
|
|
71
|
+
severeBrand: string;
|
|
72
|
+
severeAccent: string;
|
|
73
|
+
severeTint: string;
|
|
74
|
+
doneBrand: string;
|
|
75
|
+
doneAccent: string;
|
|
76
|
+
doneTint: string;
|
|
77
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Metal Color System – cool neutrals, one steel blue, four brushed surfaces.
|
|
7
|
+
*
|
|
8
|
+
* The Loop theme's system with the warmth taken out: a white canvas under a
|
|
9
|
+
* blue-grey wash, hairlines with a little steel in them, and a slate-blue
|
|
10
|
+
* accent. Where Loop has no gradient, Metal has four, for a surface that
|
|
11
|
+
* carries white text and glass on top: sage, steel, mauve and clay.
|
|
12
|
+
* The verdict colours are Loop's.
|
|
13
|
+
*/
|
|
14
|
+
import { loopColors } from './loopColors';
|
|
15
|
+
export const metalColors = {
|
|
16
|
+
...loopColors,
|
|
17
|
+
// Core neutrals
|
|
18
|
+
black: '#1C2A33', // The deep base under the dark mesh
|
|
19
|
+
gray: '#6B7280', // Secondary text on light: 4.8 to 1 on white
|
|
20
|
+
ink: '#2A2F37', // Text on light: softer than Loop's, 13.5 to 1 on white
|
|
21
|
+
inkDark: '#EEF2F7', // Text on dark
|
|
22
|
+
subtle: '#F6F8FC', // Subtle surface on light
|
|
23
|
+
subtleDark: '#25343F', // Subtle surface on dark, and the menus
|
|
24
|
+
grayDark: '#C3CDD8', // Secondary text on dark
|
|
25
|
+
// Metal palette (Brand) — steel blue
|
|
26
|
+
metalBrand: '#4C76BA', // The filled button: white text 4.6 to 1
|
|
27
|
+
metalOn: '#FFFFFF', // Text that sits on the accent
|
|
28
|
+
metalHover: '#3F68AC', // The filled button, hovered: white text 5.5 to 1
|
|
29
|
+
metalActive: '#355A98', // The filled button, pressed
|
|
30
|
+
metalText: '#3A66AC', // Accent text & links on white: 5.7 to 1
|
|
31
|
+
metalRing: '#264F8F', // The focus ring on light: 8 to 1 on white
|
|
32
|
+
metalTint: '#F1F5FB', // Quiet tint — a draft, a callout
|
|
33
|
+
metalStage: '#E4ECF7', // The stage behind an application
|
|
34
|
+
metalBright: '#8FB4E8', // The accent on dark: dark text 8.2 to 1
|
|
35
|
+
metalBrightHover: '#A9C6EE', // The accent on dark, hovered
|
|
36
|
+
metalOnDark: '#0B1A30', // Text that sits on the accent on dark
|
|
37
|
+
metalStageDark: '#152033',
|
|
38
|
+
metalTintDark: '#141A23',
|
|
39
|
+
// Hairlines, with a little steel in them
|
|
40
|
+
line: '#E3E9F2',
|
|
41
|
+
lineMuted: '#EDF1F7',
|
|
42
|
+
controlLine: '#D6E0EE',
|
|
43
|
+
lineDark: '#262D37',
|
|
44
|
+
lineMutedDark: '#1E242C',
|
|
45
|
+
// The four surfaces: the two stops of each gradient
|
|
46
|
+
sageFrom: '#8FA672',
|
|
47
|
+
sageTo: '#4F7A5A',
|
|
48
|
+
steelFrom: '#3F73B5',
|
|
49
|
+
steelTo: '#2396D6',
|
|
50
|
+
mauveFrom: '#A87890',
|
|
51
|
+
mauveTo: '#B04A6E',
|
|
52
|
+
clayFrom: '#C26A4E',
|
|
53
|
+
clayTo: '#A04A2C',
|
|
54
|
+
// Bright colours for SVG illustrations, on dark
|
|
55
|
+
brightGlow: '#8FB4E8', // Steel
|
|
56
|
+
brightPop: '#6FC3E8', // Sky
|
|
57
|
+
brightSpark: '#A8C08A', // Sage
|
|
58
|
+
brightBlaze: '#D98FAE', // Mauve
|
|
59
|
+
brightSurge: '#A9B4E6', // Periwinkle
|
|
60
|
+
brightFlame: '#E09272', // Clay
|
|
61
|
+
brightGold: '#E6C878', // Brass
|
|
62
|
+
// The same, deeper, for light backgrounds
|
|
63
|
+
brightLightGlow: '#3A66AC', // Deep steel
|
|
64
|
+
brightLightPop: '#1F7FB8', // Deep sky
|
|
65
|
+
brightLightSpark: '#56784A', // Deep sage
|
|
66
|
+
brightLightBlaze: '#A8426A', // Deep mauve
|
|
67
|
+
brightLightSurge: '#5A5FB0', // Deep periwinkle
|
|
68
|
+
brightLightFlame: '#A64E2E', // Deep clay
|
|
69
|
+
brightLightGold: '#8A6A1E', // Deep brass
|
|
70
|
+
};
|
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/metalTheme';
|
|
17
18
|
export * from './themes/vscodeTheme';
|
|
18
19
|
export * from './themes-brand/spatialBrandTheme';
|
|
19
20
|
export * from './themeRegistry';
|
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/metalTheme';
|
|
21
22
|
export * from './themes/vscodeTheme';
|
|
22
23
|
export * from './themes-brand/spatialBrandTheme';
|
|
23
24
|
export * from './themeRegistry';
|
|
@@ -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, vscodeColors, hueColorsOf, hueNames, } from '../colors';
|
|
10
|
+
import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, loopColors, metalColors, vscodeColors, hueColorsOf, hueNames, } from '../colors';
|
|
11
11
|
import { getBrightPalette, } from '../themeRegistry';
|
|
12
12
|
import { useCallback } from 'react';
|
|
13
13
|
import { useThemeStore } from '../useThemeStore';
|
|
@@ -63,6 +63,8 @@ const suBrightDark = getBrightPalette('sun');
|
|
|
63
63
|
const suBrightLight = getBrightPalette('sun', 'light');
|
|
64
64
|
const loBrightDark = getBrightPalette('loop');
|
|
65
65
|
const loBrightLight = getBrightPalette('loop', 'light');
|
|
66
|
+
const meBrightDark = getBrightPalette('metal');
|
|
67
|
+
const meBrightLight = getBrightPalette('metal', 'light');
|
|
66
68
|
const vsBrightDark = getBrightPalette('vscode');
|
|
67
69
|
const vsBrightLight = getBrightPalette('vscode', 'light');
|
|
68
70
|
const rolePalettes = {
|
|
@@ -408,6 +410,44 @@ const rolePalettes = {
|
|
|
408
410
|
isLight: false,
|
|
409
411
|
},
|
|
410
412
|
},
|
|
413
|
+
metal: {
|
|
414
|
+
light: {
|
|
415
|
+
bg: metalColors.white,
|
|
416
|
+
bgPanel: '#ffffff',
|
|
417
|
+
bgAlt: metalColors.subtle,
|
|
418
|
+
primary: metalColors.metalBrand,
|
|
419
|
+
secondary: metalColors.metalText,
|
|
420
|
+
accent: metalColors.steelTo,
|
|
421
|
+
glow: meBrightLight.glow,
|
|
422
|
+
pop: meBrightLight.pop,
|
|
423
|
+
spark: meBrightLight.spark,
|
|
424
|
+
blaze: meBrightLight.blaze,
|
|
425
|
+
surge: meBrightLight.surge,
|
|
426
|
+
flame: meBrightLight.flame,
|
|
427
|
+
gold: meBrightLight.gold,
|
|
428
|
+
textLight: metalColors.ink,
|
|
429
|
+
textMuted: metalColors.gray,
|
|
430
|
+
isLight: true,
|
|
431
|
+
},
|
|
432
|
+
dark: {
|
|
433
|
+
bg: metalColors.black,
|
|
434
|
+
bgPanel: '#141920',
|
|
435
|
+
bgAlt: metalColors.subtleDark,
|
|
436
|
+
primary: metalColors.metalBrand,
|
|
437
|
+
secondary: metalColors.metalBright,
|
|
438
|
+
accent: metalColors.steelTo,
|
|
439
|
+
glow: meBrightDark.glow,
|
|
440
|
+
pop: meBrightDark.pop,
|
|
441
|
+
spark: meBrightDark.spark,
|
|
442
|
+
blaze: meBrightDark.blaze,
|
|
443
|
+
surge: meBrightDark.surge,
|
|
444
|
+
flame: meBrightDark.flame,
|
|
445
|
+
gold: meBrightDark.gold,
|
|
446
|
+
textLight: metalColors.inkDark,
|
|
447
|
+
textMuted: metalColors.grayDark,
|
|
448
|
+
isLight: false,
|
|
449
|
+
},
|
|
450
|
+
},
|
|
411
451
|
vscode: {
|
|
412
452
|
light: {
|
|
413
453
|
bg: vscodeColors.white,
|
|
@@ -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 { metalTheme } from './themes/metalTheme';
|
|
20
21
|
import { vscodeTheme, vscodeThemeStyles } from './themes/vscodeTheme';
|
|
21
22
|
import { avatarColorsOf, brightPaletteOf, themeTokens, } from './themeTokens';
|
|
22
23
|
export { avatarColorsOf, brightPaletteOf, getCardGradient, getThemeTokens, themeTokens, themeVariants, } from './themeTokens';
|
|
@@ -30,6 +31,7 @@ const primerThemes = {
|
|
|
30
31
|
ivory: ivoryTheme,
|
|
31
32
|
sun: sunTheme,
|
|
32
33
|
loop: loopTheme,
|
|
34
|
+
metal: metalTheme,
|
|
33
35
|
vscode: vscodeTheme,
|
|
34
36
|
};
|
|
35
37
|
export const themeConfigs = Object.fromEntries(Object.keys(themeTokens).map(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' | 'vscode';
|
|
10
|
+
export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth' | 'sand' | 'ivory' | 'sun' | 'loop' | 'metal' | '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 { metalThemeStyles } from './themes/metalThemeStyles';
|
|
14
15
|
import { vscodePortableThemeStyles } from './themes/vscodeThemeStyles';
|
|
15
16
|
import { datalayerColors } from './colors/datalayerColors';
|
|
16
17
|
import { spatialColors } from './colors/spatialColors';
|
|
@@ -21,6 +22,7 @@ import { sandColors } from './colors/sandColors';
|
|
|
21
22
|
import { ivoryColors } from './colors/ivoryColors';
|
|
22
23
|
import { sunColors } from './colors/sunColors';
|
|
23
24
|
import { loopColors } from './colors/loopColors';
|
|
25
|
+
import { metalColors } from './colors/metalColors';
|
|
24
26
|
import { vscodeColors } from './colors/vscodeColors';
|
|
25
27
|
/* ─── Registry ────────────────────────────────────────────────────────── */
|
|
26
28
|
export const themeTokens = {
|
|
@@ -304,6 +306,37 @@ export const themeTokens = {
|
|
|
304
306
|
gold: loopColors.brightLightGold, // #8A6A00 — deep sun
|
|
305
307
|
},
|
|
306
308
|
},
|
|
309
|
+
metal: {
|
|
310
|
+
label: 'Metal',
|
|
311
|
+
description: 'Loop’s curves, on a page of its own: a dotted wash on light, a deep gradient and frosted glass on dark.',
|
|
312
|
+
brandColor: metalColors.metalBrand,
|
|
313
|
+
defaultColorMode: 'light',
|
|
314
|
+
themeStyles: metalThemeStyles,
|
|
315
|
+
cardGradient: {
|
|
316
|
+
light: { from: metalColors.steelFrom, to: metalColors.steelTo },
|
|
317
|
+
dark: { from: metalColors.steelFrom, to: metalColors.steelTo },
|
|
318
|
+
},
|
|
319
|
+
brightPalette: {
|
|
320
|
+
glow: metalColors.brightGlow,
|
|
321
|
+
onGlow: metalColors.metalOnDark,
|
|
322
|
+
pop: metalColors.brightPop,
|
|
323
|
+
spark: metalColors.brightSpark,
|
|
324
|
+
blaze: metalColors.brightBlaze,
|
|
325
|
+
surge: metalColors.brightSurge,
|
|
326
|
+
flame: metalColors.brightFlame,
|
|
327
|
+
gold: metalColors.brightGold,
|
|
328
|
+
},
|
|
329
|
+
brightPaletteLight: {
|
|
330
|
+
glow: metalColors.brightLightGlow,
|
|
331
|
+
onGlow: '#ffffff',
|
|
332
|
+
pop: metalColors.brightLightPop,
|
|
333
|
+
spark: metalColors.brightLightSpark,
|
|
334
|
+
blaze: metalColors.brightLightBlaze,
|
|
335
|
+
surge: metalColors.brightLightSurge,
|
|
336
|
+
flame: metalColors.brightLightFlame,
|
|
337
|
+
gold: metalColors.brightLightGold,
|
|
338
|
+
},
|
|
339
|
+
},
|
|
307
340
|
vscode: {
|
|
308
341
|
label: 'VS Code',
|
|
309
342
|
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.',
|
|
@@ -347,6 +380,7 @@ export const themeVariants = [
|
|
|
347
380
|
'ivory',
|
|
348
381
|
'sun',
|
|
349
382
|
'loop',
|
|
383
|
+
'metal',
|
|
350
384
|
'vscode',
|
|
351
385
|
];
|
|
352
386
|
/** Look up a theme's tokens by variant name. */
|
|
@@ -527,6 +561,22 @@ const avatarColorPalettes = {
|
|
|
527
561
|
loopColors.brightGold, // #F8D469 — sun
|
|
528
562
|
],
|
|
529
563
|
},
|
|
564
|
+
metal: {
|
|
565
|
+
light: [
|
|
566
|
+
metalColors.brightLightGlow,
|
|
567
|
+
metalColors.brightLightPop,
|
|
568
|
+
metalColors.brightLightBlaze,
|
|
569
|
+
metalColors.brightLightSurge,
|
|
570
|
+
metalColors.gray,
|
|
571
|
+
],
|
|
572
|
+
dark: [
|
|
573
|
+
metalColors.loopBrand,
|
|
574
|
+
metalColors.brightPop,
|
|
575
|
+
metalColors.brightBlaze,
|
|
576
|
+
metalColors.brightSurge,
|
|
577
|
+
metalColors.brightGold,
|
|
578
|
+
],
|
|
579
|
+
},
|
|
530
580
|
vscode: {
|
|
531
581
|
light: [
|
|
532
582
|
vscodeColors.brightLightGlow, // #005FB8 — deep blue
|