Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change jsxImportSource to react #2184

Merged
merged 2 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twenty-cobras-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/circuit-ui': patch
---

Changed the `jsxImportSource` from `@emotion/react` to `react`.
2 changes: 2 additions & 0 deletions packages/circuit-ui/components/Calendar/RangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';
import { ArrowRight, ArrowLeft, Close } from '@sumup/icons';
// eslint-disable-next-line import/no-extraneous-dependencies
Expand All @@ -32,7 +34,7 @@
const CloseIcon = styled(Close)(
({ theme }) => css`
color: var(--cui-fg-normal);
margin: ${theme.spacings.bit} ${theme.spacings.bit} 0 0; /* Adjust spacing to fit in the 32px customArrowIcon container */

Check warning on line 37 in packages/circuit-ui/components/Calendar/RangePicker.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.bit}' with 'var(--cui-spacings-bit)'

Check warning on line 37 in packages/circuit-ui/components/Calendar/RangePicker.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.bit}' with 'var(--cui-spacings-bit)'

Check warning on line 37 in packages/circuit-ui/components/Calendar/RangePicker.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.bit}' with 'var(--cui-spacings-bit)'

Check warning on line 37 in packages/circuit-ui/components/Calendar/RangePicker.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.bit}' with 'var(--cui-spacings-bit)'
`,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import type { ReactNode } from 'react';
import type { Theme } from '@sumup/design-tokens';
import { css, Global } from '@emotion/react';
Expand Down Expand Up @@ -99,16 +101,16 @@
.DateRangePickerInput,
.SingleDatePickerInput {
background-color: var(--cui-bg-normal);
padding: ${theme.spacings.kilo} ${theme.spacings.mega};

Check warning on line 104 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.kilo}' with 'var(--cui-spacings-kilo)'

Check warning on line 104 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.mega}' with 'var(--cui-spacings-mega)'

Check warning on line 104 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.kilo}' with 'var(--cui-spacings-kilo)'

Check warning on line 104 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.mega}' with 'var(--cui-spacings-mega)'
transition: border-color ${theme.transitions.default};

Check warning on line 105 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.transitions.default}' with 'var(--cui-transitions-default)'

Check warning on line 105 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.transitions.default}' with 'var(--cui-transitions-default)'
width: 100%;
${typography('one')(theme)};

&.DateRangePickerInput__withBorder,
&.SingleDatePickerInput__withBorder {
border: none;
border-radius: ${theme.borderRadius.byte};

Check warning on line 112 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.borderRadius.byte}' with 'var(--cui-border-radius-byte)'

Check warning on line 112 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.borderRadius.byte}' with 'var(--cui-border-radius-byte)'
transition: box-shadow ${theme.transitions.default};

Check warning on line 113 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.transitions.default}' with 'var(--cui-transitions-default)'

Check warning on line 113 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.transitions.default}' with 'var(--cui-transitions-default)'
box-shadow: 0 0 0 1px var(--cui-border-strong);

&:hover {
Expand All @@ -129,8 +131,8 @@
}

.DateRangePickerInput_arrow {
margin: 0 ${theme.spacings.kilo};

Check warning on line 134 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.kilo}' with 'var(--cui-spacings-kilo)'

Check warning on line 134 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.kilo}' with 'var(--cui-spacings-kilo)'
width: ${theme.spacings.giga};

Check warning on line 135 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (16)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.giga}' with 'var(--cui-spacings-giga)'

Check warning on line 135 in packages/circuit-ui/components/Calendar/components/CalendarWrapper/CalendarWrapper.tsx

View workflow job for this annotation

GitHub Actions / ci (18)

Use CSS custom properties instead of the Emotion.js theme. Replace '${theme.spacings.giga}' with 'var(--cui-spacings-giga)'
height: ${theme.spacings.giga};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { Component, createRef } from 'react';
import { css } from '@emotion/react';
import type { Moment } from 'moment';
Expand Down
2 changes: 2 additions & 0 deletions packages/circuit-ui/components/Grid/Col/Col.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';
import { Theme } from '@sumup/design-tokens';

Expand Down
2 changes: 2 additions & 0 deletions packages/circuit-ui/components/Grid/Grid/Grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';
import { Theme } from '@sumup/design-tokens';

Expand Down
2 changes: 2 additions & 0 deletions packages/circuit-ui/components/Grid/Row/Row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';
import { Theme } from '@sumup/design-tokens';

Expand Down
2 changes: 2 additions & 0 deletions packages/circuit-ui/components/Grid/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import type { Theme } from '@sumup/design-tokens';
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';

import styled from '../../styles/styled.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { Children, ReactElement } from 'react';
import { css } from '@emotion/react';

Expand Down
39 changes: 17 additions & 22 deletions packages/circuit-ui/components/List/List.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

import { Fragment } from 'react';

import Body from '../Body/index.js';
import { spacing } from '../../styles/style-mixins.js';
import { Stack } from '../../../../.storybook/components/index.js';

import { List, ListProps } from './List.js';

Expand All @@ -40,31 +39,27 @@ export const Base = (args: ListProps) => (

const variants: ListProps['variant'][] = ['unordered', 'ordered'];

export const Variants = (args: ListProps) =>
variants.map((variant) => (
<List
key={variant}
{...args}
variant={variant}
css={spacing({ bottom: 'giga' })}
>
<ListItems />
</List>
));
export const Variants = (args: ListProps) => (
<Stack vertical>
{variants.map((variant) => (
<List key={variant} {...args} variant={variant}>
<ListItems />
</List>
))}
</Stack>
);

const sizes: ListProps['size'][] = ['one', 'two'];

export const Sizes = (args: ListProps) =>
sizes.map((size) => (
<>
<Body size={size} css={spacing({ bottom: 'mega' })}>
Use List size {size} with Body {size} text.
</Body>
<List key={size} {...args} size={size} css={spacing({ bottom: 'giga' })}>
export const Sizes = (args: ListProps) => (
<Stack vertical>
{sizes.map((size) => (
<List key={size} {...args} size={size}>
<ListItems />
</List>
</>
));
))}
</Stack>
);

export const Nested = (args: ListProps) => (
<List {...args}>
Expand Down
12 changes: 5 additions & 7 deletions packages/circuit-ui/components/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* limitations under the License.
*/

/* eslint-disable react/display-name */
import { Fragment } from 'react';

import { Stack } from '../../../../.storybook/components/index.js';
Expand All @@ -22,7 +21,6 @@ import Headline from '../Headline/index.js';
import Body from '../Body/index.js';
import Image from '../Image/index.js';
import { ModalProvider } from '../ModalContext/index.js';
import { spacing } from '../../styles/style-mixins.js';

import { Modal, ModalProps, useModal } from './Modal.js';

Expand All @@ -34,7 +32,7 @@ export default {

const defaultModalChildren = () => (
<Fragment>
<Headline as="h2" size="four" css={spacing({ bottom: 'giga' })}>
<Headline as="h2" size="four" style={{ marginBottom: '1rem' }}>
Hello World!
</Headline>
<Body>I am a modal.</Body>
Expand Down Expand Up @@ -109,10 +107,10 @@ export const PreventClose = (modal: ModalProps): JSX.Element => {
PreventClose.args = {
children: ({ onClose }: { onClose: ModalProps['onClose'] }) => (
<Fragment>
<Headline as="h2" size="four" css={spacing({ bottom: 'giga' })}>
<Headline as="h2" size="four" style={{ marginBottom: '1rem' }}>
Complete the action
</Headline>
<Body css={spacing({ bottom: 'giga' })}>
<Body style={{ marginBottom: '1rem' }}>
Users have to complete the action inside the modal to close it. The
close button is hidden and clicking outside the modal or pressing the
escape key does not close the modal either.
Expand Down Expand Up @@ -169,10 +167,10 @@ CustomStyles.args = {
borderTopRightRadius: 'var(--cui-border-radius-mega)',
}}
/>
<Headline as="h2" size="four" css={spacing('giga')}>
<Headline as="h2" size="four" style={{ margin: '1rem' }}>
Custom styles
</Headline>
<Body css={spacing('giga')}>
<Body style={{ margin: '1rem' }}>
Custom styles can be applied using the <code>css</code> prop.
</Body>
</Fragment>
Expand Down
19 changes: 9 additions & 10 deletions packages/circuit-ui/components/SidePanel/SidePanel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { TopNavigation } from '../TopNavigation/index.js';
import { baseArgs as topNavigationProps } from '../TopNavigation/TopNavigation.stories.js';
import { SideNavigation } from '../SideNavigation/index.js';
import { baseArgs as sideNavigationProps } from '../SideNavigation/SideNavigation.stories.js';
import { spacing } from '../../styles/style-mixins.js';

import { SidePanelProvider } from './SidePanelContext.js';
import {
Expand Down Expand Up @@ -69,7 +68,7 @@ const basePlay = ({ canvasElement }: { canvasElement: HTMLCanvasElement }) => {
};

const StoryInstructions = () => (
<Body css={spacing('mega')}>
<Body style={{ margin: '1rem' }}>
Select an item to open its details in a side panel. When this story is
viewed in canvas mode we simulate a selection of the third item.
</Body>
Expand Down Expand Up @@ -98,12 +97,12 @@ const DefaultChildren = ({

return (
<>
<Body css={spacing({ bottom: 'mega' })}>
<Body style={{ marginBottom: '1rem' }}>
{showMoreInfo
? `These are the details of ${label}.`
: `This is more information about ${label}.`}
</Body>
<Body css={spacing({ bottom: 'mega' })}>
<Body style={{ marginBottom: '1rem' }}>
{
'Lorem ipsum dolor amet swag pickled humblebrag retro farm-to-table, shoreditch typewriter deep v single-origin coffee green juice coloring book venmo chambray. Marfa authentic blue bottle mixtape tofu adaptogen. IPhone chia blog palo santo mlkshk tattooed jean shorts yr locavore ennui scenester. Wolf tousled pok pok sartorial scenester man bun salvia quinoa raclette sriracha roof party pour-over venmo hammock. Four dollar toast typewriter 3 wolf moon letterpress disrupt pabst. Neutra irony tousled iPhone banh mi wayfarers hoodie waistcoat.'
}
Expand All @@ -127,7 +126,7 @@ const DefaultChildren = ({
headline: 'More information',
})
}
css={spacing({ bottom: 'mega' })}
style={{ marginBottom: '1rem' }}
>
Show more
</Button>
Expand All @@ -140,7 +139,7 @@ const DefaultChildren = ({
variant="tertiary"
size="kilo"
onClick={onBack}
css={spacing({ bottom: 'mega' })}
style={{ marginBottom: '1rem' }}
>
Back
</Button>
Expand All @@ -150,7 +149,7 @@ const DefaultChildren = ({
variant="tertiary"
size="kilo"
onClick={onClose}
css={spacing({ left: 'mega', bottom: 'mega' })}
style={{ marginBottom: '1rem', marginLeft: '1rem' }}
>
Close
</Button>
Expand Down Expand Up @@ -182,7 +181,7 @@ const ComponentWithSidePanel = (props: SidePanelHookProps) => {
}))}
label="List of items with details in a side panel"
hideLabel
css={spacing('mega')}
style={{ margin: '1rem' }}
/>
);
};
Expand Down Expand Up @@ -216,7 +215,7 @@ export const WithTopNavigation = (props: SidePanelHookProps): JSX.Element => {
onClose={() => setSideNavigationOpen(false)}
/>
<div style={{ flex: '1' }}>
<SidePanelProvider withTopNavigation>
<SidePanelProvider>
<StoryInstructions />
<ComponentWithSidePanel {...props} />
</SidePanelProvider>
Expand Down Expand Up @@ -279,7 +278,7 @@ const ComponentWithSidePanelExtended = (props: SidePanelHookProps) => {
}))}
label="List of items with details in a side panel"
hideLabel
css={spacing('mega')}
style={{ margin: '1rem' }}
/>
);
};
Expand Down
2 changes: 2 additions & 0 deletions packages/circuit-ui/components/Sidebar/Sidebar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { useState } from 'react';
import { css } from '@emotion/react';
import { Home, Profile, Sales, Shop } from '@sumup/icons';
Expand Down
2 changes: 2 additions & 0 deletions packages/circuit-ui/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { Fragment, ReactNode } from 'react';
import { css } from '@emotion/react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { useState, useEffect, ReactElement } from 'react';
import { css } from '@emotion/react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { HTMLAttributes } from 'react';
import { css } from '@emotion/react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';

import styled, { StyleProps } from '../../../../styles/styled.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';

import styled, { StyleProps } from '../../../../styles/styled.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';

import styled, { StyleProps } from '../../../../styles/styled.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { ReactElement } from 'react';
import { css } from '@emotion/react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { HTMLAttributes } from 'react';
import { css } from '@emotion/react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { HTMLAttributes } from 'react';
import { css } from '@emotion/react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';
import { Theme } from '@sumup/design-tokens';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { HTMLAttributes } from 'react';
import { css } from '@emotion/react';

Expand Down
2 changes: 2 additions & 0 deletions packages/circuit-ui/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';

import styled from '../../styles/styled.js';
Expand Down
Loading
Loading