@expo/styleguide 8.0.0-alpha.0 → 8.0.0-alpha.2
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/README.md +31 -4
- package/dist/expo-theme.css +3 -3
- package/dist/global.css +13 -0
- package/dist/index.js +210 -58
- package/dist/src/components/Button/Button.d.ts +12 -0
- package/dist/src/components/Button/ButtonBase.d.ts +8 -0
- package/dist/src/components/Button/helpers.d.ts +6 -0
- package/dist/src/components/Button/index.d.ts +2 -0
- package/dist/src/components/Link/Link.d.ts +3 -0
- package/dist/src/components/Link/LinkBase.d.ts +12 -0
- package/dist/src/components/Link/index.d.ts +2 -0
- package/dist/src/components/Theme/index.d.ts +2 -0
- package/dist/src/components/index.d.ts +3 -3
- package/dist/src/logos/DocsLogo.d.ts +1 -1
- package/dist/src/logos/ExpoGoLogo.d.ts +1 -1
- package/dist/src/logos/Logo.d.ts +1 -1
- package/dist/src/logos/SnackLogo.d.ts +1 -1
- package/dist/src/logos/WordMarkLogo.d.ts +1 -1
- package/dist/tailwind.js +261 -297
- package/package.json +11 -9
- package/tailwind.js +261 -297
- package/dist/src/components/ButtonBase.d.ts +0 -9
- /package/dist/src/components/{BlockingSetInitialColorMode.d.ts → Theme/BlockingSetInitialColorMode.d.ts} +0 -0
- /package/dist/src/components/{ThemeProvider.d.ts → Theme/ThemeProvider.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,17 +1,44 @@
|
|
|
1
1
|
# @expo/styleguide
|
|
2
2
|
|
|
3
|
-
Expo's styleguide components for use on the web.
|
|
3
|
+
Expo's styleguide and components for use on the web.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
1. Install Expo Styleguide package:
|
|
8
|
+
```shell
|
|
9
|
+
yarn add @expo/styleguide
|
|
10
|
+
```
|
|
11
|
+
2. Import global CSS files from the package in your JS(X)/TS(X) code:
|
|
12
|
+
```jsx
|
|
13
|
+
import "@expo/styleguide/dist/expo-theme.css";
|
|
14
|
+
import "@expo/styleguide/dist/global.css";
|
|
15
|
+
```
|
|
16
|
+
or import it the main stylesheet file:
|
|
17
|
+
```css
|
|
18
|
+
@import "@expo/styleguide/dist/expo-theme.css";
|
|
19
|
+
@import "@expo/styleguide/dist/global.css";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Tailwind theme
|
|
23
|
+
|
|
24
|
+
For the Styleguide we use our custom Tailwind theme, which is based on the default TW theme, with the following differences:
|
|
25
|
+
* only valid media screen scopes are: `small:`, `medium:` and `large:`
|
|
26
|
+
* there is a custom `hocus:` scope which is a shorthand for hover and focus states
|
|
27
|
+
* typography elements are predefined as a `heading-[size]` styles sets
|
|
28
|
+
* `icon-[size]` are custom classes defined for icons sizing
|
|
29
|
+
|
|
30
|
+
## Development
|
|
31
|
+
|
|
32
|
+
### Get started
|
|
6
33
|
|
|
7
34
|
1. Install dependencies with `yarn`.
|
|
8
35
|
2. Build everything with `yarn build`.
|
|
9
36
|
3. Develop with `yarn dev`.
|
|
10
37
|
|
|
11
|
-
|
|
38
|
+
### Changing Tailwind theme
|
|
12
39
|
|
|
13
40
|
In order to see changes made to the exported **tailwind.js** config:
|
|
14
41
|
|
|
15
42
|
- Change a value in **packages/styleguide/tailwind.js**
|
|
16
|
-
- Run yarn
|
|
43
|
+
- Run `yarn build` in **packages/styleguide**
|
|
17
44
|
- Navigate to **example-web** and restart the dev server
|
package/dist/expo-theme.css
CHANGED
|
@@ -228,13 +228,13 @@
|
|
|
228
228
|
--expo-theme-button-primary-destructive-text: var(--expo-color-white);
|
|
229
229
|
--expo-theme-button-primary-destructive-disabled-background: var(--red6);
|
|
230
230
|
--expo-theme-button-primary-destructive-disabled-border: var(--red6);
|
|
231
|
-
--expo-theme-button-primary-destructive-disabled-text: var(--
|
|
231
|
+
--expo-theme-button-primary-destructive-disabled-text: var(--red12);
|
|
232
232
|
|
|
233
233
|
--expo-theme-button-secondary-destructive-background: var(--red3);
|
|
234
234
|
--expo-theme-button-secondary-destructive-border: var(--red7);
|
|
235
235
|
--expo-theme-button-secondary-destructive-hover: var(--red2);
|
|
236
236
|
--expo-theme-button-secondary-destructive-icon: var(--red9);
|
|
237
|
-
--expo-theme-button-secondary-destructive-text: var(--
|
|
237
|
+
--expo-theme-button-secondary-destructive-text: var(--red11);
|
|
238
238
|
--expo-theme-button-secondary-destructive-disabled-background: var(--red2);
|
|
239
239
|
--expo-theme-button-secondary-destructive-disabled-border: var(--red6);
|
|
240
240
|
--expo-theme-button-secondary-destructive-disabled-text: var(--red10);
|
|
@@ -271,4 +271,4 @@
|
|
|
271
271
|
:root {
|
|
272
272
|
--expo-theme-heading-base-font-size: 16px;
|
|
273
273
|
}
|
|
274
|
-
}
|
|
274
|
+
}
|
package/dist/global.css
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer components {
|
|
6
|
+
.icon-md { @apply h-5 w-5; }
|
|
7
|
+
.icon-2xs { @apply h-3 w-3; }
|
|
8
|
+
.icon-xs { @apply h-3.5 w-3.5; }
|
|
9
|
+
.icon-sm { @apply h-4 w-4; }
|
|
10
|
+
.icon-lg { @apply h-6 w-6; }
|
|
11
|
+
.icon-xl { @apply h-8 w-8; }
|
|
12
|
+
.icon-2xl { @apply h-10 w-10; }
|
|
13
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
var Link$1 = require('next/link');
|
|
6
|
+
var styleguideBase = require('@expo/styleguide-base');
|
|
4
7
|
|
|
5
8
|
function isLocalStorageAvailable() {
|
|
6
9
|
try {
|
|
@@ -51,25 +54,23 @@ function BlockingSetInitialColorMode() {
|
|
|
51
54
|
} }));
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
exports.Themes = void 0;
|
|
55
58
|
(function (Themes) {
|
|
56
59
|
Themes["AUTO"] = "auto";
|
|
57
60
|
Themes["DARK"] = "dark";
|
|
58
61
|
Themes["LIGHT"] = "light";
|
|
59
|
-
})(Themes || (Themes = {}));
|
|
60
|
-
var ThemeContext = createContext({
|
|
62
|
+
})(exports.Themes || (exports.Themes = {}));
|
|
63
|
+
var ThemeContext = React.createContext({
|
|
61
64
|
setDarkMode: function () { },
|
|
62
65
|
setLightMode: function () { },
|
|
63
66
|
setAutoMode: function () { },
|
|
64
|
-
themeName: Themes.AUTO
|
|
67
|
+
themeName: exports.Themes.AUTO
|
|
65
68
|
});
|
|
66
69
|
function ThemeProvider(props) {
|
|
67
70
|
var children = props.children, _a = props.disabled, disabled = _a === void 0 ? false : _a;
|
|
68
|
-
var initialTheme = process.browser
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var _b = useState(disabled ? Themes.LIGHT : initialTheme), themeName = _b[0], setThemeName = _b[1];
|
|
72
|
-
useEffect(function didMount() {
|
|
71
|
+
var initialTheme = process.browser ? document.documentElement.dataset.expoTheme : exports.Themes.AUTO;
|
|
72
|
+
var _b = React.useState(disabled ? exports.Themes.LIGHT : initialTheme), themeName = _b[0], setThemeName = _b[1];
|
|
73
|
+
React.useEffect(function didMount() {
|
|
73
74
|
if (disabled)
|
|
74
75
|
return;
|
|
75
76
|
var mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
@@ -82,15 +83,15 @@ function ThemeProvider(props) {
|
|
|
82
83
|
}
|
|
83
84
|
if (isLocalStorageAvailable()) {
|
|
84
85
|
var themePreference = window.localStorage.getItem('data-expo-theme');
|
|
85
|
-
if (themePreference === Themes.LIGHT || themePreference === Themes.DARK) {
|
|
86
|
+
if (themePreference === exports.Themes.LIGHT || themePreference === exports.Themes.DARK) {
|
|
86
87
|
setThemeName(themePreference);
|
|
87
88
|
}
|
|
88
89
|
else {
|
|
89
|
-
setThemeName(Themes.AUTO);
|
|
90
|
+
setThemeName(exports.Themes.AUTO);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
else {
|
|
93
|
-
setThemeName(Themes.AUTO);
|
|
94
|
+
setThemeName(exports.Themes.AUTO);
|
|
94
95
|
}
|
|
95
96
|
return function unMount() {
|
|
96
97
|
try {
|
|
@@ -105,7 +106,7 @@ function ThemeProvider(props) {
|
|
|
105
106
|
function setDocumentTheme(themeName) {
|
|
106
107
|
if (disabled)
|
|
107
108
|
return;
|
|
108
|
-
if (themeName === Themes.DARK) {
|
|
109
|
+
if (themeName === exports.Themes.DARK) {
|
|
109
110
|
document.documentElement.classList.add('dark-theme');
|
|
110
111
|
}
|
|
111
112
|
else {
|
|
@@ -117,30 +118,30 @@ function ThemeProvider(props) {
|
|
|
117
118
|
var themePreference = window.localStorage.getItem('data-expo-theme');
|
|
118
119
|
if (!themePreference) {
|
|
119
120
|
if (event.matches) {
|
|
120
|
-
setDocumentTheme(Themes.DARK);
|
|
121
|
+
setDocumentTheme(exports.Themes.DARK);
|
|
121
122
|
}
|
|
122
123
|
else {
|
|
123
|
-
setDocumentTheme(Themes.LIGHT);
|
|
124
|
+
setDocumentTheme(exports.Themes.LIGHT);
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
else {
|
|
128
|
-
setDocumentTheme(Themes.AUTO);
|
|
129
|
+
setDocumentTheme(exports.Themes.AUTO);
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
function setDarkMode() {
|
|
132
133
|
if (isLocalStorageAvailable()) {
|
|
133
|
-
window.localStorage.setItem('data-expo-theme', Themes.DARK);
|
|
134
|
+
window.localStorage.setItem('data-expo-theme', exports.Themes.DARK);
|
|
134
135
|
}
|
|
135
|
-
setDocumentTheme(Themes.DARK);
|
|
136
|
-
setThemeName(Themes.DARK);
|
|
136
|
+
setDocumentTheme(exports.Themes.DARK);
|
|
137
|
+
setThemeName(exports.Themes.DARK);
|
|
137
138
|
}
|
|
138
139
|
function setLightMode() {
|
|
139
140
|
if (isLocalStorageAvailable()) {
|
|
140
|
-
window.localStorage.setItem('data-expo-theme', Themes.LIGHT);
|
|
141
|
+
window.localStorage.setItem('data-expo-theme', exports.Themes.LIGHT);
|
|
141
142
|
}
|
|
142
|
-
setDocumentTheme(Themes.LIGHT);
|
|
143
|
-
setThemeName(Themes.LIGHT);
|
|
143
|
+
setDocumentTheme(exports.Themes.LIGHT);
|
|
144
|
+
setThemeName(exports.Themes.LIGHT);
|
|
144
145
|
}
|
|
145
146
|
function setAutoMode() {
|
|
146
147
|
if (isLocalStorageAvailable()) {
|
|
@@ -148,7 +149,7 @@ function ThemeProvider(props) {
|
|
|
148
149
|
}
|
|
149
150
|
var themeName = getInitialColorMode();
|
|
150
151
|
setDocumentTheme(themeName);
|
|
151
|
-
setThemeName(Themes.AUTO);
|
|
152
|
+
setThemeName(exports.Themes.AUTO);
|
|
152
153
|
}
|
|
153
154
|
return (React.createElement(ThemeContext.Provider, { value: {
|
|
154
155
|
setDarkMode: setDarkMode,
|
|
@@ -158,7 +159,7 @@ function ThemeProvider(props) {
|
|
|
158
159
|
} }, children));
|
|
159
160
|
}
|
|
160
161
|
function useTheme() {
|
|
161
|
-
var context = useContext(ThemeContext);
|
|
162
|
+
var context = React.useContext(ThemeContext);
|
|
162
163
|
if (context === undefined) {
|
|
163
164
|
throw new Error('useTheme must be used within a ThemeProvider');
|
|
164
165
|
}
|
|
@@ -203,46 +204,181 @@ function __rest(s, e) {
|
|
|
203
204
|
return t;
|
|
204
205
|
}
|
|
205
206
|
|
|
206
|
-
var ButtonBase = forwardRef(function (_a, ref) {
|
|
207
|
-
var children = _a.children, testID = _a.testID, className = _a.className, _b = _a.type, type = _b === void 0 ? 'button' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, rest = __rest(_a, ["children", "testID", "className", "type", "disabled"]);
|
|
208
|
-
return (React.createElement("button", __assign({ className: twMerge(
|
|
207
|
+
var ButtonBase = React.forwardRef(function (_a, ref) {
|
|
208
|
+
var children = _a.children, testID = _a.testID, className = _a.className, onClick = _a.onClick, _b = _a.type, type = _b === void 0 ? 'button' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, rest = __rest(_a, ["children", "testID", "className", "onClick", "type", "disabled"]);
|
|
209
|
+
return (React.createElement("button", __assign({ className: tailwindMerge.twMerge('flex cursor-pointer', className), "data-testid": testID, disabled: disabled, ref: ref, type: type, onClick: disabled ? undefined : onClick }, rest), children));
|
|
209
210
|
});
|
|
210
211
|
|
|
212
|
+
var STOPWORDS = 'a an and at but by for in nor of on or so the to up yet'.split(' ');
|
|
213
|
+
function titleCase(value, options) {
|
|
214
|
+
var _a;
|
|
215
|
+
if (options === void 0) { options = {}; }
|
|
216
|
+
if (!value)
|
|
217
|
+
return '';
|
|
218
|
+
var stop = (_a = options.stopwords) !== null && _a !== void 0 ? _a : STOPWORDS;
|
|
219
|
+
var keep = options.keepSpaces;
|
|
220
|
+
var splitter = /(\s+|[-‑–—,:;!?()])/;
|
|
221
|
+
return value
|
|
222
|
+
.split(splitter)
|
|
223
|
+
.map(function (word, index, all) {
|
|
224
|
+
if (index % 2) {
|
|
225
|
+
if (/\s+/.test(word))
|
|
226
|
+
return keep ? word : ' ';
|
|
227
|
+
return word;
|
|
228
|
+
}
|
|
229
|
+
var lower = word.toLocaleLowerCase();
|
|
230
|
+
if (index !== 0 && index !== all.length - 1 && stop.includes(lower)) {
|
|
231
|
+
return lower;
|
|
232
|
+
}
|
|
233
|
+
return capitalize(word);
|
|
234
|
+
})
|
|
235
|
+
.join('');
|
|
236
|
+
}
|
|
237
|
+
function capitalize(text) {
|
|
238
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
var LinkBase = React.forwardRef(function (_a, ref) {
|
|
242
|
+
var children = _a.children, testID = _a.testID, href = _a.href, openInNewTab = _a.openInNewTab, onClick = _a.onClick, target = _a.target, disabled = _a.disabled, rel = _a.rel, rest = __rest(_a, ["children", "testID", "href", "openInNewTab", "onClick", "target", "disabled", "rel"]);
|
|
243
|
+
if (!href)
|
|
244
|
+
return null;
|
|
245
|
+
if (disabled) {
|
|
246
|
+
return (React.createElement("a", __assign({ ref: ref, "data-testid": testID }, rest), children));
|
|
247
|
+
}
|
|
248
|
+
return (React.createElement(Link$1, __assign({ href: href, ref: ref, onClick: onClick, target: openInNewTab ? '_blank' : target, rel: openInNewTab ? 'noopener noreferrer' : rel, "data-testid": testID }, rest), children));
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
function Link(_a) {
|
|
252
|
+
var className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["className", "disabled"]);
|
|
253
|
+
return (React.createElement(LinkBase, __assign({ className: tailwindMerge.twMerge('text-link transition-opacity', !disabled && 'hocus:opacity-80', className) }, rest)));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function getSizeClasses(size) {
|
|
257
|
+
switch (size) {
|
|
258
|
+
case 'xs':
|
|
259
|
+
return 'h-8 px-3 text-3xs';
|
|
260
|
+
case 'sm':
|
|
261
|
+
return 'h-9 px-4 text-xs';
|
|
262
|
+
case 'md':
|
|
263
|
+
return 'h-10 px-4 text-xs';
|
|
264
|
+
case 'lg':
|
|
265
|
+
return 'h-11 px-6 text-base';
|
|
266
|
+
case 'xl':
|
|
267
|
+
return 'h-12 px-6 text-base';
|
|
268
|
+
case '2xl':
|
|
269
|
+
return 'h-15 px-6 text-lg';
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function getThemeClasses(theme, disabled) {
|
|
273
|
+
if (disabled === void 0) { disabled = false; }
|
|
274
|
+
switch (theme) {
|
|
275
|
+
case 'primary':
|
|
276
|
+
return tailwindMerge.twMerge('border-button-primary bg-button-primary text-button-primary shadow-xs', !disabled && 'hocus:bg-button-primary-hover active:scale-98', disabled && 'bg-button-primary-disabled border-button-primary-disabled text-button-primary-disabled');
|
|
277
|
+
case 'primary-destructive':
|
|
278
|
+
return tailwindMerge.twMerge('border-button-primary-destructive bg-button-primary-destructive text-button-primary-destructive shadow-xs', !disabled && 'hocus:bg-button-primary-destructive-hover active:scale-98', disabled &&
|
|
279
|
+
'bg-button-primary-destructive-disabled border-button-primary-destructive-disabled text-button-primary-destructive-disabled');
|
|
280
|
+
case 'secondary':
|
|
281
|
+
return tailwindMerge.twMerge('border-button-secondary bg-button-secondary text-button-secondary shadow-xs', !disabled && 'hocus:bg-button-secondary-hover active:scale-98', disabled && 'bg-button-secondary-disabled border-button-secondary-disabled text-button-secondary-disabled');
|
|
282
|
+
case 'secondary-destructive':
|
|
283
|
+
return tailwindMerge.twMerge('border-button-secondary-destructive bg-button-secondary-destructive text-button-secondary-destructive shadow-xs', !disabled && 'hocus:bg-button-secondary-destructive-hover active:scale-98', disabled &&
|
|
284
|
+
'bg-button-secondary-destructive-disabled border-button-secondary-destructive-disabled text-button-secondary-destructive-disabled');
|
|
285
|
+
case 'tertiary':
|
|
286
|
+
return tailwindMerge.twMerge('border-button-tertiary bg-button-tertiary text-button-tertiary shadow-none', !disabled && 'hocus:bg-button-tertiary-hover active:scale-98', disabled && 'bg-button-tertiary-disabled border-button-tertiary-disabled text-button-tertiary-disabled');
|
|
287
|
+
case 'quaternary':
|
|
288
|
+
return tailwindMerge.twMerge('border-button-quaternary bg-button-quaternary text-button-quaternary shadow-none', !disabled && 'hocus:bg-button-quaternary-hover active:scale-98', disabled && 'bg-button-quaternary-disabled border-button-quaternary-disabled text-button-quaternary-disabled');
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
function getIconSizeClasses(size) {
|
|
292
|
+
switch (size) {
|
|
293
|
+
case 'xs':
|
|
294
|
+
return 'icon-xs';
|
|
295
|
+
case 'sm':
|
|
296
|
+
return 'icon-sm';
|
|
297
|
+
case 'md':
|
|
298
|
+
return 'icon-md';
|
|
299
|
+
case 'lg':
|
|
300
|
+
return 'icon-md';
|
|
301
|
+
case 'xl':
|
|
302
|
+
return 'icon-lg';
|
|
303
|
+
case '2xl':
|
|
304
|
+
return 'icon-lg';
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function getThemedIconClasses(theme) {
|
|
308
|
+
switch (theme) {
|
|
309
|
+
case 'primary':
|
|
310
|
+
return 'text-button-primary-icon';
|
|
311
|
+
case 'primary-destructive':
|
|
312
|
+
return 'text-button-primary-destructive-icon';
|
|
313
|
+
case 'secondary':
|
|
314
|
+
return 'text-button-secondary-icon';
|
|
315
|
+
case 'secondary-destructive':
|
|
316
|
+
return 'text-button-secondary-destructive-icon';
|
|
317
|
+
case 'tertiary':
|
|
318
|
+
return 'text-button-tertiary-icon';
|
|
319
|
+
case 'quaternary':
|
|
320
|
+
return 'text-button-quaternary-icon';
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function isIconElement(element) {
|
|
324
|
+
var _a, _b, _c;
|
|
325
|
+
if (React.isValidElement(element)) {
|
|
326
|
+
// @ts-ignore React Portal did not have `displayName` prop, but it is a valid element
|
|
327
|
+
return (_c = (_b = (_a = element.type) === null || _a === void 0 ? void 0 : _a.displayName) === null || _b === void 0 ? void 0 : _b.endsWith('Icon')) !== null && _c !== void 0 ? _c : false;
|
|
328
|
+
}
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
function getIconProps(element, classNames) {
|
|
332
|
+
return __assign(__assign({}, element.props), { className: tailwindMerge.twMerge(classNames, element.props.className) });
|
|
333
|
+
}
|
|
334
|
+
var Button = function (props) {
|
|
335
|
+
var children = props.children, _a = props.size, size = _a === void 0 ? 'sm' : _a, _b = props.theme, theme = _b === void 0 ? 'primary' : _b, href = props.href, disabled = props.disabled, className = props.className, leftSlot = props.leftSlot, rightSlot = props.rightSlot, openInNewTab = props.openInNewTab, rest = __rest(props, ["children", "size", "theme", "href", "disabled", "className", "leftSlot", "rightSlot", "openInNewTab"]);
|
|
336
|
+
var Element = href ? LinkBase : ButtonBase;
|
|
337
|
+
var isLeftSlotIcon = leftSlot && isIconElement(leftSlot);
|
|
338
|
+
var isRightSlotIcon = rightSlot && isIconElement(rightSlot);
|
|
339
|
+
var iconClasses = (isLeftSlotIcon || isRightSlotIcon) &&
|
|
340
|
+
tailwindMerge.twMerge("".concat(getIconSizeClasses(size)), getThemedIconClasses(theme), disabled && 'opacity-60');
|
|
341
|
+
return (React.createElement(Element, __assign({ href: href, className: tailwindMerge.twMerge("inline-flex border rounded-md font-medium gap-2 items-center whitespace-nowrap transition", getSizeClasses(size), getThemeClasses(theme, disabled), disabled && 'cursor-default opacity-80 pointer-event-none', className), disabled: disabled }, (href ? { openInNewTab: openInNewTab } : {}), rest),
|
|
342
|
+
isLeftSlotIcon ? React.cloneElement(leftSlot, getIconProps(leftSlot, iconClasses)) : leftSlot,
|
|
343
|
+
children && (React.createElement("span", { className: tailwindMerge.twMerge('flex self-center text-inherit leading-none', href && 'select-none') }, typeof children === 'string' ? titleCase(children) : children)),
|
|
344
|
+
isRightSlotIcon ? React.cloneElement(rightSlot, getIconProps(rightSlot, iconClasses)) : rightSlot));
|
|
345
|
+
};
|
|
346
|
+
|
|
211
347
|
function DocsLogo(props) {
|
|
212
|
-
var _a = props.title, title = _a === void 0 ?
|
|
348
|
+
var _a = props.title, title = _a === void 0 ? 'Docs-logo' : _a, color = props.color, titleId = props.titleId;
|
|
213
349
|
return (React.createElement("svg", __assign({ viewBox: "0 0 20 20", fill: "none", role: "img", "aria-labelledby": titleId }, props),
|
|
214
350
|
title ? React.createElement("title", { id: titleId }, title) : null,
|
|
215
|
-
React.createElement("path", { d: "M12.07 8a.157.157 0 01.166.015l5.374 4.141a.16.16 0 01.055.168l-.37 1.298a.157.157 0 01-.234.09l-4.416-2.768-.846 5.47a.157.157 0 01-.219.12l-1.158-.518a.157.157 0 01-.093-.154l.477-7.132a.157.157 0 01.085-.129L12.069 8z", fill: color ||
|
|
216
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.584.02a.157.157 0 00-.157.001L.708 5.071l-.003.001a.157.157 0 00-.079.135V15.31c0 .056.03.108.079.136l1.71.984.004.003a.157.157 0 00.157 0l1.054-.61v1.183c0 .056.03.108.078.136l1.715.987a.157.157 0 00.156 0l.003-.002 2.024-1.172.91 2.934a.157.157 0 00.198.102l1.815-.594a.156.156 0 00.03-.013l8.732-4.666a.157.157 0 00.075-.186L16.06 4.258a.157.157 0 00-.205-.098l-1.473.529v-1.85a.157.157 0 00-.079-.135l-.002-.001-1.713-.986a.157.157 0 00-.156 0l-1.054.61V1.144a.157.157 0 00-.078-.136L9.584.02zM5.33 9.56l-.003-1.578-1.383-.805v9.74l1.4.806-.014-8.119a.156.156 0 010-.045zM.94 5.48l1.384.805.017 9.741-1.4-.806V5.48zm9.968-4.336l-1.4-.806-8.412 4.87 1.385.806 8.427-4.87zM5.483 7.71l8.427-4.87-1.4-.806-8.411 4.87 1.384.806zm5.09 11.313l-3.21-9.971 8.455-4.519 3.21 9.97-8.456 4.52zM5.678 9.678l3.09 9.967 1.514-.496-3.21-9.972-1.394.501z", fill: color ||
|
|
351
|
+
React.createElement("path", { d: "M12.07 8a.157.157 0 01.166.015l5.374 4.141a.16.16 0 01.055.168l-.37 1.298a.157.157 0 01-.234.09l-4.416-2.768-.846 5.47a.157.157 0 01-.219.12l-1.158-.518a.157.157 0 01-.093-.154l.477-7.132a.157.157 0 01.085-.129L12.069 8z", fill: color || 'var(--expo-theme-icon-default)' }),
|
|
352
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.584.02a.157.157 0 00-.157.001L.708 5.071l-.003.001a.157.157 0 00-.079.135V15.31c0 .056.03.108.079.136l1.71.984.004.003a.157.157 0 00.157 0l1.054-.61v1.183c0 .056.03.108.078.136l1.715.987a.157.157 0 00.156 0l.003-.002 2.024-1.172.91 2.934a.157.157 0 00.198.102l1.815-.594a.156.156 0 00.03-.013l8.732-4.666a.157.157 0 00.075-.186L16.06 4.258a.157.157 0 00-.205-.098l-1.473.529v-1.85a.157.157 0 00-.079-.135l-.002-.001-1.713-.986a.157.157 0 00-.156 0l-1.054.61V1.144a.157.157 0 00-.078-.136L9.584.02zM5.33 9.56l-.003-1.578-1.383-.805v9.74l1.4.806-.014-8.119a.156.156 0 010-.045zM.94 5.48l1.384.805.017 9.741-1.4-.806V5.48zm9.968-4.336l-1.4-.806-8.412 4.87 1.385.806 8.427-4.87zM5.483 7.71l8.427-4.87-1.4-.806-8.411 4.87 1.384.806zm5.09 11.313l-3.21-9.971 8.455-4.519 3.21 9.97-8.456 4.52zM5.678 9.678l3.09 9.967 1.514-.496-3.21-9.972-1.394.501z", fill: color || 'var(--expo-theme-icon-default)' })));
|
|
217
353
|
}
|
|
218
354
|
|
|
219
355
|
function ExpoGoLogo(props) {
|
|
220
|
-
var _a = props.title, title = _a === void 0 ?
|
|
356
|
+
var _a = props.title, title = _a === void 0 ? 'Expo-go-logo' : _a, color = props.color, titleId = props.titleId;
|
|
221
357
|
return (React.createElement("svg", __assign({ viewBox: "0 0 20 20", fill: "none", role: "img", "aria-labelledby": titleId }, props),
|
|
222
358
|
title ? React.createElement("title", { id: titleId }, title) : null,
|
|
223
|
-
React.createElement("path", { d: "M18.072 7.75a1.749 1.749 0 00-1.56-.732 1.763 1.763 0 00-1.436.946 1.55 1.55 0 00.302 1.75 2.57 2.57 0 001.716-.484 2.53 2.53 0 00.978-1.48zM12.866 1L11.751.394 6.897 3.072l.387.207.736.383 1.332-.733L12.867.987 12.866 1zm.449-.184a.173.173 0 01.124.115l1.626 4.755a.158.158 0 01-.077.207 3.126 3.126 0 00-1.384 1.519 3.09 3.09 0 00-.134 2.042 3.29 3.29 0 001.35 1.793 3.343 3.343 0 002.195.524.208.208 0 01.202.123l1.68 4.88a.196.196 0 01-.078.215l-5.163 2.992a.195.195 0 01-.078.015.208.208 0 01-.14-.022l-1.81-1.129a.18.18 0 01-.078-.076l-3.538-8.065-5.388 3.039a.25.25 0 01-.21.008l-1.224-.69a.177.177 0 01-.077-.23l5.234-9.847c.02-.033.05-.06.085-.076L11.65.023a.2.2 0 01.186 0l1.479.793zM6.843 3.46l-.256-.13-5.044 9.523.92.514 4.352-5.643a.212.212 0 01.178-.077.217.217 0 01.155.115l4.738 10.82 1.266.775L8.066 4.62l-.216-.614-1.014-.552.007.007zm7.804 5.679a1.932 1.932 0 01.092-1.28c.176-.404.484-.737.875-.945a2.152 2.152 0 012.509.307 1.934 1.934 0 01.056 2.745l-.056.056a2.118 2.118 0 01-1.986.516 2.118 2.118 0 01-.928-.508 2.091 2.091 0 01-.562-.891z", fill: color ||
|
|
359
|
+
React.createElement("path", { d: "M18.072 7.75a1.749 1.749 0 00-1.56-.732 1.763 1.763 0 00-1.436.946 1.55 1.55 0 00.302 1.75 2.57 2.57 0 001.716-.484 2.53 2.53 0 00.978-1.48zM12.866 1L11.751.394 6.897 3.072l.387.207.736.383 1.332-.733L12.867.987 12.866 1zm.449-.184a.173.173 0 01.124.115l1.626 4.755a.158.158 0 01-.077.207 3.126 3.126 0 00-1.384 1.519 3.09 3.09 0 00-.134 2.042 3.29 3.29 0 001.35 1.793 3.343 3.343 0 002.195.524.208.208 0 01.202.123l1.68 4.88a.196.196 0 01-.078.215l-5.163 2.992a.195.195 0 01-.078.015.208.208 0 01-.14-.022l-1.81-1.129a.18.18 0 01-.078-.076l-3.538-8.065-5.388 3.039a.25.25 0 01-.21.008l-1.224-.69a.177.177 0 01-.077-.23l5.234-9.847c.02-.033.05-.06.085-.076L11.65.023a.2.2 0 01.186 0l1.479.793zM6.843 3.46l-.256-.13-5.044 9.523.92.514 4.352-5.643a.212.212 0 01.178-.077.217.217 0 01.155.115l4.738 10.82 1.266.775L8.066 4.62l-.216-.614-1.014-.552.007.007zm7.804 5.679a1.932 1.932 0 01.092-1.28c.176-.404.484-.737.875-.945a2.152 2.152 0 012.509.307 1.934 1.934 0 01.056 2.745l-.056.056a2.118 2.118 0 01-1.986.516 2.118 2.118 0 01-.928-.508 2.091 2.091 0 01-.562-.891z", fill: color || 'var(--expo-theme-icon-default)' })));
|
|
224
360
|
}
|
|
225
361
|
|
|
226
362
|
function Logo(props) {
|
|
227
|
-
var _a = props.title, title = _a === void 0 ?
|
|
363
|
+
var _a = props.title, title = _a === void 0 ? 'Logo' : _a, color = props.color, titleId = props.titleId;
|
|
228
364
|
return (React.createElement("svg", __assign({ viewBox: "0 0 20 20", fill: "none", role: "img", "aria-labelledby": titleId }, props),
|
|
229
365
|
title ? React.createElement("title", { id: titleId }, title) : null,
|
|
230
|
-
React.createElement("path", { d: "M9.477 7.638c.164-.24.343-.27.488-.27.145 0 .387.03.551.27 2.13 2.901 6.55 10.56 6.959 10.976.605.618 1.436.233 1.918-.468.475-.69.607-1.174.607-1.69 0-.352-6.883-13.05-7.576-14.106-.667-1.017-.884-1.274-2.025-1.274h-.854c-1.138 0-1.302.257-1.969 1.274C6.883 3.406 0 16.104 0 16.456c0 .517.132 1 .607 1.69.482.7 1.313 1.086 1.918.468.41-.417 4.822-8.075 6.952-10.977z", fill: color ||
|
|
366
|
+
React.createElement("path", { d: "M9.477 7.638c.164-.24.343-.27.488-.27.145 0 .387.03.551.27 2.13 2.901 6.55 10.56 6.959 10.976.605.618 1.436.233 1.918-.468.475-.69.607-1.174.607-1.69 0-.352-6.883-13.05-7.576-14.106-.667-1.017-.884-1.274-2.025-1.274h-.854c-1.138 0-1.302.257-1.969 1.274C6.883 3.406 0 16.104 0 16.456c0 .517.132 1 .607 1.69.482.7 1.313 1.086 1.918.468.41-.417 4.822-8.075 6.952-10.977z", fill: color || 'var(--expo-theme-icon-default)' })));
|
|
231
367
|
}
|
|
232
368
|
|
|
233
369
|
function SnackLogo(props) {
|
|
234
|
-
var _a = props.title, title = _a === void 0 ?
|
|
370
|
+
var _a = props.title, title = _a === void 0 ? 'Snack-logo' : _a, color = props.color, titleId = props.titleId;
|
|
235
371
|
return (React.createElement("svg", __assign({ viewBox: "0 0 20 20", fill: "none", role: "img", "aria-labelledby": titleId }, props),
|
|
236
372
|
title ? React.createElement("title", { id: titleId }, title) : null,
|
|
237
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.168 1.152a2.752 2.752 0 100 5.504 2.752 2.752 0 000-5.504zm-2.43 2.752a2.429 2.429 0 014.608-1.075 3.805 3.805 0 01-3.701 2.925h-.051a2.423 2.423 0 01-.855-1.85zm-1.755-1.422a.16.16 0 01.081.14v4.825L17.23 9.86c.05.029.081.082.082.14l.026 4.92a.16.16 0 01-.081.14l-8.52 4.92a.161.161 0 01-.242-.14V10c0-.057.03-.11.08-.14l4.006-2.319-4.005-2.32a.161.161 0 010-.28l4.246-2.458a.161.161 0 01.162 0zm3.845 7.517L13.064 7.82v4.36L16.828 10zM8.978 5.08l3.764 2.18V2.901l-3.763 2.18z", fill: color ||
|
|
238
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.75.022a.161.161 0 00-.162 0l-4.242 2.46a.16.16 0 00-.019.01L.11 4.94l-.003.001a.161.161 0 00-.081.136v.004l-.013 4.994a.161.161 0 000 .125L0 14.92c0 .058.03.111.08.14l4.24 2.455.03.018 4.226 2.446a.161.161 0 00.242-.14v-9.746l4.166-2.412a.162.162 0 000-.28l-.081-.046V2.808l.08-.047a.162.162 0 000-.28L8.75.022zm3.828 2.597L8.67.35 4.74 2.626l3.917 2.267 3.922-2.275zM8.656 5.268L4.74 7.538l3.916 2.275L12.58 7.54 8.656 5.268zM4.419 7.352l3.915-2.27-3.916-2.268L.508 5.08 4.42 7.35zm-.165.277v4.692L.336 10.05l.012-4.69 3.906 2.268zm.323 4.879V7.817l3.918 2.275v4.685l-3.918-2.27zm-.323.186l-3.92-2.27-.01 4.403 3.93 2.276v-4.41zm.323 4.596v-4.41l3.918 2.27v4.408L4.577 17.29z", fill: color ||
|
|
373
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.168 1.152a2.752 2.752 0 100 5.504 2.752 2.752 0 000-5.504zm-2.43 2.752a2.429 2.429 0 014.608-1.075 3.805 3.805 0 01-3.701 2.925h-.051a2.423 2.423 0 01-.855-1.85zm-1.755-1.422a.16.16 0 01.081.14v4.825L17.23 9.86c.05.029.081.082.082.14l.026 4.92a.16.16 0 01-.081.14l-8.52 4.92a.161.161 0 01-.242-.14V10c0-.057.03-.11.08-.14l4.006-2.319-4.005-2.32a.161.161 0 010-.28l4.246-2.458a.161.161 0 01.162 0zm3.845 7.517L13.064 7.82v4.36L16.828 10zM8.978 5.08l3.764 2.18V2.901l-3.763 2.18z", fill: color || 'var(--expo-theme-icon-default)' }),
|
|
374
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.75.022a.161.161 0 00-.162 0l-4.242 2.46a.16.16 0 00-.019.01L.11 4.94l-.003.001a.161.161 0 00-.081.136v.004l-.013 4.994a.161.161 0 000 .125L0 14.92c0 .058.03.111.08.14l4.24 2.455.03.018 4.226 2.446a.161.161 0 00.242-.14v-9.746l4.166-2.412a.162.162 0 000-.28l-.081-.046V2.808l.08-.047a.162.162 0 000-.28L8.75.022zm3.828 2.597L8.67.35 4.74 2.626l3.917 2.267 3.922-2.275zM8.656 5.268L4.74 7.538l3.916 2.275L12.58 7.54 8.656 5.268zM4.419 7.352l3.915-2.27-3.916-2.268L.508 5.08 4.42 7.35zm-.165.277v4.692L.336 10.05l.012-4.69 3.906 2.268zm.323 4.879V7.817l3.918 2.275v4.685l-3.918-2.27zm-.323.186l-3.92-2.27-.01 4.403 3.93 2.276v-4.41zm.323 4.596v-4.41l3.918 2.27v4.408L4.577 17.29z", fill: color || 'var(--expo-theme-icon-default)' })));
|
|
239
375
|
}
|
|
240
376
|
|
|
241
377
|
function WordMarkLogo(props) {
|
|
242
|
-
var _a = props.title, title = _a === void 0 ?
|
|
378
|
+
var _a = props.title, title = _a === void 0 ? 'Word-mark-logo' : _a, color = props.color, titleId = props.titleId;
|
|
243
379
|
return (React.createElement("svg", __assign({ viewBox: "0 0 71 20", fill: "none", role: "img", "aria-labelledby": titleId }, props),
|
|
244
380
|
title ? React.createElement("title", { id: titleId }, title) : null,
|
|
245
|
-
React.createElement("path", { d: "M9.258 6.342c.158-.23.331-.26.472-.26.14 0 .374.03.532.26 2.06 2.806 6.332 10.208 6.727 10.611.585.597 1.388.225 1.854-.452.46-.667.587-1.135.587-1.634 0-.34-6.653-12.614-7.324-13.636C11.462.248 11.252 0 10.15 0h-.825c-1.1 0-1.259.248-1.903 1.23C6.75 2.254.097 14.528.097 14.868c0 .5.127.967.587 1.634.466.677 1.269 1.05 1.854.452.395-.403 4.661-7.805 6.72-10.61zm14.941-5.237v15.344h9.35v-3.113h-6.125v-3.244h5.45V6.98h-5.45V4.218h6.125V1.105h-9.35zM46.25 16.449l-3.88-5.568 3.619-5.195h-3.662L40.54 8.23l-1.765-2.543h-3.706l3.618 5.217-3.857 5.546h3.661l2.027-2.915 2.027 2.915h3.705zm7.572-10.982c-1.482 0-2.637.614-3.378 1.732V5.686H47.37V20h3.073v-5.063c.74 1.117 1.896 1.731 3.378 1.731 2.768 0 4.97-2.52 4.97-5.611 0-3.091-2.202-5.59-4.97-5.59zm-.697 8.242c-1.504 0-2.681-1.14-2.681-2.652 0-1.49 1.177-2.653 2.68-2.653 1.483 0 2.681 1.184 2.681 2.653 0 1.49-1.198 2.652-2.68 2.652zm12.188-8.242c-3.16 0-5.558 2.411-5.558 5.612 0 3.2 2.397 5.59 5.557 5.59 3.139 0 5.558-2.39 5.558-5.59 0-3.2-2.42-5.612-5.558-5.612zm0 2.96c1.438 0 2.55 1.117 2.55 2.652 0 1.49-1.112 2.63-2.55 2.63-1.46 0-2.55-1.14-2.55-2.63 0-1.535 1.09-2.653 2.55-2.653z", fill: color ||
|
|
381
|
+
React.createElement("path", { d: "M9.258 6.342c.158-.23.331-.26.472-.26.14 0 .374.03.532.26 2.06 2.806 6.332 10.208 6.727 10.611.585.597 1.388.225 1.854-.452.46-.667.587-1.135.587-1.634 0-.34-6.653-12.614-7.324-13.636C11.462.248 11.252 0 10.15 0h-.825c-1.1 0-1.259.248-1.903 1.23C6.75 2.254.097 14.528.097 14.868c0 .5.127.967.587 1.634.466.677 1.269 1.05 1.854.452.395-.403 4.661-7.805 6.72-10.61zm14.941-5.237v15.344h9.35v-3.113h-6.125v-3.244h5.45V6.98h-5.45V4.218h6.125V1.105h-9.35zM46.25 16.449l-3.88-5.568 3.619-5.195h-3.662L40.54 8.23l-1.765-2.543h-3.706l3.618 5.217-3.857 5.546h3.661l2.027-2.915 2.027 2.915h3.705zm7.572-10.982c-1.482 0-2.637.614-3.378 1.732V5.686H47.37V20h3.073v-5.063c.74 1.117 1.896 1.731 3.378 1.731 2.768 0 4.97-2.52 4.97-5.611 0-3.091-2.202-5.59-4.97-5.59zm-.697 8.242c-1.504 0-2.681-1.14-2.681-2.652 0-1.49 1.177-2.653 2.68-2.653 1.483 0 2.681 1.184 2.681 2.653 0 1.49-1.198 2.652-2.68 2.652zm12.188-8.242c-3.16 0-5.558 2.411-5.558 5.612 0 3.2 2.397 5.59 5.557 5.59 3.139 0 5.558-2.39 5.558-5.59 0-3.2-2.42-5.612-5.558-5.612zm0 2.96c1.438 0 2.55 1.117 2.55 2.652 0 1.49-1.112 2.63-2.55 2.63-1.46 0-2.55-1.14-2.55-2.63 0-1.535 1.09-2.653 2.55-2.653z", fill: color || 'var(--expo-theme-icon-default)' })));
|
|
246
382
|
}
|
|
247
383
|
|
|
248
384
|
var shadows = {
|
|
@@ -603,19 +739,19 @@ var fontSizes = {
|
|
|
603
739
|
};
|
|
604
740
|
var headers = {
|
|
605
741
|
xl: {
|
|
606
|
-
huge: __assign(__assign({ fontWeight: 900 }, fontSizes[61]), (_a = {}, _a["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[53], _a["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[46], _a)),
|
|
607
|
-
h1: __assign(__assign({ fontWeight: 600 }, fontSizes[49]), (_b = {}, _b["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[43], _b["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[37], _b)),
|
|
608
|
-
h2: __assign(__assign({ fontWeight: 600 }, fontSizes[39]), (_c = {}, _c["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[34], _c["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[29], _c)),
|
|
609
|
-
h3: __assign(__assign({ fontWeight: 600 }, fontSizes[31]), (_d = {}, _d["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[27], _d["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[23], _d)),
|
|
610
|
-
h4: __assign(__assign({ fontWeight: 500 }, fontSizes[25]), (_e = {}, _e["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[22], _e["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[19], _e)),
|
|
611
|
-
h5: __assign(__assign({ fontWeight: 500 }, fontSizes[20]), (_f = {}, _f["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[18], _f["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[16], _f)),
|
|
742
|
+
huge: __assign(__assign({ fontWeight: 900 }, fontSizes[61]), (_a = {}, _a["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[53], _a["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[46], _a)),
|
|
743
|
+
h1: __assign(__assign({ fontWeight: 600 }, fontSizes[49]), (_b = {}, _b["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[43], _b["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[37], _b)),
|
|
744
|
+
h2: __assign(__assign({ fontWeight: 600 }, fontSizes[39]), (_c = {}, _c["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[34], _c["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[29], _c)),
|
|
745
|
+
h3: __assign(__assign({ fontWeight: 600 }, fontSizes[31]), (_d = {}, _d["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[27], _d["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[23], _d)),
|
|
746
|
+
h4: __assign(__assign({ fontWeight: 500 }, fontSizes[25]), (_e = {}, _e["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[22], _e["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[19], _e)),
|
|
747
|
+
h5: __assign(__assign({ fontWeight: 500 }, fontSizes[20]), (_f = {}, _f["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[18], _f["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[16], _f)),
|
|
612
748
|
h6: __assign({ fontWeight: 500 }, fontSizes[16])
|
|
613
749
|
},
|
|
614
750
|
"default": {
|
|
615
|
-
huge: __assign(__assign({ fontWeight: 900 }, fontSizes[39]), (_g = {}, _g["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[34], _g["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[29], _g)),
|
|
616
|
-
h1: __assign(__assign({ fontWeight: 600 }, fontSizes[31]), (_h = {}, _h["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[27], _h["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[23], _h)),
|
|
617
|
-
h2: __assign(__assign({ fontWeight: 600 }, fontSizes[25]), (_j = {}, _j["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[22], _j["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[19], _j)),
|
|
618
|
-
h3: __assign(__assign({ fontWeight: 600 }, fontSizes[20]), (_k = {}, _k["@media (max-width: ".concat(breakpoints.medium, "px)")] = fontSizes[18], _k["@media (max-width: ".concat(breakpoints.small, "px)")] = fontSizes[16], _k)),
|
|
751
|
+
huge: __assign(__assign({ fontWeight: 900 }, fontSizes[39]), (_g = {}, _g["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[34], _g["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[29], _g)),
|
|
752
|
+
h1: __assign(__assign({ fontWeight: 600 }, fontSizes[31]), (_h = {}, _h["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[27], _h["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[23], _h)),
|
|
753
|
+
h2: __assign(__assign({ fontWeight: 600 }, fontSizes[25]), (_j = {}, _j["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[22], _j["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[19], _j)),
|
|
754
|
+
h3: __assign(__assign({ fontWeight: 600 }, fontSizes[20]), (_k = {}, _k["@media (max-width: ".concat(styleguideBase.breakpoints.medium, "px)")] = fontSizes[18], _k["@media (max-width: ".concat(styleguideBase.breakpoints.small, "px)")] = fontSizes[16], _k)),
|
|
619
755
|
h4: __assign({ fontWeight: 600 }, fontSizes[16]),
|
|
620
756
|
h5: __assign({ fontWeight: 600 }, fontSizes[13]),
|
|
621
757
|
h6: __assign({ fontWeight: 600 }, fontSizes[12])
|
|
@@ -645,7 +781,7 @@ var body = {
|
|
|
645
781
|
}
|
|
646
782
|
},
|
|
647
783
|
li: __assign(__assign({}, baseStyle), { marginBottom: '0.5rem' }),
|
|
648
|
-
blockquote: __assign(__assign({}, baseStyle), { color: theme.text.secondary, paddingLeft: spacing[4], borderLeft: "".concat(spacing[1], "px solid ").concat(theme.border["default"]) })
|
|
784
|
+
blockquote: __assign(__assign({}, baseStyle), { color: theme.text.secondary, paddingLeft: styleguideBase.spacing[4], borderLeft: "".concat(styleguideBase.spacing[1], "px solid ").concat(theme.border["default"]) })
|
|
649
785
|
};
|
|
650
786
|
var utility = {
|
|
651
787
|
anchor: {
|
|
@@ -663,10 +799,10 @@ var utility = {
|
|
|
663
799
|
opacity: 0.8
|
|
664
800
|
}
|
|
665
801
|
},
|
|
666
|
-
inlineCode: __assign(__assign({}, body.code), { display: 'inline-block', backgroundColor: theme.background.subtle, border: "1px solid ".concat(theme.border["default"]), borderRadius: borderRadius.md, padding: '2px 4px', lineHeight: '130%' }),
|
|
667
|
-
terminalCode: __assign(__assign({}, body.code), { display: 'inline-block', backgroundColor: darkTheme.background.subtle, color: darkTheme.text["default"], border: "1px solid ".concat(darkTheme.border["default"]), borderRadius: borderRadius.md, padding: '2px 4px', lineHeight: '130%' }),
|
|
668
|
-
pre: __assign(__assign({}, body.code), { backgroundColor: theme.background.subtle, borderRadius: borderRadius.md, border: "1px solid ".concat(theme.border["default"]), padding: spacing[4], whiteSpace: 'pre-wrap', margin: "".concat(spacing[4], "px 0") }),
|
|
669
|
-
terminalPre: __assign(__assign({}, body.code), { backgroundColor: darkTheme.background.subtle, color: darkTheme.text["default"], borderRadius: borderRadius.md, border: "1px solid ".concat(darkTheme.border["default"]), padding: spacing[4], margin: "".concat(spacing[4], "px 0"), whiteSpace: 'pre-wrap', '&:before': {
|
|
802
|
+
inlineCode: __assign(__assign({}, body.code), { display: 'inline-block', backgroundColor: theme.background.subtle, border: "1px solid ".concat(theme.border["default"]), borderRadius: styleguideBase.borderRadius.md, padding: '2px 4px', lineHeight: '130%' }),
|
|
803
|
+
terminalCode: __assign(__assign({}, body.code), { display: 'inline-block', backgroundColor: styleguideBase.darkTheme.background.subtle, color: styleguideBase.darkTheme.text["default"], border: "1px solid ".concat(styleguideBase.darkTheme.border["default"]), borderRadius: styleguideBase.borderRadius.md, padding: '2px 4px', lineHeight: '130%' }),
|
|
804
|
+
pre: __assign(__assign({}, body.code), { backgroundColor: theme.background.subtle, borderRadius: styleguideBase.borderRadius.md, border: "1px solid ".concat(theme.border["default"]), padding: styleguideBase.spacing[4], whiteSpace: 'pre-wrap', margin: "".concat(styleguideBase.spacing[4], "px 0") }),
|
|
805
|
+
terminalPre: __assign(__assign({}, body.code), { backgroundColor: styleguideBase.darkTheme.background.subtle, color: styleguideBase.darkTheme.text["default"], borderRadius: styleguideBase.borderRadius.md, border: "1px solid ".concat(styleguideBase.darkTheme.border["default"]), padding: styleguideBase.spacing[4], margin: "".concat(styleguideBase.spacing[4], "px 0"), whiteSpace: 'pre-wrap', '&:before': {
|
|
670
806
|
content: '"➜ "'
|
|
671
807
|
} }),
|
|
672
808
|
hr: {
|
|
@@ -699,4 +835,20 @@ var typography = {
|
|
|
699
835
|
fontSizes: fontSizes
|
|
700
836
|
};
|
|
701
837
|
|
|
702
|
-
|
|
838
|
+
exports.BlockingSetInitialColorMode = BlockingSetInitialColorMode;
|
|
839
|
+
exports.Button = Button;
|
|
840
|
+
exports.ButtonBase = ButtonBase;
|
|
841
|
+
exports.DocsLogo = DocsLogo;
|
|
842
|
+
exports.ExpoGoLogo = ExpoGoLogo;
|
|
843
|
+
exports.Link = Link;
|
|
844
|
+
exports.LinkBase = LinkBase;
|
|
845
|
+
exports.Logo = Logo;
|
|
846
|
+
exports.SnackLogo = SnackLogo;
|
|
847
|
+
exports.ThemeProvider = ThemeProvider;
|
|
848
|
+
exports.WordMarkLogo = WordMarkLogo;
|
|
849
|
+
exports.getInitialColorMode = getInitialColorMode;
|
|
850
|
+
exports.isLocalStorageAvailable = isLocalStorageAvailable;
|
|
851
|
+
exports.shadows = shadows;
|
|
852
|
+
exports.theme = theme;
|
|
853
|
+
exports.typography = typography;
|
|
854
|
+
exports.useTheme = useTheme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import { ButtonBaseProps } from './ButtonBase';
|
|
3
|
+
import { LinkBaseProps } from '../Link';
|
|
4
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
|
+
export type ButtonTheme = 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'primary-destructive' | 'secondary-destructive';
|
|
6
|
+
export type ButtonProps = ButtonBaseProps & LinkBaseProps & {
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
theme?: ButtonTheme;
|
|
9
|
+
leftSlot?: ReactElement;
|
|
10
|
+
rightSlot?: ReactElement;
|
|
11
|
+
};
|
|
12
|
+
export declare const Button: (props: ButtonProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonHTMLAttributes } from 'react';
|
|
3
|
+
export type ButtonBaseProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
testID?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const ButtonBase: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
7
|
+
testID?: string | undefined;
|
|
8
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AnchorHTMLAttributes } from 'react';
|
|
3
|
+
export type LinkBaseProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
4
|
+
testID?: string;
|
|
5
|
+
openInNewTab?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const LinkBase: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
9
|
+
testID?: string | undefined;
|
|
10
|
+
openInNewTab?: boolean | undefined;
|
|
11
|
+
disabled?: boolean | undefined;
|
|
12
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './Theme';
|
|
2
|
+
export * from './Button';
|
|
3
|
+
export * from './Link';
|
package/dist/src/logos/Logo.d.ts
CHANGED