Skip to content

Commit

Permalink
chore: Update dev dependencies (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickm68 committed Apr 18, 2020
1 parent ada5061 commit 652797b
Show file tree
Hide file tree
Showing 16 changed files with 8,819 additions and 6,141 deletions.
1 change: 0 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

parser: babel-eslint
extends:
- jason/react
Expand Down
19 changes: 19 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { plugins, rules } = require('webpack-atoms');

module.exports = {
webpackFinal: (config) => {
config.module = {
rules: [
rules.js(),
rules.astroturf(),
rules.css({ extract: false }),
],
};

config.plugins.push(
plugins.extractCss({ disable: true })
)

return config;
},
};
15 changes: 0 additions & 15 deletions .storybook/webpack.config.js

This file was deleted.

78 changes: 39 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"start": "yarn --cwd www run develop",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"travis-deploy-once": "travis-deploy-once",
"semantic-release": "semantic-release"
},
"repository": {
Expand Down Expand Up @@ -64,48 +63,49 @@
"prop-types": "^15.6.2"
},
"devDependencies": {
"@babel/cli": "^7.4.3",
"@babel/core": "^7.4.3",
"@semantic-release/changelog": "^3.0.0",
"@semantic-release/git": "^7.0.4",
"@semantic-release/github": "^5.0.5",
"@semantic-release/npm": "^5.0.4",
"@storybook/addon-actions": "^4.1.4",
"@storybook/react": "^4.1.4",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.5",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0",
"@restart/hooks": "^0.3.22",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.5",
"@semantic-release/npm": "^7.0.5",
"@storybook/addon-actions": "^5.3.18",
"@storybook/react": "^5.3.18",
"astroturf": "^0.10.4",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"babel-preset-jason": "^6.0.1",
"babel-preset-jason": "^6.2.0",
"cherry-pick": "^0.5.0",
"cross-env": "^5.2.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.0",
"eslint": "^5.16.0",
"eslint-config-jason": "^5.0.0",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"husky": "^1.3.1",
"jest": "^24.7.1",
"prettier": "^1.16.4",
"react": "~16.6.3",
"react-dom": "~16.6.3",
"cross-env": "^7.0.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"eslint": "^6.8.0",
"eslint-config-jason": "^7.0.1",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^3.0.0",
"husky": "^4.2.5",
"jest": "^25.3.0",
"prettier": "^2.0.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"release-script": "^1.0.2",
"rimraf": "^2.6.3",
"rollup": "^1.9.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-node-resolve": "^4.2.0",
"rollup-plugin-replace": "^2.1.1",
"rollup-plugin-size-snapshot": "^0.8.0",
"rollup-plugin-terser": "^4.0.2",
"semantic-release": "^15.9.16",
"rimraf": "^3.0.2",
"rollup": "^2.6.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-size-snapshot": "^0.11.0",
"rollup-plugin-terser": "^5.3.0",
"semantic-release": "^17.0.6",
"semantic-release-alt-publish-dir": "^3.0.0",
"travis-deploy-once": "^5.0.8",
"webpack-atoms": "^10.0.2"
"webpack-atoms": "^12.1.0"
},
"release": {
"pkgRoot": "lib",
Expand Down
2 changes: 0 additions & 2 deletions stories/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
globals:
css: false
rules:
react/prop-types: off
no-unused-vars:
Expand Down
1 change: 1 addition & 0 deletions stories/CSSTransitionGroupFixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class CSSTransitionGroupFixture extends React.Component {
items,
};
}

handleAddItem = () => {
this.setState(({ items }) => ({
items: [
Expand Down
83 changes: 39 additions & 44 deletions stories/NestedTransition.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,46 @@
import React from 'react';
import StoryFixture from './StoryFixture';
import React, { useState } from 'react';

import StoryFixture from './StoryFixture';
import Fade from './transitions/Fade';
import Scale from './transitions/Scale';

const FadeAndScale = (props) => (
<Fade {...props}>
<div>
<div>I will fade</div>
{/*
We also want to scale in at the same time so we pass the `in` state here as well, so it enters
at the same time as the Fade.
Note also the `appear` since the Fade will happen when the item mounts, the Scale transition
will mount at the same time as the div we want to scale, so we need to tell it to animate as
it _appears_.
*/}
<Scale in={props.in} appear>
<div>I should scale</div>
</Scale>
</div>
</Fade>
)


export default class Example extends React.Component {
constructor(props, context) {
super(props, context);
this.state = { showNested: false };
}

toggleNested = () => {
this.setState({ showNested: !this.state.showNested })
}

render() {
return (
<StoryFixture description="nested Transtions">
<h3>Nested Animations</h3>
<button onClick={this.toggleNested}>
Click to see 2 nested animations
</button>
<FadeAndScale in={this.state.showNested} mountOnEnter unmountOnExit />
</StoryFixture>
);
}
function FadeAndScale(props) {
return (
<Fade {...props}>
<div>
<div>I will fade</div>
{/*
We also want to scale in at the same time so we pass the `in` state here as well, so it enters
at the same time as the Fade.
Note also the `appear` since the Fade will happen when the item mounts, the Scale transition
will mount at the same time as the div we want to scale, so we need to tell it to animate as
it _appears_.
*/}
<Scale in={props.in} appear>
<div>I should scale</div>
</Scale>
</div>
</Fade>
);
}

function Example() {
const [showNested, setShowNested] = useState(false);

return (
<StoryFixture description="nested Transtions">
<h3>Nested Animations</h3>
<button
onClick={() => {
setShowNested(!showNested);
}}
>
Click to see 2 nested animations
</button>
<FadeAndScale in={showNested} mountOnEnter unmountOnExit />
</StoryFixture>
);
}


export default Example;
66 changes: 36 additions & 30 deletions stories/ReplaceTransition.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';
import { css } from 'astroturf';
import React, { useState } from 'react';
import { storiesOf } from '@storybook/react';

import ReplaceTransition from '../src/ReplaceTransition';
import CSSTransition from '../src/CSSTransition';

const FADE_TIMEOUT = 1000;

let styles = css`
const styles = css`
.enter {
opacity: 0.01;
}
Expand Down Expand Up @@ -37,36 +38,41 @@ let styles = css`
}
`;

export default class Fade extends React.Component {
static defaultProps = {
in: false,
delay: false,
timeout: FADE_TIMEOUT * 2,
};
render() {
const { ...props } = this.props;
return (
<CSSTransition
{...props}
className={styles.box}
classNames={styles}
/>
);
}
const defaultProps = {
in: false,
delay: false,
timeout: FADE_TIMEOUT * 2,
}

class Example extends React.Component {
state = { in: false }
render() {
return (
<div>
<button onClick={() => this.setState(p => ({ in: !p.in })) }>
toggle (in: "{String(this.state.in)}")
</button>
{React.cloneElement(this.props.children, this.state)}
</div>
);
}
function Fade(props) {
return (
<CSSTransition
{...props}
className={styles.box}
classNames={styles}
/>
);
}

Fade.defaultProps = defaultProps;

export default Fade;

function Example({ children }) {
const [show, setShow] = useState(false);

return (
<div>
<button
onClick={() => {
setShow(!show);
}}
>
toggle (in: "{String(show)}")
</button>
{React.cloneElement(children, { in: show })}
</div>
);
}


Expand Down
18 changes: 7 additions & 11 deletions stories/StoryFixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ const propTypes = {
description: PropTypes.string,
};

class StoryFixture extends React.Component {
render() {
const { children, description } = this.props;
function StoryFixture({ description, children }) {
return (
<div>
<p>{description}</p>

return (
<div>
<p>{description}</p>

{children}
</div>
);
}
{children}
</div>
);
}

StoryFixture.propTypes = propTypes;
Expand Down
Loading

0 comments on commit 652797b

Please sign in to comment.