Skip to content

Commit

Permalink
Improve tree-shaking using the verbatimModuleSyntax flag (#2493)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer authored Apr 16, 2024
1 parent 35ee26a commit 60a1f3b
Show file tree
Hide file tree
Showing 111 changed files with 265 additions and 236 deletions.
10 changes: 5 additions & 5 deletions packages/circuit-ui/components/Anchor/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@

import {
forwardRef,
AnchorHTMLAttributes,
ButtonHTMLAttributes,
ReactNode,
Ref,
type AnchorHTMLAttributes,
type ButtonHTMLAttributes,
type ReactNode,
type Ref,
} from 'react';

import type { ReturnType } from '../../types/return-type.js';
import type { ClickEvent } from '../../types/events.js';
import type { AsPropType } from '../../types/prop-types.js';
import { Body, BodyProps } from '../Body/Body.js';
import { Body, type BodyProps } from '../Body/Body.js';
import { useComponents } from '../ComponentsContext/index.js';
import { clsx } from '../../styles/clsx.js';
import utilityClasses from '../../styles/utility.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/circuit-ui/components/AspectRatio/AspectRatio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
Children,
forwardRef,
cloneElement,
ReactElement,
HTMLAttributes,
type ReactElement,
type HTMLAttributes,
} from 'react';

import { clsx } from '../../styles/clsx.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { ImgHTMLAttributes } from 'react';
import type { ImgHTMLAttributes } from 'react';
import { Profile, Image as ImageIcon } from '@sumup/icons';

import { CircuitError } from '../../util/errors.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { HTMLAttributes, forwardRef } from 'react';
import { forwardRef, type HTMLAttributes } from 'react';

import type { AsPropType } from '../../types/prop-types.js';
import { clsx } from '../../styles/clsx.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Body/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { forwardRef, HTMLAttributes } from 'react';
import { forwardRef, type HTMLAttributes } from 'react';

import type { AsPropType } from '../../types/prop-types.js';
import { clsx } from '../../styles/clsx.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/BodyLarge/BodyLarge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { forwardRef, HTMLAttributes, Ref } from 'react';
import { forwardRef, type HTMLAttributes, type Ref } from 'react';

import type { AsPropType } from '../../types/prop-types.js';
import { clsx } from '../../styles/clsx.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import { deprecate } from '../../util/logger.js';

import classes from './Button.module.css';
import {
SharedButtonProps,
createButtonComponent,
legacyButtonSizeMap,
type SharedButtonProps,
} from './base.js';

export type ButtonProps = SharedButtonProps & {
Expand Down
4 changes: 2 additions & 2 deletions packages/circuit-ui/components/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* limitations under the License.
*/

import { forwardRef, HTMLAttributes } from 'react';
import { forwardRef, type HTMLAttributes } from 'react';

import Button, { ButtonProps } from '../Button/index.js';
import Button, { type ButtonProps } from '../Button/index.js';
import { clsx } from '../../styles/clsx.js';
import { deprecate } from '../../util/logger.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { HTMLAttributes, forwardRef } from 'react';
import { forwardRef, type HTMLAttributes } from 'react';

import { clsx } from '../../styles/clsx.js';
import type { AsPropType } from '../../types/prop-types.js';
Expand Down
16 changes: 1 addition & 15 deletions packages/circuit-ui/components/Card/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,7 @@
* limitations under the License.
*/

/**
* Copyright 2019, SumUp Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { HTMLAttributes, forwardRef } from 'react';
import { forwardRef, type HTMLAttributes } from 'react';

import { clsx } from '../../../../styles/clsx.js';
import type { AsPropType } from '../../../../types/prop-types.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

'use client';

import { ReactNode, HTMLAttributes, forwardRef } from 'react';
import { forwardRef, type ReactNode, type HTMLAttributes } from 'react';

import type { ClickEvent } from '../../../../types/events.js';
import CloseButton from '../../../CloseButton/index.js';
Expand Down
6 changes: 3 additions & 3 deletions packages/circuit-ui/components/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

'use client';

import { ReactNode, useRef, useState } from 'react';
import { useRef, useState, type ReactNode } from 'react';

import ProgressBar from '../ProgressBar/index.js';
import Step from '../Step/index.js';
import { useComponentSize } from '../../hooks/useComponentSize/index.js';
import { ImageProps } from '../Image/index.js';
import type { ImageProps } from '../Image/index.js';
import { isFunction } from '../../util/type-check.js';
import { Actions, State } from '../Step/types.js';
import type { Actions, State } from '../Step/types.js';

import { Container } from './components/Container/index.js';
import { Slides } from './components/Slides/index.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
* limitations under the License.
*/

import { HTMLAttributes } from 'react';
import type { HTMLAttributes } from 'react';
import { ChevronLeft, ChevronRight, Pause, Play } from '@sumup/icons';

import { IconButton, IconButtonProps } from '../../../Button/index.js';
import { IconButton, type IconButtonProps } from '../../../Button/index.js';
import { clsx } from '../../../../styles/clsx.js';

import classes from './Buttons.module.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { HTMLAttributes, forwardRef } from 'react';
import { forwardRef, type HTMLAttributes } from 'react';

import { clsx } from '../../../../styles/clsx.js';

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

import Body, { BodyProps } from '../../../Body/index.js';
import Body, { type BodyProps } from '../../../Body/index.js';
import { clsx } from '../../../../styles/clsx.js';

import classes from './Status.module.css';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
'use client';

import {
InputHTMLAttributes,
forwardRef,
useEffect,
useId,
useRef,
type InputHTMLAttributes,
} from 'react';
import { Checkmark } from '@sumup/icons';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
'use client';

import {
FieldsetHTMLAttributes,
InputHTMLAttributes,
Ref,
forwardRef,
useId,
type FieldsetHTMLAttributes,
type InputHTMLAttributes,
type Ref,
} from 'react';

import { Checkbox, CheckboxProps } from '../Checkbox/Checkbox.js';
import { Checkbox, type CheckboxProps } from '../Checkbox/Checkbox.js';
import {
FieldLabelText,
FieldValidationHint,
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/CloseButton/CloseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { forwardRef } from 'react';
import { Close } from '@sumup/icons';

import { IconButton, IconButtonProps } from '../Button/IconButton.js';
import { IconButton, type IconButtonProps } from '../Button/IconButton.js';

export type CloseButtonProps = Omit<IconButtonProps, 'icon'>;

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

import { ComponentType, createContext } from 'react';
import { createContext, type ComponentType } from 'react';

import { Link, LinkProps } from './components/Link/index.js';
import { Link, type LinkProps } from './components/Link/index.js';

export const defaultComponents = { Link };

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

import { forwardRef, AnchorHTMLAttributes, Ref } from 'react';
import { forwardRef, type AnchorHTMLAttributes, type Ref } from 'react';

export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
ref?: Ref<HTMLAnchorElement>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import { useContext } from 'react';

import {
ComponentsContext,
ComponentsContextType,
defaultComponents,
ComponentsContext,
type ComponentsContextType,
} from './ComponentsContext.js';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import { forwardRef, useId } from 'react';
import { resolveCurrencyFormat } from '@sumup/intl';
import { NumericFormat, NumericFormatProps } from 'react-number-format';
import { NumericFormat, type NumericFormatProps } from 'react-number-format';

import { clsx } from '../../styles/clsx.js';
import Input, { InputElement, InputProps } from '../Input/index.js';
import Input, { type InputElement, type InputProps } from '../Input/index.js';

import { formatPlaceholder } from './CurrencyInputService.js';
import classes from './CurrencyInput.module.css';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/DateInput/DateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { forwardRef, useState, useEffect } from 'react';
import { PatternFormat } from 'react-number-format';

import Input, { InputElement, InputProps } from '../Input/index.js';
import Input, { type InputElement, type InputProps } from '../Input/index.js';
import { clsx } from '../../styles/clsx.js';

import classes from './DateInput.module.css';
Expand Down
6 changes: 3 additions & 3 deletions packages/circuit-ui/components/Field/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
*/

import {
FieldsetHTMLAttributes,
HTMLAttributes,
LabelHTMLAttributes,
forwardRef,
type FieldsetHTMLAttributes,
type HTMLAttributes,
type LabelHTMLAttributes,
} from 'react';
import { Confirm, Notify, Alert } from '@sumup/icons';

Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Hamburger/Hamburger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { forwardRef } from 'react';

import { legacyButtonSizeMap } from '../Button/index.js';
import { IconButton, IconButtonProps } from '../Button/IconButton.js';
import { IconButton, type IconButtonProps } from '../Button/IconButton.js';
import { Skeleton } from '../Skeleton/index.js';
import {
AccessibilityError,
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Headline/Headline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { HTMLAttributes, forwardRef } from 'react';
import { forwardRef, type HTMLAttributes } from 'react';

import { clsx } from '../../styles/clsx.js';
import { CircuitError } from '../../util/errors.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Hr/Hr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { HTMLAttributes, forwardRef } from 'react';
import { forwardRef, type HTMLAttributes } from 'react';

import type { AsPropType } from '../../types/prop-types.js';
import { clsx } from '../../styles/clsx.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { ImgHTMLAttributes, forwardRef } from 'react';
import { forwardRef, type ImgHTMLAttributes } from 'react';

import { clsx } from '../../styles/clsx.js';

Expand Down
12 changes: 6 additions & 6 deletions packages/circuit-ui/components/ImageInput/ImageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
import {
useState,
useRef,
InputHTMLAttributes,
ChangeEvent,
ClipboardEvent,
DragEvent,
useId,
ComponentType,
type InputHTMLAttributes,
type ChangeEvent,
type ClipboardEvent,
type DragEvent,
type ComponentType,
} from 'react';
import { Delete, Plus } from '@sumup/icons';

import { ClickEvent } from '../../types/events.js';
import type { ClickEvent } from '../../types/events.js';
import utilityClasses from '../../styles/utility.js';
import {
FieldWrapper,
Expand Down
8 changes: 4 additions & 4 deletions packages/circuit-ui/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
'use client';

import {
ComponentType,
forwardRef,
InputHTMLAttributes,
TextareaHTMLAttributes,
useId,
type ComponentType,
type InputHTMLAttributes,
type TextareaHTMLAttributes,
} from 'react';

import {
Expand All @@ -29,7 +29,7 @@ import {
FieldLabelText,
FieldValidationHint,
} from '../Field/index.js';
import { ReturnType } from '../../types/return-type.js';
import type { ReturnType } from '../../types/return-type.js';
import {
AccessibilityError,
isSufficientlyLabelled,
Expand Down
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

import { forwardRef, OlHTMLAttributes } from 'react';
import { forwardRef, type OlHTMLAttributes } from 'react';

import { clsx } from '../../styles/clsx.js';

Expand Down
Loading

0 comments on commit 60a1f3b

Please sign in to comment.