@expo/styleguide 6.1.2 → 7.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.
@@ -42,10 +42,10 @@ function setInitialColorMode() {
42
42
  const colorMode = getInitialColorMode();
43
43
  // add HTML attribute if dark mode
44
44
  if (colorMode === 'dark') {
45
- document.body.classList.add('dark-theme');
45
+ document.documentElement.classList.add('dark-theme');
46
46
  }
47
47
  else {
48
- document.body.classList.remove('dark-theme');
48
+ document.documentElement.classList.remove('dark-theme');
49
49
  }
50
50
  }
51
51
  // our function needs to be a string so that we can call it
@@ -77,10 +77,10 @@ function ThemeProvider(props) {
77
77
  if (disabled)
78
78
  return;
79
79
  if (themeName === Themes.DARK) {
80
- document.body.classList.add('dark-theme');
80
+ document.documentElement.classList.add('dark-theme');
81
81
  }
82
82
  else {
83
- document.body.classList.remove('dark-theme');
83
+ document.documentElement.classList.remove('dark-theme');
84
84
  }
85
85
  }
86
86
  function onThemeChange(event) {
@@ -126,6 +126,7 @@
126
126
  --expo-theme-project-purple: linear-gradient(#a687e0, #8a66cc);
127
127
 
128
128
  /* Light shadows */
129
+ --expo-theme-shadows-none: 0 0 transparent;
129
130
  --expo-theme-shadows-xs: 0 1px 3px rgba(0, 0, 0, 0.025),
130
131
  0 1px 2px rgba(0, 0, 0, 0.05);
131
132
  --expo-theme-shadows-sm: 0 3px 6px rgba(0, 0, 0, 0.08),
@@ -248,6 +249,7 @@
248
249
  --expo-theme-project-purple: linear-gradient(#715c99, #4e3973);
249
250
 
250
251
  /* Dark shadows */
252
+ --expo-theme-shadows-none: 0 0 transparent;
251
253
  --expo-theme-shadows-xs: 0 1px 3px rgba(0, 0, 0, 0.3),
252
254
  0 1px 2px rgba(0, 0, 0, 0.3);
253
255
  --expo-theme-shadows-sm: 0 3px 6px rgba(0, 0, 0, 0.4),
@@ -1,4 +1,5 @@
1
1
  export declare const shadows: {
2
+ none: string;
2
3
  xs: string;
3
4
  sm: string;
4
5
  md: string;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shadows = void 0;
4
4
  exports.shadows = {
5
+ none: 'var(--expo-theme-shadows-none)',
5
6
  xs: 'var(--expo-theme-shadows-xs)',
6
7
  sm: 'var(--expo-theme-shadows-sm)',
7
8
  md: 'var(--expo-theme-shadows-md)',
@@ -6,49 +6,42 @@ export declare const typography: {
6
6
  fontSize: string;
7
7
  lineHeight: string;
8
8
  letterSpacing: string;
9
- fontFamily: string;
10
9
  fontWeight: number;
11
10
  };
12
11
  h1: {
13
12
  fontSize: string;
14
13
  lineHeight: string;
15
14
  letterSpacing: string;
16
- fontFamily: string;
17
15
  fontWeight: number;
18
16
  };
19
17
  h2: {
20
18
  fontSize: string;
21
19
  lineHeight: string;
22
20
  letterSpacing: string;
23
- fontFamily: string;
24
21
  fontWeight: number;
25
22
  };
26
23
  h3: {
27
24
  fontSize: string;
28
25
  lineHeight: string;
29
26
  letterSpacing: string;
30
- fontFamily: string;
31
27
  fontWeight: number;
32
28
  };
33
29
  h4: {
34
30
  fontSize: string;
35
31
  lineHeight: string;
36
32
  letterSpacing: string;
37
- fontFamily: string;
38
33
  fontWeight: number;
39
34
  };
40
35
  h5: {
41
36
  fontSize: string;
42
37
  lineHeight: string;
43
38
  letterSpacing: string;
44
- fontFamily: string;
45
39
  fontWeight: number;
46
40
  };
47
41
  h6: {
48
42
  fontSize: string;
49
43
  lineHeight: string;
50
44
  letterSpacing: string;
51
- fontFamily: string;
52
45
  fontWeight: number;
53
46
  };
54
47
  };
@@ -57,48 +50,41 @@ export declare const typography: {
57
50
  fontSize: string;
58
51
  lineHeight: string;
59
52
  letterSpacing: string;
60
- fontFamily: string;
61
53
  fontWeight: number;
62
54
  };
63
55
  h1: {
64
56
  fontSize: string;
65
57
  lineHeight: string;
66
58
  letterSpacing: string;
67
- fontFamily: string;
68
59
  fontWeight: number;
69
60
  };
70
61
  h2: {
71
62
  fontSize: string;
72
63
  lineHeight: string;
73
64
  letterSpacing: string;
74
- fontFamily: string;
75
65
  fontWeight: number;
76
66
  };
77
67
  h3: {
78
68
  fontSize: string;
79
69
  lineHeight: string;
80
70
  letterSpacing: string;
81
- fontFamily: string;
82
71
  fontWeight: number;
83
72
  };
84
73
  h4: {
85
74
  fontSize: string;
86
75
  lineHeight: string;
87
76
  letterSpacing: string;
88
- fontFamily: string;
89
77
  fontWeight: number;
90
78
  };
91
79
  h5: {
92
80
  fontSize: string;
93
81
  lineHeight: string;
94
82
  letterSpacing: string;
95
- fontFamily: string;
96
83
  fontWeight: number;
97
84
  };
98
85
  h6: {
99
86
  fontSize: string;
100
87
  lineHeight: string;
101
- fontFamily: string;
102
88
  fontWeight: number;
103
89
  };
104
90
  };
@@ -108,48 +94,41 @@ export declare const typography: {
108
94
  fontSize: string;
109
95
  lineHeight: string;
110
96
  letterSpacing: string;
111
- fontFamily: string;
112
97
  fontWeight: number;
113
98
  };
114
99
  paragraph: {
115
100
  fontSize: string;
116
101
  lineHeight: string;
117
102
  letterSpacing: string;
118
- fontFamily: string;
119
103
  fontWeight: number;
120
104
  };
121
105
  label: {
122
106
  fontSize: string;
123
107
  lineHeight: string;
124
108
  letterSpacing: string;
125
- fontFamily: string;
126
109
  fontWeight: number;
127
110
  };
128
111
  callout: {
129
112
  fontSize: string;
130
113
  lineHeight: string;
131
114
  letterSpacing: string;
132
- fontFamily: string;
133
115
  fontWeight: number;
134
116
  };
135
117
  footnote: {
136
118
  fontSize: string;
137
119
  lineHeight: string;
138
120
  letterSpacing: string;
139
- fontFamily: string;
140
121
  fontWeight: number;
141
122
  };
142
123
  caption: {
143
124
  fontSize: string;
144
125
  lineHeight: string;
145
- fontFamily: string;
146
126
  fontWeight: number;
147
127
  };
148
128
  code: {
149
129
  fontSize: string;
150
130
  lineHeight: string;
151
131
  letterSpacing: string;
152
- fontFamily: string;
153
132
  fontWeight: number;
154
133
  };
155
134
  ul: {
@@ -171,7 +150,6 @@ export declare const typography: {
171
150
  fontSize: string;
172
151
  lineHeight: string;
173
152
  letterSpacing: string;
174
- fontFamily: string;
175
153
  fontWeight: number;
176
154
  };
177
155
  blockquote: {
@@ -181,7 +159,6 @@ export declare const typography: {
181
159
  fontSize: string;
182
160
  lineHeight: string;
183
161
  letterSpacing: string;
184
- fontFamily: string;
185
162
  fontWeight: number;
186
163
  };
187
164
  };
@@ -191,18 +168,16 @@ export declare const typography: {
191
168
  fontWeight: number;
192
169
  textDecoration: string;
193
170
  cursor: string;
194
- opacity: number;
171
+ transition: string;
195
172
  transform: string;
196
173
  ':visited': {
197
174
  color: string;
198
175
  };
199
176
  ':hover': {
200
- transition: string;
201
177
  opacity: number;
202
178
  };
203
179
  };
204
180
  inlineCode: {
205
- fontWeight: number;
206
181
  display: string;
207
182
  backgroundColor: string;
208
183
  border: string;
@@ -211,10 +186,9 @@ export declare const typography: {
211
186
  lineHeight: string;
212
187
  fontSize: string;
213
188
  letterSpacing: string;
214
- fontFamily: string;
189
+ fontWeight: number;
215
190
  };
216
191
  terminalCode: {
217
- fontWeight: number;
218
192
  display: string;
219
193
  backgroundColor: string;
220
194
  color: string;
@@ -224,37 +198,35 @@ export declare const typography: {
224
198
  lineHeight: string;
225
199
  fontSize: string;
226
200
  letterSpacing: string;
227
- fontFamily: string;
201
+ fontWeight: number;
228
202
  };
229
203
  pre: {
230
- fontWeight: number;
231
204
  backgroundColor: string;
232
205
  borderRadius: number;
233
206
  border: string;
234
207
  padding: number;
235
- whiteSpace: "pre-wrap";
208
+ whiteSpace: string;
236
209
  margin: string;
237
210
  fontSize: string;
238
211
  lineHeight: string;
239
212
  letterSpacing: string;
240
- fontFamily: string;
213
+ fontWeight: number;
241
214
  };
242
215
  terminalPre: {
243
- fontWeight: number;
244
216
  backgroundColor: string;
245
217
  color: string;
246
218
  borderRadius: number;
247
219
  border: string;
248
220
  padding: number;
249
221
  margin: string;
250
- whiteSpace: "pre-wrap";
222
+ whiteSpace: string;
251
223
  '&:before': {
252
224
  content: string;
253
225
  };
254
226
  fontSize: string;
255
227
  lineHeight: string;
256
228
  letterSpacing: string;
257
- fontFamily: string;
229
+ fontWeight: number;
258
230
  };
259
231
  hr: {
260
232
  backgroundColor: string;
@@ -265,37 +237,19 @@ export declare const typography: {
265
237
  };
266
238
  weight: {
267
239
  black: {
268
- fontFamily: string;
269
240
  fontWeight: number;
270
241
  };
271
242
  semiBold: {
272
- fontFamily: string;
273
243
  fontWeight: number;
274
244
  };
275
245
  medium: {
276
- fontFamily: string;
277
246
  fontWeight: number;
278
247
  };
279
248
  regular: {
280
- fontFamily: string;
281
249
  fontWeight: number;
282
250
  };
283
251
  };
284
252
  };
285
- fontFaces: {
286
- black: string;
287
- semiBold: string;
288
- medium: string;
289
- regular: string;
290
- mono: string;
291
- };
292
- fontStacks: {
293
- black: string;
294
- semiBold: string;
295
- medium: string;
296
- regular: string;
297
- mono: string;
298
- };
299
253
  fontSizes: {
300
254
  61: {
301
255
  fontSize: string;
@@ -15,22 +15,6 @@ function round(value) {
15
15
  function rem(px) {
16
16
  return `${round(px / baseFontSize)}rem`;
17
17
  }
18
- const fontFaces = {
19
- black: 'Inter-Black',
20
- semiBold: 'Inter-SemiBold',
21
- medium: 'Inter-Medium',
22
- regular: 'Inter-Regular',
23
- mono: 'Menlo-Regular',
24
- };
25
- const defaultFontStack = "system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'";
26
- const defaultMonoStack = "Monaco,Consolas,'Liberation Mono','Courier New',monospace, 'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'";
27
- const fontStacks = {
28
- black: `${fontFaces.black}, ${defaultFontStack}`,
29
- semiBold: `${fontFaces.semiBold}, ${defaultFontStack}`,
30
- medium: `${fontFaces.medium}, ${defaultFontStack}`,
31
- regular: `${fontFaces.regular}, ${defaultFontStack}`,
32
- mono: `${fontFaces.mono}, ${defaultMonoStack}`,
33
- };
34
18
  const fontSizes = {
35
19
  61: {
36
20
  fontSize: rem(61),
@@ -142,133 +126,112 @@ const fontSizes = {
142
126
  const headers = {
143
127
  xl: {
144
128
  huge: {
145
- fontFamily: fontStacks.black,
146
129
  fontWeight: 900,
147
130
  ...fontSizes[61],
148
131
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[53],
149
132
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[46],
150
133
  },
151
134
  h1: {
152
- fontFamily: fontStacks.semiBold,
153
- fontWeight: 500,
135
+ fontWeight: 600,
154
136
  ...fontSizes[49],
155
137
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[43],
156
138
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[37],
157
139
  },
158
140
  h2: {
159
- fontFamily: fontStacks.semiBold,
160
- fontWeight: 500,
141
+ fontWeight: 600,
161
142
  ...fontSizes[39],
162
143
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[34],
163
144
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[29],
164
145
  },
165
146
  h3: {
166
- fontFamily: fontStacks.semiBold,
167
- fontWeight: 500,
147
+ fontWeight: 600,
168
148
  ...fontSizes[31],
169
149
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[27],
170
150
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[23],
171
151
  },
172
152
  h4: {
173
- fontFamily: fontStacks.medium,
174
153
  fontWeight: 500,
175
154
  ...fontSizes[25],
176
155
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[22],
177
156
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[19],
178
157
  },
179
158
  h5: {
180
- fontFamily: fontStacks.medium,
181
159
  fontWeight: 500,
182
160
  ...fontSizes[20],
183
161
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[18],
184
162
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[16],
185
163
  },
186
164
  h6: {
187
- fontFamily: fontStacks.medium,
188
165
  fontWeight: 500,
189
166
  ...fontSizes[16],
190
167
  },
191
168
  },
192
169
  default: {
193
170
  huge: {
194
- fontFamily: fontStacks.black,
195
- fontWeight: 500,
171
+ fontWeight: 900,
196
172
  ...fontSizes[39],
197
173
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[34],
198
174
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[29],
199
175
  },
200
176
  h1: {
201
- fontFamily: fontStacks.semiBold,
202
- fontWeight: 500,
177
+ fontWeight: 600,
203
178
  ...fontSizes[31],
204
179
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[27],
205
180
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[23],
206
181
  },
207
182
  h2: {
208
- fontFamily: fontStacks.semiBold,
209
- fontWeight: 500,
183
+ fontWeight: 600,
210
184
  ...fontSizes[25],
211
185
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[22],
212
186
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[19],
213
187
  },
214
188
  h3: {
215
- fontFamily: fontStacks.semiBold,
216
- fontWeight: 500,
189
+ fontWeight: 600,
217
190
  ...fontSizes[20],
218
191
  [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[18],
219
192
  [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[16],
220
193
  },
221
194
  h4: {
222
- fontFamily: fontStacks.semiBold,
223
- fontWeight: 500,
195
+ fontWeight: 600,
224
196
  ...fontSizes[16],
225
197
  },
226
198
  h5: {
227
- fontFamily: fontStacks.semiBold,
228
- fontWeight: 500,
199
+ fontWeight: 600,
229
200
  ...fontSizes[13],
230
201
  },
231
202
  h6: {
232
- fontFamily: fontStacks.semiBold,
233
- fontWeight: 500,
203
+ fontWeight: 600,
234
204
  ...fontSizes[12],
235
205
  },
236
206
  },
237
207
  };
238
208
  const baseStyle = {
239
- fontFamily: fontStacks.regular,
240
209
  fontWeight: 400,
241
210
  ...fontSizes[16],
242
211
  };
243
212
  const body = {
244
213
  headline: {
245
- fontFamily: fontStacks.medium,
246
- fontWeight: 400,
214
+ fontWeight: 500,
247
215
  ...fontSizes[16],
248
216
  },
249
217
  paragraph: baseStyle,
250
218
  label: {
251
- fontFamily: fontStacks.medium,
252
- fontWeight: 400,
219
+ fontWeight: 500,
253
220
  ...fontSizes[15],
254
221
  },
255
222
  callout: {
256
- fontFamily: fontStacks.regular,
257
223
  fontWeight: 400,
258
224
  ...fontSizes[14],
259
225
  },
260
226
  footnote: {
261
- fontFamily: fontStacks.regular,
262
227
  fontWeight: 400,
263
228
  ...fontSizes[13],
264
229
  },
265
230
  caption: {
266
- fontFamily: fontStacks.regular,
267
231
  fontWeight: 400,
268
232
  ...fontSizes[12],
269
233
  },
270
234
  code: {
271
- fontFamily: fontStacks.mono,
272
235
  fontWeight: 400,
273
236
  ...fontSizes[13],
274
237
  },
@@ -303,20 +266,18 @@ const utility = {
303
266
  fontWeight: 400,
304
267
  textDecoration: 'none',
305
268
  cursor: 'pointer',
306
- opacity: 1,
269
+ transition: '200ms',
307
270
  // transform prevents a 1px shift on hover on Safari
308
271
  transform: 'translate3d(0,0,0)',
309
272
  ':visited': {
310
273
  color: themes_1.theme.text.link,
311
274
  },
312
275
  ':hover': {
313
- transition: '200ms',
314
276
  opacity: 0.8,
315
277
  },
316
278
  },
317
279
  inlineCode: {
318
280
  ...body.code,
319
- fontWeight: 400,
320
281
  display: 'inline-block',
321
282
  backgroundColor: themes_1.theme.background.subtle,
322
283
  border: `1px solid ${themes_1.theme.border.default}`,
@@ -326,7 +287,6 @@ const utility = {
326
287
  },
327
288
  terminalCode: {
328
289
  ...body.code,
329
- fontWeight: 400,
330
290
  display: 'inline-block',
331
291
  backgroundColor: themes_1.darkTheme.background.subtle,
332
292
  color: themes_1.darkTheme.text.default,
@@ -337,7 +297,6 @@ const utility = {
337
297
  },
338
298
  pre: {
339
299
  ...body.code,
340
- fontWeight: 400,
341
300
  backgroundColor: themes_1.theme.background.subtle,
342
301
  borderRadius: sizing_1.borderRadius.md,
343
302
  border: `1px solid ${themes_1.theme.border.default}`,
@@ -347,7 +306,6 @@ const utility = {
347
306
  },
348
307
  terminalPre: {
349
308
  ...body.code,
350
- fontWeight: 400,
351
309
  backgroundColor: themes_1.darkTheme.background.subtle,
352
310
  color: themes_1.darkTheme.text.default,
353
311
  borderRadius: sizing_1.borderRadius.md,
@@ -368,19 +326,15 @@ const utility = {
368
326
  },
369
327
  weight: {
370
328
  black: {
371
- fontFamily: fontStacks.black,
372
329
  fontWeight: 900,
373
330
  },
374
331
  semiBold: {
375
- fontFamily: fontStacks.semiBold,
376
- fontWeight: 500,
332
+ fontWeight: 600,
377
333
  },
378
334
  medium: {
379
- fontFamily: fontStacks.medium,
380
335
  fontWeight: 500,
381
336
  },
382
337
  regular: {
383
- fontFamily: fontStacks.regular,
384
338
  fontWeight: 400,
385
339
  },
386
340
  },
@@ -390,7 +344,5 @@ exports.typography = {
390
344
  headers,
391
345
  body,
392
346
  utility,
393
- fontFaces,
394
- fontStacks,
395
347
  fontSizes,
396
348
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/styleguide",
3
- "version": "6.1.2",
3
+ "version": "7.0.0",
4
4
  "description": "Foundational styles for Expo interfaces.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/tailwind.js CHANGED
@@ -17,46 +17,14 @@ module.exports = {
17
17
  colors: {
18
18
  transparent: "transparent",
19
19
  current: "currentColor",
20
- default: theme.text.default,
21
- secondary: theme.text.secondary,
22
- tertiary: theme.text.tertiary,
23
- quaternary: theme.text.quaternary,
24
- success: theme.text.success,
25
- warning: theme.text.warning,
26
- danger: theme.text.danger,
27
- info: theme.text.info,
20
+ ...theme.text,
28
21
  ...theme,
29
22
  },
30
23
  boxShadow: shadows,
31
24
  fontFamily: {
32
- sans: [
33
- "Inter var",
34
- "ui-sans-serif",
35
- "system-ui",
36
- "-apple-system",
37
- "BlinkMacSystemFont",
38
- '"Segoe UI"',
39
- "Roboto",
40
- '"Helvetica Neue"',
41
- "Arial",
42
- '"Noto Sans"',
43
- "sans-serif",
44
- '"Apple Color Emoji"',
45
- '"Segoe UI Emoji"',
46
- '"Segoe UI Symbol"',
47
- '"Noto Color Emoji"',
48
- ],
49
- mono: [
50
- "Menlo",
51
- "ui-monospace",
52
- "SFMono-Regular",
53
- "Menlo",
54
- "Monaco",
55
- "Consolas",
56
- '"Liberation Mono"',
57
- '"Courier New"',
58
- "monospace",
59
- ],
25
+ sans: undefined,
26
+ serif: undefined,
27
+ mono: undefined
60
28
  },
61
29
  // Based on Major Third (1.250) type scale.
62
30
  // Sizes calculated at: https://type-scale.com