@expo/styleguide 14.0.0 → 14.1.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.
- package/dist/index.js +51 -2
- package/dist/src/components/Button/Button.js +291 -0
- package/dist/src/components/Button/ButtonBase.js +84 -0
- package/dist/src/components/Button/helpers.js +25 -0
- package/dist/src/components/Link/Link.js +57 -0
- package/dist/src/components/Link/LinkBase.js +131 -0
- package/dist/src/components/Theme/ThemeProvider.d.ts +1 -5
- package/dist/src/components/Theme/ThemeProvider.js +264 -0
- package/dist/src/components/Theme/index.d.ts +1 -0
- package/dist/src/components/Theme/theme-cookie.js +70 -0
- package/dist/src/components/Theme/types.d.ts +5 -0
- package/dist/src/components/Theme/types.js +10 -0
- package/dist/src/helpers/mergeClasses.d.ts +1 -1
- package/dist/src/logos/DocsLogo.js +71 -0
- package/dist/src/logos/ExpoGoLogo.js +62 -0
- package/dist/src/logos/Logo.js +62 -0
- package/dist/src/logos/OrbitLogo.js +71 -0
- package/dist/src/logos/RouterLogo.js +73 -0
- package/dist/src/logos/SnackLogo.js +73 -0
- package/dist/src/logos/WordMarkLogo.js +62 -0
- package/dist/src/styles/colors.js +18 -0
- package/dist/src/styles/shadows.js +12 -0
- package/dist/src/styles/themes.js +234 -0
- package/dist/src/styles/typography.js +308 -0
- package/package.json +7 -3
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var styleguideBase = require('@expo/styleguide-base');
|
|
4
|
+
var themes = require('./themes.js');
|
|
5
|
+
|
|
6
|
+
const baseFontSize = 16;
|
|
7
|
+
function round(value) {
|
|
8
|
+
return value.toFixed(7).replace(/(\.[0-9]+?)0+$/, '$1') // remove trailing zeroes after decimals
|
|
9
|
+
.replace(/\.0$/, ''); // remove any remaining zeroes
|
|
10
|
+
}
|
|
11
|
+
function rem(px) {
|
|
12
|
+
return `${round(px / baseFontSize)}rem`;
|
|
13
|
+
}
|
|
14
|
+
const fontSizes = {
|
|
15
|
+
64: {
|
|
16
|
+
fontSize: rem(64),
|
|
17
|
+
lineHeight: 1.1,
|
|
18
|
+
letterSpacing: '-3px'
|
|
19
|
+
},
|
|
20
|
+
48: {
|
|
21
|
+
fontSize: rem(48),
|
|
22
|
+
lineHeight: 1.1,
|
|
23
|
+
letterSpacing: '-2px'
|
|
24
|
+
},
|
|
25
|
+
32: {
|
|
26
|
+
fontSize: rem(32),
|
|
27
|
+
lineHeight: 1.1,
|
|
28
|
+
letterSpacing: '-0.5px'
|
|
29
|
+
},
|
|
30
|
+
24: {
|
|
31
|
+
fontSize: rem(24),
|
|
32
|
+
lineHeight: 1.2,
|
|
33
|
+
letterSpacing: '-0.5px'
|
|
34
|
+
},
|
|
35
|
+
20: {
|
|
36
|
+
fontSize: rem(20),
|
|
37
|
+
lineHeight: 1.4,
|
|
38
|
+
letterSpacing: '-0.25px'
|
|
39
|
+
},
|
|
40
|
+
18: {
|
|
41
|
+
fontSize: rem(18),
|
|
42
|
+
lineHeight: 1.4,
|
|
43
|
+
letterSpacing: '0'
|
|
44
|
+
},
|
|
45
|
+
16: {
|
|
46
|
+
fontSize: rem(16),
|
|
47
|
+
lineHeight: 1.6,
|
|
48
|
+
letterSpacing: '0'
|
|
49
|
+
},
|
|
50
|
+
14: {
|
|
51
|
+
fontSize: rem(14),
|
|
52
|
+
lineHeight: 1.6,
|
|
53
|
+
letterSpacing: '0'
|
|
54
|
+
},
|
|
55
|
+
12: {
|
|
56
|
+
fontSize: rem(12),
|
|
57
|
+
lineHeight: 1.6,
|
|
58
|
+
letterSpacing: '0'
|
|
59
|
+
},
|
|
60
|
+
10: {
|
|
61
|
+
fontSize: rem(10),
|
|
62
|
+
lineHeight: 1.6,
|
|
63
|
+
letterSpacing: '0'
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const headers = {
|
|
67
|
+
xl: {
|
|
68
|
+
huge: {
|
|
69
|
+
fontWeight: 600,
|
|
70
|
+
...fontSizes[64]
|
|
71
|
+
},
|
|
72
|
+
h1: {
|
|
73
|
+
fontWeight: 600,
|
|
74
|
+
...fontSizes[48]
|
|
75
|
+
},
|
|
76
|
+
h2: {
|
|
77
|
+
fontWeight: 600,
|
|
78
|
+
...fontSizes[32]
|
|
79
|
+
},
|
|
80
|
+
h3: {
|
|
81
|
+
fontWeight: 600,
|
|
82
|
+
...fontSizes[24]
|
|
83
|
+
},
|
|
84
|
+
h4: {
|
|
85
|
+
fontWeight: 600,
|
|
86
|
+
...fontSizes[20]
|
|
87
|
+
},
|
|
88
|
+
h5: {
|
|
89
|
+
fontWeight: 600,
|
|
90
|
+
...fontSizes[18]
|
|
91
|
+
},
|
|
92
|
+
h6: {
|
|
93
|
+
fontWeight: 600,
|
|
94
|
+
...fontSizes[16]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
default: {
|
|
98
|
+
huge: {
|
|
99
|
+
fontWeight: 600,
|
|
100
|
+
...fontSizes[48]
|
|
101
|
+
},
|
|
102
|
+
h1: {
|
|
103
|
+
fontWeight: 600,
|
|
104
|
+
...fontSizes[32]
|
|
105
|
+
},
|
|
106
|
+
h2: {
|
|
107
|
+
fontWeight: 600,
|
|
108
|
+
...fontSizes[24]
|
|
109
|
+
},
|
|
110
|
+
h3: {
|
|
111
|
+
fontWeight: 600,
|
|
112
|
+
...fontSizes[20]
|
|
113
|
+
},
|
|
114
|
+
h4: {
|
|
115
|
+
fontWeight: 600,
|
|
116
|
+
...fontSizes[18]
|
|
117
|
+
},
|
|
118
|
+
h5: {
|
|
119
|
+
fontWeight: 600,
|
|
120
|
+
...fontSizes[16]
|
|
121
|
+
},
|
|
122
|
+
h6: {
|
|
123
|
+
fontWeight: 600,
|
|
124
|
+
...fontSizes[14]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const baseStyle = {
|
|
129
|
+
fontWeight: 400,
|
|
130
|
+
...fontSizes[16]
|
|
131
|
+
};
|
|
132
|
+
const body = {
|
|
133
|
+
// Size-based text styles
|
|
134
|
+
'2xl': {
|
|
135
|
+
fontWeight: 500,
|
|
136
|
+
...fontSizes[24]
|
|
137
|
+
},
|
|
138
|
+
xl: {
|
|
139
|
+
fontWeight: 500,
|
|
140
|
+
...fontSizes[20]
|
|
141
|
+
},
|
|
142
|
+
lg: {
|
|
143
|
+
fontWeight: 400,
|
|
144
|
+
...fontSizes[18]
|
|
145
|
+
},
|
|
146
|
+
base: {
|
|
147
|
+
fontWeight: 400,
|
|
148
|
+
...fontSizes[16]
|
|
149
|
+
},
|
|
150
|
+
sm: {
|
|
151
|
+
fontWeight: 400,
|
|
152
|
+
...fontSizes[14]
|
|
153
|
+
},
|
|
154
|
+
xs: {
|
|
155
|
+
fontWeight: 400,
|
|
156
|
+
...fontSizes[12]
|
|
157
|
+
},
|
|
158
|
+
'2xs': {
|
|
159
|
+
fontWeight: 500,
|
|
160
|
+
...fontSizes[10]
|
|
161
|
+
},
|
|
162
|
+
// Semantic text styles (kept for backward compatibility)
|
|
163
|
+
headline: {
|
|
164
|
+
fontWeight: 500,
|
|
165
|
+
...fontSizes[16]
|
|
166
|
+
},
|
|
167
|
+
paragraph: baseStyle,
|
|
168
|
+
label: {
|
|
169
|
+
fontWeight: 500,
|
|
170
|
+
...fontSizes[14]
|
|
171
|
+
},
|
|
172
|
+
callout: {
|
|
173
|
+
fontWeight: 400,
|
|
174
|
+
...fontSizes[14]
|
|
175
|
+
},
|
|
176
|
+
footnote: {
|
|
177
|
+
fontWeight: 400,
|
|
178
|
+
...fontSizes[12]
|
|
179
|
+
},
|
|
180
|
+
caption: {
|
|
181
|
+
fontWeight: 400,
|
|
182
|
+
...fontSizes[12]
|
|
183
|
+
},
|
|
184
|
+
code: {
|
|
185
|
+
fontWeight: 400,
|
|
186
|
+
...fontSizes[16],
|
|
187
|
+
lineHeight: 1.6
|
|
188
|
+
},
|
|
189
|
+
eyebrow: {
|
|
190
|
+
fontWeight: 500,
|
|
191
|
+
fontSize: rem(12),
|
|
192
|
+
lineHeight: 1.0,
|
|
193
|
+
letterSpacing: '-0.5px',
|
|
194
|
+
textTransform: 'uppercase'
|
|
195
|
+
},
|
|
196
|
+
ul: {
|
|
197
|
+
marginLeft: '1.5rem',
|
|
198
|
+
'ol, ul': {
|
|
199
|
+
marginTop: '0.5rem',
|
|
200
|
+
marginBottom: '1rem'
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
ol: {
|
|
204
|
+
marginLeft: '1.5rem',
|
|
205
|
+
'ol, ul': {
|
|
206
|
+
marginTop: '0.5rem',
|
|
207
|
+
marginBottom: '1rem'
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
li: {
|
|
211
|
+
...baseStyle,
|
|
212
|
+
marginBottom: '0.5rem'
|
|
213
|
+
},
|
|
214
|
+
blockquote: {
|
|
215
|
+
...baseStyle,
|
|
216
|
+
color: themes.theme.text.secondary,
|
|
217
|
+
paddingLeft: styleguideBase.spacing[4],
|
|
218
|
+
borderLeft: `${styleguideBase.spacing[1]}px solid ${themes.theme.border.default}`
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const utility = {
|
|
222
|
+
anchor: {
|
|
223
|
+
color: themes.theme.text.link,
|
|
224
|
+
fontWeight: 400,
|
|
225
|
+
textDecoration: 'none',
|
|
226
|
+
cursor: 'pointer',
|
|
227
|
+
transition: '200ms',
|
|
228
|
+
// transform prevents a 1px shift on hover on Safari
|
|
229
|
+
transform: 'translate3d(0,0,0)',
|
|
230
|
+
':visited': {
|
|
231
|
+
color: themes.theme.text.link
|
|
232
|
+
},
|
|
233
|
+
':hover': {
|
|
234
|
+
opacity: 0.8
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
inlineCode: {
|
|
238
|
+
...body.code,
|
|
239
|
+
display: 'inline-block',
|
|
240
|
+
backgroundColor: themes.theme.background.subtle,
|
|
241
|
+
border: `1px solid ${themes.theme.border.default}`,
|
|
242
|
+
borderRadius: styleguideBase.borderRadius.md,
|
|
243
|
+
padding: '2px 4px',
|
|
244
|
+
lineHeight: '130%'
|
|
245
|
+
},
|
|
246
|
+
terminalCode: {
|
|
247
|
+
...body.code,
|
|
248
|
+
display: 'inline-block',
|
|
249
|
+
backgroundColor: styleguideBase.darkTheme.background.subtle,
|
|
250
|
+
color: styleguideBase.darkTheme.text.default,
|
|
251
|
+
border: `1px solid ${styleguideBase.darkTheme.border.default}`,
|
|
252
|
+
borderRadius: styleguideBase.borderRadius.md,
|
|
253
|
+
padding: '2px 4px',
|
|
254
|
+
lineHeight: '130%'
|
|
255
|
+
},
|
|
256
|
+
pre: {
|
|
257
|
+
...body.code,
|
|
258
|
+
backgroundColor: themes.theme.background.subtle,
|
|
259
|
+
borderRadius: styleguideBase.borderRadius.md,
|
|
260
|
+
border: `1px solid ${themes.theme.border.default}`,
|
|
261
|
+
padding: styleguideBase.spacing[4],
|
|
262
|
+
whiteSpace: 'pre-wrap',
|
|
263
|
+
margin: `${styleguideBase.spacing[4]}px 0`
|
|
264
|
+
},
|
|
265
|
+
terminalPre: {
|
|
266
|
+
...body.code,
|
|
267
|
+
backgroundColor: styleguideBase.darkTheme.background.subtle,
|
|
268
|
+
color: styleguideBase.darkTheme.text.default,
|
|
269
|
+
borderRadius: styleguideBase.borderRadius.md,
|
|
270
|
+
border: `1px solid ${styleguideBase.darkTheme.border.default}`,
|
|
271
|
+
padding: styleguideBase.spacing[4],
|
|
272
|
+
margin: `${styleguideBase.spacing[4]}px 0`,
|
|
273
|
+
whiteSpace: 'pre-wrap',
|
|
274
|
+
'&:before': {
|
|
275
|
+
content: '"➜ "'
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
hr: {
|
|
279
|
+
backgroundColor: themes.theme.border.default,
|
|
280
|
+
border: 0,
|
|
281
|
+
height: 1,
|
|
282
|
+
display: 'block',
|
|
283
|
+
width: '100%'
|
|
284
|
+
},
|
|
285
|
+
weight: {
|
|
286
|
+
black: {
|
|
287
|
+
fontWeight: 900
|
|
288
|
+
},
|
|
289
|
+
semiBold: {
|
|
290
|
+
fontWeight: 600
|
|
291
|
+
},
|
|
292
|
+
medium: {
|
|
293
|
+
fontWeight: 500
|
|
294
|
+
},
|
|
295
|
+
regular: {
|
|
296
|
+
fontWeight: 400
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
const typography = {
|
|
301
|
+
baseFontSize,
|
|
302
|
+
headers,
|
|
303
|
+
body,
|
|
304
|
+
utility,
|
|
305
|
+
fontSizes
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
exports.typography = typography;
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/styleguide",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.1.1",
|
|
4
4
|
"description": "Expo's styleguide components for use on the web.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"**/*.css"
|
|
9
|
+
],
|
|
7
10
|
"files": [
|
|
8
11
|
"dist",
|
|
9
12
|
"tailwind.js"
|
|
@@ -31,7 +34,7 @@
|
|
|
31
34
|
"url": "https://github.com/expo/styleguide/issues"
|
|
32
35
|
},
|
|
33
36
|
"dependencies": {
|
|
34
|
-
"@expo/styleguide-base": "^3.0
|
|
37
|
+
"@expo/styleguide-base": "^3.1.0",
|
|
35
38
|
"tailwind-merge": "^3.5.0"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
@@ -42,6 +45,7 @@
|
|
|
42
45
|
"npm-run-all": "*",
|
|
43
46
|
"rimraf": "*",
|
|
44
47
|
"rollup": "*",
|
|
48
|
+
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
45
49
|
"tailwindcss": "^4.2.2",
|
|
46
50
|
"vitest": "*"
|
|
47
51
|
},
|
|
@@ -53,5 +57,5 @@
|
|
|
53
57
|
"eslintConfig": {
|
|
54
58
|
"extends": "universe/web"
|
|
55
59
|
},
|
|
56
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "f236fe25a83254c7ad502713454a9e1f2e427a60"
|
|
57
61
|
}
|