@datalayer/primer-addons 1.0.23 → 1.0.25
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 +1 -1
- package/lib/components/logo/DatalayerLogo.js +18 -1
- package/lib/components/sliding-panel/SlidingPanel.js +1 -1
- package/lib/theme/colors/index.d.ts +1 -0
- package/lib/theme/colors/index.js +3 -0
- package/lib/theme/colors/loopColors.d.ts +91 -0
- package/lib/theme/colors/loopColors.js +128 -0
- package/lib/theme/css/createThemeCSSVars.d.ts +28 -0
- package/lib/theme/css/createThemeCSSVars.js +25 -12
- 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.d.ts +1 -1
- package/lib/theme/themeRegistry.js +52 -1
- package/lib/theme/themes/loopTheme.d.ts +1122 -0
- package/lib/theme/themes/loopTheme.js +340 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://datalayer.ai)
|
|
2
2
|
|
|
3
3
|
[](https://github.com/sponsors/datalayer)
|
|
4
4
|
|
|
@@ -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, } from '../../theme';
|
|
7
|
+
import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, loopColors, } from '../../theme';
|
|
8
8
|
/**
|
|
9
9
|
* Gradient pattern derived from the original brand logo SVG:
|
|
10
10
|
* - Left bars: accent → brand (bright → mid)
|
|
@@ -141,6 +141,23 @@ export const THEME_LOGO_COLORS = {
|
|
|
141
141
|
secondaryGradient: [sunColors.sunHover, sunColors.sunAccent],
|
|
142
142
|
},
|
|
143
143
|
},
|
|
144
|
+
loop: {
|
|
145
|
+
// Flat: the theme has no gradient on a surface.
|
|
146
|
+
light: {
|
|
147
|
+
primary: loopColors.loopAccent,
|
|
148
|
+
secondary: loopColors.ink,
|
|
149
|
+
textColor: loopColors.gray,
|
|
150
|
+
primaryGradient: [loopColors.loopAccent, loopColors.loopAccent],
|
|
151
|
+
secondaryGradient: [loopColors.ink, loopColors.ink],
|
|
152
|
+
},
|
|
153
|
+
dark: {
|
|
154
|
+
primary: loopColors.loopBrand,
|
|
155
|
+
secondary: loopColors.inkDark,
|
|
156
|
+
textColor: loopColors.grayDark,
|
|
157
|
+
primaryGradient: [loopColors.loopBrand, loopColors.loopBrand],
|
|
158
|
+
secondaryGradient: [loopColors.inkDark, loopColors.inkDark],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
144
161
|
};
|
|
145
162
|
export function getLogoColors(variant = 'datalayer', colorMode = 'light') {
|
|
146
163
|
const mode = colorMode === 'auto' ? 'light' : colorMode;
|
|
@@ -174,7 +174,7 @@ export const SlidingPanel = ({ isOpen, message, details, onDismiss, position = '
|
|
|
174
174
|
pointerEvents: 'none',
|
|
175
175
|
...anchorStyles,
|
|
176
176
|
}, children: _jsxs(Box, { role: variant === 'error' || variant === 'danger' ? 'alert' : 'status', "aria-live": variant === 'error' || variant === 'danger' ? 'assertive' : 'polite', onClick: onDismiss
|
|
177
|
-
? event => {
|
|
177
|
+
? (event) => {
|
|
178
178
|
// A tap on the panel dismisses it — but not a click on a
|
|
179
179
|
// link, button or field in its content, nor the end of a
|
|
180
180
|
// text selection: those are someone using what it says.
|
|
@@ -6,6 +6,7 @@ export { earthColors } from './earthColors';
|
|
|
6
6
|
export { sandColors } from './sandColors';
|
|
7
7
|
export { ivoryColors } from './ivoryColors';
|
|
8
8
|
export { sunColors } from './sunColors';
|
|
9
|
+
export { loopColors, loopAccents, loopAccentNames, loopAccentVars, type LoopAccent, type LoopAccentName, } from './loopColors';
|
|
9
10
|
import type { ThemeVariant } from '../themeRegistry';
|
|
10
11
|
/**
|
|
11
12
|
* Themed color palettes — maps each `ThemeVariant` to its corresponding
|
|
@@ -10,6 +10,7 @@ export { earthColors } from './earthColors';
|
|
|
10
10
|
export { sandColors } from './sandColors';
|
|
11
11
|
export { ivoryColors } from './ivoryColors';
|
|
12
12
|
export { sunColors } from './sunColors';
|
|
13
|
+
export { loopColors, loopAccents, loopAccentNames, loopAccentVars, } from './loopColors';
|
|
13
14
|
import { datalayerColors } from './datalayerColors';
|
|
14
15
|
import { spatialColors } from './spatialColors';
|
|
15
16
|
import { lovelyColors } from './lovelyColors';
|
|
@@ -18,6 +19,7 @@ import { earthColors } from './earthColors';
|
|
|
18
19
|
import { sandColors } from './sandColors';
|
|
19
20
|
import { ivoryColors } from './ivoryColors';
|
|
20
21
|
import { sunColors } from './sunColors';
|
|
22
|
+
import { loopColors } from './loopColors';
|
|
21
23
|
/**
|
|
22
24
|
* Themed color palettes — maps each `ThemeVariant` to its corresponding
|
|
23
25
|
* color object so consumers can pick the right palette at runtime.
|
|
@@ -37,4 +39,5 @@ export const themedColors = {
|
|
|
37
39
|
sand: sandColors,
|
|
38
40
|
ivory: ivoryColors,
|
|
39
41
|
sun: sunColors,
|
|
42
|
+
loop: loopColors,
|
|
40
43
|
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loop Color System – one accent, neutral everything else.
|
|
3
|
+
*
|
|
4
|
+
* The look of an application built in LOOP: a white (or near-black)
|
|
5
|
+
* canvas, near-black (or near-white) text, hairlines instead of borders,
|
|
6
|
+
* and a single soft accent that dark text sits on. Nothing else carries
|
|
7
|
+
* colour, apart from the three colours of a verdict.
|
|
8
|
+
*
|
|
9
|
+
* The accent of the theme itself is green — a lighter relative of
|
|
10
|
+
* Datalayer's brand green. An application may take one of five others
|
|
11
|
+
* (`loopAccents`); each is four values: the accent, the text that sits on
|
|
12
|
+
* it, the tint of the stage behind an application, and a quiet tint.
|
|
13
|
+
* Dark text on every accent: the lowest contrast of the six is 8.8 to 1.
|
|
14
|
+
*/
|
|
15
|
+
export declare const loopColors: {
|
|
16
|
+
black: string;
|
|
17
|
+
gray: string;
|
|
18
|
+
white: string;
|
|
19
|
+
ink: string;
|
|
20
|
+
inkDark: string;
|
|
21
|
+
subtle: string;
|
|
22
|
+
subtleDark: string;
|
|
23
|
+
grayDark: string;
|
|
24
|
+
loopBrand: string;
|
|
25
|
+
loopOn: string;
|
|
26
|
+
loopAccent: string;
|
|
27
|
+
loopText: string;
|
|
28
|
+
loopTint: string;
|
|
29
|
+
loopStage: string;
|
|
30
|
+
loopBright: string;
|
|
31
|
+
loopHover: string;
|
|
32
|
+
loopStageDark: string;
|
|
33
|
+
loopTintDark: string;
|
|
34
|
+
successBrand: string;
|
|
35
|
+
successAccent: string;
|
|
36
|
+
successTint: string;
|
|
37
|
+
attentionBrand: string;
|
|
38
|
+
attentionAccent: string;
|
|
39
|
+
attentionTint: string;
|
|
40
|
+
dangerBrand: string;
|
|
41
|
+
dangerAccent: string;
|
|
42
|
+
dangerTint: string;
|
|
43
|
+
severeBrand: string;
|
|
44
|
+
severeAccent: string;
|
|
45
|
+
severeTint: string;
|
|
46
|
+
doneBrand: string;
|
|
47
|
+
doneAccent: string;
|
|
48
|
+
doneTint: string;
|
|
49
|
+
brightGlow: string;
|
|
50
|
+
brightPop: string;
|
|
51
|
+
brightSpark: string;
|
|
52
|
+
brightBlaze: string;
|
|
53
|
+
brightSurge: string;
|
|
54
|
+
brightFlame: string;
|
|
55
|
+
brightGold: string;
|
|
56
|
+
brightLightGlow: string;
|
|
57
|
+
brightLightPop: string;
|
|
58
|
+
brightLightSpark: string;
|
|
59
|
+
brightLightBlaze: string;
|
|
60
|
+
brightLightSurge: string;
|
|
61
|
+
brightLightFlame: string;
|
|
62
|
+
brightLightGold: string;
|
|
63
|
+
};
|
|
64
|
+
/** The accents an application may take, by name. */
|
|
65
|
+
export type LoopAccentName = 'green' | 'rose' | 'sky' | 'lime' | 'sun' | 'violet';
|
|
66
|
+
/** An accent: four values, in light and in dark. */
|
|
67
|
+
export interface LoopAccent {
|
|
68
|
+
/** The accent itself: a bubble, a send button. The same in both modes. */
|
|
69
|
+
accent: string;
|
|
70
|
+
/** The text that sits on the accent. */
|
|
71
|
+
on: string;
|
|
72
|
+
/** The stage behind an application. */
|
|
73
|
+
stage: {
|
|
74
|
+
light: string;
|
|
75
|
+
dark: string;
|
|
76
|
+
};
|
|
77
|
+
/** A quiet tint: a draft, something waiting. */
|
|
78
|
+
quiet: {
|
|
79
|
+
light: string;
|
|
80
|
+
dark: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** The six accents. One per application; everything else is neutral. */
|
|
84
|
+
export declare const loopAccents: Record<LoopAccentName, LoopAccent>;
|
|
85
|
+
/** The names of the accents, in the order a picker shows them. */
|
|
86
|
+
export declare const loopAccentNames: LoopAccentName[];
|
|
87
|
+
/**
|
|
88
|
+
* An accent as CSS custom properties, for a color mode: what an
|
|
89
|
+
* application sets on its root to take its colour.
|
|
90
|
+
*/
|
|
91
|
+
export declare function loopAccentVars(name: LoopAccentName, mode?: 'light' | 'dark'): Record<string, string>;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Loop Color System – one accent, neutral everything else.
|
|
7
|
+
*
|
|
8
|
+
* The look of an application built in LOOP: a white (or near-black)
|
|
9
|
+
* canvas, near-black (or near-white) text, hairlines instead of borders,
|
|
10
|
+
* and a single soft accent that dark text sits on. Nothing else carries
|
|
11
|
+
* colour, apart from the three colours of a verdict.
|
|
12
|
+
*
|
|
13
|
+
* The accent of the theme itself is green — a lighter relative of
|
|
14
|
+
* Datalayer's brand green. An application may take one of five others
|
|
15
|
+
* (`loopAccents`); each is four values: the accent, the text that sits on
|
|
16
|
+
* it, the tint of the stage behind an application, and a quiet tint.
|
|
17
|
+
* Dark text on every accent: the lowest contrast of the six is 8.8 to 1.
|
|
18
|
+
*/
|
|
19
|
+
export const loopColors = {
|
|
20
|
+
// Core neutrals
|
|
21
|
+
black: '#131314', // Near-black — primary dark background
|
|
22
|
+
gray: '#6A6A66', // Neutral gray, faintly warm — secondary text
|
|
23
|
+
white: '#FFFFFF', // White — primary light background
|
|
24
|
+
// Neutral surfaces and ink
|
|
25
|
+
ink: '#111111', // Text on light
|
|
26
|
+
inkDark: '#F3F3F1', // Text on dark
|
|
27
|
+
subtle: '#F5F5F3', // Subtle surface on light (a bubble, a chip)
|
|
28
|
+
subtleDark: '#1E1E20', // Subtle surface on dark
|
|
29
|
+
grayDark: '#A1A19C', // Secondary text on dark
|
|
30
|
+
// Loop palette (Brand) — green
|
|
31
|
+
loopBrand: '#7ADBB8', // The accent — a bubble, a send button, a swatch
|
|
32
|
+
loopOn: '#06281E', // Text that sits on the accent
|
|
33
|
+
loopAccent: '#4FC79C', // Deeper accent — charts, highlights
|
|
34
|
+
loopText: '#0F6B4F', // Accessible accent text & links on white (AA+)
|
|
35
|
+
loopTint: '#F0FAF6', // Quiet tint — a draft, a callout
|
|
36
|
+
loopStage: '#DDF5EC', // The stage behind an application
|
|
37
|
+
loopBright: '#8FE5C6', // Accent text & links on dark
|
|
38
|
+
loopHover: '#0A5640', // Accent text hover
|
|
39
|
+
// The stage and the quiet tint, on dark
|
|
40
|
+
loopStageDark: '#10261F',
|
|
41
|
+
loopTintDark: '#17211D',
|
|
42
|
+
// Semantic roles — kept for verdicts and rules only
|
|
43
|
+
successBrand: '#1F8A5B',
|
|
44
|
+
successAccent: '#58C797',
|
|
45
|
+
successTint: '#E4F5EC',
|
|
46
|
+
attentionBrand: '#A66A12',
|
|
47
|
+
attentionAccent: '#E0A54A',
|
|
48
|
+
attentionTint: '#FBF0DC',
|
|
49
|
+
dangerBrand: '#BF3F38',
|
|
50
|
+
dangerAccent: '#F08A83',
|
|
51
|
+
dangerTint: '#FBE7E5',
|
|
52
|
+
severeBrand: '#B4571A',
|
|
53
|
+
severeAccent: '#E8935A',
|
|
54
|
+
severeTint: '#FBEADD',
|
|
55
|
+
doneBrand: '#6B53C9',
|
|
56
|
+
doneAccent: '#C0AEF6',
|
|
57
|
+
doneTint: '#F6F3FE',
|
|
58
|
+
// Bright colours for SVG illustrations — the six accents themselves
|
|
59
|
+
brightGlow: '#7ADBB8', // Green — the accent
|
|
60
|
+
brightPop: '#8CCBF9', // Sky
|
|
61
|
+
brightSpark: '#BEDC55', // Lime
|
|
62
|
+
brightBlaze: '#F6A5C1', // Rose
|
|
63
|
+
brightSurge: '#C0AEF6', // Violet
|
|
64
|
+
brightFlame: '#F4A261', // Soft orange
|
|
65
|
+
brightGold: '#F8D469', // Sun
|
|
66
|
+
// The same, deeper, for light backgrounds
|
|
67
|
+
brightLightGlow: '#0F6B4F', // Deep green
|
|
68
|
+
brightLightPop: '#1F6FB0', // Deep sky
|
|
69
|
+
brightLightSpark: '#5F7A00', // Deep lime
|
|
70
|
+
brightLightBlaze: '#B83A6B', // Deep rose
|
|
71
|
+
brightLightSurge: '#6B53C9', // Deep violet
|
|
72
|
+
brightLightFlame: '#B4571A', // Deep orange
|
|
73
|
+
brightLightGold: '#8A6A00', // Deep sun
|
|
74
|
+
};
|
|
75
|
+
/** The six accents. One per application; everything else is neutral. */
|
|
76
|
+
export const loopAccents = {
|
|
77
|
+
green: {
|
|
78
|
+
accent: '#7ADBB8',
|
|
79
|
+
on: '#06281E',
|
|
80
|
+
stage: { light: '#DDF5EC', dark: '#10261F' },
|
|
81
|
+
quiet: { light: '#F0FAF6', dark: '#17211D' },
|
|
82
|
+
},
|
|
83
|
+
rose: {
|
|
84
|
+
accent: '#F6A5C1',
|
|
85
|
+
on: '#3A0A1C',
|
|
86
|
+
stage: { light: '#FCE3EC', dark: '#2B141C' },
|
|
87
|
+
quiet: { light: '#FDF2F6', dark: '#22181C' },
|
|
88
|
+
},
|
|
89
|
+
sky: {
|
|
90
|
+
accent: '#8CCBF9',
|
|
91
|
+
on: '#06243B',
|
|
92
|
+
stage: { light: '#DFF0FD', dark: '#0F2333' },
|
|
93
|
+
quiet: { light: '#F0F8FE', dark: '#161E25' },
|
|
94
|
+
},
|
|
95
|
+
lime: {
|
|
96
|
+
accent: '#BEDC55',
|
|
97
|
+
on: '#1F2A00',
|
|
98
|
+
stage: { light: '#EEF6CC', dark: '#1E2609' },
|
|
99
|
+
quiet: { light: '#F7FBE6', dark: '#1C2014' },
|
|
100
|
+
},
|
|
101
|
+
sun: {
|
|
102
|
+
accent: '#F8D469',
|
|
103
|
+
on: '#2E2200',
|
|
104
|
+
stage: { light: '#FDF3CD', dark: '#2A2209' },
|
|
105
|
+
quiet: { light: '#FEF9E7', dark: '#221F14' },
|
|
106
|
+
},
|
|
107
|
+
violet: {
|
|
108
|
+
accent: '#C0AEF6',
|
|
109
|
+
on: '#1C0F47',
|
|
110
|
+
stage: { light: '#ECE7FD', dark: '#1B1533' },
|
|
111
|
+
quiet: { light: '#F6F3FE', dark: '#1C1A27' },
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
/** The names of the accents, in the order a picker shows them. */
|
|
115
|
+
export const loopAccentNames = ['green', 'rose', 'sky', 'lime', 'sun', 'violet'];
|
|
116
|
+
/**
|
|
117
|
+
* An accent as CSS custom properties, for a color mode: what an
|
|
118
|
+
* application sets on its root to take its colour.
|
|
119
|
+
*/
|
|
120
|
+
export function loopAccentVars(name, mode = 'light') {
|
|
121
|
+
const accent = loopAccents[name] ?? loopAccents.green;
|
|
122
|
+
return {
|
|
123
|
+
'--loop-accent': accent.accent,
|
|
124
|
+
'--loop-accent-on': accent.on,
|
|
125
|
+
'--loop-stage': accent.stage[mode],
|
|
126
|
+
'--loop-quiet': accent.quiet[mode],
|
|
127
|
+
};
|
|
128
|
+
}
|
|
@@ -168,6 +168,34 @@ export interface ThemeStyles {
|
|
|
168
168
|
* `Blankslate`) picks up the themed font instead of the
|
|
169
169
|
* hard-coded system-font fallback.
|
|
170
170
|
*/
|
|
171
|
+
/**
|
|
172
|
+
* The shape of a theme (LOOP T-03): the radii of a control, a card, a bubble
|
|
173
|
+
* and a frame; the hairline; at most one level of shadow. As custom
|
|
174
|
+
* properties every theme sets — `--theme-radius-control` and the rest — so
|
|
175
|
+
* that a component reads its shape the way it reads its colour.
|
|
176
|
+
*/
|
|
177
|
+
export interface ThemeShape {
|
|
178
|
+
radiusControl: string;
|
|
179
|
+
radiusCard: string;
|
|
180
|
+
radiusBubble: string;
|
|
181
|
+
radiusFrame: string;
|
|
182
|
+
hairline: string;
|
|
183
|
+
shadow: string;
|
|
184
|
+
}
|
|
185
|
+
/** Today's shape, which every theme has unless it says otherwise. */
|
|
186
|
+
export declare const DEFAULT_THEME_SHAPE: ThemeShape;
|
|
187
|
+
/** A shape as custom properties. */
|
|
188
|
+
export declare function shapeVars(shape?: Partial<ThemeShape>): Record<string, string>;
|
|
171
189
|
export declare function buildThemeStyles(light: ThemeColorDefs, dark: ThemeColorDefs, options?: {
|
|
172
190
|
fontFamily?: string;
|
|
191
|
+
/** Its shape (T-03); today's, for what it does not say. */
|
|
192
|
+
shape?: Partial<ThemeShape>;
|
|
193
|
+
/**
|
|
194
|
+
* More custom properties, per mode, set after everything else: what a
|
|
195
|
+
* theme sets beside colour and font — its radii, its own tokens.
|
|
196
|
+
*/
|
|
197
|
+
variables?: {
|
|
198
|
+
light?: Record<string, string>;
|
|
199
|
+
dark?: Record<string, string>;
|
|
200
|
+
};
|
|
173
201
|
}): ThemeStyles;
|
|
@@ -246,18 +246,27 @@ export function colorDefsToCSS(defs, mode = 'light') {
|
|
|
246
246
|
'--datalayer-icon-fg': defs.accent.fg,
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
249
|
+
/** Today's shape, which every theme has unless it says otherwise. */
|
|
250
|
+
export const DEFAULT_THEME_SHAPE = {
|
|
251
|
+
radiusControl: 'var(--borderRadius-medium, 6px)',
|
|
252
|
+
radiusCard: 'var(--borderRadius-medium, 6px)',
|
|
253
|
+
radiusBubble: 'var(--borderRadius-large, 12px)',
|
|
254
|
+
radiusFrame: 'var(--borderRadius-large, 12px)',
|
|
255
|
+
hairline: 'var(--borderWidth-thin, 1px)',
|
|
256
|
+
shadow: 'var(--shadow-resting-small, none)',
|
|
257
|
+
};
|
|
258
|
+
/** A shape as custom properties. */
|
|
259
|
+
export function shapeVars(shape = {}) {
|
|
260
|
+
const full = { ...DEFAULT_THEME_SHAPE, ...shape };
|
|
261
|
+
return {
|
|
262
|
+
'--theme-radius-control': full.radiusControl,
|
|
263
|
+
'--theme-radius-card': full.radiusCard,
|
|
264
|
+
'--theme-radius-bubble': full.radiusBubble,
|
|
265
|
+
'--theme-radius-frame': full.radiusFrame,
|
|
266
|
+
'--theme-hairline': full.hairline,
|
|
267
|
+
'--theme-shadow': full.shadow,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
261
270
|
export function buildThemeStyles(light, dark, options) {
|
|
262
271
|
const fontVars = {};
|
|
263
272
|
if (options?.fontFamily) {
|
|
@@ -290,6 +299,8 @@ export function buildThemeStyles(light, dark, options) {
|
|
|
290
299
|
...(options?.fontFamily ? { fontFamily: options.fontFamily } : {}),
|
|
291
300
|
...colorDefsToCSS(light, 'light'),
|
|
292
301
|
...fontVars,
|
|
302
|
+
...shapeVars(options?.shape),
|
|
303
|
+
...(options?.variables?.light ?? {}),
|
|
293
304
|
},
|
|
294
305
|
dark: {
|
|
295
306
|
backgroundColor: dark.canvas.default,
|
|
@@ -298,6 +309,8 @@ export function buildThemeStyles(light, dark, options) {
|
|
|
298
309
|
...(options?.fontFamily ? { fontFamily: options.fontFamily } : {}),
|
|
299
310
|
...colorDefsToCSS(dark, 'dark'),
|
|
300
311
|
...fontVars,
|
|
312
|
+
...shapeVars(options?.shape),
|
|
313
|
+
...(options?.variables?.dark ?? {}),
|
|
301
314
|
},
|
|
302
315
|
};
|
|
303
316
|
}
|
package/lib/theme/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './themes/earthTheme';
|
|
|
11
11
|
export * from './themes/sandTheme';
|
|
12
12
|
export * from './themes/ivoryTheme';
|
|
13
13
|
export * from './themes/sunTheme';
|
|
14
|
+
export * from './themes/loopTheme';
|
|
14
15
|
export * from './themes-brand/spatialBrandTheme';
|
|
15
16
|
export * from './themeRegistry';
|
|
16
17
|
export * from './portableTheme';
|
package/lib/theme/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './themes/earthTheme';
|
|
|
15
15
|
export * from './themes/sandTheme';
|
|
16
16
|
export * from './themes/ivoryTheme';
|
|
17
17
|
export * from './themes/sunTheme';
|
|
18
|
+
export * from './themes/loopTheme';
|
|
18
19
|
export * from './themes-brand/spatialBrandTheme';
|
|
19
20
|
export * from './themeRegistry';
|
|
20
21
|
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, } from '../colors';
|
|
10
|
+
import { datalayerColors, spatialColors, lovelyColors, matrixColors, earthColors, sandColors, ivoryColors, sunColors, loopColors, } from '../colors';
|
|
11
11
|
import { getBrightPalette, } from '../themeRegistry';
|
|
12
12
|
import { useThemeStore } from '../useThemeStore';
|
|
13
13
|
const dlBrightDark = getBrightPalette('datalayer');
|
|
@@ -26,6 +26,8 @@ const ivBrightDark = getBrightPalette('ivory');
|
|
|
26
26
|
const ivBrightLight = getBrightPalette('ivory', 'light');
|
|
27
27
|
const suBrightDark = getBrightPalette('sun');
|
|
28
28
|
const suBrightLight = getBrightPalette('sun', 'light');
|
|
29
|
+
const loBrightDark = getBrightPalette('loop');
|
|
30
|
+
const loBrightLight = getBrightPalette('loop', 'light');
|
|
29
31
|
const palettes = {
|
|
30
32
|
datalayer: {
|
|
31
33
|
light: {
|
|
@@ -331,6 +333,44 @@ const palettes = {
|
|
|
331
333
|
isLight: false,
|
|
332
334
|
},
|
|
333
335
|
},
|
|
336
|
+
loop: {
|
|
337
|
+
light: {
|
|
338
|
+
bg: loopColors.white,
|
|
339
|
+
bgPanel: '#ffffff',
|
|
340
|
+
bgAlt: loopColors.subtle,
|
|
341
|
+
primary: loopColors.loopBrand,
|
|
342
|
+
secondary: loopColors.loopText,
|
|
343
|
+
accent: loopColors.loopAccent,
|
|
344
|
+
glow: loBrightLight.glow,
|
|
345
|
+
pop: loBrightLight.pop,
|
|
346
|
+
spark: loBrightLight.spark,
|
|
347
|
+
blaze: loBrightLight.blaze,
|
|
348
|
+
surge: loBrightLight.surge,
|
|
349
|
+
flame: loBrightLight.flame,
|
|
350
|
+
gold: loBrightLight.gold,
|
|
351
|
+
textLight: loopColors.ink,
|
|
352
|
+
textMuted: loopColors.gray,
|
|
353
|
+
isLight: true,
|
|
354
|
+
},
|
|
355
|
+
dark: {
|
|
356
|
+
bg: loopColors.black,
|
|
357
|
+
bgPanel: '#19191B',
|
|
358
|
+
bgAlt: loopColors.subtleDark,
|
|
359
|
+
primary: loopColors.loopBrand,
|
|
360
|
+
secondary: loopColors.loopBright,
|
|
361
|
+
accent: loopColors.loopAccent,
|
|
362
|
+
glow: loBrightDark.glow,
|
|
363
|
+
pop: loBrightDark.pop,
|
|
364
|
+
spark: loBrightDark.spark,
|
|
365
|
+
blaze: loBrightDark.blaze,
|
|
366
|
+
surge: loBrightDark.surge,
|
|
367
|
+
flame: loBrightDark.flame,
|
|
368
|
+
gold: loBrightDark.gold,
|
|
369
|
+
textLight: loopColors.inkDark,
|
|
370
|
+
textMuted: loopColors.grayDark,
|
|
371
|
+
isLight: false,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
334
374
|
};
|
|
335
375
|
export function getColorPalette(theme = 'datalayer', colorMode = 'auto') {
|
|
336
376
|
const mode = colorMode === 'auto'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
2
|
import { type ColorMode } from './DatalayerBrandThemeProvider';
|
|
3
3
|
/** Available theme variants. */
|
|
4
|
-
export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth' | 'sand' | 'ivory' | 'sun';
|
|
4
|
+
export type ThemeVariant = 'datalayer' | 'spatial' | 'lovely' | 'matrix' | 'earth' | 'sand' | 'ivory' | 'sun' | 'loop';
|
|
5
5
|
/** A pair of colours for a two-stop gradient. */
|
|
6
6
|
export interface GradientPair {
|
|
7
7
|
/** Start colour (brighter / brand). */
|
|
@@ -10,6 +10,7 @@ import { earthTheme, earthThemeStyles } from './themes/earthTheme';
|
|
|
10
10
|
import { sandTheme, sandThemeStyles } from './themes/sandTheme';
|
|
11
11
|
import { ivoryTheme, ivoryThemeStyles } from './themes/ivoryTheme';
|
|
12
12
|
import { sunTheme, sunThemeStyles } from './themes/sunTheme';
|
|
13
|
+
import { loopTheme, loopThemeStyles } from './themes/loopTheme';
|
|
13
14
|
import { datalayerColors } from './colors/datalayerColors';
|
|
14
15
|
import { spatialColors } from './colors/spatialColors';
|
|
15
16
|
import { lovelyColors } from './colors/lovelyColors';
|
|
@@ -18,6 +19,7 @@ import { earthColors } from './colors/earthColors';
|
|
|
18
19
|
import { sandColors } from './colors/sandColors';
|
|
19
20
|
import { ivoryColors } from './colors/ivoryColors';
|
|
20
21
|
import { sunColors } from './colors/sunColors';
|
|
22
|
+
import { loopColors } from './colors/loopColors';
|
|
21
23
|
/* ─── Registry ────────────────────────────────────────────────────────── */
|
|
22
24
|
export const themeConfigs = {
|
|
23
25
|
datalayer: {
|
|
@@ -276,9 +278,42 @@ export const themeConfigs = {
|
|
|
276
278
|
gold: sunColors.brightLightGold, // #8A6E00 — deep gold
|
|
277
279
|
},
|
|
278
280
|
},
|
|
281
|
+
loop: {
|
|
282
|
+
label: 'Loop',
|
|
283
|
+
description: 'Very clean: one soft accent, neutral everything else. The look of an application built in LOOP.',
|
|
284
|
+
brandColor: loopColors.loopBrand,
|
|
285
|
+
defaultColorMode: 'light',
|
|
286
|
+
primerTheme: loopTheme,
|
|
287
|
+
themeStyles: loopThemeStyles,
|
|
288
|
+
// The theme has no gradient on a surface: both stops are the accent.
|
|
289
|
+
cardGradient: {
|
|
290
|
+
light: { from: loopColors.loopBrand, to: loopColors.loopBrand }, // #7ADBB8, flat
|
|
291
|
+
dark: { from: loopColors.loopBrand, to: loopColors.loopBrand }, // #7ADBB8, flat
|
|
292
|
+
},
|
|
293
|
+
brightPalette: {
|
|
294
|
+
glow: loopColors.brightGlow, // #7ADBB8 — green, the accent
|
|
295
|
+
onGlow: loopColors.loopOn, // dark text on the accent
|
|
296
|
+
pop: loopColors.brightPop, // #8CCBF9 — sky
|
|
297
|
+
spark: loopColors.brightSpark, // #BEDC55 — lime
|
|
298
|
+
blaze: loopColors.brightBlaze, // #F6A5C1 — rose
|
|
299
|
+
surge: loopColors.brightSurge, // #C0AEF6 — violet
|
|
300
|
+
flame: loopColors.brightFlame, // #F4A261 — soft orange
|
|
301
|
+
gold: loopColors.brightGold, // #F8D469 — sun
|
|
302
|
+
},
|
|
303
|
+
brightPaletteLight: {
|
|
304
|
+
glow: loopColors.brightLightGlow, // #0F6B4F — deep green
|
|
305
|
+
onGlow: '#ffffff', // white text on deep green
|
|
306
|
+
pop: loopColors.brightLightPop, // #1F6FB0 — deep sky
|
|
307
|
+
spark: loopColors.brightLightSpark, // #5F7A00 — deep lime
|
|
308
|
+
blaze: loopColors.brightLightBlaze, // #B83A6B — deep rose
|
|
309
|
+
surge: loopColors.brightLightSurge, // #6B53C9 — deep violet
|
|
310
|
+
flame: loopColors.brightLightFlame, // #B4571A — deep orange
|
|
311
|
+
gold: loopColors.brightLightGold, // #8A6A00 — deep sun
|
|
312
|
+
},
|
|
313
|
+
},
|
|
279
314
|
};
|
|
280
315
|
/** All available theme variants in display order. */
|
|
281
|
-
export const themeVariants = ['datalayer', 'spatial', 'lovely', 'matrix', 'earth', 'sand', 'ivory', 'sun'];
|
|
316
|
+
export const themeVariants = ['datalayer', 'spatial', 'lovely', 'matrix', 'earth', 'sand', 'ivory', 'sun', 'loop'];
|
|
282
317
|
/** Look up a theme config by variant name. */
|
|
283
318
|
export function getThemeConfig(variant) {
|
|
284
319
|
return themeConfigs[variant];
|
|
@@ -463,6 +498,22 @@ const avatarColorPalettes = {
|
|
|
463
498
|
sunColors.brightSurge, // #4FB0C6 — sky blue
|
|
464
499
|
],
|
|
465
500
|
},
|
|
501
|
+
loop: {
|
|
502
|
+
light: [
|
|
503
|
+
loopColors.brightLightGlow, // #0F6B4F — deep green
|
|
504
|
+
loopColors.brightLightPop, // #1F6FB0 — deep sky
|
|
505
|
+
loopColors.brightLightBlaze, // #B83A6B — deep rose
|
|
506
|
+
loopColors.brightLightSurge, // #6B53C9 — deep violet
|
|
507
|
+
loopColors.gray, // #6A6A66 — neutral gray
|
|
508
|
+
],
|
|
509
|
+
dark: [
|
|
510
|
+
loopColors.loopBrand, // #7ADBB8 — green
|
|
511
|
+
loopColors.brightPop, // #8CCBF9 — sky
|
|
512
|
+
loopColors.brightBlaze, // #F6A5C1 — rose
|
|
513
|
+
loopColors.brightSurge, // #C0AEF6 — violet
|
|
514
|
+
loopColors.brightGold, // #F8D469 — sun
|
|
515
|
+
],
|
|
516
|
+
},
|
|
466
517
|
};
|
|
467
518
|
/**
|
|
468
519
|
* Get a 5-colour avatar palette for the given theme variant and colour mode.
|