@expo/styleguide 3.3.2 → 3.4.2-alpha.1

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.
@@ -0,0 +1,324 @@
1
+ export declare const typography: {
2
+ baseFontSize: number;
3
+ headers: {
4
+ huge: {
5
+ fontSize: string;
6
+ lineHeight: string;
7
+ letterSpacing: string;
8
+ fontFamily: string;
9
+ fontWeight: number;
10
+ };
11
+ h1: {
12
+ fontSize: string;
13
+ lineHeight: string;
14
+ letterSpacing: string;
15
+ fontFamily: string;
16
+ fontWeight: number;
17
+ };
18
+ h2: {
19
+ fontSize: string;
20
+ lineHeight: string;
21
+ letterSpacing: string;
22
+ fontFamily: string;
23
+ fontWeight: number;
24
+ };
25
+ h3: {
26
+ fontSize: string;
27
+ lineHeight: string;
28
+ letterSpacing: string;
29
+ fontFamily: string;
30
+ fontWeight: number;
31
+ };
32
+ h4: {
33
+ fontSize: string;
34
+ lineHeight: string;
35
+ letterSpacing: string;
36
+ fontFamily: string;
37
+ fontWeight: number;
38
+ };
39
+ h5: {
40
+ fontSize: string;
41
+ lineHeight: string;
42
+ letterSpacing: string;
43
+ fontFamily: string;
44
+ fontWeight: number;
45
+ };
46
+ h6: {
47
+ fontSize: string;
48
+ lineHeight: string;
49
+ letterSpacing: string;
50
+ fontFamily: string;
51
+ fontWeight: number;
52
+ };
53
+ };
54
+ body: {
55
+ headline: {
56
+ fontSize: string;
57
+ lineHeight: string;
58
+ letterSpacing: string;
59
+ fontFamily: string;
60
+ fontWeight: number;
61
+ };
62
+ paragraph: {
63
+ fontSize: string;
64
+ lineHeight: string;
65
+ letterSpacing: string;
66
+ fontFamily: string;
67
+ fontWeight: number;
68
+ };
69
+ label: {
70
+ fontSize: string;
71
+ lineHeight: string;
72
+ letterSpacing: string;
73
+ fontFamily: string;
74
+ fontWeight: number;
75
+ };
76
+ callout: {
77
+ fontSize: string;
78
+ lineHeight: string;
79
+ letterSpacing: string;
80
+ fontFamily: string;
81
+ fontWeight: number;
82
+ };
83
+ footnote: {
84
+ fontSize: string;
85
+ lineHeight: string;
86
+ letterSpacing: string;
87
+ fontFamily: string;
88
+ fontWeight: number;
89
+ };
90
+ caption: {
91
+ fontSize: string;
92
+ lineHeight: string;
93
+ fontFamily: string;
94
+ fontWeight: number;
95
+ };
96
+ code: {
97
+ fontSize: string;
98
+ lineHeight: string;
99
+ letterSpacing: string;
100
+ fontFamily: string;
101
+ fontWeight: number;
102
+ };
103
+ };
104
+ utility: {
105
+ anchor: {
106
+ color: string;
107
+ fontWeight: number;
108
+ textDecoration: string;
109
+ cursor: string;
110
+ opacity: number;
111
+ transform: string;
112
+ ':visited': {
113
+ color: string;
114
+ };
115
+ ':hover': {
116
+ transition: string;
117
+ opacity: number;
118
+ };
119
+ };
120
+ li: {
121
+ fontWeight: number;
122
+ marginBottom: string;
123
+ fontSize: string;
124
+ lineHeight: string;
125
+ letterSpacing: string;
126
+ };
127
+ inlineCode: {
128
+ fontWeight: number;
129
+ display: string;
130
+ backgroundColor: string;
131
+ border: string;
132
+ borderRadius: number;
133
+ padding: string;
134
+ lineHeight: string;
135
+ fontSize: string;
136
+ letterSpacing: string;
137
+ fontFamily: string;
138
+ };
139
+ terminalCode: {
140
+ fontWeight: number;
141
+ display: string;
142
+ backgroundColor: string;
143
+ color: string;
144
+ border: string;
145
+ borderRadius: number;
146
+ padding: string;
147
+ lineHeight: string;
148
+ fontSize: string;
149
+ letterSpacing: string;
150
+ fontFamily: string;
151
+ };
152
+ pre: {
153
+ fontWeight: number;
154
+ backgroundColor: string;
155
+ borderRadius: number;
156
+ border: string;
157
+ padding: number;
158
+ whiteSpace: string;
159
+ margin: string;
160
+ fontSize: string;
161
+ lineHeight: string;
162
+ letterSpacing: string;
163
+ fontFamily: string;
164
+ };
165
+ terminalPre: {
166
+ fontWeight: number;
167
+ backgroundColor: string;
168
+ color: string;
169
+ borderRadius: number;
170
+ border: string;
171
+ padding: number;
172
+ margin: string;
173
+ whiteSpace: string;
174
+ '&:before': {
175
+ content: string;
176
+ };
177
+ fontSize: string;
178
+ lineHeight: string;
179
+ letterSpacing: string;
180
+ fontFamily: string;
181
+ };
182
+ hr: {
183
+ backgroundColor: string;
184
+ border: number;
185
+ height: number;
186
+ display: string;
187
+ width: string;
188
+ };
189
+ blockquote: {
190
+ fontWeight: number;
191
+ color: string;
192
+ paddingLeft: number;
193
+ borderLeft: string;
194
+ fontSize: string;
195
+ lineHeight: string;
196
+ letterSpacing: string;
197
+ };
198
+ };
199
+ fontFaces: {
200
+ black: string;
201
+ semiBold: string;
202
+ medium: string;
203
+ regular: string;
204
+ mono: string;
205
+ };
206
+ fontStacks: {
207
+ black: string;
208
+ semiBold: string;
209
+ medium: string;
210
+ regular: string;
211
+ mono: string;
212
+ };
213
+ fontSizes: {
214
+ 61: {
215
+ fontSize: string;
216
+ lineHeight: string;
217
+ letterSpacing: string;
218
+ };
219
+ 53: {
220
+ fontSize: string;
221
+ lineHeight: string;
222
+ letterSpacing: string;
223
+ };
224
+ 49: {
225
+ fontSize: string;
226
+ lineHeight: string;
227
+ letterSpacing: string;
228
+ };
229
+ 46: {
230
+ fontSize: string;
231
+ lineHeight: string;
232
+ letterSpacing: string;
233
+ };
234
+ 43: {
235
+ fontSize: string;
236
+ lineHeight: string;
237
+ letterSpacing: string;
238
+ };
239
+ 39: {
240
+ fontSize: string;
241
+ lineHeight: string;
242
+ letterSpacing: string;
243
+ };
244
+ 37: {
245
+ fontSize: string;
246
+ lineHeight: string;
247
+ letterSpacing: string;
248
+ };
249
+ 34: {
250
+ fontSize: string;
251
+ lineHeight: string;
252
+ letterSpacing: string;
253
+ };
254
+ 31: {
255
+ fontSize: string;
256
+ lineHeight: string;
257
+ letterSpacing: string;
258
+ };
259
+ 29: {
260
+ fontSize: string;
261
+ lineHeight: string;
262
+ letterSpacing: string;
263
+ };
264
+ 27: {
265
+ fontSize: string;
266
+ lineHeight: string;
267
+ letterSpacing: string;
268
+ };
269
+ 25: {
270
+ fontSize: string;
271
+ lineHeight: string;
272
+ letterSpacing: string;
273
+ };
274
+ 23: {
275
+ fontSize: string;
276
+ lineHeight: string;
277
+ letterSpacing: string;
278
+ };
279
+ 22: {
280
+ fontSize: string;
281
+ lineHeight: string;
282
+ letterSpacing: string;
283
+ };
284
+ 20: {
285
+ fontSize: string;
286
+ lineHeight: string;
287
+ letterSpacing: string;
288
+ };
289
+ 19: {
290
+ fontSize: string;
291
+ lineHeight: string;
292
+ letterSpacing: string;
293
+ };
294
+ 18: {
295
+ fontSize: string;
296
+ lineHeight: string;
297
+ letterSpacing: string;
298
+ };
299
+ 16: {
300
+ fontSize: string;
301
+ lineHeight: string;
302
+ letterSpacing: string;
303
+ };
304
+ 15: {
305
+ fontSize: string;
306
+ lineHeight: string;
307
+ letterSpacing: string;
308
+ };
309
+ 14: {
310
+ fontSize: string;
311
+ lineHeight: string;
312
+ letterSpacing: string;
313
+ };
314
+ 13: {
315
+ fontSize: string;
316
+ lineHeight: string;
317
+ letterSpacing: string;
318
+ };
319
+ 12: {
320
+ fontSize: string;
321
+ lineHeight: string;
322
+ };
323
+ };
324
+ };
@@ -0,0 +1,318 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.typography = void 0;
4
+ const themes_1 = require("./themes");
5
+ const sizing_1 = require("./sizing");
6
+ const spacing_1 = require("./spacing");
7
+ const breakpoints_1 = require("./breakpoints");
8
+ const baseFontSize = 16;
9
+ function round(value) {
10
+ return value
11
+ .toFixed(7)
12
+ .replace(/(\.[0-9]+?)0+$/, '$1') // remove trailing zeroes after decimals
13
+ .replace(/\.0$/, ''); // remove any remaining zeroes
14
+ }
15
+ function rem(px) {
16
+ return `${round(px / baseFontSize)}rem`;
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
+ const fontSizes = {
35
+ 61: {
36
+ fontSize: rem(61),
37
+ lineHeight: round(73 / 61),
38
+ letterSpacing: rem(-0.022 * baseFontSize),
39
+ },
40
+ 53: {
41
+ fontSize: rem(53),
42
+ lineHeight: round(64 / 53),
43
+ letterSpacing: rem(-0.022 * baseFontSize),
44
+ },
45
+ 49: {
46
+ fontSize: rem(49),
47
+ lineHeight: round(59 / 49),
48
+ letterSpacing: rem(-0.022 * baseFontSize),
49
+ },
50
+ 46: {
51
+ fontSize: rem(46),
52
+ lineHeight: round(55 / 46),
53
+ letterSpacing: rem(-0.022 * baseFontSize),
54
+ },
55
+ 43: {
56
+ fontSize: rem(43),
57
+ lineHeight: round(52 / 43),
58
+ letterSpacing: rem(-0.022 * baseFontSize),
59
+ },
60
+ 39: {
61
+ fontSize: rem(39),
62
+ lineHeight: round(51 / 39),
63
+ letterSpacing: rem(-0.022 * baseFontSize),
64
+ },
65
+ 37: {
66
+ fontSize: rem(37),
67
+ lineHeight: round(48 / 37),
68
+ letterSpacing: rem(-0.022 * baseFontSize),
69
+ },
70
+ 34: {
71
+ fontSize: rem(34),
72
+ lineHeight: round(44 / 34),
73
+ letterSpacing: rem(-0.022 * baseFontSize),
74
+ },
75
+ 31: {
76
+ fontSize: rem(31),
77
+ lineHeight: round(40 / 31),
78
+ letterSpacing: rem(-0.021 * baseFontSize),
79
+ },
80
+ 29: {
81
+ fontSize: rem(29),
82
+ lineHeight: round(38 / 29),
83
+ letterSpacing: rem(-0.021 * baseFontSize),
84
+ },
85
+ 27: {
86
+ fontSize: rem(27),
87
+ lineHeight: round(36 / 27),
88
+ letterSpacing: rem(-0.021 * baseFontSize),
89
+ },
90
+ 25: {
91
+ fontSize: rem(25),
92
+ lineHeight: round(35 / 25),
93
+ letterSpacing: rem(-0.021 * baseFontSize),
94
+ },
95
+ 23: {
96
+ fontSize: rem(23),
97
+ lineHeight: round(32 / 23),
98
+ letterSpacing: rem(-0.019 * baseFontSize),
99
+ },
100
+ 22: {
101
+ fontSize: rem(22),
102
+ lineHeight: round(31 / 22),
103
+ letterSpacing: rem(-0.018 * baseFontSize),
104
+ },
105
+ 20: {
106
+ fontSize: rem(20),
107
+ lineHeight: round(30 / 20),
108
+ letterSpacing: rem(-0.017 * baseFontSize),
109
+ },
110
+ 19: {
111
+ fontSize: rem(19),
112
+ lineHeight: round(29 / 19),
113
+ letterSpacing: rem(-0.015 * baseFontSize),
114
+ },
115
+ 18: {
116
+ fontSize: rem(18),
117
+ lineHeight: round(28 / 18),
118
+ letterSpacing: rem(-0.014 * baseFontSize),
119
+ },
120
+ 16: {
121
+ fontSize: rem(16),
122
+ lineHeight: round(26 / 16),
123
+ letterSpacing: rem(-0.011 * baseFontSize),
124
+ },
125
+ 15: {
126
+ fontSize: rem(15),
127
+ lineHeight: round(24 / 15),
128
+ letterSpacing: rem(-0.009 * baseFontSize),
129
+ },
130
+ 14: {
131
+ fontSize: rem(14),
132
+ lineHeight: round(22 / 14),
133
+ letterSpacing: rem(-0.006 * baseFontSize),
134
+ },
135
+ 13: {
136
+ fontSize: rem(13),
137
+ lineHeight: round(21 / 13),
138
+ letterSpacing: rem(-0.003 * baseFontSize),
139
+ },
140
+ 12: { fontSize: rem(12), lineHeight: round(19 / 12) },
141
+ };
142
+ const headers = {
143
+ huge: {
144
+ fontFamily: fontStacks.black,
145
+ fontWeight: 900,
146
+ ...fontSizes[61],
147
+ [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[53],
148
+ [`@media (max-width: ${breakpoints_1.breakpoints.small}px`]: fontSizes[46],
149
+ },
150
+ h1: {
151
+ fontFamily: fontStacks.semiBold,
152
+ fontWeight: 500,
153
+ ...fontSizes[49],
154
+ [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[43],
155
+ [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[37],
156
+ },
157
+ h2: {
158
+ fontFamily: fontStacks.semiBold,
159
+ fontWeight: 500,
160
+ ...fontSizes[39],
161
+ [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[34],
162
+ [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[29],
163
+ },
164
+ h3: {
165
+ fontFamily: fontStacks.semiBold,
166
+ fontWeight: 500,
167
+ ...fontSizes[31],
168
+ [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[27],
169
+ [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[23],
170
+ },
171
+ h4: {
172
+ fontFamily: fontStacks.medium,
173
+ fontWeight: 500,
174
+ ...fontSizes[25],
175
+ [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[22],
176
+ [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[19],
177
+ },
178
+ h5: {
179
+ fontFamily: fontStacks.medium,
180
+ fontWeight: 500,
181
+ ...fontSizes[20],
182
+ [`@media (max-width: ${breakpoints_1.breakpoints.medium}px)`]: fontSizes[18],
183
+ [`@media (max-width: ${breakpoints_1.breakpoints.small}px)`]: fontSizes[16],
184
+ },
185
+ h6: {
186
+ fontFamily: fontStacks.medium,
187
+ fontWeight: 500,
188
+ ...fontSizes[16],
189
+ },
190
+ };
191
+ const body = {
192
+ headline: {
193
+ fontFamily: fontStacks.medium,
194
+ fontWeight: 400,
195
+ ...fontSizes[16],
196
+ },
197
+ paragraph: {
198
+ fontFamily: fontStacks.regular,
199
+ fontWeight: 400,
200
+ ...fontSizes[16],
201
+ },
202
+ label: {
203
+ fontFamily: fontStacks.medium,
204
+ fontWeight: 400,
205
+ ...fontSizes[15],
206
+ },
207
+ callout: {
208
+ fontFamily: fontStacks.regular,
209
+ fontWeight: 400,
210
+ ...fontSizes[14],
211
+ },
212
+ footnote: {
213
+ fontFamily: fontStacks.regular,
214
+ fontWeight: 400,
215
+ ...fontSizes[13],
216
+ },
217
+ caption: {
218
+ fontFamily: fontStacks.regular,
219
+ fontWeight: 400,
220
+ ...fontSizes[12],
221
+ },
222
+ code: {
223
+ fontFamily: fontStacks.mono,
224
+ fontWeight: 400,
225
+ ...fontSizes[13],
226
+ },
227
+ };
228
+ const utility = {
229
+ anchor: {
230
+ color: themes_1.theme.link.default,
231
+ fontWeight: 400,
232
+ textDecoration: 'none',
233
+ cursor: 'pointer',
234
+ opacity: 1,
235
+ // transform prevents a 1px shift on hover on Safari
236
+ transform: 'translate3d(0,0,0)',
237
+ ':visited': {
238
+ color: themes_1.theme.link.default,
239
+ },
240
+ ':hover': {
241
+ transition: '200ms',
242
+ opacity: 0.8,
243
+ },
244
+ },
245
+ li: {
246
+ ...fontSizes[16],
247
+ fontWeight: 400,
248
+ marginBottom: rem(0.5),
249
+ },
250
+ inlineCode: {
251
+ ...body.code,
252
+ fontWeight: 400,
253
+ display: 'inline-block',
254
+ backgroundColor: themes_1.theme.background.secondary,
255
+ border: `1px solid ${themes_1.theme.border.default}`,
256
+ borderRadius: sizing_1.borderRadius.medium,
257
+ padding: '2px 4px',
258
+ lineHeight: '130%',
259
+ },
260
+ terminalCode: {
261
+ ...body.code,
262
+ fontWeight: 400,
263
+ display: 'inline-block',
264
+ backgroundColor: themes_1.darkTheme.background.secondary,
265
+ color: themes_1.darkTheme.text.default,
266
+ border: `1px solid ${themes_1.darkTheme.border.default}`,
267
+ borderRadius: sizing_1.borderRadius.medium,
268
+ padding: '2px 4px',
269
+ lineHeight: '130%',
270
+ },
271
+ pre: {
272
+ ...body.code,
273
+ fontWeight: 400,
274
+ backgroundColor: themes_1.theme.background.secondary,
275
+ borderRadius: sizing_1.borderRadius.medium,
276
+ border: `1px solid ${themes_1.theme.border.default}`,
277
+ padding: spacing_1.spacing[4],
278
+ whiteSpace: 'pre-wrap',
279
+ margin: `${spacing_1.spacing[4]}px 0`,
280
+ },
281
+ terminalPre: {
282
+ ...body.code,
283
+ fontWeight: 400,
284
+ backgroundColor: themes_1.darkTheme.background.secondary,
285
+ color: themes_1.darkTheme.text.default,
286
+ borderRadius: sizing_1.borderRadius.medium,
287
+ border: `1px solid ${themes_1.darkTheme.border.default}`,
288
+ padding: spacing_1.spacing[4],
289
+ margin: `${spacing_1.spacing[4]}px 0`,
290
+ whiteSpace: 'pre-wrap',
291
+ '&:before': {
292
+ content: '"➜ "',
293
+ },
294
+ },
295
+ hr: {
296
+ backgroundColor: themes_1.theme.border.default,
297
+ border: 0,
298
+ height: 1,
299
+ display: 'block',
300
+ width: '100%',
301
+ },
302
+ blockquote: {
303
+ ...fontSizes[16],
304
+ fontWeight: 400,
305
+ color: themes_1.theme.text.secondary,
306
+ paddingLeft: spacing_1.spacing[4],
307
+ borderLeft: `${spacing_1.spacing[1]}px solid ${themes_1.theme.border.default}`,
308
+ },
309
+ };
310
+ exports.typography = {
311
+ baseFontSize,
312
+ headers,
313
+ body,
314
+ utility,
315
+ fontFaces,
316
+ fontStacks,
317
+ fontSizes,
318
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/styleguide",
3
- "version": "3.3.2",
3
+ "version": "3.4.2-alpha.1",
4
4
  "description": "Foundational styles for Expo interfaces.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,5 +37,5 @@
37
37
  "peerDependencies": {
38
38
  "react": "*"
39
39
  },
40
- "gitHead": "126598c82787550214db53049a3d3d0dd7ab43f8"
40
+ "gitHead": "5ac13fe7b45394f8d3bf63f409bc0f6056903f50"
41
41
  }