From f0c842abc864d0ad21830aae6160ff6567cd5090 Mon Sep 17 00:00:00 2001 From: koji Date: Mon, 23 Dec 2024 18:52:18 -0500 Subject: [PATCH] chore(components): clean up react imports clean up react imports close AUTH-1201 --- components/src/alerts/AlertItem.tsx | 6 ++--- .../Checkbox/__tests__/Checkbox.test.tsx | 7 +++--- components/src/atoms/Checkbox/index.tsx | 5 ++-- .../__tests__/CheckboxField.test.tsx | 7 +++--- components/src/atoms/CheckboxField/index.tsx | 9 +++---- .../src/atoms/Chip/__tests__/Chip.test.tsx | 9 +++---- components/src/atoms/Divider/index.tsx | 5 ++-- .../InputField/__tests__/InputField.test.tsx | 7 +++--- components/src/atoms/InputField/index.tsx | 3 ++- .../ListButtonAccordion.tsx | 5 ++-- .../ListButtonAccordionContainer.tsx | 5 ++-- .../ListButton/__tests__/ListButton.test.tsx | 7 +++--- .../__tests__/ListButtonAccordion.test.tsx | 7 +++--- .../__tests__/ListButtonRadioButton.test.tsx | 7 +++--- components/src/atoms/ListButton/index.tsx | 5 ++-- .../ListItem/__tests__/ListItem.test.tsx | 7 +++--- components/src/atoms/ListItem/index.tsx | 5 ++-- components/src/atoms/MenuList/OverflowBtn.tsx | 12 ++++++---- .../MenuList/__tests__/MenuItem.test.tsx | 7 +++--- .../MenuList/__tests__/MenuList.test.tsx | 7 +++--- .../MenuList/__tests__/OverflowBtn.test.tsx | 5 ++-- components/src/atoms/MenuList/index.tsx | 8 +++---- .../Snackbar/__tests__/Snackbar.test.tsx | 7 +++--- .../src/atoms/StyledText/LegacyStyledText.tsx | 6 ++--- .../src/atoms/StyledText/StyledText.tsx | 6 ++--- .../src/atoms/Tag/__tests__/Tag.test.tsx | 7 +++--- .../atoms/Toast/__tests__/ODDToast.test.tsx | 7 +++--- .../src/atoms/Toast/__tests__/Toast.test.tsx | 7 +++--- .../__tests__/ToggleGroup.test.tsx | 7 +++--- .../atoms/Tooltip/__tests__/Tooltip.test.tsx | 9 +++---- components/src/atoms/Tooltip/index.tsx | 5 ++-- components/src/atoms/buttons/LargeButton.tsx | 4 ++-- components/src/atoms/buttons/RadioButton.tsx | 9 +++---- .../__tests__/AlertPrimaryButton.test.tsx | 7 +++--- .../__tests__/AltPrimaryButton.test.tsx | 7 +++--- .../__tests__/EmptySelectorButton.test.tsx | 7 +++--- .../buttons/__tests__/LargeButton.test.tsx | 7 +++--- .../buttons/__tests__/PrimaryButton.test.tsx | 7 +++--- .../buttons/__tests__/RadioButton.test.tsx | 7 +++--- .../__tests__/SecondaryButton.test.tsx | 7 +++--- components/src/buttons/Button.tsx | 8 +++---- components/src/controls/ControlInfo.tsx | 6 ++--- components/src/controls/LabeledButton.tsx | 4 ++-- components/src/controls/LabeledCheckbox.tsx | 7 +++--- components/src/controls/LabeledControl.tsx | 8 +++---- components/src/controls/LabeledRadioGroup.tsx | 5 ++-- components/src/controls/LabeledToggle.tsx | 6 ++--- .../src/controls/StackedLabeledControl.tsx | 8 +++---- .../src/forms/DeprecatedCheckboxField.tsx | 7 +++--- components/src/forms/FormGroup.tsx | 5 ++-- components/src/forms/LegacyInputField.tsx | 18 +++++++++----- components/src/forms/RadioGroup.tsx | 9 +++---- components/src/forms/SelectField.tsx | 6 ++--- components/src/forms/ToggleField.tsx | 5 ++-- .../BaseDeck/SingleSlotFixture.tsx | 9 ++++--- .../src/hardware-sim/BaseDeck/SlotBase.tsx | 4 ++-- .../src/hardware-sim/BaseDeck/SlotClip.tsx | 6 ++--- .../BaseDeck/StagingAreaFixture.tsx | 9 ++++--- .../BaseDeck/WasteChuteFixture.tsx | 8 +++---- .../BaseDeck/WasteChuteStagingAreaFixture.tsx | 10 ++++---- .../hardware-sim/Deck/MoveLabwareOnDeck.tsx | 18 +++++++------- .../Deck/RobotCoordsForeignDiv.tsx | 7 +++--- .../Deck/RobotCoordsForeignObject.tsx | 9 +++---- .../src/hardware-sim/Deck/RobotCoordsText.tsx | 7 +++--- .../hardware-sim/DeckConfigurator/index.tsx | 5 ++-- .../hardware-sim/DeckSlotLocation/index.tsx | 8 +++---- .../src/hardware-sim/Labware/Labware.tsx | 12 ++++++---- .../hardware-sim/Labware/LabwareRender.tsx | 5 ++-- .../Labware/LabwareStackRender.tsx | 5 ++-- .../Labware/labwareInternals/FilledWells.tsx | 12 ++++++---- .../labwareInternals/LabwareOutline.tsx | 4 ++-- .../labwareInternals/LabwareWellLabels.tsx | 9 +++---- .../labwareInternals/StaticLabware.tsx | 13 +++++----- .../Labware/labwareInternals/StrokedWells.tsx | 14 ++++++----- .../Labware/labwareInternals/StyledWells.tsx | 14 ++++++----- .../Labware/labwareInternals/Well.tsx | 21 ++++++++-------- .../Labware/labwareInternals/WellLabels.tsx | 10 ++++---- .../Labware/labwareInternals/types.ts | 4 ++-- .../src/hardware-sim/Module/ModuleTag.tsx | 5 ++-- components/src/hardware-sim/Module/index.tsx | 20 +++++++--------- .../Pipette/__tests__/PipetteRender.test.tsx | 6 ++--- .../hardware-sim/ProtocolDeck/LabwareInfo.tsx | 5 ++-- .../src/hardware-sim/ProtocolDeck/index.tsx | 5 ++-- .../RobotCoordinateSpace.tsx | 5 ++-- .../RobotCoordinateSpaceWithRef.tsx | 5 ++-- components/src/hooks/useDrag.ts | 2 +- components/src/hooks/useInterval.ts | 5 ++-- components/src/icons/Icon.tsx | 4 ++-- components/src/instrument/InstrumentInfo.tsx | 5 ++-- .../__tests__/InstrumentInfo.test.tsx | 7 +++--- .../src/interaction-enhancers/ClickOutside.ts | 7 +++--- .../interaction-enhancers/HandleKeypress.tsx | 8 ++++--- components/src/lists/SidePanelGroup.tsx | 4 ++-- components/src/lists/TitledList.tsx | 24 +++++++++---------- components/src/modals/AlertModal.tsx | 6 ++--- components/src/modals/LegacyModal.tsx | 12 ++++++---- components/src/modals/Modal.tsx | 11 +++++---- components/src/modals/ModalHeader.tsx | 9 +++---- components/src/modals/ModalShell.tsx | 14 +++++------ components/src/modals/Overlay.tsx | 7 +++--- components/src/modals/SpinnerModalPage.tsx | 5 ++-- .../src/modals/__tests__/Modal.test.tsx | 7 +++--- .../src/modals/__tests__/ModalHeader.test.tsx | 7 +++--- .../src/modals/__tests__/ModalShell.test.tsx | 7 +++--- .../Banner/__tests__/Banner.test.tsx | 7 +++--- components/src/molecules/Banner/index.tsx | 11 +++++---- .../__tests__/DeckInfoLabel.test.tsx | 7 +++--- .../DeckLabel/__tests__/DeckLabel.test.tsx | 6 +++-- .../__tests__/DropdownMenu.test.tsx | 7 +++--- .../src/molecules/DropdownMenu/index.tsx | 22 +++++++++-------- .../InfoScreen/__tests__/InfoScreen.test.tsx | 7 +++--- .../LiquidIcon/__tests__/LiquidIcon.test.tsx | 7 +++--- .../__tests__/ParametersTable.test.tsx | 6 ++--- .../molecules/Tabs/__tests__/Tabs.test.tsx | 7 +++--- components/src/nav/SidePanel.tsx | 5 ++-- .../__tests__/DeckLabelSet.test.tsx | 7 +++--- .../src/organisms/DeckLabelSet/index.tsx | 7 +++--- .../Toolbox/__tests__/Toolbox.test.tsx | 7 +++--- components/src/organisms/Toolbox/index.tsx | 4 +++- components/src/primitives/Btn.tsx | 4 +++- components/src/primitives/ForeignObject.tsx | 5 ++-- components/src/primitives/Link.tsx | 5 ++-- components/src/primitives/Svg.tsx | 3 ++- components/src/primitives/style-props.ts | 4 +++- components/src/primitives/types.ts | 4 ++-- components/src/structure/Card.tsx | 7 +++--- components/src/structure/LabeledValue.tsx | 8 +++---- components/src/structure/Pill.tsx | 4 ++-- components/src/structure/TitleBar.tsx | 9 ++++--- .../src/testing/utils/renderWithProviders.tsx | 14 +++++++---- components/src/tooltips/DeprecatedTooltip.tsx | 18 +++++++++----- components/src/tooltips/HoverTooltip.tsx | 7 +++--- components/src/tooltips/LegacyTooltip.tsx | 14 +++++------ components/src/tooltips/types.ts | 8 +++---- 134 files changed, 561 insertions(+), 465 deletions(-) diff --git a/components/src/alerts/AlertItem.tsx b/components/src/alerts/AlertItem.tsx index 708f44f746c..4ef5eb04a8c 100644 --- a/components/src/alerts/AlertItem.tsx +++ b/components/src/alerts/AlertItem.tsx @@ -1,9 +1,9 @@ -import type * as React from 'react' import cx from 'classnames' import { Icon } from '../icons' import { IconButton } from '../buttons' import styles from './alerts.module.css' +import type { ReactNode } from 'react' import type { IconProps } from '../icons' export type AlertType = 'success' | 'warning' | 'error' | 'info' @@ -12,9 +12,9 @@ export interface AlertItemProps { /** name constant of the icon to display */ type: AlertType /** title/main message of colored alert bar */ - title: React.ReactNode + title: ReactNode /** Alert message body contents */ - children?: React.ReactNode + children?: ReactNode /** Additional class name */ className?: string /** optional handler to show close button/clear alert */ diff --git a/components/src/atoms/Checkbox/__tests__/Checkbox.test.tsx b/components/src/atoms/Checkbox/__tests__/Checkbox.test.tsx index cfee4c22835..1bc8265ad4f 100644 --- a/components/src/atoms/Checkbox/__tests__/Checkbox.test.tsx +++ b/components/src/atoms/Checkbox/__tests__/Checkbox.test.tsx @@ -1,16 +1,17 @@ -import type * as React from 'react' import { describe, beforeEach, afterEach, vi, expect, it } from 'vitest' import { fireEvent, screen } from '@testing-library/react' import '@testing-library/jest-dom/vitest' import { renderWithProviders } from '../../../testing/utils' import { Checkbox } from '..' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('Checkbox', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/Checkbox/index.tsx b/components/src/atoms/Checkbox/index.tsx index f4ae61dee1f..c5763665351 100644 --- a/components/src/atoms/Checkbox/index.tsx +++ b/components/src/atoms/Checkbox/index.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { css } from 'styled-components' import { COLORS, BORDERS } from '../../helix-design-system' import { Flex } from '../../primitives' @@ -14,13 +13,15 @@ import { import { RESPONSIVENESS, SPACING } from '../../ui-style-constants' import { StyledText } from '../StyledText' +import type { MouseEventHandler } from 'react' + export interface CheckboxProps { /** checkbox is checked if value is true */ isChecked: boolean /** label text that describes the option */ labelText: string /** callback click/tap handler */ - onClick: React.MouseEventHandler + onClick: MouseEventHandler /** html tabindex property */ tabIndex?: number /** if disabled is true, mouse events will not trigger onClick callback */ diff --git a/components/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx b/components/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx index 06fc3153d9e..b3b0e561711 100644 --- a/components/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx +++ b/components/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, beforeEach, afterEach, vi, expect, it } from 'vitest' import { fireEvent, screen } from '@testing-library/react' import '@testing-library/jest-dom/vitest' @@ -8,12 +7,14 @@ import { BORDERS, COLORS } from '../../../helix-design-system' import { TYPOGRAPHY, SPACING } from '../../../ui-style-constants' import { CheckboxField } from '..' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('CheckboxField', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/CheckboxField/index.tsx b/components/src/atoms/CheckboxField/index.tsx index 9f02ef52bc0..1be78e36c1a 100644 --- a/components/src/atoms/CheckboxField/index.tsx +++ b/components/src/atoms/CheckboxField/index.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { css } from 'styled-components' import { SPACING, TYPOGRAPHY } from '../../ui-style-constants' import { COLORS, BORDERS } from '../../helix-design-system' @@ -11,21 +10,23 @@ import { JUSTIFY_CENTER, } from '../../styles' +import type { ChangeEventHandler, ComponentProps, ReactNode } from 'react' + export interface CheckboxFieldProps { /** change handler */ - onChange: React.ChangeEventHandler + onChange: ChangeEventHandler /** checkbox is checked if value is true */ value?: boolean /** name of field in form */ name?: string /** label text for checkbox */ - label?: React.ReactNode + label?: ReactNode /** checkbox is disabled if value is true */ disabled?: boolean /** html tabindex property */ tabIndex?: number /** props passed into label div. TODO IMMEDIATELY what is the Flow type? */ - labelProps?: React.ComponentProps<'div'> + labelProps?: ComponentProps<'div'> /** if true, render indeterminate icon */ isIndeterminate?: boolean } diff --git a/components/src/atoms/Chip/__tests__/Chip.test.tsx b/components/src/atoms/Chip/__tests__/Chip.test.tsx index 65de215160f..9fb190e665b 100644 --- a/components/src/atoms/Chip/__tests__/Chip.test.tsx +++ b/components/src/atoms/Chip/__tests__/Chip.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, expect, beforeEach } from 'vitest' import { screen } from '@testing-library/react' import { BORDERS, COLORS } from '../../../helix-design-system' @@ -6,12 +5,14 @@ import { SPACING } from '../../../ui-style-constants' import { renderWithProviders } from '../../../testing/utils' import { Chip } from '..' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders() } describe('Chip Touchscreen', () => { - let props: React.ComponentProps + let props: ComponentProps it('should render text, icon, bgcolor with success colors', () => { props = { @@ -214,7 +215,7 @@ describe('Chip Touchscreen', () => { }) describe('Chip Web', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { Object.defineProperty(window, 'innerWidth', { diff --git a/components/src/atoms/Divider/index.tsx b/components/src/atoms/Divider/index.tsx index 7de6a3757f4..df9a9e9af07 100644 --- a/components/src/atoms/Divider/index.tsx +++ b/components/src/atoms/Divider/index.tsx @@ -1,7 +1,8 @@ -import type * as React from 'react' import { Box, COLORS, SPACING } from '../..' -type Props = React.ComponentProps +import type { ComponentProps } from 'react' + +type Props = ComponentProps export function Divider(props: Props): JSX.Element { return ( diff --git a/components/src/atoms/InputField/__tests__/InputField.test.tsx b/components/src/atoms/InputField/__tests__/InputField.test.tsx index f53d4f4163a..87b3e752272 100644 --- a/components/src/atoms/InputField/__tests__/InputField.test.tsx +++ b/components/src/atoms/InputField/__tests__/InputField.test.tsx @@ -1,15 +1,16 @@ -import type * as React from 'react' import { describe, it, vi, beforeEach, expect } from 'vitest' import { screen, fireEvent } from '@testing-library/react' import { renderWithProviders } from '../../../testing/utils' import { InputField } from '..' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('HeaterShakerSlideout', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { type: 'number', diff --git a/components/src/atoms/InputField/index.tsx b/components/src/atoms/InputField/index.tsx index 001374f71ce..2064bac4d75 100644 --- a/components/src/atoms/InputField/index.tsx +++ b/components/src/atoms/InputField/index.tsx @@ -20,6 +20,7 @@ import type { ChangeEventHandler, FocusEvent, MouseEvent, + MutableRefObject, ReactNode, } from 'react' import type { IconName } from '../../icons' @@ -81,7 +82,7 @@ export interface InputFieldProps { /** small or medium input field height, relevant only */ size?: 'medium' | 'small' /** react useRef to control input field instead of react event */ - ref?: React.MutableRefObject + ref?: MutableRefObject /** optional IconName to display icon aligned to left of input field */ leftIcon?: IconName /** if true, show delete icon aligned to right of input field */ diff --git a/components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordion.tsx b/components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordion.tsx index 04c42ba654b..2d874f61c99 100644 --- a/components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordion.tsx +++ b/components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordion.tsx @@ -1,11 +1,12 @@ -import type * as React from 'react' import { Flex } from '../../../primitives' import { DIRECTION_COLUMN } from '../../../styles' import { SPACING } from '../../../ui-style-constants' import { StyledText } from '../../StyledText' +import type { ReactNode } from 'react' + interface ListButtonAccordionProps { - children: React.ReactNode + children: ReactNode // determines if the accordion is expanded or not isExpanded?: boolean // is it nested into another accordion? diff --git a/components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordionContainer.tsx b/components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordionContainer.tsx index 85f76f901b2..d0e8f19821f 100644 --- a/components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordionContainer.tsx +++ b/components/src/atoms/ListButton/ListButtonChildren/ListButtonAccordionContainer.tsx @@ -1,9 +1,10 @@ -import type * as React from 'react' import { Flex } from '../../../primitives' import { DIRECTION_COLUMN } from '../../../styles' +import type { ReactNode } from 'react' + interface ListButtonAccordionContainerProps { - children: React.ReactNode + children: ReactNode id: string } /* diff --git a/components/src/atoms/ListButton/__tests__/ListButton.test.tsx b/components/src/atoms/ListButton/__tests__/ListButton.test.tsx index e7ba460b5e2..fe4e3fb7349 100644 --- a/components/src/atoms/ListButton/__tests__/ListButton.test.tsx +++ b/components/src/atoms/ListButton/__tests__/ListButton.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { vi, describe, it, expect, beforeEach } from 'vitest' import '@testing-library/jest-dom/vitest' import { fireEvent, screen } from '@testing-library/react' @@ -7,11 +6,13 @@ import { COLORS } from '../../../helix-design-system' import { ListButton } from '..' -const render = (props: React.ComponentProps) => +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => renderWithProviders() describe('ListButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/ListButton/__tests__/ListButtonAccordion.test.tsx b/components/src/atoms/ListButton/__tests__/ListButtonAccordion.test.tsx index 29a2673c773..07ce7452549 100644 --- a/components/src/atoms/ListButton/__tests__/ListButtonAccordion.test.tsx +++ b/components/src/atoms/ListButton/__tests__/ListButtonAccordion.test.tsx @@ -1,15 +1,16 @@ -import type * as React from 'react' import { describe, it, beforeEach } from 'vitest' import { screen } from '@testing-library/react' import { renderWithProviders } from '../../../testing/utils' import { ListButtonAccordion } from '..' -const render = (props: React.ComponentProps) => +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => renderWithProviders() describe('ListButtonAccordion', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/ListButton/__tests__/ListButtonRadioButton.test.tsx b/components/src/atoms/ListButton/__tests__/ListButtonRadioButton.test.tsx index e9448ffabdf..95520a9691b 100644 --- a/components/src/atoms/ListButton/__tests__/ListButtonRadioButton.test.tsx +++ b/components/src/atoms/ListButton/__tests__/ListButtonRadioButton.test.tsx @@ -1,15 +1,16 @@ -import type * as React from 'react' import { describe, it, beforeEach, vi, expect } from 'vitest' import { fireEvent, screen } from '@testing-library/react' import { renderWithProviders } from '../../../testing/utils' import { ListButtonRadioButton } from '..' -const render = (props: React.ComponentProps) => +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => renderWithProviders() describe('ListButtonRadioButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/ListButton/index.tsx b/components/src/atoms/ListButton/index.tsx index 3f26c830a50..fd4d0cce052 100644 --- a/components/src/atoms/ListButton/index.tsx +++ b/components/src/atoms/ListButton/index.tsx @@ -1,9 +1,10 @@ -import type * as React from 'react' import { css } from 'styled-components' import { Flex } from '../../primitives' import { SPACING } from '../../ui-style-constants' import { BORDERS, COLORS } from '../../helix-design-system' import { CURSOR_POINTER } from '../../styles' + +import type { ReactNode } from 'react' import type { StyleProps } from '../../primitives' export * from './ListButtonChildren/index' @@ -12,7 +13,7 @@ export type ListButtonType = 'noActive' | 'connected' | 'notConnected' interface ListButtonProps extends StyleProps { type: ListButtonType - children: React.ReactNode + children: ReactNode disabled?: boolean onClick?: () => void } diff --git a/components/src/atoms/ListItem/__tests__/ListItem.test.tsx b/components/src/atoms/ListItem/__tests__/ListItem.test.tsx index ce15aec5d8e..7b603d85868 100644 --- a/components/src/atoms/ListItem/__tests__/ListItem.test.tsx +++ b/components/src/atoms/ListItem/__tests__/ListItem.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { vi, describe, it, expect, beforeEach } from 'vitest' import '@testing-library/jest-dom/vitest' import { fireEvent, screen } from '@testing-library/react' @@ -7,11 +6,13 @@ import { BORDERS, COLORS } from '../../../helix-design-system' import { ListItem } from '..' -const render = (props: React.ComponentProps) => +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => renderWithProviders() describe('ListItem', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/ListItem/index.tsx b/components/src/atoms/ListItem/index.tsx index 5a47c614ea8..d1d9b8d1312 100644 --- a/components/src/atoms/ListItem/index.tsx +++ b/components/src/atoms/ListItem/index.tsx @@ -1,9 +1,10 @@ -import type * as React from 'react' import { css } from 'styled-components' import { Flex } from '../../primitives' import { RESPONSIVENESS, SPACING } from '../../ui-style-constants' import { BORDERS, COLORS } from '../../helix-design-system' import { FLEX_MAX_CONTENT } from '../../styles' + +import type { ReactNode } from 'react' import type { StyleProps } from '../../primitives' export * from './ListItemChildren' @@ -19,7 +20,7 @@ interface ListItemProps extends StyleProps { /** ListItem state type */ type: ListItemType /** ListItem contents */ - children: React.ReactNode + children: ReactNode onClick?: () => void onMouseEnter?: () => void onMouseLeave?: () => void diff --git a/components/src/atoms/MenuList/OverflowBtn.tsx b/components/src/atoms/MenuList/OverflowBtn.tsx index efe9195f03d..0414f95f7d3 100644 --- a/components/src/atoms/MenuList/OverflowBtn.tsx +++ b/components/src/atoms/MenuList/OverflowBtn.tsx @@ -1,20 +1,22 @@ -import * as React from 'react' +import { forwardRef } from 'react' import { css } from 'styled-components' import { Btn } from '../../primitives' import { BORDERS, COLORS } from '../../helix-design-system' import { SPACING } from '../../ui-style-constants' -interface OverflowBtnProps extends React.ComponentProps { +import type { ComponentProps, ForwardedRef, ReactNode } from 'react' + +interface OverflowBtnProps extends ComponentProps { fillColor?: string } export const OverflowBtn: ( props: OverflowBtnProps, - ref: React.ForwardedRef -) => React.ReactNode = React.forwardRef( + ref: ForwardedRef +) => ReactNode = forwardRef( ( props: OverflowBtnProps, - ref: React.ForwardedRef + ref: ForwardedRef ): JSX.Element => { const { fillColor, ...restProps } = props return ( diff --git a/components/src/atoms/MenuList/__tests__/MenuItem.test.tsx b/components/src/atoms/MenuList/__tests__/MenuItem.test.tsx index f6d0485be45..4a90984f638 100644 --- a/components/src/atoms/MenuList/__tests__/MenuItem.test.tsx +++ b/components/src/atoms/MenuList/__tests__/MenuItem.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, expect, beforeEach } from 'vitest' import { screen } from '@testing-library/react' @@ -8,12 +7,14 @@ import { SPACING, TYPOGRAPHY } from '../../../ui-style-constants' import { MenuItem } from '../MenuItem' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('MenuItem', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/MenuList/__tests__/MenuList.test.tsx b/components/src/atoms/MenuList/__tests__/MenuList.test.tsx index e38e145eceb..7b2ccffc42b 100644 --- a/components/src/atoms/MenuList/__tests__/MenuList.test.tsx +++ b/components/src/atoms/MenuList/__tests__/MenuList.test.tsx @@ -1,18 +1,19 @@ -import type * as React from 'react' import { describe, it, expect, vi, beforeEach } from 'vitest' import { fireEvent, screen } from '@testing-library/react' import { renderWithProviders } from '../../../testing/utils' import { MenuList } from '..' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } const mockBtn =
mockBtn
describe('MenuList', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { children: mockBtn, diff --git a/components/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx b/components/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx index 00f080fae2c..af60a617c41 100644 --- a/components/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx +++ b/components/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { vi, it, expect, describe } from 'vitest' import { fireEvent, screen } from '@testing-library/react' @@ -6,7 +5,9 @@ import { COLORS } from '../../../helix-design-system' import { renderWithProviders } from '../../../testing/utils' import { OverflowBtn } from '../OverflowBtn' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } diff --git a/components/src/atoms/MenuList/index.tsx b/components/src/atoms/MenuList/index.tsx index 7b930243ba0..f06fe983523 100644 --- a/components/src/atoms/MenuList/index.tsx +++ b/components/src/atoms/MenuList/index.tsx @@ -1,5 +1,3 @@ -import type * as React from 'react' - import { BORDERS, COLORS } from '../../helix-design-system' import { DIRECTION_COLUMN, @@ -10,10 +8,12 @@ import { Flex } from '../../primitives' import { SPACING } from '../../ui-style-constants' import { ModalShell } from '../../modals' +import type { MouseEventHandler, ReactNode } from 'react' + interface MenuListProps { - children: React.ReactNode + children: ReactNode isOnDevice?: boolean - onClick?: React.MouseEventHandler + onClick?: MouseEventHandler } export const MenuList = (props: MenuListProps): JSX.Element | null => { diff --git a/components/src/atoms/Snackbar/__tests__/Snackbar.test.tsx b/components/src/atoms/Snackbar/__tests__/Snackbar.test.tsx index a4ae1f8f6b0..0f093548cdc 100644 --- a/components/src/atoms/Snackbar/__tests__/Snackbar.test.tsx +++ b/components/src/atoms/Snackbar/__tests__/Snackbar.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, expect, vi, beforeEach } from 'vitest' import '@testing-library/jest-dom/vitest' import { screen, act } from '@testing-library/react' @@ -6,12 +5,14 @@ import { renderWithProviders } from '../../../testing/utils' import { Snackbar } from '..' import { COLORS } from '../../../helix-design-system' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('Snackbar', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { message: 'test message', diff --git a/components/src/atoms/StyledText/LegacyStyledText.tsx b/components/src/atoms/StyledText/LegacyStyledText.tsx index 83df2c69e06..7816a8967f9 100644 --- a/components/src/atoms/StyledText/LegacyStyledText.tsx +++ b/components/src/atoms/StyledText/LegacyStyledText.tsx @@ -2,11 +2,11 @@ import styled, { css } from 'styled-components' import { Text } from '../../primitives' import { TYPOGRAPHY, RESPONSIVENESS } from '../../ui-style-constants' -import type * as React from 'react' +import type { ComponentProps, ReactNode } from 'react' import type { FlattenSimpleInterpolation } from 'styled-components' -export interface LegacyProps extends React.ComponentProps { - children?: React.ReactNode +export interface LegacyProps extends ComponentProps { + children?: ReactNode } const styleMap: { [tag: string]: FlattenSimpleInterpolation } = { diff --git a/components/src/atoms/StyledText/StyledText.tsx b/components/src/atoms/StyledText/StyledText.tsx index fc33536da9a..df16b3f8b0a 100644 --- a/components/src/atoms/StyledText/StyledText.tsx +++ b/components/src/atoms/StyledText/StyledText.tsx @@ -3,7 +3,7 @@ import { Text } from '../../primitives' import { TYPOGRAPHY, RESPONSIVENESS } from '../../ui-style-constants' import { TYPOGRAPHY as HELIX_TYPOGRAPHY } from '../../helix-design-system/product' -import type * as React from 'react' +import type { ComponentProps, ReactNode } from 'react' import type { FlattenSimpleInterpolation } from 'styled-components' const helixProductStyleMap = { @@ -290,10 +290,10 @@ const ODDStyleMap = { }, } as const -export interface Props extends React.ComponentProps { +export interface Props extends ComponentProps { oddStyle?: ODDStyles desktopStyle?: HelixStyles - children?: React.ReactNode + children?: ReactNode } export const ODD_STYLES = Object.keys(ODDStyleMap) export const HELIX_STYLES = Object.keys(helixProductStyleMap) diff --git a/components/src/atoms/Tag/__tests__/Tag.test.tsx b/components/src/atoms/Tag/__tests__/Tag.test.tsx index dcb25c77d27..9c7ba83731d 100644 --- a/components/src/atoms/Tag/__tests__/Tag.test.tsx +++ b/components/src/atoms/Tag/__tests__/Tag.test.tsx @@ -1,16 +1,17 @@ -import type * as React from 'react' import { describe, it, expect } from 'vitest' import { screen } from '@testing-library/react' import { COLORS } from '../../../helix-design-system' import { renderWithProviders } from '../../../testing/utils' import { Tag } from '../index' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders() } describe('Tag', () => { - let props: React.ComponentProps + let props: ComponentProps it('should render text, icon with default', () => { props = { diff --git a/components/src/atoms/Toast/__tests__/ODDToast.test.tsx b/components/src/atoms/Toast/__tests__/ODDToast.test.tsx index d198df7f03e..3999fc8ec6e 100644 --- a/components/src/atoms/Toast/__tests__/ODDToast.test.tsx +++ b/components/src/atoms/Toast/__tests__/ODDToast.test.tsx @@ -1,16 +1,17 @@ -import type * as React from 'react' import { describe, it, expect, vi, beforeEach } from 'vitest' import '@testing-library/jest-dom/vitest' import { act, fireEvent, screen } from '@testing-library/react' import { renderWithProviders } from '../../../testing/utils' import { Toast, TOAST_ANIMATION_DURATION } from '..' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('Toast', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { id: '1', diff --git a/components/src/atoms/Toast/__tests__/Toast.test.tsx b/components/src/atoms/Toast/__tests__/Toast.test.tsx index 5133651ecd6..2d4e189e895 100644 --- a/components/src/atoms/Toast/__tests__/Toast.test.tsx +++ b/components/src/atoms/Toast/__tests__/Toast.test.tsx @@ -1,16 +1,17 @@ -import type * as React from 'react' import { describe, it, expect, vi, beforeEach } from 'vitest' import '@testing-library/jest-dom/vitest' import { act, fireEvent, screen } from '@testing-library/react' import { renderWithProviders } from '../../../testing/utils' import { Toast, TOAST_ANIMATION_DURATION } from '..' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('Toast', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { id: '1', diff --git a/components/src/atoms/ToggleGroup/__tests__/ToggleGroup.test.tsx b/components/src/atoms/ToggleGroup/__tests__/ToggleGroup.test.tsx index f7beb737696..f754467da5e 100644 --- a/components/src/atoms/ToggleGroup/__tests__/ToggleGroup.test.tsx +++ b/components/src/atoms/ToggleGroup/__tests__/ToggleGroup.test.tsx @@ -1,15 +1,16 @@ -import type * as React from 'react' import { describe, it, expect, vi } from 'vitest' import { fireEvent, screen } from '@testing-library/react' import { renderWithProviders } from '../../../testing/utils' import { ToggleGroup } from '../index' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders() } describe('ToggleGroup', () => { - let props: React.ComponentProps + let props: ComponentProps it('should render text and buttons', () => { props = { diff --git a/components/src/atoms/Tooltip/__tests__/Tooltip.test.tsx b/components/src/atoms/Tooltip/__tests__/Tooltip.test.tsx index ddc1e4f6a1a..18fe3fcce85 100644 --- a/components/src/atoms/Tooltip/__tests__/Tooltip.test.tsx +++ b/components/src/atoms/Tooltip/__tests__/Tooltip.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, expect, vi, beforeEach } from 'vitest' import '@testing-library/jest-dom/vitest' import { screen } from '@testing-library/react' @@ -11,7 +10,9 @@ import { POSITION_ABSOLUTE } from '../../../styles' import { renderWithProviders } from '../../../testing/utils' import { Tooltip } from '..' -const render = (props: React.ComponentProps) => { +import type { ComponentProps, ReactNode } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } @@ -39,11 +40,11 @@ const MockTooltipProps = { } describe('Tooltip', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { - children: 'mock children' as React.ReactNode, + children: 'mock children' as ReactNode, tooltipProps: MockTooltipProps, key: 'mock key', } diff --git a/components/src/atoms/Tooltip/index.tsx b/components/src/atoms/Tooltip/index.tsx index 6bc04add77c..9ba18b99e1e 100644 --- a/components/src/atoms/Tooltip/index.tsx +++ b/components/src/atoms/Tooltip/index.tsx @@ -1,15 +1,14 @@ -import type * as React from 'react' - import { COLORS } from '../../helix-design-system' import { TYPOGRAPHY } from '../../ui-style-constants' import { LegacyTooltip } from '../../tooltips' import { FLEX_MAX_CONTENT } from '../../styles' +import type { ReactNode } from 'react' import type { UseTooltipResultTooltipProps } from '../../tooltips' import type { StyleProps } from '../../primitives' export interface TooltipProps extends StyleProps { - children: React.ReactNode + children: ReactNode tooltipProps: UseTooltipResultTooltipProps & { visible: boolean } key?: string } diff --git a/components/src/atoms/buttons/LargeButton.tsx b/components/src/atoms/buttons/LargeButton.tsx index 67436adf6ed..7bfcf4b6533 100644 --- a/components/src/atoms/buttons/LargeButton.tsx +++ b/components/src/atoms/buttons/LargeButton.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { css } from 'styled-components' import { Btn } from '../../primitives' @@ -16,6 +15,7 @@ import { } from '../..' import { Icon } from '../../icons' +import type { ReactNode } from 'react' import type { StyleProps } from '../../primitives' import type { IconName } from '../../icons' @@ -126,7 +126,7 @@ interface LargeButtonProps extends StyleProps { type?: 'submit' onClick?: () => void buttonType?: LargeButtonTypes - buttonText: React.ReactNode + buttonText: ReactNode iconName?: IconName disabled?: boolean /** aria-disabled for displaying snack bar. */ diff --git a/components/src/atoms/buttons/RadioButton.tsx b/components/src/atoms/buttons/RadioButton.tsx index a4d1a769144..8b371912e6a 100644 --- a/components/src/atoms/buttons/RadioButton.tsx +++ b/components/src/atoms/buttons/RadioButton.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import styled, { css } from 'styled-components' import { Flex } from '../../primitives' import { COLORS, BORDERS } from '../../helix-design-system' @@ -12,14 +11,16 @@ import { Icon, StyledText, } from '../../index' + +import type { ChangeEventHandler, ReactNode } from 'react' +import type { FlattenSimpleInterpolation } from 'styled-components' import type { IconName } from '../../icons' import type { StyleProps } from '../../primitives' -import type { FlattenSimpleInterpolation } from 'styled-components' interface RadioButtonProps extends StyleProps { - buttonLabel: string | React.ReactNode + buttonLabel: string | ReactNode buttonValue: string | number - onChange: React.ChangeEventHandler + onChange: ChangeEventHandler disabled?: boolean iconName?: IconName isSelected?: boolean diff --git a/components/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx b/components/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx index cad0175d981..61d1b07729c 100644 --- a/components/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, beforeEach, expect } from 'vitest' import { screen } from '@testing-library/react' import '@testing-library/jest-dom/vitest' @@ -8,12 +7,14 @@ import { TYPOGRAPHY, SPACING } from '../../../ui-style-constants' import { AlertPrimaryButton } from '../AlertPrimaryButton' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('AlertPrimaryButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/buttons/__tests__/AltPrimaryButton.test.tsx b/components/src/atoms/buttons/__tests__/AltPrimaryButton.test.tsx index f65613d0561..7697336c219 100644 --- a/components/src/atoms/buttons/__tests__/AltPrimaryButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/AltPrimaryButton.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, beforeEach, expect } from 'vitest' import { screen } from '@testing-library/react' import '@testing-library/jest-dom/vitest' @@ -7,12 +6,14 @@ import { BORDERS, COLORS } from '../../../helix-design-system' import { TYPOGRAPHY, SPACING } from '../../../ui-style-constants' import { AltPrimaryButton } from '../AltPrimaryButton' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('AltPrimaryButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/buttons/__tests__/EmptySelectorButton.test.tsx b/components/src/atoms/buttons/__tests__/EmptySelectorButton.test.tsx index 6fea2d8d297..bf5e2953086 100644 --- a/components/src/atoms/buttons/__tests__/EmptySelectorButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/EmptySelectorButton.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import '@testing-library/jest-dom/vitest' import { fireEvent, screen } from '@testing-library/react' import { describe, it, expect, vi, beforeEach } from 'vitest' @@ -6,12 +5,14 @@ import { renderWithProviders } from '../../../testing/utils' import { JUSTIFY_CENTER, JUSTIFY_START } from '../../../styles' import { EmptySelectorButton } from '../EmptySelectorButton' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('EmptySelectorButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { onClick: vi.fn(), diff --git a/components/src/atoms/buttons/__tests__/LargeButton.test.tsx b/components/src/atoms/buttons/__tests__/LargeButton.test.tsx index 52f6c9e71f6..628dd88b541 100644 --- a/components/src/atoms/buttons/__tests__/LargeButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/LargeButton.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, expect, vi, beforeEach } from 'vitest' import '@testing-library/jest-dom/vitest' import { fireEvent, screen } from '@testing-library/react' @@ -7,12 +6,14 @@ import { renderWithProviders } from '../../../testing/utils' import { COLORS } from '../../../helix-design-system' import { LargeButton } from '../LargeButton' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('LargeButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { onClick: vi.fn(), diff --git a/components/src/atoms/buttons/__tests__/PrimaryButton.test.tsx b/components/src/atoms/buttons/__tests__/PrimaryButton.test.tsx index 558f4a595eb..8f465d4bc63 100644 --- a/components/src/atoms/buttons/__tests__/PrimaryButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/PrimaryButton.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, beforeEach, expect } from 'vitest' import { fireEvent, screen } from '@testing-library/react' import '@testing-library/jest-dom/vitest' @@ -7,12 +6,14 @@ import { BORDERS, COLORS } from '../../../helix-design-system' import { TYPOGRAPHY, SPACING } from '../../../ui-style-constants' import { PrimaryButton } from '../PrimaryButton' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('PrimaryButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/atoms/buttons/__tests__/RadioButton.test.tsx b/components/src/atoms/buttons/__tests__/RadioButton.test.tsx index 95aaf6532fc..b259bcc97fb 100644 --- a/components/src/atoms/buttons/__tests__/RadioButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/RadioButton.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import '@testing-library/jest-dom/vitest' import { screen, queryByAttribute } from '@testing-library/react' import { describe, it, expect, vi, beforeEach } from 'vitest' @@ -7,12 +6,14 @@ import { COLORS } from '../../../helix-design-system' import { SPACING } from '../../../ui-style-constants' import { RadioButton } from '../RadioButton' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('RadioButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { onChange: vi.fn(), diff --git a/components/src/atoms/buttons/__tests__/SecondaryButton.test.tsx b/components/src/atoms/buttons/__tests__/SecondaryButton.test.tsx index 8887e679268..c7fdcc3229f 100644 --- a/components/src/atoms/buttons/__tests__/SecondaryButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/SecondaryButton.test.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import { describe, it, beforeEach, expect } from 'vitest' import { screen } from '@testing-library/react' import '@testing-library/jest-dom/vitest' @@ -8,12 +7,14 @@ import { BORDERS, COLORS } from '../../../helix-design-system' import { SecondaryButton } from '../SecondaryButton' -const render = (props: React.ComponentProps) => { +import type { ComponentProps } from 'react' + +const render = (props: ComponentProps) => { return renderWithProviders()[0] } describe('SecondaryButton', () => { - let props: React.ComponentProps + let props: ComponentProps beforeEach(() => { props = { diff --git a/components/src/buttons/Button.tsx b/components/src/buttons/Button.tsx index 749c4e603a5..3c159a3b759 100644 --- a/components/src/buttons/Button.tsx +++ b/components/src/buttons/Button.tsx @@ -1,4 +1,3 @@ -import type * as React from 'react' import cx from 'classnames' import omit from 'lodash/omit' @@ -7,6 +6,7 @@ import styles from './buttons.module.css' import { BUTTON_TYPE_BUTTON } from '../primitives' +import type { ComponentType, MouseEventHandler, ReactNode } from 'react' import type { BUTTON_TYPE_SUBMIT, BUTTON_TYPE_RESET } from '../primitives' import type { IconName } from '../icons' import type { UseHoverTooltipTargetProps } from '../tooltips' @@ -15,7 +15,7 @@ export interface ButtonProps { /** id attribute */ id?: string /** click handler */ - onClick?: React.MouseEventHandler + onClick?: MouseEventHandler /** name attribute */ name?: string /** title attribute */ @@ -31,7 +31,7 @@ export interface ButtonProps { /** inverts the default color/background/border of default button style */ inverted?: boolean /** contents of the button */ - children?: React.ReactNode + children?: ReactNode /** type of button (default "button") */ type?: | typeof BUTTON_TYPE_SUBMIT @@ -40,7 +40,7 @@ export interface ButtonProps { /** ID of form that button is for */ form?: string /** custom element or component to use instead of `