@datalayer/primer-addons 1.0.52 → 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/ThemePalettePreview.d.ts +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/colorMode.d.ts +6 -0
- package/lib/theme/{themes-brand/index.js → colorMode.js} +1 -1
- 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 +4 -4
- package/lib/theme/index.js +4 -4
- 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/portableTheme.d.ts +1 -1
- package/lib/theme/themeRegistry.js +2 -2
- package/lib/theme/themeTokens.d.ts +2 -2
- 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} +179 -189
- package/lib/theme/themes/ivoryThemeStyles.d.ts +4 -1
- package/lib/theme/themes/ivoryThemeStyles.js +7 -1
- package/lib/theme/themes/metalThemeStyles.d.ts +1 -1
- package/lib/theme/themes/metalThemeStyles.js +27 -31
- package/lib/theme/themes/roundedShape.d.ts +18 -0
- package/lib/theme/themes/roundedShape.js +24 -0
- package/lib/theme/themes/sandThemeStyles.d.ts +4 -1
- package/lib/theme/themes/sandThemeStyles.js +7 -1
- package/lib/theme/themes/sunThemeStyles.d.ts +4 -1
- package/lib/theme/themes/sunThemeStyles.js +7 -1
- package/lib/theme/useThemeStore.d.ts +7 -1
- package/lib/theme/useThemeStore.js +29 -6
- package/lib/utils/Helper.d.ts +1 -16
- package/lib/utils/Helper.js +4 -20
- package/lib/utils/Portals.d.ts +1 -1
- package/lib/utils/Portals.js +1 -1
- package/package.json +1 -2
- package/style/{loop-face.css → agent-face.css} +2 -2
- package/lib/theme/DatalayerBrandThemeProvider.d.ts +0 -41
- package/lib/theme/DatalayerBrandThemeProvider.js +0 -32
- package/lib/theme/themes-brand/index.d.ts +0 -1
- package/lib/theme/themes-brand/spatialBrandTheme.d.ts +0 -16
- package/lib/theme/themes-brand/spatialBrandTheme.js +0 -157
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Agent Theme for Primer React.
|
|
7
7
|
*
|
|
8
8
|
* Soft and clear, for somebody who is not here for the software: one accent,
|
|
9
9
|
* neutral everything else. A white (or near-black) canvas, a deep-grey ink
|
|
@@ -14,62 +14,63 @@
|
|
|
14
14
|
* Theming is applied via **CSS custom-property overrides**.
|
|
15
15
|
*
|
|
16
16
|
* Unlike the other themes it also sets **shape**: rounder corners, and
|
|
17
|
-
* its own `--
|
|
17
|
+
* its own `--agent-*` properties for what an application is drawn with —
|
|
18
18
|
* a bubble, a frame, a face. Its accent and stage are the theme system's
|
|
19
19
|
* (`--theme-accent`, `--theme-stage` and the rest, `themeAccents`): mint.
|
|
20
20
|
*/
|
|
21
|
-
import {
|
|
21
|
+
import { agentColors } from '../colors/agentColors';
|
|
22
22
|
import { themeAccentTints, themeAccents } from '../colors/themeAccents';
|
|
23
23
|
import { buildThemeStyles } from '../css/createThemeCSSVars';
|
|
24
|
+
import { roundedRadiusVars, roundedShape } from './roundedShape';
|
|
24
25
|
/* ── Light-mode colour definitions ───────────────────────────────────── */
|
|
25
|
-
export const
|
|
26
|
+
export const agentLight = {
|
|
26
27
|
canvas: {
|
|
27
|
-
default:
|
|
28
|
-
subtle:
|
|
28
|
+
default: agentColors.white,
|
|
29
|
+
subtle: agentColors.subtle,
|
|
29
30
|
},
|
|
30
31
|
fg: {
|
|
31
|
-
default:
|
|
32
|
-
muted:
|
|
32
|
+
default: agentColors.ink,
|
|
33
|
+
muted: agentColors.gray,
|
|
33
34
|
onEmphasis: '#FFFFFF',
|
|
34
35
|
},
|
|
35
36
|
accent: {
|
|
36
|
-
fg:
|
|
37
|
+
fg: agentColors.agentText,
|
|
37
38
|
// The accent itself, as on dark: the soft mint that dark text sits on —
|
|
38
39
|
// the filled button, the person's bubble, the assistant's avatar. The
|
|
39
40
|
// chat pairs it with the button's text, so the two stay one colour.
|
|
40
|
-
emphasis:
|
|
41
|
-
muted:
|
|
42
|
-
subtle:
|
|
41
|
+
emphasis: agentColors.agentBrand,
|
|
42
|
+
muted: agentColors.agentBrand,
|
|
43
|
+
subtle: agentColors.agentTint,
|
|
43
44
|
},
|
|
44
45
|
success: {
|
|
45
|
-
fg:
|
|
46
|
-
emphasis:
|
|
47
|
-
muted:
|
|
48
|
-
subtle:
|
|
46
|
+
fg: agentColors.successBrand,
|
|
47
|
+
emphasis: agentColors.successBrand,
|
|
48
|
+
muted: agentColors.successAccent,
|
|
49
|
+
subtle: agentColors.successTint,
|
|
49
50
|
},
|
|
50
51
|
attention: {
|
|
51
|
-
fg:
|
|
52
|
-
emphasis:
|
|
53
|
-
muted:
|
|
54
|
-
subtle:
|
|
52
|
+
fg: agentColors.attentionBrand,
|
|
53
|
+
emphasis: agentColors.attentionBrand,
|
|
54
|
+
muted: agentColors.attentionAccent,
|
|
55
|
+
subtle: agentColors.attentionTint,
|
|
55
56
|
},
|
|
56
57
|
danger: {
|
|
57
|
-
fg:
|
|
58
|
-
emphasis:
|
|
59
|
-
muted:
|
|
60
|
-
subtle:
|
|
58
|
+
fg: agentColors.dangerBrand,
|
|
59
|
+
emphasis: agentColors.dangerBrand,
|
|
60
|
+
muted: agentColors.dangerAccent,
|
|
61
|
+
subtle: agentColors.dangerTint,
|
|
61
62
|
},
|
|
62
63
|
severe: {
|
|
63
|
-
fg:
|
|
64
|
-
emphasis:
|
|
65
|
-
muted:
|
|
66
|
-
subtle:
|
|
64
|
+
fg: agentColors.severeBrand,
|
|
65
|
+
emphasis: agentColors.severeBrand,
|
|
66
|
+
muted: agentColors.severeAccent,
|
|
67
|
+
subtle: agentColors.severeTint,
|
|
67
68
|
},
|
|
68
69
|
done: {
|
|
69
|
-
fg:
|
|
70
|
-
emphasis:
|
|
71
|
-
muted:
|
|
72
|
-
subtle:
|
|
70
|
+
fg: agentColors.doneBrand,
|
|
71
|
+
emphasis: agentColors.doneBrand,
|
|
72
|
+
muted: agentColors.doneAccent,
|
|
73
|
+
subtle: agentColors.doneTint,
|
|
73
74
|
},
|
|
74
75
|
border: {
|
|
75
76
|
// Hairlines: 7% of the ink, as solid colours on white — a surface is
|
|
@@ -78,8 +79,8 @@ export const loopLight = {
|
|
|
78
79
|
muted: '#F2F2F4',
|
|
79
80
|
},
|
|
80
81
|
btn: {
|
|
81
|
-
text:
|
|
82
|
-
bg:
|
|
82
|
+
text: agentColors.ink,
|
|
83
|
+
bg: agentColors.subtle,
|
|
83
84
|
border: 'transparent',
|
|
84
85
|
hoverBg: '#ECECEF',
|
|
85
86
|
hoverBorder: 'transparent',
|
|
@@ -90,101 +91,101 @@ export const loopLight = {
|
|
|
90
91
|
// The one filled button of a screen, in the accent: the soft mint, with
|
|
91
92
|
// its dark text — the same pastel as on dark, never the platform's deep green.
|
|
92
93
|
primary: {
|
|
93
|
-
text:
|
|
94
|
-
bg:
|
|
95
|
-
border:
|
|
96
|
-
hoverBg:
|
|
97
|
-
hoverBorder:
|
|
98
|
-
selectedBg:
|
|
94
|
+
text: agentColors.agentOn,
|
|
95
|
+
bg: agentColors.agentBrand,
|
|
96
|
+
border: agentColors.agentBrand,
|
|
97
|
+
hoverBg: agentColors.agentBrandHover,
|
|
98
|
+
hoverBorder: agentColors.agentBrandHover,
|
|
99
|
+
selectedBg: agentColors.agentAccent,
|
|
99
100
|
disabledText: 'rgba(6, 40, 30, 0.5)',
|
|
100
101
|
disabledBg: '#CDEFE2',
|
|
101
102
|
disabledBorder: '#CDEFE2',
|
|
102
|
-
icon:
|
|
103
|
+
icon: agentColors.agentOn,
|
|
103
104
|
counterBg: 'rgba(6, 40, 30, 0.12)',
|
|
104
105
|
},
|
|
105
106
|
outline: {
|
|
106
|
-
text:
|
|
107
|
-
hoverText:
|
|
108
|
-
hoverBg:
|
|
109
|
-
hoverBorder:
|
|
107
|
+
text: agentColors.agentText,
|
|
108
|
+
hoverText: agentColors.agentOn,
|
|
109
|
+
hoverBg: agentColors.agentBrand,
|
|
110
|
+
hoverBorder: agentColors.agentBrand,
|
|
110
111
|
hoverCounterBg: 'rgba(6, 40, 30, 0.12)',
|
|
111
|
-
selectedText:
|
|
112
|
-
selectedBg:
|
|
113
|
-
selectedBorder:
|
|
114
|
-
disabledText:
|
|
115
|
-
disabledBg:
|
|
112
|
+
selectedText: agentColors.agentOn,
|
|
113
|
+
selectedBg: agentColors.agentAccent,
|
|
114
|
+
selectedBorder: agentColors.agentAccent,
|
|
115
|
+
disabledText: agentColors.gray,
|
|
116
|
+
disabledBg: agentColors.subtle,
|
|
116
117
|
disabledCounterBg: 'rgba(0, 0, 0, 0.05)',
|
|
117
118
|
counterBg: 'rgba(0, 0, 0, 0.05)',
|
|
118
|
-
counterFg:
|
|
119
|
-
hoverCounterFg:
|
|
120
|
-
disabledCounterFg:
|
|
119
|
+
counterFg: agentColors.agentText,
|
|
120
|
+
hoverCounterFg: agentColors.agentOn,
|
|
121
|
+
disabledCounterFg: agentColors.gray,
|
|
121
122
|
},
|
|
122
123
|
danger: {
|
|
123
|
-
text:
|
|
124
|
+
text: agentColors.dangerBrand,
|
|
124
125
|
hoverText: '#FFFFFF',
|
|
125
|
-
hoverBg:
|
|
126
|
-
hoverBorder:
|
|
126
|
+
hoverBg: agentColors.dangerBrand,
|
|
127
|
+
hoverBorder: agentColors.dangerBrand,
|
|
127
128
|
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
128
129
|
selectedText: '#FFFFFF',
|
|
129
130
|
selectedBg: '#9C302A',
|
|
130
131
|
selectedBorder: '#9C302A',
|
|
131
132
|
disabledText: 'rgba(191, 63, 56, 0.5)',
|
|
132
|
-
disabledBg:
|
|
133
|
+
disabledBg: agentColors.subtle,
|
|
133
134
|
disabledCounterBg: 'rgba(191, 63, 56, 0.05)',
|
|
134
135
|
counterBg: 'rgba(191, 63, 56, 0.1)',
|
|
135
|
-
counterFg:
|
|
136
|
+
counterFg: agentColors.dangerBrand,
|
|
136
137
|
hoverCounterFg: '#FFFFFF',
|
|
137
138
|
disabledCounterFg: 'rgba(191, 63, 56, 0.5)',
|
|
138
|
-
icon:
|
|
139
|
+
icon: agentColors.dangerBrand,
|
|
139
140
|
},
|
|
140
141
|
},
|
|
141
142
|
};
|
|
142
143
|
/* ── Dark-mode colour definitions ────────────────────────────────────── */
|
|
143
|
-
export const
|
|
144
|
+
export const agentDark = {
|
|
144
145
|
canvas: {
|
|
145
|
-
default:
|
|
146
|
-
subtle:
|
|
146
|
+
default: agentColors.black,
|
|
147
|
+
subtle: agentColors.subtleDark,
|
|
147
148
|
},
|
|
148
149
|
fg: {
|
|
149
|
-
default:
|
|
150
|
-
muted:
|
|
150
|
+
default: agentColors.inkDark,
|
|
151
|
+
muted: agentColors.grayDark,
|
|
151
152
|
onEmphasis: '#FFFFFF',
|
|
152
153
|
},
|
|
153
154
|
accent: {
|
|
154
|
-
fg:
|
|
155
|
+
fg: agentColors.agentBright,
|
|
155
156
|
// The accent itself, on dark: a pastel that dark text sits on.
|
|
156
|
-
emphasis:
|
|
157
|
-
muted:
|
|
158
|
-
subtle:
|
|
157
|
+
emphasis: agentColors.agentBrand,
|
|
158
|
+
muted: agentColors.agentBrand,
|
|
159
|
+
subtle: agentColors.agentTintDark,
|
|
159
160
|
},
|
|
160
161
|
success: {
|
|
161
|
-
fg:
|
|
162
|
-
emphasis:
|
|
163
|
-
muted:
|
|
162
|
+
fg: agentColors.successAccent,
|
|
163
|
+
emphasis: agentColors.successBrand,
|
|
164
|
+
muted: agentColors.successAccent,
|
|
164
165
|
subtle: '#12241B',
|
|
165
166
|
},
|
|
166
167
|
attention: {
|
|
167
|
-
fg:
|
|
168
|
+
fg: agentColors.attentionAccent,
|
|
168
169
|
emphasis: '#8A5710',
|
|
169
|
-
muted:
|
|
170
|
+
muted: agentColors.attentionAccent,
|
|
170
171
|
subtle: '#2A2010',
|
|
171
172
|
},
|
|
172
173
|
danger: {
|
|
173
|
-
fg:
|
|
174
|
-
emphasis:
|
|
175
|
-
muted:
|
|
174
|
+
fg: agentColors.dangerAccent,
|
|
175
|
+
emphasis: agentColors.dangerBrand,
|
|
176
|
+
muted: agentColors.dangerAccent,
|
|
176
177
|
subtle: '#2C1615',
|
|
177
178
|
},
|
|
178
179
|
severe: {
|
|
179
|
-
fg:
|
|
180
|
-
emphasis:
|
|
181
|
-
muted:
|
|
180
|
+
fg: agentColors.severeAccent,
|
|
181
|
+
emphasis: agentColors.severeBrand,
|
|
182
|
+
muted: agentColors.severeAccent,
|
|
182
183
|
subtle: '#2B1B10',
|
|
183
184
|
},
|
|
184
185
|
done: {
|
|
185
|
-
fg:
|
|
186
|
-
emphasis:
|
|
187
|
-
muted:
|
|
186
|
+
fg: agentColors.doneAccent,
|
|
187
|
+
emphasis: agentColors.doneBrand,
|
|
188
|
+
muted: agentColors.doneAccent,
|
|
188
189
|
subtle: '#1C1A27',
|
|
189
190
|
},
|
|
190
191
|
border: {
|
|
@@ -193,8 +194,8 @@ export const loopDark = {
|
|
|
193
194
|
muted: '#222224',
|
|
194
195
|
},
|
|
195
196
|
btn: {
|
|
196
|
-
text:
|
|
197
|
-
bg:
|
|
197
|
+
text: agentColors.inkDark,
|
|
198
|
+
bg: agentColors.subtleDark,
|
|
198
199
|
border: 'transparent',
|
|
199
200
|
hoverBg: '#28282B',
|
|
200
201
|
hoverBorder: 'transparent',
|
|
@@ -205,84 +206,78 @@ export const loopDark = {
|
|
|
205
206
|
// The one filled button of a screen, in the accent: the pastel, with
|
|
206
207
|
// its dark text, the brightest thing on a dark page.
|
|
207
208
|
primary: {
|
|
208
|
-
text:
|
|
209
|
-
bg:
|
|
210
|
-
border:
|
|
211
|
-
hoverBg:
|
|
212
|
-
hoverBorder:
|
|
209
|
+
text: agentColors.agentOn,
|
|
210
|
+
bg: agentColors.agentBrand,
|
|
211
|
+
border: agentColors.agentBrand,
|
|
212
|
+
hoverBg: agentColors.agentBright,
|
|
213
|
+
hoverBorder: agentColors.agentBright,
|
|
213
214
|
selectedBg: '#6CCFAA',
|
|
214
215
|
disabledText: 'rgba(6, 40, 30, 0.6)',
|
|
215
216
|
disabledBg: 'rgba(122, 219, 184, 0.35)',
|
|
216
217
|
disabledBorder: 'transparent',
|
|
217
|
-
icon:
|
|
218
|
+
icon: agentColors.agentOn,
|
|
218
219
|
counterBg: 'rgba(6, 40, 30, 0.15)',
|
|
219
220
|
},
|
|
220
221
|
outline: {
|
|
221
|
-
text:
|
|
222
|
-
hoverText:
|
|
223
|
-
hoverBg:
|
|
224
|
-
hoverBorder:
|
|
222
|
+
text: agentColors.agentBright,
|
|
223
|
+
hoverText: agentColors.agentOn,
|
|
224
|
+
hoverBg: agentColors.agentBright,
|
|
225
|
+
hoverBorder: agentColors.agentBright,
|
|
225
226
|
hoverCounterBg: 'rgba(0, 0, 0, 0.2)',
|
|
226
|
-
selectedText:
|
|
227
|
-
selectedBg:
|
|
228
|
-
selectedBorder:
|
|
227
|
+
selectedText: agentColors.agentOn,
|
|
228
|
+
selectedBg: agentColors.agentBrand,
|
|
229
|
+
selectedBorder: agentColors.agentBrand,
|
|
229
230
|
disabledText: 'rgba(143, 229, 198, 0.5)',
|
|
230
231
|
disabledBg: 'rgba(143, 229, 198, 0.1)',
|
|
231
232
|
disabledCounterBg: 'rgba(143, 229, 198, 0.05)',
|
|
232
233
|
counterBg: 'rgba(143, 229, 198, 0.1)',
|
|
233
|
-
counterFg:
|
|
234
|
-
hoverCounterFg:
|
|
234
|
+
counterFg: agentColors.agentBright,
|
|
235
|
+
hoverCounterFg: agentColors.agentOn,
|
|
235
236
|
disabledCounterFg: 'rgba(143, 229, 198, 0.5)',
|
|
236
237
|
},
|
|
237
238
|
danger: {
|
|
238
|
-
text:
|
|
239
|
+
text: agentColors.dangerAccent,
|
|
239
240
|
hoverText: '#FFFFFF',
|
|
240
|
-
hoverBg:
|
|
241
|
-
hoverBorder:
|
|
241
|
+
hoverBg: agentColors.dangerBrand,
|
|
242
|
+
hoverBorder: agentColors.dangerAccent,
|
|
242
243
|
hoverCounterBg: 'rgba(255, 255, 255, 0.2)',
|
|
243
244
|
selectedText: '#FFFFFF',
|
|
244
245
|
selectedBg: '#9C302A',
|
|
245
|
-
selectedBorder:
|
|
246
|
+
selectedBorder: agentColors.dangerAccent,
|
|
246
247
|
disabledText: 'rgba(240, 138, 131, 0.5)',
|
|
247
248
|
disabledBg: 'rgba(240, 138, 131, 0.1)',
|
|
248
249
|
disabledCounterBg: 'rgba(240, 138, 131, 0.05)',
|
|
249
250
|
counterBg: 'rgba(240, 138, 131, 0.1)',
|
|
250
|
-
counterFg:
|
|
251
|
+
counterFg: agentColors.dangerAccent,
|
|
251
252
|
hoverCounterFg: '#FFFFFF',
|
|
252
253
|
disabledCounterFg: 'rgba(240, 138, 131, 0.5)',
|
|
253
|
-
icon:
|
|
254
|
+
icon: agentColors.dangerAccent,
|
|
254
255
|
},
|
|
255
256
|
},
|
|
256
257
|
};
|
|
257
258
|
/* ── Shape, type and motion ──────────────────────────────────────────── */
|
|
258
259
|
/**
|
|
259
|
-
* What the
|
|
260
|
+
* What the Agent theme sets beside colour, the same in both modes.
|
|
260
261
|
*
|
|
261
|
-
* Primer's own radii are made rounder; the `--
|
|
262
|
+
* Primer's own radii are made rounder; the `--agent-*` properties are what
|
|
262
263
|
* an application is drawn with. A face is an emoji at one of three sizes;
|
|
263
264
|
* motion has three durations and one easing.
|
|
264
265
|
*/
|
|
265
|
-
export const
|
|
266
|
-
'
|
|
267
|
-
|
|
268
|
-
'
|
|
269
|
-
'--
|
|
270
|
-
'--
|
|
271
|
-
'--
|
|
272
|
-
'--
|
|
273
|
-
'--
|
|
274
|
-
|
|
275
|
-
'--
|
|
276
|
-
'--
|
|
277
|
-
'--loop-face-medium': '40px',
|
|
278
|
-
'--loop-face-small': '20px',
|
|
279
|
-
'--loop-motion-fast': '120ms',
|
|
280
|
-
'--loop-motion-medium': '200ms',
|
|
281
|
-
'--loop-motion-slow': '320ms',
|
|
282
|
-
'--loop-motion-easing': 'cubic-bezier(0.2, 0.8, 0.2, 1)',
|
|
266
|
+
export const agentShapeVars = {
|
|
267
|
+
// The rounded shape's radii, shared with Metal, Sand, Ivory and Sun.
|
|
268
|
+
...roundedRadiusVars,
|
|
269
|
+
// Light mode's; `agentShadows` says dark mode's.
|
|
270
|
+
'--agent-shadow-frame': '0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.06)',
|
|
271
|
+
'--agent-face-large': '72px',
|
|
272
|
+
'--agent-face-medium': '40px',
|
|
273
|
+
'--agent-face-small': '20px',
|
|
274
|
+
'--agent-motion-fast': '120ms',
|
|
275
|
+
'--agent-motion-medium': '200ms',
|
|
276
|
+
'--agent-motion-slow': '320ms',
|
|
277
|
+
'--agent-motion-easing': 'cubic-bezier(0.2, 0.8, 0.2, 1)',
|
|
283
278
|
};
|
|
284
279
|
/** The hairline between two surfaces, per mode. */
|
|
285
|
-
const
|
|
280
|
+
const agentHairline = {
|
|
286
281
|
light: 'rgba(29, 29, 31, 0.07)',
|
|
287
282
|
dark: 'rgba(255, 255, 255, 0.10)',
|
|
288
283
|
};
|
|
@@ -293,9 +288,9 @@ const loopHairline = {
|
|
|
293
288
|
* deeper shadow. Primer's own shadow tokens take the same hand, so a menu
|
|
294
289
|
* or a dialog floats the way a frame does.
|
|
295
290
|
*/
|
|
296
|
-
export const
|
|
291
|
+
export const agentShadows = {
|
|
297
292
|
light: {
|
|
298
|
-
'--
|
|
293
|
+
'--agent-shadow-frame': '0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.06)',
|
|
299
294
|
'--theme-shadow': '0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.06)',
|
|
300
295
|
'--shadow-resting-xsmall': '0 1px 1px rgba(0, 0, 0, 0.03)',
|
|
301
296
|
'--shadow-resting-small': '0 1px 2px rgba(0, 0, 0, 0.04)',
|
|
@@ -306,7 +301,7 @@ export const loopShadows = {
|
|
|
306
301
|
'--shadow-floating-xlarge': '0 0 0 1px rgba(29, 29, 31, 0.04), 0 24px 64px rgba(0, 0, 0, 0.18)',
|
|
307
302
|
},
|
|
308
303
|
dark: {
|
|
309
|
-
'--
|
|
304
|
+
'--agent-shadow-frame': '0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 36px rgba(0, 0, 0, 0.45)',
|
|
310
305
|
'--theme-shadow': '0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 36px rgba(0, 0, 0, 0.45)',
|
|
311
306
|
'--shadow-resting-xsmall': '0 0 0 1px rgba(255, 255, 255, 0.05)',
|
|
312
307
|
'--shadow-resting-small': '0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.3)',
|
|
@@ -318,7 +313,7 @@ export const loopShadows = {
|
|
|
318
313
|
},
|
|
319
314
|
};
|
|
320
315
|
/**
|
|
321
|
-
* Type
|
|
316
|
+
* Type: one face, two weights, five sizes, one line-height per
|
|
322
317
|
* size — each line a multiple of 4px.
|
|
323
318
|
*
|
|
324
319
|
* | Size | Line | Tokens |
|
|
@@ -335,18 +330,18 @@ export const loopShadows = {
|
|
|
335
330
|
* is; the body left alone. The tracking is a token for a component to apply,
|
|
336
331
|
* since a CSS font shorthand carries none.
|
|
337
332
|
*/
|
|
338
|
-
export const
|
|
333
|
+
export const agentTypeScale = {
|
|
339
334
|
display: { size: '2rem', lineHeight: '1.25' },
|
|
340
335
|
title: { size: '1.25rem', lineHeight: '1.4' },
|
|
341
336
|
heading: { size: '1rem', lineHeight: '1.5' },
|
|
342
337
|
body: { size: '0.875rem', lineHeight: '1.4286' },
|
|
343
338
|
small: { size: '0.75rem', lineHeight: '1.3333' },
|
|
344
339
|
};
|
|
345
|
-
/** The two weights of the `
|
|
346
|
-
export const
|
|
347
|
-
export const
|
|
348
|
-
const { display, title, heading, body, small } =
|
|
349
|
-
const { regular, semibold } =
|
|
340
|
+
/** The two weights of the `agent` theme. */
|
|
341
|
+
export const agentFontWeights = { regular: 400, semibold: 600 };
|
|
342
|
+
export const agentTypeVars = (font) => {
|
|
343
|
+
const { display, title, heading, body, small } = agentTypeScale;
|
|
344
|
+
const { regular, semibold } = agentFontWeights;
|
|
350
345
|
const shorthand = (weight, step) => `${weight} ${step.size}/${step.lineHeight} ${font}`;
|
|
351
346
|
return {
|
|
352
347
|
'--base-text-weight-light': String(regular),
|
|
@@ -382,16 +377,16 @@ export const loopTypeVars = (font) => {
|
|
|
382
377
|
'--text-body-shorthand-medium': shorthand(regular, body),
|
|
383
378
|
'--text-body-shorthand-small': shorthand(regular, small),
|
|
384
379
|
'--text-caption-shorthand': shorthand(regular, small),
|
|
385
|
-
'--
|
|
386
|
-
'--
|
|
387
|
-
'--
|
|
380
|
+
'--agent-tracking-display': '-0.02em',
|
|
381
|
+
'--agent-tracking-title': '-0.012em',
|
|
382
|
+
'--agent-tracking-body': '0',
|
|
388
383
|
};
|
|
389
384
|
};
|
|
390
385
|
/**
|
|
391
386
|
* The accent's properties in a mode, mint's (`themeAccents.green`): the
|
|
392
387
|
* stage and the quiet tint are mint's own, not derived from the colours.
|
|
393
388
|
*/
|
|
394
|
-
const
|
|
389
|
+
const agentTints = (mode) => themeAccentTints({
|
|
395
390
|
accent: themeAccents.green.accent,
|
|
396
391
|
on: themeAccents.green.on,
|
|
397
392
|
stage: themeAccents.green.stage[mode],
|
|
@@ -400,27 +395,27 @@ const loopTints = (mode) => themeAccentTints({
|
|
|
400
395
|
/* ── Exports ─────────────────────────────────────────────────────────── */
|
|
401
396
|
/**
|
|
402
397
|
* Inter, then its metric-matched fallback, then the system's own sans-serif
|
|
403
|
-
|
|
398
|
+
*. One face, two weights (400 and 600). The face is served by the
|
|
404
399
|
* page's own build: a page wearing the theme imports
|
|
405
|
-
* `@datalayer/primer-addons/style/
|
|
400
|
+
* `@datalayer/primer-addons/style/agent-face.css`, which declares
|
|
406
401
|
* `Inter Variable` from `@fontsource-variable/inter` and `Inter Fallback`, a
|
|
407
402
|
* local Arial drawn to Inter's measure. The text paints in the fallback first
|
|
408
403
|
* and does not move when Inter arrives; a page that has not imported the
|
|
409
404
|
* stylesheet shows the system face.
|
|
410
405
|
*/
|
|
411
|
-
export const
|
|
406
|
+
export const agentFontFamily = '"Inter Variable", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
|
|
412
407
|
/**
|
|
413
|
-
* Motion
|
|
408
|
+
* Motion: three durations and one easing, for three things — a
|
|
414
409
|
* status changing, a message arriving, a pane opening. Nothing else moves.
|
|
415
410
|
*/
|
|
416
|
-
export const
|
|
417
|
-
'--
|
|
418
|
-
'--
|
|
419
|
-
'--
|
|
420
|
-
'--
|
|
411
|
+
export const agentMotionVars = {
|
|
412
|
+
'--agent-motion-status': '120ms',
|
|
413
|
+
'--agent-motion-message': '200ms',
|
|
414
|
+
'--agent-motion-pane': '320ms',
|
|
415
|
+
'--agent-motion-easing': 'cubic-bezier(0.2, 0, 0, 1)',
|
|
421
416
|
};
|
|
422
417
|
/**
|
|
423
|
-
* The focus ring
|
|
418
|
+
* The focus ring: 3 to 1 against the page and around a pill of
|
|
424
419
|
* any accent, in both modes. In light mode the deep mint does it — darker than the text, the one place it is —
|
|
425
420
|
* a halo in the theme's colour, as a system's own focus ring is — 6.5 to 1
|
|
426
421
|
* on white and 3.28 or more around every pastel. In dark mode no
|
|
@@ -429,9 +424,9 @@ export const loopMotionVars = {
|
|
|
429
424
|
* mid grey does, at 3.04 to 1 — and 2.77 to 1 on the subtle dark surface,
|
|
430
425
|
* the one place it falls short.
|
|
431
426
|
*/
|
|
432
|
-
export const
|
|
427
|
+
export const agentFocusRing = { light: agentColors.agentRing, dark: '#636363' };
|
|
433
428
|
/**
|
|
434
|
-
* The
|
|
429
|
+
* The agent theme's own stylesheet, beside what its shape draws: bold is the
|
|
435
430
|
* theme's semibold, its second and last weight.
|
|
436
431
|
*
|
|
437
432
|
* Its controls are pills and its tables rounder by its shape
|
|
@@ -439,66 +434,61 @@ export const loopFocusRing = { light: loopColors.loopRing, dark: '#636363' };
|
|
|
439
434
|
* any theme that sets them: menus and overlays keep the card's radius,
|
|
440
435
|
* `--borderRadius-large`, which the theme already sets.
|
|
441
436
|
*/
|
|
442
|
-
const
|
|
437
|
+
const agentOwnCss = `
|
|
443
438
|
:scope b,
|
|
444
439
|
:scope strong {
|
|
445
440
|
font-weight: var(--base-text-weight-semibold);
|
|
446
441
|
}
|
|
447
442
|
`;
|
|
448
443
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
449
|
-
export const
|
|
450
|
-
fontFamily:
|
|
451
|
-
css:
|
|
452
|
-
// Rounder than the others: a pill for a control
|
|
444
|
+
export const agentThemeStyles = buildThemeStyles(agentLight, agentDark, {
|
|
445
|
+
fontFamily: agentFontFamily,
|
|
446
|
+
css: agentOwnCss,
|
|
447
|
+
// Rounder than the others: a pill for a control, soft cards,
|
|
453
448
|
// round bubbles, a table with the corners of a list item.
|
|
454
449
|
shape: {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
motionStatus: loopMotionVars['--loop-motion-status'],
|
|
463
|
-
motionMessage: loopMotionVars['--loop-motion-message'],
|
|
464
|
-
motionPane: loopMotionVars['--loop-motion-pane'],
|
|
465
|
-
motionEasing: loopMotionVars['--loop-motion-easing'],
|
|
466
|
-
// Links plain in a message: the words' own colour, underlined (T-06).
|
|
450
|
+
...roundedShape,
|
|
451
|
+
shadow: agentShapeVars['--agent-shadow-frame'],
|
|
452
|
+
motionStatus: agentMotionVars['--agent-motion-status'],
|
|
453
|
+
motionMessage: agentMotionVars['--agent-motion-message'],
|
|
454
|
+
motionPane: agentMotionVars['--agent-motion-pane'],
|
|
455
|
+
motionEasing: agentMotionVars['--agent-motion-easing'],
|
|
456
|
+
// Links plain in a message: the words' own colour, underlined.
|
|
467
457
|
messageLink: 'currentColor',
|
|
468
458
|
},
|
|
469
459
|
variables: {
|
|
470
460
|
light: {
|
|
471
|
-
...
|
|
472
|
-
...
|
|
473
|
-
...
|
|
474
|
-
...
|
|
475
|
-
...
|
|
476
|
-
'--
|
|
461
|
+
...agentShapeVars,
|
|
462
|
+
...agentTints('light'),
|
|
463
|
+
...agentMotionVars,
|
|
464
|
+
...agentShadows.light,
|
|
465
|
+
...agentTypeVars(agentFontFamily),
|
|
466
|
+
'--agent-hairline': agentHairline.light,
|
|
477
467
|
// The hairline is Primer's default border: a card drawn with
|
|
478
468
|
// `borderColor="border.default"` gets it, no fallback chain at the call site.
|
|
479
|
-
'--borderColor-default':
|
|
480
|
-
'--focus-outlineColor':
|
|
481
|
-
// The selected tab underlined in the accent, not Primer's coral
|
|
469
|
+
'--borderColor-default': agentHairline.light,
|
|
470
|
+
'--focus-outlineColor': agentFocusRing.light,
|
|
471
|
+
// The selected tab underlined in the accent, not Primer's coral.
|
|
482
472
|
'--underlineNav-borderColor-active': themeAccents.green.accent,
|
|
483
473
|
},
|
|
484
474
|
dark: {
|
|
485
|
-
...
|
|
486
|
-
...
|
|
487
|
-
...
|
|
488
|
-
...
|
|
489
|
-
...
|
|
490
|
-
'--
|
|
475
|
+
...agentShapeVars,
|
|
476
|
+
...agentTints('dark'),
|
|
477
|
+
...agentMotionVars,
|
|
478
|
+
...agentShadows.dark,
|
|
479
|
+
...agentTypeVars(agentFontFamily),
|
|
480
|
+
'--agent-hairline': agentHairline.dark,
|
|
491
481
|
// The hairline is Primer's default border: a card drawn with
|
|
492
482
|
// `borderColor="border.default"` gets it, no fallback chain at the call site.
|
|
493
|
-
'--borderColor-default':
|
|
494
|
-
'--focus-outlineColor':
|
|
495
|
-
// The selected tab underlined in the accent, not Primer's coral
|
|
483
|
+
'--borderColor-default': agentHairline.dark,
|
|
484
|
+
'--focus-outlineColor': agentFocusRing.dark,
|
|
485
|
+
// The selected tab underlined in the accent, not Primer's coral.
|
|
496
486
|
'--underlineNav-borderColor-active': themeAccents.green.accent,
|
|
497
487
|
},
|
|
498
488
|
},
|
|
499
489
|
});
|
|
500
490
|
/**
|
|
501
|
-
* The
|
|
491
|
+
* The agent theme's whole stylesheet (`ThemeStyles.css`): its controls as
|
|
502
492
|
* pills and its tables rounder, drawn from its shape, then its own rules.
|
|
503
493
|
*/
|
|
504
|
-
export const
|
|
494
|
+
export const agentControlsCss = agentThemeStyles.css ?? '';
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
3
|
+
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
4
|
+
*/
|
|
2
5
|
export declare const ivoryThemeStyles: import("../css/createThemeCSSVars").ThemeStyles;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { ivoryColors } from '../colors/ivoryColors';
|
|
14
14
|
import { buildThemeStyles } from '../css/createThemeCSSVars';
|
|
15
|
+
import { roundedRadiusVars, roundedShape } from './roundedShape';
|
|
15
16
|
/* ── Light-mode colour definitions ───────────────────────────────────── */
|
|
16
17
|
const ivoryLight = {
|
|
17
18
|
canvas: {
|
|
@@ -241,7 +242,12 @@ const ivoryDark = {
|
|
|
241
242
|
* approach as the Matrix monospace stack).
|
|
242
243
|
*/
|
|
243
244
|
const ivoryFontFamily = '"Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif';
|
|
244
|
-
/**
|
|
245
|
+
/**
|
|
246
|
+
* Comprehensive Primer CSS-variable overrides for light & dark mode, with
|
|
247
|
+
* the rounded shape: Agent's and Metal's corners, pill controls (`roundedShape`).
|
|
248
|
+
*/
|
|
245
249
|
export const ivoryThemeStyles = buildThemeStyles(ivoryLight, ivoryDark, {
|
|
246
250
|
fontFamily: ivoryFontFamily,
|
|
251
|
+
shape: roundedShape,
|
|
252
|
+
variables: { light: roundedRadiusVars, dark: roundedRadiusVars },
|
|
247
253
|
});
|