@datalayer/primer-addons 1.0.53 → 1.0.54
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 +32 -32
- package/lib/components/appearance/AppearanceControls.js +1 -1
- package/lib/components/appearance/AppearanceMenu.stories.d.ts +1 -1
- package/lib/components/appearance/AppearanceMenu.stories.js +2 -2
- package/lib/components/appearance/CollaboratorPalette.stories.d.ts +1 -1
- package/lib/components/appearance/CollaboratorPalette.stories.js +2 -2
- package/lib/components/appearance/ColorModeCircle.js +1 -1
- package/lib/components/appearance/ThemeCircle.stories.js +1 -1
- package/lib/components/appearance/ThemePreviewCard.js +1 -1
- package/lib/components/appearance/ThemePreviewCard.stories.d.ts +1 -1
- package/lib/components/appearance/ThemePreviewCard.stories.js +1 -1
- package/lib/components/box/Box.d.ts +3 -3
- package/lib/components/box/Box.js +3 -3
- package/lib/components/box/Box.stories.d.ts +1 -1
- package/lib/components/box/Box.stories.js +1 -1
- package/lib/components/box/boxTokens.d.ts +2 -2
- package/lib/components/box/boxTokens.js +2 -2
- package/lib/components/calendar-picker/CalendarPicker.js +1 -1
- package/lib/components/card/Card.js +1 -1
- package/lib/components/color/ColorSwatch.js +1 -1
- package/lib/components/entity-avatar/EntityAvatar.d.ts +1 -1
- package/lib/components/entity-avatar/EntityAvatar.js +1 -1
- package/lib/components/hover-card/HoverCard.d.ts +1 -1
- package/lib/components/logo/DatalayerLogo.js +12 -12
- package/lib/components/logo/DatalayerLogo.stories.js +1 -1
- package/lib/components/sheet/Sheet.d.ts +1 -1
- package/lib/components/sheet/Sheet.js +1 -1
- package/lib/components/toolbar/ToolbarButton.js +1 -1
- package/lib/reactor/ThemePlugin.js +1 -1
- package/lib/reactor/index.d.ts +1 -1
- package/lib/reactor/index.js +1 -1
- package/lib/reactor/page-layout/PageLayout.d.ts +2 -2
- package/lib/reactor/page-layout/PageLayout.js +3 -3
- package/lib/reactor/page-layout/PageLayoutPlugin.js +2 -2
- package/lib/theme/DatalayerThemeProvider.js +1 -1
- package/lib/theme/{loopEyes.d.ts → agentEyes.d.ts} +3 -3
- package/lib/theme/{loopEyes.js → agentEyes.js} +3 -3
- package/lib/theme/colors/{loopColors.d.ts → agentColors.d.ts} +15 -15
- package/lib/theme/colors/{loopColors.js → agentColors.js} +16 -16
- package/lib/theme/colors/hueColors.d.ts +1 -1
- package/lib/theme/colors/hueColors.js +2 -2
- package/lib/theme/colors/index.d.ts +1 -1
- package/lib/theme/colors/index.js +3 -3
- package/lib/theme/colors/metalColors.d.ts +12 -12
- package/lib/theme/colors/metalColors.js +6 -6
- package/lib/theme/colors/themeAccents.d.ts +5 -6
- package/lib/theme/colors/themeAccents.js +4 -5
- package/lib/theme/css/createThemeCSSVars.d.ts +5 -5
- package/lib/theme/css/primerBaseVars.js +1 -1
- package/lib/theme/index.d.ts +2 -2
- package/lib/theme/index.js +2 -2
- package/lib/theme/palettes/ColorPalette.js +18 -18
- package/lib/theme/portable.d.ts +1 -1
- package/lib/theme/portable.js +1 -1
- package/lib/theme/themeRegistry.js +2 -2
- package/lib/theme/themeTokens.d.ts +1 -1
- package/lib/theme/themeTokens.js +38 -38
- package/lib/theme/themes/{loopTheme.d.ts → agentTheme.d.ts} +5 -5
- package/lib/theme/themes/{loopTheme.js → agentTheme.js} +11 -11
- package/lib/theme/themes/{loopThemeStyles.d.ts → agentThemeStyles.d.ts} +21 -21
- package/lib/theme/themes/{loopThemeStyles.js → agentThemeStyles.js} +175 -175
- package/lib/theme/themes/ivoryThemeStyles.d.ts +1 -1
- package/lib/theme/themes/ivoryThemeStyles.js +1 -1
- package/lib/theme/themes/metalThemeStyles.d.ts +1 -1
- package/lib/theme/themes/metalThemeStyles.js +25 -25
- package/lib/theme/themes/roundedShape.d.ts +2 -2
- package/lib/theme/themes/roundedShape.js +9 -9
- package/lib/theme/themes/sandThemeStyles.d.ts +1 -1
- package/lib/theme/themes/sandThemeStyles.js +1 -1
- package/lib/theme/themes/sunThemeStyles.d.ts +1 -1
- package/lib/theme/themes/sunThemeStyles.js +1 -1
- package/lib/theme/useThemeStore.d.ts +6 -0
- package/lib/theme/useThemeStore.js +29 -6
- package/lib/utils/Portals.d.ts +1 -1
- package/lib/utils/Portals.js +1 -1
- package/package.json +1 -1
- package/style/{loop-face.css → agent-face.css} +2 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Metal Theme for Primer React.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Agent's curves and motion, with a look of its own. On light, a page that is
|
|
9
9
|
* not white: a blue-grey wash and a dot grid, panels drawn by a pale steel
|
|
10
10
|
* line rather than floated on a shadow, outlined controls, a brushed filled
|
|
11
11
|
* button. On dark, the page is the surface: a deep mesh of sage, steel, mauve
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
import { metalColors } from '../colors/metalColors';
|
|
17
17
|
import { themeAccentTints } from '../colors/themeAccents';
|
|
18
18
|
import { buildThemeStyles } from '../css/createThemeCSSVars';
|
|
19
|
-
import {
|
|
19
|
+
import { agentDark, agentLight, agentMotionVars, agentShapeVars, agentTypeScale, agentTypeVars, } from './agentThemeStyles';
|
|
20
20
|
import { roundedShape } from './roundedShape';
|
|
21
21
|
/* ── Colour definitions ────────────────────────────────────────── */
|
|
22
22
|
export const metalLight = {
|
|
23
|
-
...
|
|
23
|
+
...agentLight,
|
|
24
24
|
canvas: {
|
|
25
25
|
default: metalColors.white,
|
|
26
26
|
subtle: metalColors.subtle,
|
|
@@ -41,7 +41,7 @@ export const metalLight = {
|
|
|
41
41
|
muted: metalColors.lineMuted,
|
|
42
42
|
},
|
|
43
43
|
btn: {
|
|
44
|
-
...
|
|
44
|
+
...agentLight.btn,
|
|
45
45
|
text: metalColors.ink,
|
|
46
46
|
// Outlined, not filled: a control is drawn as a panel is.
|
|
47
47
|
bg: '#FFFFFF',
|
|
@@ -52,7 +52,7 @@ export const metalLight = {
|
|
|
52
52
|
selectedBg: '#E3E9F2',
|
|
53
53
|
counterBg: 'rgba(34, 38, 43, 0.08)',
|
|
54
54
|
primary: {
|
|
55
|
-
...
|
|
55
|
+
...agentLight.btn.primary,
|
|
56
56
|
text: metalColors.metalOn,
|
|
57
57
|
bg: metalColors.metalBrand,
|
|
58
58
|
border: metalColors.metalBrand,
|
|
@@ -66,7 +66,7 @@ export const metalLight = {
|
|
|
66
66
|
counterBg: 'rgba(255, 255, 255, 0.2)',
|
|
67
67
|
},
|
|
68
68
|
outline: {
|
|
69
|
-
...
|
|
69
|
+
...agentLight.btn.outline,
|
|
70
70
|
text: metalColors.metalText,
|
|
71
71
|
hoverText: metalColors.metalOn,
|
|
72
72
|
hoverBg: metalColors.metalBrand,
|
|
@@ -84,7 +84,7 @@ export const metalLight = {
|
|
|
84
84
|
},
|
|
85
85
|
};
|
|
86
86
|
export const metalDark = {
|
|
87
|
-
...
|
|
87
|
+
...agentDark,
|
|
88
88
|
// Solid stand-ins for the page behind the glass, which the checks read;
|
|
89
89
|
// what is painted is `metalVariables` and the mesh.
|
|
90
90
|
canvas: {
|
|
@@ -108,7 +108,7 @@ export const metalDark = {
|
|
|
108
108
|
muted: metalColors.lineMutedDark,
|
|
109
109
|
},
|
|
110
110
|
btn: {
|
|
111
|
-
...
|
|
111
|
+
...agentDark.btn,
|
|
112
112
|
text: metalColors.inkDark,
|
|
113
113
|
bg: 'rgba(255, 255, 255, 0.10)',
|
|
114
114
|
border: 'rgba(255, 255, 255, 0.22)',
|
|
@@ -119,7 +119,7 @@ export const metalDark = {
|
|
|
119
119
|
counterBg: 'rgba(238, 242, 247, 0.12)',
|
|
120
120
|
// White on the mesh, the brightest thing on the page.
|
|
121
121
|
primary: {
|
|
122
|
-
...
|
|
122
|
+
...agentDark.btn.primary,
|
|
123
123
|
text: metalColors.metalOnDark,
|
|
124
124
|
bg: metalColors.white,
|
|
125
125
|
border: metalColors.white,
|
|
@@ -133,7 +133,7 @@ export const metalDark = {
|
|
|
133
133
|
counterBg: 'rgba(11, 26, 48, 0.12)',
|
|
134
134
|
},
|
|
135
135
|
outline: {
|
|
136
|
-
...
|
|
136
|
+
...agentDark.btn.outline,
|
|
137
137
|
text: metalColors.metalBright,
|
|
138
138
|
hoverText: metalColors.metalOnDark,
|
|
139
139
|
hoverBg: metalColors.metalBright,
|
|
@@ -156,12 +156,12 @@ export const metalFontFamily = '"Geist Variable", ui-sans-serif, system-ui, -app
|
|
|
156
156
|
export const metalMonoFamily = '"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace';
|
|
157
157
|
/** The two weights: titles stay regular, what must stand out is 500. */
|
|
158
158
|
export const metalFontWeights = { regular: 400, medium: 500 };
|
|
159
|
-
/**
|
|
159
|
+
/** Agent's sizes, in Metal's weights: a title is large and light, never bold. */
|
|
160
160
|
const metalTypeVars = () => {
|
|
161
161
|
const { regular, medium } = metalFontWeights;
|
|
162
|
-
const { display, title, heading } =
|
|
162
|
+
const { display, title, heading } = agentTypeScale;
|
|
163
163
|
return {
|
|
164
|
-
...
|
|
164
|
+
...agentTypeVars(metalFontFamily),
|
|
165
165
|
'--base-text-weight-medium': String(medium),
|
|
166
166
|
'--base-text-weight-semibold': String(medium),
|
|
167
167
|
'--text-display-weight': String(regular),
|
|
@@ -169,8 +169,8 @@ const metalTypeVars = () => {
|
|
|
169
169
|
'--text-title-shorthand-large': `${regular} ${display.size}/${display.lineHeight} ${metalFontFamily}`,
|
|
170
170
|
'--text-title-shorthand-medium': `${regular} ${title.size}/${title.lineHeight} ${metalFontFamily}`,
|
|
171
171
|
'--text-title-shorthand-small': `${medium} ${heading.size}/${heading.lineHeight} ${metalFontFamily}`,
|
|
172
|
-
'--
|
|
173
|
-
'--
|
|
172
|
+
'--agent-tracking-display': '-0.03em',
|
|
173
|
+
'--agent-tracking-title': '-0.02em',
|
|
174
174
|
'--fontStack-monospace': metalMonoFamily,
|
|
175
175
|
};
|
|
176
176
|
};
|
|
@@ -235,7 +235,7 @@ const metalPainted = {
|
|
|
235
235
|
/** A panel lies on the page: a line and nothing under it, a menu alone floats. */
|
|
236
236
|
export const metalShadows = {
|
|
237
237
|
light: {
|
|
238
|
-
'--
|
|
238
|
+
'--agent-shadow-frame': 'none',
|
|
239
239
|
'--theme-shadow': 'none',
|
|
240
240
|
'--shadow-resting-xsmall': 'none',
|
|
241
241
|
'--shadow-resting-small': 'none',
|
|
@@ -246,7 +246,7 @@ export const metalShadows = {
|
|
|
246
246
|
'--shadow-floating-xlarge': '0 0 0 1px rgba(76, 118, 186, 0.16), 0 24px 64px rgba(34, 52, 84, 0.14)',
|
|
247
247
|
},
|
|
248
248
|
dark: {
|
|
249
|
-
'--
|
|
249
|
+
'--agent-shadow-frame': 'none',
|
|
250
250
|
'--theme-shadow': 'none',
|
|
251
251
|
'--shadow-resting-xsmall': 'none',
|
|
252
252
|
'--shadow-resting-small': 'none',
|
|
@@ -265,15 +265,15 @@ const metalTints = (mode) => themeAccentTints({
|
|
|
265
265
|
quiet: mode === 'light' ? metalColors.metalTint : metalColors.metalTintDark,
|
|
266
266
|
});
|
|
267
267
|
const metalVariables = (mode) => ({
|
|
268
|
-
...
|
|
268
|
+
...agentShapeVars,
|
|
269
269
|
...metalTints(mode),
|
|
270
|
-
...
|
|
270
|
+
...agentMotionVars,
|
|
271
271
|
...metalShadows[mode],
|
|
272
272
|
...metalTypeVars(),
|
|
273
273
|
...metalSurfaceVars,
|
|
274
274
|
...metalPainted[mode],
|
|
275
275
|
'--metal-page': metalPage[mode],
|
|
276
|
-
'--
|
|
276
|
+
'--agent-hairline': metalHairline[mode],
|
|
277
277
|
'--borderColor-default': metalHairline[mode],
|
|
278
278
|
'--borderColor-muted': metalHairline[mode],
|
|
279
279
|
'--focus-outlineColor': metalFocusRing[mode],
|
|
@@ -319,17 +319,17 @@ const metalOwnCss = `
|
|
|
319
319
|
}
|
|
320
320
|
`;
|
|
321
321
|
/* ── Exports ───────────────────────────────────────────────────── */
|
|
322
|
-
/** Comprehensive Primer CSS-variable overrides for light & dark mode:
|
|
322
|
+
/** Comprehensive Primer CSS-variable overrides for light & dark mode: Agent's curves, Metal's look. */
|
|
323
323
|
export const metalThemeStyles = buildThemeStyles(metalLight, metalDark, {
|
|
324
324
|
fontFamily: metalFontFamily,
|
|
325
325
|
css: metalOwnCss,
|
|
326
326
|
shape: {
|
|
327
327
|
...roundedShape,
|
|
328
328
|
shadow: 'none',
|
|
329
|
-
motionStatus:
|
|
330
|
-
motionMessage:
|
|
331
|
-
motionPane:
|
|
332
|
-
motionEasing:
|
|
329
|
+
motionStatus: agentMotionVars['--agent-motion-status'],
|
|
330
|
+
motionMessage: agentMotionVars['--agent-motion-message'],
|
|
331
|
+
motionPane: agentMotionVars['--agent-motion-pane'],
|
|
332
|
+
motionEasing: agentMotionVars['--agent-motion-easing'],
|
|
333
333
|
messageLink: 'currentColor',
|
|
334
334
|
},
|
|
335
335
|
variables: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The rounded shape:
|
|
2
|
+
* The rounded shape: Agent's corners, which Metal, Sand, Ivory and Sun share.
|
|
3
3
|
*
|
|
4
4
|
* Primer's own radii made rounder (a list item, a card, a menu take them),
|
|
5
|
-
* the `--
|
|
5
|
+
* the `--agent-radius-*` properties an application is drawn with, and the
|
|
6
6
|
* theme shape that says so: a pill for every single-line control (a button,
|
|
7
7
|
* an icon button, a text input, a select, a segmented control), soft cards
|
|
8
8
|
* and overlays, round bubbles, a table with the corners of a list item.
|
|
@@ -8,17 +8,17 @@ export const roundedRadiusVars = {
|
|
|
8
8
|
'--borderRadius-medium': '14px',
|
|
9
9
|
'--borderRadius-large': '20px',
|
|
10
10
|
'--borderRadius-default': '14px',
|
|
11
|
-
'--
|
|
12
|
-
'--
|
|
13
|
-
'--
|
|
14
|
-
'--
|
|
11
|
+
'--agent-radius-control': '999px',
|
|
12
|
+
'--agent-radius-card': '20px',
|
|
13
|
+
'--agent-radius-bubble': '22px',
|
|
14
|
+
'--agent-radius-frame': '28px',
|
|
15
15
|
};
|
|
16
16
|
/** The radii of the theme shape (`--theme-radius-*`). */
|
|
17
17
|
export const roundedShape = {
|
|
18
|
-
radiusControl: roundedRadiusVars['--
|
|
18
|
+
radiusControl: roundedRadiusVars['--agent-radius-control'],
|
|
19
19
|
radiusTable: roundedRadiusVars['--borderRadius-medium'],
|
|
20
|
-
radiusOverlay: roundedRadiusVars['--
|
|
21
|
-
radiusCard: roundedRadiusVars['--
|
|
22
|
-
radiusBubble: roundedRadiusVars['--
|
|
23
|
-
radiusFrame: roundedRadiusVars['--
|
|
20
|
+
radiusOverlay: roundedRadiusVars['--agent-radius-card'],
|
|
21
|
+
radiusCard: roundedRadiusVars['--agent-radius-card'],
|
|
22
|
+
radiusBubble: roundedRadiusVars['--agent-radius-bubble'],
|
|
23
|
+
radiusFrame: roundedRadiusVars['--agent-radius-frame'],
|
|
24
24
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
3
|
-
* the rounded shape:
|
|
3
|
+
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
4
4
|
*/
|
|
5
5
|
export declare const sandThemeStyles: import("../css/createThemeCSSVars").ThemeStyles;
|
|
@@ -243,7 +243,7 @@ const sandDark = {
|
|
|
243
243
|
const sandFontFamily = 'Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Cambria, serif';
|
|
244
244
|
/**
|
|
245
245
|
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
246
|
-
* the rounded shape:
|
|
246
|
+
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
247
247
|
*/
|
|
248
248
|
export const sandThemeStyles = buildThemeStyles(sandLight, sandDark, {
|
|
249
249
|
fontFamily: sandFontFamily,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
3
|
-
* the rounded shape:
|
|
3
|
+
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
4
4
|
*/
|
|
5
5
|
export declare const sunThemeStyles: import("../css/createThemeCSSVars").ThemeStyles;
|
|
@@ -244,7 +244,7 @@ const sunDark = {
|
|
|
244
244
|
const sunFontFamily = '"Avenir Next", Avenir, "Segoe UI", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif';
|
|
245
245
|
/**
|
|
246
246
|
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
247
|
-
* the rounded shape:
|
|
247
|
+
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
248
248
|
*/
|
|
249
249
|
export const sunThemeStyles = buildThemeStyles(sunLight, sunDark, {
|
|
250
250
|
fontFamily: sunFontFamily,
|
|
@@ -29,6 +29,12 @@ export type VariantPreference = {
|
|
|
29
29
|
};
|
|
30
30
|
/** Per-variant theme + colorMode preferences. */
|
|
31
31
|
export type VariantDefaults = Record<string, VariantPreference>;
|
|
32
|
+
/**
|
|
33
|
+
* Themes renamed here, read under their new id when a store hydrates (the
|
|
34
|
+
* user, 22 November 2026: the 'loop' theme is the 'agent' theme): a person's
|
|
35
|
+
* choice follows the theme it named rather than falling back to the default.
|
|
36
|
+
*/
|
|
37
|
+
export declare const RENAMED_THEMES: Readonly<Record<string, ThemeVariant>>;
|
|
32
38
|
export interface ThemeState {
|
|
33
39
|
/** Current color mode (light, dark, or auto = follow OS). */
|
|
34
40
|
colorMode: ColorMode;
|
|
@@ -47,6 +47,25 @@ function normalizeVariants(variants) {
|
|
|
47
47
|
}
|
|
48
48
|
return normalized;
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* A stored theme the registry no longer has (a renamed theme: 'loop' became
|
|
52
|
+
* 'agent' on 22 November 2026) is not drawn: it would leave the page without
|
|
53
|
+
* a theme. The stored choice is dropped and the store's own default stands.
|
|
54
|
+
*/
|
|
55
|
+
function isKnownTheme(theme) {
|
|
56
|
+
return typeof theme === 'string' && Object.prototype.hasOwnProperty.call(themeConfigs, theme);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Themes renamed here, read under their new id when a store hydrates (the
|
|
60
|
+
* user, 22 November 2026: the 'loop' theme is the 'agent' theme): a person's
|
|
61
|
+
* choice follows the theme it named rather than falling back to the default.
|
|
62
|
+
*/
|
|
63
|
+
export const RENAMED_THEMES = {
|
|
64
|
+
loop: 'agent',
|
|
65
|
+
};
|
|
66
|
+
function renamedTheme(theme) {
|
|
67
|
+
return typeof theme === 'string' && theme in RENAMED_THEMES ? RENAMED_THEMES[theme] : theme;
|
|
68
|
+
}
|
|
50
69
|
function hasMissingVariantVersion(variants) {
|
|
51
70
|
if (!variants || Object.keys(variants).length === 0) {
|
|
52
71
|
return false;
|
|
@@ -180,7 +199,7 @@ export function createThemeStore(storageKey, defaults) {
|
|
|
180
199
|
// Legacy snapshots without per-variant versions are upgraded to v1.
|
|
181
200
|
// Anonymous defaults are forced to matrix/dark during this upgrade.
|
|
182
201
|
if (missingVariantVersion) {
|
|
183
|
-
variants['
|
|
202
|
+
variants['site-anonymous'] = {
|
|
184
203
|
theme: 'matrix',
|
|
185
204
|
colorMode: 'dark',
|
|
186
205
|
version: VARIANT_SCHEMA_VERSION,
|
|
@@ -191,8 +210,8 @@ export function createThemeStore(storageKey, defaults) {
|
|
|
191
210
|
variants,
|
|
192
211
|
...(missingVariantVersion
|
|
193
212
|
? {
|
|
194
|
-
theme: p.activeVariant === '
|
|
195
|
-
colorMode: p.activeVariant === '
|
|
213
|
+
theme: p.activeVariant === 'site-anonymous' ? 'matrix' : p.theme,
|
|
214
|
+
colorMode: p.activeVariant === 'site-anonymous' ? 'dark' : p.colorMode,
|
|
196
215
|
}
|
|
197
216
|
: {}),
|
|
198
217
|
};
|
|
@@ -211,14 +230,18 @@ export function createThemeStore(storageKey, defaults) {
|
|
|
211
230
|
const mergedVariants = normalizeVariants(current.variants);
|
|
212
231
|
if (p.variants) {
|
|
213
232
|
for (const [key, val] of Object.entries(p.variants)) {
|
|
214
|
-
|
|
215
|
-
|
|
233
|
+
const theme = val && typeof val === 'object' ? renamedTheme(val.theme) : undefined;
|
|
234
|
+
if (val && typeof val === 'object' && isKnownTheme(theme)) {
|
|
235
|
+
mergedVariants[key] = normalizeVariantPreference({ ...val, theme });
|
|
216
236
|
}
|
|
217
237
|
}
|
|
218
238
|
}
|
|
239
|
+
const { theme: stored, ...rest } = p;
|
|
240
|
+
const storedTheme = renamedTheme(stored);
|
|
219
241
|
return {
|
|
220
242
|
...current,
|
|
221
|
-
...
|
|
243
|
+
...rest,
|
|
244
|
+
...(isKnownTheme(storedTheme) ? { theme: storedTheme } : {}),
|
|
222
245
|
variants: mergedVariants,
|
|
223
246
|
};
|
|
224
247
|
},
|
package/lib/utils/Portals.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare const THEME_SCOPE_ATTRIBUTE = "data-datalayer-theme-scope";
|
|
|
36
36
|
/**
|
|
37
37
|
* The attribute an application puts on its own outer Primer `BaseStyles`
|
|
38
38
|
* when it wraps everything in Primer's provider above a Datalayer one: that
|
|
39
|
-
* element is the application's, not a host page's
|
|
39
|
+
* element is the application's, not a host page's, so the
|
|
40
40
|
* provider inside it still themes the page's portal root.
|
|
41
41
|
*/
|
|
42
42
|
export declare const APP_ROOT_ATTRIBUTE = "data-datalayer-app-root";
|
package/lib/utils/Portals.js
CHANGED
|
@@ -220,7 +220,7 @@ export const THEME_SCOPE_ATTRIBUTE = 'data-datalayer-theme-scope';
|
|
|
220
220
|
/**
|
|
221
221
|
* The attribute an application puts on its own outer Primer `BaseStyles`
|
|
222
222
|
* when it wraps everything in Primer's provider above a Datalayer one: that
|
|
223
|
-
* element is the application's, not a host page's
|
|
223
|
+
* element is the application's, not a host page's, so the
|
|
224
224
|
* provider inside it still themes the page's portal root.
|
|
225
225
|
*/
|
|
226
226
|
export const APP_ROOT_ATTRIBUTE = 'data-datalayer-app-root';
|
package/package.json
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
* The `
|
|
7
|
+
* The `agent` theme's face: Inter, open licence (SIL OFL 1.1) and
|
|
8
8
|
* variable, served by the page's own build from `@fontsource-variable/inter`
|
|
9
9
|
* — the woff2 is bundled as an asset of the importing application, so it is
|
|
10
10
|
* fetched from that application's origin and never from a third party.
|
|
11
11
|
*
|
|
12
12
|
* Import it once where the theme can be worn:
|
|
13
13
|
*
|
|
14
|
-
* import '@datalayer/primer-addons/style/
|
|
14
|
+
* import '@datalayer/primer-addons/style/agent-face.css';
|
|
15
15
|
*
|
|
16
16
|
* Only the upright variable axis (weights 100 to 900 in one file; the theme
|
|
17
17
|
* uses 400 and 600) and only two subsets, latin and latin-ext: a browser
|