Skip to content

Commit 869a036

Browse files
montezumedferber90
authored andcommitted
fix: replace styled-components with react-emotion (#184)
* chore: replace styled-components with react-emotion * refactor: consistently use react-emotion Drops direct usage of emotion. Drops emotion as a peer-dep as we're not using it directly anymore. * chore: make emotion dep
1 parent 4324b74 commit 869a036

File tree

13 files changed

+154
-151
lines changed

13 files changed

+154
-151
lines changed

materials/colors/colors.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
3-
import styled from 'styled-components';
3+
import styled from 'react-emotion';
44
import { Text } from '../../src';
55
import isVariation from '../../src/utils/is-variation';
66
import colorGroups from './decisions/base-colors.json';

materials/shadows/shadows.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
3-
import styled from 'styled-components';
3+
import styled from 'react-emotion';
44
import { flatMap } from 'lodash';
55
import { Text } from '../../src';
66
import shadowGroups from './decisions/base-shadows.json';

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"common-tags": "1.8.0",
5858
"dom-helpers": "3.3.1",
5959
"downshift": "3.1.1",
60+
"emotion": "9.2.12",
6061
"is-touch-device": "1.0.1",
6162
"lodash.flatmap": "4.5.0",
6263
"lodash.has": "4.5.2",
@@ -67,6 +68,7 @@
6768
"lodash.uniq": "4.5.0",
6869
"lodash.without": "4.4.0",
6970
"prop-types": "15.6.2",
71+
"react-emotion": "9.2.12",
7072
"react-required-if": "1.0.3",
7173
"recompose": "0.30.0",
7274
"tiny-invariant": "1.0.1",
@@ -109,7 +111,6 @@
109111
"cross-env": "5.2.0",
110112
"css": "2.2.4",
111113
"css-loader": "1.0.0",
112-
"emotion": "9.2.12",
113114
"enzyme": "3.7.0",
114115
"enzyme-adapter-react-16": "1.6.0",
115116
"enzyme-to-json": "3.3.4",
@@ -187,15 +188,13 @@
187188
"shelljs": "0.8.2",
188189
"storybook-readme": "4.0.2",
189190
"style-loader": "0.23.1",
190-
"styled-components": "4.0.2",
191191
"stylelint": "9.6.0",
192192
"stylelint-config-standard": "18.2.0",
193193
"stylelint-order": "1.0.0",
194194
"url-loader": "1.1.2",
195195
"webpack": "4.21.0"
196196
},
197197
"peerDependencies": {
198-
"emotion": "^9.1.2",
199198
"flatpickr": ">4.5.0",
200199
"moment": ">2.2",
201200
"moment-timezone": "^0.5",

rollup.config.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ const plugins = [
7676
resolve(),
7777
// For shimming nodejs builtins
7878
builtins(),
79-
// To automatically externalize `peerDependencies`
79+
// To automatically externalize `peerDependencies` and `dependencies`
8080
// so that they do not end up in the bundle.
8181
// See also https://medium.com/@kelin2025/so-you-wanna-use-es6-modules-714f48b3a953
82-
peerDepsExternal(),
82+
peerDepsExternal({
83+
dependencies: true,
84+
}),
8385
// Transpile sources using our custom babel preset.
8486
babel({
8587
exclude: ['node_modules/**'],

src/components/collapsible-motion/collapsible-motion.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
33
import invariant from 'tiny-invariant';
4-
import { keyframes } from 'emotion';
4+
import { keyframes } from 'react-emotion';
55
import Collapsible from '../collapsible';
66

77
const createOpeningAnimation = height =>

src/components/constraints/horizontal/horizontal.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import { withKnobs, select } from '@storybook/addon-knobs';
44
import withReadme from 'storybook-readme/with-readme';
5-
import styled from 'styled-components';
5+
import styled from 'react-emotion';
66
import Horizontal from './horizontal';
77
import Readme from './README.md';
88

src/components/icons/icon.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import { withKnobs, select } from '@storybook/addon-knobs';
44
import withReadme from 'storybook-readme/with-readme';
5-
import styled from 'styled-components';
5+
import styled from 'react-emotion';
66
import kebabCase from 'lodash.kebabcase';
77
import Text from '../typography/text';
88
import Readme from './README.md';

src/components/spacings/inline/inline.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import { withKnobs, select } from '@storybook/addon-knobs';
44
import withReadme from 'storybook-readme/with-readme';
5-
import styled from 'styled-components';
5+
import styled from 'react-emotion';
66
import Text from '../../typography/text';
77
import Inset from '../inset';
88
import Inline from './inline';

src/components/spacings/inset-squish/inset-squish.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import withReadme from 'storybook-readme/with-readme';
4-
import styled from 'styled-components';
4+
import styled from 'react-emotion';
55
import { Text } from '../../../index';
66
import Inline from '../inline';
77
import Inset from '../inset';

src/components/spacings/inset/inset.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import withReadme from 'storybook-readme/with-readme';
4-
import styled from 'styled-components';
4+
import styled from 'react-emotion';
55
import { Text } from '../../../index';
66
import Inline from '../inline';
77
import Inset from './inset';

src/components/spacings/stack/stack.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import { withKnobs, select } from '@storybook/addon-knobs';
44
import withReadme from 'storybook-readme/with-readme';
5-
import styled from 'styled-components';
5+
import styled from 'react-emotion';
66
import { Text } from '../../../index';
77
import Inline from '../inline';
88
import Inset from '../inset';

src/components/typography/typography.story.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import styled from 'styled-components';
2+
import styled from 'react-emotion';
33
import { storiesOf } from '@storybook/react';
44
import { withKnobs, boolean, select, text } from '@storybook/addon-knobs';
55
import withReadme from 'storybook-readme/with-readme';

0 commit comments

Comments
 (0)