Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
Replace all @emotion/core package references with @emotion/react
Browse files Browse the repository at this point in the history
  • Loading branch information
hwillson committed Feb 20, 2021
1 parent a7f42cb commit 9f7d82f
Show file tree
Hide file tree
Showing 48 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .storybook/preview/ThemedCanvas.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { colors } from "../../src/colors";
import { assertUnreachable } from "../../src/shared/assertUnreachable";
import { Canvas } from "@storybook/addon-docs/dist/blocks/Canvas";
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function CJS() {
),
external: [
"@emotion/cache",
"@emotion/core",
"@emotion/react",
"@popperjs/core",
"@popperjs/core/lib/utils/computeAutoPlacement",
"@popperjs/core/lib/utils/detectOverflow",
Expand Down Expand Up @@ -100,7 +100,7 @@ function CJS() {
"@babel/preset-react",
{
runtime: "classic",
importSource: "@emotion/core",
importSource: "@emotion/react",
},
],
],
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractTooltip/abstractTooltip/TippyStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "../../../node_modules/tippy.js/dist/tippy.css";
import React from "react";
import { base } from "../../typography";
import { colors } from "../../colors";
import { Global, css } from "@emotion/core";
import { Global, css } from "@emotion/react";

export const TippyStyles: React.FC = () => (
<Global
Expand Down
2 changes: 1 addition & 1 deletion src/AlertBanner/AlertBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx } from "@emotion/core";
import { jsx } from "@emotion/react";
import React, { CSSProperties, useMemo } from "react";
import PropTypes from "prop-types";

Expand Down
2 changes: 1 addition & 1 deletion src/AlertCard/AlertCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
/** @jsxFrag React.Fragment */
import { jsx, ClassNames } from "@emotion/core";
import { jsx, ClassNames } from "@emotion/react";
import React, { CSSProperties, Fragment, useMemo } from "react";
import PropTypes from "prop-types";
import classnames from "classnames";
Expand Down
4 changes: 2 additions & 2 deletions src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { colors, ShadedColor } from "../colors";
import type { Property, SimplePseudos } from "csstype";
import { base } from "../typography";
import { ClassNames, jsx, ObjectInterpolation } from "@emotion/core";
import { ClassNames, jsx, CSSObject } from "@emotion/react";
import { getOffsetInPalette } from "../colors/utils/getOffsetInPalette";
import tinycolor from "tinycolor2";
import React, { useState } from "react";
Expand Down Expand Up @@ -353,7 +353,7 @@ export const Button = React.forwardRef<HTMLElement, Props>(
: colors.grey.light,
};

const focusedStyles: ObjectInterpolation<undefined> = {
const focusedStyles: CSSObject = {
...(feel === "flat" && {
backgroundColor: theme === "light" ? colors.white : "#000",
color: theme === "light" ? colors.blue.base : colors.blue.light,
Expand Down
2 changes: 1 addition & 1 deletion src/Button/button.stories/ButtonLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import React from "react";
import { Button } from "../Button";
import { colors } from "../../colors";
Expand Down
2 changes: 1 addition & 1 deletion src/Button/button/ButtonIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
import React from "react";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";

interface ButtonIconProps
extends Pick<
Expand Down
2 changes: 1 addition & 1 deletion src/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
import { colors } from "../colors";
import { base } from "../typography";
import { jsx, ClassNames } from "@emotion/core";
import { jsx, ClassNames } from "@emotion/react";
import React from "react";
import PropTypes from "prop-types";
import classnames from "classnames";
Expand Down
2 changes: 1 addition & 1 deletion src/FeatureIntroContent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
import * as React from "react";
import * as typography from "../typography";
import { jsx } from "@emotion/core";
import { jsx } from "@emotion/react";
import { colors } from "../colors";
import { useFeatureIntroControlInternalContext } from "../shared/FeatureIntroControlContext";

Expand Down
2 changes: 1 addition & 1 deletion src/FeatureIntroControl/FeatureIntroControl.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta, Story, Canvas } from "@storybook/addon-docs/blocks";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { FeatureIntroControl } from "../FeatureIntroControl";
import { FeatureIntroContent } from "../FeatureIntroContent";
import { FeatureIntroHeading } from "../FeatureIntroHeading";
Expand Down
2 changes: 1 addition & 1 deletion src/FeatureIntroControl/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
import React, { useMemo } from "react";
import { colors } from "../colors";
import { ClassNames, jsx } from "@emotion/core";
import { ClassNames, jsx } from "@emotion/react";
import { As, createElementFromAs } from "../shared/createElementFromAs";
import {
FeatureIntroControlContextProvider,
Expand Down
2 changes: 1 addition & 1 deletion src/FeatureIntroDismissButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
import * as React from "react";
import * as typography from "../typography";
import { jsx } from "@emotion/core";
import { jsx } from "@emotion/react";
import { colors } from "../colors";
import { useFeatureIntroControlInternalContext } from "../shared/FeatureIntroControlContext";

Expand Down
2 changes: 1 addition & 1 deletion src/FeatureIntroHeading/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
import * as React from "react";
import * as typography from "../typography";
import { jsx } from "@emotion/core";
import { jsx } from "@emotion/react";
import { colors } from "../colors";
import { useFeatureIntroControlInternalContext } from "../shared/FeatureIntroControlContext";

Expand Down
2 changes: 1 addition & 1 deletion src/FeatureIntroImage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
import * as React from "react";
import { jsx } from "@emotion/core";
import { jsx } from "@emotion/react";
import { useFeatureIntroControlInternalContext } from "../shared/FeatureIntroControlContext";

interface Props
Expand Down
2 changes: 1 addition & 1 deletion src/FeatureIntroLearnMoreLink/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
import * as React from "react";
import * as typography from "../typography";
import { jsx } from "@emotion/core";
import { jsx } from "@emotion/react";
import { colors } from "../colors";
import { useFeatureIntroControlInternalContext } from "../shared/FeatureIntroControlContext";
import { As, createElementFromAs } from "../shared/createElementFromAs";
Expand Down
2 changes: 1 addition & 1 deletion src/FormControl/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
/** @jsxFrag React.Fragment */
import { ClassNames, jsx } from "@emotion/core";
import { ClassNames, jsx } from "@emotion/react";
import React from "react";
import { As, createElementFromAs } from "../shared/createElementFromAs";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/FormDescription/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @jsxFrag React.Fragment */
import * as React from "react";
import * as typography from "../typography";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { colors } from "../colors";
import { useFormControlInternalContext } from "../shared/FormControlContext";

Expand Down
2 changes: 1 addition & 1 deletion src/FormEndAdornment/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
/** @jsxFrag React.Fragment */
import * as React from "react";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { useFormControlInternalContext } from "../shared/FormControlContext";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/FormErrorMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as React from "react";
import * as typography from "../typography";
import { colors } from "../colors";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { useFormControlInternalContext } from "../shared/FormControlContext";
import { IconWarningSolid } from "../icons/IconWarningSolid";

Expand Down
2 changes: 1 addition & 1 deletion src/FormHelperText/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as React from "react";
import * as typography from "../typography";
import { colors } from "../colors";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { IconInfo } from "../icons/IconInfo";
import { useFormControlInternalContext } from "../shared/FormControlContext";

Expand Down
2 changes: 1 addition & 1 deletion src/FormLabel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @jsxFrag React.Fragment */
import * as React from "react";
import * as typography from "../typography";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { useFormControlInternalContext } from "../shared/FormControlContext";

interface Props
Expand Down
2 changes: 1 addition & 1 deletion src/FormStartAdornment/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
/** @jsxFrag React.Fragment */
import * as React from "react";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { useFormControlInternalContext } from "../shared/FormControlContext";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
/** @jsxFrag React.Fragment */
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import React from "react";
import * as typography from "../typography";
import { colors } from "../colors";
Expand Down
2 changes: 1 addition & 1 deletion src/List/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
import React from "react";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { ListConfigProvider, useListConfig } from "../ListConfig";
import { verticalListMarginFromPadding } from "../shared/verticalListMarginFromPadding";
import { assertUnreachable } from "../shared/assertUnreachable";
Expand Down
2 changes: 1 addition & 1 deletion src/ListDivider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
import React from "react";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { colors } from "../colors";
import { ListItem } from "../ListItem";
import { useListConfig, ListConfigProvider } from "../ListConfig";
Expand Down
2 changes: 1 addition & 1 deletion src/ListHeading/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-empty-interface */
/** @jsx jsx */
import React from "react";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { colors } from "../colors";
import { ListItem } from "../ListItem";

Expand Down
2 changes: 1 addition & 1 deletion src/ListItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Property } from "csstype";
import React from "react";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { assertUnreachable } from "../shared/assertUnreachable";
import tinycolor from "tinycolor2";
import { colors } from "../colors";
Expand Down
2 changes: 1 addition & 1 deletion src/Loaders/LoadingSpinner.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
import React from "react";
import type { Property } from "csstype";
import { jsx, keyframes } from "@emotion/core";
import { jsx, keyframes } from "@emotion/react";
import { colors } from "../colors";
import { useSpaceKitProvider } from "../SpaceKitProvider";

Expand Down
2 changes: 1 addition & 1 deletion src/Modal/Modal.story.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
import { storiesOf } from "@storybook/react";
import { css, jsx } from "@emotion/core";
import { css, jsx } from "@emotion/react";
import { Modal } from "../Modal";
import React, { useState } from "react";
import { colors } from "../colors";
Expand Down
2 changes: 1 addition & 1 deletion src/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css, ClassNames } from "@emotion/core";
import { jsx, css, ClassNames } from "@emotion/react";
import React, { useEffect } from "react";
import { motion, MotionProps } from "framer-motion";
import * as typography from "../typography";
Expand Down
2 changes: 1 addition & 1 deletion src/Popover/popover/TippyPopoverStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "../../../node_modules/tippy.js/dist/tippy.css";
import React from "react";
import { base } from "../../typography";
import { colors } from "../../colors";
import { Global, css } from "@emotion/core";
import { Global, css } from "@emotion/react";

export const TippyPopoverStyles: React.FC = () => (
<Global
Expand Down
4 changes: 2 additions & 2 deletions src/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ListHeading } from "../ListHeading";
import { ListDivider } from "../ListDivider";
import { Popover } from "../Popover";
import { useSelect, UseSelectPropGetters } from "downshift";
import { ClassNames, jsx } from "@emotion/core";
import { ClassNames, jsx } from "@emotion/react";
import {
reactNodeToDownshiftItems,
isHTMLOptionElement,
Expand All @@ -37,7 +37,7 @@ interface RenderListItemProps {
* Custom function to render each `ListItem`
*
* This is provided so you can render the `ListItem` on your own, with an `as`
* prop, for example, so you can render a `Link`.
* prop, for example, so you can render a `Link`.
*
* The function will be called and it's return value rendered; this does not
* use `React.createElement`, so an inline function is totally acceptable with
Expand Down
2 changes: 1 addition & 1 deletion src/Switch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { ShadedColor, colors } from "../colors";
import { useFocusRing } from "@react-aria/focus";
import { useSwitch } from "@react-aria/switch";
Expand Down
2 changes: 1 addition & 1 deletion src/Switch/switch.story/Wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Switch } from "../../Switch";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { colors } from "../../colors";
import { mergeProps } from "@react-aria/utils";
import { assertUnreachable } from "../../shared/assertUnreachable";
Expand Down
2 changes: 1 addition & 1 deletion src/Switch/switch/Label.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";

type LabelProps = React.DetailedHTMLProps<
React.LabelHTMLAttributes<HTMLLabelElement>,
Expand Down
2 changes: 1 addition & 1 deletion src/Table/Table.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { cleanup, render } from "@testing-library/react";
import "@testing-library/jest-dom";
import { Table } from "./Table";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { matchers } from "jest-emotion";
import { colors } from "../colors";

Expand Down
2 changes: 1 addition & 1 deletion src/Table/Table.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { colors } from "../colors";
import { Meta, Story, ArgsTable, Canvas } from "@storybook/addon-docs/blocks";
import { Table } from "./Table";
Expand Down
2 changes: 1 addition & 1 deletion src/Table/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import React from "react";
import * as typography from "../typography";
import { colors } from "../colors";
Expand Down
2 changes: 1 addition & 1 deletion src/TextField/TextField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { ClassNames, jsx } from "@emotion/core";
import { ClassNames, jsx } from "@emotion/react";
import React from "react";
import * as typography from "../typography";
import { colors } from "../colors";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */
import "@testing-library/jest-dom";
import { emotionCacheProviderFactory } from "./index";
import { jsx } from "@emotion/core";
import { jsx } from "@emotion/react";
import { render } from "@testing-library/react";

test("when given no element, emotion should render classes into head", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/emotionCacheProviderFactory/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { CacheProvider } from "@emotion/core";
import { CacheProvider } from "@emotion/react";
import createCache from "@emotion/cache";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/icons/icons.story/IconDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as typography from "../../typography";
import React from "react";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { colors } from "../../colors";

interface Props {
Expand Down
4 changes: 2 additions & 2 deletions src/icons/scripts/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ function createCSSAttribute(css: string): types.JSXAttribute {
// manually when we write the file to disk.
return typeScriptTpl.ast`
${imports}
import { jsx, css } from '@emotion/core';
import { jsx, css } from '@emotion/react';
interface Props extends Omit<React.SVGProps<SVGSVGElement>, "css"> {
/**
* Weight to render the SVG in. Defaults to "normal"
Expand Down
2 changes: 1 addition & 1 deletion src/illustrations/scripts/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ All illustration components extends \`SVGSVGElement\` so that most props you'd w

return typeScriptTpl.ast`
${imports}
import { jsx } from '@emotion/core';
import { jsx } from '@emotion/react';
export const ${componentName} = React.forwardRef<SVGSVGElement, Omit<React.SVGProps<SVGSVGElement>, "css">>(
(props, ref) => ${jsx}
Expand Down
Loading

0 comments on commit 9f7d82f

Please sign in to comment.