@backstage/theme 0.5.3 → 0.5.4
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/CHANGELOG.md +12 -0
- package/dist/base/createBaseThemeOptions.esm.js +66 -0
- package/dist/base/createBaseThemeOptions.esm.js.map +1 -0
- package/dist/base/pageTheme.esm.js +52 -0
- package/dist/base/pageTheme.esm.js.map +1 -0
- package/dist/base/palettes.esm.js +149 -0
- package/dist/base/palettes.esm.js.map +1 -0
- package/dist/index.esm.js +10 -700
- package/dist/index.esm.js.map +1 -1
- package/dist/unified/MuiClassNameSetup.esm.js +6 -0
- package/dist/unified/MuiClassNameSetup.esm.js.map +1 -0
- package/dist/unified/UnifiedTheme.esm.js +57 -0
- package/dist/unified/UnifiedTheme.esm.js.map +1 -0
- package/dist/unified/UnifiedThemeProvider.esm.js +29 -0
- package/dist/unified/UnifiedThemeProvider.esm.js.map +1 -0
- package/dist/unified/overrides.esm.js +102 -0
- package/dist/unified/overrides.esm.js.map +1 -0
- package/dist/unified/themes.esm.js +11 -0
- package/dist/unified/themes.esm.js.map +1 -0
- package/dist/v4/baseTheme.esm.js +33 -0
- package/dist/v4/baseTheme.esm.js.map +1 -0
- package/dist/v4/themes.esm.js +13 -0
- package/dist/v4/themes.esm.js.map +1 -0
- package/dist/v5/defaultComponentThemes.esm.js +242 -0
- package/dist/v5/defaultComponentThemes.esm.js.map +1 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,701 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return argument;
|
|
12
|
-
}
|
|
13
|
-
return themeSpacing * argument;
|
|
14
|
-
};
|
|
15
|
-
return args.map((argument) => {
|
|
16
|
-
const output = transform(argument, defaultSpacing);
|
|
17
|
-
return typeof output === "number" ? `${output}px` : output;
|
|
18
|
-
}).join(" ");
|
|
19
|
-
};
|
|
20
|
-
function adaptV5CssBaselineOverride(theme, overrides) {
|
|
21
|
-
if (!overrides || typeof overrides === "string") {
|
|
22
|
-
return void 0;
|
|
23
|
-
}
|
|
24
|
-
const styles = typeof overrides === "function" ? overrides(theme) : overrides;
|
|
25
|
-
if (styles) {
|
|
26
|
-
return { "@global": styles };
|
|
27
|
-
}
|
|
28
|
-
return void 0;
|
|
29
|
-
}
|
|
30
|
-
function adaptV5Override(theme, overrides) {
|
|
31
|
-
if (!overrides || typeof overrides === "string") {
|
|
32
|
-
return void 0;
|
|
33
|
-
}
|
|
34
|
-
if (typeof overrides === "object") {
|
|
35
|
-
const _theme = { ...theme };
|
|
36
|
-
const defaultSpacing = theme.spacing(1);
|
|
37
|
-
if (typeof defaultSpacing === "number") {
|
|
38
|
-
_theme.spacing = __v5Spacing(defaultSpacing);
|
|
39
|
-
}
|
|
40
|
-
return Object.fromEntries(
|
|
41
|
-
Object.entries(overrides).map(([className, style]) => {
|
|
42
|
-
if (typeof style === "function") {
|
|
43
|
-
return [className, style({ theme: _theme })];
|
|
44
|
-
}
|
|
45
|
-
return [className, style];
|
|
46
|
-
})
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
return overrides;
|
|
50
|
-
}
|
|
51
|
-
const stateStyleKeyPattern = /^&.Mui-([\w-]+)$/;
|
|
52
|
-
function extractV5StateOverrides(overrides) {
|
|
53
|
-
let output = overrides;
|
|
54
|
-
if (!overrides || typeof overrides !== "object") {
|
|
55
|
-
return output;
|
|
56
|
-
}
|
|
57
|
-
for (const className of Object.keys(overrides)) {
|
|
58
|
-
const styles = overrides[className];
|
|
59
|
-
if (!styles || typeof styles !== "object") {
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
for (const _styleKey of Object.keys(styles)) {
|
|
63
|
-
const styleKey = _styleKey;
|
|
64
|
-
const match = styleKey.match(stateStyleKeyPattern);
|
|
65
|
-
if (match) {
|
|
66
|
-
const [, state] = match;
|
|
67
|
-
const { [styleKey]: stateStyles, ...restStyles } = styles;
|
|
68
|
-
if (stateStyles) {
|
|
69
|
-
output = {
|
|
70
|
-
...output,
|
|
71
|
-
[className]: restStyles,
|
|
72
|
-
[state]: stateStyles
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return output;
|
|
79
|
-
}
|
|
80
|
-
function transformV5ComponentThemesToV4(theme, components = {}) {
|
|
81
|
-
const overrides = {};
|
|
82
|
-
const props = {};
|
|
83
|
-
for (const name of Object.keys(components)) {
|
|
84
|
-
const component = components[name];
|
|
85
|
-
if (!component) {
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
if ("styleOverrides" in component) {
|
|
89
|
-
if (name === "MuiCssBaseline") {
|
|
90
|
-
overrides[name] = adaptV5CssBaselineOverride(
|
|
91
|
-
theme,
|
|
92
|
-
component.styleOverrides
|
|
93
|
-
);
|
|
94
|
-
} else {
|
|
95
|
-
overrides[name] = extractV5StateOverrides(
|
|
96
|
-
adaptV5Override(theme, component.styleOverrides)
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if ("defaultProps" in component) {
|
|
101
|
-
props[name] = component.defaultProps;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return { overrides, props };
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const shapes = {
|
|
108
|
-
wave: `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,
|
|
109
|
-
wave2: `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,
|
|
110
|
-
round: `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`
|
|
111
|
-
};
|
|
112
|
-
const colorVariants = {
|
|
113
|
-
darkGrey: ["#171717", "#383838"],
|
|
114
|
-
marineBlue: ["#006D8F", "#0049A1"],
|
|
115
|
-
veryBlue: ["#0027AF", "#270094"],
|
|
116
|
-
rubyRed: ["#98002B", "#8D1134"],
|
|
117
|
-
toastyOrange: ["#BE2200", "#A41D00"],
|
|
118
|
-
purpleSky: ["#8912CA", "#3E00EA"],
|
|
119
|
-
eveningSea: ["#00FFF2", "#035355"],
|
|
120
|
-
teal: ["#005B4B"],
|
|
121
|
-
pinkSea: ["#C8077A", "#C2297D"],
|
|
122
|
-
greens: ["#4BB8A5", "#187656"]
|
|
123
|
-
};
|
|
124
|
-
function genPageTheme(props) {
|
|
125
|
-
var _a;
|
|
126
|
-
const { colors, shape, options } = props;
|
|
127
|
-
const gradientColors = colors.length === 1 ? [colors[0], colors[0]] : colors;
|
|
128
|
-
const gradient = `linear-gradient(90deg, ${gradientColors.join(", ")})`;
|
|
129
|
-
const backgroundImage = `${shape}, ${gradient}`;
|
|
130
|
-
const fontColor = (_a = options == null ? void 0 : options.fontColor) != null ? _a : "#FFFFFF";
|
|
131
|
-
return {
|
|
132
|
-
colors,
|
|
133
|
-
shape,
|
|
134
|
-
backgroundImage,
|
|
135
|
-
fontColor
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
const pageTheme = {
|
|
139
|
-
home: genPageTheme({ colors: colorVariants.teal, shape: shapes.wave }),
|
|
140
|
-
documentation: genPageTheme({
|
|
141
|
-
colors: colorVariants.pinkSea,
|
|
142
|
-
shape: shapes.wave2
|
|
143
|
-
}),
|
|
144
|
-
tool: genPageTheme({ colors: colorVariants.purpleSky, shape: shapes.round }),
|
|
145
|
-
service: genPageTheme({
|
|
146
|
-
colors: colorVariants.marineBlue,
|
|
147
|
-
shape: shapes.wave
|
|
148
|
-
}),
|
|
149
|
-
website: genPageTheme({ colors: colorVariants.veryBlue, shape: shapes.wave }),
|
|
150
|
-
library: genPageTheme({ colors: colorVariants.rubyRed, shape: shapes.wave }),
|
|
151
|
-
other: genPageTheme({ colors: colorVariants.darkGrey, shape: shapes.wave }),
|
|
152
|
-
app: genPageTheme({ colors: colorVariants.toastyOrange, shape: shapes.wave }),
|
|
153
|
-
apis: genPageTheme({ colors: colorVariants.teal, shape: shapes.wave2 }),
|
|
154
|
-
card: genPageTheme({ colors: colorVariants.greens, shape: shapes.wave })
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const DEFAULT_HTML_FONT_SIZE = 16;
|
|
158
|
-
const DEFAULT_FONT_FAMILY = '"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';
|
|
159
|
-
const DEFAULT_PAGE_THEME = "home";
|
|
160
|
-
const defaultTypography = {
|
|
161
|
-
htmlFontSize: DEFAULT_HTML_FONT_SIZE,
|
|
162
|
-
fontFamily: DEFAULT_FONT_FAMILY,
|
|
163
|
-
h1: {
|
|
164
|
-
fontSize: 54,
|
|
165
|
-
fontWeight: 700,
|
|
166
|
-
marginBottom: 10
|
|
167
|
-
},
|
|
168
|
-
h2: {
|
|
169
|
-
fontSize: 40,
|
|
170
|
-
fontWeight: 700,
|
|
171
|
-
marginBottom: 8
|
|
172
|
-
},
|
|
173
|
-
h3: {
|
|
174
|
-
fontSize: 32,
|
|
175
|
-
fontWeight: 700,
|
|
176
|
-
marginBottom: 6
|
|
177
|
-
},
|
|
178
|
-
h4: {
|
|
179
|
-
fontWeight: 700,
|
|
180
|
-
fontSize: 28,
|
|
181
|
-
marginBottom: 6
|
|
182
|
-
},
|
|
183
|
-
h5: {
|
|
184
|
-
fontWeight: 700,
|
|
185
|
-
fontSize: 24,
|
|
186
|
-
marginBottom: 4
|
|
187
|
-
},
|
|
188
|
-
h6: {
|
|
189
|
-
fontWeight: 700,
|
|
190
|
-
fontSize: 20,
|
|
191
|
-
marginBottom: 2
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
function createBaseThemeOptions(options) {
|
|
195
|
-
const {
|
|
196
|
-
palette,
|
|
197
|
-
htmlFontSize = DEFAULT_HTML_FONT_SIZE,
|
|
198
|
-
fontFamily = DEFAULT_FONT_FAMILY,
|
|
199
|
-
defaultPageTheme = DEFAULT_PAGE_THEME,
|
|
200
|
-
pageTheme: pageTheme$1 = pageTheme,
|
|
201
|
-
typography
|
|
202
|
-
} = options;
|
|
203
|
-
if (!pageTheme$1[defaultPageTheme]) {
|
|
204
|
-
throw new Error(`${defaultPageTheme} is not defined in pageTheme.`);
|
|
205
|
-
}
|
|
206
|
-
defaultTypography.htmlFontSize = htmlFontSize;
|
|
207
|
-
defaultTypography.fontFamily = fontFamily;
|
|
208
|
-
return {
|
|
209
|
-
palette,
|
|
210
|
-
typography: typography != null ? typography : defaultTypography,
|
|
211
|
-
page: pageTheme$1[defaultPageTheme],
|
|
212
|
-
getPageTheme: ({ themeId }) => {
|
|
213
|
-
var _a;
|
|
214
|
-
return (_a = pageTheme$1[themeId]) != null ? _a : pageTheme$1[defaultPageTheme];
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const defaultComponentThemes = {
|
|
220
|
-
MuiCssBaseline: {
|
|
221
|
-
styleOverrides: (theme) => ({
|
|
222
|
-
html: {
|
|
223
|
-
height: "100%",
|
|
224
|
-
fontFamily: theme.typography.fontFamily
|
|
225
|
-
},
|
|
226
|
-
body: {
|
|
227
|
-
height: "100%",
|
|
228
|
-
fontFamily: theme.typography.fontFamily,
|
|
229
|
-
overscrollBehaviorY: "none",
|
|
230
|
-
fontSize: "0.875rem",
|
|
231
|
-
lineHeight: 1.43
|
|
232
|
-
},
|
|
233
|
-
a: {
|
|
234
|
-
color: "inherit",
|
|
235
|
-
textDecoration: "none"
|
|
236
|
-
}
|
|
237
|
-
})
|
|
238
|
-
},
|
|
239
|
-
MuiGrid: {
|
|
240
|
-
defaultProps: {
|
|
241
|
-
spacing: 2
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
MuiSwitch: {
|
|
245
|
-
defaultProps: {
|
|
246
|
-
color: "primary"
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
MuiTableRow: {
|
|
250
|
-
styleOverrides: {
|
|
251
|
-
// Alternating row backgrounds
|
|
252
|
-
root: ({ theme }) => ({
|
|
253
|
-
"&:nth-of-type(odd)": {
|
|
254
|
-
backgroundColor: theme.palette.background.default
|
|
255
|
-
}
|
|
256
|
-
}),
|
|
257
|
-
// Use pointer for hoverable rows
|
|
258
|
-
hover: {
|
|
259
|
-
"&:hover": {
|
|
260
|
-
cursor: "pointer"
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
// Alternating head backgrounds
|
|
264
|
-
head: ({ theme }) => ({
|
|
265
|
-
"&:nth-of-type(odd)": {
|
|
266
|
-
backgroundColor: theme.palette.background.paper
|
|
267
|
-
}
|
|
268
|
-
})
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
// Tables are more dense than default mui tables
|
|
272
|
-
MuiTableCell: {
|
|
273
|
-
styleOverrides: {
|
|
274
|
-
root: ({ theme }) => ({
|
|
275
|
-
wordBreak: "break-word",
|
|
276
|
-
overflow: "hidden",
|
|
277
|
-
verticalAlign: "middle",
|
|
278
|
-
lineHeight: "1",
|
|
279
|
-
margin: 0,
|
|
280
|
-
padding: theme.spacing(3, 2, 3, 2.5),
|
|
281
|
-
borderBottom: 0
|
|
282
|
-
}),
|
|
283
|
-
sizeSmall: ({ theme }) => ({
|
|
284
|
-
padding: theme.spacing(1.5, 2, 1.5, 2.5)
|
|
285
|
-
}),
|
|
286
|
-
head: ({ theme }) => ({
|
|
287
|
-
wordBreak: "break-word",
|
|
288
|
-
overflow: "hidden",
|
|
289
|
-
color: theme.palette.textSubtle,
|
|
290
|
-
fontWeight: "normal",
|
|
291
|
-
lineHeight: "1"
|
|
292
|
-
})
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
MuiTabs: {
|
|
296
|
-
styleOverrides: {
|
|
297
|
-
// Tabs are smaller than default mui tab rows
|
|
298
|
-
root: {
|
|
299
|
-
minHeight: 24
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
MuiTab: {
|
|
304
|
-
styleOverrides: {
|
|
305
|
-
// Tabs are smaller and have a hover background
|
|
306
|
-
root: ({ theme }) => ({
|
|
307
|
-
color: theme.palette.link,
|
|
308
|
-
minHeight: 24,
|
|
309
|
-
textTransform: "initial",
|
|
310
|
-
letterSpacing: "0.07em",
|
|
311
|
-
"&:hover": {
|
|
312
|
-
color: darken(theme.palette.link, 0.3),
|
|
313
|
-
background: lighten(theme.palette.link, 0.95)
|
|
314
|
-
},
|
|
315
|
-
[theme.breakpoints.up("md")]: {
|
|
316
|
-
minWidth: 120,
|
|
317
|
-
fontSize: theme.typography.pxToRem(14),
|
|
318
|
-
fontWeight: 500
|
|
319
|
-
}
|
|
320
|
-
}),
|
|
321
|
-
textColorPrimary: ({ theme }) => ({
|
|
322
|
-
color: theme.palette.link
|
|
323
|
-
})
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
MuiTableSortLabel: {
|
|
327
|
-
styleOverrides: {
|
|
328
|
-
// No color change on hover, just rely on the arrow showing up instead.
|
|
329
|
-
root: {
|
|
330
|
-
color: "inherit",
|
|
331
|
-
"&:hover": {
|
|
332
|
-
color: "inherit"
|
|
333
|
-
},
|
|
334
|
-
"&:focus": {
|
|
335
|
-
color: "inherit"
|
|
336
|
-
},
|
|
337
|
-
// Bold font for highlighting selected column
|
|
338
|
-
"&.Mui-active": {
|
|
339
|
-
fontWeight: "bold",
|
|
340
|
-
color: "inherit"
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
MuiListItemText: {
|
|
346
|
-
styleOverrides: {
|
|
347
|
-
dense: {
|
|
348
|
-
// Default dense list items to adding ellipsis for really long str...
|
|
349
|
-
whiteSpace: "nowrap",
|
|
350
|
-
overflow: "hidden",
|
|
351
|
-
textOverflow: "ellipsis"
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
MuiButton: {
|
|
356
|
-
styleOverrides: {
|
|
357
|
-
text: {
|
|
358
|
-
// Text buttons have less padding by default, but we want to keep the original padding
|
|
359
|
-
padding: void 0
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
MuiChip: {
|
|
364
|
-
styleOverrides: {
|
|
365
|
-
root: ({ theme }) => ({
|
|
366
|
-
// By default there's no margin, but it's usually wanted, so we add some trailing margin
|
|
367
|
-
marginRight: theme.spacing(1),
|
|
368
|
-
marginBottom: theme.spacing(1)
|
|
369
|
-
}),
|
|
370
|
-
label: ({ theme }) => ({
|
|
371
|
-
lineHeight: theme.spacing(2.5),
|
|
372
|
-
fontWeight: theme.typography.fontWeightMedium,
|
|
373
|
-
fontSize: theme.spacing(1.75)
|
|
374
|
-
}),
|
|
375
|
-
labelSmall: ({ theme }) => ({
|
|
376
|
-
fontSize: theme.spacing(1.5)
|
|
377
|
-
}),
|
|
378
|
-
deleteIcon: ({ theme }) => ({
|
|
379
|
-
width: theme.spacing(3),
|
|
380
|
-
height: theme.spacing(3),
|
|
381
|
-
margin: theme.spacing(0, 0.75, 0, -0.75)
|
|
382
|
-
}),
|
|
383
|
-
deleteIconSmall: ({ theme }) => ({
|
|
384
|
-
width: theme.spacing(2),
|
|
385
|
-
height: theme.spacing(2),
|
|
386
|
-
margin: theme.spacing(0, 0.5, 0, -0.5)
|
|
387
|
-
})
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
MuiCard: {
|
|
391
|
-
styleOverrides: {
|
|
392
|
-
root: {
|
|
393
|
-
// When cards have a forced size, such as when they are arranged in a
|
|
394
|
-
// CSS grid, the content needs to flex such that the actions (buttons
|
|
395
|
-
// etc) end up at the bottom of the card instead of just below the body
|
|
396
|
-
// contents.
|
|
397
|
-
display: "flex",
|
|
398
|
-
flexDirection: "column"
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
MuiCardHeader: {
|
|
403
|
-
styleOverrides: {
|
|
404
|
-
root: {
|
|
405
|
-
// Reduce padding between header and content
|
|
406
|
-
paddingBottom: 0
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
MuiCardContent: {
|
|
411
|
-
styleOverrides: {
|
|
412
|
-
root: {
|
|
413
|
-
// When cards have a forced size, such as when they are arranged in a
|
|
414
|
-
// CSS grid, the content needs to flex such that the actions (buttons
|
|
415
|
-
// etc) end up at the bottom of the card instead of just below the body
|
|
416
|
-
// contents.
|
|
417
|
-
flexGrow: 1,
|
|
418
|
-
"&:last-child": {
|
|
419
|
-
paddingBottom: void 0
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
},
|
|
424
|
-
MuiCardActions: {
|
|
425
|
-
styleOverrides: {
|
|
426
|
-
root: {
|
|
427
|
-
// We default to putting the card actions at the end
|
|
428
|
-
justifyContent: "flex-end"
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
MuiLink: {
|
|
433
|
-
defaultProps: {
|
|
434
|
-
underline: "hover"
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
MuiPaper: {
|
|
438
|
-
styleOverrides: { root: { backgroundImage: "unset" } }
|
|
439
|
-
}
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
var __accessCheck = (obj, member, msg) => {
|
|
443
|
-
if (!member.has(obj))
|
|
444
|
-
throw TypeError("Cannot " + msg);
|
|
445
|
-
};
|
|
446
|
-
var __privateGet = (obj, member, getter) => {
|
|
447
|
-
__accessCheck(obj, member, "read from private field");
|
|
448
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
449
|
-
};
|
|
450
|
-
var __privateAdd = (obj, member, value) => {
|
|
451
|
-
if (member.has(obj))
|
|
452
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
453
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
454
|
-
};
|
|
455
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
456
|
-
__accessCheck(obj, member, "write to private field");
|
|
457
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
458
|
-
return value;
|
|
459
|
-
};
|
|
460
|
-
var _themes;
|
|
461
|
-
class UnifiedThemeHolder {
|
|
462
|
-
constructor(v4, v5) {
|
|
463
|
-
__privateAdd(this, _themes, /* @__PURE__ */ new Map());
|
|
464
|
-
__privateSet(this, _themes, /* @__PURE__ */ new Map());
|
|
465
|
-
if (v4) {
|
|
466
|
-
__privateGet(this, _themes).set("v4", v4);
|
|
467
|
-
}
|
|
468
|
-
if (v5) {
|
|
469
|
-
__privateGet(this, _themes).set("v5", v5);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
getTheme(version) {
|
|
473
|
-
return __privateGet(this, _themes).get(version);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
_themes = new WeakMap();
|
|
477
|
-
function createUnifiedTheme(options) {
|
|
478
|
-
const themeOptions = createBaseThemeOptions(options);
|
|
479
|
-
const components = { ...defaultComponentThemes, ...options.components };
|
|
480
|
-
const v5Theme = createTheme$1({ ...themeOptions, components });
|
|
481
|
-
const v4Overrides = transformV5ComponentThemesToV4(v5Theme, components);
|
|
482
|
-
const v4Theme = { ...createTheme$2(themeOptions), ...v4Overrides };
|
|
483
|
-
return new UnifiedThemeHolder(v4Theme, v5Theme);
|
|
484
|
-
}
|
|
485
|
-
function createUnifiedThemeFromV4(options) {
|
|
486
|
-
const v5Theme = adaptV4Theme(options);
|
|
487
|
-
const v4Theme = createTheme$2(options);
|
|
488
|
-
return new UnifiedThemeHolder(v4Theme, createTheme$1(v5Theme));
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
const palettes = {
|
|
492
|
-
light: {
|
|
493
|
-
type: "light",
|
|
494
|
-
mode: "light",
|
|
495
|
-
background: {
|
|
496
|
-
default: "#F8F8F8",
|
|
497
|
-
paper: "#FFFFFF"
|
|
498
|
-
},
|
|
499
|
-
status: {
|
|
500
|
-
ok: "#1DB954",
|
|
501
|
-
warning: "#FF9800",
|
|
502
|
-
error: "#E22134",
|
|
503
|
-
running: "#1F5493",
|
|
504
|
-
pending: "#FFED51",
|
|
505
|
-
aborted: "#757575"
|
|
506
|
-
},
|
|
507
|
-
bursts: {
|
|
508
|
-
fontColor: "#FEFEFE",
|
|
509
|
-
slackChannelText: "#ddd",
|
|
510
|
-
backgroundColor: {
|
|
511
|
-
default: "#7C3699"
|
|
512
|
-
},
|
|
513
|
-
gradient: {
|
|
514
|
-
linear: "linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
primary: {
|
|
518
|
-
main: "#1F5493"
|
|
519
|
-
},
|
|
520
|
-
banner: {
|
|
521
|
-
info: "#2E77D0",
|
|
522
|
-
error: "#E22134",
|
|
523
|
-
text: "#FFFFFF",
|
|
524
|
-
link: "#000000",
|
|
525
|
-
closeButtonColor: "#FFFFFF",
|
|
526
|
-
warning: "#FF9800"
|
|
527
|
-
},
|
|
528
|
-
border: "#E6E6E6",
|
|
529
|
-
textContrast: "#000000",
|
|
530
|
-
textVerySubtle: "#DDD",
|
|
531
|
-
textSubtle: "#6E6E6E",
|
|
532
|
-
highlight: "#FFFBCC",
|
|
533
|
-
errorBackground: "#FFEBEE",
|
|
534
|
-
warningBackground: "#F59B23",
|
|
535
|
-
infoBackground: "#ebf5ff",
|
|
536
|
-
errorText: "#CA001B",
|
|
537
|
-
infoText: "#004e8a",
|
|
538
|
-
warningText: "#000000",
|
|
539
|
-
linkHover: "#2196F3",
|
|
540
|
-
link: "#0A6EBE",
|
|
541
|
-
gold: "#FFD600",
|
|
542
|
-
navigation: {
|
|
543
|
-
background: "#171717",
|
|
544
|
-
indicator: "#9BF0E1",
|
|
545
|
-
color: "#b5b5b5",
|
|
546
|
-
selectedColor: "#FFF",
|
|
547
|
-
navItem: {
|
|
548
|
-
hoverBackground: "#404040"
|
|
549
|
-
},
|
|
550
|
-
submenu: {
|
|
551
|
-
background: "#404040"
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
pinSidebarButton: {
|
|
555
|
-
icon: "#181818",
|
|
556
|
-
background: "#BDBDBD"
|
|
557
|
-
},
|
|
558
|
-
tabbar: {
|
|
559
|
-
indicator: "#9BF0E1"
|
|
560
|
-
}
|
|
561
|
-
},
|
|
562
|
-
dark: {
|
|
563
|
-
type: "dark",
|
|
564
|
-
mode: "dark",
|
|
565
|
-
background: {
|
|
566
|
-
default: "#333333",
|
|
567
|
-
paper: "#424242"
|
|
568
|
-
},
|
|
569
|
-
status: {
|
|
570
|
-
ok: "#71CF88",
|
|
571
|
-
warning: "#FFB84D",
|
|
572
|
-
error: "#F84C55",
|
|
573
|
-
running: "#3488E3",
|
|
574
|
-
pending: "#FEF071",
|
|
575
|
-
aborted: "#9E9E9E"
|
|
576
|
-
},
|
|
577
|
-
bursts: {
|
|
578
|
-
fontColor: "#FEFEFE",
|
|
579
|
-
slackChannelText: "#ddd",
|
|
580
|
-
backgroundColor: {
|
|
581
|
-
default: "#7C3699"
|
|
582
|
-
},
|
|
583
|
-
gradient: {
|
|
584
|
-
linear: "linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"
|
|
585
|
-
}
|
|
586
|
-
},
|
|
587
|
-
primary: {
|
|
588
|
-
main: "#9CC9FF",
|
|
589
|
-
dark: "#82BAFD"
|
|
590
|
-
},
|
|
591
|
-
secondary: {
|
|
592
|
-
main: "#FF88B2"
|
|
593
|
-
},
|
|
594
|
-
banner: {
|
|
595
|
-
info: "#2E77D0",
|
|
596
|
-
error: "#E22134",
|
|
597
|
-
text: "#FFFFFF",
|
|
598
|
-
link: "#000000",
|
|
599
|
-
closeButtonColor: "#FFFFFF",
|
|
600
|
-
warning: "#FF9800"
|
|
601
|
-
},
|
|
602
|
-
border: "#E6E6E6",
|
|
603
|
-
textContrast: "#FFFFFF",
|
|
604
|
-
textVerySubtle: "#727272",
|
|
605
|
-
textSubtle: "#CCCCCC",
|
|
606
|
-
highlight: "#FFFBCC",
|
|
607
|
-
errorBackground: "#FFEBEE",
|
|
608
|
-
warningBackground: "#F59B23",
|
|
609
|
-
infoBackground: "#ebf5ff",
|
|
610
|
-
errorText: "#CA001B",
|
|
611
|
-
infoText: "#004e8a",
|
|
612
|
-
warningText: "#000000",
|
|
613
|
-
linkHover: "#82BAFD",
|
|
614
|
-
link: "#9CC9FF",
|
|
615
|
-
gold: "#FFD600",
|
|
616
|
-
navigation: {
|
|
617
|
-
background: "#424242",
|
|
618
|
-
indicator: "#9BF0E1",
|
|
619
|
-
color: "#b5b5b5",
|
|
620
|
-
selectedColor: "#FFF",
|
|
621
|
-
navItem: {
|
|
622
|
-
hoverBackground: "#404040"
|
|
623
|
-
},
|
|
624
|
-
submenu: {
|
|
625
|
-
background: "#404040"
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
pinSidebarButton: {
|
|
629
|
-
icon: "#404040",
|
|
630
|
-
background: "#BDBDBD"
|
|
631
|
-
},
|
|
632
|
-
tabbar: {
|
|
633
|
-
indicator: "#9BF0E1"
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
const themes = {
|
|
639
|
-
light: createUnifiedTheme({ palette: palettes.light }),
|
|
640
|
-
dark: createUnifiedTheme({ palette: palettes.dark })
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
unstable_ClassNameGenerator.configure((componentName) => {
|
|
644
|
-
return `v5-${componentName}`;
|
|
645
|
-
});
|
|
646
|
-
|
|
647
|
-
const generateV4ClassName = createGenerateClassName({
|
|
648
|
-
productionPrefix: "jss4-"
|
|
649
|
-
});
|
|
650
|
-
function UnifiedThemeProvider(props) {
|
|
651
|
-
const { children, theme, noCssBaseline = false } = props;
|
|
652
|
-
const v4Theme = theme.getTheme("v4");
|
|
653
|
-
const v5Theme = theme.getTheme("v5");
|
|
654
|
-
let cssBaseline = void 0;
|
|
655
|
-
if (!noCssBaseline) {
|
|
656
|
-
cssBaseline = /* @__PURE__ */ React.createElement(CssBaseline, null);
|
|
657
|
-
}
|
|
658
|
-
let result = /* @__PURE__ */ React.createElement(React.Fragment, null, cssBaseline, children);
|
|
659
|
-
if (v4Theme) {
|
|
660
|
-
result = /* @__PURE__ */ React.createElement(StylesProvider, { generateClassName: generateV4ClassName }, /* @__PURE__ */ React.createElement(ThemeProvider, { theme: v4Theme }, result));
|
|
661
|
-
}
|
|
662
|
-
if (v5Theme) {
|
|
663
|
-
result = /* @__PURE__ */ React.createElement(StyledEngineProvider, { injectFirst: true }, /* @__PURE__ */ React.createElement(ThemeProvider$1, { theme: v5Theme }, result));
|
|
664
|
-
}
|
|
665
|
-
return result;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
function createThemeOptions(options) {
|
|
669
|
-
var _a, _b, _c, _d;
|
|
670
|
-
return {
|
|
671
|
-
props: {
|
|
672
|
-
MuiGrid: (_b = (_a = defaultComponentThemes) == null ? void 0 : _a.MuiGrid) == null ? void 0 : _b.defaultProps,
|
|
673
|
-
MuiSwitch: (_d = (_c = defaultComponentThemes) == null ? void 0 : _c.MuiSwitch) == null ? void 0 : _d.defaultProps
|
|
674
|
-
},
|
|
675
|
-
...createBaseThemeOptions(options)
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
function createThemeOverrides(theme) {
|
|
679
|
-
return transformV5ComponentThemesToV4(
|
|
680
|
-
// Safe but we have to make sure we don't use mui5 specific stuff in the default component themes
|
|
681
|
-
theme,
|
|
682
|
-
defaultComponentThemes
|
|
683
|
-
).overrides;
|
|
684
|
-
}
|
|
685
|
-
function createTheme(options) {
|
|
686
|
-
const themeOptions = createThemeOptions(options);
|
|
687
|
-
const baseTheme = createTheme$2(themeOptions);
|
|
688
|
-
const overrides = createThemeOverrides(baseTheme);
|
|
689
|
-
const theme = { ...baseTheme, overrides };
|
|
690
|
-
return theme;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
const lightTheme = createTheme({
|
|
694
|
-
palette: palettes.light
|
|
695
|
-
});
|
|
696
|
-
const darkTheme = createTheme({
|
|
697
|
-
palette: palettes.dark
|
|
698
|
-
});
|
|
699
|
-
|
|
700
|
-
export { UnifiedThemeProvider, colorVariants, createBaseThemeOptions, createTheme, createThemeOptions, createThemeOverrides, createUnifiedTheme, createUnifiedThemeFromV4, darkTheme, defaultComponentThemes, defaultTypography, genPageTheme, lightTheme, pageTheme, palettes, shapes, themes, transformV5ComponentThemesToV4 };
|
|
1
|
+
export { transformV5ComponentThemesToV4 } from './unified/overrides.esm.js';
|
|
2
|
+
export { createUnifiedTheme, createUnifiedThemeFromV4 } from './unified/UnifiedTheme.esm.js';
|
|
3
|
+
export { themes } from './unified/themes.esm.js';
|
|
4
|
+
export { UnifiedThemeProvider } from './unified/UnifiedThemeProvider.esm.js';
|
|
5
|
+
export { createBaseThemeOptions, defaultTypography } from './base/createBaseThemeOptions.esm.js';
|
|
6
|
+
export { colorVariants, genPageTheme, pageTheme, shapes } from './base/pageTheme.esm.js';
|
|
7
|
+
export { palettes } from './base/palettes.esm.js';
|
|
8
|
+
export { darkTheme, lightTheme } from './v4/themes.esm.js';
|
|
9
|
+
export { createTheme, createThemeOptions, createThemeOverrides } from './v4/baseTheme.esm.js';
|
|
10
|
+
export { defaultComponentThemes } from './v5/defaultComponentThemes.esm.js';
|
|
701
11
|
//# sourceMappingURL=index.esm.js.map
|