@expo/styleguide 15.0.3 → 15.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +10 -14
- package/dist/expo-theme.css +38 -38
- package/dist/src/components/Button/Button.d.ts +2 -2
- package/dist/src/components/Button/Button.js +48 -180
- package/dist/src/components/Button/ButtonBase.js +19 -73
- package/dist/src/components/Link/Link.js +27 -21
- package/dist/src/components/Link/LinkBase.js +63 -57
- package/dist/src/components/Theme/ThemeProvider.d.ts +1 -1
- package/dist/src/components/Theme/ThemeProvider.js +94 -170
- package/dist/src/logos/DocsLogo.d.ts +1 -1
- package/dist/src/logos/DocsLogo.js +28 -21
- package/dist/src/logos/ExpoGoLogo.d.ts +1 -1
- package/dist/src/logos/ExpoGoLogo.js +26 -19
- package/dist/src/logos/Logo.d.ts +1 -1
- package/dist/src/logos/Logo.js +26 -19
- package/dist/src/logos/OrbitLogo.d.ts +1 -1
- package/dist/src/logos/OrbitLogo.js +28 -21
- package/dist/src/logos/RouterLogo.d.ts +1 -1
- package/dist/src/logos/RouterLogo.js +28 -21
- package/dist/src/logos/SnackLogo.d.ts +1 -1
- package/dist/src/logos/SnackLogo.js +28 -21
- package/dist/src/logos/WordMarkLogo.d.ts +1 -1
- package/dist/src/logos/WordMarkLogo.js +26 -19
- package/dist/src/styles/typography.d.ts +17 -17
- package/package.json +56 -34
- package/tailwind.js +22 -11
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## 15.0.4
|
|
2
|
+
|
|
3
|
+
- Source moved from expo/styleguide to Expo's internal monorepo. No API changes.
|
|
4
|
+
- Disabled `Button` now ignores pointer events. Its `pointer-events-none` class had a typo.
|
|
5
|
+
|
|
6
|
+
## 15.0.3
|
|
7
|
+
|
|
8
|
+
Earlier history: https://github.com/expo/styleguide/commits/main/packages/styleguide
|
package/README.md
CHANGED
|
@@ -10,21 +10,22 @@ Expo's styleguide and components for use on the web.
|
|
|
10
10
|
```
|
|
11
11
|
2. Import global CSS files from the package in your JS(X)/TS(X) code:
|
|
12
12
|
```jsx
|
|
13
|
-
import
|
|
13
|
+
import '@expo/styleguide/dist/expo-theme.css';
|
|
14
14
|
```
|
|
15
15
|
or import it the main stylesheet file:
|
|
16
16
|
```css
|
|
17
|
-
@import
|
|
17
|
+
@import '@expo/styleguide/dist/expo-theme.css';
|
|
18
18
|
```
|
|
19
19
|
3. Add `'./node_modules/@expo/styleguide/dist/**/*.{js,ts,jsx,tsx}'` to the Tailwind `content` paths.
|
|
20
20
|
|
|
21
21
|
### Tailwind theme
|
|
22
22
|
|
|
23
23
|
For the Styleguide we use our custom Tailwind theme, which is based on the default TW theme, with the following differences:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
|
|
25
|
+
- only valid media screen scopes are: `xs:`, `sm:`, `md:`, `lg:` and `xl:`
|
|
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 component classes defined for icons sizing
|
|
28
29
|
|
|
29
30
|
The theme can be extended, if needed, and includes `@tailwindcss/typography` plugin by default, with a stripped down version of default config.
|
|
30
31
|
|
|
@@ -32,14 +33,9 @@ The theme can be extended, if needed, and includes `@tailwindcss/typography` plu
|
|
|
32
33
|
|
|
33
34
|
### Get started
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
2. Build everything with `yarn build`.
|
|
37
|
-
3. Develop with `yarn dev`.
|
|
36
|
+
See [`../README.md`](../README.md) for local development. There is no build step.
|
|
38
37
|
|
|
39
38
|
### Changing Tailwind theme
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- Change a value in **packages/styleguide/tailwind.js**
|
|
44
|
-
- Run `yarn build` in **packages/styleguide**
|
|
45
|
-
- Navigate to **example-web** and restart the dev server
|
|
40
|
+
Edit **tailwind.js** and restart the dev server. The website, the blog and **example-web** load
|
|
41
|
+
it directly, so it needs no build.
|
package/dist/expo-theme.css
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
5
|
-
@import
|
|
6
|
-
@import
|
|
7
|
-
@import
|
|
8
|
-
@import
|
|
9
|
-
@import
|
|
10
|
-
@import
|
|
11
|
-
@import
|
|
12
|
-
@import
|
|
13
|
-
@import
|
|
14
|
-
@import
|
|
15
|
-
@import
|
|
16
|
-
@import
|
|
1
|
+
@import '@radix-ui/colors/green.css';
|
|
2
|
+
@import '@radix-ui/colors/green-dark.css';
|
|
3
|
+
@import '@radix-ui/colors/amber.css';
|
|
4
|
+
@import '@radix-ui/colors/amber-dark.css';
|
|
5
|
+
@import '@radix-ui/colors/red.css';
|
|
6
|
+
@import '@radix-ui/colors/red-dark.css';
|
|
7
|
+
@import '@radix-ui/colors/blue.css';
|
|
8
|
+
@import '@radix-ui/colors/blue-dark.css';
|
|
9
|
+
@import '@radix-ui/colors/orange.css';
|
|
10
|
+
@import '@radix-ui/colors/orange-dark.css';
|
|
11
|
+
@import '@radix-ui/colors/purple.css';
|
|
12
|
+
@import '@radix-ui/colors/purple-dark.css';
|
|
13
|
+
@import '@radix-ui/colors/pink.css';
|
|
14
|
+
@import '@radix-ui/colors/pink-dark.css';
|
|
15
|
+
@import '@radix-ui/colors/slate.css';
|
|
16
|
+
@import '@radix-ui/colors/slate-dark.css';
|
|
17
17
|
|
|
18
18
|
:root {
|
|
19
19
|
--expo-color-white: #fff;
|
|
@@ -86,7 +86,11 @@
|
|
|
86
86
|
--expo-theme-interactive-neutral-default-border: var(--expo-theme-border-default);
|
|
87
87
|
--expo-theme-interactive-neutral-default-text: var(--expo-theme-text-default);
|
|
88
88
|
--expo-theme-interactive-neutral-default-icon: var(--slate-11);
|
|
89
|
-
--expo-theme-interactive-neutral-hover-background: color-mix(
|
|
89
|
+
--expo-theme-interactive-neutral-hover-background: color-mix(
|
|
90
|
+
in srgb,
|
|
91
|
+
var(--slate-12) 6%,
|
|
92
|
+
transparent
|
|
93
|
+
);
|
|
90
94
|
--expo-theme-interactive-subtle-default-background: var(--slate-3);
|
|
91
95
|
--expo-theme-interactive-subtle-hover-background: var(--slate-5);
|
|
92
96
|
--expo-theme-interactive-accent-hover-background: var(--blue-3);
|
|
@@ -165,16 +169,11 @@
|
|
|
165
169
|
|
|
166
170
|
/* Light shadows */
|
|
167
171
|
--expo-theme-shadows-none: 0 0 transparent;
|
|
168
|
-
--expo-theme-shadows-xs: 0 1px 3px rgba(0, 0, 0, 0.025),
|
|
169
|
-
|
|
170
|
-
--expo-theme-shadows-
|
|
171
|
-
|
|
172
|
-
--expo-theme-shadows-md: 0 10px 20px rgba(0, 0, 0, 0.1),
|
|
173
|
-
0 3px 6px rgba(0, 0, 0, 0.05);
|
|
174
|
-
--expo-theme-shadows-lg: 0 15px 25px rgba(0, 0, 0, 0.12),
|
|
175
|
-
0 5px 10px rgba(0, 0, 0, 0.05);
|
|
172
|
+
--expo-theme-shadows-xs: 0 1px 3px rgba(0, 0, 0, 0.025), 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
173
|
+
--expo-theme-shadows-sm: 0 3px 6px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.07);
|
|
174
|
+
--expo-theme-shadows-md: 0 10px 20px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.05);
|
|
175
|
+
--expo-theme-shadows-lg: 0 15px 25px rgba(0, 0, 0, 0.12), 0 5px 10px rgba(0, 0, 0, 0.05);
|
|
176
176
|
--expo-theme-shadows-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
|
|
177
|
-
|
|
178
177
|
}
|
|
179
178
|
|
|
180
179
|
.dark-theme {
|
|
@@ -182,7 +181,7 @@
|
|
|
182
181
|
|
|
183
182
|
/* Backgrounds */
|
|
184
183
|
--expo-theme-background-default: var(--slate-1);
|
|
185
|
-
--expo-theme-background-screen: #
|
|
184
|
+
--expo-theme-background-screen: #0c0d0e;
|
|
186
185
|
--expo-theme-background-subtle: var(--slate-2);
|
|
187
186
|
--expo-theme-background-element: var(--slate-3);
|
|
188
187
|
--expo-theme-background-hover: var(--slate-4);
|
|
@@ -233,7 +232,11 @@
|
|
|
233
232
|
--expo-theme-interactive-neutral-default-border: var(--expo-theme-border-default);
|
|
234
233
|
--expo-theme-interactive-neutral-default-text: var(--expo-theme-text-default);
|
|
235
234
|
--expo-theme-interactive-neutral-default-icon: var(--slate-12);
|
|
236
|
-
--expo-theme-interactive-neutral-hover-background: color-mix(
|
|
235
|
+
--expo-theme-interactive-neutral-hover-background: color-mix(
|
|
236
|
+
in srgb,
|
|
237
|
+
var(--slate-12) 10%,
|
|
238
|
+
transparent
|
|
239
|
+
);
|
|
237
240
|
--expo-theme-interactive-subtle-default-background: var(--slate-3);
|
|
238
241
|
--expo-theme-interactive-subtle-hover-background: var(--slate-5);
|
|
239
242
|
--expo-theme-interactive-accent-hover-background: var(--blue-3);
|
|
@@ -274,7 +277,6 @@
|
|
|
274
277
|
--expo-theme-button-tertiary-disabled-border: var(--expo-theme-interactive-disabled-border);
|
|
275
278
|
--expo-theme-button-tertiary-disabled-text: var(--expo-theme-interactive-disabled-text);
|
|
276
279
|
|
|
277
|
-
|
|
278
280
|
--expo-theme-button-quaternary-background: transparent;
|
|
279
281
|
--expo-theme-button-quaternary-border: transparent;
|
|
280
282
|
--expo-theme-button-quaternary-hover: var(--expo-theme-interactive-neutral-hover-background);
|
|
@@ -284,7 +286,9 @@
|
|
|
284
286
|
--expo-theme-button-quaternary-disabled-border: transparent;
|
|
285
287
|
--expo-theme-button-quaternary-disabled-text: var(--expo-theme-interactive-disabled-text);
|
|
286
288
|
|
|
287
|
-
--expo-theme-button-primary-destructive-background: hsl(
|
|
289
|
+
--expo-theme-button-primary-destructive-background: hsl(
|
|
290
|
+
from var(--red-8) h calc(s + 15) calc(l - 10)
|
|
291
|
+
);
|
|
288
292
|
--expo-theme-button-primary-destructive-border: transparent;
|
|
289
293
|
--expo-theme-button-primary-destructive-hover: hsl(from var(--red-7) h calc(s + 15) calc(l - 10));
|
|
290
294
|
--expo-theme-button-primary-destructive-icon: var(--red-12);
|
|
@@ -313,14 +317,10 @@
|
|
|
313
317
|
|
|
314
318
|
/* Dark shadows */
|
|
315
319
|
--expo-theme-shadows-none: 0 0 transparent;
|
|
316
|
-
--expo-theme-shadows-xs: 0 1px 3px rgba(0, 0, 0, 0.3),
|
|
317
|
-
|
|
318
|
-
--expo-theme-shadows-
|
|
319
|
-
|
|
320
|
-
--expo-theme-shadows-md: 0 10px 20px rgba(0, 0, 0, 0.25),
|
|
321
|
-
0 3px 6px rgba(0, 0, 0, 0.25);
|
|
322
|
-
--expo-theme-shadows-lg: 0 15px 25px rgba(0, 0, 0, 0.5),
|
|
323
|
-
0 5px 10px rgba(0, 0, 0, 0.25);
|
|
320
|
+
--expo-theme-shadows-xs: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.3);
|
|
321
|
+
--expo-theme-shadows-sm: 0 3px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.25);
|
|
322
|
+
--expo-theme-shadows-md: 0 10px 20px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.25);
|
|
323
|
+
--expo-theme-shadows-lg: 0 15px 25px rgba(0, 0, 0, 0.5), 0 5px 10px rgba(0, 0, 0, 0.25);
|
|
324
324
|
--expo-theme-shadows-xl: 0 20px 40px rgba(0, 0, 0, 0.5);
|
|
325
325
|
}
|
|
326
326
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import { ButtonBaseProps } from './ButtonBase';
|
|
3
2
|
import { LinkBaseProps } from '../Link';
|
|
3
|
+
import { ButtonBaseProps } from './ButtonBase';
|
|
4
4
|
export type ButtonSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
5
|
export type ButtonTheme = 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'primary-destructive' | 'secondary-destructive' | 'tertiary-destructive';
|
|
6
6
|
export type ButtonProps = ButtonBaseProps & LinkBaseProps & {
|
|
@@ -31,4 +31,4 @@ export declare const Button: import("react").ForwardRefExoticComponent<import("r
|
|
|
31
31
|
* This prop is a no-op and will be removed in a future release.
|
|
32
32
|
*/
|
|
33
33
|
skipCapitalization?: boolean;
|
|
34
|
-
} & import("react").RefAttributes<
|
|
34
|
+
} & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var compilerRuntime = require('react/compiler-runtime');
|
|
5
4
|
var react = require('react');
|
|
6
5
|
var ButtonBase = require('./ButtonBase.js');
|
|
7
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -29,19 +28,19 @@ function getSizeClasses(size) {
|
|
|
29
28
|
function getThemeClasses(theme, disabled = false) {
|
|
30
29
|
switch (theme) {
|
|
31
30
|
case 'primary':
|
|
32
|
-
return mergeClasses.mergeClasses('border-button-primary bg-button-primary text-button-primary', !disabled && 'hocus:bg-button-primary-hover
|
|
31
|
+
return mergeClasses.mergeClasses('border-button-primary bg-button-primary text-button-primary', !disabled && 'active:scale-98 hocus:bg-button-primary-hover', disabled && 'border-button-primary-disabled bg-button-primary-disabled text-button-primary-disabled');
|
|
33
32
|
case 'primary-destructive':
|
|
34
|
-
return mergeClasses.mergeClasses('border-button-primary-destructive bg-button-primary-destructive text-button-primary-destructive', !disabled && 'hocus:bg-button-primary-destructive-hover
|
|
33
|
+
return mergeClasses.mergeClasses('border-button-primary-destructive bg-button-primary-destructive text-button-primary-destructive', !disabled && 'active:scale-98 hocus:bg-button-primary-destructive-hover', disabled && 'border-button-primary-destructive-disabled bg-button-primary-destructive-disabled text-button-primary-destructive-disabled');
|
|
35
34
|
case 'secondary':
|
|
36
|
-
return mergeClasses.mergeClasses('border-button-secondary bg-button-secondary text-button-secondary', !disabled && 'hocus:bg-button-secondary-hover
|
|
35
|
+
return mergeClasses.mergeClasses('border-button-secondary bg-button-secondary text-button-secondary', !disabled && 'active:scale-98 hocus:bg-button-secondary-hover', disabled && 'border-button-secondary-disabled bg-button-secondary-disabled text-button-secondary-disabled');
|
|
37
36
|
case 'secondary-destructive':
|
|
38
|
-
return mergeClasses.mergeClasses('border-button-secondary-destructive bg-button-secondary-destructive text-button-secondary-destructive', !disabled && 'hocus:bg-button-secondary-destructive-hover
|
|
37
|
+
return mergeClasses.mergeClasses('border-button-secondary-destructive bg-button-secondary-destructive text-button-secondary-destructive', !disabled && 'active:scale-98 hocus:bg-button-secondary-destructive-hover', disabled && 'border-button-secondary-destructive-disabled bg-button-secondary-destructive-disabled text-button-secondary-destructive-disabled');
|
|
39
38
|
case 'tertiary':
|
|
40
|
-
return mergeClasses.mergeClasses('border-button-tertiary bg-button-tertiary text-button-tertiary shadow-none', !disabled && 'hocus:bg-button-tertiary-hover
|
|
39
|
+
return mergeClasses.mergeClasses('border-button-tertiary bg-button-tertiary text-button-tertiary shadow-none', !disabled && 'active:scale-98 hocus:bg-button-tertiary-hover', disabled && 'border-button-tertiary-disabled bg-button-tertiary-disabled text-button-tertiary-disabled');
|
|
41
40
|
case 'tertiary-destructive':
|
|
42
|
-
return mergeClasses.mergeClasses('border-button-tertiary-destructive bg-button-tertiary-destructive text-button-tertiary-destructive shadow-none', !disabled && 'hocus:bg-button-tertiary-destructive-hover
|
|
41
|
+
return mergeClasses.mergeClasses('border-button-tertiary-destructive bg-button-tertiary-destructive text-button-tertiary-destructive shadow-none', !disabled && 'active:scale-98 hocus:bg-button-tertiary-destructive-hover', disabled && 'border-button-tertiary-destructive-disabled bg-button-tertiary-destructive-disabled text-button-tertiary-destructive-disabled');
|
|
43
42
|
case 'quaternary':
|
|
44
|
-
return mergeClasses.mergeClasses('border-button-quaternary bg-button-quaternary text-button-quaternary shadow-none', !disabled && 'hocus:bg-button-quaternary-hover
|
|
43
|
+
return mergeClasses.mergeClasses('border-button-quaternary bg-button-quaternary text-button-quaternary shadow-none', !disabled && 'active:scale-98 hocus:bg-button-quaternary-hover', disabled && 'border-button-quaternary-disabled bg-button-quaternary-disabled text-button-quaternary-disabled');
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
function getIconSizeClasses(size) {
|
|
@@ -100,7 +99,7 @@ function getButtonIconClasses(size) {
|
|
|
100
99
|
}
|
|
101
100
|
function isIconElement(element) {
|
|
102
101
|
if (/*#__PURE__*/react.isValidElement(element)) {
|
|
103
|
-
// @ts-
|
|
102
|
+
// @ts-expect-error React Portal did not have `displayName` prop, but it is a valid element
|
|
104
103
|
return element.type?.displayName?.endsWith('Icon') ?? false;
|
|
105
104
|
}
|
|
106
105
|
return false;
|
|
@@ -114,179 +113,48 @@ function getIconProps(element, classNames) {
|
|
|
114
113
|
className: mergeClasses.mergeClasses(classNames, element.props.className)
|
|
115
114
|
};
|
|
116
115
|
}
|
|
117
|
-
const Button = /*#__PURE__*/react.forwardRef((
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
className:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
...t12
|
|
142
|
-
} = t0;
|
|
143
|
-
children = t3;
|
|
144
|
-
t1 = t4;
|
|
145
|
-
t2 = t5;
|
|
146
|
-
href = t6;
|
|
147
|
-
disabled = t7;
|
|
148
|
-
className = t8;
|
|
149
|
-
leftSlot = t9;
|
|
150
|
-
rightSlot = t10;
|
|
151
|
-
openInNewTab = t11;
|
|
152
|
-
rest = t12;
|
|
153
|
-
$[0] = t0;
|
|
154
|
-
$[1] = children;
|
|
155
|
-
$[2] = className;
|
|
156
|
-
$[3] = disabled;
|
|
157
|
-
$[4] = href;
|
|
158
|
-
$[5] = leftSlot;
|
|
159
|
-
$[6] = openInNewTab;
|
|
160
|
-
$[7] = rest;
|
|
161
|
-
$[8] = rightSlot;
|
|
162
|
-
$[9] = t1;
|
|
163
|
-
$[10] = t2;
|
|
164
|
-
} else {
|
|
165
|
-
children = $[1];
|
|
166
|
-
className = $[2];
|
|
167
|
-
disabled = $[3];
|
|
168
|
-
href = $[4];
|
|
169
|
-
leftSlot = $[5];
|
|
170
|
-
openInNewTab = $[6];
|
|
171
|
-
rest = $[7];
|
|
172
|
-
rightSlot = $[8];
|
|
173
|
-
t1 = $[9];
|
|
174
|
-
t2 = $[10];
|
|
175
|
-
}
|
|
176
|
-
const size = t1 === undefined ? "sm" : t1;
|
|
177
|
-
const theme = t2 === undefined ? "primary" : t2;
|
|
178
|
-
let t3;
|
|
179
|
-
let t4;
|
|
180
|
-
let t5;
|
|
181
|
-
let twClasses;
|
|
182
|
-
if ($[11] !== children || $[12] !== className || $[13] !== disabled || $[14] !== href || $[15] !== leftSlot || $[16] !== rightSlot || $[17] !== size || $[18] !== theme) {
|
|
183
|
-
const isLeftSlotIcon = leftSlot && isIconElement(leftSlot);
|
|
184
|
-
const isRightSlotIcon = rightSlot && isIconElement(rightSlot);
|
|
185
|
-
const iconClasses = (isLeftSlotIcon || isRightSlotIcon) && mergeClasses.mergeClasses(getIconSizeClasses(size), getThemedIconClasses(theme), disabled && "opacity-60");
|
|
186
|
-
const isSingleIconButton = (leftSlot || rightSlot) && !children;
|
|
187
|
-
let t6;
|
|
188
|
-
if ($[23] !== className || $[24] !== disabled || $[25] !== isSingleIconButton || $[26] !== size || $[27] !== theme) {
|
|
189
|
-
t6 = mergeClasses.mergeClasses("inline-flex border border-solid rounded-full font-medium items-center whitespace-nowrap transition gap-2", size === "xs" && "gap-1.5", size === "2xs" && "gap-1", getSizeClasses(size), getThemeClasses(theme, disabled), isSingleIconButton && getButtonIconClasses(size), disabled && "cursor-default opacity-80 pointer-event-none", className);
|
|
190
|
-
$[23] = className;
|
|
191
|
-
$[24] = disabled;
|
|
192
|
-
$[25] = isSingleIconButton;
|
|
193
|
-
$[26] = size;
|
|
194
|
-
$[27] = theme;
|
|
195
|
-
$[28] = t6;
|
|
196
|
-
} else {
|
|
197
|
-
t6 = $[28];
|
|
198
|
-
}
|
|
199
|
-
twClasses = t6;
|
|
200
|
-
t3 = isLeftSlotIcon ? /*#__PURE__*/react.cloneElement(leftSlot, getIconProps(leftSlot, iconClasses)) : leftSlot;
|
|
201
|
-
if ($[29] !== children || $[30] !== href) {
|
|
202
|
-
t4 = children && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
203
|
-
className: mergeClasses.mergeClasses("flex self-center text-inherit leading-none", href && "select-none"),
|
|
204
|
-
children: children
|
|
205
|
-
});
|
|
206
|
-
$[29] = children;
|
|
207
|
-
$[30] = href;
|
|
208
|
-
$[31] = t4;
|
|
209
|
-
} else {
|
|
210
|
-
t4 = $[31];
|
|
211
|
-
}
|
|
212
|
-
t5 = isRightSlotIcon ? /*#__PURE__*/react.cloneElement(rightSlot, getIconProps(rightSlot, iconClasses)) : rightSlot;
|
|
213
|
-
$[11] = children;
|
|
214
|
-
$[12] = className;
|
|
215
|
-
$[13] = disabled;
|
|
216
|
-
$[14] = href;
|
|
217
|
-
$[15] = leftSlot;
|
|
218
|
-
$[16] = rightSlot;
|
|
219
|
-
$[17] = size;
|
|
220
|
-
$[18] = theme;
|
|
221
|
-
$[19] = t3;
|
|
222
|
-
$[20] = t4;
|
|
223
|
-
$[21] = t5;
|
|
224
|
-
$[22] = twClasses;
|
|
225
|
-
} else {
|
|
226
|
-
t3 = $[19];
|
|
227
|
-
t4 = $[20];
|
|
228
|
-
t5 = $[21];
|
|
229
|
-
twClasses = $[22];
|
|
230
|
-
}
|
|
231
|
-
let t6;
|
|
232
|
-
if ($[32] !== t3 || $[33] !== t4 || $[34] !== t5) {
|
|
233
|
-
t6 = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
234
|
-
children: [t3, t4, t5]
|
|
235
|
-
});
|
|
236
|
-
$[32] = t3;
|
|
237
|
-
$[33] = t4;
|
|
238
|
-
$[34] = t5;
|
|
239
|
-
$[35] = t6;
|
|
240
|
-
} else {
|
|
241
|
-
t6 = $[35];
|
|
242
|
-
}
|
|
243
|
-
const content = t6;
|
|
116
|
+
const Button = /*#__PURE__*/react.forwardRef(function ({
|
|
117
|
+
children,
|
|
118
|
+
size = 'sm',
|
|
119
|
+
theme = 'primary',
|
|
120
|
+
skipCapitalization: _skipCapitalization,
|
|
121
|
+
href,
|
|
122
|
+
disabled,
|
|
123
|
+
className,
|
|
124
|
+
leftSlot,
|
|
125
|
+
rightSlot,
|
|
126
|
+
openInNewTab,
|
|
127
|
+
...rest
|
|
128
|
+
}, ref) {
|
|
129
|
+
const isLeftSlotIcon = leftSlot && isIconElement(leftSlot);
|
|
130
|
+
const isRightSlotIcon = rightSlot && isIconElement(rightSlot);
|
|
131
|
+
const iconClasses = (isLeftSlotIcon || isRightSlotIcon) && mergeClasses.mergeClasses(getIconSizeClasses(size), getThemedIconClasses(theme), disabled && 'opacity-60');
|
|
132
|
+
const isSingleIconButton = (leftSlot || rightSlot) && !children;
|
|
133
|
+
const twClasses = mergeClasses.mergeClasses(`inline-flex items-center gap-2 rounded-full border border-solid font-medium whitespace-nowrap transition`, size === 'xs' && 'gap-1.5', size === '2xs' && 'gap-1', getSizeClasses(size), getThemeClasses(theme, disabled), isSingleIconButton && getButtonIconClasses(size), disabled && 'pointer-events-none cursor-default opacity-80', className);
|
|
134
|
+
const content = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
135
|
+
children: [isLeftSlotIcon ? /*#__PURE__*/react.cloneElement(leftSlot, getIconProps(leftSlot, iconClasses)) : leftSlot, children && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
136
|
+
className: mergeClasses.mergeClasses('flex self-center leading-none text-inherit', href && 'select-none'),
|
|
137
|
+
children: children
|
|
138
|
+
}), isRightSlotIcon ? /*#__PURE__*/react.cloneElement(rightSlot, getIconProps(rightSlot, iconClasses)) : rightSlot]
|
|
139
|
+
});
|
|
244
140
|
if (href) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
...rest,
|
|
255
|
-
children: content
|
|
256
|
-
});
|
|
257
|
-
$[36] = content;
|
|
258
|
-
$[37] = disabled;
|
|
259
|
-
$[38] = href;
|
|
260
|
-
$[39] = openInNewTab;
|
|
261
|
-
$[40] = rest;
|
|
262
|
-
$[41] = t7;
|
|
263
|
-
$[42] = twClasses;
|
|
264
|
-
$[43] = t8;
|
|
265
|
-
} else {
|
|
266
|
-
t8 = $[43];
|
|
267
|
-
}
|
|
268
|
-
return t8;
|
|
141
|
+
return /*#__PURE__*/jsxRuntime.jsx(LinkBase.LinkBase, {
|
|
142
|
+
href: href,
|
|
143
|
+
className: twClasses,
|
|
144
|
+
disabled: disabled,
|
|
145
|
+
ref: ref,
|
|
146
|
+
openInNewTab: openInNewTab,
|
|
147
|
+
...rest,
|
|
148
|
+
children: content
|
|
149
|
+
});
|
|
269
150
|
} else {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
...rest,
|
|
278
|
-
children: content
|
|
279
|
-
});
|
|
280
|
-
$[44] = content;
|
|
281
|
-
$[45] = disabled;
|
|
282
|
-
$[46] = rest;
|
|
283
|
-
$[47] = t7;
|
|
284
|
-
$[48] = twClasses;
|
|
285
|
-
$[49] = t8;
|
|
286
|
-
} else {
|
|
287
|
-
t8 = $[49];
|
|
288
|
-
}
|
|
289
|
-
return t8;
|
|
151
|
+
return /*#__PURE__*/jsxRuntime.jsx(ButtonBase.ButtonBase, {
|
|
152
|
+
className: twClasses,
|
|
153
|
+
disabled: disabled,
|
|
154
|
+
ref: ref,
|
|
155
|
+
...rest,
|
|
156
|
+
children: content
|
|
157
|
+
});
|
|
290
158
|
}
|
|
291
159
|
});
|
|
292
160
|
Button.displayName = 'Button';
|
|
@@ -1,83 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var compilerRuntime = require('react/compiler-runtime');
|
|
5
4
|
var react = require('react');
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
6
|
var mergeClasses = require('@expo/styleguide-base/mergeClasses');
|
|
8
7
|
|
|
9
|
-
const ButtonBase = /*#__PURE__*/react.forwardRef((
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
$[0] = t0;
|
|
29
|
-
$[1] = children;
|
|
30
|
-
$[2] = className;
|
|
31
|
-
$[3] = onClick;
|
|
32
|
-
$[4] = rest;
|
|
33
|
-
$[5] = t1;
|
|
34
|
-
$[6] = t2;
|
|
35
|
-
$[7] = testID;
|
|
36
|
-
} else {
|
|
37
|
-
children = $[1];
|
|
38
|
-
className = $[2];
|
|
39
|
-
onClick = $[3];
|
|
40
|
-
rest = $[4];
|
|
41
|
-
t1 = $[5];
|
|
42
|
-
t2 = $[6];
|
|
43
|
-
testID = $[7];
|
|
44
|
-
}
|
|
45
|
-
const type = t1 === undefined ? "button" : t1;
|
|
46
|
-
const disabled = t2 === undefined ? false : t2;
|
|
47
|
-
let t3;
|
|
48
|
-
if ($[8] !== className) {
|
|
49
|
-
t3 = mergeClasses.mergeClasses("flex cursor-pointer", className);
|
|
50
|
-
$[8] = className;
|
|
51
|
-
$[9] = t3;
|
|
52
|
-
} else {
|
|
53
|
-
t3 = $[9];
|
|
54
|
-
}
|
|
55
|
-
const t4 = disabled ? undefined : onClick;
|
|
56
|
-
let t5;
|
|
57
|
-
if ($[10] !== children || $[11] !== disabled || $[12] !== ref || $[13] !== rest || $[14] !== t3 || $[15] !== t4 || $[16] !== testID || $[17] !== type) {
|
|
58
|
-
t5 = /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
59
|
-
className: t3,
|
|
60
|
-
"data-testid": testID,
|
|
61
|
-
disabled: disabled,
|
|
62
|
-
ref: ref,
|
|
63
|
-
type: type,
|
|
64
|
-
onClick: t4,
|
|
65
|
-
...rest,
|
|
66
|
-
children: children
|
|
67
|
-
});
|
|
68
|
-
$[10] = children;
|
|
69
|
-
$[11] = disabled;
|
|
70
|
-
$[12] = ref;
|
|
71
|
-
$[13] = rest;
|
|
72
|
-
$[14] = t3;
|
|
73
|
-
$[15] = t4;
|
|
74
|
-
$[16] = testID;
|
|
75
|
-
$[17] = type;
|
|
76
|
-
$[18] = t5;
|
|
77
|
-
} else {
|
|
78
|
-
t5 = $[18];
|
|
79
|
-
}
|
|
80
|
-
return t5;
|
|
8
|
+
const ButtonBase = /*#__PURE__*/react.forwardRef(function ({
|
|
9
|
+
children,
|
|
10
|
+
testID,
|
|
11
|
+
className,
|
|
12
|
+
onClick,
|
|
13
|
+
type = 'button',
|
|
14
|
+
disabled = false,
|
|
15
|
+
...rest
|
|
16
|
+
}, ref) {
|
|
17
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
18
|
+
className: mergeClasses.mergeClasses('flex cursor-pointer', className),
|
|
19
|
+
"data-testid": testID,
|
|
20
|
+
disabled: disabled,
|
|
21
|
+
ref: ref,
|
|
22
|
+
type: type,
|
|
23
|
+
onClick: disabled ? undefined : onClick,
|
|
24
|
+
...rest,
|
|
25
|
+
children: children
|
|
26
|
+
});
|
|
81
27
|
});
|
|
82
28
|
ButtonBase.displayName = 'ButtonBase';
|
|
83
29
|
|
|
@@ -7,49 +7,55 @@ var LinkBase = require('./LinkBase.js');
|
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var mergeClasses = require('@expo/styleguide-base/mergeClasses');
|
|
9
9
|
|
|
10
|
-
const Link = /*#__PURE__*/react.forwardRef((t0, ref)
|
|
11
|
-
const $ = compilerRuntime.c(
|
|
10
|
+
const Link = /*#__PURE__*/react.forwardRef(function (t0, ref) {
|
|
11
|
+
const $ = compilerRuntime.c(12);
|
|
12
|
+
if ($[0] !== "a3da98c14b71ee8a3d9305596baf7f1134847009820f8e55193feb89ff05b801") {
|
|
13
|
+
for (let $i = 0; $i < 12; $i += 1) {
|
|
14
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
15
|
+
}
|
|
16
|
+
$[0] = "a3da98c14b71ee8a3d9305596baf7f1134847009820f8e55193feb89ff05b801";
|
|
17
|
+
}
|
|
12
18
|
let className;
|
|
13
19
|
let disabled;
|
|
14
20
|
let rest;
|
|
15
|
-
if ($[
|
|
21
|
+
if ($[1] !== t0) {
|
|
16
22
|
({
|
|
17
23
|
className,
|
|
18
24
|
disabled,
|
|
19
25
|
...rest
|
|
20
26
|
} = t0);
|
|
21
|
-
$[
|
|
22
|
-
$[
|
|
23
|
-
$[
|
|
24
|
-
$[
|
|
27
|
+
$[1] = t0;
|
|
28
|
+
$[2] = className;
|
|
29
|
+
$[3] = disabled;
|
|
30
|
+
$[4] = rest;
|
|
25
31
|
} else {
|
|
26
|
-
className = $[
|
|
27
|
-
disabled = $[
|
|
28
|
-
rest = $[
|
|
32
|
+
className = $[2];
|
|
33
|
+
disabled = $[3];
|
|
34
|
+
rest = $[4];
|
|
29
35
|
}
|
|
30
36
|
const t1 = !disabled && "hocus:opacity-80";
|
|
31
37
|
let t2;
|
|
32
|
-
if ($[
|
|
38
|
+
if ($[5] !== className || $[6] !== t1) {
|
|
33
39
|
t2 = mergeClasses.mergeClasses("text-link transition-opacity", t1, className);
|
|
34
|
-
$[
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
40
|
+
$[5] = className;
|
|
41
|
+
$[6] = t1;
|
|
42
|
+
$[7] = t2;
|
|
37
43
|
} else {
|
|
38
|
-
t2 = $[
|
|
44
|
+
t2 = $[7];
|
|
39
45
|
}
|
|
40
46
|
let t3;
|
|
41
|
-
if ($[
|
|
47
|
+
if ($[8] !== ref || $[9] !== rest || $[10] !== t2) {
|
|
42
48
|
t3 = /*#__PURE__*/jsxRuntime.jsx(LinkBase.LinkBase, {
|
|
43
49
|
className: t2,
|
|
44
50
|
ref: ref,
|
|
45
51
|
...rest
|
|
46
52
|
});
|
|
47
|
-
$[
|
|
48
|
-
$[
|
|
49
|
-
$[
|
|
50
|
-
$[
|
|
53
|
+
$[8] = ref;
|
|
54
|
+
$[9] = rest;
|
|
55
|
+
$[10] = t2;
|
|
56
|
+
$[11] = t3;
|
|
51
57
|
} else {
|
|
52
|
-
t3 = $[
|
|
58
|
+
t3 = $[11];
|
|
53
59
|
}
|
|
54
60
|
return t3;
|
|
55
61
|
});
|