@expo/styleguide 8.0.0-alpha.7 → 8.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expo-theme.css +0 -18
- package/dist/index.js +16 -16
- package/dist/src/components/Button/Button.d.ts +1 -1
- package/dist/src/components/Link/Link.d.ts +6 -3
- package/dist/src/components/Theme/BlockingSetInitialColorMode.d.ts +2 -2
- package/dist/src/components/Theme/ThemeProvider.d.ts +2 -2
- package/dist/src/logos/DocsLogo.d.ts +2 -2
- package/dist/src/logos/ExpoGoLogo.d.ts +2 -2
- package/dist/src/logos/Logo.d.ts +2 -2
- package/dist/src/logos/SnackLogo.d.ts +2 -2
- package/dist/src/logos/WordMarkLogo.d.ts +2 -2
- package/dist/src/styles/themes.d.ts +0 -9
- package/package.json +7 -7
- package/tailwind.js +0 -9
package/dist/expo-theme.css
CHANGED
|
@@ -116,15 +116,6 @@
|
|
|
116
116
|
--expo-theme-button-secondary-destructive-disabled-border: var(--red5);
|
|
117
117
|
--expo-theme-button-secondary-destructive-disabled-text: var(--red8);
|
|
118
118
|
|
|
119
|
-
/* Project icon backgrounds */
|
|
120
|
-
--expo-theme-project-blue: linear-gradient(#81b2eb, #6299d9);
|
|
121
|
-
--expo-theme-project-green: linear-gradient(#6eb87f, #54a767);
|
|
122
|
-
--expo-theme-project-yellow: linear-gradient(#edcd5f, #e5c145);
|
|
123
|
-
--expo-theme-project-orange: linear-gradient(#eb9f6a, #d9864c);
|
|
124
|
-
--expo-theme-project-red: linear-gradient(#eb7171, #d95757);
|
|
125
|
-
--expo-theme-project-pink: linear-gradient(#eb8dc5, #d977b2);
|
|
126
|
-
--expo-theme-project-purple: linear-gradient(#a687e0, #8a66cc);
|
|
127
|
-
|
|
128
119
|
/* Light shadows */
|
|
129
120
|
--expo-theme-shadows-none: 0 0 transparent;
|
|
130
121
|
--expo-theme-shadows-xs: 0 1px 3px rgba(0, 0, 0, 0.025),
|
|
@@ -239,15 +230,6 @@
|
|
|
239
230
|
--expo-theme-button-secondary-destructive-disabled-border: var(--red6);
|
|
240
231
|
--expo-theme-button-secondary-destructive-disabled-text: var(--red10);
|
|
241
232
|
|
|
242
|
-
/* Project icon backgrounds */
|
|
243
|
-
--expo-theme-project-blue: linear-gradient(#537296, #395a80);
|
|
244
|
-
--expo-theme-project-green: linear-gradient(#4b7d56, #32633d);
|
|
245
|
-
--expo-theme-project-yellow: linear-gradient(#a67f35, #8a6319);
|
|
246
|
-
--expo-theme-project-orange: linear-gradient(#ab744d, #8c5731);
|
|
247
|
-
--expo-theme-project-red: linear-gradient(#b25656, #8c3838);
|
|
248
|
-
--expo-theme-project-pink: linear-gradient(#995c81, #8a4c71);
|
|
249
|
-
--expo-theme-project-purple: linear-gradient(#715c99, #4e3973);
|
|
250
|
-
|
|
251
233
|
/* Dark shadows */
|
|
252
234
|
--expo-theme-shadows-none: 0 0 transparent;
|
|
253
235
|
--expo-theme-shadows-xs: 0 1px 3px rgba(0, 0, 0, 0.3),
|
package/dist/index.js
CHANGED
|
@@ -180,6 +180,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
180
180
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
181
181
|
PERFORMANCE OF THIS SOFTWARE.
|
|
182
182
|
***************************************************************************** */
|
|
183
|
+
/* global Reflect, Promise */
|
|
184
|
+
|
|
183
185
|
|
|
184
186
|
var __assign = function() {
|
|
185
187
|
__assign = Object.assign || function __assign(t) {
|
|
@@ -247,19 +249,20 @@ function capitalize(text) {
|
|
|
247
249
|
|
|
248
250
|
var LinkBase = React.forwardRef(function (_a, ref) {
|
|
249
251
|
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"]);
|
|
250
|
-
if (!href)
|
|
251
|
-
return null;
|
|
252
252
|
if (disabled) {
|
|
253
253
|
return (React.createElement("a", __assign({ ref: ref, "data-testid": testID }, rest), children));
|
|
254
254
|
}
|
|
255
|
+
if (!href || href.startsWith('#')) {
|
|
256
|
+
return (React.createElement("a", __assign({ href: href, ref: ref, onClick: onClick, "data-testid": testID }, rest), children));
|
|
257
|
+
}
|
|
255
258
|
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));
|
|
256
259
|
});
|
|
257
260
|
LinkBase.displayName = 'LinkBase';
|
|
258
261
|
|
|
259
|
-
|
|
262
|
+
var Link = React.forwardRef(function (_a, ref) {
|
|
260
263
|
var className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["className", "disabled"]);
|
|
261
|
-
return (React.createElement(LinkBase, __assign({ className: mergeClasses('text-link transition-opacity', !disabled && 'hocus:opacity-80', className) }, rest)));
|
|
262
|
-
}
|
|
264
|
+
return (React.createElement(LinkBase, __assign({ className: mergeClasses('text-link transition-opacity', !disabled && 'hocus:opacity-80', className), ref: ref }, rest)));
|
|
265
|
+
});
|
|
263
266
|
|
|
264
267
|
function getSizeClasses(size) {
|
|
265
268
|
switch (size) {
|
|
@@ -357,16 +360,22 @@ function getIconProps(element, classNames) {
|
|
|
357
360
|
}
|
|
358
361
|
var Button = React.forwardRef(function (_a, ref) {
|
|
359
362
|
var children = _a.children, _b = _a.size, size = _b === void 0 ? 'sm' : _b, _c = _a.theme, theme = _c === void 0 ? 'primary' : _c, _d = _a.skipCapitalization, skipCapitalization = _d === void 0 ? false : _d, href = _a.href, disabled = _a.disabled, className = _a.className, leftSlot = _a.leftSlot, rightSlot = _a.rightSlot, openInNewTab = _a.openInNewTab, rest = __rest(_a, ["children", "size", "theme", "skipCapitalization", "href", "disabled", "className", "leftSlot", "rightSlot", "openInNewTab"]);
|
|
360
|
-
var Element = href ? LinkBase : ButtonBase;
|
|
361
363
|
var isLeftSlotIcon = leftSlot && isIconElement(leftSlot);
|
|
362
364
|
var isRightSlotIcon = rightSlot && isIconElement(rightSlot);
|
|
363
365
|
var iconClasses = (isLeftSlotIcon || isRightSlotIcon) &&
|
|
364
366
|
mergeClasses("".concat(getIconSizeClasses(size)), getThemedIconClasses(theme), disabled && 'opacity-60');
|
|
365
367
|
var isSingleIconButton = (leftSlot || rightSlot) && !children;
|
|
366
|
-
|
|
368
|
+
var twClasses = mergeClasses("inline-flex border border-solid rounded-md font-medium gap-2 items-center whitespace-nowrap transition", getSizeClasses(size), getThemeClasses(theme, disabled), isSingleIconButton && getButtonIconClasses(size), disabled && 'cursor-default opacity-80 pointer-event-none', className);
|
|
369
|
+
var content = (React.createElement(React.Fragment, null,
|
|
367
370
|
isLeftSlotIcon ? React.cloneElement(leftSlot, getIconProps(leftSlot, iconClasses)) : leftSlot,
|
|
368
371
|
children && (React.createElement("span", { className: mergeClasses('flex self-center text-inherit leading-none', href && 'select-none') }, typeof children === 'string' && !skipCapitalization ? titleCase(children) : children)),
|
|
369
372
|
isRightSlotIcon ? React.cloneElement(rightSlot, getIconProps(rightSlot, iconClasses)) : rightSlot));
|
|
373
|
+
if (href) {
|
|
374
|
+
return (React.createElement(LinkBase, __assign({ href: href, className: twClasses, disabled: disabled, ref: ref, openInNewTab: openInNewTab }, rest), content));
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
return (React.createElement(ButtonBase, __assign({ className: twClasses, disabled: disabled, ref: ref }, rest), content));
|
|
378
|
+
}
|
|
370
379
|
});
|
|
371
380
|
Button.displayName = 'Button';
|
|
372
381
|
|
|
@@ -533,15 +542,6 @@ var theme = {
|
|
|
533
542
|
}
|
|
534
543
|
}
|
|
535
544
|
},
|
|
536
|
-
project: {
|
|
537
|
-
blue: 'var(--expo-theme-project-blue)',
|
|
538
|
-
green: 'var(--expo-theme-project-green)',
|
|
539
|
-
yellow: 'var(--expo-theme-project-yellow)',
|
|
540
|
-
orange: 'var(--expo-theme-project-orange)',
|
|
541
|
-
red: 'var(--expo-theme-project-red)',
|
|
542
|
-
pink: 'var(--expo-theme-project-pink)',
|
|
543
|
-
purple: 'var(--expo-theme-project-purple)'
|
|
544
|
-
},
|
|
545
545
|
palette: {
|
|
546
546
|
white: 'var(--expo-color-white)',
|
|
547
547
|
black: 'var(--expo-color-black)',
|
|
@@ -23,4 +23,4 @@ export declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAtt
|
|
|
23
23
|
leftSlot?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
24
24
|
rightSlot?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
25
25
|
skipCapitalization?: boolean | undefined;
|
|
26
|
-
} & React.RefAttributes<HTMLButtonElement |
|
|
26
|
+
} & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Link: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
3
|
+
testID?: string | undefined;
|
|
4
|
+
openInNewTab?: boolean | undefined;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare function isLocalStorageAvailable(): boolean;
|
|
3
3
|
export declare function getInitialColorMode(): string | null;
|
|
4
|
-
export declare function BlockingSetInitialColorMode(): JSX.Element;
|
|
4
|
+
export declare function BlockingSetInitialColorMode(): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
export declare enum Themes {
|
|
3
3
|
AUTO = "auto",
|
|
4
4
|
DARK = "dark",
|
|
@@ -8,7 +8,7 @@ type ThemeProviderProps = {
|
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare function ThemeProvider(props: ThemeProviderProps): JSX.Element;
|
|
11
|
+
export declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element;
|
|
12
12
|
export declare function useTheme(): {
|
|
13
13
|
setDarkMode: () => void;
|
|
14
14
|
setLightMode: () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
export declare function DocsLogo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export declare function DocsLogo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
export declare function ExpoGoLogo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export declare function ExpoGoLogo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): React.JSX.Element;
|
package/dist/src/logos/Logo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
export declare function Logo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export declare function Logo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
export declare function SnackLogo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export declare function SnackLogo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
export declare function WordMarkLogo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export declare function WordMarkLogo({ className, ...rest }: HTMLAttributes<SVGSVGElement>): React.JSX.Element;
|
|
@@ -115,15 +115,6 @@ export declare const theme: {
|
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
-
project: {
|
|
119
|
-
blue: string;
|
|
120
|
-
green: string;
|
|
121
|
-
yellow: string;
|
|
122
|
-
orange: string;
|
|
123
|
-
red: string;
|
|
124
|
-
pink: string;
|
|
125
|
-
purple: string;
|
|
126
|
-
};
|
|
127
118
|
palette: {
|
|
128
119
|
white: string;
|
|
129
120
|
black: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/styleguide",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.9",
|
|
4
4
|
"description": "Expo's styleguide components for use on the web.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
33
33
|
"@tailwindcss/typography": "^0.5.9",
|
|
34
|
-
"@types/react": "^18.
|
|
34
|
+
"@types/react": "^18.2.6",
|
|
35
35
|
"npm-run-all": "^4.1.5",
|
|
36
36
|
"rimraf": "^4.1.2",
|
|
37
|
-
"rollup": "^3.
|
|
37
|
+
"rollup": "^3.21.5",
|
|
38
38
|
"rollup-plugin-copy": "^3.4.0",
|
|
39
|
-
"tailwindcss": "^3.2
|
|
39
|
+
"tailwindcss": "^3.3.2",
|
|
40
40
|
"typescript": "^4.9.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"react": ">= 16"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@expo/styleguide-base": "^1.0.0-alpha.
|
|
48
|
-
"tailwind-merge": "^1.
|
|
47
|
+
"@expo/styleguide-base": "^1.0.0-alpha.3",
|
|
48
|
+
"tailwind-merge": "^1.12.0"
|
|
49
49
|
},
|
|
50
50
|
"eslintConfig": {
|
|
51
51
|
"extends": "universe/web"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "d5a31412d00af352d1d1f3383d08cfd8f009efd2"
|
|
54
54
|
}
|
package/tailwind.js
CHANGED
|
@@ -151,15 +151,6 @@ const expoTailwindConfig = {
|
|
|
151
151
|
|
|
152
152
|
...palette,
|
|
153
153
|
},
|
|
154
|
-
backgroundImage: {
|
|
155
|
-
'project-blue': 'var(--expo-theme-project-blue)',
|
|
156
|
-
'project-green': 'var(--expo-theme-project-green)',
|
|
157
|
-
'project-yellow': 'var(--expo-theme-project-yellow)',
|
|
158
|
-
'project-orange': 'var(--expo-theme-project-orange)',
|
|
159
|
-
'project-red': 'var(--expo-theme-project-red)',
|
|
160
|
-
'project-pink': 'var(--expo-theme-project-pink)',
|
|
161
|
-
'project-purple': 'var(--expo-theme-project-purple)',
|
|
162
|
-
},
|
|
163
154
|
borderColor: {
|
|
164
155
|
default: 'var(--expo-theme-border-default)',
|
|
165
156
|
secondary: 'var(--expo-theme-border-secondary)',
|