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