diff --git a/README.md b/README.md index a78feb9d7..5617da2f0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ### React ``` -npm install @microlink/react styled-components --save +npm install @microlink/react @emotion/react @emotion/styled --save ``` ### Vanilla diff --git a/packages/hover-react/.babelrc b/packages/hover-react/.babelrc index bc21ecb9c..5550e1a23 100644 --- a/packages/hover-react/.babelrc +++ b/packages/hover-react/.babelrc @@ -16,7 +16,8 @@ ], "plugins": [ "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-object-rest-spread" + "@babel/plugin-proposal-object-rest-spread", + "@emotion" ], "env": { "production": { diff --git a/packages/hover-react/package.json b/packages/hover-react/package.json index 9cc16585c..b790420da 100644 --- a/packages/hover-react/package.json +++ b/packages/hover-react/package.json @@ -36,6 +36,10 @@ "@babel/preset-env": "latest", "@babel/preset-react": "latest", "@babel/runtime": "latest", + "@emotion/babel-plugin": "latest", + "@emotion/jest": "latest", + "@emotion/react": "latest", + "@emotion/styled": "latest", "@microlink/demo-links": "latest", "@rollup/plugin-babel": "latest", "@rollup/plugin-commonjs": "latest", @@ -57,7 +61,6 @@ "jest": "26", "jest-environment-enzyme": "latest", "jest-enzyme": "latest", - "jest-styled-components": "latest", "lodash": "latest", "prop-types": "latest", "react": "^17", @@ -65,7 +68,6 @@ "rollup": "latest", "rollup-plugin-filesize": "latest", "rollup-plugin-visualizer": "latest", - "styled-components": "latest", "unfetch": "latest" }, "engines": { @@ -91,9 +93,10 @@ "verbose": true }, "peerDependencies": { + "@emotion/react": "^11", + "@emotion/styled": "^11", "react": ">= 17", - "react-dom": ">= 17", - "styled-components": "^5" + "react-dom": ">= 17" }, "publishConfig": { "access": "public" diff --git a/packages/hover-react/rollup.config.js b/packages/hover-react/rollup.config.js index a7b718764..805a4b41b 100644 --- a/packages/hover-react/rollup.config.js +++ b/packages/hover-react/rollup.config.js @@ -12,7 +12,8 @@ const babelRc = JSON.parse(fs.readFileSync('./.babelrc')) const globals = { react: 'React', 'react-dom': 'ReactDOM', - 'styled-components': 'styled', + '@emotion/react': 'emotionReact', + '@emotion/styled': 'emotionStyled', '@microlink/mql': 'mql' } diff --git a/packages/hover-react/src/index.js b/packages/hover-react/src/index.js index d24189bf6..2f4395128 100644 --- a/packages/hover-react/src/index.js +++ b/packages/hover-react/src/index.js @@ -1,5 +1,5 @@ import Microlink from '@microlink/react' -import styled from 'styled-components' +import styled from '@emotion/styled' import React from 'react' const PopOver = styled.div` diff --git a/packages/hover-react/stories/index.js b/packages/hover-react/stories/index.js index 85db2f8fe..e000495fd 100644 --- a/packages/hover-react/stories/index.js +++ b/packages/hover-react/stories/index.js @@ -1,6 +1,6 @@ import 'unfetch/polyfill' import React from 'react' -import styled from 'styled-components' +import styled from '@emotion/styled' import { storiesOf } from '@storybook/react' diff --git a/packages/hover-react/stories/index.test.js b/packages/hover-react/stories/index.test.js index 8363fd9cd..eec010a6c 100644 --- a/packages/hover-react/stories/index.test.js +++ b/packages/hover-react/stories/index.test.js @@ -1,4 +1,8 @@ +/* global expect */ + import initStoryshots from '@storybook/addon-storyshots' -import 'jest-styled-components' +import { createSerializer } from '@emotion/jest' + +expect.addSnapshotSerializer(createSerializer()) initStoryshots() diff --git a/packages/hover-vanilla/docs/bootstrap.html b/packages/hover-vanilla/docs/bootstrap.html index 06cfb963e..bd05f1325 100644 --- a/packages/hover-vanilla/docs/bootstrap.html +++ b/packages/hover-vanilla/docs/bootstrap.html @@ -489,7 +489,7 @@