sage-nexus-ui 1.0.0
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/.storybook/main.ts +22 -0
- package/.storybook/preview.ts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.mjs +140 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src/components/ActionBar.d.ts +8 -0
- package/dist/src/components/NexusHome.d.ts +1 -0
- package/dist/src/components/TextHighlightAi.d.ts +7 -0
- package/dist/src/components/ThemeToggle.d.ts +1 -0
- package/dist/src/components/index.d.ts +4 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/stories/Button.d.ts +15 -0
- package/dist/src/stories/Button.stories.d.ts +23 -0
- package/dist/src/stories/EmTestComponent.stories.d.ts +6 -0
- package/dist/src/stories/Header.d.ts +12 -0
- package/dist/src/stories/Header.stories.d.ts +18 -0
- package/dist/src/stories/Page.d.ts +3 -0
- package/dist/src/stories/Page.stories.d.ts +12 -0
- package/dist/src/theme/MuiAppThemeProvider.d.ts +7 -0
- package/dist/src/theme/ThemeContext.d.ts +9 -0
- package/dist/src/theme/sageTheme.d.ts +49 -0
- package/dist/src/theme/sxHelpers.d.ts +13 -0
- package/package.json +57 -0
- package/rollup-plugins.d.ts +5 -0
- package/rollup.config.ts +39 -0
- package/src/assets/fonts/SageHeadline-Black.otf +0 -0
- package/src/assets/fonts/SageText-Bold.otf +0 -0
- package/src/assets/fonts/SageText-BoldItalic.otf +0 -0
- package/src/assets/fonts/SageText-Light.otf +0 -0
- package/src/assets/fonts/SageText-LightItalic.otf +0 -0
- package/src/assets/fonts/SageText-Medium.otf +0 -0
- package/src/assets/fonts/SageText-MediumItalic.otf +0 -0
- package/src/assets/fonts/SageText-Regular.otf +0 -0
- package/src/assets/fonts/SageText-RegularItalic.otf +0 -0
- package/src/assets/fonts/SageUI-Bold.otf +0 -0
- package/src/assets/fonts/SageUI-Medium.otf +0 -0
- package/src/assets/fonts/SageUI-Regular.otf +0 -0
- package/src/assets/images/Logo.svg +3 -0
- package/src/assets/images/S-sage-logo-nobg.svg +3 -0
- package/src/assets/images/S-sage-logo.svg +4 -0
- package/src/assets/images/nexus-logo-icon.svg +31 -0
- package/src/components/ActionBar.tsx +105 -0
- package/src/components/NexusHome.tsx +36 -0
- package/src/components/TextHighlightAi.tsx +34 -0
- package/src/components/ThemeToggle.tsx +22 -0
- package/src/components/index.ts +11 -0
- package/src/index.ts +1 -0
- package/src/stories/Button.stories.ts +54 -0
- package/src/stories/Button.tsx +37 -0
- package/src/stories/Configure.mdx +388 -0
- package/src/stories/EmTestComponent.stories.ts +14 -0
- package/src/stories/Header.stories.ts +34 -0
- package/src/stories/Header.tsx +56 -0
- package/src/stories/Page.stories.ts +33 -0
- package/src/stories/Page.tsx +91 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/src/theme/MuiAppThemeProvider.tsx +21 -0
- package/src/theme/ThemeContext.tsx +27 -0
- package/src/theme/sageTheme.ts +565 -0
- package/src/theme/sxHelpers.ts +14 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +27 -0
- package/vite.config.ts +12 -0
- package/vitest.config.ts +36 -0
- package/vitest.shims.d.ts +1 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import "@mui/x-data-grid/themeAugmentation";
|
|
2
|
+
|
|
3
|
+
import { alpha, createTheme, type Theme } from "@mui/material/styles";
|
|
4
|
+
|
|
5
|
+
export type ThemeMode = "light" | "dark";
|
|
6
|
+
|
|
7
|
+
type ModeTokens = {
|
|
8
|
+
background: {
|
|
9
|
+
default: string;
|
|
10
|
+
paper: string;
|
|
11
|
+
subtle: string;
|
|
12
|
+
};
|
|
13
|
+
text: {
|
|
14
|
+
primary: string;
|
|
15
|
+
secondary: string;
|
|
16
|
+
greens: string;
|
|
17
|
+
};
|
|
18
|
+
border: string;
|
|
19
|
+
shadow: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type GradientBorderOptions = {
|
|
23
|
+
borderRadius?: number;
|
|
24
|
+
padding?: number;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const colours = {
|
|
28
|
+
brilliantGreen: "#00D639",
|
|
29
|
+
primaryGreenHover: "#00BE32",
|
|
30
|
+
primaryGreenActive: "#00AA2D",
|
|
31
|
+
jade: "#00A65C",
|
|
32
|
+
teal: "#006362",
|
|
33
|
+
navy: "#00293F",
|
|
34
|
+
cherry: "#cc0f4b",
|
|
35
|
+
terra: "#A13829",
|
|
36
|
+
amber: "#E9875B",
|
|
37
|
+
gold: "#F5C518",
|
|
38
|
+
black: "#000000",
|
|
39
|
+
white: "#FFFFFF",
|
|
40
|
+
darkGrey: "#55616D",
|
|
41
|
+
lightGrey: "#ffffffc2",
|
|
42
|
+
} as const;
|
|
43
|
+
|
|
44
|
+
export const gradients = {
|
|
45
|
+
brand: `linear-gradient(135deg, ${colours.brilliantGreen} 0%, ${colours.jade} 42%, ${colours.teal} 100%)`,
|
|
46
|
+
nexus: `linear-gradient(135deg, ${colours.brilliantGreen} 0%, #00D6DE 40%, #2D60FF 100%)`,
|
|
47
|
+
textHighlightAi: `linear-gradient(30deg, ${colours.brilliantGreen} 0%, #00D6DE 40%, #9D60FF 90%)`,
|
|
48
|
+
mesh: `radial-gradient(circle at top right, ${alpha(colours.brilliantGreen, 0.16)} 0%, transparent 34%), linear-gradient(135deg, ${alpha(colours.jade, 0.08)} 0%, ${alpha(colours.teal, 0.12)} 100%)`,
|
|
49
|
+
} as const;
|
|
50
|
+
|
|
51
|
+
const getModeTokens = (mode: ThemeMode): ModeTokens => {
|
|
52
|
+
const isDark = mode === "dark";
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
background: {
|
|
56
|
+
default: isDark ? colours.black : "#F5F7F6",
|
|
57
|
+
paper: isDark ? "#111111" : colours.white,
|
|
58
|
+
subtle: isDark ? "#1A1A1A" : "#EEF2EF",
|
|
59
|
+
},
|
|
60
|
+
text: {
|
|
61
|
+
primary: isDark ? colours.white : colours.black,
|
|
62
|
+
secondary: isDark ? colours.lightGrey : colours.darkGrey,
|
|
63
|
+
greens: isDark ? colours.brilliantGreen : colours.jade,
|
|
64
|
+
},
|
|
65
|
+
border: isDark ? "rgba(255, 255, 255, 0.10)" : "rgba(0, 0, 0, 0.10)",
|
|
66
|
+
shadow: isDark
|
|
67
|
+
? "0 28px 80px rgba(0, 0, 0, 0.42)"
|
|
68
|
+
: "0 24px 64px rgba(0, 41, 63, 0.12)",
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const getGradientBorderStyles = (
|
|
73
|
+
theme: Theme,
|
|
74
|
+
options: GradientBorderOptions = {},
|
|
75
|
+
) => {
|
|
76
|
+
const { borderRadius = theme.shape.borderRadius, padding = 1 } = options;
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
position: "relative",
|
|
80
|
+
borderRadius,
|
|
81
|
+
border: `${padding}px solid transparent`,
|
|
82
|
+
background: theme.palette.background.paper,
|
|
83
|
+
backgroundClip: "padding-box",
|
|
84
|
+
"&::before": {
|
|
85
|
+
content: '""',
|
|
86
|
+
position: "absolute",
|
|
87
|
+
inset: 0,
|
|
88
|
+
borderRadius: "inherit",
|
|
89
|
+
padding: `${padding}px`,
|
|
90
|
+
background: gradients.brand,
|
|
91
|
+
WebkitMask:
|
|
92
|
+
"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",
|
|
93
|
+
WebkitMaskComposite: "xor",
|
|
94
|
+
maskComposite: "exclude",
|
|
95
|
+
pointerEvents: "none",
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const createSageTheme = (mode: ThemeMode = "light"): Theme => {
|
|
101
|
+
const tokens = getModeTokens(mode);
|
|
102
|
+
const outlinedPrimaryColor =
|
|
103
|
+
mode === "dark" ? colours.brilliantGreen : colours.jade;
|
|
104
|
+
const outlinedPrimaryHoverColor =
|
|
105
|
+
mode === "dark" ? colours.primaryGreenHover : colours.primaryGreenActive;
|
|
106
|
+
const buttonTransition =
|
|
107
|
+
"color 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease";
|
|
108
|
+
|
|
109
|
+
return createTheme({
|
|
110
|
+
palette: {
|
|
111
|
+
mode,
|
|
112
|
+
primary: {
|
|
113
|
+
main: colours.brilliantGreen,
|
|
114
|
+
dark: colours.primaryGreenActive,
|
|
115
|
+
contrastText: colours.black,
|
|
116
|
+
},
|
|
117
|
+
secondary: {
|
|
118
|
+
main: colours.teal,
|
|
119
|
+
contrastText: colours.white,
|
|
120
|
+
},
|
|
121
|
+
success: {
|
|
122
|
+
main: colours.jade,
|
|
123
|
+
contrastText: colours.white,
|
|
124
|
+
},
|
|
125
|
+
warning: {
|
|
126
|
+
main: colours.amber,
|
|
127
|
+
contrastText: colours.white,
|
|
128
|
+
},
|
|
129
|
+
error: {
|
|
130
|
+
main: colours.cherry,
|
|
131
|
+
contrastText: colours.white,
|
|
132
|
+
},
|
|
133
|
+
info: {
|
|
134
|
+
main: colours.navy,
|
|
135
|
+
contrastText: colours.white,
|
|
136
|
+
},
|
|
137
|
+
background: {
|
|
138
|
+
default: tokens.background.default,
|
|
139
|
+
paper: tokens.background.paper,
|
|
140
|
+
},
|
|
141
|
+
text: tokens.text,
|
|
142
|
+
divider: tokens.border,
|
|
143
|
+
},
|
|
144
|
+
shape: {
|
|
145
|
+
borderRadius: 8,
|
|
146
|
+
},
|
|
147
|
+
typography: {
|
|
148
|
+
fontFamily: "SageText, Inter, Segoe UI, sans-serif",
|
|
149
|
+
button: {
|
|
150
|
+
fontFamily: "SageUI, Inter, Segoe UI, sans-serif",
|
|
151
|
+
fontSize: "0.95rem",
|
|
152
|
+
fontWeight: 600,
|
|
153
|
+
letterSpacing: "0.01em",
|
|
154
|
+
textTransform: "none",
|
|
155
|
+
},
|
|
156
|
+
overline: {
|
|
157
|
+
fontFamily: "SageUI, Inter, Segoe UI, sans-serif",
|
|
158
|
+
fontWeight: 700,
|
|
159
|
+
fontSize: "0.75rem",
|
|
160
|
+
letterSpacing: "0.12em",
|
|
161
|
+
textTransform: "uppercase",
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
shadows: [
|
|
165
|
+
"none",
|
|
166
|
+
"0 4px 14px rgba(0, 0, 0, 0.08)",
|
|
167
|
+
"0 10px 28px rgba(0, 0, 0, 0.10)",
|
|
168
|
+
"0 12px 36px rgba(0, 0, 0, 0.12)",
|
|
169
|
+
"0 16px 44px rgba(0, 0, 0, 0.14)",
|
|
170
|
+
"0 20px 48px rgba(0, 0, 0, 0.16)",
|
|
171
|
+
"0 24px 56px rgba(0, 0, 0, 0.18)",
|
|
172
|
+
"0 28px 64px rgba(0, 0, 0, 0.20)",
|
|
173
|
+
"0 32px 72px rgba(0, 0, 0, 0.22)",
|
|
174
|
+
"0 36px 80px rgba(0, 0, 0, 0.24)",
|
|
175
|
+
"0 40px 88px rgba(0, 0, 0, 0.26)",
|
|
176
|
+
"0 44px 96px rgba(0, 0, 0, 0.28)",
|
|
177
|
+
"0 48px 104px rgba(0, 0, 0, 0.30)",
|
|
178
|
+
"0 52px 112px rgba(0, 0, 0, 0.32)",
|
|
179
|
+
"0 56px 120px rgba(0, 0, 0, 0.34)",
|
|
180
|
+
"0 60px 128px rgba(0, 0, 0, 0.36)",
|
|
181
|
+
"0 64px 136px rgba(0, 0, 0, 0.38)",
|
|
182
|
+
"0 68px 144px rgba(0, 0, 0, 0.40)",
|
|
183
|
+
"0 72px 152px rgba(0, 0, 0, 0.42)",
|
|
184
|
+
"0 76px 160px rgba(0, 0, 0, 0.44)",
|
|
185
|
+
"0 80px 168px rgba(0, 0, 0, 0.46)",
|
|
186
|
+
"0 84px 176px rgba(0, 0, 0, 0.48)",
|
|
187
|
+
"0 88px 184px rgba(0, 0, 0, 0.50)",
|
|
188
|
+
"0 92px 192px rgba(0, 0, 0, 0.52)",
|
|
189
|
+
"0 96px 200px rgba(0, 0, 0, 0.54)",
|
|
190
|
+
],
|
|
191
|
+
components: {
|
|
192
|
+
MuiCssBaseline: {
|
|
193
|
+
styleOverrides: {
|
|
194
|
+
html: {
|
|
195
|
+
backgroundColor: tokens.background.default,
|
|
196
|
+
},
|
|
197
|
+
body: {
|
|
198
|
+
backgroundColor: tokens.background.default,
|
|
199
|
+
fontFamily: "SageText, Inter, Segoe UI, sans-serif",
|
|
200
|
+
color: tokens.text.primary,
|
|
201
|
+
"--sage-text-greens": tokens.text.greens,
|
|
202
|
+
transition: "background-color 200ms ease, color 200ms ease",
|
|
203
|
+
},
|
|
204
|
+
"#root": {
|
|
205
|
+
minHeight: "100vh",
|
|
206
|
+
},
|
|
207
|
+
"::selection": {
|
|
208
|
+
backgroundColor: alpha(colours.brilliantGreen, 0.28),
|
|
209
|
+
color: tokens.text.primary,
|
|
210
|
+
},
|
|
211
|
+
a: {
|
|
212
|
+
color: tokens.text.greens,
|
|
213
|
+
"&:hover": {
|
|
214
|
+
color: tokens.text.secondary,
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
".greens": {
|
|
218
|
+
color: "var(--sage-text-greens)",
|
|
219
|
+
fontWeight: 700,
|
|
220
|
+
},
|
|
221
|
+
".greys": {
|
|
222
|
+
color: tokens.text.secondary,
|
|
223
|
+
},
|
|
224
|
+
h1: {
|
|
225
|
+
color: tokens.text.primary,
|
|
226
|
+
fontSize: "clamp(2rem, 3vw, 2.75rem)",
|
|
227
|
+
lineHeight: 1.08,
|
|
228
|
+
letterSpacing: "-0.02em",
|
|
229
|
+
fontWeight: 700,
|
|
230
|
+
margin: 0,
|
|
231
|
+
},
|
|
232
|
+
h2: {
|
|
233
|
+
color: tokens.text.secondary,
|
|
234
|
+
fontSize: "1.5rem",
|
|
235
|
+
lineHeight: 1.2,
|
|
236
|
+
fontWeight: 600,
|
|
237
|
+
letterSpacing: "-0.01em",
|
|
238
|
+
margin: 0,
|
|
239
|
+
},
|
|
240
|
+
h3: {
|
|
241
|
+
color: tokens.text.greens,
|
|
242
|
+
fontSize: "0.8rem",
|
|
243
|
+
lineHeight: 1.25,
|
|
244
|
+
fontWeight: 600,
|
|
245
|
+
marginTop: 0,
|
|
246
|
+
marginBottom: 8,
|
|
247
|
+
textTransform: "uppercase",
|
|
248
|
+
},
|
|
249
|
+
h4: {
|
|
250
|
+
color: tokens.text.primary,
|
|
251
|
+
fontSize: "0.8rem",
|
|
252
|
+
lineHeight: 1,
|
|
253
|
+
fontWeight: 600,
|
|
254
|
+
margin: 0,
|
|
255
|
+
fontFamily: "SageText, Inter, Segoe UI, sans-serif",
|
|
256
|
+
},
|
|
257
|
+
p: {
|
|
258
|
+
fontSize: "0.8rem",
|
|
259
|
+
lineHeight: 1.4,
|
|
260
|
+
letterSpacing: "0",
|
|
261
|
+
margin: 0,
|
|
262
|
+
fontWeight: 400,
|
|
263
|
+
fontFamily: "SageText, Inter, Segoe UI, sans-serif",
|
|
264
|
+
},
|
|
265
|
+
aside: {
|
|
266
|
+
marginRight: 1.25,
|
|
267
|
+
borderLeft: "2px solid",
|
|
268
|
+
borderColor: tokens.text.secondary,
|
|
269
|
+
padding: "0 8px",
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
MuiPaper: {
|
|
274
|
+
defaultProps: {
|
|
275
|
+
elevation: 1,
|
|
276
|
+
},
|
|
277
|
+
styleOverrides: {
|
|
278
|
+
root: ({ theme }) => ({
|
|
279
|
+
backgroundImage: "none",
|
|
280
|
+
border: `1px solid ${tokens.border}`,
|
|
281
|
+
borderRadius: theme.shape.borderRadius,
|
|
282
|
+
padding: theme.spacing(1),
|
|
283
|
+
}),
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
MuiCard: {
|
|
287
|
+
styleOverrides: {
|
|
288
|
+
root: ({ theme }) => ({
|
|
289
|
+
borderRadius: theme.shape.borderRadius,
|
|
290
|
+
boxShadow: tokens.shadow,
|
|
291
|
+
border: `1px solid ${tokens.border}`,
|
|
292
|
+
}),
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
MuiButton: {
|
|
296
|
+
defaultProps: {
|
|
297
|
+
disableElevation: true,
|
|
298
|
+
},
|
|
299
|
+
styleOverrides: {
|
|
300
|
+
root: {
|
|
301
|
+
borderRadius: 999,
|
|
302
|
+
paddingInline: 18,
|
|
303
|
+
minHeight: 48,
|
|
304
|
+
transition: buttonTransition,
|
|
305
|
+
"&.MuiButton-containedPrimary": {
|
|
306
|
+
color: `${colours.black} !important`,
|
|
307
|
+
},
|
|
308
|
+
"&.MuiButton-containedPrimary:hover": {
|
|
309
|
+
color: `${colours.black} !important`,
|
|
310
|
+
},
|
|
311
|
+
"&.MuiButton-containedPrimary:active": {
|
|
312
|
+
color: `${colours.black} !important`,
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
contained: {
|
|
316
|
+
"&.MuiButton-containedPrimary": {
|
|
317
|
+
color: `${colours.black} !important`,
|
|
318
|
+
"&:hover": {
|
|
319
|
+
backgroundColor: colours.primaryGreenHover,
|
|
320
|
+
color: `${colours.black} !important`,
|
|
321
|
+
},
|
|
322
|
+
"&:active": {
|
|
323
|
+
color: `${colours.black} !important`,
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
"&.MuiButton-containedPrimary:hover": {
|
|
327
|
+
color: `${colours.black} !important`,
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
outlined: {
|
|
331
|
+
borderWidth: 1.5,
|
|
332
|
+
transition: buttonTransition,
|
|
333
|
+
"&:hover": {
|
|
334
|
+
borderWidth: 1.5,
|
|
335
|
+
},
|
|
336
|
+
"&.MuiButton-outlinedPrimary": {
|
|
337
|
+
color: outlinedPrimaryColor,
|
|
338
|
+
borderColor: alpha(
|
|
339
|
+
outlinedPrimaryColor,
|
|
340
|
+
mode === "dark" ? 0.8 : 0.72,
|
|
341
|
+
),
|
|
342
|
+
transition: buttonTransition,
|
|
343
|
+
"&:hover": {
|
|
344
|
+
color: outlinedPrimaryHoverColor,
|
|
345
|
+
borderColor: outlinedPrimaryHoverColor,
|
|
346
|
+
backgroundColor: alpha(
|
|
347
|
+
outlinedPrimaryHoverColor,
|
|
348
|
+
mode === "dark" ? 0.12 : 0.08,
|
|
349
|
+
),
|
|
350
|
+
transition: buttonTransition,
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
sizeSmall: {
|
|
355
|
+
minHeight: 0,
|
|
356
|
+
minWidth: 0,
|
|
357
|
+
paddingInline: 0,
|
|
358
|
+
paddingBlock: 0,
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
MuiChip: {
|
|
363
|
+
styleOverrides: {
|
|
364
|
+
root: {
|
|
365
|
+
borderRadius: 999,
|
|
366
|
+
fontFamily: "SageUI, Inter, Segoe UI, sans-serif",
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
MuiDivider: {
|
|
371
|
+
styleOverrides: {
|
|
372
|
+
root: {
|
|
373
|
+
borderColor: tokens.border,
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
MuiDataGrid: {
|
|
378
|
+
styleOverrides: {
|
|
379
|
+
root: ({ theme }) => ({
|
|
380
|
+
borderRadius: theme.shape.borderRadius,
|
|
381
|
+
border: `1px solid ${tokens.border}`,
|
|
382
|
+
backgroundColor: tokens.background.paper,
|
|
383
|
+
color: tokens.text.primary,
|
|
384
|
+
"--DataGrid-rowBorderColor": tokens.border,
|
|
385
|
+
"--DataGrid-containerBackground": tokens.background.paper,
|
|
386
|
+
"--DataGrid-pinnedBackground": tokens.background.paper,
|
|
387
|
+
"& .MuiDataGrid-toolbarContainer": {
|
|
388
|
+
padding: "12px 16px 0",
|
|
389
|
+
gap: 8,
|
|
390
|
+
},
|
|
391
|
+
"& .MuiDataGrid-toolbarContainer .MuiButton-root": {
|
|
392
|
+
minHeight: 36,
|
|
393
|
+
paddingInline: 12,
|
|
394
|
+
color: tokens.text.secondary,
|
|
395
|
+
},
|
|
396
|
+
"& .MuiDataGrid-toolbarContainer .MuiInputBase-root": {
|
|
397
|
+
borderRadius: 999,
|
|
398
|
+
backgroundColor: alpha(
|
|
399
|
+
colours.brilliantGreen,
|
|
400
|
+
mode === "dark" ? 0.08 : 0.05,
|
|
401
|
+
),
|
|
402
|
+
},
|
|
403
|
+
"& .MuiDataGrid-toolbarContainer .MuiInputBase-input": {
|
|
404
|
+
paddingBlock: 8,
|
|
405
|
+
},
|
|
406
|
+
"& .MuiDataGrid-overlay": {
|
|
407
|
+
backgroundColor: "transparent",
|
|
408
|
+
},
|
|
409
|
+
}),
|
|
410
|
+
columnHeaders: {
|
|
411
|
+
backgroundColor: alpha(
|
|
412
|
+
colours.brilliantGreen,
|
|
413
|
+
mode === "dark" ? 0.12 : 0.08,
|
|
414
|
+
),
|
|
415
|
+
borderBottom: `1px solid ${tokens.border}`,
|
|
416
|
+
},
|
|
417
|
+
columnHeader: {
|
|
418
|
+
"&:focus, &:focus-within": {
|
|
419
|
+
outline: "none",
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
columnHeaderTitle: {
|
|
423
|
+
fontWeight: 600,
|
|
424
|
+
},
|
|
425
|
+
cell: {
|
|
426
|
+
alignItems: "center",
|
|
427
|
+
borderTop: `1px solid ${tokens.border}`,
|
|
428
|
+
"&:focus, &:focus-within": {
|
|
429
|
+
outline: "none",
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
row: {
|
|
433
|
+
"&:hover": {
|
|
434
|
+
backgroundColor: alpha(
|
|
435
|
+
colours.brilliantGreen,
|
|
436
|
+
mode === "dark" ? 0.08 : 0.04,
|
|
437
|
+
),
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
footerContainer: {
|
|
441
|
+
borderTop: `1px solid ${tokens.border}`,
|
|
442
|
+
backgroundColor: alpha(
|
|
443
|
+
colours.brilliantGreen,
|
|
444
|
+
mode === "dark" ? 0.05 : 0.03,
|
|
445
|
+
),
|
|
446
|
+
},
|
|
447
|
+
sortIcon: {
|
|
448
|
+
color: colours.brilliantGreen,
|
|
449
|
+
},
|
|
450
|
+
menuIconButton: {
|
|
451
|
+
color: tokens.text.secondary,
|
|
452
|
+
},
|
|
453
|
+
withBorderColor: {
|
|
454
|
+
borderColor: tokens.border,
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
MuiListItemButton: {
|
|
459
|
+
styleOverrides: {
|
|
460
|
+
root: ({ theme }) => ({
|
|
461
|
+
borderRadius: theme.shape.borderRadius,
|
|
462
|
+
border: `1px solid ${tokens.border}`,
|
|
463
|
+
backgroundColor: tokens.background.paper,
|
|
464
|
+
color: tokens.text.primary,
|
|
465
|
+
}),
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
MuiAppBar: {
|
|
469
|
+
defaultProps: { elevation: 1 },
|
|
470
|
+
styleOverrides: {
|
|
471
|
+
root: {
|
|
472
|
+
backgroundColor: tokens.background.paper,
|
|
473
|
+
backgroundImage: "none",
|
|
474
|
+
borderBottom: `1px solid ${tokens.border}`,
|
|
475
|
+
borderRadius: 0,
|
|
476
|
+
color: tokens.text.primary,
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
},
|
|
480
|
+
MuiAccordion: {
|
|
481
|
+
defaultProps: { disableGutters: true, elevation: 0 },
|
|
482
|
+
styleOverrides: {
|
|
483
|
+
root: {
|
|
484
|
+
backgroundColor: "transparent",
|
|
485
|
+
border: `1px solid ${tokens.border}`,
|
|
486
|
+
borderRadius: "8px !important",
|
|
487
|
+
"&:before": { display: "none" },
|
|
488
|
+
"&.Mui-expanded": {
|
|
489
|
+
borderColor: alpha(
|
|
490
|
+
colours.brilliantGreen,
|
|
491
|
+
mode === "dark" ? 0.4 : 0.3,
|
|
492
|
+
),
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
MuiAccordionSummary: {
|
|
498
|
+
styleOverrides: {
|
|
499
|
+
root: ({ theme }) => ({
|
|
500
|
+
borderRadius: theme.shape.borderRadius,
|
|
501
|
+
minHeight: 24,
|
|
502
|
+
"&.Mui-expanded": { minHeight: 24 },
|
|
503
|
+
"&:focus-visible": {
|
|
504
|
+
outline: `2px solid ${outlinedPrimaryColor}`,
|
|
505
|
+
outlineOffset: 2,
|
|
506
|
+
},
|
|
507
|
+
padding: 0,
|
|
508
|
+
}),
|
|
509
|
+
content: { margin: "0", "&.Mui-expanded": { margin: "0" } },
|
|
510
|
+
expandIconWrapper: { color: tokens.text.secondary },
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
MuiAccordionDetails: {
|
|
514
|
+
styleOverrides: {
|
|
515
|
+
root: { padding: 0, borderTop: `1px solid ${tokens.border}` },
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
MuiTabs: {
|
|
519
|
+
styleOverrides: {
|
|
520
|
+
root: { minHeight: 40, borderBottom: `1px solid ${tokens.border}` },
|
|
521
|
+
indicator: { backgroundColor: colours.brilliantGreen, height: 2 },
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
MuiTab: {
|
|
525
|
+
styleOverrides: {
|
|
526
|
+
root: {
|
|
527
|
+
minHeight: 40,
|
|
528
|
+
fontFamily: "SageUI, Inter, Segoe UI, sans-serif",
|
|
529
|
+
fontWeight: 600,
|
|
530
|
+
fontSize: "0.85rem",
|
|
531
|
+
letterSpacing: "0.01em",
|
|
532
|
+
textTransform: "none",
|
|
533
|
+
color: tokens.text.secondary,
|
|
534
|
+
"&.Mui-selected": { color: tokens.text.primary },
|
|
535
|
+
"&:focus-visible": {
|
|
536
|
+
outline: `2px solid ${outlinedPrimaryColor}`,
|
|
537
|
+
outlineOffset: 2,
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
MuiDialog: {
|
|
543
|
+
styleOverrides: {
|
|
544
|
+
paper: ({ theme }) => ({
|
|
545
|
+
backgroundColor: tokens.background.paper,
|
|
546
|
+
backgroundImage: "none",
|
|
547
|
+
border: `1px solid ${tokens.border}`,
|
|
548
|
+
borderRadius: theme.shape.borderRadius,
|
|
549
|
+
boxShadow: tokens.shadow,
|
|
550
|
+
}),
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
MuiDialogTitle: {
|
|
554
|
+
styleOverrides: {
|
|
555
|
+
root: { paddingBottom: 8 },
|
|
556
|
+
},
|
|
557
|
+
},
|
|
558
|
+
MuiDialogContent: {
|
|
559
|
+
styleOverrides: {
|
|
560
|
+
root: { paddingTop: "8px !important" },
|
|
561
|
+
},
|
|
562
|
+
},
|
|
563
|
+
},
|
|
564
|
+
});
|
|
565
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const leftPipe = {
|
|
2
|
+
borderLeft: (theme: any) => `3px solid ${theme.palette.text.primary}`,
|
|
3
|
+
pl: 0.8,
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export const expandableText = (isExpanded: boolean) => ({
|
|
7
|
+
color: 'text.primary',
|
|
8
|
+
lineHeight: 1.45,
|
|
9
|
+
whiteSpace: isExpanded ? 'pre-line' : 'normal',
|
|
10
|
+
overflow: 'hidden',
|
|
11
|
+
display: isExpanded ? 'block' : '-webkit-box',
|
|
12
|
+
WebkitBoxOrient: 'vertical',
|
|
13
|
+
WebkitLineClamp: isExpanded ? 'unset' : 2,
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"isolatedModules": true,
|
|
9
|
+
"jsx": "react-jsx",
|
|
10
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
11
|
+
"module": "ESNext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"noFallthroughCasesInSwitch": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"strict": true,
|
|
18
|
+
"target": "ESNext",
|
|
19
|
+
"ignoreDeprecations": "6.0",
|
|
20
|
+
"baseUrl": ".",
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["src/*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["src"],
|
|
26
|
+
"exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx"]
|
|
27
|
+
}
|
package/vite.config.ts
ADDED
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import { defineConfig } from 'vitest/config';
|
|
5
|
+
|
|
6
|
+
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
|
7
|
+
|
|
8
|
+
import { playwright } from '@vitest/browser-playwright';
|
|
9
|
+
|
|
10
|
+
const dirname =
|
|
11
|
+
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
|
|
13
|
+
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
test: {
|
|
16
|
+
projects: [
|
|
17
|
+
{
|
|
18
|
+
extends: true,
|
|
19
|
+
plugins: [
|
|
20
|
+
// The plugin will run tests for the stories defined in your Storybook config
|
|
21
|
+
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
|
22
|
+
storybookTest({ configDir: path.join(dirname, '.storybook') }),
|
|
23
|
+
],
|
|
24
|
+
test: {
|
|
25
|
+
name: 'storybook',
|
|
26
|
+
browser: {
|
|
27
|
+
enabled: true,
|
|
28
|
+
headless: true,
|
|
29
|
+
provider: playwright({}),
|
|
30
|
+
instances: [{ browser: 'chromium' }],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@vitest/browser-playwright" />
|