diff --git a/.changeset/fresh-hats-count.md b/.changeset/fresh-hats-count.md new file mode 100644 index 00000000000..f2fc312e22a --- /dev/null +++ b/.changeset/fresh-hats-count.md @@ -0,0 +1,5 @@ +--- +'@itwin/itwinui-react': minor +--- + +The build output now uses the [new JSX transform](https://react.dev/link/new-jsx-transform) instead of `React.createElement`. diff --git a/apps/react-workshop/src/Alert.stories.tsx b/apps/react-workshop/src/Alert.stories.tsx index 2f9a72adc43..f9ec3ba577a 100644 --- a/apps/react-workshop/src/Alert.stories.tsx +++ b/apps/react-workshop/src/Alert.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Alert } from '@itwin/itwinui-react'; import { SvgPlaceholder, SvgSmileyHappy } from '@itwin/itwinui-icons-react'; diff --git a/apps/react-workshop/src/Anchor.stories.tsx b/apps/react-workshop/src/Anchor.stories.tsx index ab6405dadce..1767abc3d9a 100644 --- a/apps/react-workshop/src/Anchor.stories.tsx +++ b/apps/react-workshop/src/Anchor.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Anchor } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Avatar.stories.tsx b/apps/react-workshop/src/Avatar.stories.tsx index 0febd50fa96..8fe8021f50a 100644 --- a/apps/react-workshop/src/Avatar.stories.tsx +++ b/apps/react-workshop/src/Avatar.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { getUserColor, Avatar } from '@itwin/itwinui-react'; import { SvgUser } from '@itwin/itwinui-icons-react'; diff --git a/apps/react-workshop/src/AvatarGroup.stories.tsx b/apps/react-workshop/src/AvatarGroup.stories.tsx index b825113cc4b..a3238f64fb0 100644 --- a/apps/react-workshop/src/AvatarGroup.stories.tsx +++ b/apps/react-workshop/src/AvatarGroup.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { getUserColor, Tooltip, @@ -153,7 +153,7 @@ export const WithTooltip = () => { /** * Store the last avatar for tooltip positioning. */ - const [countIcon, setCountIcon] = React.useState(null); + const [countIcon, setCountIcon] = useState(null); const usersSubArray = userNames.slice(5); const tooltipContent = usersSubArray.join(`\n`) as string; diff --git a/apps/react-workshop/src/Badge.stories.tsx b/apps/react-workshop/src/Badge.stories.tsx index dc635e57e3b..45e7b78c6d6 100644 --- a/apps/react-workshop/src/Badge.stories.tsx +++ b/apps/react-workshop/src/Badge.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Badge } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Blockquote.stories.tsx b/apps/react-workshop/src/Blockquote.stories.tsx index c54ab6cbdc3..70e1fcf56a0 100644 --- a/apps/react-workshop/src/Blockquote.stories.tsx +++ b/apps/react-workshop/src/Blockquote.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Blockquote } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Breadcrumbs.stories.tsx b/apps/react-workshop/src/Breadcrumbs.stories.tsx index c1203c8e489..e5a13c8fe4a 100644 --- a/apps/react-workshop/src/Breadcrumbs.stories.tsx +++ b/apps/react-workshop/src/Breadcrumbs.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useMemo, useState } from 'react'; import { IconButton, Breadcrumbs, @@ -193,15 +193,15 @@ export const CustomOverflowDropdown = () => { }; export const FolderNavigation = () => { - const items = React.useMemo( + const items = useMemo( () => ['Root', 'Level 1', 'Level 2', 'Level 3', 'Level 4'], [], ); - const [lastIndex, setLastIndex] = React.useState(items.length - 1); - const [isEditing, setIsEditing] = React.useState(false); + const [lastIndex, setLastIndex] = useState(items.length - 1); + const [isEditing, setIsEditing] = useState(false); - const breadcrumbItems = React.useMemo( + const breadcrumbItems = useMemo( () => items.slice(0, lastIndex + 1).map((item, index) => ( { - const [isOpen, setIsOpen] = React.useState(false); - const [activeColor, setActiveColor] = React.useState(ColorsList[5]); - const [colorName, setColorName] = React.useState(ColorsList[5].name); + const [isOpen, setIsOpen] = useState(false); + const [activeColor, setActiveColor] = useState(ColorsList[5]); + const [colorName, setColorName] = useState(ColorsList[5].name); const onColorChanged = (color: ColorValue) => { const hexString = color.toHexString(); @@ -97,15 +97,15 @@ export const Basic = () => { }; export const Advanced = () => { - const [isOpen, setIsOpen] = React.useState(false); - const [selectedColor, setSelectedColor] = React.useState( + const [isOpen, setIsOpen] = useState(false); + const [selectedColor, setSelectedColor] = useState( ColorValue.create({ h: 0, s: 100, l: 50 }), ); const formats = ['hsl', 'rgb', 'hex'] as const; - const [currentFormat, setCurrentFormat] = React.useState< - (typeof formats)[number] - >(formats[0]); + const [currentFormat, setCurrentFormat] = useState<(typeof formats)[number]>( + formats[0], + ); const onColorChanged = (color: ColorValue) => { setSelectedColor(color); @@ -176,15 +176,15 @@ export const Advanced = () => { }; export const WithAlpha = () => { - const [isOpen, setIsOpen] = React.useState(false); - const [selectedColor, setSelectedColor] = React.useState( + const [isOpen, setIsOpen] = useState(false); + const [selectedColor, setSelectedColor] = useState( ColorValue.create({ r: 90, g: 105, b: 115, a: 0.4 }), ); const formats = ['hsl', 'rgb', 'hex'] as const; - const [currentFormat, setCurrentFormat] = React.useState< - (typeof formats)[number] - >(formats[0]); + const [currentFormat, setCurrentFormat] = useState<(typeof formats)[number]>( + formats[0], + ); const onColorChanged = (color: ColorValue) => { setSelectedColor(color); diff --git a/apps/react-workshop/src/DatePicker.stories.tsx b/apps/react-workshop/src/DatePicker.stories.tsx index e41e9d057d3..b210d7efee3 100644 --- a/apps/react-workshop/src/DatePicker.stories.tsx +++ b/apps/react-workshop/src/DatePicker.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { DatePicker, IconButton, @@ -16,7 +16,7 @@ export default { }; export const Basic = () => { - const [currentDate, setCurrentDate] = React.useState( + const [currentDate, setCurrentDate] = useState( new Date(2021, 4, 11, 14, 55, 22), ); const onChange = (date: Date) => { @@ -46,7 +46,7 @@ export const Basic = () => { }; export const WithTime = () => { - const [currentDate, setCurrentDate] = React.useState( + const [currentDate, setCurrentDate] = useState( new Date(2021, 4, 11, 14, 55, 22), ); const onChange = (date: Date) => { @@ -77,7 +77,7 @@ export const WithTime = () => { }; export const WithCombinedTime = () => { - const [currentDate, setCurrentDate] = React.useState( + const [currentDate, setCurrentDate] = useState( new Date(2021, 4, 11, 14, 30, 0), ); const onChange = (date: Date) => { @@ -111,7 +111,7 @@ export const WithCombinedTime = () => { }; export const Localized = () => { - const [currentDate, setCurrentDate] = React.useState( + const [currentDate, setCurrentDate] = useState( new Date(2021, 4, 11, 14, 55, 22), ); const onChange = (date: Date) => { @@ -141,7 +141,7 @@ export const Localized = () => { ); }; export const WithYear = () => { - const [currentDate, setCurrentDate] = React.useState( + const [currentDate, setCurrentDate] = useState( new Date(2021, 4, 11, 14, 55, 22), ); const onChange = (date: Date) => { @@ -170,10 +170,10 @@ export const WithYear = () => { }; export const Range = () => { - const [currentStartDate, setCurrentStartDate] = React.useState( + const [currentStartDate, setCurrentStartDate] = useState( new Date(2022, 6, 13, 14, 55, 22), ); - const [currentEndDate, setCurrentEndDate] = React.useState( + const [currentEndDate, setCurrentEndDate] = useState( new Date(2022, 6, 27, 14, 55, 22), ); const onChange = (startDate: Date, endDate?: Date) => { @@ -216,10 +216,10 @@ export const Range = () => { }; export const SomeDatesDisabled = () => { - const [currentStartDate, setCurrentStartDate] = React.useState( + const [currentStartDate, setCurrentStartDate] = useState( new Date(2022, 6, 13, 14, 55, 22), ); - const [currentEndDate, setCurrentEndDate] = React.useState( + const [currentEndDate, setCurrentEndDate] = useState( new Date(2022, 6, 17, 14, 55, 22), ); diff --git a/apps/react-workshop/src/Dialog.stories.tsx b/apps/react-workshop/src/Dialog.stories.tsx index 20c36771095..a45c7b66497 100644 --- a/apps/react-workshop/src/Dialog.stories.tsx +++ b/apps/react-workshop/src/Dialog.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { Button, Code, Dialog } from '@itwin/itwinui-react'; export default { @@ -10,7 +10,7 @@ export default { }; export const Basic = () => { - const [isOpen, setIsOpen] = React.useState(false); + const [isOpen, setIsOpen] = useState(false); const closeDialog = () => { setIsOpen(false); @@ -61,7 +61,7 @@ export const Basic = () => { }; export const Modal = () => { - const [isOpen, setIsOpen] = React.useState(false); + const [isOpen, setIsOpen] = useState(false); const closeDialog = () => { setIsOpen(false); @@ -122,7 +122,7 @@ export const Modal = () => { }; export const DraggableAndResizable = () => { - const [isOpen, setIsOpen] = React.useState(false); + const [isOpen, setIsOpen] = useState(false); const closeDialog = () => { setIsOpen(false); @@ -180,7 +180,7 @@ export const DraggableAndResizable = () => { }; export const DraggableRelativeToContainer = () => { - const [isDialogOpen, setIsDialogOpen] = React.useState(false); + const [isDialogOpen, setIsDialogOpen] = useState(false); const closeDialog = () => { setIsDialogOpen(false); @@ -252,7 +252,7 @@ export const DraggableRelativeToContainer = () => { }; export const Placement = () => { - const [isOpen, setIsOpen] = React.useState(false); + const [isOpen, setIsOpen] = useState(false); const closeDialog = () => { setIsOpen(false); diff --git a/apps/react-workshop/src/DropdownButton.stories.tsx b/apps/react-workshop/src/DropdownButton.stories.tsx index 83eea5eb2c9..44db9cc8fb4 100644 --- a/apps/react-workshop/src/DropdownButton.stories.tsx +++ b/apps/react-workshop/src/DropdownButton.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { MenuItem, DropdownButton } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/ExpandableBlock.stories.tsx b/apps/react-workshop/src/ExpandableBlock.stories.tsx index 5876468f5e9..c2b3d475d53 100644 --- a/apps/react-workshop/src/ExpandableBlock.stories.tsx +++ b/apps/react-workshop/src/ExpandableBlock.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { ExpandableBlock } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Fieldset.stories.tsx b/apps/react-workshop/src/Fieldset.stories.tsx index eb9765e9dff..f5c2db65d7e 100644 --- a/apps/react-workshop/src/Fieldset.stories.tsx +++ b/apps/react-workshop/src/Fieldset.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { Fieldset, InputGroup, @@ -16,7 +16,7 @@ export default { }; export const Basic = () => { - const [value, setValue] = React.useState(undefined); + const [value, setValue] = useState(undefined); return (
{ }; export const Disabled = () => { - const [value, setValue] = React.useState(undefined); + const [value, setValue] = useState(undefined); return (
{ .filter((el) => el.key !== 'copyright') .flatMap((element, index) => { return ( - + {element.url ? ( @@ -114,7 +112,7 @@ export const CustomContent = () => { element.title )} - + ); }), , diff --git a/apps/react-workshop/src/Header.stories.tsx b/apps/react-workshop/src/Header.stories.tsx index fa2f88bf21f..f602bfc82be 100644 --- a/apps/react-workshop/src/Header.stories.tsx +++ b/apps/react-workshop/src/Header.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { DropdownMenu, getUserColor, @@ -50,7 +50,7 @@ const buildMenu = (menu: string) => (close: () => void) => [ ]; export const Full = () => { - const [userType, setUserType] = React.useState('User'); + const [userType, setUserType] = useState('User'); const avatarMenuItems = (close: () => void) => [ diff --git a/apps/react-workshop/src/IconButton.stories.tsx b/apps/react-workshop/src/IconButton.stories.tsx index c23e4abe7bb..b035fec1a8d 100644 --- a/apps/react-workshop/src/IconButton.stories.tsx +++ b/apps/react-workshop/src/IconButton.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { IconButton } from '@itwin/itwinui-react'; import { SvgAdd } from '@itwin/itwinui-icons-react'; diff --git a/apps/react-workshop/src/IdeasButton.stories.tsx b/apps/react-workshop/src/IdeasButton.stories.tsx index fc008371add..47e8a198bef 100644 --- a/apps/react-workshop/src/IdeasButton.stories.tsx +++ b/apps/react-workshop/src/IdeasButton.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { IdeasButton } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Input.stories.tsx b/apps/react-workshop/src/Input.stories.tsx index ba8deae82d2..9364eedde86 100644 --- a/apps/react-workshop/src/Input.stories.tsx +++ b/apps/react-workshop/src/Input.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Input } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/InputGrid.stories.tsx b/apps/react-workshop/src/InputGrid.stories.tsx index 01e12e3ffef..63c5946aef3 100644 --- a/apps/react-workshop/src/InputGrid.stories.tsx +++ b/apps/react-workshop/src/InputGrid.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { Input, InputGrid, @@ -55,7 +55,7 @@ export const WithSelect = () => { { value: 2, label: 'Hawaii' }, { value: 3, label: 'Madagascar' }, ]; - const [value, setValue] = React.useState(undefined); + const [value, setValue] = useState(undefined); return ( diff --git a/apps/react-workshop/src/InputGroup.stories.tsx b/apps/react-workshop/src/InputGroup.stories.tsx index 6a4e15cb177..9a2b6d60033 100644 --- a/apps/react-workshop/src/InputGroup.stories.tsx +++ b/apps/react-workshop/src/InputGroup.stories.tsx @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import SvgSmileyHappy from '@itwin/itwinui-icons-react/cjs/icons/SmileyHappy'; import SvgSmileySad from '@itwin/itwinui-icons-react/cjs/icons/SmileySad'; -import React from 'react'; +import { useState, useEffect } from 'react'; import { Checkbox, InputGroup, @@ -42,12 +42,12 @@ export const RadioGroup = () => { export const CheckboxGroup = () => { const option1Label = 'Football'; const option2Label = 'Hockey'; - const [option1, setOption1] = React.useState(true); - const [option2, setOption2] = React.useState(false); - const [allOptions, setAllOptions] = React.useState(false); - const [isIndeterminate, setIsIndeterminate] = React.useState(true); + const [option1, setOption1] = useState(true); + const [option2, setOption2] = useState(false); + const [allOptions, setAllOptions] = useState(false); + const [isIndeterminate, setIsIndeterminate] = useState(true); - React.useEffect(() => { + useEffect(() => { if (option1 && option2) { setAllOptions(true); setIsIndeterminate(false); @@ -91,8 +91,8 @@ export const CheckboxGroup = () => { }; export const ToggleGroup = () => { - const [option1, setOption1] = React.useState(true); - const [option2, setOption2] = React.useState(false); + const [option1, setOption1] = useState(true); + const [option2, setOption2] = useState(false); return ( diff --git a/apps/react-workshop/src/InputWithDecoration.stories.tsx b/apps/react-workshop/src/InputWithDecoration.stories.tsx index 7c4f6e953ff..63b23965b1f 100644 --- a/apps/react-workshop/src/InputWithDecoration.stories.tsx +++ b/apps/react-workshop/src/InputWithDecoration.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { InputWithDecorations } from '@itwin/itwinui-react'; import { SvgAdd, SvgAirplane } from '@itwin/itwinui-icons-react'; diff --git a/apps/react-workshop/src/Kbd.stories.tsx b/apps/react-workshop/src/Kbd.stories.tsx index 0e2cdebf18b..abe5dd4e2f7 100644 --- a/apps/react-workshop/src/Kbd.stories.tsx +++ b/apps/react-workshop/src/Kbd.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Kbd, KbdKeys } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Label.stories.tsx b/apps/react-workshop/src/Label.stories.tsx index 7273411675f..5b448a83c00 100644 --- a/apps/react-workshop/src/Label.stories.tsx +++ b/apps/react-workshop/src/Label.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Input, Label, Text, InputGrid } from '@itwin/itwinui-react'; import type { StoryDefault } from '@ladle/react'; diff --git a/apps/react-workshop/src/LabeledInput.stories.tsx b/apps/react-workshop/src/LabeledInput.stories.tsx index a9b86a77802..a3e792684a1 100644 --- a/apps/react-workshop/src/LabeledInput.stories.tsx +++ b/apps/react-workshop/src/LabeledInput.stories.tsx @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { SvgPlaceholder } from '@itwin/itwinui-icons-react'; import { SvgCamera } from '@itwin/itwinui-icons-react'; -import React from 'react'; import { LabeledInput, StatusMessage } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/LabeledTextarea.stories.tsx b/apps/react-workshop/src/LabeledTextarea.stories.tsx index 7d605774c24..ec604565199 100644 --- a/apps/react-workshop/src/LabeledTextarea.stories.tsx +++ b/apps/react-workshop/src/LabeledTextarea.stories.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { SvgCamera, SvgPlaceholder } from '@itwin/itwinui-icons-react'; -import React from 'react'; import { LabeledTextarea, StatusMessage } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/List.stories.tsx b/apps/react-workshop/src/List.stories.tsx index dc0881a73de..57759b92e25 100644 --- a/apps/react-workshop/src/List.stories.tsx +++ b/apps/react-workshop/src/List.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { List, ListItem } from '@itwin/itwinui-react'; import { SvgCheckmark, SvgPlaceholder } from '@itwin/itwinui-icons-react'; import type { StoryDefault } from '@ladle/react'; diff --git a/apps/react-workshop/src/Modal.stories.tsx b/apps/react-workshop/src/Modal.stories.tsx index bbea7adf1b0..f72eeed23e7 100644 --- a/apps/react-workshop/src/Modal.stories.tsx +++ b/apps/react-workshop/src/Modal.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { Button, Modal, @@ -15,7 +15,7 @@ export default { }; export const Basic = () => { - const [isModalOpen, setIsModalOpen] = React.useState(false); + const [isModalOpen, setIsModalOpen] = useState(false); const closeModal = () => { setIsModalOpen(false); @@ -68,7 +68,7 @@ export const Basic = () => { }; export const NonDismissibleModal = () => { - const [isModalOpen, setIsModalOpen] = React.useState(false); + const [isModalOpen, setIsModalOpen] = useState(false); const closeModal = () => { setIsModalOpen(false); @@ -122,7 +122,7 @@ export const NonDismissibleModal = () => { }; export const OutsideClickAndEscDoesNotClose = () => { - const [isModalOpen, setIsModalOpen] = React.useState(false); + const [isModalOpen, setIsModalOpen] = useState(false); const closeModal = () => { setIsModalOpen(false); @@ -177,7 +177,7 @@ export const OutsideClickAndEscDoesNotClose = () => { }; export const FullPageModal = () => { - const [isModalOpen, setIsModalOpen] = React.useState(false); + const [isModalOpen, setIsModalOpen] = useState(false); const closeModal = () => { setIsModalOpen(false); diff --git a/apps/react-workshop/src/NonIdealState.stories.tsx b/apps/react-workshop/src/NonIdealState.stories.tsx index c5fe1b79bc5..b6bf4564b99 100644 --- a/apps/react-workshop/src/NonIdealState.stories.tsx +++ b/apps/react-workshop/src/NonIdealState.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Anchor, Button, NonIdealState } from '@itwin/itwinui-react'; import { Svg401, diff --git a/apps/react-workshop/src/NotificationMarker.stories.tsx b/apps/react-workshop/src/NotificationMarker.stories.tsx index 8657995d1b2..f17bff9bc69 100644 --- a/apps/react-workshop/src/NotificationMarker.stories.tsx +++ b/apps/react-workshop/src/NotificationMarker.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Text, NotificationMarker, diff --git a/apps/react-workshop/src/ProgressLinear.stories.tsx b/apps/react-workshop/src/ProgressLinear.stories.tsx index b7b6d80bc62..215fa5683ad 100644 --- a/apps/react-workshop/src/ProgressLinear.stories.tsx +++ b/apps/react-workshop/src/ProgressLinear.stories.tsx @@ -7,7 +7,6 @@ import { SvgStatusSuccess, SvgStatusWarning, } from '@itwin/itwinui-icons-react'; -import React from 'react'; import { ProgressLinear, Icon } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/ProgressRadial.stories.tsx b/apps/react-workshop/src/ProgressRadial.stories.tsx index 999ecc23ce7..17a25bc881f 100644 --- a/apps/react-workshop/src/ProgressRadial.stories.tsx +++ b/apps/react-workshop/src/ProgressRadial.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { ProgressRadial } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Radio.stories.tsx b/apps/react-workshop/src/Radio.stories.tsx index 05fa6166c41..543cea20924 100644 --- a/apps/react-workshop/src/Radio.stories.tsx +++ b/apps/react-workshop/src/Radio.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Radio } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/RadioTileGroup.stories.tsx b/apps/react-workshop/src/RadioTileGroup.stories.tsx index 13c3d7b7350..f5dd1f2d881 100644 --- a/apps/react-workshop/src/RadioTileGroup.stories.tsx +++ b/apps/react-workshop/src/RadioTileGroup.stories.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { SvgNetwork, SvgWindows } from '@itwin/itwinui-icons-react'; -import React from 'react'; import { RadioTile, RadioTileGroup } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/SearchBox.stories.tsx b/apps/react-workshop/src/SearchBox.stories.tsx index 73c0c6b5ce5..39e32bc5f9a 100644 --- a/apps/react-workshop/src/SearchBox.stories.tsx +++ b/apps/react-workshop/src/SearchBox.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { SearchBox, Text, Divider } from '@itwin/itwinui-react'; import { SvgCaretDownSmall, SvgCaretUpSmall } from '@itwin/itwinui-icons-react'; @@ -77,7 +77,7 @@ export const Small = () => { }; export const WithCustomAction = () => { - const [expanded, setExpanded] = React.useState(false); + const [expanded, setExpanded] = useState(false); const handleExpand = () => { console.log('Expanding searchbox'); diff --git a/apps/react-workshop/src/SkipToContentLink.stories.tsx b/apps/react-workshop/src/SkipToContentLink.stories.tsx index 53389f9b95a..15ff06ba269 100644 --- a/apps/react-workshop/src/SkipToContentLink.stories.tsx +++ b/apps/react-workshop/src/SkipToContentLink.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { SkipToContentLink, Text, Kbd, Anchor } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/SplitButton.stories.tsx b/apps/react-workshop/src/SplitButton.stories.tsx index e040e573671..07a24eb7059 100644 --- a/apps/react-workshop/src/SplitButton.stories.tsx +++ b/apps/react-workshop/src/SplitButton.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { MenuItem, SplitButton } from '@itwin/itwinui-react'; import type { StoryDefault } from '@ladle/react'; diff --git a/apps/react-workshop/src/Stepper.stories.tsx b/apps/react-workshop/src/Stepper.stories.tsx index e454af220ea..65a128070bd 100644 --- a/apps/react-workshop/src/Stepper.stories.tsx +++ b/apps/react-workshop/src/Stepper.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Stepper, type StepperLocalization } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Surface.stories.tsx b/apps/react-workshop/src/Surface.stories.tsx index 6bd69a0e54b..6ed6e55f9c0 100644 --- a/apps/react-workshop/src/Surface.stories.tsx +++ b/apps/react-workshop/src/Surface.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import * as React from 'react'; import { Surface, Code, diff --git a/apps/react-workshop/src/Tabs.stories.tsx b/apps/react-workshop/src/Tabs.stories.tsx index e83c658563a..66f462ff60a 100644 --- a/apps/react-workshop/src/Tabs.stories.tsx +++ b/apps/react-workshop/src/Tabs.stories.tsx @@ -3,7 +3,7 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { SvgStar } from '@itwin/itwinui-icons-react'; -import React from 'react'; +import { useState } from 'react'; import { Button, Tabs, Tab } from '@itwin/itwinui-react'; export default { @@ -226,7 +226,7 @@ export const SublabelsAndIcons = () => { }; export const HorizontalOverflow = () => { - const [active, setActive] = React.useState('Item 11'); + const [active, setActive] = useState('Item 11'); const tabData = [ { name: 'Item 1', content: 'Tab Content One', disabled: false }, @@ -287,7 +287,7 @@ export const HorizontalOverflow = () => { }; export const VerticalOverflow = () => { - const [active, setActive] = React.useState('Item 11'); + const [active, setActive] = useState('Item 11'); const tabData = [ { name: 'Item 1', content: 'Tab Content One', disabled: false }, @@ -419,7 +419,7 @@ export const Vertical = () => { }; export const LegacyTabs = () => { - const [index, setIndex] = React.useState(0); + const [index, setIndex] = useState(0); const getContent = () => { switch (index) { case 0: diff --git a/apps/react-workshop/src/Tag.stories.tsx b/apps/react-workshop/src/Tag.stories.tsx index 6829891bd50..1cfc8a93f1d 100644 --- a/apps/react-workshop/src/Tag.stories.tsx +++ b/apps/react-workshop/src/Tag.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Tag } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/TagContainer.stories.tsx b/apps/react-workshop/src/TagContainer.stories.tsx index 365dabc8ac7..e4ec4d202a2 100644 --- a/apps/react-workshop/src/TagContainer.stories.tsx +++ b/apps/react-workshop/src/TagContainer.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Tag, TagContainer } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Text.stories.tsx b/apps/react-workshop/src/Text.stories.tsx index 9bf8b3d83c7..7403f159e8d 100644 --- a/apps/react-workshop/src/Text.stories.tsx +++ b/apps/react-workshop/src/Text.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Text } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Textarea.stories.tsx b/apps/react-workshop/src/Textarea.stories.tsx index 226c204a10c..533be54381a 100644 --- a/apps/react-workshop/src/Textarea.stories.tsx +++ b/apps/react-workshop/src/Textarea.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Textarea } from '@itwin/itwinui-react'; export default { diff --git a/apps/react-workshop/src/Tile.stories.tsx b/apps/react-workshop/src/Tile.stories.tsx index c0324c006de..0235ed261b1 100644 --- a/apps/react-workshop/src/Tile.stories.tsx +++ b/apps/react-workshop/src/Tile.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { Badge, Button, @@ -116,7 +116,7 @@ export const AllProps = () => { ); }; export const Actionable = () => { - const [selected, setSelected] = React.useState(false); + const [selected, setSelected] = useState(false); return ( diff --git a/apps/react-workshop/src/TimePicker.stories.tsx b/apps/react-workshop/src/TimePicker.stories.tsx index 1e9e61515ba..59b278abd86 100644 --- a/apps/react-workshop/src/TimePicker.stories.tsx +++ b/apps/react-workshop/src/TimePicker.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { TimePicker, InputWithDecorations, @@ -16,7 +16,7 @@ export default { }; export const Basic = () => { - const [currentDate, setCurrentDate] = React.useState( + const [currentDate, setCurrentDate] = useState( new Date(2021, 4, 11, 14, 55, 22), ); const onChange = (date: Date) => { @@ -55,7 +55,7 @@ export const Basic = () => { }; export const CustomRenderers = () => { - const [currentDate, setCurrentDate] = React.useState( + const [currentDate, setCurrentDate] = useState( new Date(2021, 4, 11, 14, 55, 22), ); const onChange = (date: Date) => { @@ -107,7 +107,7 @@ export const CustomRenderers = () => { }; export const Combined = () => { - const [currentDate, setCurrentDate] = React.useState( + const [currentDate, setCurrentDate] = useState( new Date(2021, 4, 11, 14, 30, 0), ); const onChange = (date: Date) => { diff --git a/apps/react-workshop/src/Toasts.stories.tsx b/apps/react-workshop/src/Toasts.stories.tsx index 4c11008d1ca..6d24dd0ad70 100644 --- a/apps/react-workshop/src/Toasts.stories.tsx +++ b/apps/react-workshop/src/Toasts.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useRef } from 'react'; import { Button, useToaster, ProgressRadial } from '@itwin/itwinui-react'; export default { @@ -206,7 +206,7 @@ export const PositionChanged = () => { export const AnchorToButton = () => { const toaster = useToaster(); - const buttonRef = React.useRef(null); + const buttonRef = useRef(null); const displayPositiveToast = () => { toaster.setSettings({ placement: 'top', diff --git a/apps/react-workshop/src/ToggleSwitch.stories.tsx b/apps/react-workshop/src/ToggleSwitch.stories.tsx index b9d5cbe3fb6..cdd51c8fd08 100644 --- a/apps/react-workshop/src/ToggleSwitch.stories.tsx +++ b/apps/react-workshop/src/ToggleSwitch.stories.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { SvgLightbulb } from '@itwin/itwinui-icons-react'; -import React from 'react'; import { ToggleSwitch } from '@itwin/itwinui-react'; import type { StoryDefault } from '@ladle/react'; diff --git a/apps/react-workshop/src/Tooltip.stories.tsx b/apps/react-workshop/src/Tooltip.stories.tsx index fc2df2a0c39..b2d74a959c7 100644 --- a/apps/react-workshop/src/Tooltip.stories.tsx +++ b/apps/react-workshop/src/Tooltip.stories.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { Button, Tooltip } from '@itwin/itwinui-react'; export default { title: 'Tooltip', diff --git a/apps/react-workshop/src/TransferList.stories.tsx b/apps/react-workshop/src/TransferList.stories.tsx index eff35baab29..b22a8e3a75e 100644 --- a/apps/react-workshop/src/TransferList.stories.tsx +++ b/apps/react-workshop/src/TransferList.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState } from 'react'; import { TransferList, IconButton } from '@itwin/itwinui-react'; import { SvgChevronLeft, @@ -21,7 +21,7 @@ export const Basic = () => { active: boolean; }; - const [optionData, setOptionData] = React.useState([ + const [optionData, setOptionData] = useState([ { name: 'Option 1', active: false }, { name: 'Option 2', active: false }, { name: 'Option 3', active: false }, @@ -30,7 +30,7 @@ export const Basic = () => { { name: 'Option 6', active: false }, ]); - const [appliedData, setAppliedData] = React.useState([ + const [appliedData, setAppliedData] = useState([ { name: 'Option 7', active: false }, ]); @@ -155,7 +155,7 @@ export const WithLabel = () => { active: boolean; }; - const [optionData, setOptionData] = React.useState([ + const [optionData, setOptionData] = useState([ { name: 'Option 1', active: false }, { name: 'Option 2', active: false }, { name: 'Option 3', active: false }, @@ -164,7 +164,7 @@ export const WithLabel = () => { { name: 'Option 6', active: false }, ]); - const [appliedData, setAppliedData] = React.useState([ + const [appliedData, setAppliedData] = useState([ { name: 'Option 7', active: false }, ]); diff --git a/apps/react-workshop/src/Tree.stories.tsx b/apps/react-workshop/src/Tree.stories.tsx index c4638178f47..7263a8a5f25 100644 --- a/apps/react-workshop/src/Tree.stories.tsx +++ b/apps/react-workshop/src/Tree.stories.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import { useState, useCallback, useMemo } from 'react'; import { Tree, TreeNode, @@ -25,29 +25,24 @@ export const Basic = () => { subItems: StoryData[]; }; - const [expandedNodes, setExpandedNodes] = React.useState< - Record - >({ + const [expandedNodes, setExpandedNodes] = useState>({ 'Node-2': true, 'Node-2-1': true, 'Node-3': true, }); - const onNodeExpanded = React.useCallback( - (nodeId: string, isExpanded: boolean) => { - if (isExpanded) { - setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); - console.log(`Expanded node ${nodeId}`); - } else { - setExpandedNodes((oldExpanded) => ({ - ...oldExpanded, - [nodeId]: false, - })); - console.log(`Closed node ${nodeId}`); - } - }, - [], - ); - const generateItem = React.useCallback( + const onNodeExpanded = useCallback((nodeId: string, isExpanded: boolean) => { + if (isExpanded) { + setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); + console.log(`Expanded node ${nodeId}`); + } else { + setExpandedNodes((oldExpanded) => ({ + ...oldExpanded, + [nodeId]: false, + })); + console.log(`Closed node ${nodeId}`); + } + }, []); + const generateItem = useCallback( (index: number, parentNode = '', depth = 0): StoryData => { const keyValue = parentNode ? `${parentNode}-${index}` : `${index}`; return { @@ -65,7 +60,7 @@ export const Basic = () => { [], ); - const data = React.useMemo( + const data = useMemo( () => Array(8) .fill(null) @@ -73,7 +68,7 @@ export const Basic = () => { [generateItem], ); - const getNode = React.useCallback( + const getNode = useCallback( (node: StoryData): NodeData => { return { subNodes: node.subItems, @@ -90,7 +85,7 @@ export const Basic = () => { data={data} getNode={getNode} - nodeRenderer={React.useCallback( + nodeRenderer={useCallback( ({ node, ...rest }) => ( ), @@ -108,14 +103,12 @@ export const Full = () => { subItems: StoryData[]; }; - const [selectedNodes, setSelectedNodes] = React.useState< - Record - >({ + const [selectedNodes, setSelectedNodes] = useState>({ 'Node-0': true, 'Node-3-2': true, 'Node-22': true, }); - const onSelectedNodeChange = React.useCallback( + const onSelectedNodeChange = useCallback( (nodeId: string, isSelected: boolean) => { if (isSelected) { setSelectedNodes((oldSelected) => ({ ...oldSelected, [nodeId]: true })); @@ -131,37 +124,32 @@ export const Full = () => { [], ); - const [expandedNodes, setExpandedNodes] = React.useState< - Record - >({ + const [expandedNodes, setExpandedNodes] = useState>({ 'Node-2': true, 'Node-2-1': true, 'Node-3': true, }); - const onNodeExpanded = React.useCallback( - (nodeId: string, isExpanded: boolean) => { - if (isExpanded) { - setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); - console.log(`Expanded node ${nodeId}`); - } else { - setExpandedNodes((oldExpanded) => ({ - ...oldExpanded, - [nodeId]: false, - })); - console.log(`Closed node ${nodeId}`); - } - }, - [], - ); + const onNodeExpanded = useCallback((nodeId: string, isExpanded: boolean) => { + if (isExpanded) { + setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); + console.log(`Expanded node ${nodeId}`); + } else { + setExpandedNodes((oldExpanded) => ({ + ...oldExpanded, + [nodeId]: false, + })); + console.log(`Closed node ${nodeId}`); + } + }, []); - const [disabledNodes] = React.useState>({ + const [disabledNodes] = useState>({ 'Node-4': true, 'Node-3-0': true, 'Node-6': true, 'Node-10': true, }); - const generateItem = React.useCallback( + const generateItem = useCallback( (index: number, parentNode = '', depth = 0): StoryData => { const keyValue = parentNode ? `${parentNode}-${index}` : `${index}`; return { @@ -179,7 +167,7 @@ export const Full = () => { [], ); - const data = React.useMemo( + const data = useMemo( () => Array(8) .fill(null) @@ -187,7 +175,7 @@ export const Full = () => { [generateItem], ); - const getNode = React.useCallback( + const getNode = useCallback( (node: StoryData): NodeData => { return { subNodes: node.subItems, @@ -206,7 +194,7 @@ export const Full = () => { data={data} getNode={getNode} - nodeRenderer={React.useCallback( + nodeRenderer={useCallback( ({ node, ...rest }) => ( { isLoading?: boolean; }; - const generateItem = React.useCallback((index: number): StoryData => { + const generateItem = useCallback((index: number): StoryData => { return { id: `Node-${index}`, label: `Node ${index}`, @@ -242,16 +230,16 @@ export const AsyncLoading = () => { }; }, []); - const [data, setData] = React.useState(() => + const [data, setData] = useState(() => Array(8) .fill(null) .map((_, index) => generateItem(index)), ); - const [selectedNodes, setSelectedNodes] = React.useState< - Record - >({}); - const onSelectedNodeChange = React.useCallback( + const [selectedNodes, setSelectedNodes] = useState>( + {}, + ); + const onSelectedNodeChange = useCallback( (nodeId: string, isSelected: boolean) => { if (isSelected) { setSelectedNodes((oldSelected) => ({ ...oldSelected, [nodeId]: true })); @@ -267,10 +255,10 @@ export const AsyncLoading = () => { [], ); - const [expandedNodes, setExpandedNodes] = React.useState< - Record - >({}); - const onNodeExpanded = React.useCallback( + const [expandedNodes, setExpandedNodes] = useState>( + {}, + ); + const onNodeExpanded = useCallback( (nodeId: string, isExpanded: boolean, node: StoryData) => { if (isExpanded && !node.subItems.length && node.hasSubNodes) { // Mocking API call @@ -302,7 +290,7 @@ export const AsyncLoading = () => { [], ); - const getNode = React.useCallback( + const getNode = useCallback( (node: StoryData): NodeData => { return { subNodes: @@ -330,7 +318,7 @@ export const AsyncLoading = () => { data={data} getNode={getNode} - nodeRenderer={React.useCallback( + nodeRenderer={useCallback( ({ node, ...rest }) => ( { subItems: StoryData[]; }; - const [selectedNodes, setSelectedNodes] = React.useState< - Record - >({ + const [selectedNodes, setSelectedNodes] = useState>({ 'Node-0': true, 'Node-3-2': true, 'Node-22': true, }); - const onSelectedNodeChange = React.useCallback( + const onSelectedNodeChange = useCallback( (nodeId: string, isSelected: boolean) => { if (isSelected) { setSelectedNodes((oldSelected) => ({ ...oldSelected, [nodeId]: true })); @@ -386,37 +372,32 @@ export const CustomizedExpander = () => { [], ); - const [expandedNodes, setExpandedNodes] = React.useState< - Record - >({ + const [expandedNodes, setExpandedNodes] = useState>({ 'Node-2': true, 'Node-2-1': true, 'Node-3': true, }); - const onNodeExpanded = React.useCallback( - (nodeId: string, isExpanded: boolean) => { - if (isExpanded) { - setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); - console.log(`Expanded node ${nodeId}`); - } else { - setExpandedNodes((oldExpanded) => ({ - ...oldExpanded, - [nodeId]: false, - })); - console.log(`Closed node ${nodeId}`); - } - }, - [], - ); + const onNodeExpanded = useCallback((nodeId: string, isExpanded: boolean) => { + if (isExpanded) { + setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); + console.log(`Expanded node ${nodeId}`); + } else { + setExpandedNodes((oldExpanded) => ({ + ...oldExpanded, + [nodeId]: false, + })); + console.log(`Closed node ${nodeId}`); + } + }, []); - const [disabledNodes] = React.useState({ + const [disabledNodes] = useState({ 'Node-4': true, 'Node-3': true, 'Node-6': true, 'Node-10': true, }); - const isNodeDisabled = React.useCallback( + const isNodeDisabled = useCallback( (nodeId: string) => { return Object.keys(disabledNodes).some( (id) => nodeId === id || nodeId.startsWith(`${id}-`), @@ -425,7 +406,7 @@ export const CustomizedExpander = () => { [disabledNodes], ); - const generateItem = React.useCallback( + const generateItem = useCallback( (index: number, parentNode = '', depth = 0): StoryData => { const keyValue = parentNode ? `${parentNode}-${index}` : `${index}`; return { @@ -443,7 +424,7 @@ export const CustomizedExpander = () => { [], ); - const data = React.useMemo( + const data = useMemo( () => Array(8) .fill(null) @@ -451,7 +432,7 @@ export const CustomizedExpander = () => { [generateItem], ); - const getNode = React.useCallback( + const getNode = useCallback( (node: StoryData): NodeData => { return { subNodes: node.subItems, @@ -470,7 +451,7 @@ export const CustomizedExpander = () => { data={data} getNode={getNode} - nodeRenderer={React.useCallback( + nodeRenderer={useCallback( ({ node, ...rest }) => ( { subItems: StoryData[]; }; - const [selectedNodes, setSelectedNodes] = React.useState< - Record - >({ + const [selectedNodes, setSelectedNodes] = useState>({ 'Node-0': true, 'Node-3-2': true, 'Node-22': true, }); - const onSelectedNodeChange = React.useCallback( + const onSelectedNodeChange = useCallback( (nodeId: string, isSelected: boolean) => { if (isSelected) { setSelectedNodes((oldSelected) => ({ ...oldSelected, [nodeId]: true })); @@ -529,37 +508,32 @@ export const Virtualized = () => { [], ); - const [expandedNodes, setExpandedNodes] = React.useState< - Record - >({ + const [expandedNodes, setExpandedNodes] = useState>({ 'Node-2': true, 'Node-2-1': true, 'Node-3': true, }); - const onNodeExpanded = React.useCallback( - (nodeId: string, isExpanded: boolean) => { - if (isExpanded) { - setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); - console.log(`Expanded node ${nodeId}`); - } else { - setExpandedNodes((oldExpanded) => ({ - ...oldExpanded, - [nodeId]: false, - })); - console.log(`Closed node ${nodeId}`); - } - }, - [], - ); + const onNodeExpanded = useCallback((nodeId: string, isExpanded: boolean) => { + if (isExpanded) { + setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); + console.log(`Expanded node ${nodeId}`); + } else { + setExpandedNodes((oldExpanded) => ({ + ...oldExpanded, + [nodeId]: false, + })); + console.log(`Closed node ${nodeId}`); + } + }, []); - const [disabledNodes] = React.useState>({ + const [disabledNodes] = useState>({ 'Node-4': true, 'Node-3-0': true, 'Node-6': true, 'Node-10': true, }); - const generateItem = React.useCallback( + const generateItem = useCallback( (index: number, parentNode = '', depth = 0): StoryData => { const keyValue = parentNode ? `${parentNode}-${index}` : `${index}`; return { @@ -577,7 +551,7 @@ export const Virtualized = () => { [], ); - const data = React.useMemo( + const data = useMemo( () => Array(100000) .fill(null) @@ -585,7 +559,7 @@ export const Virtualized = () => { [generateItem], ); - const getNode = React.useCallback( + const getNode = useCallback( (node: StoryData): NodeData => { return { subNodes: node.subItems, @@ -606,7 +580,7 @@ export const Virtualized = () => { data={data} getNode={getNode} enableVirtualization - nodeRenderer={React.useCallback( + nodeRenderer={useCallback( ({ node, ...rest }) => ( { subItems: StoryData[]; }; - const [expandedNodes, setExpandedNodes] = React.useState< - Record - >({ + const [expandedNodes, setExpandedNodes] = useState>({ 'Node-2': true, 'Node-2-1': true, 'Node-3': true, }); - const onNodeExpanded = React.useCallback( - (nodeId: string, isExpanded: boolean) => { - if (isExpanded) { - setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); - console.log(`Expanded node ${nodeId}`); - } else { - setExpandedNodes((oldExpanded) => ({ - ...oldExpanded, - [nodeId]: false, - })); - console.log(`Closed node ${nodeId}`); - } - }, - [], - ); - const generateItem = React.useCallback( + const onNodeExpanded = useCallback((nodeId: string, isExpanded: boolean) => { + if (isExpanded) { + setExpandedNodes((oldExpanded) => ({ ...oldExpanded, [nodeId]: true })); + console.log(`Expanded node ${nodeId}`); + } else { + setExpandedNodes((oldExpanded) => ({ + ...oldExpanded, + [nodeId]: false, + })); + console.log(`Closed node ${nodeId}`); + } + }, []); + const generateItem = useCallback( (index: number, parentNode = '', depth = 0): StoryData => { const keyValue = parentNode ? `${parentNode}-${index}` : `${index}`; return { @@ -675,7 +644,7 @@ export const Small = () => { [], ); - const data = React.useMemo( + const data = useMemo( () => Array(8) .fill(null) @@ -683,7 +652,7 @@ export const Small = () => { [generateItem], ); - const getNode = React.useCallback( + const getNode = useCallback( (node: StoryData): NodeData => { return { subNodes: node.subItems, @@ -701,7 +670,7 @@ export const Small = () => { data={data} size='small' getNode={getNode} - nodeRenderer={React.useCallback( + nodeRenderer={useCallback( ({ node, ...rest }) => ( { diff --git a/packages/itwinui-react/src/core/DatePicker/DatePicker.test.tsx b/packages/itwinui-react/src/core/DatePicker/DatePicker.test.tsx index 69ee1a5b355..73ba237f832 100644 --- a/packages/itwinui-react/src/core/DatePicker/DatePicker.test.tsx +++ b/packages/itwinui-react/src/core/DatePicker/DatePicker.test.tsx @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { fireEvent, render, screen } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; -import * as React from 'react'; import { DatePicker } from './DatePicker.js'; const selectedDaySelector = '.iui-calendar-day-selected'; diff --git a/packages/itwinui-react/src/core/Dialog/Dialog.test.tsx b/packages/itwinui-react/src/core/Dialog/Dialog.test.tsx index 44022e16c1d..30c5c2fcc6d 100644 --- a/packages/itwinui-react/src/core/Dialog/Dialog.test.tsx +++ b/packages/itwinui-react/src/core/Dialog/Dialog.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, act } from '@testing-library/react'; import { Dialog } from './Dialog.js'; import { Button } from '../Buttons/Button.js'; diff --git a/packages/itwinui-react/src/core/Dialog/DialogBackdrop.test.tsx b/packages/itwinui-react/src/core/Dialog/DialogBackdrop.test.tsx index 274d7dc3c6b..6a5108d18fb 100644 --- a/packages/itwinui-react/src/core/Dialog/DialogBackdrop.test.tsx +++ b/packages/itwinui-react/src/core/Dialog/DialogBackdrop.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { DialogBackdrop } from './DialogBackdrop.js'; import { userEvent } from '@testing-library/user-event'; diff --git a/packages/itwinui-react/src/core/Dialog/DialogButtonBar.test.tsx b/packages/itwinui-react/src/core/Dialog/DialogButtonBar.test.tsx index 95e56c6061e..8c980cf7eb3 100644 --- a/packages/itwinui-react/src/core/Dialog/DialogButtonBar.test.tsx +++ b/packages/itwinui-react/src/core/Dialog/DialogButtonBar.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render, screen } from '@testing-library/react'; -import * as React from 'react'; import { Button } from '../Buttons/Button.js'; import { DialogButtonBar } from './DialogButtonBar.js'; diff --git a/packages/itwinui-react/src/core/Dialog/DialogContent.test.tsx b/packages/itwinui-react/src/core/Dialog/DialogContent.test.tsx index 0060ee8e5b4..24d79ce63a6 100644 --- a/packages/itwinui-react/src/core/Dialog/DialogContent.test.tsx +++ b/packages/itwinui-react/src/core/Dialog/DialogContent.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render, screen } from '@testing-library/react'; -import * as React from 'react'; import { DialogContent } from './DialogContent.js'; it('should render in its most basic state', () => { diff --git a/packages/itwinui-react/src/core/Dialog/DialogMain.test.tsx b/packages/itwinui-react/src/core/Dialog/DialogMain.test.tsx index 9fa6cae8b2f..f48137eb7fe 100644 --- a/packages/itwinui-react/src/core/Dialog/DialogMain.test.tsx +++ b/packages/itwinui-react/src/core/Dialog/DialogMain.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { DialogMain } from './DialogMain.js'; import { DialogTitleBar } from './DialogTitleBar.js'; diff --git a/packages/itwinui-react/src/core/Dialog/DialogTitleBar.test.tsx b/packages/itwinui-react/src/core/Dialog/DialogTitleBar.test.tsx index 1fdb91f47fa..a78298322ee 100644 --- a/packages/itwinui-react/src/core/Dialog/DialogTitleBar.test.tsx +++ b/packages/itwinui-react/src/core/Dialog/DialogTitleBar.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { DialogTitleBar } from './DialogTitleBar.js'; diff --git a/packages/itwinui-react/src/core/Dialog/DialogTitleBarTitle.test.tsx b/packages/itwinui-react/src/core/Dialog/DialogTitleBarTitle.test.tsx index 725ae38ed65..8771face968 100644 --- a/packages/itwinui-react/src/core/Dialog/DialogTitleBarTitle.test.tsx +++ b/packages/itwinui-react/src/core/Dialog/DialogTitleBarTitle.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { DialogTitleBarTitle } from './DialogTitleBarTitle.js'; diff --git a/packages/itwinui-react/src/core/Divider/Divider.test.tsx b/packages/itwinui-react/src/core/Divider/Divider.test.tsx index 6a20d7b361c..7eb8af20243 100644 --- a/packages/itwinui-react/src/core/Divider/Divider.test.tsx +++ b/packages/itwinui-react/src/core/Divider/Divider.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Divider } from './Divider.js'; diff --git a/packages/itwinui-react/src/core/DropdownMenu/DropdownMenu.test.tsx b/packages/itwinui-react/src/core/DropdownMenu/DropdownMenu.test.tsx index e8c638b8f57..88d2a128702 100644 --- a/packages/itwinui-react/src/core/DropdownMenu/DropdownMenu.test.tsx +++ b/packages/itwinui-react/src/core/DropdownMenu/DropdownMenu.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { fireEvent, render, screen } from '@testing-library/react'; import { DropdownMenu, type DropdownMenuProps } from './DropdownMenu.js'; import { Button } from '../Buttons/Button.js'; diff --git a/packages/itwinui-react/src/core/ExpandableBlock/ExpandableBlock.test.tsx b/packages/itwinui-react/src/core/ExpandableBlock/ExpandableBlock.test.tsx index 55fba7a9603..e8583f93d6c 100644 --- a/packages/itwinui-react/src/core/ExpandableBlock/ExpandableBlock.test.tsx +++ b/packages/itwinui-react/src/core/ExpandableBlock/ExpandableBlock.test.tsx @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { fireEvent, render, screen } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; -import * as React from 'react'; import { StatusIconMap, SvgMore as SvgPlaceholder } from '../../utils/index.js'; import * as UseId from '../../utils/hooks/useId.js'; diff --git a/packages/itwinui-react/src/core/Fieldset/Fieldset.test.tsx b/packages/itwinui-react/src/core/Fieldset/Fieldset.test.tsx index 3098006aa45..984b63105ee 100644 --- a/packages/itwinui-react/src/core/Fieldset/Fieldset.test.tsx +++ b/packages/itwinui-react/src/core/Fieldset/Fieldset.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { fireEvent, render } from '@testing-library/react'; import { Fieldset } from './Fieldset.js'; import { InputGroup } from '../InputGroup/InputGroup.js'; diff --git a/packages/itwinui-react/src/core/FileUpload/FileUpload.test.tsx b/packages/itwinui-react/src/core/FileUpload/FileUpload.test.tsx index 50abefc1de8..a6c5f5014b3 100644 --- a/packages/itwinui-react/src/core/FileUpload/FileUpload.test.tsx +++ b/packages/itwinui-react/src/core/FileUpload/FileUpload.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { fireEvent, render } from '@testing-library/react'; import { FileUpload } from './FileUpload.js'; diff --git a/packages/itwinui-react/src/core/FileUpload/FileUploadTemplate.test.tsx b/packages/itwinui-react/src/core/FileUpload/FileUploadTemplate.test.tsx index 210621620e9..04a635b7c7a 100644 --- a/packages/itwinui-react/src/core/FileUpload/FileUploadTemplate.test.tsx +++ b/packages/itwinui-react/src/core/FileUpload/FileUploadTemplate.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { fireEvent, render } from '@testing-library/react'; import { FileUploadTemplate } from './FileUploadTemplate.js'; import { SvgUpload } from '../../utils/index.js'; diff --git a/packages/itwinui-react/src/core/Flex/Flex.test.tsx b/packages/itwinui-react/src/core/Flex/Flex.test.tsx index 7cf6610639a..863f885bf62 100644 --- a/packages/itwinui-react/src/core/Flex/Flex.test.tsx +++ b/packages/itwinui-react/src/core/Flex/Flex.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Flex } from './Flex.js'; diff --git a/packages/itwinui-react/src/core/Footer/FooterItem.test.tsx b/packages/itwinui-react/src/core/Footer/FooterItem.test.tsx index 6b409befbf5..746f19befe2 100644 --- a/packages/itwinui-react/src/core/Footer/FooterItem.test.tsx +++ b/packages/itwinui-react/src/core/Footer/FooterItem.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { FooterItem } from './FooterItem.js'; it('should render with misc props', () => { diff --git a/packages/itwinui-react/src/core/Footer/FooterList.test.tsx b/packages/itwinui-react/src/core/Footer/FooterList.test.tsx index 7fe9fc956c0..481aee4487a 100644 --- a/packages/itwinui-react/src/core/Footer/FooterList.test.tsx +++ b/packages/itwinui-react/src/core/Footer/FooterList.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { FooterList } from './FooterList.js'; diff --git a/packages/itwinui-react/src/core/Footer/FooterSeparator.test.tsx b/packages/itwinui-react/src/core/Footer/FooterSeparator.test.tsx index 6b95d8a6c0d..5c5c99d2a15 100644 --- a/packages/itwinui-react/src/core/Footer/FooterSeparator.test.tsx +++ b/packages/itwinui-react/src/core/Footer/FooterSeparator.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { FooterSeparator } from './FooterSeparator.js'; diff --git a/packages/itwinui-react/src/core/Header/Header.test.tsx b/packages/itwinui-react/src/core/Header/Header.test.tsx index cb8d51d4f8b..474e8c7762b 100644 --- a/packages/itwinui-react/src/core/Header/Header.test.tsx +++ b/packages/itwinui-react/src/core/Header/Header.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Header } from './Header.js'; diff --git a/packages/itwinui-react/src/core/Header/HeaderBreadcrumbs.test.tsx b/packages/itwinui-react/src/core/Header/HeaderBreadcrumbs.test.tsx index bbfaea95704..765829d52d1 100644 --- a/packages/itwinui-react/src/core/Header/HeaderBreadcrumbs.test.tsx +++ b/packages/itwinui-react/src/core/Header/HeaderBreadcrumbs.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { HeaderBreadcrumbs } from './HeaderBreadcrumbs.js'; diff --git a/packages/itwinui-react/src/core/Header/HeaderButton.test.tsx b/packages/itwinui-react/src/core/Header/HeaderButton.test.tsx index 154654d723c..e72415a1d1b 100644 --- a/packages/itwinui-react/src/core/Header/HeaderButton.test.tsx +++ b/packages/itwinui-react/src/core/Header/HeaderButton.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { SvgMore as SvgPlaceholder, diff --git a/packages/itwinui-react/src/core/Header/HeaderLogo.test.tsx b/packages/itwinui-react/src/core/Header/HeaderLogo.test.tsx index 2de9af48983..1bef17048f4 100644 --- a/packages/itwinui-react/src/core/Header/HeaderLogo.test.tsx +++ b/packages/itwinui-react/src/core/Header/HeaderLogo.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { SvgMore as SvgPlaceholder } from '../../utils/index.js'; diff --git a/packages/itwinui-react/src/core/Icon/Icon.test.tsx b/packages/itwinui-react/src/core/Icon/Icon.test.tsx index c826b11028a..403bf211ca0 100644 --- a/packages/itwinui-react/src/core/Icon/Icon.test.tsx +++ b/packages/itwinui-react/src/core/Icon/Icon.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { Icon } from './Icon.js'; diff --git a/packages/itwinui-react/src/core/InformationPanel/InformationPanel.test.tsx b/packages/itwinui-react/src/core/InformationPanel/InformationPanel.test.tsx index c0d88bf4f1a..21d3ad20968 100644 --- a/packages/itwinui-react/src/core/InformationPanel/InformationPanel.test.tsx +++ b/packages/itwinui-react/src/core/InformationPanel/InformationPanel.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { fireEvent, render, act } from '@testing-library/react'; import { InformationPanel } from './InformationPanel.js'; diff --git a/packages/itwinui-react/src/core/InformationPanel/InformationPanelContent.test.tsx b/packages/itwinui-react/src/core/InformationPanel/InformationPanelContent.test.tsx index eddd2771f08..f5a7f21a809 100644 --- a/packages/itwinui-react/src/core/InformationPanel/InformationPanelContent.test.tsx +++ b/packages/itwinui-react/src/core/InformationPanel/InformationPanelContent.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { InformationPanelContent } from './InformationPanelContent.js'; diff --git a/packages/itwinui-react/src/core/Input/Input.test.tsx b/packages/itwinui-react/src/core/Input/Input.test.tsx index 79dd331bbea..321a842b3fd 100644 --- a/packages/itwinui-react/src/core/Input/Input.test.tsx +++ b/packages/itwinui-react/src/core/Input/Input.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { Input } from './Input.js'; diff --git a/packages/itwinui-react/src/core/InputGrid/InputGrid.test.tsx b/packages/itwinui-react/src/core/InputGrid/InputGrid.test.tsx index 97932b52175..8b6141be2a2 100644 --- a/packages/itwinui-react/src/core/InputGrid/InputGrid.test.tsx +++ b/packages/itwinui-react/src/core/InputGrid/InputGrid.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { InputGrid } from './InputGrid.js'; import { StatusMessage } from '../StatusMessage/StatusMessage.js'; diff --git a/packages/itwinui-react/src/core/InputGroup/InputGroup.test.tsx b/packages/itwinui-react/src/core/InputGroup/InputGroup.test.tsx index b06847134ee..653a36dcdfa 100644 --- a/packages/itwinui-react/src/core/InputGroup/InputGroup.test.tsx +++ b/packages/itwinui-react/src/core/InputGroup/InputGroup.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { Checkbox } from '../Checkbox/Checkbox.js'; import { Radio } from '../Radio/Radio.js'; diff --git a/packages/itwinui-react/src/core/InputWithDecorations/InputWithDecorations.test.tsx b/packages/itwinui-react/src/core/InputWithDecorations/InputWithDecorations.test.tsx index 08397a8b984..29f6e880d2c 100644 --- a/packages/itwinui-react/src/core/InputWithDecorations/InputWithDecorations.test.tsx +++ b/packages/itwinui-react/src/core/InputWithDecorations/InputWithDecorations.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { InputWithDecorations } from './InputWithDecorations.js'; import { SvgAirplane } from '@itwin/itwinui-icons-react'; diff --git a/packages/itwinui-react/src/core/Label/Label.test.tsx b/packages/itwinui-react/src/core/Label/Label.test.tsx index 3a9de2cfbae..b56aaff27b5 100644 --- a/packages/itwinui-react/src/core/Label/Label.test.tsx +++ b/packages/itwinui-react/src/core/Label/Label.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Label } from './Label.js'; diff --git a/packages/itwinui-react/src/core/LabeledInput/LabeledInput.test.tsx b/packages/itwinui-react/src/core/LabeledInput/LabeledInput.test.tsx index 60a19b34b85..960b668ed24 100644 --- a/packages/itwinui-react/src/core/LabeledInput/LabeledInput.test.tsx +++ b/packages/itwinui-react/src/core/LabeledInput/LabeledInput.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { LabeledInput } from './LabeledInput.js'; diff --git a/packages/itwinui-react/src/core/LabeledSelect/LabeledSelect.types-test.tsx b/packages/itwinui-react/src/core/LabeledSelect/LabeledSelect.types-test.tsx index 30c717f53c4..13d5a0421da 100644 --- a/packages/itwinui-react/src/core/LabeledSelect/LabeledSelect.types-test.tsx +++ b/packages/itwinui-react/src/core/LabeledSelect/LabeledSelect.types-test.tsx @@ -7,7 +7,7 @@ * (e.g. react-workshop, unit tests, etc.) */ -import React, { useRef } from 'react'; +import { useRef } from 'react'; import { LabeledSelect } from './LabeledSelect.js'; () => { diff --git a/packages/itwinui-react/src/core/LabeledTextarea/LabeledTextarea.test.tsx b/packages/itwinui-react/src/core/LabeledTextarea/LabeledTextarea.test.tsx index 7282ef7ca2e..23574a94050 100644 --- a/packages/itwinui-react/src/core/LabeledTextarea/LabeledTextarea.test.tsx +++ b/packages/itwinui-react/src/core/LabeledTextarea/LabeledTextarea.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { LabeledTextarea } from './LabeledTextarea.js'; diff --git a/packages/itwinui-react/src/core/LinkAction/LinkAction.test.tsx b/packages/itwinui-react/src/core/LinkAction/LinkAction.test.tsx index 158bda98920..8e08b1e7f6a 100644 --- a/packages/itwinui-react/src/core/LinkAction/LinkAction.test.tsx +++ b/packages/itwinui-react/src/core/LinkAction/LinkAction.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { LinkBox, LinkAction } from './LinkAction.js'; diff --git a/packages/itwinui-react/src/core/List/List.test.tsx b/packages/itwinui-react/src/core/List/List.test.tsx index 7ec3a414579..70b2b512883 100644 --- a/packages/itwinui-react/src/core/List/List.test.tsx +++ b/packages/itwinui-react/src/core/List/List.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { List } from './List.js'; diff --git a/packages/itwinui-react/src/core/List/ListItem.test.tsx b/packages/itwinui-react/src/core/List/ListItem.test.tsx index 770449c46d7..19c89de0fc5 100644 --- a/packages/itwinui-react/src/core/List/ListItem.test.tsx +++ b/packages/itwinui-react/src/core/List/ListItem.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { ListItem } from './ListItem.js'; diff --git a/packages/itwinui-react/src/core/Menu/MenuItem.test.tsx b/packages/itwinui-react/src/core/Menu/MenuItem.test.tsx index 74d33afe2d6..7fa4b5f7211 100644 --- a/packages/itwinui-react/src/core/Menu/MenuItem.test.tsx +++ b/packages/itwinui-react/src/core/Menu/MenuItem.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { act, fireEvent, render, screen } from '@testing-library/react'; import { MenuItem } from './MenuItem.js'; import { SvgSmileyHappy } from '../../utils/index.js'; diff --git a/packages/itwinui-react/src/core/Menu/MenuItemSkeleton.test.tsx b/packages/itwinui-react/src/core/Menu/MenuItemSkeleton.test.tsx index ce51bcd48d1..20db29a3f66 100644 --- a/packages/itwinui-react/src/core/Menu/MenuItemSkeleton.test.tsx +++ b/packages/itwinui-react/src/core/Menu/MenuItemSkeleton.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { MenuItemSkeleton } from './MenuItemSkeleton.js'; diff --git a/packages/itwinui-react/src/core/NonIdealState/ErrorPage.test.tsx b/packages/itwinui-react/src/core/NonIdealState/ErrorPage.test.tsx index 4a292e9eff3..536ba2e6c04 100644 --- a/packages/itwinui-react/src/core/NonIdealState/ErrorPage.test.tsx +++ b/packages/itwinui-react/src/core/NonIdealState/ErrorPage.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render, screen, waitFor } from '@testing-library/react'; -import * as React from 'react'; import { ErrorPage, type ErrorPageType } from './ErrorPage.js'; import { Svg401, diff --git a/packages/itwinui-react/src/core/NonIdealState/NonIdealState.test.tsx b/packages/itwinui-react/src/core/NonIdealState/NonIdealState.test.tsx index f75c074c53f..98c98b11211 100644 --- a/packages/itwinui-react/src/core/NonIdealState/NonIdealState.test.tsx +++ b/packages/itwinui-react/src/core/NonIdealState/NonIdealState.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { NonIdealState } from './NonIdealState.js'; diff --git a/packages/itwinui-react/src/core/NotificationMarker/NotificationMarker.test.tsx b/packages/itwinui-react/src/core/NotificationMarker/NotificationMarker.test.tsx index 55dbcb94aea..a64f6eac908 100644 --- a/packages/itwinui-react/src/core/NotificationMarker/NotificationMarker.test.tsx +++ b/packages/itwinui-react/src/core/NotificationMarker/NotificationMarker.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { NotificationMarker } from './NotificationMarker.js'; diff --git a/packages/itwinui-react/src/core/Overlay/Overlay.test.tsx b/packages/itwinui-react/src/core/Overlay/Overlay.test.tsx index 4b65b0d4de3..c729b9f62bb 100644 --- a/packages/itwinui-react/src/core/Overlay/Overlay.test.tsx +++ b/packages/itwinui-react/src/core/Overlay/Overlay.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { Overlay } from './Overlay.js'; diff --git a/packages/itwinui-react/src/core/Overlay/Overlay.tsx b/packages/itwinui-react/src/core/Overlay/Overlay.tsx index ec187ecfcc2..76cad96e2e1 100644 --- a/packages/itwinui-react/src/core/Overlay/Overlay.tsx +++ b/packages/itwinui-react/src/core/Overlay/Overlay.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import * as React from 'react'; import { Box, polymorphic } from '../../utils/index.js'; import type { PolymorphicForwardRefComponent } from '../../utils/index.js'; diff --git a/packages/itwinui-react/src/core/Popover/Popover.test.tsx b/packages/itwinui-react/src/core/Popover/Popover.test.tsx index 759de38b2d7..d2559f9690c 100644 --- a/packages/itwinui-react/src/core/Popover/Popover.test.tsx +++ b/packages/itwinui-react/src/core/Popover/Popover.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { Popover } from './Popover.js'; import { userEvent } from '@testing-library/user-event'; diff --git a/packages/itwinui-react/src/core/ProgressIndicators/ProgressLinear.test.tsx b/packages/itwinui-react/src/core/ProgressIndicators/ProgressLinear.test.tsx index 14ada51055c..596e570abc2 100644 --- a/packages/itwinui-react/src/core/ProgressIndicators/ProgressLinear.test.tsx +++ b/packages/itwinui-react/src/core/ProgressIndicators/ProgressLinear.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { act, render, screen } from '@testing-library/react'; import { ProgressLinear } from './ProgressLinear.js'; diff --git a/packages/itwinui-react/src/core/ProgressIndicators/ProgressRadial.test.tsx b/packages/itwinui-react/src/core/ProgressIndicators/ProgressRadial.test.tsx index 428704da49f..b11d4170617 100644 --- a/packages/itwinui-react/src/core/ProgressIndicators/ProgressRadial.test.tsx +++ b/packages/itwinui-react/src/core/ProgressIndicators/ProgressRadial.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { act, render } from '@testing-library/react'; import { ProgressRadial } from './ProgressRadial.js'; diff --git a/packages/itwinui-react/src/core/Radio/Radio.test.tsx b/packages/itwinui-react/src/core/Radio/Radio.test.tsx index b1e9ed48a39..a63e5a55c09 100644 --- a/packages/itwinui-react/src/core/Radio/Radio.test.tsx +++ b/packages/itwinui-react/src/core/Radio/Radio.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render, screen } from '@testing-library/react'; -import * as React from 'react'; import { Radio } from './Radio.js'; diff --git a/packages/itwinui-react/src/core/RadioTiles/RadioTile.test.tsx b/packages/itwinui-react/src/core/RadioTiles/RadioTile.test.tsx index 3ead77028d6..ee2b4eb4523 100644 --- a/packages/itwinui-react/src/core/RadioTiles/RadioTile.test.tsx +++ b/packages/itwinui-react/src/core/RadioTiles/RadioTile.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { RadioTile } from './RadioTile.js'; diff --git a/packages/itwinui-react/src/core/RadioTiles/RadioTileGroup.test.tsx b/packages/itwinui-react/src/core/RadioTiles/RadioTileGroup.test.tsx index 5b680cb59e6..858156d9d92 100644 --- a/packages/itwinui-react/src/core/RadioTiles/RadioTileGroup.test.tsx +++ b/packages/itwinui-react/src/core/RadioTiles/RadioTileGroup.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { RadioTileGroup } from './RadioTileGroup.js'; diff --git a/packages/itwinui-react/src/core/SearchBox/SearchBox.test.tsx b/packages/itwinui-react/src/core/SearchBox/SearchBox.test.tsx index 36e31ee38dd..f06df9fb358 100644 --- a/packages/itwinui-react/src/core/SearchBox/SearchBox.test.tsx +++ b/packages/itwinui-react/src/core/SearchBox/SearchBox.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { render } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; import { SearchBox } from './SearchBox.js'; diff --git a/packages/itwinui-react/src/core/Select/Select.types-test.tsx b/packages/itwinui-react/src/core/Select/Select.types-test.tsx index 02d17dbeee0..2df006c1cba 100644 --- a/packages/itwinui-react/src/core/Select/Select.types-test.tsx +++ b/packages/itwinui-react/src/core/Select/Select.types-test.tsx @@ -7,7 +7,7 @@ * (e.g. react-workshop, unit tests, etc.) */ -import React, { useRef } from 'react'; +import { useRef } from 'react'; import { Select } from './Select.js'; // ---------------------------------------------------------------------------- diff --git a/packages/itwinui-react/src/core/SideNavigation/SidenavSubmenu.test.tsx b/packages/itwinui-react/src/core/SideNavigation/SidenavSubmenu.test.tsx index 66713e5f1e7..5bd4a1546be 100644 --- a/packages/itwinui-react/src/core/SideNavigation/SidenavSubmenu.test.tsx +++ b/packages/itwinui-react/src/core/SideNavigation/SidenavSubmenu.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { SvgMore } from '../../utils/index.js'; diff --git a/packages/itwinui-react/src/core/SkipToContentLink/SkipToContentLink.test.tsx b/packages/itwinui-react/src/core/SkipToContentLink/SkipToContentLink.test.tsx index 24ddb2a7c34..89007915ccc 100644 --- a/packages/itwinui-react/src/core/SkipToContentLink/SkipToContentLink.test.tsx +++ b/packages/itwinui-react/src/core/SkipToContentLink/SkipToContentLink.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { SkipToContentLink } from './SkipToContentLink.js'; diff --git a/packages/itwinui-react/src/core/Slider/Slider.test.tsx b/packages/itwinui-react/src/core/Slider/Slider.test.tsx index 47d6de017a6..97126782146 100644 --- a/packages/itwinui-react/src/core/Slider/Slider.test.tsx +++ b/packages/itwinui-react/src/core/Slider/Slider.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { act, fireEvent, render } from '@testing-library/react'; -import * as React from 'react'; import { Slider } from './Slider.js'; import { userEvent } from '@testing-library/user-event'; diff --git a/packages/itwinui-react/src/core/StatusMessage/StatusMessage.test.tsx b/packages/itwinui-react/src/core/StatusMessage/StatusMessage.test.tsx index f4a86eea466..86ce36feb17 100644 --- a/packages/itwinui-react/src/core/StatusMessage/StatusMessage.test.tsx +++ b/packages/itwinui-react/src/core/StatusMessage/StatusMessage.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { StatusMessage } from './StatusMessage.js'; diff --git a/packages/itwinui-react/src/core/Stepper/Stepper.test.tsx b/packages/itwinui-react/src/core/Stepper/Stepper.test.tsx index 750c702c987..fa9441c72c0 100644 --- a/packages/itwinui-react/src/core/Stepper/Stepper.test.tsx +++ b/packages/itwinui-react/src/core/Stepper/Stepper.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { screen, render, fireEvent, act } from '@testing-library/react'; -import * as React from 'react'; import { Stepper } from './Stepper.js'; it('should render all step names and numbers in default stepper', () => { diff --git a/packages/itwinui-react/src/core/Stepper/StepperStep.test.tsx b/packages/itwinui-react/src/core/Stepper/StepperStep.test.tsx index f74efa28355..7b94e136f97 100644 --- a/packages/itwinui-react/src/core/Stepper/StepperStep.test.tsx +++ b/packages/itwinui-react/src/core/Stepper/StepperStep.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { fireEvent, render } from '@testing-library/react'; -import * as React from 'react'; import { StepperStep } from './StepperStep.js'; describe('Stepper step (default)', () => { diff --git a/packages/itwinui-react/src/core/Stepper/WorkflowDiagram.test.tsx b/packages/itwinui-react/src/core/Stepper/WorkflowDiagram.test.tsx index 1ad0ad4bb93..c28d7bfc64b 100644 --- a/packages/itwinui-react/src/core/Stepper/WorkflowDiagram.test.tsx +++ b/packages/itwinui-react/src/core/Stepper/WorkflowDiagram.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { screen, render, fireEvent, act } from '@testing-library/react'; -import * as React from 'react'; import { WorkflowDiagram } from './WorkflowDiagram.js'; it('should display all step names in default workflow diagram', () => { diff --git a/packages/itwinui-react/src/core/Stepper/WorkflowDiagramStep.test.tsx b/packages/itwinui-react/src/core/Stepper/WorkflowDiagramStep.test.tsx index cfdfb73e4a7..49d20dcd4b7 100644 --- a/packages/itwinui-react/src/core/Stepper/WorkflowDiagramStep.test.tsx +++ b/packages/itwinui-react/src/core/Stepper/WorkflowDiagramStep.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { WorkflowDiagramStep } from './WorkflowDiagramStep.js'; it('should render correctly', () => { diff --git a/packages/itwinui-react/src/core/Surface/Surface.test.tsx b/packages/itwinui-react/src/core/Surface/Surface.test.tsx index 2d2acb85ae8..03f6ce89d42 100644 --- a/packages/itwinui-react/src/core/Surface/Surface.test.tsx +++ b/packages/itwinui-react/src/core/Surface/Surface.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Surface } from './Surface.js'; diff --git a/packages/itwinui-react/src/core/Table/TablePaginator.test.tsx b/packages/itwinui-react/src/core/Table/TablePaginator.test.tsx index 26e66cb4de3..ccb8544f9a9 100644 --- a/packages/itwinui-react/src/core/Table/TablePaginator.test.tsx +++ b/packages/itwinui-react/src/core/Table/TablePaginator.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { fireEvent, render, screen } from '@testing-library/react'; import { TablePaginator, type TablePaginatorProps } from './TablePaginator.js'; import * as UseOverflow from '../../utils/hooks/useOverflow.js'; diff --git a/packages/itwinui-react/src/core/Table/cells/DefaultCell.test.tsx b/packages/itwinui-react/src/core/Table/cells/DefaultCell.test.tsx index bb78d10850c..e5b794dd65b 100644 --- a/packages/itwinui-react/src/core/Table/cells/DefaultCell.test.tsx +++ b/packages/itwinui-react/src/core/Table/cells/DefaultCell.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { DefaultCell } from './DefaultCell.js'; it('should merge className/style with cellElementProps', () => { diff --git a/packages/itwinui-react/src/core/Table/cells/EditableCell.test.tsx b/packages/itwinui-react/src/core/Table/cells/EditableCell.test.tsx index 47ffebf67e1..ad40f0b7162 100644 --- a/packages/itwinui-react/src/core/Table/cells/EditableCell.test.tsx +++ b/packages/itwinui-react/src/core/Table/cells/EditableCell.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { EditableCell } from './EditableCell.js'; it('should merge className/style with cellElementProps', () => { diff --git a/packages/itwinui-react/src/core/Table/columns/selectionColumn.tsx b/packages/itwinui-react/src/core/Table/columns/selectionColumn.tsx index a8bbcf7b0f0..b7f9c084eed 100644 --- a/packages/itwinui-react/src/core/Table/columns/selectionColumn.tsx +++ b/packages/itwinui-react/src/core/Table/columns/selectionColumn.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import type { CellProps, CellRendererProps, diff --git a/packages/itwinui-react/src/core/Table/filters/DateRangeFilter/DatePickerInput.test.tsx b/packages/itwinui-react/src/core/Table/filters/DateRangeFilter/DatePickerInput.test.tsx index bd2941c84bc..14e60a503d0 100644 --- a/packages/itwinui-react/src/core/Table/filters/DateRangeFilter/DatePickerInput.test.tsx +++ b/packages/itwinui-react/src/core/Table/filters/DateRangeFilter/DatePickerInput.test.tsx @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { fireEvent, render, screen } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; -import * as React from 'react'; import { DatePickerInput, type DatePickerInputProps, diff --git a/packages/itwinui-react/src/core/Table/filters/DateRangeFilter/DateRangeFilter.test.tsx b/packages/itwinui-react/src/core/Table/filters/DateRangeFilter/DateRangeFilter.test.tsx index 2f1d187cd59..5eb250cacde 100644 --- a/packages/itwinui-react/src/core/Table/filters/DateRangeFilter/DateRangeFilter.test.tsx +++ b/packages/itwinui-react/src/core/Table/filters/DateRangeFilter/DateRangeFilter.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { act, fireEvent, render, screen } from '@testing-library/react'; -import * as React from 'react'; import type { HeaderGroup } from '../../../../react-table/react-table.js'; import { DateRangeFilter, diff --git a/packages/itwinui-react/src/core/Table/filters/FilterButtonBar.test.tsx b/packages/itwinui-react/src/core/Table/filters/FilterButtonBar.test.tsx index a022ef46220..98b18a1b3ad 100644 --- a/packages/itwinui-react/src/core/Table/filters/FilterButtonBar.test.tsx +++ b/packages/itwinui-react/src/core/Table/filters/FilterButtonBar.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { FilterButtonBar, diff --git a/packages/itwinui-react/src/core/Table/filters/FilterToggle.test.tsx b/packages/itwinui-react/src/core/Table/filters/FilterToggle.test.tsx index e36a7c9e9c9..2689bebeb5e 100644 --- a/packages/itwinui-react/src/core/Table/filters/FilterToggle.test.tsx +++ b/packages/itwinui-react/src/core/Table/filters/FilterToggle.test.tsx @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { render, type RenderResult, screen } from '@testing-library/react'; -import * as React from 'react'; import type { HeaderGroup } from '../../../react-table/react-table.js'; import { FilterToggle, type FilterToggleProps } from './FilterToggle.js'; import { tableFilters } from './tableFilters.js'; diff --git a/packages/itwinui-react/src/core/Table/filters/NumberRangeFilter/NumberRangeFilter.test.tsx b/packages/itwinui-react/src/core/Table/filters/NumberRangeFilter/NumberRangeFilter.test.tsx index 7a5bb34f1d5..45e3f27288e 100644 --- a/packages/itwinui-react/src/core/Table/filters/NumberRangeFilter/NumberRangeFilter.test.tsx +++ b/packages/itwinui-react/src/core/Table/filters/NumberRangeFilter/NumberRangeFilter.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { fireEvent, render, screen } from '@testing-library/react'; -import * as React from 'react'; import type { HeaderGroup } from '../../../../react-table/react-table.js'; import { NumberRangeFilter } from './NumberRangeFilter.js'; import type { NumberRangeFilterProps } from './NumberRangeFilter.js'; diff --git a/packages/itwinui-react/src/core/Table/filters/TextFilter/TextFilter.test.tsx b/packages/itwinui-react/src/core/Table/filters/TextFilter/TextFilter.test.tsx index 2d9bfddcd2e..a2966808135 100644 --- a/packages/itwinui-react/src/core/Table/filters/TextFilter/TextFilter.test.tsx +++ b/packages/itwinui-react/src/core/Table/filters/TextFilter/TextFilter.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { fireEvent, render, screen } from '@testing-library/react'; -import * as React from 'react'; import type { HeaderGroup } from '../../../../react-table/react-table.js'; import type { TableFilterProps } from '../types.js'; import { TextFilter } from './TextFilter.js'; diff --git a/packages/itwinui-react/src/core/Tag/Tag.test.tsx b/packages/itwinui-react/src/core/Tag/Tag.test.tsx index a25b27956f6..b5c354ca8d7 100644 --- a/packages/itwinui-react/src/core/Tag/Tag.test.tsx +++ b/packages/itwinui-react/src/core/Tag/Tag.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { fireEvent, render } from '@testing-library/react'; -import * as React from 'react'; import { Tag } from './Tag.js'; diff --git a/packages/itwinui-react/src/core/Tag/TagContainer.test.tsx b/packages/itwinui-react/src/core/Tag/TagContainer.test.tsx index 571b7415a21..1f43f036dda 100644 --- a/packages/itwinui-react/src/core/Tag/TagContainer.test.tsx +++ b/packages/itwinui-react/src/core/Tag/TagContainer.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { Tag } from './Tag.js'; import { TagContainer } from './TagContainer.js'; diff --git a/packages/itwinui-react/src/core/Textarea/Textarea.test.tsx b/packages/itwinui-react/src/core/Textarea/Textarea.test.tsx index 4c032e6315d..ee137215867 100644 --- a/packages/itwinui-react/src/core/Textarea/Textarea.test.tsx +++ b/packages/itwinui-react/src/core/Textarea/Textarea.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Textarea } from './Textarea.js'; diff --git a/packages/itwinui-react/src/core/ThemeProvider/ThemeProvider.test.tsx b/packages/itwinui-react/src/core/ThemeProvider/ThemeProvider.test.tsx index c5d48bc514c..0a1299352eb 100644 --- a/packages/itwinui-react/src/core/ThemeProvider/ThemeProvider.test.tsx +++ b/packages/itwinui-react/src/core/ThemeProvider/ThemeProvider.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import * as UseMediaQuery from '../../utils/hooks/useMediaQuery.js'; diff --git a/packages/itwinui-react/src/core/Tile/Tile.test.tsx b/packages/itwinui-react/src/core/Tile/Tile.test.tsx index e50be1a1b50..ae35d5ee47f 100644 --- a/packages/itwinui-react/src/core/Tile/Tile.test.tsx +++ b/packages/itwinui-react/src/core/Tile/Tile.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { Tile } from './Tile.js'; diff --git a/packages/itwinui-react/src/core/TimePicker/TimePicker.test.tsx b/packages/itwinui-react/src/core/TimePicker/TimePicker.test.tsx index 2bd932d73f1..3c6589edbe9 100644 --- a/packages/itwinui-react/src/core/TimePicker/TimePicker.test.tsx +++ b/packages/itwinui-react/src/core/TimePicker/TimePicker.test.tsx @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { fireEvent, render, screen } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; -import * as React from 'react'; import { type MeridiemType, TimePicker } from './TimePicker.js'; it('should display passed time', () => { diff --git a/packages/itwinui-react/src/core/Toast/Toast.test.tsx b/packages/itwinui-react/src/core/Toast/Toast.test.tsx index 0893fce9e19..ab5a354d867 100644 --- a/packages/itwinui-react/src/core/Toast/Toast.test.tsx +++ b/packages/itwinui-react/src/core/Toast/Toast.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { act, render, type RenderResult } from '@testing-library/react'; -import * as React from 'react'; import { Toast, type ToastCategory } from './Toast.js'; import { SvgInfoCircular, diff --git a/packages/itwinui-react/src/core/Toast/Toaster.test.tsx b/packages/itwinui-react/src/core/Toast/Toaster.test.tsx index 04bbf9d80cc..e0ff6874ee4 100644 --- a/packages/itwinui-react/src/core/Toast/Toaster.test.tsx +++ b/packages/itwinui-react/src/core/Toast/Toaster.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { act, fireEvent, diff --git a/packages/itwinui-react/src/core/ToggleSwitch/ToggleSwitch.test.tsx b/packages/itwinui-react/src/core/ToggleSwitch/ToggleSwitch.test.tsx index 44027ac72c8..1496a72dfd0 100644 --- a/packages/itwinui-react/src/core/ToggleSwitch/ToggleSwitch.test.tsx +++ b/packages/itwinui-react/src/core/ToggleSwitch/ToggleSwitch.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { SvgMore as SvgPlaceholder } from '../../utils/index.js'; -import * as React from 'react'; import { render } from '@testing-library/react'; import { ToggleSwitch } from './ToggleSwitch.js'; diff --git a/packages/itwinui-react/src/core/TransferList/TransferList.test.tsx b/packages/itwinui-react/src/core/TransferList/TransferList.test.tsx index a0931561729..3eebb502c10 100644 --- a/packages/itwinui-react/src/core/TransferList/TransferList.test.tsx +++ b/packages/itwinui-react/src/core/TransferList/TransferList.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { fireEvent, render, screen } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; import { Button } from '../Buttons/Button.js'; diff --git a/packages/itwinui-react/src/core/TransferList/TransferList.tsx b/packages/itwinui-react/src/core/TransferList/TransferList.tsx index 4b514643f60..67e70d52373 100644 --- a/packages/itwinui-react/src/core/TransferList/TransferList.tsx +++ b/packages/itwinui-react/src/core/TransferList/TransferList.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import * as React from 'react'; import cx from 'classnames'; import { getFocusableElements, diff --git a/packages/itwinui-react/src/core/Tree/Tree.test.tsx b/packages/itwinui-react/src/core/Tree/Tree.test.tsx index 335c1453025..02f38b2d52e 100644 --- a/packages/itwinui-react/src/core/Tree/Tree.test.tsx +++ b/packages/itwinui-react/src/core/Tree/Tree.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { fireEvent, render } from '@testing-library/react'; import { diff --git a/packages/itwinui-react/src/core/Typography/Anchor.test.tsx b/packages/itwinui-react/src/core/Typography/Anchor.test.tsx index dfd17cd4f9d..f53092b9973 100644 --- a/packages/itwinui-react/src/core/Typography/Anchor.test.tsx +++ b/packages/itwinui-react/src/core/Typography/Anchor.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Anchor } from './Anchor.js'; diff --git a/packages/itwinui-react/src/core/Typography/Blockquote.test.tsx b/packages/itwinui-react/src/core/Typography/Blockquote.test.tsx index 44e19eb4f20..99f0268d451 100644 --- a/packages/itwinui-react/src/core/Typography/Blockquote.test.tsx +++ b/packages/itwinui-react/src/core/Typography/Blockquote.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Blockquote } from './Blockquote.js'; diff --git a/packages/itwinui-react/src/core/Typography/Code.test.tsx b/packages/itwinui-react/src/core/Typography/Code.test.tsx index 276fa603488..be652a1f94a 100644 --- a/packages/itwinui-react/src/core/Typography/Code.test.tsx +++ b/packages/itwinui-react/src/core/Typography/Code.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Code } from './Code.js'; diff --git a/packages/itwinui-react/src/core/Typography/Kbd.test.tsx b/packages/itwinui-react/src/core/Typography/Kbd.test.tsx index ba2f618e44e..b14f51d9bbc 100644 --- a/packages/itwinui-react/src/core/Typography/Kbd.test.tsx +++ b/packages/itwinui-react/src/core/Typography/Kbd.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { Kbd, KbdKeys } from './Kbd.js'; diff --git a/packages/itwinui-react/src/core/Typography/Text.test.tsx b/packages/itwinui-react/src/core/Typography/Text.test.tsx index 4fd5e4cd27c..c76fcfb5546 100644 --- a/packages/itwinui-react/src/core/Typography/Text.test.tsx +++ b/packages/itwinui-react/src/core/Typography/Text.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { Text } from './Text.js'; it('should render in the most basic state', () => { diff --git a/packages/itwinui-react/src/core/VisuallyHidden/VisuallyHidden.test.tsx b/packages/itwinui-react/src/core/VisuallyHidden/VisuallyHidden.test.tsx index cc1e10709e7..2b76c222613 100644 --- a/packages/itwinui-react/src/core/VisuallyHidden/VisuallyHidden.test.tsx +++ b/packages/itwinui-react/src/core/VisuallyHidden/VisuallyHidden.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { act, render } from '@testing-library/react'; import { VisuallyHidden } from './VisuallyHidden.js'; diff --git a/packages/itwinui-react/src/utils/components/ButtonBase.test.tsx b/packages/itwinui-react/src/utils/components/ButtonBase.test.tsx index daece599b74..f71d7dd00ff 100644 --- a/packages/itwinui-react/src/utils/components/ButtonBase.test.tsx +++ b/packages/itwinui-react/src/utils/components/ButtonBase.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import * as ReactDOMServer from 'react-dom/server'; import { render } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; diff --git a/packages/itwinui-react/src/utils/components/FocusTrap.test.tsx b/packages/itwinui-react/src/utils/components/FocusTrap.test.tsx index 0518526943e..f12c86b829d 100644 --- a/packages/itwinui-react/src/utils/components/FocusTrap.test.tsx +++ b/packages/itwinui-react/src/utils/components/FocusTrap.test.tsx @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { FocusTrap } from './FocusTrap.js'; it('should focus trap in element', () => { diff --git a/packages/itwinui-react/src/utils/components/InputFlexContainer.test.tsx b/packages/itwinui-react/src/utils/components/InputFlexContainer.test.tsx index 95ad90a0328..c5a709a2a4f 100644 --- a/packages/itwinui-react/src/utils/components/InputFlexContainer.test.tsx +++ b/packages/itwinui-react/src/utils/components/InputFlexContainer.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; import { render } from '@testing-library/react'; import { InputFlexContainer } from './InputFlexContainer.js'; diff --git a/packages/itwinui-react/src/utils/components/InputFlexContainer.tsx b/packages/itwinui-react/src/utils/components/InputFlexContainer.tsx index e002f97f7ce..46e6a97619e 100644 --- a/packages/itwinui-react/src/utils/components/InputFlexContainer.tsx +++ b/packages/itwinui-react/src/utils/components/InputFlexContainer.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import React from 'react'; +import * as React from 'react'; import cx from 'classnames'; import type { PolymorphicForwardRefComponent } from '../props.js'; import { Box } from './Box.js'; diff --git a/packages/itwinui-react/src/utils/components/MiddleTextTruncation.test.tsx b/packages/itwinui-react/src/utils/components/MiddleTextTruncation.test.tsx index 38ad0ec46f7..4393d666e8a 100644 --- a/packages/itwinui-react/src/utils/components/MiddleTextTruncation.test.tsx +++ b/packages/itwinui-react/src/utils/components/MiddleTextTruncation.test.tsx @@ -3,7 +3,6 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import { render } from '@testing-library/react'; -import * as React from 'react'; import { MiddleTextTruncation } from './MiddleTextTruncation.js'; import * as UseOverflow from '../hooks/useOverflow.js'; diff --git a/packages/itwinui-react/src/utils/components/ShadowRoot.test.tsx b/packages/itwinui-react/src/utils/components/ShadowRoot.test.tsx index a6d3b3543d1..41adf872dff 100644 --- a/packages/itwinui-react/src/utils/components/ShadowRoot.test.tsx +++ b/packages/itwinui-react/src/utils/components/ShadowRoot.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, act } from '@testing-library/react'; import { ShadowRoot } from './ShadowRoot.js'; diff --git a/packages/itwinui-react/src/utils/components/VirtualScroll.test.tsx b/packages/itwinui-react/src/utils/components/VirtualScroll.test.tsx index 87fe59c6bb2..d153fe2b08e 100644 --- a/packages/itwinui-react/src/utils/components/VirtualScroll.test.tsx +++ b/packages/itwinui-react/src/utils/components/VirtualScroll.test.tsx @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { act, fireEvent, render } from '@testing-library/react'; -import * as React from 'react'; import { VirtualScroll } from './VirtualScroll.js'; import * as UseResizeObserver from '../hooks/useResizeObserver.js'; import { useVirtualization } from './index.js'; diff --git a/packages/itwinui-react/src/utils/functions/dom.test.tsx b/packages/itwinui-react/src/utils/functions/dom.test.tsx index 56e4baf46c4..c888bddd676 100644 --- a/packages/itwinui-react/src/utils/functions/dom.test.tsx +++ b/packages/itwinui-react/src/utils/functions/dom.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render, screen } from '@testing-library/react'; import { getDocument, getWindow, mergeEventHandlers } from './dom.js'; diff --git a/packages/itwinui-react/src/utils/functions/polymorphic.test.tsx b/packages/itwinui-react/src/utils/functions/polymorphic.test.tsx index ce01d9136d1..629b2e9a35e 100644 --- a/packages/itwinui-react/src/utils/functions/polymorphic.test.tsx +++ b/packages/itwinui-react/src/utils/functions/polymorphic.test.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { render } from '@testing-library/react'; import { polymorphic } from './polymorphic.js'; diff --git a/packages/itwinui-react/src/utils/icons/StatusIconMap.tsx b/packages/itwinui-react/src/utils/icons/StatusIconMap.tsx index 3d1f43fc56e..1358b9f31fa 100644 --- a/packages/itwinui-react/src/utils/icons/StatusIconMap.tsx +++ b/packages/itwinui-react/src/utils/icons/StatusIconMap.tsx @@ -2,7 +2,6 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as React from 'react'; import { SvgInfoCircular } from './SvgInfoCircular.js'; import { SvgStatusError } from './SvgStatusError.js'; import { SvgStatusSuccess } from './SvgStatusSuccess.js'; diff --git a/packages/itwinui-react/tsconfig.json b/packages/itwinui-react/tsconfig.json index d3920d04066..0be0dd97737 100644 --- a/packages/itwinui-react/tsconfig.json +++ b/packages/itwinui-react/tsconfig.json @@ -8,7 +8,7 @@ "esModuleInterop": true, "sourceMap": false, "allowJs": false, - "jsx": "react", + "jsx": "react-jsx", "moduleResolution": "NodeNext", "traceResolution": false, "forceConsistentCasingInFileNames": true, @@ -21,10 +21,7 @@ "skipLibCheck": true, "isolatedModules": true, "verbatimModuleSyntax": true, - "types": [ - "vitest/globals", - "@testing-library/jest-dom/vitest" - ], + "types": ["vitest/globals", "@testing-library/jest-dom/vitest"], "baseUrl": ".", "paths": { // This is only to avoid the missing types error when importing non-types from `react-table`