Skip to content

Commit

Permalink
Upgrade to Emotion 11
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed May 4, 2021
1 parent d176475 commit 269f8e3
Show file tree
Hide file tree
Showing 57 changed files with 413 additions and 150 deletions.
375 changes: 307 additions & 68 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"@babel/plugin-syntax-jsx": "7.12.13",
"@babel/runtime-corejs3": "7.13.10",
"@babel/traverse": "7.13.0",
"@emotion/styled": "^11.3.0",
"@octokit/rest": "16.26.0",
"@octokit/webhooks": "7.1.0",
"@storybook/addon-a11y": "6.2.5",
Expand Down
12 changes: 6 additions & 6 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
],
"dependencies": {
"@babel/runtime": "^7.13.10",
"@emotion/cache": "^10.0.27",
"@emotion/core": "^10.1.1",
"@emotion/css": "^10.0.22",
"@emotion/native": "^10.0.22",
"@emotion/styled": "^10.0.23",
"@emotion/cache": "^11.1.3",
"@emotion/core": "^11.0.0",
"@emotion/css": "^11.1.3",
"@emotion/native": "^11.0.0",
"@emotion/react": "^11.1.5",
"@emotion/styled": "^11.3.0",
"@wordpress/a11y": "file:../a11y",
"@wordpress/compose": "file:../compose",
"@wordpress/date": "file:../date",
Expand All @@ -52,7 +53,6 @@
"classnames": "^2.2.5",
"dom-scroll-into-view": "^1.2.1",
"downshift": "^6.0.15",
"emotion": "^10.0.23",
"gradient-parser": "^0.1.5",
"highlight-words-core": "^1.2.2",
"lodash": "^4.17.19",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { css } from '@emotion/css';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { css } from '@emotion/css';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from '@emotion/core';
import { css } from '@emotion/css';
import styled from '@emotion/styled';

export const Root = styled.span`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from '@emotion/core';
import { css } from '@emotion/css';
import styled from '@emotion/styled';
/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from '@emotion/core';
import { css } from '@emotion/css';
import styled from '@emotion/styled';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/flex/flex-item/hook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css, cx } from 'emotion';
import { css, cx } from '@emotion/css';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/flex/flex/hook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css, cx } from 'emotion';
import { css, cx } from '@emotion/css';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/flex/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

export const Flex = css`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from '@emotion/core';
import { css } from '@emotion/css';
import styled from '@emotion/styled';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from '@emotion/core';
import { css } from '@emotion/css';
import styled from '@emotion/styled';
/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from '@emotion/core';
import { css } from '@emotion/css';
import styled from '@emotion/styled';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from '@emotion/core';
import { css } from '@emotion/css';
import styled from '@emotion/styled';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/spinner/styles/spinner-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import styled from '@emotion/styled';
import { keyframes } from '@emotion/core';
import { keyframes } from '@emotion/css';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/style-provider/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { CacheProvider } from '@emotion/core';
import { CacheProvider } from '@emotion/react';
import createCache from '@emotion/cache';
import memoize from 'memize';

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/text/hook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css, cx } from 'emotion';
import { css, cx } from '@emotion/css';
import { isPlainObject } from 'lodash';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/text/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/truncate/hook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css, cx } from 'emotion';
import { css, cx } from '@emotion/css';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/truncate/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

export const Truncate = css`
display: block;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/card/body.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { cx } from 'emotion';
import { cx } from '@emotion/css';

/**
* WordPress dependencies
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/ui/card/component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

/**
* WordPress dependencies
Expand Down Expand Up @@ -35,7 +35,7 @@ function Card( props, forwardedRef ) {

return (
<View { ...otherProps } ref={ forwardedRef }>
<View css={ styles.Content }>{ children }</View>
<View className={ styles.Content }>{ children }</View>
<Elevation
className={ elevationClassName }
isInteractive={ false }
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/card/footer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { cx } from 'emotion';
import { cx } from '@emotion/css';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/card/header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { cx } from 'emotion';
import { cx } from '@emotion/css';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/card/hook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { cx } from 'emotion';
import { cx } from '@emotion/css';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/card/inner-body.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { cx } from 'emotion';
import { cx } from '@emotion/css';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/card/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

/**
* Internal dependencies
Expand Down
21 changes: 0 additions & 21 deletions packages/components/src/ui/context/polymorphic-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// eslint-disable-next-line no-restricted-imports
import type * as React from 'react';
import type { As, RenderProp, ExtractHTMLAttributes } from 'reakit-utils/types';
import type { Interpolation } from 'create-emotion';

/**
* Based on https://github.com/reakit/reakit/blob/master/packages/reakit-utils/src/types.ts
Expand Down Expand Up @@ -35,27 +34,7 @@ export type PolymorphicComponent< T extends As, O > = {
selector: string;
};

export type CreatePolymorphicComponent< T extends As, P > = (
template: TemplateStringsArray,
...styles: (
| Interpolation< undefined >
| PolymorphicComponent< any, any >
)[]
) => PolymorphicComponent< T, P >;

export type ForwardedRef< TElement extends HTMLElement > =
| ( ( instance: TElement | null ) => void )
| React.MutableRefObject< TElement | null >
| null;

export type CoreElements = {
[ P in keyof JSX.IntrinsicElements ]: PolymorphicComponent< P, {} >;
};

type CreateStyledComponents = {
[ P in keyof JSX.IntrinsicElements ]: CreatePolymorphicComponent< P, {} >;
};

export type CreateStyled = CreateStyledComponents & {
< T extends As >( component: T ): CreatePolymorphicComponent< T, {} >;
};
2 changes: 1 addition & 1 deletion packages/components/src/ui/context/use-context-system.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { cx } from 'emotion';
import { cx } from '@emotion/css';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/control-group/hook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { cx } from 'emotion';
import { cx } from '@emotion/css';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/control-group/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

export const first = css`
border-bottom-right-radius: 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/control-label/hook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { cx } from 'emotion';
import { cx } from '@emotion/css';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/control-label/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/divider/component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css, cx } from 'emotion';
import { css, cx } from '@emotion/css';
// eslint-disable-next-line no-restricted-imports
import { Separator } from 'reakit';
// eslint-disable-next-line no-restricted-imports, no-duplicate-imports
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/divider/styles.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/elevation/hook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css, cx } from 'emotion';
import { css, cx } from '@emotion/css';
import { isNil } from 'lodash';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/elevation/styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

export const Elevation = css`
background: transparent;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ui/form-group/form-group-styles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { css } from 'emotion';
import { css } from '@emotion/css';

export const FormGroup = css`
width: 100%;
Expand Down
Loading

0 comments on commit 269f8e3

Please sign in to comment.