@expo/styleguide 8.0.0-alpha.8 → 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.
@@ -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) {
@@ -257,10 +259,10 @@ var LinkBase = React.forwardRef(function (_a, ref) {
257
259
  });
258
260
  LinkBase.displayName = 'LinkBase';
259
261
 
260
- function Link(_a) {
262
+ var Link = React.forwardRef(function (_a, ref) {
261
263
  var className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["className", "disabled"]);
262
- return (React.createElement(LinkBase, __assign({ className: mergeClasses('text-link transition-opacity', !disabled && 'hocus:opacity-80', className) }, rest)));
263
- }
264
+ return (React.createElement(LinkBase, __assign({ className: mergeClasses('text-link transition-opacity', !disabled && 'hocus:opacity-80', className), ref: ref }, rest)));
265
+ });
264
266
 
265
267
  function getSizeClasses(size) {
266
268
  switch (size) {
@@ -358,16 +360,22 @@ function getIconProps(element, classNames) {
358
360
  }
359
361
  var Button = React.forwardRef(function (_a, ref) {
360
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"]);
361
- var Element = href ? LinkBase : ButtonBase;
362
363
  var isLeftSlotIcon = leftSlot && isIconElement(leftSlot);
363
364
  var isRightSlotIcon = rightSlot && isIconElement(rightSlot);
364
365
  var iconClasses = (isLeftSlotIcon || isRightSlotIcon) &&
365
366
  mergeClasses("".concat(getIconSizeClasses(size)), getThemedIconClasses(theme), disabled && 'opacity-60');
366
367
  var isSingleIconButton = (leftSlot || rightSlot) && !children;
367
- return (React.createElement(Element, __assign({ href: href, className: 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), disabled: disabled }, (href ? { openInNewTab: openInNewTab } : {}), rest),
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,
368
370
  isLeftSlotIcon ? React.cloneElement(leftSlot, getIconProps(leftSlot, iconClasses)) : leftSlot,
369
371
  children && (React.createElement("span", { className: mergeClasses('flex self-center text-inherit leading-none', href && 'select-none') }, typeof children === 'string' && !skipCapitalization ? titleCase(children) : children)),
370
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
+ }
371
379
  });
372
380
  Button.displayName = 'Button';
373
381
 
@@ -534,15 +542,6 @@ var theme = {
534
542
  }
535
543
  }
536
544
  },
537
- project: {
538
- blue: 'var(--expo-theme-project-blue)',
539
- green: 'var(--expo-theme-project-green)',
540
- yellow: 'var(--expo-theme-project-yellow)',
541
- orange: 'var(--expo-theme-project-orange)',
542
- red: 'var(--expo-theme-project-red)',
543
- pink: 'var(--expo-theme-project-pink)',
544
- purple: 'var(--expo-theme-project-purple)'
545
- },
546
545
  palette: {
547
546
  white: 'var(--expo-color-white)',
548
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 | HTMLLinkElement>>;
26
+ } & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
@@ -1,3 +1,6 @@
1
- /// <reference types="react" />
2
- import { LinkBaseProps } from './LinkBase';
3
- export declare function Link({ className, disabled, ...rest }: LinkBaseProps): JSX.Element;
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
- /// <reference types="react" />
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;
@@ -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.8",
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.0.28",
34
+ "@types/react": "^18.2.6",
35
35
  "npm-run-all": "^4.1.5",
36
36
  "rimraf": "^4.1.2",
37
- "rollup": "^3.17.2",
37
+ "rollup": "^3.21.5",
38
38
  "rollup-plugin-copy": "^3.4.0",
39
- "tailwindcss": "^3.2.7",
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.2",
47
+ "@expo/styleguide-base": "^1.0.0-alpha.3",
48
48
  "tailwind-merge": "^1.12.0"
49
49
  },
50
50
  "eslintConfig": {
51
51
  "extends": "universe/web"
52
52
  },
53
- "gitHead": "573e5979139e7d40c946ac8724d3ec7b66ae60b3"
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)',