@graphcommerce/docs 3.1.4 → 4.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/CHANGELOG.md +9 -0
- package/{content/framework → framework}/deployment.md +0 -0
- package/{content/framework → framework}/environment-variables.md +0 -0
- package/{content/framework → framework}/favicon.md +0 -0
- package/{content/framework → framework}/graphcms.md +0 -0
- package/{content/framework → framework}/icons.md +0 -0
- package/{content/framework → framework}/readme.md +0 -0
- package/{content/framework → framework}/seo.md +0 -0
- package/{content/framework → framework}/static-file-serving.md +0 -0
- package/{content/framework → framework}/static-generation.md +0 -0
- package/{content/framework → framework}/theming.md +0 -0
- package/{content/framework → framework}/translations.md +0 -0
- package/{content/framework → framework}/troubleshooting.md +0 -0
- package/{content/framework → framework}/typography.md +0 -0
- package/{content/getting-started → getting-started}/create.md +0 -0
- package/{content/getting-started → getting-started}/graphcms-component.md +0 -0
- package/{content/getting-started → getting-started}/header.md +0 -0
- package/{content/getting-started → getting-started}/pages.md +0 -0
- package/{content/getting-started → getting-started}/readme.md +0 -0
- package/{content/getting-started → getting-started}/start-building.md +0 -0
- package/{content/getting-started → getting-started}/vscode.md +0 -0
- package/package.json +6 -51
- package/{content/readme.md → readme.md} +0 -0
- package/{content/roadmap.md → roadmap.md} +0 -0
- package/.babelrc +0 -4
- package/components/Layout/LayoutFull.tsx +0 -85
- package/components/Layout/Logo.tsx +0 -19
- package/components/Layout/graphcommerce.svg +0 -34
- package/components/Search.tsx +0 -37
- package/components/SearchForm.tsx +0 -110
- package/components/SidebarMenu/index.tsx +0 -101
- package/components/prism.css +0 -274
- package/components/rehype-prism-plus.css +0 -49
- package/components/theme.ts +0 -410
- package/lib/DocumentIndexer.ts +0 -59
- package/lib/files.ts +0 -168
- package/lib/instantSearch.ts +0 -26
- package/lib/typesense/IndexerHandler.ts +0 -47
- package/lib/typesense/Leaves.ts +0 -37
- package/lib/typesense/SearchIndexer.ts +0 -64
- package/lib/typesense/batchInterable.ts +0 -13
- package/lib/typesense/createInstantSearchProps.ts +0 -36
- package/lib/typesense/typesenseClientConf.ts +0 -23
- package/lib/typesense/typesenseIndexerHandler.ts +0 -23
- package/next-env.d.ts +0 -5
- package/next.config.js +0 -21
- package/pages/[[...url]].tsx +0 -391
- package/pages/_app.tsx +0 -26
- package/pages/_document.tsx +0 -22
- package/pages/api/reindex.ts +0 -4
- package/pages/menu/[[...url]].tsx +0 -69
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +0 -12
- package/public/link.svg +0 -4
- package/public/manifest/favicon-192.png +0 -0
- package/public/manifest/favicon-512.png +0 -0
- package/public/manifest.webmanifest +0 -20
package/components/prism.css
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
pre[class*='language-'],
|
|
2
|
-
code[class*='language-'] {
|
|
3
|
-
color: #d4d4d4;
|
|
4
|
-
/* font-size: 13px; */
|
|
5
|
-
text-shadow: none;
|
|
6
|
-
direction: ltr;
|
|
7
|
-
text-align: left;
|
|
8
|
-
white-space: pre;
|
|
9
|
-
word-spacing: normal;
|
|
10
|
-
word-break: normal;
|
|
11
|
-
line-height: 1.5;
|
|
12
|
-
-moz-tab-size: 4;
|
|
13
|
-
-o-tab-size: 4;
|
|
14
|
-
tab-size: 4;
|
|
15
|
-
-webkit-hyphens: none;
|
|
16
|
-
-moz-hyphens: none;
|
|
17
|
-
-ms-hyphens: none;
|
|
18
|
-
hyphens: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
pre[class*='language-']::selection,
|
|
22
|
-
code[class*='language-']::selection,
|
|
23
|
-
pre[class*='language-'] *::selection,
|
|
24
|
-
code[class*='language-'] *::selection {
|
|
25
|
-
text-shadow: none;
|
|
26
|
-
background: #264f78;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@media print {
|
|
30
|
-
pre[class*='language-'],
|
|
31
|
-
code[class*='language-'] {
|
|
32
|
-
text-shadow: none;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
pre[class*='language-'] {
|
|
37
|
-
padding: 1em;
|
|
38
|
-
margin: 0.5em 0;
|
|
39
|
-
overflow: auto;
|
|
40
|
-
background: #1e1e1e;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:not(pre) > code[class*='language-'] {
|
|
44
|
-
padding: 0.1em 0.3em;
|
|
45
|
-
border-radius: 0.3em;
|
|
46
|
-
color: #db4c69;
|
|
47
|
-
background: #1e1e1e;
|
|
48
|
-
}
|
|
49
|
-
/*********************************************************
|
|
50
|
-
* Tokens
|
|
51
|
-
*/
|
|
52
|
-
.namespace {
|
|
53
|
-
opacity: 0.7;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.token.doctype .token.doctype-tag {
|
|
57
|
-
color: #569cd6;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.token.doctype .token.name {
|
|
61
|
-
color: #9cdcfe;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.token.comment,
|
|
65
|
-
.token.prolog {
|
|
66
|
-
color: #6a9955;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.token.punctuation,
|
|
70
|
-
.language-html .language-css .token.punctuation,
|
|
71
|
-
.language-html .language-javascript .token.punctuation {
|
|
72
|
-
color: #d4d4d4;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.token.property,
|
|
76
|
-
.token.tag,
|
|
77
|
-
.token.boolean,
|
|
78
|
-
.token.number,
|
|
79
|
-
.token.constant,
|
|
80
|
-
.token.symbol,
|
|
81
|
-
.token.inserted,
|
|
82
|
-
.token.unit {
|
|
83
|
-
color: #b5cea8;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.token.selector,
|
|
87
|
-
.token.attr-name,
|
|
88
|
-
.token.string,
|
|
89
|
-
.token.char,
|
|
90
|
-
.token.builtin,
|
|
91
|
-
.token.deleted {
|
|
92
|
-
color: #ce9178;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.language-css .token.string.url {
|
|
96
|
-
text-decoration: underline;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.token.operator,
|
|
100
|
-
.token.entity {
|
|
101
|
-
color: #d4d4d4;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.token.operator.arrow {
|
|
105
|
-
color: #569cd6;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.token.atrule {
|
|
109
|
-
color: #ce9178;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.token.atrule .token.rule {
|
|
113
|
-
color: #c586c0;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.token.atrule .token.url {
|
|
117
|
-
color: #9cdcfe;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.token.atrule .token.url .token.function {
|
|
121
|
-
color: #dcdcaa;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.token.atrule .token.url .token.punctuation {
|
|
125
|
-
color: #d4d4d4;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.token.keyword {
|
|
129
|
-
color: #569cd6;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.token.keyword.module,
|
|
133
|
-
.token.keyword.control-flow {
|
|
134
|
-
color: #c586c0;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.token.function,
|
|
138
|
-
.token.function .token.maybe-class-name {
|
|
139
|
-
color: #dcdcaa;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.token.regex {
|
|
143
|
-
color: #d16969;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.token.important {
|
|
147
|
-
color: #569cd6;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.token.italic {
|
|
151
|
-
font-style: italic;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.token.constant {
|
|
155
|
-
color: #9cdcfe;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.token.class-name,
|
|
159
|
-
.token.maybe-class-name {
|
|
160
|
-
color: #4ec9b0;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.token.console {
|
|
164
|
-
color: #9cdcfe;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.token.parameter {
|
|
168
|
-
color: #9cdcfe;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.token.interpolation {
|
|
172
|
-
color: #9cdcfe;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.token.punctuation.interpolation-punctuation {
|
|
176
|
-
color: #569cd6;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.token.boolean {
|
|
180
|
-
color: #569cd6;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.token.property,
|
|
184
|
-
.token.variable,
|
|
185
|
-
.token.imports .token.maybe-class-name,
|
|
186
|
-
.token.exports .token.maybe-class-name {
|
|
187
|
-
color: #9cdcfe;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.token.selector {
|
|
191
|
-
color: #d7ba7d;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.token.escape {
|
|
195
|
-
color: #d7ba7d;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.token.tag {
|
|
199
|
-
color: #569cd6;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.token.tag .token.punctuation {
|
|
203
|
-
color: #808080;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.token.cdata {
|
|
207
|
-
color: #808080;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.token.attr-name {
|
|
211
|
-
color: #9cdcfe;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.token.attr-value,
|
|
215
|
-
.token.attr-value .token.punctuation {
|
|
216
|
-
color: #ce9178;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.token.attr-value .token.punctuation.attr-equals {
|
|
220
|
-
color: #d4d4d4;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.token.entity {
|
|
224
|
-
color: #569cd6;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.token.namespace {
|
|
228
|
-
color: #4ec9b0;
|
|
229
|
-
}
|
|
230
|
-
/*********************************************************
|
|
231
|
-
* Language Specific
|
|
232
|
-
*/
|
|
233
|
-
|
|
234
|
-
pre[class*='language-javascript'],
|
|
235
|
-
code[class*='language-javascript'],
|
|
236
|
-
pre[class*='language-jsx'],
|
|
237
|
-
code[class*='language-jsx'],
|
|
238
|
-
pre[class*='language-typescript'],
|
|
239
|
-
code[class*='language-typescript'],
|
|
240
|
-
pre[class*='language-tsx'],
|
|
241
|
-
code[class*='language-tsx'] {
|
|
242
|
-
color: #9cdcfe;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
pre[class*='language-css'],
|
|
246
|
-
code[class*='language-css'] {
|
|
247
|
-
color: #ce9178;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
pre[class*='language-html'],
|
|
251
|
-
code[class*='language-html'] {
|
|
252
|
-
color: #d4d4d4;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.language-regex .token.anchor {
|
|
256
|
-
color: #dcdcaa;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.language-html .token.punctuation {
|
|
260
|
-
color: #808080;
|
|
261
|
-
}
|
|
262
|
-
/*********************************************************
|
|
263
|
-
* Line highlighting
|
|
264
|
-
*/
|
|
265
|
-
pre[class*='language-'] > code[class*='language-'] {
|
|
266
|
-
position: relative;
|
|
267
|
-
z-index: 1;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.line-highlight.line-highlight {
|
|
271
|
-
background: #f7ebc6;
|
|
272
|
-
box-shadow: inset 5px 0 0 #f7d87c;
|
|
273
|
-
z-index: 0;
|
|
274
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
pre {
|
|
2
|
-
overflow-x: auto;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Inspired by gatsby remark prism - https://www.gatsbyjs.com/plugins/gatsby-remark-prismjs/
|
|
7
|
-
* 1. Make the element just wide enough to fit its content.
|
|
8
|
-
* 2. Always fill the visible space in .code-highlight.
|
|
9
|
-
*/
|
|
10
|
-
.code-highlight {
|
|
11
|
-
float: left; /* 1 */
|
|
12
|
-
min-width: 100%; /* 2 */
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.code-line {
|
|
16
|
-
display: block;
|
|
17
|
-
padding-left: 16px;
|
|
18
|
-
padding-right: 16px;
|
|
19
|
-
margin-left: -16px;
|
|
20
|
-
margin-right: -16px;
|
|
21
|
-
border-left-width: 4px;
|
|
22
|
-
border-left-color: rgba(31, 41, 55, 0); /* Set code block color */
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.code-line.inserted {
|
|
26
|
-
background-color: rgba(16, 185, 129, 0.2); /* Set inserted line (+) color */
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.code-line.deleted {
|
|
30
|
-
background-color: rgba(239, 68, 68, 0.2); /* Set deleted line (-) color */
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.highlight-line {
|
|
34
|
-
margin-left: -16px;
|
|
35
|
-
margin-right: -16px;
|
|
36
|
-
background-color: rgba(55, 65, 81, 0.5); /* Set highlight bg color */
|
|
37
|
-
border-left-width: 4px;
|
|
38
|
-
border-left-color: rgb(59, 130, 246); /* Set highlight accent border color */
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.line-number::before {
|
|
42
|
-
display: inline-block;
|
|
43
|
-
width: 1rem;
|
|
44
|
-
text-align: right;
|
|
45
|
-
margin-right: 16px;
|
|
46
|
-
margin-left: -8px;
|
|
47
|
-
color: rgb(156, 163, 175); /* Line number color */
|
|
48
|
-
content: attr(line);
|
|
49
|
-
}
|
package/components/theme.ts
DELETED
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
/// <reference types="@graphcommerce/next-ui/types" />
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
responsiveVal,
|
|
5
|
-
breakpointVal,
|
|
6
|
-
MuiButtonPill,
|
|
7
|
-
MuiButtonResponsive,
|
|
8
|
-
themeBaseDefaults,
|
|
9
|
-
MuiSnackbar,
|
|
10
|
-
MuiFabSizes,
|
|
11
|
-
} from '@graphcommerce/next-ui'
|
|
12
|
-
import { createTheme, Theme, alpha, darken, lighten } from '@mui/material'
|
|
13
|
-
import { Components, PaletteOptions } from '@mui/material/styles'
|
|
14
|
-
|
|
15
|
-
const main = '#85FFFD'
|
|
16
|
-
const dark = '#CEFF99'
|
|
17
|
-
|
|
18
|
-
const lightPalette: PaletteOptions = {
|
|
19
|
-
mode: 'light',
|
|
20
|
-
primary: {
|
|
21
|
-
main: darken(main, 0.175),
|
|
22
|
-
contrastText: '#FFFFFF',
|
|
23
|
-
dark: darken(dark, 0.175),
|
|
24
|
-
},
|
|
25
|
-
secondary: {
|
|
26
|
-
main: '#006BFF',
|
|
27
|
-
light: '#D1E4FF',
|
|
28
|
-
contrastText: '#ffffff',
|
|
29
|
-
},
|
|
30
|
-
background: {
|
|
31
|
-
default: '#ffffff',
|
|
32
|
-
paper: '#ffffff',
|
|
33
|
-
image: '#ffffff',
|
|
34
|
-
},
|
|
35
|
-
divider: '#00000015',
|
|
36
|
-
success: {
|
|
37
|
-
main: '#01D26A',
|
|
38
|
-
},
|
|
39
|
-
action: {
|
|
40
|
-
hoverOpacity: 0.16,
|
|
41
|
-
},
|
|
42
|
-
text: {
|
|
43
|
-
primary: '#000000',
|
|
44
|
-
secondary: 'hsl(229, 16%, 71%)',
|
|
45
|
-
disabled: '#00000030',
|
|
46
|
-
},
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const darkPalette: PaletteOptions = {
|
|
50
|
-
mode: 'dark',
|
|
51
|
-
primary: {
|
|
52
|
-
main,
|
|
53
|
-
contrastText: '#ffffff',
|
|
54
|
-
dark,
|
|
55
|
-
},
|
|
56
|
-
secondary: {
|
|
57
|
-
main: '#62C7B0',
|
|
58
|
-
light: '#62C7B0',
|
|
59
|
-
contrastText: '#ffffff',
|
|
60
|
-
},
|
|
61
|
-
background: {
|
|
62
|
-
default: '#001727',
|
|
63
|
-
paper: lighten('#001727', 0.03),
|
|
64
|
-
image: '#F8F8F8',
|
|
65
|
-
},
|
|
66
|
-
divider: '#ffffff30',
|
|
67
|
-
success: {
|
|
68
|
-
main: '#01D26A',
|
|
69
|
-
},
|
|
70
|
-
action: {
|
|
71
|
-
hoverOpacity: 0.16,
|
|
72
|
-
},
|
|
73
|
-
text: {
|
|
74
|
-
primary: '#ffffff',
|
|
75
|
-
secondary: '#ffffff80',
|
|
76
|
-
disabled: '#ffffff30',
|
|
77
|
-
},
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const fontSize = (from: number, to: number) =>
|
|
81
|
-
breakpointVal('fontSize', from, to, themeBaseDefaults.breakpoints.values)
|
|
82
|
-
|
|
83
|
-
// Create a theme instance.
|
|
84
|
-
const createThemeWithPalette = (palette: PaletteOptions) =>
|
|
85
|
-
createTheme({
|
|
86
|
-
palette,
|
|
87
|
-
...themeBaseDefaults,
|
|
88
|
-
shape: { borderRadius: 4 },
|
|
89
|
-
typography: {
|
|
90
|
-
fontFamily:
|
|
91
|
-
'-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji',
|
|
92
|
-
// @see docs typography.md
|
|
93
|
-
h1: {
|
|
94
|
-
...fontSize(36, 44),
|
|
95
|
-
fontWeight: 550,
|
|
96
|
-
lineHeight: 1.22,
|
|
97
|
-
fontVariationSettings: palette.mode === 'dark' ? "'wght' 550" : "'wght' 610",
|
|
98
|
-
},
|
|
99
|
-
h2: {
|
|
100
|
-
...fontSize(24, 32),
|
|
101
|
-
fontWeight: 530,
|
|
102
|
-
lineHeight: 1.6,
|
|
103
|
-
fontVariationSettings: palette.mode === 'dark' ? "'wght' 480" : "'wght' 590",
|
|
104
|
-
},
|
|
105
|
-
h3: {
|
|
106
|
-
...fontSize(18, 22),
|
|
107
|
-
fontWeight: 500,
|
|
108
|
-
lineHeight: 1.55,
|
|
109
|
-
fontVariationSettings: palette.mode === 'dark' ? "'wght' 500" : "'wght' 560",
|
|
110
|
-
},
|
|
111
|
-
h4: {
|
|
112
|
-
...fontSize(18, 23),
|
|
113
|
-
fontWeight: 600,
|
|
114
|
-
lineHeight: 1.6,
|
|
115
|
-
fontVariationSettings: "'wght' 600",
|
|
116
|
-
},
|
|
117
|
-
h5: {
|
|
118
|
-
...fontSize(18, 21),
|
|
119
|
-
fontWeight: 480,
|
|
120
|
-
lineHeight: 1.6,
|
|
121
|
-
fontVariationSettings: "'wght' 510",
|
|
122
|
-
},
|
|
123
|
-
h6: {
|
|
124
|
-
...fontSize(16, 19),
|
|
125
|
-
fontWeight: 460,
|
|
126
|
-
lineHeight: 1.8,
|
|
127
|
-
fontVariationSettings: "'wght' 460",
|
|
128
|
-
},
|
|
129
|
-
subtitle1: {
|
|
130
|
-
...fontSize(16, 19),
|
|
131
|
-
fontWeight: 450,
|
|
132
|
-
fontVariationSettings: "'wght' 460",
|
|
133
|
-
lineHeight: 1.7,
|
|
134
|
-
},
|
|
135
|
-
fontWeightBold: 600,
|
|
136
|
-
body1: {
|
|
137
|
-
...fontSize(15, 18),
|
|
138
|
-
fontWeight: 370,
|
|
139
|
-
fontVariationSettings: palette.mode === 'dark' ? "'wght' 450" : "'wght' 370",
|
|
140
|
-
lineHeight: 1.7,
|
|
141
|
-
},
|
|
142
|
-
subtitle2: {
|
|
143
|
-
...fontSize(14, 16),
|
|
144
|
-
fontWeight: 500,
|
|
145
|
-
fontVariationSettings: "'wght' 450",
|
|
146
|
-
lineHeight: 1.7,
|
|
147
|
-
},
|
|
148
|
-
body2: {
|
|
149
|
-
...fontSize(13, 15),
|
|
150
|
-
lineHeight: 1.7,
|
|
151
|
-
},
|
|
152
|
-
caption: {
|
|
153
|
-
// https://web.dev/font-size/#how-the-lighthouse-font-size-audit-fails
|
|
154
|
-
...fontSize(12, 13),
|
|
155
|
-
},
|
|
156
|
-
button: {},
|
|
157
|
-
overline: {
|
|
158
|
-
// https://web.dev/font-size/#how-the-lighthouse-font-size-audit-fails
|
|
159
|
-
...fontSize(12, 14),
|
|
160
|
-
fontWeight: 500,
|
|
161
|
-
letterSpacing: 1,
|
|
162
|
-
lineHeight: 1.2,
|
|
163
|
-
textTransform: 'uppercase',
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
spacings: {
|
|
167
|
-
xxs: responsiveVal(10, 16),
|
|
168
|
-
xs: responsiveVal(12, 20),
|
|
169
|
-
sm: responsiveVal(14, 30),
|
|
170
|
-
md: responsiveVal(16, 50),
|
|
171
|
-
lg: responsiveVal(24, 80),
|
|
172
|
-
xl: responsiveVal(40, 100),
|
|
173
|
-
xxl: responsiveVal(80, 160),
|
|
174
|
-
},
|
|
175
|
-
page: {
|
|
176
|
-
horizontal: responsiveVal(10, 30),
|
|
177
|
-
vertical: responsiveVal(10, 30),
|
|
178
|
-
},
|
|
179
|
-
appShell: {
|
|
180
|
-
headerHeightSm: '46px',
|
|
181
|
-
headerHeightMd: '80px',
|
|
182
|
-
appBarHeightMd: '80px',
|
|
183
|
-
appBarInnerHeightMd: '46px',
|
|
184
|
-
},
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
// todo: move most of the styles to the graphcommerce library while still allowing for extensibility.
|
|
188
|
-
const createOverrides = (theme: Theme): Components => ({
|
|
189
|
-
MuiCssBaseline: {
|
|
190
|
-
styleOverrides: {
|
|
191
|
-
body: {
|
|
192
|
-
overflowY: 'scroll',
|
|
193
|
-
},
|
|
194
|
-
'::selection': { background: alpha(theme.palette.primary.main, 0.6) },
|
|
195
|
-
'::-moz-selection': { background: alpha(theme.palette.primary.main, 0.6) },
|
|
196
|
-
'#__next': {
|
|
197
|
-
position: 'relative',
|
|
198
|
-
},
|
|
199
|
-
img: {
|
|
200
|
-
filter: 'brightness(1.03)',
|
|
201
|
-
willChange: 'filter',
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
MuiContainer: {
|
|
207
|
-
variants: [
|
|
208
|
-
{
|
|
209
|
-
props: { disableGutters: false },
|
|
210
|
-
style: {
|
|
211
|
-
paddingLeft: theme.page.horizontal,
|
|
212
|
-
paddingRight: theme.page.horizontal,
|
|
213
|
-
[theme.breakpoints.up('sm')]: {
|
|
214
|
-
paddingLeft: theme.page.horizontal,
|
|
215
|
-
paddingRight: theme.page.horizontal,
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
],
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
MuiInputBase: {
|
|
223
|
-
styleOverrides: {
|
|
224
|
-
root: {
|
|
225
|
-
fontSize: '16px', // https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
MuiButton: {
|
|
231
|
-
defaultProps: { color: 'inherit' },
|
|
232
|
-
variants: [
|
|
233
|
-
...MuiButtonResponsive,
|
|
234
|
-
...MuiButtonPill,
|
|
235
|
-
{
|
|
236
|
-
props: { variant: 'contained', color: 'inherit' },
|
|
237
|
-
style: { backgroundColor: theme.palette.background.paper },
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
props: { variant: 'outlined' },
|
|
241
|
-
style: {
|
|
242
|
-
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
props: { variant: 'text' },
|
|
247
|
-
style: { borderRadius: '99em' },
|
|
248
|
-
},
|
|
249
|
-
],
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
MuiFab: {
|
|
253
|
-
styleOverrides: {
|
|
254
|
-
root: {
|
|
255
|
-
backgroundColor: theme.palette.background.paper,
|
|
256
|
-
'&:hover': {
|
|
257
|
-
backgroundColor: theme.palette.background.paper,
|
|
258
|
-
},
|
|
259
|
-
color: theme.palette.text.primary,
|
|
260
|
-
},
|
|
261
|
-
colorInherit: {
|
|
262
|
-
backgroundColor: 'inherit',
|
|
263
|
-
'&:hover, &:focus': {
|
|
264
|
-
backgroundColor: 'inherit',
|
|
265
|
-
},
|
|
266
|
-
boxShadow: 'none',
|
|
267
|
-
},
|
|
268
|
-
primary: {
|
|
269
|
-
color: theme.palette.text.primary,
|
|
270
|
-
},
|
|
271
|
-
secondary: {
|
|
272
|
-
color: theme.palette.text.primary,
|
|
273
|
-
},
|
|
274
|
-
extended: {
|
|
275
|
-
fontWeight: 400,
|
|
276
|
-
textTransform: 'none',
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
variants: [...MuiFabSizes],
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
MuiTextField: {
|
|
283
|
-
styleOverrides: {
|
|
284
|
-
root: {
|
|
285
|
-
'& label.Mui-focused': {
|
|
286
|
-
color: theme.palette.secondary.main,
|
|
287
|
-
},
|
|
288
|
-
'& .MuiOutlinedInput-root': {
|
|
289
|
-
borderRadius: responsiveVal(theme.shape.borderRadius * 1.5, theme.shape.borderRadius * 2),
|
|
290
|
-
'& fieldset': {
|
|
291
|
-
borderColor: theme.palette.divider,
|
|
292
|
-
},
|
|
293
|
-
'&.Mui-focused fieldset': {
|
|
294
|
-
borderColor: theme.palette.divider,
|
|
295
|
-
borderWidth: 1,
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
MuiListItemIcon: {
|
|
303
|
-
styleOverrides: {
|
|
304
|
-
root: {
|
|
305
|
-
color: theme.palette.text.primary,
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
MuiChip: {
|
|
311
|
-
styleOverrides: {
|
|
312
|
-
root: {
|
|
313
|
-
boxShadow: 'unset !important',
|
|
314
|
-
borderRadius: '99em',
|
|
315
|
-
height: responsiveVal(32, 40),
|
|
316
|
-
paddingLeft: responsiveVal(4, 8),
|
|
317
|
-
paddingRight: responsiveVal(4, 8),
|
|
318
|
-
...theme.typography.body2,
|
|
319
|
-
},
|
|
320
|
-
sizeSmall: {
|
|
321
|
-
height: responsiveVal(26, 30),
|
|
322
|
-
paddingLeft: responsiveVal(3, 6),
|
|
323
|
-
paddingRight: responsiveVal(3, 6),
|
|
324
|
-
...theme.typography.caption,
|
|
325
|
-
},
|
|
326
|
-
outlined: {
|
|
327
|
-
borderColor: theme.palette.divider,
|
|
328
|
-
},
|
|
329
|
-
label: {
|
|
330
|
-
paddingLeft: responsiveVal(6, 10),
|
|
331
|
-
paddingRight: responsiveVal(6, 10),
|
|
332
|
-
},
|
|
333
|
-
labelSmall: {
|
|
334
|
-
paddingLeft: responsiveVal(6, 8),
|
|
335
|
-
paddingRight: responsiveVal(6, 8),
|
|
336
|
-
},
|
|
337
|
-
deleteIcon: {
|
|
338
|
-
color: theme.palette.text.primary,
|
|
339
|
-
// display: 'flex',
|
|
340
|
-
},
|
|
341
|
-
deleteIconOutlinedColorPrimary: {
|
|
342
|
-
// color: theme.palette.primary.main,
|
|
343
|
-
},
|
|
344
|
-
},
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
MuiCheckbox: {
|
|
348
|
-
styleOverrides: {
|
|
349
|
-
colorPrimary: {
|
|
350
|
-
color: theme.palette.text.disabled,
|
|
351
|
-
'&.Mui-checked': {
|
|
352
|
-
color: theme.palette.primary.main,
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
colorSecondary: {
|
|
356
|
-
color: theme.palette.text.disabled,
|
|
357
|
-
'&.Mui-checked': {
|
|
358
|
-
color: theme.palette.secondary.main,
|
|
359
|
-
},
|
|
360
|
-
},
|
|
361
|
-
},
|
|
362
|
-
},
|
|
363
|
-
|
|
364
|
-
MuiSwitch: {
|
|
365
|
-
styleOverrides: {
|
|
366
|
-
track: {
|
|
367
|
-
'.Mui-colorPrimary + &': {
|
|
368
|
-
backgroundColor: theme.palette.primary,
|
|
369
|
-
borderRadius: '30px',
|
|
370
|
-
},
|
|
371
|
-
'.Mui-checked.Mui-colorPrimary + &': {
|
|
372
|
-
opacity: 1,
|
|
373
|
-
backgroundColor: theme.palette.primary,
|
|
374
|
-
borderRadius: '30px',
|
|
375
|
-
},
|
|
376
|
-
},
|
|
377
|
-
thumb: {
|
|
378
|
-
backgroundColor: '#fff',
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
|
|
383
|
-
MuiSnackbar: { variants: MuiSnackbar },
|
|
384
|
-
|
|
385
|
-
MuiAvatar: {
|
|
386
|
-
styleOverrides: {
|
|
387
|
-
colorDefault: {
|
|
388
|
-
backgroundColor: theme.palette.text.disabled,
|
|
389
|
-
},
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
|
-
|
|
393
|
-
MuiSlider: {
|
|
394
|
-
styleOverrides: {
|
|
395
|
-
rail: {
|
|
396
|
-
color: theme.palette.text.disabled,
|
|
397
|
-
},
|
|
398
|
-
thumb: {
|
|
399
|
-
background: theme.palette.background.default,
|
|
400
|
-
boxShadow: theme.shadows[6],
|
|
401
|
-
},
|
|
402
|
-
},
|
|
403
|
-
},
|
|
404
|
-
})
|
|
405
|
-
|
|
406
|
-
export const lightTheme = createThemeWithPalette(lightPalette)
|
|
407
|
-
lightTheme.components = createOverrides(lightTheme)
|
|
408
|
-
|
|
409
|
-
export const darkTheme = createThemeWithPalette(darkPalette)
|
|
410
|
-
darkTheme.components = createOverrides(darkTheme)
|