Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Chance Strickland committed Nov 15, 2019
2 parents cbaf979 + e31aa7d commit 7b6ddbf
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 97 deletions.
26 changes: 16 additions & 10 deletions packages/alert-dialog/src/index.js
Expand Up @@ -3,7 +3,7 @@ import { DialogOverlay, DialogContent } from "@reach/dialog";
import { useId } from "@reach/auto-id";
import { makeId } from "@reach/utils";
import invariant from "invariant";
import { func, bool, node, object, oneOfType } from "prop-types";
import PropTypes from "prop-types";

let AlertDialogContext = createContext({});

Expand Down Expand Up @@ -35,10 +35,13 @@ export const AlertDialogOverlay = React.forwardRef(function AlertDialogOverlay(

if (__DEV__) {
AlertDialogOverlay.propTypes = {
isOpen: bool,
onDismiss: func,
leastDestructiveRef: oneOfType([func, object]),
children: node
isOpen: PropTypes.bool,
onDismiss: PropTypes.func,
leastDestructiveRef: PropTypes.oneOfType([
PropTypes.func,
PropTypes.object
]),
children: PropTypes.node
};
}

Expand Down Expand Up @@ -77,7 +80,7 @@ export const AlertDialogContent = React.forwardRef(function AlertDialogContent(

if (__DEV__) {
AlertDialogContent.propTypes = {
children: node
children: PropTypes.node
};
}

Expand Down Expand Up @@ -106,9 +109,12 @@ export const AlertDialog = ({

if (__DEV__) {
AlertDialog.propTypes = {
isOpen: bool,
onDismiss: func,
leastDestructiveRef: oneOfType([func, object]),
children: node
isOpen: PropTypes.bool,
onDismiss: PropTypes.func,
leastDestructiveRef: PropTypes.oneOfType([
PropTypes.func,
PropTypes.object
]),
children: PropTypes.node
};
}
6 changes: 3 additions & 3 deletions packages/alert/src/index.js
Expand Up @@ -15,7 +15,7 @@ import React, { forwardRef, useEffect, useRef, useMemo } from "react";
import { render } from "react-dom";
import VisuallyHidden from "@reach/visually-hidden";
import { usePrevious, useForkedRef } from "@reach/utils";
import { node, string } from "prop-types";
import PropTypes from "prop-types";

// singleton state is fine because you don't server render
// an alert (SRs don't read them on first load anyway)
Expand Down Expand Up @@ -56,8 +56,8 @@ const Alert = forwardRef(function Alert(

if (__DEV__) {
Alert.propTypes = {
children: node,
type: string
children: PropTypes.node,
type: PropTypes.string
};
}

Expand Down
4 changes: 2 additions & 2 deletions packages/combobox/src/index.js
Expand Up @@ -20,7 +20,7 @@ import React, {
useReducer,
useState
} from "react";
import { func } from "prop-types";
import PropTypes from "prop-types";
import { makeId, wrapEvent, useForkedRef } from "@reach/utils";
import { findAll } from "highlight-words-core";
import escapeRegexp from "escape-regexp";
Expand Down Expand Up @@ -300,7 +300,7 @@ export const Combobox = forwardRef(function Combobox(

if (__DEV__) {
Combobox.propTypes = {
onSelect: func
onSelect: PropTypes.func
};
}

Expand Down
24 changes: 12 additions & 12 deletions packages/component-component/src/index.js
@@ -1,5 +1,5 @@
import React from "react";
import { object, func, oneOfType, node } from "prop-types";
import PropTypes from "prop-types";

let cleanProps = props => {
let {
Expand Down Expand Up @@ -106,17 +106,17 @@ class Component extends React.Component {

if (__DEV__) {
Component.propTypes = {
initialState: object,
getInitialState: func,
refs: object,
getRefs: func,
didMount: func,
didUpdate: func,
willUnmount: func,
getSnapshotBeforeUpdate: func,
shouldUpdate: func,
render: func,
children: oneOfType([func, node])
initialState: PropTypes.object,
getInitialState: PropTypes.func,
refs: PropTypes.object,
getRefs: PropTypes.func,
didMount: PropTypes.func,
didUpdate: PropTypes.func,
willUnmount: PropTypes.func,
getSnapshotBeforeUpdate: PropTypes.func,
shouldUpdate: PropTypes.func,
render: PropTypes.func,
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
};
}

Expand Down
8 changes: 4 additions & 4 deletions packages/dialog/src/index.js
Expand Up @@ -3,7 +3,7 @@ import Portal from "@reach/portal";
import { checkStyles, wrapEvent, useForkedRef } from "@reach/utils";
import FocusLock from "react-focus-lock";
import { RemoveScroll } from "react-remove-scroll";
import { string, func, bool } from "prop-types";
import PropTypes from "prop-types";

const noop = () => {};

Expand Down Expand Up @@ -139,8 +139,8 @@ export const Dialog = React.forwardRef(function Dialog(

if (__DEV__) {
Dialog.propTypes = {
isOpen: bool,
onDismiss: func,
isOpen: PropTypes.bool,
onDismiss: PropTypes.func,
"aria-label": ariaLabelType,
"aria-labelledby": ariaLabelType
};
Expand Down Expand Up @@ -209,5 +209,5 @@ function ariaLabelType(props, name, compName, ...rest) {
details
);
}
return string(name, props, compName, ...rest);
return PropTypes.string(name, props, compName, ...rest);
}
56 changes: 28 additions & 28 deletions packages/menu-button/src/index.js
Expand Up @@ -10,7 +10,7 @@ import React, {
import Portal from "@reach/portal";
import Rect, { useRect } from "@reach/rect";
import Component from "@reach/component-component";
import { node, func, object, string, number, oneOfType, any } from "prop-types";
import PropTypes from "prop-types";
import { wrapEvent, checkStyles, assignRef, useForkedRef } from "@reach/utils";

const noop = () => {};
Expand Down Expand Up @@ -115,7 +115,7 @@ export const Menu = ({ children }) => {

if (__DEV__) {
Menu.propTypes = {
children: oneOfType([func, node])
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
};
Menu.displayName = "Menu";
}
Expand Down Expand Up @@ -175,9 +175,9 @@ export const MenuButton = forwardRef(function MenuButton(

if (__DEV__) {
MenuButton.propTypes = {
onClick: func,
onKeyDown: func,
children: node
onClick: PropTypes.func,
onKeyDown: PropTypes.func,
children: PropTypes.node
};
MenuButton.displayName = "MenuButton";
}
Expand Down Expand Up @@ -239,15 +239,15 @@ export const MenuItem = forwardRef(function MenuItem(

if (__DEV__) {
MenuItem.propTypes = {
onSelect: func.isRequired,
onClick: func,
role: string,
state: object,
setState: func,
onKeyDown: func,
onMouseMove: func,
_ref: func,
_index: number
onSelect: PropTypes.func.isRequired,
onClick: PropTypes.func,
role: PropTypes.string,
state: PropTypes.object,
setState: PropTypes.func,
onKeyDown: PropTypes.func,
onMouseMove: PropTypes.func,
_ref: PropTypes.func,
_index: PropTypes.number
};
MenuItem.displayName = "MenuItem";
}
Expand Down Expand Up @@ -301,12 +301,12 @@ export const MenuLink = forwardRef(function MenuLink(

if (__DEV__) {
MenuLink.propTypes = {
as: any,
component: any,
onClick: func,
onKeyDown: func,
_index: number,
_ref: func
as: PropTypes.any,
component: PropTypes.any,
onClick: PropTypes.func,
onKeyDown: PropTypes.func,
_index: PropTypes.number,
_ref: PropTypes.func
};
MenuLink.displayName = "MenuLink";
}
Expand Down Expand Up @@ -346,7 +346,7 @@ export const MenuPopover = forwardRef(function MenuPopover(

if (__DEV__) {
MenuPopover.propTypes = {
children: node
children: PropTypes.node
};
MenuPopover.displayName = "MenuPopover";
}
Expand All @@ -364,7 +364,7 @@ export const MenuList = forwardRef(function MenuList(props, forwardedRef) {

if (__DEV__) {
MenuList.propTypes = {
children: node.isRequired
children: PropTypes.node.isRequired
};
MenuList.displayName = "MenuList";
}
Expand Down Expand Up @@ -446,12 +446,12 @@ export const MenuItems = forwardRef(function MenuItems(

if (__DEV__) {
MenuItems.propTypes = {
refs: object,
state: object,
setState: func,
children: node,
onKeyDown: func,
onBlur: func
refs: PropTypes.object,
state: PropTypes.object,
setState: PropTypes.func,
children: PropTypes.node,
onKeyDown: PropTypes.func,
onBlur: PropTypes.func
};
MenuItems.displayName = "MenuItems";
}
Expand Down
8 changes: 4 additions & 4 deletions packages/rect/src/index.js
@@ -1,6 +1,6 @@
import React, { useRef, useState, useLayoutEffect } from "react";
import observeRect from "@reach/observe-rect";
import { func, bool } from "prop-types";
import PropTypes from "prop-types";

let Rect = ({ onChange, observe, children }) => {
const ref = React.useRef(null);
Expand All @@ -14,9 +14,9 @@ Rect.defaultProps = {

if (__DEV__) {
Rect.propTypes = {
children: func,
observe: bool,
onChange: func
children: PropTypes.func,
observe: PropTypes.bool,
onChange: PropTypes.func
};
}

Expand Down
32 changes: 16 additions & 16 deletions packages/slider/src/index.js
Expand Up @@ -10,7 +10,7 @@ import React, {
useRef,
useState
} from "react";
import { node, func, number, string, bool, oneOf, oneOfType } from "prop-types";
import PropTypes from "prop-types";
import warning from "warning";
import { useId } from "@reach/auto-id";
import { wrapEvent, useForkedRef, makeId } from "@reach/utils";
Expand Down Expand Up @@ -45,23 +45,23 @@ const useSliderContext = () => useContext(SliderContext);
// These proptypes are shared between the composed SliderInput component and the
// simplified Slider
const sliderPropTypes = {
defaultValue: number,
disabled: bool,
getValueText: func,
handleAlignment: oneOf([
defaultValue: PropTypes.number,
disabled: PropTypes.bool,
getValueText: PropTypes.func,
handleAlignment: PropTypes.oneOf([
SLIDER_HANDLE_ALIGN_CENTER,
SLIDER_HANDLE_ALIGN_CONTAIN
]),
min: number,
max: number,
name: string,
orientation: oneOf([
min: PropTypes.number,
max: PropTypes.number,
name: PropTypes.string,
orientation: PropTypes.oneOf([
SLIDER_ORIENTATION_HORIZONTAL,
SLIDER_ORIENTATION_VERTICAL
]),
onChange: func,
step: number,
value: number
onChange: PropTypes.func,
step: PropTypes.number,
value: PropTypes.number
};

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -85,7 +85,7 @@ Slider.displayName = "Slider";
if (__DEV__) {
Slider.propTypes = {
...sliderPropTypes,
children: node
children: PropTypes.node
};
}

Expand Down Expand Up @@ -381,7 +381,7 @@ SliderInput.displayName = "SliderInput";
if (__DEV__) {
SliderInput.propTypes = {
...sliderPropTypes,
children: oneOfType([node, func]).isRequired
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired
};
}

Expand Down Expand Up @@ -416,7 +416,7 @@ SliderTrack.displayName = "SliderTrack";

if (__DEV__) {
SliderTrack.propTypes = {
children: node.isRequired
children: PropTypes.node.isRequired
};
}

Expand Down Expand Up @@ -568,7 +568,7 @@ SliderMarker.displayName = "SliderMarker";

if (__DEV__) {
SliderMarker.propTypes = {
value: number.isRequired
value: PropTypes.number.isRequired
};
}

Expand Down

0 comments on commit 7b6ddbf

Please sign in to comment.