From 334b6f983aedee3707472dd7c7297c80507348d5 Mon Sep 17 00:00:00 2001 From: Johnny Bouder Date: Tue, 10 Dec 2024 09:17:57 -0500 Subject: [PATCH] Update react imports for react jsx. --- .../src/components/spinner/spinner.figma.tsx | 4 +++- packages/comet-extras/src/components/spinner/spinner.tsx | 2 +- packages/comet-uswds/src/components/button/button.tsx | 2 +- .../src/components/character-count/character-count.tsx | 2 +- .../comet-uswds/src/components/checkbox/checkbox.tsx | 2 +- .../comet-uswds/src/components/combo-box/combo-box.tsx | 9 ++++++++- .../src/components/date-picker/date-picker.tsx | 2 +- .../src/components/file-input/file-input.test.tsx | 2 +- .../comet-uswds/src/components/file-input/file-input.tsx | 2 +- packages/comet-uswds/src/components/form/form.tsx | 1 + packages/comet-uswds/src/components/label/label.tsx | 2 +- packages/comet-uswds/src/components/modal/modal.test.tsx | 2 +- .../comet-uswds/src/components/pagination/pagination.tsx | 2 +- packages/comet-uswds/src/components/prose/prose.tsx | 2 +- .../src/components/radio-button/radio-button.tsx | 2 +- .../src/components/range-slider/range-slider.tsx | 1 + packages/comet-uswds/src/components/search/search.tsx | 2 +- packages/comet-uswds/src/components/select/select.tsx | 2 +- .../side-navigation/side-navigation.stories.tsx | 2 +- .../components/side-navigation/side-navigation.test.tsx | 1 + .../src/components/side-navigation/side-navigation.tsx | 2 +- .../comet-uswds/src/components/text-area/text-area.tsx | 2 +- .../comet-uswds/src/components/text-input/text-input.tsx | 2 +- .../src/components/time-picker/time-picker.tsx | 2 +- 24 files changed, 33 insertions(+), 21 deletions(-) diff --git a/packages/comet-extras/src/components/spinner/spinner.figma.tsx b/packages/comet-extras/src/components/spinner/spinner.figma.tsx index 8a483c6b..71e6b9b1 100644 --- a/packages/comet-extras/src/components/spinner/spinner.figma.tsx +++ b/packages/comet-extras/src/components/spinner/spinner.figma.tsx @@ -11,6 +11,8 @@ figma.connect( Large: 'large', }), }, - example: ({ type }) => , + example: ({ type }) => ( + + ), }, ); diff --git a/packages/comet-extras/src/components/spinner/spinner.tsx b/packages/comet-extras/src/components/spinner/spinner.tsx index 22f1449c..b3370276 100644 --- a/packages/comet-extras/src/components/spinner/spinner.tsx +++ b/packages/comet-extras/src/components/spinner/spinner.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { JSX } from 'react'; import classnames from 'classnames'; import './spinner.style.css'; diff --git a/packages/comet-uswds/src/components/button/button.tsx b/packages/comet-uswds/src/components/button/button.tsx index 1756ee90..2ee6ed5d 100644 --- a/packages/comet-uswds/src/components/button/button.tsx +++ b/packages/comet-uswds/src/components/button/button.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, SyntheticEvent } from 'react'; +import React, { JSX, ReactNode, SyntheticEvent } from 'react'; import classnames from 'classnames'; export interface ButtonProps { diff --git a/packages/comet-uswds/src/components/character-count/character-count.tsx b/packages/comet-uswds/src/components/character-count/character-count.tsx index bf14a980..4de9c0d9 100644 --- a/packages/comet-uswds/src/components/character-count/character-count.tsx +++ b/packages/comet-uswds/src/components/character-count/character-count.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef } from 'react'; +import React, { JSX, useEffect, useRef } from 'react'; import classNames from 'classnames'; import characterCount from '@uswds/uswds/js/usa-character-count'; diff --git a/packages/comet-uswds/src/components/checkbox/checkbox.tsx b/packages/comet-uswds/src/components/checkbox/checkbox.tsx index 99c1d5a1..080010c7 100644 --- a/packages/comet-uswds/src/components/checkbox/checkbox.tsx +++ b/packages/comet-uswds/src/components/checkbox/checkbox.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEventHandler, MouseEventHandler } from 'react'; +import React, { ChangeEventHandler, JSX, MouseEventHandler } from 'react'; import classnames from 'classnames'; import FormGroup from '../form-group'; diff --git a/packages/comet-uswds/src/components/combo-box/combo-box.tsx b/packages/comet-uswds/src/components/combo-box/combo-box.tsx index 9f78fc3c..e624a72b 100644 --- a/packages/comet-uswds/src/components/combo-box/combo-box.tsx +++ b/packages/comet-uswds/src/components/combo-box/combo-box.tsx @@ -1,6 +1,13 @@ import { createOption, SelectOptionProps, SelectProps } from '../select/select'; import comboBox from '@uswds/uswds/js/usa-combo-box'; -import React, { ChangeEventHandler, ReactElement, RefObject, useLayoutEffect, useRef } from 'react'; +import React, { + ChangeEventHandler, + JSX, + ReactElement, + RefObject, + useLayoutEffect, + useRef, +} from 'react'; import FormGroup from '../form-group'; import classNames from 'classnames'; diff --git a/packages/comet-uswds/src/components/date-picker/date-picker.tsx b/packages/comet-uswds/src/components/date-picker/date-picker.tsx index 99d4b541..904edccf 100644 --- a/packages/comet-uswds/src/components/date-picker/date-picker.tsx +++ b/packages/comet-uswds/src/components/date-picker/date-picker.tsx @@ -1,5 +1,5 @@ import datePicker from '@uswds/uswds/js/usa-date-picker'; -import React, { useLayoutEffect, useRef } from 'react'; +import React, { JSX, useLayoutEffect, useRef } from 'react'; import FormGroup from '../form-group'; import { ValidationStatus } from '../utils/types'; import classNames from 'classnames'; diff --git a/packages/comet-uswds/src/components/file-input/file-input.test.tsx b/packages/comet-uswds/src/components/file-input/file-input.test.tsx index df6f3b84..f36f2409 100644 --- a/packages/comet-uswds/src/components/file-input/file-input.test.tsx +++ b/packages/comet-uswds/src/components/file-input/file-input.test.tsx @@ -1,7 +1,7 @@ import { render, RenderOptions, RenderResult } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { axe } from 'jest-axe'; -import React, { ReactNode } from 'react'; +import React, { JSX, ReactNode } from 'react'; import FileInput from './file-input'; const customRender = (ui: React.ReactElement, options?: RenderOptions): RenderResult => render(ui, { wrapper: Wrapper, ...options }); diff --git a/packages/comet-uswds/src/components/file-input/file-input.tsx b/packages/comet-uswds/src/components/file-input/file-input.tsx index d2122fec..014ea1aa 100644 --- a/packages/comet-uswds/src/components/file-input/file-input.tsx +++ b/packages/comet-uswds/src/components/file-input/file-input.tsx @@ -1,5 +1,5 @@ import fileInput from '@uswds/uswds/js/usa-file-input'; -import React, { useLayoutEffect, useRef } from 'react'; +import React, { JSX, useLayoutEffect, useRef } from 'react'; import FormGroup from '../form-group'; export interface FileInputProps { diff --git a/packages/comet-uswds/src/components/form/form.tsx b/packages/comet-uswds/src/components/form/form.tsx index 174291e4..de1147d3 100644 --- a/packages/comet-uswds/src/components/form/form.tsx +++ b/packages/comet-uswds/src/components/form/form.tsx @@ -1,4 +1,5 @@ import classNames from 'classnames'; +import { JSX } from 'react'; export interface FormProps { /** diff --git a/packages/comet-uswds/src/components/label/label.tsx b/packages/comet-uswds/src/components/label/label.tsx index 56a17ce9..75c920a3 100644 --- a/packages/comet-uswds/src/components/label/label.tsx +++ b/packages/comet-uswds/src/components/label/label.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import React, { JSX, ReactNode } from 'react'; export interface LabelProps { /** diff --git a/packages/comet-uswds/src/components/modal/modal.test.tsx b/packages/comet-uswds/src/components/modal/modal.test.tsx index 23d6c294..4f7d1df7 100644 --- a/packages/comet-uswds/src/components/modal/modal.test.tsx +++ b/packages/comet-uswds/src/components/modal/modal.test.tsx @@ -1,6 +1,6 @@ import { render, RenderOptions, RenderResult } from '@testing-library/react'; import { axe } from 'jest-axe'; -import React, { ReactNode } from 'react'; +import React, { JSX, ReactNode } from 'react'; import Modal from './modal'; const customRender = (ui: React.ReactElement, options?: RenderOptions): RenderResult => diff --git a/packages/comet-uswds/src/components/pagination/pagination.tsx b/packages/comet-uswds/src/components/pagination/pagination.tsx index 0d96f0cc..158a4342 100644 --- a/packages/comet-uswds/src/components/pagination/pagination.tsx +++ b/packages/comet-uswds/src/components/pagination/pagination.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, SyntheticEvent } from 'react'; +import React, { JSX, ReactNode, SyntheticEvent } from 'react'; import classNames from 'classnames'; import sprite from '@uswds/uswds/img/sprite.svg'; diff --git a/packages/comet-uswds/src/components/prose/prose.tsx b/packages/comet-uswds/src/components/prose/prose.tsx index 239e3dde..03d358db 100644 --- a/packages/comet-uswds/src/components/prose/prose.tsx +++ b/packages/comet-uswds/src/components/prose/prose.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import React, { JSX, ReactNode } from 'react'; import classnames from 'classnames'; export interface ProseProps { diff --git a/packages/comet-uswds/src/components/radio-button/radio-button.tsx b/packages/comet-uswds/src/components/radio-button/radio-button.tsx index f888c621..e61d9879 100644 --- a/packages/comet-uswds/src/components/radio-button/radio-button.tsx +++ b/packages/comet-uswds/src/components/radio-button/radio-button.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEventHandler, MouseEventHandler } from 'react'; +import React, { ChangeEventHandler, JSX, MouseEventHandler } from 'react'; import classnames from 'classnames'; import FormGroup from '../form-group'; diff --git a/packages/comet-uswds/src/components/range-slider/range-slider.tsx b/packages/comet-uswds/src/components/range-slider/range-slider.tsx index cf3b7dcd..ef050153 100644 --- a/packages/comet-uswds/src/components/range-slider/range-slider.tsx +++ b/packages/comet-uswds/src/components/range-slider/range-slider.tsx @@ -1,3 +1,4 @@ +import { JSX } from 'react'; import FormGroup from '../form-group'; export interface RangeSliderProps { diff --git a/packages/comet-uswds/src/components/search/search.tsx b/packages/comet-uswds/src/components/search/search.tsx index 93700a5c..c131582c 100644 --- a/packages/comet-uswds/src/components/search/search.tsx +++ b/packages/comet-uswds/src/components/search/search.tsx @@ -1,4 +1,4 @@ -import React, { FormEvent } from 'react'; +import React, { FormEvent, JSX } from 'react'; import classnames from 'classnames'; import searchIcon from '@uswds/uswds/img/usa-icons-bg/search--white.svg'; diff --git a/packages/comet-uswds/src/components/select/select.tsx b/packages/comet-uswds/src/components/select/select.tsx index d26d90f4..405afd80 100644 --- a/packages/comet-uswds/src/components/select/select.tsx +++ b/packages/comet-uswds/src/components/select/select.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React, { ChangeEventHandler, ReactElement } from 'react'; +import React, { ChangeEventHandler, JSX, ReactElement } from 'react'; import FormGroup from '../form-group'; export interface SelectOptionProps { diff --git a/packages/comet-uswds/src/components/side-navigation/side-navigation.stories.tsx b/packages/comet-uswds/src/components/side-navigation/side-navigation.stories.tsx index 4b07db99..377db5a2 100644 --- a/packages/comet-uswds/src/components/side-navigation/side-navigation.stories.tsx +++ b/packages/comet-uswds/src/components/side-navigation/side-navigation.stories.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { JSX } from 'react'; import { Meta, StoryFn } from '@storybook/react'; import SideNavigation, { SideNavigationItem, diff --git a/packages/comet-uswds/src/components/side-navigation/side-navigation.test.tsx b/packages/comet-uswds/src/components/side-navigation/side-navigation.test.tsx index d5d8b407..3369fc6f 100644 --- a/packages/comet-uswds/src/components/side-navigation/side-navigation.test.tsx +++ b/packages/comet-uswds/src/components/side-navigation/side-navigation.test.tsx @@ -1,6 +1,7 @@ import { render } from '@testing-library/react'; import { axe } from 'jest-axe'; import SideNavigation, { SideNavigationItemProps } from './side-navigation'; +import { JSX } from 'react'; describe('SideNavigation', () => { const defaultId = 'side-navigation1'; diff --git a/packages/comet-uswds/src/components/side-navigation/side-navigation.tsx b/packages/comet-uswds/src/components/side-navigation/side-navigation.tsx index d982dc39..5e9b6d21 100644 --- a/packages/comet-uswds/src/components/side-navigation/side-navigation.tsx +++ b/packages/comet-uswds/src/components/side-navigation/side-navigation.tsx @@ -1,4 +1,4 @@ -import React, { ReactElement, ReactNode } from 'react'; +import React, { JSX, ReactElement, ReactNode } from 'react'; export interface SideNavigationItemProps { /** diff --git a/packages/comet-uswds/src/components/text-area/text-area.tsx b/packages/comet-uswds/src/components/text-area/text-area.tsx index 52d86330..ad6aca9a 100644 --- a/packages/comet-uswds/src/components/text-area/text-area.tsx +++ b/packages/comet-uswds/src/components/text-area/text-area.tsx @@ -1,5 +1,5 @@ import classnames from 'classnames'; -import React, { ChangeEventHandler } from 'react'; +import React, { ChangeEventHandler, JSX } from 'react'; import { ValidationStatus } from '../utils/types'; import FormGroup from '../form-group'; diff --git a/packages/comet-uswds/src/components/text-input/text-input.tsx b/packages/comet-uswds/src/components/text-input/text-input.tsx index f155974a..e1c72b7e 100644 --- a/packages/comet-uswds/src/components/text-input/text-input.tsx +++ b/packages/comet-uswds/src/components/text-input/text-input.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEventHandler, ReactNode, useEffect, useRef } from 'react'; +import React, { ChangeEventHandler, JSX, ReactNode, useEffect, useRef } from 'react'; import classnames from 'classnames'; import { getInputMode, getPattern, getPlaceholder, getType } from './input-utils'; import FormGroup from '../form-group'; diff --git a/packages/comet-uswds/src/components/time-picker/time-picker.tsx b/packages/comet-uswds/src/components/time-picker/time-picker.tsx index b6540af5..e8e6eb31 100644 --- a/packages/comet-uswds/src/components/time-picker/time-picker.tsx +++ b/packages/comet-uswds/src/components/time-picker/time-picker.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React, { useLayoutEffect, useRef } from 'react'; +import React, { JSX, useLayoutEffect, useRef } from 'react'; import comboBox from '@uswds/uswds/js/usa-combo-box'; import timePicker from '@uswds/uswds/js/usa-time-picker'; import FormGroup from '../form-group';