@expo/styleguide 8.0.0-alpha.5 → 8.0.0-alpha.6

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/index.js CHANGED
@@ -214,6 +214,7 @@ var ButtonBase = React.forwardRef(function (_a, ref) {
214
214
  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"]);
215
215
  return (React.createElement("button", __assign({ className: mergeClasses('flex cursor-pointer', className), "data-testid": testID, disabled: disabled, ref: ref, type: type, onClick: disabled ? undefined : onClick }, rest), children));
216
216
  });
217
+ ButtonBase.displayName = 'ButtonBase';
217
218
 
218
219
  var STOPWORDS = 'a an and at but by for in nor of on or out so the to up with yet'.split(' ');
219
220
  function titleCase(value, options) {
@@ -253,6 +254,7 @@ var LinkBase = React.forwardRef(function (_a, ref) {
253
254
  }
254
255
  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));
255
256
  });
257
+ LinkBase.displayName = 'LinkBase';
256
258
 
257
259
  function Link(_a) {
258
260
  var className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["className", "disabled"]);
@@ -337,8 +339,8 @@ function isIconElement(element) {
337
339
  function getIconProps(element, classNames) {
338
340
  return __assign(__assign({}, element.props), { className: mergeClasses(classNames, element.props.className) });
339
341
  }
340
- var Button = function (props) {
341
- var children = props.children, _a = props.size, size = _a === void 0 ? 'sm' : _a, _b = props.theme, theme = _b === void 0 ? 'primary' : _b, _c = props.skipCapitalization, skipCapitalization = _c === void 0 ? false : _c, href = props.href, disabled = props.disabled, className = props.className, leftSlot = props.leftSlot, rightSlot = props.rightSlot, openInNewTab = props.openInNewTab, rest = __rest(props, ["children", "size", "theme", "skipCapitalization", "href", "disabled", "className", "leftSlot", "rightSlot", "openInNewTab"]);
342
+ var Button = React.forwardRef(function (_a, ref) {
343
+ 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"]);
342
344
  var Element = href ? LinkBase : ButtonBase;
343
345
  var isLeftSlotIcon = leftSlot && isIconElement(leftSlot);
344
346
  var isRightSlotIcon = rightSlot && isIconElement(rightSlot);
@@ -348,7 +350,8 @@ var Button = function (props) {
348
350
  isLeftSlotIcon ? React.cloneElement(leftSlot, getIconProps(leftSlot, iconClasses)) : leftSlot,
349
351
  children && (React.createElement("span", { className: mergeClasses('flex self-center text-inherit leading-none', href && 'select-none') }, typeof children === 'string' && !skipCapitalization ? titleCase(children) : children)),
350
352
  isRightSlotIcon ? React.cloneElement(rightSlot, getIconProps(rightSlot, iconClasses)) : rightSlot));
351
- };
353
+ });
354
+ Button.displayName = 'Button';
352
355
 
353
356
  function DocsLogo(_a) {
354
357
  var className = _a.className, rest = __rest(_a, ["className"]);
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { ReactElement } from 'react';
2
3
  import { ButtonBaseProps } from './ButtonBase';
3
4
  import { LinkBaseProps } from '../Link';
@@ -10,4 +11,16 @@ export type ButtonProps = ButtonBaseProps & LinkBaseProps & {
10
11
  rightSlot?: ReactElement;
11
12
  skipCapitalization?: boolean;
12
13
  };
13
- export declare const Button: (props: ButtonProps) => JSX.Element;
14
+ export declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
15
+ testID?: string | undefined;
16
+ } & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
17
+ testID?: string | undefined;
18
+ openInNewTab?: boolean | undefined;
19
+ disabled?: boolean | undefined;
20
+ } & {
21
+ size?: ButtonSize | undefined;
22
+ theme?: ButtonTheme | undefined;
23
+ leftSlot?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
24
+ rightSlot?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
25
+ skipCapitalization?: boolean | undefined;
26
+ } & React.RefAttributes<HTMLButtonElement | HTMLLinkElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/styleguide",
3
- "version": "8.0.0-alpha.5",
3
+ "version": "8.0.0-alpha.6",
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",
@@ -49,5 +49,5 @@
49
49
  "eslintConfig": {
50
50
  "extends": "universe/web"
51
51
  },
52
- "gitHead": "68d6b28dc988586775131a895c4a718410562214"
52
+ "gitHead": "f69b54101ffc1851056c16bcac76e91a89d0254a"
53
53
  }