@expo/styleguide 15.0.3 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -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 +101 -95
- package/dist/src/components/Button/ButtonBase.js +39 -33
- 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 +58 -45
- package/dist/src/logos/DocsLogo.d.ts +1 -1
- package/dist/src/logos/DocsLogo.js +27 -21
- package/dist/src/logos/ExpoGoLogo.d.ts +1 -1
- package/dist/src/logos/ExpoGoLogo.js +25 -19
- package/dist/src/logos/Logo.d.ts +1 -1
- package/dist/src/logos/Logo.js +25 -19
- package/dist/src/logos/OrbitLogo.d.ts +1 -1
- package/dist/src/logos/OrbitLogo.js +27 -21
- package/dist/src/logos/RouterLogo.d.ts +1 -1
- package/dist/src/logos/RouterLogo.js +27 -21
- package/dist/src/logos/SnackLogo.d.ts +1 -1
- package/dist/src/logos/SnackLogo.js +27 -21
- package/dist/src/logos/WordMarkLogo.d.ts +1 -1
- package/dist/src/logos/WordMarkLogo.js +25 -19
- package/dist/src/styles/typography.d.ts +17 -17
- package/package.json +56 -34
- package/tailwind.js +49 -11
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## 15.1.0
|
|
2
|
+
|
|
3
|
+
- Added `label-xs`, `label-sm`, `label-base` and `label-lg` classes to the Tailwind preset, matching the Figma label text styles.
|
|
4
|
+
- `Button` uses `label-*` for its size classes. Labels look the same as before.
|
|
5
|
+
|
|
6
|
+
## 15.0.5
|
|
7
|
+
|
|
8
|
+
- Restored React Compiler memoization in `ThemeProvider`, `Button` and `ButtonBase`, and removed development-only compiler code from the build.
|
|
9
|
+
- `ThemeProvider` memoizes its context value, so `useTheme` consumers no longer re-render on every provider render in apps without React Compiler.
|
|
10
|
+
|
|
11
|
+
## 15.0.4
|
|
12
|
+
|
|
13
|
+
- Source moved from expo/styleguide to Expo's internal monorepo. No API changes.
|
|
14
|
+
- Disabled `Button` now ignores pointer events. Its `pointer-events-none` class had a typo.
|
|
15
|
+
|
|
16
|
+
## 15.0.3
|
|
17
|
+
|
|
18
|
+
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>>;
|
|
@@ -11,37 +11,37 @@ var mergeClasses = require('@expo/styleguide-base/mergeClasses');
|
|
|
11
11
|
function getSizeClasses(size) {
|
|
12
12
|
switch (size) {
|
|
13
13
|
case '2xs':
|
|
14
|
-
return 'h-7 px-2
|
|
14
|
+
return 'h-7 px-2 label-xs';
|
|
15
15
|
case 'xs':
|
|
16
|
-
return 'h-8 px-3
|
|
16
|
+
return 'h-8 px-3 label-xs';
|
|
17
17
|
case 'sm':
|
|
18
|
-
return 'h-9 px-4
|
|
18
|
+
return 'h-9 px-4 label-sm';
|
|
19
19
|
case 'md':
|
|
20
|
-
return 'h-10 px-4
|
|
20
|
+
return 'h-10 px-4 label-sm';
|
|
21
21
|
case 'lg':
|
|
22
|
-
return 'h-11 px-6
|
|
22
|
+
return 'h-11 px-6 label-base';
|
|
23
23
|
case 'xl':
|
|
24
|
-
return 'h-12 px-6
|
|
24
|
+
return 'h-12 px-6 label-base';
|
|
25
25
|
case '2xl':
|
|
26
|
-
return 'h-15 px-6
|
|
26
|
+
return 'h-15 px-6 label-lg';
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
function getThemeClasses(theme, disabled = false) {
|
|
30
30
|
switch (theme) {
|
|
31
31
|
case 'primary':
|
|
32
|
-
return mergeClasses.mergeClasses('border-button-primary bg-button-primary text-button-primary', !disabled && 'hocus:bg-button-primary-hover
|
|
32
|
+
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
33
|
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
|
|
34
|
+
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
35
|
case 'secondary':
|
|
36
|
-
return mergeClasses.mergeClasses('border-button-secondary bg-button-secondary text-button-secondary', !disabled && 'hocus:bg-button-secondary-hover
|
|
36
|
+
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
37
|
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
|
|
38
|
+
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
39
|
case 'tertiary':
|
|
40
|
-
return mergeClasses.mergeClasses('border-button-tertiary bg-button-tertiary text-button-tertiary shadow-none', !disabled && 'hocus:bg-button-tertiary-hover
|
|
40
|
+
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
41
|
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
|
|
42
|
+
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
43
|
case 'quaternary':
|
|
44
|
-
return mergeClasses.mergeClasses('border-button-quaternary bg-button-quaternary text-button-quaternary shadow-none', !disabled && 'hocus:bg-button-quaternary-hover
|
|
44
|
+
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
45
|
}
|
|
46
46
|
}
|
|
47
47
|
function getIconSizeClasses(size) {
|
|
@@ -100,7 +100,7 @@ function getButtonIconClasses(size) {
|
|
|
100
100
|
}
|
|
101
101
|
function isIconElement(element) {
|
|
102
102
|
if (/*#__PURE__*/react.isValidElement(element)) {
|
|
103
|
-
// @ts-
|
|
103
|
+
// @ts-expect-error React Portal did not have `displayName` prop, but it is a valid element
|
|
104
104
|
return element.type?.displayName?.endsWith('Icon') ?? false;
|
|
105
105
|
}
|
|
106
106
|
return false;
|
|
@@ -114,8 +114,14 @@ function getIconProps(element, classNames) {
|
|
|
114
114
|
className: mergeClasses.mergeClasses(classNames, element.props.className)
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
const Button = /*#__PURE__*/react.forwardRef((t0, ref)
|
|
118
|
-
const $ = compilerRuntime.c(
|
|
117
|
+
const Button = /*#__PURE__*/react.forwardRef(function (t0, ref) {
|
|
118
|
+
const $ = compilerRuntime.c(51);
|
|
119
|
+
if ($[0] !== "8e1537730a76d9b4a8988ca7e89b82623c62a2d07e22fbf220ae86470e2307df") {
|
|
120
|
+
for (let $i = 0; $i < 51; $i += 1) {
|
|
121
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
122
|
+
}
|
|
123
|
+
$[0] = "8e1537730a76d9b4a8988ca7e89b82623c62a2d07e22fbf220ae86470e2307df";
|
|
124
|
+
}
|
|
119
125
|
let children;
|
|
120
126
|
let className;
|
|
121
127
|
let disabled;
|
|
@@ -126,7 +132,7 @@ const Button = /*#__PURE__*/react.forwardRef((t0, ref) => {
|
|
|
126
132
|
let rightSlot;
|
|
127
133
|
let t1;
|
|
128
134
|
let t2;
|
|
129
|
-
if ($[
|
|
135
|
+
if ($[1] !== t0) {
|
|
130
136
|
const {
|
|
131
137
|
children: t3,
|
|
132
138
|
size: t4,
|
|
@@ -150,28 +156,28 @@ const Button = /*#__PURE__*/react.forwardRef((t0, ref) => {
|
|
|
150
156
|
rightSlot = t10;
|
|
151
157
|
openInNewTab = t11;
|
|
152
158
|
rest = t12;
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
159
|
+
$[1] = t0;
|
|
160
|
+
$[2] = children;
|
|
161
|
+
$[3] = className;
|
|
162
|
+
$[4] = disabled;
|
|
163
|
+
$[5] = href;
|
|
164
|
+
$[6] = leftSlot;
|
|
165
|
+
$[7] = openInNewTab;
|
|
166
|
+
$[8] = rest;
|
|
167
|
+
$[9] = rightSlot;
|
|
168
|
+
$[10] = t1;
|
|
169
|
+
$[11] = t2;
|
|
164
170
|
} else {
|
|
165
|
-
children = $[
|
|
166
|
-
className = $[
|
|
167
|
-
disabled = $[
|
|
168
|
-
href = $[
|
|
169
|
-
leftSlot = $[
|
|
170
|
-
openInNewTab = $[
|
|
171
|
-
rest = $[
|
|
172
|
-
rightSlot = $[
|
|
173
|
-
t1 = $[
|
|
174
|
-
t2 = $[
|
|
171
|
+
children = $[2];
|
|
172
|
+
className = $[3];
|
|
173
|
+
disabled = $[4];
|
|
174
|
+
href = $[5];
|
|
175
|
+
leftSlot = $[6];
|
|
176
|
+
openInNewTab = $[7];
|
|
177
|
+
rest = $[8];
|
|
178
|
+
rightSlot = $[9];
|
|
179
|
+
t1 = $[10];
|
|
180
|
+
t2 = $[11];
|
|
175
181
|
}
|
|
176
182
|
const size = t1 === undefined ? "sm" : t1;
|
|
177
183
|
const theme = t2 === undefined ? "primary" : t2;
|
|
@@ -179,72 +185,72 @@ const Button = /*#__PURE__*/react.forwardRef((t0, ref) => {
|
|
|
179
185
|
let t4;
|
|
180
186
|
let t5;
|
|
181
187
|
let twClasses;
|
|
182
|
-
if ($[
|
|
188
|
+
if ($[12] !== children || $[13] !== className || $[14] !== disabled || $[15] !== href || $[16] !== leftSlot || $[17] !== rightSlot || $[18] !== size || $[19] !== theme) {
|
|
183
189
|
const isLeftSlotIcon = leftSlot && isIconElement(leftSlot);
|
|
184
190
|
const isRightSlotIcon = rightSlot && isIconElement(rightSlot);
|
|
185
191
|
const iconClasses = (isLeftSlotIcon || isRightSlotIcon) && mergeClasses.mergeClasses(getIconSizeClasses(size), getThemedIconClasses(theme), disabled && "opacity-60");
|
|
186
192
|
const isSingleIconButton = (leftSlot || rightSlot) && !children;
|
|
187
193
|
let t6;
|
|
188
|
-
if ($[
|
|
189
|
-
t6 = mergeClasses.mergeClasses("inline-flex
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
194
|
+
if ($[24] !== className || $[25] !== disabled || $[26] !== isSingleIconButton || $[27] !== size || $[28] !== theme) {
|
|
195
|
+
t6 = mergeClasses.mergeClasses("inline-flex items-center gap-2 rounded-full border border-solid whitespace-nowrap transition", size === "xs" && "gap-1.5", size === "2xs" && "gap-1", getSizeClasses(size), "font-medium", getThemeClasses(theme, disabled), isSingleIconButton && getButtonIconClasses(size), disabled && "pointer-events-none cursor-default opacity-80", className);
|
|
196
|
+
$[24] = className;
|
|
197
|
+
$[25] = disabled;
|
|
198
|
+
$[26] = isSingleIconButton;
|
|
199
|
+
$[27] = size;
|
|
200
|
+
$[28] = theme;
|
|
201
|
+
$[29] = t6;
|
|
196
202
|
} else {
|
|
197
|
-
t6 = $[
|
|
203
|
+
t6 = $[29];
|
|
198
204
|
}
|
|
199
205
|
twClasses = t6;
|
|
200
206
|
t3 = isLeftSlotIcon ? /*#__PURE__*/react.cloneElement(leftSlot, getIconProps(leftSlot, iconClasses)) : leftSlot;
|
|
201
|
-
if ($[
|
|
207
|
+
if ($[30] !== children || $[31] !== href) {
|
|
202
208
|
t4 = children && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
203
|
-
className: mergeClasses.mergeClasses("flex self-center text-inherit
|
|
209
|
+
className: mergeClasses.mergeClasses("flex self-center leading-none text-inherit", href && "select-none"),
|
|
204
210
|
children: children
|
|
205
211
|
});
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
212
|
+
$[30] = children;
|
|
213
|
+
$[31] = href;
|
|
214
|
+
$[32] = t4;
|
|
209
215
|
} else {
|
|
210
|
-
t4 = $[
|
|
216
|
+
t4 = $[32];
|
|
211
217
|
}
|
|
212
218
|
t5 = isRightSlotIcon ? /*#__PURE__*/react.cloneElement(rightSlot, getIconProps(rightSlot, iconClasses)) : rightSlot;
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
219
|
+
$[12] = children;
|
|
220
|
+
$[13] = className;
|
|
221
|
+
$[14] = disabled;
|
|
222
|
+
$[15] = href;
|
|
223
|
+
$[16] = leftSlot;
|
|
224
|
+
$[17] = rightSlot;
|
|
225
|
+
$[18] = size;
|
|
226
|
+
$[19] = theme;
|
|
227
|
+
$[20] = t3;
|
|
228
|
+
$[21] = t4;
|
|
229
|
+
$[22] = t5;
|
|
230
|
+
$[23] = twClasses;
|
|
225
231
|
} else {
|
|
226
|
-
t3 = $[
|
|
227
|
-
t4 = $[
|
|
228
|
-
t5 = $[
|
|
229
|
-
twClasses = $[
|
|
232
|
+
t3 = $[20];
|
|
233
|
+
t4 = $[21];
|
|
234
|
+
t5 = $[22];
|
|
235
|
+
twClasses = $[23];
|
|
230
236
|
}
|
|
231
237
|
let t6;
|
|
232
|
-
if ($[
|
|
238
|
+
if ($[33] !== t3 || $[34] !== t4 || $[35] !== t5) {
|
|
233
239
|
t6 = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
234
240
|
children: [t3, t4, t5]
|
|
235
241
|
});
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
242
|
+
$[33] = t3;
|
|
243
|
+
$[34] = t4;
|
|
244
|
+
$[35] = t5;
|
|
245
|
+
$[36] = t6;
|
|
240
246
|
} else {
|
|
241
|
-
t6 = $[
|
|
247
|
+
t6 = $[36];
|
|
242
248
|
}
|
|
243
249
|
const content = t6;
|
|
244
250
|
if (href) {
|
|
245
251
|
const t7 = ref;
|
|
246
252
|
let t8;
|
|
247
|
-
if ($[
|
|
253
|
+
if ($[37] !== content || $[38] !== disabled || $[39] !== href || $[40] !== openInNewTab || $[41] !== rest || $[42] !== t7 || $[43] !== twClasses) {
|
|
248
254
|
t8 = /*#__PURE__*/jsxRuntime.jsx(LinkBase.LinkBase, {
|
|
249
255
|
href: href,
|
|
250
256
|
className: twClasses,
|
|
@@ -254,22 +260,22 @@ const Button = /*#__PURE__*/react.forwardRef((t0, ref) => {
|
|
|
254
260
|
...rest,
|
|
255
261
|
children: content
|
|
256
262
|
});
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
263
|
+
$[37] = content;
|
|
264
|
+
$[38] = disabled;
|
|
265
|
+
$[39] = href;
|
|
266
|
+
$[40] = openInNewTab;
|
|
267
|
+
$[41] = rest;
|
|
268
|
+
$[42] = t7;
|
|
269
|
+
$[43] = twClasses;
|
|
270
|
+
$[44] = t8;
|
|
265
271
|
} else {
|
|
266
|
-
t8 = $[
|
|
272
|
+
t8 = $[44];
|
|
267
273
|
}
|
|
268
274
|
return t8;
|
|
269
275
|
} else {
|
|
270
276
|
const t7 = ref;
|
|
271
277
|
let t8;
|
|
272
|
-
if ($[
|
|
278
|
+
if ($[45] !== content || $[46] !== disabled || $[47] !== rest || $[48] !== t7 || $[49] !== twClasses) {
|
|
273
279
|
t8 = /*#__PURE__*/jsxRuntime.jsx(ButtonBase.ButtonBase, {
|
|
274
280
|
className: twClasses,
|
|
275
281
|
disabled: disabled,
|
|
@@ -277,14 +283,14 @@ const Button = /*#__PURE__*/react.forwardRef((t0, ref) => {
|
|
|
277
283
|
...rest,
|
|
278
284
|
children: content
|
|
279
285
|
});
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
+
$[45] = content;
|
|
287
|
+
$[46] = disabled;
|
|
288
|
+
$[47] = rest;
|
|
289
|
+
$[48] = t7;
|
|
290
|
+
$[49] = twClasses;
|
|
291
|
+
$[50] = t8;
|
|
286
292
|
} else {
|
|
287
|
-
t8 = $[
|
|
293
|
+
t8 = $[50];
|
|
288
294
|
}
|
|
289
295
|
return t8;
|
|
290
296
|
}
|
|
@@ -6,8 +6,14 @@ var react = require('react');
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var mergeClasses = require('@expo/styleguide-base/mergeClasses');
|
|
8
8
|
|
|
9
|
-
const ButtonBase = /*#__PURE__*/react.forwardRef((t0, ref)
|
|
10
|
-
const $ = compilerRuntime.c(
|
|
9
|
+
const ButtonBase = /*#__PURE__*/react.forwardRef(function (t0, ref) {
|
|
10
|
+
const $ = compilerRuntime.c(20);
|
|
11
|
+
if ($[0] !== "ac4589bcc6a4b54bc3148c9349759bbd89c06a1d41f6cddd344080bfb27308ea") {
|
|
12
|
+
for (let $i = 0; $i < 20; $i += 1) {
|
|
13
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
14
|
+
}
|
|
15
|
+
$[0] = "ac4589bcc6a4b54bc3148c9349759bbd89c06a1d41f6cddd344080bfb27308ea";
|
|
16
|
+
}
|
|
11
17
|
let children;
|
|
12
18
|
let className;
|
|
13
19
|
let onClick;
|
|
@@ -15,7 +21,7 @@ const ButtonBase = /*#__PURE__*/react.forwardRef((t0, ref) => {
|
|
|
15
21
|
let t1;
|
|
16
22
|
let t2;
|
|
17
23
|
let testID;
|
|
18
|
-
if ($[
|
|
24
|
+
if ($[1] !== t0) {
|
|
19
25
|
({
|
|
20
26
|
children,
|
|
21
27
|
testID,
|
|
@@ -25,36 +31,36 @@ const ButtonBase = /*#__PURE__*/react.forwardRef((t0, ref) => {
|
|
|
25
31
|
disabled: t2,
|
|
26
32
|
...rest
|
|
27
33
|
} = t0);
|
|
28
|
-
$[
|
|
29
|
-
$[
|
|
30
|
-
$[
|
|
31
|
-
$[
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
35
|
-
$[
|
|
34
|
+
$[1] = t0;
|
|
35
|
+
$[2] = children;
|
|
36
|
+
$[3] = className;
|
|
37
|
+
$[4] = onClick;
|
|
38
|
+
$[5] = rest;
|
|
39
|
+
$[6] = t1;
|
|
40
|
+
$[7] = t2;
|
|
41
|
+
$[8] = testID;
|
|
36
42
|
} else {
|
|
37
|
-
children = $[
|
|
38
|
-
className = $[
|
|
39
|
-
onClick = $[
|
|
40
|
-
rest = $[
|
|
41
|
-
t1 = $[
|
|
42
|
-
t2 = $[
|
|
43
|
-
testID = $[
|
|
43
|
+
children = $[2];
|
|
44
|
+
className = $[3];
|
|
45
|
+
onClick = $[4];
|
|
46
|
+
rest = $[5];
|
|
47
|
+
t1 = $[6];
|
|
48
|
+
t2 = $[7];
|
|
49
|
+
testID = $[8];
|
|
44
50
|
}
|
|
45
51
|
const type = t1 === undefined ? "button" : t1;
|
|
46
52
|
const disabled = t2 === undefined ? false : t2;
|
|
47
53
|
let t3;
|
|
48
|
-
if ($[
|
|
54
|
+
if ($[9] !== className) {
|
|
49
55
|
t3 = mergeClasses.mergeClasses("flex cursor-pointer", className);
|
|
50
|
-
$[
|
|
51
|
-
$[
|
|
56
|
+
$[9] = className;
|
|
57
|
+
$[10] = t3;
|
|
52
58
|
} else {
|
|
53
|
-
t3 = $[
|
|
59
|
+
t3 = $[10];
|
|
54
60
|
}
|
|
55
61
|
const t4 = disabled ? undefined : onClick;
|
|
56
62
|
let t5;
|
|
57
|
-
if ($[
|
|
63
|
+
if ($[11] !== children || $[12] !== disabled || $[13] !== ref || $[14] !== rest || $[15] !== t3 || $[16] !== t4 || $[17] !== testID || $[18] !== type) {
|
|
58
64
|
t5 = /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
59
65
|
className: t3,
|
|
60
66
|
"data-testid": testID,
|
|
@@ -65,17 +71,17 @@ const ButtonBase = /*#__PURE__*/react.forwardRef((t0, ref) => {
|
|
|
65
71
|
...rest,
|
|
66
72
|
children: children
|
|
67
73
|
});
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
74
|
+
$[11] = children;
|
|
75
|
+
$[12] = disabled;
|
|
76
|
+
$[13] = ref;
|
|
77
|
+
$[14] = rest;
|
|
78
|
+
$[15] = t3;
|
|
79
|
+
$[16] = t4;
|
|
80
|
+
$[17] = testID;
|
|
81
|
+
$[18] = type;
|
|
82
|
+
$[19] = t5;
|
|
77
83
|
} else {
|
|
78
|
-
t5 = $[
|
|
84
|
+
t5 = $[19];
|
|
79
85
|
}
|
|
80
86
|
return t5;
|
|
81
87
|
});
|